Cesium.d.ts 2.1 MB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613161416151616161716181619162016211622162316241625162616271628162916301631163216331634163516361637163816391640164116421643164416451646164716481649165016511652165316541655165616571658165916601661166216631664166516661667166816691670167116721673167416751676167716781679168016811682168316841685168616871688168916901691169216931694169516961697169816991700170117021703170417051706170717081709171017111712171317141715171617171718171917201721172217231724172517261727172817291730173117321733173417351736173717381739174017411742174317441745174617471748174917501751175217531754175517561757175817591760176117621763176417651766176717681769177017711772177317741775177617771778177917801781178217831784178517861787178817891790179117921793179417951796179717981799180018011802180318041805180618071808180918101811181218131814181518161817181818191820182118221823182418251826182718281829183018311832183318341835183618371838183918401841184218431844184518461847184818491850185118521853185418551856185718581859186018611862186318641865186618671868186918701871187218731874187518761877187818791880188118821883188418851886188718881889189018911892189318941895189618971898189919001901190219031904190519061907190819091910191119121913191419151916191719181919192019211922192319241925192619271928192919301931193219331934193519361937193819391940194119421943194419451946194719481949195019511952195319541955195619571958195919601961196219631964196519661967196819691970197119721973197419751976197719781979198019811982198319841985198619871988198919901991199219931994199519961997199819992000200120022003200420052006200720082009201020112012201320142015201620172018201920202021202220232024202520262027202820292030203120322033203420352036203720382039204020412042204320442045204620472048204920502051205220532054205520562057205820592060206120622063206420652066206720682069207020712072207320742075207620772078207920802081208220832084208520862087208820892090209120922093209420952096209720982099210021012102210321042105210621072108210921102111211221132114211521162117211821192120212121222123212421252126212721282129213021312132213321342135213621372138213921402141214221432144214521462147214821492150215121522153215421552156215721582159216021612162216321642165216621672168216921702171217221732174217521762177217821792180218121822183218421852186218721882189219021912192219321942195219621972198219922002201220222032204220522062207220822092210221122122213221422152216221722182219222022212222222322242225222622272228222922302231223222332234223522362237223822392240224122422243224422452246224722482249225022512252225322542255225622572258225922602261226222632264226522662267226822692270227122722273227422752276227722782279228022812282228322842285228622872288228922902291229222932294229522962297229822992300230123022303230423052306230723082309231023112312231323142315231623172318231923202321232223232324232523262327232823292330233123322333233423352336233723382339234023412342234323442345234623472348234923502351235223532354235523562357235823592360236123622363236423652366236723682369237023712372237323742375237623772378237923802381238223832384238523862387238823892390239123922393239423952396239723982399240024012402240324042405240624072408240924102411241224132414241524162417241824192420242124222423242424252426242724282429243024312432243324342435243624372438243924402441244224432444244524462447244824492450245124522453245424552456245724582459246024612462246324642465246624672468246924702471247224732474247524762477247824792480248124822483248424852486248724882489249024912492249324942495249624972498249925002501250225032504250525062507250825092510251125122513251425152516251725182519252025212522252325242525252625272528252925302531253225332534253525362537253825392540254125422543254425452546254725482549255025512552255325542555255625572558255925602561256225632564256525662567256825692570257125722573257425752576257725782579258025812582258325842585258625872588258925902591259225932594259525962597259825992600260126022603260426052606260726082609261026112612261326142615261626172618261926202621262226232624262526262627262826292630263126322633263426352636263726382639264026412642264326442645264626472648264926502651265226532654265526562657265826592660266126622663266426652666266726682669267026712672267326742675267626772678267926802681268226832684268526862687268826892690269126922693269426952696269726982699270027012702270327042705270627072708270927102711271227132714271527162717271827192720272127222723272427252726272727282729273027312732273327342735273627372738273927402741274227432744274527462747274827492750275127522753275427552756275727582759276027612762276327642765276627672768276927702771277227732774277527762777277827792780278127822783278427852786278727882789279027912792279327942795279627972798279928002801280228032804280528062807280828092810281128122813281428152816281728182819282028212822282328242825282628272828282928302831283228332834283528362837283828392840284128422843284428452846284728482849285028512852285328542855285628572858285928602861286228632864286528662867286828692870287128722873287428752876287728782879288028812882288328842885288628872888288928902891289228932894289528962897289828992900290129022903290429052906290729082909291029112912291329142915291629172918291929202921292229232924292529262927292829292930293129322933293429352936293729382939294029412942294329442945294629472948294929502951295229532954295529562957295829592960296129622963296429652966296729682969297029712972297329742975297629772978297929802981298229832984298529862987298829892990299129922993299429952996299729982999300030013002300330043005300630073008300930103011301230133014301530163017301830193020302130223023302430253026302730283029303030313032303330343035303630373038303930403041304230433044304530463047304830493050305130523053305430553056305730583059306030613062306330643065306630673068306930703071307230733074307530763077307830793080308130823083308430853086308730883089309030913092309330943095309630973098309931003101310231033104310531063107310831093110311131123113311431153116311731183119312031213122312331243125312631273128312931303131313231333134313531363137313831393140314131423143314431453146314731483149315031513152315331543155315631573158315931603161316231633164316531663167316831693170317131723173317431753176317731783179318031813182318331843185318631873188318931903191319231933194319531963197319831993200320132023203320432053206320732083209321032113212321332143215321632173218321932203221322232233224322532263227322832293230323132323233323432353236323732383239324032413242324332443245324632473248324932503251325232533254325532563257325832593260326132623263326432653266326732683269327032713272327332743275327632773278327932803281328232833284328532863287328832893290329132923293329432953296329732983299330033013302330333043305330633073308330933103311331233133314331533163317331833193320332133223323332433253326332733283329333033313332333333343335333633373338333933403341334233433344334533463347334833493350335133523353335433553356335733583359336033613362336333643365336633673368336933703371337233733374337533763377337833793380338133823383338433853386338733883389339033913392339333943395339633973398339934003401340234033404340534063407340834093410341134123413341434153416341734183419342034213422342334243425342634273428342934303431343234333434343534363437343834393440344134423443344434453446344734483449345034513452345334543455345634573458345934603461346234633464346534663467346834693470347134723473347434753476347734783479348034813482348334843485348634873488348934903491349234933494349534963497349834993500350135023503350435053506350735083509351035113512351335143515351635173518351935203521352235233524352535263527352835293530353135323533353435353536353735383539354035413542354335443545354635473548354935503551355235533554355535563557355835593560356135623563356435653566356735683569357035713572357335743575357635773578357935803581358235833584358535863587358835893590359135923593359435953596359735983599360036013602360336043605360636073608360936103611361236133614361536163617361836193620362136223623362436253626362736283629363036313632363336343635363636373638363936403641364236433644364536463647364836493650365136523653365436553656365736583659366036613662366336643665366636673668366936703671367236733674367536763677367836793680368136823683368436853686368736883689369036913692369336943695369636973698369937003701370237033704370537063707370837093710371137123713371437153716371737183719372037213722372337243725372637273728372937303731373237333734373537363737373837393740374137423743374437453746374737483749375037513752375337543755375637573758375937603761376237633764376537663767376837693770377137723773377437753776377737783779378037813782378337843785378637873788378937903791379237933794379537963797379837993800380138023803380438053806380738083809381038113812381338143815381638173818381938203821382238233824382538263827382838293830383138323833383438353836383738383839384038413842384338443845384638473848384938503851385238533854385538563857385838593860386138623863386438653866386738683869387038713872387338743875387638773878387938803881388238833884388538863887388838893890389138923893389438953896389738983899390039013902390339043905390639073908390939103911391239133914391539163917391839193920392139223923392439253926392739283929393039313932393339343935393639373938393939403941394239433944394539463947394839493950395139523953395439553956395739583959396039613962396339643965396639673968396939703971397239733974397539763977397839793980398139823983398439853986398739883989399039913992399339943995399639973998399940004001400240034004400540064007400840094010401140124013401440154016401740184019402040214022402340244025402640274028402940304031403240334034403540364037403840394040404140424043404440454046404740484049405040514052405340544055405640574058405940604061406240634064406540664067406840694070407140724073407440754076407740784079408040814082408340844085408640874088408940904091409240934094409540964097409840994100410141024103410441054106410741084109411041114112411341144115411641174118411941204121412241234124412541264127412841294130413141324133413441354136413741384139414041414142414341444145414641474148414941504151415241534154415541564157415841594160416141624163416441654166416741684169417041714172417341744175417641774178417941804181418241834184418541864187418841894190419141924193419441954196419741984199420042014202420342044205420642074208420942104211421242134214421542164217421842194220422142224223422442254226422742284229423042314232423342344235423642374238423942404241424242434244424542464247424842494250425142524253425442554256425742584259426042614262426342644265426642674268426942704271427242734274427542764277427842794280428142824283428442854286428742884289429042914292429342944295429642974298429943004301430243034304430543064307430843094310431143124313431443154316431743184319432043214322432343244325432643274328432943304331433243334334433543364337433843394340434143424343434443454346434743484349435043514352435343544355435643574358435943604361436243634364436543664367436843694370437143724373437443754376437743784379438043814382438343844385438643874388438943904391439243934394439543964397439843994400440144024403440444054406440744084409441044114412441344144415441644174418441944204421442244234424442544264427442844294430443144324433443444354436443744384439444044414442444344444445444644474448444944504451445244534454445544564457445844594460446144624463446444654466446744684469447044714472447344744475447644774478447944804481448244834484448544864487448844894490449144924493449444954496449744984499450045014502450345044505450645074508450945104511451245134514451545164517451845194520452145224523452445254526452745284529453045314532453345344535453645374538453945404541454245434544454545464547454845494550455145524553455445554556455745584559456045614562456345644565456645674568456945704571457245734574457545764577457845794580458145824583458445854586458745884589459045914592459345944595459645974598459946004601460246034604460546064607460846094610461146124613461446154616461746184619462046214622462346244625462646274628462946304631463246334634463546364637463846394640464146424643464446454646464746484649465046514652465346544655465646574658465946604661466246634664466546664667466846694670467146724673467446754676467746784679468046814682468346844685468646874688468946904691469246934694469546964697469846994700470147024703470447054706470747084709471047114712471347144715471647174718471947204721472247234724472547264727472847294730473147324733473447354736473747384739474047414742474347444745474647474748474947504751475247534754475547564757475847594760476147624763476447654766476747684769477047714772477347744775477647774778477947804781478247834784478547864787478847894790479147924793479447954796479747984799480048014802480348044805480648074808480948104811481248134814481548164817481848194820482148224823482448254826482748284829483048314832483348344835483648374838483948404841484248434844484548464847484848494850485148524853485448554856485748584859486048614862486348644865486648674868486948704871487248734874487548764877487848794880488148824883488448854886488748884889489048914892489348944895489648974898489949004901490249034904490549064907490849094910491149124913491449154916491749184919492049214922492349244925492649274928492949304931493249334934493549364937493849394940494149424943494449454946494749484949495049514952495349544955495649574958495949604961496249634964496549664967496849694970497149724973497449754976497749784979498049814982498349844985498649874988498949904991499249934994499549964997499849995000500150025003500450055006500750085009501050115012501350145015501650175018501950205021502250235024502550265027502850295030503150325033503450355036503750385039504050415042504350445045504650475048504950505051505250535054505550565057505850595060506150625063506450655066506750685069507050715072507350745075507650775078507950805081508250835084508550865087508850895090509150925093509450955096509750985099510051015102510351045105510651075108510951105111511251135114511551165117511851195120512151225123512451255126512751285129513051315132513351345135513651375138513951405141514251435144514551465147514851495150515151525153515451555156515751585159516051615162516351645165516651675168516951705171517251735174517551765177517851795180518151825183518451855186518751885189519051915192519351945195519651975198519952005201520252035204520552065207520852095210521152125213521452155216521752185219522052215222522352245225522652275228522952305231523252335234523552365237523852395240524152425243524452455246524752485249525052515252525352545255525652575258525952605261526252635264526552665267526852695270527152725273527452755276527752785279528052815282528352845285528652875288528952905291529252935294529552965297529852995300530153025303530453055306530753085309531053115312531353145315531653175318531953205321532253235324532553265327532853295330533153325333533453355336533753385339534053415342534353445345534653475348534953505351535253535354535553565357535853595360536153625363536453655366536753685369537053715372537353745375537653775378537953805381538253835384538553865387538853895390539153925393539453955396539753985399540054015402540354045405540654075408540954105411541254135414541554165417541854195420542154225423542454255426542754285429543054315432543354345435543654375438543954405441544254435444544554465447544854495450545154525453545454555456545754585459546054615462546354645465546654675468546954705471547254735474547554765477547854795480548154825483548454855486548754885489549054915492549354945495549654975498549955005501550255035504550555065507550855095510551155125513551455155516551755185519552055215522552355245525552655275528552955305531553255335534553555365537553855395540554155425543554455455546554755485549555055515552555355545555555655575558555955605561556255635564556555665567556855695570557155725573557455755576557755785579558055815582558355845585558655875588558955905591559255935594559555965597559855995600560156025603560456055606560756085609561056115612561356145615561656175618561956205621562256235624562556265627562856295630563156325633563456355636563756385639564056415642564356445645564656475648564956505651565256535654565556565657565856595660566156625663566456655666566756685669567056715672567356745675567656775678567956805681568256835684568556865687568856895690569156925693569456955696569756985699570057015702570357045705570657075708570957105711571257135714571557165717571857195720572157225723572457255726572757285729573057315732573357345735573657375738573957405741574257435744574557465747574857495750575157525753575457555756575757585759576057615762576357645765576657675768576957705771577257735774577557765777577857795780578157825783578457855786578757885789579057915792579357945795579657975798579958005801580258035804580558065807580858095810581158125813581458155816581758185819582058215822582358245825582658275828582958305831583258335834583558365837583858395840584158425843584458455846584758485849585058515852585358545855585658575858585958605861586258635864586558665867586858695870587158725873587458755876587758785879588058815882588358845885588658875888588958905891589258935894589558965897589858995900590159025903590459055906590759085909591059115912591359145915591659175918591959205921592259235924592559265927592859295930593159325933593459355936593759385939594059415942594359445945594659475948594959505951595259535954595559565957595859595960596159625963596459655966596759685969597059715972597359745975597659775978597959805981598259835984598559865987598859895990599159925993599459955996599759985999600060016002600360046005600660076008600960106011601260136014601560166017601860196020602160226023602460256026602760286029603060316032603360346035603660376038603960406041604260436044604560466047604860496050605160526053605460556056605760586059606060616062606360646065606660676068606960706071607260736074607560766077607860796080608160826083608460856086608760886089609060916092609360946095609660976098609961006101610261036104610561066107610861096110611161126113611461156116611761186119612061216122612361246125612661276128612961306131613261336134613561366137613861396140614161426143614461456146614761486149615061516152615361546155615661576158615961606161616261636164616561666167616861696170617161726173617461756176617761786179618061816182618361846185618661876188618961906191619261936194619561966197619861996200620162026203620462056206620762086209621062116212621362146215621662176218621962206221622262236224622562266227622862296230623162326233623462356236623762386239624062416242624362446245624662476248624962506251625262536254625562566257625862596260626162626263626462656266626762686269627062716272627362746275627662776278627962806281628262836284628562866287628862896290629162926293629462956296629762986299630063016302630363046305630663076308630963106311631263136314631563166317631863196320632163226323632463256326632763286329633063316332633363346335633663376338633963406341634263436344634563466347634863496350635163526353635463556356635763586359636063616362636363646365636663676368636963706371637263736374637563766377637863796380638163826383638463856386638763886389639063916392639363946395639663976398639964006401640264036404640564066407640864096410641164126413641464156416641764186419642064216422642364246425642664276428642964306431643264336434643564366437643864396440644164426443644464456446644764486449645064516452645364546455645664576458645964606461646264636464646564666467646864696470647164726473647464756476647764786479648064816482648364846485648664876488648964906491649264936494649564966497649864996500650165026503650465056506650765086509651065116512651365146515651665176518651965206521652265236524652565266527652865296530653165326533653465356536653765386539654065416542654365446545654665476548654965506551655265536554655565566557655865596560656165626563656465656566656765686569657065716572657365746575657665776578657965806581658265836584658565866587658865896590659165926593659465956596659765986599660066016602660366046605660666076608660966106611661266136614661566166617661866196620662166226623662466256626662766286629663066316632663366346635663666376638663966406641664266436644664566466647664866496650665166526653665466556656665766586659666066616662666366646665666666676668666966706671667266736674667566766677667866796680668166826683668466856686668766886689669066916692669366946695669666976698669967006701670267036704670567066707670867096710671167126713671467156716671767186719672067216722672367246725672667276728672967306731673267336734673567366737673867396740674167426743674467456746674767486749675067516752675367546755675667576758675967606761676267636764676567666767676867696770677167726773677467756776677767786779678067816782678367846785678667876788678967906791679267936794679567966797679867996800680168026803680468056806680768086809681068116812681368146815681668176818681968206821682268236824682568266827682868296830683168326833683468356836683768386839684068416842684368446845684668476848684968506851685268536854685568566857685868596860686168626863686468656866686768686869687068716872687368746875687668776878687968806881688268836884688568866887688868896890689168926893689468956896689768986899690069016902690369046905690669076908690969106911691269136914691569166917691869196920692169226923692469256926692769286929693069316932693369346935693669376938693969406941694269436944694569466947694869496950695169526953695469556956695769586959696069616962696369646965696669676968696969706971697269736974697569766977697869796980698169826983698469856986698769886989699069916992699369946995699669976998699970007001700270037004700570067007700870097010701170127013701470157016701770187019702070217022702370247025702670277028702970307031703270337034703570367037703870397040704170427043704470457046704770487049705070517052705370547055705670577058705970607061706270637064706570667067706870697070707170727073707470757076707770787079708070817082708370847085708670877088708970907091709270937094709570967097709870997100710171027103710471057106710771087109711071117112711371147115711671177118711971207121712271237124712571267127712871297130713171327133713471357136713771387139714071417142714371447145714671477148714971507151715271537154715571567157715871597160716171627163716471657166716771687169717071717172717371747175717671777178717971807181718271837184718571867187718871897190719171927193719471957196719771987199720072017202720372047205720672077208720972107211721272137214721572167217721872197220722172227223722472257226722772287229723072317232723372347235723672377238723972407241724272437244724572467247724872497250725172527253725472557256725772587259726072617262726372647265726672677268726972707271727272737274727572767277727872797280728172827283728472857286728772887289729072917292729372947295729672977298729973007301730273037304730573067307730873097310731173127313731473157316731773187319732073217322732373247325732673277328732973307331733273337334733573367337733873397340734173427343734473457346734773487349735073517352735373547355735673577358735973607361736273637364736573667367736873697370737173727373737473757376737773787379738073817382738373847385738673877388738973907391739273937394739573967397739873997400740174027403740474057406740774087409741074117412741374147415741674177418741974207421742274237424742574267427742874297430743174327433743474357436743774387439744074417442744374447445744674477448744974507451745274537454745574567457745874597460746174627463746474657466746774687469747074717472747374747475747674777478747974807481748274837484748574867487748874897490749174927493749474957496749774987499750075017502750375047505750675077508750975107511751275137514751575167517751875197520752175227523752475257526752775287529753075317532753375347535753675377538753975407541754275437544754575467547754875497550755175527553755475557556755775587559756075617562756375647565756675677568756975707571757275737574757575767577757875797580758175827583758475857586758775887589759075917592759375947595759675977598759976007601760276037604760576067607760876097610761176127613761476157616761776187619762076217622762376247625762676277628762976307631763276337634763576367637763876397640764176427643764476457646764776487649765076517652765376547655765676577658765976607661766276637664766576667667766876697670767176727673767476757676767776787679768076817682768376847685768676877688768976907691769276937694769576967697769876997700770177027703770477057706770777087709771077117712771377147715771677177718771977207721772277237724772577267727772877297730773177327733773477357736773777387739774077417742774377447745774677477748774977507751775277537754775577567757775877597760776177627763776477657766776777687769777077717772777377747775777677777778777977807781778277837784778577867787778877897790779177927793779477957796779777987799780078017802780378047805780678077808780978107811781278137814781578167817781878197820782178227823782478257826782778287829783078317832783378347835783678377838783978407841784278437844784578467847784878497850785178527853785478557856785778587859786078617862786378647865786678677868786978707871787278737874787578767877787878797880788178827883788478857886788778887889789078917892789378947895789678977898789979007901790279037904790579067907790879097910791179127913791479157916791779187919792079217922792379247925792679277928792979307931793279337934793579367937793879397940794179427943794479457946794779487949795079517952795379547955795679577958795979607961796279637964796579667967796879697970797179727973797479757976797779787979798079817982798379847985798679877988798979907991799279937994799579967997799879998000800180028003800480058006800780088009801080118012801380148015801680178018801980208021802280238024802580268027802880298030803180328033803480358036803780388039804080418042804380448045804680478048804980508051805280538054805580568057805880598060806180628063806480658066806780688069807080718072807380748075807680778078807980808081808280838084808580868087808880898090809180928093809480958096809780988099810081018102810381048105810681078108810981108111811281138114811581168117811881198120812181228123812481258126812781288129813081318132813381348135813681378138813981408141814281438144814581468147814881498150815181528153815481558156815781588159816081618162816381648165816681678168816981708171817281738174817581768177817881798180818181828183818481858186818781888189819081918192819381948195819681978198819982008201820282038204820582068207820882098210821182128213821482158216821782188219822082218222822382248225822682278228822982308231823282338234823582368237823882398240824182428243824482458246824782488249825082518252825382548255825682578258825982608261826282638264826582668267826882698270827182728273827482758276827782788279828082818282828382848285828682878288828982908291829282938294829582968297829882998300830183028303830483058306830783088309831083118312831383148315831683178318831983208321832283238324832583268327832883298330833183328333833483358336833783388339834083418342834383448345834683478348834983508351835283538354835583568357835883598360836183628363836483658366836783688369837083718372837383748375837683778378837983808381838283838384838583868387838883898390839183928393839483958396839783988399840084018402840384048405840684078408840984108411841284138414841584168417841884198420842184228423842484258426842784288429843084318432843384348435843684378438843984408441844284438444844584468447844884498450845184528453845484558456845784588459846084618462846384648465846684678468846984708471847284738474847584768477847884798480848184828483848484858486848784888489849084918492849384948495849684978498849985008501850285038504850585068507850885098510851185128513851485158516851785188519852085218522852385248525852685278528852985308531853285338534853585368537853885398540854185428543854485458546854785488549855085518552855385548555855685578558855985608561856285638564856585668567856885698570857185728573857485758576857785788579858085818582858385848585858685878588858985908591859285938594859585968597859885998600860186028603860486058606860786088609861086118612861386148615861686178618861986208621862286238624862586268627862886298630863186328633863486358636863786388639864086418642864386448645864686478648864986508651865286538654865586568657865886598660866186628663866486658666866786688669867086718672867386748675867686778678867986808681868286838684868586868687868886898690869186928693869486958696869786988699870087018702870387048705870687078708870987108711871287138714871587168717871887198720872187228723872487258726872787288729873087318732873387348735873687378738873987408741874287438744874587468747874887498750875187528753875487558756875787588759876087618762876387648765876687678768876987708771877287738774877587768777877887798780878187828783878487858786878787888789879087918792879387948795879687978798879988008801880288038804880588068807880888098810881188128813881488158816881788188819882088218822882388248825882688278828882988308831883288338834883588368837883888398840884188428843884488458846884788488849885088518852885388548855885688578858885988608861886288638864886588668867886888698870887188728873887488758876887788788879888088818882888388848885888688878888888988908891889288938894889588968897889888998900890189028903890489058906890789088909891089118912891389148915891689178918891989208921892289238924892589268927892889298930893189328933893489358936893789388939894089418942894389448945894689478948894989508951895289538954895589568957895889598960896189628963896489658966896789688969897089718972897389748975897689778978897989808981898289838984898589868987898889898990899189928993899489958996899789988999900090019002900390049005900690079008900990109011901290139014901590169017901890199020902190229023902490259026902790289029903090319032903390349035903690379038903990409041904290439044904590469047904890499050905190529053905490559056905790589059906090619062906390649065906690679068906990709071907290739074907590769077907890799080908190829083908490859086908790889089909090919092909390949095909690979098909991009101910291039104910591069107910891099110911191129113911491159116911791189119912091219122912391249125912691279128912991309131913291339134913591369137913891399140914191429143914491459146914791489149915091519152915391549155915691579158915991609161916291639164916591669167916891699170917191729173917491759176917791789179918091819182918391849185918691879188918991909191919291939194919591969197919891999200920192029203920492059206920792089209921092119212921392149215921692179218921992209221922292239224922592269227922892299230923192329233923492359236923792389239924092419242924392449245924692479248924992509251925292539254925592569257925892599260926192629263926492659266926792689269927092719272927392749275927692779278927992809281928292839284928592869287928892899290929192929293929492959296929792989299930093019302930393049305930693079308930993109311931293139314931593169317931893199320932193229323932493259326932793289329933093319332933393349335933693379338933993409341934293439344934593469347934893499350935193529353935493559356935793589359936093619362936393649365936693679368936993709371937293739374937593769377937893799380938193829383938493859386938793889389939093919392939393949395939693979398939994009401940294039404940594069407940894099410941194129413941494159416941794189419942094219422942394249425942694279428942994309431943294339434943594369437943894399440944194429443944494459446944794489449945094519452945394549455945694579458945994609461946294639464946594669467946894699470947194729473947494759476947794789479948094819482948394849485948694879488948994909491949294939494949594969497949894999500950195029503950495059506950795089509951095119512951395149515951695179518951995209521952295239524952595269527952895299530953195329533953495359536953795389539954095419542954395449545954695479548954995509551955295539554955595569557955895599560956195629563956495659566956795689569957095719572957395749575957695779578957995809581958295839584958595869587958895899590959195929593959495959596959795989599960096019602960396049605960696079608960996109611961296139614961596169617961896199620962196229623962496259626962796289629963096319632963396349635963696379638963996409641964296439644964596469647964896499650965196529653965496559656965796589659966096619662966396649665966696679668966996709671967296739674967596769677967896799680968196829683968496859686968796889689969096919692969396949695969696979698969997009701970297039704970597069707970897099710971197129713971497159716971797189719972097219722972397249725972697279728972997309731973297339734973597369737973897399740974197429743974497459746974797489749975097519752975397549755975697579758975997609761976297639764976597669767976897699770977197729773977497759776977797789779978097819782978397849785978697879788978997909791979297939794979597969797979897999800980198029803980498059806980798089809981098119812981398149815981698179818981998209821982298239824982598269827982898299830983198329833983498359836983798389839984098419842984398449845984698479848984998509851985298539854985598569857985898599860986198629863986498659866986798689869987098719872987398749875987698779878987998809881988298839884988598869887988898899890989198929893989498959896989798989899990099019902990399049905990699079908990999109911991299139914991599169917991899199920992199229923992499259926992799289929993099319932993399349935993699379938993999409941994299439944994599469947994899499950995199529953995499559956995799589959996099619962996399649965996699679968996999709971997299739974997599769977997899799980998199829983998499859986998799889989999099919992999399949995999699979998999910000100011000210003100041000510006100071000810009100101001110012100131001410015100161001710018100191002010021100221002310024100251002610027100281002910030100311003210033100341003510036100371003810039100401004110042100431004410045100461004710048100491005010051100521005310054100551005610057100581005910060100611006210063100641006510066100671006810069100701007110072100731007410075100761007710078100791008010081100821008310084100851008610087100881008910090100911009210093100941009510096100971009810099101001010110102101031010410105101061010710108101091011010111101121011310114101151011610117101181011910120101211012210123101241012510126101271012810129101301013110132101331013410135101361013710138101391014010141101421014310144101451014610147101481014910150101511015210153101541015510156101571015810159101601016110162101631016410165101661016710168101691017010171101721017310174101751017610177101781017910180101811018210183101841018510186101871018810189101901019110192101931019410195101961019710198101991020010201102021020310204102051020610207102081020910210102111021210213102141021510216102171021810219102201022110222102231022410225102261022710228102291023010231102321023310234102351023610237102381023910240102411024210243102441024510246102471024810249102501025110252102531025410255102561025710258102591026010261102621026310264102651026610267102681026910270102711027210273102741027510276102771027810279102801028110282102831028410285102861028710288102891029010291102921029310294102951029610297102981029910300103011030210303103041030510306103071030810309103101031110312103131031410315103161031710318103191032010321103221032310324103251032610327103281032910330103311033210333103341033510336103371033810339103401034110342103431034410345103461034710348103491035010351103521035310354103551035610357103581035910360103611036210363103641036510366103671036810369103701037110372103731037410375103761037710378103791038010381103821038310384103851038610387103881038910390103911039210393103941039510396103971039810399104001040110402104031040410405104061040710408104091041010411104121041310414104151041610417104181041910420104211042210423104241042510426104271042810429104301043110432104331043410435104361043710438104391044010441104421044310444104451044610447104481044910450104511045210453104541045510456104571045810459104601046110462104631046410465104661046710468104691047010471104721047310474104751047610477104781047910480104811048210483104841048510486104871048810489104901049110492104931049410495104961049710498104991050010501105021050310504105051050610507105081050910510105111051210513105141051510516105171051810519105201052110522105231052410525105261052710528105291053010531105321053310534105351053610537105381053910540105411054210543105441054510546105471054810549105501055110552105531055410555105561055710558105591056010561105621056310564105651056610567105681056910570105711057210573105741057510576105771057810579105801058110582105831058410585105861058710588105891059010591105921059310594105951059610597105981059910600106011060210603106041060510606106071060810609106101061110612106131061410615106161061710618106191062010621106221062310624106251062610627106281062910630106311063210633106341063510636106371063810639106401064110642106431064410645106461064710648106491065010651106521065310654106551065610657106581065910660106611066210663106641066510666106671066810669106701067110672106731067410675106761067710678106791068010681106821068310684106851068610687106881068910690106911069210693106941069510696106971069810699107001070110702107031070410705107061070710708107091071010711107121071310714107151071610717107181071910720107211072210723107241072510726107271072810729107301073110732107331073410735107361073710738107391074010741107421074310744107451074610747107481074910750107511075210753107541075510756107571075810759107601076110762107631076410765107661076710768107691077010771107721077310774107751077610777107781077910780107811078210783107841078510786107871078810789107901079110792107931079410795107961079710798107991080010801108021080310804108051080610807108081080910810108111081210813108141081510816108171081810819108201082110822108231082410825108261082710828108291083010831108321083310834108351083610837108381083910840108411084210843108441084510846108471084810849108501085110852108531085410855108561085710858108591086010861108621086310864108651086610867108681086910870108711087210873108741087510876108771087810879108801088110882108831088410885108861088710888108891089010891108921089310894108951089610897108981089910900109011090210903109041090510906109071090810909109101091110912109131091410915109161091710918109191092010921109221092310924109251092610927109281092910930109311093210933109341093510936109371093810939109401094110942109431094410945109461094710948109491095010951109521095310954109551095610957109581095910960109611096210963109641096510966109671096810969109701097110972109731097410975109761097710978109791098010981109821098310984109851098610987109881098910990109911099210993109941099510996109971099810999110001100111002110031100411005110061100711008110091101011011110121101311014110151101611017110181101911020110211102211023110241102511026110271102811029110301103111032110331103411035110361103711038110391104011041110421104311044110451104611047110481104911050110511105211053110541105511056110571105811059110601106111062110631106411065110661106711068110691107011071110721107311074110751107611077110781107911080110811108211083110841108511086110871108811089110901109111092110931109411095110961109711098110991110011101111021110311104111051110611107111081110911110111111111211113111141111511116111171111811119111201112111122111231112411125111261112711128111291113011131111321113311134111351113611137111381113911140111411114211143111441114511146111471114811149111501115111152111531115411155111561115711158111591116011161111621116311164111651116611167111681116911170111711117211173111741117511176111771117811179111801118111182111831118411185111861118711188111891119011191111921119311194111951119611197111981119911200112011120211203112041120511206112071120811209112101121111212112131121411215112161121711218112191122011221112221122311224112251122611227112281122911230112311123211233112341123511236112371123811239112401124111242112431124411245112461124711248112491125011251112521125311254112551125611257112581125911260112611126211263112641126511266112671126811269112701127111272112731127411275112761127711278112791128011281112821128311284112851128611287112881128911290112911129211293112941129511296112971129811299113001130111302113031130411305113061130711308113091131011311113121131311314113151131611317113181131911320113211132211323113241132511326113271132811329113301133111332113331133411335113361133711338113391134011341113421134311344113451134611347113481134911350113511135211353113541135511356113571135811359113601136111362113631136411365113661136711368113691137011371113721137311374113751137611377113781137911380113811138211383113841138511386113871138811389113901139111392113931139411395113961139711398113991140011401114021140311404114051140611407114081140911410114111141211413114141141511416114171141811419114201142111422114231142411425114261142711428114291143011431114321143311434114351143611437114381143911440114411144211443114441144511446114471144811449114501145111452114531145411455114561145711458114591146011461114621146311464114651146611467114681146911470114711147211473114741147511476114771147811479114801148111482114831148411485114861148711488114891149011491114921149311494114951149611497114981149911500115011150211503115041150511506115071150811509115101151111512115131151411515115161151711518115191152011521115221152311524115251152611527115281152911530115311153211533115341153511536115371153811539115401154111542115431154411545115461154711548115491155011551115521155311554115551155611557115581155911560115611156211563115641156511566115671156811569115701157111572115731157411575115761157711578115791158011581115821158311584115851158611587115881158911590115911159211593115941159511596115971159811599116001160111602116031160411605116061160711608116091161011611116121161311614116151161611617116181161911620116211162211623116241162511626116271162811629116301163111632116331163411635116361163711638116391164011641116421164311644116451164611647116481164911650116511165211653116541165511656116571165811659116601166111662116631166411665116661166711668116691167011671116721167311674116751167611677116781167911680116811168211683116841168511686116871168811689116901169111692116931169411695116961169711698116991170011701117021170311704117051170611707117081170911710117111171211713117141171511716117171171811719117201172111722117231172411725117261172711728117291173011731117321173311734117351173611737117381173911740117411174211743117441174511746117471174811749117501175111752117531175411755117561175711758117591176011761117621176311764117651176611767117681176911770117711177211773117741177511776117771177811779117801178111782117831178411785117861178711788117891179011791117921179311794117951179611797117981179911800118011180211803118041180511806118071180811809118101181111812118131181411815118161181711818118191182011821118221182311824118251182611827118281182911830118311183211833118341183511836118371183811839118401184111842118431184411845118461184711848118491185011851118521185311854118551185611857118581185911860118611186211863118641186511866118671186811869118701187111872118731187411875118761187711878118791188011881118821188311884118851188611887118881188911890118911189211893118941189511896118971189811899119001190111902119031190411905119061190711908119091191011911119121191311914119151191611917119181191911920119211192211923119241192511926119271192811929119301193111932119331193411935119361193711938119391194011941119421194311944119451194611947119481194911950119511195211953119541195511956119571195811959119601196111962119631196411965119661196711968119691197011971119721197311974119751197611977119781197911980119811198211983119841198511986119871198811989119901199111992119931199411995119961199711998119991200012001120021200312004120051200612007120081200912010120111201212013120141201512016120171201812019120201202112022120231202412025120261202712028120291203012031120321203312034120351203612037120381203912040120411204212043120441204512046120471204812049120501205112052120531205412055120561205712058120591206012061120621206312064120651206612067120681206912070120711207212073120741207512076120771207812079120801208112082120831208412085120861208712088120891209012091120921209312094120951209612097120981209912100121011210212103121041210512106121071210812109121101211112112121131211412115121161211712118121191212012121121221212312124121251212612127121281212912130121311213212133121341213512136121371213812139121401214112142121431214412145121461214712148121491215012151121521215312154121551215612157121581215912160121611216212163121641216512166121671216812169121701217112172121731217412175121761217712178121791218012181121821218312184121851218612187121881218912190121911219212193121941219512196121971219812199122001220112202122031220412205122061220712208122091221012211122121221312214122151221612217122181221912220122211222212223122241222512226122271222812229122301223112232122331223412235122361223712238122391224012241122421224312244122451224612247122481224912250122511225212253122541225512256122571225812259122601226112262122631226412265122661226712268122691227012271122721227312274122751227612277122781227912280122811228212283122841228512286122871228812289122901229112292122931229412295122961229712298122991230012301123021230312304123051230612307123081230912310123111231212313123141231512316123171231812319123201232112322123231232412325123261232712328123291233012331123321233312334123351233612337123381233912340123411234212343123441234512346123471234812349123501235112352123531235412355123561235712358123591236012361123621236312364123651236612367123681236912370123711237212373123741237512376123771237812379123801238112382123831238412385123861238712388123891239012391123921239312394123951239612397123981239912400124011240212403124041240512406124071240812409124101241112412124131241412415124161241712418124191242012421124221242312424124251242612427124281242912430124311243212433124341243512436124371243812439124401244112442124431244412445124461244712448124491245012451124521245312454124551245612457124581245912460124611246212463124641246512466124671246812469124701247112472124731247412475124761247712478124791248012481124821248312484124851248612487124881248912490124911249212493124941249512496124971249812499125001250112502125031250412505125061250712508125091251012511125121251312514125151251612517125181251912520125211252212523125241252512526125271252812529125301253112532125331253412535125361253712538125391254012541125421254312544125451254612547125481254912550125511255212553125541255512556125571255812559125601256112562125631256412565125661256712568125691257012571125721257312574125751257612577125781257912580125811258212583125841258512586125871258812589125901259112592125931259412595125961259712598125991260012601126021260312604126051260612607126081260912610126111261212613126141261512616126171261812619126201262112622126231262412625126261262712628126291263012631126321263312634126351263612637126381263912640126411264212643126441264512646126471264812649126501265112652126531265412655126561265712658126591266012661126621266312664126651266612667126681266912670126711267212673126741267512676126771267812679126801268112682126831268412685126861268712688126891269012691126921269312694126951269612697126981269912700127011270212703127041270512706127071270812709127101271112712127131271412715127161271712718127191272012721127221272312724127251272612727127281272912730127311273212733127341273512736127371273812739127401274112742127431274412745127461274712748127491275012751127521275312754127551275612757127581275912760127611276212763127641276512766127671276812769127701277112772127731277412775127761277712778127791278012781127821278312784127851278612787127881278912790127911279212793127941279512796127971279812799128001280112802128031280412805128061280712808128091281012811128121281312814128151281612817128181281912820128211282212823128241282512826128271282812829128301283112832128331283412835128361283712838128391284012841128421284312844128451284612847128481284912850128511285212853128541285512856128571285812859128601286112862128631286412865128661286712868128691287012871128721287312874128751287612877128781287912880128811288212883128841288512886128871288812889128901289112892128931289412895128961289712898128991290012901129021290312904129051290612907129081290912910129111291212913129141291512916129171291812919129201292112922129231292412925129261292712928129291293012931129321293312934129351293612937129381293912940129411294212943129441294512946129471294812949129501295112952129531295412955129561295712958129591296012961129621296312964129651296612967129681296912970129711297212973129741297512976129771297812979129801298112982129831298412985129861298712988129891299012991129921299312994129951299612997129981299913000130011300213003130041300513006130071300813009130101301113012130131301413015130161301713018130191302013021130221302313024130251302613027130281302913030130311303213033130341303513036130371303813039130401304113042130431304413045130461304713048130491305013051130521305313054130551305613057130581305913060130611306213063130641306513066130671306813069130701307113072130731307413075130761307713078130791308013081130821308313084130851308613087130881308913090130911309213093130941309513096130971309813099131001310113102131031310413105131061310713108131091311013111131121311313114131151311613117131181311913120131211312213123131241312513126131271312813129131301313113132131331313413135131361313713138131391314013141131421314313144131451314613147131481314913150131511315213153131541315513156131571315813159131601316113162131631316413165131661316713168131691317013171131721317313174131751317613177131781317913180131811318213183131841318513186131871318813189131901319113192131931319413195131961319713198131991320013201132021320313204132051320613207132081320913210132111321213213132141321513216132171321813219132201322113222132231322413225132261322713228132291323013231132321323313234132351323613237132381323913240132411324213243132441324513246132471324813249132501325113252132531325413255132561325713258132591326013261132621326313264132651326613267132681326913270132711327213273132741327513276132771327813279132801328113282132831328413285132861328713288132891329013291132921329313294132951329613297132981329913300133011330213303133041330513306133071330813309133101331113312133131331413315133161331713318133191332013321133221332313324133251332613327133281332913330133311333213333133341333513336133371333813339133401334113342133431334413345133461334713348133491335013351133521335313354133551335613357133581335913360133611336213363133641336513366133671336813369133701337113372133731337413375133761337713378133791338013381133821338313384133851338613387133881338913390133911339213393133941339513396133971339813399134001340113402134031340413405134061340713408134091341013411134121341313414134151341613417134181341913420134211342213423134241342513426134271342813429134301343113432134331343413435134361343713438134391344013441134421344313444134451344613447134481344913450134511345213453134541345513456134571345813459134601346113462134631346413465134661346713468134691347013471134721347313474134751347613477134781347913480134811348213483134841348513486134871348813489134901349113492134931349413495134961349713498134991350013501135021350313504135051350613507135081350913510135111351213513135141351513516135171351813519135201352113522135231352413525135261352713528135291353013531135321353313534135351353613537135381353913540135411354213543135441354513546135471354813549135501355113552135531355413555135561355713558135591356013561135621356313564135651356613567135681356913570135711357213573135741357513576135771357813579135801358113582135831358413585135861358713588135891359013591135921359313594135951359613597135981359913600136011360213603136041360513606136071360813609136101361113612136131361413615136161361713618136191362013621136221362313624136251362613627136281362913630136311363213633136341363513636136371363813639136401364113642136431364413645136461364713648136491365013651136521365313654136551365613657136581365913660136611366213663136641366513666136671366813669136701367113672136731367413675136761367713678136791368013681136821368313684136851368613687136881368913690136911369213693136941369513696136971369813699137001370113702137031370413705137061370713708137091371013711137121371313714137151371613717137181371913720137211372213723137241372513726137271372813729137301373113732137331373413735137361373713738137391374013741137421374313744137451374613747137481374913750137511375213753137541375513756137571375813759137601376113762137631376413765137661376713768137691377013771137721377313774137751377613777137781377913780137811378213783137841378513786137871378813789137901379113792137931379413795137961379713798137991380013801138021380313804138051380613807138081380913810138111381213813138141381513816138171381813819138201382113822138231382413825138261382713828138291383013831138321383313834138351383613837138381383913840138411384213843138441384513846138471384813849138501385113852138531385413855138561385713858138591386013861138621386313864138651386613867138681386913870138711387213873138741387513876138771387813879138801388113882138831388413885138861388713888138891389013891138921389313894138951389613897138981389913900139011390213903139041390513906139071390813909139101391113912139131391413915139161391713918139191392013921139221392313924139251392613927139281392913930139311393213933139341393513936139371393813939139401394113942139431394413945139461394713948139491395013951139521395313954139551395613957139581395913960139611396213963139641396513966139671396813969139701397113972139731397413975139761397713978139791398013981139821398313984139851398613987139881398913990139911399213993139941399513996139971399813999140001400114002140031400414005140061400714008140091401014011140121401314014140151401614017140181401914020140211402214023140241402514026140271402814029140301403114032140331403414035140361403714038140391404014041140421404314044140451404614047140481404914050140511405214053140541405514056140571405814059140601406114062140631406414065140661406714068140691407014071140721407314074140751407614077140781407914080140811408214083140841408514086140871408814089140901409114092140931409414095140961409714098140991410014101141021410314104141051410614107141081410914110141111411214113141141411514116141171411814119141201412114122141231412414125141261412714128141291413014131141321413314134141351413614137141381413914140141411414214143141441414514146141471414814149141501415114152141531415414155141561415714158141591416014161141621416314164141651416614167141681416914170141711417214173141741417514176141771417814179141801418114182141831418414185141861418714188141891419014191141921419314194141951419614197141981419914200142011420214203142041420514206142071420814209142101421114212142131421414215142161421714218142191422014221142221422314224142251422614227142281422914230142311423214233142341423514236142371423814239142401424114242142431424414245142461424714248142491425014251142521425314254142551425614257142581425914260142611426214263142641426514266142671426814269142701427114272142731427414275142761427714278142791428014281142821428314284142851428614287142881428914290142911429214293142941429514296142971429814299143001430114302143031430414305143061430714308143091431014311143121431314314143151431614317143181431914320143211432214323143241432514326143271432814329143301433114332143331433414335143361433714338143391434014341143421434314344143451434614347143481434914350143511435214353143541435514356143571435814359143601436114362143631436414365143661436714368143691437014371143721437314374143751437614377143781437914380143811438214383143841438514386143871438814389143901439114392143931439414395143961439714398143991440014401144021440314404144051440614407144081440914410144111441214413144141441514416144171441814419144201442114422144231442414425144261442714428144291443014431144321443314434144351443614437144381443914440144411444214443144441444514446144471444814449144501445114452144531445414455144561445714458144591446014461144621446314464144651446614467144681446914470144711447214473144741447514476144771447814479144801448114482144831448414485144861448714488144891449014491144921449314494144951449614497144981449914500145011450214503145041450514506145071450814509145101451114512145131451414515145161451714518145191452014521145221452314524145251452614527145281452914530145311453214533145341453514536145371453814539145401454114542145431454414545145461454714548145491455014551145521455314554145551455614557145581455914560145611456214563145641456514566145671456814569145701457114572145731457414575145761457714578145791458014581145821458314584145851458614587145881458914590145911459214593145941459514596145971459814599146001460114602146031460414605146061460714608146091461014611146121461314614146151461614617146181461914620146211462214623146241462514626146271462814629146301463114632146331463414635146361463714638146391464014641146421464314644146451464614647146481464914650146511465214653146541465514656146571465814659146601466114662146631466414665146661466714668146691467014671146721467314674146751467614677146781467914680146811468214683146841468514686146871468814689146901469114692146931469414695146961469714698146991470014701147021470314704147051470614707147081470914710147111471214713147141471514716147171471814719147201472114722147231472414725147261472714728147291473014731147321473314734147351473614737147381473914740147411474214743147441474514746147471474814749147501475114752147531475414755147561475714758147591476014761147621476314764147651476614767147681476914770147711477214773147741477514776147771477814779147801478114782147831478414785147861478714788147891479014791147921479314794147951479614797147981479914800148011480214803148041480514806148071480814809148101481114812148131481414815148161481714818148191482014821148221482314824148251482614827148281482914830148311483214833148341483514836148371483814839148401484114842148431484414845148461484714848148491485014851148521485314854148551485614857148581485914860148611486214863148641486514866148671486814869148701487114872148731487414875148761487714878148791488014881148821488314884148851488614887148881488914890148911489214893148941489514896148971489814899149001490114902149031490414905149061490714908149091491014911149121491314914149151491614917149181491914920149211492214923149241492514926149271492814929149301493114932149331493414935149361493714938149391494014941149421494314944149451494614947149481494914950149511495214953149541495514956149571495814959149601496114962149631496414965149661496714968149691497014971149721497314974149751497614977149781497914980149811498214983149841498514986149871498814989149901499114992149931499414995149961499714998149991500015001150021500315004150051500615007150081500915010150111501215013150141501515016150171501815019150201502115022150231502415025150261502715028150291503015031150321503315034150351503615037150381503915040150411504215043150441504515046150471504815049150501505115052150531505415055150561505715058150591506015061150621506315064150651506615067150681506915070150711507215073150741507515076150771507815079150801508115082150831508415085150861508715088150891509015091150921509315094150951509615097150981509915100151011510215103151041510515106151071510815109151101511115112151131511415115151161511715118151191512015121151221512315124151251512615127151281512915130151311513215133151341513515136151371513815139151401514115142151431514415145151461514715148151491515015151151521515315154151551515615157151581515915160151611516215163151641516515166151671516815169151701517115172151731517415175151761517715178151791518015181151821518315184151851518615187151881518915190151911519215193151941519515196151971519815199152001520115202152031520415205152061520715208152091521015211152121521315214152151521615217152181521915220152211522215223152241522515226152271522815229152301523115232152331523415235152361523715238152391524015241152421524315244152451524615247152481524915250152511525215253152541525515256152571525815259152601526115262152631526415265152661526715268152691527015271152721527315274152751527615277152781527915280152811528215283152841528515286152871528815289152901529115292152931529415295152961529715298152991530015301153021530315304153051530615307153081530915310153111531215313153141531515316153171531815319153201532115322153231532415325153261532715328153291533015331153321533315334153351533615337153381533915340153411534215343153441534515346153471534815349153501535115352153531535415355153561535715358153591536015361153621536315364153651536615367153681536915370153711537215373153741537515376153771537815379153801538115382153831538415385153861538715388153891539015391153921539315394153951539615397153981539915400154011540215403154041540515406154071540815409154101541115412154131541415415154161541715418154191542015421154221542315424154251542615427154281542915430154311543215433154341543515436154371543815439154401544115442154431544415445154461544715448154491545015451154521545315454154551545615457154581545915460154611546215463154641546515466154671546815469154701547115472154731547415475154761547715478154791548015481154821548315484154851548615487154881548915490154911549215493154941549515496154971549815499155001550115502155031550415505155061550715508155091551015511155121551315514155151551615517155181551915520155211552215523155241552515526155271552815529155301553115532155331553415535155361553715538155391554015541155421554315544155451554615547155481554915550155511555215553155541555515556155571555815559155601556115562155631556415565155661556715568155691557015571155721557315574155751557615577155781557915580155811558215583155841558515586155871558815589155901559115592155931559415595155961559715598155991560015601156021560315604156051560615607156081560915610156111561215613156141561515616156171561815619156201562115622156231562415625156261562715628156291563015631156321563315634156351563615637156381563915640156411564215643156441564515646156471564815649156501565115652156531565415655156561565715658156591566015661156621566315664156651566615667156681566915670156711567215673156741567515676156771567815679156801568115682156831568415685156861568715688156891569015691156921569315694156951569615697156981569915700157011570215703157041570515706157071570815709157101571115712157131571415715157161571715718157191572015721157221572315724157251572615727157281572915730157311573215733157341573515736157371573815739157401574115742157431574415745157461574715748157491575015751157521575315754157551575615757157581575915760157611576215763157641576515766157671576815769157701577115772157731577415775157761577715778157791578015781157821578315784157851578615787157881578915790157911579215793157941579515796157971579815799158001580115802158031580415805158061580715808158091581015811158121581315814158151581615817158181581915820158211582215823158241582515826158271582815829158301583115832158331583415835158361583715838158391584015841158421584315844158451584615847158481584915850158511585215853158541585515856158571585815859158601586115862158631586415865158661586715868158691587015871158721587315874158751587615877158781587915880158811588215883158841588515886158871588815889158901589115892158931589415895158961589715898158991590015901159021590315904159051590615907159081590915910159111591215913159141591515916159171591815919159201592115922159231592415925159261592715928159291593015931159321593315934159351593615937159381593915940159411594215943159441594515946159471594815949159501595115952159531595415955159561595715958159591596015961159621596315964159651596615967159681596915970159711597215973159741597515976159771597815979159801598115982159831598415985159861598715988159891599015991159921599315994159951599615997159981599916000160011600216003160041600516006160071600816009160101601116012160131601416015160161601716018160191602016021160221602316024160251602616027160281602916030160311603216033160341603516036160371603816039160401604116042160431604416045160461604716048160491605016051160521605316054160551605616057160581605916060160611606216063160641606516066160671606816069160701607116072160731607416075160761607716078160791608016081160821608316084160851608616087160881608916090160911609216093160941609516096160971609816099161001610116102161031610416105161061610716108161091611016111161121611316114161151611616117161181611916120161211612216123161241612516126161271612816129161301613116132161331613416135161361613716138161391614016141161421614316144161451614616147161481614916150161511615216153161541615516156161571615816159161601616116162161631616416165161661616716168161691617016171161721617316174161751617616177161781617916180161811618216183161841618516186161871618816189161901619116192161931619416195161961619716198161991620016201162021620316204162051620616207162081620916210162111621216213162141621516216162171621816219162201622116222162231622416225162261622716228162291623016231162321623316234162351623616237162381623916240162411624216243162441624516246162471624816249162501625116252162531625416255162561625716258162591626016261162621626316264162651626616267162681626916270162711627216273162741627516276162771627816279162801628116282162831628416285162861628716288162891629016291162921629316294162951629616297162981629916300163011630216303163041630516306163071630816309163101631116312163131631416315163161631716318163191632016321163221632316324163251632616327163281632916330163311633216333163341633516336163371633816339163401634116342163431634416345163461634716348163491635016351163521635316354163551635616357163581635916360163611636216363163641636516366163671636816369163701637116372163731637416375163761637716378163791638016381163821638316384163851638616387163881638916390163911639216393163941639516396163971639816399164001640116402164031640416405164061640716408164091641016411164121641316414164151641616417164181641916420164211642216423164241642516426164271642816429164301643116432164331643416435164361643716438164391644016441164421644316444164451644616447164481644916450164511645216453164541645516456164571645816459164601646116462164631646416465164661646716468164691647016471164721647316474164751647616477164781647916480164811648216483164841648516486164871648816489164901649116492164931649416495164961649716498164991650016501165021650316504165051650616507165081650916510165111651216513165141651516516165171651816519165201652116522165231652416525165261652716528165291653016531165321653316534165351653616537165381653916540165411654216543165441654516546165471654816549165501655116552165531655416555165561655716558165591656016561165621656316564165651656616567165681656916570165711657216573165741657516576165771657816579165801658116582165831658416585165861658716588165891659016591165921659316594165951659616597165981659916600166011660216603166041660516606166071660816609166101661116612166131661416615166161661716618166191662016621166221662316624166251662616627166281662916630166311663216633166341663516636166371663816639166401664116642166431664416645166461664716648166491665016651166521665316654166551665616657166581665916660166611666216663166641666516666166671666816669166701667116672166731667416675166761667716678166791668016681166821668316684166851668616687166881668916690166911669216693166941669516696166971669816699167001670116702167031670416705167061670716708167091671016711167121671316714167151671616717167181671916720167211672216723167241672516726167271672816729167301673116732167331673416735167361673716738167391674016741167421674316744167451674616747167481674916750167511675216753167541675516756167571675816759167601676116762167631676416765167661676716768167691677016771167721677316774167751677616777167781677916780167811678216783167841678516786167871678816789167901679116792167931679416795167961679716798167991680016801168021680316804168051680616807168081680916810168111681216813168141681516816168171681816819168201682116822168231682416825168261682716828168291683016831168321683316834168351683616837168381683916840168411684216843168441684516846168471684816849168501685116852168531685416855168561685716858168591686016861168621686316864168651686616867168681686916870168711687216873168741687516876168771687816879168801688116882168831688416885168861688716888168891689016891168921689316894168951689616897168981689916900169011690216903169041690516906169071690816909169101691116912169131691416915169161691716918169191692016921169221692316924169251692616927169281692916930169311693216933169341693516936169371693816939169401694116942169431694416945169461694716948169491695016951169521695316954169551695616957169581695916960169611696216963169641696516966169671696816969169701697116972169731697416975169761697716978169791698016981169821698316984169851698616987169881698916990169911699216993169941699516996169971699816999170001700117002170031700417005170061700717008170091701017011170121701317014170151701617017170181701917020170211702217023170241702517026170271702817029170301703117032170331703417035170361703717038170391704017041170421704317044170451704617047170481704917050170511705217053170541705517056170571705817059170601706117062170631706417065170661706717068170691707017071170721707317074170751707617077170781707917080170811708217083170841708517086170871708817089170901709117092170931709417095170961709717098170991710017101171021710317104171051710617107171081710917110171111711217113171141711517116171171711817119171201712117122171231712417125171261712717128171291713017131171321713317134171351713617137171381713917140171411714217143171441714517146171471714817149171501715117152171531715417155171561715717158171591716017161171621716317164171651716617167171681716917170171711717217173171741717517176171771717817179171801718117182171831718417185171861718717188171891719017191171921719317194171951719617197171981719917200172011720217203172041720517206172071720817209172101721117212172131721417215172161721717218172191722017221172221722317224172251722617227172281722917230172311723217233172341723517236172371723817239172401724117242172431724417245172461724717248172491725017251172521725317254172551725617257172581725917260172611726217263172641726517266172671726817269172701727117272172731727417275172761727717278172791728017281172821728317284172851728617287172881728917290172911729217293172941729517296172971729817299173001730117302173031730417305173061730717308173091731017311173121731317314173151731617317173181731917320173211732217323173241732517326173271732817329173301733117332173331733417335173361733717338173391734017341173421734317344173451734617347173481734917350173511735217353173541735517356173571735817359173601736117362173631736417365173661736717368173691737017371173721737317374173751737617377173781737917380173811738217383173841738517386173871738817389173901739117392173931739417395173961739717398173991740017401174021740317404174051740617407174081740917410174111741217413174141741517416174171741817419174201742117422174231742417425174261742717428174291743017431174321743317434174351743617437174381743917440174411744217443174441744517446174471744817449174501745117452174531745417455174561745717458174591746017461174621746317464174651746617467174681746917470174711747217473174741747517476174771747817479174801748117482174831748417485174861748717488174891749017491174921749317494174951749617497174981749917500175011750217503175041750517506175071750817509175101751117512175131751417515175161751717518175191752017521175221752317524175251752617527175281752917530175311753217533175341753517536175371753817539175401754117542175431754417545175461754717548175491755017551175521755317554175551755617557175581755917560175611756217563175641756517566175671756817569175701757117572175731757417575175761757717578175791758017581175821758317584175851758617587175881758917590175911759217593175941759517596175971759817599176001760117602176031760417605176061760717608176091761017611176121761317614176151761617617176181761917620176211762217623176241762517626176271762817629176301763117632176331763417635176361763717638176391764017641176421764317644176451764617647176481764917650176511765217653176541765517656176571765817659176601766117662176631766417665176661766717668176691767017671176721767317674176751767617677176781767917680176811768217683176841768517686176871768817689176901769117692176931769417695176961769717698176991770017701177021770317704177051770617707177081770917710177111771217713177141771517716177171771817719177201772117722177231772417725177261772717728177291773017731177321773317734177351773617737177381773917740177411774217743177441774517746177471774817749177501775117752177531775417755177561775717758177591776017761177621776317764177651776617767177681776917770177711777217773177741777517776177771777817779177801778117782177831778417785177861778717788177891779017791177921779317794177951779617797177981779917800178011780217803178041780517806178071780817809178101781117812178131781417815178161781717818178191782017821178221782317824178251782617827178281782917830178311783217833178341783517836178371783817839178401784117842178431784417845178461784717848178491785017851178521785317854178551785617857178581785917860178611786217863178641786517866178671786817869178701787117872178731787417875178761787717878178791788017881178821788317884178851788617887178881788917890178911789217893178941789517896178971789817899179001790117902179031790417905179061790717908179091791017911179121791317914179151791617917179181791917920179211792217923179241792517926179271792817929179301793117932179331793417935179361793717938179391794017941179421794317944179451794617947179481794917950179511795217953179541795517956179571795817959179601796117962179631796417965179661796717968179691797017971179721797317974179751797617977179781797917980179811798217983179841798517986179871798817989179901799117992179931799417995179961799717998179991800018001180021800318004180051800618007180081800918010180111801218013180141801518016180171801818019180201802118022180231802418025180261802718028180291803018031180321803318034180351803618037180381803918040180411804218043180441804518046180471804818049180501805118052180531805418055180561805718058180591806018061180621806318064180651806618067180681806918070180711807218073180741807518076180771807818079180801808118082180831808418085180861808718088180891809018091180921809318094180951809618097180981809918100181011810218103181041810518106181071810818109181101811118112181131811418115181161811718118181191812018121181221812318124181251812618127181281812918130181311813218133181341813518136181371813818139181401814118142181431814418145181461814718148181491815018151181521815318154181551815618157181581815918160181611816218163181641816518166181671816818169181701817118172181731817418175181761817718178181791818018181181821818318184181851818618187181881818918190181911819218193181941819518196181971819818199182001820118202182031820418205182061820718208182091821018211182121821318214182151821618217182181821918220182211822218223182241822518226182271822818229182301823118232182331823418235182361823718238182391824018241182421824318244182451824618247182481824918250182511825218253182541825518256182571825818259182601826118262182631826418265182661826718268182691827018271182721827318274182751827618277182781827918280182811828218283182841828518286182871828818289182901829118292182931829418295182961829718298182991830018301183021830318304183051830618307183081830918310183111831218313183141831518316183171831818319183201832118322183231832418325183261832718328183291833018331183321833318334183351833618337183381833918340183411834218343183441834518346183471834818349183501835118352183531835418355183561835718358183591836018361183621836318364183651836618367183681836918370183711837218373183741837518376183771837818379183801838118382183831838418385183861838718388183891839018391183921839318394183951839618397183981839918400184011840218403184041840518406184071840818409184101841118412184131841418415184161841718418184191842018421184221842318424184251842618427184281842918430184311843218433184341843518436184371843818439184401844118442184431844418445184461844718448184491845018451184521845318454184551845618457184581845918460184611846218463184641846518466184671846818469184701847118472184731847418475184761847718478184791848018481184821848318484184851848618487184881848918490184911849218493184941849518496184971849818499185001850118502185031850418505185061850718508185091851018511185121851318514185151851618517185181851918520185211852218523185241852518526185271852818529185301853118532185331853418535185361853718538185391854018541185421854318544185451854618547185481854918550185511855218553185541855518556185571855818559185601856118562185631856418565185661856718568185691857018571185721857318574185751857618577185781857918580185811858218583185841858518586185871858818589185901859118592185931859418595185961859718598185991860018601186021860318604186051860618607186081860918610186111861218613186141861518616186171861818619186201862118622186231862418625186261862718628186291863018631186321863318634186351863618637186381863918640186411864218643186441864518646186471864818649186501865118652186531865418655186561865718658186591866018661186621866318664186651866618667186681866918670186711867218673186741867518676186771867818679186801868118682186831868418685186861868718688186891869018691186921869318694186951869618697186981869918700187011870218703187041870518706187071870818709187101871118712187131871418715187161871718718187191872018721187221872318724187251872618727187281872918730187311873218733187341873518736187371873818739187401874118742187431874418745187461874718748187491875018751187521875318754187551875618757187581875918760187611876218763187641876518766187671876818769187701877118772187731877418775187761877718778187791878018781187821878318784187851878618787187881878918790187911879218793187941879518796187971879818799188001880118802188031880418805188061880718808188091881018811188121881318814188151881618817188181881918820188211882218823188241882518826188271882818829188301883118832188331883418835188361883718838188391884018841188421884318844188451884618847188481884918850188511885218853188541885518856188571885818859188601886118862188631886418865188661886718868188691887018871188721887318874188751887618877188781887918880188811888218883188841888518886188871888818889188901889118892188931889418895188961889718898188991890018901189021890318904189051890618907189081890918910189111891218913189141891518916189171891818919189201892118922189231892418925189261892718928189291893018931189321893318934189351893618937189381893918940189411894218943189441894518946189471894818949189501895118952189531895418955189561895718958189591896018961189621896318964189651896618967189681896918970189711897218973189741897518976189771897818979189801898118982189831898418985189861898718988189891899018991189921899318994189951899618997189981899919000190011900219003190041900519006190071900819009190101901119012190131901419015190161901719018190191902019021190221902319024190251902619027190281902919030190311903219033190341903519036190371903819039190401904119042190431904419045190461904719048190491905019051190521905319054190551905619057190581905919060190611906219063190641906519066190671906819069190701907119072190731907419075190761907719078190791908019081190821908319084190851908619087190881908919090190911909219093190941909519096190971909819099191001910119102191031910419105191061910719108191091911019111191121911319114191151911619117191181911919120191211912219123191241912519126191271912819129191301913119132191331913419135191361913719138191391914019141191421914319144191451914619147191481914919150191511915219153191541915519156191571915819159191601916119162191631916419165191661916719168191691917019171191721917319174191751917619177191781917919180191811918219183191841918519186191871918819189191901919119192191931919419195191961919719198191991920019201192021920319204192051920619207192081920919210192111921219213192141921519216192171921819219192201922119222192231922419225192261922719228192291923019231192321923319234192351923619237192381923919240192411924219243192441924519246192471924819249192501925119252192531925419255192561925719258192591926019261192621926319264192651926619267192681926919270192711927219273192741927519276192771927819279192801928119282192831928419285192861928719288192891929019291192921929319294192951929619297192981929919300193011930219303193041930519306193071930819309193101931119312193131931419315193161931719318193191932019321193221932319324193251932619327193281932919330193311933219333193341933519336193371933819339193401934119342193431934419345193461934719348193491935019351193521935319354193551935619357193581935919360193611936219363193641936519366193671936819369193701937119372193731937419375193761937719378193791938019381193821938319384193851938619387193881938919390193911939219393193941939519396193971939819399194001940119402194031940419405194061940719408194091941019411194121941319414194151941619417194181941919420194211942219423194241942519426194271942819429194301943119432194331943419435194361943719438194391944019441194421944319444194451944619447194481944919450194511945219453194541945519456194571945819459194601946119462194631946419465194661946719468194691947019471194721947319474194751947619477194781947919480194811948219483194841948519486194871948819489194901949119492194931949419495194961949719498194991950019501195021950319504195051950619507195081950919510195111951219513195141951519516195171951819519195201952119522195231952419525195261952719528195291953019531195321953319534195351953619537195381953919540195411954219543195441954519546195471954819549195501955119552195531955419555195561955719558195591956019561195621956319564195651956619567195681956919570195711957219573195741957519576195771957819579195801958119582195831958419585195861958719588195891959019591195921959319594195951959619597195981959919600196011960219603196041960519606196071960819609196101961119612196131961419615196161961719618196191962019621196221962319624196251962619627196281962919630196311963219633196341963519636196371963819639196401964119642196431964419645196461964719648196491965019651196521965319654196551965619657196581965919660196611966219663196641966519666196671966819669196701967119672196731967419675196761967719678196791968019681196821968319684196851968619687196881968919690196911969219693196941969519696196971969819699197001970119702197031970419705197061970719708197091971019711197121971319714197151971619717197181971919720197211972219723197241972519726197271972819729197301973119732197331973419735197361973719738197391974019741197421974319744197451974619747197481974919750197511975219753197541975519756197571975819759197601976119762197631976419765197661976719768197691977019771197721977319774197751977619777197781977919780197811978219783197841978519786197871978819789197901979119792197931979419795197961979719798197991980019801198021980319804198051980619807198081980919810198111981219813198141981519816198171981819819198201982119822198231982419825198261982719828198291983019831198321983319834198351983619837198381983919840198411984219843198441984519846198471984819849198501985119852198531985419855198561985719858198591986019861198621986319864198651986619867198681986919870198711987219873198741987519876198771987819879198801988119882198831988419885198861988719888198891989019891198921989319894198951989619897198981989919900199011990219903199041990519906199071990819909199101991119912199131991419915199161991719918199191992019921199221992319924199251992619927199281992919930199311993219933199341993519936199371993819939199401994119942199431994419945199461994719948199491995019951199521995319954199551995619957199581995919960199611996219963199641996519966199671996819969199701997119972199731997419975199761997719978199791998019981199821998319984199851998619987199881998919990199911999219993199941999519996199971999819999200002000120002200032000420005200062000720008200092001020011200122001320014200152001620017200182001920020200212002220023200242002520026200272002820029200302003120032200332003420035200362003720038200392004020041200422004320044200452004620047200482004920050200512005220053200542005520056200572005820059200602006120062200632006420065200662006720068200692007020071200722007320074200752007620077200782007920080200812008220083200842008520086200872008820089200902009120092200932009420095200962009720098200992010020101201022010320104201052010620107201082010920110201112011220113201142011520116201172011820119201202012120122201232012420125201262012720128201292013020131201322013320134201352013620137201382013920140201412014220143201442014520146201472014820149201502015120152201532015420155201562015720158201592016020161201622016320164201652016620167201682016920170201712017220173201742017520176201772017820179201802018120182201832018420185201862018720188201892019020191201922019320194201952019620197201982019920200202012020220203202042020520206202072020820209202102021120212202132021420215202162021720218202192022020221202222022320224202252022620227202282022920230202312023220233202342023520236202372023820239202402024120242202432024420245202462024720248202492025020251202522025320254202552025620257202582025920260202612026220263202642026520266202672026820269202702027120272202732027420275202762027720278202792028020281202822028320284202852028620287202882028920290202912029220293202942029520296202972029820299203002030120302203032030420305203062030720308203092031020311203122031320314203152031620317203182031920320203212032220323203242032520326203272032820329203302033120332203332033420335203362033720338203392034020341203422034320344203452034620347203482034920350203512035220353203542035520356203572035820359203602036120362203632036420365203662036720368203692037020371203722037320374203752037620377203782037920380203812038220383203842038520386203872038820389203902039120392203932039420395203962039720398203992040020401204022040320404204052040620407204082040920410204112041220413204142041520416204172041820419204202042120422204232042420425204262042720428204292043020431204322043320434204352043620437204382043920440204412044220443204442044520446204472044820449204502045120452204532045420455204562045720458204592046020461204622046320464204652046620467204682046920470204712047220473204742047520476204772047820479204802048120482204832048420485204862048720488204892049020491204922049320494204952049620497204982049920500205012050220503205042050520506205072050820509205102051120512205132051420515205162051720518205192052020521205222052320524205252052620527205282052920530205312053220533205342053520536205372053820539205402054120542205432054420545205462054720548205492055020551205522055320554205552055620557205582055920560205612056220563205642056520566205672056820569205702057120572205732057420575205762057720578205792058020581205822058320584205852058620587205882058920590205912059220593205942059520596205972059820599206002060120602206032060420605206062060720608206092061020611206122061320614206152061620617206182061920620206212062220623206242062520626206272062820629206302063120632206332063420635206362063720638206392064020641206422064320644206452064620647206482064920650206512065220653206542065520656206572065820659206602066120662206632066420665206662066720668206692067020671206722067320674206752067620677206782067920680206812068220683206842068520686206872068820689206902069120692206932069420695206962069720698206992070020701207022070320704207052070620707207082070920710207112071220713207142071520716207172071820719207202072120722207232072420725207262072720728207292073020731207322073320734207352073620737207382073920740207412074220743207442074520746207472074820749207502075120752207532075420755207562075720758207592076020761207622076320764207652076620767207682076920770207712077220773207742077520776207772077820779207802078120782207832078420785207862078720788207892079020791207922079320794207952079620797207982079920800208012080220803208042080520806208072080820809208102081120812208132081420815208162081720818208192082020821208222082320824208252082620827208282082920830208312083220833208342083520836208372083820839208402084120842208432084420845208462084720848208492085020851208522085320854208552085620857208582085920860208612086220863208642086520866208672086820869208702087120872208732087420875208762087720878208792088020881208822088320884208852088620887208882088920890208912089220893208942089520896208972089820899209002090120902209032090420905209062090720908209092091020911209122091320914209152091620917209182091920920209212092220923209242092520926209272092820929209302093120932209332093420935209362093720938209392094020941209422094320944209452094620947209482094920950209512095220953209542095520956209572095820959209602096120962209632096420965209662096720968209692097020971209722097320974209752097620977209782097920980209812098220983209842098520986209872098820989209902099120992209932099420995209962099720998209992100021001210022100321004210052100621007210082100921010210112101221013210142101521016210172101821019210202102121022210232102421025210262102721028210292103021031210322103321034210352103621037210382103921040210412104221043210442104521046210472104821049210502105121052210532105421055210562105721058210592106021061210622106321064210652106621067210682106921070210712107221073210742107521076210772107821079210802108121082210832108421085210862108721088210892109021091210922109321094210952109621097210982109921100211012110221103211042110521106211072110821109211102111121112211132111421115211162111721118211192112021121211222112321124211252112621127211282112921130211312113221133211342113521136211372113821139211402114121142211432114421145211462114721148211492115021151211522115321154211552115621157211582115921160211612116221163211642116521166211672116821169211702117121172211732117421175211762117721178211792118021181211822118321184211852118621187211882118921190211912119221193211942119521196211972119821199212002120121202212032120421205212062120721208212092121021211212122121321214212152121621217212182121921220212212122221223212242122521226212272122821229212302123121232212332123421235212362123721238212392124021241212422124321244212452124621247212482124921250212512125221253212542125521256212572125821259212602126121262212632126421265212662126721268212692127021271212722127321274212752127621277212782127921280212812128221283212842128521286212872128821289212902129121292212932129421295212962129721298212992130021301213022130321304213052130621307213082130921310213112131221313213142131521316213172131821319213202132121322213232132421325213262132721328213292133021331213322133321334213352133621337213382133921340213412134221343213442134521346213472134821349213502135121352213532135421355213562135721358213592136021361213622136321364213652136621367213682136921370213712137221373213742137521376213772137821379213802138121382213832138421385213862138721388213892139021391213922139321394213952139621397213982139921400214012140221403214042140521406214072140821409214102141121412214132141421415214162141721418214192142021421214222142321424214252142621427214282142921430214312143221433214342143521436214372143821439214402144121442214432144421445214462144721448214492145021451214522145321454214552145621457214582145921460214612146221463214642146521466214672146821469214702147121472214732147421475214762147721478214792148021481214822148321484214852148621487214882148921490214912149221493214942149521496214972149821499215002150121502215032150421505215062150721508215092151021511215122151321514215152151621517215182151921520215212152221523215242152521526215272152821529215302153121532215332153421535215362153721538215392154021541215422154321544215452154621547215482154921550215512155221553215542155521556215572155821559215602156121562215632156421565215662156721568215692157021571215722157321574215752157621577215782157921580215812158221583215842158521586215872158821589215902159121592215932159421595215962159721598215992160021601216022160321604216052160621607216082160921610216112161221613216142161521616216172161821619216202162121622216232162421625216262162721628216292163021631216322163321634216352163621637216382163921640216412164221643216442164521646216472164821649216502165121652216532165421655216562165721658216592166021661216622166321664216652166621667216682166921670216712167221673216742167521676216772167821679216802168121682216832168421685216862168721688216892169021691216922169321694216952169621697216982169921700217012170221703217042170521706217072170821709217102171121712217132171421715217162171721718217192172021721217222172321724217252172621727217282172921730217312173221733217342173521736217372173821739217402174121742217432174421745217462174721748217492175021751217522175321754217552175621757217582175921760217612176221763217642176521766217672176821769217702177121772217732177421775217762177721778217792178021781217822178321784217852178621787217882178921790217912179221793217942179521796217972179821799218002180121802218032180421805218062180721808218092181021811218122181321814218152181621817218182181921820218212182221823218242182521826218272182821829218302183121832218332183421835218362183721838218392184021841218422184321844218452184621847218482184921850218512185221853218542185521856218572185821859218602186121862218632186421865218662186721868218692187021871218722187321874218752187621877218782187921880218812188221883218842188521886218872188821889218902189121892218932189421895218962189721898218992190021901219022190321904219052190621907219082190921910219112191221913219142191521916219172191821919219202192121922219232192421925219262192721928219292193021931219322193321934219352193621937219382193921940219412194221943219442194521946219472194821949219502195121952219532195421955219562195721958219592196021961219622196321964219652196621967219682196921970219712197221973219742197521976219772197821979219802198121982219832198421985219862198721988219892199021991219922199321994219952199621997219982199922000220012200222003220042200522006220072200822009220102201122012220132201422015220162201722018220192202022021220222202322024220252202622027220282202922030220312203222033220342203522036220372203822039220402204122042220432204422045220462204722048220492205022051220522205322054220552205622057220582205922060220612206222063220642206522066220672206822069220702207122072220732207422075220762207722078220792208022081220822208322084220852208622087220882208922090220912209222093220942209522096220972209822099221002210122102221032210422105221062210722108221092211022111221122211322114221152211622117221182211922120221212212222123221242212522126221272212822129221302213122132221332213422135221362213722138221392214022141221422214322144221452214622147221482214922150221512215222153221542215522156221572215822159221602216122162221632216422165221662216722168221692217022171221722217322174221752217622177221782217922180221812218222183221842218522186221872218822189221902219122192221932219422195221962219722198221992220022201222022220322204222052220622207222082220922210222112221222213222142221522216222172221822219222202222122222222232222422225222262222722228222292223022231222322223322234222352223622237222382223922240222412224222243222442224522246222472224822249222502225122252222532225422255222562225722258222592226022261222622226322264222652226622267222682226922270222712227222273222742227522276222772227822279222802228122282222832228422285222862228722288222892229022291222922229322294222952229622297222982229922300223012230222303223042230522306223072230822309223102231122312223132231422315223162231722318223192232022321223222232322324223252232622327223282232922330223312233222333223342233522336223372233822339223402234122342223432234422345223462234722348223492235022351223522235322354223552235622357223582235922360223612236222363223642236522366223672236822369223702237122372223732237422375223762237722378223792238022381223822238322384223852238622387223882238922390223912239222393223942239522396223972239822399224002240122402224032240422405224062240722408224092241022411224122241322414224152241622417224182241922420224212242222423224242242522426224272242822429224302243122432224332243422435224362243722438224392244022441224422244322444224452244622447224482244922450224512245222453224542245522456224572245822459224602246122462224632246422465224662246722468224692247022471224722247322474224752247622477224782247922480224812248222483224842248522486224872248822489224902249122492224932249422495224962249722498224992250022501225022250322504225052250622507225082250922510225112251222513225142251522516225172251822519225202252122522225232252422525225262252722528225292253022531225322253322534225352253622537225382253922540225412254222543225442254522546225472254822549225502255122552225532255422555225562255722558225592256022561225622256322564225652256622567225682256922570225712257222573225742257522576225772257822579225802258122582225832258422585225862258722588225892259022591225922259322594225952259622597225982259922600226012260222603226042260522606226072260822609226102261122612226132261422615226162261722618226192262022621226222262322624226252262622627226282262922630226312263222633226342263522636226372263822639226402264122642226432264422645226462264722648226492265022651226522265322654226552265622657226582265922660226612266222663226642266522666226672266822669226702267122672226732267422675226762267722678226792268022681226822268322684226852268622687226882268922690226912269222693226942269522696226972269822699227002270122702227032270422705227062270722708227092271022711227122271322714227152271622717227182271922720227212272222723227242272522726227272272822729227302273122732227332273422735227362273722738227392274022741227422274322744227452274622747227482274922750227512275222753227542275522756227572275822759227602276122762227632276422765227662276722768227692277022771227722277322774227752277622777227782277922780227812278222783227842278522786227872278822789227902279122792227932279422795227962279722798227992280022801228022280322804228052280622807228082280922810228112281222813228142281522816228172281822819228202282122822228232282422825228262282722828228292283022831228322283322834228352283622837228382283922840228412284222843228442284522846228472284822849228502285122852228532285422855228562285722858228592286022861228622286322864228652286622867228682286922870228712287222873228742287522876228772287822879228802288122882228832288422885228862288722888228892289022891228922289322894228952289622897228982289922900229012290222903229042290522906229072290822909229102291122912229132291422915229162291722918229192292022921229222292322924229252292622927229282292922930229312293222933229342293522936229372293822939229402294122942229432294422945229462294722948229492295022951229522295322954229552295622957229582295922960229612296222963229642296522966229672296822969229702297122972229732297422975229762297722978229792298022981229822298322984229852298622987229882298922990229912299222993229942299522996229972299822999230002300123002230032300423005230062300723008230092301023011230122301323014230152301623017230182301923020230212302223023230242302523026230272302823029230302303123032230332303423035230362303723038230392304023041230422304323044230452304623047230482304923050230512305223053230542305523056230572305823059230602306123062230632306423065230662306723068230692307023071230722307323074230752307623077230782307923080230812308223083230842308523086230872308823089230902309123092230932309423095230962309723098230992310023101231022310323104231052310623107231082310923110231112311223113231142311523116231172311823119231202312123122231232312423125231262312723128231292313023131231322313323134231352313623137231382313923140231412314223143231442314523146231472314823149231502315123152231532315423155231562315723158231592316023161231622316323164231652316623167231682316923170231712317223173231742317523176231772317823179231802318123182231832318423185231862318723188231892319023191231922319323194231952319623197231982319923200232012320223203232042320523206232072320823209232102321123212232132321423215232162321723218232192322023221232222322323224232252322623227232282322923230232312323223233232342323523236232372323823239232402324123242232432324423245232462324723248232492325023251232522325323254232552325623257232582325923260232612326223263232642326523266232672326823269232702327123272232732327423275232762327723278232792328023281232822328323284232852328623287232882328923290232912329223293232942329523296232972329823299233002330123302233032330423305233062330723308233092331023311233122331323314233152331623317233182331923320233212332223323233242332523326233272332823329233302333123332233332333423335233362333723338233392334023341233422334323344233452334623347233482334923350233512335223353233542335523356233572335823359233602336123362233632336423365233662336723368233692337023371233722337323374233752337623377233782337923380233812338223383233842338523386233872338823389233902339123392233932339423395233962339723398233992340023401234022340323404234052340623407234082340923410234112341223413234142341523416234172341823419234202342123422234232342423425234262342723428234292343023431234322343323434234352343623437234382343923440234412344223443234442344523446234472344823449234502345123452234532345423455234562345723458234592346023461234622346323464234652346623467234682346923470234712347223473234742347523476234772347823479234802348123482234832348423485234862348723488234892349023491234922349323494234952349623497234982349923500235012350223503235042350523506235072350823509235102351123512235132351423515235162351723518235192352023521235222352323524235252352623527235282352923530235312353223533235342353523536235372353823539235402354123542235432354423545235462354723548235492355023551235522355323554235552355623557235582355923560235612356223563235642356523566235672356823569235702357123572235732357423575235762357723578235792358023581235822358323584235852358623587235882358923590235912359223593235942359523596235972359823599236002360123602236032360423605236062360723608236092361023611236122361323614236152361623617236182361923620236212362223623236242362523626236272362823629236302363123632236332363423635236362363723638236392364023641236422364323644236452364623647236482364923650236512365223653236542365523656236572365823659236602366123662236632366423665236662366723668236692367023671236722367323674236752367623677236782367923680236812368223683236842368523686236872368823689236902369123692236932369423695236962369723698236992370023701237022370323704237052370623707237082370923710237112371223713237142371523716237172371823719237202372123722237232372423725237262372723728237292373023731237322373323734237352373623737237382373923740237412374223743237442374523746237472374823749237502375123752237532375423755237562375723758237592376023761237622376323764237652376623767237682376923770237712377223773237742377523776237772377823779237802378123782237832378423785237862378723788237892379023791237922379323794237952379623797237982379923800238012380223803238042380523806238072380823809238102381123812238132381423815238162381723818238192382023821238222382323824238252382623827238282382923830238312383223833238342383523836238372383823839238402384123842238432384423845238462384723848238492385023851238522385323854238552385623857238582385923860238612386223863238642386523866238672386823869238702387123872238732387423875238762387723878238792388023881238822388323884238852388623887238882388923890238912389223893238942389523896238972389823899239002390123902239032390423905239062390723908239092391023911239122391323914239152391623917239182391923920239212392223923239242392523926239272392823929239302393123932239332393423935239362393723938239392394023941239422394323944239452394623947239482394923950239512395223953239542395523956239572395823959239602396123962239632396423965239662396723968239692397023971239722397323974239752397623977239782397923980239812398223983239842398523986239872398823989239902399123992239932399423995239962399723998239992400024001240022400324004240052400624007240082400924010240112401224013240142401524016240172401824019240202402124022240232402424025240262402724028240292403024031240322403324034240352403624037240382403924040240412404224043240442404524046240472404824049240502405124052240532405424055240562405724058240592406024061240622406324064240652406624067240682406924070240712407224073240742407524076240772407824079240802408124082240832408424085240862408724088240892409024091240922409324094240952409624097240982409924100241012410224103241042410524106241072410824109241102411124112241132411424115241162411724118241192412024121241222412324124241252412624127241282412924130241312413224133241342413524136241372413824139241402414124142241432414424145241462414724148241492415024151241522415324154241552415624157241582415924160241612416224163241642416524166241672416824169241702417124172241732417424175241762417724178241792418024181241822418324184241852418624187241882418924190241912419224193241942419524196241972419824199242002420124202242032420424205242062420724208242092421024211242122421324214242152421624217242182421924220242212422224223242242422524226242272422824229242302423124232242332423424235242362423724238242392424024241242422424324244242452424624247242482424924250242512425224253242542425524256242572425824259242602426124262242632426424265242662426724268242692427024271242722427324274242752427624277242782427924280242812428224283242842428524286242872428824289242902429124292242932429424295242962429724298242992430024301243022430324304243052430624307243082430924310243112431224313243142431524316243172431824319243202432124322243232432424325243262432724328243292433024331243322433324334243352433624337243382433924340243412434224343243442434524346243472434824349243502435124352243532435424355243562435724358243592436024361243622436324364243652436624367243682436924370243712437224373243742437524376243772437824379243802438124382243832438424385243862438724388243892439024391243922439324394243952439624397243982439924400244012440224403244042440524406244072440824409244102441124412244132441424415244162441724418244192442024421244222442324424244252442624427244282442924430244312443224433244342443524436244372443824439244402444124442244432444424445244462444724448244492445024451244522445324454244552445624457244582445924460244612446224463244642446524466244672446824469244702447124472244732447424475244762447724478244792448024481244822448324484244852448624487244882448924490244912449224493244942449524496244972449824499245002450124502245032450424505245062450724508245092451024511245122451324514245152451624517245182451924520245212452224523245242452524526245272452824529245302453124532245332453424535245362453724538245392454024541245422454324544245452454624547245482454924550245512455224553245542455524556245572455824559245602456124562245632456424565245662456724568245692457024571245722457324574245752457624577245782457924580245812458224583245842458524586245872458824589245902459124592245932459424595245962459724598245992460024601246022460324604246052460624607246082460924610246112461224613246142461524616246172461824619246202462124622246232462424625246262462724628246292463024631246322463324634246352463624637246382463924640246412464224643246442464524646246472464824649246502465124652246532465424655246562465724658246592466024661246622466324664246652466624667246682466924670246712467224673246742467524676246772467824679246802468124682246832468424685246862468724688246892469024691246922469324694246952469624697246982469924700247012470224703247042470524706247072470824709247102471124712247132471424715247162471724718247192472024721247222472324724247252472624727247282472924730247312473224733247342473524736247372473824739247402474124742247432474424745247462474724748247492475024751247522475324754247552475624757247582475924760247612476224763247642476524766247672476824769247702477124772247732477424775247762477724778247792478024781247822478324784247852478624787247882478924790247912479224793247942479524796247972479824799248002480124802248032480424805248062480724808248092481024811248122481324814248152481624817248182481924820248212482224823248242482524826248272482824829248302483124832248332483424835248362483724838248392484024841248422484324844248452484624847248482484924850248512485224853248542485524856248572485824859248602486124862248632486424865248662486724868248692487024871248722487324874248752487624877248782487924880248812488224883248842488524886248872488824889248902489124892248932489424895248962489724898248992490024901249022490324904249052490624907249082490924910249112491224913249142491524916249172491824919249202492124922249232492424925249262492724928249292493024931249322493324934249352493624937249382493924940249412494224943249442494524946249472494824949249502495124952249532495424955249562495724958249592496024961249622496324964249652496624967249682496924970249712497224973249742497524976249772497824979249802498124982249832498424985249862498724988249892499024991249922499324994249952499624997249982499925000250012500225003250042500525006250072500825009250102501125012250132501425015250162501725018250192502025021250222502325024250252502625027250282502925030250312503225033250342503525036250372503825039250402504125042250432504425045250462504725048250492505025051250522505325054250552505625057250582505925060250612506225063250642506525066250672506825069250702507125072250732507425075250762507725078250792508025081250822508325084250852508625087250882508925090250912509225093250942509525096250972509825099251002510125102251032510425105251062510725108251092511025111251122511325114251152511625117251182511925120251212512225123251242512525126251272512825129251302513125132251332513425135251362513725138251392514025141251422514325144251452514625147251482514925150251512515225153251542515525156251572515825159251602516125162251632516425165251662516725168251692517025171251722517325174251752517625177251782517925180251812518225183251842518525186251872518825189251902519125192251932519425195251962519725198251992520025201252022520325204252052520625207252082520925210252112521225213252142521525216252172521825219252202522125222252232522425225252262522725228252292523025231252322523325234252352523625237252382523925240252412524225243252442524525246252472524825249252502525125252252532525425255252562525725258252592526025261252622526325264252652526625267252682526925270252712527225273252742527525276252772527825279252802528125282252832528425285252862528725288252892529025291252922529325294252952529625297252982529925300253012530225303253042530525306253072530825309253102531125312253132531425315253162531725318253192532025321253222532325324253252532625327253282532925330253312533225333253342533525336253372533825339253402534125342253432534425345253462534725348253492535025351253522535325354253552535625357253582535925360253612536225363253642536525366253672536825369253702537125372253732537425375253762537725378253792538025381253822538325384253852538625387253882538925390253912539225393253942539525396253972539825399254002540125402254032540425405254062540725408254092541025411254122541325414254152541625417254182541925420254212542225423254242542525426254272542825429254302543125432254332543425435254362543725438254392544025441254422544325444254452544625447254482544925450254512545225453254542545525456254572545825459254602546125462254632546425465254662546725468254692547025471254722547325474254752547625477254782547925480254812548225483254842548525486254872548825489254902549125492254932549425495254962549725498254992550025501255022550325504255052550625507255082550925510255112551225513255142551525516255172551825519255202552125522255232552425525255262552725528255292553025531255322553325534255352553625537255382553925540255412554225543255442554525546255472554825549255502555125552255532555425555255562555725558255592556025561255622556325564255652556625567255682556925570255712557225573255742557525576255772557825579255802558125582255832558425585255862558725588255892559025591255922559325594255952559625597255982559925600256012560225603256042560525606256072560825609256102561125612256132561425615256162561725618256192562025621256222562325624256252562625627256282562925630256312563225633256342563525636256372563825639256402564125642256432564425645256462564725648256492565025651256522565325654256552565625657256582565925660256612566225663256642566525666256672566825669256702567125672256732567425675256762567725678256792568025681256822568325684256852568625687256882568925690256912569225693256942569525696256972569825699257002570125702257032570425705257062570725708257092571025711257122571325714257152571625717257182571925720257212572225723257242572525726257272572825729257302573125732257332573425735257362573725738257392574025741257422574325744257452574625747257482574925750257512575225753257542575525756257572575825759257602576125762257632576425765257662576725768257692577025771257722577325774257752577625777257782577925780257812578225783257842578525786257872578825789257902579125792257932579425795257962579725798257992580025801258022580325804258052580625807258082580925810258112581225813258142581525816258172581825819258202582125822258232582425825258262582725828258292583025831258322583325834258352583625837258382583925840258412584225843258442584525846258472584825849258502585125852258532585425855258562585725858258592586025861258622586325864258652586625867258682586925870258712587225873258742587525876258772587825879258802588125882258832588425885258862588725888258892589025891258922589325894258952589625897258982589925900259012590225903259042590525906259072590825909259102591125912259132591425915259162591725918259192592025921259222592325924259252592625927259282592925930259312593225933259342593525936259372593825939259402594125942259432594425945259462594725948259492595025951259522595325954259552595625957259582595925960259612596225963259642596525966259672596825969259702597125972259732597425975259762597725978259792598025981259822598325984259852598625987259882598925990259912599225993259942599525996259972599825999260002600126002260032600426005260062600726008260092601026011260122601326014260152601626017260182601926020260212602226023260242602526026260272602826029260302603126032260332603426035260362603726038260392604026041260422604326044260452604626047260482604926050260512605226053260542605526056260572605826059260602606126062260632606426065260662606726068260692607026071260722607326074260752607626077260782607926080260812608226083260842608526086260872608826089260902609126092260932609426095260962609726098260992610026101261022610326104261052610626107261082610926110261112611226113261142611526116261172611826119261202612126122261232612426125261262612726128261292613026131261322613326134261352613626137261382613926140261412614226143261442614526146261472614826149261502615126152261532615426155261562615726158261592616026161261622616326164261652616626167261682616926170261712617226173261742617526176261772617826179261802618126182261832618426185261862618726188261892619026191261922619326194261952619626197261982619926200262012620226203262042620526206262072620826209262102621126212262132621426215262162621726218262192622026221262222622326224262252622626227262282622926230262312623226233262342623526236262372623826239262402624126242262432624426245262462624726248262492625026251262522625326254262552625626257262582625926260262612626226263262642626526266262672626826269262702627126272262732627426275262762627726278262792628026281262822628326284262852628626287262882628926290262912629226293262942629526296262972629826299263002630126302263032630426305263062630726308263092631026311263122631326314263152631626317263182631926320263212632226323263242632526326263272632826329263302633126332263332633426335263362633726338263392634026341263422634326344263452634626347263482634926350263512635226353263542635526356263572635826359263602636126362263632636426365263662636726368263692637026371263722637326374263752637626377263782637926380263812638226383263842638526386263872638826389263902639126392263932639426395263962639726398263992640026401264022640326404264052640626407264082640926410264112641226413264142641526416264172641826419264202642126422264232642426425264262642726428264292643026431264322643326434264352643626437264382643926440264412644226443264442644526446264472644826449264502645126452264532645426455264562645726458264592646026461264622646326464264652646626467264682646926470264712647226473264742647526476264772647826479264802648126482264832648426485264862648726488264892649026491264922649326494264952649626497264982649926500265012650226503265042650526506265072650826509265102651126512265132651426515265162651726518265192652026521265222652326524265252652626527265282652926530265312653226533265342653526536265372653826539265402654126542265432654426545265462654726548265492655026551265522655326554265552655626557265582655926560265612656226563265642656526566265672656826569265702657126572265732657426575265762657726578265792658026581265822658326584265852658626587265882658926590265912659226593265942659526596265972659826599266002660126602266032660426605266062660726608266092661026611266122661326614266152661626617266182661926620266212662226623266242662526626266272662826629266302663126632266332663426635266362663726638266392664026641266422664326644266452664626647266482664926650266512665226653266542665526656266572665826659266602666126662266632666426665266662666726668266692667026671266722667326674266752667626677266782667926680266812668226683266842668526686266872668826689266902669126692266932669426695266962669726698266992670026701267022670326704267052670626707267082670926710267112671226713267142671526716267172671826719267202672126722267232672426725267262672726728267292673026731267322673326734267352673626737267382673926740267412674226743267442674526746267472674826749267502675126752267532675426755267562675726758267592676026761267622676326764267652676626767267682676926770267712677226773267742677526776267772677826779267802678126782267832678426785267862678726788267892679026791267922679326794267952679626797267982679926800268012680226803268042680526806268072680826809268102681126812268132681426815268162681726818268192682026821268222682326824268252682626827268282682926830268312683226833268342683526836268372683826839268402684126842268432684426845268462684726848268492685026851268522685326854268552685626857268582685926860268612686226863268642686526866268672686826869268702687126872268732687426875268762687726878268792688026881268822688326884268852688626887268882688926890268912689226893268942689526896268972689826899269002690126902269032690426905269062690726908269092691026911269122691326914269152691626917269182691926920269212692226923269242692526926269272692826929269302693126932269332693426935269362693726938269392694026941269422694326944269452694626947269482694926950269512695226953269542695526956269572695826959269602696126962269632696426965269662696726968269692697026971269722697326974269752697626977269782697926980269812698226983269842698526986269872698826989269902699126992269932699426995269962699726998269992700027001270022700327004270052700627007270082700927010270112701227013270142701527016270172701827019270202702127022270232702427025270262702727028270292703027031270322703327034270352703627037270382703927040270412704227043270442704527046270472704827049270502705127052270532705427055270562705727058270592706027061270622706327064270652706627067270682706927070270712707227073270742707527076270772707827079270802708127082270832708427085270862708727088270892709027091270922709327094270952709627097270982709927100271012710227103271042710527106271072710827109271102711127112271132711427115271162711727118271192712027121271222712327124271252712627127271282712927130271312713227133271342713527136271372713827139271402714127142271432714427145271462714727148271492715027151271522715327154271552715627157271582715927160271612716227163271642716527166271672716827169271702717127172271732717427175271762717727178271792718027181271822718327184271852718627187271882718927190271912719227193271942719527196271972719827199272002720127202272032720427205272062720727208272092721027211272122721327214272152721627217272182721927220272212722227223272242722527226272272722827229272302723127232272332723427235272362723727238272392724027241272422724327244272452724627247272482724927250272512725227253272542725527256272572725827259272602726127262272632726427265272662726727268272692727027271272722727327274272752727627277272782727927280272812728227283272842728527286272872728827289272902729127292272932729427295272962729727298272992730027301273022730327304273052730627307273082730927310273112731227313273142731527316273172731827319273202732127322273232732427325273262732727328273292733027331273322733327334273352733627337273382733927340273412734227343273442734527346273472734827349273502735127352273532735427355273562735727358273592736027361273622736327364273652736627367273682736927370273712737227373273742737527376273772737827379273802738127382273832738427385273862738727388273892739027391273922739327394273952739627397273982739927400274012740227403274042740527406274072740827409274102741127412274132741427415274162741727418274192742027421274222742327424274252742627427274282742927430274312743227433274342743527436274372743827439274402744127442274432744427445274462744727448274492745027451274522745327454274552745627457274582745927460274612746227463274642746527466274672746827469274702747127472274732747427475274762747727478274792748027481274822748327484274852748627487274882748927490274912749227493274942749527496274972749827499275002750127502275032750427505275062750727508275092751027511275122751327514275152751627517275182751927520275212752227523275242752527526275272752827529275302753127532275332753427535275362753727538275392754027541275422754327544275452754627547275482754927550275512755227553275542755527556275572755827559275602756127562275632756427565275662756727568275692757027571275722757327574275752757627577275782757927580275812758227583275842758527586275872758827589275902759127592275932759427595275962759727598275992760027601276022760327604276052760627607276082760927610276112761227613276142761527616276172761827619276202762127622276232762427625276262762727628276292763027631276322763327634276352763627637276382763927640276412764227643276442764527646276472764827649276502765127652276532765427655276562765727658276592766027661276622766327664276652766627667276682766927670276712767227673276742767527676276772767827679276802768127682276832768427685276862768727688276892769027691276922769327694276952769627697276982769927700277012770227703277042770527706277072770827709277102771127712277132771427715277162771727718277192772027721277222772327724277252772627727277282772927730277312773227733277342773527736277372773827739277402774127742277432774427745277462774727748277492775027751277522775327754277552775627757277582775927760277612776227763277642776527766277672776827769277702777127772277732777427775277762777727778277792778027781277822778327784277852778627787277882778927790277912779227793277942779527796277972779827799278002780127802278032780427805278062780727808278092781027811278122781327814278152781627817278182781927820278212782227823278242782527826278272782827829278302783127832278332783427835278362783727838278392784027841278422784327844278452784627847278482784927850278512785227853278542785527856278572785827859278602786127862278632786427865278662786727868278692787027871278722787327874278752787627877278782787927880278812788227883278842788527886278872788827889278902789127892278932789427895278962789727898278992790027901279022790327904279052790627907279082790927910279112791227913279142791527916279172791827919279202792127922279232792427925279262792727928279292793027931279322793327934279352793627937279382793927940279412794227943279442794527946279472794827949279502795127952279532795427955279562795727958279592796027961279622796327964279652796627967279682796927970279712797227973279742797527976279772797827979279802798127982279832798427985279862798727988279892799027991279922799327994279952799627997279982799928000280012800228003280042800528006280072800828009280102801128012280132801428015280162801728018280192802028021280222802328024280252802628027280282802928030280312803228033280342803528036280372803828039280402804128042280432804428045280462804728048280492805028051280522805328054280552805628057280582805928060280612806228063280642806528066280672806828069280702807128072280732807428075280762807728078280792808028081280822808328084280852808628087280882808928090280912809228093280942809528096280972809828099281002810128102281032810428105281062810728108281092811028111281122811328114281152811628117281182811928120281212812228123281242812528126281272812828129281302813128132281332813428135281362813728138281392814028141281422814328144281452814628147281482814928150281512815228153281542815528156281572815828159281602816128162281632816428165281662816728168281692817028171281722817328174281752817628177281782817928180281812818228183281842818528186281872818828189281902819128192281932819428195281962819728198281992820028201282022820328204282052820628207282082820928210282112821228213282142821528216282172821828219282202822128222282232822428225282262822728228282292823028231282322823328234282352823628237282382823928240282412824228243282442824528246282472824828249282502825128252282532825428255282562825728258282592826028261282622826328264282652826628267282682826928270282712827228273282742827528276282772827828279282802828128282282832828428285282862828728288282892829028291282922829328294282952829628297282982829928300283012830228303283042830528306283072830828309283102831128312283132831428315283162831728318283192832028321283222832328324283252832628327283282832928330283312833228333283342833528336283372833828339283402834128342283432834428345283462834728348283492835028351283522835328354283552835628357283582835928360283612836228363283642836528366283672836828369283702837128372283732837428375283762837728378283792838028381283822838328384283852838628387283882838928390283912839228393283942839528396283972839828399284002840128402284032840428405284062840728408284092841028411284122841328414284152841628417284182841928420284212842228423284242842528426284272842828429284302843128432284332843428435284362843728438284392844028441284422844328444284452844628447284482844928450284512845228453284542845528456284572845828459284602846128462284632846428465284662846728468284692847028471284722847328474284752847628477284782847928480284812848228483284842848528486284872848828489284902849128492284932849428495284962849728498284992850028501285022850328504285052850628507285082850928510285112851228513285142851528516285172851828519285202852128522285232852428525285262852728528285292853028531285322853328534285352853628537285382853928540285412854228543285442854528546285472854828549285502855128552285532855428555285562855728558285592856028561285622856328564285652856628567285682856928570285712857228573285742857528576285772857828579285802858128582285832858428585285862858728588285892859028591285922859328594285952859628597285982859928600286012860228603286042860528606286072860828609286102861128612286132861428615286162861728618286192862028621286222862328624286252862628627286282862928630286312863228633286342863528636286372863828639286402864128642286432864428645286462864728648286492865028651286522865328654286552865628657286582865928660286612866228663286642866528666286672866828669286702867128672286732867428675286762867728678286792868028681286822868328684286852868628687286882868928690286912869228693286942869528696286972869828699287002870128702287032870428705287062870728708287092871028711287122871328714287152871628717287182871928720287212872228723287242872528726287272872828729287302873128732287332873428735287362873728738287392874028741287422874328744287452874628747287482874928750287512875228753287542875528756287572875828759287602876128762287632876428765287662876728768287692877028771287722877328774287752877628777287782877928780287812878228783287842878528786287872878828789287902879128792287932879428795287962879728798287992880028801288022880328804288052880628807288082880928810288112881228813288142881528816288172881828819288202882128822288232882428825288262882728828288292883028831288322883328834288352883628837288382883928840288412884228843288442884528846288472884828849288502885128852288532885428855288562885728858288592886028861288622886328864288652886628867288682886928870288712887228873288742887528876288772887828879288802888128882288832888428885288862888728888288892889028891288922889328894288952889628897288982889928900289012890228903289042890528906289072890828909289102891128912289132891428915289162891728918289192892028921289222892328924289252892628927289282892928930289312893228933289342893528936289372893828939289402894128942289432894428945289462894728948289492895028951289522895328954289552895628957289582895928960289612896228963289642896528966289672896828969289702897128972289732897428975289762897728978289792898028981289822898328984289852898628987289882898928990289912899228993289942899528996289972899828999290002900129002290032900429005290062900729008290092901029011290122901329014290152901629017290182901929020290212902229023290242902529026290272902829029290302903129032290332903429035290362903729038290392904029041290422904329044290452904629047290482904929050290512905229053290542905529056290572905829059290602906129062290632906429065290662906729068290692907029071290722907329074290752907629077290782907929080290812908229083290842908529086290872908829089290902909129092290932909429095290962909729098290992910029101291022910329104291052910629107291082910929110291112911229113291142911529116291172911829119291202912129122291232912429125291262912729128291292913029131291322913329134291352913629137291382913929140291412914229143291442914529146291472914829149291502915129152291532915429155291562915729158291592916029161291622916329164291652916629167291682916929170291712917229173291742917529176291772917829179291802918129182291832918429185291862918729188291892919029191291922919329194291952919629197291982919929200292012920229203292042920529206292072920829209292102921129212292132921429215292162921729218292192922029221292222922329224292252922629227292282922929230292312923229233292342923529236292372923829239292402924129242292432924429245292462924729248292492925029251292522925329254292552925629257292582925929260292612926229263292642926529266292672926829269292702927129272292732927429275292762927729278292792928029281292822928329284292852928629287292882928929290292912929229293292942929529296292972929829299293002930129302293032930429305293062930729308293092931029311293122931329314293152931629317293182931929320293212932229323293242932529326293272932829329293302933129332293332933429335293362933729338293392934029341293422934329344293452934629347293482934929350293512935229353293542935529356293572935829359293602936129362293632936429365293662936729368293692937029371293722937329374293752937629377293782937929380293812938229383293842938529386293872938829389293902939129392293932939429395293962939729398293992940029401294022940329404294052940629407294082940929410294112941229413294142941529416294172941829419294202942129422294232942429425294262942729428294292943029431294322943329434294352943629437294382943929440294412944229443294442944529446294472944829449294502945129452294532945429455294562945729458294592946029461294622946329464294652946629467294682946929470294712947229473294742947529476294772947829479294802948129482294832948429485294862948729488294892949029491294922949329494294952949629497294982949929500295012950229503295042950529506295072950829509295102951129512295132951429515295162951729518295192952029521295222952329524295252952629527295282952929530295312953229533295342953529536295372953829539295402954129542295432954429545295462954729548295492955029551295522955329554295552955629557295582955929560295612956229563295642956529566295672956829569295702957129572295732957429575295762957729578295792958029581295822958329584295852958629587295882958929590295912959229593295942959529596295972959829599296002960129602296032960429605296062960729608296092961029611296122961329614296152961629617296182961929620296212962229623296242962529626296272962829629296302963129632296332963429635296362963729638296392964029641296422964329644296452964629647296482964929650296512965229653296542965529656296572965829659296602966129662296632966429665296662966729668296692967029671296722967329674296752967629677296782967929680296812968229683296842968529686296872968829689296902969129692296932969429695296962969729698296992970029701297022970329704297052970629707297082970929710297112971229713297142971529716297172971829719297202972129722297232972429725297262972729728297292973029731297322973329734297352973629737297382973929740297412974229743297442974529746297472974829749297502975129752297532975429755297562975729758297592976029761297622976329764297652976629767297682976929770297712977229773297742977529776297772977829779297802978129782297832978429785297862978729788297892979029791297922979329794297952979629797297982979929800298012980229803298042980529806298072980829809298102981129812298132981429815298162981729818298192982029821298222982329824298252982629827298282982929830298312983229833298342983529836298372983829839298402984129842298432984429845298462984729848298492985029851298522985329854298552985629857298582985929860298612986229863298642986529866298672986829869298702987129872298732987429875298762987729878298792988029881298822988329884298852988629887298882988929890298912989229893298942989529896298972989829899299002990129902299032990429905299062990729908299092991029911299122991329914299152991629917299182991929920299212992229923299242992529926299272992829929299302993129932299332993429935299362993729938299392994029941299422994329944299452994629947299482994929950299512995229953299542995529956299572995829959299602996129962299632996429965299662996729968299692997029971299722997329974299752997629977299782997929980299812998229983299842998529986299872998829989299902999129992299932999429995299962999729998299993000030001300023000330004300053000630007300083000930010300113001230013300143001530016300173001830019300203002130022300233002430025300263002730028300293003030031300323003330034300353003630037300383003930040300413004230043300443004530046300473004830049300503005130052300533005430055300563005730058300593006030061300623006330064300653006630067300683006930070300713007230073300743007530076300773007830079300803008130082300833008430085300863008730088300893009030091300923009330094300953009630097300983009930100301013010230103301043010530106301073010830109301103011130112301133011430115301163011730118301193012030121301223012330124301253012630127301283012930130301313013230133301343013530136301373013830139301403014130142301433014430145301463014730148301493015030151301523015330154301553015630157301583015930160301613016230163301643016530166301673016830169301703017130172301733017430175301763017730178301793018030181301823018330184301853018630187301883018930190301913019230193301943019530196301973019830199302003020130202302033020430205302063020730208302093021030211302123021330214302153021630217302183021930220302213022230223302243022530226302273022830229302303023130232302333023430235302363023730238302393024030241302423024330244302453024630247302483024930250302513025230253302543025530256302573025830259302603026130262302633026430265302663026730268302693027030271302723027330274302753027630277302783027930280302813028230283302843028530286302873028830289302903029130292302933029430295302963029730298302993030030301303023030330304303053030630307303083030930310303113031230313303143031530316303173031830319303203032130322303233032430325303263032730328303293033030331303323033330334303353033630337303383033930340303413034230343303443034530346303473034830349303503035130352303533035430355303563035730358303593036030361303623036330364303653036630367303683036930370303713037230373303743037530376303773037830379303803038130382303833038430385303863038730388303893039030391303923039330394303953039630397303983039930400304013040230403304043040530406304073040830409304103041130412304133041430415304163041730418304193042030421304223042330424304253042630427304283042930430304313043230433304343043530436304373043830439304403044130442304433044430445304463044730448304493045030451304523045330454304553045630457304583045930460304613046230463304643046530466304673046830469304703047130472304733047430475304763047730478304793048030481304823048330484304853048630487304883048930490304913049230493304943049530496304973049830499305003050130502305033050430505305063050730508305093051030511305123051330514305153051630517305183051930520305213052230523305243052530526305273052830529305303053130532305333053430535305363053730538305393054030541305423054330544305453054630547305483054930550305513055230553305543055530556305573055830559305603056130562305633056430565305663056730568305693057030571305723057330574305753057630577305783057930580305813058230583305843058530586305873058830589305903059130592305933059430595305963059730598305993060030601306023060330604306053060630607306083060930610306113061230613306143061530616306173061830619306203062130622306233062430625306263062730628306293063030631306323063330634306353063630637306383063930640306413064230643306443064530646306473064830649306503065130652306533065430655306563065730658306593066030661306623066330664306653066630667306683066930670306713067230673306743067530676306773067830679306803068130682306833068430685306863068730688306893069030691306923069330694306953069630697306983069930700307013070230703307043070530706307073070830709307103071130712307133071430715307163071730718307193072030721307223072330724307253072630727307283072930730307313073230733307343073530736307373073830739307403074130742307433074430745307463074730748307493075030751307523075330754307553075630757307583075930760307613076230763307643076530766307673076830769307703077130772307733077430775307763077730778307793078030781307823078330784307853078630787307883078930790307913079230793307943079530796307973079830799308003080130802308033080430805308063080730808308093081030811308123081330814308153081630817308183081930820308213082230823308243082530826308273082830829308303083130832308333083430835308363083730838308393084030841308423084330844308453084630847308483084930850308513085230853308543085530856308573085830859308603086130862308633086430865308663086730868308693087030871308723087330874308753087630877308783087930880308813088230883308843088530886308873088830889308903089130892308933089430895308963089730898308993090030901309023090330904309053090630907309083090930910309113091230913309143091530916309173091830919309203092130922309233092430925309263092730928309293093030931309323093330934309353093630937309383093930940309413094230943309443094530946309473094830949309503095130952309533095430955309563095730958309593096030961309623096330964309653096630967309683096930970309713097230973309743097530976309773097830979309803098130982309833098430985309863098730988309893099030991309923099330994309953099630997309983099931000310013100231003310043100531006310073100831009310103101131012310133101431015310163101731018310193102031021310223102331024310253102631027310283102931030310313103231033310343103531036310373103831039310403104131042310433104431045310463104731048310493105031051310523105331054310553105631057310583105931060310613106231063310643106531066310673106831069310703107131072310733107431075310763107731078310793108031081310823108331084310853108631087310883108931090310913109231093310943109531096310973109831099311003110131102311033110431105311063110731108311093111031111311123111331114311153111631117311183111931120311213112231123311243112531126311273112831129311303113131132311333113431135311363113731138311393114031141311423114331144311453114631147311483114931150311513115231153311543115531156311573115831159311603116131162311633116431165311663116731168311693117031171311723117331174311753117631177311783117931180311813118231183311843118531186311873118831189311903119131192311933119431195311963119731198311993120031201312023120331204312053120631207312083120931210312113121231213312143121531216312173121831219312203122131222312233122431225312263122731228312293123031231312323123331234312353123631237312383123931240312413124231243312443124531246312473124831249312503125131252312533125431255312563125731258312593126031261312623126331264312653126631267312683126931270312713127231273312743127531276312773127831279312803128131282312833128431285312863128731288312893129031291312923129331294312953129631297312983129931300313013130231303313043130531306313073130831309313103131131312313133131431315313163131731318313193132031321313223132331324313253132631327313283132931330313313133231333313343133531336313373133831339313403134131342313433134431345313463134731348313493135031351313523135331354313553135631357313583135931360313613136231363313643136531366313673136831369313703137131372313733137431375313763137731378313793138031381313823138331384313853138631387313883138931390313913139231393313943139531396313973139831399314003140131402314033140431405314063140731408314093141031411314123141331414314153141631417314183141931420314213142231423314243142531426314273142831429314303143131432314333143431435314363143731438314393144031441314423144331444314453144631447314483144931450314513145231453314543145531456314573145831459314603146131462314633146431465314663146731468314693147031471314723147331474314753147631477314783147931480314813148231483314843148531486314873148831489314903149131492314933149431495314963149731498314993150031501315023150331504315053150631507315083150931510315113151231513315143151531516315173151831519315203152131522315233152431525315263152731528315293153031531315323153331534315353153631537315383153931540315413154231543315443154531546315473154831549315503155131552315533155431555315563155731558315593156031561315623156331564315653156631567315683156931570315713157231573315743157531576315773157831579315803158131582315833158431585315863158731588315893159031591315923159331594315953159631597315983159931600316013160231603316043160531606316073160831609316103161131612316133161431615316163161731618316193162031621316223162331624316253162631627316283162931630316313163231633316343163531636316373163831639316403164131642316433164431645316463164731648316493165031651316523165331654316553165631657316583165931660316613166231663316643166531666316673166831669316703167131672316733167431675316763167731678316793168031681316823168331684316853168631687316883168931690316913169231693316943169531696316973169831699317003170131702317033170431705317063170731708317093171031711317123171331714317153171631717317183171931720317213172231723317243172531726317273172831729317303173131732317333173431735317363173731738317393174031741317423174331744317453174631747317483174931750317513175231753317543175531756317573175831759317603176131762317633176431765317663176731768317693177031771317723177331774317753177631777317783177931780317813178231783317843178531786317873178831789317903179131792317933179431795317963179731798317993180031801318023180331804318053180631807318083180931810318113181231813318143181531816318173181831819318203182131822318233182431825318263182731828318293183031831318323183331834318353183631837318383183931840318413184231843318443184531846318473184831849318503185131852318533185431855318563185731858318593186031861318623186331864318653186631867318683186931870318713187231873318743187531876318773187831879318803188131882318833188431885318863188731888318893189031891318923189331894318953189631897318983189931900319013190231903319043190531906319073190831909319103191131912319133191431915319163191731918319193192031921319223192331924319253192631927319283192931930319313193231933319343193531936319373193831939319403194131942319433194431945319463194731948319493195031951319523195331954319553195631957319583195931960319613196231963319643196531966319673196831969319703197131972319733197431975319763197731978319793198031981319823198331984319853198631987319883198931990319913199231993319943199531996319973199831999320003200132002320033200432005320063200732008320093201032011320123201332014320153201632017320183201932020320213202232023320243202532026320273202832029320303203132032320333203432035320363203732038320393204032041320423204332044320453204632047320483204932050320513205232053320543205532056320573205832059320603206132062320633206432065320663206732068320693207032071320723207332074320753207632077320783207932080320813208232083320843208532086320873208832089320903209132092320933209432095320963209732098320993210032101321023210332104321053210632107321083210932110321113211232113321143211532116321173211832119321203212132122321233212432125321263212732128321293213032131321323213332134321353213632137321383213932140321413214232143321443214532146321473214832149321503215132152321533215432155321563215732158321593216032161321623216332164321653216632167321683216932170321713217232173321743217532176321773217832179321803218132182321833218432185321863218732188321893219032191321923219332194321953219632197321983219932200322013220232203322043220532206322073220832209322103221132212322133221432215322163221732218322193222032221322223222332224322253222632227322283222932230322313223232233322343223532236322373223832239322403224132242322433224432245322463224732248322493225032251322523225332254322553225632257322583225932260322613226232263322643226532266322673226832269322703227132272322733227432275322763227732278322793228032281322823228332284322853228632287322883228932290322913229232293322943229532296322973229832299323003230132302323033230432305323063230732308323093231032311323123231332314323153231632317323183231932320323213232232323323243232532326323273232832329323303233132332323333233432335323363233732338323393234032341323423234332344323453234632347323483234932350323513235232353323543235532356323573235832359323603236132362323633236432365323663236732368323693237032371323723237332374323753237632377323783237932380323813238232383323843238532386323873238832389323903239132392323933239432395323963239732398323993240032401324023240332404324053240632407324083240932410324113241232413324143241532416324173241832419324203242132422324233242432425324263242732428324293243032431324323243332434324353243632437324383243932440324413244232443324443244532446324473244832449324503245132452324533245432455324563245732458324593246032461324623246332464324653246632467324683246932470324713247232473324743247532476324773247832479324803248132482324833248432485324863248732488324893249032491324923249332494324953249632497324983249932500325013250232503325043250532506325073250832509325103251132512325133251432515325163251732518325193252032521325223252332524325253252632527325283252932530325313253232533325343253532536325373253832539325403254132542325433254432545325463254732548325493255032551325523255332554325553255632557325583255932560325613256232563325643256532566325673256832569325703257132572325733257432575325763257732578325793258032581325823258332584325853258632587325883258932590325913259232593325943259532596325973259832599326003260132602326033260432605326063260732608326093261032611326123261332614326153261632617326183261932620326213262232623326243262532626326273262832629326303263132632326333263432635326363263732638326393264032641326423264332644326453264632647326483264932650326513265232653326543265532656326573265832659326603266132662326633266432665326663266732668326693267032671326723267332674326753267632677326783267932680326813268232683326843268532686326873268832689326903269132692326933269432695326963269732698326993270032701327023270332704327053270632707327083270932710327113271232713327143271532716327173271832719327203272132722327233272432725327263272732728327293273032731327323273332734327353273632737327383273932740327413274232743327443274532746327473274832749327503275132752327533275432755327563275732758327593276032761327623276332764327653276632767327683276932770327713277232773327743277532776327773277832779327803278132782327833278432785327863278732788327893279032791327923279332794327953279632797327983279932800328013280232803328043280532806328073280832809328103281132812328133281432815328163281732818328193282032821328223282332824328253282632827328283282932830328313283232833328343283532836328373283832839328403284132842328433284432845328463284732848328493285032851328523285332854328553285632857328583285932860328613286232863328643286532866328673286832869328703287132872328733287432875328763287732878328793288032881328823288332884328853288632887328883288932890328913289232893328943289532896328973289832899329003290132902329033290432905329063290732908329093291032911329123291332914329153291632917329183291932920329213292232923329243292532926329273292832929329303293132932329333293432935329363293732938329393294032941329423294332944329453294632947329483294932950329513295232953329543295532956329573295832959329603296132962329633296432965329663296732968329693297032971329723297332974329753297632977329783297932980329813298232983329843298532986329873298832989329903299132992329933299432995329963299732998329993300033001330023300333004330053300633007330083300933010330113301233013330143301533016330173301833019330203302133022330233302433025330263302733028330293303033031330323303333034330353303633037330383303933040330413304233043330443304533046330473304833049330503305133052330533305433055330563305733058330593306033061330623306333064330653306633067330683306933070330713307233073330743307533076330773307833079330803308133082330833308433085330863308733088330893309033091330923309333094330953309633097330983309933100331013310233103331043310533106331073310833109331103311133112331133311433115331163311733118331193312033121331223312333124331253312633127331283312933130331313313233133331343313533136331373313833139331403314133142331433314433145331463314733148331493315033151331523315333154331553315633157331583315933160331613316233163331643316533166331673316833169331703317133172331733317433175331763317733178331793318033181331823318333184331853318633187331883318933190331913319233193331943319533196331973319833199332003320133202332033320433205332063320733208332093321033211332123321333214332153321633217332183321933220332213322233223332243322533226332273322833229332303323133232332333323433235332363323733238332393324033241332423324333244332453324633247332483324933250332513325233253332543325533256332573325833259332603326133262332633326433265332663326733268332693327033271332723327333274332753327633277332783327933280332813328233283332843328533286332873328833289332903329133292332933329433295332963329733298332993330033301333023330333304333053330633307333083330933310333113331233313333143331533316333173331833319333203332133322333233332433325333263332733328333293333033331333323333333334333353333633337333383333933340333413334233343333443334533346333473334833349333503335133352333533335433355333563335733358333593336033361333623336333364333653336633367333683336933370333713337233373333743337533376333773337833379333803338133382333833338433385333863338733388333893339033391333923339333394333953339633397333983339933400334013340233403334043340533406334073340833409334103341133412334133341433415334163341733418334193342033421334223342333424334253342633427334283342933430334313343233433334343343533436334373343833439334403344133442334433344433445334463344733448334493345033451334523345333454334553345633457334583345933460334613346233463334643346533466334673346833469334703347133472334733347433475334763347733478334793348033481334823348333484334853348633487334883348933490334913349233493334943349533496334973349833499335003350133502335033350433505335063350733508335093351033511335123351333514335153351633517335183351933520335213352233523335243352533526335273352833529335303353133532335333353433535335363353733538335393354033541335423354333544335453354633547335483354933550335513355233553335543355533556335573355833559335603356133562335633356433565335663356733568335693357033571335723357333574335753357633577335783357933580335813358233583335843358533586335873358833589335903359133592335933359433595335963359733598335993360033601336023360333604336053360633607336083360933610336113361233613336143361533616336173361833619336203362133622336233362433625336263362733628336293363033631336323363333634336353363633637336383363933640336413364233643336443364533646336473364833649336503365133652336533365433655336563365733658336593366033661336623366333664336653366633667336683366933670336713367233673336743367533676336773367833679336803368133682336833368433685336863368733688336893369033691336923369333694336953369633697336983369933700337013370233703337043370533706337073370833709337103371133712337133371433715337163371733718337193372033721337223372333724337253372633727337283372933730337313373233733337343373533736337373373833739337403374133742337433374433745337463374733748337493375033751337523375333754337553375633757337583375933760337613376233763337643376533766337673376833769337703377133772337733377433775337763377733778337793378033781337823378333784337853378633787337883378933790337913379233793337943379533796337973379833799338003380133802338033380433805338063380733808338093381033811338123381333814338153381633817338183381933820338213382233823338243382533826338273382833829338303383133832338333383433835338363383733838338393384033841338423384333844338453384633847338483384933850338513385233853338543385533856338573385833859338603386133862338633386433865338663386733868338693387033871338723387333874338753387633877338783387933880338813388233883338843388533886338873388833889338903389133892338933389433895338963389733898338993390033901339023390333904339053390633907339083390933910339113391233913339143391533916339173391833919339203392133922339233392433925339263392733928339293393033931339323393333934339353393633937339383393933940339413394233943339443394533946339473394833949339503395133952339533395433955339563395733958339593396033961339623396333964339653396633967339683396933970339713397233973339743397533976339773397833979339803398133982339833398433985339863398733988339893399033991339923399333994339953399633997339983399934000340013400234003340043400534006340073400834009340103401134012340133401434015340163401734018340193402034021340223402334024340253402634027340283402934030340313403234033340343403534036340373403834039340403404134042340433404434045340463404734048340493405034051340523405334054340553405634057340583405934060340613406234063340643406534066340673406834069340703407134072340733407434075340763407734078340793408034081340823408334084340853408634087340883408934090340913409234093340943409534096340973409834099341003410134102341033410434105341063410734108341093411034111341123411334114341153411634117341183411934120341213412234123341243412534126341273412834129341303413134132341333413434135341363413734138341393414034141341423414334144341453414634147341483414934150341513415234153341543415534156341573415834159341603416134162341633416434165341663416734168341693417034171341723417334174341753417634177341783417934180341813418234183341843418534186341873418834189341903419134192341933419434195341963419734198341993420034201342023420334204342053420634207342083420934210342113421234213342143421534216342173421834219342203422134222342233422434225342263422734228342293423034231342323423334234342353423634237342383423934240342413424234243342443424534246342473424834249342503425134252342533425434255342563425734258342593426034261342623426334264342653426634267342683426934270342713427234273342743427534276342773427834279342803428134282342833428434285342863428734288342893429034291342923429334294342953429634297342983429934300343013430234303343043430534306343073430834309343103431134312343133431434315343163431734318343193432034321343223432334324343253432634327343283432934330343313433234333343343433534336343373433834339343403434134342343433434434345343463434734348343493435034351343523435334354343553435634357343583435934360343613436234363343643436534366343673436834369343703437134372343733437434375343763437734378343793438034381343823438334384343853438634387343883438934390343913439234393343943439534396343973439834399344003440134402344033440434405344063440734408344093441034411344123441334414344153441634417344183441934420344213442234423344243442534426344273442834429344303443134432344333443434435344363443734438344393444034441344423444334444344453444634447344483444934450344513445234453344543445534456344573445834459344603446134462344633446434465344663446734468344693447034471344723447334474344753447634477344783447934480344813448234483344843448534486344873448834489344903449134492344933449434495344963449734498344993450034501345023450334504345053450634507345083450934510345113451234513345143451534516345173451834519345203452134522345233452434525345263452734528345293453034531345323453334534345353453634537345383453934540345413454234543345443454534546345473454834549345503455134552345533455434555345563455734558345593456034561345623456334564345653456634567345683456934570345713457234573345743457534576345773457834579345803458134582345833458434585345863458734588345893459034591345923459334594345953459634597345983459934600346013460234603346043460534606346073460834609346103461134612346133461434615346163461734618346193462034621346223462334624346253462634627346283462934630346313463234633346343463534636346373463834639346403464134642346433464434645346463464734648346493465034651346523465334654346553465634657346583465934660346613466234663346643466534666346673466834669346703467134672346733467434675346763467734678346793468034681346823468334684346853468634687346883468934690346913469234693346943469534696346973469834699347003470134702347033470434705347063470734708347093471034711347123471334714347153471634717347183471934720347213472234723347243472534726347273472834729347303473134732347333473434735347363473734738347393474034741347423474334744347453474634747347483474934750347513475234753347543475534756347573475834759347603476134762347633476434765347663476734768347693477034771347723477334774347753477634777347783477934780347813478234783347843478534786347873478834789347903479134792347933479434795347963479734798347993480034801348023480334804348053480634807348083480934810348113481234813348143481534816348173481834819348203482134822348233482434825348263482734828348293483034831348323483334834348353483634837348383483934840348413484234843348443484534846348473484834849348503485134852348533485434855348563485734858348593486034861348623486334864348653486634867348683486934870348713487234873348743487534876348773487834879348803488134882348833488434885348863488734888348893489034891348923489334894348953489634897348983489934900349013490234903349043490534906349073490834909349103491134912349133491434915349163491734918349193492034921349223492334924349253492634927349283492934930349313493234933349343493534936349373493834939349403494134942349433494434945349463494734948349493495034951349523495334954349553495634957349583495934960349613496234963349643496534966349673496834969349703497134972349733497434975349763497734978349793498034981349823498334984349853498634987349883498934990349913499234993349943499534996349973499834999350003500135002350033500435005350063500735008350093501035011350123501335014350153501635017350183501935020350213502235023350243502535026350273502835029350303503135032350333503435035350363503735038350393504035041350423504335044350453504635047350483504935050350513505235053350543505535056350573505835059350603506135062350633506435065350663506735068350693507035071350723507335074350753507635077350783507935080350813508235083350843508535086350873508835089350903509135092350933509435095350963509735098350993510035101351023510335104351053510635107351083510935110351113511235113351143511535116351173511835119351203512135122351233512435125351263512735128351293513035131351323513335134351353513635137351383513935140351413514235143351443514535146351473514835149351503515135152351533515435155351563515735158351593516035161351623516335164351653516635167351683516935170351713517235173351743517535176351773517835179351803518135182351833518435185351863518735188351893519035191351923519335194351953519635197351983519935200352013520235203352043520535206352073520835209352103521135212352133521435215352163521735218352193522035221352223522335224352253522635227352283522935230352313523235233352343523535236352373523835239352403524135242352433524435245352463524735248352493525035251352523525335254352553525635257352583525935260352613526235263352643526535266352673526835269352703527135272352733527435275352763527735278352793528035281352823528335284352853528635287352883528935290352913529235293352943529535296352973529835299353003530135302353033530435305353063530735308353093531035311353123531335314353153531635317353183531935320353213532235323353243532535326353273532835329353303533135332353333533435335353363533735338353393534035341353423534335344353453534635347353483534935350353513535235353353543535535356353573535835359353603536135362353633536435365353663536735368353693537035371353723537335374353753537635377353783537935380353813538235383353843538535386353873538835389353903539135392353933539435395353963539735398353993540035401354023540335404354053540635407354083540935410354113541235413354143541535416354173541835419354203542135422354233542435425354263542735428354293543035431354323543335434354353543635437354383543935440354413544235443354443544535446354473544835449354503545135452354533545435455354563545735458354593546035461354623546335464354653546635467354683546935470354713547235473354743547535476354773547835479354803548135482354833548435485354863548735488354893549035491354923549335494354953549635497354983549935500355013550235503355043550535506355073550835509355103551135512355133551435515355163551735518355193552035521355223552335524355253552635527355283552935530355313553235533355343553535536355373553835539355403554135542355433554435545355463554735548355493555035551355523555335554355553555635557355583555935560355613556235563355643556535566355673556835569355703557135572355733557435575355763557735578355793558035581355823558335584355853558635587355883558935590355913559235593355943559535596355973559835599356003560135602356033560435605356063560735608356093561035611356123561335614356153561635617356183561935620356213562235623356243562535626356273562835629356303563135632356333563435635356363563735638356393564035641356423564335644356453564635647356483564935650356513565235653356543565535656356573565835659356603566135662356633566435665356663566735668356693567035671356723567335674356753567635677356783567935680356813568235683356843568535686356873568835689356903569135692356933569435695356963569735698356993570035701357023570335704357053570635707357083570935710357113571235713357143571535716357173571835719357203572135722357233572435725357263572735728357293573035731357323573335734357353573635737357383573935740357413574235743357443574535746357473574835749357503575135752357533575435755357563575735758357593576035761357623576335764357653576635767357683576935770357713577235773357743577535776357773577835779357803578135782357833578435785357863578735788357893579035791357923579335794357953579635797357983579935800358013580235803358043580535806358073580835809358103581135812358133581435815358163581735818358193582035821358223582335824358253582635827358283582935830358313583235833358343583535836358373583835839358403584135842358433584435845358463584735848358493585035851358523585335854358553585635857358583585935860358613586235863358643586535866358673586835869358703587135872358733587435875358763587735878358793588035881358823588335884358853588635887358883588935890358913589235893358943589535896358973589835899359003590135902359033590435905359063590735908359093591035911359123591335914359153591635917359183591935920359213592235923359243592535926359273592835929359303593135932359333593435935359363593735938359393594035941359423594335944359453594635947359483594935950359513595235953359543595535956359573595835959359603596135962359633596435965359663596735968359693597035971359723597335974359753597635977359783597935980359813598235983359843598535986359873598835989359903599135992359933599435995359963599735998359993600036001360023600336004360053600636007360083600936010360113601236013360143601536016360173601836019360203602136022360233602436025360263602736028360293603036031360323603336034360353603636037360383603936040360413604236043360443604536046360473604836049360503605136052360533605436055360563605736058360593606036061360623606336064360653606636067360683606936070360713607236073360743607536076360773607836079360803608136082360833608436085360863608736088360893609036091360923609336094360953609636097360983609936100361013610236103361043610536106361073610836109361103611136112361133611436115361163611736118361193612036121361223612336124361253612636127361283612936130361313613236133361343613536136361373613836139361403614136142361433614436145361463614736148361493615036151361523615336154361553615636157361583615936160361613616236163361643616536166361673616836169361703617136172361733617436175361763617736178361793618036181361823618336184361853618636187361883618936190361913619236193361943619536196361973619836199362003620136202362033620436205362063620736208362093621036211362123621336214362153621636217362183621936220362213622236223362243622536226362273622836229362303623136232362333623436235362363623736238362393624036241362423624336244362453624636247362483624936250362513625236253362543625536256362573625836259362603626136262362633626436265362663626736268362693627036271362723627336274362753627636277362783627936280362813628236283362843628536286362873628836289362903629136292362933629436295362963629736298362993630036301363023630336304363053630636307363083630936310363113631236313363143631536316363173631836319363203632136322363233632436325363263632736328363293633036331363323633336334363353633636337363383633936340363413634236343363443634536346363473634836349363503635136352363533635436355363563635736358363593636036361363623636336364363653636636367363683636936370363713637236373363743637536376363773637836379363803638136382363833638436385363863638736388363893639036391363923639336394363953639636397363983639936400364013640236403364043640536406364073640836409364103641136412364133641436415364163641736418364193642036421364223642336424364253642636427364283642936430364313643236433364343643536436364373643836439364403644136442364433644436445364463644736448364493645036451364523645336454364553645636457364583645936460364613646236463364643646536466364673646836469364703647136472364733647436475364763647736478364793648036481364823648336484364853648636487364883648936490364913649236493364943649536496364973649836499365003650136502365033650436505365063650736508365093651036511365123651336514365153651636517365183651936520365213652236523365243652536526365273652836529365303653136532365333653436535365363653736538365393654036541365423654336544365453654636547365483654936550365513655236553365543655536556365573655836559365603656136562365633656436565365663656736568365693657036571365723657336574365753657636577365783657936580365813658236583365843658536586365873658836589365903659136592365933659436595365963659736598365993660036601366023660336604366053660636607366083660936610366113661236613366143661536616366173661836619366203662136622366233662436625366263662736628366293663036631366323663336634366353663636637366383663936640366413664236643366443664536646366473664836649366503665136652366533665436655366563665736658366593666036661366623666336664366653666636667366683666936670366713667236673366743667536676366773667836679366803668136682366833668436685366863668736688366893669036691366923669336694366953669636697366983669936700367013670236703367043670536706367073670836709367103671136712367133671436715367163671736718367193672036721367223672336724367253672636727367283672936730367313673236733367343673536736367373673836739367403674136742367433674436745367463674736748367493675036751367523675336754367553675636757367583675936760367613676236763367643676536766367673676836769367703677136772367733677436775367763677736778367793678036781367823678336784367853678636787367883678936790367913679236793367943679536796367973679836799368003680136802368033680436805368063680736808368093681036811368123681336814368153681636817368183681936820368213682236823368243682536826368273682836829368303683136832368333683436835368363683736838368393684036841368423684336844368453684636847368483684936850368513685236853368543685536856368573685836859368603686136862368633686436865368663686736868368693687036871368723687336874368753687636877368783687936880368813688236883368843688536886368873688836889368903689136892368933689436895368963689736898368993690036901369023690336904369053690636907369083690936910369113691236913369143691536916369173691836919369203692136922369233692436925369263692736928369293693036931369323693336934369353693636937369383693936940369413694236943369443694536946369473694836949369503695136952369533695436955369563695736958369593696036961369623696336964369653696636967369683696936970369713697236973369743697536976369773697836979369803698136982369833698436985369863698736988369893699036991369923699336994369953699636997369983699937000370013700237003370043700537006370073700837009370103701137012370133701437015370163701737018370193702037021370223702337024370253702637027370283702937030370313703237033370343703537036370373703837039370403704137042370433704437045370463704737048370493705037051370523705337054370553705637057370583705937060370613706237063370643706537066370673706837069370703707137072370733707437075370763707737078370793708037081370823708337084370853708637087370883708937090370913709237093370943709537096370973709837099371003710137102371033710437105371063710737108371093711037111371123711337114371153711637117371183711937120371213712237123371243712537126371273712837129371303713137132371333713437135371363713737138371393714037141371423714337144371453714637147371483714937150371513715237153371543715537156371573715837159371603716137162371633716437165371663716737168371693717037171371723717337174371753717637177371783717937180371813718237183371843718537186371873718837189371903719137192371933719437195371963719737198371993720037201372023720337204372053720637207372083720937210372113721237213372143721537216372173721837219372203722137222372233722437225372263722737228372293723037231372323723337234372353723637237372383723937240372413724237243372443724537246372473724837249372503725137252372533725437255372563725737258372593726037261372623726337264372653726637267372683726937270372713727237273372743727537276372773727837279372803728137282372833728437285372863728737288372893729037291372923729337294372953729637297372983729937300373013730237303373043730537306373073730837309373103731137312373133731437315373163731737318373193732037321373223732337324373253732637327373283732937330373313733237333373343733537336373373733837339373403734137342373433734437345373463734737348373493735037351373523735337354373553735637357373583735937360373613736237363373643736537366373673736837369373703737137372373733737437375373763737737378373793738037381373823738337384373853738637387373883738937390373913739237393373943739537396373973739837399374003740137402374033740437405374063740737408374093741037411374123741337414374153741637417374183741937420374213742237423374243742537426374273742837429374303743137432374333743437435374363743737438374393744037441374423744337444374453744637447374483744937450374513745237453374543745537456374573745837459374603746137462374633746437465374663746737468374693747037471374723747337474374753747637477374783747937480374813748237483374843748537486374873748837489374903749137492374933749437495374963749737498374993750037501375023750337504375053750637507375083750937510375113751237513375143751537516375173751837519375203752137522375233752437525375263752737528375293753037531375323753337534375353753637537375383753937540375413754237543375443754537546375473754837549375503755137552375533755437555375563755737558375593756037561375623756337564375653756637567375683756937570375713757237573375743757537576375773757837579375803758137582375833758437585375863758737588375893759037591375923759337594375953759637597375983759937600376013760237603376043760537606376073760837609376103761137612376133761437615376163761737618376193762037621376223762337624376253762637627376283762937630376313763237633376343763537636376373763837639376403764137642376433764437645376463764737648376493765037651376523765337654376553765637657376583765937660376613766237663376643766537666376673766837669376703767137672376733767437675376763767737678376793768037681376823768337684376853768637687376883768937690376913769237693376943769537696376973769837699377003770137702377033770437705377063770737708377093771037711377123771337714377153771637717377183771937720377213772237723377243772537726377273772837729377303773137732377333773437735377363773737738377393774037741377423774337744377453774637747377483774937750377513775237753377543775537756377573775837759377603776137762377633776437765377663776737768377693777037771377723777337774377753777637777377783777937780377813778237783377843778537786377873778837789377903779137792377933779437795377963779737798377993780037801378023780337804378053780637807378083780937810378113781237813378143781537816378173781837819378203782137822378233782437825378263782737828378293783037831378323783337834378353783637837378383783937840378413784237843378443784537846378473784837849378503785137852378533785437855378563785737858378593786037861378623786337864378653786637867378683786937870378713787237873378743787537876378773787837879378803788137882378833788437885378863788737888378893789037891378923789337894378953789637897378983789937900379013790237903379043790537906379073790837909379103791137912379133791437915379163791737918379193792037921379223792337924379253792637927379283792937930379313793237933379343793537936379373793837939379403794137942379433794437945379463794737948379493795037951379523795337954379553795637957379583795937960379613796237963379643796537966379673796837969379703797137972379733797437975379763797737978379793798037981379823798337984379853798637987379883798937990379913799237993379943799537996379973799837999380003800138002380033800438005380063800738008380093801038011380123801338014380153801638017380183801938020380213802238023380243802538026380273802838029380303803138032380333803438035380363803738038380393804038041380423804338044380453804638047380483804938050380513805238053380543805538056380573805838059380603806138062380633806438065380663806738068380693807038071380723807338074380753807638077380783807938080380813808238083380843808538086380873808838089380903809138092380933809438095380963809738098380993810038101381023810338104381053810638107381083810938110381113811238113381143811538116381173811838119381203812138122381233812438125381263812738128381293813038131381323813338134381353813638137381383813938140381413814238143381443814538146381473814838149381503815138152381533815438155381563815738158381593816038161381623816338164381653816638167381683816938170381713817238173381743817538176381773817838179381803818138182381833818438185381863818738188381893819038191381923819338194381953819638197381983819938200382013820238203382043820538206382073820838209382103821138212382133821438215382163821738218382193822038221382223822338224382253822638227382283822938230382313823238233382343823538236382373823838239382403824138242382433824438245382463824738248382493825038251382523825338254382553825638257382583825938260382613826238263382643826538266382673826838269382703827138272382733827438275382763827738278382793828038281382823828338284382853828638287382883828938290382913829238293382943829538296382973829838299383003830138302383033830438305383063830738308383093831038311383123831338314383153831638317383183831938320383213832238323383243832538326383273832838329383303833138332383333833438335383363833738338383393834038341383423834338344383453834638347383483834938350383513835238353383543835538356383573835838359383603836138362383633836438365383663836738368383693837038371383723837338374383753837638377383783837938380383813838238383383843838538386383873838838389383903839138392383933839438395383963839738398383993840038401384023840338404384053840638407384083840938410384113841238413384143841538416384173841838419384203842138422384233842438425384263842738428384293843038431384323843338434384353843638437384383843938440384413844238443384443844538446384473844838449384503845138452384533845438455384563845738458384593846038461384623846338464384653846638467384683846938470384713847238473384743847538476384773847838479384803848138482384833848438485384863848738488384893849038491384923849338494384953849638497384983849938500385013850238503385043850538506385073850838509385103851138512385133851438515385163851738518385193852038521385223852338524385253852638527385283852938530385313853238533385343853538536385373853838539385403854138542385433854438545385463854738548385493855038551385523855338554385553855638557385583855938560385613856238563385643856538566385673856838569385703857138572385733857438575385763857738578385793858038581385823858338584385853858638587385883858938590385913859238593385943859538596385973859838599386003860138602386033860438605386063860738608386093861038611386123861338614386153861638617386183861938620386213862238623386243862538626386273862838629386303863138632386333863438635386363863738638386393864038641386423864338644386453864638647386483864938650386513865238653386543865538656386573865838659386603866138662386633866438665386663866738668386693867038671386723867338674386753867638677386783867938680386813868238683386843868538686386873868838689386903869138692386933869438695386963869738698386993870038701387023870338704387053870638707387083870938710387113871238713387143871538716387173871838719387203872138722387233872438725387263872738728387293873038731387323873338734387353873638737387383873938740387413874238743387443874538746387473874838749387503875138752387533875438755387563875738758387593876038761387623876338764387653876638767387683876938770387713877238773387743877538776387773877838779387803878138782387833878438785387863878738788387893879038791387923879338794387953879638797387983879938800388013880238803388043880538806388073880838809388103881138812388133881438815388163881738818388193882038821388223882338824388253882638827388283882938830388313883238833388343883538836388373883838839388403884138842388433884438845388463884738848388493885038851388523885338854388553885638857388583885938860388613886238863388643886538866388673886838869388703887138872388733887438875388763887738878388793888038881388823888338884388853888638887388883888938890388913889238893388943889538896388973889838899389003890138902389033890438905389063890738908389093891038911389123891338914389153891638917389183891938920389213892238923389243892538926389273892838929389303893138932389333893438935389363893738938389393894038941389423894338944389453894638947389483894938950389513895238953389543895538956389573895838959389603896138962389633896438965389663896738968389693897038971389723897338974389753897638977389783897938980389813898238983389843898538986389873898838989389903899138992389933899438995389963899738998389993900039001390023900339004390053900639007390083900939010390113901239013390143901539016390173901839019390203902139022390233902439025390263902739028390293903039031390323903339034390353903639037390383903939040390413904239043390443904539046390473904839049390503905139052390533905439055390563905739058390593906039061390623906339064390653906639067390683906939070390713907239073390743907539076390773907839079390803908139082390833908439085390863908739088390893909039091390923909339094390953909639097390983909939100391013910239103391043910539106391073910839109391103911139112391133911439115391163911739118391193912039121391223912339124391253912639127391283912939130391313913239133391343913539136391373913839139391403914139142391433914439145391463914739148391493915039151391523915339154391553915639157391583915939160391613916239163391643916539166391673916839169391703917139172391733917439175391763917739178391793918039181391823918339184391853918639187391883918939190391913919239193391943919539196391973919839199392003920139202392033920439205392063920739208392093921039211392123921339214392153921639217392183921939220392213922239223392243922539226392273922839229392303923139232392333923439235392363923739238392393924039241392423924339244392453924639247392483924939250392513925239253392543925539256392573925839259392603926139262392633926439265392663926739268392693927039271392723927339274392753927639277392783927939280392813928239283392843928539286392873928839289392903929139292392933929439295392963929739298392993930039301393023930339304393053930639307393083930939310393113931239313393143931539316393173931839319393203932139322393233932439325393263932739328393293933039331393323933339334393353933639337393383933939340393413934239343393443934539346393473934839349393503935139352393533935439355393563935739358393593936039361393623936339364393653936639367393683936939370393713937239373393743937539376393773937839379393803938139382393833938439385393863938739388393893939039391393923939339394393953939639397393983939939400394013940239403394043940539406394073940839409394103941139412394133941439415394163941739418394193942039421394223942339424394253942639427394283942939430394313943239433394343943539436394373943839439394403944139442394433944439445394463944739448394493945039451394523945339454394553945639457394583945939460394613946239463394643946539466394673946839469394703947139472394733947439475394763947739478394793948039481394823948339484394853948639487394883948939490394913949239493394943949539496394973949839499395003950139502395033950439505395063950739508395093951039511395123951339514395153951639517395183951939520395213952239523395243952539526395273952839529395303953139532395333953439535395363953739538395393954039541395423954339544395453954639547395483954939550395513955239553395543955539556395573955839559395603956139562395633956439565395663956739568395693957039571395723957339574395753957639577395783957939580395813958239583395843958539586395873958839589395903959139592395933959439595395963959739598395993960039601396023960339604396053960639607396083960939610396113961239613396143961539616396173961839619396203962139622396233962439625396263962739628396293963039631396323963339634396353963639637396383963939640396413964239643396443964539646396473964839649396503965139652396533965439655396563965739658396593966039661396623966339664396653966639667396683966939670396713967239673396743967539676396773967839679396803968139682396833968439685396863968739688396893969039691396923969339694396953969639697396983969939700397013970239703397043970539706397073970839709397103971139712397133971439715397163971739718397193972039721397223972339724397253972639727397283972939730397313973239733397343973539736397373973839739397403974139742397433974439745397463974739748397493975039751397523975339754397553975639757397583975939760397613976239763397643976539766397673976839769397703977139772397733977439775397763977739778397793978039781397823978339784397853978639787397883978939790397913979239793397943979539796397973979839799398003980139802398033980439805398063980739808398093981039811398123981339814398153981639817398183981939820398213982239823398243982539826398273982839829398303983139832398333983439835398363983739838398393984039841398423984339844398453984639847398483984939850398513985239853398543985539856398573985839859398603986139862398633986439865398663986739868398693987039871398723987339874398753987639877398783987939880398813988239883398843988539886398873988839889398903989139892398933989439895398963989739898398993990039901399023990339904399053990639907399083990939910399113991239913399143991539916399173991839919399203992139922399233992439925399263992739928399293993039931399323993339934399353993639937399383993939940399413994239943399443994539946399473994839949399503995139952399533995439955399563995739958399593996039961399623996339964399653996639967399683996939970399713997239973399743997539976399773997839979399803998139982399833998439985399863998739988399893999039991399923999339994399953999639997399983999940000400014000240003400044000540006400074000840009400104001140012400134001440015400164001740018400194002040021400224002340024400254002640027400284002940030400314003240033400344003540036400374003840039400404004140042400434004440045400464004740048400494005040051400524005340054400554005640057400584005940060400614006240063400644006540066400674006840069400704007140072400734007440075400764007740078400794008040081400824008340084400854008640087400884008940090400914009240093400944009540096400974009840099401004010140102401034010440105401064010740108401094011040111401124011340114401154011640117401184011940120401214012240123401244012540126401274012840129401304013140132401334013440135401364013740138401394014040141401424014340144401454014640147401484014940150401514015240153401544015540156401574015840159401604016140162401634016440165401664016740168401694017040171401724017340174401754017640177401784017940180401814018240183401844018540186401874018840189401904019140192401934019440195401964019740198401994020040201402024020340204402054020640207402084020940210402114021240213402144021540216402174021840219402204022140222402234022440225402264022740228402294023040231402324023340234402354023640237402384023940240402414024240243402444024540246402474024840249402504025140252402534025440255402564025740258402594026040261402624026340264402654026640267402684026940270402714027240273402744027540276402774027840279402804028140282402834028440285402864028740288402894029040291402924029340294402954029640297402984029940300403014030240303403044030540306403074030840309403104031140312403134031440315403164031740318403194032040321403224032340324403254032640327403284032940330403314033240333403344033540336403374033840339403404034140342403434034440345403464034740348403494035040351403524035340354403554035640357403584035940360403614036240363403644036540366403674036840369403704037140372403734037440375403764037740378403794038040381403824038340384403854038640387403884038940390403914039240393403944039540396403974039840399404004040140402404034040440405404064040740408404094041040411404124041340414404154041640417404184041940420404214042240423404244042540426404274042840429404304043140432404334043440435404364043740438404394044040441404424044340444404454044640447404484044940450404514045240453404544045540456404574045840459404604046140462404634046440465404664046740468404694047040471404724047340474404754047640477404784047940480404814048240483404844048540486404874048840489404904049140492404934049440495404964049740498404994050040501405024050340504405054050640507405084050940510405114051240513405144051540516405174051840519405204052140522405234052440525405264052740528405294053040531405324053340534405354053640537405384053940540405414054240543405444054540546405474054840549405504055140552405534055440555405564055740558405594056040561405624056340564405654056640567405684056940570405714057240573405744057540576405774057840579405804058140582405834058440585405864058740588405894059040591405924059340594405954059640597405984059940600406014060240603406044060540606406074060840609406104061140612406134061440615406164061740618406194062040621406224062340624406254062640627406284062940630406314063240633406344063540636406374063840639406404064140642406434064440645406464064740648406494065040651406524065340654406554065640657406584065940660406614066240663406644066540666406674066840669406704067140672406734067440675406764067740678406794068040681406824068340684406854068640687406884068940690406914069240693406944069540696406974069840699407004070140702407034070440705407064070740708407094071040711407124071340714407154071640717407184071940720407214072240723407244072540726407274072840729407304073140732407334073440735407364073740738407394074040741407424074340744407454074640747407484074940750407514075240753407544075540756407574075840759407604076140762407634076440765407664076740768407694077040771407724077340774407754077640777407784077940780407814078240783407844078540786407874078840789407904079140792407934079440795407964079740798407994080040801408024080340804408054080640807408084080940810408114081240813408144081540816408174081840819408204082140822408234082440825408264082740828408294083040831408324083340834408354083640837408384083940840408414084240843408444084540846408474084840849408504085140852408534085440855408564085740858408594086040861408624086340864408654086640867408684086940870408714087240873408744087540876408774087840879408804088140882408834088440885408864088740888408894089040891408924089340894408954089640897408984089940900409014090240903409044090540906409074090840909409104091140912409134091440915409164091740918409194092040921409224092340924409254092640927409284092940930409314093240933409344093540936409374093840939409404094140942409434094440945409464094740948409494095040951409524095340954409554095640957409584095940960409614096240963409644096540966409674096840969409704097140972409734097440975409764097740978409794098040981409824098340984409854098640987409884098940990409914099240993409944099540996409974099840999410004100141002410034100441005410064100741008410094101041011410124101341014410154101641017410184101941020410214102241023410244102541026410274102841029410304103141032410334103441035410364103741038410394104041041410424104341044410454104641047410484104941050410514105241053410544105541056410574105841059410604106141062410634106441065410664106741068410694107041071410724107341074410754107641077410784107941080410814108241083410844108541086410874108841089410904109141092410934109441095410964109741098410994110041101411024110341104411054110641107411084110941110411114111241113411144111541116411174111841119411204112141122411234112441125411264112741128411294113041131411324113341134411354113641137411384113941140411414114241143411444114541146411474114841149411504115141152411534115441155411564115741158411594116041161411624116341164411654116641167411684116941170411714117241173411744117541176411774117841179411804118141182411834118441185411864118741188411894119041191411924119341194411954119641197411984119941200412014120241203412044120541206412074120841209412104121141212412134121441215412164121741218412194122041221412224122341224412254122641227412284122941230412314123241233412344123541236412374123841239412404124141242412434124441245412464124741248412494125041251412524125341254412554125641257412584125941260412614126241263412644126541266412674126841269412704127141272412734127441275412764127741278412794128041281412824128341284412854128641287412884128941290412914129241293412944129541296412974129841299413004130141302413034130441305413064130741308413094131041311413124131341314413154131641317413184131941320413214132241323413244132541326413274132841329413304133141332413334133441335413364133741338413394134041341413424134341344413454134641347413484134941350413514135241353413544135541356413574135841359413604136141362413634136441365413664136741368413694137041371413724137341374413754137641377413784137941380413814138241383413844138541386413874138841389413904139141392413934139441395413964139741398413994140041401414024140341404414054140641407414084140941410414114141241413414144141541416414174141841419414204142141422414234142441425414264142741428414294143041431414324143341434414354143641437414384143941440414414144241443414444144541446414474144841449414504145141452414534145441455414564145741458414594146041461414624146341464414654146641467414684146941470414714147241473414744147541476414774147841479414804148141482414834148441485414864148741488414894149041491414924149341494414954149641497414984149941500415014150241503415044150541506415074150841509415104151141512415134151441515415164151741518415194152041521415224152341524415254152641527415284152941530415314153241533415344153541536415374153841539415404154141542415434154441545415464154741548415494155041551415524155341554415554155641557415584155941560415614156241563415644156541566415674156841569415704157141572415734157441575415764157741578415794158041581415824158341584415854158641587415884158941590415914159241593415944159541596415974159841599416004160141602416034160441605416064160741608416094161041611416124161341614416154161641617416184161941620416214162241623416244162541626416274162841629416304163141632416334163441635416364163741638416394164041641416424164341644416454164641647416484164941650416514165241653416544165541656416574165841659416604166141662416634166441665416664166741668416694167041671416724167341674416754167641677416784167941680416814168241683416844168541686416874168841689416904169141692416934169441695416964169741698416994170041701417024170341704417054170641707417084170941710417114171241713417144171541716417174171841719417204172141722417234172441725417264172741728417294173041731417324173341734417354173641737417384173941740417414174241743417444174541746417474174841749417504175141752417534175441755417564175741758417594176041761417624176341764417654176641767417684176941770417714177241773417744177541776417774177841779417804178141782417834178441785417864178741788417894179041791417924179341794417954179641797417984179941800418014180241803418044180541806418074180841809418104181141812418134181441815418164181741818418194182041821418224182341824418254182641827418284182941830418314183241833418344183541836418374183841839418404184141842418434184441845418464184741848418494185041851418524185341854418554185641857418584185941860418614186241863418644186541866418674186841869418704187141872418734187441875418764187741878418794188041881418824188341884418854188641887418884188941890418914189241893418944189541896418974189841899419004190141902419034190441905419064190741908419094191041911419124191341914419154191641917419184191941920419214192241923419244192541926419274192841929419304193141932419334193441935419364193741938419394194041941419424194341944419454194641947419484194941950419514195241953419544195541956419574195841959419604196141962419634196441965419664196741968419694197041971419724197341974419754197641977419784197941980419814198241983419844198541986419874198841989419904199141992419934199441995419964199741998419994200042001420024200342004420054200642007420084200942010420114201242013420144201542016420174201842019420204202142022420234202442025420264202742028420294203042031420324203342034420354203642037420384203942040420414204242043420444204542046420474204842049420504205142052420534205442055420564205742058420594206042061420624206342064420654206642067420684206942070420714207242073420744207542076420774207842079420804208142082420834208442085420864208742088420894209042091420924209342094420954209642097420984209942100421014210242103421044210542106421074210842109421104211142112421134211442115421164211742118421194212042121421224212342124421254212642127421284212942130421314213242133421344213542136421374213842139421404214142142421434214442145421464214742148421494215042151421524215342154421554215642157421584215942160421614216242163421644216542166421674216842169421704217142172421734217442175421764217742178421794218042181421824218342184421854218642187421884218942190421914219242193421944219542196421974219842199422004220142202422034220442205422064220742208422094221042211422124221342214422154221642217422184221942220422214222242223422244222542226422274222842229422304223142232422334223442235422364223742238422394224042241422424224342244422454224642247422484224942250422514225242253422544225542256422574225842259422604226142262422634226442265422664226742268422694227042271422724227342274422754227642277422784227942280422814228242283422844228542286422874228842289422904229142292422934229442295422964229742298422994230042301423024230342304423054230642307423084230942310423114231242313423144231542316423174231842319423204232142322423234232442325423264232742328423294233042331423324233342334423354233642337423384233942340423414234242343423444234542346423474234842349423504235142352423534235442355423564235742358423594236042361423624236342364423654236642367423684236942370423714237242373423744237542376423774237842379423804238142382423834238442385423864238742388423894239042391423924239342394423954239642397423984239942400424014240242403424044240542406424074240842409424104241142412424134241442415424164241742418424194242042421424224242342424424254242642427424284242942430424314243242433424344243542436424374243842439424404244142442424434244442445424464244742448424494245042451424524245342454424554245642457424584245942460424614246242463424644246542466424674246842469424704247142472424734247442475424764247742478424794248042481424824248342484424854248642487424884248942490424914249242493424944249542496424974249842499425004250142502425034250442505425064250742508425094251042511425124251342514425154251642517425184251942520425214252242523425244252542526425274252842529425304253142532425334253442535425364253742538425394254042541425424254342544425454254642547425484254942550425514255242553425544255542556425574255842559425604256142562425634256442565425664256742568425694257042571425724257342574425754257642577425784257942580425814258242583425844258542586425874258842589425904259142592425934259442595425964259742598425994260042601426024260342604426054260642607426084260942610426114261242613426144261542616426174261842619426204262142622426234262442625426264262742628426294263042631426324263342634426354263642637426384263942640426414264242643426444264542646426474264842649426504265142652426534265442655426564265742658426594266042661426624266342664426654266642667426684266942670426714267242673426744267542676426774267842679426804268142682426834268442685426864268742688426894269042691426924269342694426954269642697426984269942700427014270242703427044270542706427074270842709427104271142712427134271442715427164271742718427194272042721427224272342724427254272642727427284272942730427314273242733427344273542736427374273842739427404274142742427434274442745427464274742748427494275042751427524275342754427554275642757427584275942760427614276242763427644276542766427674276842769427704277142772427734277442775427764277742778427794278042781427824278342784427854278642787427884278942790427914279242793427944279542796427974279842799428004280142802428034280442805428064280742808428094281042811428124281342814428154281642817428184281942820428214282242823428244282542826428274282842829428304283142832428334283442835428364283742838428394284042841428424284342844428454284642847428484284942850428514285242853428544285542856428574285842859428604286142862428634286442865428664286742868428694287042871428724287342874428754287642877428784287942880428814288242883428844288542886428874288842889428904289142892428934289442895428964289742898428994290042901429024290342904429054290642907429084290942910429114291242913429144291542916429174291842919429204292142922429234292442925429264292742928429294293042931429324293342934429354293642937429384293942940429414294242943429444294542946429474294842949429504295142952429534295442955429564295742958429594296042961429624296342964429654296642967429684296942970429714297242973429744297542976429774297842979429804298142982429834298442985429864298742988429894299042991429924299342994429954299642997429984299943000430014300243003430044300543006430074300843009430104301143012430134301443015430164301743018430194302043021430224302343024430254302643027430284302943030430314303243033430344303543036430374303843039430404304143042430434304443045430464304743048430494305043051430524305343054430554305643057430584305943060430614306243063430644306543066430674306843069430704307143072430734307443075430764307743078430794308043081430824308343084430854308643087430884308943090430914309243093430944309543096430974309843099431004310143102431034310443105431064310743108431094311043111431124311343114431154311643117431184311943120431214312243123431244312543126431274312843129431304313143132431334313443135431364313743138431394314043141431424314343144431454314643147431484314943150431514315243153431544315543156431574315843159431604316143162431634316443165431664316743168431694317043171431724317343174431754317643177431784317943180431814318243183431844318543186431874318843189431904319143192431934319443195431964319743198431994320043201432024320343204432054320643207432084320943210432114321243213432144321543216432174321843219432204322143222432234322443225432264322743228432294323043231432324323343234432354323643237432384323943240432414324243243432444324543246432474324843249432504325143252432534325443255432564325743258432594326043261432624326343264432654326643267432684326943270432714327243273432744327543276432774327843279432804328143282432834328443285432864328743288432894329043291432924329343294432954329643297432984329943300433014330243303433044330543306433074330843309433104331143312433134331443315433164331743318433194332043321433224332343324433254332643327433284332943330433314333243333433344333543336433374333843339433404334143342433434334443345433464334743348433494335043351433524335343354433554335643357433584335943360433614336243363433644336543366433674336843369433704337143372433734337443375433764337743378433794338043381433824338343384433854338643387433884338943390433914339243393433944339543396433974339843399434004340143402434034340443405434064340743408434094341043411434124341343414434154341643417434184341943420434214342243423434244342543426434274342843429434304343143432434334343443435434364343743438434394344043441434424344343444434454344643447434484344943450434514345243453434544345543456434574345843459434604346143462434634346443465434664346743468434694347043471434724347343474434754347643477434784347943480434814348243483434844348543486434874348843489434904349143492434934349443495434964349743498434994350043501435024350343504435054350643507435084350943510435114351243513435144351543516435174351843519435204352143522435234352443525435264352743528435294353043531435324353343534435354353643537435384353943540435414354243543435444354543546435474354843549435504355143552435534355443555435564355743558435594356043561435624356343564435654356643567435684356943570435714357243573435744357543576435774357843579435804358143582435834358443585435864358743588435894359043591435924359343594435954359643597435984359943600436014360243603436044360543606436074360843609436104361143612436134361443615436164361743618436194362043621436224362343624436254362643627436284362943630436314363243633436344363543636436374363843639436404364143642436434364443645436464364743648436494365043651436524365343654436554365643657436584365943660436614366243663436644366543666436674366843669436704367143672436734367443675436764367743678436794368043681436824368343684436854368643687436884368943690436914369243693436944369543696436974369843699437004370143702437034370443705437064370743708437094371043711437124371343714437154371643717437184371943720437214372243723437244372543726437274372843729437304373143732437334373443735437364373743738437394374043741437424374343744437454374643747437484374943750437514375243753437544375543756437574375843759437604376143762437634376443765437664376743768437694377043771437724377343774437754377643777437784377943780437814378243783437844378543786437874378843789437904379143792437934379443795437964379743798437994380043801438024380343804438054380643807438084380943810438114381243813438144381543816438174381843819438204382143822438234382443825438264382743828438294383043831438324383343834438354383643837438384383943840438414384243843438444384543846438474384843849438504385143852438534385443855438564385743858438594386043861438624386343864438654386643867438684386943870438714387243873438744387543876438774387843879438804388143882438834388443885438864388743888438894389043891438924389343894438954389643897438984389943900439014390243903439044390543906439074390843909439104391143912439134391443915439164391743918439194392043921439224392343924439254392643927439284392943930439314393243933439344393543936439374393843939439404394143942439434394443945439464394743948439494395043951439524395343954439554395643957439584395943960439614396243963439644396543966439674396843969439704397143972439734397443975439764397743978439794398043981439824398343984439854398643987439884398943990439914399243993439944399543996439974399843999440004400144002440034400444005440064400744008440094401044011440124401344014440154401644017440184401944020440214402244023440244402544026440274402844029440304403144032440334403444035440364403744038440394404044041440424404344044440454404644047440484404944050440514405244053440544405544056440574405844059440604406144062440634406444065440664406744068440694407044071440724407344074440754407644077440784407944080440814408244083440844408544086440874408844089440904409144092440934409444095440964409744098440994410044101441024410344104441054410644107441084410944110441114411244113441144411544116441174411844119441204412144122441234412444125441264412744128441294413044131441324413344134441354413644137441384413944140441414414244143441444414544146441474414844149441504415144152441534415444155441564415744158441594416044161441624416344164441654416644167441684416944170441714417244173441744417544176441774417844179441804418144182441834418444185441864418744188441894419044191441924419344194441954419644197441984419944200442014420244203442044420544206442074420844209442104421144212442134421444215442164421744218442194422044221442224422344224442254422644227442284422944230442314423244233442344423544236442374423844239442404424144242442434424444245442464424744248442494425044251442524425344254442554425644257442584425944260442614426244263442644426544266442674426844269442704427144272442734427444275442764427744278442794428044281442824428344284442854428644287442884428944290442914429244293442944429544296442974429844299443004430144302443034430444305443064430744308443094431044311443124431344314443154431644317443184431944320443214432244323443244432544326443274432844329443304433144332443334433444335443364433744338443394434044341443424434344344443454434644347443484434944350443514435244353443544435544356443574435844359443604436144362443634436444365443664436744368443694437044371443724437344374443754437644377443784437944380443814438244383443844438544386443874438844389443904439144392443934439444395443964439744398443994440044401444024440344404444054440644407444084440944410444114441244413444144441544416444174441844419444204442144422444234442444425444264442744428444294443044431444324443344434444354443644437444384443944440444414444244443444444444544446444474444844449444504445144452444534445444455444564445744458444594446044461444624446344464444654446644467444684446944470444714447244473444744447544476444774447844479444804448144482444834448444485444864448744488444894449044491444924449344494444954449644497444984449944500445014450244503445044450544506445074450844509445104451144512445134451444515445164451744518445194452044521445224452344524445254452644527445284452944530445314453244533445344453544536445374453844539445404454144542445434454444545445464454744548445494455044551445524455344554445554455644557445584455944560445614456244563445644456544566445674456844569445704457144572445734457444575445764457744578445794458044581445824458344584445854458644587445884458944590445914459244593445944459544596445974459844599446004460144602446034460444605446064460744608446094461044611446124461344614446154461644617446184461944620446214462244623446244462544626446274462844629446304463144632446334463444635446364463744638446394464044641446424464344644446454464644647446484464944650446514465244653446544465544656446574465844659446604466144662446634466444665446664466744668446694467044671446724467344674446754467644677446784467944680446814468244683446844468544686446874468844689446904469144692446934469444695446964469744698446994470044701447024470344704447054470644707447084470944710447114471244713447144471544716447174471844719447204472144722447234472444725447264472744728447294473044731447324473344734447354473644737447384473944740447414474244743447444474544746447474474844749447504475144752447534475444755447564475744758447594476044761447624476344764447654476644767447684476944770447714477244773447744477544776447774477844779447804478144782447834478444785447864478744788447894479044791447924479344794447954479644797447984479944800448014480244803448044480544806448074480844809448104481144812448134481444815448164481744818448194482044821448224482344824448254482644827448284482944830448314483244833448344483544836448374483844839448404484144842448434484444845448464484744848448494485044851448524485344854448554485644857448584485944860448614486244863448644486544866448674486844869448704487144872448734487444875448764487744878448794488044881448824488344884448854488644887448884488944890448914489244893448944489544896448974489844899449004490144902449034490444905449064490744908449094491044911449124491344914449154491644917449184491944920449214492244923449244492544926449274492844929449304493144932449334493444935449364493744938449394494044941449424494344944449454494644947449484494944950449514495244953449544495544956449574495844959449604496144962449634496444965449664496744968449694497044971449724497344974449754497644977449784497944980449814498244983449844498544986449874498844989449904499144992449934499444995449964499744998449994500045001450024500345004450054500645007450084500945010450114501245013450144501545016450174501845019450204502145022450234502445025450264502745028450294503045031450324503345034450354503645037450384503945040450414504245043450444504545046450474504845049450504505145052450534505445055450564505745058450594506045061450624506345064450654506645067450684506945070450714507245073450744507545076450774507845079450804508145082450834508445085450864508745088450894509045091450924509345094450954509645097450984509945100451014510245103451044510545106451074510845109451104511145112451134511445115451164511745118451194512045121451224512345124451254512645127451284512945130451314513245133451344513545136451374513845139451404514145142451434514445145451464514745148451494515045151451524515345154451554515645157451584515945160451614516245163
  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. * tighly and fully encompases 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. */
  4447. export class CoplanarPolygonGeometry {
  4448. constructor(options: {
  4449. polygonHierarchy: PolygonHierarchy;
  4450. stRotation?: number;
  4451. vertexFormat?: VertexFormat;
  4452. ellipsoid?: Ellipsoid;
  4453. });
  4454. /**
  4455. * The number of elements used to pack the object into an array.
  4456. */
  4457. packedLength: number;
  4458. /**
  4459. * A description of a coplanar polygon from an array of positions.
  4460. * @example
  4461. * // create a polygon from points
  4462. * const polygon = Cesium.CoplanarPolygonGeometry.fromPositions({
  4463. * positions : Cesium.Cartesian3.fromDegreesArray([
  4464. * -72.0, 40.0,
  4465. * -70.0, 35.0,
  4466. * -75.0, 30.0,
  4467. * -70.0, 30.0,
  4468. * -68.0, 40.0
  4469. * ])
  4470. * });
  4471. * const geometry = Cesium.PolygonGeometry.createGeometry(polygon);
  4472. * @param options - Object with the following properties:
  4473. * @param options.positions - An array of positions that defined the corner points of the polygon.
  4474. * @param [options.vertexFormat = VertexFormat.DEFAULT] - The vertex attributes to be computed.
  4475. * @param [options.stRotation = 0.0] - The rotation of the texture coordinates, in radians. A positive rotation is counter-clockwise.
  4476. * @param [options.ellipsoid = Ellipsoid.WGS84] - The ellipsoid to be used as a reference.
  4477. */
  4478. static fromPositions(options: {
  4479. positions: Cartesian3[];
  4480. vertexFormat?: VertexFormat;
  4481. stRotation?: number;
  4482. ellipsoid?: Ellipsoid;
  4483. }): CoplanarPolygonGeometry;
  4484. /**
  4485. * Stores the provided instance into the provided array.
  4486. * @param value - The value to pack.
  4487. * @param array - The array to pack into.
  4488. * @param [startingIndex = 0] - The index into the array at which to start packing the elements.
  4489. * @returns The array that was packed into
  4490. */
  4491. static pack(value: CoplanarPolygonGeometry, array: number[], startingIndex?: number): number[];
  4492. /**
  4493. * Retrieves an instance from a packed array.
  4494. * @param array - The packed array.
  4495. * @param [startingIndex = 0] - The starting index of the element to be unpacked.
  4496. * @param [result] - The object into which to store the result.
  4497. * @returns The modified result parameter or a new CoplanarPolygonGeometry instance if one was not provided.
  4498. */
  4499. static unpack(array: number[], startingIndex?: number, result?: CoplanarPolygonGeometry): CoplanarPolygonGeometry;
  4500. /**
  4501. * Computes the geometric representation of an arbitrary coplanar polygon, including its vertices, indices, and a bounding sphere.
  4502. * @param polygonGeometry - A description of the polygon.
  4503. * @returns The computed vertices and indices.
  4504. */
  4505. static createGeometry(polygonGeometry: CoplanarPolygonGeometry): Geometry | undefined;
  4506. }
  4507. /**
  4508. * A description of the outline of a polygon composed of arbitrary coplanar positions.
  4509. * @example
  4510. * const polygonOutline = new Cesium.CoplanarPolygonOutlineGeometry({
  4511. * positions : Cesium.Cartesian3.fromDegreesArrayHeights([
  4512. * -90.0, 30.0, 0.0,
  4513. * -90.0, 30.0, 1000.0,
  4514. * -80.0, 30.0, 1000.0,
  4515. * -80.0, 30.0, 0.0
  4516. * ])
  4517. * });
  4518. * const geometry = Cesium.CoplanarPolygonOutlineGeometry.createGeometry(polygonOutline);
  4519. * @param options - Object with the following properties:
  4520. * @param options.polygonHierarchy - A polygon hierarchy that can include holes.
  4521. */
  4522. export class CoplanarPolygonOutlineGeometry {
  4523. constructor(options: {
  4524. polygonHierarchy: PolygonHierarchy;
  4525. });
  4526. /**
  4527. * The number of elements used to pack the object into an array.
  4528. */
  4529. packedLength: number;
  4530. /**
  4531. * A description of a coplanar polygon outline from an array of positions.
  4532. * @param options - Object with the following properties:
  4533. * @param options.positions - An array of positions that defined the corner points of the polygon.
  4534. */
  4535. static fromPositions(options: {
  4536. positions: Cartesian3[];
  4537. }): CoplanarPolygonOutlineGeometry;
  4538. /**
  4539. * Stores the provided instance into the provided array.
  4540. * @param value - The value to pack.
  4541. * @param array - The array to pack into.
  4542. * @param [startingIndex = 0] - The index into the array at which to start packing the elements.
  4543. * @returns The array that was packed into
  4544. */
  4545. static pack(value: CoplanarPolygonOutlineGeometry, array: number[], startingIndex?: number): number[];
  4546. /**
  4547. * Retrieves an instance from a packed array.
  4548. * @param array - The packed array.
  4549. * @param [startingIndex = 0] - The starting index of the element to be unpacked.
  4550. * @param [result] - The object into which to store the result.
  4551. * @returns The modified result parameter or a new CoplanarPolygonOutlineGeometry instance if one was not provided.
  4552. */
  4553. static unpack(array: number[], startingIndex?: number, result?: CoplanarPolygonOutlineGeometry): CoplanarPolygonOutlineGeometry;
  4554. /**
  4555. * Computes the geometric representation of an arbitrary coplanar polygon, including its vertices, indices, and a bounding sphere.
  4556. * @param polygonGeometry - A description of the polygon.
  4557. * @returns The computed vertices and indices.
  4558. */
  4559. static createGeometry(polygonGeometry: CoplanarPolygonOutlineGeometry): Geometry | undefined;
  4560. }
  4561. /**
  4562. * Style options for corners.
  4563. */
  4564. export enum CornerType {
  4565. /**
  4566. * <img src="Images/CornerTypeRounded.png" style="vertical-align: middle;" width="186" height="189" />
  4567. *
  4568. * Corner has a smooth edge.
  4569. */
  4570. ROUNDED = 0,
  4571. /**
  4572. * <img src="Images/CornerTypeMitered.png" style="vertical-align: middle;" width="186" height="189" />
  4573. *
  4574. * Corner point is the intersection of adjacent edges.
  4575. */
  4576. MITERED = 1,
  4577. /**
  4578. * <img src="Images/CornerTypeBeveled.png" style="vertical-align: middle;" width="186" height="189" />
  4579. *
  4580. * Corner is clipped.
  4581. */
  4582. BEVELED = 2
  4583. }
  4584. /**
  4585. * A description of a corridor. Corridor geometry can be rendered with both {@link Primitive} and {@link GroundPrimitive}.
  4586. * @example
  4587. * const corridor = new Cesium.CorridorGeometry({
  4588. * vertexFormat : Cesium.VertexFormat.POSITION_ONLY,
  4589. * positions : Cesium.Cartesian3.fromDegreesArray([-72.0, 40.0, -70.0, 35.0]),
  4590. * width : 100000
  4591. * });
  4592. * @param options - Object with the following properties:
  4593. * @param options.positions - An array of positions that define the center of the corridor.
  4594. * @param options.width - The distance between the edges of the corridor in meters.
  4595. * @param [options.ellipsoid = Ellipsoid.WGS84] - The ellipsoid to be used as a reference.
  4596. * @param [options.granularity = Math.RADIANS_PER_DEGREE] - The distance, in radians, between each latitude and longitude. Determines the number of positions in the buffer.
  4597. * @param [options.height = 0] - The distance in meters between the ellipsoid surface and the positions.
  4598. * @param [options.extrudedHeight] - The distance in meters between the ellipsoid surface and the extruded face.
  4599. * @param [options.vertexFormat = VertexFormat.DEFAULT] - The vertex attributes to be computed.
  4600. * @param [options.cornerType = CornerType.ROUNDED] - Determines the style of the corners.
  4601. */
  4602. export class CorridorGeometry {
  4603. constructor(options: {
  4604. positions: Cartesian3[];
  4605. width: number;
  4606. ellipsoid?: Ellipsoid;
  4607. granularity?: number;
  4608. height?: number;
  4609. extrudedHeight?: number;
  4610. vertexFormat?: VertexFormat;
  4611. cornerType?: CornerType;
  4612. });
  4613. /**
  4614. * The number of elements used to pack the object into an array.
  4615. */
  4616. packedLength: number;
  4617. /**
  4618. * Stores the provided instance into the provided array.
  4619. * @param value - The value to pack.
  4620. * @param array - The array to pack into.
  4621. * @param [startingIndex = 0] - The index into the array at which to start packing the elements.
  4622. * @returns The array that was packed into
  4623. */
  4624. static pack(value: CorridorGeometry, array: number[], startingIndex?: number): number[];
  4625. /**
  4626. * Retrieves an instance from a packed array.
  4627. * @param array - The packed array.
  4628. * @param [startingIndex = 0] - The starting index of the element to be unpacked.
  4629. * @param [result] - The object into which to store the result.
  4630. * @returns The modified result parameter or a new CorridorGeometry instance if one was not provided.
  4631. */
  4632. static unpack(array: number[], startingIndex?: number, result?: CorridorGeometry): CorridorGeometry;
  4633. /**
  4634. * Computes the bounding rectangle given the provided options
  4635. * @param options - Object with the following properties:
  4636. * @param options.positions - An array of positions that define the center of the corridor.
  4637. * @param options.width - The distance between the edges of the corridor in meters.
  4638. * @param [options.ellipsoid = Ellipsoid.WGS84] - The ellipsoid to be used as a reference.
  4639. * @param [options.cornerType = CornerType.ROUNDED] - Determines the style of the corners.
  4640. * @param [result] - An object in which to store the result.
  4641. * @returns The result rectangle.
  4642. */
  4643. static computeRectangle(options: {
  4644. positions: Cartesian3[];
  4645. width: number;
  4646. ellipsoid?: Ellipsoid;
  4647. cornerType?: CornerType;
  4648. }, result?: Rectangle): Rectangle;
  4649. /**
  4650. * Computes the geometric representation of a corridor, including its vertices, indices, and a bounding sphere.
  4651. * @param corridorGeometry - A description of the corridor.
  4652. * @returns The computed vertices and indices.
  4653. */
  4654. static createGeometry(corridorGeometry: CorridorGeometry): Geometry | undefined;
  4655. }
  4656. /**
  4657. * A description of a corridor outline.
  4658. * @example
  4659. * const corridor = new Cesium.CorridorOutlineGeometry({
  4660. * positions : Cesium.Cartesian3.fromDegreesArray([-72.0, 40.0, -70.0, 35.0]),
  4661. * width : 100000
  4662. * });
  4663. * @param options - Object with the following properties:
  4664. * @param options.positions - An array of positions that define the center of the corridor outline.
  4665. * @param options.width - The distance between the edges of the corridor outline.
  4666. * @param [options.ellipsoid = Ellipsoid.WGS84] - The ellipsoid to be used as a reference.
  4667. * @param [options.granularity = Math.RADIANS_PER_DEGREE] - The distance, in radians, between each latitude and longitude. Determines the number of positions in the buffer.
  4668. * @param [options.height = 0] - The distance in meters between the positions and the ellipsoid surface.
  4669. * @param [options.extrudedHeight] - The distance in meters between the extruded face and the ellipsoid surface.
  4670. * @param [options.cornerType = CornerType.ROUNDED] - Determines the style of the corners.
  4671. */
  4672. export class CorridorOutlineGeometry {
  4673. constructor(options: {
  4674. positions: Cartesian3[];
  4675. width: number;
  4676. ellipsoid?: Ellipsoid;
  4677. granularity?: number;
  4678. height?: number;
  4679. extrudedHeight?: number;
  4680. cornerType?: CornerType;
  4681. });
  4682. /**
  4683. * The number of elements used to pack the object into an array.
  4684. */
  4685. packedLength: number;
  4686. /**
  4687. * Stores the provided instance into the provided array.
  4688. * @param value - The value to pack.
  4689. * @param array - The array to pack into.
  4690. * @param [startingIndex = 0] - The index into the array at which to start packing the elements.
  4691. * @returns The array that was packed into
  4692. */
  4693. static pack(value: CorridorOutlineGeometry, array: number[], startingIndex?: number): number[];
  4694. /**
  4695. * Retrieves an instance from a packed array.
  4696. * @param array - The packed array.
  4697. * @param [startingIndex = 0] - The starting index of the element to be unpacked.
  4698. * @param [result] - The object into which to store the result.
  4699. * @returns The modified result parameter or a new CorridorOutlineGeometry instance if one was not provided.
  4700. */
  4701. static unpack(array: number[], startingIndex?: number, result?: CorridorOutlineGeometry): CorridorOutlineGeometry;
  4702. /**
  4703. * Computes the geometric representation of a corridor, including its vertices, indices, and a bounding sphere.
  4704. * @param corridorOutlineGeometry - A description of the corridor.
  4705. * @returns The computed vertices and indices.
  4706. */
  4707. static createGeometry(corridorOutlineGeometry: CorridorOutlineGeometry): Geometry | undefined;
  4708. }
  4709. /**
  4710. * A credit contains data pertaining to how to display attributions/credits for certain content on the screen.
  4711. * @example
  4712. * //Create a credit with a tooltip, image and link
  4713. * const credit = new Cesium.Credit('<a href="https://cesium.com/" target="_blank"><img src="/images/cesium_logo.png" title="Cesium"/></a>');
  4714. * @param html - An string representing an html code snippet
  4715. * @param [showOnScreen = false] - If true, the credit will be visible in the main credit container. Otherwise, it will appear in a popover
  4716. */
  4717. export class Credit {
  4718. constructor(html: string, showOnScreen?: boolean);
  4719. /**
  4720. * The credit content
  4721. */
  4722. readonly html: string;
  4723. /**
  4724. * Whether the credit should be displayed on screen or in a lightbox
  4725. */
  4726. showOnScreen: boolean;
  4727. /**
  4728. * Gets the credit element
  4729. */
  4730. readonly element: HTMLElement;
  4731. /**
  4732. * Returns true if the credits are equal
  4733. * @param left - The first credit
  4734. * @param right - The second credit
  4735. * @returns <code>true</code> if left and right are equal, <code>false</code> otherwise.
  4736. */
  4737. static equals(left: Credit, right: Credit): boolean;
  4738. /**
  4739. * Returns true if the credits are equal
  4740. * @param credit - The credit to compare to.
  4741. * @returns <code>true</code> if left and right are equal, <code>false</code> otherwise.
  4742. */
  4743. equals(credit: Credit): boolean;
  4744. /**
  4745. * Duplicates a Credit instance.
  4746. * @param [credit] - The Credit to duplicate.
  4747. * @returns A new Credit instance that is a duplicate of the one provided. (Returns undefined if the credit is undefined)
  4748. */
  4749. static clone(credit?: Credit): Credit;
  4750. }
  4751. /**
  4752. * Defines functions for 3rd order polynomial functions of one variable with only real coefficients.
  4753. */
  4754. export namespace CubicRealPolynomial {
  4755. /**
  4756. * Provides the discriminant of the cubic equation from the supplied coefficients.
  4757. * @param a - The coefficient of the 3rd order monomial.
  4758. * @param b - The coefficient of the 2nd order monomial.
  4759. * @param c - The coefficient of the 1st order monomial.
  4760. * @param d - The coefficient of the 0th order monomial.
  4761. * @returns The value of the discriminant.
  4762. */
  4763. function computeDiscriminant(a: number, b: number, c: number, d: number): number;
  4764. /**
  4765. * Provides the real valued roots of the cubic polynomial with the provided coefficients.
  4766. * @param a - The coefficient of the 3rd order monomial.
  4767. * @param b - The coefficient of the 2nd order monomial.
  4768. * @param c - The coefficient of the 1st order monomial.
  4769. * @param d - The coefficient of the 0th order monomial.
  4770. * @returns The real valued roots.
  4771. */
  4772. function computeRealRoots(a: number, b: number, c: number, d: number): number[];
  4773. }
  4774. /**
  4775. * The culling volume defined by planes.
  4776. * @param [planes] - An array of clipping planes.
  4777. */
  4778. export class CullingVolume {
  4779. constructor(planes?: Cartesian4[]);
  4780. /**
  4781. * Each plane is represented by a Cartesian4 object, where the x, y, and z components
  4782. * define the unit vector normal to the plane, and the w component is the distance of the
  4783. * plane from the origin.
  4784. */
  4785. planes: Cartesian4[];
  4786. /**
  4787. * Constructs a culling volume from a bounding sphere. Creates six planes that create a box containing the sphere.
  4788. * The planes are aligned to the x, y, and z axes in world coordinates.
  4789. * @param boundingSphere - The bounding sphere used to create the culling volume.
  4790. * @param [result] - The object onto which to store the result.
  4791. * @returns The culling volume created from the bounding sphere.
  4792. */
  4793. static fromBoundingSphere(boundingSphere: BoundingSphere, result?: CullingVolume): CullingVolume;
  4794. /**
  4795. * Determines whether a bounding volume intersects the culling volume.
  4796. * @param boundingVolume - The bounding volume whose intersection with the culling volume is to be tested.
  4797. * @returns Intersect.OUTSIDE, Intersect.INTERSECTING, or Intersect.INSIDE.
  4798. */
  4799. computeVisibility(boundingVolume: any): Intersect;
  4800. }
  4801. export namespace CustomHeightmapTerrainProvider {
  4802. /**
  4803. * @param x - The X coordinate of the tile for which to request geometry.
  4804. * @param y - The Y coordinate of the tile for which to request geometry.
  4805. * @param level - The level of the tile for which to request geometry.
  4806. */
  4807. 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;
  4808. }
  4809. /**
  4810. * A simple {@link TerrainProvider} that gets height values from a callback function.
  4811. * It can be used for procedurally generated terrain or as a way to load custom
  4812. * heightmap data without creating a subclass of {@link TerrainProvider}.
  4813. *
  4814. * There are some limitations such as no water mask, no vertex normals, and no
  4815. * availability, so a full-fledged {@link TerrainProvider} subclass is better suited
  4816. * for these more sophisticated use cases.
  4817. * @example
  4818. * const viewer = new Cesium.Viewer("cesiumContainer", {
  4819. * terrainProvider: new Cesium.CustomHeightmapTerrainProvider({
  4820. * width: 32,
  4821. * height: 32,
  4822. * callback: function (x, y, level) {
  4823. * return new Float32Array(32 * 32); // all zeros
  4824. * },
  4825. * }),
  4826. * });
  4827. * @param options - Object with the following properties:
  4828. * @param options.callback - The callback function for requesting tile geometry.
  4829. * @param options.width - The number of columns per heightmap tile.
  4830. * @param options.height - The number of rows per heightmap tile.
  4831. * @param [options.tilingScheme] - The tiling scheme specifying how the ellipsoidal
  4832. * surface is broken into tiles. If this parameter is not provided, a {@link GeographicTilingScheme}
  4833. * is used.
  4834. * @param [options.ellipsoid] - The ellipsoid. If the tilingScheme is specified,
  4835. * this parameter is ignored and the tiling scheme's ellipsoid is used instead. If neither
  4836. * parameter is specified, the WGS84 ellipsoid is used.
  4837. * @param [options.credit] - A credit for the data source, which is displayed on the canvas.
  4838. */
  4839. export class CustomHeightmapTerrainProvider {
  4840. constructor(options: {
  4841. callback: CustomHeightmapTerrainProvider.GeometryCallback;
  4842. width: number;
  4843. height: number;
  4844. tilingScheme?: TilingScheme;
  4845. ellipsoid?: Ellipsoid;
  4846. credit?: Credit | string;
  4847. });
  4848. /**
  4849. * Gets an event that is raised when the terrain provider encounters an asynchronous error. By subscribing
  4850. * to the event, you will be notified of the error and can potentially recover from it. Event listeners
  4851. * are passed an instance of {@link TileProviderError}.
  4852. */
  4853. readonly errorEvent: Event;
  4854. /**
  4855. * Gets the credit to display when this terrain provider is active. Typically this is used to credit
  4856. * the source of the terrain.
  4857. */
  4858. readonly credit: Credit;
  4859. /**
  4860. * Gets the tiling scheme used by this provider.
  4861. */
  4862. readonly tilingScheme: TilingScheme;
  4863. /**
  4864. * Gets a value indicating whether or not the provider is ready for use.
  4865. */
  4866. readonly ready: boolean;
  4867. /**
  4868. * Gets a promise that resolves to true when the provider is ready for use.
  4869. */
  4870. readonly readyPromise: Promise<boolean>;
  4871. /**
  4872. * Gets a value indicating whether or not the provider includes a water mask. The water mask
  4873. * indicates which areas of the globe are water rather than land, so they can be rendered
  4874. * as a reflective surface with animated waves.
  4875. * Water mask is not supported by {@link CustomHeightmapTerrainProvider}, so the return
  4876. * value will always be false.
  4877. */
  4878. readonly hasWaterMask: boolean;
  4879. /**
  4880. * Gets a value indicating whether or not the requested tiles include vertex normals.
  4881. * Vertex normals are not supported by {@link CustomHeightmapTerrainProvider}, so the return
  4882. * value will always be false.
  4883. */
  4884. readonly hasVertexNormals: boolean;
  4885. /**
  4886. * Gets the number of columns per heightmap tile.
  4887. */
  4888. readonly width: boolean;
  4889. /**
  4890. * Gets the number of rows per heightmap tile.
  4891. */
  4892. readonly height: boolean;
  4893. /**
  4894. * Requests the geometry for a given tile. The result includes terrain
  4895. * data and indicates that all child tiles are available.
  4896. * @param x - The X coordinate of the tile for which to request geometry.
  4897. * @param y - The Y coordinate of the tile for which to request geometry.
  4898. * @param level - The level of the tile for which to request geometry.
  4899. * @param [request] - The request object. Intended for internal use only.
  4900. * @returns A promise for the requested geometry. If this method
  4901. * returns undefined instead of a promise, it is an indication that too many requests are already
  4902. * pending and the request will be retried later.
  4903. */
  4904. requestTileGeometry(x: number, y: number, level: number, request?: Request): Promise<TerrainData> | undefined;
  4905. /**
  4906. * Gets the maximum geometric error allowed in a tile at a given level.
  4907. * @param level - The tile level for which to get the maximum geometric error.
  4908. * @returns The maximum geometric error.
  4909. */
  4910. getLevelMaximumGeometricError(level: number): number;
  4911. /**
  4912. * Determines whether data for a tile is available to be loaded.
  4913. * @param x - The X coordinate of the tile for which to request geometry.
  4914. * @param y - The Y coordinate of the tile for which to request geometry.
  4915. * @param level - The level of the tile for which to request geometry.
  4916. * @returns Undefined if not supported, otherwise true or false.
  4917. */
  4918. getTileDataAvailable(x: number, y: number, level: number): boolean | undefined;
  4919. /**
  4920. * Makes sure we load availability data for a tile
  4921. * @param x - The X coordinate of the tile for which to request geometry.
  4922. * @param y - The Y coordinate of the tile for which to request geometry.
  4923. * @param level - The level of the tile for which to request geometry.
  4924. * @returns Undefined if nothing need to be loaded or a Promise that resolves when all required tiles are loaded
  4925. */
  4926. loadTileDataAvailability(x: number, y: number, level: number): undefined | Promise<void>;
  4927. }
  4928. /**
  4929. * A description of a cylinder.
  4930. * @example
  4931. * // create cylinder geometry
  4932. * const cylinder = new Cesium.CylinderGeometry({
  4933. * length: 200000,
  4934. * topRadius: 80000,
  4935. * bottomRadius: 200000,
  4936. * });
  4937. * const geometry = Cesium.CylinderGeometry.createGeometry(cylinder);
  4938. * @param options - Object with the following properties:
  4939. * @param options.length - The length of the cylinder.
  4940. * @param options.topRadius - The radius of the top of the cylinder.
  4941. * @param options.bottomRadius - The radius of the bottom of the cylinder.
  4942. * @param [options.slices = 128] - The number of edges around the perimeter of the cylinder.
  4943. * @param [options.vertexFormat = VertexFormat.DEFAULT] - The vertex attributes to be computed.
  4944. */
  4945. export class CylinderGeometry {
  4946. constructor(options: {
  4947. length: number;
  4948. topRadius: number;
  4949. bottomRadius: number;
  4950. slices?: number;
  4951. vertexFormat?: VertexFormat;
  4952. });
  4953. /**
  4954. * The number of elements used to pack the object into an array.
  4955. */
  4956. static packedLength: number;
  4957. /**
  4958. * Stores the provided instance into the provided array.
  4959. * @param value - The value to pack.
  4960. * @param array - The array to pack into.
  4961. * @param [startingIndex = 0] - The index into the array at which to start packing the elements.
  4962. * @returns The array that was packed into
  4963. */
  4964. static pack(value: CylinderGeometry, array: number[], startingIndex?: number): number[];
  4965. /**
  4966. * Retrieves an instance from a packed array.
  4967. * @param array - The packed array.
  4968. * @param [startingIndex = 0] - The starting index of the element to be unpacked.
  4969. * @param [result] - The object into which to store the result.
  4970. * @returns The modified result parameter or a new CylinderGeometry instance if one was not provided.
  4971. */
  4972. static unpack(array: number[], startingIndex?: number, result?: CylinderGeometry): CylinderGeometry;
  4973. /**
  4974. * Computes the geometric representation of a cylinder, including its vertices, indices, and a bounding sphere.
  4975. * @param cylinderGeometry - A description of the cylinder.
  4976. * @returns The computed vertices and indices.
  4977. */
  4978. static createGeometry(cylinderGeometry: CylinderGeometry): Geometry | undefined;
  4979. }
  4980. /**
  4981. * A description of the outline of a cylinder.
  4982. * @example
  4983. * // create cylinder geometry
  4984. * const cylinder = new Cesium.CylinderOutlineGeometry({
  4985. * length: 200000,
  4986. * topRadius: 80000,
  4987. * bottomRadius: 200000,
  4988. * });
  4989. * const geometry = Cesium.CylinderOutlineGeometry.createGeometry(cylinder);
  4990. * @param options - Object with the following properties:
  4991. * @param options.length - The length of the cylinder.
  4992. * @param options.topRadius - The radius of the top of the cylinder.
  4993. * @param options.bottomRadius - The radius of the bottom of the cylinder.
  4994. * @param [options.slices = 128] - The number of edges around the perimeter of the cylinder.
  4995. * @param [options.numberOfVerticalLines = 16] - Number of lines to draw between the top and bottom surfaces of the cylinder.
  4996. */
  4997. export class CylinderOutlineGeometry {
  4998. constructor(options: {
  4999. length: number;
  5000. topRadius: number;
  5001. bottomRadius: number;
  5002. slices?: number;
  5003. numberOfVerticalLines?: number;
  5004. });
  5005. /**
  5006. * The number of elements used to pack the object into an array.
  5007. */
  5008. static packedLength: number;
  5009. /**
  5010. * Stores the provided instance into the provided array.
  5011. * @param value - The value to pack.
  5012. * @param array - The array to pack into.
  5013. * @param [startingIndex = 0] - The index into the array at which to start packing the elements.
  5014. * @returns The array that was packed into
  5015. */
  5016. static pack(value: CylinderOutlineGeometry, array: number[], startingIndex?: number): number[];
  5017. /**
  5018. * Retrieves an instance from a packed array.
  5019. * @param array - The packed array.
  5020. * @param [startingIndex = 0] - The starting index of the element to be unpacked.
  5021. * @param [result] - The object into which to store the result.
  5022. * @returns The modified result parameter or a new CylinderOutlineGeometry instance if one was not provided.
  5023. */
  5024. static unpack(array: number[], startingIndex?: number, result?: CylinderOutlineGeometry): CylinderOutlineGeometry;
  5025. /**
  5026. * Computes the geometric representation of an outline of a cylinder, including its vertices, indices, and a bounding sphere.
  5027. * @param cylinderGeometry - A description of the cylinder outline.
  5028. * @returns The computed vertices and indices.
  5029. */
  5030. static createGeometry(cylinderGeometry: CylinderOutlineGeometry): Geometry | undefined;
  5031. }
  5032. /**
  5033. * A simple proxy that appends the desired resource as the sole query parameter
  5034. * to the given proxy URL.
  5035. * @param proxy - The proxy URL that will be used to requests all resources.
  5036. */
  5037. export class DefaultProxy extends Proxy {
  5038. constructor(proxy: string);
  5039. /**
  5040. * Get the final URL to use to request a given resource.
  5041. * @param resource - The resource to request.
  5042. * @returns proxied resource
  5043. */
  5044. getURL(resource: string): string;
  5045. }
  5046. /**
  5047. * Constructs an exception object that is thrown due to a developer error, e.g., invalid argument,
  5048. * argument out of range, etc. This exception should only be thrown during development;
  5049. * it usually indicates a bug in the calling code. This exception should never be
  5050. * caught; instead the calling code should strive not to generate it.
  5051. * <br /><br />
  5052. * On the other hand, a {@link RuntimeError} indicates an exception that may
  5053. * be thrown at runtime, e.g., out of memory, that the calling code should be prepared
  5054. * to catch.
  5055. * @param [message] - The error message for this exception.
  5056. */
  5057. export class DeveloperError extends Error {
  5058. constructor(message?: string);
  5059. /**
  5060. * 'DeveloperError' indicating that this exception was thrown due to a developer error.
  5061. */
  5062. readonly name: string;
  5063. /**
  5064. * The explanation for why this exception was thrown.
  5065. */
  5066. readonly message: string;
  5067. /**
  5068. * The stack trace of this exception, if available.
  5069. */
  5070. readonly stack: string;
  5071. }
  5072. /**
  5073. * Determines visibility based on the distance to the camera.
  5074. * @example
  5075. * // Make a billboard that is only visible when the distance to the camera is between 10 and 20 meters.
  5076. * billboard.distanceDisplayCondition = new Cesium.DistanceDisplayCondition(10.0, 20.0);
  5077. * @param [near = 0.0] - The smallest distance in the interval where the object is visible.
  5078. * @param [far = Number.MAX_VALUE] - The largest distance in the interval where the object is visible.
  5079. */
  5080. export class DistanceDisplayCondition {
  5081. constructor(near?: number, far?: number);
  5082. /**
  5083. * The smallest distance in the interval where the object is visible.
  5084. */
  5085. near: number;
  5086. /**
  5087. * The largest distance in the interval where the object is visible.
  5088. */
  5089. far: number;
  5090. /**
  5091. * The number of elements used to pack the object into an array.
  5092. */
  5093. static packedLength: number;
  5094. /**
  5095. * Stores the provided instance into the provided array.
  5096. * @param value - The value to pack.
  5097. * @param array - The array to pack into.
  5098. * @param [startingIndex = 0] - The index into the array at which to start packing the elements.
  5099. * @returns The array that was packed into
  5100. */
  5101. static pack(value: DistanceDisplayCondition, array: number[], startingIndex?: number): number[];
  5102. /**
  5103. * Retrieves an instance from a packed array.
  5104. * @param array - The packed array.
  5105. * @param [startingIndex = 0] - The starting index of the element to be unpacked.
  5106. * @param [result] - The object into which to store the result.
  5107. * @returns The modified result parameter or a new DistanceDisplayCondition instance if one was not provided.
  5108. */
  5109. static unpack(array: number[], startingIndex?: number, result?: DistanceDisplayCondition): DistanceDisplayCondition;
  5110. /**
  5111. * Determines if two distance display conditions are equal.
  5112. * @param left - A distance display condition.
  5113. * @param right - Another distance display condition.
  5114. * @returns Whether the two distance display conditions are equal.
  5115. */
  5116. static equals(left: DistanceDisplayCondition, right: DistanceDisplayCondition): boolean;
  5117. /**
  5118. * Duplicates a distance display condition instance.
  5119. * @param [value] - The distance display condition to duplicate.
  5120. * @param [result] - The result onto which to store the result.
  5121. * @returns The duplicated instance.
  5122. */
  5123. static clone(value?: DistanceDisplayCondition, result?: DistanceDisplayCondition): DistanceDisplayCondition;
  5124. /**
  5125. * Duplicates this instance.
  5126. * @param [result] - The result onto which to store the result.
  5127. * @returns The duplicated instance.
  5128. */
  5129. clone(result?: DistanceDisplayCondition): DistanceDisplayCondition;
  5130. /**
  5131. * Determines if this distance display condition is equal to another.
  5132. * @param other - Another distance display condition.
  5133. * @returns Whether this distance display condition is equal to the other.
  5134. */
  5135. equals(other: DistanceDisplayCondition): boolean;
  5136. }
  5137. /**
  5138. * Value and type information for per-instance geometry attribute that determines if the geometry instance has a distance display condition.
  5139. * @example
  5140. * const instance = new Cesium.GeometryInstance({
  5141. * geometry : new Cesium.BoxGeometry({
  5142. * vertexFormat : Cesium.VertexFormat.POSITION_AND_NORMAL,
  5143. * minimum : new Cesium.Cartesian3(-250000.0, -250000.0, -250000.0),
  5144. * maximum : new Cesium.Cartesian3(250000.0, 250000.0, 250000.0)
  5145. * }),
  5146. * modelMatrix : Cesium.Matrix4.multiplyByTranslation(Cesium.Transforms.eastNorthUpToFixedFrame(
  5147. * Cesium.Cartesian3.fromDegrees(-75.59777, 40.03883)), new Cesium.Cartesian3(0.0, 0.0, 1000000.0), new Cesium.Matrix4()),
  5148. * id : 'box',
  5149. * attributes : {
  5150. * distanceDisplayCondition : new Cesium.DistanceDisplayConditionGeometryInstanceAttribute(100.0, 10000.0)
  5151. * }
  5152. * });
  5153. * @param [near = 0.0] - The near distance.
  5154. * @param [far = Number.MAX_VALUE] - The far distance.
  5155. */
  5156. export class DistanceDisplayConditionGeometryInstanceAttribute {
  5157. constructor(near?: number, far?: number);
  5158. /**
  5159. * The values for the attributes stored in a typed array.
  5160. */
  5161. value: Float32Array;
  5162. /**
  5163. * The datatype of each component in the attribute, e.g., individual elements in
  5164. * {@link DistanceDisplayConditionGeometryInstanceAttribute#value}.
  5165. */
  5166. readonly componentDatatype: ComponentDatatype;
  5167. /**
  5168. * The number of components in the attributes, i.e., {@link DistanceDisplayConditionGeometryInstanceAttribute#value}.
  5169. */
  5170. readonly componentsPerAttribute: number;
  5171. /**
  5172. * When <code>true</code> and <code>componentDatatype</code> is an integer format,
  5173. * indicate that the components should be mapped to the range [0, 1] (unsigned)
  5174. * or [-1, 1] (signed) when they are accessed as floating-point for rendering.
  5175. */
  5176. readonly normalize: boolean;
  5177. /**
  5178. * Creates a new {@link DistanceDisplayConditionGeometryInstanceAttribute} instance given the provided an enabled flag and {@link DistanceDisplayCondition}.
  5179. * @example
  5180. * const distanceDisplayCondition = new Cesium.DistanceDisplayCondition(100.0, 10000.0);
  5181. * const instance = new Cesium.GeometryInstance({
  5182. * geometry : geometry,
  5183. * attributes : {
  5184. * distanceDisplayCondition : Cesium.DistanceDisplayConditionGeometryInstanceAttribute.fromDistanceDisplayCondition(distanceDisplayCondition)
  5185. * }
  5186. * });
  5187. * @param distanceDisplayCondition - The distance display condition.
  5188. * @returns The new {@link DistanceDisplayConditionGeometryInstanceAttribute} instance.
  5189. */
  5190. static fromDistanceDisplayCondition(distanceDisplayCondition: DistanceDisplayCondition): DistanceDisplayConditionGeometryInstanceAttribute;
  5191. /**
  5192. * Converts a distance display condition to a typed array that can be used to assign a distance display condition attribute.
  5193. * @example
  5194. * const attributes = primitive.getGeometryInstanceAttributes('an id');
  5195. * attributes.distanceDisplayCondition = Cesium.DistanceDisplayConditionGeometryInstanceAttribute.toValue(distanceDisplayCondition, attributes.distanceDisplayCondition);
  5196. * @param distanceDisplayCondition - The distance display condition value.
  5197. * @param [result] - The array to store the result in, if undefined a new instance will be created.
  5198. * @returns The modified result parameter or a new instance if result was undefined.
  5199. */
  5200. static toValue(distanceDisplayCondition: DistanceDisplayCondition, result?: Float32Array): Float32Array;
  5201. }
  5202. /**
  5203. * Easing functions for use with TweenCollection. These function are from
  5204. * {@link https://github.com/sole/tween.js/|Tween.js} and Robert Penner. See the
  5205. * {@link http://sole.github.io/tween.js/examples/03_graphs.html|Tween.js graphs for each function}.
  5206. */
  5207. export namespace EasingFunction {
  5208. /**
  5209. * Linear easing.
  5210. */
  5211. const LINEAR_NONE: EasingFunction.Callback;
  5212. /**
  5213. * Quadratic in.
  5214. */
  5215. const QUADRATIC_IN: EasingFunction.Callback;
  5216. /**
  5217. * Quadratic out.
  5218. */
  5219. const QUADRATIC_OUT: EasingFunction.Callback;
  5220. /**
  5221. * Quadratic in then out.
  5222. */
  5223. const QUADRATIC_IN_OUT: EasingFunction.Callback;
  5224. /**
  5225. * Cubic in.
  5226. */
  5227. const CUBIC_IN: EasingFunction.Callback;
  5228. /**
  5229. * Cubic out.
  5230. */
  5231. const CUBIC_OUT: EasingFunction.Callback;
  5232. /**
  5233. * Cubic in then out.
  5234. */
  5235. const CUBIC_IN_OUT: EasingFunction.Callback;
  5236. /**
  5237. * Quartic in.
  5238. */
  5239. const QUARTIC_IN: EasingFunction.Callback;
  5240. /**
  5241. * Quartic out.
  5242. */
  5243. const QUARTIC_OUT: EasingFunction.Callback;
  5244. /**
  5245. * Quartic in then out.
  5246. */
  5247. const QUARTIC_IN_OUT: EasingFunction.Callback;
  5248. /**
  5249. * Quintic in.
  5250. */
  5251. const QUINTIC_IN: EasingFunction.Callback;
  5252. /**
  5253. * Quintic out.
  5254. */
  5255. const QUINTIC_OUT: EasingFunction.Callback;
  5256. /**
  5257. * Quintic in then out.
  5258. */
  5259. const QUINTIC_IN_OUT: EasingFunction.Callback;
  5260. /**
  5261. * Sinusoidal in.
  5262. */
  5263. const SINUSOIDAL_IN: EasingFunction.Callback;
  5264. /**
  5265. * Sinusoidal out.
  5266. */
  5267. const SINUSOIDAL_OUT: EasingFunction.Callback;
  5268. /**
  5269. * Sinusoidal in then out.
  5270. */
  5271. const SINUSOIDAL_IN_OUT: EasingFunction.Callback;
  5272. /**
  5273. * Exponential in.
  5274. */
  5275. const EXPONENTIAL_IN: EasingFunction.Callback;
  5276. /**
  5277. * Exponential out.
  5278. */
  5279. const EXPONENTIAL_OUT: EasingFunction.Callback;
  5280. /**
  5281. * Exponential in then out.
  5282. */
  5283. const EXPONENTIAL_IN_OUT: EasingFunction.Callback;
  5284. /**
  5285. * Circular in.
  5286. */
  5287. const CIRCULAR_IN: EasingFunction.Callback;
  5288. /**
  5289. * Circular out.
  5290. */
  5291. const CIRCULAR_OUT: EasingFunction.Callback;
  5292. /**
  5293. * Circular in then out.
  5294. */
  5295. const CIRCULAR_IN_OUT: EasingFunction.Callback;
  5296. /**
  5297. * Elastic in.
  5298. */
  5299. const ELASTIC_IN: EasingFunction.Callback;
  5300. /**
  5301. * Elastic out.
  5302. */
  5303. const ELASTIC_OUT: EasingFunction.Callback;
  5304. /**
  5305. * Elastic in then out.
  5306. */
  5307. const ELASTIC_IN_OUT: EasingFunction.Callback;
  5308. /**
  5309. * Back in.
  5310. */
  5311. const BACK_IN: EasingFunction.Callback;
  5312. /**
  5313. * Back out.
  5314. */
  5315. const BACK_OUT: EasingFunction.Callback;
  5316. /**
  5317. * Back in then out.
  5318. */
  5319. const BACK_IN_OUT: EasingFunction.Callback;
  5320. /**
  5321. * Bounce in.
  5322. */
  5323. const BOUNCE_IN: EasingFunction.Callback;
  5324. /**
  5325. * Bounce out.
  5326. */
  5327. const BOUNCE_OUT: EasingFunction.Callback;
  5328. /**
  5329. * Bounce in then out.
  5330. */
  5331. const BOUNCE_IN_OUT: EasingFunction.Callback;
  5332. /**
  5333. * Function interface for implementing a custom easing function.
  5334. * @example
  5335. * function quadraticIn(time) {
  5336. * return time * time;
  5337. * }
  5338. * @example
  5339. * function quadraticOut(time) {
  5340. * return time * (2.0 - time);
  5341. * }
  5342. * @param time - The time in the range <code>[0, 1]</code>.
  5343. */
  5344. type Callback = (time: number) => number;
  5345. }
  5346. /**
  5347. * A description of an ellipse on an ellipsoid. Ellipse geometry can be rendered with both {@link Primitive} and {@link GroundPrimitive}.
  5348. * @example
  5349. * // Create an ellipse.
  5350. * const ellipse = new Cesium.EllipseGeometry({
  5351. * center : Cesium.Cartesian3.fromDegrees(-75.59777, 40.03883),
  5352. * semiMajorAxis : 500000.0,
  5353. * semiMinorAxis : 300000.0,
  5354. * rotation : Cesium.Math.toRadians(60.0)
  5355. * });
  5356. * const geometry = Cesium.EllipseGeometry.createGeometry(ellipse);
  5357. * @param options - Object with the following properties:
  5358. * @param options.center - The ellipse's center point in the fixed frame.
  5359. * @param options.semiMajorAxis - The length of the ellipse's semi-major axis in meters.
  5360. * @param options.semiMinorAxis - The length of the ellipse's semi-minor axis in meters.
  5361. * @param [options.ellipsoid = Ellipsoid.WGS84] - The ellipsoid the ellipse will be on.
  5362. * @param [options.height = 0.0] - The distance in meters between the ellipse and the ellipsoid surface.
  5363. * @param [options.extrudedHeight] - The distance in meters between the ellipse's extruded face and the ellipsoid surface.
  5364. * @param [options.rotation = 0.0] - The angle of rotation counter-clockwise from north.
  5365. * @param [options.stRotation = 0.0] - The rotation of the texture coordinates counter-clockwise from north.
  5366. * @param [options.granularity = Math.RADIANS_PER_DEGREE] - The angular distance between points on the ellipse in radians.
  5367. * @param [options.vertexFormat = VertexFormat.DEFAULT] - The vertex attributes to be computed.
  5368. */
  5369. export class EllipseGeometry {
  5370. constructor(options: {
  5371. center: Cartesian3;
  5372. semiMajorAxis: number;
  5373. semiMinorAxis: number;
  5374. ellipsoid?: Ellipsoid;
  5375. height?: number;
  5376. extrudedHeight?: number;
  5377. rotation?: number;
  5378. stRotation?: number;
  5379. granularity?: number;
  5380. vertexFormat?: VertexFormat;
  5381. });
  5382. /**
  5383. * The number of elements used to pack the object into an array.
  5384. */
  5385. static packedLength: number;
  5386. /**
  5387. * Stores the provided instance into the provided array.
  5388. * @param value - The value to pack.
  5389. * @param array - The array to pack into.
  5390. * @param [startingIndex = 0] - The index into the array at which to start packing the elements.
  5391. * @returns The array that was packed into
  5392. */
  5393. static pack(value: EllipseGeometry, array: number[], startingIndex?: number): number[];
  5394. /**
  5395. * Retrieves an instance from a packed array.
  5396. * @param array - The packed array.
  5397. * @param [startingIndex = 0] - The starting index of the element to be unpacked.
  5398. * @param [result] - The object into which to store the result.
  5399. * @returns The modified result parameter or a new EllipseGeometry instance if one was not provided.
  5400. */
  5401. static unpack(array: number[], startingIndex?: number, result?: EllipseGeometry): EllipseGeometry;
  5402. /**
  5403. * Computes the bounding rectangle based on the provided options
  5404. * @param options - Object with the following properties:
  5405. * @param options.center - The ellipse's center point in the fixed frame.
  5406. * @param options.semiMajorAxis - The length of the ellipse's semi-major axis in meters.
  5407. * @param options.semiMinorAxis - The length of the ellipse's semi-minor axis in meters.
  5408. * @param [options.ellipsoid = Ellipsoid.WGS84] - The ellipsoid the ellipse will be on.
  5409. * @param [options.rotation = 0.0] - The angle of rotation counter-clockwise from north.
  5410. * @param [options.granularity = Math.RADIANS_PER_DEGREE] - The angular distance between points on the ellipse in radians.
  5411. * @param [result] - An object in which to store the result
  5412. * @returns The result rectangle
  5413. */
  5414. static computeRectangle(options: {
  5415. center: Cartesian3;
  5416. semiMajorAxis: number;
  5417. semiMinorAxis: number;
  5418. ellipsoid?: Ellipsoid;
  5419. rotation?: number;
  5420. granularity?: number;
  5421. }, result?: Rectangle): Rectangle;
  5422. /**
  5423. * Computes the geometric representation of a ellipse on an ellipsoid, including its vertices, indices, and a bounding sphere.
  5424. * @param ellipseGeometry - A description of the ellipse.
  5425. * @returns The computed vertices and indices.
  5426. */
  5427. static createGeometry(ellipseGeometry: EllipseGeometry): Geometry | undefined;
  5428. }
  5429. /**
  5430. * A description of the outline of an ellipse on an ellipsoid.
  5431. * @example
  5432. * const ellipse = new Cesium.EllipseOutlineGeometry({
  5433. * center : Cesium.Cartesian3.fromDegrees(-75.59777, 40.03883),
  5434. * semiMajorAxis : 500000.0,
  5435. * semiMinorAxis : 300000.0,
  5436. * rotation : Cesium.Math.toRadians(60.0)
  5437. * });
  5438. * const geometry = Cesium.EllipseOutlineGeometry.createGeometry(ellipse);
  5439. * @param options - Object with the following properties:
  5440. * @param options.center - The ellipse's center point in the fixed frame.
  5441. * @param options.semiMajorAxis - The length of the ellipse's semi-major axis in meters.
  5442. * @param options.semiMinorAxis - The length of the ellipse's semi-minor axis in meters.
  5443. * @param [options.ellipsoid = Ellipsoid.WGS84] - The ellipsoid the ellipse will be on.
  5444. * @param [options.height = 0.0] - The distance in meters between the ellipse and the ellipsoid surface.
  5445. * @param [options.extrudedHeight] - The distance in meters between the ellipse's extruded face and the ellipsoid surface.
  5446. * @param [options.rotation = 0.0] - The angle from north (counter-clockwise) in radians.
  5447. * @param [options.granularity = 0.02] - The angular distance between points on the ellipse in radians.
  5448. * @param [options.numberOfVerticalLines = 16] - Number of lines to draw between the top and bottom surface of an extruded ellipse.
  5449. */
  5450. export class EllipseOutlineGeometry {
  5451. constructor(options: {
  5452. center: Cartesian3;
  5453. semiMajorAxis: number;
  5454. semiMinorAxis: number;
  5455. ellipsoid?: Ellipsoid;
  5456. height?: number;
  5457. extrudedHeight?: number;
  5458. rotation?: number;
  5459. granularity?: number;
  5460. numberOfVerticalLines?: number;
  5461. });
  5462. /**
  5463. * The number of elements used to pack the object into an array.
  5464. */
  5465. static packedLength: number;
  5466. /**
  5467. * Stores the provided instance into the provided array.
  5468. * @param value - The value to pack.
  5469. * @param array - The array to pack into.
  5470. * @param [startingIndex = 0] - The index into the array at which to start packing the elements.
  5471. * @returns The array that was packed into
  5472. */
  5473. static pack(value: EllipseOutlineGeometry, array: number[], startingIndex?: number): number[];
  5474. /**
  5475. * Retrieves an instance from a packed array.
  5476. * @param array - The packed array.
  5477. * @param [startingIndex = 0] - The starting index of the element to be unpacked.
  5478. * @param [result] - The object into which to store the result.
  5479. * @returns The modified result parameter or a new EllipseOutlineGeometry instance if one was not provided.
  5480. */
  5481. static unpack(array: number[], startingIndex?: number, result?: EllipseOutlineGeometry): EllipseOutlineGeometry;
  5482. /**
  5483. * Computes the geometric representation of an outline of an ellipse on an ellipsoid, including its vertices, indices, and a bounding sphere.
  5484. * @param ellipseGeometry - A description of the ellipse.
  5485. * @returns The computed vertices and indices.
  5486. */
  5487. static createGeometry(ellipseGeometry: EllipseOutlineGeometry): Geometry | undefined;
  5488. }
  5489. /**
  5490. * A quadratic surface defined in Cartesian coordinates by the equation
  5491. * <code>(x / a)^2 + (y / b)^2 + (z / c)^2 = 1</code>. Primarily used
  5492. * by Cesium to represent the shape of planetary bodies.
  5493. *
  5494. * Rather than constructing this object directly, one of the provided
  5495. * constants is normally used.
  5496. * @param [x = 0] - The radius in the x direction.
  5497. * @param [y = 0] - The radius in the y direction.
  5498. * @param [z = 0] - The radius in the z direction.
  5499. */
  5500. export class Ellipsoid {
  5501. constructor(x?: number, y?: number, z?: number);
  5502. /**
  5503. * Gets the radii of the ellipsoid.
  5504. */
  5505. readonly radii: Cartesian3;
  5506. /**
  5507. * Gets the squared radii of the ellipsoid.
  5508. */
  5509. readonly radiiSquared: Cartesian3;
  5510. /**
  5511. * Gets the radii of the ellipsoid raise to the fourth power.
  5512. */
  5513. readonly radiiToTheFourth: Cartesian3;
  5514. /**
  5515. * Gets one over the radii of the ellipsoid.
  5516. */
  5517. readonly oneOverRadii: Cartesian3;
  5518. /**
  5519. * Gets one over the squared radii of the ellipsoid.
  5520. */
  5521. readonly oneOverRadiiSquared: Cartesian3;
  5522. /**
  5523. * Gets the minimum radius of the ellipsoid.
  5524. */
  5525. readonly minimumRadius: number;
  5526. /**
  5527. * Gets the maximum radius of the ellipsoid.
  5528. */
  5529. readonly maximumRadius: number;
  5530. /**
  5531. * Duplicates an Ellipsoid instance.
  5532. * @param ellipsoid - The ellipsoid to duplicate.
  5533. * @param [result] - The object onto which to store the result, or undefined if a new
  5534. * instance should be created.
  5535. * @returns The cloned Ellipsoid. (Returns undefined if ellipsoid is undefined)
  5536. */
  5537. static clone(ellipsoid: Ellipsoid, result?: Ellipsoid): Ellipsoid;
  5538. /**
  5539. * Computes an Ellipsoid from a Cartesian specifying the radii in x, y, and z directions.
  5540. * @param [cartesian = Cartesian3.ZERO] - The ellipsoid's radius in the x, y, and z directions.
  5541. * @param [result] - The object onto which to store the result, or undefined if a new
  5542. * instance should be created.
  5543. * @returns A new Ellipsoid instance.
  5544. */
  5545. static fromCartesian3(cartesian?: Cartesian3, result?: Ellipsoid): Ellipsoid;
  5546. /**
  5547. * An Ellipsoid instance initialized to the WGS84 standard.
  5548. */
  5549. static readonly WGS84: Ellipsoid;
  5550. /**
  5551. * An Ellipsoid instance initialized to radii of (1.0, 1.0, 1.0).
  5552. */
  5553. static readonly UNIT_SPHERE: Ellipsoid;
  5554. /**
  5555. * An Ellipsoid instance initialized to a sphere with the lunar radius.
  5556. */
  5557. static readonly MOON: Ellipsoid;
  5558. /**
  5559. * Duplicates an Ellipsoid instance.
  5560. * @param [result] - The object onto which to store the result, or undefined if a new
  5561. * instance should be created.
  5562. * @returns The cloned Ellipsoid.
  5563. */
  5564. clone(result?: Ellipsoid): Ellipsoid;
  5565. /**
  5566. * The number of elements used to pack the object into an array.
  5567. */
  5568. static packedLength: number;
  5569. /**
  5570. * Stores the provided instance into the provided array.
  5571. * @param value - The value to pack.
  5572. * @param array - The array to pack into.
  5573. * @param [startingIndex = 0] - The index into the array at which to start packing the elements.
  5574. * @returns The array that was packed into
  5575. */
  5576. static pack(value: Ellipsoid, array: number[], startingIndex?: number): number[];
  5577. /**
  5578. * Retrieves an instance from a packed array.
  5579. * @param array - The packed array.
  5580. * @param [startingIndex = 0] - The starting index of the element to be unpacked.
  5581. * @param [result] - The object into which to store the result.
  5582. * @returns The modified result parameter or a new Ellipsoid instance if one was not provided.
  5583. */
  5584. static unpack(array: number[], startingIndex?: number, result?: Ellipsoid): Ellipsoid;
  5585. /**
  5586. * Computes the unit vector directed from the center of this ellipsoid toward the provided Cartesian position.
  5587. * @param cartesian - The Cartesian for which to to determine the geocentric normal.
  5588. * @param [result] - The object onto which to store the result.
  5589. * @returns The modified result parameter or a new Cartesian3 instance if none was provided.
  5590. */
  5591. geocentricSurfaceNormal(cartesian: Cartesian3, result?: Cartesian3): Cartesian3;
  5592. /**
  5593. * Computes the normal of the plane tangent to the surface of the ellipsoid at the provided position.
  5594. * @param cartographic - The cartographic position for which to to determine the geodetic normal.
  5595. * @param [result] - The object onto which to store the result.
  5596. * @returns The modified result parameter or a new Cartesian3 instance if none was provided.
  5597. */
  5598. geodeticSurfaceNormalCartographic(cartographic: Cartographic, result?: Cartesian3): Cartesian3;
  5599. /**
  5600. * Computes the normal of the plane tangent to the surface of the ellipsoid at the provided position.
  5601. * @param cartesian - The Cartesian position for which to to determine the surface normal.
  5602. * @param [result] - The object onto which to store the result.
  5603. * @returns The modified result parameter or a new Cartesian3 instance if none was provided, or undefined if a normal cannot be found.
  5604. */
  5605. geodeticSurfaceNormal(cartesian: Cartesian3, result?: Cartesian3): Cartesian3;
  5606. /**
  5607. * Converts the provided cartographic to Cartesian representation.
  5608. * @example
  5609. * //Create a Cartographic and determine it's Cartesian representation on a WGS84 ellipsoid.
  5610. * const position = new Cesium.Cartographic(Cesium.Math.toRadians(21), Cesium.Math.toRadians(78), 5000);
  5611. * const cartesianPosition = Cesium.Ellipsoid.WGS84.cartographicToCartesian(position);
  5612. * @param cartographic - The cartographic position.
  5613. * @param [result] - The object onto which to store the result.
  5614. * @returns The modified result parameter or a new Cartesian3 instance if none was provided.
  5615. */
  5616. cartographicToCartesian(cartographic: Cartographic, result?: Cartesian3): Cartesian3;
  5617. /**
  5618. * Converts the provided array of cartographics to an array of Cartesians.
  5619. * @example
  5620. * //Convert an array of Cartographics and determine their Cartesian representation on a WGS84 ellipsoid.
  5621. * const positions = [new Cesium.Cartographic(Cesium.Math.toRadians(21), Cesium.Math.toRadians(78), 0),
  5622. * new Cesium.Cartographic(Cesium.Math.toRadians(21.321), Cesium.Math.toRadians(78.123), 100),
  5623. * new Cesium.Cartographic(Cesium.Math.toRadians(21.645), Cesium.Math.toRadians(78.456), 250)];
  5624. * const cartesianPositions = Cesium.Ellipsoid.WGS84.cartographicArrayToCartesianArray(positions);
  5625. * @param cartographics - An array of cartographic positions.
  5626. * @param [result] - The object onto which to store the result.
  5627. * @returns The modified result parameter or a new Array instance if none was provided.
  5628. */
  5629. cartographicArrayToCartesianArray(cartographics: Cartographic[], result?: Cartesian3[]): Cartesian3[];
  5630. /**
  5631. * Converts the provided cartesian to cartographic representation.
  5632. * The cartesian is undefined at the center of the ellipsoid.
  5633. * @example
  5634. * //Create a Cartesian and determine it's Cartographic representation on a WGS84 ellipsoid.
  5635. * const position = new Cesium.Cartesian3(17832.12, 83234.52, 952313.73);
  5636. * const cartographicPosition = Cesium.Ellipsoid.WGS84.cartesianToCartographic(position);
  5637. * @param cartesian - The Cartesian position to convert to cartographic representation.
  5638. * @param [result] - The object onto which to store the result.
  5639. * @returns The modified result parameter, new Cartographic instance if none was provided, or undefined if the cartesian is at the center of the ellipsoid.
  5640. */
  5641. cartesianToCartographic(cartesian: Cartesian3, result?: Cartographic): Cartographic;
  5642. /**
  5643. * Converts the provided array of cartesians to an array of cartographics.
  5644. * @example
  5645. * //Create an array of Cartesians and determine their Cartographic representation on a WGS84 ellipsoid.
  5646. * const positions = [new Cesium.Cartesian3(17832.12, 83234.52, 952313.73),
  5647. * new Cesium.Cartesian3(17832.13, 83234.53, 952313.73),
  5648. * new Cesium.Cartesian3(17832.14, 83234.54, 952313.73)]
  5649. * const cartographicPositions = Cesium.Ellipsoid.WGS84.cartesianArrayToCartographicArray(positions);
  5650. * @param cartesians - An array of Cartesian positions.
  5651. * @param [result] - The object onto which to store the result.
  5652. * @returns The modified result parameter or a new Array instance if none was provided.
  5653. */
  5654. cartesianArrayToCartographicArray(cartesians: Cartesian3[], result?: Cartographic[]): Cartographic[];
  5655. /**
  5656. * Scales the provided Cartesian position along the geodetic surface normal
  5657. * so that it is on the surface of this ellipsoid. If the position is
  5658. * at the center of the ellipsoid, this function returns undefined.
  5659. * @param cartesian - The Cartesian position to scale.
  5660. * @param [result] - The object onto which to store the result.
  5661. * @returns The modified result parameter, a new Cartesian3 instance if none was provided, or undefined if the position is at the center.
  5662. */
  5663. scaleToGeodeticSurface(cartesian: Cartesian3, result?: Cartesian3): Cartesian3;
  5664. /**
  5665. * Scales the provided Cartesian position along the geocentric surface normal
  5666. * so that it is on the surface of this ellipsoid.
  5667. * @param cartesian - The Cartesian position to scale.
  5668. * @param [result] - The object onto which to store the result.
  5669. * @returns The modified result parameter or a new Cartesian3 instance if none was provided.
  5670. */
  5671. scaleToGeocentricSurface(cartesian: Cartesian3, result?: Cartesian3): Cartesian3;
  5672. /**
  5673. * Transforms a Cartesian X, Y, Z position to the ellipsoid-scaled space by multiplying
  5674. * its components by the result of {@link Ellipsoid#oneOverRadii}.
  5675. * @param position - The position to transform.
  5676. * @param [result] - The position to which to copy the result, or undefined to create and
  5677. * return a new instance.
  5678. * @returns The position expressed in the scaled space. The returned instance is the
  5679. * one passed as the result parameter if it is not undefined, or a new instance of it is.
  5680. */
  5681. transformPositionToScaledSpace(position: Cartesian3, result?: Cartesian3): Cartesian3;
  5682. /**
  5683. * Transforms a Cartesian X, Y, Z position from the ellipsoid-scaled space by multiplying
  5684. * its components by the result of {@link Ellipsoid#radii}.
  5685. * @param position - The position to transform.
  5686. * @param [result] - The position to which to copy the result, or undefined to create and
  5687. * return a new instance.
  5688. * @returns The position expressed in the unscaled space. The returned instance is the
  5689. * one passed as the result parameter if it is not undefined, or a new instance of it is.
  5690. */
  5691. transformPositionFromScaledSpace(position: Cartesian3, result?: Cartesian3): Cartesian3;
  5692. /**
  5693. * Compares this Ellipsoid against the provided Ellipsoid componentwise and returns
  5694. * <code>true</code> if they are equal, <code>false</code> otherwise.
  5695. * @param [right] - The other Ellipsoid.
  5696. * @returns <code>true</code> if they are equal, <code>false</code> otherwise.
  5697. */
  5698. equals(right?: Ellipsoid): boolean;
  5699. /**
  5700. * Creates a string representing this Ellipsoid in the format '(radii.x, radii.y, radii.z)'.
  5701. * @returns A string representing this ellipsoid in the format '(radii.x, radii.y, radii.z)'.
  5702. */
  5703. toString(): string;
  5704. /**
  5705. * Computes a point which is the intersection of the surface normal with the z-axis.
  5706. * @param position - the position. must be on the surface of the ellipsoid.
  5707. * @param [buffer = 0.0] - A buffer to subtract from the ellipsoid size when checking if the point is inside the ellipsoid.
  5708. * 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.
  5709. * In WGS84 datum, intersection point is at max z = +-42841.31151331382 (0.673% of z-axis).
  5710. * Intersection point could be outside the ellipsoid if the ratio of MajorAxis / AxisOfRotation is bigger than the square root of 2
  5711. * @param [result] - The cartesian to which to copy the result, or undefined to create and
  5712. * return a new instance.
  5713. * @returns the intersection point if it's inside the ellipsoid, undefined otherwise
  5714. */
  5715. getSurfaceNormalIntersectionWithZAxis(position: Cartesian3, buffer?: number, result?: Cartesian3): Cartesian3 | undefined;
  5716. /**
  5717. * Computes an approximation of the surface area of a rectangle on the surface of an ellipsoid using
  5718. * Gauss-Legendre 10th order quadrature.
  5719. * @param rectangle - The rectangle used for computing the surface area.
  5720. * @returns The approximate area of the rectangle on the surface of this ellipsoid.
  5721. */
  5722. surfaceArea(rectangle: Rectangle): number;
  5723. }
  5724. /**
  5725. * Initializes a geodesic on the ellipsoid connecting the two provided planetodetic points.
  5726. * @param [start] - The initial planetodetic point on the path.
  5727. * @param [end] - The final planetodetic point on the path.
  5728. * @param [ellipsoid = Ellipsoid.WGS84] - The ellipsoid on which the geodesic lies.
  5729. */
  5730. export class EllipsoidGeodesic {
  5731. constructor(start?: Cartographic, end?: Cartographic, ellipsoid?: Ellipsoid);
  5732. /**
  5733. * Gets the ellipsoid.
  5734. */
  5735. readonly ellipsoid: Ellipsoid;
  5736. /**
  5737. * Gets the surface distance between the start and end point
  5738. */
  5739. readonly surfaceDistance: number;
  5740. /**
  5741. * Gets the initial planetodetic point on the path.
  5742. */
  5743. readonly start: Cartographic;
  5744. /**
  5745. * Gets the final planetodetic point on the path.
  5746. */
  5747. readonly end: Cartographic;
  5748. /**
  5749. * Gets the heading at the initial point.
  5750. */
  5751. readonly startHeading: number;
  5752. /**
  5753. * Gets the heading at the final point.
  5754. */
  5755. readonly endHeading: number;
  5756. /**
  5757. * Sets the start and end points of the geodesic
  5758. * @param start - The initial planetodetic point on the path.
  5759. * @param end - The final planetodetic point on the path.
  5760. */
  5761. setEndPoints(start: Cartographic, end: Cartographic): void;
  5762. /**
  5763. * Provides the location of a point at the indicated portion along the geodesic.
  5764. * @param fraction - The portion of the distance between the initial and final points.
  5765. * @param [result] - The object in which to store the result.
  5766. * @returns The location of the point along the geodesic.
  5767. */
  5768. interpolateUsingFraction(fraction: number, result?: Cartographic): Cartographic;
  5769. /**
  5770. * Provides the location of a point at the indicated distance along the geodesic.
  5771. * @param distance - The distance from the inital point to the point of interest along the geodesic
  5772. * @param [result] - The object in which to store the result.
  5773. * @returns The location of the point along the geodesic.
  5774. */
  5775. interpolateUsingSurfaceDistance(distance: number, result?: Cartographic): Cartographic;
  5776. }
  5777. /**
  5778. * A description of an ellipsoid centered at the origin.
  5779. * @example
  5780. * const ellipsoid = new Cesium.EllipsoidGeometry({
  5781. * vertexFormat : Cesium.VertexFormat.POSITION_ONLY,
  5782. * radii : new Cesium.Cartesian3(1000000.0, 500000.0, 500000.0)
  5783. * });
  5784. * const geometry = Cesium.EllipsoidGeometry.createGeometry(ellipsoid);
  5785. * @param [options] - Object with the following properties:
  5786. * @param [options.radii = Cartesian3(1.0, 1.0, 1.0)] - The radii of the ellipsoid in the x, y, and z directions.
  5787. * @param [options.innerRadii = options.radii] - The inner radii of the ellipsoid in the x, y, and z directions.
  5788. * @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.
  5789. * @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.
  5790. * @param [options.minimumCone = 0.0] - The minimum angle measured from the positive z-axis and toward the negative z-axis.
  5791. * @param [options.maximumCone = PI] - The maximum angle measured from the positive z-axis and toward the negative z-axis.
  5792. * @param [options.stackPartitions = 64] - The number of times to partition the ellipsoid into stacks.
  5793. * @param [options.slicePartitions = 64] - The number of times to partition the ellipsoid into radial slices.
  5794. * @param [options.vertexFormat = VertexFormat.DEFAULT] - The vertex attributes to be computed.
  5795. */
  5796. export class EllipsoidGeometry {
  5797. constructor(options?: {
  5798. radii?: Cartesian3;
  5799. innerRadii?: Cartesian3;
  5800. minimumClock?: number;
  5801. maximumClock?: number;
  5802. minimumCone?: number;
  5803. maximumCone?: number;
  5804. stackPartitions?: number;
  5805. slicePartitions?: number;
  5806. vertexFormat?: VertexFormat;
  5807. });
  5808. /**
  5809. * The number of elements used to pack the object into an array.
  5810. */
  5811. static packedLength: number;
  5812. /**
  5813. * Stores the provided instance into the provided array.
  5814. * @param value - The value to pack.
  5815. * @param array - The array to pack into.
  5816. * @param [startingIndex = 0] - The index into the array at which to start packing the elements.
  5817. * @returns The array that was packed into
  5818. */
  5819. static pack(value: EllipsoidGeometry, array: number[], startingIndex?: number): number[];
  5820. /**
  5821. * Retrieves an instance from a packed array.
  5822. * @param array - The packed array.
  5823. * @param [startingIndex = 0] - The starting index of the element to be unpacked.
  5824. * @param [result] - The object into which to store the result.
  5825. * @returns The modified result parameter or a new EllipsoidGeometry instance if one was not provided.
  5826. */
  5827. static unpack(array: number[], startingIndex?: number, result?: EllipsoidGeometry): EllipsoidGeometry;
  5828. /**
  5829. * Computes the geometric representation of an ellipsoid, including its vertices, indices, and a bounding sphere.
  5830. * @param ellipsoidGeometry - A description of the ellipsoid.
  5831. * @returns The computed vertices and indices.
  5832. */
  5833. static createGeometry(ellipsoidGeometry: EllipsoidGeometry): Geometry | undefined;
  5834. }
  5835. /**
  5836. * A description of the outline of an ellipsoid centered at the origin.
  5837. * @example
  5838. * const ellipsoid = new Cesium.EllipsoidOutlineGeometry({
  5839. * radii : new Cesium.Cartesian3(1000000.0, 500000.0, 500000.0),
  5840. * stackPartitions: 6,
  5841. * slicePartitions: 5
  5842. * });
  5843. * const geometry = Cesium.EllipsoidOutlineGeometry.createGeometry(ellipsoid);
  5844. * @param [options] - Object with the following properties:
  5845. * @param [options.radii = Cartesian3(1.0, 1.0, 1.0)] - The radii of the ellipsoid in the x, y, and z directions.
  5846. * @param [options.innerRadii = options.radii] - The inner radii of the ellipsoid in the x, y, and z directions.
  5847. * @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.
  5848. * @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.
  5849. * @param [options.minimumCone = 0.0] - The minimum angle measured from the positive z-axis and toward the negative z-axis.
  5850. * @param [options.maximumCone = PI] - The maximum angle measured from the positive z-axis and toward the negative z-axis.
  5851. * @param [options.stackPartitions = 10] - The count of stacks for the ellipsoid (1 greater than the number of parallel lines).
  5852. * @param [options.slicePartitions = 8] - The count of slices for the ellipsoid (Equal to the number of radial lines).
  5853. * @param [options.subdivisions = 128] - The number of points per line, determining the granularity of the curvature.
  5854. */
  5855. export class EllipsoidOutlineGeometry {
  5856. constructor(options?: {
  5857. radii?: Cartesian3;
  5858. innerRadii?: Cartesian3;
  5859. minimumClock?: number;
  5860. maximumClock?: number;
  5861. minimumCone?: number;
  5862. maximumCone?: number;
  5863. stackPartitions?: number;
  5864. slicePartitions?: number;
  5865. subdivisions?: number;
  5866. });
  5867. /**
  5868. * The number of elements used to pack the object into an array.
  5869. */
  5870. static packedLength: number;
  5871. /**
  5872. * Stores the provided instance into the provided array.
  5873. * @param value - The value to pack.
  5874. * @param array - The array to pack into.
  5875. * @param [startingIndex = 0] - The index into the array at which to start packing the elements.
  5876. * @returns The array that was packed into
  5877. */
  5878. static pack(value: EllipsoidOutlineGeometry, array: number[], startingIndex?: number): number[];
  5879. /**
  5880. * Retrieves an instance from a packed array.
  5881. * @param array - The packed array.
  5882. * @param [startingIndex = 0] - The starting index of the element to be unpacked.
  5883. * @param [result] - The object into which to store the result.
  5884. * @returns The modified result parameter or a new EllipsoidOutlineGeometry instance if one was not provided.
  5885. */
  5886. static unpack(array: number[], startingIndex?: number, result?: EllipsoidOutlineGeometry): EllipsoidOutlineGeometry;
  5887. /**
  5888. * Computes the geometric representation of an outline of an ellipsoid, including its vertices, indices, and a bounding sphere.
  5889. * @param ellipsoidGeometry - A description of the ellipsoid outline.
  5890. * @returns The computed vertices and indices.
  5891. */
  5892. static createGeometry(ellipsoidGeometry: EllipsoidOutlineGeometry): Geometry | undefined;
  5893. }
  5894. /**
  5895. * Initializes a rhumb line on the ellipsoid connecting the two provided planetodetic points.
  5896. * @param [start] - The initial planetodetic point on the path.
  5897. * @param [end] - The final planetodetic point on the path.
  5898. * @param [ellipsoid = Ellipsoid.WGS84] - The ellipsoid on which the rhumb line lies.
  5899. */
  5900. export class EllipsoidRhumbLine {
  5901. constructor(start?: Cartographic, end?: Cartographic, ellipsoid?: Ellipsoid);
  5902. /**
  5903. * Gets the ellipsoid.
  5904. */
  5905. readonly ellipsoid: Ellipsoid;
  5906. /**
  5907. * Gets the surface distance between the start and end point
  5908. */
  5909. readonly surfaceDistance: number;
  5910. /**
  5911. * Gets the initial planetodetic point on the path.
  5912. */
  5913. readonly start: Cartographic;
  5914. /**
  5915. * Gets the final planetodetic point on the path.
  5916. */
  5917. readonly end: Cartographic;
  5918. /**
  5919. * Gets the heading from the start point to the end point.
  5920. */
  5921. readonly heading: number;
  5922. /**
  5923. * Create a rhumb line using an initial position with a heading and distance.
  5924. * @param start - The initial planetodetic point on the path.
  5925. * @param heading - The heading in radians.
  5926. * @param distance - The rhumb line distance between the start and end point.
  5927. * @param [ellipsoid = Ellipsoid.WGS84] - The ellipsoid on which the rhumb line lies.
  5928. * @param [result] - The object in which to store the result.
  5929. * @returns The EllipsoidRhumbLine object.
  5930. */
  5931. static fromStartHeadingDistance(start: Cartographic, heading: number, distance: number, ellipsoid?: Ellipsoid, result?: EllipsoidRhumbLine): EllipsoidRhumbLine;
  5932. /**
  5933. * Sets the start and end points of the rhumb line.
  5934. * @param start - The initial planetodetic point on the path.
  5935. * @param end - The final planetodetic point on the path.
  5936. */
  5937. setEndPoints(start: Cartographic, end: Cartographic): void;
  5938. /**
  5939. * Provides the location of a point at the indicated portion along the rhumb line.
  5940. * @param fraction - The portion of the distance between the initial and final points.
  5941. * @param [result] - The object in which to store the result.
  5942. * @returns The location of the point along the rhumb line.
  5943. */
  5944. interpolateUsingFraction(fraction: number, result?: Cartographic): Cartographic;
  5945. /**
  5946. * Provides the location of a point at the indicated distance along the rhumb line.
  5947. * @param distance - The distance from the inital point to the point of interest along the rhumbLine.
  5948. * @param [result] - The object in which to store the result.
  5949. * @returns The location of the point along the rhumb line.
  5950. */
  5951. interpolateUsingSurfaceDistance(distance: number, result?: Cartographic): Cartographic;
  5952. /**
  5953. * Provides the location of a point at the indicated longitude along the rhumb line.
  5954. * 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.
  5955. * @param intersectionLongitude - The longitude, in radians, at which to find the intersection point from the starting point using the heading.
  5956. * @param [result] - The object in which to store the result.
  5957. * @returns The location of the intersection point along the rhumb line, undefined if there is no intersection or infinite intersections.
  5958. */
  5959. findIntersectionWithLongitude(intersectionLongitude: number, result?: Cartographic): Cartographic;
  5960. /**
  5961. * Provides the location of a point at the indicated latitude along the rhumb line.
  5962. * 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.
  5963. * @param intersectionLatitude - The latitude, in radians, at which to find the intersection point from the starting point using the heading.
  5964. * @param [result] - The object in which to store the result.
  5965. * @returns The location of the intersection point along the rhumb line, undefined if there is no intersection or infinite intersections.
  5966. */
  5967. findIntersectionWithLatitude(intersectionLatitude: number, result?: Cartographic): Cartographic;
  5968. }
  5969. /**
  5970. * A plane tangent to the provided ellipsoid at the provided origin.
  5971. * If origin is not on the surface of the ellipsoid, it's surface projection will be used.
  5972. * If origin is at the center of the ellipsoid, an exception will be thrown.
  5973. * @param origin - The point on the surface of the ellipsoid where the tangent plane touches.
  5974. * @param [ellipsoid = Ellipsoid.WGS84] - The ellipsoid to use.
  5975. */
  5976. export class EllipsoidTangentPlane {
  5977. constructor(origin: Cartesian3, ellipsoid?: Ellipsoid);
  5978. /**
  5979. * Gets the ellipsoid.
  5980. */
  5981. ellipsoid: Ellipsoid;
  5982. /**
  5983. * Gets the origin.
  5984. */
  5985. origin: Cartesian3;
  5986. /**
  5987. * Gets the plane which is tangent to the ellipsoid.
  5988. */
  5989. readonly plane: Plane;
  5990. /**
  5991. * Gets the local X-axis (east) of the tangent plane.
  5992. */
  5993. readonly xAxis: Cartesian3;
  5994. /**
  5995. * Gets the local Y-axis (north) of the tangent plane.
  5996. */
  5997. readonly yAxis: Cartesian3;
  5998. /**
  5999. * Gets the local Z-axis (up) of the tangent plane.
  6000. */
  6001. readonly zAxis: Cartesian3;
  6002. /**
  6003. * Creates a new instance from the provided ellipsoid and the center
  6004. * point of the provided Cartesians.
  6005. * @param cartesians - The list of positions surrounding the center point.
  6006. * @param [ellipsoid = Ellipsoid.WGS84] - The ellipsoid to use.
  6007. * @returns The new instance of EllipsoidTangentPlane.
  6008. */
  6009. static fromPoints(cartesians: Cartesian3[], ellipsoid?: Ellipsoid): EllipsoidTangentPlane;
  6010. /**
  6011. * Computes the projection of the provided 3D position onto the 2D plane, radially outward from the {@link EllipsoidTangentPlane.ellipsoid} coordinate system origin.
  6012. * @param cartesian - The point to project.
  6013. * @param [result] - The object onto which to store the result.
  6014. * @returns The modified result parameter or a new Cartesian2 instance if none was provided. Undefined if there is no intersection point
  6015. */
  6016. projectPointOntoPlane(cartesian: Cartesian3, result?: Cartesian2): Cartesian2;
  6017. /**
  6018. * Computes the projection of the provided 3D positions onto the 2D plane (where possible), radially outward from the global origin.
  6019. * The resulting array may be shorter than the input array - if a single projection is impossible it will not be included.
  6020. * @param cartesians - The array of points to project.
  6021. * @param [result] - The array of Cartesian2 instances onto which to store results.
  6022. * @returns The modified result parameter or a new array of Cartesian2 instances if none was provided.
  6023. */
  6024. projectPointsOntoPlane(cartesians: Cartesian3[], result?: Cartesian2[]): Cartesian2[];
  6025. /**
  6026. * Computes the projection of the provided 3D position onto the 2D plane, along the plane normal.
  6027. * @param cartesian - The point to project.
  6028. * @param [result] - The object onto which to store the result.
  6029. * @returns The modified result parameter or a new Cartesian2 instance if none was provided.
  6030. */
  6031. projectPointToNearestOnPlane(cartesian: Cartesian3, result?: Cartesian2): Cartesian2;
  6032. /**
  6033. * Computes the projection of the provided 3D positions onto the 2D plane, along the plane normal.
  6034. * @param cartesians - The array of points to project.
  6035. * @param [result] - The array of Cartesian2 instances onto which to store results.
  6036. * @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>.
  6037. */
  6038. projectPointsToNearestOnPlane(cartesians: Cartesian3[], result?: Cartesian2[]): Cartesian2[];
  6039. /**
  6040. * Computes the projection of the provided 2D position onto the 3D ellipsoid.
  6041. * @param cartesian - The points to project.
  6042. * @param [result] - The Cartesian3 instance to store result.
  6043. * @returns The modified result parameter or a new Cartesian3 instance if none was provided.
  6044. */
  6045. projectPointOntoEllipsoid(cartesian: Cartesian2, result?: Cartesian3): Cartesian3;
  6046. /**
  6047. * Computes the projection of the provided 2D positions onto the 3D ellipsoid.
  6048. * @param cartesians - The array of points to project.
  6049. * @param [result] - The array of Cartesian3 instances onto which to store results.
  6050. * @returns The modified result parameter or a new array of Cartesian3 instances if none was provided.
  6051. */
  6052. projectPointsOntoEllipsoid(cartesians: Cartesian2[], result?: Cartesian3[]): Cartesian3[];
  6053. }
  6054. /**
  6055. * A very simple {@link TerrainProvider} that produces geometry by tessellating an ellipsoidal
  6056. * surface.
  6057. * @param [options] - Object with the following properties:
  6058. * @param [options.tilingScheme] - The tiling scheme specifying how the ellipsoidal
  6059. * surface is broken into tiles. If this parameter is not provided, a {@link GeographicTilingScheme}
  6060. * is used.
  6061. * @param [options.ellipsoid] - The ellipsoid. If the tilingScheme is specified,
  6062. * this parameter is ignored and the tiling scheme's ellipsoid is used instead. If neither
  6063. * parameter is specified, the WGS84 ellipsoid is used.
  6064. */
  6065. export class EllipsoidTerrainProvider {
  6066. constructor(options?: {
  6067. tilingScheme?: TilingScheme;
  6068. ellipsoid?: Ellipsoid;
  6069. });
  6070. /**
  6071. * Gets an event that is raised when the terrain provider encounters an asynchronous error. By subscribing
  6072. * to the event, you will be notified of the error and can potentially recover from it. Event listeners
  6073. * are passed an instance of {@link TileProviderError}.
  6074. */
  6075. readonly errorEvent: Event;
  6076. /**
  6077. * Gets the credit to display when this terrain provider is active. Typically this is used to credit
  6078. * the source of the terrain. This function should not be called before {@link EllipsoidTerrainProvider#ready} returns true.
  6079. */
  6080. readonly credit: Credit;
  6081. /**
  6082. * Gets the tiling scheme used by this provider. This function should
  6083. * not be called before {@link EllipsoidTerrainProvider#ready} returns true.
  6084. */
  6085. readonly tilingScheme: GeographicTilingScheme;
  6086. /**
  6087. * Gets a value indicating whether or not the provider is ready for use.
  6088. */
  6089. readonly ready: boolean;
  6090. /**
  6091. * Gets a promise that resolves to true when the provider is ready for use.
  6092. */
  6093. readonly readyPromise: Promise<boolean>;
  6094. /**
  6095. * Gets a value indicating whether or not the provider includes a water mask. The water mask
  6096. * indicates which areas of the globe are water rather than land, so they can be rendered
  6097. * as a reflective surface with animated waves. This function should not be
  6098. * called before {@link EllipsoidTerrainProvider#ready} returns true.
  6099. */
  6100. readonly hasWaterMask: boolean;
  6101. /**
  6102. * Gets a value indicating whether or not the requested tiles include vertex normals.
  6103. * This function should not be called before {@link EllipsoidTerrainProvider#ready} returns true.
  6104. */
  6105. readonly hasVertexNormals: boolean;
  6106. /**
  6107. * Gets an object that can be used to determine availability of terrain from this provider, such as
  6108. * at points and in rectangles. This function should not be called before
  6109. * {@link TerrainProvider#ready} returns true. This property may be undefined if availability
  6110. * information is not available.
  6111. */
  6112. readonly availability: TileAvailability;
  6113. /**
  6114. * Requests the geometry for a given tile. This function should not be called before
  6115. * {@link TerrainProvider#ready} returns true. The result includes terrain
  6116. * data and indicates that all child tiles are available.
  6117. * @param x - The X coordinate of the tile for which to request geometry.
  6118. * @param y - The Y coordinate of the tile for which to request geometry.
  6119. * @param level - The level of the tile for which to request geometry.
  6120. * @param [request] - The request object. Intended for internal use only.
  6121. * @returns A promise for the requested geometry. If this method
  6122. * returns undefined instead of a promise, it is an indication that too many requests are already
  6123. * pending and the request will be retried later.
  6124. */
  6125. requestTileGeometry(x: number, y: number, level: number, request?: Request): Promise<TerrainData> | undefined;
  6126. /**
  6127. * Gets the maximum geometric error allowed in a tile at a given level.
  6128. * @param level - The tile level for which to get the maximum geometric error.
  6129. * @returns The maximum geometric error.
  6130. */
  6131. getLevelMaximumGeometricError(level: number): number;
  6132. /**
  6133. * Determines whether data for a tile is available to be loaded.
  6134. * @param x - The X coordinate of the tile for which to request geometry.
  6135. * @param y - The Y coordinate of the tile for which to request geometry.
  6136. * @param level - The level of the tile for which to request geometry.
  6137. * @returns Undefined if not supported, otherwise true or false.
  6138. */
  6139. getTileDataAvailable(x: number, y: number, level: number): boolean | undefined;
  6140. /**
  6141. * Makes sure we load availability data for a tile
  6142. * @param x - The X coordinate of the tile for which to request geometry.
  6143. * @param y - The Y coordinate of the tile for which to request geometry.
  6144. * @param level - The level of the tile for which to request geometry.
  6145. * @returns This provider does not support loading availability.
  6146. */
  6147. loadTileDataAvailability(x: number, y: number, level: number): undefined;
  6148. }
  6149. /**
  6150. * A generic utility class for managing subscribers for a particular event.
  6151. * This class is usually instantiated inside of a container class and
  6152. * exposed as a property for others to subscribe to.
  6153. * @example
  6154. * MyObject.prototype.myListener = function(arg1, arg2) {
  6155. * this.myArg1Copy = arg1;
  6156. * this.myArg2Copy = arg2;
  6157. * }
  6158. *
  6159. * const myObjectInstance = new MyObject();
  6160. * const evt = new Cesium.Event();
  6161. * evt.addEventListener(MyObject.prototype.myListener, myObjectInstance);
  6162. * evt.raiseEvent('1', '2');
  6163. * evt.removeEventListener(MyObject.prototype.myListener);
  6164. */
  6165. export class Event<Listener extends (...args: any[]) => void = (...args: any[]) => void> {
  6166. constructor();
  6167. /**
  6168. * The number of listeners currently subscribed to the event.
  6169. */
  6170. readonly numberOfListeners: number;
  6171. /**
  6172. * Registers a callback function to be executed whenever the event is raised.
  6173. * An optional scope can be provided to serve as the <code>this</code> pointer
  6174. * in which the function will execute.
  6175. * @param listener - The function to be executed when the event is raised.
  6176. * @param [scope] - An optional object scope to serve as the <code>this</code>
  6177. * pointer in which the listener function will execute.
  6178. * @returns A function that will remove this event listener when invoked.
  6179. */
  6180. addEventListener(listener: Listener, scope?: any): Event.RemoveCallback;
  6181. /**
  6182. * Unregisters a previously registered callback.
  6183. * @param listener - The function to be unregistered.
  6184. * @param [scope] - The scope that was originally passed to addEventListener.
  6185. * @returns <code>true</code> if the listener was removed; <code>false</code> if the listener and scope are not registered with the event.
  6186. */
  6187. removeEventListener(listener: Listener, scope?: any): boolean;
  6188. /**
  6189. * Raises the event by calling each registered listener with all supplied arguments.
  6190. * @param arguments - This method takes any number of parameters and passes them through to the listener functions.
  6191. */
  6192. raiseEvent(...arguments: Parameters<Listener>[]): void;
  6193. }
  6194. export namespace Event {
  6195. /**
  6196. * A function that removes a listener.
  6197. */
  6198. type RemoveCallback = () => void;
  6199. }
  6200. /**
  6201. * A convenience object that simplifies the common pattern of attaching event listeners
  6202. * to several events, then removing all those listeners at once later, for example, in
  6203. * a destroy method.
  6204. * @example
  6205. * const helper = new Cesium.EventHelper();
  6206. *
  6207. * helper.add(someObject.event, listener1, this);
  6208. * helper.add(otherObject.event, listener2, this);
  6209. *
  6210. * // later...
  6211. * helper.removeAll();
  6212. */
  6213. export class EventHelper {
  6214. constructor();
  6215. /**
  6216. * Adds a listener to an event, and records the registration to be cleaned up later.
  6217. * @param event - The event to attach to.
  6218. * @param listener - The function to be executed when the event is raised.
  6219. * @param [scope] - An optional object scope to serve as the <code>this</code>
  6220. * pointer in which the listener function will execute.
  6221. * @returns A function that will remove this event listener when invoked.
  6222. */
  6223. add(event: Event, listener: (...params: any[]) => any, scope?: any): EventHelper.RemoveCallback;
  6224. /**
  6225. * Unregisters all previously added listeners.
  6226. */
  6227. removeAll(): void;
  6228. }
  6229. export namespace EventHelper {
  6230. /**
  6231. * A function that removes a listener.
  6232. */
  6233. type RemoveCallback = () => void;
  6234. }
  6235. /**
  6236. * Flags to enable experimental features in CesiumJS. Stability and performance
  6237. * may not be optimal when these are enabled. Experimental features are subject
  6238. * to change without Cesium's standard deprecation policy.
  6239. * <p>
  6240. * Experimental features must still uphold Cesium's quality standards. Here
  6241. * are some guidelines:
  6242. * </p>
  6243. * <ul>
  6244. * <li>Experimental features must have high unit test coverage like any other feature.</li>
  6245. * <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>
  6246. * <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>
  6247. * <li>To avoid cluttering the code, check the flag in as few places as possible. Ideally this would be a single place.</li>
  6248. * </ul>
  6249. */
  6250. export namespace ExperimentalFeatures {
  6251. /**
  6252. * Toggles the usage of the ModelExperimental class.
  6253. */
  6254. var enableModelExperimental: boolean;
  6255. }
  6256. /**
  6257. * Constants to determine how an interpolated value is extrapolated
  6258. * when querying outside the bounds of available data.
  6259. */
  6260. export enum ExtrapolationType {
  6261. /**
  6262. * No extrapolation occurs.
  6263. */
  6264. NONE = 0,
  6265. /**
  6266. * The first or last value is used when outside the range of sample data.
  6267. */
  6268. HOLD = 1,
  6269. /**
  6270. * The value is extrapolated.
  6271. */
  6272. EXTRAPOLATE = 2
  6273. }
  6274. /**
  6275. * A set of functions to detect whether the current browser supports
  6276. * various features.
  6277. */
  6278. export namespace FeatureDetection {
  6279. /**
  6280. * Detects whether the current browser supports Basis Universal textures and the web assembly modules needed to transcode them.
  6281. * @returns true if the browser supports web assembly modules and the scene supports Basis Universal textures, false if not.
  6282. */
  6283. function supportsBasis(scene: Scene): boolean;
  6284. /**
  6285. * Detects whether the current browser supports the full screen standard.
  6286. * @returns true if the browser supports the full screen standard, false if not.
  6287. */
  6288. function supportsFullscreen(): boolean;
  6289. /**
  6290. * Detects whether the current browser supports typed arrays.
  6291. * @returns true if the browser supports typed arrays, false if not.
  6292. */
  6293. function supportsTypedArrays(): boolean;
  6294. /**
  6295. * Detects whether the current browser supports BigInt64Array typed arrays.
  6296. * @returns true if the browser supports BigInt64Array typed arrays, false if not.
  6297. */
  6298. function supportsBigInt64Array(): boolean;
  6299. /**
  6300. * Detects whether the current browser supports BigUint64Array typed arrays.
  6301. * @returns true if the browser supports BigUint64Array typed arrays, false if not.
  6302. */
  6303. function supportsBigUint64Array(): boolean;
  6304. /**
  6305. * Detects whether the current browser supports BigInt.
  6306. * @returns true if the browser supports BigInt, false if not.
  6307. */
  6308. function supportsBigInt(): boolean;
  6309. /**
  6310. * Detects whether the current browser supports Web Workers.
  6311. * @returns true if the browsers supports Web Workers, false if not.
  6312. */
  6313. function supportsWebWorkers(): boolean;
  6314. /**
  6315. * Detects whether the current browser supports Web Assembly.
  6316. * @returns true if the browsers supports Web Assembly, false if not.
  6317. */
  6318. function supportsWebAssembly(): boolean;
  6319. }
  6320. /**
  6321. * Describes a frustum at the given the origin and orientation.
  6322. * @param options - Object with the following properties:
  6323. * @param options.frustum - The frustum.
  6324. * @param options.origin - The origin of the frustum.
  6325. * @param options.orientation - The orientation of the frustum.
  6326. * @param [options.vertexFormat = VertexFormat.DEFAULT] - The vertex attributes to be computed.
  6327. */
  6328. export class FrustumGeometry {
  6329. constructor(options: {
  6330. frustum: PerspectiveFrustum | OrthographicFrustum;
  6331. origin: Cartesian3;
  6332. orientation: Quaternion;
  6333. vertexFormat?: VertexFormat;
  6334. });
  6335. /**
  6336. * The number of elements used to pack the object into an array.
  6337. */
  6338. packedLength: number;
  6339. /**
  6340. * Stores the provided instance into the provided array.
  6341. * @param value - The value to pack.
  6342. * @param array - The array to pack into.
  6343. * @param [startingIndex = 0] - The index into the array at which to start packing the elements.
  6344. * @returns The array that was packed into
  6345. */
  6346. static pack(value: FrustumGeometry, array: number[], startingIndex?: number): number[];
  6347. /**
  6348. * Retrieves an instance from a packed array.
  6349. * @param array - The packed array.
  6350. * @param [startingIndex = 0] - The starting index of the element to be unpacked.
  6351. * @param [result] - The object into which to store the result.
  6352. */
  6353. static unpack(array: number[], startingIndex?: number, result?: FrustumGeometry): void;
  6354. /**
  6355. * Computes the geometric representation of a frustum, including its vertices, indices, and a bounding sphere.
  6356. * @param frustumGeometry - A description of the frustum.
  6357. * @returns The computed vertices and indices.
  6358. */
  6359. static createGeometry(frustumGeometry: FrustumGeometry): Geometry | undefined;
  6360. }
  6361. /**
  6362. * A description of the outline of a frustum with the given the origin and orientation.
  6363. * @param options - Object with the following properties:
  6364. * @param options.frustum - The frustum.
  6365. * @param options.origin - The origin of the frustum.
  6366. * @param options.orientation - The orientation of the frustum.
  6367. */
  6368. export class FrustumOutlineGeometry {
  6369. constructor(options: {
  6370. frustum: PerspectiveFrustum | OrthographicFrustum;
  6371. origin: Cartesian3;
  6372. orientation: Quaternion;
  6373. });
  6374. /**
  6375. * The number of elements used to pack the object into an array.
  6376. */
  6377. packedLength: number;
  6378. /**
  6379. * Stores the provided instance into the provided array.
  6380. * @param value - The value to pack.
  6381. * @param array - The array to pack into.
  6382. * @param [startingIndex = 0] - The index into the array at which to start packing the elements.
  6383. * @returns The array that was packed into
  6384. */
  6385. static pack(value: FrustumOutlineGeometry, array: number[], startingIndex?: number): number[];
  6386. /**
  6387. * Retrieves an instance from a packed array.
  6388. * @param array - The packed array.
  6389. * @param [startingIndex = 0] - The starting index of the element to be unpacked.
  6390. * @param [result] - The object into which to store the result.
  6391. */
  6392. static unpack(array: number[], startingIndex?: number, result?: FrustumOutlineGeometry): void;
  6393. /**
  6394. * Computes the geometric representation of a frustum outline, including its vertices, indices, and a bounding sphere.
  6395. * @param frustumGeometry - A description of the frustum.
  6396. * @returns The computed vertices and indices.
  6397. */
  6398. static createGeometry(frustumGeometry: FrustumOutlineGeometry): Geometry | undefined;
  6399. }
  6400. /**
  6401. * Browser-independent functions for working with the standard fullscreen API.
  6402. */
  6403. export namespace Fullscreen {
  6404. /**
  6405. * The element that is currently fullscreen, if any. To simply check if the
  6406. * browser is in fullscreen mode or not, use {@link Fullscreen#fullscreen}.
  6407. */
  6408. const element: any;
  6409. /**
  6410. * The name of the event on the document that is fired when fullscreen is
  6411. * entered or exited. This event name is intended for use with addEventListener.
  6412. * In your event handler, to determine if the browser is in fullscreen mode or not,
  6413. * use {@link Fullscreen#fullscreen}.
  6414. */
  6415. const changeEventName: string;
  6416. /**
  6417. * The name of the event that is fired when a fullscreen error
  6418. * occurs. This event name is intended for use with addEventListener.
  6419. */
  6420. const errorEventName: string;
  6421. /**
  6422. * Determine whether the browser will allow an element to be made fullscreen, or not.
  6423. * For example, by default, iframes cannot go fullscreen unless the containing page
  6424. * adds an "allowfullscreen" attribute (or prefixed equivalent).
  6425. */
  6426. const enabled: boolean;
  6427. /**
  6428. * Determines if the browser is currently in fullscreen mode.
  6429. */
  6430. const fullscreen: boolean;
  6431. /**
  6432. * Detects whether the browser supports the standard fullscreen API.
  6433. * @returns <code>true</code> if the browser supports the standard fullscreen API,
  6434. * <code>false</code> otherwise.
  6435. */
  6436. function supportsFullscreen(): boolean;
  6437. /**
  6438. * Asynchronously requests the browser to enter fullscreen mode on the given element.
  6439. * If fullscreen mode is not supported by the browser, does nothing.
  6440. * @example
  6441. * // Put the entire page into fullscreen.
  6442. * Cesium.Fullscreen.requestFullscreen(document.body)
  6443. *
  6444. * // Place only the Cesium canvas into fullscreen.
  6445. * Cesium.Fullscreen.requestFullscreen(scene.canvas)
  6446. * @param element - The HTML element which will be placed into fullscreen mode.
  6447. * @param [vrDevice] - The HMDVRDevice device.
  6448. */
  6449. function requestFullscreen(element: any, vrDevice?: any): void;
  6450. /**
  6451. * Asynchronously exits fullscreen mode. If the browser is not currently
  6452. * in fullscreen, or if fullscreen mode is not supported by the browser, does nothing.
  6453. */
  6454. function exitFullscreen(): void;
  6455. }
  6456. /**
  6457. * The type of geocoding to be performed by a {@link GeocoderService}.
  6458. */
  6459. export enum GeocodeType {
  6460. /**
  6461. * Perform a search where the input is considered complete.
  6462. */
  6463. SEARCH = 0,
  6464. /**
  6465. * Perform an auto-complete using partial input, typically
  6466. * reserved for providing possible results as a user is typing.
  6467. */
  6468. AUTOCOMPLETE = 1
  6469. }
  6470. export namespace GeocoderService {
  6471. /**
  6472. * @property displayName - The display name for a location
  6473. * @property destination - The bounding box for a location
  6474. */
  6475. type Result = {
  6476. displayName: string;
  6477. destination: Rectangle | Cartesian3;
  6478. };
  6479. }
  6480. /**
  6481. * Provides geocoding through an external service. This type describes an interface and
  6482. * is not intended to be used.
  6483. */
  6484. export class GeocoderService {
  6485. constructor();
  6486. /**
  6487. * @param query - The query to be sent to the geocoder service
  6488. * @param [type = GeocodeType.SEARCH] - The type of geocode to perform.
  6489. */
  6490. geocode(query: string, type?: GeocodeType): Promise<GeocoderService.Result[]>;
  6491. }
  6492. /**
  6493. * A simple map projection where longitude and latitude are linearly mapped to X and Y by multiplying
  6494. * them by the {@link Ellipsoid#maximumRadius}. This projection
  6495. * is commonly known as geographic, equirectangular, equidistant cylindrical, or plate carrée. It
  6496. * is also known as EPSG:4326.
  6497. * @param [ellipsoid = Ellipsoid.WGS84] - The ellipsoid.
  6498. */
  6499. export class GeographicProjection {
  6500. constructor(ellipsoid?: Ellipsoid);
  6501. /**
  6502. * Gets the {@link Ellipsoid}.
  6503. */
  6504. readonly ellipsoid: Ellipsoid;
  6505. /**
  6506. * Projects a set of {@link Cartographic} coordinates, in radians, to map coordinates, in meters.
  6507. * X and Y are the longitude and latitude, respectively, multiplied by the maximum radius of the
  6508. * ellipsoid. Z is the unmodified height.
  6509. * @param cartographic - The coordinates to project.
  6510. * @param [result] - An instance into which to copy the result. If this parameter is
  6511. * undefined, a new instance is created and returned.
  6512. * @returns The projected coordinates. If the result parameter is not undefined, the
  6513. * coordinates are copied there and that instance is returned. Otherwise, a new instance is
  6514. * created and returned.
  6515. */
  6516. project(cartographic: Cartographic, result?: Cartesian3): Cartesian3;
  6517. /**
  6518. * Unprojects a set of projected {@link Cartesian3} coordinates, in meters, to {@link Cartographic}
  6519. * coordinates, in radians. Longitude and Latitude are the X and Y coordinates, respectively,
  6520. * divided by the maximum radius of the ellipsoid. Height is the unmodified Z coordinate.
  6521. * @param cartesian - The Cartesian position to unproject with height (z) in meters.
  6522. * @param [result] - An instance into which to copy the result. If this parameter is
  6523. * undefined, a new instance is created and returned.
  6524. * @returns The unprojected coordinates. If the result parameter is not undefined, the
  6525. * coordinates are copied there and that instance is returned. Otherwise, a new instance is
  6526. * created and returned.
  6527. */
  6528. unproject(cartesian: Cartesian3, result?: Cartographic): Cartographic;
  6529. }
  6530. /**
  6531. * A tiling scheme for geometry referenced to a simple {@link GeographicProjection} where
  6532. * longitude and latitude are directly mapped to X and Y. This projection is commonly
  6533. * known as geographic, equirectangular, equidistant cylindrical, or plate carrée.
  6534. * @param [options] - Object with the following properties:
  6535. * @param [options.ellipsoid = Ellipsoid.WGS84] - The ellipsoid whose surface is being tiled. Defaults to
  6536. * the WGS84 ellipsoid.
  6537. * @param [options.rectangle = Rectangle.MAX_VALUE] - The rectangle, in radians, covered by the tiling scheme.
  6538. * @param [options.numberOfLevelZeroTilesX = 2] - The number of tiles in the X direction at level zero of
  6539. * the tile tree.
  6540. * @param [options.numberOfLevelZeroTilesY = 1] - The number of tiles in the Y direction at level zero of
  6541. * the tile tree.
  6542. */
  6543. export class GeographicTilingScheme {
  6544. constructor(options?: {
  6545. ellipsoid?: Ellipsoid;
  6546. rectangle?: Rectangle;
  6547. numberOfLevelZeroTilesX?: number;
  6548. numberOfLevelZeroTilesY?: number;
  6549. });
  6550. /**
  6551. * Gets the ellipsoid that is tiled by this tiling scheme.
  6552. */
  6553. ellipsoid: Ellipsoid;
  6554. /**
  6555. * Gets the rectangle, in radians, covered by this tiling scheme.
  6556. */
  6557. rectangle: Rectangle;
  6558. /**
  6559. * Gets the map projection used by this tiling scheme.
  6560. */
  6561. projection: MapProjection;
  6562. /**
  6563. * Gets the total number of tiles in the X direction at a specified level-of-detail.
  6564. * @param level - The level-of-detail.
  6565. * @returns The number of tiles in the X direction at the given level.
  6566. */
  6567. getNumberOfXTilesAtLevel(level: number): number;
  6568. /**
  6569. * Gets the total number of tiles in the Y direction at a specified level-of-detail.
  6570. * @param level - The level-of-detail.
  6571. * @returns The number of tiles in the Y direction at the given level.
  6572. */
  6573. getNumberOfYTilesAtLevel(level: number): number;
  6574. /**
  6575. * Transforms a rectangle specified in geodetic radians to the native coordinate system
  6576. * of this tiling scheme.
  6577. * @param rectangle - The rectangle to transform.
  6578. * @param [result] - The instance to which to copy the result, or undefined if a new instance
  6579. * should be created.
  6580. * @returns The specified 'result', or a new object containing the native rectangle if 'result'
  6581. * is undefined.
  6582. */
  6583. rectangleToNativeRectangle(rectangle: Rectangle, result?: Rectangle): Rectangle;
  6584. /**
  6585. * Converts tile x, y coordinates and level to a rectangle expressed in the native coordinates
  6586. * of the tiling scheme.
  6587. * @param x - The integer x coordinate of the tile.
  6588. * @param y - The integer y coordinate of the tile.
  6589. * @param level - The tile level-of-detail. Zero is the least detailed.
  6590. * @param [result] - The instance to which to copy the result, or undefined if a new instance
  6591. * should be created.
  6592. * @returns The specified 'result', or a new object containing the rectangle
  6593. * if 'result' is undefined.
  6594. */
  6595. tileXYToNativeRectangle(x: number, y: number, level: number, result?: any): Rectangle;
  6596. /**
  6597. * Converts tile x, y coordinates and level to a cartographic rectangle in radians.
  6598. * @param x - The integer x coordinate of the tile.
  6599. * @param y - The integer y coordinate of the tile.
  6600. * @param level - The tile level-of-detail. Zero is the least detailed.
  6601. * @param [result] - The instance to which to copy the result, or undefined if a new instance
  6602. * should be created.
  6603. * @returns The specified 'result', or a new object containing the rectangle
  6604. * if 'result' is undefined.
  6605. */
  6606. tileXYToRectangle(x: number, y: number, level: number, result?: any): Rectangle;
  6607. /**
  6608. * Calculates the tile x, y coordinates of the tile containing
  6609. * a given cartographic position.
  6610. * @param position - The position.
  6611. * @param level - The tile level-of-detail. Zero is the least detailed.
  6612. * @param [result] - The instance to which to copy the result, or undefined if a new instance
  6613. * should be created.
  6614. * @returns The specified 'result', or a new object containing the tile x, y coordinates
  6615. * if 'result' is undefined.
  6616. */
  6617. positionToTileXY(position: Cartographic, level: number, result?: Cartesian2): Cartesian2;
  6618. }
  6619. /**
  6620. * A geometry representation with attributes forming vertices and optional index data
  6621. * defining primitives. Geometries and an {@link Appearance}, which describes the shading,
  6622. * can be assigned to a {@link Primitive} for visualization. A <code>Primitive</code> can
  6623. * be created from many heterogeneous - in many cases - geometries for performance.
  6624. * <p>
  6625. * Geometries can be transformed and optimized using functions in {@link GeometryPipeline}.
  6626. * </p>
  6627. * @example
  6628. * // Create geometry with a position attribute and indexed lines.
  6629. * const positions = new Float64Array([
  6630. * 0.0, 0.0, 0.0,
  6631. * 7500000.0, 0.0, 0.0,
  6632. * 0.0, 7500000.0, 0.0
  6633. * ]);
  6634. *
  6635. * const geometry = new Cesium.Geometry({
  6636. * attributes : {
  6637. * position : new Cesium.GeometryAttribute({
  6638. * componentDatatype : Cesium.ComponentDatatype.DOUBLE,
  6639. * componentsPerAttribute : 3,
  6640. * values : positions
  6641. * })
  6642. * },
  6643. * indices : new Uint16Array([0, 1, 1, 2, 2, 0]),
  6644. * primitiveType : Cesium.PrimitiveType.LINES,
  6645. * boundingSphere : Cesium.BoundingSphere.fromVertices(positions)
  6646. * });
  6647. * @param options - Object with the following properties:
  6648. * @param options.attributes - Attributes, which make up the geometry's vertices.
  6649. * @param [options.primitiveType = PrimitiveType.TRIANGLES] - The type of primitives in the geometry.
  6650. * @param [options.indices] - Optional index data that determines the primitives in the geometry.
  6651. * @param [options.boundingSphere] - An optional bounding sphere that fully enclosed the geometry.
  6652. */
  6653. export class Geometry {
  6654. constructor(options: {
  6655. attributes: GeometryAttributes;
  6656. primitiveType?: PrimitiveType;
  6657. indices?: Uint16Array | Uint32Array;
  6658. boundingSphere?: BoundingSphere;
  6659. });
  6660. /**
  6661. * Attributes, which make up the geometry's vertices. Each property in this object corresponds to a
  6662. * {@link GeometryAttribute} containing the attribute's data.
  6663. * <p>
  6664. * Attributes are always stored non-interleaved in a Geometry.
  6665. * </p>
  6666. * <p>
  6667. * There are reserved attribute names with well-known semantics. The following attributes
  6668. * are created by a Geometry (depending on the provided {@link VertexFormat}.
  6669. * <ul>
  6670. * <li><code>position</code> - 3D vertex position. 64-bit floating-point (for precision). 3 components per attribute. See {@link VertexFormat#position}.</li>
  6671. * <li><code>normal</code> - Normal (normalized), commonly used for lighting. 32-bit floating-point. 3 components per attribute. See {@link VertexFormat#normal}.</li>
  6672. * <li><code>st</code> - 2D texture coordinate. 32-bit floating-point. 2 components per attribute. See {@link VertexFormat#st}.</li>
  6673. * <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>
  6674. * <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>
  6675. * </ul>
  6676. * </p>
  6677. * <p>
  6678. * The following attribute names are generally not created by a Geometry, but are added
  6679. * to a Geometry by a {@link Primitive} or {@link GeometryPipeline} functions to prepare
  6680. * the geometry for rendering.
  6681. * <ul>
  6682. * <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>
  6683. * <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>
  6684. * <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>
  6685. * <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>
  6686. * <li><code>color</code> - RGBA color (normalized) usually from {@link GeometryInstance#color}. 32-bit floating-point. 4 components per attribute.</li>
  6687. * <li><code>pickColor</code> - RGBA color used for picking. 32-bit floating-point. 4 components per attribute.</li>
  6688. * </ul>
  6689. * </p>
  6690. * @example
  6691. * geometry.attributes.position = new Cesium.GeometryAttribute({
  6692. * componentDatatype : Cesium.ComponentDatatype.FLOAT,
  6693. * componentsPerAttribute : 3,
  6694. * values : new Float32Array(0)
  6695. * });
  6696. */
  6697. attributes: GeometryAttributes;
  6698. /**
  6699. * Optional index data that - along with {@link Geometry#primitiveType} -
  6700. * determines the primitives in the geometry.
  6701. */
  6702. indices: any[];
  6703. /**
  6704. * The type of primitives in the geometry. This is most often {@link PrimitiveType.TRIANGLES},
  6705. * but can varying based on the specific geometry.
  6706. */
  6707. primitiveType: PrimitiveType;
  6708. /**
  6709. * An optional bounding sphere that fully encloses the geometry. This is
  6710. * commonly used for culling.
  6711. */
  6712. boundingSphere: BoundingSphere;
  6713. /**
  6714. * Computes the number of vertices in a geometry. The runtime is linear with
  6715. * respect to the number of attributes in a vertex, not the number of vertices.
  6716. * @example
  6717. * const numVertices = Cesium.Geometry.computeNumberOfVertices(geometry);
  6718. * @param geometry - The geometry.
  6719. * @returns The number of vertices in the geometry.
  6720. */
  6721. static computeNumberOfVertices(geometry: Geometry): number;
  6722. }
  6723. /**
  6724. * Values and type information for geometry attributes. A {@link Geometry}
  6725. * generally contains one or more attributes. All attributes together form
  6726. * the geometry's vertices.
  6727. * @example
  6728. * const geometry = new Cesium.Geometry({
  6729. * attributes : {
  6730. * position : new Cesium.GeometryAttribute({
  6731. * componentDatatype : Cesium.ComponentDatatype.FLOAT,
  6732. * componentsPerAttribute : 3,
  6733. * values : new Float32Array([
  6734. * 0.0, 0.0, 0.0,
  6735. * 7500000.0, 0.0, 0.0,
  6736. * 0.0, 7500000.0, 0.0
  6737. * ])
  6738. * })
  6739. * },
  6740. * primitiveType : Cesium.PrimitiveType.LINE_LOOP
  6741. * });
  6742. * @param [options] - Object with the following properties:
  6743. * @param [options.componentDatatype] - The datatype of each component in the attribute, e.g., individual elements in values.
  6744. * @param [options.componentsPerAttribute] - A number between 1 and 4 that defines the number of components in an attributes.
  6745. * @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.
  6746. * @param [options.values] - The values for the attributes stored in a typed array.
  6747. */
  6748. export class GeometryAttribute {
  6749. constructor(options?: {
  6750. componentDatatype?: ComponentDatatype;
  6751. componentsPerAttribute?: number;
  6752. normalize?: boolean;
  6753. values?: number[] | Int8Array | Uint8Array | Int16Array | Uint16Array | Int32Array | Uint32Array | Float32Array | Float64Array;
  6754. });
  6755. /**
  6756. * The datatype of each component in the attribute, e.g., individual elements in
  6757. * {@link GeometryAttribute#values}.
  6758. */
  6759. componentDatatype: ComponentDatatype;
  6760. /**
  6761. * A number between 1 and 4 that defines the number of components in an attributes.
  6762. * For example, a position attribute with x, y, and z components would have 3 as
  6763. * shown in the code example.
  6764. * @example
  6765. * attribute.componentDatatype = Cesium.ComponentDatatype.FLOAT;
  6766. * attribute.componentsPerAttribute = 3;
  6767. * attribute.values = new Float32Array([
  6768. * 0.0, 0.0, 0.0,
  6769. * 7500000.0, 0.0, 0.0,
  6770. * 0.0, 7500000.0, 0.0
  6771. * ]);
  6772. */
  6773. componentsPerAttribute: number;
  6774. /**
  6775. * When <code>true</code> and <code>componentDatatype</code> is an integer format,
  6776. * indicate that the components should be mapped to the range [0, 1] (unsigned)
  6777. * or [-1, 1] (signed) when they are accessed as floating-point for rendering.
  6778. * <p>
  6779. * This is commonly used when storing colors using {@link ComponentDatatype.UNSIGNED_BYTE}.
  6780. * </p>
  6781. * @example
  6782. * attribute.componentDatatype = Cesium.ComponentDatatype.UNSIGNED_BYTE;
  6783. * attribute.componentsPerAttribute = 4;
  6784. * attribute.normalize = true;
  6785. * attribute.values = new Uint8Array([
  6786. * Cesium.Color.floatToByte(color.red),
  6787. * Cesium.Color.floatToByte(color.green),
  6788. * Cesium.Color.floatToByte(color.blue),
  6789. * Cesium.Color.floatToByte(color.alpha)
  6790. * ]);
  6791. */
  6792. normalize: boolean;
  6793. /**
  6794. * The values for the attributes stored in a typed array. In the code example,
  6795. * every three elements in <code>values</code> defines one attributes since
  6796. * <code>componentsPerAttribute</code> is 3.
  6797. * @example
  6798. * attribute.componentDatatype = Cesium.ComponentDatatype.FLOAT;
  6799. * attribute.componentsPerAttribute = 3;
  6800. * attribute.values = new Float32Array([
  6801. * 0.0, 0.0, 0.0,
  6802. * 7500000.0, 0.0, 0.0,
  6803. * 0.0, 7500000.0, 0.0
  6804. * ]);
  6805. */
  6806. values: number[] | Int8Array | Uint8Array | Int16Array | Uint16Array | Int32Array | Uint32Array | Float32Array | Float64Array;
  6807. }
  6808. /**
  6809. * Attributes, which make up a geometry's vertices. Each property in this object corresponds to a
  6810. * {@link GeometryAttribute} containing the attribute's data.
  6811. * <p>
  6812. * Attributes are always stored non-interleaved in a Geometry.
  6813. * </p>
  6814. */
  6815. export class GeometryAttributes {
  6816. constructor();
  6817. /**
  6818. * The 3D position attribute.
  6819. * <p>
  6820. * 64-bit floating-point (for precision). 3 components per attribute.
  6821. * </p>
  6822. */
  6823. position: GeometryAttribute;
  6824. /**
  6825. * The normal attribute (normalized), which is commonly used for lighting.
  6826. * <p>
  6827. * 32-bit floating-point. 3 components per attribute.
  6828. * </p>
  6829. */
  6830. normal: GeometryAttribute;
  6831. /**
  6832. * The 2D texture coordinate attribute.
  6833. * <p>
  6834. * 32-bit floating-point. 2 components per attribute
  6835. * </p>
  6836. */
  6837. st: GeometryAttribute;
  6838. /**
  6839. * The bitangent attribute (normalized), which is used for tangent-space effects like bump mapping.
  6840. * <p>
  6841. * 32-bit floating-point. 3 components per attribute.
  6842. * </p>
  6843. */
  6844. bitangent: GeometryAttribute;
  6845. /**
  6846. * The tangent attribute (normalized), which is used for tangent-space effects like bump mapping.
  6847. * <p>
  6848. * 32-bit floating-point. 3 components per attribute.
  6849. * </p>
  6850. */
  6851. tangent: GeometryAttribute;
  6852. /**
  6853. * The color attribute.
  6854. * <p>
  6855. * 8-bit unsigned integer. 4 components per attribute.
  6856. * </p>
  6857. */
  6858. color: GeometryAttribute;
  6859. }
  6860. /**
  6861. * Base class for all geometry creation utility classes that can be passed to {@link GeometryInstance}
  6862. * for asynchronous geometry creation.
  6863. */
  6864. export class GeometryFactory {
  6865. constructor();
  6866. /**
  6867. * Returns a geometry.
  6868. * @param geometryFactory - A description of the circle.
  6869. * @returns The computed vertices and indices.
  6870. */
  6871. static createGeometry(geometryFactory: GeometryFactory): Geometry | undefined;
  6872. }
  6873. /**
  6874. * Geometry instancing allows one {@link Geometry} object to be positions in several
  6875. * different locations and colored uniquely. For example, one {@link BoxGeometry} can
  6876. * be instanced several times, each with a different <code>modelMatrix</code> to change
  6877. * its position, rotation, and scale.
  6878. * @example
  6879. * // Create geometry for a box, and two instances that refer to it.
  6880. * // One instance positions the box on the bottom and colored aqua.
  6881. * // The other instance positions the box on the top and color white.
  6882. * const geometry = Cesium.BoxGeometry.fromDimensions({
  6883. * vertexFormat : Cesium.VertexFormat.POSITION_AND_NORMAL,
  6884. * dimensions : new Cesium.Cartesian3(1000000.0, 1000000.0, 500000.0)
  6885. * });
  6886. * const instanceBottom = new Cesium.GeometryInstance({
  6887. * geometry : geometry,
  6888. * modelMatrix : Cesium.Matrix4.multiplyByTranslation(Cesium.Transforms.eastNorthUpToFixedFrame(
  6889. * Cesium.Cartesian3.fromDegrees(-75.59777, 40.03883)), new Cesium.Cartesian3(0.0, 0.0, 1000000.0), new Cesium.Matrix4()),
  6890. * attributes : {
  6891. * color : Cesium.ColorGeometryInstanceAttribute.fromColor(Cesium.Color.AQUA)
  6892. * },
  6893. * id : 'bottom'
  6894. * });
  6895. * const instanceTop = new Cesium.GeometryInstance({
  6896. * geometry : geometry,
  6897. * modelMatrix : Cesium.Matrix4.multiplyByTranslation(Cesium.Transforms.eastNorthUpToFixedFrame(
  6898. * Cesium.Cartesian3.fromDegrees(-75.59777, 40.03883)), new Cesium.Cartesian3(0.0, 0.0, 3000000.0), new Cesium.Matrix4()),
  6899. * attributes : {
  6900. * color : Cesium.ColorGeometryInstanceAttribute.fromColor(Cesium.Color.AQUA)
  6901. * },
  6902. * id : 'top'
  6903. * });
  6904. * @param options - Object with the following properties:
  6905. * @param options.geometry - The geometry to instance.
  6906. * @param [options.modelMatrix = Matrix4.IDENTITY] - The model matrix that transforms to transform the geometry from model to world coordinates.
  6907. * @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}.
  6908. * @param [options.attributes] - Per-instance attributes like a show or color attribute shown in the example below.
  6909. */
  6910. export class GeometryInstance {
  6911. constructor(options: {
  6912. geometry: Geometry | GeometryFactory;
  6913. modelMatrix?: Matrix4;
  6914. id?: any;
  6915. attributes?: any;
  6916. });
  6917. /**
  6918. * The geometry being instanced.
  6919. */
  6920. geometry: Geometry;
  6921. /**
  6922. * The 4x4 transformation matrix that transforms the geometry from model to world coordinates.
  6923. * When this is the identity matrix, the geometry is drawn in world coordinates, i.e., Earth's WGS84 coordinates.
  6924. * Local reference frames can be used by providing a different transformation matrix, like that returned
  6925. * by {@link Transforms.eastNorthUpToFixedFrame}.
  6926. */
  6927. modelMatrix: Matrix4;
  6928. /**
  6929. * User-defined object returned when the instance is picked or used to get/set per-instance attributes.
  6930. */
  6931. id: any;
  6932. /**
  6933. * Per-instance attributes like {@link ColorGeometryInstanceAttribute} or {@link ShowGeometryInstanceAttribute}.
  6934. * {@link Geometry} attributes varying per vertex; these attributes are constant for the entire instance.
  6935. */
  6936. attributes: any;
  6937. }
  6938. /**
  6939. * Values and type information for per-instance geometry attributes.
  6940. * @example
  6941. * const instance = new Cesium.GeometryInstance({
  6942. * geometry : Cesium.BoxGeometry.fromDimensions({
  6943. * dimensions : new Cesium.Cartesian3(1000000.0, 1000000.0, 500000.0)
  6944. * }),
  6945. * modelMatrix : Cesium.Matrix4.multiplyByTranslation(Cesium.Transforms.eastNorthUpToFixedFrame(
  6946. * Cesium.Cartesian3.fromDegrees(0.0, 0.0)), new Cesium.Cartesian3(0.0, 0.0, 1000000.0), new Cesium.Matrix4()),
  6947. * id : 'box',
  6948. * attributes : {
  6949. * color : new Cesium.GeometryInstanceAttribute({
  6950. * componentDatatype : Cesium.ComponentDatatype.UNSIGNED_BYTE,
  6951. * componentsPerAttribute : 4,
  6952. * normalize : true,
  6953. * value : [255, 255, 0, 255]
  6954. * })
  6955. * }
  6956. * });
  6957. * @param options - Object with the following properties:
  6958. * @param options.componentDatatype - The datatype of each component in the attribute, e.g., individual elements in values.
  6959. * @param options.componentsPerAttribute - A number between 1 and 4 that defines the number of components in an attributes.
  6960. * @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.
  6961. * @param options.value - The value for the attribute.
  6962. */
  6963. export class GeometryInstanceAttribute {
  6964. constructor(options: {
  6965. componentDatatype: ComponentDatatype;
  6966. componentsPerAttribute: number;
  6967. normalize?: boolean;
  6968. value: number[];
  6969. });
  6970. /**
  6971. * The datatype of each component in the attribute, e.g., individual elements in
  6972. * {@link GeometryInstanceAttribute#value}.
  6973. */
  6974. componentDatatype: ComponentDatatype;
  6975. /**
  6976. * A number between 1 and 4 that defines the number of components in an attributes.
  6977. * For example, a position attribute with x, y, and z components would have 3 as
  6978. * shown in the code example.
  6979. * @example
  6980. * show : new Cesium.GeometryInstanceAttribute({
  6981. * componentDatatype : Cesium.ComponentDatatype.UNSIGNED_BYTE,
  6982. * componentsPerAttribute : 1,
  6983. * normalize : true,
  6984. * value : [1.0]
  6985. * })
  6986. */
  6987. componentsPerAttribute: number;
  6988. /**
  6989. * When <code>true</code> and <code>componentDatatype</code> is an integer format,
  6990. * indicate that the components should be mapped to the range [0, 1] (unsigned)
  6991. * or [-1, 1] (signed) when they are accessed as floating-point for rendering.
  6992. * <p>
  6993. * This is commonly used when storing colors using {@link ComponentDatatype.UNSIGNED_BYTE}.
  6994. * </p>
  6995. * @example
  6996. * attribute.componentDatatype = Cesium.ComponentDatatype.UNSIGNED_BYTE;
  6997. * attribute.componentsPerAttribute = 4;
  6998. * attribute.normalize = true;
  6999. * attribute.value = [
  7000. * Cesium.Color.floatToByte(color.red),
  7001. * Cesium.Color.floatToByte(color.green),
  7002. * Cesium.Color.floatToByte(color.blue),
  7003. * Cesium.Color.floatToByte(color.alpha)
  7004. * ];
  7005. */
  7006. normalize: boolean;
  7007. /**
  7008. * The values for the attributes stored in a typed array. In the code example,
  7009. * every three elements in <code>values</code> defines one attributes since
  7010. * <code>componentsPerAttribute</code> is 3.
  7011. * @example
  7012. * show : new Cesium.GeometryInstanceAttribute({
  7013. * componentDatatype : Cesium.ComponentDatatype.UNSIGNED_BYTE,
  7014. * componentsPerAttribute : 1,
  7015. * normalize : true,
  7016. * value : [1.0]
  7017. * })
  7018. */
  7019. value: number[];
  7020. }
  7021. /**
  7022. * Content pipeline functions for geometries.
  7023. */
  7024. export namespace GeometryPipeline {
  7025. /**
  7026. * Converts a geometry's triangle indices to line indices. If the geometry has an <code>indices</code>
  7027. * and its <code>primitiveType</code> is <code>TRIANGLES</code>, <code>TRIANGLE_STRIP</code>,
  7028. * <code>TRIANGLE_FAN</code>, it is converted to <code>LINES</code>; otherwise, the geometry is not changed.
  7029. * <p>
  7030. * This is commonly used to create a wireframe geometry for visual debugging.
  7031. * </p>
  7032. * @example
  7033. * geometry = Cesium.GeometryPipeline.toWireframe(geometry);
  7034. * @param geometry - The geometry to modify.
  7035. * @returns The modified <code>geometry</code> argument, with its triangle indices converted to lines.
  7036. */
  7037. function toWireframe(geometry: Geometry): Geometry;
  7038. /**
  7039. * Creates a new {@link Geometry} with <code>LINES</code> representing the provided
  7040. * attribute (<code>attributeName</code>) for the provided geometry. This is used to
  7041. * visualize vector attributes like normals, tangents, and bitangents.
  7042. * @example
  7043. * const geometry = Cesium.GeometryPipeline.createLineSegmentsForVectors(instance.geometry, 'bitangent', 100000.0);
  7044. * @param geometry - The <code>Geometry</code> instance with the attribute.
  7045. * @param [attributeName = 'normal'] - The name of the attribute.
  7046. * @param [length = 10000.0] - The length of each line segment in meters. This can be negative to point the vector in the opposite direction.
  7047. * @returns A new <code>Geometry</code> instance with line segments for the vector.
  7048. */
  7049. function createLineSegmentsForVectors(geometry: Geometry, attributeName?: string, length?: number): Geometry;
  7050. /**
  7051. * Creates an object that maps attribute names to unique locations (indices)
  7052. * for matching vertex attributes and shader programs.
  7053. * @example
  7054. * const attributeLocations = Cesium.GeometryPipeline.createAttributeLocations(geometry);
  7055. * // Example output
  7056. * // {
  7057. * // 'position' : 0,
  7058. * // 'normal' : 1
  7059. * // }
  7060. * @param geometry - The geometry, which is not modified, to create the object for.
  7061. * @returns An object with attribute name / index pairs.
  7062. */
  7063. function createAttributeLocations(geometry: Geometry): any;
  7064. /**
  7065. * Reorders a geometry's attributes and <code>indices</code> to achieve better performance from the GPU's pre-vertex-shader cache.
  7066. * @example
  7067. * geometry = Cesium.GeometryPipeline.reorderForPreVertexCache(geometry);
  7068. * @param geometry - The geometry to modify.
  7069. * @returns The modified <code>geometry</code> argument, with its attributes and indices reordered for the GPU's pre-vertex-shader cache.
  7070. */
  7071. function reorderForPreVertexCache(geometry: Geometry): Geometry;
  7072. /**
  7073. * Reorders a geometry's <code>indices</code> to achieve better performance from the GPU's
  7074. * post vertex-shader cache by using the Tipsify algorithm. If the geometry <code>primitiveType</code>
  7075. * is not <code>TRIANGLES</code> or the geometry does not have an <code>indices</code>, this function has no effect.
  7076. * @example
  7077. * geometry = Cesium.GeometryPipeline.reorderForPostVertexCache(geometry);
  7078. * @param geometry - The geometry to modify.
  7079. * @param [cacheCapacity = 24] - The number of vertices that can be held in the GPU's vertex cache.
  7080. * @returns The modified <code>geometry</code> argument, with its indices reordered for the post-vertex-shader cache.
  7081. */
  7082. function reorderForPostVertexCache(geometry: Geometry, cacheCapacity?: number): Geometry;
  7083. /**
  7084. * Splits a geometry into multiple geometries, if necessary, to ensure that indices in the
  7085. * <code>indices</code> fit into unsigned shorts. This is used to meet the WebGL requirements
  7086. * when unsigned int indices are not supported.
  7087. * <p>
  7088. * If the geometry does not have any <code>indices</code>, this function has no effect.
  7089. * </p>
  7090. * @example
  7091. * const geometries = Cesium.GeometryPipeline.fitToUnsignedShortIndices(geometry);
  7092. * @param geometry - The geometry to be split into multiple geometries.
  7093. * @returns An array of geometries, each with indices that fit into unsigned shorts.
  7094. */
  7095. function fitToUnsignedShortIndices(geometry: Geometry): Geometry[];
  7096. /**
  7097. * Projects a geometry's 3D <code>position</code> attribute to 2D, replacing the <code>position</code>
  7098. * attribute with separate <code>position3D</code> and <code>position2D</code> attributes.
  7099. * <p>
  7100. * If the geometry does not have a <code>position</code>, this function has no effect.
  7101. * </p>
  7102. * @example
  7103. * geometry = Cesium.GeometryPipeline.projectTo2D(geometry, 'position', 'position3D', 'position2D');
  7104. * @param geometry - The geometry to modify.
  7105. * @param attributeName - The name of the attribute.
  7106. * @param attributeName3D - The name of the attribute in 3D.
  7107. * @param attributeName2D - The name of the attribute in 2D.
  7108. * @param [projection = new GeographicProjection()] - The projection to use.
  7109. * @returns The modified <code>geometry</code> argument with <code>position3D</code> and <code>position2D</code> attributes.
  7110. */
  7111. function projectTo2D(geometry: Geometry, attributeName: string, attributeName3D: string, attributeName2D: string, projection?: any): Geometry;
  7112. /**
  7113. * Encodes floating-point geometry attribute values as two separate attributes to improve
  7114. * rendering precision.
  7115. * <p>
  7116. * This is commonly used to create high-precision position vertex attributes.
  7117. * </p>
  7118. * @example
  7119. * geometry = Cesium.GeometryPipeline.encodeAttribute(geometry, 'position3D', 'position3DHigh', 'position3DLow');
  7120. * @param geometry - The geometry to modify.
  7121. * @param attributeName - The name of the attribute.
  7122. * @param attributeHighName - The name of the attribute for the encoded high bits.
  7123. * @param attributeLowName - The name of the attribute for the encoded low bits.
  7124. * @returns The modified <code>geometry</code> argument, with its encoded attribute.
  7125. */
  7126. function encodeAttribute(geometry: Geometry, attributeName: string, attributeHighName: string, attributeLowName: string): Geometry;
  7127. /**
  7128. * Transforms a geometry instance to world coordinates. This changes
  7129. * the instance's <code>modelMatrix</code> to {@link Matrix4.IDENTITY} and transforms the
  7130. * following attributes if they are present: <code>position</code>, <code>normal</code>,
  7131. * <code>tangent</code>, and <code>bitangent</code>.
  7132. * @example
  7133. * Cesium.GeometryPipeline.transformToWorldCoordinates(instance);
  7134. * @param instance - The geometry instance to modify.
  7135. * @returns The modified <code>instance</code> argument, with its attributes transforms to world coordinates.
  7136. */
  7137. function transformToWorldCoordinates(instance: GeometryInstance): GeometryInstance;
  7138. /**
  7139. * Computes per-vertex normals for a geometry containing <code>TRIANGLES</code> by averaging the normals of
  7140. * all triangles incident to the vertex. The result is a new <code>normal</code> attribute added to the geometry.
  7141. * This assumes a counter-clockwise winding order.
  7142. * @example
  7143. * Cesium.GeometryPipeline.computeNormal(geometry);
  7144. * @param geometry - The geometry to modify.
  7145. * @returns The modified <code>geometry</code> argument with the computed <code>normal</code> attribute.
  7146. */
  7147. function computeNormal(geometry: Geometry): Geometry;
  7148. /**
  7149. * Computes per-vertex tangents and bitangents for a geometry containing <code>TRIANGLES</code>.
  7150. * The result is new <code>tangent</code> and <code>bitangent</code> attributes added to the geometry.
  7151. * This assumes a counter-clockwise winding order.
  7152. * <p>
  7153. * Based on <a href="http://www.terathon.com/code/tangent.html">Computing Tangent Space Basis Vectors
  7154. * for an Arbitrary Mesh</a> by Eric Lengyel.
  7155. * </p>
  7156. * @example
  7157. * Cesium.GeometryPipeline.computeTangentAndBiTangent(geometry);
  7158. * @param geometry - The geometry to modify.
  7159. * @returns The modified <code>geometry</code> argument with the computed <code>tangent</code> and <code>bitangent</code> attributes.
  7160. */
  7161. function computeTangentAndBitangent(geometry: Geometry): Geometry;
  7162. /**
  7163. * Compresses and packs geometry normal attribute values to save memory.
  7164. * @example
  7165. * geometry = Cesium.GeometryPipeline.compressVertices(geometry);
  7166. * @param geometry - The geometry to modify.
  7167. * @returns The modified <code>geometry</code> argument, with its normals compressed and packed.
  7168. */
  7169. function compressVertices(geometry: Geometry): Geometry;
  7170. }
  7171. /**
  7172. * Provides metadata using the Google Earth Enterprise REST API. This is used by the GoogleEarthEnterpriseImageryProvider
  7173. * and GoogleEarthEnterpriseTerrainProvider to share metadata requests.
  7174. * @param resourceOrUrl - The url of the Google Earth Enterprise server hosting the imagery
  7175. */
  7176. export class GoogleEarthEnterpriseMetadata {
  7177. constructor(resourceOrUrl: Resource | string);
  7178. /**
  7179. * True if imagery is available.
  7180. */
  7181. imageryPresent: boolean;
  7182. /**
  7183. * True if imagery is sent as a protocol buffer, false if sent as plain images. If undefined we will try both.
  7184. */
  7185. protoImagery: boolean;
  7186. /**
  7187. * True if terrain is available.
  7188. */
  7189. terrainPresent: boolean;
  7190. /**
  7191. * Exponent used to compute constant to calculate negative height values.
  7192. */
  7193. negativeAltitudeExponentBias: number;
  7194. /**
  7195. * Threshold where any numbers smaller are actually negative values. They are multiplied by -2^negativeAltitudeExponentBias.
  7196. */
  7197. negativeAltitudeThreshold: number;
  7198. /**
  7199. * Dictionary of provider id to copyright strings.
  7200. */
  7201. providers: any;
  7202. /**
  7203. * Key used to decode packets
  7204. */
  7205. key: ArrayBuffer;
  7206. /**
  7207. * Gets the name of the Google Earth Enterprise server.
  7208. */
  7209. readonly url: string;
  7210. /**
  7211. * Gets the proxy used for metadata requests.
  7212. */
  7213. readonly proxy: Proxy;
  7214. /**
  7215. * Gets the resource used for metadata requests.
  7216. */
  7217. readonly resource: Resource;
  7218. /**
  7219. * Gets a promise that resolves to true when the metadata is ready for use.
  7220. */
  7221. readonly readyPromise: Promise<boolean>;
  7222. /**
  7223. * Converts a tiles (x, y, level) position into a quadkey used to request an image
  7224. * from a Google Earth Enterprise server.
  7225. * @param x - The tile's x coordinate.
  7226. * @param y - The tile's y coordinate.
  7227. * @param level - The tile's zoom level.
  7228. */
  7229. static tileXYToQuadKey(x: number, y: number, level: number): void;
  7230. /**
  7231. * Converts a tile's quadkey used to request an image from a Google Earth Enterprise server into the
  7232. * (x, y, level) position.
  7233. * @param quadkey - The tile's quad key
  7234. */
  7235. static quadKeyToTileXY(quadkey: string): void;
  7236. }
  7237. /**
  7238. * Terrain data for a single tile from a Google Earth Enterprise server.
  7239. * @example
  7240. * const buffer = ...
  7241. * const childTileMask = ...
  7242. * const terrainData = new Cesium.GoogleEarthEnterpriseTerrainData({
  7243. * buffer : heightBuffer,
  7244. * childTileMask : childTileMask
  7245. * });
  7246. * @param options - Object with the following properties:
  7247. * @param options.buffer - The buffer containing terrain data.
  7248. * @param options.negativeAltitudeExponentBias - Multiplier for negative terrain heights that are encoded as very small positive values.
  7249. * @param options.negativeElevationThreshold - Threshold for negative values
  7250. * @param [options.childTileMask = 15] - A bit mask indicating which of this tile's four children exist.
  7251. * If a child's bit is set, geometry will be requested for that tile as well when it
  7252. * is needed. If the bit is cleared, the child tile is not requested and geometry is
  7253. * instead upsampled from the parent. The bit values are as follows:
  7254. * <table>
  7255. * <tr><th>Bit Position</th><th>Bit Value</th><th>Child Tile</th></tr>
  7256. * <tr><td>0</td><td>1</td><td>Southwest</td></tr>
  7257. * <tr><td>1</td><td>2</td><td>Southeast</td></tr>
  7258. * <tr><td>2</td><td>4</td><td>Northeast</td></tr>
  7259. * <tr><td>3</td><td>8</td><td>Northwest</td></tr>
  7260. * </table>
  7261. * @param [options.createdByUpsampling = false] - True if this instance was created by upsampling another instance;
  7262. * otherwise, false.
  7263. * @param [options.credits] - Array of credits for this tile.
  7264. */
  7265. export class GoogleEarthEnterpriseTerrainData {
  7266. constructor(options: {
  7267. buffer: ArrayBuffer;
  7268. negativeAltitudeExponentBias: number;
  7269. negativeElevationThreshold: number;
  7270. childTileMask?: number;
  7271. createdByUpsampling?: boolean;
  7272. credits?: Credit[];
  7273. });
  7274. /**
  7275. * An array of credits for this tile
  7276. */
  7277. credits: Credit[];
  7278. /**
  7279. * The water mask included in this terrain data, if any. A water mask is a rectangular
  7280. * Uint8Array or image where a value of 255 indicates water and a value of 0 indicates land.
  7281. * Values in between 0 and 255 are allowed as well to smoothly blend between land and water.
  7282. */
  7283. waterMask: Uint8Array | HTMLImageElement | HTMLCanvasElement;
  7284. /**
  7285. * Computes the terrain height at a specified longitude and latitude.
  7286. * @param rectangle - The rectangle covered by this terrain data.
  7287. * @param longitude - The longitude in radians.
  7288. * @param latitude - The latitude in radians.
  7289. * @returns The terrain height at the specified position. If the position
  7290. * is outside the rectangle, this method will extrapolate the height, which is likely to be wildly
  7291. * incorrect for positions far outside the rectangle.
  7292. */
  7293. interpolateHeight(rectangle: Rectangle, longitude: number, latitude: number): number;
  7294. /**
  7295. * Upsamples this terrain data for use by a descendant tile. The resulting instance will contain a subset of the
  7296. * height samples in this instance, interpolated if necessary.
  7297. * @param tilingScheme - The tiling scheme of this terrain data.
  7298. * @param thisX - The X coordinate of this tile in the tiling scheme.
  7299. * @param thisY - The Y coordinate of this tile in the tiling scheme.
  7300. * @param thisLevel - The level of this tile in the tiling scheme.
  7301. * @param descendantX - The X coordinate within the tiling scheme of the descendant tile for which we are upsampling.
  7302. * @param descendantY - The Y coordinate within the tiling scheme of the descendant tile for which we are upsampling.
  7303. * @param descendantLevel - The level within the tiling scheme of the descendant tile for which we are upsampling.
  7304. * @returns A promise for upsampled heightmap terrain data for the descendant tile,
  7305. * or undefined if too many asynchronous upsample operations are in progress and the request has been
  7306. * deferred.
  7307. */
  7308. upsample(tilingScheme: TilingScheme, thisX: number, thisY: number, thisLevel: number, descendantX: number, descendantY: number, descendantLevel: number): Promise<HeightmapTerrainData> | undefined;
  7309. /**
  7310. * Determines if a given child tile is available, based on the
  7311. * {@link HeightmapTerrainData.childTileMask}. The given child tile coordinates are assumed
  7312. * to be one of the four children of this tile. If non-child tile coordinates are
  7313. * given, the availability of the southeast child tile is returned.
  7314. * @param thisX - The tile X coordinate of this (the parent) tile.
  7315. * @param thisY - The tile Y coordinate of this (the parent) tile.
  7316. * @param childX - The tile X coordinate of the child tile to check for availability.
  7317. * @param childY - The tile Y coordinate of the child tile to check for availability.
  7318. * @returns True if the child tile is available; otherwise, false.
  7319. */
  7320. isChildAvailable(thisX: number, thisY: number, childX: number, childY: number): boolean;
  7321. /**
  7322. * Gets a value indicating whether or not this terrain data was created by upsampling lower resolution
  7323. * terrain data. If this value is false, the data was obtained from some other source, such
  7324. * as by downloading it from a remote server. This method should return true for instances
  7325. * returned from a call to {@link HeightmapTerrainData#upsample}.
  7326. * @returns True if this instance was created by upsampling; otherwise, false.
  7327. */
  7328. wasCreatedByUpsampling(): boolean;
  7329. }
  7330. /**
  7331. * Provides tiled terrain using the Google Earth Enterprise REST API.
  7332. * @example
  7333. * const geeMetadata = new GoogleEarthEnterpriseMetadata('http://www.earthenterprise.org/3d');
  7334. * const gee = new Cesium.GoogleEarthEnterpriseTerrainProvider({
  7335. * metadata : geeMetadata
  7336. * });
  7337. * @param options - Object with the following properties:
  7338. * @param options.url - The url of the Google Earth Enterprise server hosting the imagery.
  7339. * @param options.metadata - A metadata object that can be used to share metadata requests with a GoogleEarthEnterpriseImageryProvider.
  7340. * @param [options.ellipsoid] - The ellipsoid. If not specified, the WGS84 ellipsoid is used.
  7341. * @param [options.credit] - A credit for the data source, which is displayed on the canvas.
  7342. */
  7343. export class GoogleEarthEnterpriseTerrainProvider {
  7344. constructor(options: {
  7345. url: Resource | string;
  7346. metadata: GoogleEarthEnterpriseMetadata;
  7347. ellipsoid?: Ellipsoid;
  7348. credit?: Credit | string;
  7349. });
  7350. /**
  7351. * Gets the name of the Google Earth Enterprise server url hosting the imagery.
  7352. */
  7353. readonly url: string;
  7354. /**
  7355. * Gets the proxy used by this provider.
  7356. */
  7357. readonly proxy: Proxy;
  7358. /**
  7359. * Gets the tiling scheme used by this provider. This function should
  7360. * not be called before {@link GoogleEarthEnterpriseTerrainProvider#ready} returns true.
  7361. */
  7362. readonly tilingScheme: TilingScheme;
  7363. /**
  7364. * Gets an event that is raised when the imagery provider encounters an asynchronous error. By subscribing
  7365. * to the event, you will be notified of the error and can potentially recover from it. Event listeners
  7366. * are passed an instance of {@link TileProviderError}.
  7367. */
  7368. readonly errorEvent: Event;
  7369. /**
  7370. * Gets a value indicating whether or not the provider is ready for use.
  7371. */
  7372. readonly ready: boolean;
  7373. /**
  7374. * Gets a promise that resolves to true when the provider is ready for use.
  7375. */
  7376. readonly readyPromise: Promise<boolean>;
  7377. /**
  7378. * Gets the credit to display when this terrain provider is active. Typically this is used to credit
  7379. * the source of the terrain. This function should not be called before {@link GoogleEarthEnterpriseTerrainProvider#ready} returns true.
  7380. */
  7381. readonly credit: Credit;
  7382. /**
  7383. * Gets a value indicating whether or not the provider includes a water mask. The water mask
  7384. * indicates which areas of the globe are water rather than land, so they can be rendered
  7385. * as a reflective surface with animated waves. This function should not be
  7386. * called before {@link GoogleEarthEnterpriseTerrainProvider#ready} returns true.
  7387. */
  7388. readonly hasWaterMask: boolean;
  7389. /**
  7390. * Gets a value indicating whether or not the requested tiles include vertex normals.
  7391. * This function should not be called before {@link GoogleEarthEnterpriseTerrainProvider#ready} returns true.
  7392. */
  7393. readonly hasVertexNormals: boolean;
  7394. /**
  7395. * Gets an object that can be used to determine availability of terrain from this provider, such as
  7396. * at points and in rectangles. This function should not be called before
  7397. * {@link GoogleEarthEnterpriseTerrainProvider#ready} returns true. This property may be undefined if availability
  7398. * information is not available.
  7399. */
  7400. readonly availability: TileAvailability;
  7401. /**
  7402. * Requests the geometry for a given tile. This function should not be called before
  7403. * {@link GoogleEarthEnterpriseTerrainProvider#ready} returns true. The result must include terrain data and
  7404. * may optionally include a water mask and an indication of which child tiles are available.
  7405. * @param x - The X coordinate of the tile for which to request geometry.
  7406. * @param y - The Y coordinate of the tile for which to request geometry.
  7407. * @param level - The level of the tile for which to request geometry.
  7408. * @param [request] - The request object. Intended for internal use only.
  7409. * @returns A promise for the requested geometry. If this method
  7410. * returns undefined instead of a promise, it is an indication that too many requests are already
  7411. * pending and the request will be retried later.
  7412. */
  7413. requestTileGeometry(x: number, y: number, level: number, request?: Request): Promise<TerrainData> | undefined;
  7414. /**
  7415. * Gets the maximum geometric error allowed in a tile at a given level.
  7416. * @param level - The tile level for which to get the maximum geometric error.
  7417. * @returns The maximum geometric error.
  7418. */
  7419. getLevelMaximumGeometricError(level: number): number;
  7420. /**
  7421. * Determines whether data for a tile is available to be loaded.
  7422. * @param x - The X coordinate of the tile for which to request geometry.
  7423. * @param y - The Y coordinate of the tile for which to request geometry.
  7424. * @param level - The level of the tile for which to request geometry.
  7425. * @returns Undefined if not supported, otherwise true or false.
  7426. */
  7427. getTileDataAvailable(x: number, y: number, level: number): boolean | undefined;
  7428. /**
  7429. * Makes sure we load availability data for a tile
  7430. * @param x - The X coordinate of the tile for which to request geometry.
  7431. * @param y - The Y coordinate of the tile for which to request geometry.
  7432. * @param level - The level of the tile for which to request geometry.
  7433. */
  7434. loadTileDataAvailability(x: number, y: number, level: number): undefined;
  7435. }
  7436. /**
  7437. * Represents a Gregorian date in a more precise format than the JavaScript Date object.
  7438. * In addition to submillisecond precision, this object can also represent leap seconds.
  7439. * @param [year] - The year as a whole number.
  7440. * @param [month] - The month as a whole number with range [1, 12].
  7441. * @param [day] - The day of the month as a whole number starting at 1.
  7442. * @param [hour] - The hour as a whole number with range [0, 23].
  7443. * @param [minute] - The minute of the hour as a whole number with range [0, 59].
  7444. * @param [second] - The second of the minute as a whole number with range [0, 60], with 60 representing a leap second.
  7445. * @param [millisecond] - The millisecond of the second as a floating point number with range [0.0, 1000.0).
  7446. * @param [isLeapSecond] - Whether this time is during a leap second.
  7447. */
  7448. export class GregorianDate {
  7449. constructor(year?: number, month?: number, day?: number, hour?: number, minute?: number, second?: number, millisecond?: number, isLeapSecond?: boolean);
  7450. /**
  7451. * Gets or sets the year as a whole number.
  7452. */
  7453. year: number;
  7454. /**
  7455. * Gets or sets the month as a whole number with range [1, 12].
  7456. */
  7457. month: number;
  7458. /**
  7459. * Gets or sets the day of the month as a whole number starting at 1.
  7460. */
  7461. day: number;
  7462. /**
  7463. * Gets or sets the hour as a whole number with range [0, 23].
  7464. */
  7465. hour: number;
  7466. /**
  7467. * Gets or sets the minute of the hour as a whole number with range [0, 59].
  7468. */
  7469. minute: number;
  7470. /**
  7471. * Gets or sets the second of the minute as a whole number with range [0, 60], with 60 representing a leap second.
  7472. */
  7473. second: number;
  7474. /**
  7475. * Gets or sets the millisecond of the second as a floating point number with range [0.0, 1000.0).
  7476. */
  7477. millisecond: number;
  7478. /**
  7479. * Gets or sets whether this time is during a leap second.
  7480. */
  7481. isLeapSecond: boolean;
  7482. }
  7483. /**
  7484. * A description of a polyline on terrain or 3D Tiles. Only to be used with {@link GroundPolylinePrimitive}.
  7485. * @example
  7486. * const positions = Cesium.Cartesian3.fromDegreesArray([
  7487. * -112.1340164450331, 36.05494287836128,
  7488. * -112.08821010582645, 36.097804071380715,
  7489. * -112.13296079730024, 36.168769146801104
  7490. * ]);
  7491. *
  7492. * const geometry = new Cesium.GroundPolylineGeometry({
  7493. * positions : positions
  7494. * });
  7495. * @param options - Options with the following properties:
  7496. * @param options.positions - An array of {@link Cartesian3} defining the polyline's points. Heights above the ellipsoid will be ignored.
  7497. * @param [options.width = 1.0] - The screen space width in pixels.
  7498. * @param [options.granularity = 9999.0] - The distance interval in meters used for interpolating options.points. Defaults to 9999.0 meters. Zero indicates no interpolation.
  7499. * @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.
  7500. * @param [options.arcType = ArcType.GEODESIC] - The type of line the polyline segments must follow. Valid options are {@link ArcType.GEODESIC} and {@link ArcType.RHUMB}.
  7501. */
  7502. export class GroundPolylineGeometry {
  7503. constructor(options: {
  7504. positions: Cartesian3[];
  7505. width?: number;
  7506. granularity?: number;
  7507. loop?: boolean;
  7508. arcType?: ArcType;
  7509. });
  7510. /**
  7511. * The screen space width in pixels.
  7512. */
  7513. width: number;
  7514. /**
  7515. * The distance interval used for interpolating options.points. Zero indicates no interpolation.
  7516. * Default of 9999.0 allows centimeter accuracy with 32 bit floating point.
  7517. */
  7518. granularity: boolean;
  7519. /**
  7520. * Whether during geometry creation a line segment will be added between the last and first line positions to make this Polyline a loop.
  7521. * If the geometry has two positions this parameter will be ignored.
  7522. */
  7523. loop: boolean;
  7524. /**
  7525. * The type of path the polyline must follow. Valid options are {@link ArcType.GEODESIC} and {@link ArcType.RHUMB}.
  7526. */
  7527. arcType: ArcType;
  7528. /**
  7529. * Stores the provided instance into the provided array.
  7530. * @param value - The value to pack.
  7531. * @param array - The array to pack into.
  7532. * @param [startingIndex = 0] - The index into the array at which to start packing the elements.
  7533. * @returns The array that was packed into
  7534. */
  7535. static pack(value: PolygonGeometry, array: number[], startingIndex?: number): number[];
  7536. /**
  7537. * Retrieves an instance from a packed array.
  7538. * @param array - The packed array.
  7539. * @param [startingIndex = 0] - The starting index of the element to be unpacked.
  7540. * @param [result] - The object into which to store the result.
  7541. */
  7542. static unpack(array: number[], startingIndex?: number, result?: PolygonGeometry): void;
  7543. }
  7544. /**
  7545. * Defines a heading angle, pitch angle, and range in a local frame.
  7546. * Heading is the rotation from the local north direction where a positive angle is increasing eastward.
  7547. * Pitch is the rotation from the local xy-plane. Positive pitch angles are above the plane. Negative pitch
  7548. * angles are below the plane. Range is the distance from the center of the frame.
  7549. * @param [heading = 0.0] - The heading angle in radians.
  7550. * @param [pitch = 0.0] - The pitch angle in radians.
  7551. * @param [range = 0.0] - The distance from the center in meters.
  7552. */
  7553. export class HeadingPitchRange {
  7554. constructor(heading?: number, pitch?: number, range?: number);
  7555. /**
  7556. * Heading is the rotation from the local north direction where a positive angle is increasing eastward.
  7557. */
  7558. heading: number;
  7559. /**
  7560. * Pitch is the rotation from the local xy-plane. Positive pitch angles
  7561. * are above the plane. Negative pitch angles are below the plane.
  7562. */
  7563. pitch: number;
  7564. /**
  7565. * Range is the distance from the center of the local frame.
  7566. */
  7567. range: number;
  7568. /**
  7569. * Duplicates a HeadingPitchRange instance.
  7570. * @param hpr - The HeadingPitchRange to duplicate.
  7571. * @param [result] - The object onto which to store the result.
  7572. * @returns The modified result parameter or a new HeadingPitchRange instance if one was not provided. (Returns undefined if hpr is undefined)
  7573. */
  7574. static clone(hpr: HeadingPitchRange, result?: HeadingPitchRange): HeadingPitchRange;
  7575. }
  7576. /**
  7577. * A rotation expressed as a heading, pitch, and roll. Heading is the rotation about the
  7578. * negative z axis. Pitch is the rotation about the negative y axis. Roll is the rotation about
  7579. * the positive x axis.
  7580. * @param [heading = 0.0] - The heading component in radians.
  7581. * @param [pitch = 0.0] - The pitch component in radians.
  7582. * @param [roll = 0.0] - The roll component in radians.
  7583. */
  7584. export class HeadingPitchRoll {
  7585. constructor(heading?: number, pitch?: number, roll?: number);
  7586. /**
  7587. * Gets or sets the heading.
  7588. */
  7589. heading: number;
  7590. /**
  7591. * Gets or sets the pitch.
  7592. */
  7593. pitch: number;
  7594. /**
  7595. * Gets or sets the roll.
  7596. */
  7597. roll: number;
  7598. /**
  7599. * Computes the heading, pitch and roll from a quaternion (see http://en.wikipedia.org/wiki/Conversion_between_quaternions_and_Euler_angles )
  7600. * @param quaternion - The quaternion from which to retrieve heading, pitch, and roll, all expressed in radians.
  7601. * @param [result] - The object in which to store the result. If not provided, a new instance is created and returned.
  7602. * @returns The modified result parameter or a new HeadingPitchRoll instance if one was not provided.
  7603. */
  7604. static fromQuaternion(quaternion: Quaternion, result?: HeadingPitchRoll): HeadingPitchRoll;
  7605. /**
  7606. * Returns a new HeadingPitchRoll instance from angles given in degrees.
  7607. * @param heading - the heading in degrees
  7608. * @param pitch - the pitch in degrees
  7609. * @param roll - the heading in degrees
  7610. * @param [result] - The object in which to store the result. If not provided, a new instance is created and returned.
  7611. * @returns A new HeadingPitchRoll instance
  7612. */
  7613. static fromDegrees(heading: number, pitch: number, roll: number, result?: HeadingPitchRoll): HeadingPitchRoll;
  7614. /**
  7615. * Duplicates a HeadingPitchRoll instance.
  7616. * @param headingPitchRoll - The HeadingPitchRoll to duplicate.
  7617. * @param [result] - The object onto which to store the result.
  7618. * @returns The modified result parameter or a new HeadingPitchRoll instance if one was not provided. (Returns undefined if headingPitchRoll is undefined)
  7619. */
  7620. static clone(headingPitchRoll: HeadingPitchRoll, result?: HeadingPitchRoll): HeadingPitchRoll;
  7621. /**
  7622. * Compares the provided HeadingPitchRolls componentwise and returns
  7623. * <code>true</code> if they are equal, <code>false</code> otherwise.
  7624. * @param [left] - The first HeadingPitchRoll.
  7625. * @param [right] - The second HeadingPitchRoll.
  7626. * @returns <code>true</code> if left and right are equal, <code>false</code> otherwise.
  7627. */
  7628. static equals(left?: HeadingPitchRoll, right?: HeadingPitchRoll): boolean;
  7629. /**
  7630. * Compares the provided HeadingPitchRolls componentwise and returns
  7631. * <code>true</code> if they pass an absolute or relative tolerance test,
  7632. * <code>false</code> otherwise.
  7633. * @param [left] - The first HeadingPitchRoll.
  7634. * @param [right] - The second HeadingPitchRoll.
  7635. * @param [relativeEpsilon = 0] - The relative epsilon tolerance to use for equality testing.
  7636. * @param [absoluteEpsilon = relativeEpsilon] - The absolute epsilon tolerance to use for equality testing.
  7637. * @returns <code>true</code> if left and right are within the provided epsilon, <code>false</code> otherwise.
  7638. */
  7639. static equalsEpsilon(left?: HeadingPitchRoll, right?: HeadingPitchRoll, relativeEpsilon?: number, absoluteEpsilon?: number): boolean;
  7640. /**
  7641. * Duplicates this HeadingPitchRoll instance.
  7642. * @param [result] - The object onto which to store the result.
  7643. * @returns The modified result parameter or a new HeadingPitchRoll instance if one was not provided.
  7644. */
  7645. clone(result?: HeadingPitchRoll): HeadingPitchRoll;
  7646. /**
  7647. * Compares this HeadingPitchRoll against the provided HeadingPitchRoll componentwise and returns
  7648. * <code>true</code> if they are equal, <code>false</code> otherwise.
  7649. * @param [right] - The right hand side HeadingPitchRoll.
  7650. * @returns <code>true</code> if they are equal, <code>false</code> otherwise.
  7651. */
  7652. equals(right?: HeadingPitchRoll): boolean;
  7653. /**
  7654. * Compares this HeadingPitchRoll against the provided HeadingPitchRoll componentwise and returns
  7655. * <code>true</code> if they pass an absolute or relative tolerance test,
  7656. * <code>false</code> otherwise.
  7657. * @param [right] - The right hand side HeadingPitchRoll.
  7658. * @param [relativeEpsilon = 0] - The relative epsilon tolerance to use for equality testing.
  7659. * @param [absoluteEpsilon = relativeEpsilon] - The absolute epsilon tolerance to use for equality testing.
  7660. * @returns <code>true</code> if they are within the provided epsilon, <code>false</code> otherwise.
  7661. */
  7662. equalsEpsilon(right?: HeadingPitchRoll, relativeEpsilon?: number, absoluteEpsilon?: number): boolean;
  7663. /**
  7664. * Creates a string representing this HeadingPitchRoll in the format '(heading, pitch, roll)' in radians.
  7665. * @returns A string representing the provided HeadingPitchRoll in the format '(heading, pitch, roll)'.
  7666. */
  7667. toString(): string;
  7668. }
  7669. /**
  7670. * The encoding that is used for a heightmap
  7671. */
  7672. export enum HeightmapEncoding {
  7673. /**
  7674. * No encoding
  7675. */
  7676. NONE = 0,
  7677. /**
  7678. * LERC encoding
  7679. */
  7680. LERC = 1
  7681. }
  7682. /**
  7683. * Terrain data for a single tile where the terrain data is represented as a heightmap. A heightmap
  7684. * is a rectangular array of heights in row-major order from north to south and west to east.
  7685. * @example
  7686. * const buffer = ...
  7687. * const heightBuffer = new Uint16Array(buffer, 0, that._heightmapWidth * that._heightmapWidth);
  7688. * const childTileMask = new Uint8Array(buffer, heightBuffer.byteLength, 1)[0];
  7689. * const waterMask = new Uint8Array(buffer, heightBuffer.byteLength + 1, buffer.byteLength - heightBuffer.byteLength - 1);
  7690. * const terrainData = new Cesium.HeightmapTerrainData({
  7691. * buffer : heightBuffer,
  7692. * width : 65,
  7693. * height : 65,
  7694. * childTileMask : childTileMask,
  7695. * waterMask : waterMask
  7696. * });
  7697. * @param options - Object with the following properties:
  7698. * @param options.buffer - The buffer containing height data.
  7699. * @param options.width - The width (longitude direction) of the heightmap, in samples.
  7700. * @param options.height - The height (latitude direction) of the heightmap, in samples.
  7701. * @param [options.childTileMask = 15] - A bit mask indicating which of this tile's four children exist.
  7702. * If a child's bit is set, geometry will be requested for that tile as well when it
  7703. * is needed. If the bit is cleared, the child tile is not requested and geometry is
  7704. * instead upsampled from the parent. The bit values are as follows:
  7705. * <table>
  7706. * <tr><th>Bit Position</th><th>Bit Value</th><th>Child Tile</th></tr>
  7707. * <tr><td>0</td><td>1</td><td>Southwest</td></tr>
  7708. * <tr><td>1</td><td>2</td><td>Southeast</td></tr>
  7709. * <tr><td>2</td><td>4</td><td>Northwest</td></tr>
  7710. * <tr><td>3</td><td>8</td><td>Northeast</td></tr>
  7711. * </table>
  7712. * @param [options.waterMask] - The water mask included in this terrain data, if any. A water mask is a square
  7713. * Uint8Array or image where a value of 255 indicates water and a value of 0 indicates land.
  7714. * Values in between 0 and 255 are allowed as well to smoothly blend between land and water.
  7715. * @param [options.structure] - An object describing the structure of the height data.
  7716. * @param [options.structure.heightScale = 1.0] - The factor by which to multiply height samples in order to obtain
  7717. * the height above the heightOffset, in meters. The heightOffset is added to the resulting
  7718. * height after multiplying by the scale.
  7719. * @param [options.structure.heightOffset = 0.0] - The offset to add to the scaled height to obtain the final
  7720. * height in meters. The offset is added after the height sample is multiplied by the
  7721. * heightScale.
  7722. * @param [options.structure.elementsPerHeight = 1] - The number of elements in the buffer that make up a single height
  7723. * sample. This is usually 1, indicating that each element is a separate height sample. If
  7724. * it is greater than 1, that number of elements together form the height sample, which is
  7725. * computed according to the structure.elementMultiplier and structure.isBigEndian properties.
  7726. * @param [options.structure.stride = 1] - The number of elements to skip to get from the first element of
  7727. * one height to the first element of the next height.
  7728. * @param [options.structure.elementMultiplier = 256.0] - The multiplier used to compute the height value when the
  7729. * stride property is greater than 1. For example, if the stride is 4 and the strideMultiplier
  7730. * is 256, the height is computed as follows:
  7731. * `height = buffer[index] + buffer[index + 1] * 256 + buffer[index + 2] * 256 * 256 + buffer[index + 3] * 256 * 256 * 256`
  7732. * This is assuming that the isBigEndian property is false. If it is true, the order of the
  7733. * elements is reversed.
  7734. * @param [options.structure.isBigEndian = false] - Indicates endianness of the elements in the buffer when the
  7735. * stride property is greater than 1. If this property is false, the first element is the
  7736. * low-order element. If it is true, the first element is the high-order element.
  7737. * @param [options.structure.lowestEncodedHeight] - The lowest value that can be stored in the height buffer. Any heights that are lower
  7738. * than this value after encoding with the `heightScale` and `heightOffset` are clamped to this value. For example, if the height
  7739. * buffer is a `Uint16Array`, this value should be 0 because a `Uint16Array` cannot store negative numbers. If this parameter is
  7740. * not specified, no minimum value is enforced.
  7741. * @param [options.structure.highestEncodedHeight] - The highest value that can be stored in the height buffer. Any heights that are higher
  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 `256 * 256 - 1` or 65535 because a `Uint16Array` cannot store numbers larger
  7744. * than 65535. If this parameter is not specified, no maximum value is enforced.
  7745. * @param [options.encoding = HeightmapEncoding.NONE] - The encoding that is used on the buffer.
  7746. * @param [options.createdByUpsampling = false] - True if this instance was created by upsampling another instance;
  7747. * otherwise, false.
  7748. */
  7749. export class HeightmapTerrainData {
  7750. constructor(options: {
  7751. buffer: Int8Array | Uint8Array | Int16Array | Uint16Array | Int32Array | Uint32Array | Float32Array | Float64Array;
  7752. width: number;
  7753. height: number;
  7754. childTileMask?: number;
  7755. waterMask?: Uint8Array;
  7756. structure?: {
  7757. heightScale?: number;
  7758. heightOffset?: number;
  7759. elementsPerHeight?: number;
  7760. stride?: number;
  7761. elementMultiplier?: number;
  7762. isBigEndian?: boolean;
  7763. lowestEncodedHeight?: number;
  7764. highestEncodedHeight?: number;
  7765. };
  7766. encoding?: HeightmapEncoding;
  7767. createdByUpsampling?: boolean;
  7768. });
  7769. /**
  7770. * An array of credits for this tile.
  7771. */
  7772. credits: Credit[];
  7773. /**
  7774. * The water mask included in this terrain data, if any. A water mask is a square
  7775. * Uint8Array or image where a value of 255 indicates water and a value of 0 indicates land.
  7776. * Values in between 0 and 255 are allowed as well to smoothly blend between land and water.
  7777. */
  7778. waterMask: Uint8Array | HTMLImageElement | HTMLCanvasElement;
  7779. /**
  7780. * Computes the terrain height at a specified longitude and latitude.
  7781. * @param rectangle - The rectangle covered by this terrain data.
  7782. * @param longitude - The longitude in radians.
  7783. * @param latitude - The latitude in radians.
  7784. * @returns The terrain height at the specified position. If the position
  7785. * is outside the rectangle, this method will extrapolate the height, which is likely to be wildly
  7786. * incorrect for positions far outside the rectangle.
  7787. */
  7788. interpolateHeight(rectangle: Rectangle, longitude: number, latitude: number): number;
  7789. /**
  7790. * Upsamples this terrain data for use by a descendant tile. The resulting instance will contain a subset of the
  7791. * height samples in this instance, interpolated if necessary.
  7792. * @param tilingScheme - The tiling scheme of this terrain data.
  7793. * @param thisX - The X coordinate of this tile in the tiling scheme.
  7794. * @param thisY - The Y coordinate of this tile in the tiling scheme.
  7795. * @param thisLevel - The level of this tile in the tiling scheme.
  7796. * @param descendantX - The X coordinate within the tiling scheme of the descendant tile for which we are upsampling.
  7797. * @param descendantY - The Y coordinate within the tiling scheme of the descendant tile for which we are upsampling.
  7798. * @param descendantLevel - The level within the tiling scheme of the descendant tile for which we are upsampling.
  7799. * @returns A promise for upsampled heightmap terrain data for the descendant tile,
  7800. * or undefined if the mesh is unavailable.
  7801. */
  7802. upsample(tilingScheme: TilingScheme, thisX: number, thisY: number, thisLevel: number, descendantX: number, descendantY: number, descendantLevel: number): Promise<HeightmapTerrainData> | undefined;
  7803. /**
  7804. * Determines if a given child tile is available, based on the
  7805. * {@link HeightmapTerrainData.childTileMask}. The given child tile coordinates are assumed
  7806. * to be one of the four children of this tile. If non-child tile coordinates are
  7807. * given, the availability of the southeast child tile is returned.
  7808. * @param thisX - The tile X coordinate of this (the parent) tile.
  7809. * @param thisY - The tile Y coordinate of this (the parent) tile.
  7810. * @param childX - The tile X coordinate of the child tile to check for availability.
  7811. * @param childY - The tile Y coordinate of the child tile to check for availability.
  7812. * @returns True if the child tile is available; otherwise, false.
  7813. */
  7814. isChildAvailable(thisX: number, thisY: number, childX: number, childY: number): boolean;
  7815. /**
  7816. * Gets a value indicating whether or not this terrain data was created by upsampling lower resolution
  7817. * terrain data. If this value is false, the data was obtained from some other source, such
  7818. * as by downloading it from a remote server. This method should return true for instances
  7819. * returned from a call to {@link HeightmapTerrainData#upsample}.
  7820. * @returns True if this instance was created by upsampling; otherwise, false.
  7821. */
  7822. wasCreatedByUpsampling(): boolean;
  7823. }
  7824. /**
  7825. * An {@link InterpolationAlgorithm} for performing Hermite interpolation.
  7826. */
  7827. export namespace HermitePolynomialApproximation {
  7828. /**
  7829. * Given the desired degree, returns the number of data points required for interpolation.
  7830. * @param degree - The desired degree of interpolation.
  7831. * @param [inputOrder = 0] - The order of the inputs (0 means just the data, 1 means the data and its derivative, etc).
  7832. * @returns The number of required data points needed for the desired degree of interpolation.
  7833. */
  7834. function getRequiredDataPoints(degree: number, inputOrder?: number): number;
  7835. /**
  7836. * Interpolates values using Hermite Polynomial Approximation.
  7837. * @param x - The independent variable for which the dependent variables will be interpolated.
  7838. * @param xTable - The array of independent variables to use to interpolate. The values
  7839. * in this array must be in increasing order and the same value must not occur twice in the array.
  7840. * @param yTable - The array of dependent variables to use to interpolate. For a set of three
  7841. * dependent values (p,q,w) at time 1 and time 2 this should be as follows: {p1, q1, w1, p2, q2, w2}.
  7842. * @param yStride - The number of dependent variable values in yTable corresponding to
  7843. * each independent variable value in xTable.
  7844. * @param [result] - An existing array into which to store the result.
  7845. * @returns The array of interpolated values, or the result parameter if one was provided.
  7846. */
  7847. function interpolateOrderZero(x: number, xTable: number[], yTable: number[], yStride: number, result?: number[]): number[];
  7848. /**
  7849. * Interpolates values using Hermite Polynomial Approximation.
  7850. * @param x - The independent variable for which the dependent variables will be interpolated.
  7851. * @param xTable - The array of independent variables to use to interpolate. The values
  7852. * in this array must be in increasing order and the same value must not occur twice in the array.
  7853. * @param yTable - The array of dependent variables to use to interpolate. For a set of three
  7854. * dependent values (p,q,w) at time 1 and time 2 this should be as follows: {p1, q1, w1, p2, q2, w2}.
  7855. * @param yStride - The number of dependent variable values in yTable corresponding to
  7856. * each independent variable value in xTable.
  7857. * @param inputOrder - The number of derivatives supplied for input.
  7858. * @param outputOrder - The number of derivatives desired for output.
  7859. * @param [result] - An existing array into which to store the result.
  7860. * @returns The array of interpolated values, or the result parameter if one was provided.
  7861. */
  7862. function interpolate(x: number, xTable: number[], yTable: number[], yStride: number, inputOrder: number, outputOrder: number, result?: number[]): number[];
  7863. }
  7864. /**
  7865. * A Hermite spline is a cubic interpolating spline. Points, incoming tangents, outgoing tangents, and times
  7866. * must be defined for each control point. The outgoing tangents are defined for points [0, n - 2] and the incoming
  7867. * tangents are defined for points [1, n - 1]. For example, when interpolating a segment of the curve between <code>points[i]</code> and
  7868. * <code>points[i + 1]</code>, the tangents at the points will be <code>outTangents[i]</code> and <code>inTangents[i]</code>,
  7869. * respectively.
  7870. * @example
  7871. * // Create a G<sup>1</sup> continuous Hermite spline
  7872. * const times = [ 0.0, 1.5, 3.0, 4.5, 6.0 ];
  7873. * const spline = new Cesium.HermiteSpline({
  7874. * times : times,
  7875. * points : [
  7876. * new Cesium.Cartesian3(1235398.0, -4810983.0, 4146266.0),
  7877. * new Cesium.Cartesian3(1372574.0, -5345182.0, 4606657.0),
  7878. * new Cesium.Cartesian3(-757983.0, -5542796.0, 4514323.0),
  7879. * new Cesium.Cartesian3(-2821260.0, -5248423.0, 4021290.0),
  7880. * new Cesium.Cartesian3(-2539788.0, -4724797.0, 3620093.0)
  7881. * ],
  7882. * outTangents : [
  7883. * new Cesium.Cartesian3(1125196, -161816, 270551),
  7884. * new Cesium.Cartesian3(-996690.5, -365906.5, 184028.5),
  7885. * new Cesium.Cartesian3(-2096917, 48379.5, -292683.5),
  7886. * new Cesium.Cartesian3(-890902.5, 408999.5, -447115)
  7887. * ],
  7888. * inTangents : [
  7889. * new Cesium.Cartesian3(-1993381, -731813, 368057),
  7890. * new Cesium.Cartesian3(-4193834, 96759, -585367),
  7891. * new Cesium.Cartesian3(-1781805, 817999, -894230),
  7892. * new Cesium.Cartesian3(1165345, 112641, 47281)
  7893. * ]
  7894. * });
  7895. *
  7896. * const p0 = spline.evaluate(times[0]);
  7897. * @param options - Object with the following properties:
  7898. * @param options.times - An array of strictly increasing, unit-less, floating-point times at each point.
  7899. * The values are in no way connected to the clock time. They are the parameterization for the curve.
  7900. * @param options.points - The array of control points.
  7901. * @param options.inTangents - The array of incoming tangents at each control point.
  7902. * @param options.outTangents - The array of outgoing tangents at each control point.
  7903. */
  7904. export class HermiteSpline {
  7905. constructor(options: {
  7906. times: number[];
  7907. points: Cartesian3[];
  7908. inTangents: Cartesian3[];
  7909. outTangents: Cartesian3[];
  7910. });
  7911. /**
  7912. * An array of times for the control points.
  7913. */
  7914. readonly times: number[];
  7915. /**
  7916. * An array of control points.
  7917. */
  7918. readonly points: Cartesian3[];
  7919. /**
  7920. * An array of incoming tangents at each control point.
  7921. */
  7922. readonly inTangents: Cartesian3[];
  7923. /**
  7924. * An array of outgoing tangents at each control point.
  7925. */
  7926. readonly outTangents: Cartesian3[];
  7927. /**
  7928. * Creates a spline where the tangents at each control point are the same.
  7929. * The curves are guaranteed to be at least in the class C<sup>1</sup>.
  7930. * @example
  7931. * const points = [
  7932. * new Cesium.Cartesian3(1235398.0, -4810983.0, 4146266.0),
  7933. * new Cesium.Cartesian3(1372574.0, -5345182.0, 4606657.0),
  7934. * new Cesium.Cartesian3(-757983.0, -5542796.0, 4514323.0),
  7935. * new Cesium.Cartesian3(-2821260.0, -5248423.0, 4021290.0),
  7936. * new Cesium.Cartesian3(-2539788.0, -4724797.0, 3620093.0)
  7937. * ];
  7938. *
  7939. * // Add tangents
  7940. * const tangents = new Array(points.length);
  7941. * tangents[0] = new Cesium.Cartesian3(1125196, -161816, 270551);
  7942. * const temp = new Cesium.Cartesian3();
  7943. * for (let i = 1; i < tangents.length - 1; ++i) {
  7944. * tangents[i] = Cesium.Cartesian3.multiplyByScalar(Cesium.Cartesian3.subtract(points[i + 1], points[i - 1], temp), 0.5, new Cesium.Cartesian3());
  7945. * }
  7946. * tangents[tangents.length - 1] = new Cesium.Cartesian3(1165345, 112641, 47281);
  7947. *
  7948. * const spline = Cesium.HermiteSpline.createC1({
  7949. * times : times,
  7950. * points : points,
  7951. * tangents : tangents
  7952. * });
  7953. * @param options - Object with the following properties:
  7954. * @param options.times - The array of control point times.
  7955. * @param options.points - The array of control points.
  7956. * @param options.tangents - The array of tangents at the control points.
  7957. * @returns A hermite spline.
  7958. */
  7959. static createC1(options: {
  7960. times: number[];
  7961. points: Cartesian3[];
  7962. tangents: Cartesian3[];
  7963. }): HermiteSpline;
  7964. /**
  7965. * Creates a natural cubic spline. The tangents at the control points are generated
  7966. * to create a curve in the class C<sup>2</sup>.
  7967. * @example
  7968. * // Create a natural cubic spline above the earth from Philadelphia to Los Angeles.
  7969. * const spline = Cesium.HermiteSpline.createNaturalCubic({
  7970. * times : [ 0.0, 1.5, 3.0, 4.5, 6.0 ],
  7971. * points : [
  7972. * new Cesium.Cartesian3(1235398.0, -4810983.0, 4146266.0),
  7973. * new Cesium.Cartesian3(1372574.0, -5345182.0, 4606657.0),
  7974. * new Cesium.Cartesian3(-757983.0, -5542796.0, 4514323.0),
  7975. * new Cesium.Cartesian3(-2821260.0, -5248423.0, 4021290.0),
  7976. * new Cesium.Cartesian3(-2539788.0, -4724797.0, 3620093.0)
  7977. * ]
  7978. * });
  7979. * @param options - Object with the following properties:
  7980. * @param options.times - The array of control point times.
  7981. * @param options.points - The array of control points.
  7982. * @returns A hermite spline, or a linear spline if less than 3 control points were given.
  7983. */
  7984. static createNaturalCubic(options: {
  7985. times: number[];
  7986. points: Cartesian3[];
  7987. }): HermiteSpline | LinearSpline;
  7988. /**
  7989. * Creates a clamped cubic spline. The tangents at the interior control points are generated
  7990. * to create a curve in the class C<sup>2</sup>.
  7991. * @example
  7992. * // Create a clamped cubic spline above the earth from Philadelphia to Los Angeles.
  7993. * const spline = Cesium.HermiteSpline.createClampedCubic({
  7994. * times : [ 0.0, 1.5, 3.0, 4.5, 6.0 ],
  7995. * points : [
  7996. * new Cesium.Cartesian3(1235398.0, -4810983.0, 4146266.0),
  7997. * new Cesium.Cartesian3(1372574.0, -5345182.0, 4606657.0),
  7998. * new Cesium.Cartesian3(-757983.0, -5542796.0, 4514323.0),
  7999. * new Cesium.Cartesian3(-2821260.0, -5248423.0, 4021290.0),
  8000. * new Cesium.Cartesian3(-2539788.0, -4724797.0, 3620093.0)
  8001. * ],
  8002. * firstTangent : new Cesium.Cartesian3(1125196, -161816, 270551),
  8003. * lastTangent : new Cesium.Cartesian3(1165345, 112641, 47281)
  8004. * });
  8005. * @param options - Object with the following properties:
  8006. * @param options.times - The array of control point times.
  8007. * @param options.points - The array of control points.
  8008. * @param options.firstTangent - The outgoing tangent of the first control point.
  8009. * @param options.lastTangent - The incoming tangent of the last control point.
  8010. * @returns A hermite spline, or a linear spline if less than 3 control points were given.
  8011. */
  8012. static createClampedCubic(options: {
  8013. times: number[];
  8014. points: number[] | Cartesian3[];
  8015. firstTangent: Cartesian3;
  8016. lastTangent: Cartesian3;
  8017. }): HermiteSpline | LinearSpline;
  8018. /**
  8019. * Finds an index <code>i</code> in <code>times</code> such that the parameter
  8020. * <code>time</code> is in the interval <code>[times[i], times[i + 1]]</code>.
  8021. * @param time - The time.
  8022. * @returns The index for the element at the start of the interval.
  8023. */
  8024. findTimeInterval(time: number): number;
  8025. /**
  8026. * Wraps the given time to the period covered by the spline.
  8027. * @param time - The time.
  8028. * @returns The time, wrapped around to the updated animation.
  8029. */
  8030. wrapTime(time: number): number;
  8031. /**
  8032. * Clamps the given time to the period covered by the spline.
  8033. * @param time - The time.
  8034. * @returns The time, clamped to the animation period.
  8035. */
  8036. clampTime(time: number): number;
  8037. /**
  8038. * Evaluates the curve at a given time.
  8039. * @param time - The time at which to evaluate the curve.
  8040. * @param [result] - The object onto which to store the result.
  8041. * @returns The modified result parameter or a new instance of the point on the curve at the given time.
  8042. */
  8043. evaluate(time: number, result?: Cartesian3): Cartesian3;
  8044. }
  8045. /**
  8046. * Hilbert Order helper functions.
  8047. */
  8048. export namespace HilbertOrder { }
  8049. /**
  8050. * Constants for WebGL index datatypes. These corresponds to the
  8051. * <code>type</code> parameter of {@link http://www.khronos.org/opengles/sdk/docs/man/xhtml/glDrawElements.xml|drawElements}.
  8052. */
  8053. export enum IndexDatatype {
  8054. /**
  8055. * 8-bit unsigned byte corresponding to <code>UNSIGNED_BYTE</code> and the type
  8056. * of an element in <code>Uint8Array</code>.
  8057. */
  8058. UNSIGNED_BYTE = WebGLConstants.UNSIGNED_BYTE,
  8059. /**
  8060. * 16-bit unsigned short corresponding to <code>UNSIGNED_SHORT</code> and the type
  8061. * of an element in <code>Uint16Array</code>.
  8062. */
  8063. UNSIGNED_SHORT = WebGLConstants.UNSIGNED_SHORT,
  8064. /**
  8065. * 32-bit unsigned int corresponding to <code>UNSIGNED_INT</code> and the type
  8066. * of an element in <code>Uint32Array</code>.
  8067. */
  8068. UNSIGNED_INT = WebGLConstants.UNSIGNED_INT
  8069. }
  8070. export namespace InterpolationAlgorithm {
  8071. /**
  8072. * Gets the name of this interpolation algorithm.
  8073. */
  8074. var type: string;
  8075. /**
  8076. * Given the desired degree, returns the number of data points required for interpolation.
  8077. * @param degree - The desired degree of interpolation.
  8078. * @returns The number of required data points needed for the desired degree of interpolation.
  8079. */
  8080. function getRequiredDataPoints(degree: number): number;
  8081. /**
  8082. * Performs zero order interpolation.
  8083. * @param x - The independent variable for which the dependent variables will be interpolated.
  8084. * @param xTable - The array of independent variables to use to interpolate. The values
  8085. * in this array must be in increasing order and the same value must not occur twice in the array.
  8086. * @param yTable - The array of dependent variables to use to interpolate. For a set of three
  8087. * dependent values (p,q,w) at time 1 and time 2 this should be as follows: {p1, q1, w1, p2, q2, w2}.
  8088. * @param yStride - The number of dependent variable values in yTable corresponding to
  8089. * each independent variable value in xTable.
  8090. * @param [result] - An existing array into which to store the result.
  8091. * @returns The array of interpolated values, or the result parameter if one was provided.
  8092. */
  8093. function interpolateOrderZero(x: number, xTable: number[], yTable: number[], yStride: number, result?: number[]): number[];
  8094. /**
  8095. * Performs higher order interpolation. Not all interpolators need to support high-order interpolation,
  8096. * if this function remains undefined on implementing objects, interpolateOrderZero will be used instead.
  8097. * @param x - The independent variable for which the dependent variables will be interpolated.
  8098. * @param xTable - The array of independent variables to use to interpolate. The values
  8099. * in this array must be in increasing order and the same value must not occur twice in the array.
  8100. * @param yTable - The array of dependent variables to use to interpolate. For a set of three
  8101. * dependent values (p,q,w) at time 1 and time 2 this should be as follows: {p1, q1, w1, p2, q2, w2}.
  8102. * @param yStride - The number of dependent variable values in yTable corresponding to
  8103. * each independent variable value in xTable.
  8104. * @param inputOrder - The number of derivatives supplied for input.
  8105. * @param outputOrder - The number of derivatives desired for output.
  8106. * @param [result] - An existing array into which to store the result.
  8107. * @returns The array of interpolated values, or the result parameter if one was provided.
  8108. */
  8109. function interpolate(x: number, xTable: number[], yTable: number[], yStride: number, inputOrder: number, outputOrder: number, result?: number[]): number[];
  8110. }
  8111. /**
  8112. * The interface for interpolation algorithms.
  8113. */
  8114. export interface InterpolationAlgorithm {
  8115. }
  8116. /**
  8117. * This enumerated type is used in determining where, relative to the frustum, an
  8118. * object is located. The object can either be fully contained within the frustum (INSIDE),
  8119. * partially inside the frustum and partially outside (INTERSECTING), or somewhere entirely
  8120. * outside of the frustum's 6 planes (OUTSIDE).
  8121. */
  8122. export enum Intersect {
  8123. /**
  8124. * Represents that an object is not contained within the frustum.
  8125. */
  8126. OUTSIDE = -1,
  8127. /**
  8128. * Represents that an object intersects one of the frustum's planes.
  8129. */
  8130. INTERSECTING = 0,
  8131. /**
  8132. * Represents that an object is fully within the frustum.
  8133. */
  8134. INSIDE = 1
  8135. }
  8136. /**
  8137. * Functions for computing the intersection between geometries such as rays, planes, triangles, and ellipsoids.
  8138. */
  8139. export namespace IntersectionTests {
  8140. /**
  8141. * Computes the intersection of a ray and a plane.
  8142. * @param ray - The ray.
  8143. * @param plane - The plane.
  8144. * @param [result] - The object onto which to store the result.
  8145. * @returns The intersection point or undefined if there is no intersections.
  8146. */
  8147. function rayPlane(ray: Ray, plane: Plane, result?: Cartesian3): Cartesian3;
  8148. /**
  8149. * 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.
  8150. *
  8151. * Implements {@link https://cadxfem.org/inf/Fast%20MinimumStorage%20RayTriangle%20Intersection.pdf|
  8152. * Fast Minimum Storage Ray/Triangle Intersection} by Tomas Moller and Ben Trumbore.
  8153. * @param ray - The ray.
  8154. * @param p0 - The first vertex of the triangle.
  8155. * @param p1 - The second vertex of the triangle.
  8156. * @param p2 - The third vertex of the triangle.
  8157. * @param [cullBackFaces = false] - If <code>true</code>, will only compute an intersection with the front face of the triangle
  8158. * and return undefined for intersections with the back face.
  8159. * @returns The intersection as a parametric distance along the ray, or undefined if there is no intersection.
  8160. */
  8161. function rayTriangleParametric(ray: Ray, p0: Cartesian3, p1: Cartesian3, p2: Cartesian3, cullBackFaces?: boolean): number;
  8162. /**
  8163. * Computes the intersection of a ray and a triangle as a Cartesian3 coordinate.
  8164. *
  8165. * Implements {@link https://cadxfem.org/inf/Fast%20MinimumStorage%20RayTriangle%20Intersection.pdf|
  8166. * Fast Minimum Storage Ray/Triangle Intersection} by Tomas Moller and Ben Trumbore.
  8167. * @param ray - The ray.
  8168. * @param p0 - The first vertex of the triangle.
  8169. * @param p1 - The second vertex of the triangle.
  8170. * @param p2 - The third vertex of the triangle.
  8171. * @param [cullBackFaces = false] - If <code>true</code>, will only compute an intersection with the front face of the triangle
  8172. * and return undefined for intersections with the back face.
  8173. * @param [result] - The <code>Cartesian3</code> onto which to store the result.
  8174. * @returns The intersection point or undefined if there is no intersections.
  8175. */
  8176. function rayTriangle(ray: Ray, p0: Cartesian3, p1: Cartesian3, p2: Cartesian3, cullBackFaces?: boolean, result?: Cartesian3): Cartesian3;
  8177. /**
  8178. * Computes the intersection of a line segment and a triangle.
  8179. * @param v0 - The an end point of the line segment.
  8180. * @param v1 - The other end point of the line segment.
  8181. * @param p0 - The first vertex of the triangle.
  8182. * @param p1 - The second vertex of the triangle.
  8183. * @param p2 - The third vertex of the triangle.
  8184. * @param [cullBackFaces = false] - If <code>true</code>, will only compute an intersection with the front face of the triangle
  8185. * and return undefined for intersections with the back face.
  8186. * @param [result] - The <code>Cartesian3</code> onto which to store the result.
  8187. * @returns The intersection point or undefined if there is no intersections.
  8188. */
  8189. function lineSegmentTriangle(v0: Cartesian3, v1: Cartesian3, p0: Cartesian3, p1: Cartesian3, p2: Cartesian3, cullBackFaces?: boolean, result?: Cartesian3): Cartesian3;
  8190. /**
  8191. * Computes the intersection points of a ray with a sphere.
  8192. * @param ray - The ray.
  8193. * @param sphere - The sphere.
  8194. * @param [result] - The result onto which to store the result.
  8195. * @returns The interval containing scalar points along the ray or undefined if there are no intersections.
  8196. */
  8197. function raySphere(ray: Ray, sphere: BoundingSphere, result?: Interval): Interval;
  8198. /**
  8199. * Computes the intersection points of a line segment with a sphere.
  8200. * @param p0 - An end point of the line segment.
  8201. * @param p1 - The other end point of the line segment.
  8202. * @param sphere - The sphere.
  8203. * @param [result] - The result onto which to store the result.
  8204. * @returns The interval containing scalar points along the ray or undefined if there are no intersections.
  8205. */
  8206. function lineSegmentSphere(p0: Cartesian3, p1: Cartesian3, sphere: BoundingSphere, result?: Interval): Interval;
  8207. /**
  8208. * Computes the intersection points of a ray with an ellipsoid.
  8209. * @param ray - The ray.
  8210. * @param ellipsoid - The ellipsoid.
  8211. * @returns The interval containing scalar points along the ray or undefined if there are no intersections.
  8212. */
  8213. function rayEllipsoid(ray: Ray, ellipsoid: Ellipsoid): Interval;
  8214. /**
  8215. * Provides the point along the ray which is nearest to the ellipsoid.
  8216. * @param ray - The ray.
  8217. * @param ellipsoid - The ellipsoid.
  8218. * @returns The nearest planetodetic point on the ray.
  8219. */
  8220. function grazingAltitudeLocation(ray: Ray, ellipsoid: Ellipsoid): Cartesian3;
  8221. /**
  8222. * Computes the intersection of a line segment and a plane.
  8223. * @example
  8224. * const origin = Cesium.Cartesian3.fromDegrees(-75.59777, 40.03883);
  8225. * const normal = ellipsoid.geodeticSurfaceNormal(origin);
  8226. * const plane = Cesium.Plane.fromPointNormal(origin, normal);
  8227. *
  8228. * const p0 = new Cesium.Cartesian3(...);
  8229. * const p1 = new Cesium.Cartesian3(...);
  8230. *
  8231. * // find the intersection of the line segment from p0 to p1 and the tangent plane at origin.
  8232. * const intersection = Cesium.IntersectionTests.lineSegmentPlane(p0, p1, plane);
  8233. * @param endPoint0 - An end point of the line segment.
  8234. * @param endPoint1 - The other end point of the line segment.
  8235. * @param plane - The plane.
  8236. * @param [result] - The object onto which to store the result.
  8237. * @returns The intersection point or undefined if there is no intersection.
  8238. */
  8239. function lineSegmentPlane(endPoint0: Cartesian3, endPoint1: Cartesian3, plane: Plane, result?: Cartesian3): Cartesian3;
  8240. /**
  8241. * Computes the intersection of a triangle and a plane
  8242. * @example
  8243. * const origin = Cesium.Cartesian3.fromDegrees(-75.59777, 40.03883);
  8244. * const normal = ellipsoid.geodeticSurfaceNormal(origin);
  8245. * const plane = Cesium.Plane.fromPointNormal(origin, normal);
  8246. *
  8247. * const p0 = new Cesium.Cartesian3(...);
  8248. * const p1 = new Cesium.Cartesian3(...);
  8249. * const p2 = new Cesium.Cartesian3(...);
  8250. *
  8251. * // convert the triangle composed of points (p0, p1, p2) to three triangles that don't cross the plane
  8252. * const triangles = Cesium.IntersectionTests.trianglePlaneIntersection(p0, p1, p2, plane);
  8253. * @param p0 - First point of the triangle
  8254. * @param p1 - Second point of the triangle
  8255. * @param p2 - Third point of the triangle
  8256. * @param plane - Intersection plane
  8257. * @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)
  8258. */
  8259. function trianglePlaneIntersection(p0: Cartesian3, p1: Cartesian3, p2: Cartesian3, plane: Plane): any;
  8260. }
  8261. /**
  8262. * Contains functions for operating on 2D triangles.
  8263. */
  8264. export namespace Intersections2D {
  8265. /**
  8266. * Splits a 2D triangle at given axis-aligned threshold value and returns the resulting
  8267. * polygon on a given side of the threshold. The resulting polygon may have 0, 1, 2,
  8268. * 3, or 4 vertices.
  8269. * @example
  8270. * const result = Cesium.Intersections2D.clipTriangleAtAxisAlignedThreshold(0.5, false, 0.2, 0.6, 0.4);
  8271. * // result === [2, 0, -1, 1, 0, 0.25, -1, 1, 2, 0.5]
  8272. * @param threshold - The threshold coordinate value at which to clip the triangle.
  8273. * @param keepAbove - true to keep the portion of the triangle above the threshold, or false
  8274. * to keep the portion below.
  8275. * @param u0 - The coordinate of the first vertex in the triangle, in counter-clockwise order.
  8276. * @param u1 - The coordinate of the second vertex in the triangle, in counter-clockwise order.
  8277. * @param u2 - The coordinate of the third vertex in the triangle, in counter-clockwise order.
  8278. * @param [result] - The array into which to copy the result. If this parameter is not supplied,
  8279. * a new array is constructed and returned.
  8280. * @returns The polygon that results after the clip, specified as a list of
  8281. * vertices. The vertices are specified in counter-clockwise order.
  8282. * Each vertex is either an index from the existing list (identified as
  8283. * a 0, 1, or 2) or -1 indicating a new vertex not in the original triangle.
  8284. * For new vertices, the -1 is followed by three additional numbers: the
  8285. * index of each of the two original vertices forming the line segment that
  8286. * the new vertex lies on, and the fraction of the distance from the first
  8287. * vertex to the second one.
  8288. */
  8289. function clipTriangleAtAxisAlignedThreshold(threshold: number, keepAbove: boolean, u0: number, u1: number, u2: number, result?: number[]): number[];
  8290. /**
  8291. * Compute the barycentric coordinates of a 2D position within a 2D triangle.
  8292. * @example
  8293. * const result = Cesium.Intersections2D.computeBarycentricCoordinates(0.0, 0.0, 0.0, 1.0, -1, -0.5, 1, -0.5);
  8294. * // result === new Cesium.Cartesian3(1.0 / 3.0, 1.0 / 3.0, 1.0 / 3.0);
  8295. * @param x - The x coordinate of the position for which to find the barycentric coordinates.
  8296. * @param y - The y coordinate of the position for which to find the barycentric coordinates.
  8297. * @param x1 - The x coordinate of the triangle's first vertex.
  8298. * @param y1 - The y coordinate of the triangle's first vertex.
  8299. * @param x2 - The x coordinate of the triangle's second vertex.
  8300. * @param y2 - The y coordinate of the triangle's second vertex.
  8301. * @param x3 - The x coordinate of the triangle's third vertex.
  8302. * @param y3 - The y coordinate of the triangle's third vertex.
  8303. * @param [result] - The instance into to which to copy the result. If this parameter
  8304. * is undefined, a new instance is created and returned.
  8305. * @returns The barycentric coordinates of the position within the triangle.
  8306. */
  8307. function computeBarycentricCoordinates(x: number, y: number, x1: number, y1: number, x2: number, y2: number, x3: number, y3: number, result?: Cartesian3): Cartesian3;
  8308. /**
  8309. * Compute the intersection between 2 line segments
  8310. * @example
  8311. * const result = Cesium.Intersections2D.computeLineSegmentLineSegmentIntersection(0.0, 0.0, 0.0, 2.0, -1, 1, 1, 1);
  8312. * // result === new Cesium.Cartesian2(0.0, 1.0);
  8313. * @param x00 - The x coordinate of the first line's first vertex.
  8314. * @param y00 - The y coordinate of the first line's first vertex.
  8315. * @param x01 - The x coordinate of the first line's second vertex.
  8316. * @param y01 - The y coordinate of the first line's second vertex.
  8317. * @param x10 - The x coordinate of the second line's first vertex.
  8318. * @param y10 - The y coordinate of the second line's first vertex.
  8319. * @param x11 - The x coordinate of the second line's second vertex.
  8320. * @param y11 - The y coordinate of the second line's second vertex.
  8321. * @param [result] - The instance into to which to copy the result. If this parameter
  8322. * is undefined, a new instance is created and returned.
  8323. * @returns The intersection point, undefined if there is no intersection point or lines are coincident.
  8324. */
  8325. function computeLineSegmentLineSegmentIntersection(x00: number, y00: number, x01: number, y01: number, x10: number, y10: number, x11: number, y11: number, result?: Cartesian2): Cartesian2;
  8326. }
  8327. /**
  8328. * Represents the closed interval [start, stop].
  8329. * @param [start = 0.0] - The beginning of the interval.
  8330. * @param [stop = 0.0] - The end of the interval.
  8331. */
  8332. export class Interval {
  8333. constructor(start?: number, stop?: number);
  8334. /**
  8335. * The beginning of the interval.
  8336. */
  8337. start: number;
  8338. /**
  8339. * The end of the interval.
  8340. */
  8341. stop: number;
  8342. }
  8343. /**
  8344. * Default settings for accessing the Cesium ion API.
  8345. *
  8346. * An ion access token is only required if you are using any ion related APIs.
  8347. * A default access token is provided for evaluation purposes only.
  8348. * Sign up for a free ion account and get your own access token at {@link https://cesium.com}
  8349. */
  8350. export namespace Ion {
  8351. /**
  8352. * Gets or sets the default Cesium ion access token.
  8353. */
  8354. var defaultAccessToken: string;
  8355. /**
  8356. * Gets or sets the default Cesium ion server.
  8357. */
  8358. var defaultServer: string | Resource;
  8359. }
  8360. /**
  8361. * Provides geocoding through Cesium ion.
  8362. * @param options - Object with the following properties:
  8363. * @param options.scene - The scene
  8364. * @param [options.accessToken = Ion.defaultAccessToken] - The access token to use.
  8365. * @param [options.server = Ion.defaultServer] - The resource to the Cesium ion API server.
  8366. */
  8367. export class IonGeocoderService {
  8368. constructor(options: {
  8369. scene: Scene;
  8370. accessToken?: string;
  8371. server?: string | Resource;
  8372. });
  8373. /**
  8374. * @param query - The query to be sent to the geocoder service
  8375. * @param [type = GeocodeType.SEARCH] - The type of geocode to perform.
  8376. */
  8377. geocode(query: string, type?: GeocodeType): Promise<GeocoderService.Result[]>;
  8378. }
  8379. /**
  8380. * A {@link Resource} instance that encapsulates Cesium ion asset access.
  8381. * This object is normally not instantiated directly, use {@link IonResource.fromAssetId}.
  8382. * @param endpoint - The result of the Cesium ion asset endpoint service.
  8383. * @param endpointResource - The resource used to retreive the endpoint.
  8384. */
  8385. export class IonResource extends Resource {
  8386. constructor(endpoint: any, endpointResource: Resource);
  8387. /**
  8388. * Asynchronously creates an instance.
  8389. * @example
  8390. * //Load a Cesium3DTileset with asset ID of 124624234
  8391. * viewer.scene.primitives.add(new Cesium.Cesium3DTileset({ url: Cesium.IonResource.fromAssetId(124624234) }));
  8392. * @example
  8393. * //Load a CZML file with asset ID of 10890
  8394. * Cesium.IonResource.fromAssetId(10890)
  8395. * .then(function (resource) {
  8396. * viewer.dataSources.add(Cesium.CzmlDataSource.load(resource));
  8397. * });
  8398. * @param assetId - The Cesium ion asset id.
  8399. * @param [options] - An object with the following properties:
  8400. * @param [options.accessToken = Ion.defaultAccessToken] - The access token to use.
  8401. * @param [options.server = Ion.defaultServer] - The resource to the Cesium ion API server.
  8402. * @returns A Promise to am instance representing the Cesium ion Asset.
  8403. */
  8404. static fromAssetId(assetId: number, options?: {
  8405. accessToken?: string;
  8406. server?: string | Resource;
  8407. }): Promise<IonResource>;
  8408. /**
  8409. * Gets the credits required for attribution of the asset.
  8410. */
  8411. readonly credits: Credit[];
  8412. /**
  8413. * Duplicates a Resource instance.
  8414. * @param [result] - The object onto which to store the result.
  8415. * @returns The modified result parameter or a new Resource instance if one was not provided.
  8416. */
  8417. clone(result?: Resource): Resource;
  8418. /**
  8419. * Asynchronously loads the given image resource. Returns a promise that will resolve to
  8420. * 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
  8421. * {@link https://developer.mozilla.org/en-US/docs/Web/API/HTMLImageElement|Image} once loaded, or reject if the image failed to load.
  8422. * @example
  8423. * // load a single image asynchronously
  8424. * resource.fetchImage().then(function(image) {
  8425. * // use the loaded image
  8426. * }).catch(function(error) {
  8427. * // an error occurred
  8428. * });
  8429. *
  8430. * // load several images in parallel
  8431. * Promise.all([resource1.fetchImage(), resource2.fetchImage()]).then(function(images) {
  8432. * // images is an array containing all the loaded images
  8433. * });
  8434. * @param [options] - An object with the following properties.
  8435. * @param [options.preferBlob = false] - If true, we will load the image via a blob.
  8436. * @param [options.preferImageBitmap = false] - If true, image will be decoded during fetch and an <code>ImageBitmap</code> is returned.
  8437. * @param [options.flipY = false] - If true, image will be vertically flipped during decode. Only applies if the browser supports <code>createImageBitmap</code>.
  8438. * @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>.
  8439. * @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.
  8440. */
  8441. fetchImage(options?: {
  8442. preferBlob?: boolean;
  8443. preferImageBitmap?: boolean;
  8444. flipY?: boolean;
  8445. skipColorSpaceConversion?: boolean;
  8446. }): Promise<ImageBitmap | HTMLImageElement> | undefined;
  8447. }
  8448. /**
  8449. * Constants related to ISO8601 support.
  8450. */
  8451. export namespace Iso8601 {
  8452. /**
  8453. * A {@link JulianDate} representing the earliest time representable by an ISO8601 date.
  8454. * This is equivalent to the date string '0000-01-01T00:00:00Z'
  8455. */
  8456. const MINIMUM_VALUE: JulianDate;
  8457. /**
  8458. * A {@link JulianDate} representing the latest time representable by an ISO8601 date.
  8459. * This is equivalent to the date string '9999-12-31T24:00:00Z'
  8460. */
  8461. const MAXIMUM_VALUE: JulianDate;
  8462. /**
  8463. * A {@link TimeInterval} representing the largest interval representable by an ISO8601 interval.
  8464. * This is equivalent to the interval string '0000-01-01T00:00:00Z/9999-12-31T24:00:00Z'
  8465. */
  8466. const MAXIMUM_INTERVAL: TimeInterval;
  8467. }
  8468. /**
  8469. * Represents an astronomical Julian date, which is the number of days since noon on January 1, -4712 (4713 BC).
  8470. * For increased precision, this class stores the whole number part of the date and the seconds
  8471. * part of the date in separate components. In order to be safe for arithmetic and represent
  8472. * leap seconds, the date is always stored in the International Atomic Time standard
  8473. * {@link TimeStandard.TAI}.
  8474. * @param [julianDayNumber = 0.0] - The Julian Day Number representing the number of whole days. Fractional days will also be handled correctly.
  8475. * @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.
  8476. * @param [timeStandard = TimeStandard.UTC] - The time standard in which the first two parameters are defined.
  8477. */
  8478. export class JulianDate {
  8479. constructor(julianDayNumber?: number, secondsOfDay?: number, timeStandard?: TimeStandard);
  8480. /**
  8481. * Gets or sets the number of whole days.
  8482. */
  8483. dayNumber: number;
  8484. /**
  8485. * Gets or sets the number of seconds into the current day.
  8486. */
  8487. secondsOfDay: number;
  8488. /**
  8489. * Creates a new instance from a GregorianDate.
  8490. * @param date - A GregorianDate.
  8491. * @param [result] - An existing instance to use for the result.
  8492. * @returns The modified result parameter or a new instance if none was provided.
  8493. */
  8494. static fromGregorianDate(date: GregorianDate, result?: JulianDate): JulianDate;
  8495. /**
  8496. * Creates a new instance from a JavaScript Date.
  8497. * @param date - A JavaScript Date.
  8498. * @param [result] - An existing instance to use for the result.
  8499. * @returns The modified result parameter or a new instance if none was provided.
  8500. */
  8501. static fromDate(date: Date, result?: JulianDate): JulianDate;
  8502. /**
  8503. * Creates a new instance from a from an {@link http://en.wikipedia.org/wiki/ISO_8601|ISO 8601} date.
  8504. * This method is superior to <code>Date.parse</code> because it will handle all valid formats defined by the ISO 8601
  8505. * specification, including leap seconds and sub-millisecond times, which discarded by most JavaScript implementations.
  8506. * @param iso8601String - An ISO 8601 date.
  8507. * @param [result] - An existing instance to use for the result.
  8508. * @returns The modified result parameter or a new instance if none was provided.
  8509. */
  8510. static fromIso8601(iso8601String: string, result?: JulianDate): JulianDate;
  8511. /**
  8512. * Creates a new instance that represents the current system time.
  8513. * This is equivalent to calling <code>JulianDate.fromDate(new Date());</code>.
  8514. * @param [result] - An existing instance to use for the result.
  8515. * @returns The modified result parameter or a new instance if none was provided.
  8516. */
  8517. static now(result?: JulianDate): JulianDate;
  8518. /**
  8519. * Creates a {@link GregorianDate} from the provided instance.
  8520. * @param julianDate - The date to be converted.
  8521. * @param [result] - An existing instance to use for the result.
  8522. * @returns The modified result parameter or a new instance if none was provided.
  8523. */
  8524. static toGregorianDate(julianDate: JulianDate, result?: GregorianDate): GregorianDate;
  8525. /**
  8526. * Creates a JavaScript Date from the provided instance.
  8527. * Since JavaScript dates are only accurate to the nearest millisecond and
  8528. * cannot represent a leap second, consider using {@link JulianDate.toGregorianDate} instead.
  8529. * If the provided JulianDate is during a leap second, the previous second is used.
  8530. * @param julianDate - The date to be converted.
  8531. * @returns A new instance representing the provided date.
  8532. */
  8533. static toDate(julianDate: JulianDate): Date;
  8534. /**
  8535. * Creates an ISO8601 representation of the provided date.
  8536. * @param julianDate - The date to be converted.
  8537. * @param [precision] - The number of fractional digits used to represent the seconds component. By default, the most precise representation is used.
  8538. * @returns The ISO8601 representation of the provided date.
  8539. */
  8540. static toIso8601(julianDate: JulianDate, precision?: number): string;
  8541. /**
  8542. * Duplicates a JulianDate instance.
  8543. * @param julianDate - The date to duplicate.
  8544. * @param [result] - An existing instance to use for the result.
  8545. * @returns The modified result parameter or a new instance if none was provided. Returns undefined if julianDate is undefined.
  8546. */
  8547. static clone(julianDate: JulianDate, result?: JulianDate): JulianDate;
  8548. /**
  8549. * Compares two instances.
  8550. * @param left - The first instance.
  8551. * @param right - The second instance.
  8552. * @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.
  8553. */
  8554. static compare(left: JulianDate, right: JulianDate): number;
  8555. /**
  8556. * Compares two instances and returns <code>true</code> if they are equal, <code>false</code> otherwise.
  8557. * @param [left] - The first instance.
  8558. * @param [right] - The second instance.
  8559. * @returns <code>true</code> if the dates are equal; otherwise, <code>false</code>.
  8560. */
  8561. static equals(left?: JulianDate, right?: JulianDate): boolean;
  8562. /**
  8563. * Compares two instances and returns <code>true</code> if they are within <code>epsilon</code> seconds of
  8564. * each other. That is, in order for the dates to be considered equal (and for
  8565. * this function to return <code>true</code>), the absolute value of the difference between them, in
  8566. * seconds, must be less than <code>epsilon</code>.
  8567. * @param [left] - The first instance.
  8568. * @param [right] - The second instance.
  8569. * @param [epsilon = 0] - The maximum number of seconds that should separate the two instances.
  8570. * @returns <code>true</code> if the two dates are within <code>epsilon</code> seconds of each other; otherwise <code>false</code>.
  8571. */
  8572. static equalsEpsilon(left?: JulianDate, right?: JulianDate, epsilon?: number): boolean;
  8573. /**
  8574. * Computes the total number of whole and fractional days represented by the provided instance.
  8575. * @param julianDate - The date.
  8576. * @returns The Julian date as single floating point number.
  8577. */
  8578. static totalDays(julianDate: JulianDate): number;
  8579. /**
  8580. * Computes the difference in seconds between the provided instance.
  8581. * @param left - The first instance.
  8582. * @param right - The second instance.
  8583. * @returns The difference, in seconds, when subtracting <code>right</code> from <code>left</code>.
  8584. */
  8585. static secondsDifference(left: JulianDate, right: JulianDate): number;
  8586. /**
  8587. * Computes the difference in days between the provided instance.
  8588. * @param left - The first instance.
  8589. * @param right - The second instance.
  8590. * @returns The difference, in days, when subtracting <code>right</code> from <code>left</code>.
  8591. */
  8592. static daysDifference(left: JulianDate, right: JulianDate): number;
  8593. /**
  8594. * Computes the number of seconds the provided instance is ahead of UTC.
  8595. * @param julianDate - The date.
  8596. * @returns The number of seconds the provided instance is ahead of UTC
  8597. */
  8598. static computeTaiMinusUtc(julianDate: JulianDate): number;
  8599. /**
  8600. * Adds the provided number of seconds to the provided date instance.
  8601. * @param julianDate - The date.
  8602. * @param seconds - The number of seconds to add or subtract.
  8603. * @param result - An existing instance to use for the result.
  8604. * @returns The modified result parameter.
  8605. */
  8606. static addSeconds(julianDate: JulianDate, seconds: number, result: JulianDate): JulianDate;
  8607. /**
  8608. * Adds the provided number of minutes to the provided date instance.
  8609. * @param julianDate - The date.
  8610. * @param minutes - The number of minutes to add or subtract.
  8611. * @param result - An existing instance to use for the result.
  8612. * @returns The modified result parameter.
  8613. */
  8614. static addMinutes(julianDate: JulianDate, minutes: number, result: JulianDate): JulianDate;
  8615. /**
  8616. * Adds the provided number of hours to the provided date instance.
  8617. * @param julianDate - The date.
  8618. * @param hours - The number of hours to add or subtract.
  8619. * @param result - An existing instance to use for the result.
  8620. * @returns The modified result parameter.
  8621. */
  8622. static addHours(julianDate: JulianDate, hours: number, result: JulianDate): JulianDate;
  8623. /**
  8624. * Adds the provided number of days to the provided date instance.
  8625. * @param julianDate - The date.
  8626. * @param days - The number of days to add or subtract.
  8627. * @param result - An existing instance to use for the result.
  8628. * @returns The modified result parameter.
  8629. */
  8630. static addDays(julianDate: JulianDate, days: number, result: JulianDate): JulianDate;
  8631. /**
  8632. * Compares the provided instances and returns <code>true</code> if <code>left</code> is earlier than <code>right</code>, <code>false</code> otherwise.
  8633. * @param left - The first instance.
  8634. * @param right - The second instance.
  8635. * @returns <code>true</code> if <code>left</code> is earlier than <code>right</code>, <code>false</code> otherwise.
  8636. */
  8637. static lessThan(left: JulianDate, right: JulianDate): boolean;
  8638. /**
  8639. * 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.
  8640. * @param left - The first instance.
  8641. * @param right - The second instance.
  8642. * @returns <code>true</code> if <code>left</code> is earlier than or equal to <code>right</code>, <code>false</code> otherwise.
  8643. */
  8644. static lessThanOrEquals(left: JulianDate, right: JulianDate): boolean;
  8645. /**
  8646. * Compares the provided instances and returns <code>true</code> if <code>left</code> is later than <code>right</code>, <code>false</code> otherwise.
  8647. * @param left - The first instance.
  8648. * @param right - The second instance.
  8649. * @returns <code>true</code> if <code>left</code> is later than <code>right</code>, <code>false</code> otherwise.
  8650. */
  8651. static greaterThan(left: JulianDate, right: JulianDate): boolean;
  8652. /**
  8653. * 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.
  8654. * @param left - The first instance.
  8655. * @param right - The second instance.
  8656. * @returns <code>true</code> if <code>left</code> is later than or equal to <code>right</code>, <code>false</code> otherwise.
  8657. */
  8658. static greaterThanOrEquals(left: JulianDate, right: JulianDate): boolean;
  8659. /**
  8660. * Duplicates this instance.
  8661. * @param [result] - An existing instance to use for the result.
  8662. * @returns The modified result parameter or a new instance if none was provided.
  8663. */
  8664. clone(result?: JulianDate): JulianDate;
  8665. /**
  8666. * Compares this and the provided instance and returns <code>true</code> if they are equal, <code>false</code> otherwise.
  8667. * @param [right] - The second instance.
  8668. * @returns <code>true</code> if the dates are equal; otherwise, <code>false</code>.
  8669. */
  8670. equals(right?: JulianDate): boolean;
  8671. /**
  8672. * Compares this and the provided instance and returns <code>true</code> if they are within <code>epsilon</code> seconds of
  8673. * each other. That is, in order for the dates to be considered equal (and for
  8674. * this function to return <code>true</code>), the absolute value of the difference between them, in
  8675. * seconds, must be less than <code>epsilon</code>.
  8676. * @param [right] - The second instance.
  8677. * @param [epsilon = 0] - The maximum number of seconds that should separate the two instances.
  8678. * @returns <code>true</code> if the two dates are within <code>epsilon</code> seconds of each other; otherwise <code>false</code>.
  8679. */
  8680. equalsEpsilon(right?: JulianDate, epsilon?: number): boolean;
  8681. /**
  8682. * Creates a string representing this date in ISO8601 format.
  8683. * @returns A string representing this date in ISO8601 format.
  8684. */
  8685. toString(): string;
  8686. /**
  8687. * Gets or sets the list of leap seconds used throughout Cesium.
  8688. */
  8689. static leapSeconds: LeapSecond[];
  8690. }
  8691. /**
  8692. * This enumerated type is for representing keyboard modifiers. These are keys
  8693. * that are held down in addition to other event types.
  8694. */
  8695. export enum KeyboardEventModifier {
  8696. /**
  8697. * Represents the shift key being held down.
  8698. */
  8699. SHIFT = 0,
  8700. /**
  8701. * Represents the control key being held down.
  8702. */
  8703. CTRL = 1,
  8704. /**
  8705. * Represents the alt key being held down.
  8706. */
  8707. ALT = 2
  8708. }
  8709. /**
  8710. * An {@link InterpolationAlgorithm} for performing Lagrange interpolation.
  8711. */
  8712. export namespace LagrangePolynomialApproximation {
  8713. /**
  8714. * Given the desired degree, returns the number of data points required for interpolation.
  8715. * @param degree - The desired degree of interpolation.
  8716. * @returns The number of required data points needed for the desired degree of interpolation.
  8717. */
  8718. function getRequiredDataPoints(degree: number): number;
  8719. /**
  8720. * Interpolates values using Lagrange Polynomial Approximation.
  8721. * @param x - The independent variable for which the dependent variables will be interpolated.
  8722. * @param xTable - The array of independent variables to use to interpolate. The values
  8723. * in this array must be in increasing order and the same value must not occur twice in the array.
  8724. * @param yTable - The array of dependent variables to use to interpolate. For a set of three
  8725. * dependent values (p,q,w) at time 1 and time 2 this should be as follows: {p1, q1, w1, p2, q2, w2}.
  8726. * @param yStride - The number of dependent variable values in yTable corresponding to
  8727. * each independent variable value in xTable.
  8728. * @param [result] - An existing array into which to store the result.
  8729. * @returns The array of interpolated values, or the result parameter if one was provided.
  8730. */
  8731. function interpolateOrderZero(x: number, xTable: number[], yTable: number[], yStride: number, result?: number[]): number[];
  8732. }
  8733. /**
  8734. * Describes a single leap second, which is constructed from a {@link JulianDate} and a
  8735. * numerical offset representing the number of seconds TAI is ahead of the UTC time standard.
  8736. * @param [date] - A Julian date representing the time of the leap second.
  8737. * @param [offset] - The cumulative number of seconds that TAI is ahead of UTC at the provided date.
  8738. */
  8739. export class LeapSecond {
  8740. constructor(date?: JulianDate, offset?: number);
  8741. /**
  8742. * Gets or sets the date at which this leap second occurs.
  8743. */
  8744. julianDate: JulianDate;
  8745. /**
  8746. * Gets or sets the cumulative number of seconds between the UTC and TAI time standards at the time
  8747. * of this leap second.
  8748. */
  8749. offset: number;
  8750. }
  8751. /**
  8752. * An {@link InterpolationAlgorithm} for performing linear interpolation.
  8753. */
  8754. export namespace LinearApproximation {
  8755. /**
  8756. * Given the desired degree, returns the number of data points required for interpolation.
  8757. * Since linear interpolation can only generate a first degree polynomial, this function
  8758. * always returns 2.
  8759. * @param degree - The desired degree of interpolation.
  8760. * @returns This function always returns 2.
  8761. */
  8762. function getRequiredDataPoints(degree: number): number;
  8763. /**
  8764. * Interpolates values using linear approximation.
  8765. * @param x - The independent variable for which the dependent variables will be interpolated.
  8766. * @param xTable - The array of independent variables to use to interpolate. The values
  8767. * in this array must be in increasing order and the same value must not occur twice in the array.
  8768. * @param yTable - The array of dependent variables to use to interpolate. For a set of three
  8769. * dependent values (p,q,w) at time 1 and time 2 this should be as follows: {p1, q1, w1, p2, q2, w2}.
  8770. * @param yStride - The number of dependent variable values in yTable corresponding to
  8771. * each independent variable value in xTable.
  8772. * @param [result] - An existing array into which to store the result.
  8773. * @returns The array of interpolated values, or the result parameter if one was provided.
  8774. */
  8775. function interpolateOrderZero(x: number, xTable: number[], yTable: number[], yStride: number, result?: number[]): number[];
  8776. }
  8777. /**
  8778. * A spline that uses piecewise linear interpolation to create a curve.
  8779. * @example
  8780. * const times = [ 0.0, 1.5, 3.0, 4.5, 6.0 ];
  8781. * const spline = new Cesium.LinearSpline({
  8782. * times : times,
  8783. * points : [
  8784. * new Cesium.Cartesian3(1235398.0, -4810983.0, 4146266.0),
  8785. * new Cesium.Cartesian3(1372574.0, -5345182.0, 4606657.0),
  8786. * new Cesium.Cartesian3(-757983.0, -5542796.0, 4514323.0),
  8787. * new Cesium.Cartesian3(-2821260.0, -5248423.0, 4021290.0),
  8788. * new Cesium.Cartesian3(-2539788.0, -4724797.0, 3620093.0)
  8789. * ]
  8790. * });
  8791. *
  8792. * const p0 = spline.evaluate(times[0]);
  8793. * @param options - Object with the following properties:
  8794. * @param options.times - An array of strictly increasing, unit-less, floating-point times at each point.
  8795. * The values are in no way connected to the clock time. They are the parameterization for the curve.
  8796. * @param options.points - The array of control points.
  8797. */
  8798. export class LinearSpline {
  8799. constructor(options: {
  8800. times: number[];
  8801. points: number[] | Cartesian3[];
  8802. });
  8803. /**
  8804. * An array of times for the control points.
  8805. */
  8806. readonly times: number[];
  8807. /**
  8808. * An array of {@link Cartesian3} control points.
  8809. */
  8810. readonly points: number[] | Cartesian3[];
  8811. /**
  8812. * Finds an index <code>i</code> in <code>times</code> such that the parameter
  8813. * <code>time</code> is in the interval <code>[times[i], times[i + 1]]</code>.
  8814. * @param time - The time.
  8815. * @returns The index for the element at the start of the interval.
  8816. */
  8817. findTimeInterval(time: number): number;
  8818. /**
  8819. * Wraps the given time to the period covered by the spline.
  8820. * @param time - The time.
  8821. * @returns The time, wrapped around to the updated animation.
  8822. */
  8823. wrapTime(time: number): number;
  8824. /**
  8825. * Clamps the given time to the period covered by the spline.
  8826. * @param time - The time.
  8827. * @returns The time, clamped to the animation period.
  8828. */
  8829. clampTime(time: number): number;
  8830. /**
  8831. * Evaluates the curve at a given time.
  8832. * @param time - The time at which to evaluate the curve.
  8833. * @param [result] - The object onto which to store the result.
  8834. * @returns The modified result parameter or a new instance of the point on the curve at the given time.
  8835. */
  8836. evaluate(time: number, result?: Cartesian3): number | Cartesian3;
  8837. }
  8838. /**
  8839. * Defines how geodetic ellipsoid coordinates ({@link Cartographic}) project to a
  8840. * flat map like Cesium's 2D and Columbus View modes.
  8841. */
  8842. export class MapProjection {
  8843. constructor();
  8844. /**
  8845. * Gets the {@link Ellipsoid}.
  8846. */
  8847. readonly ellipsoid: Ellipsoid;
  8848. /**
  8849. * Projects {@link Cartographic} coordinates, in radians, to projection-specific map coordinates, in meters.
  8850. * @param cartographic - The coordinates to project.
  8851. * @param [result] - An instance into which to copy the result. If this parameter is
  8852. * undefined, a new instance is created and returned.
  8853. * @returns The projected coordinates. If the result parameter is not undefined, the
  8854. * coordinates are copied there and that instance is returned. Otherwise, a new instance is
  8855. * created and returned.
  8856. */
  8857. project(cartographic: Cartographic, result?: Cartesian3): Cartesian3;
  8858. /**
  8859. * Unprojects projection-specific map {@link Cartesian3} coordinates, in meters, to {@link Cartographic}
  8860. * coordinates, in radians.
  8861. * @param cartesian - The Cartesian position to unproject with height (z) in meters.
  8862. * @param [result] - An instance into which to copy the result. If this parameter is
  8863. * undefined, a new instance is created and returned.
  8864. * @returns The unprojected coordinates. If the result parameter is not undefined, the
  8865. * coordinates are copied there and that instance is returned. Otherwise, a new instance is
  8866. * created and returned.
  8867. */
  8868. unproject(cartesian: Cartesian3, result?: Cartographic): Cartographic;
  8869. }
  8870. /**
  8871. * Math functions.
  8872. */
  8873. export namespace Math {
  8874. /**
  8875. * 0.1
  8876. */
  8877. const EPSILON1 = 0.1;
  8878. /**
  8879. * 0.01
  8880. */
  8881. const EPSILON2 = 0.01;
  8882. /**
  8883. * 0.001
  8884. */
  8885. const EPSILON3 = 0.001;
  8886. /**
  8887. * 0.0001
  8888. */
  8889. const EPSILON4 = 0.0001;
  8890. /**
  8891. * 0.00001
  8892. */
  8893. const EPSILON5 = 0.00001;
  8894. /**
  8895. * 0.000001
  8896. */
  8897. const EPSILON6 = 0.000001;
  8898. /**
  8899. * 0.0000001
  8900. */
  8901. const EPSILON7 = 1e-7;
  8902. /**
  8903. * 0.00000001
  8904. */
  8905. const EPSILON8 = 1e-8;
  8906. /**
  8907. * 0.000000001
  8908. */
  8909. const EPSILON9 = 1e-9;
  8910. /**
  8911. * 0.0000000001
  8912. */
  8913. const EPSILON10 = 1e-10;
  8914. /**
  8915. * 0.00000000001
  8916. */
  8917. const EPSILON11 = 1e-11;
  8918. /**
  8919. * 0.000000000001
  8920. */
  8921. const EPSILON12 = 1e-12;
  8922. /**
  8923. * 0.0000000000001
  8924. */
  8925. const EPSILON13 = 1e-13;
  8926. /**
  8927. * 0.00000000000001
  8928. */
  8929. const EPSILON14 = 1e-14;
  8930. /**
  8931. * 0.000000000000001
  8932. */
  8933. const EPSILON15 = 1e-15;
  8934. /**
  8935. * 0.0000000000000001
  8936. */
  8937. const EPSILON16 = 1e-16;
  8938. /**
  8939. * 0.00000000000000001
  8940. */
  8941. const EPSILON17 = 1e-17;
  8942. /**
  8943. * 0.000000000000000001
  8944. */
  8945. const EPSILON18 = 1e-18;
  8946. /**
  8947. * 0.0000000000000000001
  8948. */
  8949. const EPSILON19 = 1e-19;
  8950. /**
  8951. * 0.00000000000000000001
  8952. */
  8953. const EPSILON20 = 1e-20;
  8954. /**
  8955. * 0.000000000000000000001
  8956. */
  8957. const EPSILON21 = 1e-21;
  8958. /**
  8959. * The gravitational parameter of the Earth in meters cubed
  8960. * per second squared as defined by the WGS84 model: 3.986004418e14
  8961. */
  8962. const GRAVITATIONALPARAMETER = 398600441800000;
  8963. /**
  8964. * Radius of the sun in meters: 6.955e8
  8965. */
  8966. const SOLAR_RADIUS = 695500000;
  8967. /**
  8968. * The mean radius of the moon, according to the "Report of the IAU/IAG Working Group on
  8969. * Cartographic Coordinates and Rotational Elements of the Planets and satellites: 2000",
  8970. * Celestial Mechanics 82: 83-110, 2002.
  8971. */
  8972. const LUNAR_RADIUS = 1737400;
  8973. /**
  8974. * 64 * 1024
  8975. */
  8976. const SIXTY_FOUR_KILOBYTES: number;
  8977. /**
  8978. * 4 * 1024 * 1024 * 1024
  8979. */
  8980. const FOUR_GIGABYTES: number;
  8981. /**
  8982. * Returns the sign of the value; 1 if the value is positive, -1 if the value is
  8983. * negative, or 0 if the value is 0.
  8984. * @param value - The value to return the sign of.
  8985. * @returns The sign of value.
  8986. */
  8987. function sign(value: number): number;
  8988. /**
  8989. * Returns 1.0 if the given value is positive or zero, and -1.0 if it is negative.
  8990. * This is similar to {@link Math#sign} except that returns 1.0 instead of
  8991. * 0.0 when the input value is 0.0.
  8992. * @param value - The value to return the sign of.
  8993. * @returns The sign of value.
  8994. */
  8995. function signNotZero(value: number): number;
  8996. /**
  8997. * Converts a scalar value in the range [-1.0, 1.0] to a SNORM in the range [0, rangeMaximum]
  8998. * @param value - The scalar value in the range [-1.0, 1.0]
  8999. * @param [rangeMaximum = 255] - The maximum value in the mapped range, 255 by default.
  9000. * @returns A SNORM value, where 0 maps to -1.0 and rangeMaximum maps to 1.0.
  9001. */
  9002. function toSNorm(value: number, rangeMaximum?: number): number;
  9003. /**
  9004. * Converts a SNORM value in the range [0, rangeMaximum] to a scalar in the range [-1.0, 1.0].
  9005. * @param value - SNORM value in the range [0, rangeMaximum]
  9006. * @param [rangeMaximum = 255] - The maximum value in the SNORM range, 255 by default.
  9007. * @returns Scalar in the range [-1.0, 1.0].
  9008. */
  9009. function fromSNorm(value: number, rangeMaximum?: number): number;
  9010. /**
  9011. * Converts a scalar value in the range [rangeMinimum, rangeMaximum] to a scalar in the range [0.0, 1.0]
  9012. * @param value - The scalar value in the range [rangeMinimum, rangeMaximum]
  9013. * @param rangeMinimum - The minimum value in the mapped range.
  9014. * @param rangeMaximum - The maximum value in the mapped range.
  9015. * @returns A scalar value, where rangeMinimum maps to 0.0 and rangeMaximum maps to 1.0.
  9016. */
  9017. function normalize(value: number, rangeMinimum: number, rangeMaximum: number): number;
  9018. /**
  9019. * Returns the hyperbolic sine of a number.
  9020. * The hyperbolic sine of <em>value</em> is defined to be
  9021. * (<em>e<sup>x</sup>&nbsp;-&nbsp;e<sup>-x</sup></em>)/2.0
  9022. * where <i>e</i> is Euler's number, approximately 2.71828183.
  9023. *
  9024. * <p>Special cases:
  9025. * <ul>
  9026. * <li>If the argument is NaN, then the result is NaN.</li>
  9027. *
  9028. * <li>If the argument is infinite, then the result is an infinity
  9029. * with the same sign as the argument.</li>
  9030. *
  9031. * <li>If the argument is zero, then the result is a zero with the
  9032. * same sign as the argument.</li>
  9033. * </ul>
  9034. * </p>
  9035. * @param value - The number whose hyperbolic sine is to be returned.
  9036. * @returns The hyperbolic sine of <code>value</code>.
  9037. */
  9038. function sinh(value: number): number;
  9039. /**
  9040. * Returns the hyperbolic cosine of a number.
  9041. * The hyperbolic cosine of <strong>value</strong> is defined to be
  9042. * (<em>e<sup>x</sup>&nbsp;+&nbsp;e<sup>-x</sup></em>)/2.0
  9043. * where <i>e</i> is Euler's number, approximately 2.71828183.
  9044. *
  9045. * <p>Special cases:
  9046. * <ul>
  9047. * <li>If the argument is NaN, then the result is NaN.</li>
  9048. *
  9049. * <li>If the argument is infinite, then the result is positive infinity.</li>
  9050. *
  9051. * <li>If the argument is zero, then the result is 1.0.</li>
  9052. * </ul>
  9053. * </p>
  9054. * @param value - The number whose hyperbolic cosine is to be returned.
  9055. * @returns The hyperbolic cosine of <code>value</code>.
  9056. */
  9057. function cosh(value: number): number;
  9058. /**
  9059. * Computes the linear interpolation of two values.
  9060. * @example
  9061. * const n = Cesium.Math.lerp(0.0, 2.0, 0.5); // returns 1.0
  9062. * @param p - The start value to interpolate.
  9063. * @param q - The end value to interpolate.
  9064. * @param time - The time of interpolation generally in the range <code>[0.0, 1.0]</code>.
  9065. * @returns The linearly interpolated value.
  9066. */
  9067. function lerp(p: number, q: number, time: number): number;
  9068. /**
  9069. * pi
  9070. */
  9071. const PI: number;
  9072. /**
  9073. * 1/pi
  9074. */
  9075. const ONE_OVER_PI: number;
  9076. /**
  9077. * pi/2
  9078. */
  9079. const PI_OVER_TWO: number;
  9080. /**
  9081. * pi/3
  9082. */
  9083. const PI_OVER_THREE: number;
  9084. /**
  9085. * pi/4
  9086. */
  9087. const PI_OVER_FOUR: number;
  9088. /**
  9089. * pi/6
  9090. */
  9091. const PI_OVER_SIX: number;
  9092. /**
  9093. * 3pi/2
  9094. */
  9095. const THREE_PI_OVER_TWO: number;
  9096. /**
  9097. * 2pi
  9098. */
  9099. const TWO_PI: number;
  9100. /**
  9101. * 1/2pi
  9102. */
  9103. const ONE_OVER_TWO_PI: number;
  9104. /**
  9105. * The number of radians in a degree.
  9106. */
  9107. const RADIANS_PER_DEGREE: number;
  9108. /**
  9109. * The number of degrees in a radian.
  9110. */
  9111. const DEGREES_PER_RADIAN: number;
  9112. /**
  9113. * The number of radians in an arc second.
  9114. */
  9115. const RADIANS_PER_ARCSECOND: number;
  9116. /**
  9117. * Converts degrees to radians.
  9118. * @param degrees - The angle to convert in degrees.
  9119. * @returns The corresponding angle in radians.
  9120. */
  9121. function toRadians(degrees: number): number;
  9122. /**
  9123. * Converts radians to degrees.
  9124. * @param radians - The angle to convert in radians.
  9125. * @returns The corresponding angle in degrees.
  9126. */
  9127. function toDegrees(radians: number): number;
  9128. /**
  9129. * Converts a longitude value, in radians, to the range [<code>-Math.PI</code>, <code>Math.PI</code>).
  9130. * @example
  9131. * // Convert 270 degrees to -90 degrees longitude
  9132. * const longitude = Cesium.Math.convertLongitudeRange(Cesium.Math.toRadians(270.0));
  9133. * @param angle - The longitude value, in radians, to convert to the range [<code>-Math.PI</code>, <code>Math.PI</code>).
  9134. * @returns The equivalent longitude value in the range [<code>-Math.PI</code>, <code>Math.PI</code>).
  9135. */
  9136. function convertLongitudeRange(angle: number): number;
  9137. /**
  9138. * Convenience function that clamps a latitude value, in radians, to the range [<code>-Math.PI/2</code>, <code>Math.PI/2</code>).
  9139. * Useful for sanitizing data before use in objects requiring correct range.
  9140. * @example
  9141. * // Clamp 108 degrees latitude to 90 degrees latitude
  9142. * const latitude = Cesium.Math.clampToLatitudeRange(Cesium.Math.toRadians(108.0));
  9143. * @param angle - The latitude value, in radians, to clamp to the range [<code>-Math.PI/2</code>, <code>Math.PI/2</code>).
  9144. * @returns The latitude value clamped to the range [<code>-Math.PI/2</code>, <code>Math.PI/2</code>).
  9145. */
  9146. function clampToLatitudeRange(angle: number): number;
  9147. /**
  9148. * Produces an angle in the range -Pi <= angle <= Pi which is equivalent to the provided angle.
  9149. * @param angle - in radians
  9150. * @returns The angle in the range [<code>-Math.PI</code>, <code>Math.PI</code>].
  9151. */
  9152. function negativePiToPi(angle: number): number;
  9153. /**
  9154. * Produces an angle in the range 0 <= angle <= 2Pi which is equivalent to the provided angle.
  9155. * @param angle - in radians
  9156. * @returns The angle in the range [0, <code>Math.TWO_PI</code>].
  9157. */
  9158. function zeroToTwoPi(angle: number): number;
  9159. /**
  9160. * The modulo operation that also works for negative dividends.
  9161. * @param m - The dividend.
  9162. * @param n - The divisor.
  9163. * @returns The remainder.
  9164. */
  9165. function mod(m: number, n: number): number;
  9166. /**
  9167. * Determines if two values are equal using an absolute or relative tolerance test. This is useful
  9168. * to avoid problems due to roundoff error when comparing floating-point values directly. The values are
  9169. * first compared using an absolute tolerance test. If that fails, a relative tolerance test is performed.
  9170. * Use this test if you are unsure of the magnitudes of left and right.
  9171. * @example
  9172. * const a = Cesium.Math.equalsEpsilon(0.0, 0.01, Cesium.Math.EPSILON2); // true
  9173. * const b = Cesium.Math.equalsEpsilon(0.0, 0.1, Cesium.Math.EPSILON2); // false
  9174. * const c = Cesium.Math.equalsEpsilon(3699175.1634344, 3699175.2, Cesium.Math.EPSILON7); // true
  9175. * const d = Cesium.Math.equalsEpsilon(3699175.1634344, 3699175.2, Cesium.Math.EPSILON9); // false
  9176. * @param left - The first value to compare.
  9177. * @param right - The other value to compare.
  9178. * @param [relativeEpsilon = 0] - The maximum inclusive delta between <code>left</code> and <code>right</code> for the relative tolerance test.
  9179. * @param [absoluteEpsilon = relativeEpsilon] - The maximum inclusive delta between <code>left</code> and <code>right</code> for the absolute tolerance test.
  9180. * @returns <code>true</code> if the values are equal within the epsilon; otherwise, <code>false</code>.
  9181. */
  9182. function equalsEpsilon(left: number, right: number, relativeEpsilon?: number, absoluteEpsilon?: number): boolean;
  9183. /**
  9184. * Determines if the left value is less than the right value. If the two values are within
  9185. * <code>absoluteEpsilon</code> of each other, they are considered equal and this function returns false.
  9186. * @param left - The first number to compare.
  9187. * @param right - The second number to compare.
  9188. * @param absoluteEpsilon - The absolute epsilon to use in comparison.
  9189. * @returns <code>true</code> if <code>left</code> is less than <code>right</code> by more than
  9190. * <code>absoluteEpsilon<code>. <code>false</code> if <code>left</code> is greater or if the two
  9191. * values are nearly equal.
  9192. */
  9193. function lessThan(left: number, right: number, absoluteEpsilon: number): boolean;
  9194. /**
  9195. * Determines if the left value is less than or equal to the right value. If the two values are within
  9196. * <code>absoluteEpsilon</code> of each other, they are considered equal and this function returns true.
  9197. * @param left - The first number to compare.
  9198. * @param right - The second number to compare.
  9199. * @param absoluteEpsilon - The absolute epsilon to use in comparison.
  9200. * @returns <code>true</code> if <code>left</code> is less than <code>right</code> or if the
  9201. * the values are nearly equal.
  9202. */
  9203. function lessThanOrEquals(left: number, right: number, absoluteEpsilon: number): boolean;
  9204. /**
  9205. * Determines if the left value is greater the right value. If the two values are within
  9206. * <code>absoluteEpsilon</code> of each other, they are considered equal and this function returns false.
  9207. * @param left - The first number to compare.
  9208. * @param right - The second number to compare.
  9209. * @param absoluteEpsilon - The absolute epsilon to use in comparison.
  9210. * @returns <code>true</code> if <code>left</code> is greater than <code>right</code> by more than
  9211. * <code>absoluteEpsilon<code>. <code>false</code> if <code>left</code> is less or if the two
  9212. * values are nearly equal.
  9213. */
  9214. function greaterThan(left: number, right: number, absoluteEpsilon: number): boolean;
  9215. /**
  9216. * Determines if the left value is greater than or equal to the right value. If the two values are within
  9217. * <code>absoluteEpsilon</code> of each other, they are considered equal and this function returns true.
  9218. * @param left - The first number to compare.
  9219. * @param right - The second number to compare.
  9220. * @param absoluteEpsilon - The absolute epsilon to use in comparison.
  9221. * @returns <code>true</code> if <code>left</code> is greater than <code>right</code> or if the
  9222. * the values are nearly equal.
  9223. */
  9224. function greaterThanOrEquals(left: number, right: number, absoluteEpsilon: number): boolean;
  9225. /**
  9226. * Computes the factorial of the provided number.
  9227. * @example
  9228. * //Compute 7!, which is equal to 5040
  9229. * const computedFactorial = Cesium.Math.factorial(7);
  9230. * @param n - The number whose factorial is to be computed.
  9231. * @returns The factorial of the provided number or undefined if the number is less than 0.
  9232. */
  9233. function factorial(n: number): number;
  9234. /**
  9235. * Increments a number with a wrapping to a minimum value if the number exceeds the maximum value.
  9236. * @example
  9237. * const n = Cesium.Math.incrementWrap(5, 10, 0); // returns 6
  9238. * const m = Cesium.Math.incrementWrap(10, 10, 0); // returns 0
  9239. * @param [n] - The number to be incremented.
  9240. * @param [maximumValue] - The maximum incremented value before rolling over to the minimum value.
  9241. * @param [minimumValue = 0.0] - The number reset to after the maximum value has been exceeded.
  9242. * @returns The incremented number.
  9243. */
  9244. function incrementWrap(n?: number, maximumValue?: number, minimumValue?: number): number;
  9245. /**
  9246. * Determines if a non-negative integer is a power of two.
  9247. * The maximum allowed input is (2^32)-1 due to 32-bit bitwise operator limitation in Javascript.
  9248. * @example
  9249. * const t = Cesium.Math.isPowerOfTwo(16); // true
  9250. * const f = Cesium.Math.isPowerOfTwo(20); // false
  9251. * @param n - The integer to test in the range [0, (2^32)-1].
  9252. * @returns <code>true</code> if the number if a power of two; otherwise, <code>false</code>.
  9253. */
  9254. function isPowerOfTwo(n: number): boolean;
  9255. /**
  9256. * Computes the next power-of-two integer greater than or equal to the provided non-negative integer.
  9257. * The maximum allowed input is 2^31 due to 32-bit bitwise operator limitation in Javascript.
  9258. * @example
  9259. * const n = Cesium.Math.nextPowerOfTwo(29); // 32
  9260. * const m = Cesium.Math.nextPowerOfTwo(32); // 32
  9261. * @param n - The integer to test in the range [0, 2^31].
  9262. * @returns The next power-of-two integer.
  9263. */
  9264. function nextPowerOfTwo(n: number): number;
  9265. /**
  9266. * Computes the previous power-of-two integer less than or equal to the provided non-negative integer.
  9267. * The maximum allowed input is (2^32)-1 due to 32-bit bitwise operator limitation in Javascript.
  9268. * @example
  9269. * const n = Cesium.Math.previousPowerOfTwo(29); // 16
  9270. * const m = Cesium.Math.previousPowerOfTwo(32); // 32
  9271. * @param n - The integer to test in the range [0, (2^32)-1].
  9272. * @returns The previous power-of-two integer.
  9273. */
  9274. function previousPowerOfTwo(n: number): number;
  9275. /**
  9276. * Constraint a value to lie between two values.
  9277. * @param value - The value to clamp.
  9278. * @param min - The minimum value.
  9279. * @param max - The maximum value.
  9280. * @returns The clamped value such that min <= result <= max.
  9281. */
  9282. function clamp(value: number, min: number, max: number): number;
  9283. /**
  9284. * Sets the seed used by the random number generator
  9285. * in {@link Math#nextRandomNumber}.
  9286. * @param seed - An integer used as the seed.
  9287. */
  9288. function setRandomNumberSeed(seed: number): void;
  9289. /**
  9290. * Generates a random floating point number in the range of [0.0, 1.0)
  9291. * using a Mersenne twister.
  9292. * @returns A random number in the range of [0.0, 1.0).
  9293. */
  9294. function nextRandomNumber(): number;
  9295. /**
  9296. * Generates a random number between two numbers.
  9297. * @param min - The minimum value.
  9298. * @param max - The maximum value.
  9299. * @returns A random number between the min and max.
  9300. */
  9301. function randomBetween(min: number, max: number): number;
  9302. /**
  9303. * Computes <code>Math.acos(value)</code>, but first clamps <code>value</code> to the range [-1.0, 1.0]
  9304. * so that the function will never return NaN.
  9305. * @param value - The value for which to compute acos.
  9306. * @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,
  9307. * whichever is closer, if the value is outside the range.
  9308. */
  9309. function acosClamped(value: number): number;
  9310. /**
  9311. * Computes <code>Math.asin(value)</code>, but first clamps <code>value</code> to the range [-1.0, 1.0]
  9312. * so that the function will never return NaN.
  9313. * @param value - The value for which to compute asin.
  9314. * @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,
  9315. * whichever is closer, if the value is outside the range.
  9316. */
  9317. function asinClamped(value: number): number;
  9318. /**
  9319. * Finds the chord length between two points given the circle's radius and the angle between the points.
  9320. * @param angle - The angle between the two points.
  9321. * @param radius - The radius of the circle.
  9322. * @returns The chord length.
  9323. */
  9324. function chordLength(angle: number, radius: number): number;
  9325. /**
  9326. * Finds the logarithm of a number to a base.
  9327. * @param number - The number.
  9328. * @param base - The base.
  9329. * @returns The result.
  9330. */
  9331. function logBase(number: number, base: number): number;
  9332. /**
  9333. * Finds the cube root of a number.
  9334. * Returns NaN if <code>number</code> is not provided.
  9335. * @param [number] - The number.
  9336. * @returns The result.
  9337. */
  9338. function cbrt(number?: number): number;
  9339. /**
  9340. * Finds the base 2 logarithm of a number.
  9341. * @param number - The number.
  9342. * @returns The result.
  9343. */
  9344. function log2(number: number): number;
  9345. /**
  9346. * Computes a fast approximation of Atan for input in the range [-1, 1].
  9347. *
  9348. * Based on Michal Drobot's approximation from ShaderFastLibs,
  9349. * which in turn is based on "Efficient approximations for the arctangent function,"
  9350. * Rajan, S. Sichun Wang Inkol, R. Joyal, A., May 2006.
  9351. * Adapted from ShaderFastLibs under MIT License.
  9352. * @param x - An input number in the range [-1, 1]
  9353. * @returns An approximation of atan(x)
  9354. */
  9355. function fastApproximateAtan(x: number): number;
  9356. /**
  9357. * Computes a fast approximation of Atan2(x, y) for arbitrary input scalars.
  9358. *
  9359. * Range reduction math based on nvidia's cg reference implementation: http://developer.download.nvidia.com/cg/atan2.html
  9360. * @param x - An input number that isn't zero if y is zero.
  9361. * @param y - An input number that isn't zero if x is zero.
  9362. * @returns An approximation of atan2(x, y)
  9363. */
  9364. function fastApproximateAtan2(x: number, y: number): number;
  9365. }
  9366. export interface Matrix2 extends ArrayLike<number> {
  9367. }
  9368. /**
  9369. * A 2x2 matrix, indexable as a column-major order array.
  9370. * Constructor parameters are in row-major order for code readability.
  9371. * @param [column0Row0 = 0.0] - The value for column 0, row 0.
  9372. * @param [column1Row0 = 0.0] - The value for column 1, row 0.
  9373. * @param [column0Row1 = 0.0] - The value for column 0, row 1.
  9374. * @param [column1Row1 = 0.0] - The value for column 1, row 1.
  9375. */
  9376. export class Matrix2 implements ArrayLike<number> {
  9377. constructor(column0Row0?: number, column1Row0?: number, column0Row1?: number, column1Row1?: number);
  9378. /**
  9379. * The number of elements used to pack the object into an array.
  9380. */
  9381. static packedLength: number;
  9382. /**
  9383. * Stores the provided instance into the provided array.
  9384. * @param value - The value to pack.
  9385. * @param array - The array to pack into.
  9386. * @param [startingIndex = 0] - The index into the array at which to start packing the elements.
  9387. * @returns The array that was packed into
  9388. */
  9389. static pack(value: Matrix2, array: number[], startingIndex?: number): number[];
  9390. /**
  9391. * Retrieves an instance from a packed array.
  9392. * @param array - The packed array.
  9393. * @param [startingIndex = 0] - The starting index of the element to be unpacked.
  9394. * @param [result] - The object into which to store the result.
  9395. * @returns The modified result parameter or a new Matrix2 instance if one was not provided.
  9396. */
  9397. static unpack(array: number[], startingIndex?: number, result?: Matrix2): Matrix2;
  9398. /**
  9399. * Flattens an array of Matrix2s into an array of components. The components
  9400. * are stored in column-major order.
  9401. * @param array - The array of matrices to pack.
  9402. * @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.
  9403. * @returns The packed array.
  9404. */
  9405. static packArray(array: Matrix2[], result?: number[]): number[];
  9406. /**
  9407. * Unpacks an array of column-major matrix components into an array of Matrix2s.
  9408. * @param array - The array of components to unpack.
  9409. * @param [result] - The array onto which to store the result.
  9410. * @returns The unpacked array.
  9411. */
  9412. static unpackArray(array: number[], result?: Matrix2[]): Matrix2[];
  9413. /**
  9414. * Duplicates a Matrix2 instance.
  9415. * @param matrix - The matrix to duplicate.
  9416. * @param [result] - The object onto which to store the result.
  9417. * @returns The modified result parameter or a new Matrix2 instance if one was not provided. (Returns undefined if matrix is undefined)
  9418. */
  9419. static clone(matrix: Matrix2, result?: Matrix2): Matrix2;
  9420. /**
  9421. * Creates a Matrix2 from 4 consecutive elements in an array.
  9422. * @example
  9423. * // Create the Matrix2:
  9424. * // [1.0, 2.0]
  9425. * // [1.0, 2.0]
  9426. *
  9427. * const v = [1.0, 1.0, 2.0, 2.0];
  9428. * const m = Cesium.Matrix2.fromArray(v);
  9429. *
  9430. * // Create same Matrix2 with using an offset into an array
  9431. * const v2 = [0.0, 0.0, 1.0, 1.0, 2.0, 2.0];
  9432. * const m2 = Cesium.Matrix2.fromArray(v2, 2);
  9433. * @param array - The array whose 4 consecutive elements correspond to the positions of the matrix. Assumes column-major order.
  9434. * @param [startingIndex = 0] - The offset into the array of the first element, which corresponds to first column first row position in the matrix.
  9435. * @param [result] - The object onto which to store the result.
  9436. * @returns The modified result parameter or a new Matrix2 instance if one was not provided.
  9437. */
  9438. static fromArray(array: number[], startingIndex?: number, result?: Matrix2): Matrix2;
  9439. /**
  9440. * Creates a Matrix2 instance from a column-major order array.
  9441. * @param values - The column-major order array.
  9442. * @param [result] - The object in which the result will be stored, if undefined a new instance will be created.
  9443. * @returns The modified result parameter, or a new Matrix2 instance if one was not provided.
  9444. */
  9445. static fromColumnMajorArray(values: number[], result?: Matrix2): Matrix2;
  9446. /**
  9447. * Creates a Matrix2 instance from a row-major order array.
  9448. * The resulting matrix will be in column-major order.
  9449. * @param values - The row-major order array.
  9450. * @param [result] - The object in which the result will be stored, if undefined a new instance will be created.
  9451. * @returns The modified result parameter, or a new Matrix2 instance if one was not provided.
  9452. */
  9453. static fromRowMajorArray(values: number[], result?: Matrix2): Matrix2;
  9454. /**
  9455. * Computes a Matrix2 instance representing a non-uniform scale.
  9456. * @example
  9457. * // Creates
  9458. * // [7.0, 0.0]
  9459. * // [0.0, 8.0]
  9460. * const m = Cesium.Matrix2.fromScale(new Cesium.Cartesian2(7.0, 8.0));
  9461. * @param scale - The x and y scale factors.
  9462. * @param [result] - The object in which the result will be stored, if undefined a new instance will be created.
  9463. * @returns The modified result parameter, or a new Matrix2 instance if one was not provided.
  9464. */
  9465. static fromScale(scale: Cartesian2, result?: Matrix2): Matrix2;
  9466. /**
  9467. * Computes a Matrix2 instance representing a uniform scale.
  9468. * @example
  9469. * // Creates
  9470. * // [2.0, 0.0]
  9471. * // [0.0, 2.0]
  9472. * const m = Cesium.Matrix2.fromUniformScale(2.0);
  9473. * @param scale - The uniform scale factor.
  9474. * @param [result] - The object in which the result will be stored, if undefined a new instance will be created.
  9475. * @returns The modified result parameter, or a new Matrix2 instance if one was not provided.
  9476. */
  9477. static fromUniformScale(scale: number, result?: Matrix2): Matrix2;
  9478. /**
  9479. * Creates a rotation matrix.
  9480. * @example
  9481. * // Rotate a point 45 degrees counterclockwise.
  9482. * const p = new Cesium.Cartesian2(5, 6);
  9483. * const m = Cesium.Matrix2.fromRotation(Cesium.Math.toRadians(45.0));
  9484. * const rotated = Cesium.Matrix2.multiplyByVector(m, p, new Cesium.Cartesian2());
  9485. * @param angle - The angle, in radians, of the rotation. Positive angles are counterclockwise.
  9486. * @param [result] - The object in which the result will be stored, if undefined a new instance will be created.
  9487. * @returns The modified result parameter, or a new Matrix2 instance if one was not provided.
  9488. */
  9489. static fromRotation(angle: number, result?: Matrix2): Matrix2;
  9490. /**
  9491. * Creates an Array from the provided Matrix2 instance.
  9492. * The array will be in column-major order.
  9493. * @param matrix - The matrix to use..
  9494. * @param [result] - The Array onto which to store the result.
  9495. * @returns The modified Array parameter or a new Array instance if one was not provided.
  9496. */
  9497. static toArray(matrix: Matrix2, result?: number[]): number[];
  9498. /**
  9499. * Computes the array index of the element at the provided row and column.
  9500. * @example
  9501. * const myMatrix = new Cesium.Matrix2();
  9502. * const column1Row0Index = Cesium.Matrix2.getElementIndex(1, 0);
  9503. * const column1Row0 = myMatrix[column1Row0Index]
  9504. * myMatrix[column1Row0Index] = 10.0;
  9505. * @param row - The zero-based index of the row.
  9506. * @param column - The zero-based index of the column.
  9507. * @returns The index of the element at the provided row and column.
  9508. */
  9509. static getElementIndex(row: number, column: number): number;
  9510. /**
  9511. * Retrieves a copy of the matrix column at the provided index as a Cartesian2 instance.
  9512. * @param matrix - The matrix to use.
  9513. * @param index - The zero-based index of the column to retrieve.
  9514. * @param result - The object onto which to store the result.
  9515. * @returns The modified result parameter.
  9516. */
  9517. static getColumn(matrix: Matrix2, index: number, result: Cartesian2): Cartesian2;
  9518. /**
  9519. * Computes a new matrix that replaces the specified column in the provided matrix with the provided Cartesian2 instance.
  9520. * @param matrix - The matrix to use.
  9521. * @param index - The zero-based index of the column to set.
  9522. * @param cartesian - The Cartesian whose values will be assigned to the specified column.
  9523. * @param result - The object onto which to store the result.
  9524. * @returns The modified result parameter.
  9525. */
  9526. static setColumn(matrix: Matrix2, index: number, cartesian: Cartesian2, result: Cartesian2): Matrix2;
  9527. /**
  9528. * Retrieves a copy of the matrix row at the provided index as a Cartesian2 instance.
  9529. * @param matrix - The matrix to use.
  9530. * @param index - The zero-based index of the row to retrieve.
  9531. * @param result - The object onto which to store the result.
  9532. * @returns The modified result parameter.
  9533. */
  9534. static getRow(matrix: Matrix2, index: number, result: Cartesian2): Cartesian2;
  9535. /**
  9536. * Computes a new matrix that replaces the specified row in the provided matrix with the provided Cartesian2 instance.
  9537. * @param matrix - The matrix to use.
  9538. * @param index - The zero-based index of the row to set.
  9539. * @param cartesian - The Cartesian whose values will be assigned to the specified row.
  9540. * @param result - The object onto which to store the result.
  9541. * @returns The modified result parameter.
  9542. */
  9543. static setRow(matrix: Matrix2, index: number, cartesian: Cartesian2, result: Matrix2): Matrix2;
  9544. /**
  9545. * Computes a new matrix that replaces the scale with the provided scale.
  9546. * This assumes the matrix is an affine transformation.
  9547. * @param matrix - The matrix to use.
  9548. * @param scale - The scale that replaces the scale of the provided matrix.
  9549. * @param result - The object onto which to store the result.
  9550. * @returns The modified result parameter.
  9551. */
  9552. static setScale(matrix: Matrix2, scale: Cartesian2, result: Matrix2): Matrix2;
  9553. /**
  9554. * Computes a new matrix that replaces the scale with the provided uniform scale.
  9555. * This assumes the matrix is an affine transformation.
  9556. * @param matrix - The matrix to use.
  9557. * @param scale - The uniform scale that replaces the scale of the provided matrix.
  9558. * @param result - The object onto which to store the result.
  9559. * @returns The modified result parameter.
  9560. */
  9561. static setUniformScale(matrix: Matrix2, scale: number, result: Matrix2): Matrix2;
  9562. /**
  9563. * Extracts the non-uniform scale assuming the matrix is an affine transformation.
  9564. * @param matrix - The matrix.
  9565. * @param result - The object onto which to store the result.
  9566. * @returns The modified result parameter.
  9567. */
  9568. static getScale(matrix: Matrix2, result: Cartesian2): Cartesian2;
  9569. /**
  9570. * Computes the maximum scale assuming the matrix is an affine transformation.
  9571. * The maximum scale is the maximum length of the column vectors.
  9572. * @param matrix - The matrix.
  9573. * @returns The maximum scale.
  9574. */
  9575. static getMaximumScale(matrix: Matrix2): number;
  9576. /**
  9577. * Sets the rotation assuming the matrix is an affine transformation.
  9578. * @param matrix - The matrix.
  9579. * @param rotation - The rotation matrix.
  9580. * @returns The modified result parameter.
  9581. */
  9582. static setRotation(matrix: Matrix2, rotation: Matrix2): Matrix2;
  9583. /**
  9584. * Extracts the rotation matrix assuming the matrix is an affine transformation.
  9585. * @param matrix - The matrix.
  9586. * @param result - The object onto which to store the result.
  9587. * @returns The modified result parameter.
  9588. */
  9589. static getRotation(matrix: Matrix2, result: Matrix2): Matrix2;
  9590. /**
  9591. * Computes the product of two matrices.
  9592. * @param left - The first matrix.
  9593. * @param right - The second matrix.
  9594. * @param result - The object onto which to store the result.
  9595. * @returns The modified result parameter.
  9596. */
  9597. static multiply(left: Matrix2, right: Matrix2, result: Matrix2): Matrix2;
  9598. /**
  9599. * Computes the sum of two matrices.
  9600. * @param left - The first matrix.
  9601. * @param right - The second matrix.
  9602. * @param result - The object onto which to store the result.
  9603. * @returns The modified result parameter.
  9604. */
  9605. static add(left: Matrix2, right: Matrix2, result: Matrix2): Matrix2;
  9606. /**
  9607. * Computes the difference of two matrices.
  9608. * @param left - The first matrix.
  9609. * @param right - The second matrix.
  9610. * @param result - The object onto which to store the result.
  9611. * @returns The modified result parameter.
  9612. */
  9613. static subtract(left: Matrix2, right: Matrix2, result: Matrix2): Matrix2;
  9614. /**
  9615. * Computes the product of a matrix and a column vector.
  9616. * @param matrix - The matrix.
  9617. * @param cartesian - The column.
  9618. * @param result - The object onto which to store the result.
  9619. * @returns The modified result parameter.
  9620. */
  9621. static multiplyByVector(matrix: Matrix2, cartesian: Cartesian2, result: Cartesian2): Cartesian2;
  9622. /**
  9623. * Computes the product of a matrix and a scalar.
  9624. * @param matrix - The matrix.
  9625. * @param scalar - The number to multiply by.
  9626. * @param result - The object onto which to store the result.
  9627. * @returns The modified result parameter.
  9628. */
  9629. static multiplyByScalar(matrix: Matrix2, scalar: number, result: Matrix2): Matrix2;
  9630. /**
  9631. * Computes the product of a matrix times a (non-uniform) scale, as if the scale were a scale matrix.
  9632. * @example
  9633. * // Instead of Cesium.Matrix2.multiply(m, Cesium.Matrix2.fromScale(scale), m);
  9634. * Cesium.Matrix2.multiplyByScale(m, scale, m);
  9635. * @param matrix - The matrix on the left-hand side.
  9636. * @param scale - The non-uniform scale on the right-hand side.
  9637. * @param result - The object onto which to store the result.
  9638. * @returns The modified result parameter.
  9639. */
  9640. static multiplyByScale(matrix: Matrix2, scale: number, result: Matrix2): Matrix2;
  9641. /**
  9642. * Computes the product of a matrix times a uniform scale, as if the scale were a scale matrix.
  9643. * @example
  9644. * // Instead of Cesium.Matrix2.multiply(m, Cesium.Matrix2.fromUniformScale(scale), m);
  9645. * Cesium.Matrix2.multiplyByUniformScale(m, scale, m);
  9646. * @param matrix - The matrix on the left-hand side.
  9647. * @param scale - The uniform scale on the right-hand side.
  9648. * @param result - The object onto which to store the result.
  9649. * @returns The modified result parameter.
  9650. */
  9651. static multiplyByUniformScale(matrix: Matrix2, scale: number, result: Matrix2): Matrix2;
  9652. /**
  9653. * Creates a negated copy of the provided matrix.
  9654. * @param matrix - The matrix to negate.
  9655. * @param result - The object onto which to store the result.
  9656. * @returns The modified result parameter.
  9657. */
  9658. static negate(matrix: Matrix2, result: Matrix2): Matrix2;
  9659. /**
  9660. * Computes the transpose of the provided matrix.
  9661. * @param matrix - The matrix to transpose.
  9662. * @param result - The object onto which to store the result.
  9663. * @returns The modified result parameter.
  9664. */
  9665. static transpose(matrix: Matrix2, result: Matrix2): Matrix2;
  9666. /**
  9667. * Computes a matrix, which contains the absolute (unsigned) values of the provided matrix's elements.
  9668. * @param matrix - The matrix with signed elements.
  9669. * @param result - The object onto which to store the result.
  9670. * @returns The modified result parameter.
  9671. */
  9672. static abs(matrix: Matrix2, result: Matrix2): Matrix2;
  9673. /**
  9674. * Compares the provided matrices componentwise and returns
  9675. * <code>true</code> if they are equal, <code>false</code> otherwise.
  9676. * @param [left] - The first matrix.
  9677. * @param [right] - The second matrix.
  9678. * @returns <code>true</code> if left and right are equal, <code>false</code> otherwise.
  9679. */
  9680. static equals(left?: Matrix2, right?: Matrix2): boolean;
  9681. /**
  9682. * Compares the provided matrices componentwise and returns
  9683. * <code>true</code> if they are within the provided epsilon,
  9684. * <code>false</code> otherwise.
  9685. * @param [left] - The first matrix.
  9686. * @param [right] - The second matrix.
  9687. * @param [epsilon = 0] - The epsilon to use for equality testing.
  9688. * @returns <code>true</code> if left and right are within the provided epsilon, <code>false</code> otherwise.
  9689. */
  9690. static equalsEpsilon(left?: Matrix2, right?: Matrix2, epsilon?: number): boolean;
  9691. /**
  9692. * An immutable Matrix2 instance initialized to the identity matrix.
  9693. */
  9694. static readonly IDENTITY: Matrix2;
  9695. /**
  9696. * An immutable Matrix2 instance initialized to the zero matrix.
  9697. */
  9698. static readonly ZERO: Matrix2;
  9699. /**
  9700. * The index into Matrix2 for column 0, row 0.
  9701. * @example
  9702. * const matrix = new Cesium.Matrix2();
  9703. * matrix[Cesium.Matrix2.COLUMN0ROW0] = 5.0; // set column 0, row 0 to 5.0
  9704. */
  9705. static readonly COLUMN0ROW0: number;
  9706. /**
  9707. * The index into Matrix2 for column 0, row 1.
  9708. * @example
  9709. * const matrix = new Cesium.Matrix2();
  9710. * matrix[Cesium.Matrix2.COLUMN0ROW1] = 5.0; // set column 0, row 1 to 5.0
  9711. */
  9712. static readonly COLUMN0ROW1: number;
  9713. /**
  9714. * The index into Matrix2 for column 1, row 0.
  9715. * @example
  9716. * const matrix = new Cesium.Matrix2();
  9717. * matrix[Cesium.Matrix2.COLUMN1ROW0] = 5.0; // set column 1, row 0 to 5.0
  9718. */
  9719. static readonly COLUMN1ROW0: number;
  9720. /**
  9721. * The index into Matrix2 for column 1, row 1.
  9722. * @example
  9723. * const matrix = new Cesium.Matrix2();
  9724. * matrix[Cesium.Matrix2.COLUMN1ROW1] = 5.0; // set column 1, row 1 to 5.0
  9725. */
  9726. static readonly COLUMN1ROW1: number;
  9727. /**
  9728. * Gets the number of items in the collection.
  9729. */
  9730. length: number;
  9731. /**
  9732. * Duplicates the provided Matrix2 instance.
  9733. * @param [result] - The object onto which to store the result.
  9734. * @returns The modified result parameter or a new Matrix2 instance if one was not provided.
  9735. */
  9736. clone(result?: Matrix2): Matrix2;
  9737. /**
  9738. * Compares this matrix to the provided matrix componentwise and returns
  9739. * <code>true</code> if they are equal, <code>false</code> otherwise.
  9740. * @param [right] - The right hand side matrix.
  9741. * @returns <code>true</code> if they are equal, <code>false</code> otherwise.
  9742. */
  9743. equals(right?: Matrix2): boolean;
  9744. /**
  9745. * Compares this matrix to the provided matrix componentwise and returns
  9746. * <code>true</code> if they are within the provided epsilon,
  9747. * <code>false</code> otherwise.
  9748. * @param [right] - The right hand side matrix.
  9749. * @param [epsilon = 0] - The epsilon to use for equality testing.
  9750. * @returns <code>true</code> if they are within the provided epsilon, <code>false</code> otherwise.
  9751. */
  9752. equalsEpsilon(right?: Matrix2, epsilon?: number): boolean;
  9753. /**
  9754. * Creates a string representing this Matrix with each row being
  9755. * on a separate line and in the format '(column0, column1)'.
  9756. * @returns A string representing the provided Matrix with each row being on a separate line and in the format '(column0, column1)'.
  9757. */
  9758. toString(): string;
  9759. }
  9760. export interface Matrix3 extends ArrayLike<number> {
  9761. }
  9762. /**
  9763. * A 3x3 matrix, indexable as a column-major order array.
  9764. * Constructor parameters are in row-major order for code readability.
  9765. * @param [column0Row0 = 0.0] - The value for column 0, row 0.
  9766. * @param [column1Row0 = 0.0] - The value for column 1, row 0.
  9767. * @param [column2Row0 = 0.0] - The value for column 2, row 0.
  9768. * @param [column0Row1 = 0.0] - The value for column 0, row 1.
  9769. * @param [column1Row1 = 0.0] - The value for column 1, row 1.
  9770. * @param [column2Row1 = 0.0] - The value for column 2, row 1.
  9771. * @param [column0Row2 = 0.0] - The value for column 0, row 2.
  9772. * @param [column1Row2 = 0.0] - The value for column 1, row 2.
  9773. * @param [column2Row2 = 0.0] - The value for column 2, row 2.
  9774. */
  9775. export class Matrix3 implements ArrayLike<number> {
  9776. constructor(column0Row0?: number, column1Row0?: number, column2Row0?: number, column0Row1?: number, column1Row1?: number, column2Row1?: number, column0Row2?: number, column1Row2?: number, column2Row2?: number);
  9777. /**
  9778. * The number of elements used to pack the object into an array.
  9779. */
  9780. static packedLength: number;
  9781. /**
  9782. * Stores the provided instance into the provided array.
  9783. * @param value - The value to pack.
  9784. * @param array - The array to pack into.
  9785. * @param [startingIndex = 0] - The index into the array at which to start packing the elements.
  9786. * @returns The array that was packed into
  9787. */
  9788. static pack(value: Matrix3, array: number[], startingIndex?: number): number[];
  9789. /**
  9790. * Retrieves an instance from a packed array.
  9791. * @param array - The packed array.
  9792. * @param [startingIndex = 0] - The starting index of the element to be unpacked.
  9793. * @param [result] - The object into which to store the result.
  9794. * @returns The modified result parameter or a new Matrix3 instance if one was not provided.
  9795. */
  9796. static unpack(array: number[], startingIndex?: number, result?: Matrix3): Matrix3;
  9797. /**
  9798. * Flattens an array of Matrix3s into an array of components. The components
  9799. * are stored in column-major order.
  9800. * @param array - The array of matrices to pack.
  9801. * @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.
  9802. * @returns The packed array.
  9803. */
  9804. static packArray(array: Matrix3[], result?: number[]): number[];
  9805. /**
  9806. * Unpacks an array of column-major matrix components into an array of Matrix3s.
  9807. * @param array - The array of components to unpack.
  9808. * @param [result] - The array onto which to store the result.
  9809. * @returns The unpacked array.
  9810. */
  9811. static unpackArray(array: number[], result?: Matrix3[]): Matrix3[];
  9812. /**
  9813. * Duplicates a Matrix3 instance.
  9814. * @param matrix - The matrix to duplicate.
  9815. * @param [result] - The object onto which to store the result.
  9816. * @returns The modified result parameter or a new Matrix3 instance if one was not provided. (Returns undefined if matrix is undefined)
  9817. */
  9818. static clone(matrix: Matrix3, result?: Matrix3): Matrix3;
  9819. /**
  9820. * Creates a Matrix3 from 9 consecutive elements in an array.
  9821. * @example
  9822. * // Create the Matrix3:
  9823. * // [1.0, 2.0, 3.0]
  9824. * // [1.0, 2.0, 3.0]
  9825. * // [1.0, 2.0, 3.0]
  9826. *
  9827. * const v = [1.0, 1.0, 1.0, 2.0, 2.0, 2.0, 3.0, 3.0, 3.0];
  9828. * const m = Cesium.Matrix3.fromArray(v);
  9829. *
  9830. * // Create same Matrix3 with using an offset into an array
  9831. * const v2 = [0.0, 0.0, 1.0, 1.0, 1.0, 2.0, 2.0, 2.0, 3.0, 3.0, 3.0];
  9832. * const m2 = Cesium.Matrix3.fromArray(v2, 2);
  9833. * @param array - The array whose 9 consecutive elements correspond to the positions of the matrix. Assumes column-major order.
  9834. * @param [startingIndex = 0] - The offset into the array of the first element, which corresponds to first column first row position in the matrix.
  9835. * @param [result] - The object onto which to store the result.
  9836. * @returns The modified result parameter or a new Matrix3 instance if one was not provided.
  9837. */
  9838. static fromArray(array: number[], startingIndex?: number, result?: Matrix3): Matrix3;
  9839. /**
  9840. * Creates a Matrix3 instance from a column-major order array.
  9841. * @param values - The column-major order array.
  9842. * @param [result] - The object in which the result will be stored, if undefined a new instance will be created.
  9843. * @returns The modified result parameter, or a new Matrix3 instance if one was not provided.
  9844. */
  9845. static fromColumnMajorArray(values: number[], result?: Matrix3): Matrix3;
  9846. /**
  9847. * Creates a Matrix3 instance from a row-major order array.
  9848. * The resulting matrix will be in column-major order.
  9849. * @param values - The row-major order array.
  9850. * @param [result] - The object in which the result will be stored, if undefined a new instance will be created.
  9851. * @returns The modified result parameter, or a new Matrix3 instance if one was not provided.
  9852. */
  9853. static fromRowMajorArray(values: number[], result?: Matrix3): Matrix3;
  9854. /**
  9855. * Computes a 3x3 rotation matrix from the provided quaternion.
  9856. * @param quaternion - the quaternion to use.
  9857. * @param [result] - The object in which the result will be stored, if undefined a new instance will be created.
  9858. * @returns The 3x3 rotation matrix from this quaternion.
  9859. */
  9860. static fromQuaternion(quaternion: Quaternion, result?: Matrix3): Matrix3;
  9861. /**
  9862. * Computes a 3x3 rotation matrix from the provided headingPitchRoll. (see http://en.wikipedia.org/wiki/Conversion_between_quaternions_and_Euler_angles )
  9863. * @param headingPitchRoll - the headingPitchRoll to use.
  9864. * @param [result] - The object in which the result will be stored, if undefined a new instance will be created.
  9865. * @returns The 3x3 rotation matrix from this headingPitchRoll.
  9866. */
  9867. static fromHeadingPitchRoll(headingPitchRoll: HeadingPitchRoll, result?: Matrix3): Matrix3;
  9868. /**
  9869. * Computes a Matrix3 instance representing a non-uniform scale.
  9870. * @example
  9871. * // Creates
  9872. * // [7.0, 0.0, 0.0]
  9873. * // [0.0, 8.0, 0.0]
  9874. * // [0.0, 0.0, 9.0]
  9875. * const m = Cesium.Matrix3.fromScale(new Cesium.Cartesian3(7.0, 8.0, 9.0));
  9876. * @param scale - The x, y, and z scale factors.
  9877. * @param [result] - The object in which the result will be stored, if undefined a new instance will be created.
  9878. * @returns The modified result parameter, or a new Matrix3 instance if one was not provided.
  9879. */
  9880. static fromScale(scale: Cartesian3, result?: Matrix3): Matrix3;
  9881. /**
  9882. * Computes a Matrix3 instance representing a uniform scale.
  9883. * @example
  9884. * // Creates
  9885. * // [2.0, 0.0, 0.0]
  9886. * // [0.0, 2.0, 0.0]
  9887. * // [0.0, 0.0, 2.0]
  9888. * const m = Cesium.Matrix3.fromUniformScale(2.0);
  9889. * @param scale - The uniform scale factor.
  9890. * @param [result] - The object in which the result will be stored, if undefined a new instance will be created.
  9891. * @returns The modified result parameter, or a new Matrix3 instance if one was not provided.
  9892. */
  9893. static fromUniformScale(scale: number, result?: Matrix3): Matrix3;
  9894. /**
  9895. * Computes a Matrix3 instance representing the cross product equivalent matrix of a Cartesian3 vector.
  9896. * @example
  9897. * // Creates
  9898. * // [0.0, -9.0, 8.0]
  9899. * // [9.0, 0.0, -7.0]
  9900. * // [-8.0, 7.0, 0.0]
  9901. * const m = Cesium.Matrix3.fromCrossProduct(new Cesium.Cartesian3(7.0, 8.0, 9.0));
  9902. * @param vector - the vector on the left hand side of the cross product operation.
  9903. * @param [result] - The object in which the result will be stored, if undefined a new instance will be created.
  9904. * @returns The modified result parameter, or a new Matrix3 instance if one was not provided.
  9905. */
  9906. static fromCrossProduct(vector: Cartesian3, result?: Matrix3): Matrix3;
  9907. /**
  9908. * Creates a rotation matrix around the x-axis.
  9909. * @example
  9910. * // Rotate a point 45 degrees counterclockwise around the x-axis.
  9911. * const p = new Cesium.Cartesian3(5, 6, 7);
  9912. * const m = Cesium.Matrix3.fromRotationX(Cesium.Math.toRadians(45.0));
  9913. * const rotated = Cesium.Matrix3.multiplyByVector(m, p, new Cesium.Cartesian3());
  9914. * @param angle - The angle, in radians, of the rotation. Positive angles are counterclockwise.
  9915. * @param [result] - The object in which the result will be stored, if undefined a new instance will be created.
  9916. * @returns The modified result parameter, or a new Matrix3 instance if one was not provided.
  9917. */
  9918. static fromRotationX(angle: number, result?: Matrix3): Matrix3;
  9919. /**
  9920. * Creates a rotation matrix around the y-axis.
  9921. * @example
  9922. * // Rotate a point 45 degrees counterclockwise around the y-axis.
  9923. * const p = new Cesium.Cartesian3(5, 6, 7);
  9924. * const m = Cesium.Matrix3.fromRotationY(Cesium.Math.toRadians(45.0));
  9925. * const rotated = Cesium.Matrix3.multiplyByVector(m, p, new Cesium.Cartesian3());
  9926. * @param angle - The angle, in radians, of the rotation. Positive angles are counterclockwise.
  9927. * @param [result] - The object in which the result will be stored, if undefined a new instance will be created.
  9928. * @returns The modified result parameter, or a new Matrix3 instance if one was not provided.
  9929. */
  9930. static fromRotationY(angle: number, result?: Matrix3): Matrix3;
  9931. /**
  9932. * Creates a rotation matrix around the z-axis.
  9933. * @example
  9934. * // Rotate a point 45 degrees counterclockwise around the z-axis.
  9935. * const p = new Cesium.Cartesian3(5, 6, 7);
  9936. * const m = Cesium.Matrix3.fromRotationZ(Cesium.Math.toRadians(45.0));
  9937. * const rotated = Cesium.Matrix3.multiplyByVector(m, p, new Cesium.Cartesian3());
  9938. * @param angle - The angle, in radians, of the rotation. Positive angles are counterclockwise.
  9939. * @param [result] - The object in which the result will be stored, if undefined a new instance will be created.
  9940. * @returns The modified result parameter, or a new Matrix3 instance if one was not provided.
  9941. */
  9942. static fromRotationZ(angle: number, result?: Matrix3): Matrix3;
  9943. /**
  9944. * Creates an Array from the provided Matrix3 instance.
  9945. * The array will be in column-major order.
  9946. * @param matrix - The matrix to use..
  9947. * @param [result] - The Array onto which to store the result.
  9948. * @returns The modified Array parameter or a new Array instance if one was not provided.
  9949. */
  9950. static toArray(matrix: Matrix3, result?: number[]): number[];
  9951. /**
  9952. * Computes the array index of the element at the provided row and column.
  9953. * @example
  9954. * const myMatrix = new Cesium.Matrix3();
  9955. * const column1Row0Index = Cesium.Matrix3.getElementIndex(1, 0);
  9956. * const column1Row0 = myMatrix[column1Row0Index]
  9957. * myMatrix[column1Row0Index] = 10.0;
  9958. * @param column - The zero-based index of the column.
  9959. * @param row - The zero-based index of the row.
  9960. * @returns The index of the element at the provided row and column.
  9961. */
  9962. static getElementIndex(column: number, row: number): number;
  9963. /**
  9964. * Retrieves a copy of the matrix column at the provided index as a Cartesian3 instance.
  9965. * @param matrix - The matrix to use.
  9966. * @param index - The zero-based index of the column to retrieve.
  9967. * @param result - The object onto which to store the result.
  9968. * @returns The modified result parameter.
  9969. */
  9970. static getColumn(matrix: Matrix3, index: number, result: Cartesian3): Cartesian3;
  9971. /**
  9972. * Computes a new matrix that replaces the specified column in the provided matrix with the provided Cartesian3 instance.
  9973. * @param matrix - The matrix to use.
  9974. * @param index - The zero-based index of the column to set.
  9975. * @param cartesian - The Cartesian whose values will be assigned to the specified column.
  9976. * @param result - The object onto which to store the result.
  9977. * @returns The modified result parameter.
  9978. */
  9979. static setColumn(matrix: Matrix3, index: number, cartesian: Cartesian3, result: Matrix3): Matrix3;
  9980. /**
  9981. * Retrieves a copy of the matrix row at the provided index as a Cartesian3 instance.
  9982. * @param matrix - The matrix to use.
  9983. * @param index - The zero-based index of the row to retrieve.
  9984. * @param result - The object onto which to store the result.
  9985. * @returns The modified result parameter.
  9986. */
  9987. static getRow(matrix: Matrix3, index: number, result: Cartesian3): Cartesian3;
  9988. /**
  9989. * Computes a new matrix that replaces the specified row in the provided matrix with the provided Cartesian3 instance.
  9990. * @param matrix - The matrix to use.
  9991. * @param index - The zero-based index of the row to set.
  9992. * @param cartesian - The Cartesian whose values will be assigned to the specified row.
  9993. * @param result - The object onto which to store the result.
  9994. * @returns The modified result parameter.
  9995. */
  9996. static setRow(matrix: Matrix3, index: number, cartesian: Cartesian3, result: Matrix3): Matrix3;
  9997. /**
  9998. * Computes a new matrix that replaces the scale with the provided scale.
  9999. * This assumes the matrix is an affine transformation.
  10000. * @param matrix - The matrix to use.
  10001. * @param scale - The scale that replaces the scale of the provided matrix.
  10002. * @param result - The object onto which to store the result.
  10003. * @returns The modified result parameter.
  10004. */
  10005. static setScale(matrix: Matrix3, scale: Cartesian3, result: Matrix3): Matrix3;
  10006. /**
  10007. * Computes a new matrix that replaces the scale with the provided uniform scale.
  10008. * This assumes the matrix is an affine transformation.
  10009. * @param matrix - The matrix to use.
  10010. * @param scale - The uniform scale that replaces the scale of the provided matrix.
  10011. * @param result - The object onto which to store the result.
  10012. * @returns The modified result parameter.
  10013. */
  10014. static setUniformScale(matrix: Matrix3, scale: number, result: Matrix3): Matrix3;
  10015. /**
  10016. * Extracts the non-uniform scale assuming the matrix is an affine transformation.
  10017. * @param matrix - The matrix.
  10018. * @param result - The object onto which to store the result.
  10019. * @returns The modified result parameter.
  10020. */
  10021. static getScale(matrix: Matrix3, result: Cartesian3): Cartesian3;
  10022. /**
  10023. * Computes the maximum scale assuming the matrix is an affine transformation.
  10024. * The maximum scale is the maximum length of the column vectors.
  10025. * @param matrix - The matrix.
  10026. * @returns The maximum scale.
  10027. */
  10028. static getMaximumScale(matrix: Matrix3): number;
  10029. /**
  10030. * Sets the rotation assuming the matrix is an affine transformation.
  10031. * @param matrix - The matrix.
  10032. * @param rotation - The rotation matrix.
  10033. * @returns The modified result parameter.
  10034. */
  10035. static setRotation(matrix: Matrix3, rotation: Matrix3): Matrix3;
  10036. /**
  10037. * Extracts the rotation matrix assuming the matrix is an affine transformation.
  10038. * @param matrix - The matrix.
  10039. * @param result - The object onto which to store the result.
  10040. * @returns The modified result parameter.
  10041. */
  10042. static getRotation(matrix: Matrix3, result: Matrix3): Matrix3;
  10043. /**
  10044. * Computes the product of two matrices.
  10045. * @param left - The first matrix.
  10046. * @param right - The second matrix.
  10047. * @param result - The object onto which to store the result.
  10048. * @returns The modified result parameter.
  10049. */
  10050. static multiply(left: Matrix3, right: Matrix3, result: Matrix3): Matrix3;
  10051. /**
  10052. * Computes the sum of two matrices.
  10053. * @param left - The first matrix.
  10054. * @param right - The second matrix.
  10055. * @param result - The object onto which to store the result.
  10056. * @returns The modified result parameter.
  10057. */
  10058. static add(left: Matrix3, right: Matrix3, result: Matrix3): Matrix3;
  10059. /**
  10060. * Computes the difference of two matrices.
  10061. * @param left - The first matrix.
  10062. * @param right - The second matrix.
  10063. * @param result - The object onto which to store the result.
  10064. * @returns The modified result parameter.
  10065. */
  10066. static subtract(left: Matrix3, right: Matrix3, result: Matrix3): Matrix3;
  10067. /**
  10068. * Computes the product of a matrix and a column vector.
  10069. * @param matrix - The matrix.
  10070. * @param cartesian - The column.
  10071. * @param result - The object onto which to store the result.
  10072. * @returns The modified result parameter.
  10073. */
  10074. static multiplyByVector(matrix: Matrix3, cartesian: Cartesian3, result: Cartesian3): Cartesian3;
  10075. /**
  10076. * Computes the product of a matrix and a scalar.
  10077. * @param matrix - The matrix.
  10078. * @param scalar - The number to multiply by.
  10079. * @param result - The object onto which to store the result.
  10080. * @returns The modified result parameter.
  10081. */
  10082. static multiplyByScalar(matrix: Matrix3, scalar: number, result: Matrix3): Matrix3;
  10083. /**
  10084. * Computes the product of a matrix times a (non-uniform) scale, as if the scale were a scale matrix.
  10085. * @example
  10086. * // Instead of Cesium.Matrix3.multiply(m, Cesium.Matrix3.fromScale(scale), m);
  10087. * Cesium.Matrix3.multiplyByScale(m, scale, m);
  10088. * @param matrix - The matrix on the left-hand side.
  10089. * @param scale - The non-uniform scale on the right-hand side.
  10090. * @param result - The object onto which to store the result.
  10091. * @returns The modified result parameter.
  10092. */
  10093. static multiplyByScale(matrix: Matrix3, scale: number, result: Matrix3): Matrix3;
  10094. /**
  10095. * Computes the product of a matrix times a uniform scale, as if the scale were a scale matrix.
  10096. * @example
  10097. * // Instead of Cesium.Matrix3.multiply(m, Cesium.Matrix3.fromUniformScale(scale), m);
  10098. * Cesium.Matrix3.multiplyByUniformScale(m, scale, m);
  10099. * @param matrix - The matrix on the left-hand side.
  10100. * @param scale - The uniform scale on the right-hand side.
  10101. * @param result - The object onto which to store the result.
  10102. * @returns The modified result parameter.
  10103. */
  10104. static multiplyByUniformScale(matrix: Matrix3, scale: number, result: Matrix3): Matrix3;
  10105. /**
  10106. * Creates a negated copy of the provided matrix.
  10107. * @param matrix - The matrix to negate.
  10108. * @param result - The object onto which to store the result.
  10109. * @returns The modified result parameter.
  10110. */
  10111. static negate(matrix: Matrix3, result: Matrix3): Matrix3;
  10112. /**
  10113. * Computes the transpose of the provided matrix.
  10114. * @param matrix - The matrix to transpose.
  10115. * @param result - The object onto which to store the result.
  10116. * @returns The modified result parameter.
  10117. */
  10118. static transpose(matrix: Matrix3, result: Matrix3): Matrix3;
  10119. /**
  10120. * Computes the eigenvectors and eigenvalues of a symmetric matrix.
  10121. * <p>
  10122. * Returns a diagonal matrix and unitary matrix such that:
  10123. * <code>matrix = unitary matrix * diagonal matrix * transpose(unitary matrix)</code>
  10124. * </p>
  10125. * <p>
  10126. * The values along the diagonal of the diagonal matrix are the eigenvalues. The columns
  10127. * of the unitary matrix are the corresponding eigenvectors.
  10128. * </p>
  10129. * @example
  10130. * const a = //... symetric matrix
  10131. * const result = {
  10132. * unitary : new Cesium.Matrix3(),
  10133. * diagonal : new Cesium.Matrix3()
  10134. * };
  10135. * Cesium.Matrix3.computeEigenDecomposition(a, result);
  10136. *
  10137. * const unitaryTranspose = Cesium.Matrix3.transpose(result.unitary, new Cesium.Matrix3());
  10138. * const b = Cesium.Matrix3.multiply(result.unitary, result.diagonal, new Cesium.Matrix3());
  10139. * Cesium.Matrix3.multiply(b, unitaryTranspose, b); // b is now equal to a
  10140. *
  10141. * const lambda = Cesium.Matrix3.getColumn(result.diagonal, 0, new Cesium.Cartesian3()).x; // first eigenvalue
  10142. * const v = Cesium.Matrix3.getColumn(result.unitary, 0, new Cesium.Cartesian3()); // first eigenvector
  10143. * const c = Cesium.Cartesian3.multiplyByScalar(v, lambda, new Cesium.Cartesian3()); // equal to Cesium.Matrix3.multiplyByVector(a, v)
  10144. * @param matrix - The matrix to decompose into diagonal and unitary matrix. Expected to be symmetric.
  10145. * @param [result] - An object with unitary and diagonal properties which are matrices onto which to store the result.
  10146. * @returns An object with unitary and diagonal properties which are the unitary and diagonal matrices, respectively.
  10147. */
  10148. static computeEigenDecomposition(matrix: Matrix3, result?: any): any;
  10149. /**
  10150. * Computes a matrix, which contains the absolute (unsigned) values of the provided matrix's elements.
  10151. * @param matrix - The matrix with signed elements.
  10152. * @param result - The object onto which to store the result.
  10153. * @returns The modified result parameter.
  10154. */
  10155. static abs(matrix: Matrix3, result: Matrix3): Matrix3;
  10156. /**
  10157. * Computes the determinant of the provided matrix.
  10158. * @param matrix - The matrix to use.
  10159. * @returns The value of the determinant of the matrix.
  10160. */
  10161. static determinant(matrix: Matrix3): number;
  10162. /**
  10163. * Computes the inverse of the provided matrix.
  10164. * @param matrix - The matrix to invert.
  10165. * @param result - The object onto which to store the result.
  10166. * @returns The modified result parameter.
  10167. */
  10168. static inverse(matrix: Matrix3, result: Matrix3): Matrix3;
  10169. /**
  10170. * Computes the inverse transpose of a matrix.
  10171. * @param matrix - The matrix to transpose and invert.
  10172. * @param result - The object onto which to store the result.
  10173. * @returns The modified result parameter.
  10174. */
  10175. static inverseTranspose(matrix: Matrix3, result: Matrix3): Matrix3;
  10176. /**
  10177. * Compares the provided matrices componentwise and returns
  10178. * <code>true</code> if they are equal, <code>false</code> otherwise.
  10179. * @param [left] - The first matrix.
  10180. * @param [right] - The second matrix.
  10181. * @returns <code>true</code> if left and right are equal, <code>false</code> otherwise.
  10182. */
  10183. static equals(left?: Matrix3, right?: Matrix3): boolean;
  10184. /**
  10185. * Compares the provided matrices componentwise and returns
  10186. * <code>true</code> if they are within the provided epsilon,
  10187. * <code>false</code> otherwise.
  10188. * @param [left] - The first matrix.
  10189. * @param [right] - The second matrix.
  10190. * @param [epsilon = 0] - The epsilon to use for equality testing.
  10191. * @returns <code>true</code> if left and right are within the provided epsilon, <code>false</code> otherwise.
  10192. */
  10193. static equalsEpsilon(left?: Matrix3, right?: Matrix3, epsilon?: number): boolean;
  10194. /**
  10195. * An immutable Matrix3 instance initialized to the identity matrix.
  10196. */
  10197. static readonly IDENTITY: Matrix3;
  10198. /**
  10199. * An immutable Matrix3 instance initialized to the zero matrix.
  10200. */
  10201. static readonly ZERO: Matrix3;
  10202. /**
  10203. * The index into Matrix3 for column 0, row 0.
  10204. */
  10205. static readonly COLUMN0ROW0: number;
  10206. /**
  10207. * The index into Matrix3 for column 0, row 1.
  10208. */
  10209. static readonly COLUMN0ROW1: number;
  10210. /**
  10211. * The index into Matrix3 for column 0, row 2.
  10212. */
  10213. static readonly COLUMN0ROW2: number;
  10214. /**
  10215. * The index into Matrix3 for column 1, row 0.
  10216. */
  10217. static readonly COLUMN1ROW0: number;
  10218. /**
  10219. * The index into Matrix3 for column 1, row 1.
  10220. */
  10221. static readonly COLUMN1ROW1: number;
  10222. /**
  10223. * The index into Matrix3 for column 1, row 2.
  10224. */
  10225. static readonly COLUMN1ROW2: number;
  10226. /**
  10227. * The index into Matrix3 for column 2, row 0.
  10228. */
  10229. static readonly COLUMN2ROW0: number;
  10230. /**
  10231. * The index into Matrix3 for column 2, row 1.
  10232. */
  10233. static readonly COLUMN2ROW1: number;
  10234. /**
  10235. * The index into Matrix3 for column 2, row 2.
  10236. */
  10237. static readonly COLUMN2ROW2: number;
  10238. /**
  10239. * Gets the number of items in the collection.
  10240. */
  10241. length: number;
  10242. /**
  10243. * Duplicates the provided Matrix3 instance.
  10244. * @param [result] - The object onto which to store the result.
  10245. * @returns The modified result parameter or a new Matrix3 instance if one was not provided.
  10246. */
  10247. clone(result?: Matrix3): Matrix3;
  10248. /**
  10249. * Compares this matrix to the provided matrix componentwise and returns
  10250. * <code>true</code> if they are equal, <code>false</code> otherwise.
  10251. * @param [right] - The right hand side matrix.
  10252. * @returns <code>true</code> if they are equal, <code>false</code> otherwise.
  10253. */
  10254. equals(right?: Matrix3): boolean;
  10255. /**
  10256. * Compares this matrix to the provided matrix componentwise and returns
  10257. * <code>true</code> if they are within the provided epsilon,
  10258. * <code>false</code> otherwise.
  10259. * @param [right] - The right hand side matrix.
  10260. * @param [epsilon = 0] - The epsilon to use for equality testing.
  10261. * @returns <code>true</code> if they are within the provided epsilon, <code>false</code> otherwise.
  10262. */
  10263. equalsEpsilon(right?: Matrix3, epsilon?: number): boolean;
  10264. /**
  10265. * Creates a string representing this Matrix with each row being
  10266. * on a separate line and in the format '(column0, column1, column2)'.
  10267. * @returns A string representing the provided Matrix with each row being on a separate line and in the format '(column0, column1, column2)'.
  10268. */
  10269. toString(): string;
  10270. }
  10271. export interface Matrix4 extends ArrayLike<number> {
  10272. }
  10273. /**
  10274. * A 4x4 matrix, indexable as a column-major order array.
  10275. * Constructor parameters are in row-major order for code readability.
  10276. * @param [column0Row0 = 0.0] - The value for column 0, row 0.
  10277. * @param [column1Row0 = 0.0] - The value for column 1, row 0.
  10278. * @param [column2Row0 = 0.0] - The value for column 2, row 0.
  10279. * @param [column3Row0 = 0.0] - The value for column 3, row 0.
  10280. * @param [column0Row1 = 0.0] - The value for column 0, row 1.
  10281. * @param [column1Row1 = 0.0] - The value for column 1, row 1.
  10282. * @param [column2Row1 = 0.0] - The value for column 2, row 1.
  10283. * @param [column3Row1 = 0.0] - The value for column 3, row 1.
  10284. * @param [column0Row2 = 0.0] - The value for column 0, row 2.
  10285. * @param [column1Row2 = 0.0] - The value for column 1, row 2.
  10286. * @param [column2Row2 = 0.0] - The value for column 2, row 2.
  10287. * @param [column3Row2 = 0.0] - The value for column 3, row 2.
  10288. * @param [column0Row3 = 0.0] - The value for column 0, row 3.
  10289. * @param [column1Row3 = 0.0] - The value for column 1, row 3.
  10290. * @param [column2Row3 = 0.0] - The value for column 2, row 3.
  10291. * @param [column3Row3 = 0.0] - The value for column 3, row 3.
  10292. */
  10293. export class Matrix4 implements ArrayLike<number> {
  10294. 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);
  10295. /**
  10296. * The number of elements used to pack the object into an array.
  10297. */
  10298. static packedLength: number;
  10299. /**
  10300. * Stores the provided instance into the provided array.
  10301. * @param value - The value to pack.
  10302. * @param array - The array to pack into.
  10303. * @param [startingIndex = 0] - The index into the array at which to start packing the elements.
  10304. * @returns The array that was packed into
  10305. */
  10306. static pack(value: Matrix4, array: number[], startingIndex?: number): number[];
  10307. /**
  10308. * Retrieves an instance from a packed array.
  10309. * @param array - The packed array.
  10310. * @param [startingIndex = 0] - The starting index of the element to be unpacked.
  10311. * @param [result] - The object into which to store the result.
  10312. * @returns The modified result parameter or a new Matrix4 instance if one was not provided.
  10313. */
  10314. static unpack(array: number[], startingIndex?: number, result?: Matrix4): Matrix4;
  10315. /**
  10316. * Flattens an array of Matrix4s into an array of components. The components
  10317. * are stored in column-major order.
  10318. * @param array - The array of matrices to pack.
  10319. * @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.
  10320. * @returns The packed array.
  10321. */
  10322. static packArray(array: Matrix4[], result?: number[]): number[];
  10323. /**
  10324. * Unpacks an array of column-major matrix components into an array of Matrix4s.
  10325. * @param array - The array of components to unpack.
  10326. * @param [result] - The array onto which to store the result.
  10327. * @returns The unpacked array.
  10328. */
  10329. static unpackArray(array: number[], result?: Matrix4[]): Matrix4[];
  10330. /**
  10331. * Duplicates a Matrix4 instance.
  10332. * @param matrix - The matrix to duplicate.
  10333. * @param [result] - The object onto which to store the result.
  10334. * @returns The modified result parameter or a new Matrix4 instance if one was not provided. (Returns undefined if matrix is undefined)
  10335. */
  10336. static clone(matrix: Matrix4, result?: Matrix4): Matrix4;
  10337. /**
  10338. * Creates a Matrix4 from 16 consecutive elements in an array.
  10339. * @example
  10340. * // Create the Matrix4:
  10341. * // [1.0, 2.0, 3.0, 4.0]
  10342. * // [1.0, 2.0, 3.0, 4.0]
  10343. * // [1.0, 2.0, 3.0, 4.0]
  10344. * // [1.0, 2.0, 3.0, 4.0]
  10345. *
  10346. * 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];
  10347. * const m = Cesium.Matrix4.fromArray(v);
  10348. *
  10349. * // Create same Matrix4 with using an offset into an array
  10350. * 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];
  10351. * const m2 = Cesium.Matrix4.fromArray(v2, 2);
  10352. * @param array - The array whose 16 consecutive elements correspond to the positions of the matrix. Assumes column-major order.
  10353. * @param [startingIndex = 0] - The offset into the array of the first element, which corresponds to first column first row position in the matrix.
  10354. * @param [result] - The object onto which to store the result.
  10355. * @returns The modified result parameter or a new Matrix4 instance if one was not provided.
  10356. */
  10357. static fromArray(array: number[], startingIndex?: number, result?: Matrix4): Matrix4;
  10358. /**
  10359. * Computes a Matrix4 instance from a column-major order array.
  10360. * @param values - The column-major order array.
  10361. * @param [result] - The object in which the result will be stored, if undefined a new instance will be created.
  10362. * @returns The modified result parameter, or a new Matrix4 instance if one was not provided.
  10363. */
  10364. static fromColumnMajorArray(values: number[], result?: Matrix4): Matrix4;
  10365. /**
  10366. * Computes a Matrix4 instance from a row-major order array.
  10367. * The resulting matrix will be in column-major order.
  10368. * @param values - The row-major order array.
  10369. * @param [result] - The object in which the result will be stored, if undefined a new instance will be created.
  10370. * @returns The modified result parameter, or a new Matrix4 instance if one was not provided.
  10371. */
  10372. static fromRowMajorArray(values: number[], result?: Matrix4): Matrix4;
  10373. /**
  10374. * Computes a Matrix4 instance from a Matrix3 representing the rotation
  10375. * and a Cartesian3 representing the translation.
  10376. * @param rotation - The upper left portion of the matrix representing the rotation.
  10377. * @param [translation = Cartesian3.ZERO] - The upper right portion of the matrix representing the translation.
  10378. * @param [result] - The object in which the result will be stored, if undefined a new instance will be created.
  10379. * @returns The modified result parameter, or a new Matrix4 instance if one was not provided.
  10380. */
  10381. static fromRotationTranslation(rotation: Matrix3, translation?: Cartesian3, result?: Matrix4): Matrix4;
  10382. /**
  10383. * Computes a Matrix4 instance from a translation, rotation, and scale (TRS)
  10384. * representation with the rotation represented as a quaternion.
  10385. * @example
  10386. * const result = Cesium.Matrix4.fromTranslationQuaternionRotationScale(
  10387. * new Cesium.Cartesian3(1.0, 2.0, 3.0), // translation
  10388. * Cesium.Quaternion.IDENTITY, // rotation
  10389. * new Cesium.Cartesian3(7.0, 8.0, 9.0), // scale
  10390. * result);
  10391. * @param translation - The translation transformation.
  10392. * @param rotation - The rotation transformation.
  10393. * @param scale - The non-uniform scale transformation.
  10394. * @param [result] - The object in which the result will be stored, if undefined a new instance will be created.
  10395. * @returns The modified result parameter, or a new Matrix4 instance if one was not provided.
  10396. */
  10397. static fromTranslationQuaternionRotationScale(translation: Cartesian3, rotation: Quaternion, scale: Cartesian3, result?: Matrix4): Matrix4;
  10398. /**
  10399. * Creates a Matrix4 instance from a {@link TranslationRotationScale} instance.
  10400. * @param translationRotationScale - The instance.
  10401. * @param [result] - The object in which the result will be stored, if undefined a new instance will be created.
  10402. * @returns The modified result parameter, or a new Matrix4 instance if one was not provided.
  10403. */
  10404. static fromTranslationRotationScale(translationRotationScale: TranslationRotationScale, result?: Matrix4): Matrix4;
  10405. /**
  10406. * Creates a Matrix4 instance from a Cartesian3 representing the translation.
  10407. * @param translation - The upper right portion of the matrix representing the translation.
  10408. * @param [result] - The object in which the result will be stored, if undefined a new instance will be created.
  10409. * @returns The modified result parameter, or a new Matrix4 instance if one was not provided.
  10410. */
  10411. static fromTranslation(translation: Cartesian3, result?: Matrix4): Matrix4;
  10412. /**
  10413. * Computes a Matrix4 instance representing a non-uniform scale.
  10414. * @example
  10415. * // Creates
  10416. * // [7.0, 0.0, 0.0, 0.0]
  10417. * // [0.0, 8.0, 0.0, 0.0]
  10418. * // [0.0, 0.0, 9.0, 0.0]
  10419. * // [0.0, 0.0, 0.0, 1.0]
  10420. * const m = Cesium.Matrix4.fromScale(new Cesium.Cartesian3(7.0, 8.0, 9.0));
  10421. * @param scale - The x, y, and z scale factors.
  10422. * @param [result] - The object in which the result will be stored, if undefined a new instance will be created.
  10423. * @returns The modified result parameter, or a new Matrix4 instance if one was not provided.
  10424. */
  10425. static fromScale(scale: Cartesian3, result?: Matrix4): Matrix4;
  10426. /**
  10427. * Computes a Matrix4 instance representing a uniform scale.
  10428. * @example
  10429. * // Creates
  10430. * // [2.0, 0.0, 0.0, 0.0]
  10431. * // [0.0, 2.0, 0.0, 0.0]
  10432. * // [0.0, 0.0, 2.0, 0.0]
  10433. * // [0.0, 0.0, 0.0, 1.0]
  10434. * const m = Cesium.Matrix4.fromUniformScale(2.0);
  10435. * @param scale - The uniform scale factor.
  10436. * @param [result] - The object in which the result will be stored, if undefined a new instance will be created.
  10437. * @returns The modified result parameter, or a new Matrix4 instance if one was not provided.
  10438. */
  10439. static fromUniformScale(scale: number, result?: Matrix4): Matrix4;
  10440. /**
  10441. * Creates a rotation matrix.
  10442. * @param rotation - The rotation matrix.
  10443. * @param [result] - The object in which the result will be stored, if undefined a new instance will be created.
  10444. * @returns The modified result parameter, or a new Matrix4 instance if one was not provided.
  10445. */
  10446. static fromRotation(rotation: Matrix3, result?: Matrix4): Matrix4;
  10447. /**
  10448. * Computes a Matrix4 instance from a Camera.
  10449. * @param camera - The camera to use.
  10450. * @param [result] - The object in which the result will be stored, if undefined a new instance will be created.
  10451. * @returns The modified result parameter, or a new Matrix4 instance if one was not provided.
  10452. */
  10453. static fromCamera(camera: Camera, result?: Matrix4): Matrix4;
  10454. /**
  10455. * Computes a Matrix4 instance representing a perspective transformation matrix.
  10456. * @param fovY - The field of view along the Y axis in radians.
  10457. * @param aspectRatio - The aspect ratio.
  10458. * @param near - The distance to the near plane in meters.
  10459. * @param far - The distance to the far plane in meters.
  10460. * @param result - The object in which the result will be stored.
  10461. * @returns The modified result parameter.
  10462. */
  10463. static computePerspectiveFieldOfView(fovY: number, aspectRatio: number, near: number, far: number, result: Matrix4): Matrix4;
  10464. /**
  10465. * Computes a Matrix4 instance representing an orthographic transformation matrix.
  10466. * @param left - The number of meters to the left of the camera that will be in view.
  10467. * @param right - The number of meters to the right of the camera that will be in view.
  10468. * @param bottom - The number of meters below of the camera that will be in view.
  10469. * @param top - The number of meters above of the camera that will be in view.
  10470. * @param near - The distance to the near plane in meters.
  10471. * @param far - The distance to the far plane in meters.
  10472. * @param result - The object in which the result will be stored.
  10473. * @returns The modified result parameter.
  10474. */
  10475. static computeOrthographicOffCenter(left: number, right: number, bottom: number, top: number, near: number, far: number, result: Matrix4): Matrix4;
  10476. /**
  10477. * Computes a Matrix4 instance representing an off center perspective transformation.
  10478. * @param left - The number of meters to the left of the camera that will be in view.
  10479. * @param right - The number of meters to the right of the camera that will be in view.
  10480. * @param bottom - The number of meters below of the camera that will be in view.
  10481. * @param top - The number of meters above of the camera that will be in view.
  10482. * @param near - The distance to the near plane in meters.
  10483. * @param far - The distance to the far plane in meters.
  10484. * @param result - The object in which the result will be stored.
  10485. * @returns The modified result parameter.
  10486. */
  10487. static computePerspectiveOffCenter(left: number, right: number, bottom: number, top: number, near: number, far: number, result: Matrix4): Matrix4;
  10488. /**
  10489. * Computes a Matrix4 instance representing an infinite off center perspective transformation.
  10490. * @param left - The number of meters to the left of the camera that will be in view.
  10491. * @param right - The number of meters to the right of the camera that will be in view.
  10492. * @param bottom - The number of meters below of the camera that will be in view.
  10493. * @param top - The number of meters above of the camera that will be in view.
  10494. * @param near - The distance to the near plane in meters.
  10495. * @param result - The object in which the result will be stored.
  10496. * @returns The modified result parameter.
  10497. */
  10498. static computeInfinitePerspectiveOffCenter(left: number, right: number, bottom: number, top: number, near: number, result: Matrix4): Matrix4;
  10499. /**
  10500. * Computes a Matrix4 instance that transforms from normalized device coordinates to window coordinates.
  10501. * @example
  10502. * // Create viewport transformation using an explicit viewport and depth range.
  10503. * const m = Cesium.Matrix4.computeViewportTransformation({
  10504. * x : 0.0,
  10505. * y : 0.0,
  10506. * width : 1024.0,
  10507. * height : 768.0
  10508. * }, 0.0, 1.0, new Cesium.Matrix4());
  10509. * @param [viewport = { x : 0.0, y : 0.0, width : 0.0, height : 0.0 }] - The viewport's corners as shown in Example 1.
  10510. * @param [nearDepthRange = 0.0] - The near plane distance in window coordinates.
  10511. * @param [farDepthRange = 1.0] - The far plane distance in window coordinates.
  10512. * @param [result] - The object in which the result will be stored.
  10513. * @returns The modified result parameter.
  10514. */
  10515. static computeViewportTransformation(viewport?: any, nearDepthRange?: number, farDepthRange?: number, result?: Matrix4): Matrix4;
  10516. /**
  10517. * Computes a Matrix4 instance that transforms from world space to view space.
  10518. * @param position - The position of the camera.
  10519. * @param direction - The forward direction.
  10520. * @param up - The up direction.
  10521. * @param right - The right direction.
  10522. * @param result - The object in which the result will be stored.
  10523. * @returns The modified result parameter.
  10524. */
  10525. static computeView(position: Cartesian3, direction: Cartesian3, up: Cartesian3, right: Cartesian3, result: Matrix4): Matrix4;
  10526. /**
  10527. * Computes an Array from the provided Matrix4 instance.
  10528. * The array will be in column-major order.
  10529. * @example
  10530. * //create an array from an instance of Matrix4
  10531. * // m = [10.0, 14.0, 18.0, 22.0]
  10532. * // [11.0, 15.0, 19.0, 23.0]
  10533. * // [12.0, 16.0, 20.0, 24.0]
  10534. * // [13.0, 17.0, 21.0, 25.0]
  10535. * const a = Cesium.Matrix4.toArray(m);
  10536. *
  10537. * // m remains the same
  10538. * //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]
  10539. * @param matrix - The matrix to use..
  10540. * @param [result] - The Array onto which to store the result.
  10541. * @returns The modified Array parameter or a new Array instance if one was not provided.
  10542. */
  10543. static toArray(matrix: Matrix4, result?: number[]): number[];
  10544. /**
  10545. * Computes the array index of the element at the provided row and column.
  10546. * @example
  10547. * const myMatrix = new Cesium.Matrix4();
  10548. * const column1Row0Index = Cesium.Matrix4.getElementIndex(1, 0);
  10549. * const column1Row0 = myMatrix[column1Row0Index];
  10550. * myMatrix[column1Row0Index] = 10.0;
  10551. * @param row - The zero-based index of the row.
  10552. * @param column - The zero-based index of the column.
  10553. * @returns The index of the element at the provided row and column.
  10554. */
  10555. static getElementIndex(row: number, column: number): number;
  10556. /**
  10557. * Retrieves a copy of the matrix column at the provided index as a Cartesian4 instance.
  10558. * @example
  10559. * //returns a Cartesian4 instance with values from the specified column
  10560. * // m = [10.0, 11.0, 12.0, 13.0]
  10561. * // [14.0, 15.0, 16.0, 17.0]
  10562. * // [18.0, 19.0, 20.0, 21.0]
  10563. * // [22.0, 23.0, 24.0, 25.0]
  10564. *
  10565. * //Example 1: Creates an instance of Cartesian
  10566. * const a = Cesium.Matrix4.getColumn(m, 2, new Cesium.Cartesian4());
  10567. * @example
  10568. * //Example 2: Sets values for Cartesian instance
  10569. * const a = new Cesium.Cartesian4();
  10570. * Cesium.Matrix4.getColumn(m, 2, a);
  10571. *
  10572. * // a.x = 12.0; a.y = 16.0; a.z = 20.0; a.w = 24.0;
  10573. * @param matrix - The matrix to use.
  10574. * @param index - The zero-based index of the column to retrieve.
  10575. * @param result - The object onto which to store the result.
  10576. * @returns The modified result parameter.
  10577. */
  10578. static getColumn(matrix: Matrix4, index: number, result: Cartesian4): Cartesian4;
  10579. /**
  10580. * Computes a new matrix that replaces the specified column in the provided matrix with the provided Cartesian4 instance.
  10581. * @example
  10582. * //creates a new Matrix4 instance with new column values from the Cartesian4 instance
  10583. * // m = [10.0, 11.0, 12.0, 13.0]
  10584. * // [14.0, 15.0, 16.0, 17.0]
  10585. * // [18.0, 19.0, 20.0, 21.0]
  10586. * // [22.0, 23.0, 24.0, 25.0]
  10587. *
  10588. * const a = Cesium.Matrix4.setColumn(m, 2, new Cesium.Cartesian4(99.0, 98.0, 97.0, 96.0), new Cesium.Matrix4());
  10589. *
  10590. * // m remains the same
  10591. * // a = [10.0, 11.0, 99.0, 13.0]
  10592. * // [14.0, 15.0, 98.0, 17.0]
  10593. * // [18.0, 19.0, 97.0, 21.0]
  10594. * // [22.0, 23.0, 96.0, 25.0]
  10595. * @param matrix - The matrix to use.
  10596. * @param index - The zero-based index of the column to set.
  10597. * @param cartesian - The Cartesian whose values will be assigned to the specified column.
  10598. * @param result - The object onto which to store the result.
  10599. * @returns The modified result parameter.
  10600. */
  10601. static setColumn(matrix: Matrix4, index: number, cartesian: Cartesian4, result: Matrix4): Matrix4;
  10602. /**
  10603. * Retrieves a copy of the matrix row at the provided index as a Cartesian4 instance.
  10604. * @example
  10605. * //returns a Cartesian4 instance with values from the specified column
  10606. * // m = [10.0, 11.0, 12.0, 13.0]
  10607. * // [14.0, 15.0, 16.0, 17.0]
  10608. * // [18.0, 19.0, 20.0, 21.0]
  10609. * // [22.0, 23.0, 24.0, 25.0]
  10610. *
  10611. * //Example 1: Returns an instance of Cartesian
  10612. * const a = Cesium.Matrix4.getRow(m, 2, new Cesium.Cartesian4());
  10613. * @example
  10614. * //Example 2: Sets values for a Cartesian instance
  10615. * const a = new Cesium.Cartesian4();
  10616. * Cesium.Matrix4.getRow(m, 2, a);
  10617. *
  10618. * // a.x = 18.0; a.y = 19.0; a.z = 20.0; a.w = 21.0;
  10619. * @param matrix - The matrix to use.
  10620. * @param index - The zero-based index of the row to retrieve.
  10621. * @param result - The object onto which to store the result.
  10622. * @returns The modified result parameter.
  10623. */
  10624. static getRow(matrix: Matrix4, index: number, result: Cartesian4): Cartesian4;
  10625. /**
  10626. * Computes a new matrix that replaces the specified row in the provided matrix with the provided Cartesian4 instance.
  10627. * @example
  10628. * //create a new Matrix4 instance with new row values from the Cartesian4 instance
  10629. * // m = [10.0, 11.0, 12.0, 13.0]
  10630. * // [14.0, 15.0, 16.0, 17.0]
  10631. * // [18.0, 19.0, 20.0, 21.0]
  10632. * // [22.0, 23.0, 24.0, 25.0]
  10633. *
  10634. * const a = Cesium.Matrix4.setRow(m, 2, new Cesium.Cartesian4(99.0, 98.0, 97.0, 96.0), new Cesium.Matrix4());
  10635. *
  10636. * // m remains the same
  10637. * // a = [10.0, 11.0, 12.0, 13.0]
  10638. * // [14.0, 15.0, 16.0, 17.0]
  10639. * // [99.0, 98.0, 97.0, 96.0]
  10640. * // [22.0, 23.0, 24.0, 25.0]
  10641. * @param matrix - The matrix to use.
  10642. * @param index - The zero-based index of the row to set.
  10643. * @param cartesian - The Cartesian whose values will be assigned to the specified row.
  10644. * @param result - The object onto which to store the result.
  10645. * @returns The modified result parameter.
  10646. */
  10647. static setRow(matrix: Matrix4, index: number, cartesian: Cartesian4, result: Matrix4): Matrix4;
  10648. /**
  10649. * Computes a new matrix that replaces the translation in the rightmost column of the provided
  10650. * matrix with the provided translation. This assumes the matrix is an affine transformation.
  10651. * @param matrix - The matrix to use.
  10652. * @param translation - The translation that replaces the translation of the provided matrix.
  10653. * @param result - The object onto which to store the result.
  10654. * @returns The modified result parameter.
  10655. */
  10656. static setTranslation(matrix: Matrix4, translation: Cartesian3, result: Matrix4): Matrix4;
  10657. /**
  10658. * Computes a new matrix that replaces the scale with the provided scale.
  10659. * This assumes the matrix is an affine transformation.
  10660. * @param matrix - The matrix to use.
  10661. * @param scale - The scale that replaces the scale of the provided matrix.
  10662. * @param result - The object onto which to store the result.
  10663. * @returns The modified result parameter.
  10664. */
  10665. static setScale(matrix: Matrix4, scale: Cartesian3, result: Matrix4): Matrix4;
  10666. /**
  10667. * Computes a new matrix that replaces the scale with the provided uniform scale.
  10668. * This assumes the matrix is an affine transformation.
  10669. * @param matrix - The matrix to use.
  10670. * @param scale - The uniform scale that replaces the scale of the provided matrix.
  10671. * @param result - The object onto which to store the result.
  10672. * @returns The modified result parameter.
  10673. */
  10674. static setUniformScale(matrix: Matrix4, scale: number, result: Matrix4): Matrix4;
  10675. /**
  10676. * Extracts the non-uniform scale assuming the matrix is an affine transformation.
  10677. * @param matrix - The matrix.
  10678. * @param result - The object onto which to store the result.
  10679. * @returns The modified result parameter
  10680. */
  10681. static getScale(matrix: Matrix4, result: Cartesian3): Cartesian3;
  10682. /**
  10683. * Computes the maximum scale assuming the matrix is an affine transformation.
  10684. * The maximum scale is the maximum length of the column vectors in the upper-left
  10685. * 3x3 matrix.
  10686. * @param matrix - The matrix.
  10687. * @returns The maximum scale.
  10688. */
  10689. static getMaximumScale(matrix: Matrix4): number;
  10690. /**
  10691. * Sets the rotation assuming the matrix is an affine transformation.
  10692. * @param matrix - The matrix.
  10693. * @param rotation - The rotation matrix.
  10694. * @returns The modified result parameter.
  10695. */
  10696. static setRotation(matrix: Matrix4, rotation: Matrix4): Matrix4;
  10697. /**
  10698. * Extracts the rotation matrix assuming the matrix is an affine transformation.
  10699. * @param matrix - The matrix.
  10700. * @param result - The object onto which to store the result.
  10701. * @returns The modified result parameter.
  10702. */
  10703. static getRotation(matrix: Matrix4, result: Matrix4): Matrix4;
  10704. /**
  10705. * Computes the product of two matrices.
  10706. * @param left - The first matrix.
  10707. * @param right - The second matrix.
  10708. * @param result - The object onto which to store the result.
  10709. * @returns The modified result parameter.
  10710. */
  10711. static multiply(left: Matrix4, right: Matrix4, result: Matrix4): Matrix4;
  10712. /**
  10713. * Computes the sum of two matrices.
  10714. * @param left - The first matrix.
  10715. * @param right - The second matrix.
  10716. * @param result - The object onto which to store the result.
  10717. * @returns The modified result parameter.
  10718. */
  10719. static add(left: Matrix4, right: Matrix4, result: Matrix4): Matrix4;
  10720. /**
  10721. * Computes the difference of two matrices.
  10722. * @param left - The first matrix.
  10723. * @param right - The second matrix.
  10724. * @param result - The object onto which to store the result.
  10725. * @returns The modified result parameter.
  10726. */
  10727. static subtract(left: Matrix4, right: Matrix4, result: Matrix4): Matrix4;
  10728. /**
  10729. * Computes the product of two matrices assuming the matrices are affine transformation matrices,
  10730. * where the upper left 3x3 elements are any matrix, and
  10731. * the upper three elements in the fourth column are the translation.
  10732. * The bottom row is assumed to be [0, 0, 0, 1].
  10733. * The matrix is not verified to be in the proper form.
  10734. * This method is faster than computing the product for general 4x4
  10735. * matrices using {@link Matrix4.multiply}.
  10736. * @example
  10737. * 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);
  10738. * const m2 = Cesium.Transforms.eastNorthUpToFixedFrame(new Cesium.Cartesian3(1.0, 1.0, 1.0));
  10739. * const m3 = Cesium.Matrix4.multiplyTransformation(m1, m2, new Cesium.Matrix4());
  10740. * @param left - The first matrix.
  10741. * @param right - The second matrix.
  10742. * @param result - The object onto which to store the result.
  10743. * @returns The modified result parameter.
  10744. */
  10745. static multiplyTransformation(left: Matrix4, right: Matrix4, result: Matrix4): Matrix4;
  10746. /**
  10747. * Multiplies a transformation matrix (with a bottom row of <code>[0.0, 0.0, 0.0, 1.0]</code>)
  10748. * by a 3x3 rotation matrix. This is an optimization
  10749. * for <code>Matrix4.multiply(m, Matrix4.fromRotationTranslation(rotation), m);</code> with less allocations and arithmetic operations.
  10750. * @example
  10751. * // Instead of Cesium.Matrix4.multiply(m, Cesium.Matrix4.fromRotationTranslation(rotation), m);
  10752. * Cesium.Matrix4.multiplyByMatrix3(m, rotation, m);
  10753. * @param matrix - The matrix on the left-hand side.
  10754. * @param rotation - The 3x3 rotation matrix on the right-hand side.
  10755. * @param result - The object onto which to store the result.
  10756. * @returns The modified result parameter.
  10757. */
  10758. static multiplyByMatrix3(matrix: Matrix4, rotation: Matrix3, result: Matrix4): Matrix4;
  10759. /**
  10760. * Multiplies a transformation matrix (with a bottom row of <code>[0.0, 0.0, 0.0, 1.0]</code>)
  10761. * by an implicit translation matrix defined by a {@link Cartesian3}. This is an optimization
  10762. * for <code>Matrix4.multiply(m, Matrix4.fromTranslation(position), m);</code> with less allocations and arithmetic operations.
  10763. * @example
  10764. * // Instead of Cesium.Matrix4.multiply(m, Cesium.Matrix4.fromTranslation(position), m);
  10765. * Cesium.Matrix4.multiplyByTranslation(m, position, m);
  10766. * @param matrix - The matrix on the left-hand side.
  10767. * @param translation - The translation on the right-hand side.
  10768. * @param result - The object onto which to store the result.
  10769. * @returns The modified result parameter.
  10770. */
  10771. static multiplyByTranslation(matrix: Matrix4, translation: Cartesian3, result: Matrix4): Matrix4;
  10772. /**
  10773. * Multiplies an affine transformation matrix (with a bottom row of <code>[0.0, 0.0, 0.0, 1.0]</code>)
  10774. * by an implicit non-uniform scale matrix. This is an optimization
  10775. * for <code>Matrix4.multiply(m, Matrix4.fromUniformScale(scale), m);</code>, where
  10776. * <code>m</code> must be an affine matrix.
  10777. * This function performs fewer allocations and arithmetic operations.
  10778. * @example
  10779. * // Instead of Cesium.Matrix4.multiply(m, Cesium.Matrix4.fromScale(scale), m);
  10780. * Cesium.Matrix4.multiplyByScale(m, scale, m);
  10781. * @param matrix - The affine matrix on the left-hand side.
  10782. * @param scale - The non-uniform scale on the right-hand side.
  10783. * @param result - The object onto which to store the result.
  10784. * @returns The modified result parameter.
  10785. */
  10786. static multiplyByScale(matrix: Matrix4, scale: Cartesian3, result: Matrix4): Matrix4;
  10787. /**
  10788. * Computes the product of a matrix times a uniform scale, as if the scale were a scale matrix.
  10789. * @example
  10790. * // Instead of Cesium.Matrix4.multiply(m, Cesium.Matrix4.fromUniformScale(scale), m);
  10791. * Cesium.Matrix4.multiplyByUniformScale(m, scale, m);
  10792. * @param matrix - The matrix on the left-hand side.
  10793. * @param scale - The uniform scale on the right-hand side.
  10794. * @param result - The object onto which to store the result.
  10795. * @returns The modified result parameter.
  10796. */
  10797. static multiplyByUniformScale(matrix: Matrix4, scale: number, result: Matrix4): Matrix4;
  10798. /**
  10799. * Computes the product of a matrix and a column vector.
  10800. * @param matrix - The matrix.
  10801. * @param cartesian - The vector.
  10802. * @param result - The object onto which to store the result.
  10803. * @returns The modified result parameter.
  10804. */
  10805. static multiplyByVector(matrix: Matrix4, cartesian: Cartesian4, result: Cartesian4): Cartesian4;
  10806. /**
  10807. * Computes the product of a matrix and a {@link Cartesian3}. This is equivalent to calling {@link Matrix4.multiplyByVector}
  10808. * with a {@link Cartesian4} with a <code>w</code> component of zero.
  10809. * @example
  10810. * const p = new Cesium.Cartesian3(1.0, 2.0, 3.0);
  10811. * const result = Cesium.Matrix4.multiplyByPointAsVector(matrix, p, new Cesium.Cartesian3());
  10812. * // A shortcut for
  10813. * // Cartesian3 p = ...
  10814. * // Cesium.Matrix4.multiplyByVector(matrix, new Cesium.Cartesian4(p.x, p.y, p.z, 0.0), result);
  10815. * @param matrix - The matrix.
  10816. * @param cartesian - The point.
  10817. * @param result - The object onto which to store the result.
  10818. * @returns The modified result parameter.
  10819. */
  10820. static multiplyByPointAsVector(matrix: Matrix4, cartesian: Cartesian3, result: Cartesian3): Cartesian3;
  10821. /**
  10822. * Computes the product of a matrix and a {@link Cartesian3}. This is equivalent to calling {@link Matrix4.multiplyByVector}
  10823. * with a {@link Cartesian4} with a <code>w</code> component of 1, but returns a {@link Cartesian3} instead of a {@link Cartesian4}.
  10824. * @example
  10825. * const p = new Cesium.Cartesian3(1.0, 2.0, 3.0);
  10826. * const result = Cesium.Matrix4.multiplyByPoint(matrix, p, new Cesium.Cartesian3());
  10827. * @param matrix - The matrix.
  10828. * @param cartesian - The point.
  10829. * @param result - The object onto which to store the result.
  10830. * @returns The modified result parameter.
  10831. */
  10832. static multiplyByPoint(matrix: Matrix4, cartesian: Cartesian3, result: Cartesian3): Cartesian3;
  10833. /**
  10834. * Computes the product of a matrix and a scalar.
  10835. * @example
  10836. * //create a Matrix4 instance which is a scaled version of the supplied Matrix4
  10837. * // m = [10.0, 11.0, 12.0, 13.0]
  10838. * // [14.0, 15.0, 16.0, 17.0]
  10839. * // [18.0, 19.0, 20.0, 21.0]
  10840. * // [22.0, 23.0, 24.0, 25.0]
  10841. *
  10842. * const a = Cesium.Matrix4.multiplyByScalar(m, -2, new Cesium.Matrix4());
  10843. *
  10844. * // m remains the same
  10845. * // a = [-20.0, -22.0, -24.0, -26.0]
  10846. * // [-28.0, -30.0, -32.0, -34.0]
  10847. * // [-36.0, -38.0, -40.0, -42.0]
  10848. * // [-44.0, -46.0, -48.0, -50.0]
  10849. * @param matrix - The matrix.
  10850. * @param scalar - The number to multiply by.
  10851. * @param result - The object onto which to store the result.
  10852. * @returns The modified result parameter.
  10853. */
  10854. static multiplyByScalar(matrix: Matrix4, scalar: number, result: Matrix4): Matrix4;
  10855. /**
  10856. * Computes a negated copy of the provided matrix.
  10857. * @example
  10858. * //create a new Matrix4 instance which is a negation of a Matrix4
  10859. * // m = [10.0, 11.0, 12.0, 13.0]
  10860. * // [14.0, 15.0, 16.0, 17.0]
  10861. * // [18.0, 19.0, 20.0, 21.0]
  10862. * // [22.0, 23.0, 24.0, 25.0]
  10863. *
  10864. * const a = Cesium.Matrix4.negate(m, new Cesium.Matrix4());
  10865. *
  10866. * // m remains the same
  10867. * // a = [-10.0, -11.0, -12.0, -13.0]
  10868. * // [-14.0, -15.0, -16.0, -17.0]
  10869. * // [-18.0, -19.0, -20.0, -21.0]
  10870. * // [-22.0, -23.0, -24.0, -25.0]
  10871. * @param matrix - The matrix to negate.
  10872. * @param result - The object onto which to store the result.
  10873. * @returns The modified result parameter.
  10874. */
  10875. static negate(matrix: Matrix4, result: Matrix4): Matrix4;
  10876. /**
  10877. * Computes the transpose of the provided matrix.
  10878. * @example
  10879. * //returns transpose of a Matrix4
  10880. * // m = [10.0, 11.0, 12.0, 13.0]
  10881. * // [14.0, 15.0, 16.0, 17.0]
  10882. * // [18.0, 19.0, 20.0, 21.0]
  10883. * // [22.0, 23.0, 24.0, 25.0]
  10884. *
  10885. * const a = Cesium.Matrix4.transpose(m, new Cesium.Matrix4());
  10886. *
  10887. * // m remains the same
  10888. * // a = [10.0, 14.0, 18.0, 22.0]
  10889. * // [11.0, 15.0, 19.0, 23.0]
  10890. * // [12.0, 16.0, 20.0, 24.0]
  10891. * // [13.0, 17.0, 21.0, 25.0]
  10892. * @param matrix - The matrix to transpose.
  10893. * @param result - The object onto which to store the result.
  10894. * @returns The modified result parameter.
  10895. */
  10896. static transpose(matrix: Matrix4, result: Matrix4): Matrix4;
  10897. /**
  10898. * Computes a matrix, which contains the absolute (unsigned) values of the provided matrix's elements.
  10899. * @param matrix - The matrix with signed elements.
  10900. * @param result - The object onto which to store the result.
  10901. * @returns The modified result parameter.
  10902. */
  10903. static abs(matrix: Matrix4, result: Matrix4): Matrix4;
  10904. /**
  10905. * Compares the provided matrices componentwise and returns
  10906. * <code>true</code> if they are equal, <code>false</code> otherwise.
  10907. * @example
  10908. * //compares two Matrix4 instances
  10909. *
  10910. * // a = [10.0, 14.0, 18.0, 22.0]
  10911. * // [11.0, 15.0, 19.0, 23.0]
  10912. * // [12.0, 16.0, 20.0, 24.0]
  10913. * // [13.0, 17.0, 21.0, 25.0]
  10914. *
  10915. * // b = [10.0, 14.0, 18.0, 22.0]
  10916. * // [11.0, 15.0, 19.0, 23.0]
  10917. * // [12.0, 16.0, 20.0, 24.0]
  10918. * // [13.0, 17.0, 21.0, 25.0]
  10919. *
  10920. * if(Cesium.Matrix4.equals(a,b)) {
  10921. * console.log("Both matrices are equal");
  10922. * } else {
  10923. * console.log("They are not equal");
  10924. * }
  10925. *
  10926. * //Prints "Both matrices are equal" on the console
  10927. * @param [left] - The first matrix.
  10928. * @param [right] - The second matrix.
  10929. * @returns <code>true</code> if left and right are equal, <code>false</code> otherwise.
  10930. */
  10931. static equals(left?: Matrix4, right?: Matrix4): boolean;
  10932. /**
  10933. * Compares the provided matrices componentwise and returns
  10934. * <code>true</code> if they are within the provided epsilon,
  10935. * <code>false</code> otherwise.
  10936. * @example
  10937. * //compares two Matrix4 instances
  10938. *
  10939. * // a = [10.5, 14.5, 18.5, 22.5]
  10940. * // [11.5, 15.5, 19.5, 23.5]
  10941. * // [12.5, 16.5, 20.5, 24.5]
  10942. * // [13.5, 17.5, 21.5, 25.5]
  10943. *
  10944. * // b = [10.0, 14.0, 18.0, 22.0]
  10945. * // [11.0, 15.0, 19.0, 23.0]
  10946. * // [12.0, 16.0, 20.0, 24.0]
  10947. * // [13.0, 17.0, 21.0, 25.0]
  10948. *
  10949. * if(Cesium.Matrix4.equalsEpsilon(a,b,0.1)){
  10950. * console.log("Difference between both the matrices is less than 0.1");
  10951. * } else {
  10952. * console.log("Difference between both the matrices is not less than 0.1");
  10953. * }
  10954. *
  10955. * //Prints "Difference between both the matrices is not less than 0.1" on the console
  10956. * @param [left] - The first matrix.
  10957. * @param [right] - The second matrix.
  10958. * @param [epsilon = 0] - The epsilon to use for equality testing.
  10959. * @returns <code>true</code> if left and right are within the provided epsilon, <code>false</code> otherwise.
  10960. */
  10961. static equalsEpsilon(left?: Matrix4, right?: Matrix4, epsilon?: number): boolean;
  10962. /**
  10963. * Gets the translation portion of the provided matrix, assuming the matrix is an affine transformation matrix.
  10964. * @param matrix - The matrix to use.
  10965. * @param result - The object onto which to store the result.
  10966. * @returns The modified result parameter.
  10967. */
  10968. static getTranslation(matrix: Matrix4, result: Cartesian3): Cartesian3;
  10969. /**
  10970. * Gets the upper left 3x3 matrix of the provided matrix.
  10971. * @example
  10972. * // returns a Matrix3 instance from a Matrix4 instance
  10973. *
  10974. * // m = [10.0, 14.0, 18.0, 22.0]
  10975. * // [11.0, 15.0, 19.0, 23.0]
  10976. * // [12.0, 16.0, 20.0, 24.0]
  10977. * // [13.0, 17.0, 21.0, 25.0]
  10978. *
  10979. * const b = new Cesium.Matrix3();
  10980. * Cesium.Matrix4.getMatrix3(m,b);
  10981. *
  10982. * // b = [10.0, 14.0, 18.0]
  10983. * // [11.0, 15.0, 19.0]
  10984. * // [12.0, 16.0, 20.0]
  10985. * @param matrix - The matrix to use.
  10986. * @param result - The object onto which to store the result.
  10987. * @returns The modified result parameter.
  10988. */
  10989. static getMatrix3(matrix: Matrix4, result: Matrix3): Matrix3;
  10990. /**
  10991. * Computes the inverse of the provided matrix using Cramers Rule.
  10992. * If the determinant is zero, the matrix can not be inverted, and an exception is thrown.
  10993. * If the matrix is a proper rigid transformation, it is more efficient
  10994. * to invert it with {@link Matrix4.inverseTransformation}.
  10995. * @param matrix - The matrix to invert.
  10996. * @param result - The object onto which to store the result.
  10997. * @returns The modified result parameter.
  10998. */
  10999. static inverse(matrix: Matrix4, result: Matrix4): Matrix4;
  11000. /**
  11001. * Computes the inverse of the provided matrix assuming it is a proper rigid matrix,
  11002. * where the upper left 3x3 elements are a rotation matrix,
  11003. * and the upper three elements in the fourth column are the translation.
  11004. * The bottom row is assumed to be [0, 0, 0, 1].
  11005. * The matrix is not verified to be in the proper form.
  11006. * This method is faster than computing the inverse for a general 4x4
  11007. * matrix using {@link Matrix4.inverse}.
  11008. * @param matrix - The matrix to invert.
  11009. * @param result - The object onto which to store the result.
  11010. * @returns The modified result parameter.
  11011. */
  11012. static inverseTransformation(matrix: Matrix4, result: Matrix4): Matrix4;
  11013. /**
  11014. * Computes the inverse transpose of a matrix.
  11015. * @param matrix - The matrix to transpose and invert.
  11016. * @param result - The object onto which to store the result.
  11017. * @returns The modified result parameter.
  11018. */
  11019. static inverseTranspose(matrix: Matrix4, result: Matrix4): Matrix4;
  11020. /**
  11021. * An immutable Matrix4 instance initialized to the identity matrix.
  11022. */
  11023. static readonly IDENTITY: Matrix4;
  11024. /**
  11025. * An immutable Matrix4 instance initialized to the zero matrix.
  11026. */
  11027. static readonly ZERO: Matrix4;
  11028. /**
  11029. * The index into Matrix4 for column 0, row 0.
  11030. */
  11031. static readonly COLUMN0ROW0: number;
  11032. /**
  11033. * The index into Matrix4 for column 0, row 1.
  11034. */
  11035. static readonly COLUMN0ROW1: number;
  11036. /**
  11037. * The index into Matrix4 for column 0, row 2.
  11038. */
  11039. static readonly COLUMN0ROW2: number;
  11040. /**
  11041. * The index into Matrix4 for column 0, row 3.
  11042. */
  11043. static readonly COLUMN0ROW3: number;
  11044. /**
  11045. * The index into Matrix4 for column 1, row 0.
  11046. */
  11047. static readonly COLUMN1ROW0: number;
  11048. /**
  11049. * The index into Matrix4 for column 1, row 1.
  11050. */
  11051. static readonly COLUMN1ROW1: number;
  11052. /**
  11053. * The index into Matrix4 for column 1, row 2.
  11054. */
  11055. static readonly COLUMN1ROW2: number;
  11056. /**
  11057. * The index into Matrix4 for column 1, row 3.
  11058. */
  11059. static readonly COLUMN1ROW3: number;
  11060. /**
  11061. * The index into Matrix4 for column 2, row 0.
  11062. */
  11063. static readonly COLUMN2ROW0: number;
  11064. /**
  11065. * The index into Matrix4 for column 2, row 1.
  11066. */
  11067. static readonly COLUMN2ROW1: number;
  11068. /**
  11069. * The index into Matrix4 for column 2, row 2.
  11070. */
  11071. static readonly COLUMN2ROW2: number;
  11072. /**
  11073. * The index into Matrix4 for column 2, row 3.
  11074. */
  11075. static readonly COLUMN2ROW3: number;
  11076. /**
  11077. * The index into Matrix4 for column 3, row 0.
  11078. */
  11079. static readonly COLUMN3ROW0: number;
  11080. /**
  11081. * The index into Matrix4 for column 3, row 1.
  11082. */
  11083. static readonly COLUMN3ROW1: number;
  11084. /**
  11085. * The index into Matrix4 for column 3, row 2.
  11086. */
  11087. static readonly COLUMN3ROW2: number;
  11088. /**
  11089. * The index into Matrix4 for column 3, row 3.
  11090. */
  11091. static readonly COLUMN3ROW3: number;
  11092. /**
  11093. * Gets the number of items in the collection.
  11094. */
  11095. length: number;
  11096. /**
  11097. * Duplicates the provided Matrix4 instance.
  11098. * @param [result] - The object onto which to store the result.
  11099. * @returns The modified result parameter or a new Matrix4 instance if one was not provided.
  11100. */
  11101. clone(result?: Matrix4): Matrix4;
  11102. /**
  11103. * Compares this matrix to the provided matrix componentwise and returns
  11104. * <code>true</code> if they are equal, <code>false</code> otherwise.
  11105. * @param [right] - The right hand side matrix.
  11106. * @returns <code>true</code> if they are equal, <code>false</code> otherwise.
  11107. */
  11108. equals(right?: Matrix4): boolean;
  11109. /**
  11110. * Compares this matrix to the provided matrix componentwise and returns
  11111. * <code>true</code> if they are within the provided epsilon,
  11112. * <code>false</code> otherwise.
  11113. * @param [right] - The right hand side matrix.
  11114. * @param [epsilon = 0] - The epsilon to use for equality testing.
  11115. * @returns <code>true</code> if they are within the provided epsilon, <code>false</code> otherwise.
  11116. */
  11117. equalsEpsilon(right?: Matrix4, epsilon?: number): boolean;
  11118. /**
  11119. * Computes a string representing this Matrix with each row being
  11120. * on a separate line and in the format '(column0, column1, column2, column3)'.
  11121. * @returns A string representing the provided Matrix with each row being on a separate line and in the format '(column0, column1, column2, column3)'.
  11122. */
  11123. toString(): string;
  11124. }
  11125. /**
  11126. * A spline that linearly interpolates over an array of weight values used by morph targets.
  11127. * @example
  11128. * const times = [ 0.0, 1.5, 3.0, 4.5, 6.0 ];
  11129. * const weights = [0.0, 1.0, 0.25, 0.75, 0.5, 0.5, 0.75, 0.25, 1.0, 0.0]; //Two targets
  11130. * const spline = new Cesium.WeightSpline({
  11131. * times : times,
  11132. * weights : weights
  11133. * });
  11134. *
  11135. * const p0 = spline.evaluate(times[0]);
  11136. * @param options - Object with the following properties:
  11137. * @param options.times - An array of strictly increasing, unit-less, floating-point times at each point.
  11138. * The values are in no way connected to the clock time. They are the parameterization for the curve.
  11139. * @param options.weights - The array of floating-point control weights given. The weights are ordered such
  11140. * that all weights for the targets are given in chronological order and order in which they appear in
  11141. * 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) ...]
  11142. * where i and j in w(i,j) are the time indices and target indices, respectively.
  11143. */
  11144. export class MorphWeightSpline {
  11145. constructor(options: {
  11146. times: number[];
  11147. weights: number[];
  11148. });
  11149. /**
  11150. * Finds an index <code>i</code> in <code>times</code> such that the parameter
  11151. * <code>time</code> is in the interval <code>[times[i], times[i + 1]]</code>.
  11152. * @param time - The time.
  11153. * @returns The index for the element at the start of the interval.
  11154. */
  11155. findTimeInterval(time: number): number;
  11156. /**
  11157. * Wraps the given time to the period covered by the spline.
  11158. * @param time - The time.
  11159. * @returns The time, wrapped around to the updated animation.
  11160. */
  11161. wrapTime(time: number): number;
  11162. /**
  11163. * Clamps the given time to the period covered by the spline.
  11164. * @param time - The time.
  11165. * @returns The time, clamped to the animation period.
  11166. */
  11167. clampTime(time: number): number;
  11168. /**
  11169. * Evaluates the curve at a given time.
  11170. * @param time - The time at which to evaluate the curve.
  11171. * @param [result] - The object onto which to store the result.
  11172. * @returns The modified result parameter or a new instance of the point on the curve at the given time.
  11173. */
  11174. evaluate(time: number, result?: number[]): number[];
  11175. }
  11176. /**
  11177. * Represents a scalar value's lower and upper bound at a near distance and far distance in eye space.
  11178. * @param [near = 0.0] - The lower bound of the camera range.
  11179. * @param [nearValue = 0.0] - The value at the lower bound of the camera range.
  11180. * @param [far = 1.0] - The upper bound of the camera range.
  11181. * @param [farValue = 0.0] - The value at the upper bound of the camera range.
  11182. */
  11183. export class NearFarScalar {
  11184. constructor(near?: number, nearValue?: number, far?: number, farValue?: number);
  11185. /**
  11186. * The lower bound of the camera range.
  11187. */
  11188. near: number;
  11189. /**
  11190. * The value at the lower bound of the camera range.
  11191. */
  11192. nearValue: number;
  11193. /**
  11194. * The upper bound of the camera range.
  11195. */
  11196. far: number;
  11197. /**
  11198. * The value at the upper bound of the camera range.
  11199. */
  11200. farValue: number;
  11201. /**
  11202. * Duplicates a NearFarScalar instance.
  11203. * @param nearFarScalar - The NearFarScalar to duplicate.
  11204. * @param [result] - The object onto which to store the result.
  11205. * @returns The modified result parameter or a new NearFarScalar instance if one was not provided. (Returns undefined if nearFarScalar is undefined)
  11206. */
  11207. static clone(nearFarScalar: NearFarScalar, result?: NearFarScalar): NearFarScalar;
  11208. /**
  11209. * The number of elements used to pack the object into an array.
  11210. */
  11211. static packedLength: number;
  11212. /**
  11213. * Stores the provided instance into the provided array.
  11214. * @param value - The value to pack.
  11215. * @param array - The array to pack into.
  11216. * @param [startingIndex = 0] - The index into the array at which to start packing the elements.
  11217. * @returns The array that was packed into
  11218. */
  11219. static pack(value: NearFarScalar, array: number[], startingIndex?: number): number[];
  11220. /**
  11221. * Retrieves an instance from a packed array.
  11222. * @param array - The packed array.
  11223. * @param [startingIndex = 0] - The starting index of the element to be unpacked.
  11224. * @param [result] - The object into which to store the result.
  11225. * @returns The modified result parameter or a new NearFarScalar instance if one was not provided.
  11226. */
  11227. static unpack(array: number[], startingIndex?: number, result?: NearFarScalar): NearFarScalar;
  11228. /**
  11229. * Compares the provided NearFarScalar and returns <code>true</code> if they are equal,
  11230. * <code>false</code> otherwise.
  11231. * @param [left] - The first NearFarScalar.
  11232. * @param [right] - The second NearFarScalar.
  11233. * @returns <code>true</code> if left and right are equal; otherwise <code>false</code>.
  11234. */
  11235. static equals(left?: NearFarScalar, right?: NearFarScalar): boolean;
  11236. /**
  11237. * Duplicates this instance.
  11238. * @param [result] - The object onto which to store the result.
  11239. * @returns The modified result parameter or a new NearFarScalar instance if one was not provided.
  11240. */
  11241. clone(result?: NearFarScalar): NearFarScalar;
  11242. /**
  11243. * Compares this instance to the provided NearFarScalar and returns <code>true</code> if they are equal,
  11244. * <code>false</code> otherwise.
  11245. * @param [right] - The right hand side NearFarScalar.
  11246. * @returns <code>true</code> if left and right are equal; otherwise <code>false</code>.
  11247. */
  11248. equals(right?: NearFarScalar): boolean;
  11249. }
  11250. /**
  11251. * Creates an Occluder derived from an object's position and radius, as well as the camera position.
  11252. * The occluder can be used to determine whether or not other objects are visible or hidden behind the
  11253. * visible horizon defined by the occluder and camera position.
  11254. * @example
  11255. * // Construct an occluder one unit away from the origin with a radius of one.
  11256. * const cameraPosition = Cesium.Cartesian3.ZERO;
  11257. * const occluderBoundingSphere = new Cesium.BoundingSphere(new Cesium.Cartesian3(0, 0, -1), 1);
  11258. * const occluder = new Cesium.Occluder(occluderBoundingSphere, cameraPosition);
  11259. * @param occluderBoundingSphere - The bounding sphere surrounding the occluder.
  11260. * @param cameraPosition - The coordinate of the viewer/camera.
  11261. */
  11262. export class Occluder {
  11263. constructor(occluderBoundingSphere: BoundingSphere, cameraPosition: Cartesian3);
  11264. /**
  11265. * The position of the occluder.
  11266. */
  11267. position: Cartesian3;
  11268. /**
  11269. * The radius of the occluder.
  11270. */
  11271. radius: number;
  11272. /**
  11273. * The position of the camera.
  11274. */
  11275. cameraPosition: Cartesian3;
  11276. /**
  11277. * Creates an occluder from a bounding sphere and the camera position.
  11278. * @param occluderBoundingSphere - The bounding sphere surrounding the occluder.
  11279. * @param cameraPosition - The coordinate of the viewer/camera.
  11280. * @param [result] - The object onto which to store the result.
  11281. * @returns The occluder derived from an object's position and radius, as well as the camera position.
  11282. */
  11283. static fromBoundingSphere(occluderBoundingSphere: BoundingSphere, cameraPosition: Cartesian3, result?: Occluder): Occluder;
  11284. /**
  11285. * Determines whether or not a point, the <code>occludee</code>, is hidden from view by the occluder.
  11286. * @example
  11287. * const cameraPosition = new Cesium.Cartesian3(0, 0, 0);
  11288. * const littleSphere = new Cesium.BoundingSphere(new Cesium.Cartesian3(0, 0, -1), 0.25);
  11289. * const occluder = new Cesium.Occluder(littleSphere, cameraPosition);
  11290. * const point = new Cesium.Cartesian3(0, 0, -3);
  11291. * occluder.isPointVisible(point); //returns true
  11292. * @param occludee - The point surrounding the occludee object.
  11293. * @returns <code>true</code> if the occludee is visible; otherwise <code>false</code>.
  11294. */
  11295. isPointVisible(occludee: Cartesian3): boolean;
  11296. /**
  11297. * Determines whether or not a sphere, the <code>occludee</code>, is hidden from view by the occluder.
  11298. * @example
  11299. * const cameraPosition = new Cesium.Cartesian3(0, 0, 0);
  11300. * const littleSphere = new Cesium.BoundingSphere(new Cesium.Cartesian3(0, 0, -1), 0.25);
  11301. * const occluder = new Cesium.Occluder(littleSphere, cameraPosition);
  11302. * const bigSphere = new Cesium.BoundingSphere(new Cesium.Cartesian3(0, 0, -3), 1);
  11303. * occluder.isBoundingSphereVisible(bigSphere); //returns true
  11304. * @param occludee - The bounding sphere surrounding the occludee object.
  11305. * @returns <code>true</code> if the occludee is visible; otherwise <code>false</code>.
  11306. */
  11307. isBoundingSphereVisible(occludee: BoundingSphere): boolean;
  11308. /**
  11309. * Determine to what extent an occludee is visible (not visible, partially visible, or fully visible).
  11310. * @example
  11311. * const sphere1 = new Cesium.BoundingSphere(new Cesium.Cartesian3(0, 0, -1.5), 0.5);
  11312. * const sphere2 = new Cesium.BoundingSphere(new Cesium.Cartesian3(0, 0, -2.5), 0.5);
  11313. * const cameraPosition = new Cesium.Cartesian3(0, 0, 0);
  11314. * const occluder = new Cesium.Occluder(sphere1, cameraPosition);
  11315. * occluder.computeVisibility(sphere2); //returns Visibility.NONE
  11316. * @param occludeeBS - The bounding sphere of the occludee.
  11317. * @returns Visibility.NONE if the occludee is not visible,
  11318. * Visibility.PARTIAL if the occludee is partially visible, or
  11319. * Visibility.FULL if the occludee is fully visible.
  11320. */
  11321. computeVisibility(occludeeBS: BoundingSphere): Visibility;
  11322. /**
  11323. * Computes a point that can be used as the occludee position to the visibility functions.
  11324. * Use a radius of zero for the occludee radius. Typically, a user computes a bounding sphere around
  11325. * an object that is used for visibility; however it is also possible to compute a point that if
  11326. * seen/not seen would also indicate if an object is visible/not visible. This function is better
  11327. * called for objects that do not move relative to the occluder and is large, such as a chunk of
  11328. * terrain. You are better off not calling this and using the object's bounding sphere for objects
  11329. * such as a satellite or ground vehicle.
  11330. * @example
  11331. * const cameraPosition = new Cesium.Cartesian3(0, 0, 0);
  11332. * const occluderBoundingSphere = new Cesium.BoundingSphere(new Cesium.Cartesian3(0, 0, -8), 2);
  11333. * const occluder = new Cesium.Occluder(occluderBoundingSphere, cameraPosition);
  11334. * const positions = [new Cesium.Cartesian3(-0.25, 0, -5.3), new Cesium.Cartesian3(0.25, 0, -5.3)];
  11335. * const tileOccluderSphere = Cesium.BoundingSphere.fromPoints(positions);
  11336. * const occludeePosition = tileOccluderSphere.center;
  11337. * const occludeePt = Cesium.Occluder.computeOccludeePoint(occluderBoundingSphere, occludeePosition, positions);
  11338. * @param occluderBoundingSphere - The bounding sphere surrounding the occluder.
  11339. * @param occludeePosition - The point where the occludee (bounding sphere of radius 0) is located.
  11340. * @param positions - List of altitude points on the horizon near the surface of the occluder.
  11341. * @returns An object containing two attributes: <code>occludeePoint</code> and <code>valid</code>
  11342. * which is a boolean value.
  11343. */
  11344. static computeOccludeePoint(occluderBoundingSphere: BoundingSphere, occludeePosition: Cartesian3, positions: Cartesian3[]): any;
  11345. /**
  11346. * Computes a point that can be used as the occludee position to the visibility functions from a rectangle.
  11347. * @param rectangle - The rectangle used to create a bounding sphere.
  11348. * @param [ellipsoid = Ellipsoid.WGS84] - The ellipsoid used to determine positions of the rectangle.
  11349. * @returns An object containing two attributes: <code>occludeePoint</code> and <code>valid</code>
  11350. * which is a boolean value.
  11351. */
  11352. static computeOccludeePointFromRectangle(rectangle: Rectangle, ellipsoid?: Ellipsoid): any;
  11353. }
  11354. /**
  11355. * Provides geocoding via a {@link https://opencagedata.com/|OpenCage} server.
  11356. * @example
  11357. * // Configure a Viewer to use the OpenCage Geocoder
  11358. * const viewer = new Cesium.Viewer('cesiumContainer', {
  11359. * geocoder: new Cesium.OpenCageGeocoderService('https://api.opencagedata.com/geocode/v1/', '<API key>')
  11360. * });
  11361. * @param url - The endpoint to the OpenCage server.
  11362. * @param apiKey - The OpenCage API Key.
  11363. * @param [params] - An object with the following properties (See https://opencagedata.com/api#forward-opt):
  11364. * @param [params.abbrv] - When set to 1 we attempt to abbreviate and shorten the formatted string we return.
  11365. * @param [options.add_request] - When set to 1 the various request parameters are added to the response for ease of debugging.
  11366. * @param [options.bounds] - Provides the geocoder with a hint to the region that the query resides in.
  11367. * @param [options.countrycode] - Restricts the results to the specified country or countries (as defined by the ISO 3166-1 Alpha 2 standard).
  11368. * @param [options.jsonp] - Wraps the returned JSON with a function name.
  11369. * @param [options.language] - An IETF format language code.
  11370. * @param [options.limit] - The maximum number of results we should return.
  11371. * @param [options.min_confidence] - An integer from 1-10. Only results with at least this confidence will be returned.
  11372. * @param [options.no_annotations] - When set to 1 results will not contain annotations.
  11373. * @param [options.no_dedupe] - When set to 1 results will not be deduplicated.
  11374. * @param [options.no_record] - When set to 1 the query contents are not logged.
  11375. * @param [options.pretty] - When set to 1 results are 'pretty' printed for easier reading. Useful for debugging.
  11376. * @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).
  11377. */
  11378. export class OpenCageGeocoderService {
  11379. constructor(url: Resource | string, apiKey: string, params?: {
  11380. abbrv?: number;
  11381. });
  11382. /**
  11383. * The Resource used to access the OpenCage endpoint.
  11384. */
  11385. readonly url: Resource;
  11386. /**
  11387. * Optional params passed to OpenCage in order to customize geocoding
  11388. */
  11389. readonly params: any;
  11390. /**
  11391. * @param query - The query to be sent to the geocoder service
  11392. */
  11393. geocode(query: string): Promise<GeocoderService.Result[]>;
  11394. }
  11395. /**
  11396. * Creates an instance of an OrientedBoundingBox.
  11397. * 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.
  11398. * @example
  11399. * // Create an OrientedBoundingBox using a transformation matrix, a position where the box will be translated, and a scale.
  11400. * const center = new Cesium.Cartesian3(1.0, 0.0, 0.0);
  11401. * const halfAxes = Cesium.Matrix3.fromScale(new Cesium.Cartesian3(1.0, 3.0, 2.0), new Cesium.Matrix3());
  11402. *
  11403. * const obb = new Cesium.OrientedBoundingBox(center, halfAxes);
  11404. * @param [center = Cartesian3.ZERO] - The center of the box.
  11405. * @param [halfAxes = Matrix3.ZERO] - The three orthogonal half-axes of the bounding box.
  11406. * Equivalently, the transformation matrix, to rotate and scale a 0x0x0
  11407. * cube centered at the origin.
  11408. */
  11409. export class OrientedBoundingBox {
  11410. constructor(center?: Cartesian3, halfAxes?: Matrix3);
  11411. /**
  11412. * The center of the box.
  11413. */
  11414. center: Cartesian3;
  11415. /**
  11416. * The transformation matrix, to rotate the box to the right position.
  11417. */
  11418. halfAxes: Matrix3;
  11419. /**
  11420. * The number of elements used to pack the object into an array.
  11421. */
  11422. static packedLength: number;
  11423. /**
  11424. * Stores the provided instance into the provided array.
  11425. * @param value - The value to pack.
  11426. * @param array - The array to pack into.
  11427. * @param [startingIndex = 0] - The index into the array at which to start packing the elements.
  11428. * @returns The array that was packed into
  11429. */
  11430. static pack(value: OrientedBoundingBox, array: number[], startingIndex?: number): number[];
  11431. /**
  11432. * Retrieves an instance from a packed array.
  11433. * @param array - The packed array.
  11434. * @param [startingIndex = 0] - The starting index of the element to be unpacked.
  11435. * @param [result] - The object into which to store the result.
  11436. * @returns The modified result parameter or a new OrientedBoundingBox instance if one was not provided.
  11437. */
  11438. static unpack(array: number[], startingIndex?: number, result?: OrientedBoundingBox): OrientedBoundingBox;
  11439. /**
  11440. * Computes an instance of an OrientedBoundingBox of the given positions.
  11441. * This is an implementation of Stefan Gottschalk's Collision Queries using Oriented Bounding Boxes solution (PHD thesis).
  11442. * Reference: http://gamma.cs.unc.edu/users/gottschalk/main.pdf
  11443. * @example
  11444. * // Compute an object oriented bounding box enclosing two points.
  11445. * const box = Cesium.OrientedBoundingBox.fromPoints([new Cesium.Cartesian3(2, 0, 0), new Cesium.Cartesian3(-2, 0, 0)]);
  11446. * @param [positions] - List of {@link Cartesian3} points that the bounding box will enclose.
  11447. * @param [result] - The object onto which to store the result.
  11448. * @returns The modified result parameter or a new OrientedBoundingBox instance if one was not provided.
  11449. */
  11450. static fromPoints(positions?: Cartesian3[], result?: OrientedBoundingBox): OrientedBoundingBox;
  11451. /**
  11452. * Computes an OrientedBoundingBox that bounds a {@link Rectangle} on the surface of an {@link Ellipsoid}.
  11453. * There are no guarantees about the orientation of the bounding box.
  11454. * @param rectangle - The cartographic rectangle on the surface of the ellipsoid.
  11455. * @param [minimumHeight = 0.0] - The minimum height (elevation) within the tile.
  11456. * @param [maximumHeight = 0.0] - The maximum height (elevation) within the tile.
  11457. * @param [ellipsoid = Ellipsoid.WGS84] - The ellipsoid on which the rectangle is defined.
  11458. * @param [result] - The object onto which to store the result.
  11459. * @returns The modified result parameter or a new OrientedBoundingBox instance if none was provided.
  11460. */
  11461. static fromRectangle(rectangle: Rectangle, minimumHeight?: number, maximumHeight?: number, ellipsoid?: Ellipsoid, result?: OrientedBoundingBox): OrientedBoundingBox;
  11462. /**
  11463. * Computes an OrientedBoundingBox that bounds an affine transformation.
  11464. * @param transformation - The affine transformation.
  11465. * @param [result] - The object onto which to store the result.
  11466. * @returns The modified result parameter or a new OrientedBoundingBox instance if none was provided.
  11467. */
  11468. static fromTransformation(transformation: Matrix4, result?: OrientedBoundingBox): OrientedBoundingBox;
  11469. /**
  11470. * Duplicates a OrientedBoundingBox instance.
  11471. * @param box - The bounding box to duplicate.
  11472. * @param [result] - The object onto which to store the result.
  11473. * @returns The modified result parameter or a new OrientedBoundingBox instance if none was provided. (Returns undefined if box is undefined)
  11474. */
  11475. static clone(box: OrientedBoundingBox, result?: OrientedBoundingBox): OrientedBoundingBox;
  11476. /**
  11477. * Determines which side of a plane the oriented bounding box is located.
  11478. * @param box - The oriented bounding box to test.
  11479. * @param plane - The plane to test against.
  11480. * @returns {@link Intersect.INSIDE} if the entire box is on the side of the plane
  11481. * the normal is pointing, {@link Intersect.OUTSIDE} if the entire box is
  11482. * on the opposite side, and {@link Intersect.INTERSECTING} if the box
  11483. * intersects the plane.
  11484. */
  11485. static intersectPlane(box: OrientedBoundingBox, plane: Plane): Intersect;
  11486. /**
  11487. * Computes the estimated distance squared from the closest point on a bounding box to a point.
  11488. * @example
  11489. * // Sort bounding boxes from back to front
  11490. * boxes.sort(function(a, b) {
  11491. * return Cesium.OrientedBoundingBox.distanceSquaredTo(b, camera.positionWC) - Cesium.OrientedBoundingBox.distanceSquaredTo(a, camera.positionWC);
  11492. * });
  11493. * @param box - The box.
  11494. * @param cartesian - The point
  11495. * @returns The distance squared from the oriented bounding box to the point. Returns 0 if the point is inside the box.
  11496. */
  11497. static distanceSquaredTo(box: OrientedBoundingBox, cartesian: Cartesian3): number;
  11498. /**
  11499. * The distances calculated by the vector from the center of the bounding box to position projected onto direction.
  11500. * <br>
  11501. * If you imagine the infinite number of planes with normal direction, this computes the smallest distance to the
  11502. * closest and farthest planes from position that intersect the bounding box.
  11503. * @param box - The bounding box to calculate the distance to.
  11504. * @param position - The position to calculate the distance from.
  11505. * @param direction - The direction from position.
  11506. * @param [result] - A Interval to store the nearest and farthest distances.
  11507. * @returns The nearest and farthest distances on the bounding box from position in direction.
  11508. */
  11509. static computePlaneDistances(box: OrientedBoundingBox, position: Cartesian3, direction: Cartesian3, result?: Interval): Interval;
  11510. /**
  11511. * 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).
  11512. * @param box - The oriented bounding box.
  11513. * @param [result] - An array of eight {@link Cartesian3} instances onto which to store the corners.
  11514. * @returns The modified result parameter or a new array if none was provided.
  11515. */
  11516. static computeCorners(box: OrientedBoundingBox, result?: Cartesian3[]): Cartesian3[];
  11517. /**
  11518. * Computes a transformation matrix from an oriented bounding box.
  11519. * @param box - The oriented bounding box.
  11520. * @param result - The object onto which to store the result.
  11521. * @returns The modified result parameter or a new {@link Matrix4} instance if none was provided.
  11522. */
  11523. static computeTransformation(box: OrientedBoundingBox, result: Matrix4): Matrix4;
  11524. /**
  11525. * Determines whether or not a bounding box is hidden from view by the occluder.
  11526. * @param box - The bounding box surrounding the occludee object.
  11527. * @param occluder - The occluder.
  11528. * @returns <code>true</code> if the box is not visible; otherwise <code>false</code>.
  11529. */
  11530. static isOccluded(box: OrientedBoundingBox, occluder: Occluder): boolean;
  11531. /**
  11532. * Determines which side of a plane the oriented bounding box is located.
  11533. * @param plane - The plane to test against.
  11534. * @returns {@link Intersect.INSIDE} if the entire box is on the side of the plane
  11535. * the normal is pointing, {@link Intersect.OUTSIDE} if the entire box is
  11536. * on the opposite side, and {@link Intersect.INTERSECTING} if the box
  11537. * intersects the plane.
  11538. */
  11539. intersectPlane(plane: Plane): Intersect;
  11540. /**
  11541. * Computes the estimated distance squared from the closest point on a bounding box to a point.
  11542. * @example
  11543. * // Sort bounding boxes from back to front
  11544. * boxes.sort(function(a, b) {
  11545. * return b.distanceSquaredTo(camera.positionWC) - a.distanceSquaredTo(camera.positionWC);
  11546. * });
  11547. * @param cartesian - The point
  11548. * @returns The estimated distance squared from the bounding sphere to the point.
  11549. */
  11550. distanceSquaredTo(cartesian: Cartesian3): number;
  11551. /**
  11552. * The distances calculated by the vector from the center of the bounding box to position projected onto direction.
  11553. * <br>
  11554. * If you imagine the infinite number of planes with normal direction, this computes the smallest distance to the
  11555. * closest and farthest planes from position that intersect the bounding box.
  11556. * @param position - The position to calculate the distance from.
  11557. * @param direction - The direction from position.
  11558. * @param [result] - A Interval to store the nearest and farthest distances.
  11559. * @returns The nearest and farthest distances on the bounding box from position in direction.
  11560. */
  11561. computePlaneDistances(position: Cartesian3, direction: Cartesian3, result?: Interval): Interval;
  11562. /**
  11563. * 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).
  11564. * @param [result] - An array of eight {@link Cartesian3} instances onto which to store the corners.
  11565. * @returns The modified result parameter or a new array if none was provided.
  11566. */
  11567. computeCorners(result?: Cartesian3[]): Cartesian3[];
  11568. /**
  11569. * Computes a transformation matrix from an oriented bounding box.
  11570. * @param result - The object onto which to store the result.
  11571. * @returns The modified result parameter or a new {@link Matrix4} instance if none was provided.
  11572. */
  11573. computeTransformation(result: Matrix4): Matrix4;
  11574. /**
  11575. * Determines whether or not a bounding box is hidden from view by the occluder.
  11576. * @param occluder - The occluder.
  11577. * @returns <code>true</code> if the sphere is not visible; otherwise <code>false</code>.
  11578. */
  11579. isOccluded(occluder: Occluder): boolean;
  11580. /**
  11581. * Compares the provided OrientedBoundingBox componentwise and returns
  11582. * <code>true</code> if they are equal, <code>false</code> otherwise.
  11583. * @param left - The first OrientedBoundingBox.
  11584. * @param right - The second OrientedBoundingBox.
  11585. * @returns <code>true</code> if left and right are equal, <code>false</code> otherwise.
  11586. */
  11587. static equals(left: OrientedBoundingBox, right: OrientedBoundingBox): boolean;
  11588. /**
  11589. * Duplicates this OrientedBoundingBox instance.
  11590. * @param [result] - The object onto which to store the result.
  11591. * @returns The modified result parameter or a new OrientedBoundingBox instance if one was not provided.
  11592. */
  11593. clone(result?: OrientedBoundingBox): OrientedBoundingBox;
  11594. /**
  11595. * Compares this OrientedBoundingBox against the provided OrientedBoundingBox componentwise and returns
  11596. * <code>true</code> if they are equal, <code>false</code> otherwise.
  11597. * @param [right] - The right hand side OrientedBoundingBox.
  11598. * @returns <code>true</code> if they are equal, <code>false</code> otherwise.
  11599. */
  11600. equals(right?: OrientedBoundingBox): boolean;
  11601. }
  11602. /**
  11603. * The viewing frustum is defined by 6 planes.
  11604. * Each plane is represented by a {@link Cartesian4} object, where the x, y, and z components
  11605. * define the unit vector normal to the plane, and the w component is the distance of the
  11606. * plane from the origin/camera position.
  11607. * @example
  11608. * const maxRadii = ellipsoid.maximumRadius;
  11609. *
  11610. * const frustum = new Cesium.OrthographicFrustum();
  11611. * frustum.near = 0.01 * maxRadii;
  11612. * frustum.far = 50.0 * maxRadii;
  11613. * @param [options] - An object with the following properties:
  11614. * @param [options.width] - The width of the frustum in meters.
  11615. * @param [options.aspectRatio] - The aspect ratio of the frustum's width to it's height.
  11616. * @param [options.near = 1.0] - The distance of the near plane.
  11617. * @param [options.far = 500000000.0] - The distance of the far plane.
  11618. */
  11619. export class OrthographicFrustum {
  11620. constructor(options?: {
  11621. width?: number;
  11622. aspectRatio?: number;
  11623. near?: number;
  11624. far?: number;
  11625. });
  11626. /**
  11627. * The horizontal width of the frustum in meters.
  11628. */
  11629. width: number;
  11630. /**
  11631. * The aspect ratio of the frustum's width to it's height.
  11632. */
  11633. aspectRatio: number;
  11634. /**
  11635. * The distance of the near plane.
  11636. */
  11637. near: number;
  11638. /**
  11639. * The distance of the far plane.
  11640. */
  11641. far: number;
  11642. /**
  11643. * The number of elements used to pack the object into an array.
  11644. */
  11645. static packedLength: number;
  11646. /**
  11647. * Stores the provided instance into the provided array.
  11648. * @param value - The value to pack.
  11649. * @param array - The array to pack into.
  11650. * @param [startingIndex = 0] - The index into the array at which to start packing the elements.
  11651. * @returns The array that was packed into
  11652. */
  11653. static pack(value: OrthographicFrustum, array: number[], startingIndex?: number): number[];
  11654. /**
  11655. * Retrieves an instance from a packed array.
  11656. * @param array - The packed array.
  11657. * @param [startingIndex = 0] - The starting index of the element to be unpacked.
  11658. * @param [result] - The object into which to store the result.
  11659. * @returns The modified result parameter or a new OrthographicFrustum instance if one was not provided.
  11660. */
  11661. static unpack(array: number[], startingIndex?: number, result?: OrthographicFrustum): OrthographicFrustum;
  11662. /**
  11663. * Gets the orthographic projection matrix computed from the view frustum.
  11664. */
  11665. readonly projectionMatrix: Matrix4;
  11666. /**
  11667. * Creates a culling volume for this frustum.
  11668. * @example
  11669. * // Check if a bounding volume intersects the frustum.
  11670. * const cullingVolume = frustum.computeCullingVolume(cameraPosition, cameraDirection, cameraUp);
  11671. * const intersect = cullingVolume.computeVisibility(boundingVolume);
  11672. * @param position - The eye position.
  11673. * @param direction - The view direction.
  11674. * @param up - The up direction.
  11675. * @returns A culling volume at the given position and orientation.
  11676. */
  11677. computeCullingVolume(position: Cartesian3, direction: Cartesian3, up: Cartesian3): CullingVolume;
  11678. /**
  11679. * Returns the pixel's width and height in meters.
  11680. * @example
  11681. * // Example 1
  11682. * // Get the width and height of a pixel.
  11683. * const pixelSize = camera.frustum.getPixelDimensions(scene.drawingBufferWidth, scene.drawingBufferHeight, 0.0, scene.pixelRatio, new Cesium.Cartesian2());
  11684. * @param drawingBufferWidth - The width of the drawing buffer.
  11685. * @param drawingBufferHeight - The height of the drawing buffer.
  11686. * @param distance - The distance to the near plane in meters.
  11687. * @param pixelRatio - The scaling factor from pixel space to coordinate space.
  11688. * @param result - The object onto which to store the result.
  11689. * @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.
  11690. */
  11691. getPixelDimensions(drawingBufferWidth: number, drawingBufferHeight: number, distance: number, pixelRatio: number, result: Cartesian2): Cartesian2;
  11692. /**
  11693. * Returns a duplicate of a OrthographicFrustum instance.
  11694. * @param [result] - The object onto which to store the result.
  11695. * @returns The modified result parameter or a new OrthographicFrustum instance if one was not provided.
  11696. */
  11697. clone(result?: OrthographicFrustum): OrthographicFrustum;
  11698. /**
  11699. * Compares the provided OrthographicFrustum componentwise and returns
  11700. * <code>true</code> if they are equal, <code>false</code> otherwise.
  11701. * @param [other] - The right hand side OrthographicFrustum.
  11702. * @returns <code>true</code> if they are equal, <code>false</code> otherwise.
  11703. */
  11704. equals(other?: OrthographicFrustum): boolean;
  11705. /**
  11706. * Compares the provided OrthographicFrustum componentwise and returns
  11707. * <code>true</code> if they pass an absolute or relative tolerance test,
  11708. * <code>false</code> otherwise.
  11709. * @param other - The right hand side OrthographicFrustum.
  11710. * @param relativeEpsilon - The relative epsilon tolerance to use for equality testing.
  11711. * @param [absoluteEpsilon = relativeEpsilon] - The absolute epsilon tolerance to use for equality testing.
  11712. * @returns <code>true</code> if this and other are within the provided epsilon, <code>false</code> otherwise.
  11713. */
  11714. equalsEpsilon(other: OrthographicFrustum, relativeEpsilon: number, absoluteEpsilon?: number): boolean;
  11715. }
  11716. /**
  11717. * The viewing frustum is defined by 6 planes.
  11718. * Each plane is represented by a {@link Cartesian4} object, where the x, y, and z components
  11719. * define the unit vector normal to the plane, and the w component is the distance of the
  11720. * plane from the origin/camera position.
  11721. * @example
  11722. * const maxRadii = ellipsoid.maximumRadius;
  11723. *
  11724. * const frustum = new Cesium.OrthographicOffCenterFrustum();
  11725. * frustum.right = maxRadii * Cesium.Math.PI;
  11726. * frustum.left = -c.frustum.right;
  11727. * frustum.top = c.frustum.right * (canvas.clientHeight / canvas.clientWidth);
  11728. * frustum.bottom = -c.frustum.top;
  11729. * frustum.near = 0.01 * maxRadii;
  11730. * frustum.far = 50.0 * maxRadii;
  11731. * @param [options] - An object with the following properties:
  11732. * @param [options.left] - The left clipping plane distance.
  11733. * @param [options.right] - The right clipping plane distance.
  11734. * @param [options.top] - The top clipping plane distance.
  11735. * @param [options.bottom] - The bottom clipping plane distance.
  11736. * @param [options.near = 1.0] - The near clipping plane distance.
  11737. * @param [options.far = 500000000.0] - The far clipping plane distance.
  11738. */
  11739. export class OrthographicOffCenterFrustum {
  11740. constructor(options?: {
  11741. left?: number;
  11742. right?: number;
  11743. top?: number;
  11744. bottom?: number;
  11745. near?: number;
  11746. far?: number;
  11747. });
  11748. /**
  11749. * The left clipping plane.
  11750. */
  11751. left: number;
  11752. /**
  11753. * The right clipping plane.
  11754. */
  11755. right: number;
  11756. /**
  11757. * The top clipping plane.
  11758. */
  11759. top: number;
  11760. /**
  11761. * The bottom clipping plane.
  11762. */
  11763. bottom: number;
  11764. /**
  11765. * The distance of the near plane.
  11766. */
  11767. near: number;
  11768. /**
  11769. * The distance of the far plane.
  11770. */
  11771. far: number;
  11772. /**
  11773. * Gets the orthographic projection matrix computed from the view frustum.
  11774. */
  11775. readonly projectionMatrix: Matrix4;
  11776. /**
  11777. * Creates a culling volume for this frustum.
  11778. * @example
  11779. * // Check if a bounding volume intersects the frustum.
  11780. * const cullingVolume = frustum.computeCullingVolume(cameraPosition, cameraDirection, cameraUp);
  11781. * const intersect = cullingVolume.computeVisibility(boundingVolume);
  11782. * @param position - The eye position.
  11783. * @param direction - The view direction.
  11784. * @param up - The up direction.
  11785. * @returns A culling volume at the given position and orientation.
  11786. */
  11787. computeCullingVolume(position: Cartesian3, direction: Cartesian3, up: Cartesian3): CullingVolume;
  11788. /**
  11789. * Returns the pixel's width and height in meters.
  11790. * @example
  11791. * // Example 1
  11792. * // Get the width and height of a pixel.
  11793. * const pixelSize = camera.frustum.getPixelDimensions(scene.drawingBufferWidth, scene.drawingBufferHeight, 0.0, scene.pixelRatio, new Cesium.Cartesian2());
  11794. * @param drawingBufferWidth - The width of the drawing buffer.
  11795. * @param drawingBufferHeight - The height of the drawing buffer.
  11796. * @param distance - The distance to the near plane in meters.
  11797. * @param pixelRatio - The scaling factor from pixel space to coordinate space.
  11798. * @param result - The object onto which to store the result.
  11799. * @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.
  11800. */
  11801. getPixelDimensions(drawingBufferWidth: number, drawingBufferHeight: number, distance: number, pixelRatio: number, result: Cartesian2): Cartesian2;
  11802. /**
  11803. * Returns a duplicate of a OrthographicOffCenterFrustum instance.
  11804. * @param [result] - The object onto which to store the result.
  11805. * @returns The modified result parameter or a new OrthographicOffCenterFrustum instance if one was not provided.
  11806. */
  11807. clone(result?: OrthographicOffCenterFrustum): OrthographicOffCenterFrustum;
  11808. /**
  11809. * Compares the provided OrthographicOffCenterFrustum componentwise and returns
  11810. * <code>true</code> if they are equal, <code>false</code> otherwise.
  11811. * @param [other] - The right hand side OrthographicOffCenterFrustum.
  11812. * @returns <code>true</code> if they are equal, <code>false</code> otherwise.
  11813. */
  11814. equals(other?: OrthographicOffCenterFrustum): boolean;
  11815. /**
  11816. * Compares the provided OrthographicOffCenterFrustum componentwise and returns
  11817. * <code>true</code> if they pass an absolute or relative tolerance test,
  11818. * <code>false</code> otherwise.
  11819. * @param other - The right hand side OrthographicOffCenterFrustum.
  11820. * @param relativeEpsilon - The relative epsilon tolerance to use for equality testing.
  11821. * @param [absoluteEpsilon = relativeEpsilon] - The absolute epsilon tolerance to use for equality testing.
  11822. * @returns <code>true</code> if this and other are within the provided epsilon, <code>false</code> otherwise.
  11823. */
  11824. equalsEpsilon(other: OrthographicOffCenterFrustum, relativeEpsilon: number, absoluteEpsilon?: number): boolean;
  11825. }
  11826. export namespace Packable {
  11827. /**
  11828. * The number of elements used to pack the object into an array.
  11829. */
  11830. var packedLength: number;
  11831. /**
  11832. * Stores the provided instance into the provided array.
  11833. * @param value - The value to pack.
  11834. * @param array - The array to pack into.
  11835. * @param [startingIndex = 0] - The index into the array at which to start packing the elements.
  11836. */
  11837. function pack(value: any, array: number[], startingIndex?: number): void;
  11838. /**
  11839. * Retrieves an instance from a packed array.
  11840. * @param array - The packed array.
  11841. * @param [startingIndex = 0] - The starting index of the element to be unpacked.
  11842. * @param [result] - The object into which to store the result.
  11843. * @returns The modified result parameter or a new Object instance if one was not provided.
  11844. */
  11845. function unpack(array: number[], startingIndex?: number, result?: any): any;
  11846. }
  11847. /**
  11848. * Static interface for types which can store their values as packed
  11849. * elements in an array. These methods and properties are expected to be
  11850. * defined on a constructor function.
  11851. */
  11852. export interface Packable {
  11853. }
  11854. /**
  11855. * Static interface for {@link Packable} types which are interpolated in a
  11856. * different representation than their packed value. These methods and
  11857. * properties are expected to be defined on a constructor function.
  11858. */
  11859. export namespace PackableForInterpolation {
  11860. /**
  11861. * The number of elements used to store the object into an array in its interpolatable form.
  11862. */
  11863. var packedInterpolationLength: number;
  11864. /**
  11865. * Converts a packed array into a form suitable for interpolation.
  11866. * @param packedArray - The packed array.
  11867. * @param [startingIndex = 0] - The index of the first element to be converted.
  11868. * @param [lastIndex = packedArray.length] - The index of the last element to be converted.
  11869. * @param [result] - The object into which to store the result.
  11870. */
  11871. function convertPackedArrayForInterpolation(packedArray: number[], startingIndex?: number, lastIndex?: number, result?: number[]): void;
  11872. /**
  11873. * Retrieves an instance from a packed array converted with {@link PackableForInterpolation.convertPackedArrayForInterpolation}.
  11874. * @param array - The array previously packed for interpolation.
  11875. * @param sourceArray - The original packed array.
  11876. * @param [startingIndex = 0] - The startingIndex used to convert the array.
  11877. * @param [lastIndex = packedArray.length] - The lastIndex used to convert the array.
  11878. * @param [result] - The object into which to store the result.
  11879. * @returns The modified result parameter or a new Object instance if one was not provided.
  11880. */
  11881. function unpackInterpolationResult(array: number[], sourceArray: number[], startingIndex?: number, lastIndex?: number, result?: any): any;
  11882. }
  11883. /**
  11884. * Provides geocoding via a {@link https://pelias.io/|Pelias} server.
  11885. * @example
  11886. * // Configure a Viewer to use the Pelias server hosted by https://geocode.earth/
  11887. * const viewer = new Cesium.Viewer('cesiumContainer', {
  11888. * geocoder: new Cesium.PeliasGeocoderService(new Cesium.Resource({
  11889. * url: 'https://api.geocode.earth/v1/',
  11890. * queryParameters: {
  11891. * api_key: '<Your geocode.earth API key>'
  11892. * }
  11893. * }))
  11894. * });
  11895. * @param url - The endpoint to the Pelias server.
  11896. */
  11897. export class PeliasGeocoderService {
  11898. constructor(url: Resource | string);
  11899. /**
  11900. * The Resource used to access the Pelias endpoint.
  11901. */
  11902. readonly url: Resource;
  11903. /**
  11904. * @param query - The query to be sent to the geocoder service
  11905. * @param [type = GeocodeType.SEARCH] - The type of geocode to perform.
  11906. */
  11907. geocode(query: string, type?: GeocodeType): Promise<GeocoderService.Result[]>;
  11908. }
  11909. /**
  11910. * The viewing frustum is defined by 6 planes.
  11911. * Each plane is represented by a {@link Cartesian4} object, where the x, y, and z components
  11912. * define the unit vector normal to the plane, and the w component is the distance of the
  11913. * plane from the origin/camera position.
  11914. * @example
  11915. * const frustum = new Cesium.PerspectiveFrustum({
  11916. * fov : Cesium.Math.PI_OVER_THREE,
  11917. * aspectRatio : canvas.clientWidth / canvas.clientHeight
  11918. * near : 1.0,
  11919. * far : 1000.0
  11920. * });
  11921. * @param [options] - An object with the following properties:
  11922. * @param [options.fov] - The angle of the field of view (FOV), in radians.
  11923. * @param [options.aspectRatio] - The aspect ratio of the frustum's width to it's height.
  11924. * @param [options.near = 1.0] - The distance of the near plane.
  11925. * @param [options.far = 500000000.0] - The distance of the far plane.
  11926. * @param [options.xOffset = 0.0] - The offset in the x direction.
  11927. * @param [options.yOffset = 0.0] - The offset in the y direction.
  11928. */
  11929. export class PerspectiveFrustum {
  11930. constructor(options?: {
  11931. fov?: number;
  11932. aspectRatio?: number;
  11933. near?: number;
  11934. far?: number;
  11935. xOffset?: number;
  11936. yOffset?: number;
  11937. });
  11938. /**
  11939. * The angle of the field of view (FOV), in radians. This angle will be used
  11940. * as the horizontal FOV if the width is greater than the height, otherwise
  11941. * it will be the vertical FOV.
  11942. */
  11943. fov: number;
  11944. /**
  11945. * The aspect ratio of the frustum's width to it's height.
  11946. */
  11947. aspectRatio: number;
  11948. /**
  11949. * The distance of the near plane.
  11950. */
  11951. near: number;
  11952. /**
  11953. * The distance of the far plane.
  11954. */
  11955. far: number;
  11956. /**
  11957. * Offsets the frustum in the x direction.
  11958. */
  11959. xOffset: number;
  11960. /**
  11961. * Offsets the frustum in the y direction.
  11962. */
  11963. yOffset: number;
  11964. /**
  11965. * The number of elements used to pack the object into an array.
  11966. */
  11967. static packedLength: number;
  11968. /**
  11969. * Stores the provided instance into the provided array.
  11970. * @param value - The value to pack.
  11971. * @param array - The array to pack into.
  11972. * @param [startingIndex = 0] - The index into the array at which to start packing the elements.
  11973. * @returns The array that was packed into
  11974. */
  11975. static pack(value: PerspectiveFrustum, array: number[], startingIndex?: number): number[];
  11976. /**
  11977. * Retrieves an instance from a packed array.
  11978. * @param array - The packed array.
  11979. * @param [startingIndex = 0] - The starting index of the element to be unpacked.
  11980. * @param [result] - The object into which to store the result.
  11981. * @returns The modified result parameter or a new PerspectiveFrustum instance if one was not provided.
  11982. */
  11983. static unpack(array: number[], startingIndex?: number, result?: PerspectiveFrustum): PerspectiveFrustum;
  11984. /**
  11985. * Gets the perspective projection matrix computed from the view frustum.
  11986. */
  11987. readonly projectionMatrix: Matrix4;
  11988. /**
  11989. * The perspective projection matrix computed from the view frustum with an infinite far plane.
  11990. */
  11991. readonly infiniteProjectionMatrix: Matrix4;
  11992. /**
  11993. * Gets the angle of the vertical field of view, in radians.
  11994. */
  11995. readonly fovy: number;
  11996. /**
  11997. * Creates a culling volume for this frustum.
  11998. * @example
  11999. * // Check if a bounding volume intersects the frustum.
  12000. * const cullingVolume = frustum.computeCullingVolume(cameraPosition, cameraDirection, cameraUp);
  12001. * const intersect = cullingVolume.computeVisibility(boundingVolume);
  12002. * @param position - The eye position.
  12003. * @param direction - The view direction.
  12004. * @param up - The up direction.
  12005. * @returns A culling volume at the given position and orientation.
  12006. */
  12007. computeCullingVolume(position: Cartesian3, direction: Cartesian3, up: Cartesian3): CullingVolume;
  12008. /**
  12009. * Returns the pixel's width and height in meters.
  12010. * @example
  12011. * // Example 1
  12012. * // Get the width and height of a pixel.
  12013. * const pixelSize = camera.frustum.getPixelDimensions(scene.drawingBufferWidth, scene.drawingBufferHeight, 1.0, scene.pixelRatio, new Cesium.Cartesian2());
  12014. * @example
  12015. * // Example 2
  12016. * // Get the width and height of a pixel if the near plane was set to 'distance'.
  12017. * // For example, get the size of a pixel of an image on a billboard.
  12018. * const position = camera.position;
  12019. * const direction = camera.direction;
  12020. * const toCenter = Cesium.Cartesian3.subtract(primitive.boundingVolume.center, position, new Cesium.Cartesian3()); // vector from camera to a primitive
  12021. * const toCenterProj = Cesium.Cartesian3.multiplyByScalar(direction, Cesium.Cartesian3.dot(direction, toCenter), new Cesium.Cartesian3()); // project vector onto camera direction vector
  12022. * const distance = Cesium.Cartesian3.magnitude(toCenterProj);
  12023. * const pixelSize = camera.frustum.getPixelDimensions(scene.drawingBufferWidth, scene.drawingBufferHeight, distance, scene.pixelRatio, new Cesium.Cartesian2());
  12024. * @param drawingBufferWidth - The width of the drawing buffer.
  12025. * @param drawingBufferHeight - The height of the drawing buffer.
  12026. * @param distance - The distance to the near plane in meters.
  12027. * @param pixelRatio - The scaling factor from pixel space to coordinate space.
  12028. * @param result - The object onto which to store the result.
  12029. * @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.
  12030. */
  12031. getPixelDimensions(drawingBufferWidth: number, drawingBufferHeight: number, distance: number, pixelRatio: number, result: Cartesian2): Cartesian2;
  12032. /**
  12033. * Returns a duplicate of a PerspectiveFrustum instance.
  12034. * @param [result] - The object onto which to store the result.
  12035. * @returns The modified result parameter or a new PerspectiveFrustum instance if one was not provided.
  12036. */
  12037. clone(result?: PerspectiveFrustum): PerspectiveFrustum;
  12038. /**
  12039. * Compares the provided PerspectiveFrustum componentwise and returns
  12040. * <code>true</code> if they are equal, <code>false</code> otherwise.
  12041. * @param [other] - The right hand side PerspectiveFrustum.
  12042. * @returns <code>true</code> if they are equal, <code>false</code> otherwise.
  12043. */
  12044. equals(other?: PerspectiveFrustum): boolean;
  12045. /**
  12046. * Compares the provided PerspectiveFrustum componentwise and returns
  12047. * <code>true</code> if they pass an absolute or relative tolerance test,
  12048. * <code>false</code> otherwise.
  12049. * @param other - The right hand side PerspectiveFrustum.
  12050. * @param relativeEpsilon - The relative epsilon tolerance to use for equality testing.
  12051. * @param [absoluteEpsilon = relativeEpsilon] - The absolute epsilon tolerance to use for equality testing.
  12052. * @returns <code>true</code> if this and other are within the provided epsilon, <code>false</code> otherwise.
  12053. */
  12054. equalsEpsilon(other: PerspectiveFrustum, relativeEpsilon: number, absoluteEpsilon?: number): boolean;
  12055. }
  12056. /**
  12057. * The viewing frustum is defined by 6 planes.
  12058. * Each plane is represented by a {@link Cartesian4} object, where the x, y, and z components
  12059. * define the unit vector normal to the plane, and the w component is the distance of the
  12060. * plane from the origin/camera position.
  12061. * @example
  12062. * const frustum = new Cesium.PerspectiveOffCenterFrustum({
  12063. * left : -1.0,
  12064. * right : 1.0,
  12065. * top : 1.0,
  12066. * bottom : -1.0,
  12067. * near : 1.0,
  12068. * far : 100.0
  12069. * });
  12070. * @param [options] - An object with the following properties:
  12071. * @param [options.left] - The left clipping plane distance.
  12072. * @param [options.right] - The right clipping plane distance.
  12073. * @param [options.top] - The top clipping plane distance.
  12074. * @param [options.bottom] - The bottom clipping plane distance.
  12075. * @param [options.near = 1.0] - The near clipping plane distance.
  12076. * @param [options.far = 500000000.0] - The far clipping plane distance.
  12077. */
  12078. export class PerspectiveOffCenterFrustum {
  12079. constructor(options?: {
  12080. left?: number;
  12081. right?: number;
  12082. top?: number;
  12083. bottom?: number;
  12084. near?: number;
  12085. far?: number;
  12086. });
  12087. /**
  12088. * Defines the left clipping plane.
  12089. */
  12090. left: number;
  12091. /**
  12092. * Defines the right clipping plane.
  12093. */
  12094. right: number;
  12095. /**
  12096. * Defines the top clipping plane.
  12097. */
  12098. top: number;
  12099. /**
  12100. * Defines the bottom clipping plane.
  12101. */
  12102. bottom: number;
  12103. /**
  12104. * The distance of the near plane.
  12105. */
  12106. near: number;
  12107. /**
  12108. * The distance of the far plane.
  12109. */
  12110. far: number;
  12111. /**
  12112. * Gets the perspective projection matrix computed from the view frustum.
  12113. */
  12114. readonly projectionMatrix: Matrix4;
  12115. /**
  12116. * Gets the perspective projection matrix computed from the view frustum with an infinite far plane.
  12117. */
  12118. readonly infiniteProjectionMatrix: Matrix4;
  12119. /**
  12120. * Creates a culling volume for this frustum.
  12121. * @example
  12122. * // Check if a bounding volume intersects the frustum.
  12123. * const cullingVolume = frustum.computeCullingVolume(cameraPosition, cameraDirection, cameraUp);
  12124. * const intersect = cullingVolume.computeVisibility(boundingVolume);
  12125. * @param position - The eye position.
  12126. * @param direction - The view direction.
  12127. * @param up - The up direction.
  12128. * @returns A culling volume at the given position and orientation.
  12129. */
  12130. computeCullingVolume(position: Cartesian3, direction: Cartesian3, up: Cartesian3): CullingVolume;
  12131. /**
  12132. * Returns the pixel's width and height in meters.
  12133. * @example
  12134. * // Example 1
  12135. * // Get the width and height of a pixel.
  12136. * const pixelSize = camera.frustum.getPixelDimensions(scene.drawingBufferWidth, scene.drawingBufferHeight, 1.0, scene.pixelRatio, new Cesium.Cartesian2());
  12137. * @example
  12138. * // Example 2
  12139. * // Get the width and height of a pixel if the near plane was set to 'distance'.
  12140. * // For example, get the size of a pixel of an image on a billboard.
  12141. * const position = camera.position;
  12142. * const direction = camera.direction;
  12143. * const toCenter = Cesium.Cartesian3.subtract(primitive.boundingVolume.center, position, new Cesium.Cartesian3()); // vector from camera to a primitive
  12144. * const toCenterProj = Cesium.Cartesian3.multiplyByScalar(direction, Cesium.Cartesian3.dot(direction, toCenter), new Cesium.Cartesian3()); // project vector onto camera direction vector
  12145. * const distance = Cesium.Cartesian3.magnitude(toCenterProj);
  12146. * const pixelSize = camera.frustum.getPixelDimensions(scene.drawingBufferWidth, scene.drawingBufferHeight, distance, scene.pixelRatio, new Cesium.Cartesian2());
  12147. * @param drawingBufferWidth - The width of the drawing buffer.
  12148. * @param drawingBufferHeight - The height of the drawing buffer.
  12149. * @param distance - The distance to the near plane in meters.
  12150. * @param pixelRatio - The scaling factor from pixel space to coordinate space.
  12151. * @param result - The object onto which to store the result.
  12152. * @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.
  12153. */
  12154. getPixelDimensions(drawingBufferWidth: number, drawingBufferHeight: number, distance: number, pixelRatio: number, result: Cartesian2): Cartesian2;
  12155. /**
  12156. * Returns a duplicate of a PerspectiveOffCenterFrustum instance.
  12157. * @param [result] - The object onto which to store the result.
  12158. * @returns The modified result parameter or a new PerspectiveFrustum instance if one was not provided.
  12159. */
  12160. clone(result?: PerspectiveOffCenterFrustum): PerspectiveOffCenterFrustum;
  12161. /**
  12162. * Compares the provided PerspectiveOffCenterFrustum componentwise and returns
  12163. * <code>true</code> if they are equal, <code>false</code> otherwise.
  12164. * @param [other] - The right hand side PerspectiveOffCenterFrustum.
  12165. * @returns <code>true</code> if they are equal, <code>false</code> otherwise.
  12166. */
  12167. equals(other?: PerspectiveOffCenterFrustum): boolean;
  12168. /**
  12169. * Compares the provided PerspectiveOffCenterFrustum componentwise and returns
  12170. * <code>true</code> if they pass an absolute or relative tolerance test,
  12171. * <code>false</code> otherwise.
  12172. * @param other - The right hand side PerspectiveOffCenterFrustum.
  12173. * @param relativeEpsilon - The relative epsilon tolerance to use for equality testing.
  12174. * @param [absoluteEpsilon = relativeEpsilon] - The absolute epsilon tolerance to use for equality testing.
  12175. * @returns <code>true</code> if this and other are within the provided epsilon, <code>false</code> otherwise.
  12176. */
  12177. equalsEpsilon(other: PerspectiveOffCenterFrustum, relativeEpsilon: number, absoluteEpsilon?: number): boolean;
  12178. }
  12179. /**
  12180. * A utility class for generating custom map pins as canvas elements.
  12181. * <br /><br />
  12182. * <div align='center'>
  12183. * <img src='Images/PinBuilder.png' width='500'/><br />
  12184. * Example pins generated using both the maki icon set, which ships with Cesium, and single character text.
  12185. * </div>
  12186. */
  12187. export class PinBuilder {
  12188. constructor();
  12189. /**
  12190. * Creates an empty pin of the specified color and size.
  12191. * @param color - The color of the pin.
  12192. * @param size - The size of the pin, in pixels.
  12193. * @returns The canvas element that represents the generated pin.
  12194. */
  12195. fromColor(color: Color, size: number): HTMLCanvasElement;
  12196. /**
  12197. * Creates a pin with the specified icon, color, and size.
  12198. * @param url - The url of the image to be stamped onto the pin.
  12199. * @param color - The color of the pin.
  12200. * @param size - The size of the pin, in pixels.
  12201. * @returns The canvas element or a Promise to the canvas element that represents the generated pin.
  12202. */
  12203. fromUrl(url: Resource | string, color: Color, size: number): HTMLCanvasElement | Promise<HTMLCanvasElement>;
  12204. /**
  12205. * Creates a pin with the specified {@link https://www.mapbox.com/maki/|maki} icon identifier, color, and size.
  12206. * @param id - The id of the maki icon to be stamped onto the pin.
  12207. * @param color - The color of the pin.
  12208. * @param size - The size of the pin, in pixels.
  12209. * @returns The canvas element or a Promise to the canvas element that represents the generated pin.
  12210. */
  12211. fromMakiIconId(id: string, color: Color, size: number): HTMLCanvasElement | Promise<HTMLCanvasElement>;
  12212. /**
  12213. * Creates a pin with the specified text, color, and size. The text will be sized to be as large as possible
  12214. * while still being contained completely within the pin.
  12215. * @param text - The text to be stamped onto the pin.
  12216. * @param color - The color of the pin.
  12217. * @param size - The size of the pin, in pixels.
  12218. * @returns The canvas element that represents the generated pin.
  12219. */
  12220. fromText(text: string, color: Color, size: number): HTMLCanvasElement;
  12221. }
  12222. /**
  12223. * The format of a pixel, i.e., the number of components it has and what they represent.
  12224. */
  12225. export enum PixelFormat {
  12226. /**
  12227. * A pixel format containing a depth value.
  12228. */
  12229. DEPTH_COMPONENT = WebGLConstants.DEPTH_COMPONENT,
  12230. /**
  12231. * A pixel format containing a depth and stencil value, most often used with {@link PixelDatatype.UNSIGNED_INT_24_8}.
  12232. */
  12233. DEPTH_STENCIL = WebGLConstants.DEPTH_STENCIL,
  12234. /**
  12235. * A pixel format containing an alpha channel.
  12236. */
  12237. ALPHA = WebGLConstants.ALPHA,
  12238. /**
  12239. * A pixel format containing red, green, and blue channels.
  12240. */
  12241. RGB = WebGLConstants.RGB,
  12242. /**
  12243. * A pixel format containing red, green, blue, and alpha channels.
  12244. */
  12245. RGBA = WebGLConstants.RGBA,
  12246. /**
  12247. * A pixel format containing a luminance (intensity) channel.
  12248. */
  12249. LUMINANCE = WebGLConstants.LUMINANCE,
  12250. /**
  12251. * A pixel format containing luminance (intensity) and alpha channels.
  12252. */
  12253. LUMINANCE_ALPHA = WebGLConstants.LUMINANCE_ALPHA,
  12254. /**
  12255. * A pixel format containing red, green, and blue channels that is DXT1 compressed.
  12256. */
  12257. RGB_DXT1 = WebGLConstants.COMPRESSED_RGB_S3TC_DXT1_EXT,
  12258. /**
  12259. * A pixel format containing red, green, blue, and alpha channels that is DXT1 compressed.
  12260. */
  12261. RGBA_DXT1 = WebGLConstants.COMPRESSED_RGBA_S3TC_DXT1_EXT,
  12262. /**
  12263. * A pixel format containing red, green, blue, and alpha channels that is DXT3 compressed.
  12264. */
  12265. RGBA_DXT3 = WebGLConstants.COMPRESSED_RGBA_S3TC_DXT3_EXT,
  12266. /**
  12267. * A pixel format containing red, green, blue, and alpha channels that is DXT5 compressed.
  12268. */
  12269. RGBA_DXT5 = WebGLConstants.COMPRESSED_RGBA_S3TC_DXT5_EXT,
  12270. /**
  12271. * A pixel format containing red, green, and blue channels that is PVR 4bpp compressed.
  12272. */
  12273. RGB_PVRTC_4BPPV1 = WebGLConstants.COMPRESSED_RGB_PVRTC_4BPPV1_IMG,
  12274. /**
  12275. * A pixel format containing red, green, and blue channels that is PVR 2bpp compressed.
  12276. */
  12277. RGB_PVRTC_2BPPV1 = WebGLConstants.COMPRESSED_RGB_PVRTC_2BPPV1_IMG,
  12278. /**
  12279. * A pixel format containing red, green, blue, and alpha channels that is PVR 4bpp compressed.
  12280. */
  12281. RGBA_PVRTC_4BPPV1 = WebGLConstants.COMPRESSED_RGBA_PVRTC_4BPPV1_IMG,
  12282. /**
  12283. * A pixel format containing red, green, blue, and alpha channels that is PVR 2bpp compressed.
  12284. */
  12285. RGBA_PVRTC_2BPPV1 = WebGLConstants.COMPRESSED_RGBA_PVRTC_2BPPV1_IMG,
  12286. /**
  12287. * A pixel format containing red, green, blue, and alpha channels that is ASTC compressed.
  12288. */
  12289. RGBA_ASTC = WebGLConstants.COMPRESSED_RGBA_ASTC_4x4_WEBGL,
  12290. /**
  12291. * A pixel format containing red, green, and blue channels that is ETC1 compressed.
  12292. */
  12293. RGB_ETC1 = WebGLConstants.COMPRESSED_RGB_ETC1_WEBGL,
  12294. /**
  12295. * A pixel format containing red, green, and blue channels that is ETC2 compressed.
  12296. */
  12297. RGB8_ETC2 = WebGLConstants.COMPRESSED_RGB8_ETC2,
  12298. /**
  12299. * A pixel format containing red, green, blue, and alpha channels that is ETC2 compressed.
  12300. */
  12301. RGBA8_ETC2_EAC = WebGLConstants.COMPRESSED_RGBA8_ETC2_EAC,
  12302. /**
  12303. * A pixel format containing red, green, blue, and alpha channels that is BC7 compressed.
  12304. */
  12305. RGBA_BC7 = WebGLConstants.COMPRESSED_RGBA_BPTC_UNORM
  12306. }
  12307. /**
  12308. * A plane in Hessian Normal Form defined by
  12309. * <pre>
  12310. * ax + by + cz + d = 0
  12311. * </pre>
  12312. * where (a, b, c) is the plane's <code>normal</code>, d is the signed
  12313. * <code>distance</code> to the plane, and (x, y, z) is any point on
  12314. * the plane.
  12315. * @example
  12316. * // The plane x=0
  12317. * const plane = new Cesium.Plane(Cesium.Cartesian3.UNIT_X, 0.0);
  12318. * @param normal - The plane's normal (normalized).
  12319. * @param distance - The shortest distance from the origin to the plane. The sign of
  12320. * <code>distance</code> determines which side of the plane the origin
  12321. * is on. If <code>distance</code> is positive, the origin is in the half-space
  12322. * in the direction of the normal; if negative, the origin is in the half-space
  12323. * opposite to the normal; if zero, the plane passes through the origin.
  12324. */
  12325. export class Plane {
  12326. constructor(normal: Cartesian3, distance: number);
  12327. /**
  12328. * The plane's normal.
  12329. */
  12330. normal: Cartesian3;
  12331. /**
  12332. * The shortest distance from the origin to the plane. The sign of
  12333. * <code>distance</code> determines which side of the plane the origin
  12334. * is on. If <code>distance</code> is positive, the origin is in the half-space
  12335. * in the direction of the normal; if negative, the origin is in the half-space
  12336. * opposite to the normal; if zero, the plane passes through the origin.
  12337. */
  12338. distance: number;
  12339. /**
  12340. * Creates a plane from a normal and a point on the plane.
  12341. * @example
  12342. * const point = Cesium.Cartesian3.fromDegrees(-72.0, 40.0);
  12343. * const normal = ellipsoid.geodeticSurfaceNormal(point);
  12344. * const tangentPlane = Cesium.Plane.fromPointNormal(point, normal);
  12345. * @param point - The point on the plane.
  12346. * @param normal - The plane's normal (normalized).
  12347. * @param [result] - The object onto which to store the result.
  12348. * @returns A new plane instance or the modified result parameter.
  12349. */
  12350. static fromPointNormal(point: Cartesian3, normal: Cartesian3, result?: Plane): Plane;
  12351. /**
  12352. * Creates a plane from the general equation
  12353. * @param coefficients - The plane's normal (normalized).
  12354. * @param [result] - The object onto which to store the result.
  12355. * @returns A new plane instance or the modified result parameter.
  12356. */
  12357. static fromCartesian4(coefficients: Cartesian4, result?: Plane): Plane;
  12358. /**
  12359. * Computes the signed shortest distance of a point to a plane.
  12360. * The sign of the distance determines which side of the plane the point
  12361. * is on. If the distance is positive, the point is in the half-space
  12362. * in the direction of the normal; if negative, the point is in the half-space
  12363. * opposite to the normal; if zero, the plane passes through the point.
  12364. * @param plane - The plane.
  12365. * @param point - The point.
  12366. * @returns The signed shortest distance of the point to the plane.
  12367. */
  12368. static getPointDistance(plane: Plane, point: Cartesian3): number;
  12369. /**
  12370. * Projects a point onto the plane.
  12371. * @param plane - The plane to project the point onto
  12372. * @param point - The point to project onto the plane
  12373. * @param [result] - The result point. If undefined, a new Cartesian3 will be created.
  12374. * @returns The modified result parameter or a new Cartesian3 instance if one was not provided.
  12375. */
  12376. static projectPointOntoPlane(plane: Plane, point: Cartesian3, result?: Cartesian3): Cartesian3;
  12377. /**
  12378. * Transforms the plane by the given transformation matrix.
  12379. * @param plane - The plane.
  12380. * @param transform - The transformation matrix.
  12381. * @param [result] - The object into which to store the result.
  12382. * @returns The plane transformed by the given transformation matrix.
  12383. */
  12384. static transform(plane: Plane, transform: Matrix4, result?: Plane): Plane;
  12385. /**
  12386. * Duplicates a Plane instance.
  12387. * @param plane - The plane to duplicate.
  12388. * @param [result] - The object onto which to store the result.
  12389. * @returns The modified result parameter or a new Plane instance if one was not provided.
  12390. */
  12391. static clone(plane: Plane, result?: Plane): Plane;
  12392. /**
  12393. * Compares the provided Planes by normal and distance and returns
  12394. * <code>true</code> if they are equal, <code>false</code> otherwise.
  12395. * @param left - The first plane.
  12396. * @param right - The second plane.
  12397. * @returns <code>true</code> if left and right are equal, <code>false</code> otherwise.
  12398. */
  12399. static equals(left: Plane, right: Plane): boolean;
  12400. /**
  12401. * A constant initialized to the XY plane passing through the origin, with normal in positive Z.
  12402. */
  12403. static readonly ORIGIN_XY_PLANE: Plane;
  12404. /**
  12405. * A constant initialized to the YZ plane passing through the origin, with normal in positive X.
  12406. */
  12407. static readonly ORIGIN_YZ_PLANE: Plane;
  12408. /**
  12409. * A constant initialized to the ZX plane passing through the origin, with normal in positive Y.
  12410. */
  12411. static readonly ORIGIN_ZX_PLANE: Plane;
  12412. }
  12413. /**
  12414. * Describes geometry representing a plane centered at the origin, with a unit width and length.
  12415. * @example
  12416. * const planeGeometry = new Cesium.PlaneGeometry({
  12417. * vertexFormat : Cesium.VertexFormat.POSITION_ONLY
  12418. * });
  12419. * @param [options] - Object with the following properties:
  12420. * @param [options.vertexFormat = VertexFormat.DEFAULT] - The vertex attributes to be computed.
  12421. */
  12422. export class PlaneGeometry {
  12423. constructor(options?: {
  12424. vertexFormat?: VertexFormat;
  12425. });
  12426. /**
  12427. * The number of elements used to pack the object into an array.
  12428. */
  12429. static packedLength: number;
  12430. /**
  12431. * Stores the provided instance into the provided array.
  12432. * @param value - The value to pack.
  12433. * @param array - The array to pack into.
  12434. * @param [startingIndex = 0] - The index into the array at which to start packing the elements.
  12435. * @returns The array that was packed into
  12436. */
  12437. static pack(value: PlaneGeometry, array: number[], startingIndex?: number): number[];
  12438. /**
  12439. * Retrieves an instance from a packed array.
  12440. * @param array - The packed array.
  12441. * @param [startingIndex = 0] - The starting index of the element to be unpacked.
  12442. * @param [result] - The object into which to store the result.
  12443. * @returns The modified result parameter or a new PlaneGeometry instance if one was not provided.
  12444. */
  12445. static unpack(array: number[], startingIndex?: number, result?: PlaneGeometry): PlaneGeometry;
  12446. /**
  12447. * Computes the geometric representation of a plane, including its vertices, indices, and a bounding sphere.
  12448. * @param planeGeometry - A description of the plane.
  12449. * @returns The computed vertices and indices.
  12450. */
  12451. static createGeometry(planeGeometry: PlaneGeometry): Geometry | undefined;
  12452. }
  12453. /**
  12454. * Describes geometry representing the outline of a plane centered at the origin, with a unit width and length.
  12455. */
  12456. export class PlaneOutlineGeometry {
  12457. constructor();
  12458. /**
  12459. * The number of elements used to pack the object into an array.
  12460. */
  12461. static packedLength: number;
  12462. /**
  12463. * Stores the provided instance into the provided array.
  12464. * @param value - The value to pack.
  12465. * @param array - The array to pack into.
  12466. * @returns The array that was packed into
  12467. */
  12468. static pack(value: PlaneOutlineGeometry, array: number[]): number[];
  12469. /**
  12470. * Retrieves an instance from a packed array.
  12471. * @param array - The packed array.
  12472. * @param [startingIndex = 0] - The starting index of the element to be unpacked.
  12473. * @param [result] - The object into which to store the result.
  12474. * @returns The modified result parameter or a new PlaneOutlineGeometry instance if one was not provided.
  12475. */
  12476. static unpack(array: number[], startingIndex?: number, result?: PlaneOutlineGeometry): PlaneOutlineGeometry;
  12477. /**
  12478. * Computes the geometric representation of an outline of a plane, including its vertices, indices, and a bounding sphere.
  12479. * @returns The computed vertices and indices.
  12480. */
  12481. static createGeometry(): Geometry | undefined;
  12482. }
  12483. /**
  12484. * 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}.
  12485. * @example
  12486. * // 1. create a polygon from points
  12487. * const polygon = new Cesium.PolygonGeometry({
  12488. * polygonHierarchy : new Cesium.PolygonHierarchy(
  12489. * Cesium.Cartesian3.fromDegreesArray([
  12490. * -72.0, 40.0,
  12491. * -70.0, 35.0,
  12492. * -75.0, 30.0,
  12493. * -70.0, 30.0,
  12494. * -68.0, 40.0
  12495. * ])
  12496. * )
  12497. * });
  12498. * const geometry = Cesium.PolygonGeometry.createGeometry(polygon);
  12499. *
  12500. * // 2. create a nested polygon with holes
  12501. * const polygonWithHole = new Cesium.PolygonGeometry({
  12502. * polygonHierarchy : new Cesium.PolygonHierarchy(
  12503. * Cesium.Cartesian3.fromDegreesArray([
  12504. * -109.0, 30.0,
  12505. * -95.0, 30.0,
  12506. * -95.0, 40.0,
  12507. * -109.0, 40.0
  12508. * ]),
  12509. * [new Cesium.PolygonHierarchy(
  12510. * Cesium.Cartesian3.fromDegreesArray([
  12511. * -107.0, 31.0,
  12512. * -107.0, 39.0,
  12513. * -97.0, 39.0,
  12514. * -97.0, 31.0
  12515. * ]),
  12516. * [new Cesium.PolygonHierarchy(
  12517. * Cesium.Cartesian3.fromDegreesArray([
  12518. * -105.0, 33.0,
  12519. * -99.0, 33.0,
  12520. * -99.0, 37.0,
  12521. * -105.0, 37.0
  12522. * ]),
  12523. * [new Cesium.PolygonHierarchy(
  12524. * Cesium.Cartesian3.fromDegreesArray([
  12525. * -103.0, 34.0,
  12526. * -101.0, 34.0,
  12527. * -101.0, 36.0,
  12528. * -103.0, 36.0
  12529. * ])
  12530. * )]
  12531. * )]
  12532. * )]
  12533. * )
  12534. * });
  12535. * const geometry = Cesium.PolygonGeometry.createGeometry(polygonWithHole);
  12536. *
  12537. * // 3. create extruded polygon
  12538. * const extrudedPolygon = new Cesium.PolygonGeometry({
  12539. * polygonHierarchy : new Cesium.PolygonHierarchy(
  12540. * Cesium.Cartesian3.fromDegreesArray([
  12541. * -72.0, 40.0,
  12542. * -70.0, 35.0,
  12543. * -75.0, 30.0,
  12544. * -70.0, 30.0,
  12545. * -68.0, 40.0
  12546. * ])
  12547. * ),
  12548. * extrudedHeight: 300000
  12549. * });
  12550. * const geometry = Cesium.PolygonGeometry.createGeometry(extrudedPolygon);
  12551. * @param options - Object with the following properties:
  12552. * @param options.polygonHierarchy - A polygon hierarchy that can include holes.
  12553. * @param [options.height = 0.0] - The distance in meters between the polygon and the ellipsoid surface.
  12554. * @param [options.extrudedHeight] - The distance in meters between the polygon's extruded face and the ellipsoid surface.
  12555. * @param [options.vertexFormat = VertexFormat.DEFAULT] - The vertex attributes to be computed.
  12556. * @param [options.stRotation = 0.0] - The rotation of the texture coordinates, in radians. A positive rotation is counter-clockwise.
  12557. * @param [options.ellipsoid = Ellipsoid.WGS84] - The ellipsoid to be used as a reference.
  12558. * @param [options.granularity = Math.RADIANS_PER_DEGREE] - The distance, in radians, between each latitude and longitude. Determines the number of positions in the buffer.
  12559. * @param [options.perPositionHeight = false] - Use the height of options.positions for each position instead of using options.height to determine the height.
  12560. * @param [options.closeTop = true] - When false, leaves off the top of an extruded polygon open.
  12561. * @param [options.closeBottom = true] - When false, leaves off the bottom of an extruded polygon open.
  12562. * @param [options.arcType = ArcType.GEODESIC] - The type of line the polygon edges must follow. Valid options are {@link ArcType.GEODESIC} and {@link ArcType.RHUMB}.
  12563. */
  12564. export class PolygonGeometry {
  12565. constructor(options: {
  12566. polygonHierarchy: PolygonHierarchy;
  12567. height?: number;
  12568. extrudedHeight?: number;
  12569. vertexFormat?: VertexFormat;
  12570. stRotation?: number;
  12571. ellipsoid?: Ellipsoid;
  12572. granularity?: number;
  12573. perPositionHeight?: boolean;
  12574. closeTop?: boolean;
  12575. closeBottom?: boolean;
  12576. arcType?: ArcType;
  12577. });
  12578. /**
  12579. * The number of elements used to pack the object into an array.
  12580. */
  12581. packedLength: number;
  12582. /**
  12583. * A description of a polygon from an array of positions. Polygon geometry can be rendered with both {@link Primitive} and {@link GroundPrimitive}.
  12584. * @example
  12585. * // create a polygon from points
  12586. * const polygon = Cesium.PolygonGeometry.fromPositions({
  12587. * positions : Cesium.Cartesian3.fromDegreesArray([
  12588. * -72.0, 40.0,
  12589. * -70.0, 35.0,
  12590. * -75.0, 30.0,
  12591. * -70.0, 30.0,
  12592. * -68.0, 40.0
  12593. * ])
  12594. * });
  12595. * const geometry = Cesium.PolygonGeometry.createGeometry(polygon);
  12596. * @param options - Object with the following properties:
  12597. * @param options.positions - An array of positions that defined the corner points of the polygon.
  12598. * @param [options.height = 0.0] - The height of the polygon.
  12599. * @param [options.extrudedHeight] - The height of the polygon extrusion.
  12600. * @param [options.vertexFormat = VertexFormat.DEFAULT] - The vertex attributes to be computed.
  12601. * @param [options.stRotation = 0.0] - The rotation of the texture coordinates, in radians. A positive rotation is counter-clockwise.
  12602. * @param [options.ellipsoid = Ellipsoid.WGS84] - The ellipsoid to be used as a reference.
  12603. * @param [options.granularity = Math.RADIANS_PER_DEGREE] - The distance, in radians, between each latitude and longitude. Determines the number of positions in the buffer.
  12604. * @param [options.perPositionHeight = false] - Use the height of options.positions for each position instead of using options.height to determine the height.
  12605. * @param [options.closeTop = true] - When false, leaves off the top of an extruded polygon open.
  12606. * @param [options.closeBottom = true] - When false, leaves off the bottom of an extruded polygon open.
  12607. * @param [options.arcType = ArcType.GEODESIC] - The type of line the polygon edges must follow. Valid options are {@link ArcType.GEODESIC} and {@link ArcType.RHUMB}.
  12608. */
  12609. static fromPositions(options: {
  12610. positions: Cartesian3[];
  12611. height?: number;
  12612. extrudedHeight?: number;
  12613. vertexFormat?: VertexFormat;
  12614. stRotation?: number;
  12615. ellipsoid?: Ellipsoid;
  12616. granularity?: number;
  12617. perPositionHeight?: boolean;
  12618. closeTop?: boolean;
  12619. closeBottom?: boolean;
  12620. arcType?: ArcType;
  12621. }): PolygonGeometry;
  12622. /**
  12623. * Stores the provided instance into the provided array.
  12624. * @param value - The value to pack.
  12625. * @param array - The array to pack into.
  12626. * @param [startingIndex = 0] - The index into the array at which to start packing the elements.
  12627. * @returns The array that was packed into
  12628. */
  12629. static pack(value: PolygonGeometry, array: number[], startingIndex?: number): number[];
  12630. /**
  12631. * Retrieves an instance from a packed array.
  12632. * @param array - The packed array.
  12633. * @param [startingIndex = 0] - The starting index of the element to be unpacked.
  12634. * @param [result] - The object into which to store the result.
  12635. */
  12636. static unpack(array: number[], startingIndex?: number, result?: PolygonGeometry): void;
  12637. /**
  12638. * Returns the bounding rectangle given the provided options
  12639. * @param options - Object with the following properties:
  12640. * @param options.polygonHierarchy - A polygon hierarchy that can include holes.
  12641. * @param [options.granularity = Math.RADIANS_PER_DEGREE] - The distance, in radians, between each latitude and longitude. Determines the number of positions sampled.
  12642. * @param [options.arcType = ArcType.GEODESIC] - The type of line the polygon edges must follow. Valid options are {@link ArcType.GEODESIC} and {@link ArcType.RHUMB}.
  12643. * @param [options.ellipsoid = Ellipsoid.WGS84] - The ellipsoid to be used as a reference.
  12644. * @param [result] - An object in which to store the result.
  12645. * @returns The result rectangle
  12646. */
  12647. static computeRectangle(options: {
  12648. polygonHierarchy: PolygonHierarchy;
  12649. granularity?: number;
  12650. arcType?: ArcType;
  12651. ellipsoid?: Ellipsoid;
  12652. }, result?: Rectangle): Rectangle;
  12653. /**
  12654. * Computes the geometric representation of a polygon, including its vertices, indices, and a bounding sphere.
  12655. * @param polygonGeometry - A description of the polygon.
  12656. * @returns The computed vertices and indices.
  12657. */
  12658. static createGeometry(polygonGeometry: PolygonGeometry): Geometry | undefined;
  12659. }
  12660. /**
  12661. * An hierarchy of linear rings which define a polygon and its holes.
  12662. * The holes themselves may also have holes which nest inner polygons.
  12663. * @param [positions] - A linear ring defining the outer boundary of the polygon or hole.
  12664. * @param [holes] - An array of polygon hierarchies defining holes in the polygon.
  12665. */
  12666. export class PolygonHierarchy {
  12667. constructor(positions?: Cartesian3[], holes?: PolygonHierarchy[]);
  12668. /**
  12669. * A linear ring defining the outer boundary of the polygon or hole.
  12670. */
  12671. positions: Cartesian3[];
  12672. /**
  12673. * An array of polygon hierarchies defining holes in the polygon.
  12674. */
  12675. holes: PolygonHierarchy[];
  12676. }
  12677. /**
  12678. * A description of the outline of a polygon on the ellipsoid. The polygon is defined by a polygon hierarchy.
  12679. * @example
  12680. * // 1. create a polygon outline from points
  12681. * const polygon = new Cesium.PolygonOutlineGeometry({
  12682. * polygonHierarchy : new Cesium.PolygonHierarchy(
  12683. * Cesium.Cartesian3.fromDegreesArray([
  12684. * -72.0, 40.0,
  12685. * -70.0, 35.0,
  12686. * -75.0, 30.0,
  12687. * -70.0, 30.0,
  12688. * -68.0, 40.0
  12689. * ])
  12690. * )
  12691. * });
  12692. * const geometry = Cesium.PolygonOutlineGeometry.createGeometry(polygon);
  12693. *
  12694. * // 2. create a nested polygon with holes outline
  12695. * const polygonWithHole = new Cesium.PolygonOutlineGeometry({
  12696. * polygonHierarchy : new Cesium.PolygonHierarchy(
  12697. * Cesium.Cartesian3.fromDegreesArray([
  12698. * -109.0, 30.0,
  12699. * -95.0, 30.0,
  12700. * -95.0, 40.0,
  12701. * -109.0, 40.0
  12702. * ]),
  12703. * [new Cesium.PolygonHierarchy(
  12704. * Cesium.Cartesian3.fromDegreesArray([
  12705. * -107.0, 31.0,
  12706. * -107.0, 39.0,
  12707. * -97.0, 39.0,
  12708. * -97.0, 31.0
  12709. * ]),
  12710. * [new Cesium.PolygonHierarchy(
  12711. * Cesium.Cartesian3.fromDegreesArray([
  12712. * -105.0, 33.0,
  12713. * -99.0, 33.0,
  12714. * -99.0, 37.0,
  12715. * -105.0, 37.0
  12716. * ]),
  12717. * [new Cesium.PolygonHierarchy(
  12718. * Cesium.Cartesian3.fromDegreesArray([
  12719. * -103.0, 34.0,
  12720. * -101.0, 34.0,
  12721. * -101.0, 36.0,
  12722. * -103.0, 36.0
  12723. * ])
  12724. * )]
  12725. * )]
  12726. * )]
  12727. * )
  12728. * });
  12729. * const geometry = Cesium.PolygonOutlineGeometry.createGeometry(polygonWithHole);
  12730. *
  12731. * // 3. create extruded polygon outline
  12732. * const extrudedPolygon = new Cesium.PolygonOutlineGeometry({
  12733. * polygonHierarchy : new Cesium.PolygonHierarchy(
  12734. * Cesium.Cartesian3.fromDegreesArray([
  12735. * -72.0, 40.0,
  12736. * -70.0, 35.0,
  12737. * -75.0, 30.0,
  12738. * -70.0, 30.0,
  12739. * -68.0, 40.0
  12740. * ])
  12741. * ),
  12742. * extrudedHeight: 300000
  12743. * });
  12744. * const geometry = Cesium.PolygonOutlineGeometry.createGeometry(extrudedPolygon);
  12745. * @param options - Object with the following properties:
  12746. * @param options.polygonHierarchy - A polygon hierarchy that can include holes.
  12747. * @param [options.height = 0.0] - The distance in meters between the polygon and the ellipsoid surface.
  12748. * @param [options.extrudedHeight] - The distance in meters between the polygon's extruded face and the ellipsoid surface.
  12749. * @param [options.vertexFormat = VertexFormat.DEFAULT] - The vertex attributes to be computed.
  12750. * @param [options.ellipsoid = Ellipsoid.WGS84] - The ellipsoid to be used as a reference.
  12751. * @param [options.granularity = Math.RADIANS_PER_DEGREE] - The distance, in radians, between each latitude and longitude. Determines the number of positions in the buffer.
  12752. * @param [options.perPositionHeight = false] - Use the height of options.positions for each position instead of using options.height to determine the height.
  12753. * @param [options.arcType = ArcType.GEODESIC] - The type of path the outline must follow. Valid options are {@link ArcType.GEODESIC} and {@link ArcType.RHUMB}.
  12754. */
  12755. export class PolygonOutlineGeometry {
  12756. constructor(options: {
  12757. polygonHierarchy: PolygonHierarchy;
  12758. height?: number;
  12759. extrudedHeight?: number;
  12760. vertexFormat?: VertexFormat;
  12761. ellipsoid?: Ellipsoid;
  12762. granularity?: number;
  12763. perPositionHeight?: boolean;
  12764. arcType?: ArcType;
  12765. });
  12766. /**
  12767. * The number of elements used to pack the object into an array.
  12768. */
  12769. packedLength: number;
  12770. /**
  12771. * Stores the provided instance into the provided array.
  12772. * @param value - The value to pack.
  12773. * @param array - The array to pack into.
  12774. * @param [startingIndex = 0] - The index into the array at which to start packing the elements.
  12775. * @returns The array that was packed into
  12776. */
  12777. static pack(value: PolygonOutlineGeometry, array: number[], startingIndex?: number): number[];
  12778. /**
  12779. * Retrieves an instance from a packed array.
  12780. * @param array - The packed array.
  12781. * @param [startingIndex = 0] - The starting index of the element to be unpacked.
  12782. * @param [result] - The object into which to store the result.
  12783. * @returns The modified result parameter or a new PolygonOutlineGeometry instance if one was not provided.
  12784. */
  12785. static unpack(array: number[], startingIndex?: number, result?: PolygonOutlineGeometry): PolygonOutlineGeometry;
  12786. /**
  12787. * A description of a polygon outline from an array of positions.
  12788. * @example
  12789. * // create a polygon from points
  12790. * const polygon = Cesium.PolygonOutlineGeometry.fromPositions({
  12791. * positions : Cesium.Cartesian3.fromDegreesArray([
  12792. * -72.0, 40.0,
  12793. * -70.0, 35.0,
  12794. * -75.0, 30.0,
  12795. * -70.0, 30.0,
  12796. * -68.0, 40.0
  12797. * ])
  12798. * });
  12799. * const geometry = Cesium.PolygonOutlineGeometry.createGeometry(polygon);
  12800. * @param options - Object with the following properties:
  12801. * @param options.positions - An array of positions that defined the corner points of the polygon.
  12802. * @param [options.height = 0.0] - The height of the polygon.
  12803. * @param [options.extrudedHeight] - The height of the polygon extrusion.
  12804. * @param [options.ellipsoid = Ellipsoid.WGS84] - The ellipsoid to be used as a reference.
  12805. * @param [options.granularity = Math.RADIANS_PER_DEGREE] - The distance, in radians, between each latitude and longitude. Determines the number of positions in the buffer.
  12806. * @param [options.perPositionHeight = false] - Use the height of options.positions for each position instead of using options.height to determine the height.
  12807. * @param [options.arcType = ArcType.GEODESIC] - The type of path the outline must follow. Valid options are {@link LinkType.GEODESIC} and {@link ArcType.RHUMB}.
  12808. */
  12809. static fromPositions(options: {
  12810. positions: Cartesian3[];
  12811. height?: number;
  12812. extrudedHeight?: number;
  12813. ellipsoid?: Ellipsoid;
  12814. granularity?: number;
  12815. perPositionHeight?: boolean;
  12816. arcType?: ArcType;
  12817. }): PolygonOutlineGeometry;
  12818. /**
  12819. * Computes the geometric representation of a polygon outline, including its vertices, indices, and a bounding sphere.
  12820. * @param polygonGeometry - A description of the polygon outline.
  12821. * @returns The computed vertices and indices.
  12822. */
  12823. static createGeometry(polygonGeometry: PolygonOutlineGeometry): Geometry | undefined;
  12824. }
  12825. /**
  12826. * A description of a polyline modeled as a line strip; the first two positions define a line segment,
  12827. * and each additional position defines a line segment from the previous position. The polyline is capable of
  12828. * displaying with a material.
  12829. * @example
  12830. * // A polyline with two connected line segments
  12831. * const polyline = new Cesium.PolylineGeometry({
  12832. * positions : Cesium.Cartesian3.fromDegreesArray([
  12833. * 0.0, 0.0,
  12834. * 5.0, 0.0,
  12835. * 5.0, 5.0
  12836. * ]),
  12837. * width : 10.0
  12838. * });
  12839. * const geometry = Cesium.PolylineGeometry.createGeometry(polyline);
  12840. * @param options - Object with the following properties:
  12841. * @param options.positions - An array of {@link Cartesian3} defining the positions in the polyline as a line strip.
  12842. * @param [options.width = 1.0] - The width in pixels.
  12843. * @param [options.colors] - An Array of {@link Color} defining the per vertex or per segment colors.
  12844. * @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.
  12845. * @param [options.arcType = ArcType.GEODESIC] - The type of line the polyline segments must follow.
  12846. * @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.
  12847. * @param [options.vertexFormat = VertexFormat.DEFAULT] - The vertex attributes to be computed.
  12848. * @param [options.ellipsoid = Ellipsoid.WGS84] - The ellipsoid to be used as a reference.
  12849. */
  12850. export class PolylineGeometry {
  12851. constructor(options: {
  12852. positions: Cartesian3[];
  12853. width?: number;
  12854. colors?: Color[];
  12855. colorsPerVertex?: boolean;
  12856. arcType?: ArcType;
  12857. granularity?: number;
  12858. vertexFormat?: VertexFormat;
  12859. ellipsoid?: Ellipsoid;
  12860. });
  12861. /**
  12862. * The number of elements used to pack the object into an array.
  12863. */
  12864. packedLength: number;
  12865. /**
  12866. * Stores the provided instance into the provided array.
  12867. * @param value - The value to pack.
  12868. * @param array - The array to pack into.
  12869. * @param [startingIndex = 0] - The index into the array at which to start packing the elements.
  12870. * @returns The array that was packed into
  12871. */
  12872. static pack(value: PolylineGeometry, array: number[], startingIndex?: number): number[];
  12873. /**
  12874. * Retrieves an instance from a packed array.
  12875. * @param array - The packed array.
  12876. * @param [startingIndex = 0] - The starting index of the element to be unpacked.
  12877. * @param [result] - The object into which to store the result.
  12878. * @returns The modified result parameter or a new PolylineGeometry instance if one was not provided.
  12879. */
  12880. static unpack(array: number[], startingIndex?: number, result?: PolylineGeometry): PolylineGeometry;
  12881. /**
  12882. * Computes the geometric representation of a polyline, including its vertices, indices, and a bounding sphere.
  12883. * @param polylineGeometry - A description of the polyline.
  12884. * @returns The computed vertices and indices.
  12885. */
  12886. static createGeometry(polylineGeometry: PolylineGeometry): Geometry | undefined;
  12887. }
  12888. /**
  12889. * A description of a polyline with a volume (a 2D shape extruded along a polyline).
  12890. * @example
  12891. * function computeCircle(radius) {
  12892. * const positions = [];
  12893. * for (let i = 0; i < 360; i++) {
  12894. * const radians = Cesium.Math.toRadians(i);
  12895. * positions.push(new Cesium.Cartesian2(radius * Math.cos(radians), radius * Math.sin(radians)));
  12896. * }
  12897. * return positions;
  12898. * }
  12899. *
  12900. * const volume = new Cesium.PolylineVolumeGeometry({
  12901. * vertexFormat : Cesium.VertexFormat.POSITION_ONLY,
  12902. * polylinePositions : Cesium.Cartesian3.fromDegreesArray([
  12903. * -72.0, 40.0,
  12904. * -70.0, 35.0
  12905. * ]),
  12906. * shapePositions : computeCircle(100000.0)
  12907. * });
  12908. * @param options - Object with the following properties:
  12909. * @param options.polylinePositions - An array of {@link Cartesian3} positions that define the center of the polyline volume.
  12910. * @param options.shapePositions - An array of {@link Cartesian2} positions that define the shape to be extruded along the polyline
  12911. * @param [options.ellipsoid = Ellipsoid.WGS84] - The ellipsoid to be used as a reference.
  12912. * @param [options.granularity = Math.RADIANS_PER_DEGREE] - The distance, in radians, between each latitude and longitude. Determines the number of positions in the buffer.
  12913. * @param [options.vertexFormat = VertexFormat.DEFAULT] - The vertex attributes to be computed.
  12914. * @param [options.cornerType = CornerType.ROUNDED] - Determines the style of the corners.
  12915. */
  12916. export class PolylineVolumeGeometry {
  12917. constructor(options: {
  12918. polylinePositions: Cartesian3[];
  12919. shapePositions: Cartesian2[];
  12920. ellipsoid?: Ellipsoid;
  12921. granularity?: number;
  12922. vertexFormat?: VertexFormat;
  12923. cornerType?: CornerType;
  12924. });
  12925. /**
  12926. * The number of elements used to pack the object into an array.
  12927. */
  12928. packedLength: number;
  12929. /**
  12930. * Stores the provided instance into the provided array.
  12931. * @param value - The value to pack.
  12932. * @param array - The array to pack into.
  12933. * @param [startingIndex = 0] - The index into the array at which to start packing the elements.
  12934. * @returns The array that was packed into
  12935. */
  12936. static pack(value: PolylineVolumeGeometry, array: number[], startingIndex?: number): number[];
  12937. /**
  12938. * Retrieves an instance from a packed array.
  12939. * @param array - The packed array.
  12940. * @param [startingIndex = 0] - The starting index of the element to be unpacked.
  12941. * @param [result] - The object into which to store the result.
  12942. * @returns The modified result parameter or a new PolylineVolumeGeometry instance if one was not provided.
  12943. */
  12944. static unpack(array: number[], startingIndex?: number, result?: PolylineVolumeGeometry): PolylineVolumeGeometry;
  12945. /**
  12946. * Computes the geometric representation of a polyline with a volume, including its vertices, indices, and a bounding sphere.
  12947. * @param polylineVolumeGeometry - A description of the polyline volume.
  12948. * @returns The computed vertices and indices.
  12949. */
  12950. static createGeometry(polylineVolumeGeometry: PolylineVolumeGeometry): Geometry | undefined;
  12951. }
  12952. /**
  12953. * A description of a polyline with a volume (a 2D shape extruded along a polyline).
  12954. * @example
  12955. * function computeCircle(radius) {
  12956. * const positions = [];
  12957. * for (let i = 0; i < 360; i++) {
  12958. * const radians = Cesium.Math.toRadians(i);
  12959. * positions.push(new Cesium.Cartesian2(radius * Math.cos(radians), radius * Math.sin(radians)));
  12960. * }
  12961. * return positions;
  12962. * }
  12963. *
  12964. * const volumeOutline = new Cesium.PolylineVolumeOutlineGeometry({
  12965. * polylinePositions : Cesium.Cartesian3.fromDegreesArray([
  12966. * -72.0, 40.0,
  12967. * -70.0, 35.0
  12968. * ]),
  12969. * shapePositions : computeCircle(100000.0)
  12970. * });
  12971. * @param options - Object with the following properties:
  12972. * @param options.polylinePositions - An array of positions that define the center of the polyline volume.
  12973. * @param options.shapePositions - An array of positions that define the shape to be extruded along the polyline
  12974. * @param [options.ellipsoid = Ellipsoid.WGS84] - The ellipsoid to be used as a reference.
  12975. * @param [options.granularity = Math.RADIANS_PER_DEGREE] - The distance, in radians, between each latitude and longitude. Determines the number of positions in the buffer.
  12976. * @param [options.cornerType = CornerType.ROUNDED] - Determines the style of the corners.
  12977. */
  12978. export class PolylineVolumeOutlineGeometry {
  12979. constructor(options: {
  12980. polylinePositions: Cartesian3[];
  12981. shapePositions: Cartesian2[];
  12982. ellipsoid?: Ellipsoid;
  12983. granularity?: number;
  12984. cornerType?: CornerType;
  12985. });
  12986. /**
  12987. * The number of elements used to pack the object into an array.
  12988. */
  12989. packedLength: number;
  12990. /**
  12991. * Stores the provided instance into the provided array.
  12992. * @param value - The value to pack.
  12993. * @param array - The array to pack into.
  12994. * @param [startingIndex = 0] - The index into the array at which to start packing the elements.
  12995. * @returns The array that was packed into
  12996. */
  12997. static pack(value: PolylineVolumeOutlineGeometry, array: number[], startingIndex?: number): number[];
  12998. /**
  12999. * Retrieves an instance from a packed array.
  13000. * @param array - The packed array.
  13001. * @param [startingIndex = 0] - The starting index of the element to be unpacked.
  13002. * @param [result] - The object into which to store the result.
  13003. * @returns The modified result parameter or a new PolylineVolumeOutlineGeometry instance if one was not provided.
  13004. */
  13005. static unpack(array: number[], startingIndex?: number, result?: PolylineVolumeOutlineGeometry): PolylineVolumeOutlineGeometry;
  13006. /**
  13007. * Computes the geometric representation of the outline of a polyline with a volume, including its vertices, indices, and a bounding sphere.
  13008. * @param polylineVolumeOutlineGeometry - A description of the polyline volume outline.
  13009. * @returns The computed vertices and indices.
  13010. */
  13011. static createGeometry(polylineVolumeOutlineGeometry: PolylineVolumeOutlineGeometry): Geometry | undefined;
  13012. }
  13013. /**
  13014. * The type of a geometric primitive, i.e., points, lines, and triangles.
  13015. */
  13016. export enum PrimitiveType {
  13017. /**
  13018. * Points primitive where each vertex (or index) is a separate point.
  13019. */
  13020. POINTS = WebGLConstants.POINTS,
  13021. /**
  13022. * Lines primitive where each two vertices (or indices) is a line segment. Line segments are not necessarily connected.
  13023. */
  13024. LINES = WebGLConstants.LINES,
  13025. /**
  13026. * Line loop primitive where each vertex (or index) after the first connects a line to
  13027. * the previous vertex, and the last vertex implicitly connects to the first.
  13028. */
  13029. LINE_LOOP = WebGLConstants.LINE_LOOP,
  13030. /**
  13031. * Line strip primitive where each vertex (or index) after the first connects a line to the previous vertex.
  13032. */
  13033. LINE_STRIP = WebGLConstants.LINE_STRIP,
  13034. /**
  13035. * Triangles primitive where each three vertices (or indices) is a triangle. Triangles do not necessarily share edges.
  13036. */
  13037. TRIANGLES = WebGLConstants.TRIANGLES,
  13038. /**
  13039. * Triangle strip primitive where each vertex (or index) after the first two connect to
  13040. * the previous two vertices forming a triangle. For example, this can be used to model a wall.
  13041. */
  13042. TRIANGLE_STRIP = WebGLConstants.TRIANGLE_STRIP,
  13043. /**
  13044. * Triangle fan primitive where each vertex (or index) after the first two connect to
  13045. * the previous vertex and the first vertex forming a triangle. For example, this can be used
  13046. * to model a cone or circle.
  13047. */
  13048. TRIANGLE_FAN = WebGLConstants.TRIANGLE_FAN
  13049. }
  13050. /**
  13051. * Base class for proxying requested made by {@link Resource}.
  13052. */
  13053. export class Proxy {
  13054. constructor();
  13055. /**
  13056. * Get the final URL to use to request a given resource.
  13057. * @param resource - The resource to request.
  13058. * @returns proxied resource
  13059. */
  13060. getURL(resource: string): string;
  13061. }
  13062. /**
  13063. * Defines functions for 2nd order polynomial functions of one variable with only real coefficients.
  13064. */
  13065. export namespace QuadraticRealPolynomial {
  13066. /**
  13067. * Provides the discriminant of the quadratic equation from the supplied coefficients.
  13068. * @param a - The coefficient of the 2nd order monomial.
  13069. * @param b - The coefficient of the 1st order monomial.
  13070. * @param c - The coefficient of the 0th order monomial.
  13071. * @returns The value of the discriminant.
  13072. */
  13073. function computeDiscriminant(a: number, b: number, c: number): number;
  13074. /**
  13075. * Provides the real valued roots of the quadratic polynomial with the provided 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 real valued roots.
  13080. */
  13081. function computeRealRoots(a: number, b: number, c: number): number[];
  13082. }
  13083. /**
  13084. * Terrain data for a single tile where the terrain data is represented as a quantized mesh. A quantized
  13085. * mesh consists of three vertex attributes, longitude, latitude, and height. All attributes are expressed
  13086. * as 16-bit values in the range 0 to 32767. Longitude and latitude are zero at the southwest corner
  13087. * of the tile and 32767 at the northeast corner. Height is zero at the minimum height in the tile
  13088. * and 32767 at the maximum height in the tile.
  13089. * @example
  13090. * const data = new Cesium.QuantizedMeshTerrainData({
  13091. * minimumHeight : -100,
  13092. * maximumHeight : 2101,
  13093. * quantizedVertices : new Uint16Array([// order is SW NW SE NE
  13094. * // longitude
  13095. * 0, 0, 32767, 32767,
  13096. * // latitude
  13097. * 0, 32767, 0, 32767,
  13098. * // heights
  13099. * 16384, 0, 32767, 16384]),
  13100. * indices : new Uint16Array([0, 3, 1,
  13101. * 0, 2, 3]),
  13102. * boundingSphere : new Cesium.BoundingSphere(new Cesium.Cartesian3(1.0, 2.0, 3.0), 10000),
  13103. * orientedBoundingBox : new Cesium.OrientedBoundingBox(new Cesium.Cartesian3(1.0, 2.0, 3.0), Cesium.Matrix3.fromRotationX(Cesium.Math.PI, new Cesium.Matrix3())),
  13104. * horizonOcclusionPoint : new Cesium.Cartesian3(3.0, 2.0, 1.0),
  13105. * westIndices : [0, 1],
  13106. * southIndices : [0, 1],
  13107. * eastIndices : [2, 3],
  13108. * northIndices : [1, 3],
  13109. * westSkirtHeight : 1.0,
  13110. * southSkirtHeight : 1.0,
  13111. * eastSkirtHeight : 1.0,
  13112. * northSkirtHeight : 1.0
  13113. * });
  13114. * @param options - Object with the following properties:
  13115. * @param options.quantizedVertices - The buffer containing the quantized mesh.
  13116. * @param options.indices - The indices specifying how the quantized vertices are linked
  13117. * together into triangles. Each three indices specifies one triangle.
  13118. * @param options.minimumHeight - The minimum terrain height within the tile, in meters above the ellipsoid.
  13119. * @param options.maximumHeight - The maximum terrain height within the tile, in meters above the ellipsoid.
  13120. * @param options.boundingSphere - A sphere bounding all of the vertices in the mesh.
  13121. * @param [options.orientedBoundingBox] - An OrientedBoundingBox bounding all of the vertices in the mesh.
  13122. * @param options.horizonOcclusionPoint - The horizon occlusion point of the mesh. If this point
  13123. * is below the horizon, the entire tile is assumed to be below the horizon as well.
  13124. * The point is expressed in ellipsoid-scaled coordinates.
  13125. * @param options.westIndices - The indices of the vertices on the western edge of the tile.
  13126. * @param options.southIndices - The indices of the vertices on the southern edge of the tile.
  13127. * @param options.eastIndices - The indices of the vertices on the eastern edge of the tile.
  13128. * @param options.northIndices - The indices of the vertices on the northern edge of the tile.
  13129. * @param options.westSkirtHeight - The height of the skirt to add on the western edge of the tile.
  13130. * @param options.southSkirtHeight - The height of the skirt to add on the southern edge of the tile.
  13131. * @param options.eastSkirtHeight - The height of the skirt to add on the eastern edge of the tile.
  13132. * @param options.northSkirtHeight - The height of the skirt to add on the northern edge of the tile.
  13133. * @param [options.childTileMask = 15] - A bit mask indicating which of this tile's four children exist.
  13134. * If a child's bit is set, geometry will be requested for that tile as well when it
  13135. * is needed. If the bit is cleared, the child tile is not requested and geometry is
  13136. * instead upsampled from the parent. The bit values are as follows:
  13137. * <table>
  13138. * <tr><th>Bit Position</th><th>Bit Value</th><th>Child Tile</th></tr>
  13139. * <tr><td>0</td><td>1</td><td>Southwest</td></tr>
  13140. * <tr><td>1</td><td>2</td><td>Southeast</td></tr>
  13141. * <tr><td>2</td><td>4</td><td>Northwest</td></tr>
  13142. * <tr><td>3</td><td>8</td><td>Northeast</td></tr>
  13143. * </table>
  13144. * @param [options.createdByUpsampling = false] - True if this instance was created by upsampling another instance;
  13145. * otherwise, false.
  13146. * @param [options.encodedNormals] - The buffer containing per vertex normals, encoded using 'oct' encoding
  13147. * @param [options.waterMask] - The buffer containing the watermask.
  13148. * @param [options.credits] - Array of credits for this tile.
  13149. */
  13150. export class QuantizedMeshTerrainData {
  13151. constructor(options: {
  13152. quantizedVertices: Uint16Array;
  13153. indices: Uint16Array | Uint32Array;
  13154. minimumHeight: number;
  13155. maximumHeight: number;
  13156. boundingSphere: BoundingSphere;
  13157. orientedBoundingBox?: OrientedBoundingBox;
  13158. horizonOcclusionPoint: Cartesian3;
  13159. westIndices: number[];
  13160. southIndices: number[];
  13161. eastIndices: number[];
  13162. northIndices: number[];
  13163. westSkirtHeight: number;
  13164. southSkirtHeight: number;
  13165. eastSkirtHeight: number;
  13166. northSkirtHeight: number;
  13167. childTileMask?: number;
  13168. createdByUpsampling?: boolean;
  13169. encodedNormals?: Uint8Array;
  13170. waterMask?: Uint8Array;
  13171. credits?: Credit[];
  13172. });
  13173. /**
  13174. * An array of credits for this tile.
  13175. */
  13176. credits: Credit[];
  13177. /**
  13178. * The water mask included in this terrain data, if any. A water mask is a rectangular
  13179. * Uint8Array or image where a value of 255 indicates water and a value of 0 indicates land.
  13180. * Values in between 0 and 255 are allowed as well to smoothly blend between land and water.
  13181. */
  13182. waterMask: Uint8Array | HTMLImageElement | HTMLCanvasElement;
  13183. /**
  13184. * Upsamples this terrain data for use by a descendant tile. The resulting instance will contain a subset of the
  13185. * vertices in this instance, interpolated if necessary.
  13186. * @param tilingScheme - The tiling scheme of this terrain data.
  13187. * @param thisX - The X coordinate of this tile in the tiling scheme.
  13188. * @param thisY - The Y coordinate of this tile in the tiling scheme.
  13189. * @param thisLevel - The level of this tile in the tiling scheme.
  13190. * @param descendantX - The X coordinate within the tiling scheme of the descendant tile for which we are upsampling.
  13191. * @param descendantY - The Y coordinate within the tiling scheme of the descendant tile for which we are upsampling.
  13192. * @param descendantLevel - The level within the tiling scheme of the descendant tile for which we are upsampling.
  13193. * @returns A promise for upsampled heightmap terrain data for the descendant tile,
  13194. * or undefined if too many asynchronous upsample operations are in progress and the request has been
  13195. * deferred.
  13196. */
  13197. upsample(tilingScheme: TilingScheme, thisX: number, thisY: number, thisLevel: number, descendantX: number, descendantY: number, descendantLevel: number): Promise<QuantizedMeshTerrainData> | undefined;
  13198. /**
  13199. * Computes the terrain height at a specified longitude and latitude.
  13200. * @param rectangle - The rectangle covered by this terrain data.
  13201. * @param longitude - The longitude in radians.
  13202. * @param latitude - The latitude in radians.
  13203. * @returns The terrain height at the specified position. The position is clamped to
  13204. * the rectangle, so expect incorrect results for positions far outside the rectangle.
  13205. */
  13206. interpolateHeight(rectangle: Rectangle, longitude: number, latitude: number): number;
  13207. /**
  13208. * Determines if a given child tile is available, based on the
  13209. * {@link HeightmapTerrainData.childTileMask}. The given child tile coordinates are assumed
  13210. * to be one of the four children of this tile. If non-child tile coordinates are
  13211. * given, the availability of the southeast child tile is returned.
  13212. * @param thisX - The tile X coordinate of this (the parent) tile.
  13213. * @param thisY - The tile Y coordinate of this (the parent) tile.
  13214. * @param childX - The tile X coordinate of the child tile to check for availability.
  13215. * @param childY - The tile Y coordinate of the child tile to check for availability.
  13216. * @returns True if the child tile is available; otherwise, false.
  13217. */
  13218. isChildAvailable(thisX: number, thisY: number, childX: number, childY: number): boolean;
  13219. /**
  13220. * Gets a value indicating whether or not this terrain data was created by upsampling lower resolution
  13221. * terrain data. If this value is false, the data was obtained from some other source, such
  13222. * as by downloading it from a remote server. This method should return true for instances
  13223. * returned from a call to {@link HeightmapTerrainData#upsample}.
  13224. * @returns True if this instance was created by upsampling; otherwise, false.
  13225. */
  13226. wasCreatedByUpsampling(): boolean;
  13227. }
  13228. /**
  13229. * Defines functions for 4th order polynomial functions of one variable with only real coefficients.
  13230. */
  13231. export namespace QuarticRealPolynomial {
  13232. /**
  13233. * Provides the discriminant of the quartic equation from the supplied coefficients.
  13234. * @param a - The coefficient of the 4th order monomial.
  13235. * @param b - The coefficient of the 3rd order monomial.
  13236. * @param c - The coefficient of the 2nd order monomial.
  13237. * @param d - The coefficient of the 1st order monomial.
  13238. * @param e - The coefficient of the 0th order monomial.
  13239. * @returns The value of the discriminant.
  13240. */
  13241. function computeDiscriminant(a: number, b: number, c: number, d: number, e: number): number;
  13242. /**
  13243. * Provides the real valued roots of the quartic polynomial with the provided coefficients.
  13244. * @param a - The coefficient of the 4th order monomial.
  13245. * @param b - The coefficient of the 3rd order monomial.
  13246. * @param c - The coefficient of the 2nd order monomial.
  13247. * @param d - The coefficient of the 1st order monomial.
  13248. * @param e - The coefficient of the 0th order monomial.
  13249. * @returns The real valued roots.
  13250. */
  13251. function computeRealRoots(a: number, b: number, c: number, d: number, e: number): number[];
  13252. }
  13253. /**
  13254. * A set of 4-dimensional coordinates used to represent rotation in 3-dimensional space.
  13255. * @param [x = 0.0] - The X component.
  13256. * @param [y = 0.0] - The Y component.
  13257. * @param [z = 0.0] - The Z component.
  13258. * @param [w = 0.0] - The W component.
  13259. */
  13260. export class Quaternion {
  13261. constructor(x?: number, y?: number, z?: number, w?: number);
  13262. /**
  13263. * The X component.
  13264. */
  13265. x: number;
  13266. /**
  13267. * The Y component.
  13268. */
  13269. y: number;
  13270. /**
  13271. * The Z component.
  13272. */
  13273. z: number;
  13274. /**
  13275. * The W component.
  13276. */
  13277. w: number;
  13278. /**
  13279. * Computes a quaternion representing a rotation around an axis.
  13280. * @param axis - The axis of rotation.
  13281. * @param angle - The angle in radians to rotate around the axis.
  13282. * @param [result] - The object onto which to store the result.
  13283. * @returns The modified result parameter or a new Quaternion instance if one was not provided.
  13284. */
  13285. static fromAxisAngle(axis: Cartesian3, angle: number, result?: Quaternion): Quaternion;
  13286. /**
  13287. * Computes a Quaternion from the provided Matrix3 instance.
  13288. * @param matrix - The rotation matrix.
  13289. * @param [result] - The object onto which to store the result.
  13290. * @returns The modified result parameter or a new Quaternion instance if one was not provided.
  13291. */
  13292. static fromRotationMatrix(matrix: Matrix3, result?: Quaternion): Quaternion;
  13293. /**
  13294. * Computes a rotation from the given heading, pitch and roll angles. Heading is the rotation about the
  13295. * negative z axis. Pitch is the rotation about the negative y axis. Roll is the rotation about
  13296. * the positive x axis.
  13297. * @param headingPitchRoll - The rotation expressed as a heading, pitch and roll.
  13298. * @param [result] - The object onto which to store the result.
  13299. * @returns The modified result parameter or a new Quaternion instance if none was provided.
  13300. */
  13301. static fromHeadingPitchRoll(headingPitchRoll: HeadingPitchRoll, result?: Quaternion): Quaternion;
  13302. /**
  13303. * The number of elements used to pack the object into an array.
  13304. */
  13305. static packedLength: number;
  13306. /**
  13307. * Stores the provided instance into the provided array.
  13308. * @param value - The value to pack.
  13309. * @param array - The array to pack into.
  13310. * @param [startingIndex = 0] - The index into the array at which to start packing the elements.
  13311. * @returns The array that was packed into
  13312. */
  13313. static pack(value: Quaternion, array: number[], startingIndex?: number): number[];
  13314. /**
  13315. * Retrieves an instance from a packed array.
  13316. * @param array - The packed array.
  13317. * @param [startingIndex = 0] - The starting index of the element to be unpacked.
  13318. * @param [result] - The object into which to store the result.
  13319. * @returns The modified result parameter or a new Quaternion instance if one was not provided.
  13320. */
  13321. static unpack(array: number[], startingIndex?: number, result?: Quaternion): Quaternion;
  13322. /**
  13323. * The number of elements used to store the object into an array in its interpolatable form.
  13324. */
  13325. static packedInterpolationLength: number;
  13326. /**
  13327. * Converts a packed array into a form suitable for interpolation.
  13328. * @param packedArray - The packed array.
  13329. * @param [startingIndex = 0] - The index of the first element to be converted.
  13330. * @param [lastIndex = packedArray.length] - The index of the last element to be converted.
  13331. * @param [result] - The object into which to store the result.
  13332. */
  13333. static convertPackedArrayForInterpolation(packedArray: number[], startingIndex?: number, lastIndex?: number, result?: number[]): void;
  13334. /**
  13335. * Retrieves an instance from a packed array converted with {@link convertPackedArrayForInterpolation}.
  13336. * @param array - The array previously packed for interpolation.
  13337. * @param sourceArray - The original packed array.
  13338. * @param [firstIndex = 0] - The firstIndex used to convert the array.
  13339. * @param [lastIndex = packedArray.length] - The lastIndex used to convert the array.
  13340. * @param [result] - The object into which to store the result.
  13341. * @returns The modified result parameter or a new Quaternion instance if one was not provided.
  13342. */
  13343. static unpackInterpolationResult(array: number[], sourceArray: number[], firstIndex?: number, lastIndex?: number, result?: Quaternion): Quaternion;
  13344. /**
  13345. * Duplicates a Quaternion instance.
  13346. * @param quaternion - The quaternion to duplicate.
  13347. * @param [result] - The object onto which to store the result.
  13348. * @returns The modified result parameter or a new Quaternion instance if one was not provided. (Returns undefined if quaternion is undefined)
  13349. */
  13350. static clone(quaternion: Quaternion, result?: Quaternion): Quaternion;
  13351. /**
  13352. * Computes the conjugate of the provided quaternion.
  13353. * @param quaternion - The quaternion to conjugate.
  13354. * @param result - The object onto which to store the result.
  13355. * @returns The modified result parameter.
  13356. */
  13357. static conjugate(quaternion: Quaternion, result: Quaternion): Quaternion;
  13358. /**
  13359. * Computes magnitude squared for the provided quaternion.
  13360. * @param quaternion - The quaternion to conjugate.
  13361. * @returns The magnitude squared.
  13362. */
  13363. static magnitudeSquared(quaternion: Quaternion): number;
  13364. /**
  13365. * Computes magnitude for the provided quaternion.
  13366. * @param quaternion - The quaternion to conjugate.
  13367. * @returns The magnitude.
  13368. */
  13369. static magnitude(quaternion: Quaternion): number;
  13370. /**
  13371. * Computes the normalized form of the provided quaternion.
  13372. * @param quaternion - The quaternion to normalize.
  13373. * @param result - The object onto which to store the result.
  13374. * @returns The modified result parameter.
  13375. */
  13376. static normalize(quaternion: Quaternion, result: Quaternion): Quaternion;
  13377. /**
  13378. * Computes the inverse of the provided quaternion.
  13379. * @param quaternion - The quaternion to normalize.
  13380. * @param result - The object onto which to store the result.
  13381. * @returns The modified result parameter.
  13382. */
  13383. static inverse(quaternion: Quaternion, result: Quaternion): Quaternion;
  13384. /**
  13385. * Computes the componentwise sum of two quaternions.
  13386. * @param left - The first quaternion.
  13387. * @param right - The second quaternion.
  13388. * @param result - The object onto which to store the result.
  13389. * @returns The modified result parameter.
  13390. */
  13391. static add(left: Quaternion, right: Quaternion, result: Quaternion): Quaternion;
  13392. /**
  13393. * Computes the componentwise difference 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 subtract(left: Quaternion, right: Quaternion, result: Quaternion): Quaternion;
  13400. /**
  13401. * Negates the provided quaternion.
  13402. * @param quaternion - The quaternion to be negated.
  13403. * @param result - The object onto which to store the result.
  13404. * @returns The modified result parameter.
  13405. */
  13406. static negate(quaternion: Quaternion, result: Quaternion): Quaternion;
  13407. /**
  13408. * Computes the dot (scalar) product of two quaternions.
  13409. * @param left - The first quaternion.
  13410. * @param right - The second quaternion.
  13411. * @returns The dot product.
  13412. */
  13413. static dot(left: Quaternion, right: Quaternion): number;
  13414. /**
  13415. * Computes the product of two quaternions.
  13416. * @param left - The first quaternion.
  13417. * @param right - The second quaternion.
  13418. * @param result - The object onto which to store the result.
  13419. * @returns The modified result parameter.
  13420. */
  13421. static multiply(left: Quaternion, right: Quaternion, result: Quaternion): Quaternion;
  13422. /**
  13423. * Multiplies the provided quaternion componentwise by the provided scalar.
  13424. * @param quaternion - The quaternion to be scaled.
  13425. * @param scalar - The scalar to multiply with.
  13426. * @param result - The object onto which to store the result.
  13427. * @returns The modified result parameter.
  13428. */
  13429. static multiplyByScalar(quaternion: Quaternion, scalar: number, result: Quaternion): Quaternion;
  13430. /**
  13431. * Divides the provided quaternion componentwise by the provided scalar.
  13432. * @param quaternion - The quaternion to be divided.
  13433. * @param scalar - The scalar to divide by.
  13434. * @param result - The object onto which to store the result.
  13435. * @returns The modified result parameter.
  13436. */
  13437. static divideByScalar(quaternion: Quaternion, scalar: number, result: Quaternion): Quaternion;
  13438. /**
  13439. * Computes the axis of rotation of the provided quaternion.
  13440. * @param quaternion - The quaternion to use.
  13441. * @param result - The object onto which to store the result.
  13442. * @returns The modified result parameter.
  13443. */
  13444. static computeAxis(quaternion: Quaternion, result: Cartesian3): Cartesian3;
  13445. /**
  13446. * Computes the angle of rotation of the provided quaternion.
  13447. * @param quaternion - The quaternion to use.
  13448. * @returns The angle of rotation.
  13449. */
  13450. static computeAngle(quaternion: Quaternion): number;
  13451. /**
  13452. * Computes the linear interpolation or extrapolation at t using the provided quaternions.
  13453. * @param start - The value corresponding to t at 0.0.
  13454. * @param end - The value corresponding to t at 1.0.
  13455. * @param t - The point along t at which to interpolate.
  13456. * @param result - The object onto which to store the result.
  13457. * @returns The modified result parameter.
  13458. */
  13459. static lerp(start: Quaternion, end: Quaternion, t: number, result: Quaternion): Quaternion;
  13460. /**
  13461. * Computes the spherical linear interpolation or extrapolation at t using the provided quaternions.
  13462. * @param start - The value corresponding to t at 0.0.
  13463. * @param end - The value corresponding to t at 1.0.
  13464. * @param t - The point along t at which to interpolate.
  13465. * @param result - The object onto which to store the result.
  13466. * @returns The modified result parameter.
  13467. */
  13468. static slerp(start: Quaternion, end: Quaternion, t: number, result: Quaternion): Quaternion;
  13469. /**
  13470. * The logarithmic quaternion function.
  13471. * @param quaternion - The unit quaternion.
  13472. * @param result - The object onto which to store the result.
  13473. * @returns The modified result parameter.
  13474. */
  13475. static log(quaternion: Quaternion, result: Cartesian3): Cartesian3;
  13476. /**
  13477. * The exponential quaternion function.
  13478. * @param cartesian - The cartesian.
  13479. * @param result - The object onto which to store the result.
  13480. * @returns The modified result parameter.
  13481. */
  13482. static exp(cartesian: Cartesian3, result: Quaternion): Quaternion;
  13483. /**
  13484. * Computes an inner quadrangle point.
  13485. * <p>This will compute quaternions that ensure a squad curve is C<sup>1</sup>.</p>
  13486. * @param q0 - The first quaternion.
  13487. * @param q1 - The second quaternion.
  13488. * @param q2 - The third quaternion.
  13489. * @param result - The object onto which to store the result.
  13490. * @returns The modified result parameter.
  13491. */
  13492. static computeInnerQuadrangle(q0: Quaternion, q1: Quaternion, q2: Quaternion, result: Quaternion): Quaternion;
  13493. /**
  13494. * Computes the spherical quadrangle interpolation between quaternions.
  13495. * @example
  13496. * // 1. compute the squad interpolation between two quaternions on a curve
  13497. * const s0 = Cesium.Quaternion.computeInnerQuadrangle(quaternions[i - 1], quaternions[i], quaternions[i + 1], new Cesium.Quaternion());
  13498. * const s1 = Cesium.Quaternion.computeInnerQuadrangle(quaternions[i], quaternions[i + 1], quaternions[i + 2], new Cesium.Quaternion());
  13499. * const q = Cesium.Quaternion.squad(quaternions[i], quaternions[i + 1], s0, s1, t, new Cesium.Quaternion());
  13500. *
  13501. * // 2. compute the squad interpolation as above but where the first quaternion is a end point.
  13502. * const s1 = Cesium.Quaternion.computeInnerQuadrangle(quaternions[0], quaternions[1], quaternions[2], new Cesium.Quaternion());
  13503. * const q = Cesium.Quaternion.squad(quaternions[0], quaternions[1], quaternions[0], s1, t, new Cesium.Quaternion());
  13504. * @param q0 - The first quaternion.
  13505. * @param q1 - The second quaternion.
  13506. * @param s0 - The first inner quadrangle.
  13507. * @param s1 - The second inner quadrangle.
  13508. * @param t - The time in [0,1] used to interpolate.
  13509. * @param result - The object onto which to store the result.
  13510. * @returns The modified result parameter.
  13511. */
  13512. static squad(q0: Quaternion, q1: Quaternion, s0: Quaternion, s1: Quaternion, t: number, result: Quaternion): Quaternion;
  13513. /**
  13514. * Computes the spherical linear interpolation or extrapolation at t using the provided quaternions.
  13515. * This implementation is faster than {@link Quaternion#slerp}, but is only accurate up to 10<sup>-6</sup>.
  13516. * @param start - The value corresponding to t at 0.0.
  13517. * @param end - The value corresponding to t at 1.0.
  13518. * @param t - The point along t at which to interpolate.
  13519. * @param result - The object onto which to store the result.
  13520. * @returns The modified result parameter.
  13521. */
  13522. static fastSlerp(start: Quaternion, end: Quaternion, t: number, result: Quaternion): Quaternion;
  13523. /**
  13524. * Computes the spherical quadrangle interpolation between quaternions.
  13525. * An implementation that is faster than {@link Quaternion#squad}, but less accurate.
  13526. * @param q0 - The first quaternion.
  13527. * @param q1 - The second quaternion.
  13528. * @param s0 - The first inner quadrangle.
  13529. * @param s1 - The second inner quadrangle.
  13530. * @param t - The time in [0,1] used to interpolate.
  13531. * @param result - The object onto which to store the result.
  13532. * @returns The modified result parameter or a new instance if none was provided.
  13533. */
  13534. static fastSquad(q0: Quaternion, q1: Quaternion, s0: Quaternion, s1: Quaternion, t: number, result: Quaternion): Quaternion;
  13535. /**
  13536. * Compares the provided quaternions componentwise and returns
  13537. * <code>true</code> if they are equal, <code>false</code> otherwise.
  13538. * @param [left] - The first quaternion.
  13539. * @param [right] - The second quaternion.
  13540. * @returns <code>true</code> if left and right are equal, <code>false</code> otherwise.
  13541. */
  13542. static equals(left?: Quaternion, right?: Quaternion): boolean;
  13543. /**
  13544. * Compares the provided quaternions componentwise and returns
  13545. * <code>true</code> if they are within the provided epsilon,
  13546. * <code>false</code> otherwise.
  13547. * @param [left] - The first quaternion.
  13548. * @param [right] - The second quaternion.
  13549. * @param [epsilon = 0] - The epsilon to use for equality testing.
  13550. * @returns <code>true</code> if left and right are within the provided epsilon, <code>false</code> otherwise.
  13551. */
  13552. static equalsEpsilon(left?: Quaternion, right?: Quaternion, epsilon?: number): boolean;
  13553. /**
  13554. * An immutable Quaternion instance initialized to (0.0, 0.0, 0.0, 0.0).
  13555. */
  13556. static readonly ZERO: Quaternion;
  13557. /**
  13558. * An immutable Quaternion instance initialized to (0.0, 0.0, 0.0, 1.0).
  13559. */
  13560. static readonly IDENTITY: Quaternion;
  13561. /**
  13562. * Duplicates this Quaternion instance.
  13563. * @param [result] - The object onto which to store the result.
  13564. * @returns The modified result parameter or a new Quaternion instance if one was not provided.
  13565. */
  13566. clone(result?: Quaternion): Quaternion;
  13567. /**
  13568. * Compares this and the provided quaternion componentwise and returns
  13569. * <code>true</code> if they are equal, <code>false</code> otherwise.
  13570. * @param [right] - The right hand side quaternion.
  13571. * @returns <code>true</code> if left and right are equal, <code>false</code> otherwise.
  13572. */
  13573. equals(right?: Quaternion): boolean;
  13574. /**
  13575. * Compares this and the provided quaternion componentwise and returns
  13576. * <code>true</code> if they are within the provided epsilon,
  13577. * <code>false</code> otherwise.
  13578. * @param [right] - The right hand side quaternion.
  13579. * @param [epsilon = 0] - The epsilon to use for equality testing.
  13580. * @returns <code>true</code> if left and right are within the provided epsilon, <code>false</code> otherwise.
  13581. */
  13582. equalsEpsilon(right?: Quaternion, epsilon?: number): boolean;
  13583. /**
  13584. * Returns a string representing this quaternion in the format (x, y, z, w).
  13585. * @returns A string representing this Quaternion.
  13586. */
  13587. toString(): string;
  13588. }
  13589. /**
  13590. * A spline that uses spherical linear (slerp) interpolation to create a quaternion curve.
  13591. * The generated curve is in the class C<sup>1</sup>.
  13592. * @param options - Object with the following properties:
  13593. * @param options.times - An array of strictly increasing, unit-less, floating-point times at each point.
  13594. * The values are in no way connected to the clock time. They are the parameterization for the curve.
  13595. * @param options.points - The array of {@link Quaternion} control points.
  13596. */
  13597. export class QuaternionSpline {
  13598. constructor(options: {
  13599. times: number[];
  13600. points: Quaternion[];
  13601. });
  13602. /**
  13603. * An array of times for the control points.
  13604. */
  13605. readonly times: number[];
  13606. /**
  13607. * An array of {@link Quaternion} control points.
  13608. */
  13609. readonly points: Quaternion[];
  13610. /**
  13611. * Finds an index <code>i</code> in <code>times</code> such that the parameter
  13612. * <code>time</code> is in the interval <code>[times[i], times[i + 1]]</code>.
  13613. * @param time - The time.
  13614. * @returns The index for the element at the start of the interval.
  13615. */
  13616. findTimeInterval(time: number): number;
  13617. /**
  13618. * Wraps the given time to the period covered by the spline.
  13619. * @param time - The time.
  13620. * @returns The time, wrapped around to the updated animation.
  13621. */
  13622. wrapTime(time: number): number;
  13623. /**
  13624. * Clamps the given time to the period covered by the spline.
  13625. * @param time - The time.
  13626. * @returns The time, clamped to the animation period.
  13627. */
  13628. clampTime(time: number): number;
  13629. /**
  13630. * Evaluates the curve at a given time.
  13631. * @param time - The time at which to evaluate the curve.
  13632. * @param [result] - The object onto which to store the result.
  13633. * @returns The modified result parameter or a new instance of the point on the curve at the given time.
  13634. */
  13635. evaluate(time: number, result?: Quaternion): Quaternion;
  13636. }
  13637. /**
  13638. * A queue that can enqueue items at the end, and dequeue items from the front.
  13639. */
  13640. export class Queue {
  13641. constructor();
  13642. /**
  13643. * The length of the queue.
  13644. */
  13645. readonly length: number;
  13646. /**
  13647. * Enqueues the specified item.
  13648. * @param item - The item to enqueue.
  13649. */
  13650. enqueue(item: any): void;
  13651. /**
  13652. * Dequeues an item. Returns undefined if the queue is empty.
  13653. * @returns The the dequeued item.
  13654. */
  13655. dequeue(): any;
  13656. /**
  13657. * Returns the item at the front of the queue. Returns undefined if the queue is empty.
  13658. * @returns The item at the front of the queue.
  13659. */
  13660. peek(): any;
  13661. /**
  13662. * Check whether this queue contains the specified item.
  13663. * @param item - The item to search for.
  13664. */
  13665. contains(item: any): void;
  13666. /**
  13667. * Remove all items from the queue.
  13668. */
  13669. clear(): void;
  13670. /**
  13671. * Sort the items in the queue in-place.
  13672. * @param compareFunction - A function that defines the sort order.
  13673. */
  13674. sort(compareFunction: Queue.Comparator): void;
  13675. }
  13676. export namespace Queue {
  13677. /**
  13678. * A function used to compare two items while sorting a queue.
  13679. * @example
  13680. * function compareNumbers(a, b) {
  13681. * return a - b;
  13682. * }
  13683. * @param a - An item in the array.
  13684. * @param b - An item in the array.
  13685. */
  13686. type Comparator = (a: any, b: any) => number;
  13687. }
  13688. /**
  13689. * Represents a ray that extends infinitely from the provided origin in the provided direction.
  13690. * @param [origin = Cartesian3.ZERO] - The origin of the ray.
  13691. * @param [direction = Cartesian3.ZERO] - The direction of the ray.
  13692. */
  13693. export class Ray {
  13694. constructor(origin?: Cartesian3, direction?: Cartesian3);
  13695. /**
  13696. * The origin of the ray.
  13697. */
  13698. origin: Cartesian3;
  13699. /**
  13700. * The direction of the ray.
  13701. */
  13702. direction: Cartesian3;
  13703. /**
  13704. * Duplicates a Ray instance.
  13705. * @param ray - The ray to duplicate.
  13706. * @param [result] - The object onto which to store the result.
  13707. * @returns The modified result parameter or a new Ray instance if one was not provided. (Returns undefined if ray is undefined)
  13708. */
  13709. static clone(ray: Ray, result?: Ray): Ray;
  13710. /**
  13711. * Computes the point along the ray given by r(t) = o + t*d,
  13712. * where o is the origin of the ray and d is the direction.
  13713. * @example
  13714. * //Get the first intersection point of a ray and an ellipsoid.
  13715. * const intersection = Cesium.IntersectionTests.rayEllipsoid(ray, ellipsoid);
  13716. * const point = Cesium.Ray.getPoint(ray, intersection.start);
  13717. * @param ray - The ray.
  13718. * @param t - A scalar value.
  13719. * @param [result] - The object in which the result will be stored.
  13720. * @returns The modified result parameter, or a new instance if none was provided.
  13721. */
  13722. static getPoint(ray: Ray, t: number, result?: Cartesian3): Cartesian3;
  13723. }
  13724. /**
  13725. * A two dimensional region specified as longitude and latitude coordinates.
  13726. * @param [west = 0.0] - The westernmost longitude, in radians, in the range [-Pi, Pi].
  13727. * @param [south = 0.0] - The southernmost latitude, in radians, in the range [-Pi/2, Pi/2].
  13728. * @param [east = 0.0] - The easternmost longitude, in radians, in the range [-Pi, Pi].
  13729. * @param [north = 0.0] - The northernmost latitude, in radians, in the range [-Pi/2, Pi/2].
  13730. */
  13731. export class Rectangle {
  13732. constructor(west?: number, south?: number, east?: number, north?: number);
  13733. /**
  13734. * The westernmost longitude in radians in the range [-Pi, Pi].
  13735. */
  13736. west: number;
  13737. /**
  13738. * The southernmost latitude in radians in the range [-Pi/2, Pi/2].
  13739. */
  13740. south: number;
  13741. /**
  13742. * The easternmost longitude in radians in the range [-Pi, Pi].
  13743. */
  13744. east: number;
  13745. /**
  13746. * The northernmost latitude in radians in the range [-Pi/2, Pi/2].
  13747. */
  13748. north: number;
  13749. /**
  13750. * Gets the width of the rectangle in radians.
  13751. */
  13752. readonly width: number;
  13753. /**
  13754. * Gets the height of the rectangle in radians.
  13755. */
  13756. readonly height: number;
  13757. /**
  13758. * The number of elements used to pack the object into an array.
  13759. */
  13760. static packedLength: number;
  13761. /**
  13762. * Stores the provided instance into the provided array.
  13763. * @param value - The value to pack.
  13764. * @param array - The array to pack into.
  13765. * @param [startingIndex = 0] - The index into the array at which to start packing the elements.
  13766. * @returns The array that was packed into
  13767. */
  13768. static pack(value: Rectangle, array: number[], startingIndex?: number): number[];
  13769. /**
  13770. * Retrieves an instance from a packed array.
  13771. * @param array - The packed array.
  13772. * @param [startingIndex = 0] - The starting index of the element to be unpacked.
  13773. * @param [result] - The object into which to store the result.
  13774. * @returns The modified result parameter or a new Rectangle instance if one was not provided.
  13775. */
  13776. static unpack(array: number[], startingIndex?: number, result?: Rectangle): Rectangle;
  13777. /**
  13778. * Computes the width of a rectangle in radians.
  13779. * @param rectangle - The rectangle to compute the width of.
  13780. * @returns The width.
  13781. */
  13782. static computeWidth(rectangle: Rectangle): number;
  13783. /**
  13784. * Computes the height of a rectangle in radians.
  13785. * @param rectangle - The rectangle to compute the height of.
  13786. * @returns The height.
  13787. */
  13788. static computeHeight(rectangle: Rectangle): number;
  13789. /**
  13790. * Creates a rectangle given the boundary longitude and latitude in degrees.
  13791. * @example
  13792. * const rectangle = Cesium.Rectangle.fromDegrees(0.0, 20.0, 10.0, 30.0);
  13793. * @param [west = 0.0] - The westernmost longitude in degrees in the range [-180.0, 180.0].
  13794. * @param [south = 0.0] - The southernmost latitude in degrees in the range [-90.0, 90.0].
  13795. * @param [east = 0.0] - The easternmost longitude in degrees in the range [-180.0, 180.0].
  13796. * @param [north = 0.0] - The northernmost latitude in degrees in the range [-90.0, 90.0].
  13797. * @param [result] - The object onto which to store the result, or undefined if a new instance should be created.
  13798. * @returns The modified result parameter or a new Rectangle instance if none was provided.
  13799. */
  13800. static fromDegrees(west?: number, south?: number, east?: number, north?: number, result?: Rectangle): Rectangle;
  13801. /**
  13802. * Creates a rectangle given the boundary longitude and latitude in radians.
  13803. * @example
  13804. * const rectangle = Cesium.Rectangle.fromRadians(0.0, Math.PI/4, Math.PI/8, 3*Math.PI/4);
  13805. * @param [west = 0.0] - The westernmost longitude in radians in the range [-Math.PI, Math.PI].
  13806. * @param [south = 0.0] - The southernmost latitude in radians in the range [-Math.PI/2, Math.PI/2].
  13807. * @param [east = 0.0] - The easternmost longitude in radians in the range [-Math.PI, Math.PI].
  13808. * @param [north = 0.0] - The northernmost latitude in radians in the range [-Math.PI/2, Math.PI/2].
  13809. * @param [result] - The object onto which to store the result, or undefined if a new instance should be created.
  13810. * @returns The modified result parameter or a new Rectangle instance if none was provided.
  13811. */
  13812. static fromRadians(west?: number, south?: number, east?: number, north?: number, result?: Rectangle): Rectangle;
  13813. /**
  13814. * Creates the smallest possible Rectangle that encloses all positions in the provided array.
  13815. * @param cartographics - The list of Cartographic instances.
  13816. * @param [result] - The object onto which to store the result, or undefined if a new instance should be created.
  13817. * @returns The modified result parameter or a new Rectangle instance if none was provided.
  13818. */
  13819. static fromCartographicArray(cartographics: Cartographic[], result?: Rectangle): Rectangle;
  13820. /**
  13821. * Creates the smallest possible Rectangle that encloses all positions in the provided array.
  13822. * @param cartesians - The list of Cartesian instances.
  13823. * @param [ellipsoid = Ellipsoid.WGS84] - The ellipsoid the cartesians are on.
  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 fromCartesianArray(cartesians: Cartesian3[], ellipsoid?: Ellipsoid, result?: Rectangle): Rectangle;
  13828. /**
  13829. * Duplicates a Rectangle.
  13830. * @param rectangle - The rectangle to clone.
  13831. * @param [result] - The object onto which to store the result, or undefined if a new instance should be created.
  13832. * @returns The modified result parameter or a new Rectangle instance if none was provided. (Returns undefined if rectangle is undefined)
  13833. */
  13834. static clone(rectangle: Rectangle, result?: Rectangle): Rectangle;
  13835. /**
  13836. * Compares the provided Rectangles componentwise and returns
  13837. * <code>true</code> if they pass an absolute or relative tolerance test,
  13838. * <code>false</code> otherwise.
  13839. * @param [left] - The first Rectangle.
  13840. * @param [right] - The second Rectangle.
  13841. * @param [absoluteEpsilon = 0] - The absolute epsilon tolerance to use for equality testing.
  13842. * @returns <code>true</code> if left and right are within the provided epsilon, <code>false</code> otherwise.
  13843. */
  13844. static equalsEpsilon(left?: Rectangle, right?: Rectangle, absoluteEpsilon?: number): boolean;
  13845. /**
  13846. * Duplicates this Rectangle.
  13847. * @param [result] - The object onto which to store the result.
  13848. * @returns The modified result parameter or a new Rectangle instance if none was provided.
  13849. */
  13850. clone(result?: Rectangle): Rectangle;
  13851. /**
  13852. * Compares the provided Rectangle with this Rectangle componentwise and returns
  13853. * <code>true</code> if they are equal, <code>false</code> otherwise.
  13854. * @param [other] - The Rectangle to compare.
  13855. * @returns <code>true</code> if the Rectangles are equal, <code>false</code> otherwise.
  13856. */
  13857. equals(other?: Rectangle): boolean;
  13858. /**
  13859. * Compares the provided rectangles and returns <code>true</code> if they are equal,
  13860. * <code>false</code> otherwise.
  13861. * @param [left] - The first Rectangle.
  13862. * @param [right] - The second Rectangle.
  13863. * @returns <code>true</code> if left and right are equal; otherwise <code>false</code>.
  13864. */
  13865. static equals(left?: Rectangle, right?: Rectangle): boolean;
  13866. /**
  13867. * Compares the provided Rectangle with this Rectangle componentwise and returns
  13868. * <code>true</code> if they are within the provided epsilon,
  13869. * <code>false</code> otherwise.
  13870. * @param [other] - The Rectangle to compare.
  13871. * @param [epsilon = 0] - The epsilon to use for equality testing.
  13872. * @returns <code>true</code> if the Rectangles are within the provided epsilon, <code>false</code> otherwise.
  13873. */
  13874. equalsEpsilon(other?: Rectangle, epsilon?: number): boolean;
  13875. /**
  13876. * Checks a Rectangle's properties and throws if they are not in valid ranges.
  13877. * @param rectangle - The rectangle to validate
  13878. */
  13879. static validate(rectangle: Rectangle): void;
  13880. /**
  13881. * Computes the southwest corner of a rectangle.
  13882. * @param rectangle - The rectangle for which to find the corner
  13883. * @param [result] - The object onto which to store the result.
  13884. * @returns The modified result parameter or a new Cartographic instance if none was provided.
  13885. */
  13886. static southwest(rectangle: Rectangle, result?: Cartographic): Cartographic;
  13887. /**
  13888. * Computes the northwest corner of a rectangle.
  13889. * @param rectangle - The rectangle for which to find the corner
  13890. * @param [result] - The object onto which to store the result.
  13891. * @returns The modified result parameter or a new Cartographic instance if none was provided.
  13892. */
  13893. static northwest(rectangle: Rectangle, result?: Cartographic): Cartographic;
  13894. /**
  13895. * Computes the northeast corner of a rectangle.
  13896. * @param rectangle - The rectangle for which to find the corner
  13897. * @param [result] - The object onto which to store the result.
  13898. * @returns The modified result parameter or a new Cartographic instance if none was provided.
  13899. */
  13900. static northeast(rectangle: Rectangle, result?: Cartographic): Cartographic;
  13901. /**
  13902. * Computes the southeast corner of a rectangle.
  13903. * @param rectangle - The rectangle for which to find the corner
  13904. * @param [result] - The object onto which to store the result.
  13905. * @returns The modified result parameter or a new Cartographic instance if none was provided.
  13906. */
  13907. static southeast(rectangle: Rectangle, result?: Cartographic): Cartographic;
  13908. /**
  13909. * Computes the center of a rectangle.
  13910. * @param rectangle - The rectangle for which to find the center
  13911. * @param [result] - The object onto which to store the result.
  13912. * @returns The modified result parameter or a new Cartographic instance if none was provided.
  13913. */
  13914. static center(rectangle: Rectangle, result?: Cartographic): Cartographic;
  13915. /**
  13916. * Computes the intersection of two rectangles. This function assumes that the rectangle's coordinates are
  13917. * latitude and longitude in radians and produces a correct intersection, taking into account the fact that
  13918. * the same angle can be represented with multiple values as well as the wrapping of longitude at the
  13919. * anti-meridian. For a simple intersection that ignores these factors and can be used with projected
  13920. * coordinates, see {@link Rectangle.simpleIntersection}.
  13921. * @param rectangle - On rectangle to find an intersection
  13922. * @param otherRectangle - Another rectangle to find an intersection
  13923. * @param [result] - The object onto which to store the result.
  13924. * @returns The modified result parameter, a new Rectangle instance if none was provided or undefined if there is no intersection.
  13925. */
  13926. static intersection(rectangle: Rectangle, otherRectangle: Rectangle, result?: Rectangle): Rectangle | undefined;
  13927. /**
  13928. * Computes a simple intersection of two rectangles. Unlike {@link Rectangle.intersection}, this function
  13929. * does not attempt to put the angular coordinates into a consistent range or to account for crossing the
  13930. * anti-meridian. As such, it can be used for rectangles where the coordinates are not simply latitude
  13931. * and longitude (i.e. projected coordinates).
  13932. * @param rectangle - On rectangle to find an intersection
  13933. * @param otherRectangle - Another rectangle to find an intersection
  13934. * @param [result] - The object onto which to store the result.
  13935. * @returns The modified result parameter, a new Rectangle instance if none was provided or undefined if there is no intersection.
  13936. */
  13937. static simpleIntersection(rectangle: Rectangle, otherRectangle: Rectangle, result?: Rectangle): Rectangle | undefined;
  13938. /**
  13939. * Computes a rectangle that is the union of two rectangles.
  13940. * @param rectangle - A rectangle to enclose in rectangle.
  13941. * @param otherRectangle - A rectangle to enclose in a rectangle.
  13942. * @param [result] - The object onto which to store the result.
  13943. * @returns The modified result parameter or a new Rectangle instance if none was provided.
  13944. */
  13945. static union(rectangle: Rectangle, otherRectangle: Rectangle, result?: Rectangle): Rectangle;
  13946. /**
  13947. * Computes a rectangle by enlarging the provided rectangle until it contains the provided cartographic.
  13948. * @param rectangle - A rectangle to expand.
  13949. * @param cartographic - A cartographic 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 one was not provided.
  13952. */
  13953. static expand(rectangle: Rectangle, cartographic: Cartographic, result?: Rectangle): Rectangle;
  13954. /**
  13955. * Returns true if the cartographic is on or inside the rectangle, false otherwise.
  13956. * @param rectangle - The rectangle
  13957. * @param cartographic - The cartographic to test.
  13958. * @returns true if the provided cartographic is inside the rectangle, false otherwise.
  13959. */
  13960. static contains(rectangle: Rectangle, cartographic: Cartographic): boolean;
  13961. /**
  13962. * Samples a rectangle so that it includes a list of Cartesian points suitable for passing to
  13963. * {@link BoundingSphere#fromPoints}. Sampling is necessary to account
  13964. * for rectangles that cover the poles or cross the equator.
  13965. * @param rectangle - The rectangle to subsample.
  13966. * @param [ellipsoid = Ellipsoid.WGS84] - The ellipsoid to use.
  13967. * @param [surfaceHeight = 0.0] - The height of the rectangle above the ellipsoid.
  13968. * @param [result] - The array of Cartesians onto which to store the result.
  13969. * @returns The modified result parameter or a new Array of Cartesians instances if none was provided.
  13970. */
  13971. static subsample(rectangle: Rectangle, ellipsoid?: Ellipsoid, surfaceHeight?: number, result?: Cartesian3[]): Cartesian3[];
  13972. /**
  13973. * Computes a subsection of a rectangle from normalized coordinates in the range [0.0, 1.0].
  13974. * @param rectangle - The rectangle to subsection.
  13975. * @param westLerp - The west interpolation factor in the range [0.0, 1.0]. Must be less than or equal to eastLerp.
  13976. * @param southLerp - The south interpolation factor in the range [0.0, 1.0]. Must be less than or equal to northLerp.
  13977. * @param eastLerp - The east interpolation factor in the range [0.0, 1.0]. Must be greater than or equal to westLerp.
  13978. * @param northLerp - The north interpolation factor in the range [0.0, 1.0]. Must be greater than or equal to southLerp.
  13979. * @param [result] - The object onto which to store the result.
  13980. * @returns The modified result parameter or a new Rectangle instance if none was provided.
  13981. */
  13982. static subsection(rectangle: Rectangle, westLerp: number, southLerp: number, eastLerp: number, northLerp: number, result?: Rectangle): Rectangle;
  13983. /**
  13984. * The largest possible rectangle.
  13985. */
  13986. static readonly MAX_VALUE: Rectangle;
  13987. }
  13988. /**
  13989. * 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}.
  13990. * @example
  13991. * // 1. create a rectangle
  13992. * const rectangle = new Cesium.RectangleGeometry({
  13993. * ellipsoid : Cesium.Ellipsoid.WGS84,
  13994. * rectangle : Cesium.Rectangle.fromDegrees(-80.0, 39.0, -74.0, 42.0),
  13995. * height : 10000.0
  13996. * });
  13997. * const geometry = Cesium.RectangleGeometry.createGeometry(rectangle);
  13998. *
  13999. * // 2. create an extruded rectangle without a top
  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. * extrudedHeight: 300000
  14005. * });
  14006. * const geometry = Cesium.RectangleGeometry.createGeometry(rectangle);
  14007. * @param options - Object with the following properties:
  14008. * @param options.rectangle - A cartographic rectangle with north, south, east and west properties in radians.
  14009. * @param [options.vertexFormat = VertexFormat.DEFAULT] - The vertex attributes to be computed.
  14010. * @param [options.ellipsoid = Ellipsoid.WGS84] - The ellipsoid on which the rectangle lies.
  14011. * @param [options.granularity = Math.RADIANS_PER_DEGREE] - The distance, in radians, between each latitude and longitude. Determines the number of positions in the buffer.
  14012. * @param [options.height = 0.0] - The distance in meters between the rectangle and the ellipsoid surface.
  14013. * @param [options.rotation = 0.0] - The rotation of the rectangle, in radians. A positive rotation is counter-clockwise.
  14014. * @param [options.stRotation = 0.0] - The rotation of the texture coordinates, in radians. A positive rotation is counter-clockwise.
  14015. * @param [options.extrudedHeight] - The distance in meters between the rectangle's extruded face and the ellipsoid surface.
  14016. */
  14017. export class RectangleGeometry {
  14018. constructor(options: {
  14019. rectangle: Rectangle;
  14020. vertexFormat?: VertexFormat;
  14021. ellipsoid?: Ellipsoid;
  14022. granularity?: number;
  14023. height?: number;
  14024. rotation?: number;
  14025. stRotation?: number;
  14026. extrudedHeight?: number;
  14027. });
  14028. /**
  14029. * The number of elements used to pack the object into an array.
  14030. */
  14031. static packedLength: number;
  14032. /**
  14033. * Stores the provided instance into the provided array.
  14034. * @param value - The value to pack.
  14035. * @param array - The array to pack into.
  14036. * @param [startingIndex = 0] - The index into the array at which to start packing the elements.
  14037. * @returns The array that was packed into
  14038. */
  14039. static pack(value: RectangleGeometry, array: number[], startingIndex?: number): number[];
  14040. /**
  14041. * Retrieves an instance from a packed array.
  14042. * @param array - The packed array.
  14043. * @param [startingIndex = 0] - The starting index of the element to be unpacked.
  14044. * @param [result] - The object into which to store the result.
  14045. * @returns The modified result parameter or a new RectangleGeometry instance if one was not provided.
  14046. */
  14047. static unpack(array: number[], startingIndex?: number, result?: RectangleGeometry): RectangleGeometry;
  14048. /**
  14049. * Computes the bounding rectangle based on the provided options
  14050. * @param options - Object with the following properties:
  14051. * @param options.rectangle - A cartographic rectangle with north, south, east and west properties in radians.
  14052. * @param [options.ellipsoid = Ellipsoid.WGS84] - The ellipsoid on which the rectangle lies.
  14053. * @param [options.granularity = Math.RADIANS_PER_DEGREE] - The distance, in radians, between each latitude and longitude. Determines the number of positions in the buffer.
  14054. * @param [options.rotation = 0.0] - The rotation of the rectangle, in radians. A positive rotation is counter-clockwise.
  14055. * @param [result] - An object in which to store the result.
  14056. * @returns The result rectangle
  14057. */
  14058. static computeRectangle(options: {
  14059. rectangle: Rectangle;
  14060. ellipsoid?: Ellipsoid;
  14061. granularity?: number;
  14062. rotation?: number;
  14063. }, result?: Rectangle): Rectangle;
  14064. /**
  14065. * Computes the geometric representation of a rectangle, including its vertices, indices, and a bounding sphere.
  14066. * @param rectangleGeometry - A description of the rectangle.
  14067. * @returns The computed vertices and indices.
  14068. */
  14069. static createGeometry(rectangleGeometry: RectangleGeometry): Geometry | undefined;
  14070. }
  14071. /**
  14072. * A description of the outline of a a cartographic rectangle on an ellipsoid centered at the origin.
  14073. * @example
  14074. * const rectangle = new Cesium.RectangleOutlineGeometry({
  14075. * ellipsoid : Cesium.Ellipsoid.WGS84,
  14076. * rectangle : Cesium.Rectangle.fromDegrees(-80.0, 39.0, -74.0, 42.0),
  14077. * height : 10000.0
  14078. * });
  14079. * const geometry = Cesium.RectangleOutlineGeometry.createGeometry(rectangle);
  14080. * @param options - Object with the following properties:
  14081. * @param options.rectangle - A cartographic rectangle with north, south, east and west properties in radians.
  14082. * @param [options.ellipsoid = Ellipsoid.WGS84] - The ellipsoid on which the rectangle lies.
  14083. * @param [options.granularity = Math.RADIANS_PER_DEGREE] - The distance, in radians, between each latitude and longitude. Determines the number of positions in the buffer.
  14084. * @param [options.height = 0.0] - The distance in meters between the rectangle and the ellipsoid surface.
  14085. * @param [options.rotation = 0.0] - The rotation of the rectangle, in radians. A positive rotation is counter-clockwise.
  14086. * @param [options.extrudedHeight] - The distance in meters between the rectangle's extruded face and the ellipsoid surface.
  14087. */
  14088. export class RectangleOutlineGeometry {
  14089. constructor(options: {
  14090. rectangle: Rectangle;
  14091. ellipsoid?: Ellipsoid;
  14092. granularity?: number;
  14093. height?: number;
  14094. rotation?: number;
  14095. extrudedHeight?: number;
  14096. });
  14097. /**
  14098. * The number of elements used to pack the object into an array.
  14099. */
  14100. static packedLength: number;
  14101. /**
  14102. * Stores the provided instance into the provided array.
  14103. * @param value - The value to pack.
  14104. * @param array - The array to pack into.
  14105. * @param [startingIndex = 0] - The index into the array at which to start packing the elements.
  14106. * @returns The array that was packed into
  14107. */
  14108. static pack(value: RectangleOutlineGeometry, array: number[], startingIndex?: number): number[];
  14109. /**
  14110. * Retrieves an instance from a packed array.
  14111. * @param array - The packed array.
  14112. * @param [startingIndex = 0] - The starting index of the element to be unpacked.
  14113. * @param [result] - The object into which to store the result.
  14114. * @returns The modified result parameter or a new Quaternion instance if one was not provided.
  14115. */
  14116. static unpack(array: number[], startingIndex?: number, result?: RectangleOutlineGeometry): RectangleOutlineGeometry;
  14117. /**
  14118. * Computes the geometric representation of an outline of a rectangle, including its vertices, indices, and a bounding sphere.
  14119. * @param rectangleGeometry - A description of the rectangle outline.
  14120. * @returns The computed vertices and indices.
  14121. */
  14122. static createGeometry(rectangleGeometry: RectangleOutlineGeometry): Geometry | undefined;
  14123. }
  14124. /**
  14125. * Constants for identifying well-known reference frames.
  14126. */
  14127. export enum ReferenceFrame {
  14128. /**
  14129. * The fixed frame.
  14130. */
  14131. FIXED = 0,
  14132. /**
  14133. * The inertial frame.
  14134. */
  14135. INERTIAL = 1
  14136. }
  14137. /**
  14138. * Stores information for making a request. In general this does not need to be constructed directly.
  14139. * @param [options] - An object with the following properties:
  14140. * @param [options.url] - The url to request.
  14141. * @param [options.requestFunction] - The function that makes the actual data request.
  14142. * @param [options.cancelFunction] - The function that is called when the request is cancelled.
  14143. * @param [options.priorityFunction] - The function that is called to update the request's priority, which occurs once per frame.
  14144. * @param [options.priority = 0.0] - The initial priority of the request.
  14145. * @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.
  14146. * @param [options.throttleByServer = false] - Whether to throttle the request by server.
  14147. * @param [options.type = RequestType.OTHER] - The type of request.
  14148. */
  14149. export class Request {
  14150. constructor(options?: {
  14151. url?: string;
  14152. requestFunction?: Request.RequestCallback;
  14153. cancelFunction?: Request.CancelCallback;
  14154. priorityFunction?: Request.PriorityCallback;
  14155. priority?: number;
  14156. throttle?: boolean;
  14157. throttleByServer?: boolean;
  14158. type?: RequestType;
  14159. });
  14160. /**
  14161. * The URL to request.
  14162. */
  14163. url: string;
  14164. /**
  14165. * The function that makes the actual data request.
  14166. */
  14167. requestFunction: Request.RequestCallback;
  14168. /**
  14169. * The function that is called when the request is cancelled.
  14170. */
  14171. cancelFunction: Request.CancelCallback;
  14172. /**
  14173. * The function that is called to update the request's priority, which occurs once per frame.
  14174. */
  14175. priorityFunction: Request.PriorityCallback;
  14176. /**
  14177. * Priority is a unit-less value where lower values represent higher priority.
  14178. * For world-based objects, this is usually the distance from the camera.
  14179. * A request that does not have a priority function defaults to a priority of 0.
  14180. *
  14181. * If priorityFunction is defined, this value is updated every frame with the result of that call.
  14182. */
  14183. priority: number;
  14184. /**
  14185. * Whether to throttle and prioritize the request. If false, the request will be sent immediately. If true, the
  14186. * request will be throttled and sent based on priority.
  14187. */
  14188. readonly throttle: boolean;
  14189. /**
  14190. * Whether to throttle the request by server. Browsers typically support about 6-8 parallel connections
  14191. * for HTTP/1 servers, and an unlimited amount of connections for HTTP/2 servers. Setting this value
  14192. * to <code>true</code> is preferable for requests going through HTTP/1 servers.
  14193. */
  14194. readonly throttleByServer: boolean;
  14195. /**
  14196. * Type of request.
  14197. */
  14198. readonly type: RequestType;
  14199. /**
  14200. * The current state of the request.
  14201. */
  14202. readonly state: RequestState;
  14203. /**
  14204. * Duplicates a Request instance.
  14205. * @param [result] - The object onto which to store the result.
  14206. * @returns The modified result parameter or a new Resource instance if one was not provided.
  14207. */
  14208. clone(result?: Request): Request;
  14209. }
  14210. export namespace Request {
  14211. /**
  14212. * The function that makes the actual data request.
  14213. */
  14214. type RequestCallback = () => Promise<void>;
  14215. /**
  14216. * The function that is called when the request is cancelled.
  14217. */
  14218. type CancelCallback = () => void;
  14219. /**
  14220. * The function that is called to update the request's priority, which occurs once per frame.
  14221. */
  14222. type PriorityCallback = () => number;
  14223. }
  14224. /**
  14225. * An event that is raised when a request encounters an error.
  14226. * @param [statusCode] - The HTTP error status code, such as 404.
  14227. * @param [response] - The response included along with the error.
  14228. * @param [responseHeaders] - The response headers, represented either as an object literal or as a
  14229. * string in the format returned by XMLHttpRequest's getAllResponseHeaders() function.
  14230. */
  14231. export class RequestErrorEvent {
  14232. constructor(statusCode?: number, response?: any, responseHeaders?: string | any);
  14233. /**
  14234. * The HTTP error status code, such as 404. If the error does not have a particular
  14235. * HTTP code, this property will be undefined.
  14236. */
  14237. statusCode: number;
  14238. /**
  14239. * The response included along with the error. If the error does not include a response,
  14240. * this property will be undefined.
  14241. */
  14242. response: any;
  14243. /**
  14244. * The headers included in the response, represented as an object literal of key/value pairs.
  14245. * If the error does not include any headers, this property will be undefined.
  14246. */
  14247. responseHeaders: any;
  14248. /**
  14249. * Creates a string representing this RequestErrorEvent.
  14250. * @returns A string representing the provided RequestErrorEvent.
  14251. */
  14252. toString(): string;
  14253. }
  14254. /**
  14255. * The request scheduler is used to track and constrain the number of active requests in order to prioritize incoming requests. The ability
  14256. * to retain control over the number of requests in CesiumJS is important because due to events such as changes in the camera position,
  14257. * a lot of new requests may be generated and a lot of in-flight requests may become redundant. The request scheduler manually constrains the
  14258. * 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.
  14259. */
  14260. export namespace RequestScheduler {
  14261. /**
  14262. * The maximum number of simultaneous active requests. Un-throttled requests do not observe this limit.
  14263. */
  14264. var maximumRequests: number;
  14265. /**
  14266. * The maximum number of simultaneous active requests per server. Un-throttled requests or servers specifically
  14267. * listed in {@link requestsByServer} do not observe this limit.
  14268. */
  14269. var maximumRequestsPerServer: number;
  14270. /**
  14271. * A per server key list of overrides to use for throttling instead of <code>maximumRequestsPerServer</code>
  14272. * @example
  14273. * RequestScheduler.requestsByServer = {
  14274. * 'api.cesium.com:443': 18,
  14275. * 'assets.cesium.com:443': 18
  14276. * };
  14277. */
  14278. var requestsByServer: any;
  14279. /**
  14280. * Specifies if the request scheduler should throttle incoming requests, or let the browser queue requests under its control.
  14281. */
  14282. var throttleRequests: boolean;
  14283. }
  14284. /**
  14285. * State of the request.
  14286. */
  14287. export enum RequestState {
  14288. /**
  14289. * Initial unissued state.
  14290. */
  14291. UNISSUED = 0,
  14292. /**
  14293. * Issued but not yet active. Will become active when open slots are available.
  14294. */
  14295. ISSUED = 1,
  14296. /**
  14297. * Actual http request has been sent.
  14298. */
  14299. ACTIVE = 2,
  14300. /**
  14301. * Request completed successfully.
  14302. */
  14303. RECEIVED = 3,
  14304. /**
  14305. * Request was cancelled, either explicitly or automatically because of low priority.
  14306. */
  14307. CANCELLED = 4,
  14308. /**
  14309. * Request failed.
  14310. */
  14311. FAILED = 5
  14312. }
  14313. /**
  14314. * An enum identifying the type of request. Used for finer grained logging and priority sorting.
  14315. */
  14316. export enum RequestType {
  14317. /**
  14318. * Terrain request.
  14319. */
  14320. TERRAIN = 0,
  14321. /**
  14322. * Imagery request.
  14323. */
  14324. IMAGERY = 1,
  14325. /**
  14326. * 3D Tiles request.
  14327. */
  14328. TILES3D = 2,
  14329. /**
  14330. * Other request.
  14331. */
  14332. OTHER = 3
  14333. }
  14334. export namespace Resource {
  14335. /**
  14336. * Initialization options for the Resource constructor
  14337. * @property url - The url of the resource.
  14338. * @property [queryParameters] - An object containing query parameters that will be sent when retrieving the resource.
  14339. * @property [templateValues] - Key/Value pairs that are used to replace template values (eg. {x}).
  14340. * @property [headers = {}] - Additional HTTP headers that will be sent.
  14341. * @property [proxy] - A proxy to be used when loading the resource.
  14342. * @property [retryCallback] - The Function to call when a request for this resource fails. If it returns true, the request will be retried.
  14343. * @property [retryAttempts = 0] - The number of times the retryCallback should be called before giving up.
  14344. * @property [request] - A Request object that will be used. Intended for internal use only.
  14345. */
  14346. type ConstructorOptions = {
  14347. url: string;
  14348. queryParameters?: any;
  14349. templateValues?: any;
  14350. headers?: any;
  14351. proxy?: Proxy;
  14352. retryCallback?: Resource.RetryCallback;
  14353. retryAttempts?: number;
  14354. request?: Request;
  14355. };
  14356. /**
  14357. * A function that returns the value of the property.
  14358. * @param [resource] - The resource that failed to load.
  14359. * @param [error] - The error that occurred during the loading of the resource.
  14360. */
  14361. type RetryCallback = (resource?: Resource, error?: Error) => boolean | Promise<boolean>;
  14362. }
  14363. /**
  14364. * 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.
  14365. * @example
  14366. * function refreshTokenRetryCallback(resource, error) {
  14367. * if (error.statusCode === 403) {
  14368. * // 403 status code means a new token should be generated
  14369. * return getNewAccessToken()
  14370. * .then(function(token) {
  14371. * resource.queryParameters.access_token = token;
  14372. * return true;
  14373. * })
  14374. * .catch(function() {
  14375. * return false;
  14376. * });
  14377. * }
  14378. *
  14379. * return false;
  14380. * }
  14381. *
  14382. * const resource = new Resource({
  14383. * url: 'http://server.com/path/to/resource.json',
  14384. * proxy: new DefaultProxy('/proxy/'),
  14385. * headers: {
  14386. * 'X-My-Header': 'valueOfHeader'
  14387. * },
  14388. * queryParameters: {
  14389. * 'access_token': '123-435-456-000'
  14390. * },
  14391. * retryCallback: refreshTokenRetryCallback,
  14392. * retryAttempts: 1
  14393. * });
  14394. * @param options - A url or an object describing initialization options
  14395. */
  14396. export class Resource {
  14397. constructor(options: string | Resource.ConstructorOptions);
  14398. /**
  14399. * Additional HTTP headers that will be sent with the request.
  14400. */
  14401. headers: any;
  14402. /**
  14403. * A Request object that will be used. Intended for internal use only.
  14404. */
  14405. request: Request;
  14406. /**
  14407. * A proxy to be used when loading the resource.
  14408. */
  14409. proxy: Proxy;
  14410. /**
  14411. * 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.
  14412. */
  14413. retryCallback: (...params: any[]) => any;
  14414. /**
  14415. * The number of times the retryCallback should be called before giving up.
  14416. */
  14417. retryAttempts: number;
  14418. /**
  14419. * Returns true if blobs are supported.
  14420. */
  14421. static readonly isBlobSupported: boolean;
  14422. /**
  14423. * Query parameters appended to the url.
  14424. */
  14425. readonly queryParameters: any;
  14426. /**
  14427. * The key/value pairs used to replace template parameters in the url.
  14428. */
  14429. readonly templateValues: any;
  14430. /**
  14431. * The url to the resource with template values replaced, query string appended and encoded by proxy if one was set.
  14432. */
  14433. url: string;
  14434. /**
  14435. * The file extension of the resource.
  14436. */
  14437. readonly extension: string;
  14438. /**
  14439. * True if the Resource refers to a data URI.
  14440. */
  14441. isDataUri: boolean;
  14442. /**
  14443. * True if the Resource refers to a blob URI.
  14444. */
  14445. isBlobUri: boolean;
  14446. /**
  14447. * True if the Resource refers to a cross origin URL.
  14448. */
  14449. isCrossOriginUrl: boolean;
  14450. /**
  14451. * True if the Resource has request headers. This is equivalent to checking if the headers property has any keys.
  14452. */
  14453. hasHeaders: boolean;
  14454. /**
  14455. * Override Object#toString so that implicit string conversion gives the
  14456. * complete URL represented by this Resource.
  14457. * @returns The URL represented by this Resource
  14458. */
  14459. toString(): string;
  14460. /**
  14461. * Returns the url, optional with the query string and processed by a proxy.
  14462. * @param [query = false] - If true, the query string is included.
  14463. * @param [proxy = false] - If true, the url is processed by the proxy object, if defined.
  14464. * @returns The url with all the requested components.
  14465. */
  14466. getUrlComponent(query?: boolean, proxy?: boolean): string;
  14467. /**
  14468. * Combines the specified object and the existing query parameters. This allows you to add many parameters at once,
  14469. * 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.
  14470. * @param params - The query parameters
  14471. * @param [useAsDefault = false] - If true the params will be used as the default values, so they will only be set if they are undefined.
  14472. */
  14473. setQueryParameters(params: any, useAsDefault?: boolean): void;
  14474. /**
  14475. * Combines the specified object and the existing query parameters. This allows you to add many parameters at once,
  14476. * as opposed to adding them one at a time to the queryParameters property.
  14477. * @param params - The query parameters
  14478. */
  14479. appendQueryParameters(params: any): void;
  14480. /**
  14481. * Combines the specified object and the existing template values. This allows you to add many values at once,
  14482. * 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.
  14483. * @param template - The template values
  14484. * @param [useAsDefault = false] - If true the values will be used as the default values, so they will only be set if they are undefined.
  14485. */
  14486. setTemplateValues(template: any, useAsDefault?: boolean): void;
  14487. /**
  14488. * Returns a resource relative to the current instance. All properties remain the same as the current instance unless overridden in options.
  14489. * @param options - An object with the following properties
  14490. * @param [options.url] - The url that will be resolved relative to the url of the current instance.
  14491. * @param [options.queryParameters] - An object containing query parameters that will be combined with those of the current instance.
  14492. * @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.
  14493. * @param [options.headers = {}] - Additional HTTP headers that will be sent.
  14494. * @param [options.proxy] - A proxy to be used when loading the resource.
  14495. * @param [options.retryCallback] - The function to call when loading the resource fails.
  14496. * @param [options.retryAttempts] - The number of times the retryCallback should be called before giving up.
  14497. * @param [options.request] - A Request object that will be used. Intended for internal use only.
  14498. * @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.
  14499. * @returns The resource derived from the current one.
  14500. */
  14501. getDerivedResource(options: {
  14502. url?: string;
  14503. queryParameters?: any;
  14504. templateValues?: any;
  14505. headers?: any;
  14506. proxy?: Proxy;
  14507. retryCallback?: Resource.RetryCallback;
  14508. retryAttempts?: number;
  14509. request?: Request;
  14510. preserveQueryParameters?: boolean;
  14511. }): Resource;
  14512. /**
  14513. * Duplicates a Resource instance.
  14514. * @param [result] - The object onto which to store the result.
  14515. * @returns The modified result parameter or a new Resource instance if one was not provided.
  14516. */
  14517. clone(result?: Resource): Resource;
  14518. /**
  14519. * Returns the base path of the Resource.
  14520. * @param [includeQuery = false] - Whether or not to include the query string and fragment form the uri
  14521. * @returns The base URI of the resource
  14522. */
  14523. getBaseUri(includeQuery?: boolean): string;
  14524. /**
  14525. * Appends a forward slash to the URL.
  14526. */
  14527. appendForwardSlash(): void;
  14528. /**
  14529. * Asynchronously loads the resource as raw binary data. Returns a promise that will resolve to
  14530. * an ArrayBuffer once loaded, or reject if the resource failed to load. The data is loaded
  14531. * using XMLHttpRequest, which means that in order to make requests to another origin,
  14532. * the server must have Cross-Origin Resource Sharing (CORS) headers enabled.
  14533. * @example
  14534. * // load a single URL asynchronously
  14535. * resource.fetchArrayBuffer().then(function(arrayBuffer) {
  14536. * // use the data
  14537. * }).catch(function(error) {
  14538. * // an error occurred
  14539. * });
  14540. * @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.
  14541. */
  14542. fetchArrayBuffer(): Promise<ArrayBuffer> | undefined;
  14543. /**
  14544. * Creates a Resource and calls fetchArrayBuffer() on it.
  14545. * @param options - A url or an object with the following properties
  14546. * @param options.url - The url of the resource.
  14547. * @param [options.queryParameters] - An object containing query parameters that will be sent when retrieving the resource.
  14548. * @param [options.templateValues] - Key/Value pairs that are used to replace template values (eg. {x}).
  14549. * @param [options.headers = {}] - Additional HTTP headers that will be sent.
  14550. * @param [options.proxy] - A proxy to be used when loading the resource.
  14551. * @param [options.retryCallback] - The Function to call when a request for this resource fails. If it returns true, the request will be retried.
  14552. * @param [options.retryAttempts = 0] - The number of times the retryCallback should be called before giving up.
  14553. * @param [options.request] - A Request object that will be used. Intended for internal use only.
  14554. * @returns a promise that will resolve to the requested data when loaded. Returns undefined if <code>request.throttle</code> is true and the request does not have high enough priority.
  14555. */
  14556. static fetchArrayBuffer(options: {
  14557. url: string;
  14558. queryParameters?: any;
  14559. templateValues?: any;
  14560. headers?: any;
  14561. proxy?: Proxy;
  14562. retryCallback?: Resource.RetryCallback;
  14563. retryAttempts?: number;
  14564. request?: Request;
  14565. }): Promise<ArrayBuffer> | undefined;
  14566. /**
  14567. * Asynchronously loads the given resource as a blob. Returns a promise that will resolve to
  14568. * a Blob once loaded, or reject if the resource failed to load. The data is loaded
  14569. * using XMLHttpRequest, which means that in order to make requests to another origin,
  14570. * the server must have Cross-Origin Resource Sharing (CORS) headers enabled.
  14571. * @example
  14572. * // load a single URL asynchronously
  14573. * resource.fetchBlob().then(function(blob) {
  14574. * // use the data
  14575. * }).catch(function(error) {
  14576. * // an error occurred
  14577. * });
  14578. * @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.
  14579. */
  14580. fetchBlob(): Promise<Blob> | undefined;
  14581. /**
  14582. * Creates a Resource and calls fetchBlob() on it.
  14583. * @param options - A url or an object with the following properties
  14584. * @param options.url - The url of the resource.
  14585. * @param [options.queryParameters] - An object containing query parameters that will be sent when retrieving the resource.
  14586. * @param [options.templateValues] - Key/Value pairs that are used to replace template values (eg. {x}).
  14587. * @param [options.headers = {}] - Additional HTTP headers that will be sent.
  14588. * @param [options.proxy] - A proxy to be used when loading the resource.
  14589. * @param [options.retryCallback] - The Function to call when a request for this resource fails. If it returns true, the request will be retried.
  14590. * @param [options.retryAttempts = 0] - The number of times the retryCallback should be called before giving up.
  14591. * @param [options.request] - A Request object that will be used. Intended for internal use only.
  14592. * @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.
  14593. */
  14594. static fetchBlob(options: {
  14595. url: string;
  14596. queryParameters?: any;
  14597. templateValues?: any;
  14598. headers?: any;
  14599. proxy?: Proxy;
  14600. retryCallback?: Resource.RetryCallback;
  14601. retryAttempts?: number;
  14602. request?: Request;
  14603. }): Promise<Blob> | undefined;
  14604. /**
  14605. * Asynchronously loads the given image resource. Returns a promise that will resolve to
  14606. * 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
  14607. * {@link https://developer.mozilla.org/en-US/docs/Web/API/HTMLImageElement|Image} once loaded, or reject if the image failed to load.
  14608. * @example
  14609. * // load a single image asynchronously
  14610. * resource.fetchImage().then(function(image) {
  14611. * // use the loaded image
  14612. * }).catch(function(error) {
  14613. * // an error occurred
  14614. * });
  14615. *
  14616. * // load several images in parallel
  14617. * Promise.all([resource1.fetchImage(), resource2.fetchImage()]).then(function(images) {
  14618. * // images is an array containing all the loaded images
  14619. * });
  14620. * @param [options] - An object with the following properties.
  14621. * @param [options.preferBlob = false] - If true, we will load the image via a blob.
  14622. * @param [options.preferImageBitmap = false] - If true, image will be decoded during fetch and an <code>ImageBitmap</code> is returned.
  14623. * @param [options.flipY = false] - If true, image will be vertically flipped during decode. Only applies if the browser supports <code>createImageBitmap</code>.
  14624. * @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>.
  14625. * @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.
  14626. */
  14627. fetchImage(options?: {
  14628. preferBlob?: boolean;
  14629. preferImageBitmap?: boolean;
  14630. flipY?: boolean;
  14631. skipColorSpaceConversion?: boolean;
  14632. }): Promise<ImageBitmap | HTMLImageElement> | undefined;
  14633. /**
  14634. * Creates a Resource and calls fetchImage() on it.
  14635. * @param options - A url or an object with the following properties
  14636. * @param options.url - The url of the resource.
  14637. * @param [options.queryParameters] - An object containing query parameters that will be sent when retrieving the resource.
  14638. * @param [options.templateValues] - Key/Value pairs that are used to replace template values (eg. {x}).
  14639. * @param [options.headers = {}] - Additional HTTP headers that will be sent.
  14640. * @param [options.proxy] - A proxy to be used when loading the resource.
  14641. * @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>.
  14642. * @param [options.retryCallback] - The Function to call when a request for this resource fails. If it returns true, the request will be retried.
  14643. * @param [options.retryAttempts = 0] - The number of times the retryCallback should be called before giving up.
  14644. * @param [options.request] - A Request object that will be used. Intended for internal use only.
  14645. * @param [options.preferBlob = false] - If true, we will load the image via a blob.
  14646. * @param [options.preferImageBitmap = false] - If true, image will be decoded during fetch and an <code>ImageBitmap</code> is returned.
  14647. * @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>.
  14648. * @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.
  14649. */
  14650. static fetchImage(options: {
  14651. url: string;
  14652. queryParameters?: any;
  14653. templateValues?: any;
  14654. headers?: any;
  14655. proxy?: Proxy;
  14656. flipY?: boolean;
  14657. retryCallback?: Resource.RetryCallback;
  14658. retryAttempts?: number;
  14659. request?: Request;
  14660. preferBlob?: boolean;
  14661. preferImageBitmap?: boolean;
  14662. skipColorSpaceConversion?: boolean;
  14663. }): Promise<ImageBitmap | HTMLImageElement> | undefined;
  14664. /**
  14665. * Asynchronously loads the given resource as text. Returns a promise that will resolve to
  14666. * a String once loaded, or reject if the resource failed to load. The data is loaded
  14667. * using XMLHttpRequest, which means that in order to make requests to another origin,
  14668. * the server must have Cross-Origin Resource Sharing (CORS) headers enabled.
  14669. * @example
  14670. * // load text from a URL, setting a custom header
  14671. * const resource = new Resource({
  14672. * url: 'http://someUrl.com/someJson.txt',
  14673. * headers: {
  14674. * 'X-Custom-Header' : 'some value'
  14675. * }
  14676. * });
  14677. * resource.fetchText().then(function(text) {
  14678. * // Do something with the text
  14679. * }).catch(function(error) {
  14680. * // an error occurred
  14681. * });
  14682. * @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.
  14683. */
  14684. fetchText(): Promise<string> | undefined;
  14685. /**
  14686. * Creates a Resource and calls fetchText() on it.
  14687. * @param options - A url or an object with the following properties
  14688. * @param options.url - The url of the resource.
  14689. * @param [options.queryParameters] - An object containing query parameters that will be sent when retrieving the resource.
  14690. * @param [options.templateValues] - Key/Value pairs that are used to replace template values (eg. {x}).
  14691. * @param [options.headers = {}] - Additional HTTP headers that will be sent.
  14692. * @param [options.proxy] - A proxy to be used when loading the resource.
  14693. * @param [options.retryCallback] - The Function to call when a request for this resource fails. If it returns true, the request will be retried.
  14694. * @param [options.retryAttempts = 0] - The number of times the retryCallback should be called before giving up.
  14695. * @param [options.request] - A Request object that will be used. Intended for internal use only.
  14696. * @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.
  14697. */
  14698. static fetchText(options: {
  14699. url: string;
  14700. queryParameters?: any;
  14701. templateValues?: any;
  14702. headers?: any;
  14703. proxy?: Proxy;
  14704. retryCallback?: Resource.RetryCallback;
  14705. retryAttempts?: number;
  14706. request?: Request;
  14707. }): Promise<string> | undefined;
  14708. /**
  14709. * Asynchronously loads the given resource as JSON. Returns a promise that will resolve to
  14710. * a JSON object once loaded, or reject if the resource failed to load. The data is loaded
  14711. * using XMLHttpRequest, which means that in order to make requests to another origin,
  14712. * the server must have Cross-Origin Resource Sharing (CORS) headers enabled. This function
  14713. * adds 'Accept: application/json,&#42;&#47;&#42;;q=0.01' to the request headers, if not
  14714. * already specified.
  14715. * @example
  14716. * resource.fetchJson().then(function(jsonData) {
  14717. * // Do something with the JSON object
  14718. * }).catch(function(error) {
  14719. * // an error occurred
  14720. * });
  14721. * @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.
  14722. */
  14723. fetchJson(): Promise<any> | undefined;
  14724. /**
  14725. * Creates a Resource and calls fetchJson() on it.
  14726. * @param options - A url or an object with the following properties
  14727. * @param options.url - The url of the resource.
  14728. * @param [options.queryParameters] - An object containing query parameters that will be sent when retrieving the resource.
  14729. * @param [options.templateValues] - Key/Value pairs that are used to replace template values (eg. {x}).
  14730. * @param [options.headers = {}] - Additional HTTP headers that will be sent.
  14731. * @param [options.proxy] - A proxy to be used when loading the resource.
  14732. * @param [options.retryCallback] - The Function to call when a request for this resource fails. If it returns true, the request will be retried.
  14733. * @param [options.retryAttempts = 0] - The number of times the retryCallback should be called before giving up.
  14734. * @param [options.request] - A Request object that will be used. Intended for internal use only.
  14735. * @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.
  14736. */
  14737. static fetchJson(options: {
  14738. url: string;
  14739. queryParameters?: any;
  14740. templateValues?: any;
  14741. headers?: any;
  14742. proxy?: Proxy;
  14743. retryCallback?: Resource.RetryCallback;
  14744. retryAttempts?: number;
  14745. request?: Request;
  14746. }): Promise<any> | undefined;
  14747. /**
  14748. * Asynchronously loads the given resource as XML. Returns a promise that will resolve to
  14749. * an XML Document once loaded, or reject if the resource failed to load. The data is loaded
  14750. * using XMLHttpRequest, which means that in order to make requests to another origin,
  14751. * the server must have Cross-Origin Resource Sharing (CORS) headers enabled.
  14752. * @example
  14753. * // load XML from a URL, setting a custom header
  14754. * Cesium.loadXML('http://someUrl.com/someXML.xml', {
  14755. * 'X-Custom-Header' : 'some value'
  14756. * }).then(function(document) {
  14757. * // Do something with the document
  14758. * }).catch(function(error) {
  14759. * // an error occurred
  14760. * });
  14761. * @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.
  14762. */
  14763. fetchXML(): Promise<XMLDocument> | undefined;
  14764. /**
  14765. * Creates a Resource and calls fetchXML() on it.
  14766. * @param options - A url or an object with the following properties
  14767. * @param options.url - The url of the resource.
  14768. * @param [options.queryParameters] - An object containing query parameters that will be sent when retrieving the resource.
  14769. * @param [options.templateValues] - Key/Value pairs that are used to replace template values (eg. {x}).
  14770. * @param [options.headers = {}] - Additional HTTP headers that will be sent.
  14771. * @param [options.proxy] - A proxy to be used when loading the resource.
  14772. * @param [options.retryCallback] - The Function to call when a request for this resource fails. If it returns true, the request will be retried.
  14773. * @param [options.retryAttempts = 0] - The number of times the retryCallback should be called before giving up.
  14774. * @param [options.request] - A Request object that will be used. Intended for internal use only.
  14775. * @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.
  14776. */
  14777. static fetchXML(options: {
  14778. url: string;
  14779. queryParameters?: any;
  14780. templateValues?: any;
  14781. headers?: any;
  14782. proxy?: Proxy;
  14783. retryCallback?: Resource.RetryCallback;
  14784. retryAttempts?: number;
  14785. request?: Request;
  14786. }): Promise<XMLDocument> | undefined;
  14787. /**
  14788. * Requests a resource using JSONP.
  14789. * @example
  14790. * // load a data asynchronously
  14791. * resource.fetchJsonp().then(function(data) {
  14792. * // use the loaded data
  14793. * }).catch(function(error) {
  14794. * // an error occurred
  14795. * });
  14796. * @param [callbackParameterName = 'callback'] - The callback parameter name that the server expects.
  14797. * @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.
  14798. */
  14799. fetchJsonp(callbackParameterName?: string): Promise<any> | undefined;
  14800. /**
  14801. * Creates a Resource from a URL and calls fetchJsonp() on it.
  14802. * @param options - A url or an object with the following properties
  14803. * @param options.url - The url of the resource.
  14804. * @param [options.queryParameters] - An object containing query parameters that will be sent when retrieving the resource.
  14805. * @param [options.templateValues] - Key/Value pairs that are used to replace template values (eg. {x}).
  14806. * @param [options.headers = {}] - Additional HTTP headers that will be sent.
  14807. * @param [options.proxy] - A proxy to be used when loading the resource.
  14808. * @param [options.retryCallback] - The Function to call when a request for this resource fails. If it returns true, the request will be retried.
  14809. * @param [options.retryAttempts = 0] - The number of times the retryCallback should be called before giving up.
  14810. * @param [options.request] - A Request object that will be used. Intended for internal use only.
  14811. * @param [options.callbackParameterName = 'callback'] - The callback parameter name that the server expects.
  14812. * @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.
  14813. */
  14814. static fetchJsonp(options: {
  14815. url: string;
  14816. queryParameters?: any;
  14817. templateValues?: any;
  14818. headers?: any;
  14819. proxy?: Proxy;
  14820. retryCallback?: Resource.RetryCallback;
  14821. retryAttempts?: number;
  14822. request?: Request;
  14823. callbackParameterName?: string;
  14824. }): Promise<any> | undefined;
  14825. /**
  14826. * Asynchronously loads the given resource. Returns a promise that will resolve to
  14827. * the result once loaded, or reject if the resource failed to load. The data is loaded
  14828. * using XMLHttpRequest, which means that in order to make requests to another origin,
  14829. * the server must have Cross-Origin Resource Sharing (CORS) headers enabled. It's recommended that you use
  14830. * the more specific functions eg. fetchJson, fetchBlob, etc.
  14831. * @example
  14832. * resource.fetch()
  14833. * .then(function(body) {
  14834. * // use the data
  14835. * }).catch(function(error) {
  14836. * // an error occurred
  14837. * });
  14838. * @param [options] - Object with the following properties:
  14839. * @param [options.responseType] - The type of response. This controls the type of item returned.
  14840. * @param [options.headers] - Additional HTTP headers to send with the request, if any.
  14841. * @param [options.overrideMimeType] - Overrides the MIME type returned by the server.
  14842. * @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.
  14843. */
  14844. fetch(options?: {
  14845. responseType?: string;
  14846. headers?: any;
  14847. overrideMimeType?: string;
  14848. }): Promise<any> | undefined;
  14849. /**
  14850. * Creates a Resource from a URL and calls fetch() on it.
  14851. * @param options - A url or an object with the following properties
  14852. * @param options.url - The url of the resource.
  14853. * @param [options.queryParameters] - An object containing query parameters that will be sent when retrieving the resource.
  14854. * @param [options.templateValues] - Key/Value pairs that are used to replace template values (eg. {x}).
  14855. * @param [options.headers = {}] - Additional HTTP headers that will be sent.
  14856. * @param [options.proxy] - A proxy to be used when loading the resource.
  14857. * @param [options.retryCallback] - The Function to call when a request for this resource fails. If it returns true, the request will be retried.
  14858. * @param [options.retryAttempts = 0] - The number of times the retryCallback should be called before giving up.
  14859. * @param [options.request] - A Request object that will be used. Intended for internal use only.
  14860. * @param [options.responseType] - The type of response. This controls the type of item returned.
  14861. * @param [options.overrideMimeType] - Overrides the MIME type returned by the server.
  14862. * @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.
  14863. */
  14864. static fetch(options: {
  14865. url: string;
  14866. queryParameters?: any;
  14867. templateValues?: any;
  14868. headers?: any;
  14869. proxy?: Proxy;
  14870. retryCallback?: Resource.RetryCallback;
  14871. retryAttempts?: number;
  14872. request?: Request;
  14873. responseType?: string;
  14874. overrideMimeType?: string;
  14875. }): Promise<any> | undefined;
  14876. /**
  14877. * Asynchronously deletes the given resource. Returns a promise that will resolve to
  14878. * the result once loaded, or reject if the resource failed to load. The data is loaded
  14879. * using XMLHttpRequest, which means that in order to make requests to another origin,
  14880. * the server must have Cross-Origin Resource Sharing (CORS) headers enabled.
  14881. * @example
  14882. * resource.delete()
  14883. * .then(function(body) {
  14884. * // use the data
  14885. * }).catch(function(error) {
  14886. * // an error occurred
  14887. * });
  14888. * @param [options] - Object with the following properties:
  14889. * @param [options.responseType] - The type of response. This controls the type of item returned.
  14890. * @param [options.headers] - Additional HTTP headers to send with the request, if any.
  14891. * @param [options.overrideMimeType] - Overrides the MIME type returned by the server.
  14892. * @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.
  14893. */
  14894. delete(options?: {
  14895. responseType?: string;
  14896. headers?: any;
  14897. overrideMimeType?: string;
  14898. }): Promise<any> | undefined;
  14899. /**
  14900. * Creates a Resource from a URL and calls delete() on it.
  14901. * @param options - A url or an object with the following properties
  14902. * @param options.url - The url of the resource.
  14903. * @param [options.data] - Data that is posted with the resource.
  14904. * @param [options.queryParameters] - An object containing query parameters that will be sent when retrieving the resource.
  14905. * @param [options.templateValues] - Key/Value pairs that are used to replace template values (eg. {x}).
  14906. * @param [options.headers = {}] - Additional HTTP headers that will be sent.
  14907. * @param [options.proxy] - A proxy to be used when loading the resource.
  14908. * @param [options.retryCallback] - The Function to call when a request for this resource fails. If it returns true, the request will be retried.
  14909. * @param [options.retryAttempts = 0] - The number of times the retryCallback should be called before giving up.
  14910. * @param [options.request] - A Request object that will be used. Intended for internal use only.
  14911. * @param [options.responseType] - The type of response. This controls the type of item returned.
  14912. * @param [options.overrideMimeType] - Overrides the MIME type returned by the server.
  14913. * @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.
  14914. */
  14915. static delete(options: {
  14916. url: string;
  14917. data?: any;
  14918. queryParameters?: any;
  14919. templateValues?: any;
  14920. headers?: any;
  14921. proxy?: Proxy;
  14922. retryCallback?: Resource.RetryCallback;
  14923. retryAttempts?: number;
  14924. request?: Request;
  14925. responseType?: string;
  14926. overrideMimeType?: string;
  14927. }): Promise<any> | undefined;
  14928. /**
  14929. * Asynchronously gets headers the given resource. Returns a promise that will resolve to
  14930. * the result once loaded, or reject if the resource failed to load. The data is loaded
  14931. * using XMLHttpRequest, which means that in order to make requests to another origin,
  14932. * the server must have Cross-Origin Resource Sharing (CORS) headers enabled.
  14933. * @example
  14934. * resource.head()
  14935. * .then(function(headers) {
  14936. * // use the data
  14937. * }).catch(function(error) {
  14938. * // an error occurred
  14939. * });
  14940. * @param [options] - Object with the following properties:
  14941. * @param [options.responseType] - The type of response. This controls the type of item returned.
  14942. * @param [options.headers] - Additional HTTP headers to send with the request, if any.
  14943. * @param [options.overrideMimeType] - Overrides the MIME type returned by the server.
  14944. * @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.
  14945. */
  14946. head(options?: {
  14947. responseType?: string;
  14948. headers?: any;
  14949. overrideMimeType?: string;
  14950. }): Promise<any> | undefined;
  14951. /**
  14952. * Creates a Resource from a URL and calls head() on it.
  14953. * @param options - A url or an object with the following properties
  14954. * @param options.url - The url of the resource.
  14955. * @param [options.queryParameters] - An object containing query parameters that will be sent when retrieving the resource.
  14956. * @param [options.templateValues] - Key/Value pairs that are used to replace template values (eg. {x}).
  14957. * @param [options.headers = {}] - Additional HTTP headers that will be sent.
  14958. * @param [options.proxy] - A proxy to be used when loading the resource.
  14959. * @param [options.retryCallback] - The Function to call when a request for this resource fails. If it returns true, the request will be retried.
  14960. * @param [options.retryAttempts = 0] - The number of times the retryCallback should be called before giving up.
  14961. * @param [options.request] - A Request object that will be used. Intended for internal use only.
  14962. * @param [options.responseType] - The type of response. This controls the type of item returned.
  14963. * @param [options.overrideMimeType] - Overrides the MIME type returned by the server.
  14964. * @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.
  14965. */
  14966. static head(options: {
  14967. url: string;
  14968. queryParameters?: any;
  14969. templateValues?: any;
  14970. headers?: any;
  14971. proxy?: Proxy;
  14972. retryCallback?: Resource.RetryCallback;
  14973. retryAttempts?: number;
  14974. request?: Request;
  14975. responseType?: string;
  14976. overrideMimeType?: string;
  14977. }): Promise<any> | undefined;
  14978. /**
  14979. * Asynchronously gets options the given resource. Returns a promise that will resolve to
  14980. * the result once loaded, or reject if the resource failed to load. The data is loaded
  14981. * using XMLHttpRequest, which means that in order to make requests to another origin,
  14982. * the server must have Cross-Origin Resource Sharing (CORS) headers enabled.
  14983. * @example
  14984. * resource.options()
  14985. * .then(function(headers) {
  14986. * // use the data
  14987. * }).catch(function(error) {
  14988. * // an error occurred
  14989. * });
  14990. * @param [options] - Object with the following properties:
  14991. * @param [options.responseType] - The type of response. This controls the type of item returned.
  14992. * @param [options.headers] - Additional HTTP headers to send with the request, if any.
  14993. * @param [options.overrideMimeType] - Overrides the MIME type returned by the server.
  14994. * @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.
  14995. */
  14996. options(options?: {
  14997. responseType?: string;
  14998. headers?: any;
  14999. overrideMimeType?: string;
  15000. }): Promise<any> | undefined;
  15001. /**
  15002. * Creates a Resource from a URL and calls options() on it.
  15003. * @param options - A url or an object with the following properties
  15004. * @param options.url - The url of the resource.
  15005. * @param [options.queryParameters] - An object containing query parameters that will be sent when retrieving the resource.
  15006. * @param [options.templateValues] - Key/Value pairs that are used to replace template values (eg. {x}).
  15007. * @param [options.headers = {}] - Additional HTTP headers that will be sent.
  15008. * @param [options.proxy] - A proxy to be used when loading the resource.
  15009. * @param [options.retryCallback] - The Function to call when a request for this resource fails. If it returns true, the request will be retried.
  15010. * @param [options.retryAttempts = 0] - The number of times the retryCallback should be called before giving up.
  15011. * @param [options.request] - A Request object that will be used. Intended for internal use only.
  15012. * @param [options.responseType] - The type of response. This controls the type of item returned.
  15013. * @param [options.overrideMimeType] - Overrides the MIME type returned by the server.
  15014. * @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.
  15015. */
  15016. static options(options: {
  15017. url: string;
  15018. queryParameters?: any;
  15019. templateValues?: any;
  15020. headers?: any;
  15021. proxy?: Proxy;
  15022. retryCallback?: Resource.RetryCallback;
  15023. retryAttempts?: number;
  15024. request?: Request;
  15025. responseType?: string;
  15026. overrideMimeType?: string;
  15027. }): Promise<any> | undefined;
  15028. /**
  15029. * Asynchronously posts data to the given resource. Returns a promise that will resolve to
  15030. * the result once loaded, or reject if the resource failed to load. The data is loaded
  15031. * using XMLHttpRequest, which means that in order to make requests to another origin,
  15032. * the server must have Cross-Origin Resource Sharing (CORS) headers enabled.
  15033. * @example
  15034. * resource.post(data)
  15035. * .then(function(result) {
  15036. * // use the result
  15037. * }).catch(function(error) {
  15038. * // an error occurred
  15039. * });
  15040. * @param data - Data that is posted with the resource.
  15041. * @param [options] - Object with the following properties:
  15042. * @param [options.data] - Data that is posted with the resource.
  15043. * @param [options.responseType] - The type of response. This controls the type of item returned.
  15044. * @param [options.headers] - Additional HTTP headers to send with the request, if any.
  15045. * @param [options.overrideMimeType] - Overrides the MIME type returned by the server.
  15046. * @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.
  15047. */
  15048. post(data: any, options?: {
  15049. data?: any;
  15050. responseType?: string;
  15051. headers?: any;
  15052. overrideMimeType?: string;
  15053. }): Promise<any> | undefined;
  15054. /**
  15055. * Creates a Resource from a URL and calls post() on it.
  15056. * @param options - A url or an object with the following properties
  15057. * @param options.url - The url of the resource.
  15058. * @param options.data - Data that is posted with the resource.
  15059. * @param [options.queryParameters] - An object containing query parameters that will be sent when retrieving the resource.
  15060. * @param [options.templateValues] - Key/Value pairs that are used to replace template values (eg. {x}).
  15061. * @param [options.headers = {}] - Additional HTTP headers that will be sent.
  15062. * @param [options.proxy] - A proxy to be used when loading the resource.
  15063. * @param [options.retryCallback] - The Function to call when a request for this resource fails. If it returns true, the request will be retried.
  15064. * @param [options.retryAttempts = 0] - The number of times the retryCallback should be called before giving up.
  15065. * @param [options.request] - A Request object that will be used. Intended for internal use only.
  15066. * @param [options.responseType] - The type of response. This controls the type of item returned.
  15067. * @param [options.overrideMimeType] - Overrides the MIME type returned by the server.
  15068. * @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.
  15069. */
  15070. static post(options: {
  15071. url: string;
  15072. data: any;
  15073. queryParameters?: any;
  15074. templateValues?: any;
  15075. headers?: any;
  15076. proxy?: Proxy;
  15077. retryCallback?: Resource.RetryCallback;
  15078. retryAttempts?: number;
  15079. request?: Request;
  15080. responseType?: string;
  15081. overrideMimeType?: string;
  15082. }): Promise<any> | undefined;
  15083. /**
  15084. * Asynchronously puts data to the given resource. Returns a promise that will resolve to
  15085. * the result once loaded, or reject if the resource failed to load. The data is loaded
  15086. * using XMLHttpRequest, which means that in order to make requests to another origin,
  15087. * the server must have Cross-Origin Resource Sharing (CORS) headers enabled.
  15088. * @example
  15089. * resource.put(data)
  15090. * .then(function(result) {
  15091. * // use the result
  15092. * }).catch(function(error) {
  15093. * // an error occurred
  15094. * });
  15095. * @param data - Data that is posted with the resource.
  15096. * @param [options] - Object with the following properties:
  15097. * @param [options.responseType] - The type of response. This controls the type of item returned.
  15098. * @param [options.headers] - Additional HTTP headers to send with the request, if any.
  15099. * @param [options.overrideMimeType] - Overrides the MIME type returned by the server.
  15100. * @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.
  15101. */
  15102. put(data: any, options?: {
  15103. responseType?: string;
  15104. headers?: any;
  15105. overrideMimeType?: string;
  15106. }): Promise<any> | undefined;
  15107. /**
  15108. * Creates a Resource from a URL and calls put() on it.
  15109. * @param options - A url or an object with the following properties
  15110. * @param options.url - The url of the resource.
  15111. * @param options.data - Data that is posted with the resource.
  15112. * @param [options.queryParameters] - An object containing query parameters that will be sent when retrieving the resource.
  15113. * @param [options.templateValues] - Key/Value pairs that are used to replace template values (eg. {x}).
  15114. * @param [options.headers = {}] - Additional HTTP headers that will be sent.
  15115. * @param [options.proxy] - A proxy to be used when loading the resource.
  15116. * @param [options.retryCallback] - The Function to call when a request for this resource fails. If it returns true, the request will be retried.
  15117. * @param [options.retryAttempts = 0] - The number of times the retryCallback should be called before giving up.
  15118. * @param [options.request] - A Request object that will be used. Intended for internal use only.
  15119. * @param [options.responseType] - The type of response. This controls the type of item returned.
  15120. * @param [options.overrideMimeType] - Overrides the MIME type returned by the server.
  15121. * @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.
  15122. */
  15123. static put(options: {
  15124. url: string;
  15125. data: any;
  15126. queryParameters?: any;
  15127. templateValues?: any;
  15128. headers?: any;
  15129. proxy?: Proxy;
  15130. retryCallback?: Resource.RetryCallback;
  15131. retryAttempts?: number;
  15132. request?: Request;
  15133. responseType?: string;
  15134. overrideMimeType?: string;
  15135. }): Promise<any> | undefined;
  15136. /**
  15137. * Asynchronously patches data to the given resource. Returns a promise that will resolve to
  15138. * the result once loaded, or reject if the resource failed to load. The data is loaded
  15139. * using XMLHttpRequest, which means that in order to make requests to another origin,
  15140. * the server must have Cross-Origin Resource Sharing (CORS) headers enabled.
  15141. * @example
  15142. * resource.patch(data)
  15143. * .then(function(result) {
  15144. * // use the result
  15145. * }).catch(function(error) {
  15146. * // an error occurred
  15147. * });
  15148. * @param data - Data that is posted with the resource.
  15149. * @param [options] - Object with the following properties:
  15150. * @param [options.responseType] - The type of response. This controls the type of item returned.
  15151. * @param [options.headers] - Additional HTTP headers to send with the request, if any.
  15152. * @param [options.overrideMimeType] - Overrides the MIME type returned by the server.
  15153. * @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.
  15154. */
  15155. patch(data: any, options?: {
  15156. responseType?: string;
  15157. headers?: any;
  15158. overrideMimeType?: string;
  15159. }): Promise<any> | undefined;
  15160. /**
  15161. * Creates a Resource from a URL and calls patch() on it.
  15162. * @param options - A url or an object with the following properties
  15163. * @param options.url - The url of the resource.
  15164. * @param options.data - Data that is posted with the resource.
  15165. * @param [options.queryParameters] - An object containing query parameters that will be sent when retrieving the resource.
  15166. * @param [options.templateValues] - Key/Value pairs that are used to replace template values (eg. {x}).
  15167. * @param [options.headers = {}] - Additional HTTP headers that will be sent.
  15168. * @param [options.proxy] - A proxy to be used when loading the resource.
  15169. * @param [options.retryCallback] - The Function to call when a request for this resource fails. If it returns true, the request will be retried.
  15170. * @param [options.retryAttempts = 0] - The number of times the retryCallback should be called before giving up.
  15171. * @param [options.request] - A Request object that will be used. Intended for internal use only.
  15172. * @param [options.responseType] - The type of response. This controls the type of item returned.
  15173. * @param [options.overrideMimeType] - Overrides the MIME type returned by the server.
  15174. * @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.
  15175. */
  15176. static patch(options: {
  15177. url: string;
  15178. data: any;
  15179. queryParameters?: any;
  15180. templateValues?: any;
  15181. headers?: any;
  15182. proxy?: Proxy;
  15183. retryCallback?: Resource.RetryCallback;
  15184. retryAttempts?: number;
  15185. request?: Request;
  15186. responseType?: string;
  15187. overrideMimeType?: string;
  15188. }): Promise<any> | undefined;
  15189. /**
  15190. * A resource instance initialized to the current browser location
  15191. */
  15192. static readonly DEFAULT: Resource;
  15193. }
  15194. /**
  15195. * Constructs an exception object that is thrown due to an error that can occur at runtime, e.g.,
  15196. * out of memory, could not compile shader, etc. If a function may throw this
  15197. * exception, the calling code should be prepared to catch it.
  15198. * <br /><br />
  15199. * On the other hand, a {@link DeveloperError} indicates an exception due
  15200. * to a developer error, e.g., invalid argument, that usually indicates a bug in the
  15201. * calling code.
  15202. * @param [message] - The error message for this exception.
  15203. */
  15204. export class RuntimeError extends Error {
  15205. constructor(message?: string);
  15206. /**
  15207. * 'RuntimeError' indicating that this exception was thrown due to a runtime error.
  15208. */
  15209. readonly name: string;
  15210. /**
  15211. * The explanation for why this exception was thrown.
  15212. */
  15213. readonly message: string;
  15214. /**
  15215. * The stack trace of this exception, if available.
  15216. */
  15217. readonly stack: string;
  15218. }
  15219. export namespace ScreenSpaceEventHandler {
  15220. /**
  15221. * An Event that occurs at a single position on screen.
  15222. */
  15223. type PositionedEvent = {
  15224. position: Cartesian2;
  15225. };
  15226. /**
  15227. * @param event - The event which triggered the listener
  15228. */
  15229. type PositionedEventCallback = (event: ScreenSpaceEventHandler.PositionedEvent) => void;
  15230. /**
  15231. * An Event that starts at one position and ends at another.
  15232. */
  15233. type MotionEvent = {
  15234. startPosition: Cartesian2;
  15235. endPosition: Cartesian2;
  15236. };
  15237. /**
  15238. * @param event - The event which triggered the listener
  15239. */
  15240. type MotionEventCallback = (event: ScreenSpaceEventHandler.MotionEvent) => void;
  15241. /**
  15242. * An Event that occurs at a two positions on screen.
  15243. */
  15244. type TwoPointEvent = {
  15245. position1: Cartesian2;
  15246. position2: Cartesian2;
  15247. };
  15248. /**
  15249. * @param event - The event which triggered the listener
  15250. */
  15251. type TwoPointEventCallback = (event: ScreenSpaceEventHandler.TwoPointEvent) => void;
  15252. /**
  15253. * An Event that starts at a two positions on screen and moves to two other positions.
  15254. */
  15255. type TwoPointMotionEvent = {
  15256. position1: Cartesian2;
  15257. position2: Cartesian2;
  15258. previousPosition1: Cartesian2;
  15259. previousPosition2: Cartesian2;
  15260. };
  15261. /**
  15262. * @param event - The event which triggered the listener
  15263. */
  15264. type TwoPointMotionEventCallback = (event: ScreenSpaceEventHandler.TwoPointMotionEvent) => void;
  15265. /**
  15266. * @param delta - The amount that the mouse wheel moved
  15267. */
  15268. type WheelEventCallback = (delta: number) => void;
  15269. }
  15270. /**
  15271. * Handles user input events. Custom functions can be added to be executed on
  15272. * when the user enters input.
  15273. * @param [element = document] - The element to add events to.
  15274. */
  15275. export class ScreenSpaceEventHandler {
  15276. constructor(element?: HTMLCanvasElement);
  15277. /**
  15278. * Set a function to be executed on an input event.
  15279. * @param action - Function to be executed when the input event occurs.
  15280. * @param type - The ScreenSpaceEventType of input event.
  15281. * @param [modifier] - A KeyboardEventModifier key that is held when a <code>type</code>
  15282. * event occurs.
  15283. */
  15284. setInputAction(action: ScreenSpaceEventHandler.PositionedEventCallback | ScreenSpaceEventHandler.MotionEventCallback | ScreenSpaceEventHandler.WheelEventCallback | ScreenSpaceEventHandler.TwoPointEventCallback | ScreenSpaceEventHandler.TwoPointMotionEventCallback, type: ScreenSpaceEventType, modifier?: KeyboardEventModifier): void;
  15285. /**
  15286. * Returns the function to be executed on an input event.
  15287. * @param type - The ScreenSpaceEventType of input event.
  15288. * @param [modifier] - A KeyboardEventModifier key that is held when a <code>type</code>
  15289. * event occurs.
  15290. * @returns The function to be executed on an input event.
  15291. */
  15292. getInputAction(type: ScreenSpaceEventType, modifier?: KeyboardEventModifier): ScreenSpaceEventHandler.PositionedEventCallback | ScreenSpaceEventHandler.MotionEventCallback | ScreenSpaceEventHandler.WheelEventCallback | ScreenSpaceEventHandler.TwoPointEventCallback | ScreenSpaceEventHandler.TwoPointMotionEventCallback;
  15293. /**
  15294. * Removes 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. */
  15299. removeInputAction(type: ScreenSpaceEventType, modifier?: KeyboardEventModifier): void;
  15300. /**
  15301. * Returns true if this object was destroyed; otherwise, false.
  15302. * <br /><br />
  15303. * If this object was destroyed, it should not be used; calling any function other than
  15304. * <code>isDestroyed</code> will result in a {@link DeveloperError} exception.
  15305. * @returns <code>true</code> if this object was destroyed; otherwise, <code>false</code>.
  15306. */
  15307. isDestroyed(): boolean;
  15308. /**
  15309. * Removes listeners held by this object.
  15310. * <br /><br />
  15311. * Once an object is destroyed, it should not be used; calling any function other than
  15312. * <code>isDestroyed</code> will result in a {@link DeveloperError} exception. Therefore,
  15313. * assign the return value (<code>undefined</code>) to the object as done in the example.
  15314. * @example
  15315. * handler = handler && handler.destroy();
  15316. */
  15317. destroy(): void;
  15318. /**
  15319. * The amount of time, in milliseconds, that mouse events will be disabled after
  15320. * receiving any touch events, such that any emulated mouse events will be ignored.
  15321. */
  15322. static mouseEmulationIgnoreMilliseconds: number;
  15323. /**
  15324. * The amount of time, in milliseconds, before a touch on the screen becomes a
  15325. * touch and hold.
  15326. */
  15327. static touchHoldDelayMilliseconds: number;
  15328. }
  15329. /**
  15330. * This enumerated type is for classifying mouse events: down, up, click, double click, move and move while a button is held down.
  15331. */
  15332. export enum ScreenSpaceEventType {
  15333. /**
  15334. * Represents a mouse left button down event.
  15335. */
  15336. LEFT_DOWN = 0,
  15337. /**
  15338. * Represents a mouse left button up event.
  15339. */
  15340. LEFT_UP = 1,
  15341. /**
  15342. * Represents a mouse left click event.
  15343. */
  15344. LEFT_CLICK = 2,
  15345. /**
  15346. * Represents a mouse left double click event.
  15347. */
  15348. LEFT_DOUBLE_CLICK = 3,
  15349. /**
  15350. * Represents a mouse left button down event.
  15351. */
  15352. RIGHT_DOWN = 5,
  15353. /**
  15354. * Represents a mouse right button up event.
  15355. */
  15356. RIGHT_UP = 6,
  15357. /**
  15358. * Represents a mouse right click event.
  15359. */
  15360. RIGHT_CLICK = 7,
  15361. /**
  15362. * Represents a mouse middle button down event.
  15363. */
  15364. MIDDLE_DOWN = 10,
  15365. /**
  15366. * Represents a mouse middle button up event.
  15367. */
  15368. MIDDLE_UP = 11,
  15369. /**
  15370. * Represents a mouse middle click event.
  15371. */
  15372. MIDDLE_CLICK = 12,
  15373. /**
  15374. * Represents a mouse move event.
  15375. */
  15376. MOUSE_MOVE = 15,
  15377. /**
  15378. * Represents a mouse wheel event.
  15379. */
  15380. WHEEL = 16,
  15381. /**
  15382. * Represents the start of a two-finger event on a touch surface.
  15383. */
  15384. PINCH_START = 17,
  15385. /**
  15386. * Represents the end of a two-finger event on a touch surface.
  15387. */
  15388. PINCH_END = 18,
  15389. /**
  15390. * Represents a change of a two-finger event on a touch surface.
  15391. */
  15392. PINCH_MOVE = 19
  15393. }
  15394. /**
  15395. * Value and type information for per-instance geometry attribute that determines if the geometry instance will be shown.
  15396. * @example
  15397. * const instance = new Cesium.GeometryInstance({
  15398. * geometry : new Cesium.BoxGeometry({
  15399. * vertexFormat : Cesium.VertexFormat.POSITION_AND_NORMAL,
  15400. * minimum : new Cesium.Cartesian3(-250000.0, -250000.0, -250000.0),
  15401. * maximum : new Cesium.Cartesian3(250000.0, 250000.0, 250000.0)
  15402. * }),
  15403. * modelMatrix : Cesium.Matrix4.multiplyByTranslation(Cesium.Transforms.eastNorthUpToFixedFrame(
  15404. * Cesium.Cartesian3.fromDegrees(-75.59777, 40.03883)), new Cesium.Cartesian3(0.0, 0.0, 1000000.0), new Cesium.Matrix4()),
  15405. * id : 'box',
  15406. * attributes : {
  15407. * show : new Cesium.ShowGeometryInstanceAttribute(false)
  15408. * }
  15409. * });
  15410. * @param [show = true] - Determines if the geometry instance will be shown.
  15411. */
  15412. export class ShowGeometryInstanceAttribute {
  15413. constructor(show?: boolean);
  15414. /**
  15415. * The values for the attributes stored in a typed array.
  15416. */
  15417. value: Uint8Array;
  15418. /**
  15419. * The datatype of each component in the attribute, e.g., individual elements in
  15420. * {@link ColorGeometryInstanceAttribute#value}.
  15421. */
  15422. readonly componentDatatype: ComponentDatatype;
  15423. /**
  15424. * The number of components in the attributes, i.e., {@link ColorGeometryInstanceAttribute#value}.
  15425. */
  15426. readonly componentsPerAttribute: number;
  15427. /**
  15428. * When <code>true</code> and <code>componentDatatype</code> is an integer format,
  15429. * indicate that the components should be mapped to the range [0, 1] (unsigned)
  15430. * or [-1, 1] (signed) when they are accessed as floating-point for rendering.
  15431. */
  15432. readonly normalize: boolean;
  15433. /**
  15434. * Converts a boolean show to a typed array that can be used to assign a show attribute.
  15435. * @example
  15436. * const attributes = primitive.getGeometryInstanceAttributes('an id');
  15437. * attributes.show = Cesium.ShowGeometryInstanceAttribute.toValue(true, attributes.show);
  15438. * @param show - The show value.
  15439. * @param [result] - The array to store the result in, if undefined a new instance will be created.
  15440. * @returns The modified result parameter or a new instance if result was undefined.
  15441. */
  15442. static toValue(show: boolean, result?: Uint8Array): Uint8Array;
  15443. }
  15444. /**
  15445. * Contains functions for finding the Cartesian coordinates of the sun and the moon in the
  15446. * Earth-centered inertial frame.
  15447. */
  15448. export namespace Simon1994PlanetaryPositions {
  15449. /**
  15450. * Computes the position of the Sun in the Earth-centered inertial frame
  15451. * @param [julianDate] - The time at which to compute the Sun's position, if not provided the current system time is used.
  15452. * @param [result] - The object onto which to store the result.
  15453. * @returns Calculated sun position
  15454. */
  15455. function computeSunPositionInEarthInertialFrame(julianDate?: JulianDate, result?: Cartesian3): Cartesian3;
  15456. /**
  15457. * Computes the position of the Moon in the Earth-centered inertial frame
  15458. * @param [julianDate] - The time at which to compute the Sun's position, if not provided the current system time is used.
  15459. * @param [result] - The object onto which to store the result.
  15460. * @returns Calculated moon position
  15461. */
  15462. function computeMoonPositionInEarthInertialFrame(julianDate?: JulianDate, result?: Cartesian3): Cartesian3;
  15463. }
  15464. /**
  15465. * A description of a polyline modeled as a line strip; the first two positions define a line segment,
  15466. * and each additional position defines a line segment from the previous position.
  15467. * @example
  15468. * // A polyline with two connected line segments
  15469. * const polyline = new Cesium.SimplePolylineGeometry({
  15470. * positions : Cesium.Cartesian3.fromDegreesArray([
  15471. * 0.0, 0.0,
  15472. * 5.0, 0.0,
  15473. * 5.0, 5.0
  15474. * ])
  15475. * });
  15476. * const geometry = Cesium.SimplePolylineGeometry.createGeometry(polyline);
  15477. * @param options - Object with the following properties:
  15478. * @param options.positions - An array of {@link Cartesian3} defining the positions in the polyline as a line strip.
  15479. * @param [options.colors] - An Array of {@link Color} defining the per vertex or per segment colors.
  15480. * @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.
  15481. * @param [options.arcType = ArcType.GEODESIC] - The type of line the polyline segments must follow.
  15482. * @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.
  15483. * @param [options.ellipsoid = Ellipsoid.WGS84] - The ellipsoid to be used as a reference.
  15484. */
  15485. export class SimplePolylineGeometry {
  15486. constructor(options: {
  15487. positions: Cartesian3[];
  15488. colors?: Color[];
  15489. colorsPerVertex?: boolean;
  15490. arcType?: ArcType;
  15491. granularity?: number;
  15492. ellipsoid?: Ellipsoid;
  15493. });
  15494. /**
  15495. * The number of elements used to pack the object into an array.
  15496. */
  15497. packedLength: number;
  15498. /**
  15499. * Stores the provided instance into the provided array.
  15500. * @param value - The value to pack.
  15501. * @param array - The array to pack into.
  15502. * @param [startingIndex = 0] - The index into the array at which to start packing the elements.
  15503. * @returns The array that was packed into
  15504. */
  15505. static pack(value: SimplePolylineGeometry, array: number[], startingIndex?: number): number[];
  15506. /**
  15507. * Retrieves an instance from a packed array.
  15508. * @param array - The packed array.
  15509. * @param [startingIndex = 0] - The starting index of the element to be unpacked.
  15510. * @param [result] - The object into which to store the result.
  15511. * @returns The modified result parameter or a new SimplePolylineGeometry instance if one was not provided.
  15512. */
  15513. static unpack(array: number[], startingIndex?: number, result?: SimplePolylineGeometry): SimplePolylineGeometry;
  15514. /**
  15515. * Computes the geometric representation of a simple polyline, including its vertices, indices, and a bounding sphere.
  15516. * @param simplePolylineGeometry - A description of the polyline.
  15517. * @returns The computed vertices and indices.
  15518. */
  15519. static createGeometry(simplePolylineGeometry: SimplePolylineGeometry): Geometry | undefined;
  15520. }
  15521. /**
  15522. * A description of a sphere centered at the origin.
  15523. * @example
  15524. * const sphere = new Cesium.SphereGeometry({
  15525. * radius : 100.0,
  15526. * vertexFormat : Cesium.VertexFormat.POSITION_ONLY
  15527. * });
  15528. * const geometry = Cesium.SphereGeometry.createGeometry(sphere);
  15529. * @param [options] - Object with the following properties:
  15530. * @param [options.radius = 1.0] - The radius of the sphere.
  15531. * @param [options.stackPartitions = 64] - The number of times to partition the ellipsoid into stacks.
  15532. * @param [options.slicePartitions = 64] - The number of times to partition the ellipsoid into radial slices.
  15533. * @param [options.vertexFormat = VertexFormat.DEFAULT] - The vertex attributes to be computed.
  15534. */
  15535. export class SphereGeometry {
  15536. constructor(options?: {
  15537. radius?: number;
  15538. stackPartitions?: number;
  15539. slicePartitions?: number;
  15540. vertexFormat?: VertexFormat;
  15541. });
  15542. /**
  15543. * The number of elements used to pack the object into an array.
  15544. */
  15545. static packedLength: number;
  15546. /**
  15547. * Stores the provided instance into the provided array.
  15548. * @param value - The value to pack.
  15549. * @param array - The array to pack into.
  15550. * @param [startingIndex = 0] - The index into the array at which to start packing the elements.
  15551. * @returns The array that was packed into
  15552. */
  15553. static pack(value: SphereGeometry, array: number[], startingIndex?: number): number[];
  15554. /**
  15555. * Retrieves an instance from a packed array.
  15556. * @param array - The packed array.
  15557. * @param [startingIndex = 0] - The starting index of the element to be unpacked.
  15558. * @param [result] - The object into which to store the result.
  15559. * @returns The modified result parameter or a new SphereGeometry instance if one was not provided.
  15560. */
  15561. static unpack(array: number[], startingIndex?: number, result?: SphereGeometry): SphereGeometry;
  15562. /**
  15563. * Computes the geometric representation of a sphere, including its vertices, indices, and a bounding sphere.
  15564. * @param sphereGeometry - A description of the sphere.
  15565. * @returns The computed vertices and indices.
  15566. */
  15567. static createGeometry(sphereGeometry: SphereGeometry): Geometry | undefined;
  15568. }
  15569. /**
  15570. * A description of the outline of a sphere.
  15571. * @example
  15572. * const sphere = new Cesium.SphereOutlineGeometry({
  15573. * radius : 100.0,
  15574. * stackPartitions : 6,
  15575. * slicePartitions: 5
  15576. * });
  15577. * const geometry = Cesium.SphereOutlineGeometry.createGeometry(sphere);
  15578. * @param [options] - Object with the following properties:
  15579. * @param [options.radius = 1.0] - The radius of the sphere.
  15580. * @param [options.stackPartitions = 10] - The count of stacks for the sphere (1 greater than the number of parallel lines).
  15581. * @param [options.slicePartitions = 8] - The count of slices for the sphere (Equal to the number of radial lines).
  15582. * @param [options.subdivisions = 200] - The number of points per line, determining the granularity of the curvature .
  15583. */
  15584. export class SphereOutlineGeometry {
  15585. constructor(options?: {
  15586. radius?: number;
  15587. stackPartitions?: number;
  15588. slicePartitions?: number;
  15589. subdivisions?: number;
  15590. });
  15591. /**
  15592. * The number of elements used to pack the object into an array.
  15593. */
  15594. static packedLength: number;
  15595. /**
  15596. * Stores the provided instance into the provided array.
  15597. * @param value - The value to pack.
  15598. * @param array - The array to pack into.
  15599. * @param [startingIndex = 0] - The index into the array at which to start packing the elements.
  15600. * @returns The array that was packed into
  15601. */
  15602. static pack(value: SphereOutlineGeometry, array: number[], startingIndex?: number): number[];
  15603. /**
  15604. * Retrieves an instance from a packed array.
  15605. * @param array - The packed array.
  15606. * @param [startingIndex = 0] - The starting index of the element to be unpacked.
  15607. * @param [result] - The object into which to store the result.
  15608. * @returns The modified result parameter or a new SphereOutlineGeometry instance if one was not provided.
  15609. */
  15610. static unpack(array: number[], startingIndex?: number, result?: SphereOutlineGeometry): SphereOutlineGeometry;
  15611. /**
  15612. * Computes the geometric representation of an outline of a sphere, including its vertices, indices, and a bounding sphere.
  15613. * @param sphereGeometry - A description of the sphere outline.
  15614. * @returns The computed vertices and indices.
  15615. */
  15616. static createGeometry(sphereGeometry: SphereOutlineGeometry): Geometry | undefined;
  15617. }
  15618. /**
  15619. * A set of curvilinear 3-dimensional coordinates.
  15620. * @param [clock = 0.0] - The angular coordinate lying in the xy-plane measured from the positive x-axis and toward the positive y-axis.
  15621. * @param [cone = 0.0] - The angular coordinate measured from the positive z-axis and toward the negative z-axis.
  15622. * @param [magnitude = 1.0] - The linear coordinate measured from the origin.
  15623. */
  15624. export class Spherical {
  15625. constructor(clock?: number, cone?: number, magnitude?: number);
  15626. /**
  15627. * The clock component.
  15628. */
  15629. clock: number;
  15630. /**
  15631. * The cone component.
  15632. */
  15633. cone: number;
  15634. /**
  15635. * The magnitude component.
  15636. */
  15637. magnitude: number;
  15638. /**
  15639. * Converts the provided Cartesian3 into Spherical coordinates.
  15640. * @param cartesian3 - The Cartesian3 to be converted to Spherical.
  15641. * @param [result] - The object in which the result will be stored, if undefined a new instance will be created.
  15642. * @returns The modified result parameter, or a new instance if one was not provided.
  15643. */
  15644. static fromCartesian3(cartesian3: Cartesian3, result?: Spherical): Spherical;
  15645. /**
  15646. * Creates a duplicate of a Spherical.
  15647. * @param spherical - The spherical to clone.
  15648. * @param [result] - The object to store the result into, if undefined a new instance will be created.
  15649. * @returns The modified result parameter or a new instance if result was undefined. (Returns undefined if spherical is undefined)
  15650. */
  15651. static clone(spherical: Spherical, result?: Spherical): Spherical;
  15652. /**
  15653. * Computes the normalized version of the provided spherical.
  15654. * @param spherical - The spherical to be normalized.
  15655. * @param [result] - The object to store the result into, if undefined a new instance will be created.
  15656. * @returns The modified result parameter or a new instance if result was undefined.
  15657. */
  15658. static normalize(spherical: Spherical, result?: Spherical): Spherical;
  15659. /**
  15660. * Returns true if the first spherical is equal to the second spherical, false otherwise.
  15661. * @param left - The first Spherical to be compared.
  15662. * @param right - The second Spherical to be compared.
  15663. * @returns true if the first spherical is equal to the second spherical, false otherwise.
  15664. */
  15665. static equals(left: Spherical, right: Spherical): boolean;
  15666. /**
  15667. * Returns true if the first spherical is within the provided epsilon of the second spherical, false otherwise.
  15668. * @param left - The first Spherical to be compared.
  15669. * @param right - The second Spherical to be compared.
  15670. * @param [epsilon = 0.0] - The epsilon to compare against.
  15671. * @returns true if the first spherical is within the provided epsilon of the second spherical, false otherwise.
  15672. */
  15673. static equalsEpsilon(left: Spherical, right: Spherical, epsilon?: number): boolean;
  15674. /**
  15675. * Returns true if this spherical is equal to the provided spherical, false otherwise.
  15676. * @param other - The Spherical to be compared.
  15677. * @returns true if this spherical is equal to the provided spherical, false otherwise.
  15678. */
  15679. equals(other: Spherical): boolean;
  15680. /**
  15681. * Creates a duplicate of this Spherical.
  15682. * @param [result] - The object to store the result into, if undefined a new instance will be created.
  15683. * @returns The modified result parameter or a new instance if result was undefined.
  15684. */
  15685. clone(result?: Spherical): Spherical;
  15686. /**
  15687. * Returns true if this spherical is within the provided epsilon of the provided spherical, false otherwise.
  15688. * @param other - The Spherical to be compared.
  15689. * @param epsilon - The epsilon to compare against.
  15690. * @returns true if this spherical is within the provided epsilon of the provided spherical, false otherwise.
  15691. */
  15692. equalsEpsilon(other: Spherical, epsilon: number): boolean;
  15693. /**
  15694. * Returns a string representing this instance in the format (clock, cone, magnitude).
  15695. * @returns A string representing this instance.
  15696. */
  15697. toString(): string;
  15698. }
  15699. /**
  15700. * Creates a curve parameterized and evaluated by time. This type describes an interface
  15701. * and is not intended to be instantiated directly.
  15702. */
  15703. export class Spline {
  15704. constructor();
  15705. /**
  15706. * An array of times for the control points.
  15707. */
  15708. times: number[];
  15709. /**
  15710. * An array of control points.
  15711. */
  15712. points: Cartesian3[] | Quaternion[];
  15713. /**
  15714. * Evaluates the curve at a given time.
  15715. * @param time - The time at which to evaluate the curve.
  15716. * @param [result] - The object onto which to store the result.
  15717. * @returns The modified result parameter or a new instance of the point on the curve at the given time.
  15718. */
  15719. evaluate(time: number, result?: Cartesian3 | Quaternion | number[]): Cartesian3 | Quaternion | number[];
  15720. /**
  15721. * Finds an index <code>i</code> in <code>times</code> such that the parameter
  15722. * <code>time</code> is in the interval <code>[times[i], times[i + 1]]</code>.
  15723. * @param time - The time.
  15724. * @param startIndex - The index from which to start the search.
  15725. * @returns The index for the element at the start of the interval.
  15726. */
  15727. findTimeInterval(time: number, startIndex: number): number;
  15728. /**
  15729. * Wraps the given time to the period covered by the spline.
  15730. * @param time - The time.
  15731. * @returns The time, wrapped around the animation period.
  15732. */
  15733. wrapTime(time: number): number;
  15734. /**
  15735. * Clamps the given time to the period covered by the spline.
  15736. * @param time - The time.
  15737. * @returns The time, clamped to the animation period.
  15738. */
  15739. clampTime(time: number): number;
  15740. }
  15741. /**
  15742. * A spline that is composed of piecewise constants representing a step function.
  15743. * @example
  15744. * const times = [ 0.0, 1.5, 3.0, 4.5, 6.0 ];
  15745. * const spline = new Cesium.SteppedSpline({
  15746. * times : times,
  15747. * points : [
  15748. * new Cesium.Cartesian3(1235398.0, -4810983.0, 4146266.0),
  15749. * new Cesium.Cartesian3(1372574.0, -5345182.0, 4606657.0),
  15750. * new Cesium.Cartesian3(-757983.0, -5542796.0, 4514323.0),
  15751. * new Cesium.Cartesian3(-2821260.0, -5248423.0, 4021290.0),
  15752. * new Cesium.Cartesian3(-2539788.0, -4724797.0, 3620093.0)
  15753. * ]
  15754. * });
  15755. *
  15756. * const p0 = spline.evaluate(times[0]);
  15757. * @param options - Object with the following properties:
  15758. * @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.
  15759. * @param options.points - The array of control points.
  15760. */
  15761. export class SteppedSpline {
  15762. constructor(options: {
  15763. times: number[];
  15764. points: number[] | Cartesian3[] | Quaternion[];
  15765. });
  15766. /**
  15767. * An array of times for the control points.
  15768. */
  15769. readonly times: number[];
  15770. /**
  15771. * An array of control points.
  15772. */
  15773. readonly points: number[] | Cartesian3[] | Quaternion[];
  15774. /**
  15775. * Finds an index <code>i</code> in <code>times</code> such that the parameter
  15776. * <code>time</code> is in the interval <code>[times[i], times[i + 1]]</code>.
  15777. * @param time - The time.
  15778. * @param startIndex - The index from which to start the search.
  15779. * @returns The index for the element at the start of the interval.
  15780. */
  15781. findTimeInterval(time: number, startIndex: number): number;
  15782. /**
  15783. * Wraps the given time to the period covered by the spline.
  15784. * @param time - The time.
  15785. * @returns The time, wrapped around to the updated animation.
  15786. */
  15787. wrapTime(time: number): number;
  15788. /**
  15789. * Clamps the given time to the period covered by the spline.
  15790. * @param time - The time.
  15791. * @returns The time, clamped to the animation period.
  15792. */
  15793. clampTime(time: number): number;
  15794. /**
  15795. * Evaluates the curve at a given time.
  15796. * @param time - The time at which to evaluate the curve.
  15797. * @param [result] - The object onto which to store the result.
  15798. * @returns The modified result parameter or a new instance of the point on the curve at the given time.
  15799. */
  15800. evaluate(time: number, result?: Cartesian3 | Quaternion): number | Cartesian3 | Quaternion;
  15801. }
  15802. /**
  15803. * A wrapper around a web worker that allows scheduling tasks for a given worker,
  15804. * returning results asynchronously via a promise.
  15805. *
  15806. * The Worker is not constructed until a task is scheduled.
  15807. * @param workerPath - The Url to the worker. This can either be an absolute path or relative to the Cesium Workers folder.
  15808. * @param [maximumActiveTasks = Number.POSITIVE_INFINITY] - The maximum number of active tasks. Once exceeded,
  15809. * scheduleTask will not queue any more tasks, allowing
  15810. * work to be rescheduled in future frames.
  15811. */
  15812. export class TaskProcessor {
  15813. constructor(workerPath: string, maximumActiveTasks?: number);
  15814. /**
  15815. * Schedule a task to be processed by the web worker asynchronously. If there are currently more
  15816. * tasks active than the maximum set by the constructor, will immediately return undefined.
  15817. * Otherwise, returns a promise that will resolve to the result posted back by the worker when
  15818. * finished.
  15819. * @example
  15820. * const taskProcessor = new Cesium.TaskProcessor('myWorkerPath');
  15821. * const promise = taskProcessor.scheduleTask({
  15822. * someParameter : true,
  15823. * another : 'hello'
  15824. * });
  15825. * if (!Cesium.defined(promise)) {
  15826. * // too many active tasks - try again later
  15827. * } else {
  15828. * promise.then(function(result) {
  15829. * // use the result of the task
  15830. * });
  15831. * }
  15832. * @param parameters - Any input data that will be posted to the worker.
  15833. * @param [transferableObjects] - An array of objects contained in parameters that should be
  15834. * transferred to the worker instead of copied.
  15835. * @returns Either a promise that will resolve to the result when available, or undefined
  15836. * if there are too many active tasks,
  15837. */
  15838. scheduleTask(parameters: any, transferableObjects?: object[]): Promise<object> | undefined;
  15839. /**
  15840. * Posts a message to a web worker with configuration to initialize loading
  15841. * and compiling a web assembly module asychronously, as well as an optional
  15842. * fallback JavaScript module to use if Web Assembly is not supported.
  15843. * @param [webAssemblyOptions] - An object with the following properties:
  15844. * @param [webAssemblyOptions.modulePath] - The path of the web assembly JavaScript wrapper module.
  15845. * @param [webAssemblyOptions.wasmBinaryFile] - The path of the web assembly binary file.
  15846. * @param [webAssemblyOptions.fallbackModulePath] - The path of the fallback JavaScript module to use if web assembly is not supported.
  15847. * @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.
  15848. */
  15849. initWebAssemblyModule(webAssemblyOptions?: {
  15850. modulePath?: string;
  15851. wasmBinaryFile?: string;
  15852. fallbackModulePath?: string;
  15853. }): Promise<object>;
  15854. /**
  15855. * Returns true if this object was destroyed; otherwise, false.
  15856. * <br /><br />
  15857. * If this object was destroyed, it should not be used; calling any function other than
  15858. * <code>isDestroyed</code> will result in a {@link DeveloperError} exception.
  15859. * @returns True if this object was destroyed; otherwise, false.
  15860. */
  15861. isDestroyed(): boolean;
  15862. /**
  15863. * Destroys this object. This will immediately terminate the Worker.
  15864. * <br /><br />
  15865. * Once an object is destroyed, it should not be used; calling any function other than
  15866. * <code>isDestroyed</code> will result in a {@link DeveloperError} exception.
  15867. */
  15868. destroy(): void;
  15869. }
  15870. /**
  15871. * Terrain data for a single tile. This type describes an
  15872. * interface and is not intended to be instantiated directly.
  15873. */
  15874. export class TerrainData {
  15875. constructor();
  15876. /**
  15877. * An array of credits for this tile.
  15878. */
  15879. credits: Credit[];
  15880. /**
  15881. * The water mask included in this terrain data, if any. A water mask is a rectangular
  15882. * Uint8Array or image where a value of 255 indicates water and a value of 0 indicates land.
  15883. * Values in between 0 and 255 are allowed as well to smoothly blend between land and water.
  15884. */
  15885. waterMask: Uint8Array | HTMLImageElement | HTMLCanvasElement;
  15886. /**
  15887. * Computes the terrain height at a specified longitude and latitude.
  15888. * @param rectangle - The rectangle covered by this terrain data.
  15889. * @param longitude - The longitude in radians.
  15890. * @param latitude - The latitude in radians.
  15891. * @returns The terrain height at the specified position. If the position
  15892. * is outside the rectangle, this method will extrapolate the height, which is likely to be wildly
  15893. * incorrect for positions far outside the rectangle.
  15894. */
  15895. interpolateHeight(rectangle: Rectangle, longitude: number, latitude: number): number;
  15896. /**
  15897. * Determines if a given child tile is available, based on the
  15898. * {@link TerrainData#childTileMask}. The given child tile coordinates are assumed
  15899. * to be one of the four children of this tile. If non-child tile coordinates are
  15900. * given, the availability of the southeast child tile is returned.
  15901. * @param thisX - The tile X coordinate of this (the parent) tile.
  15902. * @param thisY - The tile Y coordinate of this (the parent) tile.
  15903. * @param childX - The tile X coordinate of the child tile to check for availability.
  15904. * @param childY - The tile Y coordinate of the child tile to check for availability.
  15905. * @returns True if the child tile is available; otherwise, false.
  15906. */
  15907. isChildAvailable(thisX: number, thisY: number, childX: number, childY: number): boolean;
  15908. /**
  15909. * Upsamples this terrain data for use by a descendant tile.
  15910. * @param tilingScheme - The tiling scheme of this terrain data.
  15911. * @param thisX - The X coordinate of this tile in the tiling scheme.
  15912. * @param thisY - The Y coordinate of this tile in the tiling scheme.
  15913. * @param thisLevel - The level of this tile in the tiling scheme.
  15914. * @param descendantX - The X coordinate within the tiling scheme of the descendant tile for which we are upsampling.
  15915. * @param descendantY - The Y coordinate within the tiling scheme of the descendant tile for which we are upsampling.
  15916. * @param descendantLevel - The level within the tiling scheme of the descendant tile for which we are upsampling.
  15917. * @returns A promise for upsampled terrain data for the descendant tile,
  15918. * or undefined if too many asynchronous upsample operations are in progress and the request has been
  15919. * deferred.
  15920. */
  15921. upsample(tilingScheme: TilingScheme, thisX: number, thisY: number, thisLevel: number, descendantX: number, descendantY: number, descendantLevel: number): Promise<TerrainData> | undefined;
  15922. /**
  15923. * Gets a value indicating whether or not this terrain data was created by upsampling lower resolution
  15924. * terrain data. If this value is false, the data was obtained from some other source, such
  15925. * as by downloading it from a remote server. This method should return true for instances
  15926. * returned from a call to {@link TerrainData#upsample}.
  15927. * @returns True if this instance was created by upsampling; otherwise, false.
  15928. */
  15929. wasCreatedByUpsampling(): boolean;
  15930. }
  15931. export namespace TerrainProvider {
  15932. /**
  15933. * A function that is called when an error occurs.
  15934. * @param err - An object holding details about the error that occurred.
  15935. */
  15936. type ErrorEvent = (this: TerrainProvider, err: TileProviderError) => void;
  15937. }
  15938. /**
  15939. * Provides terrain or other geometry for the surface of an ellipsoid. The surface geometry is
  15940. * organized into a pyramid of tiles according to a {@link TilingScheme}. This type describes an
  15941. * interface and is not intended to be instantiated directly.
  15942. */
  15943. export class TerrainProvider {
  15944. constructor();
  15945. /**
  15946. * Gets an event that is raised when the terrain provider encounters an asynchronous error.. By subscribing
  15947. * to the event, you will be notified of the error and can potentially recover from it. Event listeners
  15948. * are passed an instance of {@link TileProviderError}.
  15949. */
  15950. readonly errorEvent: Event<TerrainProvider.ErrorEvent>;
  15951. /**
  15952. * Gets the credit to display when this terrain provider is active. Typically this is used to credit
  15953. * the source of the terrain. This function should
  15954. * not be called before {@link TerrainProvider#ready} returns true.
  15955. */
  15956. readonly credit: Credit;
  15957. /**
  15958. * Gets the tiling scheme used by the provider. This function should
  15959. * not be called before {@link TerrainProvider#ready} returns true.
  15960. */
  15961. readonly tilingScheme: TilingScheme;
  15962. /**
  15963. * Gets a value indicating whether or not the provider is ready for use.
  15964. */
  15965. readonly ready: boolean;
  15966. /**
  15967. * Gets a promise that resolves to true when the provider is ready for use.
  15968. */
  15969. readonly readyPromise: Promise<boolean>;
  15970. /**
  15971. * Gets a value indicating whether or not the provider includes a water mask. The water mask
  15972. * indicates which areas of the globe are water rather than land, so they can be rendered
  15973. * as a reflective surface with animated waves. This function should not be
  15974. * called before {@link TerrainProvider#ready} returns true.
  15975. */
  15976. readonly hasWaterMask: boolean;
  15977. /**
  15978. * Gets a value indicating whether or not the requested tiles include vertex normals.
  15979. * This function should not be called before {@link TerrainProvider#ready} returns true.
  15980. */
  15981. readonly hasVertexNormals: boolean;
  15982. /**
  15983. * Gets an object that can be used to determine availability of terrain from this provider, such as
  15984. * at points and in rectangles. This function should not be called before
  15985. * {@link TerrainProvider#ready} returns true. This property may be undefined if availability
  15986. * information is not available.
  15987. */
  15988. readonly availability: TileAvailability;
  15989. /**
  15990. * Gets a list of indices for a triangle mesh representing a regular grid. Calling
  15991. * this function multiple times with the same grid width and height returns the
  15992. * same list of indices. The total number of vertices must be less than or equal
  15993. * to 65536.
  15994. * @param width - The number of vertices in the regular grid in the horizontal direction.
  15995. * @param height - The number of vertices in the regular grid in the vertical direction.
  15996. * @returns The list of indices. Uint16Array gets returned for 64KB or less and Uint32Array for 4GB or less.
  15997. */
  15998. static getRegularGridIndices(width: number, height: number): Uint16Array | Uint32Array;
  15999. /**
  16000. * Specifies the quality of terrain created from heightmaps. A value of 1.0 will
  16001. * ensure that adjacent heightmap vertices are separated by no more than
  16002. * {@link Globe.maximumScreenSpaceError} screen pixels and will probably go very slowly.
  16003. * A value of 0.5 will cut the estimated level zero geometric error in half, allowing twice the
  16004. * screen pixels between adjacent heightmap vertices and thus rendering more quickly.
  16005. */
  16006. static heightmapTerrainQuality: number;
  16007. /**
  16008. * Determines an appropriate geometric error estimate when the geometry comes from a heightmap.
  16009. * @param ellipsoid - The ellipsoid to which the terrain is attached.
  16010. * @param tileImageWidth - The width, in pixels, of the heightmap associated with a single tile.
  16011. * @param numberOfTilesAtLevelZero - The number of tiles in the horizontal direction at tile level zero.
  16012. * @returns An estimated geometric error.
  16013. */
  16014. static getEstimatedLevelZeroGeometricErrorForAHeightmap(ellipsoid: Ellipsoid, tileImageWidth: number, numberOfTilesAtLevelZero: number): number;
  16015. /**
  16016. * Requests the geometry for a given tile. This function should not be called before
  16017. * {@link TerrainProvider#ready} returns true. The result must include terrain data and
  16018. * may optionally include a water mask and an indication of which child tiles are available.
  16019. * @param x - The X coordinate of the tile for which to request geometry.
  16020. * @param y - The Y coordinate of the tile for which to request geometry.
  16021. * @param level - The level of the tile for which to request geometry.
  16022. * @param [request] - The request object. Intended for internal use only.
  16023. * @returns A promise for the requested geometry. If this method
  16024. * returns undefined instead of a promise, it is an indication that too many requests are already
  16025. * pending and the request will be retried later.
  16026. */
  16027. requestTileGeometry(x: number, y: number, level: number, request?: Request): Promise<TerrainData> | undefined;
  16028. /**
  16029. * Gets the maximum geometric error allowed in a tile at a given level. This function should not be
  16030. * called before {@link TerrainProvider#ready} returns true.
  16031. * @param level - The tile level for which to get the maximum geometric error.
  16032. * @returns The maximum geometric error.
  16033. */
  16034. getLevelMaximumGeometricError(level: number): number;
  16035. /**
  16036. * Determines whether data for a tile is available to be loaded.
  16037. * @param x - The X coordinate of the tile for which to request geometry.
  16038. * @param y - The Y coordinate of the tile for which to request geometry.
  16039. * @param level - The level of the tile for which to request geometry.
  16040. * @returns Undefined if not supported by the terrain provider, otherwise true or false.
  16041. */
  16042. getTileDataAvailable(x: number, y: number, level: number): boolean | undefined;
  16043. /**
  16044. * Makes sure we load availability data for a tile
  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 nothing need to be loaded or a Promise that resolves when all required tiles are loaded
  16049. */
  16050. loadTileDataAvailability(x: number, y: number, level: number): undefined | Promise<void>;
  16051. }
  16052. /**
  16053. * Reports the availability of tiles in a {@link TilingScheme}.
  16054. * @param tilingScheme - The tiling scheme in which to report availability.
  16055. * @param maximumLevel - The maximum tile level that is potentially available.
  16056. */
  16057. export class TileAvailability {
  16058. constructor(tilingScheme: TilingScheme, maximumLevel: number);
  16059. /**
  16060. * Marks a rectangular range of tiles in a particular level as being available. For best performance,
  16061. * add your ranges in order of increasing level.
  16062. * @param level - The level.
  16063. * @param startX - The X coordinate of the first available tiles at the level.
  16064. * @param startY - The Y coordinate of the first available tiles at the level.
  16065. * @param endX - The X coordinate of the last available tiles at the level.
  16066. * @param endY - The Y coordinate of the last available tiles at the level.
  16067. */
  16068. addAvailableTileRange(level: number, startX: number, startY: number, endX: number, endY: number): void;
  16069. /**
  16070. * Determines the level of the most detailed tile covering the position. This function
  16071. * usually completes in time logarithmic to the number of rectangles added with
  16072. * {@link TileAvailability#addAvailableTileRange}.
  16073. * @param position - The position for which to determine the maximum available level. The height component is ignored.
  16074. * @returns The level of the most detailed tile covering the position.
  16075. */
  16076. computeMaximumLevelAtPosition(position: Cartographic): number;
  16077. /**
  16078. * Finds the most detailed level that is available _everywhere_ within a given rectangle. More detailed
  16079. * tiles may be available in parts of the rectangle, but not the whole thing. The return value of this
  16080. * function may be safely passed to {@link sampleTerrain} for any position within the rectangle. This function
  16081. * usually completes in time logarithmic to the number of rectangles added with
  16082. * {@link TileAvailability#addAvailableTileRange}.
  16083. * @param rectangle - The rectangle.
  16084. * @returns The best available level for the entire rectangle.
  16085. */
  16086. computeBestAvailableLevelOverRectangle(rectangle: Rectangle): number;
  16087. /**
  16088. * Determines if a particular tile is available.
  16089. * @param level - The tile level to check.
  16090. * @param x - The X coordinate of the tile to check.
  16091. * @param y - The Y coordinate of the tile to check.
  16092. * @returns True if the tile is available; otherwise, false.
  16093. */
  16094. isTileAvailable(level: number, x: number, y: number): boolean;
  16095. /**
  16096. * Computes a bit mask indicating which of a tile's four children exist.
  16097. * If a child's bit is set, a tile is available for that child. If it is cleared,
  16098. * the tile is not available. The bit values are as follows:
  16099. * <table>
  16100. * <tr><th>Bit Position</th><th>Bit Value</th><th>Child Tile</th></tr>
  16101. * <tr><td>0</td><td>1</td><td>Southwest</td></tr>
  16102. * <tr><td>1</td><td>2</td><td>Southeast</td></tr>
  16103. * <tr><td>2</td><td>4</td><td>Northwest</td></tr>
  16104. * <tr><td>3</td><td>8</td><td>Northeast</td></tr>
  16105. * </table>
  16106. * @param level - The level of the parent tile.
  16107. * @param x - The X coordinate of the parent tile.
  16108. * @param y - The Y coordinate of the parent tile.
  16109. * @returns The bit mask indicating child availability.
  16110. */
  16111. computeChildMaskForTile(level: number, x: number, y: number): number;
  16112. }
  16113. /**
  16114. * Provides details about an error that occurred in an {@link ImageryProvider} or a {@link TerrainProvider}.
  16115. * @param provider - The imagery or terrain provider that experienced the error.
  16116. * @param message - A message describing the error.
  16117. * @param [x] - The X coordinate of the tile that experienced the error, or undefined if the error
  16118. * is not specific to a particular tile.
  16119. * @param [y] - The Y coordinate of the tile that experienced the error, or undefined if the error
  16120. * is not specific to a particular tile.
  16121. * @param [level] - The level of the tile that experienced the error, or undefined if the error
  16122. * is not specific to a particular tile.
  16123. * @param [timesRetried = 0] - The number of times this operation has been retried.
  16124. * @param [error] - The error or exception that occurred, if any.
  16125. */
  16126. export class TileProviderError {
  16127. constructor(provider: ImageryProvider | TerrainProvider, message: string, x?: number, y?: number, level?: number, timesRetried?: number, error?: Error);
  16128. /**
  16129. * The {@link ImageryProvider} or {@link TerrainProvider} that experienced the error.
  16130. */
  16131. provider: ImageryProvider | TerrainProvider;
  16132. /**
  16133. * The message describing the error.
  16134. */
  16135. message: string;
  16136. /**
  16137. * The X coordinate of the tile that experienced the error. If the error is not specific
  16138. * to a particular tile, this property will be undefined.
  16139. */
  16140. x: number;
  16141. /**
  16142. * The Y coordinate of the tile that experienced the error. If the error is not specific
  16143. * to a particular tile, this property will be undefined.
  16144. */
  16145. y: number;
  16146. /**
  16147. * The level-of-detail of the tile that experienced the error. If the error is not specific
  16148. * to a particular tile, this property will be undefined.
  16149. */
  16150. level: number;
  16151. /**
  16152. * The number of times this operation has been retried.
  16153. */
  16154. timesRetried: number;
  16155. /**
  16156. * True if the failed operation should be retried; otherwise, false. The imagery or terrain provider
  16157. * will set the initial value of this property before raising the event, but any listeners
  16158. * can change it. The value after the last listener is invoked will be acted upon.
  16159. */
  16160. retry: boolean;
  16161. /**
  16162. * The error or exception that occurred, if any.
  16163. */
  16164. error: Error;
  16165. /**
  16166. * Handles an error in an {@link ImageryProvider} or {@link TerrainProvider} by raising an event if it has any listeners, or by
  16167. * logging the error to the console if the event has no listeners. This method also tracks the number
  16168. * of times the operation has been retried and will automatically retry if requested to do so by the
  16169. * event listeners.
  16170. * @param previousError - The error instance returned by this function the last
  16171. * time it was called for this error, or undefined if this is the first time this error has
  16172. * occurred.
  16173. * @param provider - The imagery or terrain provider that encountered the error.
  16174. * @param event - The event to raise to inform listeners of the error.
  16175. * @param message - The message describing the error.
  16176. * @param x - The X coordinate of the tile that experienced the error, or undefined if the
  16177. * error is not specific to a particular tile.
  16178. * @param y - The Y coordinate of the tile that experienced the error, or undefined if the
  16179. * error is not specific to a particular tile.
  16180. * @param level - The level-of-detail of the tile that experienced the error, or undefined if the
  16181. * error is not specific to a particular tile.
  16182. * @param retryFunction - The function to call to retry the operation. If undefined, the
  16183. * operation will not be retried.
  16184. * @param [errorDetails] - The error or exception that occurred, if any.
  16185. * @returns The error instance that was passed to the event listeners and that
  16186. * should be passed to this function the next time it is called for the same error in order
  16187. * to track retry counts.
  16188. */
  16189. static handleError(previousError: TileProviderError, provider: ImageryProvider | TerrainProvider, event: Event, message: string, x: number, y: number, level: number, retryFunction: TileProviderError.RetryFunction, errorDetails?: Error): TileProviderError;
  16190. /**
  16191. * Handles success of an operation by resetting the retry count of a previous error, if any. This way,
  16192. * if the error occurs again in the future, the listeners will be informed that it has not yet been retried.
  16193. * @param previousError - The previous error, or undefined if this operation has
  16194. * not previously resulted in an error.
  16195. */
  16196. static handleSuccess(previousError: TileProviderError): void;
  16197. }
  16198. export namespace TileProviderError {
  16199. /**
  16200. * A function that will be called to retry the operation.
  16201. */
  16202. type RetryFunction = () => void;
  16203. }
  16204. /**
  16205. * A tiling scheme for geometry or imagery on the surface of an ellipsoid. At level-of-detail zero,
  16206. * the coarsest, least-detailed level, the number of tiles is configurable.
  16207. * At level of detail one, each of the level zero tiles has four children, two in each direction.
  16208. * At level of detail two, each of the level one tiles has four children, two in each direction.
  16209. * This continues for as many levels as are present in the geometry or imagery source.
  16210. */
  16211. export class TilingScheme {
  16212. constructor();
  16213. /**
  16214. * Gets the ellipsoid that is tiled by the tiling scheme.
  16215. */
  16216. ellipsoid: Ellipsoid;
  16217. /**
  16218. * Gets the rectangle, in radians, covered by this tiling scheme.
  16219. */
  16220. rectangle: Rectangle;
  16221. /**
  16222. * Gets the map projection used by the tiling scheme.
  16223. */
  16224. projection: MapProjection;
  16225. /**
  16226. * Gets the total number of tiles in the X direction at a specified level-of-detail.
  16227. * @param level - The level-of-detail.
  16228. * @returns The number of tiles in the X direction at the given level.
  16229. */
  16230. getNumberOfXTilesAtLevel(level: number): number;
  16231. /**
  16232. * Gets the total number of tiles in the Y direction at a specified level-of-detail.
  16233. * @param level - The level-of-detail.
  16234. * @returns The number of tiles in the Y direction at the given level.
  16235. */
  16236. getNumberOfYTilesAtLevel(level: number): number;
  16237. /**
  16238. * Transforms a rectangle specified in geodetic radians to the native coordinate system
  16239. * of this tiling scheme.
  16240. * @param rectangle - The rectangle to transform.
  16241. * @param [result] - The instance to which to copy the result, or undefined if a new instance
  16242. * should be created.
  16243. * @returns The specified 'result', or a new object containing the native rectangle if 'result'
  16244. * is undefined.
  16245. */
  16246. rectangleToNativeRectangle(rectangle: Rectangle, result?: Rectangle): Rectangle;
  16247. /**
  16248. * Converts tile x, y coordinates and level to a rectangle expressed in the native coordinates
  16249. * of the tiling scheme.
  16250. * @param x - The integer x coordinate of the tile.
  16251. * @param y - The integer y coordinate of the tile.
  16252. * @param level - The tile level-of-detail. Zero is the least detailed.
  16253. * @param [result] - The instance to which to copy the result, or undefined if a new instance
  16254. * should be created.
  16255. * @returns The specified 'result', or a new object containing the rectangle
  16256. * if 'result' is undefined.
  16257. */
  16258. tileXYToNativeRectangle(x: number, y: number, level: number, result?: any): Rectangle;
  16259. /**
  16260. * Converts tile x, y coordinates and level to a cartographic rectangle in radians.
  16261. * @param x - The integer x coordinate of the tile.
  16262. * @param y - The integer y coordinate of the tile.
  16263. * @param level - The tile level-of-detail. Zero is the least detailed.
  16264. * @param [result] - The instance to which to copy the result, or undefined if a new instance
  16265. * should be created.
  16266. * @returns The specified 'result', or a new object containing the rectangle
  16267. * if 'result' is undefined.
  16268. */
  16269. tileXYToRectangle(x: number, y: number, level: number, result?: any): Rectangle;
  16270. /**
  16271. * Calculates the tile x, y coordinates of the tile containing
  16272. * a given cartographic position.
  16273. * @param position - The position.
  16274. * @param level - The tile level-of-detail. Zero is the least detailed.
  16275. * @param [result] - The instance to which to copy the result, or undefined if a new instance
  16276. * should be created.
  16277. * @returns The specified 'result', or a new object containing the tile x, y coordinates
  16278. * if 'result' is undefined.
  16279. */
  16280. positionToTileXY(position: Cartographic, level: number, result?: Cartesian2): Cartesian2;
  16281. }
  16282. /**
  16283. * An interval defined by a start and a stop time; optionally including those times as part of the interval.
  16284. * Arbitrary data can optionally be associated with each instance for used with {@link TimeIntervalCollection}.
  16285. * @example
  16286. * // Create an instance that spans August 1st, 1980 and is associated
  16287. * // with a Cartesian position.
  16288. * const timeInterval = new Cesium.TimeInterval({
  16289. * start : Cesium.JulianDate.fromIso8601('1980-08-01T00:00:00Z'),
  16290. * stop : Cesium.JulianDate.fromIso8601('1980-08-02T00:00:00Z'),
  16291. * isStartIncluded : true,
  16292. * isStopIncluded : false,
  16293. * data : Cesium.Cartesian3.fromDegrees(39.921037, -75.170082)
  16294. * });
  16295. * @example
  16296. * // Create two instances from ISO 8601 intervals with associated numeric data
  16297. * // then compute their intersection, summing the data they contain.
  16298. * const left = Cesium.TimeInterval.fromIso8601({
  16299. * iso8601 : '2000/2010',
  16300. * data : 2
  16301. * });
  16302. *
  16303. * const right = Cesium.TimeInterval.fromIso8601({
  16304. * iso8601 : '1995/2005',
  16305. * data : 3
  16306. * });
  16307. *
  16308. * //The result of the below intersection will be an interval equivalent to
  16309. * //const intersection = Cesium.TimeInterval.fromIso8601({
  16310. * // iso8601 : '2000/2005',
  16311. * // data : 5
  16312. * //});
  16313. * const intersection = new Cesium.TimeInterval();
  16314. * Cesium.TimeInterval.intersect(left, right, intersection, function(leftData, rightData) {
  16315. * return leftData + rightData;
  16316. * });
  16317. * @example
  16318. * // Check if an interval contains a specific time.
  16319. * const dateToCheck = Cesium.JulianDate.fromIso8601('1982-09-08T11:30:00Z');
  16320. * const containsDate = Cesium.TimeInterval.contains(timeInterval, dateToCheck);
  16321. * @param [options] - Object with the following properties:
  16322. * @param [options.start = new JulianDate()] - The start time of the interval.
  16323. * @param [options.stop = new JulianDate()] - The stop time of the interval.
  16324. * @param [options.isStartIncluded = true] - <code>true</code> if <code>options.start</code> is included in the interval, <code>false</code> otherwise.
  16325. * @param [options.isStopIncluded = true] - <code>true</code> if <code>options.stop</code> is included in the interval, <code>false</code> otherwise.
  16326. * @param [options.data] - Arbitrary data associated with this interval.
  16327. */
  16328. export class TimeInterval {
  16329. constructor(options?: {
  16330. start?: JulianDate;
  16331. stop?: JulianDate;
  16332. isStartIncluded?: boolean;
  16333. isStopIncluded?: boolean;
  16334. data?: any;
  16335. });
  16336. /**
  16337. * Gets or sets the start time of this interval.
  16338. */
  16339. start: JulianDate;
  16340. /**
  16341. * Gets or sets the stop time of this interval.
  16342. */
  16343. stop: JulianDate;
  16344. /**
  16345. * Gets or sets the data associated with this interval.
  16346. */
  16347. data: any;
  16348. /**
  16349. * Gets or sets whether or not the start time is included in this interval.
  16350. */
  16351. isStartIncluded: boolean;
  16352. /**
  16353. * Gets or sets whether or not the stop time is included in this interval.
  16354. */
  16355. isStopIncluded: boolean;
  16356. /**
  16357. * Gets whether or not this interval is empty.
  16358. */
  16359. readonly isEmpty: boolean;
  16360. /**
  16361. * Creates a new instance from a {@link http://en.wikipedia.org/wiki/ISO_8601|ISO 8601} interval.
  16362. * @param options - Object with the following properties:
  16363. * @param options.iso8601 - An ISO 8601 interval.
  16364. * @param [options.isStartIncluded = true] - <code>true</code> if <code>options.start</code> is included in the interval, <code>false</code> otherwise.
  16365. * @param [options.isStopIncluded = true] - <code>true</code> if <code>options.stop</code> is included in the interval, <code>false</code> otherwise.
  16366. * @param [options.data] - Arbitrary data associated with this interval.
  16367. * @param [result] - An existing instance to use for the result.
  16368. * @returns The modified result parameter or a new instance if none was provided.
  16369. */
  16370. static fromIso8601(options: {
  16371. iso8601: string;
  16372. isStartIncluded?: boolean;
  16373. isStopIncluded?: boolean;
  16374. data?: any;
  16375. }, result?: TimeInterval): TimeInterval;
  16376. /**
  16377. * Creates an ISO8601 representation of the provided interval.
  16378. * @param timeInterval - The interval to be converted.
  16379. * @param [precision] - The number of fractional digits used to represent the seconds component. By default, the most precise representation is used.
  16380. * @returns The ISO8601 representation of the provided interval.
  16381. */
  16382. static toIso8601(timeInterval: TimeInterval, precision?: number): string;
  16383. /**
  16384. * Duplicates the provided instance.
  16385. * @param [timeInterval] - The instance to clone.
  16386. * @param [result] - An existing instance to use for the result.
  16387. * @returns The modified result parameter or a new instance if none was provided.
  16388. */
  16389. static clone(timeInterval?: TimeInterval, result?: TimeInterval): TimeInterval;
  16390. /**
  16391. * Compares two instances and returns <code>true</code> if they are equal, <code>false</code> otherwise.
  16392. * @param [left] - The first instance.
  16393. * @param [right] - The second instance.
  16394. * @param [dataComparer] - A function which compares the data of the two intervals. If omitted, reference equality is used.
  16395. * @returns <code>true</code> if the dates are equal; otherwise, <code>false</code>.
  16396. */
  16397. static equals(left?: TimeInterval, right?: TimeInterval, dataComparer?: TimeInterval.DataComparer): boolean;
  16398. /**
  16399. * Compares two instances and returns <code>true</code> if they are within <code>epsilon</code> seconds of
  16400. * each other. That is, in order for the dates to be considered equal (and for
  16401. * this function to return <code>true</code>), the absolute value of the difference between them, in
  16402. * seconds, must be less than <code>epsilon</code>.
  16403. * @param [left] - The first instance.
  16404. * @param [right] - The second instance.
  16405. * @param [epsilon = 0] - The maximum number of seconds that should separate the two instances.
  16406. * @param [dataComparer] - A function which compares the data of the two intervals. If omitted, reference equality is used.
  16407. * @returns <code>true</code> if the two dates are within <code>epsilon</code> seconds of each other; otherwise <code>false</code>.
  16408. */
  16409. static equalsEpsilon(left?: TimeInterval, right?: TimeInterval, epsilon?: number, dataComparer?: TimeInterval.DataComparer): boolean;
  16410. /**
  16411. * Computes the intersection of two intervals, optionally merging their data.
  16412. * @param left - The first interval.
  16413. * @param [right] - The second interval.
  16414. * @param [result] - An existing instance to use for the result.
  16415. * @param [mergeCallback] - A function which merges the data of the two intervals. If omitted, the data from the left interval will be used.
  16416. * @returns The modified result parameter.
  16417. */
  16418. static intersect(left: TimeInterval, right?: TimeInterval, result?: TimeInterval, mergeCallback?: TimeInterval.MergeCallback): TimeInterval;
  16419. /**
  16420. * Checks if the specified date is inside the provided interval.
  16421. * @param timeInterval - The interval.
  16422. * @param julianDate - The date to check.
  16423. * @returns <code>true</code> if the interval contains the specified date, <code>false</code> otherwise.
  16424. */
  16425. static contains(timeInterval: TimeInterval, julianDate: JulianDate): boolean;
  16426. /**
  16427. * Duplicates this instance.
  16428. * @param [result] - An existing instance to use for the result.
  16429. * @returns The modified result parameter or a new instance if none was provided.
  16430. */
  16431. clone(result?: TimeInterval): TimeInterval;
  16432. /**
  16433. * Compares this instance against the provided instance componentwise and returns
  16434. * <code>true</code> if they are equal, <code>false</code> otherwise.
  16435. * @param [right] - The right hand side interval.
  16436. * @param [dataComparer] - A function which compares the data of the two intervals. If omitted, reference equality is used.
  16437. * @returns <code>true</code> if they are equal, <code>false</code> otherwise.
  16438. */
  16439. equals(right?: TimeInterval, dataComparer?: TimeInterval.DataComparer): boolean;
  16440. /**
  16441. * Compares this instance against the provided instance componentwise and returns
  16442. * <code>true</code> if they are within the provided epsilon,
  16443. * <code>false</code> otherwise.
  16444. * @param [right] - The right hand side interval.
  16445. * @param [epsilon = 0] - The epsilon to use for equality testing.
  16446. * @param [dataComparer] - A function which compares the data of the two intervals. If omitted, reference equality is used.
  16447. * @returns <code>true</code> if they are within the provided epsilon, <code>false</code> otherwise.
  16448. */
  16449. equalsEpsilon(right?: TimeInterval, epsilon?: number, dataComparer?: TimeInterval.DataComparer): boolean;
  16450. /**
  16451. * Creates a string representing this TimeInterval in ISO8601 format.
  16452. * @returns A string representing this TimeInterval in ISO8601 format.
  16453. */
  16454. toString(): string;
  16455. /**
  16456. * An immutable empty interval.
  16457. */
  16458. static readonly EMPTY: TimeInterval;
  16459. }
  16460. export namespace TimeInterval {
  16461. /**
  16462. * Function interface for merging interval data.
  16463. * @param leftData - The first data instance.
  16464. * @param rightData - The second data instance.
  16465. */
  16466. type MergeCallback = (leftData: any, rightData: any) => any;
  16467. /**
  16468. * Function interface for comparing interval data.
  16469. * @param leftData - The first data instance.
  16470. * @param rightData - The second data instance.
  16471. */
  16472. type DataComparer = (leftData: any, rightData: any) => boolean;
  16473. }
  16474. /**
  16475. * A non-overlapping collection of {@link TimeInterval} instances sorted by start time.
  16476. * @param [intervals] - An array of intervals to add to the collection.
  16477. */
  16478. export class TimeIntervalCollection {
  16479. constructor(intervals?: TimeInterval[]);
  16480. /**
  16481. * Gets an event that is raised whenever the collection of intervals change.
  16482. */
  16483. readonly changedEvent: Event;
  16484. /**
  16485. * Gets the start time of the collection.
  16486. */
  16487. readonly start: JulianDate;
  16488. /**
  16489. * Gets whether or not the start time is included in the collection.
  16490. */
  16491. readonly isStartIncluded: boolean;
  16492. /**
  16493. * Gets the stop time of the collection.
  16494. */
  16495. readonly stop: JulianDate;
  16496. /**
  16497. * Gets whether or not the stop time is included in the collection.
  16498. */
  16499. readonly isStopIncluded: boolean;
  16500. /**
  16501. * Gets the number of intervals in the collection.
  16502. */
  16503. readonly length: number;
  16504. /**
  16505. * Gets whether or not the collection is empty.
  16506. */
  16507. readonly isEmpty: boolean;
  16508. /**
  16509. * Compares this instance against the provided instance componentwise and returns
  16510. * <code>true</code> if they are equal, <code>false</code> otherwise.
  16511. * @param [right] - The right hand side collection.
  16512. * @param [dataComparer] - A function which compares the data of the two intervals. If omitted, reference equality is used.
  16513. * @returns <code>true</code> if they are equal, <code>false</code> otherwise.
  16514. */
  16515. equals(right?: TimeIntervalCollection, dataComparer?: TimeInterval.DataComparer): boolean;
  16516. /**
  16517. * Gets the interval at the specified index.
  16518. * @param index - The index of the interval to retrieve.
  16519. * @returns The interval at the specified index, or <code>undefined</code> if no interval exists as that index.
  16520. */
  16521. get(index: number): TimeInterval | undefined;
  16522. /**
  16523. * Removes all intervals from the collection.
  16524. */
  16525. removeAll(): void;
  16526. /**
  16527. * Finds and returns the interval that contains the specified date.
  16528. * @param date - The date to search for.
  16529. * @returns The interval containing the specified date, <code>undefined</code> if no such interval exists.
  16530. */
  16531. findIntervalContainingDate(date: JulianDate): TimeInterval | undefined;
  16532. /**
  16533. * Finds and returns the data for the interval that contains the specified date.
  16534. * @param date - The date to search for.
  16535. * @returns The data for the interval containing the specified date, or <code>undefined</code> if no such interval exists.
  16536. */
  16537. findDataForIntervalContainingDate(date: JulianDate): any;
  16538. /**
  16539. * Checks if the specified date is inside this collection.
  16540. * @param julianDate - The date to check.
  16541. * @returns <code>true</code> if the collection contains the specified date, <code>false</code> otherwise.
  16542. */
  16543. contains(julianDate: JulianDate): boolean;
  16544. /**
  16545. * Finds and returns the index of the interval in the collection that contains the specified date.
  16546. * @param date - The date to search for.
  16547. * @returns The index of the interval that contains the specified date, if no such interval exists,
  16548. * it returns a negative number which is the bitwise complement of the index of the next interval that
  16549. * starts after the date, or if no interval starts after the specified date, the bitwise complement of
  16550. * the length of the collection.
  16551. */
  16552. indexOf(date: JulianDate): number;
  16553. /**
  16554. * Returns the first interval in the collection that matches the specified parameters.
  16555. * All parameters are optional and <code>undefined</code> parameters are treated as a don't care condition.
  16556. * @param [options] - Object with the following properties:
  16557. * @param [options.start] - The start time of the interval.
  16558. * @param [options.stop] - The stop time of the interval.
  16559. * @param [options.isStartIncluded] - <code>true</code> if <code>options.start</code> is included in the interval, <code>false</code> otherwise.
  16560. * @param [options.isStopIncluded] - <code>true</code> if <code>options.stop</code> is included in the interval, <code>false</code> otherwise.
  16561. * @returns The first interval in the collection that matches the specified parameters.
  16562. */
  16563. findInterval(options?: {
  16564. start?: JulianDate;
  16565. stop?: JulianDate;
  16566. isStartIncluded?: boolean;
  16567. isStopIncluded?: boolean;
  16568. }): TimeInterval | undefined;
  16569. /**
  16570. * Adds an interval to the collection, merging intervals that contain the same data and
  16571. * splitting intervals of different data as needed in order to maintain a non-overlapping collection.
  16572. * The data in the new interval takes precedence over any existing intervals in the collection.
  16573. * @param interval - The interval to add.
  16574. * @param [dataComparer] - A function which compares the data of the two intervals. If omitted, reference equality is used.
  16575. */
  16576. addInterval(interval: TimeInterval, dataComparer?: TimeInterval.DataComparer): void;
  16577. /**
  16578. * Removes the specified interval from this interval collection, creating a hole over the specified interval.
  16579. * The data property of the input interval is ignored.
  16580. * @param interval - The interval to remove.
  16581. * @returns <code>true</code> if the interval was removed, <code>false</code> if no part of the interval was in the collection.
  16582. */
  16583. removeInterval(interval: TimeInterval): boolean;
  16584. /**
  16585. * Creates a new instance that is the intersection of this collection and the provided collection.
  16586. * @param other - The collection to intersect with.
  16587. * @param [dataComparer] - A function which compares the data of the two intervals. If omitted, reference equality is used.
  16588. * @param [mergeCallback] - A function which merges the data of the two intervals. If omitted, the data from the left interval will be used.
  16589. * @returns A new TimeIntervalCollection which is the intersection of this collection and the provided collection.
  16590. */
  16591. intersect(other: TimeIntervalCollection, dataComparer?: TimeInterval.DataComparer, mergeCallback?: TimeInterval.MergeCallback): TimeIntervalCollection;
  16592. /**
  16593. * Creates a new instance from a JulianDate array.
  16594. * @param options - Object with the following properties:
  16595. * @param options.julianDates - An array of ISO 8601 dates.
  16596. * @param [options.isStartIncluded = true] - <code>true</code> if start time is included in the interval, <code>false</code> otherwise.
  16597. * @param [options.isStopIncluded = true] - <code>true</code> if stop time is included in the interval, <code>false</code> otherwise.
  16598. * @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.
  16599. * @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.
  16600. * @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.
  16601. * @param [result] - An existing instance to use for the result.
  16602. * @returns The modified result parameter or a new instance if none was provided.
  16603. */
  16604. static fromJulianDateArray(options: {
  16605. julianDates: JulianDate[];
  16606. isStartIncluded?: boolean;
  16607. isStopIncluded?: boolean;
  16608. leadingInterval?: boolean;
  16609. trailingInterval?: boolean;
  16610. dataCallback?: (...params: any[]) => any;
  16611. }, result?: TimeIntervalCollection): TimeIntervalCollection;
  16612. /**
  16613. * Creates a new instance from an {@link http://en.wikipedia.org/wiki/ISO_8601|ISO 8601} time interval (start/end/duration).
  16614. * @param options - Object with the following properties:
  16615. * @param options.iso8601 - An ISO 8601 interval.
  16616. * @param [options.isStartIncluded = true] - <code>true</code> if start time is included in the interval, <code>false</code> otherwise.
  16617. * @param [options.isStopIncluded = true] - <code>true</code> if stop time is included in the interval, <code>false</code> otherwise.
  16618. * @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.
  16619. * @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.
  16620. * @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.
  16621. * @param [result] - An existing instance to use for the result.
  16622. * @returns The modified result parameter or a new instance if none was provided.
  16623. */
  16624. static fromIso8601(options: {
  16625. iso8601: string;
  16626. isStartIncluded?: boolean;
  16627. isStopIncluded?: boolean;
  16628. leadingInterval?: boolean;
  16629. trailingInterval?: boolean;
  16630. dataCallback?: (...params: any[]) => any;
  16631. }, result?: TimeIntervalCollection): TimeIntervalCollection;
  16632. /**
  16633. * Creates a new instance from a {@link http://en.wikipedia.org/wiki/ISO_8601|ISO 8601} date array.
  16634. * @param options - Object with the following properties:
  16635. * @param options.iso8601Dates - An array of ISO 8601 dates.
  16636. * @param [options.isStartIncluded = true] - <code>true</code> if start time is included in the interval, <code>false</code> otherwise.
  16637. * @param [options.isStopIncluded = true] - <code>true</code> if stop time is included in the interval, <code>false</code> otherwise.
  16638. * @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.
  16639. * @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.
  16640. * @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.
  16641. * @param [result] - An existing instance to use for the result.
  16642. * @returns The modified result parameter or a new instance if none was provided.
  16643. */
  16644. static fromIso8601DateArray(options: {
  16645. iso8601Dates: string[];
  16646. isStartIncluded?: boolean;
  16647. isStopIncluded?: boolean;
  16648. leadingInterval?: boolean;
  16649. trailingInterval?: boolean;
  16650. dataCallback?: (...params: any[]) => any;
  16651. }, result?: TimeIntervalCollection): TimeIntervalCollection;
  16652. /**
  16653. * Creates a new instance from a {@link http://en.wikipedia.org/wiki/ISO_8601|ISO 8601} duration array.
  16654. * @param options - Object with the following properties:
  16655. * @param options.epoch - An date that the durations are relative to.
  16656. * @param options.iso8601Durations - An array of ISO 8601 durations.
  16657. * @param [options.relativeToPrevious = false] - <code>true</code> if durations are relative to previous date, <code>false</code> if always relative to the epoch.
  16658. * @param [options.isStartIncluded = true] - <code>true</code> if start time is included in the interval, <code>false</code> otherwise.
  16659. * @param [options.isStopIncluded = true] - <code>true</code> if stop time is included in the interval, <code>false</code> otherwise.
  16660. * @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.
  16661. * @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.
  16662. * @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.
  16663. * @param [result] - An existing instance to use for the result.
  16664. * @returns The modified result parameter or a new instance if none was provided.
  16665. */
  16666. static fromIso8601DurationArray(options: {
  16667. epoch: JulianDate;
  16668. iso8601Durations: string;
  16669. relativeToPrevious?: boolean;
  16670. isStartIncluded?: boolean;
  16671. isStopIncluded?: boolean;
  16672. leadingInterval?: boolean;
  16673. trailingInterval?: boolean;
  16674. dataCallback?: (...params: any[]) => any;
  16675. }, result?: TimeIntervalCollection): TimeIntervalCollection;
  16676. }
  16677. /**
  16678. * Provides the type of time standards which JulianDate can take as input.
  16679. */
  16680. export enum TimeStandard {
  16681. /**
  16682. * Represents the coordinated Universal Time (UTC) time standard.
  16683. *
  16684. * UTC is related to TAI according to the relationship
  16685. * <code>UTC = TAI - deltaT</code> where <code>deltaT</code> is the number of leap
  16686. * seconds which have been introduced as of the time in TAI.
  16687. */
  16688. UTC = 0,
  16689. /**
  16690. * Represents the International Atomic Time (TAI) time standard.
  16691. * TAI is the principal time standard to which the other time standards are related.
  16692. */
  16693. TAI = 1
  16694. }
  16695. /**
  16696. * Contains functions for transforming positions to various reference frames.
  16697. */
  16698. export namespace Transforms {
  16699. /**
  16700. * Generates a function that computes a 4x4 transformation matrix from a reference frame
  16701. * centered at the provided origin to the provided ellipsoid's fixed reference frame.
  16702. * @param firstAxis - name of the first axis of the local reference frame. Must be
  16703. * 'east', 'north', 'up', 'west', 'south' or 'down'.
  16704. * @param secondAxis - name of the second axis of the local reference frame. Must be
  16705. * 'east', 'north', 'up', 'west', 'south' or 'down'.
  16706. * @returns The function that will computes a
  16707. * 4x4 transformation matrix from a reference frame, with first axis and second axis compliant with the parameters,
  16708. */
  16709. function localFrameToFixedFrameGenerator(firstAxis: string, secondAxis: string): Transforms.LocalFrameToFixedFrame;
  16710. /**
  16711. * Computes a 4x4 transformation matrix from a reference frame
  16712. * centered at the provided origin to the provided ellipsoid's fixed reference frame.
  16713. * @param origin - The center point of the local reference frame.
  16714. * @param [ellipsoid = Ellipsoid.WGS84] - The ellipsoid whose fixed frame is used in the transformation.
  16715. * @param [result] - The object onto which to store the result.
  16716. */
  16717. type LocalFrameToFixedFrame = (origin: Cartesian3, ellipsoid?: Ellipsoid, result?: Matrix4) => Matrix4;
  16718. /**
  16719. * Computes a 4x4 transformation matrix from a reference frame with an east-north-up axes
  16720. * centered at the provided origin to the provided ellipsoid's fixed reference frame.
  16721. * The local axes are defined as:
  16722. * <ul>
  16723. * <li>The <code>x</code> axis points in the local east direction.</li>
  16724. * <li>The <code>y</code> axis points in the local north direction.</li>
  16725. * <li>The <code>z</code> axis points in the direction of the ellipsoid surface normal which passes through the position.</li>
  16726. * </ul>
  16727. * @example
  16728. * // Get the transform from local east-north-up at cartographic (0.0, 0.0) to Earth's fixed frame.
  16729. * const center = Cesium.Cartesian3.fromDegrees(0.0, 0.0);
  16730. * const transform = Cesium.Transforms.eastNorthUpToFixedFrame(center);
  16731. * @param origin - The center point of the local reference frame.
  16732. * @param [ellipsoid = Ellipsoid.WGS84] - The ellipsoid whose fixed frame is used in the transformation.
  16733. * @param [result] - The object onto which to store the result.
  16734. * @returns The modified result parameter or a new Matrix4 instance if none was provided.
  16735. */
  16736. function eastNorthUpToFixedFrame(origin: Cartesian3, ellipsoid?: Ellipsoid, result?: Matrix4): Matrix4;
  16737. /**
  16738. * Computes a 4x4 transformation matrix from a reference frame with an north-east-down axes
  16739. * centered at the provided origin to the provided ellipsoid's fixed reference frame.
  16740. * The local axes are defined as:
  16741. * <ul>
  16742. * <li>The <code>x</code> axis points in the local north direction.</li>
  16743. * <li>The <code>y</code> axis points in the local east direction.</li>
  16744. * <li>The <code>z</code> axis points in the opposite direction of the ellipsoid surface normal which passes through the position.</li>
  16745. * </ul>
  16746. * @example
  16747. * // Get the transform from local north-east-down at cartographic (0.0, 0.0) to Earth's fixed frame.
  16748. * const center = Cesium.Cartesian3.fromDegrees(0.0, 0.0);
  16749. * const transform = Cesium.Transforms.northEastDownToFixedFrame(center);
  16750. * @param origin - The center point of the local reference frame.
  16751. * @param [ellipsoid = Ellipsoid.WGS84] - The ellipsoid whose fixed frame is used in the transformation.
  16752. * @param [result] - The object onto which to store the result.
  16753. * @returns The modified result parameter or a new Matrix4 instance if none was provided.
  16754. */
  16755. function northEastDownToFixedFrame(origin: Cartesian3, ellipsoid?: Ellipsoid, result?: Matrix4): Matrix4;
  16756. /**
  16757. * Computes a 4x4 transformation matrix from a reference frame with an north-up-east axes
  16758. * centered at the provided origin to the provided ellipsoid's fixed reference frame.
  16759. * The local axes are defined as:
  16760. * <ul>
  16761. * <li>The <code>x</code> axis points in the local north direction.</li>
  16762. * <li>The <code>y</code> axis points in the direction of the ellipsoid surface normal which passes through the position.</li>
  16763. * <li>The <code>z</code> axis points in the local east direction.</li>
  16764. * </ul>
  16765. * @example
  16766. * // Get the transform from local north-up-east at cartographic (0.0, 0.0) to Earth's fixed frame.
  16767. * const center = Cesium.Cartesian3.fromDegrees(0.0, 0.0);
  16768. * const transform = Cesium.Transforms.northUpEastToFixedFrame(center);
  16769. * @param origin - The center point of the local reference frame.
  16770. * @param [ellipsoid = Ellipsoid.WGS84] - The ellipsoid whose fixed frame is used in the transformation.
  16771. * @param [result] - The object onto which to store the result.
  16772. * @returns The modified result parameter or a new Matrix4 instance if none was provided.
  16773. */
  16774. function northUpEastToFixedFrame(origin: Cartesian3, ellipsoid?: Ellipsoid, result?: Matrix4): Matrix4;
  16775. /**
  16776. * Computes a 4x4 transformation matrix from a reference frame with an north-west-up axes
  16777. * centered at the provided origin to the provided ellipsoid's fixed reference frame.
  16778. * The local axes are defined as:
  16779. * <ul>
  16780. * <li>The <code>x</code> axis points in the local north direction.</li>
  16781. * <li>The <code>y</code> axis points in the local west direction.</li>
  16782. * <li>The <code>z</code> axis points in the direction of the ellipsoid surface normal which passes through the position.</li>
  16783. * </ul>
  16784. * @example
  16785. * // Get the transform from local north-West-Up at cartographic (0.0, 0.0) to Earth's fixed frame.
  16786. * const center = Cesium.Cartesian3.fromDegrees(0.0, 0.0);
  16787. * const transform = Cesium.Transforms.northWestUpToFixedFrame(center);
  16788. * @param origin - The center point of the local reference frame.
  16789. * @param [ellipsoid = Ellipsoid.WGS84] - The ellipsoid whose fixed frame is used in the transformation.
  16790. * @param [result] - The object onto which to store the result.
  16791. * @returns The modified result parameter or a new Matrix4 instance if none was provided.
  16792. */
  16793. function northWestUpToFixedFrame(origin: Cartesian3, ellipsoid?: Ellipsoid, result?: Matrix4): Matrix4;
  16794. /**
  16795. * Computes a 4x4 transformation matrix from a reference frame with axes computed from the heading-pitch-roll angles
  16796. * centered at the provided origin to the provided ellipsoid's fixed reference frame. Heading is the rotation from the local north
  16797. * direction where a positive angle is increasing eastward. Pitch is the rotation from the local east-north plane. Positive pitch angles
  16798. * are above the plane. Negative pitch angles are below the plane. Roll is the first rotation applied about the local east axis.
  16799. * @example
  16800. * // Get the transform from local heading-pitch-roll at cartographic (0.0, 0.0) to Earth's fixed frame.
  16801. * const center = Cesium.Cartesian3.fromDegrees(0.0, 0.0);
  16802. * const heading = -Cesium.Math.PI_OVER_TWO;
  16803. * const pitch = Cesium.Math.PI_OVER_FOUR;
  16804. * const roll = 0.0;
  16805. * const hpr = new Cesium.HeadingPitchRoll(heading, pitch, roll);
  16806. * const transform = Cesium.Transforms.headingPitchRollToFixedFrame(center, hpr);
  16807. * @param origin - The center point of the local reference frame.
  16808. * @param headingPitchRoll - The heading, pitch, and roll.
  16809. * @param [ellipsoid = Ellipsoid.WGS84] - The ellipsoid whose fixed frame is used in the transformation.
  16810. * @param [fixedFrameTransform = Transforms.eastNorthUpToFixedFrame] - A 4x4 transformation
  16811. * matrix from a reference frame to the provided ellipsoid's fixed reference frame
  16812. * @param [result] - The object onto which to store the result.
  16813. * @returns The modified result parameter or a new Matrix4 instance if none was provided.
  16814. */
  16815. function headingPitchRollToFixedFrame(origin: Cartesian3, headingPitchRoll: HeadingPitchRoll, ellipsoid?: Ellipsoid, fixedFrameTransform?: Transforms.LocalFrameToFixedFrame, result?: Matrix4): Matrix4;
  16816. /**
  16817. * Computes a quaternion from a reference frame with axes computed from the heading-pitch-roll angles
  16818. * centered at the provided origin. Heading is the rotation from the local north
  16819. * direction where a positive angle is increasing eastward. Pitch is the rotation from the local east-north plane. Positive pitch angles
  16820. * are above the plane. Negative pitch angles are below the plane. Roll is the first rotation applied about the local east axis.
  16821. * @example
  16822. * // Get the quaternion from local heading-pitch-roll at cartographic (0.0, 0.0) to Earth's fixed frame.
  16823. * const center = Cesium.Cartesian3.fromDegrees(0.0, 0.0);
  16824. * const heading = -Cesium.Math.PI_OVER_TWO;
  16825. * const pitch = Cesium.Math.PI_OVER_FOUR;
  16826. * const roll = 0.0;
  16827. * const hpr = new HeadingPitchRoll(heading, pitch, roll);
  16828. * const quaternion = Cesium.Transforms.headingPitchRollQuaternion(center, hpr);
  16829. * @param origin - The center point of the local reference frame.
  16830. * @param headingPitchRoll - The heading, pitch, and roll.
  16831. * @param [ellipsoid = Ellipsoid.WGS84] - The ellipsoid whose fixed frame is used in the transformation.
  16832. * @param [fixedFrameTransform = Transforms.eastNorthUpToFixedFrame] - A 4x4 transformation
  16833. * matrix from a reference frame to the provided ellipsoid's fixed reference frame
  16834. * @param [result] - The object onto which to store the result.
  16835. * @returns The modified result parameter or a new Quaternion instance if none was provided.
  16836. */
  16837. function headingPitchRollQuaternion(origin: Cartesian3, headingPitchRoll: HeadingPitchRoll, ellipsoid?: Ellipsoid, fixedFrameTransform?: Transforms.LocalFrameToFixedFrame, result?: Quaternion): Quaternion;
  16838. /**
  16839. * Computes heading-pitch-roll angles from a transform in a particular reference frame. Heading is the rotation from the local north
  16840. * direction where a positive angle is increasing eastward. Pitch is the rotation from the local east-north plane. Positive pitch angles
  16841. * are above the plane. Negative pitch angles are below the plane. Roll is the first rotation applied about the local east axis.
  16842. * @param transform - The transform
  16843. * @param [ellipsoid = Ellipsoid.WGS84] - The ellipsoid whose fixed frame is used in the transformation.
  16844. * @param [fixedFrameTransform = Transforms.eastNorthUpToFixedFrame] - A 4x4 transformation
  16845. * matrix from a reference frame to the provided ellipsoid's fixed reference frame
  16846. * @param [result] - The object onto which to store the result.
  16847. * @returns The modified result parameter or a new HeadingPitchRoll instance if none was provided.
  16848. */
  16849. function fixedFrameToHeadingPitchRoll(transform: Matrix4, ellipsoid?: Ellipsoid, fixedFrameTransform?: Transforms.LocalFrameToFixedFrame, result?: HeadingPitchRoll): HeadingPitchRoll;
  16850. /**
  16851. * Computes a rotation matrix to transform a point or vector from True Equator Mean Equinox (TEME) axes to the
  16852. * pseudo-fixed axes at a given time. This method treats the UT1 time standard as equivalent to UTC.
  16853. * @example
  16854. * //Set the view to the inertial frame.
  16855. * scene.postUpdate.addEventListener(function(scene, time) {
  16856. * const now = Cesium.JulianDate.now();
  16857. * const offset = Cesium.Matrix4.multiplyByPoint(camera.transform, camera.position, new Cesium.Cartesian3());
  16858. * const transform = Cesium.Matrix4.fromRotationTranslation(Cesium.Transforms.computeTemeToPseudoFixedMatrix(now));
  16859. * const inverseTransform = Cesium.Matrix4.inverseTransformation(transform, new Cesium.Matrix4());
  16860. * Cesium.Matrix4.multiplyByPoint(inverseTransform, offset, offset);
  16861. * camera.lookAtTransform(transform, offset);
  16862. * });
  16863. * @param date - The time at which to compute the rotation matrix.
  16864. * @param [result] - The object onto which to store the result.
  16865. * @returns The modified result parameter or a new Matrix3 instance if none was provided.
  16866. */
  16867. function computeTemeToPseudoFixedMatrix(date: JulianDate, result?: Matrix3): Matrix3;
  16868. /**
  16869. * Preloads the data necessary to transform between the ICRF and Fixed axes, in either
  16870. * direction, over a given interval. This function returns a promise that, when resolved,
  16871. * indicates that the preload has completed.
  16872. * @example
  16873. * const interval = new Cesium.TimeInterval(...);
  16874. * Promise.resolve(Cesium.Transforms.preloadIcrfFixed(interval)).then(function() {
  16875. * // the data is now loaded
  16876. * });
  16877. * @param timeInterval - The interval to preload.
  16878. * @returns A promise that, when resolved, indicates that the preload has completed
  16879. * and evaluation of the transformation between the fixed and ICRF axes will
  16880. * no longer return undefined for a time inside the interval.
  16881. */
  16882. function preloadIcrfFixed(timeInterval: TimeInterval): Promise<void>;
  16883. /**
  16884. * Computes a rotation matrix to transform a point or vector from the International Celestial
  16885. * Reference Frame (GCRF/ICRF) inertial frame axes to the Earth-Fixed frame axes (ITRF)
  16886. * at a given time. This function may return undefined if the data necessary to
  16887. * do the transformation is not yet loaded.
  16888. * @example
  16889. * scene.postUpdate.addEventListener(function(scene, time) {
  16890. * // View in ICRF.
  16891. * const icrfToFixed = Cesium.Transforms.computeIcrfToFixedMatrix(time);
  16892. * if (Cesium.defined(icrfToFixed)) {
  16893. * const offset = Cesium.Cartesian3.clone(camera.position);
  16894. * const transform = Cesium.Matrix4.fromRotationTranslation(icrfToFixed);
  16895. * camera.lookAtTransform(transform, offset);
  16896. * }
  16897. * });
  16898. * @param date - The time at which to compute the rotation matrix.
  16899. * @param [result] - The object onto which to store the result. If this parameter is
  16900. * not specified, a new instance is created and returned.
  16901. * @returns The rotation matrix, or undefined if the data necessary to do the
  16902. * transformation is not yet loaded.
  16903. */
  16904. function computeIcrfToFixedMatrix(date: JulianDate, result?: Matrix3): Matrix3;
  16905. /**
  16906. * Computes a rotation matrix to transform a point or vector from the Earth-Fixed frame axes (ITRF)
  16907. * to the International Celestial Reference Frame (GCRF/ICRF) inertial frame axes
  16908. * at a given time. This function may return undefined if the data necessary to
  16909. * do the transformation is not yet loaded.
  16910. * @example
  16911. * // Transform a point from the ICRF axes to the Fixed axes.
  16912. * const now = Cesium.JulianDate.now();
  16913. * const pointInFixed = Cesium.Cartesian3.fromDegrees(0.0, 0.0);
  16914. * const fixedToIcrf = Cesium.Transforms.computeIcrfToFixedMatrix(now);
  16915. * let pointInInertial = new Cesium.Cartesian3();
  16916. * if (Cesium.defined(fixedToIcrf)) {
  16917. * pointInInertial = Cesium.Matrix3.multiplyByVector(fixedToIcrf, pointInFixed, pointInInertial);
  16918. * }
  16919. * @param date - The time at which to compute the rotation matrix.
  16920. * @param [result] - The object onto which to store the result. If this parameter is
  16921. * not specified, a new instance is created and returned.
  16922. * @returns The rotation matrix, or undefined if the data necessary to do the
  16923. * transformation is not yet loaded.
  16924. */
  16925. function computeFixedToIcrfMatrix(date: JulianDate, result?: Matrix3): Matrix3;
  16926. /**
  16927. * Transform a point from model coordinates to window coordinates.
  16928. * @param modelViewProjectionMatrix - The 4x4 model-view-projection matrix.
  16929. * @param viewportTransformation - The 4x4 viewport transformation.
  16930. * @param point - The point to transform.
  16931. * @param [result] - The object onto which to store the result.
  16932. * @returns The modified result parameter or a new Cartesian2 instance if none was provided.
  16933. */
  16934. function pointToWindowCoordinates(modelViewProjectionMatrix: Matrix4, viewportTransformation: Matrix4, point: Cartesian3, result?: Cartesian2): Cartesian2;
  16935. /**
  16936. * Transform a position and velocity to a rotation matrix.
  16937. * @param position - The position to transform.
  16938. * @param velocity - The velocity vector to transform.
  16939. * @param [ellipsoid = Ellipsoid.WGS84] - The ellipsoid whose fixed frame is used in the transformation.
  16940. * @param [result] - The object onto which to store the result.
  16941. * @returns The modified result parameter or a new Matrix3 instance if none was provided.
  16942. */
  16943. function rotationMatrixFromPositionVelocity(position: Cartesian3, velocity: Cartesian3, ellipsoid?: Ellipsoid, result?: Matrix3): Matrix3;
  16944. }
  16945. /**
  16946. * An affine transformation defined by a translation, rotation, and scale.
  16947. * @param [translation = Cartesian3.ZERO] - A {@link Cartesian3} specifying the (x, y, z) translation to apply to the node.
  16948. * @param [rotation = Quaternion.IDENTITY] - A {@link Quaternion} specifying the (x, y, z, w) rotation to apply to the node.
  16949. * @param [scale = new Cartesian3(1.0, 1.0, 1.0)] - A {@link Cartesian3} specifying the (x, y, z) scaling to apply to the node.
  16950. */
  16951. export class TranslationRotationScale {
  16952. constructor(translation?: Cartesian3, rotation?: Quaternion, scale?: Cartesian3);
  16953. /**
  16954. * Gets or sets the (x, y, z) translation to apply to the node.
  16955. */
  16956. translation: Cartesian3;
  16957. /**
  16958. * Gets or sets the (x, y, z, w) rotation to apply to the node.
  16959. */
  16960. rotation: Quaternion;
  16961. /**
  16962. * Gets or sets the (x, y, z) scaling to apply to the node.
  16963. */
  16964. scale: Cartesian3;
  16965. /**
  16966. * Compares this instance against the provided instance and returns
  16967. * <code>true</code> if they are equal, <code>false</code> otherwise.
  16968. * @param [right] - The right hand side TranslationRotationScale.
  16969. * @returns <code>true</code> if they are equal, <code>false</code> otherwise.
  16970. */
  16971. equals(right?: TranslationRotationScale): boolean;
  16972. }
  16973. /**
  16974. * Uses the Tridiagonal Matrix Algorithm, also known as the Thomas Algorithm, to solve
  16975. * a system of linear equations where the coefficient matrix is a tridiagonal matrix.
  16976. */
  16977. export namespace TridiagonalSystemSolver {
  16978. /**
  16979. * Solves a tridiagonal system of linear equations.
  16980. * @example
  16981. * const lowerDiagonal = [1.0, 1.0, 1.0, 1.0];
  16982. * const diagonal = [2.0, 4.0, 4.0, 4.0, 2.0];
  16983. * const upperDiagonal = [1.0, 1.0, 1.0, 1.0];
  16984. * const rightHandSide = [
  16985. * new Cesium.Cartesian3(410757.0, -1595711.0, 1375302.0),
  16986. * new Cesium.Cartesian3(-5986705.0, -2190640.0, 1099600.0),
  16987. * new Cesium.Cartesian3(-12593180.0, 288588.0, -1755549.0),
  16988. * new Cesium.Cartesian3(-5349898.0, 2457005.0, -2685438.0),
  16989. * new Cesium.Cartesian3(845820.0, 1573488.0, -1205591.0)
  16990. * ];
  16991. *
  16992. * const solution = Cesium.TridiagonalSystemSolver.solve(lowerDiagonal, diagonal, upperDiagonal, rightHandSide);
  16993. * @param diagonal - An array with length <code>n</code> that contains the diagonal of the coefficient matrix.
  16994. * @param lower - An array with length <code>n - 1</code> that contains the lower diagonal of the coefficient matrix.
  16995. * @param upper - An array with length <code>n - 1</code> that contains the upper diagonal of the coefficient matrix.
  16996. * @param right - An array of Cartesians with length <code>n</code> that is the right side of the system of equations.
  16997. * @returns An array of Cartesians with length <code>n</code> that is the solution to the tridiagonal system of equations.
  16998. */
  16999. function solve(diagonal: number[], lower: number[], upper: number[], right: Cartesian3[]): Cartesian3[];
  17000. }
  17001. /**
  17002. * A singleton that contains all of the servers that are trusted. Credentials will be sent with
  17003. * any requests to these servers.
  17004. */
  17005. export namespace TrustedServers {
  17006. /**
  17007. * Adds a trusted server to the registry
  17008. * @example
  17009. * // Add a trusted server
  17010. * TrustedServers.add('my.server.com', 80);
  17011. * @param host - The host to be added.
  17012. * @param port - The port used to access the host.
  17013. */
  17014. function add(host: string, port: number): void;
  17015. /**
  17016. * Removes a trusted server from the registry
  17017. * @example
  17018. * // Remove a trusted server
  17019. * TrustedServers.remove('my.server.com', 80);
  17020. * @param host - The host to be removed.
  17021. * @param port - The port used to access the host.
  17022. */
  17023. function remove(host: string, port: number): void;
  17024. /**
  17025. * Tests whether a server is trusted or not. The server must have been added with the port if it is included in the url.
  17026. * @example
  17027. * // Add server
  17028. * TrustedServers.add('my.server.com', 81);
  17029. *
  17030. * // Check if server is trusted
  17031. * if (TrustedServers.contains('https://my.server.com:81/path/to/file.png')) {
  17032. * // my.server.com:81 is trusted
  17033. * }
  17034. * if (TrustedServers.contains('https://my.server.com/path/to/file.png')) {
  17035. * // my.server.com isn't trusted
  17036. * }
  17037. * @param url - The url to be tested against the trusted list
  17038. * @returns Returns true if url is trusted, false otherwise.
  17039. */
  17040. function contains(url: string): boolean;
  17041. /**
  17042. * Clears the registry
  17043. * @example
  17044. * // Remove a trusted server
  17045. * TrustedServers.clear();
  17046. */
  17047. function clear(): void;
  17048. }
  17049. /**
  17050. * A {@link TerrainProvider} that produces terrain geometry by tessellating height maps
  17051. * retrieved from a {@link http://vr-theworld.com/|VT MÄK VR-TheWorld server}.
  17052. * @example
  17053. * const terrainProvider = new Cesium.VRTheWorldTerrainProvider({
  17054. * url : 'https://www.vr-theworld.com/vr-theworld/tiles1.0.0/73/'
  17055. * });
  17056. * viewer.terrainProvider = terrainProvider;
  17057. * @param options - Object with the following properties:
  17058. * @param options.url - The URL of the VR-TheWorld TileMap.
  17059. * @param [options.ellipsoid = Ellipsoid.WGS84] - The ellipsoid. If this parameter is not
  17060. * specified, the WGS84 ellipsoid is used.
  17061. * @param [options.credit] - A credit for the data source, which is displayed on the canvas.
  17062. */
  17063. export class VRTheWorldTerrainProvider {
  17064. constructor(options: {
  17065. url: Resource | string;
  17066. ellipsoid?: Ellipsoid;
  17067. credit?: Credit | string;
  17068. });
  17069. /**
  17070. * Gets an event that is raised when the terrain provider encounters an asynchronous error. By subscribing
  17071. * to the event, you will be notified of the error and can potentially recover from it. Event listeners
  17072. * are passed an instance of {@link TileProviderError}.
  17073. */
  17074. readonly errorEvent: Event;
  17075. /**
  17076. * Gets the credit to display when this terrain provider is active. Typically this is used to credit
  17077. * the source of the terrain. This function should not be called before {@link VRTheWorldTerrainProvider#ready} returns true.
  17078. */
  17079. readonly credit: Credit;
  17080. /**
  17081. * Gets the tiling scheme used by this provider. This function should
  17082. * not be called before {@link VRTheWorldTerrainProvider#ready} returns true.
  17083. */
  17084. readonly tilingScheme: GeographicTilingScheme;
  17085. /**
  17086. * Gets a value indicating whether or not the provider is ready for use.
  17087. */
  17088. readonly ready: boolean;
  17089. /**
  17090. * Gets a promise that resolves to true when the provider is ready for use.
  17091. */
  17092. readonly readyPromise: Promise<boolean>;
  17093. /**
  17094. * Gets a value indicating whether or not the provider includes a water mask. The water mask
  17095. * indicates which areas of the globe are water rather than land, so they can be rendered
  17096. * as a reflective surface with animated waves. This function should not be
  17097. * called before {@link VRTheWorldTerrainProvider#ready} returns true.
  17098. */
  17099. readonly hasWaterMask: boolean;
  17100. /**
  17101. * Gets a value indicating whether or not the requested tiles include vertex normals.
  17102. * This function should not be called before {@link VRTheWorldTerrainProvider#ready} returns true.
  17103. */
  17104. readonly hasVertexNormals: boolean;
  17105. /**
  17106. * Gets an object that can be used to determine availability of terrain from this provider, such as
  17107. * at points and in rectangles. This function should not be called before
  17108. * {@link TerrainProvider#ready} returns true. This property may be undefined if availability
  17109. * information is not available.
  17110. */
  17111. readonly availability: TileAvailability;
  17112. /**
  17113. * Requests the geometry for a given tile. This function should not be called before
  17114. * {@link VRTheWorldTerrainProvider#ready} returns true. The result includes terrain
  17115. * data and indicates that all child tiles are available.
  17116. * @param x - The X coordinate of the tile for which to request geometry.
  17117. * @param y - The Y coordinate of the tile for which to request geometry.
  17118. * @param level - The level of the tile for which to request geometry.
  17119. * @param [request] - The request object. Intended for internal use only.
  17120. * @returns A promise for the requested geometry. If this method
  17121. * returns undefined instead of a promise, it is an indication that too many requests are already
  17122. * pending and the request will be retried later.
  17123. */
  17124. requestTileGeometry(x: number, y: number, level: number, request?: Request): Promise<TerrainData> | undefined;
  17125. /**
  17126. * Gets the maximum geometric error allowed in a tile at a given level.
  17127. * @param level - The tile level for which to get the maximum geometric error.
  17128. * @returns The maximum geometric error.
  17129. */
  17130. getLevelMaximumGeometricError(level: number): number;
  17131. /**
  17132. * Determines whether data for a tile is available to be loaded.
  17133. * @param x - The X coordinate of the tile for which to request geometry.
  17134. * @param y - The Y coordinate of the tile for which to request geometry.
  17135. * @param level - The level of the tile for which to request geometry.
  17136. * @returns Undefined if not supported, otherwise true or false.
  17137. */
  17138. getTileDataAvailable(x: number, y: number, level: number): boolean | undefined;
  17139. /**
  17140. * Makes sure we load availability data for a tile
  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 nothing need to be loaded or a Promise that resolves when all required tiles are loaded
  17145. */
  17146. loadTileDataAvailability(x: number, y: number, level: number): undefined | Promise<void>;
  17147. }
  17148. /**
  17149. * A vertex format defines what attributes make up a vertex. A VertexFormat can be provided
  17150. * to a {@link Geometry} to request that certain properties be computed, e.g., just position,
  17151. * position and normal, etc.
  17152. * @example
  17153. * // Create a vertex format with position and 2D texture coordinate attributes.
  17154. * const format = new Cesium.VertexFormat({
  17155. * position : true,
  17156. * st : true
  17157. * });
  17158. * @param [options] - An object with boolean properties corresponding to VertexFormat properties as shown in the code example.
  17159. */
  17160. export class VertexFormat {
  17161. constructor(options?: any);
  17162. /**
  17163. * When <code>true</code>, the vertex has a 3D position attribute.
  17164. * <p>
  17165. * 64-bit floating-point (for precision). 3 components per attribute.
  17166. * </p>
  17167. */
  17168. position: boolean;
  17169. /**
  17170. * When <code>true</code>, the vertex has a normal attribute (normalized), which is commonly used for lighting.
  17171. * <p>
  17172. * 32-bit floating-point. 3 components per attribute.
  17173. * </p>
  17174. */
  17175. normal: boolean;
  17176. /**
  17177. * When <code>true</code>, the vertex has a 2D texture coordinate attribute.
  17178. * <p>
  17179. * 32-bit floating-point. 2 components per attribute
  17180. * </p>
  17181. */
  17182. st: boolean;
  17183. /**
  17184. * When <code>true</code>, the vertex has a bitangent attribute (normalized), which is used for tangent-space effects like bump mapping.
  17185. * <p>
  17186. * 32-bit floating-point. 3 components per attribute.
  17187. * </p>
  17188. */
  17189. bitangent: boolean;
  17190. /**
  17191. * When <code>true</code>, the vertex has a tangent attribute (normalized), which is used for tangent-space effects like bump mapping.
  17192. * <p>
  17193. * 32-bit floating-point. 3 components per attribute.
  17194. * </p>
  17195. */
  17196. tangent: boolean;
  17197. /**
  17198. * When <code>true</code>, the vertex has an RGB color attribute.
  17199. * <p>
  17200. * 8-bit unsigned byte. 3 components per attribute.
  17201. * </p>
  17202. */
  17203. color: boolean;
  17204. /**
  17205. * An immutable vertex format with only a position attribute.
  17206. */
  17207. static readonly POSITION_ONLY: VertexFormat;
  17208. /**
  17209. * An immutable vertex format with position and normal attributes.
  17210. * This is compatible with per-instance color appearances like {@link PerInstanceColorAppearance}.
  17211. */
  17212. static readonly POSITION_AND_NORMAL: VertexFormat;
  17213. /**
  17214. * An immutable vertex format with position, normal, and st attributes.
  17215. * This is compatible with {@link MaterialAppearance} when {@link MaterialAppearance#materialSupport}
  17216. * is <code>TEXTURED/code>.
  17217. */
  17218. static readonly POSITION_NORMAL_AND_ST: VertexFormat;
  17219. /**
  17220. * An immutable vertex format with position and st attributes.
  17221. * This is compatible with {@link EllipsoidSurfaceAppearance}.
  17222. */
  17223. static readonly POSITION_AND_ST: VertexFormat;
  17224. /**
  17225. * An immutable vertex format with position and color attributes.
  17226. */
  17227. static readonly POSITION_AND_COLOR: VertexFormat;
  17228. /**
  17229. * An immutable vertex format with well-known attributes: position, normal, st, tangent, and bitangent.
  17230. */
  17231. static readonly ALL: VertexFormat;
  17232. /**
  17233. * An immutable vertex format with position, normal, and st attributes.
  17234. * This is compatible with most appearances and materials; however
  17235. * normal and st attributes are not always required. When this is
  17236. * known in advance, another <code>VertexFormat</code> should be used.
  17237. */
  17238. static readonly DEFAULT: VertexFormat;
  17239. /**
  17240. * The number of elements used to pack the object into an array.
  17241. */
  17242. static packedLength: number;
  17243. /**
  17244. * Stores the provided instance into the provided array.
  17245. * @param value - The value to pack.
  17246. * @param array - The array to pack into.
  17247. * @param [startingIndex = 0] - The index into the array at which to start packing the elements.
  17248. * @returns The array that was packed into
  17249. */
  17250. static pack(value: VertexFormat, array: number[], startingIndex?: number): number[];
  17251. /**
  17252. * Retrieves an instance from a packed array.
  17253. * @param array - The packed array.
  17254. * @param [startingIndex = 0] - The starting index of the element to be unpacked.
  17255. * @param [result] - The object into which to store the result.
  17256. * @returns The modified result parameter or a new VertexFormat instance if one was not provided.
  17257. */
  17258. static unpack(array: number[], startingIndex?: number, result?: VertexFormat): VertexFormat;
  17259. /**
  17260. * Duplicates a VertexFormat instance.
  17261. * @param vertexFormat - The vertex format to duplicate.
  17262. * @param [result] - The object onto which to store the result.
  17263. * @returns The modified result parameter or a new VertexFormat instance if one was not provided. (Returns undefined if vertexFormat is undefined)
  17264. */
  17265. static clone(vertexFormat: VertexFormat, result?: VertexFormat): VertexFormat;
  17266. }
  17267. /**
  17268. * Synchronizes a video element with a simulation clock.
  17269. * @param [options] - Object with the following properties:
  17270. * @param [options.clock] - The clock instance used to drive the video.
  17271. * @param [options.element] - The video element to be synchronized.
  17272. * @param [options.epoch = Iso8601.MINIMUM_VALUE] - The simulation time that marks the start of the video.
  17273. * @param [options.tolerance = 1.0] - The maximum amount of time, in seconds, that the clock and video can diverge.
  17274. */
  17275. export class VideoSynchronizer {
  17276. constructor(options?: {
  17277. clock?: Clock;
  17278. element?: HTMLVideoElement;
  17279. epoch?: JulianDate;
  17280. tolerance?: number;
  17281. });
  17282. /**
  17283. * Gets or sets the simulation time that marks the start of the video.
  17284. */
  17285. epoch: JulianDate;
  17286. /**
  17287. * Gets or sets the amount of time in seconds the video's currentTime
  17288. * and the clock's currentTime can diverge before a video seek is performed.
  17289. * Lower values make the synchronization more accurate but video
  17290. * performance might suffer. Higher values provide better performance
  17291. * but at the cost of accuracy.
  17292. */
  17293. tolerance: number;
  17294. /**
  17295. * Gets or sets the clock used to drive the video element.
  17296. */
  17297. clock: Clock;
  17298. /**
  17299. * Gets or sets the video element to synchronize.
  17300. */
  17301. element: HTMLVideoElement;
  17302. /**
  17303. * Destroys and resources used by the object. Once an object is destroyed, it should not be used.
  17304. */
  17305. destroy(): void;
  17306. /**
  17307. * Returns true if this object was destroyed; otherwise, false.
  17308. * @returns True if this object was destroyed; otherwise, false.
  17309. */
  17310. isDestroyed(): boolean;
  17311. }
  17312. /**
  17313. * This enumerated type is used in determining to what extent an object, the occludee,
  17314. * is visible during horizon culling. An occluder may fully block an occludee, in which case
  17315. * it has no visibility, may partially block an occludee from view, or may not block it at all,
  17316. * leading to full visibility.
  17317. */
  17318. export enum Visibility {
  17319. /**
  17320. * Represents that no part of an object is visible.
  17321. */
  17322. NONE = -1,
  17323. /**
  17324. * Represents that part, but not all, of an object is visible
  17325. */
  17326. PARTIAL = 0,
  17327. /**
  17328. * Represents that an object is visible in its entirety.
  17329. */
  17330. FULL = 1
  17331. }
  17332. /**
  17333. * A description of a wall, which is similar to a KML line string. A wall is defined by a series of points,
  17334. * which extrude down to the ground. Optionally, they can extrude downwards to a specified height.
  17335. * @example
  17336. * // create a wall that spans from ground level to 10000 meters
  17337. * const wall = new Cesium.WallGeometry({
  17338. * positions : Cesium.Cartesian3.fromDegreesArrayHeights([
  17339. * 19.0, 47.0, 10000.0,
  17340. * 19.0, 48.0, 10000.0,
  17341. * 20.0, 48.0, 10000.0,
  17342. * 20.0, 47.0, 10000.0,
  17343. * 19.0, 47.0, 10000.0
  17344. * ])
  17345. * });
  17346. * const geometry = Cesium.WallGeometry.createGeometry(wall);
  17347. * @param options - Object with the following properties:
  17348. * @param options.positions - An array of Cartesian objects, which are the points of the wall.
  17349. * @param [options.granularity = Math.RADIANS_PER_DEGREE] - The distance, in radians, between each latitude and longitude. Determines the number of positions in the buffer.
  17350. * @param [options.maximumHeights] - An array parallel to <code>positions</code> that give the maximum height of the
  17351. * wall at <code>positions</code>. If undefined, the height of each position in used.
  17352. * @param [options.minimumHeights] - An array parallel to <code>positions</code> that give the minimum height of the
  17353. * wall at <code>positions</code>. If undefined, the height at each position is 0.0.
  17354. * @param [options.ellipsoid = Ellipsoid.WGS84] - The ellipsoid for coordinate manipulation
  17355. * @param [options.vertexFormat = VertexFormat.DEFAULT] - The vertex attributes to be computed.
  17356. */
  17357. export class WallGeometry {
  17358. constructor(options: {
  17359. positions: Cartesian3[];
  17360. granularity?: number;
  17361. maximumHeights?: number[];
  17362. minimumHeights?: number[];
  17363. ellipsoid?: Ellipsoid;
  17364. vertexFormat?: VertexFormat;
  17365. });
  17366. /**
  17367. * The number of elements used to pack the object into an array.
  17368. */
  17369. packedLength: number;
  17370. /**
  17371. * Stores the provided instance into the provided array.
  17372. * @param value - The value to pack.
  17373. * @param array - The array to pack into.
  17374. * @param [startingIndex = 0] - The index into the array at which to start packing the elements.
  17375. * @returns The array that was packed into
  17376. */
  17377. static pack(value: WallGeometry, array: number[], startingIndex?: number): number[];
  17378. /**
  17379. * Retrieves an instance from a packed array.
  17380. * @param array - The packed array.
  17381. * @param [startingIndex = 0] - The starting index of the element to be unpacked.
  17382. * @param [result] - The object into which to store the result.
  17383. * @returns The modified result parameter or a new WallGeometry instance if one was not provided.
  17384. */
  17385. static unpack(array: number[], startingIndex?: number, result?: WallGeometry): WallGeometry;
  17386. /**
  17387. * A description of a wall, which is similar to a KML line string. A wall is defined by a series of points,
  17388. * which extrude down to the ground. Optionally, they can extrude downwards to a specified height.
  17389. * @example
  17390. * // create a wall that spans from 10000 meters to 20000 meters
  17391. * const wall = Cesium.WallGeometry.fromConstantHeights({
  17392. * positions : Cesium.Cartesian3.fromDegreesArray([
  17393. * 19.0, 47.0,
  17394. * 19.0, 48.0,
  17395. * 20.0, 48.0,
  17396. * 20.0, 47.0,
  17397. * 19.0, 47.0,
  17398. * ]),
  17399. * minimumHeight : 20000.0,
  17400. * maximumHeight : 10000.0
  17401. * });
  17402. * const geometry = Cesium.WallGeometry.createGeometry(wall);
  17403. * @param options - Object with the following properties:
  17404. * @param options.positions - An array of Cartesian objects, which are the points of the wall.
  17405. * @param [options.maximumHeight] - A constant that defines the maximum height of the
  17406. * wall at <code>positions</code>. If undefined, the height of each position in used.
  17407. * @param [options.minimumHeight] - A constant that defines the minimum height of the
  17408. * wall at <code>positions</code>. If undefined, the height at each position is 0.0.
  17409. * @param [options.ellipsoid = Ellipsoid.WGS84] - The ellipsoid for coordinate manipulation
  17410. * @param [options.vertexFormat = VertexFormat.DEFAULT] - The vertex attributes to be computed.
  17411. */
  17412. static fromConstantHeights(options: {
  17413. positions: Cartesian3[];
  17414. maximumHeight?: number;
  17415. minimumHeight?: number;
  17416. ellipsoid?: Ellipsoid;
  17417. vertexFormat?: VertexFormat;
  17418. }): WallGeometry;
  17419. /**
  17420. * Computes the geometric representation of a wall, including its vertices, indices, and a bounding sphere.
  17421. * @param wallGeometry - A description of the wall.
  17422. * @returns The computed vertices and indices.
  17423. */
  17424. static createGeometry(wallGeometry: WallGeometry): Geometry | undefined;
  17425. }
  17426. /**
  17427. * A description of a wall outline. A wall is defined by a series of points,
  17428. * which extrude down to the ground. Optionally, they can extrude downwards to a specified height.
  17429. * @example
  17430. * // create a wall outline that spans from ground level to 10000 meters
  17431. * const wall = new Cesium.WallOutlineGeometry({
  17432. * positions : Cesium.Cartesian3.fromDegreesArrayHeights([
  17433. * 19.0, 47.0, 10000.0,
  17434. * 19.0, 48.0, 10000.0,
  17435. * 20.0, 48.0, 10000.0,
  17436. * 20.0, 47.0, 10000.0,
  17437. * 19.0, 47.0, 10000.0
  17438. * ])
  17439. * });
  17440. * const geometry = Cesium.WallOutlineGeometry.createGeometry(wall);
  17441. * @param options - Object with the following properties:
  17442. * @param options.positions - An array of Cartesian objects, which are the points of the wall.
  17443. * @param [options.granularity = Math.RADIANS_PER_DEGREE] - The distance, in radians, between each latitude and longitude. Determines the number of positions in the buffer.
  17444. * @param [options.maximumHeights] - An array parallel to <code>positions</code> that give the maximum height of the
  17445. * wall at <code>positions</code>. If undefined, the height of each position in used.
  17446. * @param [options.minimumHeights] - An array parallel to <code>positions</code> that give the minimum height of the
  17447. * wall at <code>positions</code>. If undefined, the height at each position is 0.0.
  17448. * @param [options.ellipsoid = Ellipsoid.WGS84] - The ellipsoid for coordinate manipulation
  17449. */
  17450. export class WallOutlineGeometry {
  17451. constructor(options: {
  17452. positions: Cartesian3[];
  17453. granularity?: number;
  17454. maximumHeights?: number[];
  17455. minimumHeights?: number[];
  17456. ellipsoid?: Ellipsoid;
  17457. });
  17458. /**
  17459. * The number of elements used to pack the object into an array.
  17460. */
  17461. packedLength: number;
  17462. /**
  17463. * Stores the provided instance into the provided array.
  17464. * @param value - The value to pack.
  17465. * @param array - The array to pack into.
  17466. * @param [startingIndex = 0] - The index into the array at which to start packing the elements.
  17467. * @returns The array that was packed into
  17468. */
  17469. static pack(value: WallOutlineGeometry, array: number[], startingIndex?: number): number[];
  17470. /**
  17471. * Retrieves an instance from a packed array.
  17472. * @param array - The packed array.
  17473. * @param [startingIndex = 0] - The starting index of the element to be unpacked.
  17474. * @param [result] - The object into which to store the result.
  17475. * @returns The modified result parameter or a new WallOutlineGeometry instance if one was not provided.
  17476. */
  17477. static unpack(array: number[], startingIndex?: number, result?: WallOutlineGeometry): WallOutlineGeometry;
  17478. /**
  17479. * A description of a walloutline. A wall is defined by a series of points,
  17480. * which extrude down to the ground. Optionally, they can extrude downwards to a specified height.
  17481. * @example
  17482. * // create a wall that spans from 10000 meters to 20000 meters
  17483. * const wall = Cesium.WallOutlineGeometry.fromConstantHeights({
  17484. * positions : Cesium.Cartesian3.fromDegreesArray([
  17485. * 19.0, 47.0,
  17486. * 19.0, 48.0,
  17487. * 20.0, 48.0,
  17488. * 20.0, 47.0,
  17489. * 19.0, 47.0,
  17490. * ]),
  17491. * minimumHeight : 20000.0,
  17492. * maximumHeight : 10000.0
  17493. * });
  17494. * const geometry = Cesium.WallOutlineGeometry.createGeometry(wall);
  17495. * @param options - Object with the following properties:
  17496. * @param options.positions - An array of Cartesian objects, which are the points of the wall.
  17497. * @param [options.maximumHeight] - A constant that defines the maximum height of the
  17498. * wall at <code>positions</code>. If undefined, the height of each position in used.
  17499. * @param [options.minimumHeight] - A constant that defines the minimum height of the
  17500. * wall at <code>positions</code>. If undefined, the height at each position is 0.0.
  17501. * @param [options.ellipsoid = Ellipsoid.WGS84] - The ellipsoid for coordinate manipulation
  17502. */
  17503. static fromConstantHeights(options: {
  17504. positions: Cartesian3[];
  17505. maximumHeight?: number;
  17506. minimumHeight?: number;
  17507. ellipsoid?: Ellipsoid;
  17508. }): WallOutlineGeometry;
  17509. /**
  17510. * Computes the geometric representation of a wall outline, including its vertices, indices, and a bounding sphere.
  17511. * @param wallGeometry - A description of the wall outline.
  17512. * @returns The computed vertices and indices.
  17513. */
  17514. static createGeometry(wallGeometry: WallOutlineGeometry): Geometry | undefined;
  17515. }
  17516. /**
  17517. * The map projection used by Google Maps, Bing Maps, and most of ArcGIS Online, EPSG:3857. This
  17518. * projection use longitude and latitude expressed with the WGS84 and transforms them to Mercator using
  17519. * the spherical (rather than ellipsoidal) equations.
  17520. * @param [ellipsoid = Ellipsoid.WGS84] - The ellipsoid.
  17521. */
  17522. export class WebMercatorProjection {
  17523. constructor(ellipsoid?: Ellipsoid);
  17524. /**
  17525. * Gets the {@link Ellipsoid}.
  17526. */
  17527. readonly ellipsoid: Ellipsoid;
  17528. /**
  17529. * Converts a Mercator angle, in the range -PI to PI, to a geodetic latitude
  17530. * in the range -PI/2 to PI/2.
  17531. * @param mercatorAngle - The angle to convert.
  17532. * @returns The geodetic latitude in radians.
  17533. */
  17534. static mercatorAngleToGeodeticLatitude(mercatorAngle: number): number;
  17535. /**
  17536. * Converts a geodetic latitude in radians, in the range -PI/2 to PI/2, to a Mercator
  17537. * angle in the range -PI to PI.
  17538. * @param latitude - The geodetic latitude in radians.
  17539. * @returns The Mercator angle.
  17540. */
  17541. static geodeticLatitudeToMercatorAngle(latitude: number): number;
  17542. /**
  17543. * The maximum latitude (both North and South) supported by a Web Mercator
  17544. * (EPSG:3857) projection. Technically, the Mercator projection is defined
  17545. * for any latitude up to (but not including) 90 degrees, but it makes sense
  17546. * to cut it off sooner because it grows exponentially with increasing latitude.
  17547. * The logic behind this particular cutoff value, which is the one used by
  17548. * Google Maps, Bing Maps, and Esri, is that it makes the projection
  17549. * square. That is, the rectangle is equal in the X and Y directions.
  17550. *
  17551. * The constant value is computed by calling:
  17552. * WebMercatorProjection.mercatorAngleToGeodeticLatitude(Math.PI)
  17553. */
  17554. static MaximumLatitude: number;
  17555. /**
  17556. * Converts geodetic ellipsoid coordinates, in radians, to the equivalent Web Mercator
  17557. * X, Y, Z coordinates expressed in meters and returned in a {@link Cartesian3}. The height
  17558. * is copied unmodified to the Z coordinate.
  17559. * @param cartographic - The cartographic coordinates in radians.
  17560. * @param [result] - The instance to which to copy the result, or undefined if a
  17561. * new instance should be created.
  17562. * @returns The equivalent web mercator X, Y, Z coordinates, in meters.
  17563. */
  17564. project(cartographic: Cartographic, result?: Cartesian3): Cartesian3;
  17565. /**
  17566. * Converts Web Mercator X, Y coordinates, expressed in meters, to a {@link Cartographic}
  17567. * containing geodetic ellipsoid coordinates. The Z coordinate is copied unmodified to the
  17568. * height.
  17569. * @param cartesian - The web mercator Cartesian position to unrproject with height (z) in meters.
  17570. * @param [result] - The instance to which to copy the result, or undefined if a
  17571. * new instance should be created.
  17572. * @returns The equivalent cartographic coordinates.
  17573. */
  17574. unproject(cartesian: Cartesian3, result?: Cartographic): Cartographic;
  17575. }
  17576. /**
  17577. * A tiling scheme for geometry referenced to a {@link WebMercatorProjection}, EPSG:3857. This is
  17578. * the tiling scheme used by Google Maps, Microsoft Bing Maps, and most of ESRI ArcGIS Online.
  17579. * @param [options] - Object with the following properties:
  17580. * @param [options.ellipsoid = Ellipsoid.WGS84] - The ellipsoid whose surface is being tiled. Defaults to
  17581. * the WGS84 ellipsoid.
  17582. * @param [options.numberOfLevelZeroTilesX = 1] - The number of tiles in the X direction at level zero of
  17583. * the tile tree.
  17584. * @param [options.numberOfLevelZeroTilesY = 1] - The number of tiles in the Y direction at level zero of
  17585. * the tile tree.
  17586. * @param [options.rectangleSouthwestInMeters] - The southwest corner of the rectangle covered by the
  17587. * tiling scheme, in meters. If this parameter or rectangleNortheastInMeters is not specified, the entire
  17588. * globe is covered in the longitude direction and an equal distance is covered in the latitude
  17589. * direction, resulting in a square projection.
  17590. * @param [options.rectangleNortheastInMeters] - The northeast corner of the rectangle covered by the
  17591. * tiling scheme, in meters. If this parameter or rectangleSouthwestInMeters is not specified, the entire
  17592. * globe is covered in the longitude direction and an equal distance is covered in the latitude
  17593. * direction, resulting in a square projection.
  17594. */
  17595. export class WebMercatorTilingScheme {
  17596. constructor(options?: {
  17597. ellipsoid?: Ellipsoid;
  17598. numberOfLevelZeroTilesX?: number;
  17599. numberOfLevelZeroTilesY?: number;
  17600. rectangleSouthwestInMeters?: Cartesian2;
  17601. rectangleNortheastInMeters?: Cartesian2;
  17602. });
  17603. /**
  17604. * Gets the ellipsoid that is tiled by this tiling scheme.
  17605. */
  17606. ellipsoid: Ellipsoid;
  17607. /**
  17608. * Gets the rectangle, in radians, covered by this tiling scheme.
  17609. */
  17610. rectangle: Rectangle;
  17611. /**
  17612. * Gets the map projection used by this tiling scheme.
  17613. */
  17614. projection: MapProjection;
  17615. /**
  17616. * Gets the total number of tiles in the X direction at a specified level-of-detail.
  17617. * @param level - The level-of-detail.
  17618. * @returns The number of tiles in the X direction at the given level.
  17619. */
  17620. getNumberOfXTilesAtLevel(level: number): number;
  17621. /**
  17622. * Gets the total number of tiles in the Y direction at a specified level-of-detail.
  17623. * @param level - The level-of-detail.
  17624. * @returns The number of tiles in the Y direction at the given level.
  17625. */
  17626. getNumberOfYTilesAtLevel(level: number): number;
  17627. /**
  17628. * Transforms a rectangle specified in geodetic radians to the native coordinate system
  17629. * of this tiling scheme.
  17630. * @param rectangle - The rectangle to transform.
  17631. * @param [result] - The instance to which to copy the result, or undefined if a new instance
  17632. * should be created.
  17633. * @returns The specified 'result', or a new object containing the native rectangle if 'result'
  17634. * is undefined.
  17635. */
  17636. rectangleToNativeRectangle(rectangle: Rectangle, result?: Rectangle): Rectangle;
  17637. /**
  17638. * Converts tile x, y coordinates and level to a rectangle expressed in the native coordinates
  17639. * of the tiling scheme.
  17640. * @param x - The integer x coordinate of the tile.
  17641. * @param y - The integer y coordinate of the tile.
  17642. * @param level - The tile level-of-detail. Zero is the least detailed.
  17643. * @param [result] - The instance to which to copy the result, or undefined if a new instance
  17644. * should be created.
  17645. * @returns The specified 'result', or a new object containing the rectangle
  17646. * if 'result' is undefined.
  17647. */
  17648. tileXYToNativeRectangle(x: number, y: number, level: number, result?: any): Rectangle;
  17649. /**
  17650. * Converts tile x, y coordinates and level to a cartographic rectangle in radians.
  17651. * @param x - The integer x coordinate of the tile.
  17652. * @param y - The integer y coordinate of the tile.
  17653. * @param level - The tile level-of-detail. Zero is the least detailed.
  17654. * @param [result] - The instance to which to copy the result, or undefined if a new instance
  17655. * should be created.
  17656. * @returns The specified 'result', or a new object containing the rectangle
  17657. * if 'result' is undefined.
  17658. */
  17659. tileXYToRectangle(x: number, y: number, level: number, result?: any): Rectangle;
  17660. /**
  17661. * Calculates the tile x, y coordinates of the tile containing
  17662. * a given cartographic position.
  17663. * @param position - The position.
  17664. * @param level - The tile level-of-detail. Zero is the least detailed.
  17665. * @param [result] - The instance to which to copy the result, or undefined if a new instance
  17666. * should be created.
  17667. * @returns The specified 'result', or a new object containing the tile x, y coordinates
  17668. * if 'result' is undefined.
  17669. */
  17670. positionToTileXY(position: Cartographic, level: number, result?: Cartesian2): Cartesian2;
  17671. }
  17672. /**
  17673. * Winding order defines the order of vertices for a triangle to be considered front-facing.
  17674. */
  17675. export enum WindingOrder {
  17676. /**
  17677. * Vertices are in clockwise order.
  17678. */
  17679. CLOCKWISE = WebGLConstants.CW,
  17680. /**
  17681. * Vertices are in counter-clockwise order.
  17682. */
  17683. COUNTER_CLOCKWISE = WebGLConstants.CCW
  17684. }
  17685. /**
  17686. * Computes the barycentric coordinates for a point with respect to a triangle.
  17687. * @example
  17688. * // Returns Cartesian3.UNIT_X
  17689. * const p = new Cesium.Cartesian3(-1.0, 0.0, 0.0);
  17690. * const b = Cesium.barycentricCoordinates(p,
  17691. * new Cesium.Cartesian3(-1.0, 0.0, 0.0),
  17692. * new Cesium.Cartesian3( 1.0, 0.0, 0.0),
  17693. * new Cesium.Cartesian3( 0.0, 1.0, 1.0));
  17694. * @param point - The point to test.
  17695. * @param p0 - The first point of the triangle, corresponding to the barycentric x-axis.
  17696. * @param p1 - The second point of the triangle, corresponding to the barycentric y-axis.
  17697. * @param p2 - The third point of the triangle, corresponding to the barycentric z-axis.
  17698. * @param [result] - The object onto which to store the result.
  17699. * @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.
  17700. */
  17701. export function barycentricCoordinates(point: Cartesian2 | Cartesian3, p0: Cartesian2 | Cartesian3, p1: Cartesian2 | Cartesian3, p2: Cartesian2 | Cartesian3, result?: Cartesian3): Cartesian3 | undefined;
  17702. /**
  17703. * Finds an item in a sorted array.
  17704. * @example
  17705. * // Create a comparator function to search through an array of numbers.
  17706. * function comparator(a, b) {
  17707. * return a - b;
  17708. * };
  17709. * const numbers = [0, 2, 4, 6, 8];
  17710. * const index = Cesium.binarySearch(numbers, 6, comparator); // 3
  17711. * @param array - The sorted array to search.
  17712. * @param itemToFind - The item to find in the array.
  17713. * @param comparator - The function to use to compare the item to
  17714. * elements in the array.
  17715. * @returns The index of <code>itemToFind</code> in the array, if it exists. If <code>itemToFind</code>
  17716. * does not exist, the return value is a negative number which is the bitwise complement (~)
  17717. * of the index before which the itemToFind should be inserted in order to maintain the
  17718. * sorted order of the array.
  17719. */
  17720. export function binarySearch(array: any[], itemToFind: any, comparator: binarySearchComparator): number;
  17721. /**
  17722. * A function used to compare two items while performing a binary search.
  17723. * @example
  17724. * function compareNumbers(a, b) {
  17725. * return a - b;
  17726. * }
  17727. * @param a - An item in the array.
  17728. * @param b - The item being searched for.
  17729. */
  17730. export type binarySearchComparator = (a: any, b: any) => number;
  17731. /**
  17732. * Given a relative URL under the Cesium base URL, returns an absolute URL.
  17733. * @example
  17734. * const viewer = new Cesium.Viewer("cesiumContainer", {
  17735. * imageryProvider: new Cesium.TileMapServiceImageryProvider({
  17736. * url: Cesium.buildModuleUrl("Assets/Textures/NaturalEarthII"),
  17737. * }),
  17738. * baseLayerPicker: false,
  17739. * });
  17740. * @param relativeUrl - The relative path.
  17741. * @returns The absolutely URL representation of the provided path.
  17742. */
  17743. export function buildModuleUrl(relativeUrl: string): string;
  17744. /**
  17745. * A browser-independent function to cancel an animation frame requested using {@link requestAnimationFrame}.
  17746. * @param requestID - The value returned by {@link requestAnimationFrame}.
  17747. */
  17748. export function cancelAnimationFrame(requestID: number): void;
  17749. /**
  17750. * Clones an object, returning a new object containing the same properties.
  17751. * @param object - The object to clone.
  17752. * @param [deep = false] - If true, all properties will be deep cloned recursively.
  17753. * @returns The cloned object.
  17754. */
  17755. export function clone(object: any, deep?: boolean): any;
  17756. /**
  17757. * Merges two objects, copying their properties onto a new combined object. When two objects have the same
  17758. * property, the value of the property on the first object is used. If either object is undefined,
  17759. * it will be treated as an empty object.
  17760. * @example
  17761. * const object1 = {
  17762. * propOne : 1,
  17763. * propTwo : {
  17764. * value1 : 10
  17765. * }
  17766. * }
  17767. * const object2 = {
  17768. * propTwo : 2
  17769. * }
  17770. * const final = Cesium.combine(object1, object2);
  17771. *
  17772. * // final === {
  17773. * // propOne : 1,
  17774. * // propTwo : {
  17775. * // value1 : 10
  17776. * // }
  17777. * // }
  17778. * @param [object1] - The first object to merge.
  17779. * @param [object2] - The second object to merge.
  17780. * @param [deep = false] - Perform a recursive merge.
  17781. * @returns The combined object containing all properties from both objects.
  17782. */
  17783. export function combine(object1?: any, object2?: any, deep?: boolean): any;
  17784. /**
  17785. * Creates a Globally unique identifier (GUID) string. A GUID is 128 bits long, and can guarantee uniqueness across space and time.
  17786. * @example
  17787. * this.guid = Cesium.createGuid();
  17788. */
  17789. export function createGuid(): string;
  17790. /**
  17791. * Creates a {@link CesiumTerrainProvider} instance for the {@link https://cesium.com/content/#cesium-world-terrain|Cesium World Terrain}.
  17792. * @example
  17793. * // Create Cesium World Terrain with default settings
  17794. * const viewer = new Cesium.Viewer('cesiumContainer', {
  17795. * terrainProvider : Cesium.createWorldTerrain();
  17796. * });
  17797. * @example
  17798. * // Create Cesium World Terrain with water and normals.
  17799. * const viewer1 = new Cesium.Viewer('cesiumContainer', {
  17800. * terrainProvider : Cesium.createWorldTerrain({
  17801. * requestWaterMask : true,
  17802. * requestVertexNormals : true
  17803. * });
  17804. * });
  17805. * @param [options] - Object with the following properties:
  17806. * @param [options.requestVertexNormals = false] - Flag that indicates if the client should request additional lighting information from the server if available.
  17807. * @param [options.requestWaterMask = false] - Flag that indicates if the client should request per tile water masks from the server if available.
  17808. */
  17809. export function createWorldTerrain(options?: {
  17810. requestVertexNormals?: boolean;
  17811. requestWaterMask?: boolean;
  17812. }): CesiumTerrainProvider;
  17813. /**
  17814. * Returns the first parameter if not undefined, otherwise the second parameter.
  17815. * Useful for setting a default value for a parameter.
  17816. * @example
  17817. * param = Cesium.defaultValue(param, 'default');
  17818. * @returns Returns the first parameter if not undefined, otherwise the second parameter.
  17819. */
  17820. export function defaultValue(a: any, b: any): any;
  17821. /**
  17822. * @example
  17823. * if (Cesium.defined(positions)) {
  17824. * doSomething();
  17825. * } else {
  17826. * doSomethingElse();
  17827. * }
  17828. * @param value - The object.
  17829. * @returns Returns true if the object is defined, returns false otherwise.
  17830. */
  17831. export function defined(value: any): boolean;
  17832. /**
  17833. * Destroys an object. Each of the object's functions, including functions in its prototype,
  17834. * is replaced with a function that throws a {@link DeveloperError}, except for the object's
  17835. * <code>isDestroyed</code> function, which is set to a function that returns <code>true</code>.
  17836. * The object's properties are removed with <code>delete</code>.
  17837. * <br /><br />
  17838. * This function is used by objects that hold native resources, e.g., WebGL resources, which
  17839. * need to be explicitly released. Client code calls an object's <code>destroy</code> function,
  17840. * which then releases the native resource and calls <code>destroyObject</code> to put itself
  17841. * in a destroyed state.
  17842. * @example
  17843. * // How a texture would destroy itself.
  17844. * this.destroy = function () {
  17845. * _gl.deleteTexture(_texture);
  17846. * return Cesium.destroyObject(this);
  17847. * };
  17848. * @param object - The object to destroy.
  17849. * @param [message] - The message to include in the exception that is thrown if
  17850. * a destroyed object's function is called.
  17851. */
  17852. export function destroyObject(object: any, message?: string): void;
  17853. /**
  17854. * Formats an error object into a String. If available, uses name, message, and stack
  17855. * properties, otherwise, falls back on toString().
  17856. * @param object - The item to find in the array.
  17857. * @returns A string containing the formatted error.
  17858. */
  17859. export function formatError(object: any): string;
  17860. /**
  17861. * Given a relative Uri and a base Uri, returns the absolute Uri of the relative Uri.
  17862. * @example
  17863. * //absolute Uri will be "https://test.com/awesome.png";
  17864. * const absoluteUri = Cesium.getAbsoluteUri('awesome.png', 'https://test.com');
  17865. * @param relative - The relative Uri.
  17866. * @param [base] - The base Uri.
  17867. * @returns The absolute Uri of the given relative Uri.
  17868. */
  17869. export function getAbsoluteUri(relative: string, base?: string): string;
  17870. /**
  17871. * Given a URI, returns the base path of the URI.
  17872. * @example
  17873. * // basePath will be "/Gallery/";
  17874. * const basePath = Cesium.getBaseUri('/Gallery/simple.czml?value=true&example=false');
  17875. *
  17876. * // basePath will be "/Gallery/?value=true&example=false";
  17877. * const basePath = Cesium.getBaseUri('/Gallery/simple.czml?value=true&example=false', true);
  17878. * @param uri - The Uri.
  17879. * @param [includeQuery = false] - Whether or not to include the query string and fragment form the uri
  17880. * @returns The base path of the Uri.
  17881. */
  17882. export function getBaseUri(uri: string, includeQuery?: boolean): string;
  17883. /**
  17884. * Given a URI, returns the extension of the URI.
  17885. * @example
  17886. * //extension will be "czml";
  17887. * const extension = Cesium.getExtensionFromUri('/Gallery/simple.czml?value=true&example=false');
  17888. * @param uri - The Uri.
  17889. * @returns The extension of the Uri.
  17890. */
  17891. export function getExtensionFromUri(uri: string): string;
  17892. /**
  17893. * Given a URI, returns the last segment of the URI, removing any path or query information.
  17894. * @example
  17895. * //fileName will be"simple.czml";
  17896. * const fileName = Cesium.getFilenameFromUri('/Gallery/simple.czml?value=true&example=false');
  17897. * @param uri - The Uri.
  17898. * @returns The last segment of the Uri.
  17899. */
  17900. export function getFilenameFromUri(uri: string): string;
  17901. /**
  17902. * Extract a pixel array from a loaded image. Draws the image
  17903. * into a canvas so it can read the pixels back.
  17904. * @param image - The image to extract pixels from.
  17905. * @param width - The width of the image. If not defined, then image.width is assigned.
  17906. * @param height - The height of the image. If not defined, then image.height is assigned.
  17907. * @returns The pixels of the image.
  17908. */
  17909. export function getImagePixels(image: HTMLImageElement | ImageBitmap, width: number, height: number): ImageData;
  17910. /**
  17911. * Gets a timestamp that can be used in measuring the time between events. Timestamps
  17912. * are expressed in milliseconds, but it is not specified what the milliseconds are
  17913. * measured from. This function uses performance.now() if it is available, or Date.now()
  17914. * otherwise.
  17915. * @returns The timestamp in milliseconds since some unspecified reference time.
  17916. */
  17917. export function getTimestamp(): number;
  17918. /**
  17919. * Determines if a given date is a leap year.
  17920. * @example
  17921. * const leapYear = Cesium.isLeapYear(2000); // true
  17922. * @param year - The year to be tested.
  17923. * @returns True if <code>year</code> is a leap year.
  17924. */
  17925. export function isLeapYear(year: number): boolean;
  17926. /**
  17927. * A stable merge sort.
  17928. * @example
  17929. * // Assume array contains BoundingSpheres in world coordinates.
  17930. * // Sort them in ascending order of distance from the camera.
  17931. * const position = camera.positionWC;
  17932. * Cesium.mergeSort(array, function(a, b, position) {
  17933. * return Cesium.BoundingSphere.distanceSquaredTo(b, position) - Cesium.BoundingSphere.distanceSquaredTo(a, position);
  17934. * }, position);
  17935. * @param array - The array to sort.
  17936. * @param comparator - The function to use to compare elements in the array.
  17937. * @param [userDefinedObject] - Any item to pass as the third parameter to <code>comparator</code>.
  17938. */
  17939. export function mergeSort(array: any[], comparator: mergeSortComparator, userDefinedObject?: any): void;
  17940. /**
  17941. * A function used to compare two items while performing a merge sort.
  17942. * @example
  17943. * function compareNumbers(a, b, userDefinedObject) {
  17944. * return a - b;
  17945. * }
  17946. * @param a - An item in the array.
  17947. * @param b - An item in the array.
  17948. * @param [userDefinedObject] - An object that was passed to {@link mergeSort}.
  17949. */
  17950. export type mergeSortComparator = (a: any, b: any, userDefinedObject?: any) => number;
  17951. /**
  17952. * Converts an object representing a set of name/value pairs into a query string,
  17953. * with names and values encoded properly for use in a URL. Values that are arrays
  17954. * will produce multiple values with the same name.
  17955. * @example
  17956. * const str = Cesium.objectToQuery({
  17957. * key1 : 'some value',
  17958. * key2 : 'a/b',
  17959. * key3 : ['x', 'y']
  17960. * });
  17961. * @param obj - The object containing data to encode.
  17962. * @returns An encoded query string.
  17963. */
  17964. export function objectToQuery(obj: any): string;
  17965. /**
  17966. * Determines if a point is inside a triangle.
  17967. * @example
  17968. * // Returns true
  17969. * const p = new Cesium.Cartesian2(0.25, 0.25);
  17970. * const b = Cesium.pointInsideTriangle(p,
  17971. * new Cesium.Cartesian2(0.0, 0.0),
  17972. * new Cesium.Cartesian2(1.0, 0.0),
  17973. * new Cesium.Cartesian2(0.0, 1.0));
  17974. * @param point - The point to test.
  17975. * @param p0 - The first point of the triangle.
  17976. * @param p1 - The second point of the triangle.
  17977. * @param p2 - The third point of the triangle.
  17978. * @returns <code>true</code> if the point is inside the triangle; otherwise, <code>false</code>.
  17979. */
  17980. export function pointInsideTriangle(point: Cartesian2 | Cartesian3, p0: Cartesian2 | Cartesian3, p1: Cartesian2 | Cartesian3, p2: Cartesian2 | Cartesian3): boolean;
  17981. /**
  17982. * Parses a query string into an object, where the keys and values of the object are the
  17983. * name/value pairs from the query string, decoded. If a name appears multiple times,
  17984. * the value in the object will be an array of values.
  17985. * @example
  17986. * const obj = Cesium.queryToObject('key1=some%20value&key2=a%2Fb&key3=x&key3=y');
  17987. * // obj will be:
  17988. * // {
  17989. * // key1 : 'some value',
  17990. * // key2 : 'a/b',
  17991. * // key3 : ['x', 'y']
  17992. * // }
  17993. * @param queryString - The query string.
  17994. * @returns An object containing the parameters parsed from the query string.
  17995. */
  17996. export function queryToObject(queryString: string): any;
  17997. /**
  17998. * A browser-independent function to request a new animation frame. This is used to create
  17999. * an application's draw loop as shown in the example below.
  18000. * @example
  18001. * // Create a draw loop using requestAnimationFrame. The
  18002. * // tick callback function is called for every animation frame.
  18003. * function tick() {
  18004. * scene.render();
  18005. * Cesium.requestAnimationFrame(tick);
  18006. * }
  18007. * tick();
  18008. * @param callback - The function to call when the next frame should be drawn.
  18009. * @returns An ID that can be passed to {@link cancelAnimationFrame} to cancel the request.
  18010. */
  18011. export function requestAnimationFrame(callback: requestAnimationFrameCallback): number;
  18012. /**
  18013. * A function that will be called when the next frame should be drawn.
  18014. * @param timestamp - A timestamp for the frame, in milliseconds.
  18015. */
  18016. export type requestAnimationFrameCallback = (timestamp: number) => void;
  18017. /**
  18018. * Initiates a terrain height query for an array of {@link Cartographic} positions by
  18019. * requesting tiles from a terrain provider, sampling, and interpolating. The interpolation
  18020. * matches the triangles used to render the terrain at the specified level. The query
  18021. * happens asynchronously, so this function returns a promise that is resolved when
  18022. * the query completes. Each point height is modified in place. If a height can not be
  18023. * determined because no terrain data is available for the specified level at that location,
  18024. * or another error occurs, the height is set to undefined. As is typical of the
  18025. * {@link Cartographic} type, the supplied height is a height above the reference ellipsoid
  18026. * (such as {@link Ellipsoid.WGS84}) rather than an altitude above mean sea level. In other
  18027. * words, it will not necessarily be 0.0 if sampled in the ocean. This function needs the
  18028. * terrain level of detail as input, if you need to get the altitude of the terrain as precisely
  18029. * as possible (i.e. with maximum level of detail) use {@link sampleTerrainMostDetailed}.
  18030. * @example
  18031. * // Query the terrain height of two Cartographic positions
  18032. * const terrainProvider = Cesium.createWorldTerrain();
  18033. * const positions = [
  18034. * Cesium.Cartographic.fromDegrees(86.925145, 27.988257),
  18035. * Cesium.Cartographic.fromDegrees(87.0, 28.0)
  18036. * ];
  18037. * const promise = Cesium.sampleTerrain(terrainProvider, 11, positions);
  18038. * Promise.resolve(promise).then(function(updatedPositions) {
  18039. * // positions[0].height and positions[1].height have been updated.
  18040. * // updatedPositions is just a reference to positions.
  18041. * });
  18042. * @param terrainProvider - The terrain provider from which to query heights.
  18043. * @param level - The terrain level-of-detail from which to query terrain heights.
  18044. * @param positions - The positions to update with terrain heights.
  18045. * @returns A promise that resolves to the provided list of positions when terrain the query has completed.
  18046. */
  18047. export function sampleTerrain(terrainProvider: TerrainProvider, level: number, positions: Cartographic[]): Promise<Cartographic[]>;
  18048. /**
  18049. * Initiates a sampleTerrain() request at the maximum available tile level for a terrain dataset.
  18050. * @example
  18051. * // Query the terrain height of two Cartographic positions
  18052. * const terrainProvider = Cesium.createWorldTerrain();
  18053. * const positions = [
  18054. * Cesium.Cartographic.fromDegrees(86.925145, 27.988257),
  18055. * Cesium.Cartographic.fromDegrees(87.0, 28.0)
  18056. * ];
  18057. * const promise = Cesium.sampleTerrainMostDetailed(terrainProvider, positions);
  18058. * Promise.resolve(promise).then(function(updatedPositions) {
  18059. * // positions[0].height and positions[1].height have been updated.
  18060. * // updatedPositions is just a reference to positions.
  18061. * });
  18062. * @param terrainProvider - The terrain provider from which to query heights.
  18063. * @param positions - The positions to update with terrain heights.
  18064. * @returns A promise that resolves to the provided list of positions when terrain the query has completed. This
  18065. * promise will reject if the terrain provider's `availability` property is undefined.
  18066. */
  18067. export function sampleTerrainMostDetailed(terrainProvider: TerrainProvider, positions: Cartographic[]): Promise<Cartographic[]>;
  18068. /**
  18069. * Subdivides an array into a number of smaller, equal sized arrays.
  18070. * @param array - The array to divide.
  18071. * @param numberOfArrays - The number of arrays to divide the provided array into.
  18072. */
  18073. export function subdivideArray(array: any[], numberOfArrays: number): void;
  18074. /**
  18075. * Writes the given text into a new canvas. The canvas will be sized to fit the text.
  18076. * If text is blank, returns undefined.
  18077. * @param text - The text to write.
  18078. * @param [options] - Object with the following properties:
  18079. * @param [options.font = '10px sans-serif'] - The CSS font to use.
  18080. * @param [options.textBaseline = 'bottom'] - The baseline of the text.
  18081. * @param [options.fill = true] - Whether to fill the text.
  18082. * @param [options.stroke = false] - Whether to stroke the text.
  18083. * @param [options.fillColor = Color.WHITE] - The fill color.
  18084. * @param [options.strokeColor = Color.BLACK] - The stroke color.
  18085. * @param [options.strokeWidth = 1] - The stroke width.
  18086. * @param [options.backgroundColor = Color.TRANSPARENT] - The background color of the canvas.
  18087. * @param [options.padding = 0] - The pixel size of the padding to add around the text.
  18088. * @returns A new canvas with the given text drawn into it. The dimensions object
  18089. * from measureText will also be added to the returned canvas. If text is
  18090. * blank, returns undefined.
  18091. */
  18092. export function writeTextToCanvas(text: string, options?: {
  18093. font?: string;
  18094. textBaseline?: string;
  18095. fill?: boolean;
  18096. stroke?: boolean;
  18097. fillColor?: Color;
  18098. strokeColor?: Color;
  18099. strokeWidth?: number;
  18100. backgroundColor?: Color;
  18101. padding?: number;
  18102. }): HTMLCanvasElement | undefined;
  18103. export namespace BillboardGraphics {
  18104. /**
  18105. * Initialization options for the BillboardGraphics constructor
  18106. * @property [show = true] - A boolean Property specifying the visibility of the billboard.
  18107. * @property [image] - A Property specifying the Image, URI, or Canvas to use for the billboard.
  18108. * @property [scale = 1.0] - A numeric Property specifying the scale to apply to the image size.
  18109. * @property [pixelOffset = Cartesian2.ZERO] - A {@link Cartesian2} Property specifying the pixel offset.
  18110. * @property [eyeOffset = Cartesian3.ZERO] - A {@link Cartesian3} Property specifying the eye offset.
  18111. * @property [horizontalOrigin = HorizontalOrigin.CENTER] - A Property specifying the {@link HorizontalOrigin}.
  18112. * @property [verticalOrigin = VerticalOrigin.CENTER] - A Property specifying the {@link VerticalOrigin}.
  18113. * @property [heightReference = HeightReference.NONE] - A Property specifying what the height is relative to.
  18114. * @property [color = Color.WHITE] - A Property specifying the tint {@link Color} of the image.
  18115. * @property [rotation = 0] - A numeric Property specifying the rotation about the alignedAxis.
  18116. * @property [alignedAxis = Cartesian3.ZERO] - A {@link Cartesian3} Property specifying the unit vector axis of rotation.
  18117. * @property [sizeInMeters] - A boolean Property specifying whether this billboard's size should be measured in meters.
  18118. * @property [width] - A numeric Property specifying the width of the billboard in pixels, overriding the native size.
  18119. * @property [height] - A numeric Property specifying the height of the billboard in pixels, overriding the native size.
  18120. * @property [scaleByDistance] - A {@link NearFarScalar} Property used to scale the point based on distance from the camera.
  18121. * @property [translucencyByDistance] - A {@link NearFarScalar} Property used to set translucency based on distance from the camera.
  18122. * @property [pixelOffsetScaleByDistance] - A {@link NearFarScalar} Property used to set pixelOffset based on distance from the camera.
  18123. * @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.
  18124. * @property [distanceDisplayCondition] - A Property specifying at what distance from the camera that this billboard will be displayed.
  18125. * @property [disableDepthTestDistance] - A Property specifying the distance from the camera at which to disable the depth test to.
  18126. */
  18127. type ConstructorOptions = {
  18128. show?: Property | boolean;
  18129. image?: Property | string | HTMLCanvasElement;
  18130. scale?: Property | number;
  18131. pixelOffset?: Property | Cartesian2;
  18132. eyeOffset?: Property | Cartesian3;
  18133. horizontalOrigin?: Property | HorizontalOrigin;
  18134. verticalOrigin?: Property | VerticalOrigin;
  18135. heightReference?: Property | HeightReference;
  18136. color?: Property | Color;
  18137. rotation?: Property | number;
  18138. alignedAxis?: Property | Cartesian3;
  18139. sizeInMeters?: Property | boolean;
  18140. width?: Property | number;
  18141. height?: Property | number;
  18142. scaleByDistance?: Property | NearFarScalar;
  18143. translucencyByDistance?: Property | NearFarScalar;
  18144. pixelOffsetScaleByDistance?: Property | NearFarScalar;
  18145. imageSubRegion?: Property | BoundingRectangle;
  18146. distanceDisplayCondition?: Property | DistanceDisplayCondition;
  18147. disableDepthTestDistance?: Property | number;
  18148. };
  18149. }
  18150. /**
  18151. * Describes a two dimensional icon located at the position of the containing {@link Entity}.
  18152. * <p>
  18153. * <div align='center'>
  18154. * <img src='Images/Billboard.png' width='400' height='300' /><br />
  18155. * Example billboards
  18156. * </div>
  18157. * </p>
  18158. * @param [options] - Object describing initialization options
  18159. */
  18160. export class BillboardGraphics {
  18161. constructor(options?: BillboardGraphics.ConstructorOptions);
  18162. /**
  18163. * Gets the event that is raised whenever a property or sub-property is changed or modified.
  18164. */
  18165. readonly definitionChanged: Event;
  18166. /**
  18167. * Gets or sets the boolean Property specifying the visibility of the billboard.
  18168. */
  18169. show: Property | undefined;
  18170. /**
  18171. * Gets or sets the Property specifying the Image, URI, or Canvas to use for the billboard.
  18172. */
  18173. image: Property | undefined;
  18174. /**
  18175. * Gets or sets the numeric Property specifying the uniform scale to apply to the image.
  18176. * A scale greater than <code>1.0</code> enlarges the billboard while a scale less than <code>1.0</code> shrinks it.
  18177. * <p>
  18178. * <div align='center'>
  18179. * <img src='Images/Billboard.setScale.png' width='400' height='300' /><br/>
  18180. * From left to right in the above image, the scales are <code>0.5</code>, <code>1.0</code>, and <code>2.0</code>.
  18181. * </div>
  18182. * </p>
  18183. */
  18184. scale: Property | undefined;
  18185. /**
  18186. * Gets or sets the {@link Cartesian2} Property specifying the billboard's pixel offset in screen space
  18187. * from the origin of this billboard. This is commonly used to align multiple billboards and labels at
  18188. * the same position, e.g., an image and text. The screen space origin is the top, left corner of the
  18189. * canvas; <code>x</code> increases from left to right, and <code>y</code> increases from top to bottom.
  18190. * <p>
  18191. * <div align='center'>
  18192. * <table border='0' cellpadding='5'><tr>
  18193. * <td align='center'><code>default</code><br/><img src='Images/Billboard.setPixelOffset.default.png' width='250' height='188' /></td>
  18194. * <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>
  18195. * </tr></table>
  18196. * The billboard's origin is indicated by the yellow point.
  18197. * </div>
  18198. * </p>
  18199. */
  18200. pixelOffset: Property | undefined;
  18201. /**
  18202. * Gets or sets the {@link Cartesian3} Property specifying the billboard's offset in eye coordinates.
  18203. * Eye coordinates is a left-handed coordinate system, where <code>x</code> points towards the viewer's
  18204. * right, <code>y</code> points up, and <code>z</code> points into the screen.
  18205. * <p>
  18206. * An eye offset is commonly used to arrange multiple billboards or objects at the same position, e.g., to
  18207. * arrange a billboard above its corresponding 3D model.
  18208. * </p>
  18209. * Below, the billboard is positioned at the center of the Earth but an eye offset makes it always
  18210. * appear on top of the Earth regardless of the viewer's or Earth's orientation.
  18211. * <p>
  18212. * <div align='center'>
  18213. * <table border='0' cellpadding='5'><tr>
  18214. * <td align='center'><img src='Images/Billboard.setEyeOffset.one.png' width='250' height='188' /></td>
  18215. * <td align='center'><img src='Images/Billboard.setEyeOffset.two.png' width='250' height='188' /></td>
  18216. * </tr></table>
  18217. * <code>b.eyeOffset = new Cartesian3(0.0, 8000000.0, 0.0);</code>
  18218. * </div>
  18219. * </p>
  18220. */
  18221. eyeOffset: Property | undefined;
  18222. /**
  18223. * Gets or sets the Property specifying the {@link HorizontalOrigin}.
  18224. */
  18225. horizontalOrigin: Property | undefined;
  18226. /**
  18227. * Gets or sets the Property specifying the {@link VerticalOrigin}.
  18228. */
  18229. verticalOrigin: Property | undefined;
  18230. /**
  18231. * Gets or sets the Property specifying the {@link HeightReference}.
  18232. */
  18233. heightReference: Property | undefined;
  18234. /**
  18235. * Gets or sets the Property specifying the {@link Color} that is multiplied with the <code>image</code>.
  18236. * This has two common use cases. First, the same white texture may be used by many different billboards,
  18237. * each with a different color, to create colored billboards. Second, the color's alpha component can be
  18238. * used to make the billboard translucent as shown below. An alpha of <code>0.0</code> makes the billboard
  18239. * transparent, and <code>1.0</code> makes the billboard opaque.
  18240. * <p>
  18241. * <div align='center'>
  18242. * <table border='0' cellpadding='5'><tr>
  18243. * <td align='center'><code>default</code><br/><img src='Images/Billboard.setColor.Alpha255.png' width='250' height='188' /></td>
  18244. * <td align='center'><code>alpha : 0.5</code><br/><img src='Images/Billboard.setColor.Alpha127.png' width='250' height='188' /></td>
  18245. * </tr></table>
  18246. * </div>
  18247. * </p>
  18248. */
  18249. color: Property | undefined;
  18250. /**
  18251. * Gets or sets the numeric Property specifying the rotation of the image
  18252. * counter clockwise from the <code>alignedAxis</code>.
  18253. */
  18254. rotation: Property | undefined;
  18255. /**
  18256. * Gets or sets the {@link Cartesian3} Property specifying the unit vector axis of rotation
  18257. * in the fixed frame. When set to Cartesian3.ZERO the rotation is from the top of the screen.
  18258. */
  18259. alignedAxis: Property | undefined;
  18260. /**
  18261. * Gets or sets the boolean Property specifying if this billboard's size will be measured in meters.
  18262. */
  18263. sizeInMeters: Property | undefined;
  18264. /**
  18265. * Gets or sets the numeric Property specifying the width of the billboard in pixels.
  18266. * When undefined, the native width is used.
  18267. */
  18268. width: Property | undefined;
  18269. /**
  18270. * Gets or sets the numeric Property specifying the height of the billboard in pixels.
  18271. * When undefined, the native height is used.
  18272. */
  18273. height: Property | undefined;
  18274. /**
  18275. * Gets or sets {@link NearFarScalar} Property specifying the scale of the billboard based on the distance from the camera.
  18276. * A billboard's scale will interpolate between the {@link NearFarScalar#nearValue} and
  18277. * {@link NearFarScalar#farValue} while the camera distance falls within the lower and upper bounds
  18278. * of the specified {@link NearFarScalar#near} and {@link NearFarScalar#far}.
  18279. * Outside of these ranges the billboard's scale remains clamped to the nearest bound.
  18280. */
  18281. scaleByDistance: Property | undefined;
  18282. /**
  18283. * Gets or sets {@link NearFarScalar} Property specifying the translucency of the billboard based on the distance from the camera.
  18284. * A billboard's translucency 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 translucency remains clamped to the nearest bound.
  18288. */
  18289. translucencyByDistance: Property | undefined;
  18290. /**
  18291. * Gets or sets {@link NearFarScalar} Property specifying the pixel offset of the billboard based on the distance from the camera.
  18292. * A billboard's pixel offset 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 pixel offset remains clamped to the nearest bound.
  18296. */
  18297. pixelOffsetScaleByDistance: Property | undefined;
  18298. /**
  18299. * Gets or sets the Property specifying a {@link BoundingRectangle} that defines a
  18300. * sub-region of the <code>image</code> to use for the billboard, rather than the entire image,
  18301. * measured in pixels from the bottom-left.
  18302. */
  18303. imageSubRegion: Property | undefined;
  18304. /**
  18305. * Gets or sets the {@link DistanceDisplayCondition} Property specifying at what distance from the camera that this billboard will be displayed.
  18306. */
  18307. distanceDisplayCondition: Property | undefined;
  18308. /**
  18309. * Gets or sets the distance from the camera at which to disable the depth test to, for example, prevent clipping against terrain.
  18310. * When set to zero, the depth test is always applied. When set to Number.POSITIVE_INFINITY, the depth test is never applied.
  18311. */
  18312. disableDepthTestDistance: Property | undefined;
  18313. /**
  18314. * Duplicates this instance.
  18315. * @param [result] - The object onto which to store the result.
  18316. * @returns The modified result parameter or a new instance if one was not provided.
  18317. */
  18318. clone(result?: BillboardGraphics): BillboardGraphics;
  18319. /**
  18320. * Assigns each unassigned property on this object to the value
  18321. * of the same property on the provided source object.
  18322. * @param source - The object to be merged into this object.
  18323. */
  18324. merge(source: BillboardGraphics): void;
  18325. }
  18326. /**
  18327. * A {@link Visualizer} which maps {@link Entity#billboard} to a {@link Billboard}.
  18328. * @param entityCluster - The entity cluster to manage the collection of billboards and optionally cluster with other entities.
  18329. * @param entityCollection - The entityCollection to visualize.
  18330. */
  18331. export class BillboardVisualizer {
  18332. constructor(entityCluster: EntityCluster, entityCollection: EntityCollection);
  18333. /**
  18334. * Updates the primitives created by this visualizer to match their
  18335. * Entity counterpart at the given time.
  18336. * @param time - The time to update to.
  18337. * @returns This function always returns true.
  18338. */
  18339. update(time: JulianDate): boolean;
  18340. /**
  18341. * Returns true if this object was destroyed; otherwise, false.
  18342. * @returns True if this object was destroyed; otherwise, false.
  18343. */
  18344. isDestroyed(): boolean;
  18345. /**
  18346. * Removes and destroys all primitives created by this instance.
  18347. */
  18348. destroy(): void;
  18349. }
  18350. /**
  18351. * A {@link GeometryUpdater} for boxes.
  18352. * Clients do not normally create this class directly, but instead rely on {@link DataSourceDisplay}.
  18353. * @param entity - The entity containing the geometry to be visualized.
  18354. * @param scene - The scene where visualization is taking place.
  18355. */
  18356. export class BoxGeometryUpdater {
  18357. constructor(entity: Entity, scene: Scene);
  18358. /**
  18359. * Creates the geometry instance which represents the fill of the geometry.
  18360. * @param time - The time to use when retrieving initial attribute values.
  18361. * @returns The geometry instance representing the filled portion of the geometry.
  18362. */
  18363. createFillGeometryInstance(time: JulianDate): GeometryInstance;
  18364. /**
  18365. * Creates the geometry instance which represents the outline of the geometry.
  18366. * @param time - The time to use when retrieving initial attribute values.
  18367. * @returns The geometry instance representing the outline portion of the geometry.
  18368. */
  18369. createOutlineGeometryInstance(time: JulianDate): GeometryInstance;
  18370. }
  18371. export namespace BoxGraphics {
  18372. /**
  18373. * Initialization options for the BoxGraphics constructor
  18374. * @property [show = true] - A boolean Property specifying the visibility of the box.
  18375. * @property [dimensions] - A {@link Cartesian3} Property specifying the length, width, and height of the box.
  18376. * @property [heightReference = HeightReference.NONE] - A Property specifying what the height from the entity position is relative to.
  18377. * @property [fill = true] - A boolean Property specifying whether the box is filled with the provided material.
  18378. * @property [material = Color.WHITE] - A Property specifying the material used to fill the box.
  18379. * @property [outline = false] - A boolean Property specifying whether the box is outlined.
  18380. * @property [outlineColor = Color.BLACK] - A Property specifying the {@link Color} of the outline.
  18381. * @property [outlineWidth = 1.0] - A numeric Property specifying the width of the outline.
  18382. * @property [shadows = ShadowMode.DISABLED] - An enum Property specifying whether the box casts or receives shadows from light sources.
  18383. * @property [distanceDisplayCondition] - A Property specifying at what distance from the camera that this box will be displayed.
  18384. */
  18385. type ConstructorOptions = {
  18386. show?: Property | boolean;
  18387. dimensions?: Property | Cartesian3;
  18388. heightReference?: Property | HeightReference;
  18389. fill?: Property | boolean;
  18390. material?: MaterialProperty | Color;
  18391. outline?: Property | boolean;
  18392. outlineColor?: Property | Color;
  18393. outlineWidth?: Property | number;
  18394. shadows?: Property | ShadowMode;
  18395. distanceDisplayCondition?: Property | DistanceDisplayCondition;
  18396. };
  18397. }
  18398. /**
  18399. * Describes a box. The center position and orientation are determined by the containing {@link Entity}.
  18400. * @param [options] - Object describing initialization options
  18401. */
  18402. export class BoxGraphics {
  18403. constructor(options?: BoxGraphics.ConstructorOptions);
  18404. /**
  18405. * Gets the event that is raised whenever a property or sub-property is changed or modified.
  18406. */
  18407. readonly definitionChanged: Event;
  18408. /**
  18409. * Gets or sets the boolean Property specifying the visibility of the box.
  18410. */
  18411. show: Property | undefined;
  18412. /**
  18413. * Gets or sets {@link Cartesian3} Property property specifying the length, width, and height of the box.
  18414. */
  18415. dimensions: Property | undefined;
  18416. /**
  18417. * Gets or sets the Property specifying the {@link HeightReference}.
  18418. */
  18419. heightReference: Property | undefined;
  18420. /**
  18421. * Gets or sets the boolean Property specifying whether the box is filled with the provided material.
  18422. */
  18423. fill: Property | undefined;
  18424. /**
  18425. * Gets or sets the material used to fill the box.
  18426. */
  18427. material: MaterialProperty | undefined;
  18428. /**
  18429. * Gets or sets the Property specifying whether the box is outlined.
  18430. */
  18431. outline: Property | undefined;
  18432. /**
  18433. * Gets or sets the Property specifying the {@link Color} of the outline.
  18434. */
  18435. outlineColor: Property | undefined;
  18436. /**
  18437. * Gets or sets the numeric Property specifying the width of the outline.
  18438. * <p>
  18439. * Note: This property will be ignored on all major browsers on Windows platforms. For details, see (@link https://github.com/CesiumGS/cesium/issues/40}.
  18440. * </p>
  18441. */
  18442. outlineWidth: Property | undefined;
  18443. /**
  18444. * Get or sets the enum Property specifying whether the box
  18445. * casts or receives shadows from light sources.
  18446. */
  18447. shadows: Property | undefined;
  18448. /**
  18449. * Gets or sets the {@link DistanceDisplayCondition} Property specifying at what distance from the camera that this box will be displayed.
  18450. */
  18451. distanceDisplayCondition: Property | undefined;
  18452. /**
  18453. * Duplicates this instance.
  18454. * @param [result] - The object onto which to store the result.
  18455. * @returns The modified result parameter or a new instance if one was not provided.
  18456. */
  18457. clone(result?: BoxGraphics): BoxGraphics;
  18458. /**
  18459. * Assigns each unassigned property on this object to the value
  18460. * of the same property on the provided source object.
  18461. * @param source - The object to be merged into this object.
  18462. */
  18463. merge(source: BoxGraphics): void;
  18464. }
  18465. /**
  18466. * A {@link Property} whose value is lazily evaluated by a callback function.
  18467. * @param callback - The function to be called when the property is evaluated.
  18468. * @param isConstant - <code>true</code> when the callback function returns the same value every time, <code>false</code> if the value will change.
  18469. */
  18470. export class CallbackProperty {
  18471. constructor(callback: CallbackProperty.Callback, isConstant: boolean);
  18472. /**
  18473. * Gets a value indicating if this property is constant.
  18474. */
  18475. readonly isConstant: boolean;
  18476. /**
  18477. * Gets the event that is raised whenever the definition of this property changes.
  18478. * The definition is changed whenever setCallback is called.
  18479. */
  18480. readonly definitionChanged: Event;
  18481. /**
  18482. * Gets the value of the property.
  18483. * @param time - The time for which to retrieve the value.
  18484. * @param [result] - The object to store the value into, if omitted, a new instance is created and returned.
  18485. * @returns The modified result parameter or a new instance if the result parameter was not supplied or is unsupported.
  18486. */
  18487. getValue(time: JulianDate, result?: any): any;
  18488. /**
  18489. * Sets the callback to be used.
  18490. * @param callback - The function to be called when the property is evaluated.
  18491. * @param isConstant - <code>true</code> when the callback function returns the same value every time, <code>false</code> if the value will change.
  18492. */
  18493. setCallback(callback: CallbackProperty.Callback, isConstant: boolean): void;
  18494. /**
  18495. * Compares this property to the provided property and returns
  18496. * <code>true</code> if they are equal, <code>false</code> otherwise.
  18497. * @param [other] - The other property.
  18498. * @returns <code>true</code> if left and right are equal, <code>false</code> otherwise.
  18499. */
  18500. equals(other?: Property): boolean;
  18501. }
  18502. export namespace CallbackProperty {
  18503. /**
  18504. * A function that returns the value of the property.
  18505. * @param time - The time for which to retrieve the value.
  18506. * @param [result] - The object to store the value into. If omitted, the function must create and return a new instance.
  18507. */
  18508. type Callback = (time: JulianDate, result?: any) => any;
  18509. }
  18510. export namespace Cesium3DTilesetGraphics {
  18511. /**
  18512. * Initialization options for the Cesium3DTilesetGraphics constructor
  18513. * @property [show = true] - A boolean Property specifying the visibility of the tileset.
  18514. * @property [uri] - A string or Resource Property specifying the URI of the tileset.
  18515. * @property [maximumScreenSpaceError] - A number or Property specifying the maximum screen space error used to drive level of detail refinement.
  18516. */
  18517. type ConstructorOptions = {
  18518. show?: Property | boolean;
  18519. uri?: Property | string | Resource;
  18520. maximumScreenSpaceError?: Property | number;
  18521. };
  18522. }
  18523. /**
  18524. * A 3D Tiles tileset represented by an {@link Entity}.
  18525. * The tileset modelMatrix is determined by the containing Entity position and orientation
  18526. * or is left unset if position is undefined.
  18527. * @param [options] - Object describing initialization options
  18528. */
  18529. export class Cesium3DTilesetGraphics {
  18530. constructor(options?: Cesium3DTilesetGraphics.ConstructorOptions);
  18531. /**
  18532. * Gets the event that is raised whenever a property or sub-property is changed or modified.
  18533. */
  18534. readonly definitionChanged: Event;
  18535. /**
  18536. * Gets or sets the boolean Property specifying the visibility of the model.
  18537. */
  18538. show: Property | undefined;
  18539. /**
  18540. * Gets or sets the string Property specifying the URI of the glTF asset.
  18541. */
  18542. uri: Property | undefined;
  18543. /**
  18544. * Gets or sets the maximum screen space error used to drive level of detail refinement.
  18545. */
  18546. maximumScreenSpaceError: Property | undefined;
  18547. /**
  18548. * Duplicates this instance.
  18549. * @param [result] - The object onto which to store the result.
  18550. * @returns The modified result parameter or a new instance if one was not provided.
  18551. */
  18552. clone(result?: Cesium3DTilesetGraphics): Cesium3DTilesetGraphics;
  18553. /**
  18554. * Assigns each unassigned property on this object to the value
  18555. * of the same property on the provided source object.
  18556. * @param source - The object to be merged into this object.
  18557. */
  18558. merge(source: Cesium3DTilesetGraphics): void;
  18559. }
  18560. /**
  18561. * A {@link Visualizer} which maps {@link Entity#tileset} to a {@link Cesium3DTileset}.
  18562. * @param scene - The scene the primitives will be rendered in.
  18563. * @param entityCollection - The entityCollection to visualize.
  18564. */
  18565. export class Cesium3DTilesetVisualizer {
  18566. constructor(scene: Scene, entityCollection: EntityCollection);
  18567. /**
  18568. * Updates models created this visualizer to match their
  18569. * Entity counterpart at the given time.
  18570. * @param time - The time to update to.
  18571. * @returns This function always returns true.
  18572. */
  18573. update(time: JulianDate): boolean;
  18574. /**
  18575. * Returns true if this object was destroyed; otherwise, false.
  18576. * @returns True if this object was destroyed; otherwise, false.
  18577. */
  18578. isDestroyed(): boolean;
  18579. /**
  18580. * Removes and destroys all primitives created by this instance.
  18581. */
  18582. destroy(): void;
  18583. }
  18584. /**
  18585. * A {@link MaterialProperty} that maps to checkerboard {@link Material} uniforms.
  18586. * @param [options] - Object with the following properties:
  18587. * @param [options.evenColor = Color.WHITE] - A Property specifying the first {@link Color}.
  18588. * @param [options.oddColor = Color.BLACK] - A Property specifying the second {@link Color}.
  18589. * @param [options.repeat = new Cartesian2(2.0, 2.0)] - A {@link Cartesian2} Property specifying how many times the tiles repeat in each direction.
  18590. */
  18591. export class CheckerboardMaterialProperty {
  18592. constructor(options?: {
  18593. evenColor?: Property | Color;
  18594. oddColor?: Property | Color;
  18595. repeat?: Property | Cartesian2;
  18596. });
  18597. /**
  18598. * Gets a value indicating if this property is constant. A property is considered
  18599. * constant if getValue always returns the same result for the current definition.
  18600. */
  18601. readonly isConstant: boolean;
  18602. /**
  18603. * Gets the event that is raised whenever the definition of this property changes.
  18604. * The definition is considered to have changed if a call to getValue would return
  18605. * a different result for the same time.
  18606. */
  18607. readonly definitionChanged: Event;
  18608. /**
  18609. * Gets or sets the Property specifying the first {@link Color}.
  18610. */
  18611. evenColor: Property | undefined;
  18612. /**
  18613. * Gets or sets the Property specifying the second {@link Color}.
  18614. */
  18615. oddColor: Property | undefined;
  18616. /**
  18617. * Gets or sets the {@link Cartesian2} Property specifying how many times the tiles repeat in each direction.
  18618. */
  18619. repeat: Property | undefined;
  18620. /**
  18621. * Gets the {@link Material} type at the provided time.
  18622. * @param time - The time for which to retrieve the type.
  18623. * @returns The type of material.
  18624. */
  18625. getType(time: JulianDate): string;
  18626. /**
  18627. * Gets the value of the property at the provided time.
  18628. * @param time - The time for which to retrieve the value.
  18629. * @param [result] - The object to store the value into, if omitted, a new instance is created and returned.
  18630. * @returns The modified result parameter or a new instance if the result parameter was not supplied.
  18631. */
  18632. getValue(time: JulianDate, result?: any): any;
  18633. /**
  18634. * Compares this property to the provided property and returns
  18635. * <code>true</code> if they are equal, <code>false</code> otherwise.
  18636. * @param [other] - The other property.
  18637. * @returns <code>true</code> if left and right are equal, <code>false</code> otherwise.
  18638. */
  18639. equals(other?: Property): boolean;
  18640. }
  18641. /**
  18642. * A {@link MaterialProperty} that maps to solid color {@link Material} uniforms.
  18643. * @param [color = Color.WHITE] - The {@link Color} Property to be used.
  18644. */
  18645. export class ColorMaterialProperty {
  18646. constructor(color?: Property | Color);
  18647. /**
  18648. * Gets a value indicating if this property is constant. A property is considered
  18649. * constant if getValue always returns the same result for the current definition.
  18650. */
  18651. readonly isConstant: boolean;
  18652. /**
  18653. * Gets the event that is raised whenever the definition of this property changes.
  18654. * The definition is considered to have changed if a call to getValue would return
  18655. * a different result for the same time.
  18656. */
  18657. readonly definitionChanged: Event;
  18658. /**
  18659. * Gets or sets the {@link Color} {@link Property}.
  18660. */
  18661. color: Property | undefined;
  18662. /**
  18663. * Gets the {@link Material} type at the provided time.
  18664. * @param time - The time for which to retrieve the type.
  18665. * @returns The type of material.
  18666. */
  18667. getType(time: JulianDate): string;
  18668. /**
  18669. * Gets the value of the property at the provided time.
  18670. * @param time - The time for which to retrieve the value.
  18671. * @param [result] - The object to store the value into, if omitted, a new instance is created and returned.
  18672. * @returns The modified result parameter or a new instance if the result parameter was not supplied.
  18673. */
  18674. getValue(time: JulianDate, result?: any): any;
  18675. /**
  18676. * Compares this property to the provided property and returns
  18677. * <code>true</code> if they are equal, <code>false</code> otherwise.
  18678. * @param [other] - The other property.
  18679. * @returns <code>true</code> if left and right are equal, <code>false</code> otherwise.
  18680. */
  18681. equals(other?: Property): boolean;
  18682. }
  18683. /**
  18684. * Non-destructively composites multiple {@link EntityCollection} instances into a single collection.
  18685. * If a Entity with the same ID exists in multiple collections, it is non-destructively
  18686. * merged into a single new entity instance. If an entity has the same property in multiple
  18687. * collections, the property of the Entity in the last collection of the list it
  18688. * belongs to is used. CompositeEntityCollection can be used almost anywhere that a
  18689. * EntityCollection is used.
  18690. * @param [collections] - The initial list of EntityCollection instances to merge.
  18691. * @param [owner] - The data source (or composite entity collection) which created this collection.
  18692. */
  18693. export class CompositeEntityCollection {
  18694. constructor(collections?: EntityCollection[], owner?: DataSource | CompositeEntityCollection);
  18695. /**
  18696. * Gets the event that is fired when entities are added or removed from the collection.
  18697. * The generated event is a {@link EntityCollection.collectionChangedEventCallback}.
  18698. */
  18699. readonly collectionChanged: Event;
  18700. /**
  18701. * Gets a globally unique identifier for this collection.
  18702. */
  18703. readonly id: string;
  18704. /**
  18705. * Gets the array of Entity instances in the collection.
  18706. * This array should not be modified directly.
  18707. */
  18708. readonly values: Entity[];
  18709. /**
  18710. * Gets the owner of this composite entity collection, ie. the data source or composite entity collection which created it.
  18711. */
  18712. readonly owner: DataSource | CompositeEntityCollection;
  18713. /**
  18714. * Adds a collection to the composite.
  18715. * @param collection - the collection to add.
  18716. * @param [index] - the index to add the collection at. If omitted, the collection will
  18717. * added on top of all existing collections.
  18718. */
  18719. addCollection(collection: EntityCollection, index?: number): void;
  18720. /**
  18721. * Removes a collection from this composite, if present.
  18722. * @param collection - The collection to remove.
  18723. * @returns true if the collection was in the composite and was removed,
  18724. * false if the collection was not in the composite.
  18725. */
  18726. removeCollection(collection: EntityCollection): boolean;
  18727. /**
  18728. * Removes all collections from this composite.
  18729. */
  18730. removeAllCollections(): void;
  18731. /**
  18732. * Checks to see if the composite contains a given collection.
  18733. * @param collection - the collection to check for.
  18734. * @returns true if the composite contains the collection, false otherwise.
  18735. */
  18736. containsCollection(collection: EntityCollection): boolean;
  18737. /**
  18738. * Returns true if the provided entity is in this collection, false otherwise.
  18739. * @param entity - The entity.
  18740. * @returns true if the provided entity is in this collection, false otherwise.
  18741. */
  18742. contains(entity: Entity): boolean;
  18743. /**
  18744. * Determines the index of a given collection in the composite.
  18745. * @param collection - The collection to find the index of.
  18746. * @returns The index of the collection in the composite, or -1 if the collection does not exist in the composite.
  18747. */
  18748. indexOfCollection(collection: EntityCollection): number;
  18749. /**
  18750. * Gets a collection by index from the composite.
  18751. * @param index - the index to retrieve.
  18752. */
  18753. getCollection(index: number): void;
  18754. /**
  18755. * Gets the number of collections in this composite.
  18756. */
  18757. getCollectionsLength(): void;
  18758. /**
  18759. * Raises a collection up one position in the composite.
  18760. * @param collection - the collection to move.
  18761. */
  18762. raiseCollection(collection: EntityCollection): void;
  18763. /**
  18764. * Lowers a collection down one position in the composite.
  18765. * @param collection - the collection to move.
  18766. */
  18767. lowerCollection(collection: EntityCollection): void;
  18768. /**
  18769. * Raises a collection to the top of the composite.
  18770. * @param collection - the collection to move.
  18771. */
  18772. raiseCollectionToTop(collection: EntityCollection): void;
  18773. /**
  18774. * Lowers a collection to the bottom of the composite.
  18775. * @param collection - the collection to move.
  18776. */
  18777. lowerCollectionToBottom(collection: EntityCollection): void;
  18778. /**
  18779. * Prevents {@link EntityCollection#collectionChanged} events from being raised
  18780. * until a corresponding call is made to {@link EntityCollection#resumeEvents}, at which
  18781. * point a single event will be raised that covers all suspended operations.
  18782. * This allows for many items to be added and removed efficiently.
  18783. * While events are suspended, recompositing of the collections will
  18784. * also be suspended, as this can be a costly operation.
  18785. * This function can be safely called multiple times as long as there
  18786. * are corresponding calls to {@link EntityCollection#resumeEvents}.
  18787. */
  18788. suspendEvents(): void;
  18789. /**
  18790. * Resumes raising {@link EntityCollection#collectionChanged} events immediately
  18791. * when an item is added or removed. Any modifications made while while events were suspended
  18792. * will be triggered as a single event when this function is called. This function also ensures
  18793. * the collection is recomposited if events are also resumed.
  18794. * This function is reference counted and can safely be called multiple times as long as there
  18795. * are corresponding calls to {@link EntityCollection#resumeEvents}.
  18796. */
  18797. resumeEvents(): void;
  18798. /**
  18799. * Computes the maximum availability of the entities in the collection.
  18800. * If the collection contains a mix of infinitely available data and non-infinite data,
  18801. * It will return the interval pertaining to the non-infinite data only. If all
  18802. * data is infinite, an infinite interval will be returned.
  18803. * @returns The availability of entities in the collection.
  18804. */
  18805. computeAvailability(): TimeInterval;
  18806. /**
  18807. * Gets an entity with the specified id.
  18808. * @param id - The id of the entity to retrieve.
  18809. * @returns The entity with the provided id or undefined if the id did not exist in the collection.
  18810. */
  18811. getById(id: string): Entity | undefined;
  18812. }
  18813. /**
  18814. * A {@link CompositeProperty} which is also a {@link MaterialProperty}.
  18815. */
  18816. export class CompositeMaterialProperty {
  18817. constructor();
  18818. /**
  18819. * Gets a value indicating if this property is constant. A property is considered
  18820. * constant if getValue always returns the same result for the current definition.
  18821. */
  18822. readonly isConstant: boolean;
  18823. /**
  18824. * Gets the event that is raised whenever the definition of this property changes.
  18825. * The definition is changed whenever setValue is called with data different
  18826. * than the current value.
  18827. */
  18828. readonly definitionChanged: Event;
  18829. /**
  18830. * Gets the interval collection.
  18831. */
  18832. intervals: TimeIntervalCollection;
  18833. /**
  18834. * Gets the {@link Material} type at the provided time.
  18835. * @param time - The time for which to retrieve the type.
  18836. * @returns The type of material.
  18837. */
  18838. getType(time: JulianDate): string;
  18839. /**
  18840. * Gets the value of the property at the provided time.
  18841. * @param time - The time for which to retrieve the value.
  18842. * @param [result] - The object to store the value into, if omitted, a new instance is created and returned.
  18843. * @returns The modified result parameter or a new instance if the result parameter was not supplied.
  18844. */
  18845. getValue(time: JulianDate, result?: any): any;
  18846. /**
  18847. * Compares this property to the provided property and returns
  18848. * <code>true</code> if they are equal, <code>false</code> otherwise.
  18849. * @param [other] - The other property.
  18850. * @returns <code>true</code> if left and right are equal, <code>false</code> otherwise.
  18851. */
  18852. equals(other?: Property): boolean;
  18853. }
  18854. /**
  18855. * A {@link CompositeProperty} which is also a {@link PositionProperty}.
  18856. * @param [referenceFrame = ReferenceFrame.FIXED] - The reference frame in which the position is defined.
  18857. */
  18858. export class CompositePositionProperty {
  18859. constructor(referenceFrame?: ReferenceFrame);
  18860. /**
  18861. * Gets a value indicating if this property is constant. A property is considered
  18862. * constant if getValue always returns the same result for the current definition.
  18863. */
  18864. readonly isConstant: boolean;
  18865. /**
  18866. * Gets the event that is raised whenever the definition of this property changes.
  18867. * The definition is changed whenever setValue is called with data different
  18868. * than the current value.
  18869. */
  18870. readonly definitionChanged: Event;
  18871. /**
  18872. * Gets the interval collection.
  18873. */
  18874. intervals: TimeIntervalCollection;
  18875. /**
  18876. * Gets or sets the reference frame which this position presents itself as.
  18877. * Each PositionProperty making up this object has it's own reference frame,
  18878. * so this property merely exposes a "preferred" reference frame for clients
  18879. * to use.
  18880. */
  18881. referenceFrame: ReferenceFrame;
  18882. /**
  18883. * Gets the value of the property at the provided time in the fixed frame.
  18884. * @param time - The time for which to retrieve the value.
  18885. * @param [result] - The object to store the value into, if omitted, a new instance is created and returned.
  18886. * @returns The modified result parameter or a new instance if the result parameter was not supplied.
  18887. */
  18888. getValue(time: JulianDate, result?: Cartesian3): Cartesian3 | undefined;
  18889. /**
  18890. * Gets the value of the property at the provided time and in the provided reference frame.
  18891. * @param time - The time for which to retrieve the value.
  18892. * @param referenceFrame - The desired referenceFrame of the result.
  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. getValueInReferenceFrame(time: JulianDate, referenceFrame: ReferenceFrame, result?: Cartesian3): Cartesian3 | undefined;
  18897. /**
  18898. * Compares this property to the provided property and returns
  18899. * <code>true</code> if they are equal, <code>false</code> otherwise.
  18900. * @param [other] - The other property.
  18901. * @returns <code>true</code> if left and right are equal, <code>false</code> otherwise.
  18902. */
  18903. equals(other?: Property): boolean;
  18904. }
  18905. /**
  18906. * A {@link Property} which is defined by a {@link TimeIntervalCollection}, where the
  18907. * data property of each {@link TimeInterval} is another Property instance which is
  18908. * evaluated at the provided time.
  18909. * @example
  18910. * const constantProperty = ...;
  18911. * const sampledProperty = ...;
  18912. *
  18913. * //Create a composite property from two previously defined properties
  18914. * //where the property is valid on August 1st, 2012 and uses a constant
  18915. * //property for the first half of the day and a sampled property for the
  18916. * //remaining half.
  18917. * const composite = new Cesium.CompositeProperty();
  18918. * composite.intervals.addInterval(Cesium.TimeInterval.fromIso8601({
  18919. * iso8601 : '2012-08-01T00:00:00.00Z/2012-08-01T12:00:00.00Z',
  18920. * data : constantProperty
  18921. * }));
  18922. * composite.intervals.addInterval(Cesium.TimeInterval.fromIso8601({
  18923. * iso8601 : '2012-08-01T12:00:00.00Z/2012-08-02T00:00:00.00Z',
  18924. * isStartIncluded : false,
  18925. * isStopIncluded : false,
  18926. * data : sampledProperty
  18927. * }));
  18928. */
  18929. export class CompositeProperty {
  18930. constructor();
  18931. /**
  18932. * Gets a value indicating if this property is constant. A property is considered
  18933. * constant if getValue always returns the same result for the current definition.
  18934. */
  18935. readonly isConstant: boolean;
  18936. /**
  18937. * Gets the event that is raised whenever the definition of this property changes.
  18938. * The definition is changed whenever setValue is called with data different
  18939. * than the current value.
  18940. */
  18941. readonly definitionChanged: Event;
  18942. /**
  18943. * Gets the interval collection.
  18944. */
  18945. intervals: TimeIntervalCollection;
  18946. /**
  18947. * Gets the value of the property at the provided time.
  18948. * @param time - The time for which to retrieve the value.
  18949. * @param [result] - The object to store the value into, if omitted, a new instance is created and returned.
  18950. * @returns The modified result parameter or a new instance if the result parameter was not supplied.
  18951. */
  18952. getValue(time: JulianDate, result?: any): any;
  18953. /**
  18954. * Compares this property to the provided property and returns
  18955. * <code>true</code> if they are equal, <code>false</code> otherwise.
  18956. * @param [other] - The other property.
  18957. * @returns <code>true</code> if left and right are equal, <code>false</code> otherwise.
  18958. */
  18959. equals(other?: Property): boolean;
  18960. }
  18961. /**
  18962. * A {@link PositionProperty} whose value does not change in respect to the
  18963. * {@link ReferenceFrame} in which is it defined.
  18964. * @param [value] - The property value.
  18965. * @param [referenceFrame = ReferenceFrame.FIXED] - The reference frame in which the position is defined.
  18966. */
  18967. export class ConstantPositionProperty {
  18968. constructor(value?: Cartesian3, referenceFrame?: ReferenceFrame);
  18969. /**
  18970. * Gets a value indicating if this property is constant. A property is considered
  18971. * constant if getValue always returns the same result for the current definition.
  18972. */
  18973. readonly isConstant: boolean;
  18974. /**
  18975. * Gets the event that is raised whenever the definition of this property changes.
  18976. * The definition is considered to have changed if a call to getValue would return
  18977. * a different result for the same time.
  18978. */
  18979. readonly definitionChanged: Event;
  18980. /**
  18981. * Gets the reference frame in which the position is defined.
  18982. */
  18983. referenceFrame: ReferenceFrame;
  18984. /**
  18985. * Gets the value of the property at the provided time in the fixed frame.
  18986. * @param time - The time for which to retrieve the value.
  18987. * @param [result] - The object to store the value into, if omitted, a new instance is created and returned.
  18988. * @returns The modified result parameter or a new instance if the result parameter was not supplied.
  18989. */
  18990. getValue(time: JulianDate, result?: any): any;
  18991. /**
  18992. * Sets the value of the property.
  18993. * @param value - The property value.
  18994. * @param [referenceFrame = this.referenceFrame] - The reference frame in which the position is defined.
  18995. */
  18996. setValue(value: Cartesian3, referenceFrame?: ReferenceFrame): void;
  18997. /**
  18998. * Gets the value of the property at the provided time and in the provided reference frame.
  18999. * @param time - The time for which to retrieve the value.
  19000. * @param referenceFrame - The desired referenceFrame of the result.
  19001. * @param [result] - The object to store the value into, if omitted, a new instance is created and returned.
  19002. * @returns The modified result parameter or a new instance if the result parameter was not supplied.
  19003. */
  19004. getValueInReferenceFrame(time: JulianDate, referenceFrame: ReferenceFrame, result?: Cartesian3): Cartesian3;
  19005. /**
  19006. * Compares this property to the provided property and returns
  19007. * <code>true</code> if they are equal, <code>false</code> otherwise.
  19008. * @param [other] - The other property.
  19009. * @returns <code>true</code> if left and right are equal, <code>false</code> otherwise.
  19010. */
  19011. equals(other?: Property): boolean;
  19012. }
  19013. /**
  19014. * A {@link Property} whose value does not change with respect to simulation time.
  19015. * @param [value] - The property value.
  19016. */
  19017. export class ConstantProperty {
  19018. constructor(value?: any);
  19019. /**
  19020. * Gets a value indicating if this property is constant.
  19021. * This property always returns <code>true</code>.
  19022. */
  19023. readonly isConstant: boolean;
  19024. /**
  19025. * Gets the event that is raised whenever the definition of this property changes.
  19026. * The definition is changed whenever setValue is called with data different
  19027. * than the current value.
  19028. */
  19029. readonly definitionChanged: Event;
  19030. /**
  19031. * Gets the value of the property.
  19032. * @param [time] - The time for which to retrieve the value. This parameter is unused since the value does not change with respect to time.
  19033. * @param [result] - The object to store the value into, if omitted, a new instance is created and returned.
  19034. * @returns The modified result parameter or a new instance if the result parameter was not supplied.
  19035. */
  19036. getValue(time?: JulianDate, result?: any): any;
  19037. /**
  19038. * Sets the value of the property.
  19039. * @param value - The property value.
  19040. */
  19041. setValue(value: any): void;
  19042. /**
  19043. * Compares this property to the provided property and returns
  19044. * <code>true</code> if they are equal, <code>false</code> otherwise.
  19045. * @param [other] - The other property.
  19046. * @returns <code>true</code> if left and right are equal, <code>false</code> otherwise.
  19047. */
  19048. equals(other?: Property): boolean;
  19049. /**
  19050. * Gets this property's value.
  19051. * @returns This property's value.
  19052. */
  19053. valueOf(): any;
  19054. /**
  19055. * Creates a string representing this property's value.
  19056. * @returns A string representing the property's value.
  19057. */
  19058. toString(): string;
  19059. }
  19060. /**
  19061. * A {@link GeometryUpdater} for corridors.
  19062. * Clients do not normally create this class directly, but instead rely on {@link DataSourceDisplay}.
  19063. * @param entity - The entity containing the geometry to be visualized.
  19064. * @param scene - The scene where visualization is taking place.
  19065. */
  19066. export class CorridorGeometryUpdater {
  19067. constructor(entity: Entity, scene: Scene);
  19068. /**
  19069. * Creates the geometry instance which represents the fill of the geometry.
  19070. * @param time - The time to use when retrieving initial attribute values.
  19071. * @returns The geometry instance representing the filled portion of the geometry.
  19072. */
  19073. createFillGeometryInstance(time: JulianDate): GeometryInstance;
  19074. /**
  19075. * Creates the geometry instance which represents the outline of the geometry.
  19076. * @param time - The time to use when retrieving initial attribute values.
  19077. * @returns The geometry instance representing the outline portion of the geometry.
  19078. */
  19079. createOutlineGeometryInstance(time: JulianDate): GeometryInstance;
  19080. }
  19081. export namespace CorridorGraphics {
  19082. /**
  19083. * Initialization options for the CorridorGraphics constructor
  19084. * @property [show = true] - A boolean Property specifying the visibility of the corridor.
  19085. * @property [positions] - A Property specifying the array of {@link Cartesian3} positions that define the centerline of the corridor.
  19086. * @property [width] - A numeric Property specifying the distance between the edges of the corridor.
  19087. * @property [height = 0] - A numeric Property specifying the altitude of the corridor relative to the ellipsoid surface.
  19088. * @property [heightReference = HeightReference.NONE] - A Property specifying what the height is relative to.
  19089. * @property [extrudedHeight] - A numeric Property specifying the altitude of the corridor's extruded face relative to the ellipsoid surface.
  19090. * @property [extrudedHeightReference = HeightReference.NONE] - A Property specifying what the extrudedHeight is relative to.
  19091. * @property [cornerType = CornerType.ROUNDED] - A {@link CornerType} Property specifying the style of the corners.
  19092. * @property [granularity = Cesium.Math.RADIANS_PER_DEGREE] - A numeric Property specifying the distance between each latitude and longitude.
  19093. * @property [fill = true] - A boolean Property specifying whether the corridor is filled with the provided material.
  19094. * @property [material = Color.WHITE] - A Property specifying the material used to fill the corridor.
  19095. * @property [outline = false] - A boolean Property specifying whether the corridor is outlined.
  19096. * @property [outlineColor = Color.BLACK] - A Property specifying the {@link Color} of the outline.
  19097. * @property [outlineWidth = 1.0] - A numeric Property specifying the width of the outline.
  19098. * @property [shadows = ShadowMode.DISABLED] - An enum Property specifying whether the corridor casts or receives shadows from light sources.
  19099. * @property [distanceDisplayCondition] - A Property specifying at what distance from the camera that this corridor will be displayed.
  19100. * @property [classificationType = ClassificationType.BOTH] - An enum Property specifying whether this corridor will classify terrain, 3D Tiles, or both when on the ground.
  19101. * @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.
  19102. */
  19103. type ConstructorOptions = {
  19104. show?: Property | boolean;
  19105. positions?: Property | Cartesian3[];
  19106. width?: Property | number;
  19107. height?: Property | number;
  19108. heightReference?: Property | HeightReference;
  19109. extrudedHeight?: Property | number;
  19110. extrudedHeightReference?: Property | HeightReference;
  19111. cornerType?: Property | CornerType;
  19112. granularity?: Property | number;
  19113. fill?: Property | boolean;
  19114. material?: MaterialProperty | Color;
  19115. outline?: Property | boolean;
  19116. outlineColor?: Property | Color;
  19117. outlineWidth?: Property | number;
  19118. shadows?: Property | ShadowMode;
  19119. distanceDisplayCondition?: Property | DistanceDisplayCondition;
  19120. classificationType?: Property | ClassificationType;
  19121. zIndex?: ConstantProperty | number;
  19122. };
  19123. }
  19124. /**
  19125. * Describes a corridor, which is a shape defined by a centerline and width that
  19126. * conforms to the curvature of the globe. It can be placed on the surface or at altitude
  19127. * and can optionally be extruded into a volume.
  19128. * @param [options] - Object describing initialization options
  19129. */
  19130. export class CorridorGraphics {
  19131. constructor(options?: CorridorGraphics.ConstructorOptions);
  19132. /**
  19133. * Gets the event that is raised whenever a property or sub-property is changed or modified.
  19134. */
  19135. readonly definitionChanged: Event;
  19136. /**
  19137. * Gets or sets the boolean Property specifying the visibility of the corridor.
  19138. */
  19139. show: Property | undefined;
  19140. /**
  19141. * Gets or sets a Property specifying the array of {@link Cartesian3} positions that define the centerline of the corridor.
  19142. */
  19143. positions: Property | undefined;
  19144. /**
  19145. * Gets or sets the numeric Property specifying the width of the outline.
  19146. */
  19147. width: Property | undefined;
  19148. /**
  19149. * Gets or sets the numeric Property specifying the altitude of the corridor.
  19150. */
  19151. height: Property | undefined;
  19152. /**
  19153. * Gets or sets the Property specifying the {@link HeightReference}.
  19154. */
  19155. heightReference: Property | undefined;
  19156. /**
  19157. * Gets or sets the numeric Property specifying the altitude of the corridor extrusion.
  19158. * Setting this property creates a corridor shaped volume starting at height and ending
  19159. * at this altitude.
  19160. */
  19161. extrudedHeight: Property | undefined;
  19162. /**
  19163. * Gets or sets the Property specifying the extruded {@link HeightReference}.
  19164. */
  19165. extrudedHeightReference: Property | undefined;
  19166. /**
  19167. * Gets or sets the {@link CornerType} Property specifying how corners are styled.
  19168. */
  19169. cornerType: Property | undefined;
  19170. /**
  19171. * Gets or sets the numeric Property specifying the sampling distance between each latitude and longitude point.
  19172. */
  19173. granularity: Property | undefined;
  19174. /**
  19175. * Gets or sets the boolean Property specifying whether the corridor is filled with the provided material.
  19176. */
  19177. fill: Property | undefined;
  19178. /**
  19179. * Gets or sets the Property specifying the material used to fill the corridor.
  19180. */
  19181. material: MaterialProperty | undefined;
  19182. /**
  19183. * Gets or sets the Property specifying whether the corridor is outlined.
  19184. */
  19185. outline: Property | undefined;
  19186. /**
  19187. * Gets or sets the Property specifying the {@link Color} of the outline.
  19188. */
  19189. outlineColor: Property | undefined;
  19190. /**
  19191. * Gets or sets the numeric Property specifying the width of the outline.
  19192. * <p>
  19193. * Note: This property will be ignored on all major browsers on Windows platforms. For details, see (@link https://github.com/CesiumGS/cesium/issues/40}.
  19194. * </p>
  19195. */
  19196. outlineWidth: Property | undefined;
  19197. /**
  19198. * Get or sets the enum Property specifying whether the corridor
  19199. * casts or receives shadows from light sources.
  19200. */
  19201. shadows: Property | undefined;
  19202. /**
  19203. * Gets or sets the {@link DistanceDisplayCondition} Property specifying at what distance from the camera that this corridor will be displayed.
  19204. */
  19205. distanceDisplayCondition: Property | undefined;
  19206. /**
  19207. * Gets or sets the {@link ClassificationType} Property specifying whether this corridor will classify terrain, 3D Tiles, or both when on the ground.
  19208. */
  19209. classificationType: Property | undefined;
  19210. /**
  19211. * 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.
  19212. */
  19213. zIndex: ConstantProperty | undefined;
  19214. /**
  19215. * Duplicates this instance.
  19216. * @param [result] - The object onto which to store the result.
  19217. * @returns The modified result parameter or a new instance if one was not provided.
  19218. */
  19219. clone(result?: CorridorGraphics): CorridorGraphics;
  19220. /**
  19221. * Assigns each unassigned property on this object to the value
  19222. * of the same property on the provided source object.
  19223. * @param source - The object to be merged into this object.
  19224. */
  19225. merge(source: CorridorGraphics): void;
  19226. }
  19227. /**
  19228. * A {@link DataSource} implementation which can be used to manually manage a group of entities.
  19229. * @example
  19230. * const dataSource = new Cesium.CustomDataSource('myData');
  19231. *
  19232. * const entity = dataSource.entities.add({
  19233. * position : Cesium.Cartesian3.fromDegrees(1, 2, 0),
  19234. * billboard : {
  19235. * image : 'image.png'
  19236. * }
  19237. * });
  19238. *
  19239. * viewer.dataSources.add(dataSource);
  19240. * @param [name] - A human-readable name for this instance.
  19241. */
  19242. export class CustomDataSource {
  19243. constructor(name?: string);
  19244. /**
  19245. * Gets or sets a human-readable name for this instance.
  19246. */
  19247. name: string;
  19248. /**
  19249. * Gets or sets the clock for this instance.
  19250. */
  19251. clock: DataSourceClock;
  19252. /**
  19253. * Gets the collection of {@link Entity} instances.
  19254. */
  19255. entities: EntityCollection;
  19256. /**
  19257. * Gets or sets whether the data source is currently loading data.
  19258. */
  19259. isLoading: boolean;
  19260. /**
  19261. * Gets an event that will be raised when the underlying data changes.
  19262. */
  19263. changedEvent: Event;
  19264. /**
  19265. * Gets an event that will be raised if an error is encountered during processing.
  19266. */
  19267. errorEvent: Event;
  19268. /**
  19269. * Gets an event that will be raised when the data source either starts or stops loading.
  19270. */
  19271. loadingEvent: Event;
  19272. /**
  19273. * Gets whether or not this data source should be displayed.
  19274. */
  19275. show: boolean;
  19276. /**
  19277. * Gets or sets the clustering options for this data source. This object can be shared between multiple data sources.
  19278. */
  19279. clustering: EntityCluster;
  19280. /**
  19281. * Updates the data source to the provided time. This function is optional and
  19282. * is not required to be implemented. It is provided for data sources which
  19283. * retrieve data based on the current animation time or scene state.
  19284. * If implemented, update will be called by {@link DataSourceDisplay} once a frame.
  19285. * @param time - The simulation time.
  19286. * @returns True if this data source is ready to be displayed at the provided time, false otherwise.
  19287. */
  19288. update(time: JulianDate): boolean;
  19289. }
  19290. /**
  19291. * A {@link GeometryUpdater} for cylinders.
  19292. * Clients do not normally create this class directly, but instead rely on {@link DataSourceDisplay}.
  19293. * @param entity - The entity containing the geometry to be visualized.
  19294. * @param scene - The scene where visualization is taking place.
  19295. */
  19296. export class CylinderGeometryUpdater {
  19297. constructor(entity: Entity, scene: Scene);
  19298. /**
  19299. * Creates the geometry instance which represents the fill of the geometry.
  19300. * @param time - The time to use when retrieving initial attribute values.
  19301. * @returns The geometry instance representing the filled portion of the geometry.
  19302. */
  19303. createFillGeometryInstance(time: JulianDate): GeometryInstance;
  19304. /**
  19305. * Creates the geometry instance which represents the outline of the geometry.
  19306. * @param time - The time to use when retrieving initial attribute values.
  19307. * @returns The geometry instance representing the outline portion of the geometry.
  19308. */
  19309. createOutlineGeometryInstance(time: JulianDate): GeometryInstance;
  19310. }
  19311. export namespace CylinderGraphics {
  19312. /**
  19313. * Initialization options for the CylinderGraphics constructor
  19314. * @property [show = true] - A boolean Property specifying the visibility of the cylinder.
  19315. * @property [length] - A numeric Property specifying the length of the cylinder.
  19316. * @property [topRadius] - A numeric Property specifying the radius of the top of the cylinder.
  19317. * @property [bottomRadius] - A numeric Property specifying the radius of the bottom of the cylinder.
  19318. * @property [heightReference = HeightReference.NONE] - A Property specifying what the height from the entity position is relative to.
  19319. * @property [fill = true] - A boolean Property specifying whether the cylinder is filled with the provided material.
  19320. * @property [material = Color.WHITE] - A Property specifying the material used to fill the cylinder.
  19321. * @property [outline = false] - A boolean Property specifying whether the cylinder is outlined.
  19322. * @property [outlineColor = Color.BLACK] - A Property specifying the {@link Color} of the outline.
  19323. * @property [outlineWidth = 1.0] - A numeric Property specifying the width of the outline.
  19324. * @property [numberOfVerticalLines = 16] - A numeric Property specifying the number of vertical lines to draw along the perimeter for the outline.
  19325. * @property [slices = 128] - The number of edges around the perimeter of the cylinder.
  19326. * @property [shadows = ShadowMode.DISABLED] - An enum Property specifying whether the cylinder casts or receives shadows from light sources.
  19327. * @property [distanceDisplayCondition] - A Property specifying at what distance from the camera that this cylinder will be displayed.
  19328. */
  19329. type ConstructorOptions = {
  19330. show?: Property | boolean;
  19331. length?: Property | number;
  19332. topRadius?: Property | number;
  19333. bottomRadius?: Property | number;
  19334. heightReference?: Property | HeightReference;
  19335. fill?: Property | boolean;
  19336. material?: MaterialProperty | Color;
  19337. outline?: Property | boolean;
  19338. outlineColor?: Property | Color;
  19339. outlineWidth?: Property | number;
  19340. numberOfVerticalLines?: Property | number;
  19341. slices?: Property | number;
  19342. shadows?: Property | ShadowMode;
  19343. distanceDisplayCondition?: Property | DistanceDisplayCondition;
  19344. };
  19345. }
  19346. /**
  19347. * Describes a cylinder, truncated cone, or cone defined by a length, top radius, and bottom radius.
  19348. * The center position and orientation are determined by the containing {@link Entity}.
  19349. * @param [options] - Object describing initialization options
  19350. */
  19351. export class CylinderGraphics {
  19352. constructor(options?: CylinderGraphics.ConstructorOptions);
  19353. /**
  19354. * Gets the event that is raised whenever a property or sub-property is changed or modified.
  19355. */
  19356. readonly definitionChanged: Event;
  19357. /**
  19358. * Gets or sets the boolean Property specifying the visibility of the cylinder.
  19359. */
  19360. show: Property | undefined;
  19361. /**
  19362. * Gets or sets the numeric Property specifying the length of the cylinder.
  19363. */
  19364. length: Property | undefined;
  19365. /**
  19366. * Gets or sets the numeric Property specifying the radius of the top of the cylinder.
  19367. */
  19368. topRadius: Property | undefined;
  19369. /**
  19370. * Gets or sets the numeric Property specifying the radius of the bottom of the cylinder.
  19371. */
  19372. bottomRadius: Property | undefined;
  19373. /**
  19374. * Gets or sets the Property specifying the {@link HeightReference}.
  19375. */
  19376. heightReference: Property | undefined;
  19377. /**
  19378. * Gets or sets the boolean Property specifying whether the cylinder is filled with the provided material.
  19379. */
  19380. fill: Property | undefined;
  19381. /**
  19382. * Gets or sets the Property specifying the material used to fill the cylinder.
  19383. */
  19384. material: MaterialProperty | undefined;
  19385. /**
  19386. * Gets or sets the boolean Property specifying whether the cylinder is outlined.
  19387. */
  19388. outline: Property | undefined;
  19389. /**
  19390. * Gets or sets the Property specifying the {@link Color} of the outline.
  19391. */
  19392. outlineColor: Property | undefined;
  19393. /**
  19394. * Gets or sets the numeric Property specifying the width of the outline.
  19395. * <p>
  19396. * Note: This property will be ignored on all major browsers on Windows platforms. For details, see (@link https://github.com/CesiumGS/cesium/issues/40}.
  19397. * </p>
  19398. */
  19399. outlineWidth: Property | undefined;
  19400. /**
  19401. * Gets or sets the Property specifying the number of vertical lines to draw along the perimeter for the outline.
  19402. */
  19403. numberOfVerticalLines: Property | undefined;
  19404. /**
  19405. * Gets or sets the Property specifying the number of edges around the perimeter of the cylinder.
  19406. */
  19407. slices: Property | undefined;
  19408. /**
  19409. * Get or sets the enum Property specifying whether the cylinder
  19410. * casts or receives shadows from light sources.
  19411. */
  19412. shadows: Property | undefined;
  19413. /**
  19414. * Gets or sets the {@link DistanceDisplayCondition} Property specifying at what distance from the camera that this cylinder will be displayed.
  19415. */
  19416. distanceDisplayCondition: Property | undefined;
  19417. /**
  19418. * Duplicates this instance.
  19419. * @param [result] - The object onto which to store the result.
  19420. * @returns The modified result parameter or a new instance if one was not provided.
  19421. */
  19422. clone(result?: CylinderGraphics): CylinderGraphics;
  19423. /**
  19424. * Assigns each unassigned property on this object to the value
  19425. * of the same property on the provided source object.
  19426. * @param source - The object to be merged into this object.
  19427. */
  19428. merge(source: CylinderGraphics): void;
  19429. }
  19430. export namespace CzmlDataSource {
  19431. /**
  19432. * Initialization options for the <code>load</code> method.
  19433. * @property [sourceUri] - Overrides the url to use for resolving relative links.
  19434. * @property [credit] - A credit for the data source, which is displayed on the canvas.
  19435. */
  19436. type LoadOptions = {
  19437. sourceUri?: Resource | string;
  19438. credit?: Credit | string;
  19439. };
  19440. type UpdaterFunction = (entity: Entity, packet: any, entityCollection: EntityCollection, sourceUri: string) => void;
  19441. }
  19442. /**
  19443. * A {@link DataSource} which processes {@link https://github.com/AnalyticalGraphicsInc/czml-writer/wiki/CZML-Guide|CZML}.
  19444. * @param [name] - An optional name for the data source. This value will be overwritten if a loaded document contains a name.
  19445. */
  19446. export class CzmlDataSource {
  19447. constructor(name?: string);
  19448. /**
  19449. * Creates a Promise to a new instance loaded with the provided CZML data.
  19450. * @param czml - A url or CZML object to be processed.
  19451. * @param [options] - An object specifying configuration options
  19452. * @returns A promise that resolves to the new instance once the data is processed.
  19453. */
  19454. static load(czml: Resource | string | any, options?: CzmlDataSource.LoadOptions): Promise<CzmlDataSource>;
  19455. /**
  19456. * Gets a human-readable name for this instance.
  19457. */
  19458. name: string;
  19459. /**
  19460. * Gets the clock settings defined by the loaded CZML. If no clock is explicitly
  19461. * defined in the CZML, the combined availability of all objects is returned. If
  19462. * only static data exists, this value is undefined.
  19463. */
  19464. clock: DataSourceClock;
  19465. /**
  19466. * Gets the collection of {@link Entity} instances.
  19467. */
  19468. entities: EntityCollection;
  19469. /**
  19470. * Gets a value indicating if the data source is currently loading data.
  19471. */
  19472. isLoading: boolean;
  19473. /**
  19474. * Gets an event that will be raised when the underlying data changes.
  19475. */
  19476. changedEvent: Event;
  19477. /**
  19478. * Gets an event that will be raised if an error is encountered during processing.
  19479. */
  19480. errorEvent: Event;
  19481. /**
  19482. * Gets an event that will be raised when the data source either starts or stops loading.
  19483. */
  19484. loadingEvent: Event;
  19485. /**
  19486. * Gets whether or not this data source should be displayed.
  19487. */
  19488. show: boolean;
  19489. /**
  19490. * Gets or sets the clustering options for this data source. This object can be shared between multiple data sources.
  19491. */
  19492. clustering: EntityCluster;
  19493. /**
  19494. * Gets the credit that will be displayed for the data source
  19495. */
  19496. credit: Credit;
  19497. /**
  19498. * Gets the array of CZML processing functions.
  19499. */
  19500. static updaters: CzmlDataSource.UpdaterFunction[];
  19501. /**
  19502. * Processes the provided url or CZML object without clearing any existing data.
  19503. * @param czml - A url or CZML object to be processed.
  19504. * @param [options] - An object specifying configuration options
  19505. * @returns A promise that resolves to this instances once the data is processed.
  19506. */
  19507. process(czml: Resource | string | any, options?: CzmlDataSource.LoadOptions): Promise<CzmlDataSource>;
  19508. /**
  19509. * Loads the provided url or CZML object, replacing any existing data.
  19510. * @param czml - A url or CZML object to be processed.
  19511. * @param [options] - An object specifying configuration options
  19512. * @returns A promise that resolves to this instances once the data is processed.
  19513. */
  19514. load(czml: Resource | string | any, options?: CzmlDataSource.LoadOptions): Promise<CzmlDataSource>;
  19515. /**
  19516. * Updates the data source to the provided time. This function is optional and
  19517. * is not required to be implemented. It is provided for data sources which
  19518. * retrieve data based on the current animation time or scene state.
  19519. * If implemented, update will be called by {@link DataSourceDisplay} once a frame.
  19520. * @param time - The simulation time.
  19521. * @returns True if this data source is ready to be displayed at the provided time, false otherwise.
  19522. */
  19523. update(time: JulianDate): boolean;
  19524. /**
  19525. * A helper function used by custom CZML updater functions
  19526. * which creates or updates a {@link Property} from a CZML packet.
  19527. * @param type - The constructor function for the property being processed.
  19528. * @param object - The object on which the property will be added or updated.
  19529. * @param propertyName - The name of the property on the object.
  19530. * @param packetData - The CZML packet being processed.
  19531. * @param interval - A constraining interval for which the data is valid.
  19532. * @param sourceUri - The originating uri of the data being processed.
  19533. * @param entityCollection - The collection being processsed.
  19534. */
  19535. static processPacketData(type: (...params: any[]) => any, object: any, propertyName: string, packetData: any, interval: TimeInterval, sourceUri: string, entityCollection: EntityCollection): void;
  19536. /**
  19537. * A helper function used by custom CZML updater functions
  19538. * which creates or updates a {@link PositionProperty} from a CZML packet.
  19539. * @param object - The object on which the property will be added or updated.
  19540. * @param propertyName - The name of the property on the object.
  19541. * @param packetData - The CZML packet being processed.
  19542. * @param interval - A constraining interval for which the data is valid.
  19543. * @param sourceUri - The originating uri of the data being processed.
  19544. * @param entityCollection - The collection being processsed.
  19545. */
  19546. static processPositionPacketData(object: any, propertyName: string, packetData: any, interval: TimeInterval, sourceUri: string, entityCollection: EntityCollection): void;
  19547. /**
  19548. * A helper function used by custom CZML updater functions
  19549. * which creates or updates a {@link MaterialProperty} from a CZML packet.
  19550. * @param object - The object on which the property will be added or updated.
  19551. * @param propertyName - The name of the property on the object.
  19552. * @param packetData - The CZML packet being processed.
  19553. * @param interval - A constraining interval for which the data is valid.
  19554. * @param sourceUri - The originating uri of the data being processed.
  19555. * @param entityCollection - The collection being processsed.
  19556. */
  19557. static processMaterialPacketData(object: any, propertyName: string, packetData: any, interval: TimeInterval, sourceUri: string, entityCollection: EntityCollection): void;
  19558. }
  19559. /**
  19560. * Defines the interface for data sources, which turn arbitrary data into a
  19561. * {@link EntityCollection} for generic consumption. This object is an interface
  19562. * for documentation purposes and is not intended to be instantiated directly.
  19563. */
  19564. export class DataSource {
  19565. constructor();
  19566. /**
  19567. * Gets a human-readable name for this instance.
  19568. */
  19569. name: string;
  19570. /**
  19571. * Gets the preferred clock settings for this data source.
  19572. */
  19573. clock: DataSourceClock;
  19574. /**
  19575. * Gets the collection of {@link Entity} instances.
  19576. */
  19577. entities: EntityCollection;
  19578. /**
  19579. * Gets a value indicating if the data source is currently loading data.
  19580. */
  19581. isLoading: boolean;
  19582. /**
  19583. * Gets an event that will be raised when the underlying data changes.
  19584. */
  19585. changedEvent: Event;
  19586. /**
  19587. * Gets an event that will be raised if an error is encountered during processing.
  19588. */
  19589. errorEvent: Event<(arg0: this, arg1: RequestErrorEvent) => void>;
  19590. /**
  19591. * Gets an event that will be raised when the value of isLoading changes.
  19592. */
  19593. loadingEvent: Event<(arg0: this, arg1: boolean) => void>;
  19594. /**
  19595. * Gets whether or not this data source should be displayed.
  19596. */
  19597. show: boolean;
  19598. /**
  19599. * Gets or sets the clustering options for this data source. This object can be shared between multiple data sources.
  19600. */
  19601. clustering: EntityCluster;
  19602. /**
  19603. * Updates the data source to the provided time. This function is optional and
  19604. * is not required to be implemented. It is provided for data sources which
  19605. * retrieve data based on the current animation time or scene state.
  19606. * If implemented, update will be called by {@link DataSourceDisplay} once a frame.
  19607. * @param time - The simulation time.
  19608. * @returns True if this data source is ready to be displayed at the provided time, false otherwise.
  19609. */
  19610. update(time: JulianDate): boolean;
  19611. }
  19612. /**
  19613. * Represents desired clock settings for a particular {@link DataSource}. These settings may be applied
  19614. * to the {@link Clock} when the DataSource is loaded.
  19615. */
  19616. export class DataSourceClock {
  19617. constructor();
  19618. /**
  19619. * Gets the event that is raised whenever a new property is assigned.
  19620. */
  19621. readonly definitionChanged: Event;
  19622. /**
  19623. * Gets or sets the desired start time of the clock.
  19624. * See {@link Clock#startTime}.
  19625. */
  19626. startTime: JulianDate;
  19627. /**
  19628. * Gets or sets the desired stop time of the clock.
  19629. * See {@link Clock#stopTime}.
  19630. */
  19631. stopTime: JulianDate;
  19632. /**
  19633. * Gets or sets the desired current time when this data source is loaded.
  19634. * See {@link Clock#currentTime}.
  19635. */
  19636. currentTime: JulianDate;
  19637. /**
  19638. * Gets or sets the desired clock range setting.
  19639. * See {@link Clock#clockRange}.
  19640. */
  19641. clockRange: ClockRange;
  19642. /**
  19643. * Gets or sets the desired clock step setting.
  19644. * See {@link Clock#clockStep}.
  19645. */
  19646. clockStep: ClockStep;
  19647. /**
  19648. * Gets or sets the desired clock multiplier.
  19649. * See {@link Clock#multiplier}.
  19650. */
  19651. multiplier: number;
  19652. /**
  19653. * Duplicates a DataSourceClock instance.
  19654. * @param [result] - The object onto which to store the result.
  19655. * @returns The modified result parameter or a new instance if one was not provided.
  19656. */
  19657. clone(result?: DataSourceClock): DataSourceClock;
  19658. /**
  19659. * Returns true if this DataSourceClock is equivalent to the other
  19660. * @param other - The other DataSourceClock to compare to.
  19661. * @returns <code>true</code> if the DataSourceClocks are equal; otherwise, <code>false</code>.
  19662. */
  19663. equals(other: DataSourceClock): boolean;
  19664. /**
  19665. * Assigns each unassigned property on this object to the value
  19666. * of the same property on the provided source object.
  19667. * @param source - The object to be merged into this object.
  19668. */
  19669. merge(source: DataSourceClock): void;
  19670. /**
  19671. * Gets the value of this clock instance as a {@link Clock} object.
  19672. * @returns The modified result parameter or a new instance if one was not provided.
  19673. */
  19674. getValue(): Clock;
  19675. }
  19676. /**
  19677. * A collection of {@link DataSource} instances.
  19678. */
  19679. export class DataSourceCollection {
  19680. constructor();
  19681. /**
  19682. * Gets the number of data sources in this collection.
  19683. */
  19684. readonly length: number;
  19685. /**
  19686. * An event that is raised when a data source is added to the collection.
  19687. * Event handlers are passed the data source that was added.
  19688. */
  19689. readonly dataSourceAdded: Event;
  19690. /**
  19691. * An event that is raised when a data source is removed from the collection.
  19692. * Event handlers are passed the data source that was removed.
  19693. */
  19694. readonly dataSourceRemoved: Event;
  19695. /**
  19696. * An event that is raised when a data source changes position in the collection. Event handlers are passed the data source
  19697. * that was moved, its new index after the move, and its old index prior to the move.
  19698. */
  19699. readonly dataSourceMoved: Event;
  19700. /**
  19701. * Adds a data source to the collection.
  19702. * @param dataSource - A data source or a promise to a data source to add to the collection.
  19703. * When passing a promise, the data source will not actually be added
  19704. * to the collection until the promise resolves successfully.
  19705. * @returns A Promise that resolves once the data source has been added to the collection.
  19706. */
  19707. add(dataSource: DataSource | Promise<DataSource>): Promise<DataSource>;
  19708. /**
  19709. * Removes a data source from this collection, if present.
  19710. * @param dataSource - The data source to remove.
  19711. * @param [destroy = false] - Whether to destroy the data source in addition to removing it.
  19712. * @returns true if the data source was in the collection and was removed,
  19713. * false if the data source was not in the collection.
  19714. */
  19715. remove(dataSource: DataSource, destroy?: boolean): boolean;
  19716. /**
  19717. * Removes all data sources from this collection.
  19718. * @param [destroy = false] - whether to destroy the data sources in addition to removing them.
  19719. */
  19720. removeAll(destroy?: boolean): void;
  19721. /**
  19722. * Checks to see if the collection contains a given data source.
  19723. * @param dataSource - The data source to check for.
  19724. * @returns true if the collection contains the data source, false otherwise.
  19725. */
  19726. contains(dataSource: DataSource): boolean;
  19727. /**
  19728. * Determines the index of a given data source in the collection.
  19729. * @param dataSource - The data source to find the index of.
  19730. * @returns The index of the data source in the collection, or -1 if the data source does not exist in the collection.
  19731. */
  19732. indexOf(dataSource: DataSource): number;
  19733. /**
  19734. * Gets a data source by index from the collection.
  19735. * @param index - the index to retrieve.
  19736. * @returns The data source at the specified index.
  19737. */
  19738. get(index: number): DataSource;
  19739. /**
  19740. * Gets a data source by name from the collection.
  19741. * @param name - The name to retrieve.
  19742. * @returns A list of all data sources matching the provided name.
  19743. */
  19744. getByName(name: string): DataSource[];
  19745. /**
  19746. * Raises a data source up one position in the collection.
  19747. * @param dataSource - The data source to move.
  19748. */
  19749. raise(dataSource: DataSource): void;
  19750. /**
  19751. * Lowers a data source down one position in the collection.
  19752. * @param dataSource - The data source to move.
  19753. */
  19754. lower(dataSource: DataSource): void;
  19755. /**
  19756. * Raises a data source to the top of the collection.
  19757. * @param dataSource - The data source to move.
  19758. */
  19759. raiseToTop(dataSource: DataSource): void;
  19760. /**
  19761. * Lowers a data source to the bottom of the collection.
  19762. * @param dataSource - The data source to move.
  19763. */
  19764. lowerToBottom(dataSource: DataSource): void;
  19765. /**
  19766. * Returns true if this object was destroyed; otherwise, false.
  19767. * If this object was destroyed, it should not be used; calling any function other than
  19768. * <code>isDestroyed</code> will result in a {@link DeveloperError} exception.
  19769. * @returns true if this object was destroyed; otherwise, false.
  19770. */
  19771. isDestroyed(): boolean;
  19772. /**
  19773. * Destroys the resources held by all data sources in this collection. Explicitly destroying this
  19774. * object allows for deterministic release of WebGL resources, instead of relying on the garbage
  19775. * collector. Once this object is destroyed, it should not be used; calling any function other than
  19776. * <code>isDestroyed</code> will result in a {@link DeveloperError} exception. Therefore,
  19777. * assign the return value (<code>undefined</code>) to the object as done in the example.
  19778. * @example
  19779. * dataSourceCollection = dataSourceCollection && dataSourceCollection.destroy();
  19780. */
  19781. destroy(): void;
  19782. }
  19783. /**
  19784. * Visualizes a collection of {@link DataSource} instances.
  19785. * @param options - Object with the following properties:
  19786. * @param options.scene - The scene in which to display the data.
  19787. * @param options.dataSourceCollection - The data sources to display.
  19788. * @param [options.visualizersCallback = DataSourceDisplay.defaultVisualizersCallback] - A function which creates an array of visualizers used for visualization.
  19789. * If undefined, all standard visualizers are used.
  19790. */
  19791. export class DataSourceDisplay {
  19792. constructor(options: {
  19793. scene: Scene;
  19794. dataSourceCollection: DataSourceCollection;
  19795. visualizersCallback?: DataSourceDisplay.VisualizersCallback;
  19796. });
  19797. /**
  19798. * Gets or sets the default function which creates an array of visualizers used for visualization.
  19799. * By default, this function uses all standard visualizers.
  19800. */
  19801. static defaultVisualizersCallback(): void;
  19802. /**
  19803. * Gets the scene associated with this display.
  19804. */
  19805. scene: Scene;
  19806. /**
  19807. * Gets the collection of data sources to display.
  19808. */
  19809. dataSources: DataSourceCollection;
  19810. /**
  19811. * Gets the default data source instance which can be used to
  19812. * manually create and visualize entities not tied to
  19813. * a specific data source. This instance is always available
  19814. * and does not appear in the list dataSources collection.
  19815. */
  19816. defaultDataSource: CustomDataSource;
  19817. /**
  19818. * Gets a value indicating whether or not all entities in the data source are ready
  19819. */
  19820. readonly ready: boolean;
  19821. /**
  19822. * Returns true if this object was destroyed; otherwise, false.
  19823. * <br /><br />
  19824. * If this object was destroyed, it should not be used; calling any function other than
  19825. * <code>isDestroyed</code> will result in a {@link DeveloperError} exception.
  19826. * @returns True if this object was destroyed; otherwise, false.
  19827. */
  19828. isDestroyed(): boolean;
  19829. /**
  19830. * Destroys the WebGL resources held by this object. Destroying an object allows for deterministic
  19831. * release of WebGL resources, instead of relying on the garbage collector to destroy this object.
  19832. * <br /><br />
  19833. * Once an object is destroyed, it should not be used; calling any function other than
  19834. * <code>isDestroyed</code> will result in a {@link DeveloperError} exception. Therefore,
  19835. * assign the return value (<code>undefined</code>) to the object as done in the example.
  19836. * @example
  19837. * dataSourceDisplay = dataSourceDisplay.destroy();
  19838. */
  19839. destroy(): void;
  19840. /**
  19841. * Updates the display to the provided time.
  19842. * @param time - The simulation time.
  19843. * @returns True if all data sources are ready to be displayed, false otherwise.
  19844. */
  19845. update(time: JulianDate): boolean;
  19846. }
  19847. export namespace DataSourceDisplay {
  19848. /**
  19849. * A function which creates an array of visualizers used for visualization.
  19850. * @example
  19851. * function createVisualizers(scene, dataSource) {
  19852. * return [new Cesium.BillboardVisualizer(scene, dataSource.entities)];
  19853. * }
  19854. * @param scene - The scene to create visualizers for.
  19855. * @param dataSource - The data source to create visualizers for.
  19856. */
  19857. type VisualizersCallback = (scene: Scene, dataSource: DataSource) => Visualizer[];
  19858. }
  19859. /**
  19860. * A {@link GeometryUpdater} for ellipses.
  19861. * Clients do not normally create this class directly, but instead rely on {@link DataSourceDisplay}.
  19862. * @param entity - The entity containing the geometry to be visualized.
  19863. * @param scene - The scene where visualization is taking place.
  19864. */
  19865. export class EllipseGeometryUpdater {
  19866. constructor(entity: Entity, scene: Scene);
  19867. /**
  19868. * Creates the geometry instance which represents the fill of the geometry.
  19869. * @param time - The time to use when retrieving initial attribute values.
  19870. * @returns The geometry instance representing the filled portion of the geometry.
  19871. */
  19872. createFillGeometryInstance(time: JulianDate): GeometryInstance;
  19873. /**
  19874. * Creates the geometry instance which represents the outline of the geometry.
  19875. * @param time - The time to use when retrieving initial attribute values.
  19876. * @returns The geometry instance representing the outline portion of the geometry.
  19877. */
  19878. createOutlineGeometryInstance(time: JulianDate): GeometryInstance;
  19879. /**
  19880. * Gets a value indicating if the geometry should be drawn on terrain.
  19881. */
  19882. readonly onTerrain: boolean;
  19883. }
  19884. export namespace EllipseGraphics {
  19885. /**
  19886. * Initialization options for the EllipseGraphics constructor
  19887. * @property [show = true] - A boolean Property specifying the visibility of the ellipse.
  19888. * @property [semiMajorAxis] - The numeric Property specifying the semi-major axis.
  19889. * @property [semiMinorAxis] - The numeric Property specifying the semi-minor axis.
  19890. * @property [height = 0] - A numeric Property specifying the altitude of the ellipse relative to the ellipsoid surface.
  19891. * @property [heightReference = HeightReference.NONE] - A Property specifying what the height is relative to.
  19892. * @property [extrudedHeight] - A numeric Property specifying the altitude of the ellipse's extruded face relative to the ellipsoid surface.
  19893. * @property [extrudedHeightReference = HeightReference.NONE] - A Property specifying what the extrudedHeight is relative to.
  19894. * @property [rotation = 0.0] - A numeric property specifying the rotation of the ellipse counter-clockwise from north.
  19895. * @property [stRotation = 0.0] - A numeric property specifying the rotation of the ellipse texture counter-clockwise from north.
  19896. * @property [granularity = Cesium.Math.RADIANS_PER_DEGREE] - A numeric Property specifying the angular distance between points on the ellipse.
  19897. * @property [fill = true] - A boolean Property specifying whether the ellipse is filled with the provided material.
  19898. * @property [material = Color.WHITE] - A Property specifying the material used to fill the ellipse.
  19899. * @property [outline = false] - A boolean Property specifying whether the ellipse is outlined.
  19900. * @property [outlineColor = Color.BLACK] - A Property specifying the {@link Color} of the outline.
  19901. * @property [outlineWidth = 1.0] - A numeric Property specifying the width of the outline.
  19902. * @property [numberOfVerticalLines = 16] - A numeric Property specifying the number of vertical lines to draw along the perimeter for the outline.
  19903. * @property [shadows = ShadowMode.DISABLED] - An enum Property specifying whether the ellipse casts or receives shadows from light sources.
  19904. * @property [distanceDisplayCondition] - A Property specifying at what distance from the camera that this ellipse will be displayed.
  19905. * @property [classificationType = ClassificationType.BOTH] - An enum Property specifying whether this ellipse will classify terrain, 3D Tiles, or both when on the ground.
  19906. * @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.
  19907. */
  19908. type ConstructorOptions = {
  19909. show?: Property | boolean;
  19910. semiMajorAxis?: Property | number;
  19911. semiMinorAxis?: Property | number;
  19912. height?: Property | number;
  19913. heightReference?: Property | HeightReference;
  19914. extrudedHeight?: Property | number;
  19915. extrudedHeightReference?: Property | HeightReference;
  19916. rotation?: Property | number;
  19917. stRotation?: Property | number;
  19918. granularity?: Property | number;
  19919. fill?: Property | boolean;
  19920. material?: MaterialProperty | Color;
  19921. outline?: Property | boolean;
  19922. outlineColor?: Property | Color;
  19923. outlineWidth?: Property | number;
  19924. numberOfVerticalLines?: Property | number;
  19925. shadows?: Property | ShadowMode;
  19926. distanceDisplayCondition?: Property | DistanceDisplayCondition;
  19927. classificationType?: Property | ClassificationType;
  19928. zIndex?: ConstantProperty | number;
  19929. };
  19930. }
  19931. /**
  19932. * Describes an ellipse defined by a center point and semi-major and semi-minor axes.
  19933. * The ellipse conforms to the curvature of the globe and can be placed on the surface or
  19934. * at altitude and can optionally be extruded into a volume.
  19935. * The center point is determined by the containing {@link Entity}.
  19936. * @param [options] - Object describing initialization options
  19937. */
  19938. export class EllipseGraphics {
  19939. constructor(options?: EllipseGraphics.ConstructorOptions);
  19940. /**
  19941. * Gets the event that is raised whenever a property or sub-property is changed or modified.
  19942. */
  19943. readonly definitionChanged: Event;
  19944. /**
  19945. * Gets or sets the boolean Property specifying the visibility of the ellipse.
  19946. */
  19947. show: Property | undefined;
  19948. /**
  19949. * Gets or sets the numeric Property specifying the semi-major axis.
  19950. */
  19951. semiMajorAxis: Property | undefined;
  19952. /**
  19953. * Gets or sets the numeric Property specifying the semi-minor axis.
  19954. */
  19955. semiMinorAxis: Property | undefined;
  19956. /**
  19957. * Gets or sets the numeric Property specifying the altitude of the ellipse.
  19958. */
  19959. height: Property | undefined;
  19960. /**
  19961. * Gets or sets the Property specifying the {@link HeightReference}.
  19962. */
  19963. heightReference: Property | undefined;
  19964. /**
  19965. * Gets or sets the numeric Property specifying the altitude of the ellipse extrusion.
  19966. * Setting this property creates volume starting at height and ending at this altitude.
  19967. */
  19968. extrudedHeight: Property | undefined;
  19969. /**
  19970. * Gets or sets the Property specifying the extruded {@link HeightReference}.
  19971. */
  19972. extrudedHeightReference: Property | undefined;
  19973. /**
  19974. * Gets or sets the numeric property specifying the rotation of the ellipse counter-clockwise from north.
  19975. */
  19976. rotation: Property | undefined;
  19977. /**
  19978. * Gets or sets the numeric property specifying the rotation of the ellipse texture counter-clockwise from north.
  19979. */
  19980. stRotation: Property | undefined;
  19981. /**
  19982. * Gets or sets the numeric Property specifying the angular distance between points on the ellipse.
  19983. */
  19984. granularity: Property | undefined;
  19985. /**
  19986. * Gets or sets the boolean Property specifying whether the ellipse is filled with the provided material.
  19987. */
  19988. fill: Property | undefined;
  19989. /**
  19990. * Gets or sets the Property specifying the material used to fill the ellipse.
  19991. */
  19992. material: MaterialProperty | undefined;
  19993. /**
  19994. * Gets or sets the Property specifying whether the ellipse is outlined.
  19995. */
  19996. outline: Property | undefined;
  19997. /**
  19998. * Gets or sets the Property specifying the {@link Color} of the outline.
  19999. */
  20000. outlineColor: Property | undefined;
  20001. /**
  20002. * Gets or sets the numeric Property specifying the width of the outline.
  20003. * <p>
  20004. * Note: This property will be ignored on all major browsers on Windows platforms. For details, see (@link https://github.com/CesiumGS/cesium/issues/40}.
  20005. * </p>
  20006. */
  20007. outlineWidth: Property | undefined;
  20008. /**
  20009. * Gets or sets the numeric Property specifying the number of vertical lines to draw along the perimeter for the outline.
  20010. */
  20011. numberOfVerticalLines: Property | undefined;
  20012. /**
  20013. * Get or sets the enum Property specifying whether the ellipse
  20014. * casts or receives shadows from light sources.
  20015. */
  20016. shadows: Property | undefined;
  20017. /**
  20018. * Gets or sets the {@link DistanceDisplayCondition} Property specifying at what distance from the camera that this ellipse will be displayed.
  20019. */
  20020. distanceDisplayCondition: Property | undefined;
  20021. /**
  20022. * Gets or sets the {@link ClassificationType} Property specifying whether this ellipse will classify terrain, 3D Tiles, or both when on the ground.
  20023. */
  20024. classificationType: Property | undefined;
  20025. /**
  20026. * 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
  20027. */
  20028. zIndex: ConstantProperty | undefined;
  20029. /**
  20030. * Duplicates this instance.
  20031. * @param [result] - The object onto which to store the result.
  20032. * @returns The modified result parameter or a new instance if one was not provided.
  20033. */
  20034. clone(result?: EllipseGraphics): EllipseGraphics;
  20035. /**
  20036. * Assigns each unassigned property on this object to the value
  20037. * of the same property on the provided source object.
  20038. * @param source - The object to be merged into this object.
  20039. */
  20040. merge(source: EllipseGraphics): void;
  20041. }
  20042. /**
  20043. * A {@link GeometryUpdater} for ellipsoids.
  20044. * Clients do not normally create this class directly, but instead rely on {@link DataSourceDisplay}.
  20045. * @param entity - The entity containing the geometry to be visualized.
  20046. * @param scene - The scene where visualization is taking place.
  20047. */
  20048. export class EllipsoidGeometryUpdater {
  20049. constructor(entity: Entity, scene: Scene);
  20050. /**
  20051. * Creates the geometry instance which represents the fill of the geometry.
  20052. * @param time - The time to use when retrieving initial attribute values.
  20053. * @param [skipModelMatrix = false] - Whether to compute a model matrix for the geometry instance
  20054. * @param [modelMatrixResult] - Used to store the result of the model matrix calculation
  20055. * @returns The geometry instance representing the filled portion of the geometry.
  20056. */
  20057. createFillGeometryInstance(time: JulianDate, skipModelMatrix?: boolean, modelMatrixResult?: Matrix4): GeometryInstance;
  20058. /**
  20059. * Creates the geometry instance which represents the outline 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 outline portion of the geometry.
  20064. */
  20065. createOutlineGeometryInstance(time: JulianDate, skipModelMatrix?: boolean, modelMatrixResult?: Matrix4): GeometryInstance;
  20066. }
  20067. export namespace EllipsoidGraphics {
  20068. /**
  20069. * Initialization options for the EllipsoidGraphics constructor
  20070. * @property [show = true] - A boolean Property specifying the visibility of the ellipsoid.
  20071. * @property [radii] - A {@link Cartesian3} Property specifying the radii of the ellipsoid.
  20072. * @property [innerRadii] - A {@link Cartesian3} Property specifying the inner radii of the ellipsoid.
  20073. * @property [minimumClock = 0.0] - A Property specifying the minimum clock angle of the ellipsoid.
  20074. * @property [maximumClock = 2*PI] - A Property specifying the maximum clock angle of the ellipsoid.
  20075. * @property [minimumCone = 0.0] - A Property specifying the minimum cone angle of the ellipsoid.
  20076. * @property [maximumCone = PI] - A Property specifying the maximum cone angle of the ellipsoid.
  20077. * @property [heightReference = HeightReference.NONE] - A Property specifying what the height from the entity position is relative to.
  20078. * @property [fill = true] - A boolean Property specifying whether the ellipsoid is filled with the provided material.
  20079. * @property [material = Color.WHITE] - A Property specifying the material used to fill the ellipsoid.
  20080. * @property [outline = false] - A boolean Property specifying whether the ellipsoid is outlined.
  20081. * @property [outlineColor = Color.BLACK] - A Property specifying the {@link Color} of the outline.
  20082. * @property [outlineWidth = 1.0] - A numeric Property specifying the width of the outline.
  20083. * @property [stackPartitions = 64] - A Property specifying the number of stacks.
  20084. * @property [slicePartitions = 64] - A Property specifying the number of radial slices.
  20085. * @property [subdivisions = 128] - A Property specifying the number of samples per outline ring, determining the granularity of the curvature.
  20086. * @property [shadows = ShadowMode.DISABLED] - An enum Property specifying whether the ellipsoid casts or receives shadows from light sources.
  20087. * @property [distanceDisplayCondition] - A Property specifying at what distance from the camera that this ellipsoid will be displayed.
  20088. */
  20089. type ConstructorOptions = {
  20090. show?: Property | boolean;
  20091. radii?: Property | Cartesian3;
  20092. innerRadii?: Property | Cartesian3;
  20093. minimumClock?: Property | number;
  20094. maximumClock?: Property | number;
  20095. minimumCone?: Property | number;
  20096. maximumCone?: Property | number;
  20097. heightReference?: Property | HeightReference;
  20098. fill?: Property | boolean;
  20099. material?: MaterialProperty | Color;
  20100. outline?: Property | boolean;
  20101. outlineColor?: Property | Color;
  20102. outlineWidth?: Property | number;
  20103. stackPartitions?: Property | number;
  20104. slicePartitions?: Property | number;
  20105. subdivisions?: Property | number;
  20106. shadows?: Property | ShadowMode;
  20107. distanceDisplayCondition?: Property | DistanceDisplayCondition;
  20108. };
  20109. }
  20110. /**
  20111. * Describe an ellipsoid or sphere. The center position and orientation are determined by the containing {@link Entity}.
  20112. * @param [options] - Object describing initialization options
  20113. */
  20114. export class EllipsoidGraphics {
  20115. constructor(options?: EllipsoidGraphics.ConstructorOptions);
  20116. /**
  20117. * Gets the event that is raised whenever a property or sub-property is changed or modified.
  20118. */
  20119. readonly definitionChanged: Event;
  20120. /**
  20121. * Gets or sets the boolean Property specifying the visibility of the ellipsoid.
  20122. */
  20123. show: Property | undefined;
  20124. /**
  20125. * Gets or sets the {@link Cartesian3} {@link Property} specifying the radii of the ellipsoid.
  20126. */
  20127. radii: Property | undefined;
  20128. /**
  20129. * Gets or sets the {@link Cartesian3} {@link Property} specifying the inner radii of the ellipsoid.
  20130. */
  20131. innerRadii: Property | undefined;
  20132. /**
  20133. * Gets or sets the Property specifying the minimum clock angle of the ellipsoid.
  20134. */
  20135. minimumClock: Property | undefined;
  20136. /**
  20137. * Gets or sets the Property specifying the maximum clock angle of the ellipsoid.
  20138. */
  20139. maximumClock: Property | undefined;
  20140. /**
  20141. * Gets or sets the Property specifying the minimum cone angle of the ellipsoid.
  20142. */
  20143. minimumCone: Property | undefined;
  20144. /**
  20145. * Gets or sets the Property specifying the maximum cone angle of the ellipsoid.
  20146. */
  20147. maximumCone: Property | undefined;
  20148. /**
  20149. * Gets or sets the Property specifying the {@link HeightReference}.
  20150. */
  20151. heightReference: Property | undefined;
  20152. /**
  20153. * Gets or sets the boolean Property specifying whether the ellipsoid is filled with the provided material.
  20154. */
  20155. fill: Property | undefined;
  20156. /**
  20157. * Gets or sets the Property specifying the material used to fill the ellipsoid.
  20158. */
  20159. material: MaterialProperty;
  20160. /**
  20161. * Gets or sets the Property specifying whether the ellipsoid is outlined.
  20162. */
  20163. outline: Property | undefined;
  20164. /**
  20165. * Gets or sets the Property specifying the {@link Color} of the outline.
  20166. */
  20167. outlineColor: Property | undefined;
  20168. /**
  20169. * Gets or sets the numeric Property specifying the width of the outline.
  20170. * <p>
  20171. * Note: This property will be ignored on all major browsers on Windows platforms. For details, see (@link https://github.com/CesiumGS/cesium/issues/40}.
  20172. * </p>
  20173. */
  20174. outlineWidth: Property | undefined;
  20175. /**
  20176. * Gets or sets the Property specifying the number of stacks.
  20177. */
  20178. stackPartitions: Property | undefined;
  20179. /**
  20180. * Gets or sets the Property specifying the number of radial slices per 360 degrees.
  20181. */
  20182. slicePartitions: Property | undefined;
  20183. /**
  20184. * Gets or sets the Property specifying the number of samples per outline ring, determining the granularity of the curvature.
  20185. */
  20186. subdivisions: Property | undefined;
  20187. /**
  20188. * Get or sets the enum Property specifying whether the ellipsoid
  20189. * casts or receives shadows from light sources.
  20190. */
  20191. shadows: Property | undefined;
  20192. /**
  20193. * Gets or sets the {@link DistanceDisplayCondition} Property specifying at what distance from the camera that this ellipsoid will be displayed.
  20194. */
  20195. distanceDisplayCondition: Property | undefined;
  20196. /**
  20197. * Duplicates this instance.
  20198. * @param [result] - The object onto which to store the result.
  20199. * @returns The modified result parameter or a new instance if one was not provided.
  20200. */
  20201. clone(result?: EllipsoidGraphics): EllipsoidGraphics;
  20202. /**
  20203. * Assigns each unassigned property on this object to the value
  20204. * of the same property on the provided source object.
  20205. * @param source - The object to be merged into this object.
  20206. */
  20207. merge(source: EllipsoidGraphics): void;
  20208. }
  20209. export namespace Entity {
  20210. /**
  20211. * Initialization options for the Entity constructor
  20212. * @property [id] - A unique identifier for this object. If none is provided, a GUID is generated.
  20213. * @property [name] - A human readable name to display to users. It does not have to be unique.
  20214. * @property [availability] - The availability, if any, associated with this object.
  20215. * @property [show] - A boolean value indicating if the entity and its children are displayed.
  20216. * @property [description] - A string Property specifying an HTML description for this entity.
  20217. * @property [position] - A Property specifying the entity position.
  20218. * @property [orientation] - A Property specifying the entity orientation.
  20219. * @property [viewFrom] - A suggested initial offset for viewing this object.
  20220. * @property [parent] - A parent entity to associate with this entity.
  20221. * @property [billboard] - A billboard to associate with this entity.
  20222. * @property [box] - A box to associate with this entity.
  20223. * @property [corridor] - A corridor to associate with this entity.
  20224. * @property [cylinder] - A cylinder to associate with this entity.
  20225. * @property [ellipse] - A ellipse to associate with this entity.
  20226. * @property [ellipsoid] - A ellipsoid to associate with this entity.
  20227. * @property [label] - A options.label to associate with this entity.
  20228. * @property [model] - A model to associate with this entity.
  20229. * @property [tileset] - A 3D Tiles tileset to associate with this entity.
  20230. * @property [path] - A path to associate with this entity.
  20231. * @property [plane] - A plane to associate with this entity.
  20232. * @property [point] - A point to associate with this entity.
  20233. * @property [polygon] - A polygon to associate with this entity.
  20234. * @property [polyline] - A polyline to associate with this entity.
  20235. * @property [properties] - Arbitrary properties to associate with this entity.
  20236. * @property [polylineVolume] - A polylineVolume to associate with this entity.
  20237. * @property [rectangle] - A rectangle to associate with this entity.
  20238. * @property [wall] - A wall to associate with this entity.
  20239. */
  20240. type ConstructorOptions = {
  20241. id?: string;
  20242. name?: string;
  20243. availability?: TimeIntervalCollection;
  20244. show?: boolean;
  20245. description?: Property | string;
  20246. position?: PositionProperty | Cartesian3;
  20247. orientation?: Property;
  20248. viewFrom?: Property;
  20249. parent?: Entity;
  20250. billboard?: BillboardGraphics | BillboardGraphics.ConstructorOptions;
  20251. box?: BoxGraphics | BoxGraphics.ConstructorOptions;
  20252. corridor?: CorridorGraphics | CorridorGraphics.ConstructorOptions;
  20253. cylinder?: CylinderGraphics | CylinderGraphics.ConstructorOptions;
  20254. ellipse?: EllipseGraphics | EllipseGraphics.ConstructorOptions;
  20255. ellipsoid?: EllipsoidGraphics | EllipsoidGraphics.ConstructorOptions;
  20256. label?: LabelGraphics | LabelGraphics.ConstructorOptions;
  20257. model?: ModelGraphics | ModelGraphics.ConstructorOptions;
  20258. tileset?: Cesium3DTilesetGraphics | Cesium3DTilesetGraphics.ConstructorOptions;
  20259. path?: PathGraphics | PathGraphics.ConstructorOptions;
  20260. plane?: PlaneGraphics | PlaneGraphics.ConstructorOptions;
  20261. point?: PointGraphics | PointGraphics.ConstructorOptions;
  20262. polygon?: PolygonGraphics | PolygonGraphics.ConstructorOptions;
  20263. polyline?: PolylineGraphics | PolylineGraphics.ConstructorOptions;
  20264. properties?: PropertyBag | {
  20265. [key: string]: any;
  20266. };
  20267. polylineVolume?: PolylineVolumeGraphics | PolylineVolumeGraphics.ConstructorOptions;
  20268. rectangle?: RectangleGraphics | RectangleGraphics.ConstructorOptions;
  20269. wall?: WallGraphics | WallGraphics.ConstructorOptions;
  20270. };
  20271. }
  20272. /**
  20273. * Entity instances aggregate multiple forms of visualization into a single high-level object.
  20274. * They can be created manually and added to {@link Viewer#entities} or be produced by
  20275. * data sources, such as {@link CzmlDataSource} and {@link GeoJsonDataSource}.
  20276. * @param [options] - Object describing initialization options
  20277. */
  20278. export class Entity {
  20279. constructor(options?: Entity.ConstructorOptions);
  20280. /**
  20281. * Gets or sets the entity collection that this entity belongs to.
  20282. */
  20283. entityCollection: EntityCollection;
  20284. /**
  20285. * The availability, if any, associated with this object.
  20286. * If availability is undefined, it is assumed that this object's
  20287. * other properties will return valid data for any provided time.
  20288. * If availability exists, the objects other properties will only
  20289. * provide valid data if queried within the given interval.
  20290. */
  20291. availability: TimeIntervalCollection | undefined;
  20292. /**
  20293. * Gets the unique ID associated with this object.
  20294. */
  20295. id: string;
  20296. /**
  20297. * Gets the event that is raised whenever a property or sub-property is changed or modified.
  20298. */
  20299. readonly definitionChanged: Event;
  20300. /**
  20301. * Gets or sets the name of the object. The name is intended for end-user
  20302. * consumption and does not need to be unique.
  20303. */
  20304. name: string | undefined;
  20305. /**
  20306. * Gets or sets whether this entity should be displayed. When set to true,
  20307. * the entity is only displayed if the parent entity's show property is also true.
  20308. */
  20309. show: boolean;
  20310. /**
  20311. * Gets whether this entity is being displayed, taking into account
  20312. * the visibility of any ancestor entities.
  20313. */
  20314. isShowing: boolean;
  20315. /**
  20316. * Gets or sets the parent object.
  20317. */
  20318. parent: Entity | undefined;
  20319. /**
  20320. * Gets the names of all properties registered on this instance.
  20321. */
  20322. propertyNames: string[];
  20323. /**
  20324. * Gets or sets the billboard.
  20325. */
  20326. billboard: BillboardGraphics | undefined;
  20327. /**
  20328. * Gets or sets the box.
  20329. */
  20330. box: BoxGraphics | undefined;
  20331. /**
  20332. * Gets or sets the corridor.
  20333. */
  20334. corridor: CorridorGraphics | undefined;
  20335. /**
  20336. * Gets or sets the cylinder.
  20337. */
  20338. cylinder: CylinderGraphics | undefined;
  20339. /**
  20340. * Gets or sets the description.
  20341. */
  20342. description: Property | undefined;
  20343. /**
  20344. * Gets or sets the ellipse.
  20345. */
  20346. ellipse: EllipseGraphics | undefined;
  20347. /**
  20348. * Gets or sets the ellipsoid.
  20349. */
  20350. ellipsoid: EllipsoidGraphics | undefined;
  20351. /**
  20352. * Gets or sets the label.
  20353. */
  20354. label: LabelGraphics | undefined;
  20355. /**
  20356. * Gets or sets the model.
  20357. */
  20358. model: ModelGraphics | undefined;
  20359. /**
  20360. * Gets or sets the tileset.
  20361. */
  20362. tileset: Cesium3DTilesetGraphics | undefined;
  20363. /**
  20364. * Gets or sets the orientation.
  20365. */
  20366. orientation: Property | undefined;
  20367. /**
  20368. * Gets or sets the path.
  20369. */
  20370. path: PathGraphics | undefined;
  20371. /**
  20372. * Gets or sets the plane.
  20373. */
  20374. plane: PlaneGraphics | undefined;
  20375. /**
  20376. * Gets or sets the point graphic.
  20377. */
  20378. point: PointGraphics | undefined;
  20379. /**
  20380. * Gets or sets the polygon.
  20381. */
  20382. polygon: PolygonGraphics | undefined;
  20383. /**
  20384. * Gets or sets the polyline.
  20385. */
  20386. polyline: PolylineGraphics | undefined;
  20387. /**
  20388. * Gets or sets the polyline volume.
  20389. */
  20390. polylineVolume: PolylineVolumeGraphics | undefined;
  20391. /**
  20392. * Gets or sets the bag of arbitrary properties associated with this entity.
  20393. */
  20394. properties: PropertyBag | undefined;
  20395. /**
  20396. * Gets or sets the position.
  20397. */
  20398. position: PositionProperty | undefined;
  20399. /**
  20400. * Gets or sets the rectangle.
  20401. */
  20402. rectangle: RectangleGraphics | undefined;
  20403. /**
  20404. * Gets or sets the suggested initial offset when tracking this object.
  20405. * The offset is typically defined in the east-north-up reference frame,
  20406. * but may be another frame depending on the object's velocity.
  20407. */
  20408. viewFrom: Property | undefined;
  20409. /**
  20410. * Gets or sets the wall.
  20411. */
  20412. wall: WallGraphics | undefined;
  20413. /**
  20414. * Given a time, returns true if this object should have data during that time.
  20415. * @param time - The time to check availability for.
  20416. * @returns true if the object should have data during the provided time, false otherwise.
  20417. */
  20418. isAvailable(time: JulianDate): boolean;
  20419. /**
  20420. * Adds a property to this object. Once a property is added, it can be
  20421. * observed with {@link Entity#definitionChanged} and composited
  20422. * with {@link CompositeEntityCollection}
  20423. * @param propertyName - The name of the property to add.
  20424. */
  20425. addProperty(propertyName: string): void;
  20426. /**
  20427. * Removed a property previously added with addProperty.
  20428. * @param propertyName - The name of the property to remove.
  20429. */
  20430. removeProperty(propertyName: string): void;
  20431. /**
  20432. * Assigns each unassigned property on this object to the value
  20433. * of the same property on the provided source object.
  20434. * @param source - The object to be merged into this object.
  20435. */
  20436. merge(source: Entity): void;
  20437. /**
  20438. * Computes the model matrix for the entity's transform at specified time. Returns undefined if orientation or position
  20439. * are undefined.
  20440. * @param time - The time to retrieve model matrix for.
  20441. * @param [result] - The object onto which to store the result.
  20442. * @returns The modified result parameter or a new Matrix4 instance if one was not provided. Result is undefined if position or orientation are undefined.
  20443. */
  20444. computeModelMatrix(time: JulianDate, result?: Matrix4): Matrix4;
  20445. /**
  20446. * Checks if the given Scene supports materials besides Color on Entities draped on terrain or 3D Tiles.
  20447. * If this feature is not supported, Entities with non-color materials but no `height` will
  20448. * instead be rendered as if height is 0.
  20449. * @param scene - The current scene.
  20450. * @returns Whether or not the current scene supports materials for entities on terrain.
  20451. */
  20452. static supportsMaterialsforEntitiesOnTerrain(scene: Scene): boolean;
  20453. /**
  20454. * Checks if the given Scene supports polylines clamped to terrain or 3D Tiles.
  20455. * If this feature is not supported, Entities with PolylineGraphics will be rendered with vertices at
  20456. * the provided heights and using the `arcType` parameter instead of clamped to the ground.
  20457. * @param scene - The current scene.
  20458. * @returns Whether or not the current scene supports polylines on terrain or 3D TIles.
  20459. */
  20460. static supportsPolylinesOnTerrain(scene: Scene): boolean;
  20461. }
  20462. /**
  20463. * Defines how screen space objects (billboards, points, labels) are clustered.
  20464. * @param [options] - An object with the following properties:
  20465. * @param [options.enabled = false] - Whether or not to enable clustering.
  20466. * @param [options.pixelRange = 80] - The pixel range to extend the screen space bounding box.
  20467. * @param [options.minimumClusterSize = 2] - The minimum number of screen space objects that can be clustered.
  20468. * @param [options.clusterBillboards = true] - Whether or not to cluster the billboards of an entity.
  20469. * @param [options.clusterLabels = true] - Whether or not to cluster the labels of an entity.
  20470. * @param [options.clusterPoints = true] - Whether or not to cluster the points of an entity.
  20471. * @param [options.show = true] - Determines if the entities in the cluster will be shown.
  20472. */
  20473. export class EntityCluster {
  20474. constructor(options?: {
  20475. enabled?: boolean;
  20476. pixelRange?: number;
  20477. minimumClusterSize?: number;
  20478. clusterBillboards?: boolean;
  20479. clusterLabels?: boolean;
  20480. clusterPoints?: boolean;
  20481. show?: boolean;
  20482. });
  20483. /**
  20484. * Determines if entities in this collection will be shown.
  20485. */
  20486. show: boolean;
  20487. /**
  20488. * Gets or sets whether clustering is enabled.
  20489. */
  20490. enabled: boolean;
  20491. /**
  20492. * Gets or sets the pixel range to extend the screen space bounding box.
  20493. */
  20494. pixelRange: number;
  20495. /**
  20496. * Gets or sets the minimum number of screen space objects that can be clustered.
  20497. */
  20498. minimumClusterSize: number;
  20499. /**
  20500. * Gets the event that will be raised when a new cluster will be displayed. The signature of the event listener is {@link EntityCluster.newClusterCallback}.
  20501. */
  20502. clusterEvent: Event<EntityCluster.newClusterCallback>;
  20503. /**
  20504. * Gets or sets whether clustering billboard entities is enabled.
  20505. */
  20506. clusterBillboards: boolean;
  20507. /**
  20508. * Gets or sets whether clustering labels entities is enabled.
  20509. */
  20510. clusterLabels: boolean;
  20511. /**
  20512. * Gets or sets whether clustering point entities is enabled.
  20513. */
  20514. clusterPoints: boolean;
  20515. /**
  20516. * Destroys the WebGL resources held by this object. Destroying an object allows for deterministic
  20517. * release of WebGL resources, instead of relying on the garbage collector to destroy this object.
  20518. * <p>
  20519. * Unlike other objects that use WebGL resources, this object can be reused. For example, if a data source is removed
  20520. * from a data source collection and added to another.
  20521. * </p>
  20522. */
  20523. destroy(): void;
  20524. }
  20525. export namespace EntityCluster {
  20526. /**
  20527. * A event listener function used to style clusters.
  20528. * @example
  20529. * // The default cluster values.
  20530. * dataSource.clustering.clusterEvent.addEventListener(function(entities, cluster) {
  20531. * cluster.label.show = true;
  20532. * cluster.label.text = entities.length.toLocaleString();
  20533. * });
  20534. * @param clusteredEntities - An array of the entities contained in the cluster.
  20535. * @param cluster - An object containing the Billboard, Label, and Point
  20536. * primitives that represent this cluster of entities.
  20537. */
  20538. type newClusterCallback = (clusteredEntities: Entity[], cluster: {
  20539. billboard: Billboard;
  20540. label: Label;
  20541. point: PointPrimitive;
  20542. }) => void;
  20543. }
  20544. /**
  20545. * An observable collection of {@link Entity} instances where each entity has a unique id.
  20546. * @param [owner] - The data source (or composite entity collection) which created this collection.
  20547. */
  20548. export class EntityCollection {
  20549. constructor(owner?: DataSource | CompositeEntityCollection);
  20550. /**
  20551. * Prevents {@link EntityCollection#collectionChanged} events from being raised
  20552. * until a corresponding call is made to {@link EntityCollection#resumeEvents}, at which
  20553. * point a single event will be raised that covers all suspended operations.
  20554. * This allows for many items to be added and removed efficiently.
  20555. * This function can be safely called multiple times as long as there
  20556. * are corresponding calls to {@link EntityCollection#resumeEvents}.
  20557. */
  20558. suspendEvents(): void;
  20559. /**
  20560. * Resumes raising {@link EntityCollection#collectionChanged} events immediately
  20561. * when an item is added or removed. Any modifications made while while events were suspended
  20562. * will be triggered as a single event when this function is called.
  20563. * This function is reference counted and can safely be called multiple times as long as there
  20564. * are corresponding calls to {@link EntityCollection#resumeEvents}.
  20565. */
  20566. resumeEvents(): void;
  20567. /**
  20568. * Gets the event that is fired when entities are added or removed from the collection.
  20569. * The generated event is a {@link EntityCollection.CollectionChangedEventCallback}.
  20570. */
  20571. readonly collectionChanged: Event<EntityCollection.CollectionChangedEventCallback>;
  20572. /**
  20573. * Gets a globally unique identifier for this collection.
  20574. */
  20575. readonly id: string;
  20576. /**
  20577. * Gets the array of Entity instances in the collection.
  20578. * This array should not be modified directly.
  20579. */
  20580. readonly values: Entity[];
  20581. /**
  20582. * Gets whether or not this entity collection should be
  20583. * displayed. When true, each entity is only displayed if
  20584. * its own show property is also true.
  20585. */
  20586. show: boolean;
  20587. /**
  20588. * Gets the owner of this entity collection, ie. the data source or composite entity collection which created it.
  20589. */
  20590. readonly owner: DataSource | CompositeEntityCollection;
  20591. /**
  20592. * Computes the maximum availability of the entities in the collection.
  20593. * If the collection contains a mix of infinitely available data and non-infinite data,
  20594. * it will return the interval pertaining to the non-infinite data only. If all
  20595. * data is infinite, an infinite interval will be returned.
  20596. * @returns The availability of entities in the collection.
  20597. */
  20598. computeAvailability(): TimeInterval;
  20599. /**
  20600. * Add an entity to the collection.
  20601. * @param entity - The entity to be added.
  20602. * @returns The entity that was added.
  20603. */
  20604. add(entity: Entity | Entity.ConstructorOptions): Entity;
  20605. /**
  20606. * Removes an entity from the collection.
  20607. * @param entity - The entity to be removed.
  20608. * @returns true if the item was removed, false if it did not exist in the collection.
  20609. */
  20610. remove(entity: Entity): boolean;
  20611. /**
  20612. * Returns true if the provided entity is in this collection, false otherwise.
  20613. * @param entity - The entity.
  20614. * @returns true if the provided entity is in this collection, false otherwise.
  20615. */
  20616. contains(entity: Entity): boolean;
  20617. /**
  20618. * Removes an entity with the provided id from the collection.
  20619. * @param id - The id of the entity to remove.
  20620. * @returns true if the item was removed, false if no item with the provided id existed in the collection.
  20621. */
  20622. removeById(id: string): boolean;
  20623. /**
  20624. * Removes all Entities from the collection.
  20625. */
  20626. removeAll(): void;
  20627. /**
  20628. * Gets an entity with the specified id.
  20629. * @param id - The id of the entity to retrieve.
  20630. * @returns The entity with the provided id or undefined if the id did not exist in the collection.
  20631. */
  20632. getById(id: string): Entity | undefined;
  20633. /**
  20634. * Gets an entity with the specified id or creates it and adds it to the collection if it does not exist.
  20635. * @param id - The id of the entity to retrieve or create.
  20636. * @returns The new or existing object.
  20637. */
  20638. getOrCreateEntity(id: string): Entity;
  20639. }
  20640. export namespace EntityCollection {
  20641. /**
  20642. * The signature of the event generated by {@link EntityCollection#collectionChanged}.
  20643. * @param collection - The collection that triggered the event.
  20644. * @param added - The array of {@link Entity} instances that have been added to the collection.
  20645. * @param removed - The array of {@link Entity} instances that have been removed from the collection.
  20646. * @param changed - The array of {@link Entity} instances that have been modified.
  20647. */
  20648. type CollectionChangedEventCallback = (collection: EntityCollection, added: Entity[], removed: Entity[], changed: Entity[]) => void;
  20649. }
  20650. /**
  20651. * A utility object for tracking an entity with the camera.
  20652. * @param entity - The entity to track with the camera.
  20653. * @param scene - The scene to use.
  20654. * @param [ellipsoid = Ellipsoid.WGS84] - The ellipsoid to use for orienting the camera.
  20655. */
  20656. export class EntityView {
  20657. constructor(entity: Entity, scene: Scene, ellipsoid?: Ellipsoid);
  20658. /**
  20659. * The entity to track with the camera.
  20660. */
  20661. entity: Entity;
  20662. /**
  20663. * The scene in which to track the object.
  20664. */
  20665. scene: Scene;
  20666. /**
  20667. * The ellipsoid to use for orienting the camera.
  20668. */
  20669. ellipsoid: Ellipsoid;
  20670. /**
  20671. * The bounding sphere of the object.
  20672. */
  20673. boundingSphere: BoundingSphere;
  20674. /**
  20675. * Gets or sets a camera offset that will be used to
  20676. * initialize subsequent EntityViews.
  20677. */
  20678. static defaultOffset3D: Cartesian3;
  20679. /**
  20680. * Should be called each animation frame to update the camera
  20681. * to the latest settings.
  20682. * @param time - The current animation time.
  20683. * @param [boundingSphere] - bounding sphere of the object.
  20684. */
  20685. update(time: JulianDate, boundingSphere?: BoundingSphere): void;
  20686. }
  20687. export namespace GeoJsonDataSource {
  20688. /**
  20689. * Initialization options for the <code>load</code> method.
  20690. * @property [sourceUri] - Overrides the url to use for resolving relative links.
  20691. * @property [describe = GeoJsonDataSource.defaultDescribeProperty] - A function which returns a Property object (or just a string).
  20692. * @property [markerSize = GeoJsonDataSource.markerSize] - The default size of the map pin created for each point, in pixels.
  20693. * @property [markerSymbol = GeoJsonDataSource.markerSymbol] - The default symbol of the map pin created for each point.
  20694. * @property [markerColor = GeoJsonDataSource.markerColor] - The default color of the map pin created for each point.
  20695. * @property [stroke = GeoJsonDataSource.stroke] - The default color of polylines and polygon outlines.
  20696. * @property [strokeWidth = GeoJsonDataSource.strokeWidth] - The default width of polylines and polygon outlines.
  20697. * @property [fill = GeoJsonDataSource.fill] - The default color for polygon interiors.
  20698. * @property [clampToGround = GeoJsonDataSource.clampToGround] - true if we want the geometry features (polygons or linestrings) clamped to the ground.
  20699. * @property [credit] - A credit for the data source, which is displayed on the canvas.
  20700. */
  20701. type LoadOptions = {
  20702. sourceUri?: string;
  20703. describe?: GeoJsonDataSource.describe;
  20704. markerSize?: number;
  20705. markerSymbol?: string;
  20706. markerColor?: Color;
  20707. stroke?: Color;
  20708. strokeWidth?: number;
  20709. fill?: Color;
  20710. clampToGround?: boolean;
  20711. credit?: Credit | string;
  20712. };
  20713. /**
  20714. * This callback is displayed as part of the GeoJsonDataSource class.
  20715. * @param properties - The properties of the feature.
  20716. * @param nameProperty - The property key that Cesium estimates to have the name of the feature.
  20717. */
  20718. type describe = (properties: any, nameProperty: string) => void;
  20719. }
  20720. /**
  20721. * A {@link DataSource} which processes both
  20722. * {@link http://www.geojson.org/|GeoJSON} and {@link https://github.com/mbostock/topojson|TopoJSON} data.
  20723. * {@link https://github.com/mapbox/simplestyle-spec|simplestyle-spec} properties will also be used if they
  20724. * are present.
  20725. * @example
  20726. * const viewer = new Cesium.Viewer('cesiumContainer');
  20727. * viewer.dataSources.add(Cesium.GeoJsonDataSource.load('../../SampleData/ne_10m_us_states.topojson', {
  20728. * stroke: Cesium.Color.HOTPINK,
  20729. * fill: Cesium.Color.PINK,
  20730. * strokeWidth: 3,
  20731. * markerSymbol: '?'
  20732. * }));
  20733. * @param [name] - The name of this data source. If undefined, a name will be taken from
  20734. * the name of the GeoJSON file.
  20735. */
  20736. export class GeoJsonDataSource {
  20737. constructor(name?: string);
  20738. /**
  20739. * Creates a Promise to a new instance loaded with the provided GeoJSON or TopoJSON data.
  20740. * @param data - A url, GeoJSON object, or TopoJSON object to be loaded.
  20741. * @param [options] - An object specifying configuration options
  20742. * @returns A promise that will resolve when the data is loaded.
  20743. */
  20744. static load(data: Resource | string | any, options?: GeoJsonDataSource.LoadOptions): Promise<GeoJsonDataSource>;
  20745. /**
  20746. * Gets or sets the default size of the map pin created for each point, in pixels.
  20747. */
  20748. static markerSize: number;
  20749. /**
  20750. * Gets or sets the default symbol of the map pin created for each point.
  20751. * This can be any valid {@link http://mapbox.com/maki/|Maki} identifier, any single character,
  20752. * or blank if no symbol is to be used.
  20753. */
  20754. static markerSymbol: string;
  20755. /**
  20756. * Gets or sets the default color of the map pin created for each point.
  20757. */
  20758. static markerColor: Color;
  20759. /**
  20760. * Gets or sets the default color of polylines and polygon outlines.
  20761. */
  20762. static stroke: Color;
  20763. /**
  20764. * Gets or sets the default width of polylines and polygon outlines.
  20765. */
  20766. static strokeWidth: number;
  20767. /**
  20768. * Gets or sets default color for polygon interiors.
  20769. */
  20770. static fill: Color;
  20771. /**
  20772. * Gets or sets default of whether to clamp to the ground.
  20773. */
  20774. static clampToGround: boolean;
  20775. /**
  20776. * Gets an object that maps the name of a crs to a callback function which takes a GeoJSON coordinate
  20777. * and transforms it into a WGS84 Earth-fixed Cartesian. Older versions of GeoJSON which
  20778. * supported the EPSG type can be added to this list as well, by specifying the complete EPSG name,
  20779. * for example 'EPSG:4326'.
  20780. */
  20781. static crsNames: any;
  20782. /**
  20783. * Gets an object that maps the href property of a crs link to a callback function
  20784. * which takes the crs properties object and returns a Promise that resolves
  20785. * to a function that takes a GeoJSON coordinate and transforms it into a WGS84 Earth-fixed Cartesian.
  20786. * Items in this object take precedence over those defined in <code>crsLinkHrefs</code>, assuming
  20787. * the link has a type specified.
  20788. */
  20789. static crsLinkHrefs: any;
  20790. /**
  20791. * Gets an object that maps the type 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 <code>crsLinkHrefs</code> take precedence over this object.
  20795. */
  20796. static crsLinkTypes: any;
  20797. /**
  20798. * Gets or sets a human-readable name for this instance.
  20799. */
  20800. name: string;
  20801. /**
  20802. * This DataSource only defines static data, therefore this property is always undefined.
  20803. */
  20804. clock: DataSourceClock;
  20805. /**
  20806. * Gets the collection of {@link Entity} instances.
  20807. */
  20808. entities: EntityCollection;
  20809. /**
  20810. * Gets a value indicating if the data source is currently loading data.
  20811. */
  20812. isLoading: boolean;
  20813. /**
  20814. * Gets an event that will be raised when the underlying data changes.
  20815. */
  20816. changedEvent: Event;
  20817. /**
  20818. * Gets an event that will be raised if an error is encountered during processing.
  20819. */
  20820. errorEvent: Event;
  20821. /**
  20822. * Gets an event that will be raised when the data source either starts or stops loading.
  20823. */
  20824. loadingEvent: Event;
  20825. /**
  20826. * Gets whether or not this data source should be displayed.
  20827. */
  20828. show: boolean;
  20829. /**
  20830. * Gets or sets the clustering options for this data source. This object can be shared between multiple data sources.
  20831. */
  20832. clustering: EntityCluster;
  20833. /**
  20834. * Gets the credit that will be displayed for the data source
  20835. */
  20836. credit: Credit;
  20837. /**
  20838. * Asynchronously loads the provided GeoJSON or TopoJSON data, replacing any existing data.
  20839. * @param data - A url, GeoJSON object, or TopoJSON object to be loaded.
  20840. * @param [options] - An object specifying configuration options
  20841. * @returns a promise that will resolve when the GeoJSON is loaded.
  20842. */
  20843. load(data: Resource | string | any, options?: GeoJsonDataSource.LoadOptions): Promise<GeoJsonDataSource>;
  20844. /**
  20845. * Asynchronously loads the provided GeoJSON or TopoJSON data, without replacing any existing data.
  20846. * @param data - A url, GeoJSON object, or TopoJSON object to be loaded.
  20847. * @param [options] - An object specifying configuration options
  20848. * @returns a promise that will resolve when the GeoJSON is loaded.
  20849. */
  20850. process(data: Resource | string | any, options?: GeoJsonDataSource.LoadOptions): Promise<GeoJsonDataSource>;
  20851. /**
  20852. * Updates the data source to the provided time. This function is optional and
  20853. * is not required to be implemented. It is provided for data sources which
  20854. * retrieve data based on the current animation time or scene state.
  20855. * If implemented, update will be called by {@link DataSourceDisplay} once a frame.
  20856. * @param time - The simulation time.
  20857. * @returns True if this data source is ready to be displayed at the provided time, false otherwise.
  20858. */
  20859. update(time: JulianDate): boolean;
  20860. }
  20861. /**
  20862. * An abstract class for updating geometry entities.
  20863. * @param options - An object with the following properties:
  20864. * @param options.entity - The entity containing the geometry to be visualized.
  20865. * @param options.scene - The scene where visualization is taking place.
  20866. * @param options.geometryOptions - Options for the geometry
  20867. * @param options.geometryPropertyName - The geometry property name
  20868. * @param options.observedPropertyNames - The entity properties this geometry cares about
  20869. */
  20870. export class GeometryUpdater {
  20871. constructor(options: {
  20872. entity: Entity;
  20873. scene: Scene;
  20874. geometryOptions: any;
  20875. geometryPropertyName: string;
  20876. observedPropertyNames: string[];
  20877. });
  20878. /**
  20879. * Gets the unique ID associated with this updater
  20880. */
  20881. readonly id: string;
  20882. /**
  20883. * Gets the entity associated with this geometry.
  20884. */
  20885. readonly entity: Entity;
  20886. /**
  20887. * Gets a value indicating if the geometry has a fill component.
  20888. */
  20889. readonly fillEnabled: boolean;
  20890. /**
  20891. * Gets a value indicating if fill visibility varies with simulation time.
  20892. */
  20893. readonly hasConstantFill: boolean;
  20894. /**
  20895. * Gets the material property used to fill the geometry.
  20896. */
  20897. readonly fillMaterialProperty: MaterialProperty;
  20898. /**
  20899. * Gets a value indicating if the geometry has an outline component.
  20900. */
  20901. readonly outlineEnabled: boolean;
  20902. /**
  20903. * Gets a value indicating if the geometry has an outline component.
  20904. */
  20905. readonly hasConstantOutline: boolean;
  20906. /**
  20907. * Gets the {@link Color} property for the geometry outline.
  20908. */
  20909. readonly outlineColorProperty: Property;
  20910. /**
  20911. * Gets the constant with of the geometry outline, in pixels.
  20912. * This value is only valid if isDynamic is false.
  20913. */
  20914. readonly outlineWidth: number;
  20915. /**
  20916. * Gets the property specifying whether the geometry
  20917. * casts or receives shadows from light sources.
  20918. */
  20919. readonly shadowsProperty: Property;
  20920. /**
  20921. * Gets or sets the {@link DistanceDisplayCondition} Property specifying at what distance from the camera that this geometry will be displayed.
  20922. */
  20923. readonly distanceDisplayConditionProperty: Property;
  20924. /**
  20925. * Gets or sets the {@link ClassificationType} Property specifying if this geometry will classify terrain, 3D Tiles, or both when on the ground.
  20926. */
  20927. readonly classificationTypeProperty: Property;
  20928. /**
  20929. * Gets a value indicating if the geometry is time-varying.
  20930. * If true, all visualization is delegated to a DynamicGeometryUpdater
  20931. * returned by GeometryUpdater#createDynamicUpdater.
  20932. */
  20933. readonly isDynamic: boolean;
  20934. /**
  20935. * Gets a value indicating if the geometry is closed.
  20936. * This property is only valid for static geometry.
  20937. */
  20938. readonly isClosed: boolean;
  20939. /**
  20940. * Gets an event that is raised whenever the public properties
  20941. * of this updater change.
  20942. */
  20943. readonly geometryChanged: boolean;
  20944. /**
  20945. * Checks if the geometry is outlined at the provided time.
  20946. * @param time - The time for which to retrieve visibility.
  20947. * @returns true if geometry is outlined at the provided time, false otherwise.
  20948. */
  20949. isOutlineVisible(time: JulianDate): boolean;
  20950. /**
  20951. * Checks if the geometry is filled at the provided time.
  20952. * @param time - The time for which to retrieve visibility.
  20953. * @returns true if geometry is filled at the provided time, false otherwise.
  20954. */
  20955. isFilled(time: JulianDate): boolean;
  20956. /**
  20957. * Creates the geometry instance which represents the fill of the geometry.
  20958. * @param time - The time to use when retrieving initial attribute values.
  20959. * @returns The geometry instance representing the filled portion of the geometry.
  20960. */
  20961. createFillGeometryInstance(time: JulianDate): GeometryInstance;
  20962. /**
  20963. * Creates the geometry instance which represents the outline of the geometry.
  20964. * @param time - The time to use when retrieving initial attribute values.
  20965. * @returns The geometry instance representing the outline portion of the geometry.
  20966. */
  20967. createOutlineGeometryInstance(time: JulianDate): GeometryInstance;
  20968. /**
  20969. * Returns true if this object was destroyed; otherwise, false.
  20970. * @returns True if this object was destroyed; otherwise, false.
  20971. */
  20972. isDestroyed(): boolean;
  20973. /**
  20974. * Destroys and resources used by the object. Once an object is destroyed, it should not be used.
  20975. */
  20976. destroy(): void;
  20977. }
  20978. /**
  20979. * A general purpose visualizer for geometry represented by {@link Primitive} instances.
  20980. * @param scene - The scene the primitives will be rendered in.
  20981. * @param entityCollection - The entityCollection to visualize.
  20982. * @param [primitives = scene.primitives] - A collection to add primitives related to the entities
  20983. * @param [groundPrimitives = scene.groundPrimitives] - A collection to add ground primitives related to the entities
  20984. */
  20985. export class GeometryVisualizer {
  20986. constructor(scene: Scene, entityCollection: EntityCollection, primitives?: PrimitiveCollection, groundPrimitives?: PrimitiveCollection);
  20987. /**
  20988. * Updates all of the primitives created by this visualizer to match their
  20989. * Entity counterpart at the given time.
  20990. * @param time - The time to update to.
  20991. * @returns True if the visualizer successfully updated to the provided time,
  20992. * false if the visualizer is waiting for asynchronous primitives to be created.
  20993. */
  20994. update(time: JulianDate): boolean;
  20995. /**
  20996. * Returns true if this object was destroyed; otherwise, false.
  20997. * @returns True if this object was destroyed; otherwise, false.
  20998. */
  20999. isDestroyed(): boolean;
  21000. /**
  21001. * Removes and destroys all primitives created by this instance.
  21002. */
  21003. destroy(): void;
  21004. }
  21005. /**
  21006. * A {@link DataSource} which processes the GPS Exchange Format (GPX).
  21007. * @example
  21008. * const viewer = new Cesium.Viewer('cesiumContainer');
  21009. * viewer.dataSources.add(Cesium.GpxDataSource.load('../../SampleData/track.gpx'));
  21010. */
  21011. export class GpxDataSource {
  21012. constructor();
  21013. /**
  21014. * Creates a Promise to a new instance loaded with the provided GPX data.
  21015. * @param data - A url, parsed GPX document, or Blob containing binary GPX data.
  21016. * @param [options] - An object with the following properties:
  21017. * @param [options.clampToGround] - True if the symbols should be rendered at the same height as the terrain
  21018. * @param [options.waypointImage] - Image to use for waypoint billboards.
  21019. * @param [options.trackImage] - Image to use for track billboards.
  21020. * @param [options.trackColor] - Color to use for track lines.
  21021. * @param [options.routeColor] - Color to use for route lines.
  21022. * @returns A promise that will resolve to a new GpxDataSource instance once the gpx is loaded.
  21023. */
  21024. static load(data: string | Document | Blob, options?: {
  21025. clampToGround?: boolean;
  21026. waypointImage?: string;
  21027. trackImage?: string;
  21028. trackColor?: string;
  21029. routeColor?: string;
  21030. }): Promise<GpxDataSource>;
  21031. /**
  21032. * Gets a human-readable name for this instance.
  21033. * This will be automatically be set to the GPX document name on load.
  21034. */
  21035. name: string;
  21036. /**
  21037. * Gets the version of the GPX Schema in use.
  21038. */
  21039. version: string;
  21040. /**
  21041. * Gets the creator of the GPX document.
  21042. */
  21043. creator: string;
  21044. /**
  21045. * Gets an object containing metadata about the GPX file.
  21046. */
  21047. metadata: any;
  21048. /**
  21049. * Gets the clock settings defined by the loaded GPX. This represents the total
  21050. * availability interval for all time-dynamic data. If the GPX does not contain
  21051. * time-dynamic data, this value is undefined.
  21052. */
  21053. clock: DataSourceClock;
  21054. /**
  21055. * Gets the collection of {@link Entity} instances.
  21056. */
  21057. entities: EntityCollection;
  21058. /**
  21059. * Gets a value indicating if the data source is currently loading data.
  21060. */
  21061. isLoading: boolean;
  21062. /**
  21063. * Gets an event that will be raised when the underlying data changes.
  21064. */
  21065. changedEvent: Event;
  21066. /**
  21067. * Gets an event that will be raised if an error is encountered during processing.
  21068. */
  21069. errorEvent: Event;
  21070. /**
  21071. * Gets an event that will be raised when the data source either starts or stops loading.
  21072. */
  21073. loadingEvent: Event;
  21074. /**
  21075. * Gets whether or not this data source should be displayed.
  21076. */
  21077. show: boolean;
  21078. /**
  21079. * Gets or sets the clustering options for this data source. This object can be shared between multiple data sources.
  21080. */
  21081. clustering: EntityCluster;
  21082. /**
  21083. * Updates the data source to the provided time. This function is optional and
  21084. * is not required to be implemented. It is provided for data sources which
  21085. * retrieve data based on the current animation time or scene state.
  21086. * If implemented, update will be called by {@link DataSourceDisplay} once a frame.
  21087. * @param time - The simulation time.
  21088. * @returns True if this data source is ready to be displayed at the provided time, false otherwise.
  21089. */
  21090. update(time: JulianDate): boolean;
  21091. /**
  21092. * Asynchronously loads the provided GPX data, replacing any existing data.
  21093. * @param data - A url, parsed GPX document, or Blob containing binary GPX data or a parsed GPX document.
  21094. * @param [options] - An object with the following properties:
  21095. * @param [options.clampToGround] - True if the symbols should be rendered at the same height as the terrain
  21096. * @param [options.waypointImage] - Image to use for waypoint billboards.
  21097. * @param [options.trackImage] - Image to use for track billboards.
  21098. * @param [options.trackColor] - Color to use for track lines.
  21099. * @param [options.routeColor] - Color to use for route lines.
  21100. * @returns A promise that will resolve to this instances once the GPX is loaded.
  21101. */
  21102. load(data: string | Document | Blob, options?: {
  21103. clampToGround?: boolean;
  21104. waypointImage?: string;
  21105. trackImage?: string;
  21106. trackColor?: string;
  21107. routeColor?: string;
  21108. }): Promise<GpxDataSource>;
  21109. }
  21110. /**
  21111. * A {@link MaterialProperty} that maps to grid {@link Material} uniforms.
  21112. * @param [options] - Object with the following properties:
  21113. * @param [options.color = Color.WHITE] - A Property specifying the grid {@link Color}.
  21114. * @param [options.cellAlpha = 0.1] - A numeric Property specifying cell alpha values.
  21115. * @param [options.lineCount = new Cartesian2(8, 8)] - A {@link Cartesian2} Property specifying the number of grid lines along each axis.
  21116. * @param [options.lineThickness = new Cartesian2(1.0, 1.0)] - A {@link Cartesian2} Property specifying the thickness of grid lines along each axis.
  21117. * @param [options.lineOffset = new Cartesian2(0.0, 0.0)] - A {@link Cartesian2} Property specifying starting offset of grid lines along each axis.
  21118. */
  21119. export class GridMaterialProperty {
  21120. constructor(options?: {
  21121. color?: Property | Color;
  21122. cellAlpha?: Property | number;
  21123. lineCount?: Property | Cartesian2;
  21124. lineThickness?: Property | Cartesian2;
  21125. lineOffset?: Property | Cartesian2;
  21126. });
  21127. /**
  21128. * Gets a value indicating if this property is constant. A property is considered
  21129. * constant if getValue always returns the same result for the current definition.
  21130. */
  21131. readonly isConstant: boolean;
  21132. /**
  21133. * Gets the event that is raised whenever the definition of this property changes.
  21134. * The definition is considered to have changed if a call to getValue would return
  21135. * a different result for the same time.
  21136. */
  21137. readonly definitionChanged: Event;
  21138. /**
  21139. * Gets or sets the Property specifying the grid {@link Color}.
  21140. */
  21141. color: Property | undefined;
  21142. /**
  21143. * Gets or sets the numeric Property specifying cell alpha values.
  21144. */
  21145. cellAlpha: Property | undefined;
  21146. /**
  21147. * Gets or sets the {@link Cartesian2} Property specifying the number of grid lines along each axis.
  21148. */
  21149. lineCount: Property | undefined;
  21150. /**
  21151. * Gets or sets the {@link Cartesian2} Property specifying the thickness of grid lines along each axis.
  21152. */
  21153. lineThickness: Property | undefined;
  21154. /**
  21155. * Gets or sets the {@link Cartesian2} Property specifying the starting offset of grid lines along each axis.
  21156. */
  21157. lineOffset: Property | undefined;
  21158. /**
  21159. * Gets the {@link Material} type at the provided time.
  21160. * @param time - The time for which to retrieve the type.
  21161. * @returns The type of material.
  21162. */
  21163. getType(time: JulianDate): string;
  21164. /**
  21165. * Gets the value of the property at the provided time.
  21166. * @param time - The time for which to retrieve the value.
  21167. * @param [result] - The object to store the value into, if omitted, a new instance is created and returned.
  21168. * @returns The modified result parameter or a new instance if the result parameter was not supplied.
  21169. */
  21170. getValue(time: JulianDate, result?: any): any;
  21171. /**
  21172. * Compares this property to the provided property and returns
  21173. * <code>true</code> if they are equal, <code>false</code> otherwise.
  21174. * @param [other] - The other property.
  21175. * @returns <code>true</code> if left and right are equal, <code>false</code> otherwise.
  21176. */
  21177. equals(other?: Property): boolean;
  21178. }
  21179. /**
  21180. * An abstract class for updating ground geometry entities.
  21181. * @param options - An object with the following properties:
  21182. * @param options.entity - The entity containing the geometry to be visualized.
  21183. * @param options.scene - The scene where visualization is taking place.
  21184. * @param options.geometryOptions - Options for the geometry
  21185. * @param options.geometryPropertyName - The geometry property name
  21186. * @param options.observedPropertyNames - The entity properties this geometry cares about
  21187. */
  21188. export class GroundGeometryUpdater {
  21189. constructor(options: {
  21190. entity: Entity;
  21191. scene: Scene;
  21192. geometryOptions: any;
  21193. geometryPropertyName: string;
  21194. observedPropertyNames: string[];
  21195. });
  21196. /**
  21197. * Gets the zindex
  21198. */
  21199. readonly zIndex: number;
  21200. /**
  21201. * Destroys and resources used by the object. Once an object is destroyed, it should not be used.
  21202. */
  21203. destroy(): void;
  21204. }
  21205. /**
  21206. * A {@link MaterialProperty} that maps to image {@link Material} uniforms.
  21207. * @param [options] - Object with the following properties:
  21208. * @param [options.image] - A Property specifying the Image, URL, Canvas, or Video.
  21209. * @param [options.repeat = new Cartesian2(1.0, 1.0)] - A {@link Cartesian2} Property specifying the number of times the image repeats in each direction.
  21210. * @param [options.color = Color.WHITE] - The color applied to the image
  21211. * @param [options.transparent = false] - Set to true when the image has transparency (for example, when a png has transparent sections)
  21212. */
  21213. export class ImageMaterialProperty {
  21214. constructor(options?: {
  21215. image?: Property | string | HTMLImageElement | HTMLCanvasElement | HTMLVideoElement;
  21216. repeat?: Property | Cartesian2;
  21217. color?: Property | Color;
  21218. transparent?: Property | boolean;
  21219. });
  21220. /**
  21221. * Gets a value indicating if this property is constant. A property is considered
  21222. * constant if getValue always returns the same result for the current definition.
  21223. */
  21224. readonly isConstant: boolean;
  21225. /**
  21226. * Gets the event that is raised whenever the definition of this property changes.
  21227. * The definition is considered to have changed if a call to getValue would return
  21228. * a different result for the same time.
  21229. */
  21230. readonly definitionChanged: Event;
  21231. /**
  21232. * Gets or sets the Property specifying Image, URL, Canvas, or Video to use.
  21233. */
  21234. image: Property | undefined;
  21235. /**
  21236. * Gets or sets the {@link Cartesian2} Property specifying the number of times the image repeats in each direction.
  21237. */
  21238. repeat: Property | undefined;
  21239. /**
  21240. * Gets or sets the Color Property specifying the desired color applied to the image.
  21241. */
  21242. color: Property | undefined;
  21243. /**
  21244. * Gets or sets the Boolean Property specifying whether the image has transparency
  21245. */
  21246. transparent: Property | undefined;
  21247. /**
  21248. * Gets the {@link Material} type at the provided time.
  21249. * @param time - The time for which to retrieve the type.
  21250. * @returns The type of material.
  21251. */
  21252. getType(time: JulianDate): string;
  21253. /**
  21254. * Gets the value of the property at the provided time.
  21255. * @param time - The time for which to retrieve the value.
  21256. * @param [result] - The object to store the value into, if omitted, a new instance is created and returned.
  21257. * @returns The modified result parameter or a new instance if the result parameter was not supplied.
  21258. */
  21259. getValue(time: JulianDate, result?: any): any;
  21260. /**
  21261. * Compares this property to the provided property and returns
  21262. * <code>true</code> if they are equal, <code>false</code> otherwise.
  21263. * @param [other] - The other property.
  21264. * @returns <code>true</code> if left and right are equal, <code>false</code> otherwise.
  21265. */
  21266. equals(other?: Property): boolean;
  21267. }
  21268. /**
  21269. * Representation of <Camera> from KML
  21270. * @param position - camera position
  21271. * @param headingPitchRoll - camera orientation
  21272. */
  21273. export class KmlCamera {
  21274. constructor(position: Cartesian3, headingPitchRoll: HeadingPitchRoll);
  21275. }
  21276. export namespace KmlDataSource {
  21277. /**
  21278. * Initialization options for the `load` method.
  21279. * @property [sourceUri] - Overrides the url to use for resolving relative links and other KML network features.
  21280. * @property [clampToGround = false] - true if we want the geometry features (Polygons, LineStrings and LinearRings) clamped to the ground.
  21281. * @property [ellipsoid = Ellipsoid.WGS84] - The global ellipsoid used for geographical calculations.
  21282. * @property [screenOverlayContainer] - A container for ScreenOverlay images.
  21283. */
  21284. type LoadOptions = {
  21285. sourceUri?: string;
  21286. clampToGround?: boolean;
  21287. ellipsoid?: Ellipsoid;
  21288. screenOverlayContainer?: Element | string;
  21289. };
  21290. /**
  21291. * Options for constructing a new KmlDataSource, or calling the static `load` method.
  21292. * @property [camera] - The camera that is used for viewRefreshModes and sending camera properties to network links.
  21293. * @property [canvas] - The canvas that is used for sending viewer properties to network links.
  21294. * @property [credit] - A credit for the data source, which is displayed on the canvas.
  21295. * @property [sourceUri] - Overrides the url to use for resolving relative links and other KML network features.
  21296. * @property [clampToGround = false] - true if we want the geometry features (Polygons, LineStrings and LinearRings) clamped to the ground.
  21297. * @property [ellipsoid = Ellipsoid.WGS84] - The global ellipsoid used for geographical calculations.
  21298. * @property [screenOverlayContainer] - A container for ScreenOverlay images.
  21299. */
  21300. type ConstructorOptions = {
  21301. camera?: Camera;
  21302. canvas?: HTMLCanvasElement;
  21303. credit?: Credit | string;
  21304. sourceUri?: string;
  21305. clampToGround?: boolean;
  21306. ellipsoid?: Ellipsoid;
  21307. screenOverlayContainer?: Element | string;
  21308. };
  21309. }
  21310. /**
  21311. * A {@link DataSource} which processes Keyhole Markup Language 2.2 (KML).
  21312. * <p>
  21313. * KML support in Cesium is incomplete, but a large amount of the standard,
  21314. * as well as Google's <code>gx</code> extension namespace, is supported. See Github issue
  21315. * {@link https://github.com/CesiumGS/cesium/issues/873|#873} for a
  21316. * detailed list of what is and isn't supported. Cesium will also write information to the
  21317. * console when it encounters most unsupported features.
  21318. * </p>
  21319. * <p>
  21320. * Non visual feature data, such as <code>atom:author</code> and <code>ExtendedData</code>
  21321. * is exposed via an instance of {@link KmlFeatureData}, which is added to each {@link Entity}
  21322. * under the <code>kml</code> property.
  21323. * </p>
  21324. * @example
  21325. * const viewer = new Cesium.Viewer('cesiumContainer');
  21326. * viewer.dataSources.add(Cesium.KmlDataSource.load('../../SampleData/facilities.kmz',
  21327. * {
  21328. * camera: viewer.scene.camera,
  21329. * canvas: viewer.scene.canvas
  21330. * })
  21331. * );
  21332. * @param [options] - Object describing initialization options
  21333. */
  21334. export class KmlDataSource {
  21335. constructor(options?: KmlDataSource.ConstructorOptions);
  21336. /**
  21337. * The current size of this Canvas will be used to populate the Link parameters
  21338. * for client height and width.
  21339. */
  21340. canvas: HTMLCanvasElement | undefined;
  21341. /**
  21342. * The position and orientation of this {@link Camera} will be used to
  21343. * populate various camera parameters when making network requests.
  21344. * Camera movement will determine when to trigger NetworkLink refresh if
  21345. * <code>viewRefreshMode</code> is <code>onStop</code>.
  21346. */
  21347. camera: Camera | undefined;
  21348. /**
  21349. * Creates a Promise to a new instance loaded with the provided KML data.
  21350. * @param data - A url, parsed KML document, or Blob containing binary KMZ data or a parsed KML document.
  21351. * @param [options] - An object specifying configuration options
  21352. * @returns A promise that will resolve to a new KmlDataSource instance once the KML is loaded.
  21353. */
  21354. static load(data: Resource | string | Document | Blob, options?: KmlDataSource.ConstructorOptions): Promise<KmlDataSource>;
  21355. /**
  21356. * Gets or sets a human-readable name for this instance.
  21357. * This will be automatically be set to the KML document name on load.
  21358. */
  21359. name: string;
  21360. /**
  21361. * Gets the clock settings defined by the loaded KML. This represents the total
  21362. * availability interval for all time-dynamic data. If the KML does not contain
  21363. * time-dynamic data, this value is undefined.
  21364. */
  21365. clock: DataSourceClock;
  21366. /**
  21367. * Gets the collection of {@link Entity} instances.
  21368. */
  21369. entities: EntityCollection;
  21370. /**
  21371. * Gets a value indicating if the data source is currently loading data.
  21372. */
  21373. isLoading: boolean;
  21374. /**
  21375. * Gets an event that will be raised when the underlying data changes.
  21376. */
  21377. changedEvent: Event;
  21378. /**
  21379. * Gets an event that will be raised if an error is encountered during processing.
  21380. */
  21381. errorEvent: Event;
  21382. /**
  21383. * Gets an event that will be raised when the data source either starts or stops loading.
  21384. */
  21385. loadingEvent: Event;
  21386. /**
  21387. * Gets an event that will be raised when the data source refreshes a network link.
  21388. */
  21389. refreshEvent: Event;
  21390. /**
  21391. * Gets an event that will be raised when the data source finds an unsupported node type.
  21392. */
  21393. unsupportedNodeEvent: Event;
  21394. /**
  21395. * Gets whether or not this data source should be displayed.
  21396. */
  21397. show: boolean;
  21398. /**
  21399. * Gets or sets the clustering options for this data source. This object can be shared between multiple data sources.
  21400. */
  21401. clustering: EntityCluster;
  21402. /**
  21403. * Gets the credit that will be displayed for the data source
  21404. */
  21405. credit: Credit;
  21406. /**
  21407. * Gets the KML Tours that are used to guide the camera to specified destinations on given time intervals.
  21408. */
  21409. kmlTours: KmlTour[];
  21410. /**
  21411. * Asynchronously loads the provided KML data, replacing any existing data.
  21412. * @param data - A url, parsed KML document, or Blob containing binary KMZ data or a parsed KML document.
  21413. * @param [options] - An object specifying configuration options
  21414. * @returns A promise that will resolve to this instances once the KML is loaded.
  21415. */
  21416. load(data: Resource | string | Document | Blob, options?: KmlDataSource.LoadOptions): Promise<KmlDataSource>;
  21417. /**
  21418. * Cleans up any non-entity elements created by the data source. Currently this only affects ScreenOverlay elements.
  21419. */
  21420. destroy(): void;
  21421. /**
  21422. * Updates any NetworkLink that require updating.
  21423. * @param time - The simulation time.
  21424. * @returns True if this data source is ready to be displayed at the provided time, false otherwise.
  21425. */
  21426. update(time: JulianDate): boolean;
  21427. }
  21428. /**
  21429. * Contains KML Feature data loaded into the <code>Entity.kml</code> property by {@link KmlDataSource}.
  21430. */
  21431. export class KmlFeatureData {
  21432. constructor();
  21433. /**
  21434. * Gets the atom syndication format author field.
  21435. */
  21436. author: KmlFeatureData.Author;
  21437. /**
  21438. * Gets the link.
  21439. */
  21440. link: KmlFeatureData.Link;
  21441. /**
  21442. * Gets the unstructured address field.
  21443. */
  21444. address: string;
  21445. /**
  21446. * Gets the phone number.
  21447. */
  21448. phoneNumber: string;
  21449. /**
  21450. * Gets the snippet.
  21451. */
  21452. snippet: string;
  21453. /**
  21454. * Gets the extended data, parsed into a JSON object.
  21455. * Currently only the <code>Data</code> property is supported.
  21456. * <code>SchemaData</code> and custom data are ignored.
  21457. */
  21458. extendedData: string;
  21459. }
  21460. export namespace KmlFeatureData {
  21461. /**
  21462. * @property name - Gets the name.
  21463. * @property uri - Gets the URI.
  21464. * @property age - Gets the email.
  21465. */
  21466. type Author = {
  21467. name: string;
  21468. uri: string;
  21469. age: number;
  21470. };
  21471. /**
  21472. * @property href - Gets the href.
  21473. * @property hreflang - Gets the language of the linked resource.
  21474. * @property rel - Gets the link relation.
  21475. * @property type - Gets the link type.
  21476. * @property title - Gets the link title.
  21477. * @property length - Gets the link length.
  21478. */
  21479. type Link = {
  21480. href: string;
  21481. hreflang: string;
  21482. rel: string;
  21483. type: string;
  21484. title: string;
  21485. length: string;
  21486. };
  21487. }
  21488. /**
  21489. * @param position - camera position
  21490. * @param headingPitchRange - camera orientation
  21491. */
  21492. export class KmlLookAt {
  21493. constructor(position: Cartesian3, headingPitchRange: HeadingPitchRange);
  21494. }
  21495. /**
  21496. * Describes a KmlTour, which uses KmlTourFlyTo, and KmlTourWait to
  21497. * guide the camera to a specified destinations on given time intervals.
  21498. * @param name - name parsed from KML
  21499. * @param id - id parsed from KML
  21500. * @param playlist - array with KmlTourFlyTos and KmlTourWaits
  21501. */
  21502. export class KmlTour {
  21503. constructor(name: string, id: string, playlist: any[]);
  21504. /**
  21505. * Id of kml gx:Tour entry
  21506. */
  21507. id: string;
  21508. /**
  21509. * Tour name
  21510. */
  21511. name: string;
  21512. /**
  21513. * Index of current entry from playlist
  21514. */
  21515. playlistIndex: number;
  21516. /**
  21517. * Array of playlist entries
  21518. */
  21519. playlist: any[];
  21520. /**
  21521. * Event will be called when tour starts to play,
  21522. * before any playlist entry starts to play.
  21523. */
  21524. tourStart: Event;
  21525. /**
  21526. * Event will be called when all playlist entries are
  21527. * played, or tour playback being canceled.
  21528. *
  21529. * If tour playback was terminated, event callback will
  21530. * be called with terminated=true parameter.
  21531. */
  21532. tourEnd: Event;
  21533. /**
  21534. * Event will be called when entry from playlist starts to play.
  21535. *
  21536. * Event callback will be called with curent entry as first parameter.
  21537. */
  21538. entryStart: Event;
  21539. /**
  21540. * Event will be called when entry from playlist ends to play.
  21541. *
  21542. * Event callback will be called with following parameters:
  21543. * 1. entry - entry
  21544. * 2. terminated - true if playback was terminated by calling {@link KmlTour#stop}
  21545. */
  21546. entryEnd: Event;
  21547. /**
  21548. * Add entry to this tour playlist.
  21549. * @param entry - an entry to add to the playlist.
  21550. */
  21551. addPlaylistEntry(entry: KmlTourFlyTo | KmlTourWait): void;
  21552. /**
  21553. * Play this tour.
  21554. * @param viewer - viewer widget.
  21555. * @param [cameraOptions] - these options will be merged with {@link Camera#flyTo}
  21556. * options for FlyTo playlist entries.
  21557. */
  21558. play(viewer: Viewer, cameraOptions?: any): void;
  21559. /**
  21560. * Stop curently playing tour.
  21561. */
  21562. stop(): void;
  21563. }
  21564. /**
  21565. * Transitions the KmlTour to the next destination. This transition is facilitated
  21566. * using a specified flyToMode over a given number of seconds.
  21567. * @param duration - entry duration
  21568. * @param flyToMode - KML fly to mode: bounce, smooth, etc
  21569. * @param view - KmlCamera or KmlLookAt
  21570. */
  21571. export class KmlTourFlyTo {
  21572. constructor(duration: number, flyToMode: string, view: KmlCamera | KmlLookAt);
  21573. /**
  21574. * Play this playlist entry
  21575. * @param done - function which will be called when playback ends
  21576. * @param camera - Cesium camera
  21577. * @param [cameraOptions] - which will be merged with camera flyTo options. See {@link Camera#flyTo}
  21578. */
  21579. play(done: KmlTourFlyTo.DoneCallback, camera: Camera, cameraOptions?: any): void;
  21580. /**
  21581. * Stop execution of curent entry. Cancel camera flyTo
  21582. */
  21583. stop(): void;
  21584. /**
  21585. * Returns options for {@link Camera#flyTo} or {@link Camera#flyToBoundingSphere}
  21586. * depends on this.view type.
  21587. * @param cameraOptions - options to merge with generated. See {@link Camera#flyTo}
  21588. * @returns {@link Camera#flyTo} or {@link Camera#flyToBoundingSphere} options
  21589. */
  21590. getCameraOptions(cameraOptions: any): any;
  21591. }
  21592. export namespace KmlTourFlyTo {
  21593. /**
  21594. * A function that will be executed when the flight completes.
  21595. * @param terminated - true if {@link KmlTourFlyTo#stop} was
  21596. * called before entry done playback.
  21597. */
  21598. type DoneCallback = (terminated: boolean) => void;
  21599. }
  21600. /**
  21601. * Pauses the KmlTour for a given number of seconds.
  21602. * @param duration - entry duration
  21603. */
  21604. export class KmlTourWait {
  21605. constructor(duration: number);
  21606. /**
  21607. * Play this playlist entry
  21608. * @param done - function which will be called when playback ends
  21609. */
  21610. play(done: KmlTourWait.DoneCallback): void;
  21611. /**
  21612. * Stop execution of curent entry, cancel curent timeout
  21613. */
  21614. stop(): void;
  21615. }
  21616. export namespace KmlTourWait {
  21617. /**
  21618. * A function which will be called when playback ends.
  21619. * @param terminated - true if {@link KmlTourWait#stop} was
  21620. * called before entry done playback.
  21621. */
  21622. type DoneCallback = (terminated: boolean) => void;
  21623. }
  21624. export namespace LabelGraphics {
  21625. /**
  21626. * Initialization options for the LabelGraphics constructor
  21627. * @property [show = true] - A boolean Property specifying the visibility of the label.
  21628. * @property [text] - A Property specifying the text. Explicit newlines '\n' are supported.
  21629. * @property [font = '30px sans-serif'] - A Property specifying the CSS font.
  21630. * @property [style = LabelStyle.FILL] - A Property specifying the {@link LabelStyle}.
  21631. * @property [scale = 1.0] - A numeric Property specifying the scale to apply to the text.
  21632. * @property [showBackground = false] - A boolean Property specifying the visibility of the background behind the label.
  21633. * @property [backgroundColor = new Color(0.165, 0.165, 0.165, 0.8)] - A Property specifying the background {@link Color}.
  21634. * @property [backgroundPadding = new Cartesian2(7, 5)] - A {@link Cartesian2} Property specifying the horizontal and vertical background padding in pixels.
  21635. * @property [pixelOffset = Cartesian2.ZERO] - A {@link Cartesian2} Property specifying the pixel offset.
  21636. * @property [eyeOffset = Cartesian3.ZERO] - A {@link Cartesian3} Property specifying the eye offset.
  21637. * @property [horizontalOrigin = HorizontalOrigin.CENTER] - A Property specifying the {@link HorizontalOrigin}.
  21638. * @property [verticalOrigin = VerticalOrigin.CENTER] - A Property specifying the {@link VerticalOrigin}.
  21639. * @property [heightReference = HeightReference.NONE] - A Property specifying what the height is relative to.
  21640. * @property [fillColor = Color.WHITE] - A Property specifying the fill {@link Color}.
  21641. * @property [outlineColor = Color.BLACK] - A Property specifying the outline {@link Color}.
  21642. * @property [outlineWidth = 1.0] - A numeric Property specifying the outline width.
  21643. * @property [translucencyByDistance] - A {@link NearFarScalar} Property used to set translucency based on distance from the camera.
  21644. * @property [pixelOffsetScaleByDistance] - A {@link NearFarScalar} Property used to set pixelOffset based on distance from the camera.
  21645. * @property [scaleByDistance] - A {@link NearFarScalar} Property used to set scale based on distance from the camera.
  21646. * @property [distanceDisplayCondition] - A Property specifying at what distance from the camera that this label will be displayed.
  21647. * @property [disableDepthTestDistance] - A Property specifying the distance from the camera at which to disable the depth test to.
  21648. */
  21649. type ConstructorOptions = {
  21650. show?: Property | boolean;
  21651. text?: Property | string;
  21652. font?: Property | string;
  21653. style?: Property | LabelStyle;
  21654. scale?: Property | number;
  21655. showBackground?: Property | boolean;
  21656. backgroundColor?: Property | Color;
  21657. backgroundPadding?: Property | Cartesian2;
  21658. pixelOffset?: Property | Cartesian2;
  21659. eyeOffset?: Property | Cartesian3;
  21660. horizontalOrigin?: Property | HorizontalOrigin;
  21661. verticalOrigin?: Property | VerticalOrigin;
  21662. heightReference?: Property | HeightReference;
  21663. fillColor?: Property | Color;
  21664. outlineColor?: Property | Color;
  21665. outlineWidth?: Property | number;
  21666. translucencyByDistance?: Property | NearFarScalar;
  21667. pixelOffsetScaleByDistance?: Property | NearFarScalar;
  21668. scaleByDistance?: Property | NearFarScalar;
  21669. distanceDisplayCondition?: Property | DistanceDisplayCondition;
  21670. disableDepthTestDistance?: Property | number;
  21671. };
  21672. }
  21673. /**
  21674. * Describes a two dimensional label located at the position of the containing {@link Entity}.
  21675. * <p>
  21676. * <div align='center'>
  21677. * <img src='Images/Label.png' width='400' height='300' /><br />
  21678. * Example labels
  21679. * </div>
  21680. * </p>
  21681. * @param [options] - Object describing initialization options
  21682. */
  21683. export class LabelGraphics {
  21684. constructor(options?: LabelGraphics.ConstructorOptions);
  21685. /**
  21686. * Gets the event that is raised whenever a property or sub-property is changed or modified.
  21687. */
  21688. readonly definitionChanged: Event;
  21689. /**
  21690. * Gets or sets the boolean Property specifying the visibility of the label.
  21691. */
  21692. show: Property | undefined;
  21693. /**
  21694. * Gets or sets the string Property specifying the text of the label.
  21695. * Explicit newlines '\n' are supported.
  21696. */
  21697. text: Property | undefined;
  21698. /**
  21699. * Gets or sets the string Property specifying the font in CSS syntax.
  21700. */
  21701. font: Property | undefined;
  21702. /**
  21703. * Gets or sets the Property specifying the {@link LabelStyle}.
  21704. */
  21705. style: Property | undefined;
  21706. /**
  21707. * Gets or sets the numeric Property specifying the uniform scale to apply to the image.
  21708. * A scale greater than <code>1.0</code> enlarges the label while a scale less than <code>1.0</code> shrinks it.
  21709. * <p>
  21710. * <div align='center'>
  21711. * <img src='Images/Label.setScale.png' width='400' height='300' /><br/>
  21712. * From left to right in the above image, the scales are <code>0.5</code>, <code>1.0</code>,
  21713. * and <code>2.0</code>.
  21714. * </div>
  21715. * </p>
  21716. */
  21717. scale: Property | undefined;
  21718. /**
  21719. * Gets or sets the boolean Property specifying the visibility of the background behind the label.
  21720. */
  21721. showBackground: Property | undefined;
  21722. /**
  21723. * Gets or sets the Property specifying the background {@link Color}.
  21724. */
  21725. backgroundColor: Property | undefined;
  21726. /**
  21727. * Gets or sets the {@link Cartesian2} Property specifying the label's horizontal and vertical
  21728. * background padding in pixels.
  21729. */
  21730. backgroundPadding: Property | undefined;
  21731. /**
  21732. * Gets or sets the {@link Cartesian2} Property specifying the label's pixel offset in screen space
  21733. * from the origin of this label. This is commonly used to align multiple labels and labels at
  21734. * the same position, e.g., an image and text. The screen space origin is the top, left corner of the
  21735. * canvas; <code>x</code> increases from left to right, and <code>y</code> increases from top to bottom.
  21736. * <p>
  21737. * <div align='center'>
  21738. * <table border='0' cellpadding='5'><tr>
  21739. * <td align='center'><code>default</code><br/><img src='Images/Label.setPixelOffset.default.png' width='250' height='188' /></td>
  21740. * <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>
  21741. * </tr></table>
  21742. * The label's origin is indicated by the yellow point.
  21743. * </div>
  21744. * </p>
  21745. */
  21746. pixelOffset: Property | undefined;
  21747. /**
  21748. * Gets or sets the {@link Cartesian3} Property specifying the label's offset in eye coordinates.
  21749. * Eye coordinates is a left-handed coordinate system, where <code>x</code> points towards the viewer's
  21750. * right, <code>y</code> points up, and <code>z</code> points into the screen.
  21751. * <p>
  21752. * An eye offset is commonly used to arrange multiple labels or objects at the same position, e.g., to
  21753. * arrange a label above its corresponding 3D model.
  21754. * </p>
  21755. * Below, the label is positioned at the center of the Earth but an eye offset makes it always
  21756. * appear on top of the Earth regardless of the viewer's or Earth's orientation.
  21757. * <p>
  21758. * <div align='center'>
  21759. * <table border='0' cellpadding='5'><tr>
  21760. * <td align='center'><img src='Images/Billboard.setEyeOffset.one.png' width='250' height='188' /></td>
  21761. * <td align='center'><img src='Images/Billboard.setEyeOffset.two.png' width='250' height='188' /></td>
  21762. * </tr></table>
  21763. * <code>l.eyeOffset = new Cartesian3(0.0, 8000000.0, 0.0);</code><br /><br />
  21764. * </div>
  21765. * </p>
  21766. */
  21767. eyeOffset: Property | undefined;
  21768. /**
  21769. * Gets or sets the Property specifying the {@link HorizontalOrigin}.
  21770. */
  21771. horizontalOrigin: Property | undefined;
  21772. /**
  21773. * Gets or sets the Property specifying the {@link VerticalOrigin}.
  21774. */
  21775. verticalOrigin: Property | undefined;
  21776. /**
  21777. * Gets or sets the Property specifying the {@link HeightReference}.
  21778. */
  21779. heightReference: Property | undefined;
  21780. /**
  21781. * Gets or sets the Property specifying the fill {@link Color}.
  21782. */
  21783. fillColor: Property | undefined;
  21784. /**
  21785. * Gets or sets the Property specifying the outline {@link Color}.
  21786. */
  21787. outlineColor: Property | undefined;
  21788. /**
  21789. * Gets or sets the numeric Property specifying the outline width.
  21790. */
  21791. outlineWidth: Property | undefined;
  21792. /**
  21793. * Gets or sets {@link NearFarScalar} Property specifying the translucency of the label based on the distance from the camera.
  21794. * A label's translucency will interpolate between the {@link NearFarScalar#nearValue} and
  21795. * {@link NearFarScalar#farValue} while the camera distance falls within the lower and upper bounds
  21796. * of the specified {@link NearFarScalar#near} and {@link NearFarScalar#far}.
  21797. * Outside of these ranges the label's translucency remains clamped to the nearest bound.
  21798. */
  21799. translucencyByDistance: Property | undefined;
  21800. /**
  21801. * Gets or sets {@link NearFarScalar} Property specifying the pixel offset of the label based on the distance from the camera.
  21802. * A label's pixel offset 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 pixel offset remains clamped to the nearest bound.
  21806. */
  21807. pixelOffsetScaleByDistance: Property | undefined;
  21808. /**
  21809. * Gets or sets near and far scaling properties of a Label based on the label's distance from the camera.
  21810. * A label's scale 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 scale remains clamped to the nearest bound. If undefined,
  21814. * scaleByDistance will be disabled.
  21815. */
  21816. scaleByDistance: Property | undefined;
  21817. /**
  21818. * Gets or sets the {@link DistanceDisplayCondition} Property specifying at what distance from the camera that this label will be displayed.
  21819. */
  21820. distanceDisplayCondition: Property | undefined;
  21821. /**
  21822. * Gets or sets the distance from the camera at which to disable the depth test to, for example, prevent clipping against terrain.
  21823. * When set to zero, the depth test is always applied. When set to Number.POSITIVE_INFINITY, the depth test is never applied.
  21824. */
  21825. disableDepthTestDistance: Property | undefined;
  21826. /**
  21827. * Duplicates this instance.
  21828. * @param [result] - The object onto which to store the result.
  21829. * @returns The modified result parameter or a new instance if one was not provided.
  21830. */
  21831. clone(result?: LabelGraphics): LabelGraphics;
  21832. /**
  21833. * Assigns each unassigned property on this object to the value
  21834. * of the same property on the provided source object.
  21835. * @param source - The object to be merged into this object.
  21836. */
  21837. merge(source: LabelGraphics): void;
  21838. }
  21839. /**
  21840. * A {@link Visualizer} which maps the {@link LabelGraphics} instance
  21841. * in {@link Entity#label} to a {@link Label}.
  21842. * @param entityCluster - The entity cluster to manage the collection of billboards and optionally cluster with other entities.
  21843. * @param entityCollection - The entityCollection to visualize.
  21844. */
  21845. export class LabelVisualizer {
  21846. constructor(entityCluster: EntityCluster, entityCollection: EntityCollection);
  21847. /**
  21848. * Updates the primitives created by this visualizer to match their
  21849. * Entity counterpart at the given time.
  21850. * @param time - The time to update to.
  21851. * @returns This function always returns true.
  21852. */
  21853. update(time: JulianDate): boolean;
  21854. /**
  21855. * Returns true if this object was destroyed; otherwise, false.
  21856. * @returns True if this object was destroyed; otherwise, false.
  21857. */
  21858. isDestroyed(): boolean;
  21859. /**
  21860. * Removes and destroys all primitives created by this instance.
  21861. */
  21862. destroy(): void;
  21863. }
  21864. /**
  21865. * The interface for all {@link Property} objects that represent {@link Material} uniforms.
  21866. * This type defines an interface and cannot be instantiated directly.
  21867. */
  21868. export class MaterialProperty {
  21869. constructor();
  21870. /**
  21871. * Gets a value indicating if this property is constant. A property is considered
  21872. * constant if getValue always returns the same result for the current definition.
  21873. */
  21874. readonly isConstant: boolean;
  21875. /**
  21876. * Gets the event that is raised whenever the definition of this property changes.
  21877. * The definition is considered to have changed if a call to getValue would return
  21878. * a different result for the same time.
  21879. */
  21880. readonly definitionChanged: Event;
  21881. /**
  21882. * Gets the {@link Material} type at the provided time.
  21883. * @param time - The time for which to retrieve the type.
  21884. * @returns The type of material.
  21885. */
  21886. getType(time: JulianDate): string;
  21887. /**
  21888. * Gets the value of the property at the provided time.
  21889. * @param time - The time for which to retrieve the value.
  21890. * @param [result] - The object to store the value into, if omitted, a new instance is created and returned.
  21891. * @returns The modified result parameter or a new instance if the result parameter was not supplied.
  21892. */
  21893. getValue(time: JulianDate, result?: any): any;
  21894. /**
  21895. * Compares this property to the provided property and returns
  21896. * <code>true</code> if they are equal, <code>false</code> otherwise.
  21897. * @param [other] - The other property.
  21898. * @returns <code>true</code> if left and right are equal, <code>false</code> otherwise.
  21899. */
  21900. equals(other?: Property): boolean;
  21901. }
  21902. export namespace ModelGraphics {
  21903. /**
  21904. * Initialization options for the ModelGraphics constructor
  21905. * @property [show = true] - A boolean Property specifying the visibility of the model.
  21906. * @property [uri] - A string or Resource Property specifying the URI of the glTF asset.
  21907. * @property [scale = 1.0] - A numeric Property specifying a uniform linear scale.
  21908. * @property [minimumPixelSize = 0.0] - A numeric Property specifying the approximate minimum pixel size of the model regardless of zoom.
  21909. * @property [maximumScale] - The maximum scale size of a model. An upper limit for minimumPixelSize.
  21910. * @property [incrementallyLoadTextures = true] - Determine if textures may continue to stream in after the model is loaded.
  21911. * @property [runAnimations = true] - A boolean Property specifying if glTF animations specified in the model should be started.
  21912. * @property [clampAnimations = true] - A boolean Property specifying if glTF animations should hold the last pose for time durations with no keyframes.
  21913. * @property [shadows = ShadowMode.ENABLED] - An enum Property specifying whether the model casts or receives shadows from light sources.
  21914. * @property [heightReference = HeightReference.NONE] - A Property specifying what the height is relative to.
  21915. * @property [silhouetteColor = Color.RED] - A Property specifying the {@link Color} of the silhouette.
  21916. * @property [silhouetteSize = 0.0] - A numeric Property specifying the size of the silhouette in pixels.
  21917. * @property [color = Color.WHITE] - A Property specifying the {@link Color} that blends with the model's rendered color.
  21918. * @property [colorBlendMode = ColorBlendMode.HIGHLIGHT] - An enum Property specifying how the color blends with the model.
  21919. * @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.
  21920. * @property [imageBasedLightingFactor = new Cartesian2(1.0, 1.0)] - A property specifying the contribution from diffuse and specular image-based lighting.
  21921. * @property [lightColor] - A property specifying the light color when shading the model. When <code>undefined</code> the scene's light color is used instead.
  21922. * @property [distanceDisplayCondition] - A Property specifying at what distance from the camera that this model will be displayed.
  21923. * @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.
  21924. * @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.
  21925. * @property [clippingPlanes] - A property specifying the {@link ClippingPlaneCollection} used to selectively disable rendering the model.
  21926. */
  21927. type ConstructorOptions = {
  21928. show?: Property | boolean;
  21929. uri?: Property | string | Resource;
  21930. scale?: Property | number;
  21931. minimumPixelSize?: Property | number;
  21932. maximumScale?: Property | number;
  21933. incrementallyLoadTextures?: Property | boolean;
  21934. runAnimations?: Property | boolean;
  21935. clampAnimations?: Property | boolean;
  21936. shadows?: Property | ShadowMode;
  21937. heightReference?: Property | HeightReference;
  21938. silhouetteColor?: Property | Color;
  21939. silhouetteSize?: Property | number;
  21940. color?: Property | Color;
  21941. colorBlendMode?: Property | ColorBlendMode;
  21942. colorBlendAmount?: Property | number;
  21943. imageBasedLightingFactor?: Property | Cartesian2;
  21944. lightColor?: Property | Color;
  21945. distanceDisplayCondition?: Property | DistanceDisplayCondition;
  21946. nodeTransformations?: PropertyBag | {
  21947. [key: string]: TranslationRotationScale;
  21948. };
  21949. articulations?: PropertyBag | {
  21950. [key: string]: number;
  21951. };
  21952. clippingPlanes?: Property | ClippingPlaneCollection;
  21953. };
  21954. }
  21955. /**
  21956. * A 3D model based on {@link https://github.com/KhronosGroup/glTF|glTF}, the runtime asset format for WebGL, OpenGL ES, and OpenGL.
  21957. * The position and orientation of the model is determined by the containing {@link Entity}.
  21958. * <p>
  21959. * Cesium includes support for glTF geometry, materials, animations, and skinning.
  21960. * Cameras and lights are not currently supported.
  21961. * </p>
  21962. * @param [options] - Object describing initialization options
  21963. */
  21964. export class ModelGraphics {
  21965. constructor(options?: ModelGraphics.ConstructorOptions);
  21966. /**
  21967. * Gets the event that is raised whenever a property or sub-property is changed or modified.
  21968. */
  21969. readonly definitionChanged: Event;
  21970. /**
  21971. * Gets or sets the boolean Property specifying the visibility of the model.
  21972. */
  21973. show: Property | undefined;
  21974. /**
  21975. * Gets or sets the string Property specifying the URI of the glTF asset.
  21976. */
  21977. uri: Property | undefined;
  21978. /**
  21979. * Gets or sets the numeric Property specifying a uniform linear scale
  21980. * for this model. Values greater than 1.0 increase the size of the model while
  21981. * values less than 1.0 decrease it.
  21982. */
  21983. scale: Property | undefined;
  21984. /**
  21985. * Gets or sets the numeric Property specifying the approximate minimum
  21986. * pixel size of the model regardless of zoom. This can be used to ensure that
  21987. * a model is visible even when the viewer zooms out. When <code>0.0</code>,
  21988. * no minimum size is enforced.
  21989. */
  21990. minimumPixelSize: Property | undefined;
  21991. /**
  21992. * Gets or sets the numeric Property specifying the maximum scale
  21993. * size of a model. This property is used as an upper limit for
  21994. * {@link ModelGraphics#minimumPixelSize}.
  21995. */
  21996. maximumScale: Property | undefined;
  21997. /**
  21998. * Get or sets the boolean Property specifying whether textures
  21999. * may continue to stream in after the model is loaded.
  22000. */
  22001. incrementallyLoadTextures: Property | undefined;
  22002. /**
  22003. * Gets or sets the boolean Property specifying if glTF animations should be run.
  22004. */
  22005. runAnimations: Property | undefined;
  22006. /**
  22007. * Gets or sets the boolean Property specifying if glTF animations should hold the last pose for time durations with no keyframes.
  22008. */
  22009. clampAnimations: Property | undefined;
  22010. /**
  22011. * Get or sets the enum Property specifying whether the model
  22012. * casts or receives shadows from light sources.
  22013. */
  22014. shadows: Property | undefined;
  22015. /**
  22016. * Gets or sets the Property specifying the {@link HeightReference}.
  22017. */
  22018. heightReference: Property | undefined;
  22019. /**
  22020. * Gets or sets the Property specifying the {@link Color} of the silhouette.
  22021. */
  22022. silhouetteColor: Property | undefined;
  22023. /**
  22024. * Gets or sets the numeric Property specifying the size of the silhouette in pixels.
  22025. */
  22026. silhouetteSize: Property | undefined;
  22027. /**
  22028. * Gets or sets the Property specifying the {@link Color} that blends with the model's rendered color.
  22029. */
  22030. color: Property | undefined;
  22031. /**
  22032. * Gets or sets the enum Property specifying how the color blends with the model.
  22033. */
  22034. colorBlendMode: Property | undefined;
  22035. /**
  22036. * A numeric Property specifying the color strength when the <code>colorBlendMode</code> is MIX.
  22037. * A value of 0.0 results in the model's rendered color while a value of 1.0 results in a solid color, with
  22038. * any value in-between resulting in a mix of the two.
  22039. */
  22040. colorBlendAmount: Property | undefined;
  22041. /**
  22042. * A property specifying the {@link Cartesian2} used to scale the diffuse and specular image-based lighting contribution to the final color.
  22043. */
  22044. imageBasedLightingFactor: Property | undefined;
  22045. /**
  22046. * A property specifying the {@link Cartesian3} light color when shading the model. When <code>undefined</code> the scene's light color is used instead.
  22047. */
  22048. lightColor: Property | undefined;
  22049. /**
  22050. * Gets or sets the {@link DistanceDisplayCondition} Property specifying at what distance from the camera that this model will be displayed.
  22051. */
  22052. distanceDisplayCondition: Property | undefined;
  22053. /**
  22054. * Gets or sets the set of node transformations to apply to this model. This is represented as an {@link PropertyBag}, where keys are
  22055. * names of nodes, and values are {@link TranslationRotationScale} Properties describing the transformation to apply to that node.
  22056. * The transformation is applied after the node's existing transformation as specified in the glTF, and does not replace the node's existing transformation.
  22057. */
  22058. nodeTransformations: PropertyBag;
  22059. /**
  22060. * Gets or sets the set of articulation values to apply to this model. This is represented as an {@link PropertyBag}, where keys are
  22061. * composed as the name of the articulation, a single space, and the name of the stage.
  22062. */
  22063. articulations: PropertyBag;
  22064. /**
  22065. * A property specifying the {@link ClippingPlaneCollection} used to selectively disable rendering the model.
  22066. */
  22067. clippingPlanes: Property | undefined;
  22068. /**
  22069. * Duplicates this instance.
  22070. * @param [result] - The object onto which to store the result.
  22071. * @returns The modified result parameter or a new instance if one was not provided.
  22072. */
  22073. clone(result?: ModelGraphics): ModelGraphics;
  22074. /**
  22075. * Assigns each unassigned property on this object to the value
  22076. * of the same property on the provided source object.
  22077. * @param source - The object to be merged into this object.
  22078. */
  22079. merge(source: ModelGraphics): void;
  22080. }
  22081. /**
  22082. * A {@link Visualizer} which maps {@link Entity#model} to a {@link Model}.
  22083. * @param scene - The scene the primitives will be rendered in.
  22084. * @param entityCollection - The entityCollection to visualize.
  22085. */
  22086. export class ModelVisualizer {
  22087. constructor(scene: Scene, entityCollection: EntityCollection);
  22088. /**
  22089. * Updates models created this visualizer to match their
  22090. * Entity counterpart at the given time.
  22091. * @param time - The time to update to.
  22092. * @returns This function always returns true.
  22093. */
  22094. update(time: JulianDate): boolean;
  22095. /**
  22096. * Returns true if this object was destroyed; otherwise, false.
  22097. * @returns True if this object was destroyed; otherwise, false.
  22098. */
  22099. isDestroyed(): boolean;
  22100. /**
  22101. * Removes and destroys all primitives created by this instance.
  22102. */
  22103. destroy(): void;
  22104. }
  22105. /**
  22106. * A {@link Property} that produces {@link TranslationRotationScale} data.
  22107. * @param [options] - Object with the following properties:
  22108. * @param [options.translation = Cartesian3.ZERO] - A {@link Cartesian3} Property specifying the (x, y, z) translation to apply to the node.
  22109. * @param [options.rotation = Quaternion.IDENTITY] - A {@link Quaternion} Property specifying the (x, y, z, w) rotation to apply to the node.
  22110. * @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.
  22111. */
  22112. export class NodeTransformationProperty {
  22113. constructor(options?: {
  22114. translation?: Property | Cartesian3;
  22115. rotation?: Property | Quaternion;
  22116. scale?: Property | Cartesian3;
  22117. });
  22118. /**
  22119. * Gets a value indicating if this property is constant. A property is considered
  22120. * constant if getValue always returns the same result for the current definition.
  22121. */
  22122. readonly isConstant: boolean;
  22123. /**
  22124. * Gets the event that is raised whenever the definition of this property changes.
  22125. * The definition is considered to have changed if a call to getValue would return
  22126. * a different result for the same time.
  22127. */
  22128. readonly definitionChanged: Event;
  22129. /**
  22130. * Gets or sets the {@link Cartesian3} Property specifying the (x, y, z) translation to apply to the node.
  22131. */
  22132. translation: Property | undefined;
  22133. /**
  22134. * Gets or sets the {@link Quaternion} Property specifying the (x, y, z, w) rotation to apply to the node.
  22135. */
  22136. rotation: Property | undefined;
  22137. /**
  22138. * Gets or sets the {@link Cartesian3} Property specifying the (x, y, z) scaling to apply to the node.
  22139. */
  22140. scale: Property | undefined;
  22141. /**
  22142. * Gets the value of the property at the provided time.
  22143. * @param time - The time for which to retrieve the value.
  22144. * @param [result] - The object to store the value into, if omitted, a new instance is created and returned.
  22145. * @returns The modified result parameter or a new instance if the result parameter was not supplied.
  22146. */
  22147. getValue(time: JulianDate, result?: TranslationRotationScale): TranslationRotationScale;
  22148. /**
  22149. * Compares this property to the provided property and returns
  22150. * <code>true</code> if they are equal, <code>false</code> otherwise.
  22151. * @param [other] - The other property.
  22152. * @returns <code>true</code> if left and right are equal, <code>false</code> otherwise.
  22153. */
  22154. equals(other?: Property): boolean;
  22155. }
  22156. export namespace PathGraphics {
  22157. /**
  22158. * Initialization options for the PathGraphics constructor
  22159. * @property [show = true] - A boolean Property specifying the visibility of the path.
  22160. * @property [leadTime] - A Property specifying the number of seconds in front the object to show.
  22161. * @property [trailTime] - A Property specifying the number of seconds behind of the object to show.
  22162. * @property [width = 1.0] - A numeric Property specifying the width in pixels.
  22163. * @property [resolution = 60] - A numeric Property specifying the maximum number of seconds to step when sampling the position.
  22164. * @property [material = Color.WHITE] - A Property specifying the material used to draw the path.
  22165. * @property [distanceDisplayCondition] - A Property specifying at what distance from the camera that this path will be displayed.
  22166. */
  22167. type ConstructorOptions = {
  22168. show?: Property | boolean;
  22169. leadTime?: Property | number;
  22170. trailTime?: Property | number;
  22171. width?: Property | number;
  22172. resolution?: Property | number;
  22173. material?: MaterialProperty | Color;
  22174. distanceDisplayCondition?: Property | DistanceDisplayCondition;
  22175. };
  22176. }
  22177. /**
  22178. * Describes a polyline defined as the path made by an {@link Entity} as it moves over time.
  22179. * @param [options] - Object describing initialization options
  22180. */
  22181. export class PathGraphics {
  22182. constructor(options?: PathGraphics.ConstructorOptions);
  22183. /**
  22184. * Gets the event that is raised whenever a property or sub-property is changed or modified.
  22185. */
  22186. readonly definitionChanged: Event;
  22187. /**
  22188. * Gets or sets the boolean Property specifying the visibility of the path.
  22189. */
  22190. show: Property | undefined;
  22191. /**
  22192. * Gets or sets the Property specifying the number of seconds in front of the object to show.
  22193. */
  22194. leadTime: Property | undefined;
  22195. /**
  22196. * Gets or sets the Property specifying the number of seconds behind the object to show.
  22197. */
  22198. trailTime: Property | undefined;
  22199. /**
  22200. * Gets or sets the numeric Property specifying the width in pixels.
  22201. */
  22202. width: Property | undefined;
  22203. /**
  22204. * Gets or sets the Property specifying the maximum number of seconds to step when sampling the position.
  22205. */
  22206. resolution: Property | undefined;
  22207. /**
  22208. * Gets or sets the Property specifying the material used to draw the path.
  22209. */
  22210. material: MaterialProperty;
  22211. /**
  22212. * Gets or sets the {@link DistanceDisplayCondition} Property specifying at what distance from the camera that this path will be displayed.
  22213. */
  22214. distanceDisplayCondition: Property | undefined;
  22215. /**
  22216. * Duplicates this instance.
  22217. * @param [result] - The object onto which to store the result.
  22218. * @returns The modified result parameter or a new instance if one was not provided.
  22219. */
  22220. clone(result?: PathGraphics): PathGraphics;
  22221. /**
  22222. * Assigns each unassigned property on this object to the value
  22223. * of the same property on the provided source object.
  22224. * @param source - The object to be merged into this object.
  22225. */
  22226. merge(source: PathGraphics): void;
  22227. }
  22228. /**
  22229. * A {@link Visualizer} which maps {@link Entity#path} to a {@link Polyline}.
  22230. * @param scene - The scene the primitives will be rendered in.
  22231. * @param entityCollection - The entityCollection to visualize.
  22232. */
  22233. export class PathVisualizer {
  22234. constructor(scene: Scene, entityCollection: EntityCollection);
  22235. /**
  22236. * Updates all of the primitives created by this visualizer to match their
  22237. * Entity counterpart at the given time.
  22238. * @param time - The time to update to.
  22239. * @returns This function always returns true.
  22240. */
  22241. update(time: JulianDate): boolean;
  22242. /**
  22243. * Returns true if this object was destroyed; otherwise, false.
  22244. * @returns True if this object was destroyed; otherwise, false.
  22245. */
  22246. isDestroyed(): boolean;
  22247. /**
  22248. * Removes and destroys all primitives created by this instance.
  22249. */
  22250. destroy(): void;
  22251. }
  22252. /**
  22253. * A {@link GeometryUpdater} for planes.
  22254. * Clients do not normally create this class directly, but instead rely on {@link DataSourceDisplay}.
  22255. * @param entity - The entity containing the geometry to be visualized.
  22256. * @param scene - The scene where visualization is taking place.
  22257. */
  22258. export class PlaneGeometryUpdater {
  22259. constructor(entity: Entity, scene: Scene);
  22260. /**
  22261. * Creates the geometry instance which represents the fill of the geometry.
  22262. * @param time - The time to use when retrieving initial attribute values.
  22263. * @returns The geometry instance representing the filled portion of the geometry.
  22264. */
  22265. createFillGeometryInstance(time: JulianDate): GeometryInstance;
  22266. /**
  22267. * Creates the geometry instance which represents the outline of the geometry.
  22268. * @param time - The time to use when retrieving initial attribute values.
  22269. * @returns The geometry instance representing the outline portion of the geometry.
  22270. */
  22271. createOutlineGeometryInstance(time: JulianDate): GeometryInstance;
  22272. }
  22273. export namespace PlaneGraphics {
  22274. /**
  22275. * Initialization options for the PlaneGraphics constructor
  22276. * @property [show = true] - A boolean Property specifying the visibility of the plane.
  22277. * @property [plane] - A {@link Plane} Property specifying the normal and distance for the plane.
  22278. * @property [dimensions] - A {@link Cartesian2} Property specifying the width and height of the plane.
  22279. * @property [fill = true] - A boolean Property specifying whether the plane is filled with the provided material.
  22280. * @property [material = Color.WHITE] - A Property specifying the material used to fill the plane.
  22281. * @property [outline = false] - A boolean Property specifying whether the plane is outlined.
  22282. * @property [outlineColor = Color.BLACK] - A Property specifying the {@link Color} of the outline.
  22283. * @property [outlineWidth = 1.0] - A numeric Property specifying the width of the outline.
  22284. * @property [shadows = ShadowMode.DISABLED] - An enum Property specifying whether the plane casts or receives shadows from light sources.
  22285. * @property [distanceDisplayCondition] - A Property specifying at what distance from the camera that this plane will be displayed.
  22286. */
  22287. type ConstructorOptions = {
  22288. show?: Property | boolean;
  22289. plane?: Property | Plane;
  22290. dimensions?: Property | Cartesian2;
  22291. fill?: Property | boolean;
  22292. material?: MaterialProperty | Color;
  22293. outline?: Property | boolean;
  22294. outlineColor?: Property | Color;
  22295. outlineWidth?: Property | number;
  22296. shadows?: Property | ShadowMode;
  22297. distanceDisplayCondition?: Property | DistanceDisplayCondition;
  22298. };
  22299. }
  22300. /**
  22301. * Describes a plane. The center position and orientation are determined by the containing {@link Entity}.
  22302. * @param [options] - Object describing initialization options
  22303. */
  22304. export class PlaneGraphics {
  22305. constructor(options?: PlaneGraphics.ConstructorOptions);
  22306. /**
  22307. * Gets the event that is raised whenever a property or sub-property is changed or modified.
  22308. */
  22309. readonly definitionChanged: Event;
  22310. /**
  22311. * Gets or sets the boolean Property specifying the visibility of the plane.
  22312. */
  22313. show: Property | undefined;
  22314. /**
  22315. * Gets or sets the {@link Plane} Property specifying the normal and distance of the plane.
  22316. */
  22317. plane: Property | undefined;
  22318. /**
  22319. * Gets or sets the {@link Cartesian2} Property specifying the width and height of the plane.
  22320. */
  22321. dimensions: Property | undefined;
  22322. /**
  22323. * Gets or sets the boolean Property specifying whether the plane is filled with the provided material.
  22324. */
  22325. fill: Property | undefined;
  22326. /**
  22327. * Gets or sets the material used to fill the plane.
  22328. */
  22329. material: MaterialProperty;
  22330. /**
  22331. * Gets or sets the Property specifying whether the plane is outlined.
  22332. */
  22333. outline: Property | undefined;
  22334. /**
  22335. * Gets or sets the Property specifying the {@link Color} of the outline.
  22336. */
  22337. outlineColor: Property | undefined;
  22338. /**
  22339. * Gets or sets the numeric Property specifying the width of the outline.
  22340. * <p>
  22341. * Note: This property will be ignored on all major browsers on Windows platforms. For details, see (@link https://github.com/CesiumGS/cesium/issues/40}.
  22342. * </p>
  22343. */
  22344. outlineWidth: Property | undefined;
  22345. /**
  22346. * Get or sets the enum Property specifying whether the plane
  22347. * casts or receives shadows from light sources.
  22348. */
  22349. shadows: Property | undefined;
  22350. /**
  22351. * Gets or sets the {@link DistanceDisplayCondition} Property specifying at what distance from the camera that this plane will be displayed.
  22352. */
  22353. distanceDisplayCondition: Property | undefined;
  22354. /**
  22355. * Duplicates this instance.
  22356. * @param [result] - The object onto which to store the result.
  22357. * @returns The modified result parameter or a new instance if one was not provided.
  22358. */
  22359. clone(result?: PlaneGraphics): PlaneGraphics;
  22360. /**
  22361. * Assigns each unassigned property on this object to the value
  22362. * of the same property on the provided source object.
  22363. * @param source - The object to be merged into this object.
  22364. */
  22365. merge(source: PlaneGraphics): void;
  22366. }
  22367. export namespace PointGraphics {
  22368. /**
  22369. * Initialization options for the PointGraphics constructor
  22370. * @property [show = true] - A boolean Property specifying the visibility of the point.
  22371. * @property [pixelSize = 1] - A numeric Property specifying the size in pixels.
  22372. * @property [heightReference = HeightReference.NONE] - A Property specifying what the height is relative to.
  22373. * @property [color = Color.WHITE] - A Property specifying the {@link Color} of the point.
  22374. * @property [outlineColor = Color.BLACK] - A Property specifying the {@link Color} of the outline.
  22375. * @property [outlineWidth = 0] - A numeric Property specifying the the outline width in pixels.
  22376. * @property [scaleByDistance] - A {@link NearFarScalar} Property used to scale the point based on distance.
  22377. * @property [translucencyByDistance] - A {@link NearFarScalar} Property used to set translucency based on distance from the camera.
  22378. * @property [distanceDisplayCondition] - A Property specifying at what distance from the camera that this point will be displayed.
  22379. * @property [disableDepthTestDistance] - A Property specifying the distance from the camera at which to disable the depth test to.
  22380. */
  22381. type ConstructorOptions = {
  22382. show?: Property | boolean;
  22383. pixelSize?: Property | number;
  22384. heightReference?: Property | HeightReference;
  22385. color?: Property | Color;
  22386. outlineColor?: Property | Color;
  22387. outlineWidth?: Property | number;
  22388. scaleByDistance?: Property | NearFarScalar;
  22389. translucencyByDistance?: Property | NearFarScalar;
  22390. distanceDisplayCondition?: Property | DistanceDisplayCondition;
  22391. disableDepthTestDistance?: Property | number;
  22392. };
  22393. }
  22394. /**
  22395. * Describes a graphical point located at the position of the containing {@link Entity}.
  22396. * @param [options] - Object describing initialization options
  22397. */
  22398. export class PointGraphics {
  22399. constructor(options?: PointGraphics.ConstructorOptions);
  22400. /**
  22401. * Gets the event that is raised whenever a property or sub-property is changed or modified.
  22402. */
  22403. readonly definitionChanged: Event;
  22404. /**
  22405. * Gets or sets the boolean Property specifying the visibility of the point.
  22406. */
  22407. show: Property | undefined;
  22408. /**
  22409. * Gets or sets the numeric Property specifying the size in pixels.
  22410. */
  22411. pixelSize: Property | undefined;
  22412. /**
  22413. * Gets or sets the Property specifying the {@link HeightReference}.
  22414. */
  22415. heightReference: Property | undefined;
  22416. /**
  22417. * Gets or sets the Property specifying the {@link Color} of the point.
  22418. */
  22419. color: Property | undefined;
  22420. /**
  22421. * Gets or sets the Property specifying the {@link Color} of the outline.
  22422. */
  22423. outlineColor: Property | undefined;
  22424. /**
  22425. * Gets or sets the numeric Property specifying the the outline width in pixels.
  22426. */
  22427. outlineWidth: Property | undefined;
  22428. /**
  22429. * Gets or sets the {@link NearFarScalar} Property used to scale the point based on distance.
  22430. * If undefined, a constant size is used.
  22431. */
  22432. scaleByDistance: Property | undefined;
  22433. /**
  22434. * Gets or sets {@link NearFarScalar} Property specifying the translucency of the point based on the distance from the camera.
  22435. * A point's translucency will interpolate between the {@link NearFarScalar#nearValue} and
  22436. * {@link NearFarScalar#farValue} while the camera distance falls within the lower and upper bounds
  22437. * of the specified {@link NearFarScalar#near} and {@link NearFarScalar#far}.
  22438. * Outside of these ranges the points's translucency remains clamped to the nearest bound.
  22439. */
  22440. translucencyByDistance: Property | undefined;
  22441. /**
  22442. * Gets or sets the {@link DistanceDisplayCondition} Property specifying at what distance from the camera that this point will be displayed.
  22443. */
  22444. distanceDisplayCondition: Property | undefined;
  22445. /**
  22446. * Gets or sets the distance from the camera at which to disable the depth test to, for example, prevent clipping against terrain.
  22447. * When set to zero, the depth test is always applied. When set to Number.POSITIVE_INFINITY, the depth test is never applied.
  22448. */
  22449. disableDepthTestDistance: Property | undefined;
  22450. /**
  22451. * Duplicates this instance.
  22452. * @param [result] - The object onto which to store the result.
  22453. * @returns The modified result parameter or a new instance if one was not provided.
  22454. */
  22455. clone(result?: PointGraphics): PointGraphics;
  22456. /**
  22457. * Assigns each unassigned property on this object to the value
  22458. * of the same property on the provided source object.
  22459. * @param source - The object to be merged into this object.
  22460. */
  22461. merge(source: PointGraphics): void;
  22462. }
  22463. /**
  22464. * A {@link Visualizer} which maps {@link Entity#point} to a {@link PointPrimitive}.
  22465. * @param entityCluster - The entity cluster to manage the collection of billboards and optionally cluster with other entities.
  22466. * @param entityCollection - The entityCollection to visualize.
  22467. */
  22468. export class PointVisualizer {
  22469. constructor(entityCluster: EntityCluster, entityCollection: EntityCollection);
  22470. /**
  22471. * Updates the primitives created by this visualizer to match their
  22472. * Entity counterpart at the given time.
  22473. * @param time - The time to update to.
  22474. * @returns This function always returns true.
  22475. */
  22476. update(time: JulianDate): boolean;
  22477. /**
  22478. * Returns true if this object was destroyed; otherwise, false.
  22479. * @returns True if this object was destroyed; otherwise, false.
  22480. */
  22481. isDestroyed(): boolean;
  22482. /**
  22483. * Removes and destroys all primitives created by this instance.
  22484. */
  22485. destroy(): void;
  22486. }
  22487. /**
  22488. * A {@link GeometryUpdater} for polygons.
  22489. * Clients do not normally create this class directly, but instead rely on {@link DataSourceDisplay}.
  22490. * @param entity - The entity containing the geometry to be visualized.
  22491. * @param scene - The scene where visualization is taking place.
  22492. */
  22493. export class PolygonGeometryUpdater {
  22494. constructor(entity: Entity, scene: Scene);
  22495. /**
  22496. * Creates the geometry instance which represents the fill of the geometry.
  22497. * @param time - The time to use when retrieving initial attribute values.
  22498. * @returns The geometry instance representing the filled portion of the geometry.
  22499. */
  22500. createFillGeometryInstance(time: JulianDate): GeometryInstance;
  22501. /**
  22502. * Creates the geometry instance which represents the outline of the geometry.
  22503. * @param time - The time to use when retrieving initial attribute values.
  22504. * @returns The geometry instance representing the outline portion of the geometry.
  22505. */
  22506. createOutlineGeometryInstance(time: JulianDate): GeometryInstance;
  22507. }
  22508. export namespace PolygonGraphics {
  22509. /**
  22510. * Initialization options for the PolygonGraphics constructor
  22511. * @property [show = true] - A boolean Property specifying the visibility of the polygon.
  22512. * @property [hierarchy] - A Property specifying the {@link PolygonHierarchy}.
  22513. * @property [height = 0] - A numeric Property specifying the altitude of the polygon relative to the ellipsoid surface.
  22514. * @property [heightReference = HeightReference.NONE] - A Property specifying what the height is relative to.
  22515. * @property [extrudedHeight] - A numeric Property specifying the altitude of the polygon's extruded face relative to the ellipsoid surface.
  22516. * @property [extrudedHeightReference = HeightReference.NONE] - A Property specifying what the extrudedHeight is relative to.
  22517. * @property [stRotation = 0.0] - A numeric property specifying the rotation of the polygon texture counter-clockwise from north.
  22518. * @property [granularity = Cesium.Math.RADIANS_PER_DEGREE] - A numeric Property specifying the angular distance between each latitude and longitude point.
  22519. * @property [fill = true] - A boolean Property specifying whether the polygon is filled with the provided material.
  22520. * @property [material = Color.WHITE] - A Property specifying the material used to fill the polygon.
  22521. * @property [outline = false] - A boolean Property specifying whether the polygon is outlined.
  22522. * @property [outlineColor = Color.BLACK] - A Property specifying the {@link Color} of the outline.
  22523. * @property [outlineWidth = 1.0] - A numeric Property specifying the width of the outline.
  22524. * @property [perPositionHeight = false] - A boolean specifying whether or not the height of each position is used.
  22525. * @property [closeTop = true] - When false, leaves off the top of an extruded polygon open.
  22526. * @property [closeBottom = true] - When false, leaves off the bottom of an extruded polygon open.
  22527. * @property [arcType = ArcType.GEODESIC] - The type of line the polygon edges must follow.
  22528. * @property [shadows = ShadowMode.DISABLED] - An enum Property specifying whether the polygon casts or receives shadows from light sources.
  22529. * @property [distanceDisplayCondition] - A Property specifying at what distance from the camera that this polygon will be displayed.
  22530. * @property [classificationType = ClassificationType.BOTH] - An enum Property specifying whether this polygon will classify terrain, 3D Tiles, or both when on the ground.
  22531. * @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.
  22532. */
  22533. type ConstructorOptions = {
  22534. show?: Property | boolean;
  22535. hierarchy?: Property | PolygonHierarchy;
  22536. height?: Property | number;
  22537. heightReference?: Property | HeightReference;
  22538. extrudedHeight?: Property | number;
  22539. extrudedHeightReference?: Property | HeightReference;
  22540. stRotation?: Property | number;
  22541. granularity?: Property | number;
  22542. fill?: Property | boolean;
  22543. material?: MaterialProperty | Color;
  22544. outline?: Property | boolean;
  22545. outlineColor?: Property | Color;
  22546. outlineWidth?: Property | number;
  22547. perPositionHeight?: Property | boolean;
  22548. closeTop?: boolean | boolean;
  22549. closeBottom?: boolean | boolean;
  22550. arcType?: Property | ArcType;
  22551. shadows?: Property | ShadowMode;
  22552. distanceDisplayCondition?: Property | DistanceDisplayCondition;
  22553. classificationType?: Property | ClassificationType;
  22554. zIndex?: ConstantProperty | number;
  22555. };
  22556. }
  22557. /**
  22558. * Describes a polygon defined by an hierarchy of linear rings which make up the outer shape and any nested holes.
  22559. * The polygon conforms to the curvature of the globe and can be placed on the surface or
  22560. * at altitude and can optionally be extruded into a volume.
  22561. * @param [options] - Object describing initialization options
  22562. */
  22563. export class PolygonGraphics {
  22564. constructor(options?: PolygonGraphics.ConstructorOptions);
  22565. /**
  22566. * Gets the event that is raised whenever a property or sub-property is changed or modified.
  22567. */
  22568. readonly definitionChanged: Event;
  22569. /**
  22570. * Gets or sets the boolean Property specifying the visibility of the polygon.
  22571. */
  22572. show: Property | undefined;
  22573. /**
  22574. * Gets or sets the Property specifying the {@link PolygonHierarchy}.
  22575. */
  22576. hierarchy: Property | undefined;
  22577. /**
  22578. * Gets or sets the numeric Property specifying the constant altitude of the polygon.
  22579. */
  22580. height: Property | undefined;
  22581. /**
  22582. * Gets or sets the Property specifying the {@link HeightReference}.
  22583. */
  22584. heightReference: Property | undefined;
  22585. /**
  22586. * Gets or sets the numeric Property specifying the altitude of the polygon extrusion.
  22587. * If {@link PolygonGraphics#perPositionHeight} is false, the volume starts at {@link PolygonGraphics#height} and ends at this altitude.
  22588. * If {@link PolygonGraphics#perPositionHeight} is true, the volume starts at the height of each {@link PolygonGraphics#hierarchy} position and ends at this altitude.
  22589. */
  22590. extrudedHeight: Property | undefined;
  22591. /**
  22592. * Gets or sets the Property specifying the extruded {@link HeightReference}.
  22593. */
  22594. extrudedHeightReference: Property | undefined;
  22595. /**
  22596. * Gets or sets the numeric property specifying the rotation of the polygon texture counter-clockwise from north.
  22597. */
  22598. stRotation: Property | undefined;
  22599. /**
  22600. * Gets or sets the numeric Property specifying the angular distance between points on the polygon.
  22601. */
  22602. granularity: Property | undefined;
  22603. /**
  22604. * Gets or sets the boolean Property specifying whether the polygon is filled with the provided material.
  22605. */
  22606. fill: Property | undefined;
  22607. /**
  22608. * Gets or sets the Property specifying the material used to fill the polygon.
  22609. */
  22610. material: MaterialProperty;
  22611. /**
  22612. * Gets or sets the Property specifying whether the polygon is outlined.
  22613. */
  22614. outline: Property | undefined;
  22615. /**
  22616. * Gets or sets the Property specifying the {@link Color} of the outline.
  22617. */
  22618. outlineColor: Property | undefined;
  22619. /**
  22620. * Gets or sets the numeric Property specifying the width of the outline.
  22621. * <p>
  22622. * Note: This property will be ignored on all major browsers on Windows platforms. For details, see (@link https://github.com/CesiumGS/cesium/issues/40}.
  22623. * </p>
  22624. */
  22625. outlineWidth: Property | undefined;
  22626. /**
  22627. * Gets or sets the boolean specifying whether or not the the height of each position is used.
  22628. * If true, the shape will have non-uniform altitude defined by the height of each {@link PolygonGraphics#hierarchy} position.
  22629. * If false, the shape will have a constant altitude as specified by {@link PolygonGraphics#height}.
  22630. */
  22631. perPositionHeight: Property | undefined;
  22632. /**
  22633. * Gets or sets a boolean specifying whether or not the top of an extruded polygon is included.
  22634. */
  22635. closeTop: Property | undefined;
  22636. /**
  22637. * Gets or sets a boolean specifying whether or not the bottom of an extruded polygon is included.
  22638. */
  22639. closeBottom: Property | undefined;
  22640. /**
  22641. * Gets or sets the {@link ArcType} Property specifying the type of lines the polygon edges use.
  22642. */
  22643. arcType: Property | undefined;
  22644. /**
  22645. * Get or sets the enum Property specifying whether the polygon
  22646. * casts or receives shadows from light sources.
  22647. */
  22648. shadows: Property | undefined;
  22649. /**
  22650. * Gets or sets the {@link DistanceDisplayCondition} Property specifying at what distance from the camera that this polygon will be displayed.
  22651. */
  22652. distanceDisplayCondition: Property | undefined;
  22653. /**
  22654. * Gets or sets the {@link ClassificationType} Property specifying whether this polygon will classify terrain, 3D Tiles, or both when on the ground.
  22655. */
  22656. classificationType: Property | undefined;
  22657. /**
  22658. * 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.
  22659. */
  22660. zIndex: ConstantProperty | undefined;
  22661. /**
  22662. * Duplicates this instance.
  22663. * @param [result] - The object onto which to store the result.
  22664. * @returns The modified result parameter or a new instance if one was not provided.
  22665. */
  22666. clone(result?: PolygonGraphics): PolygonGraphics;
  22667. /**
  22668. * Assigns each unassigned property on this object to the value
  22669. * of the same property on the provided source object.
  22670. * @param source - The object to be merged into this object.
  22671. */
  22672. merge(source: PolygonGraphics): void;
  22673. }
  22674. /**
  22675. * A {@link MaterialProperty} that maps to PolylineArrow {@link Material} uniforms.
  22676. * @param [color = Color.WHITE] - The {@link Color} Property to be used.
  22677. */
  22678. export class PolylineArrowMaterialProperty {
  22679. constructor(color?: Property | Color);
  22680. /**
  22681. * Gets a value indicating if this property is constant. A property is considered
  22682. * constant if getValue always returns the same result for the current definition.
  22683. */
  22684. readonly isConstant: boolean;
  22685. /**
  22686. * Gets the event that is raised whenever the definition of this property changes.
  22687. * The definition is considered to have changed if a call to getValue would return
  22688. * a different result for the same time.
  22689. */
  22690. readonly definitionChanged: Event;
  22691. /**
  22692. * Gets or sets the {@link Color} {@link Property}.
  22693. */
  22694. color: Property | undefined;
  22695. /**
  22696. * Gets the {@link Material} type at the provided time.
  22697. * @param time - The time for which to retrieve the type.
  22698. * @returns The type of material.
  22699. */
  22700. getType(time: JulianDate): string;
  22701. /**
  22702. * Gets the value of the property at the provided time.
  22703. * @param time - The time for which to retrieve the value.
  22704. * @param [result] - The object to store the value into, if omitted, a new instance is created and returned.
  22705. * @returns The modified result parameter or a new instance if the result parameter was not supplied.
  22706. */
  22707. getValue(time: JulianDate, result?: any): any;
  22708. /**
  22709. * Compares this property to the provided property and returns
  22710. * <code>true</code> if they are equal, <code>false</code> otherwise.
  22711. * @param [other] - The other property.
  22712. * @returns <code>true</code> if left and right are equal, <code>false</code> otherwise.
  22713. */
  22714. equals(other?: Property): boolean;
  22715. }
  22716. /**
  22717. * A {@link MaterialProperty} that maps to polyline dash {@link Material} uniforms.
  22718. * @param [options] - Object with the following properties:
  22719. * @param [options.color = Color.WHITE] - A Property specifying the {@link Color} of the line.
  22720. * @param [options.gapColor = Color.TRANSPARENT] - A Property specifying the {@link Color} of the gaps in the line.
  22721. * @param [options.dashLength = 16.0] - A numeric Property specifying the length of the dash pattern in pixels.
  22722. * @param [options.dashPattern = 255.0] - A numeric Property specifying a 16 bit pattern for the dash
  22723. */
  22724. export class PolylineDashMaterialProperty {
  22725. constructor(options?: {
  22726. color?: Property | Color;
  22727. gapColor?: Property | Color;
  22728. dashLength?: Property | number;
  22729. dashPattern?: Property | number;
  22730. });
  22731. /**
  22732. * Gets a value indicating if this property is constant. A property is considered
  22733. * constant if getValue always returns the same result for the current definition.
  22734. */
  22735. readonly isConstant: boolean;
  22736. /**
  22737. * Gets the event that is raised whenever the definition of this property changes.
  22738. * The definition is considered to have changed if a call to getValue would return
  22739. * a different result for the same time.
  22740. */
  22741. readonly definitionChanged: Event;
  22742. /**
  22743. * Gets or sets the Property specifying the {@link Color} of the line.
  22744. */
  22745. color: Property | undefined;
  22746. /**
  22747. * Gets or sets the Property specifying the {@link Color} of the gaps in the line.
  22748. */
  22749. gapColor: Property | undefined;
  22750. /**
  22751. * Gets or sets the numeric Property specifying the length of a dash cycle
  22752. */
  22753. dashLength: Property | undefined;
  22754. /**
  22755. * Gets or sets the numeric Property specifying a dash pattern
  22756. */
  22757. dashPattern: Property | undefined;
  22758. /**
  22759. * Gets the {@link Material} type at the provided time.
  22760. * @param time - The time for which to retrieve the type.
  22761. * @returns The type of material.
  22762. */
  22763. getType(time: JulianDate): string;
  22764. /**
  22765. * Gets the value of the property at the provided time.
  22766. * @param time - The time for which to retrieve the value.
  22767. * @param [result] - The object to store the value into, if omitted, a new instance is created and returned.
  22768. * @returns The modified result parameter or a new instance if the result parameter was not supplied.
  22769. */
  22770. getValue(time: JulianDate, result?: any): any;
  22771. /**
  22772. * Compares this property to the provided property and returns
  22773. * <code>true</code> if they are equal, <code>false</code> otherwise.
  22774. * @param [other] - The other property.
  22775. * @returns <code>true</code> if left and right are equal, <code>false</code> otherwise.
  22776. */
  22777. equals(other?: Property): boolean;
  22778. }
  22779. /**
  22780. * A {@link GeometryUpdater} for polylines.
  22781. * Clients do not normally create this class directly, but instead rely on {@link DataSourceDisplay}.
  22782. * @param entity - The entity containing the geometry to be visualized.
  22783. * @param scene - The scene where visualization is taking place.
  22784. */
  22785. export class PolylineGeometryUpdater {
  22786. constructor(entity: Entity, scene: Scene);
  22787. /**
  22788. * Gets the unique ID associated with this updater
  22789. */
  22790. readonly id: string;
  22791. /**
  22792. * Gets the entity associated with this geometry.
  22793. */
  22794. readonly entity: Entity;
  22795. /**
  22796. * Gets a value indicating if the geometry has a fill component.
  22797. */
  22798. readonly fillEnabled: boolean;
  22799. /**
  22800. * Gets a value indicating if fill visibility varies with simulation time.
  22801. */
  22802. readonly hasConstantFill: boolean;
  22803. /**
  22804. * Gets the material property used to fill the geometry.
  22805. */
  22806. readonly fillMaterialProperty: MaterialProperty;
  22807. /**
  22808. * Gets the material property used to fill the geometry when it fails the depth test.
  22809. */
  22810. readonly depthFailMaterialProperty: MaterialProperty;
  22811. /**
  22812. * Gets a value indicating if the geometry has an outline component.
  22813. */
  22814. readonly outlineEnabled: boolean;
  22815. /**
  22816. * Gets a value indicating if outline visibility varies with simulation time.
  22817. */
  22818. readonly hasConstantOutline: boolean;
  22819. /**
  22820. * Gets the {@link Color} property for the geometry outline.
  22821. */
  22822. readonly outlineColorProperty: Property;
  22823. /**
  22824. * Gets the property specifying whether the geometry
  22825. * casts or receives shadows from light sources.
  22826. */
  22827. readonly shadowsProperty: Property;
  22828. /**
  22829. * Gets or sets the {@link DistanceDisplayCondition} Property specifying at what distance from the camera that this geometry will be displayed.
  22830. */
  22831. readonly distanceDisplayConditionProperty: Property;
  22832. /**
  22833. * Gets or sets the {@link ClassificationType} Property specifying if this geometry will classify terrain, 3D Tiles, or both when on the ground.
  22834. */
  22835. readonly classificationTypeProperty: Property;
  22836. /**
  22837. * Gets a value indicating if the geometry is time-varying.
  22838. * If true, all visualization is delegated to the {@link DynamicGeometryUpdater}
  22839. * returned by GeometryUpdater#createDynamicUpdater.
  22840. */
  22841. readonly isDynamic: boolean;
  22842. /**
  22843. * Gets a value indicating if the geometry is closed.
  22844. * This property is only valid for static geometry.
  22845. */
  22846. readonly isClosed: boolean;
  22847. /**
  22848. * Gets an event that is raised whenever the public properties
  22849. * of this updater change.
  22850. */
  22851. readonly geometryChanged: boolean;
  22852. /**
  22853. * Gets a value indicating if the path of the line.
  22854. */
  22855. readonly arcType: ArcType;
  22856. /**
  22857. * Gets a value indicating if the geometry is clamped to the ground.
  22858. * Returns false if polylines on terrain is not supported.
  22859. */
  22860. readonly clampToGround: boolean;
  22861. /**
  22862. * Gets the zindex
  22863. */
  22864. readonly zIndex: number;
  22865. /**
  22866. * Checks if the geometry is outlined at the provided time.
  22867. * @param time - The time for which to retrieve visibility.
  22868. * @returns true if geometry is outlined at the provided time, false otherwise.
  22869. */
  22870. isOutlineVisible(time: JulianDate): boolean;
  22871. /**
  22872. * Checks if the geometry is filled at the provided time.
  22873. * @param time - The time for which to retrieve visibility.
  22874. * @returns true if geometry is filled at the provided time, false otherwise.
  22875. */
  22876. isFilled(time: JulianDate): boolean;
  22877. /**
  22878. * Creates the geometry instance which represents the fill of the geometry.
  22879. * @param time - The time to use when retrieving initial attribute values.
  22880. * @returns The geometry instance representing the filled portion of the geometry.
  22881. */
  22882. createFillGeometryInstance(time: JulianDate): GeometryInstance;
  22883. /**
  22884. * Creates the geometry instance which represents the outline of the geometry.
  22885. * @param time - The time to use when retrieving initial attribute values.
  22886. * @returns The geometry instance representing the outline portion of the geometry.
  22887. */
  22888. createOutlineGeometryInstance(time: JulianDate): GeometryInstance;
  22889. /**
  22890. * Returns true if this object was destroyed; otherwise, false.
  22891. * @returns True if this object was destroyed; otherwise, false.
  22892. */
  22893. isDestroyed(): boolean;
  22894. /**
  22895. * Destroys and resources used by the object. Once an object is destroyed, it should not be used.
  22896. */
  22897. destroy(): void;
  22898. }
  22899. /**
  22900. * A {@link MaterialProperty} that maps to polyline glow {@link Material} uniforms.
  22901. * @param [options] - Object with the following properties:
  22902. * @param [options.color = Color.WHITE] - A Property specifying the {@link Color} of the line.
  22903. * @param [options.glowPower = 0.25] - A numeric Property specifying the strength of the glow, as a percentage of the total line width.
  22904. * @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.
  22905. */
  22906. export class PolylineGlowMaterialProperty {
  22907. constructor(options?: {
  22908. color?: Property | Color;
  22909. glowPower?: Property | number;
  22910. taperPower?: Property | number;
  22911. });
  22912. /**
  22913. * Gets a value indicating if this property is constant. A property is considered
  22914. * constant if getValue always returns the same result for the current definition.
  22915. */
  22916. readonly isConstant: boolean;
  22917. /**
  22918. * Gets the event that is raised whenever the definition of this property changes.
  22919. * The definition is considered to have changed if a call to getValue would return
  22920. * a different result for the same time.
  22921. */
  22922. readonly definitionChanged: Event;
  22923. /**
  22924. * Gets or sets the Property specifying the {@link Color} of the line.
  22925. */
  22926. color: Property | undefined;
  22927. /**
  22928. * Gets or sets the numeric Property specifying the strength of the glow, as a percentage of the total line width (less than 1.0).
  22929. */
  22930. glowPower: Property | undefined;
  22931. /**
  22932. * 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.
  22933. */
  22934. taperPower: Property | undefined;
  22935. /**
  22936. * Gets the {@link Material} type at the provided time.
  22937. * @param time - The time for which to retrieve the type.
  22938. * @returns The type of material.
  22939. */
  22940. getType(time: JulianDate): string;
  22941. /**
  22942. * Gets the value of the property at the provided time.
  22943. * @param time - The time for which to retrieve the value.
  22944. * @param [result] - The object to store the value into, if omitted, a new instance is created and returned.
  22945. * @returns The modified result parameter or a new instance if the result parameter was not supplied.
  22946. */
  22947. getValue(time: JulianDate, result?: any): any;
  22948. /**
  22949. * Compares this property to the provided property and returns
  22950. * <code>true</code> if they are equal, <code>false</code> otherwise.
  22951. * @param [other] - The other property.
  22952. * @returns <code>true</code> if left and right are equal, <code>false</code> otherwise.
  22953. */
  22954. equals(other?: Property): boolean;
  22955. }
  22956. export namespace PolylineGraphics {
  22957. /**
  22958. * Initialization options for the PolylineGraphics constructor
  22959. * @property [show = true] - A boolean Property specifying the visibility of the polyline.
  22960. * @property [positions] - A Property specifying the array of {@link Cartesian3} positions that define the line strip.
  22961. * @property [width = 1.0] - A numeric Property specifying the width in pixels.
  22962. * @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.
  22963. * @property [material = Color.WHITE] - A Property specifying the material used to draw the polyline.
  22964. * @property [depthFailMaterial] - A property specifying the material used to draw the polyline when it is below the terrain.
  22965. * @property [arcType = ArcType.GEODESIC] - The type of line the polyline segments must follow.
  22966. * @property [clampToGround = false] - A boolean Property specifying whether the Polyline should be clamped to the ground.
  22967. * @property [shadows = ShadowMode.DISABLED] - An enum Property specifying whether the polyline casts or receives shadows from light sources.
  22968. * @property [distanceDisplayCondition] - A Property specifying at what distance from the camera that this polyline will be displayed.
  22969. * @property [classificationType = ClassificationType.BOTH] - An enum Property specifying whether this polyline will classify terrain, 3D Tiles, or both when on the ground.
  22970. * @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.
  22971. */
  22972. type ConstructorOptions = {
  22973. show?: Property | boolean;
  22974. positions?: Property | Cartesian3[];
  22975. width?: Property | number;
  22976. granularity?: Property | number;
  22977. material?: MaterialProperty | Color;
  22978. depthFailMaterial?: MaterialProperty | Color;
  22979. arcType?: Property | ArcType;
  22980. clampToGround?: Property | boolean;
  22981. shadows?: Property | ShadowMode;
  22982. distanceDisplayCondition?: Property | DistanceDisplayCondition;
  22983. classificationType?: Property | ClassificationType;
  22984. zIndex?: Property | number;
  22985. };
  22986. }
  22987. /**
  22988. * Describes a polyline. The first two positions define a line segment,
  22989. * and each additional position defines a line segment from the previous position. The segments
  22990. * can be linear connected points, great arcs, or clamped to terrain.
  22991. * @param [options] - Object describing initialization options
  22992. */
  22993. export class PolylineGraphics {
  22994. constructor(options?: PolylineGraphics.ConstructorOptions);
  22995. /**
  22996. * Gets the event that is raised whenever a property or sub-property is changed or modified.
  22997. */
  22998. readonly definitionChanged: Event;
  22999. /**
  23000. * Gets or sets the boolean Property specifying the visibility of the polyline.
  23001. */
  23002. show: Property | undefined;
  23003. /**
  23004. * Gets or sets the Property specifying the array of {@link Cartesian3}
  23005. * positions that define the line strip.
  23006. */
  23007. positions: Property | undefined;
  23008. /**
  23009. * Gets or sets the numeric Property specifying the width in pixels.
  23010. */
  23011. width: Property | undefined;
  23012. /**
  23013. * 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.
  23014. */
  23015. granularity: Property | undefined;
  23016. /**
  23017. * Gets or sets the Property specifying the material used to draw the polyline.
  23018. */
  23019. material: MaterialProperty;
  23020. /**
  23021. * Gets or sets the Property specifying the material used to draw the polyline when it fails the depth test.
  23022. * <p>
  23023. * Requires the EXT_frag_depth WebGL extension to render properly. If the extension is not supported,
  23024. * there may be artifacts.
  23025. * </p>
  23026. */
  23027. depthFailMaterial: MaterialProperty;
  23028. /**
  23029. * Gets or sets the {@link ArcType} Property specifying whether the line segments should be great arcs, rhumb lines or linearly connected.
  23030. */
  23031. arcType: Property | undefined;
  23032. /**
  23033. * Gets or sets the boolean Property specifying whether the polyline
  23034. * should be clamped to the ground.
  23035. */
  23036. clampToGround: Property | undefined;
  23037. /**
  23038. * Get or sets the enum Property specifying whether the polyline
  23039. * casts or receives shadows from light sources.
  23040. */
  23041. shadows: Property | undefined;
  23042. /**
  23043. * Gets or sets the {@link DistanceDisplayCondition} Property specifying at what distance from the camera that this polyline will be displayed.
  23044. */
  23045. distanceDisplayCondition: Property | undefined;
  23046. /**
  23047. * Gets or sets the {@link ClassificationType} Property specifying whether this polyline will classify terrain, 3D Tiles, or both when on the ground.
  23048. */
  23049. classificationType: Property | undefined;
  23050. /**
  23051. * 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.
  23052. */
  23053. zIndex: ConstantProperty | undefined;
  23054. /**
  23055. * Duplicates this instance.
  23056. * @param [result] - The object onto which to store the result.
  23057. * @returns The modified result parameter or a new instance if one was not provided.
  23058. */
  23059. clone(result?: PolylineGraphics): PolylineGraphics;
  23060. /**
  23061. * Assigns each unassigned property on this object to the value
  23062. * of the same property on the provided source object.
  23063. * @param source - The object to be merged into this object.
  23064. */
  23065. merge(source: PolylineGraphics): void;
  23066. }
  23067. /**
  23068. * A {@link MaterialProperty} that maps to polyline outline {@link Material} uniforms.
  23069. * @param [options] - Object with the following properties:
  23070. * @param [options.color = Color.WHITE] - A Property specifying the {@link Color} of the line.
  23071. * @param [options.outlineColor = Color.BLACK] - A Property specifying the {@link Color} of the outline.
  23072. * @param [options.outlineWidth = 1.0] - A numeric Property specifying the width of the outline, in pixels.
  23073. */
  23074. export class PolylineOutlineMaterialProperty {
  23075. constructor(options?: {
  23076. color?: Property | Color;
  23077. outlineColor?: Property | Color;
  23078. outlineWidth?: Property | number;
  23079. });
  23080. /**
  23081. * Gets a value indicating if this property is constant. A property is considered
  23082. * constant if getValue always returns the same result for the current definition.
  23083. */
  23084. readonly isConstant: boolean;
  23085. /**
  23086. * Gets the event that is raised whenever the definition of this property changes.
  23087. * The definition is considered to have changed if a call to getValue would return
  23088. * a different result for the same time.
  23089. */
  23090. readonly definitionChanged: Event;
  23091. /**
  23092. * Gets or sets the Property specifying the {@link Color} of the line.
  23093. */
  23094. color: Property | undefined;
  23095. /**
  23096. * Gets or sets the Property specifying the {@link Color} of the outline.
  23097. */
  23098. outlineColor: Property | undefined;
  23099. /**
  23100. * Gets or sets the numeric Property specifying the width of the outline.
  23101. */
  23102. outlineWidth: Property | undefined;
  23103. /**
  23104. * Gets the {@link Material} type at the provided time.
  23105. * @param time - The time for which to retrieve the type.
  23106. * @returns The type of material.
  23107. */
  23108. getType(time: JulianDate): string;
  23109. /**
  23110. * Gets the value of the property at the provided time.
  23111. * @param time - The time for which to retrieve the value.
  23112. * @param [result] - The object to store the value into, if omitted, a new instance is created and returned.
  23113. * @returns The modified result parameter or a new instance if the result parameter was not supplied.
  23114. */
  23115. getValue(time: JulianDate, result?: any): any;
  23116. /**
  23117. * Compares this property to the provided property and returns
  23118. * <code>true</code> if they are equal, <code>false</code> otherwise.
  23119. * @param [other] - The other property.
  23120. * @returns <code>true</code> if left and right are equal, <code>false</code> otherwise.
  23121. */
  23122. equals(other?: Property): boolean;
  23123. }
  23124. /**
  23125. * A visualizer for polylines represented by {@link Primitive} instances.
  23126. * @param scene - The scene the primitives will be rendered in.
  23127. * @param entityCollection - The entityCollection to visualize.
  23128. * @param [primitives = scene.primitives] - A collection to add primitives related to the entities
  23129. * @param [groundPrimitives = scene.groundPrimitives] - A collection to add ground primitives related to the entities
  23130. */
  23131. export class PolylineVisualizer {
  23132. constructor(scene: Scene, entityCollection: EntityCollection, primitives?: PrimitiveCollection, groundPrimitives?: PrimitiveCollection);
  23133. /**
  23134. * Updates all of the primitives created by this visualizer to match their
  23135. * Entity counterpart at the given time.
  23136. * @param time - The time to update to.
  23137. * @returns True if the visualizer successfully updated to the provided time,
  23138. * false if the visualizer is waiting for asynchronous primitives to be created.
  23139. */
  23140. update(time: JulianDate): boolean;
  23141. /**
  23142. * Returns true if this object was destroyed; otherwise, false.
  23143. * @returns True if this object was destroyed; otherwise, false.
  23144. */
  23145. isDestroyed(): boolean;
  23146. /**
  23147. * Removes and destroys all primitives created by this instance.
  23148. */
  23149. destroy(): void;
  23150. }
  23151. /**
  23152. * A {@link GeometryUpdater} for polyline volumes.
  23153. * Clients do not normally create this class directly, but instead rely on {@link DataSourceDisplay}.
  23154. * @param entity - The entity containing the geometry to be visualized.
  23155. * @param scene - The scene where visualization is taking place.
  23156. */
  23157. export class PolylineVolumeGeometryUpdater {
  23158. constructor(entity: Entity, scene: Scene);
  23159. /**
  23160. * Creates the geometry instance which represents the fill of the geometry.
  23161. * @param time - The time to use when retrieving initial attribute values.
  23162. * @returns The geometry instance representing the filled portion of the geometry.
  23163. */
  23164. createFillGeometryInstance(time: JulianDate): GeometryInstance;
  23165. /**
  23166. * Creates the geometry instance which represents the outline of the geometry.
  23167. * @param time - The time to use when retrieving initial attribute values.
  23168. * @returns The geometry instance representing the outline portion of the geometry.
  23169. */
  23170. createOutlineGeometryInstance(time: JulianDate): GeometryInstance;
  23171. }
  23172. export namespace PolylineVolumeGraphics {
  23173. /**
  23174. * Initialization options for the PolylineVolumeGraphics constructor
  23175. * @property [show = true] - A boolean Property specifying the visibility of the volume.
  23176. * @property [positions] - A Property specifying the array of {@link Cartesian3} positions which define the line strip.
  23177. * @property [shape] - A Property specifying the array of {@link Cartesian2} positions which define the shape to be extruded.
  23178. * @property [cornerType = CornerType.ROUNDED] - A {@link CornerType} Property specifying the style of the corners.
  23179. * @property [granularity = Cesium.Math.RADIANS_PER_DEGREE] - A numeric Property specifying the angular distance between each latitude and longitude point.
  23180. * @property [fill = true] - A boolean Property specifying whether the volume is filled with the provided material.
  23181. * @property [material = Color.WHITE] - A Property specifying the material used to fill the volume.
  23182. * @property [outline = false] - A boolean Property specifying whether the volume is outlined.
  23183. * @property [outlineColor = Color.BLACK] - A Property specifying the {@link Color} of the outline.
  23184. * @property [outlineWidth = 1.0] - A numeric Property specifying the width of the outline.
  23185. * @property [shadows = ShadowMode.DISABLED] - An enum Property specifying whether the volume casts or receives shadows from light sources.
  23186. * @property [distanceDisplayCondition] - A Property specifying at what distance from the camera that this volume will be displayed.
  23187. */
  23188. type ConstructorOptions = {
  23189. show?: Property | boolean;
  23190. positions?: Property | Cartesian3[];
  23191. shape?: Property | Cartesian2[];
  23192. cornerType?: Property | CornerType;
  23193. granularity?: Property | number;
  23194. fill?: Property | boolean;
  23195. material?: MaterialProperty | Color;
  23196. outline?: Property | boolean;
  23197. outlineColor?: Property | Color;
  23198. outlineWidth?: Property | number;
  23199. shadows?: Property | ShadowMode;
  23200. distanceDisplayCondition?: Property | DistanceDisplayCondition;
  23201. };
  23202. }
  23203. /**
  23204. * Describes a polyline volume defined as a line strip and corresponding two dimensional shape which is extruded along it.
  23205. * The resulting volume conforms to the curvature of the globe.
  23206. * @param [options] - Object describing initialization options
  23207. */
  23208. export class PolylineVolumeGraphics {
  23209. constructor(options?: PolylineVolumeGraphics.ConstructorOptions);
  23210. /**
  23211. * Gets the event that is raised whenever a property or sub-property is changed or modified.
  23212. */
  23213. readonly definitionChanged: Event;
  23214. /**
  23215. * Gets or sets the boolean Property specifying the visibility of the volume.
  23216. */
  23217. show: Property | undefined;
  23218. /**
  23219. * Gets or sets the Property specifying the array of {@link Cartesian3} positions which define the line strip.
  23220. */
  23221. positions: Property | undefined;
  23222. /**
  23223. * Gets or sets the Property specifying the array of {@link Cartesian2} positions which define the shape to be extruded.
  23224. */
  23225. shape: Property | undefined;
  23226. /**
  23227. * Gets or sets the {@link CornerType} Property specifying the style of the corners.
  23228. */
  23229. cornerType: Property | undefined;
  23230. /**
  23231. * Gets or sets the numeric Property specifying the angular distance between points on the volume.
  23232. */
  23233. granularity: Property | undefined;
  23234. /**
  23235. * Gets or sets the boolean Property specifying whether the volume is filled with the provided material.
  23236. */
  23237. fill: Property | undefined;
  23238. /**
  23239. * Gets or sets the Property specifying the material used to fill the volume.
  23240. */
  23241. material: MaterialProperty;
  23242. /**
  23243. * Gets or sets the Property specifying whether the volume is outlined.
  23244. */
  23245. outline: Property | undefined;
  23246. /**
  23247. * Gets or sets the Property specifying the {@link Color} of the outline.
  23248. */
  23249. outlineColor: Property | undefined;
  23250. /**
  23251. * Gets or sets the numeric Property specifying the width of the outline.
  23252. * <p>
  23253. * Note: This property will be ignored on all major browsers on Windows platforms. For details, see (@link https://github.com/CesiumGS/cesium/issues/40}.
  23254. * </p>
  23255. */
  23256. outlineWidth: Property | undefined;
  23257. /**
  23258. * Get or sets the enum Property specifying whether the volume
  23259. * casts or receives shadows from light sources.
  23260. */
  23261. shadows: Property | undefined;
  23262. /**
  23263. * Gets or sets the {@link DistanceDisplayCondition} Property specifying at what distance from the camera that this volume will be displayed.
  23264. */
  23265. distanceDisplayCondition: Property | undefined;
  23266. /**
  23267. * Duplicates this instance.
  23268. * @param [result] - The object onto which to store the result.
  23269. * @returns The modified result parameter or a new instance if one was not provided.
  23270. */
  23271. clone(result?: PolylineVolumeGraphics): PolylineVolumeGraphics;
  23272. /**
  23273. * Assigns each unassigned property on this object to the value
  23274. * of the same property on the provided source object.
  23275. * @param source - The object to be merged into this object.
  23276. */
  23277. merge(source: PolylineVolumeGraphics): void;
  23278. }
  23279. /**
  23280. * The interface for all {@link Property} objects that define a world
  23281. * location as a {@link Cartesian3} with an associated {@link ReferenceFrame}.
  23282. * This type defines an interface and cannot be instantiated directly.
  23283. */
  23284. export class PositionProperty {
  23285. constructor();
  23286. /**
  23287. * Gets a value indicating if this property is constant. A property is considered
  23288. * constant if getValue always returns the same result for the current definition.
  23289. */
  23290. readonly isConstant: boolean;
  23291. /**
  23292. * Gets the event that is raised whenever the definition of this property changes.
  23293. * The definition is considered to have changed if a call to getValue would return
  23294. * a different result for the same time.
  23295. */
  23296. readonly definitionChanged: Event;
  23297. /**
  23298. * Gets the reference frame that the position is defined in.
  23299. */
  23300. referenceFrame: ReferenceFrame;
  23301. /**
  23302. * Gets the value of the property at the provided time in the fixed frame.
  23303. * @param time - The time for which to retrieve the value.
  23304. * @param [result] - The object to store the value into, if omitted, a new instance is created and returned.
  23305. * @returns The modified result parameter or a new instance if the result parameter was not supplied.
  23306. */
  23307. getValue(time: JulianDate, result?: Cartesian3): Cartesian3 | undefined;
  23308. /**
  23309. * Gets the value of the property at the provided time and in the provided reference frame.
  23310. * @param time - The time for which to retrieve the value.
  23311. * @param referenceFrame - The desired referenceFrame of the result.
  23312. * @param [result] - The object to store the value into, if omitted, a new instance is created and returned.
  23313. * @returns The modified result parameter or a new instance if the result parameter was not supplied.
  23314. */
  23315. getValueInReferenceFrame(time: JulianDate, referenceFrame: ReferenceFrame, result?: Cartesian3): Cartesian3 | undefined;
  23316. /**
  23317. * Compares this property to the provided property and returns
  23318. * <code>true</code> if they are equal, <code>false</code> otherwise.
  23319. * @param [other] - The other property.
  23320. * @returns <code>true</code> if left and right are equal, <code>false</code> otherwise.
  23321. */
  23322. equals(other?: Property): boolean;
  23323. }
  23324. /**
  23325. * A {@link Property} whose value is an array whose items are the computed value
  23326. * of other PositionProperty instances.
  23327. * @param [value] - An array of Property instances.
  23328. * @param [referenceFrame = ReferenceFrame.FIXED] - The reference frame in which the position is defined.
  23329. */
  23330. export class PositionPropertyArray {
  23331. constructor(value?: Property[], referenceFrame?: ReferenceFrame);
  23332. /**
  23333. * Gets a value indicating if this property is constant. This property
  23334. * is considered constant if all property items in the array are constant.
  23335. */
  23336. readonly isConstant: boolean;
  23337. /**
  23338. * Gets the event that is raised whenever the definition of this property changes.
  23339. * The definition is changed whenever setValue is called with data different
  23340. * than the current value or one of the properties in the array also changes.
  23341. */
  23342. readonly definitionChanged: Event;
  23343. /**
  23344. * Gets the reference frame in which the position is defined.
  23345. */
  23346. referenceFrame: ReferenceFrame;
  23347. /**
  23348. * Gets the value of the property.
  23349. * @param time - The time for which to retrieve the value.
  23350. * @param [result] - The object to store the value into, if omitted, a new instance is created and returned.
  23351. * @returns The modified result parameter or a new instance if the result parameter was not supplied.
  23352. */
  23353. getValue(time: JulianDate, result?: Cartesian3[]): Cartesian3[];
  23354. /**
  23355. * Gets the value of the property at the provided time and in the provided reference frame.
  23356. * @param time - The time for which to retrieve the value.
  23357. * @param referenceFrame - The desired referenceFrame of the result.
  23358. * @param [result] - The object to store the value into, if omitted, a new instance is created and returned.
  23359. * @returns The modified result parameter or a new instance if the result parameter was not supplied.
  23360. */
  23361. getValueInReferenceFrame(time: JulianDate, referenceFrame: ReferenceFrame, result?: Cartesian3[]): Cartesian3[];
  23362. /**
  23363. * Sets the value of the property.
  23364. * @param value - An array of Property instances.
  23365. */
  23366. setValue(value: Property[]): void;
  23367. /**
  23368. * Compares this property to the provided property and returns
  23369. * <code>true</code> if they are equal, <code>false</code> otherwise.
  23370. * @param [other] - The other property.
  23371. * @returns <code>true</code> if left and right are equal, <code>false</code> otherwise.
  23372. */
  23373. equals(other?: Property): boolean;
  23374. }
  23375. /**
  23376. * The interface for all properties, which represent a value that can optionally vary over time.
  23377. * This type defines an interface and cannot be instantiated directly.
  23378. */
  23379. export class Property {
  23380. constructor();
  23381. /**
  23382. * Gets a value indicating if this property is constant. A property is considered
  23383. * constant if getValue always returns the same result for the current definition.
  23384. */
  23385. readonly isConstant: boolean;
  23386. /**
  23387. * Gets the event that is raised whenever the definition of this property changes.
  23388. * The definition is considered to have changed if a call to getValue would return
  23389. * a different result for the same time.
  23390. */
  23391. readonly definitionChanged: Event;
  23392. /**
  23393. * Gets the value of the property at the provided time.
  23394. * @param time - The time for which to retrieve the value.
  23395. * @param [result] - The object to store the value into, if omitted, a new instance is created and returned.
  23396. * @returns The modified result parameter or a new instance if the result parameter was not supplied.
  23397. */
  23398. getValue(time: JulianDate, result?: any): any;
  23399. /**
  23400. * Compares this property to the provided property and returns
  23401. * <code>true</code> if they are equal, <code>false</code> otherwise.
  23402. * @param [other] - The other property.
  23403. * @returns <code>true</code> if left and right are equal, <code>false</code> otherwise.
  23404. */
  23405. equals(other?: Property): boolean;
  23406. }
  23407. /**
  23408. * A {@link Property} whose value is an array whose items are the computed value
  23409. * of other property instances.
  23410. * @param [value] - An array of Property instances.
  23411. */
  23412. export class PropertyArray {
  23413. constructor(value?: Property[]);
  23414. /**
  23415. * Gets a value indicating if this property is constant. This property
  23416. * is considered constant if all property items in the array are constant.
  23417. */
  23418. readonly isConstant: boolean;
  23419. /**
  23420. * Gets the event that is raised whenever the definition of this property changes.
  23421. * The definition is changed whenever setValue is called with data different
  23422. * than the current value or one of the properties in the array also changes.
  23423. */
  23424. readonly definitionChanged: Event;
  23425. /**
  23426. * Gets the value of the property.
  23427. * @param time - The time for which to retrieve the value.
  23428. * @param [result] - The object to store the value into, if omitted, a new instance is created and returned.
  23429. * @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.
  23430. */
  23431. getValue(time: JulianDate, result?: object[]): object[];
  23432. /**
  23433. * Sets the value of the property.
  23434. * @param value - An array of Property instances.
  23435. */
  23436. setValue(value: Property[]): void;
  23437. /**
  23438. * Compares this property to the provided property and returns
  23439. * <code>true</code> if they are equal, <code>false</code> otherwise.
  23440. * @param [other] - The other property.
  23441. * @returns <code>true</code> if left and right are equal, <code>false</code> otherwise.
  23442. */
  23443. equals(other?: Property): boolean;
  23444. }
  23445. export interface PropertyBag extends Record<string, any> {
  23446. }
  23447. /**
  23448. * A {@link Property} whose value is a key-value mapping of property names to the computed value of other properties.
  23449. * @param [value] - An object, containing key-value mapping of property names to properties.
  23450. * @param [createPropertyCallback] - A function that will be called when the value of any of the properties in value are not a Property.
  23451. */
  23452. export class PropertyBag implements Record<string, any> {
  23453. constructor(value?: any, createPropertyCallback?: (...params: any[]) => any);
  23454. /**
  23455. * Gets the names of all properties registered on this instance.
  23456. */
  23457. propertyNames: any[];
  23458. /**
  23459. * Gets a value indicating if this property is constant. This property
  23460. * is considered constant if all property items in this object are constant.
  23461. */
  23462. readonly isConstant: boolean;
  23463. /**
  23464. * Gets the event that is raised whenever the set of properties contained in this
  23465. * object changes, or one of the properties itself changes.
  23466. */
  23467. readonly definitionChanged: Event;
  23468. /**
  23469. * Determines if this object has defined a property with the given name.
  23470. * @param propertyName - The name of the property to check for.
  23471. * @returns True if this object has defined a property with the given name, false otherwise.
  23472. */
  23473. hasProperty(propertyName: string): boolean;
  23474. /**
  23475. * Adds a property to this object.
  23476. * @param propertyName - The name of the property to add.
  23477. * @param [value] - The value of the new property, if provided.
  23478. * @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.
  23479. */
  23480. addProperty(propertyName: string, value?: any, createPropertyCallback?: (...params: any[]) => any): void;
  23481. /**
  23482. * Removed a property previously added with addProperty.
  23483. * @param propertyName - The name of the property to remove.
  23484. */
  23485. removeProperty(propertyName: string): void;
  23486. /**
  23487. * Gets the value of this property. Each contained property will be evaluated at the given time, and the overall
  23488. * result will be an object, mapping property names to those values.
  23489. * @param time - The time for which to retrieve the value.
  23490. * @param [result] - The object to store the value into, if omitted, a new instance is created and returned.
  23491. * Note that any properties in result which are not part of this PropertyBag will be left as-is.
  23492. * @returns The modified result parameter or a new instance if the result parameter was not supplied.
  23493. */
  23494. getValue(time: JulianDate, result?: any): any;
  23495. /**
  23496. * Assigns each unassigned property on this object to the value
  23497. * of the same property on the provided source object.
  23498. * @param source - The object to be merged into this object.
  23499. * @param [createPropertyCallback] - A function that will be called when the value of any of the properties in value are not a Property.
  23500. */
  23501. merge(source: any, createPropertyCallback?: (...params: any[]) => any): void;
  23502. /**
  23503. * Compares this property to the provided property and returns
  23504. * <code>true</code> if they are equal, <code>false</code> otherwise.
  23505. * @param [other] - The other property.
  23506. * @returns <code>true</code> if left and right are equal, <code>false</code> otherwise.
  23507. */
  23508. equals(other?: Property): boolean;
  23509. }
  23510. /**
  23511. * A {@link GeometryUpdater} for rectangles.
  23512. * Clients do not normally create this class directly, but instead rely on {@link DataSourceDisplay}.
  23513. * @param entity - The entity containing the geometry to be visualized.
  23514. * @param scene - The scene where visualization is taking place.
  23515. */
  23516. export class RectangleGeometryUpdater {
  23517. constructor(entity: Entity, scene: Scene);
  23518. /**
  23519. * Creates the geometry instance which represents the fill of the geometry.
  23520. * @param time - The time to use when retrieving initial attribute values.
  23521. * @returns The geometry instance representing the filled portion of the geometry.
  23522. */
  23523. createFillGeometryInstance(time: JulianDate): GeometryInstance;
  23524. /**
  23525. * Creates the geometry instance which represents the outline of the geometry.
  23526. * @param time - The time to use when retrieving initial attribute values.
  23527. * @returns The geometry instance representing the outline portion of the geometry.
  23528. */
  23529. createOutlineGeometryInstance(time: JulianDate): GeometryInstance;
  23530. }
  23531. export namespace RectangleGraphics {
  23532. /**
  23533. * Initialization options for the RectangleGraphics constructor
  23534. * @property [show = true] - A boolean Property specifying the visibility of the rectangle.
  23535. * @property [coordinates] - The Property specifying the {@link Rectangle}.
  23536. * @property [height = 0] - A numeric Property specifying the altitude of the rectangle relative to the ellipsoid surface.
  23537. * @property [heightReference = HeightReference.NONE] - A Property specifying what the height is relative to.
  23538. * @property [extrudedHeight] - A numeric Property specifying the altitude of the rectangle's extruded face relative to the ellipsoid surface.
  23539. * @property [extrudedHeightReference = HeightReference.NONE] - A Property specifying what the extrudedHeight is relative to.
  23540. * @property [rotation = 0.0] - A numeric property specifying the rotation of the rectangle clockwise from north.
  23541. * @property [stRotation = 0.0] - A numeric property specifying the rotation of the rectangle texture counter-clockwise from north.
  23542. * @property [granularity = Cesium.Math.RADIANS_PER_DEGREE] - A numeric Property specifying the angular distance between points on the rectangle.
  23543. * @property [fill = true] - A boolean Property specifying whether the rectangle is filled with the provided material.
  23544. * @property [material = Color.WHITE] - A Property specifying the material used to fill the rectangle.
  23545. * @property [outline = false] - A boolean Property specifying whether the rectangle is outlined.
  23546. * @property [outlineColor = Color.BLACK] - A Property specifying the {@link Color} of the outline.
  23547. * @property [outlineWidth = 1.0] - A numeric Property specifying the width of the outline.
  23548. * @property [shadows = ShadowMode.DISABLED] - An enum Property specifying whether the rectangle casts or receives shadows from light sources.
  23549. * @property [distanceDisplayCondition] - A Property specifying at what distance from the camera that this rectangle will be displayed.
  23550. * @property [classificationType = ClassificationType.BOTH] - An enum Property specifying whether this rectangle will classify terrain, 3D Tiles, or both when on the ground.
  23551. * @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.
  23552. */
  23553. type ConstructorOptions = {
  23554. show?: Property | boolean;
  23555. coordinates?: Property | Rectangle;
  23556. height?: Property | number;
  23557. heightReference?: Property | HeightReference;
  23558. extrudedHeight?: Property | number;
  23559. extrudedHeightReference?: Property | HeightReference;
  23560. rotation?: Property | number;
  23561. stRotation?: Property | number;
  23562. granularity?: Property | number;
  23563. fill?: Property | boolean;
  23564. material?: MaterialProperty | Color;
  23565. outline?: Property | boolean;
  23566. outlineColor?: Property | Color;
  23567. outlineWidth?: Property | number;
  23568. shadows?: Property | ShadowMode;
  23569. distanceDisplayCondition?: Property | DistanceDisplayCondition;
  23570. classificationType?: Property | ClassificationType;
  23571. zIndex?: Property | number;
  23572. };
  23573. }
  23574. /**
  23575. * Describes graphics for a {@link Rectangle}.
  23576. * The rectangle conforms to the curvature of the globe and can be placed on the surface or
  23577. * at altitude and can optionally be extruded into a volume.
  23578. * @param [options] - Object describing initialization options
  23579. */
  23580. export class RectangleGraphics {
  23581. constructor(options?: RectangleGraphics.ConstructorOptions);
  23582. /**
  23583. * Gets the event that is raised whenever a property or sub-property is changed or modified.
  23584. */
  23585. readonly definitionChanged: Event;
  23586. /**
  23587. * Gets or sets the boolean Property specifying the visibility of the rectangle.
  23588. */
  23589. show: Property | undefined;
  23590. /**
  23591. * Gets or sets the Property specifying the {@link Rectangle}.
  23592. */
  23593. coordinates: Property | undefined;
  23594. /**
  23595. * Gets or sets the numeric Property specifying the altitude of the rectangle.
  23596. */
  23597. height: Property | undefined;
  23598. /**
  23599. * Gets or sets the Property specifying the {@link HeightReference}.
  23600. */
  23601. heightReference: Property | undefined;
  23602. /**
  23603. * Gets or sets the numeric Property specifying the altitude of the rectangle extrusion.
  23604. * Setting this property creates volume starting at height and ending at this altitude.
  23605. */
  23606. extrudedHeight: Property | undefined;
  23607. /**
  23608. * Gets or sets the Property specifying the extruded {@link HeightReference}.
  23609. */
  23610. extrudedHeightReference: Property | undefined;
  23611. /**
  23612. * Gets or sets the numeric property specifying the rotation of the rectangle clockwise from north.
  23613. */
  23614. rotation: Property | undefined;
  23615. /**
  23616. * Gets or sets the numeric property specifying the rotation of the rectangle texture counter-clockwise from north.
  23617. */
  23618. stRotation: Property | undefined;
  23619. /**
  23620. * Gets or sets the numeric Property specifying the angular distance between points on the rectangle.
  23621. */
  23622. granularity: Property | undefined;
  23623. /**
  23624. * Gets or sets the boolean Property specifying whether the rectangle is filled with the provided material.
  23625. */
  23626. fill: Property | undefined;
  23627. /**
  23628. * Gets or sets the Property specifying the material used to fill the rectangle.
  23629. */
  23630. material: MaterialProperty;
  23631. /**
  23632. * Gets or sets the Property specifying whether the rectangle is outlined.
  23633. */
  23634. outline: Property | undefined;
  23635. /**
  23636. * Gets or sets the Property specifying the {@link Color} of the outline.
  23637. */
  23638. outlineColor: Property | undefined;
  23639. /**
  23640. * Gets or sets the numeric Property specifying the width of the outline.
  23641. * <p>
  23642. * Note: This property will be ignored on all major browsers on Windows platforms. For details, see (@link https://github.com/CesiumGS/cesium/issues/40}.
  23643. * </p>
  23644. */
  23645. outlineWidth: Property | undefined;
  23646. /**
  23647. * Get or sets the enum Property specifying whether the rectangle
  23648. * casts or receives shadows from light sources.
  23649. */
  23650. shadows: Property | undefined;
  23651. /**
  23652. * Gets or sets the {@link DistanceDisplayCondition} Property specifying at what distance from the camera that this rectangle will be displayed.
  23653. */
  23654. distanceDisplayCondition: Property | undefined;
  23655. /**
  23656. * Gets or sets the {@link ClassificationType} Property specifying whether this rectangle will classify terrain, 3D Tiles, or both when on the ground.
  23657. */
  23658. classificationType: Property | undefined;
  23659. /**
  23660. * 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.
  23661. */
  23662. zIndex: ConstantProperty | undefined;
  23663. /**
  23664. * Duplicates this instance.
  23665. * @param [result] - The object onto which to store the result.
  23666. * @returns The modified result parameter or a new instance if one was not provided.
  23667. */
  23668. clone(result?: RectangleGraphics): RectangleGraphics;
  23669. /**
  23670. * Assigns each unassigned property on this object to the value
  23671. * of the same property on the provided source object.
  23672. * @param source - The object to be merged into this object.
  23673. */
  23674. merge(source: RectangleGraphics): void;
  23675. }
  23676. /**
  23677. * A {@link Property} which transparently links to another property on a provided object.
  23678. * @example
  23679. * const collection = new Cesium.EntityCollection();
  23680. *
  23681. * //Create a new entity and assign a billboard scale.
  23682. * const object1 = new Cesium.Entity({id:'object1'});
  23683. * object1.billboard = new Cesium.BillboardGraphics();
  23684. * object1.billboard.scale = new Cesium.ConstantProperty(2.0);
  23685. * collection.add(object1);
  23686. *
  23687. * //Create a second entity and reference the scale from the first one.
  23688. * const object2 = new Cesium.Entity({id:'object2'});
  23689. * object2.model = new Cesium.ModelGraphics();
  23690. * object2.model.scale = new Cesium.ReferenceProperty(collection, 'object1', ['billboard', 'scale']);
  23691. * collection.add(object2);
  23692. *
  23693. * //Create a third object, but use the fromString helper function.
  23694. * const object3 = new Cesium.Entity({id:'object3'});
  23695. * object3.billboard = new Cesium.BillboardGraphics();
  23696. * object3.billboard.scale = Cesium.ReferenceProperty.fromString(collection, 'object1#billboard.scale');
  23697. * collection.add(object3);
  23698. *
  23699. * //You can refer to an entity with a # or . in id and property names by escaping them.
  23700. * const object4 = new Cesium.Entity({id:'#object.4'});
  23701. * object4.billboard = new Cesium.BillboardGraphics();
  23702. * object4.billboard.scale = new Cesium.ConstantProperty(2.0);
  23703. * collection.add(object4);
  23704. *
  23705. * const object5 = new Cesium.Entity({id:'object5'});
  23706. * object5.billboard = new Cesium.BillboardGraphics();
  23707. * object5.billboard.scale = Cesium.ReferenceProperty.fromString(collection, '\\#object\\.4#billboard.scale');
  23708. * collection.add(object5);
  23709. * @param targetCollection - The entity collection which will be used to resolve the reference.
  23710. * @param targetId - The id of the entity which is being referenced.
  23711. * @param targetPropertyNames - The names of the property on the target entity which we will use.
  23712. */
  23713. export class ReferenceProperty {
  23714. constructor(targetCollection: EntityCollection, targetId: string, targetPropertyNames: string[]);
  23715. /**
  23716. * Gets a value indicating if this property is constant.
  23717. */
  23718. readonly isConstant: boolean;
  23719. /**
  23720. * Gets the event that is raised whenever the definition of this property changes.
  23721. * The definition is changed whenever the referenced property's definition is changed.
  23722. */
  23723. readonly definitionChanged: Event;
  23724. /**
  23725. * Gets the reference frame that the position is defined in.
  23726. * This property is only valid if the referenced property is a {@link PositionProperty}.
  23727. */
  23728. readonly referenceFrame: ReferenceFrame;
  23729. /**
  23730. * Gets the id of the entity being referenced.
  23731. */
  23732. readonly targetId: string;
  23733. /**
  23734. * Gets the collection containing the entity being referenced.
  23735. */
  23736. readonly targetCollection: EntityCollection;
  23737. /**
  23738. * Gets the array of property names used to retrieve the referenced property.
  23739. */
  23740. readonly targetPropertyNames: string[];
  23741. /**
  23742. * Gets the resolved instance of the underlying referenced property.
  23743. */
  23744. readonly resolvedProperty: Property | undefined;
  23745. /**
  23746. * Creates a new instance given the entity collection that will
  23747. * be used to resolve it and a string indicating the target entity id and property.
  23748. * The format of the string is "objectId#foo.bar", where # separates the id from
  23749. * property path and . separates sub-properties. If the reference identifier or
  23750. * or any sub-properties contains a # . or \ they must be escaped.
  23751. * @returns A new instance of ReferenceProperty.
  23752. */
  23753. static fromString(targetCollection: EntityCollection, referenceString: string): ReferenceProperty;
  23754. /**
  23755. * Gets the value of the property at the provided time.
  23756. * @param time - The time for which to retrieve the value.
  23757. * @param [result] - The object to store the value into, if omitted, a new instance is created and returned.
  23758. * @returns The modified result parameter or a new instance if the result parameter was not supplied.
  23759. */
  23760. getValue(time: JulianDate, result?: any): any;
  23761. /**
  23762. * Gets the value of the property at the provided time and in the provided reference frame.
  23763. * This method is only valid if the property being referenced is a {@link PositionProperty}.
  23764. * @param time - The time for which to retrieve the value.
  23765. * @param referenceFrame - The desired referenceFrame of the result.
  23766. * @param [result] - The object to store the value into, if omitted, a new instance is created and returned.
  23767. * @returns The modified result parameter or a new instance if the result parameter was not supplied.
  23768. */
  23769. getValueInReferenceFrame(time: JulianDate, referenceFrame: ReferenceFrame, result?: Cartesian3): Cartesian3;
  23770. /**
  23771. * Gets the {@link Material} type at the provided time.
  23772. * This method is only valid if the property being referenced is a {@link MaterialProperty}.
  23773. * @param time - The time for which to retrieve the type.
  23774. * @returns The type of material.
  23775. */
  23776. getType(time: JulianDate): string;
  23777. /**
  23778. * Compares this property to the provided property and returns
  23779. * <code>true</code> if they are equal, <code>false</code> otherwise.
  23780. * @param [other] - The other property.
  23781. * @returns <code>true</code> if left and right are equal, <code>false</code> otherwise.
  23782. */
  23783. equals(other?: Property): boolean;
  23784. }
  23785. export namespace Rotation {
  23786. /**
  23787. * The number of elements used to pack the object into an array.
  23788. */
  23789. var packedLength: number;
  23790. /**
  23791. * Stores the provided instance into the provided array.
  23792. * @param value - The value to pack.
  23793. * @param array - The array to pack into.
  23794. * @param [startingIndex = 0] - The index into the array at which to start packing the elements.
  23795. * @returns The array that was packed into
  23796. */
  23797. function pack(value: Rotation, array: number[], startingIndex?: number): number[];
  23798. /**
  23799. * Retrieves an instance from a packed array.
  23800. * @param array - The packed array.
  23801. * @param [startingIndex = 0] - The starting index of the element to be unpacked.
  23802. * @param [result] - The object into which to store the result.
  23803. * @returns The modified result parameter or a new Rotation instance if one was not provided.
  23804. */
  23805. function unpack(array: number[], startingIndex?: number, result?: Rotation): Rotation;
  23806. /**
  23807. * Converts a packed array into a form suitable for interpolation.
  23808. * @param packedArray - The packed array.
  23809. * @param [startingIndex = 0] - The index of the first element to be converted.
  23810. * @param [lastIndex = packedArray.length] - The index of the last element to be converted.
  23811. * @param [result] - The object into which to store the result.
  23812. */
  23813. function convertPackedArrayForInterpolation(packedArray: number[], startingIndex?: number, lastIndex?: number, result?: number[]): void;
  23814. /**
  23815. * Retrieves an instance from a packed array converted with {@link Rotation.convertPackedArrayForInterpolation}.
  23816. * @param array - The array previously packed for interpolation.
  23817. * @param sourceArray - The original packed array.
  23818. * @param [firstIndex = 0] - The firstIndex used to convert the array.
  23819. * @param [lastIndex = packedArray.length] - The lastIndex used to convert the array.
  23820. * @param [result] - The object into which to store the result.
  23821. * @returns The modified result parameter or a new Rotation instance if one was not provided.
  23822. */
  23823. function unpackInterpolationResult(array: number[], sourceArray: number[], firstIndex?: number, lastIndex?: number, result?: Rotation): Rotation;
  23824. }
  23825. /**
  23826. * Represents a {@link Packable} number that always interpolates values
  23827. * towards the shortest angle of rotation. This object is never used directly
  23828. * but is instead passed to the constructor of {@link SampledProperty}
  23829. * in order to represent a two-dimensional angle of rotation.
  23830. * @example
  23831. * const time1 = Cesium.JulianDate.fromIso8601('2010-05-07T00:00:00');
  23832. * const time2 = Cesium.JulianDate.fromIso8601('2010-05-07T00:01:00');
  23833. * const time3 = Cesium.JulianDate.fromIso8601('2010-05-07T00:02:00');
  23834. *
  23835. * const property = new Cesium.SampledProperty(Cesium.Rotation);
  23836. * property.addSample(time1, 0);
  23837. * property.addSample(time3, Cesium.Math.toRadians(350));
  23838. *
  23839. * //Getting the value at time2 will equal 355 degrees instead
  23840. * //of 175 degrees (which is what you get if you construct
  23841. * //a SampledProperty(Number) instead. Note, the actual
  23842. * //return value is in radians, not degrees.
  23843. * property.getValue(time2);
  23844. */
  23845. export interface Rotation {
  23846. }
  23847. /**
  23848. * A {@link SampledProperty} which is also a {@link PositionProperty}.
  23849. * @param [referenceFrame = ReferenceFrame.FIXED] - The reference frame in which the position is defined.
  23850. * @param [numberOfDerivatives = 0] - The number of derivatives that accompany each position; i.e. velocity, acceleration, etc...
  23851. */
  23852. export class SampledPositionProperty {
  23853. constructor(referenceFrame?: ReferenceFrame, numberOfDerivatives?: number);
  23854. /**
  23855. * Gets a value indicating if this property is constant. A property is considered
  23856. * constant if getValue always returns the same result for the current definition.
  23857. */
  23858. readonly isConstant: boolean;
  23859. /**
  23860. * Gets the event that is raised whenever the definition of this property changes.
  23861. * The definition is considered to have changed if a call to getValue would return
  23862. * a different result for the same time.
  23863. */
  23864. readonly definitionChanged: Event;
  23865. /**
  23866. * Gets the reference frame in which the position is defined.
  23867. */
  23868. referenceFrame: ReferenceFrame;
  23869. /**
  23870. * Gets the degree of interpolation to perform when retrieving a value. Call <code>setInterpolationOptions</code> to set this.
  23871. */
  23872. readonly interpolationDegree: number;
  23873. /**
  23874. * Gets the interpolation algorithm to use when retrieving a value. Call <code>setInterpolationOptions</code> to set this.
  23875. */
  23876. readonly interpolationAlgorithm: InterpolationAlgorithm;
  23877. /**
  23878. * The number of derivatives contained by this property; i.e. 0 for just position, 1 for velocity, etc.
  23879. */
  23880. numberOfDerivatives: number;
  23881. /**
  23882. * Gets or sets the type of extrapolation to perform when a value
  23883. * is requested at a time after any available samples.
  23884. */
  23885. forwardExtrapolationType: ExtrapolationType;
  23886. /**
  23887. * Gets or sets the amount of time to extrapolate forward before
  23888. * the property becomes undefined. A value of 0 will extrapolate forever.
  23889. */
  23890. forwardExtrapolationDuration: number;
  23891. /**
  23892. * Gets or sets the type of extrapolation to perform when a value
  23893. * is requested at a time before any available samples.
  23894. */
  23895. backwardExtrapolationType: ExtrapolationType;
  23896. /**
  23897. * Gets or sets the amount of time to extrapolate backward
  23898. * before the property becomes undefined. A value of 0 will extrapolate forever.
  23899. */
  23900. backwardExtrapolationDuration: number;
  23901. /**
  23902. * Gets the position at the provided time.
  23903. * @param time - The time for which to retrieve the value.
  23904. * @param [result] - The object to store the value into, if omitted, a new instance is created and returned.
  23905. * @returns The modified result parameter or a new instance if the result parameter was not supplied.
  23906. */
  23907. getValue(time: JulianDate, result?: Cartesian3): Cartesian3 | undefined;
  23908. /**
  23909. * Gets the position at the provided time and in the provided reference frame.
  23910. * @param time - The time for which to retrieve the value.
  23911. * @param referenceFrame - The desired referenceFrame of the result.
  23912. * @param [result] - The object to store the value into, if omitted, a new instance is created and returned.
  23913. * @returns The modified result parameter or a new instance if the result parameter was not supplied.
  23914. */
  23915. getValueInReferenceFrame(time: JulianDate, referenceFrame: ReferenceFrame, result?: Cartesian3): Cartesian3 | undefined;
  23916. /**
  23917. * Sets the algorithm and degree to use when interpolating a position.
  23918. * @param [options] - Object with the following properties:
  23919. * @param [options.interpolationAlgorithm] - The new interpolation algorithm. If undefined, the existing property will be unchanged.
  23920. * @param [options.interpolationDegree] - The new interpolation degree. If undefined, the existing property will be unchanged.
  23921. */
  23922. setInterpolationOptions(options?: {
  23923. interpolationAlgorithm?: InterpolationAlgorithm;
  23924. interpolationDegree?: number;
  23925. }): void;
  23926. /**
  23927. * Adds a new sample.
  23928. * @param time - The sample time.
  23929. * @param position - The position at the provided time.
  23930. * @param [derivatives] - The array of derivative values at the provided time.
  23931. */
  23932. addSample(time: JulianDate, position: Cartesian3, derivatives?: Cartesian3[]): void;
  23933. /**
  23934. * Adds multiple samples via parallel arrays.
  23935. * @param times - An array of JulianDate instances where each index is a sample time.
  23936. * @param positions - An array of Cartesian3 position instances, where each value corresponds to the provided time index.
  23937. * @param [derivatives] - An array where each value is another array containing derivatives for the corresponding time index.
  23938. */
  23939. addSamples(times: JulianDate[], positions: Cartesian3[], derivatives?: any[][]): void;
  23940. /**
  23941. * Adds samples as a single packed array where each new sample is represented as a date,
  23942. * followed by the packed representation of the corresponding value and derivatives.
  23943. * @param packedSamples - The array of packed samples.
  23944. * @param [epoch] - If any of the dates in packedSamples are numbers, they are considered an offset from this epoch, in seconds.
  23945. */
  23946. addSamplesPackedArray(packedSamples: number[], epoch?: JulianDate): void;
  23947. /**
  23948. * Removes a sample at the given time, if present.
  23949. * @param time - The sample time.
  23950. * @returns <code>true</code> if a sample at time was removed, <code>false</code> otherwise.
  23951. */
  23952. removeSample(time: JulianDate): boolean;
  23953. /**
  23954. * Removes all samples for the given time interval.
  23955. * @param time - The time interval for which to remove all samples.
  23956. */
  23957. removeSamples(time: TimeInterval): void;
  23958. /**
  23959. * Compares this property to the provided property and returns
  23960. * <code>true</code> if they are equal, <code>false</code> otherwise.
  23961. * @param [other] - The other property.
  23962. * @returns <code>true</code> if left and right are equal, <code>false</code> otherwise.
  23963. */
  23964. equals(other?: Property): boolean;
  23965. }
  23966. /**
  23967. * A {@link Property} whose value is interpolated for a given time from the
  23968. * provided set of samples and specified interpolation algorithm and degree.
  23969. * @example
  23970. * //Create a linearly interpolated Cartesian2
  23971. * const property = new Cesium.SampledProperty(Cesium.Cartesian2);
  23972. *
  23973. * //Populate it with data
  23974. * property.addSample(Cesium.JulianDate.fromIso8601('2012-08-01T00:00:00.00Z'), new Cesium.Cartesian2(0, 0));
  23975. * property.addSample(Cesium.JulianDate.fromIso8601('2012-08-02T00:00:00.00Z'), new Cesium.Cartesian2(4, 7));
  23976. *
  23977. * //Retrieve an interpolated value
  23978. * const result = property.getValue(Cesium.JulianDate.fromIso8601('2012-08-01T12:00:00.00Z'));
  23979. * @example
  23980. * //Create a simple numeric SampledProperty that uses third degree Hermite Polynomial Approximation
  23981. * const property = new Cesium.SampledProperty(Number);
  23982. * property.setInterpolationOptions({
  23983. * interpolationDegree : 3,
  23984. * interpolationAlgorithm : Cesium.HermitePolynomialApproximation
  23985. * });
  23986. *
  23987. * //Populate it with data
  23988. * property.addSample(Cesium.JulianDate.fromIso8601('2012-08-01T00:00:00.00Z'), 1.0);
  23989. * property.addSample(Cesium.JulianDate.fromIso8601('2012-08-01T00:01:00.00Z'), 6.0);
  23990. * property.addSample(Cesium.JulianDate.fromIso8601('2012-08-01T00:02:00.00Z'), 12.0);
  23991. * property.addSample(Cesium.JulianDate.fromIso8601('2012-08-01T00:03:30.00Z'), 5.0);
  23992. * property.addSample(Cesium.JulianDate.fromIso8601('2012-08-01T00:06:30.00Z'), 2.0);
  23993. *
  23994. * //Samples can be added in any order.
  23995. * property.addSample(Cesium.JulianDate.fromIso8601('2012-08-01T00:00:30.00Z'), 6.2);
  23996. *
  23997. * //Retrieve an interpolated value
  23998. * const result = property.getValue(Cesium.JulianDate.fromIso8601('2012-08-01T00:02:34.00Z'));
  23999. * @param type - The type of property.
  24000. * @param [derivativeTypes] - When supplied, indicates that samples will contain derivative information of the specified types.
  24001. */
  24002. export class SampledProperty {
  24003. constructor(type: number | Packable, derivativeTypes?: Packable[]);
  24004. /**
  24005. * Gets a value indicating if this property is constant. A property is considered
  24006. * constant if getValue always returns the same result for the current definition.
  24007. */
  24008. readonly isConstant: boolean;
  24009. /**
  24010. * Gets the event that is raised whenever the definition of this property changes.
  24011. * The definition is considered to have changed if a call to getValue would return
  24012. * a different result for the same time.
  24013. */
  24014. readonly definitionChanged: Event;
  24015. /**
  24016. * Gets the type of property.
  24017. */
  24018. type: any;
  24019. /**
  24020. * Gets the derivative types used by this property.
  24021. */
  24022. derivativeTypes: Packable[];
  24023. /**
  24024. * Gets the degree of interpolation to perform when retrieving a value.
  24025. */
  24026. interpolationDegree: number;
  24027. /**
  24028. * Gets the interpolation algorithm to use when retrieving a value.
  24029. */
  24030. interpolationAlgorithm: InterpolationAlgorithm;
  24031. /**
  24032. * Gets or sets the type of extrapolation to perform when a value
  24033. * is requested at a time after any available samples.
  24034. */
  24035. forwardExtrapolationType: ExtrapolationType;
  24036. /**
  24037. * Gets or sets the amount of time to extrapolate forward before
  24038. * the property becomes undefined. A value of 0 will extrapolate forever.
  24039. */
  24040. forwardExtrapolationDuration: number;
  24041. /**
  24042. * Gets or sets the type of extrapolation to perform when a value
  24043. * is requested at a time before any available samples.
  24044. */
  24045. backwardExtrapolationType: ExtrapolationType;
  24046. /**
  24047. * Gets or sets the amount of time to extrapolate backward
  24048. * before the property becomes undefined. A value of 0 will extrapolate forever.
  24049. */
  24050. backwardExtrapolationDuration: number;
  24051. /**
  24052. * Gets the value of the property at the provided time.
  24053. * @param time - The time for which to retrieve the value.
  24054. * @param [result] - The object to store the value into, if omitted, a new instance is created and returned.
  24055. * @returns The modified result parameter or a new instance if the result parameter was not supplied.
  24056. */
  24057. getValue(time: JulianDate, result?: any): any;
  24058. /**
  24059. * Sets the algorithm and degree to use when interpolating a value.
  24060. * @param [options] - Object with the following properties:
  24061. * @param [options.interpolationAlgorithm] - The new interpolation algorithm. If undefined, the existing property will be unchanged.
  24062. * @param [options.interpolationDegree] - The new interpolation degree. If undefined, the existing property will be unchanged.
  24063. */
  24064. setInterpolationOptions(options?: {
  24065. interpolationAlgorithm?: InterpolationAlgorithm;
  24066. interpolationDegree?: number;
  24067. }): void;
  24068. /**
  24069. * Adds a new sample.
  24070. * @param time - The sample time.
  24071. * @param value - The value at the provided time.
  24072. * @param [derivatives] - The array of derivatives at the provided time.
  24073. */
  24074. addSample(time: JulianDate, value: Packable, derivatives?: Packable[]): void;
  24075. /**
  24076. * Adds an array of samples.
  24077. * @param times - An array of JulianDate instances where each index is a sample time.
  24078. * @param values - The array of values, where each value corresponds to the provided times index.
  24079. * @param [derivativeValues] - An array where each item is the array of derivatives at the equivalent time index.
  24080. */
  24081. addSamples(times: JulianDate[], values: Packable[], derivativeValues?: any[][]): void;
  24082. /**
  24083. * Adds samples as a single packed array where each new sample is represented as a date,
  24084. * followed by the packed representation of the corresponding value and derivatives.
  24085. * @param packedSamples - The array of packed samples.
  24086. * @param [epoch] - If any of the dates in packedSamples are numbers, they are considered an offset from this epoch, in seconds.
  24087. */
  24088. addSamplesPackedArray(packedSamples: number[], epoch?: JulianDate): void;
  24089. /**
  24090. * Removes a sample at the given time, if present.
  24091. * @param time - The sample time.
  24092. * @returns <code>true</code> if a sample at time was removed, <code>false</code> otherwise.
  24093. */
  24094. removeSample(time: JulianDate): boolean;
  24095. /**
  24096. * Removes all samples for the given time interval.
  24097. * @param time - The time interval for which to remove all samples.
  24098. */
  24099. removeSamples(time: TimeInterval): void;
  24100. /**
  24101. * Compares this property to the provided property and returns
  24102. * <code>true</code> if they are equal, <code>false</code> otherwise.
  24103. * @param [other] - The other property.
  24104. * @returns <code>true</code> if left and right are equal, <code>false</code> otherwise.
  24105. */
  24106. equals(other?: Property): boolean;
  24107. }
  24108. /**
  24109. * A {@link MaterialProperty} that maps to stripe {@link Material} uniforms.
  24110. * @param [options] - Object with the following properties:
  24111. * @param [options.orientation = StripeOrientation.HORIZONTAL] - A Property specifying the {@link StripeOrientation}.
  24112. * @param [options.evenColor = Color.WHITE] - A Property specifying the first {@link Color}.
  24113. * @param [options.oddColor = Color.BLACK] - A Property specifying the second {@link Color}.
  24114. * @param [options.offset = 0] - A numeric Property specifying how far into the pattern to start the material.
  24115. * @param [options.repeat = 1] - A numeric Property specifying how many times the stripes repeat.
  24116. */
  24117. export class StripeMaterialProperty {
  24118. constructor(options?: {
  24119. orientation?: Property | StripeOrientation;
  24120. evenColor?: Property | Color;
  24121. oddColor?: Property | Color;
  24122. offset?: Property | number;
  24123. repeat?: Property | number;
  24124. });
  24125. /**
  24126. * Gets a value indicating if this property is constant. A property is considered
  24127. * constant if getValue always returns the same result for the current definition.
  24128. */
  24129. readonly isConstant: boolean;
  24130. /**
  24131. * Gets the event that is raised whenever the definition of this property changes.
  24132. * The definition is considered to have changed if a call to getValue would return
  24133. * a different result for the same time.
  24134. */
  24135. readonly definitionChanged: Event;
  24136. /**
  24137. * Gets or sets the Property specifying the {@link StripeOrientation}/
  24138. */
  24139. orientation: Property | undefined;
  24140. /**
  24141. * Gets or sets the Property specifying the first {@link Color}.
  24142. */
  24143. evenColor: Property | undefined;
  24144. /**
  24145. * Gets or sets the Property specifying the second {@link Color}.
  24146. */
  24147. oddColor: Property | undefined;
  24148. /**
  24149. * Gets or sets the numeric Property specifying the point into the pattern
  24150. * to begin drawing; with 0.0 being the beginning of the even color, 1.0 the beginning
  24151. * of the odd color, 2.0 being the even color again, and any multiple or fractional values
  24152. * being in between.
  24153. */
  24154. offset: Property | undefined;
  24155. /**
  24156. * Gets or sets the numeric Property specifying how many times the stripes repeat.
  24157. */
  24158. repeat: Property | undefined;
  24159. /**
  24160. * Gets the {@link Material} type at the provided time.
  24161. * @param time - The time for which to retrieve the type.
  24162. * @returns The type of material.
  24163. */
  24164. getType(time: JulianDate): string;
  24165. /**
  24166. * Gets the value of the property at the provided time.
  24167. * @param time - The time for which to retrieve the value.
  24168. * @param [result] - The object to store the value into, if omitted, a new instance is created and returned.
  24169. * @returns The modified result parameter or a new instance if the result parameter was not supplied.
  24170. */
  24171. getValue(time: JulianDate, result?: any): any;
  24172. /**
  24173. * Compares this property to the provided property and returns
  24174. * <code>true</code> if they are equal, <code>false</code> otherwise.
  24175. * @param [other] - The other property.
  24176. * @returns <code>true</code> if left and right are equal, <code>false</code> otherwise.
  24177. */
  24178. equals(other?: Property): boolean;
  24179. }
  24180. /**
  24181. * Defined the orientation of stripes in {@link StripeMaterialProperty}.
  24182. */
  24183. export enum StripeOrientation {
  24184. /**
  24185. * Horizontal orientation.
  24186. */
  24187. HORIZONTAL = 0,
  24188. /**
  24189. * Vertical orientation.
  24190. */
  24191. VERTICAL = 1
  24192. }
  24193. /**
  24194. * A {@link TimeIntervalCollectionProperty} which is also a {@link PositionProperty}.
  24195. * @param [referenceFrame = ReferenceFrame.FIXED] - The reference frame in which the position is defined.
  24196. */
  24197. export class TimeIntervalCollectionPositionProperty {
  24198. constructor(referenceFrame?: ReferenceFrame);
  24199. /**
  24200. * Gets a value indicating if this property is constant. A property is considered
  24201. * constant if getValue always returns the same result for the current definition.
  24202. */
  24203. readonly isConstant: boolean;
  24204. /**
  24205. * Gets the event that is raised whenever the definition of this property changes.
  24206. * The definition is considered to have changed if a call to getValue would return
  24207. * a different result for the same time.
  24208. */
  24209. readonly definitionChanged: Event;
  24210. /**
  24211. * Gets the interval collection.
  24212. */
  24213. readonly intervals: TimeIntervalCollection;
  24214. /**
  24215. * Gets the reference frame in which the position is defined.
  24216. */
  24217. readonly referenceFrame: ReferenceFrame;
  24218. /**
  24219. * Gets the value of the property at the provided time in the fixed frame.
  24220. * @param time - The time for which to retrieve the value.
  24221. * @param [result] - The object to store the value into, if omitted, a new instance is created and returned.
  24222. * @returns The modified result parameter or a new instance if the result parameter was not supplied.
  24223. */
  24224. getValue(time: JulianDate, result?: any): Cartesian3 | undefined;
  24225. /**
  24226. * Gets the value of the property at the provided time and in the provided reference frame.
  24227. * @param time - The time for which to retrieve the value.
  24228. * @param referenceFrame - The desired referenceFrame of the result.
  24229. * @param [result] - The object to store the value into, if omitted, a new instance is created and returned.
  24230. * @returns The modified result parameter or a new instance if the result parameter was not supplied.
  24231. */
  24232. getValueInReferenceFrame(time: JulianDate, referenceFrame: ReferenceFrame, result?: Cartesian3): Cartesian3 | undefined;
  24233. /**
  24234. * Compares this property to the provided property and returns
  24235. * <code>true</code> if they are equal, <code>false</code> otherwise.
  24236. * @param [other] - The other property.
  24237. * @returns <code>true</code> if left and right are equal, <code>false</code> otherwise.
  24238. */
  24239. equals(other?: Property): boolean;
  24240. }
  24241. /**
  24242. * A {@link Property} which is defined by a {@link TimeIntervalCollection}, where the
  24243. * data property of each {@link TimeInterval} represents the value at time.
  24244. * @example
  24245. * //Create a Cartesian2 interval property which contains data on August 1st, 2012
  24246. * //and uses a different value every 6 hours.
  24247. * const composite = new Cesium.TimeIntervalCollectionProperty();
  24248. * composite.intervals.addInterval(Cesium.TimeInterval.fromIso8601({
  24249. * iso8601 : '2012-08-01T00:00:00.00Z/2012-08-01T06:00:00.00Z',
  24250. * isStartIncluded : true,
  24251. * isStopIncluded : false,
  24252. * data : new Cesium.Cartesian2(2.0, 3.4)
  24253. * }));
  24254. * composite.intervals.addInterval(Cesium.TimeInterval.fromIso8601({
  24255. * iso8601 : '2012-08-01T06:00:00.00Z/2012-08-01T12:00:00.00Z',
  24256. * isStartIncluded : true,
  24257. * isStopIncluded : false,
  24258. * data : new Cesium.Cartesian2(12.0, 2.7)
  24259. * }));
  24260. * composite.intervals.addInterval(Cesium.TimeInterval.fromIso8601({
  24261. * iso8601 : '2012-08-01T12:00:00.00Z/2012-08-01T18:00:00.00Z',
  24262. * isStartIncluded : true,
  24263. * isStopIncluded : false,
  24264. * data : new Cesium.Cartesian2(5.0, 12.4)
  24265. * }));
  24266. * composite.intervals.addInterval(Cesium.TimeInterval.fromIso8601({
  24267. * iso8601 : '2012-08-01T18:00:00.00Z/2012-08-02T00:00:00.00Z',
  24268. * isStartIncluded : true,
  24269. * isStopIncluded : true,
  24270. * data : new Cesium.Cartesian2(85.0, 4.1)
  24271. * }));
  24272. */
  24273. export class TimeIntervalCollectionProperty {
  24274. constructor();
  24275. /**
  24276. * Gets a value indicating if this property is constant. A property is considered
  24277. * constant if getValue always returns the same result for the current definition.
  24278. */
  24279. readonly isConstant: boolean;
  24280. /**
  24281. * Gets the event that is raised whenever the definition of this property changes.
  24282. * The definition is changed whenever setValue is called with data different
  24283. * than the current value.
  24284. */
  24285. readonly definitionChanged: Event;
  24286. /**
  24287. * Gets the interval collection.
  24288. */
  24289. readonly intervals: TimeIntervalCollection;
  24290. /**
  24291. * Gets the value of the property at the provided time.
  24292. * @param time - The time for which to retrieve the value.
  24293. * @param [result] - The object to store the value into, if omitted, a new instance is created and returned.
  24294. * @returns The modified result parameter or a new instance if the result parameter was not supplied.
  24295. */
  24296. getValue(time: JulianDate, result?: any): any;
  24297. /**
  24298. * Compares this property to the provided property and returns
  24299. * <code>true</code> if they are equal, <code>false</code> otherwise.
  24300. * @param [other] - The other property.
  24301. * @returns <code>true</code> if left and right are equal, <code>false</code> otherwise.
  24302. */
  24303. equals(other?: Property): boolean;
  24304. }
  24305. /**
  24306. * A {@link Property} which evaluates to a {@link Quaternion} rotation
  24307. * based on the velocity of the provided {@link PositionProperty}.
  24308. * @example
  24309. * //Create an entity with position and orientation.
  24310. * const position = new Cesium.SampledProperty();
  24311. * position.addSamples(...);
  24312. * const entity = viewer.entities.add({
  24313. * position : position,
  24314. * orientation : new Cesium.VelocityOrientationProperty(position)
  24315. * }));
  24316. * @param [position] - The position property used to compute the orientation.
  24317. * @param [ellipsoid = Ellipsoid.WGS84] - The ellipsoid used to determine which way is up.
  24318. */
  24319. export class VelocityOrientationProperty {
  24320. constructor(position?: PositionProperty, ellipsoid?: Ellipsoid);
  24321. /**
  24322. * Gets a value indicating if this property is constant.
  24323. */
  24324. readonly isConstant: boolean;
  24325. /**
  24326. * Gets the event that is raised whenever the definition of this property changes.
  24327. */
  24328. readonly definitionChanged: Event;
  24329. /**
  24330. * Gets or sets the position property used to compute orientation.
  24331. */
  24332. position: Property | undefined;
  24333. /**
  24334. * Gets or sets the ellipsoid used to determine which way is up.
  24335. */
  24336. ellipsoid: Property | undefined;
  24337. /**
  24338. * Gets the value of the property at the provided time.
  24339. * @param [time] - The time for which to retrieve the value.
  24340. * @param [result] - The object to store the value into, if omitted, a new instance is created and returned.
  24341. * @returns The modified result parameter or a new instance if the result parameter was not supplied.
  24342. */
  24343. getValue(time?: JulianDate, result?: Quaternion): Quaternion;
  24344. /**
  24345. * Compares this property to the provided property and returns
  24346. * <code>true</code> if they are equal, <code>false</code> otherwise.
  24347. * @param [other] - The other property.
  24348. * @returns <code>true</code> if left and right are equal, <code>false</code> otherwise.
  24349. */
  24350. equals(other?: Property): boolean;
  24351. }
  24352. /**
  24353. * A {@link Property} which evaluates to a {@link Cartesian3} vector
  24354. * based on the velocity of the provided {@link PositionProperty}.
  24355. * @example
  24356. * //Create an entity with a billboard rotated to match its velocity.
  24357. * const position = new Cesium.SampledProperty();
  24358. * position.addSamples(...);
  24359. * const entity = viewer.entities.add({
  24360. * position : position,
  24361. * billboard : {
  24362. * image : 'image.png',
  24363. * alignedAxis : new Cesium.VelocityVectorProperty(position, true) // alignedAxis must be a unit vector
  24364. * }
  24365. * }));
  24366. * @param [position] - The position property used to compute the velocity.
  24367. * @param [normalize = true] - Whether to normalize the computed velocity vector.
  24368. */
  24369. export class VelocityVectorProperty {
  24370. constructor(position?: PositionProperty, normalize?: boolean);
  24371. /**
  24372. * Gets a value indicating if this property is constant.
  24373. */
  24374. readonly isConstant: boolean;
  24375. /**
  24376. * Gets the event that is raised whenever the definition of this property changes.
  24377. */
  24378. readonly definitionChanged: Event;
  24379. /**
  24380. * Gets or sets the position property used to compute the velocity vector.
  24381. */
  24382. position: Property | undefined;
  24383. /**
  24384. * Gets or sets whether the vector produced by this property
  24385. * will be normalized or not.
  24386. */
  24387. normalize: boolean;
  24388. /**
  24389. * Gets the value of the property at the provided time.
  24390. * @param [time] - The time for which to retrieve the value.
  24391. * @param [result] - The object to store the value into, if omitted, a new instance is created and returned.
  24392. * @returns The modified result parameter or a new instance if the result parameter was not supplied.
  24393. */
  24394. getValue(time?: JulianDate, result?: Cartesian3): Cartesian3;
  24395. /**
  24396. * Compares this property to the provided property and returns
  24397. * <code>true</code> if they are equal, <code>false</code> otherwise.
  24398. * @param [other] - The other property.
  24399. * @returns <code>true</code> if left and right are equal, <code>false</code> otherwise.
  24400. */
  24401. equals(other?: Property): boolean;
  24402. }
  24403. /**
  24404. * Defines the interface for visualizers. Visualizers are plug-ins to
  24405. * {@link DataSourceDisplay} that render data associated with
  24406. * {@link DataSource} instances.
  24407. * This object is an interface for documentation purposes and is not intended
  24408. * to be instantiated directly.
  24409. */
  24410. export class Visualizer {
  24411. constructor();
  24412. /**
  24413. * Updates the visualization to the provided time.
  24414. * @param time - The time.
  24415. * @returns True if the display was updated to the provided time,
  24416. * false if the visualizer is waiting for an asynchronous operation to
  24417. * complete before data can be updated.
  24418. */
  24419. update(time: JulianDate): boolean;
  24420. /**
  24421. * Returns true if this object was destroyed; otherwise, false.
  24422. * @returns True if this object was destroyed; otherwise, false.
  24423. */
  24424. isDestroyed(): boolean;
  24425. /**
  24426. * Removes all visualization and cleans up any resources associated with this instance.
  24427. */
  24428. destroy(): void;
  24429. }
  24430. /**
  24431. * A {@link GeometryUpdater} for walls.
  24432. * Clients do not normally create this class directly, but instead rely on {@link DataSourceDisplay}.
  24433. * @param entity - The entity containing the geometry to be visualized.
  24434. * @param scene - The scene where visualization is taking place.
  24435. */
  24436. export class WallGeometryUpdater {
  24437. constructor(entity: Entity, scene: Scene);
  24438. /**
  24439. * Creates the geometry instance which represents the fill of the geometry.
  24440. * @param time - The time to use when retrieving initial attribute values.
  24441. * @returns The geometry instance representing the filled portion of the geometry.
  24442. */
  24443. createFillGeometryInstance(time: JulianDate): GeometryInstance;
  24444. /**
  24445. * Creates the geometry instance which represents the outline of the geometry.
  24446. * @param time - The time to use when retrieving initial attribute values.
  24447. * @returns The geometry instance representing the outline portion of the geometry.
  24448. */
  24449. createOutlineGeometryInstance(time: JulianDate): GeometryInstance;
  24450. }
  24451. export namespace WallGraphics {
  24452. /**
  24453. * Initialization options for the WallGraphics constructor
  24454. * @property [show = true] - A boolean Property specifying the visibility of the wall.
  24455. * @property [positions] - A Property specifying the array of {@link Cartesian3} positions which define the top of the wall.
  24456. * @property [minimumHeights] - A Property specifying an array of heights to be used for the bottom of the wall instead of the globe surface.
  24457. * @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.
  24458. * @property [granularity = Cesium.Math.RADIANS_PER_DEGREE] - A numeric Property specifying the angular distance between each latitude and longitude point.
  24459. * @property [fill = true] - A boolean Property specifying whether the wall is filled with the provided material.
  24460. * @property [material = Color.WHITE] - A Property specifying the material used to fill the wall.
  24461. * @property [outline = false] - A boolean Property specifying whether the wall is outlined.
  24462. * @property [outlineColor = Color.BLACK] - A Property specifying the {@link Color} of the outline.
  24463. * @property [outlineWidth = 1.0] - A numeric Property specifying the width of the outline.
  24464. * @property [shadows = ShadowMode.DISABLED] - An enum Property specifying whether the wall casts or receives shadows from light sources.
  24465. * @property [distanceDisplayCondition] - A Property specifying at what distance from the camera that this wall will be displayed.
  24466. */
  24467. type ConstructorOptions = {
  24468. show?: Property | boolean;
  24469. positions?: Property | Cartesian3[];
  24470. minimumHeights?: Property | number[];
  24471. maximumHeights?: Property | number[];
  24472. granularity?: Property | number;
  24473. fill?: Property | boolean;
  24474. material?: MaterialProperty | Color;
  24475. outline?: Property | boolean;
  24476. outlineColor?: Property | Color;
  24477. outlineWidth?: Property | number;
  24478. shadows?: Property | ShadowMode;
  24479. distanceDisplayCondition?: Property | DistanceDisplayCondition;
  24480. };
  24481. }
  24482. /**
  24483. * Describes a two dimensional wall defined as a line strip and optional maximum and minimum heights.
  24484. * The wall conforms to the curvature of the globe and can be placed along the surface or at altitude.
  24485. * @param [options] - Object describing initialization options
  24486. */
  24487. export class WallGraphics {
  24488. constructor(options?: WallGraphics.ConstructorOptions);
  24489. /**
  24490. * Gets the event that is raised whenever a property or sub-property is changed or modified.
  24491. */
  24492. readonly definitionChanged: Event;
  24493. /**
  24494. * Gets or sets the boolean Property specifying the visibility of the wall.
  24495. */
  24496. show: Property | undefined;
  24497. /**
  24498. * Gets or sets the Property specifying the array of {@link Cartesian3} positions which define the top of the wall.
  24499. */
  24500. positions: Property | undefined;
  24501. /**
  24502. * 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.
  24503. * If defined, the array must be the same length as {@link Wall#positions}.
  24504. */
  24505. minimumHeights: Property | undefined;
  24506. /**
  24507. * 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.
  24508. * If defined, the array must be the same length as {@link Wall#positions}.
  24509. */
  24510. maximumHeights: Property | undefined;
  24511. /**
  24512. * Gets or sets the numeric Property specifying the angular distance between points on the wall.
  24513. */
  24514. granularity: Property | undefined;
  24515. /**
  24516. * Gets or sets the boolean Property specifying whether the wall is filled with the provided material.
  24517. */
  24518. fill: Property | undefined;
  24519. /**
  24520. * Gets or sets the Property specifying the material used to fill the wall.
  24521. */
  24522. material: MaterialProperty;
  24523. /**
  24524. * Gets or sets the Property specifying whether the wall is outlined.
  24525. */
  24526. outline: Property | undefined;
  24527. /**
  24528. * Gets or sets the Property specifying the {@link Color} of the outline.
  24529. */
  24530. outlineColor: Property | undefined;
  24531. /**
  24532. * Gets or sets the numeric Property specifying the width of the outline.
  24533. * <p>
  24534. * Note: This property will be ignored on all major browsers on Windows platforms. For details, see (@link https://github.com/CesiumGS/cesium/issues/40}.
  24535. * </p>
  24536. */
  24537. outlineWidth: Property | undefined;
  24538. /**
  24539. * Get or sets the enum Property specifying whether the wall
  24540. * casts or receives shadows from light sources.
  24541. */
  24542. shadows: Property | undefined;
  24543. /**
  24544. * Gets or sets the {@link DistanceDisplayCondition} Property specifying at what distance from the camera that this wall will be displayed.
  24545. */
  24546. distanceDisplayCondition: Property | undefined;
  24547. /**
  24548. * Duplicates this instance.
  24549. * @param [result] - The object onto which to store the result.
  24550. * @returns The modified result parameter or a new instance if one was not provided.
  24551. */
  24552. clone(result?: WallGraphics): WallGraphics;
  24553. /**
  24554. * Assigns each unassigned property on this object to the value
  24555. * of the same property on the provided source object.
  24556. * @param source - The object to be merged into this object.
  24557. */
  24558. merge(source: WallGraphics): void;
  24559. }
  24560. /**
  24561. * @property kml - The generated KML.
  24562. * @property externalFiles - An object dictionary of external files
  24563. */
  24564. export type exportKmlResultKml = {
  24565. kml: string;
  24566. externalFiles: {
  24567. [key: string]: Blob;
  24568. };
  24569. };
  24570. /**
  24571. * @property kmz - The generated kmz file.
  24572. */
  24573. export type exportKmlResultKmz = {
  24574. kmz: Blob;
  24575. };
  24576. /**
  24577. * Exports an EntityCollection as a KML document. Only Point, Billboard, Model, Path, Polygon, Polyline geometries
  24578. * will be exported. Note that there is not a 1 to 1 mapping of Entity properties to KML Feature properties. For
  24579. * example, entity properties that are time dynamic but cannot be dynamic in KML are exported with their values at
  24580. * options.time or the beginning of the EntityCollection's time interval if not specified. For time-dynamic properties
  24581. * that are supported in KML, we use the samples if it is a {@link SampledProperty} otherwise we sample the value using
  24582. * the options.sampleDuration. Point, Billboard, Model and Path geometries with time-dynamic positions will be exported
  24583. * as gx:Track Features. Not all Materials are representable in KML, so for more advanced Materials just the primary
  24584. * color is used. Canvas objects are exported as PNG images.
  24585. * @example
  24586. * Cesium.exportKml({
  24587. * entities: entityCollection
  24588. * })
  24589. * .then(function(result) {
  24590. * // The XML string is in result.kml
  24591. *
  24592. * const externalFiles = result.externalFiles
  24593. * for(const file in externalFiles) {
  24594. * // file is the name of the file used in the KML document as the href
  24595. * // externalFiles[file] is a blob with the contents of the file
  24596. * }
  24597. * });
  24598. * @param options - An object with the following properties:
  24599. * @param options.entities - The EntityCollection to export as KML.
  24600. * @param [options.ellipsoid = Ellipsoid.WGS84] - The ellipsoid for the output file.
  24601. * @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.
  24602. * @param [options.time = entities.computeAvailability().start] - The time value to use to get properties that are not time varying in KML.
  24603. * @param [options.defaultAvailability = entities.computeAvailability()] - The interval that will be sampled if an entity doesn't have an availability.
  24604. * @param [options.sampleDuration = 60] - The number of seconds to sample properties that are varying in KML.
  24605. * @param [options.kmz = false] - If true KML and external files will be compressed into a kmz file.
  24606. * @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.
  24607. */
  24608. export function exportKml(options: {
  24609. entities: EntityCollection;
  24610. ellipsoid?: Ellipsoid;
  24611. modelCallback?: exportKmlModelCallback;
  24612. time?: JulianDate;
  24613. defaultAvailability?: TimeInterval;
  24614. sampleDuration?: number;
  24615. kmz?: boolean;
  24616. }): Promise<exportKmlResultKml | exportKmlResultKmz>;
  24617. /**
  24618. * Since KML does not support glTF models, this callback is required to specify what URL to use for the model in the KML document.
  24619. * 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,
  24620. * or otherwise returned with the KML string when exporting.
  24621. * @param model - The ModelGraphics instance for an Entity.
  24622. * @param time - The time that any properties should use to get the value.
  24623. * @param externalFiles - An object that maps a filename to a Blob or a Promise that resolves to a Blob.
  24624. */
  24625. export type exportKmlModelCallback = (model: ModelGraphics, time: JulianDate, externalFiles: any) => string;
  24626. /**
  24627. * The data type of a pixel.
  24628. */
  24629. export enum PixelDatatype {
  24630. UNSIGNED_BYTE = WebGLConstants.UNSIGNED_BYTE,
  24631. UNSIGNED_SHORT = WebGLConstants.UNSIGNED_SHORT,
  24632. UNSIGNED_INT = WebGLConstants.UNSIGNED_INT,
  24633. FLOAT = WebGLConstants.FLOAT,
  24634. HALF_FLOAT = WebGLConstants.HALF_FLOAT_OES,
  24635. UNSIGNED_INT_24_8 = WebGLConstants.UNSIGNED_INT_24_8,
  24636. UNSIGNED_SHORT_4_4_4_4 = WebGLConstants.UNSIGNED_SHORT_4_4_4_4,
  24637. UNSIGNED_SHORT_5_5_5_1 = WebGLConstants.UNSIGNED_SHORT_5_5_5_1,
  24638. UNSIGNED_SHORT_5_6_5 = WebGLConstants.UNSIGNED_SHORT_5_6_5
  24639. }
  24640. /**
  24641. * Enumerates all possible filters used when magnifying WebGL textures.
  24642. */
  24643. export enum TextureMagnificationFilter {
  24644. /**
  24645. * Samples the texture by returning the closest pixel.
  24646. */
  24647. NEAREST = WebGLConstants.NEAREST,
  24648. /**
  24649. * Samples the texture through bi-linear interpolation of the four nearest pixels. This produces smoother results than <code>NEAREST</code> filtering.
  24650. */
  24651. LINEAR = WebGLConstants.LINEAR
  24652. }
  24653. /**
  24654. * Enumerates all possible filters used when minifying WebGL textures.
  24655. */
  24656. export enum TextureMinificationFilter {
  24657. /**
  24658. * Samples the texture by returning the closest pixel.
  24659. */
  24660. NEAREST = WebGLConstants.NEAREST,
  24661. /**
  24662. * Samples the texture through bi-linear interpolation of the four nearest pixels. This produces smoother results than <code>NEAREST</code> filtering.
  24663. */
  24664. LINEAR = WebGLConstants.LINEAR,
  24665. /**
  24666. * Selects the nearest mip level and applies nearest sampling within that level.
  24667. * <p>
  24668. * Requires that the texture has a mipmap. The mip level is chosen by the view angle and screen-space size of the texture.
  24669. * </p>
  24670. */
  24671. NEAREST_MIPMAP_NEAREST = WebGLConstants.NEAREST_MIPMAP_NEAREST,
  24672. /**
  24673. * Selects the nearest mip level and applies linear sampling within that level.
  24674. * <p>
  24675. * Requires that the texture has a mipmap. The mip level is chosen by the view angle and screen-space size of the texture.
  24676. * </p>
  24677. */
  24678. LINEAR_MIPMAP_NEAREST = WebGLConstants.LINEAR_MIPMAP_NEAREST,
  24679. /**
  24680. * Read texture values with nearest sampling from two adjacent mip levels and linearly interpolate the results.
  24681. * <p>
  24682. * This option provides a good balance of visual quality and speed when sampling from a mipmapped texture.
  24683. * </p>
  24684. * <p>
  24685. * Requires that the texture has a mipmap. The mip level is chosen by the view angle and screen-space size of the texture.
  24686. * </p>
  24687. */
  24688. NEAREST_MIPMAP_LINEAR = WebGLConstants.NEAREST_MIPMAP_LINEAR,
  24689. /**
  24690. * Read texture values with linear sampling from two adjacent mip levels and linearly interpolate the results.
  24691. * <p>
  24692. * This option provides a good balance of visual quality and speed when sampling from a mipmapped texture.
  24693. * </p>
  24694. * <p>
  24695. * Requires that the texture has a mipmap. The mip level is chosen by the view angle and screen-space size of the texture.
  24696. * </p>
  24697. */
  24698. LINEAR_MIPMAP_LINEAR = WebGLConstants.LINEAR_MIPMAP_LINEAR
  24699. }
  24700. /**
  24701. * An appearance defines the full GLSL vertex and fragment shaders and the
  24702. * render state used to draw a {@link Primitive}. All appearances implement
  24703. * this base <code>Appearance</code> interface.
  24704. * @param [options] - Object with the following properties:
  24705. * @param [options.translucent = true] - When <code>true</code>, the geometry is expected to appear translucent so {@link Appearance#renderState} has alpha blending enabled.
  24706. * @param [options.closed = false] - When <code>true</code>, the geometry is expected to be closed so {@link Appearance#renderState} has backface culling enabled.
  24707. * @param [options.material = Material.ColorType] - The material used to determine the fragment color.
  24708. * @param [options.vertexShaderSource] - Optional GLSL vertex shader source to override the default vertex shader.
  24709. * @param [options.fragmentShaderSource] - Optional GLSL fragment shader source to override the default fragment shader.
  24710. * @param [options.renderState] - Optional render state to override the default render state.
  24711. */
  24712. export class Appearance {
  24713. constructor(options?: {
  24714. translucent?: boolean;
  24715. closed?: boolean;
  24716. material?: Material;
  24717. vertexShaderSource?: string;
  24718. fragmentShaderSource?: string;
  24719. renderState?: any;
  24720. });
  24721. /**
  24722. * The material used to determine the fragment color. Unlike other {@link Appearance}
  24723. * properties, this is not read-only, so an appearance's material can change on the fly.
  24724. */
  24725. material: Material;
  24726. /**
  24727. * When <code>true</code>, the geometry is expected to appear translucent.
  24728. */
  24729. translucent: boolean;
  24730. /**
  24731. * The GLSL source code for the vertex shader.
  24732. */
  24733. readonly vertexShaderSource: string;
  24734. /**
  24735. * The GLSL source code for the fragment shader. The full fragment shader
  24736. * source is built procedurally taking into account the {@link Appearance#material}.
  24737. * Use {@link Appearance#getFragmentShaderSource} to get the full source.
  24738. */
  24739. readonly fragmentShaderSource: string;
  24740. /**
  24741. * The WebGL fixed-function state to use when rendering the geometry.
  24742. */
  24743. readonly renderState: any;
  24744. /**
  24745. * When <code>true</code>, the geometry is expected to be closed.
  24746. */
  24747. readonly closed: boolean;
  24748. /**
  24749. * Procedurally creates the full GLSL fragment shader source for this appearance
  24750. * taking into account {@link Appearance#fragmentShaderSource} and {@link Appearance#material}.
  24751. * @returns The full GLSL fragment shader source.
  24752. */
  24753. getFragmentShaderSource(): string;
  24754. /**
  24755. * Determines if the geometry is translucent based on {@link Appearance#translucent} and {@link Material#isTranslucent}.
  24756. * @returns <code>true</code> if the appearance is translucent.
  24757. */
  24758. isTranslucent(): boolean;
  24759. /**
  24760. * Creates a render state. This is not the final render state instance; instead,
  24761. * it can contain a subset of render state properties identical to the render state
  24762. * created in the context.
  24763. * @returns The render state.
  24764. */
  24765. getRenderState(): any;
  24766. }
  24767. export namespace ArcGisMapServerImageryProvider {
  24768. /**
  24769. * Initialization options for the ArcGisMapServerImageryProvider constructor
  24770. * @property url - The URL of the ArcGIS MapServer service.
  24771. * @property [token] - The ArcGIS token used to authenticate with the ArcGIS MapServer service.
  24772. * @property [tileDiscardPolicy] - The policy that determines if a tile
  24773. * is invalid and should be discarded. If this value is not specified, a default
  24774. * {@link DiscardMissingTileImagePolicy} is used for tiled map servers, and a
  24775. * {@link NeverTileDiscardPolicy} is used for non-tiled map servers. In the former case,
  24776. * we request tile 0,0 at the maximum tile level and check pixels (0,0), (200,20), (20,200),
  24777. * (80,110), and (160, 130). If all of these pixels are transparent, the discard check is
  24778. * disabled and no tiles are discarded. If any of them have a non-transparent color, any
  24779. * tile that has the same values in these pixel locations is discarded. The end result of
  24780. * these defaults should be correct tile discarding for a standard ArcGIS Server. To ensure
  24781. * that no tiles are discarded, construct and pass a {@link NeverTileDiscardPolicy} for this
  24782. * parameter.
  24783. * @property [usePreCachedTilesIfAvailable = true] - If true, the server's pre-cached
  24784. * tiles are used if they are available. If false, any pre-cached tiles are ignored and the
  24785. * 'export' service is used.
  24786. * @property [layers] - A comma-separated list of the layers to show, or undefined if all layers should be shown.
  24787. * @property [enablePickFeatures = true] - If true, {@link ArcGisMapServerImageryProvider#pickFeatures} will invoke
  24788. * the Identify service on the MapServer and return the features included in the response. If false,
  24789. * {@link ArcGisMapServerImageryProvider#pickFeatures} will immediately return undefined (indicating no pickable features)
  24790. * without communicating with the server. Set this property to false if you don't want this provider's features to
  24791. * be pickable. Can be overridden by setting the {@link ArcGisMapServerImageryProvider#enablePickFeatures} property on the object.
  24792. * @property [rectangle = Rectangle.MAX_VALUE] - The rectangle of the layer. This parameter is ignored when accessing
  24793. * a tiled layer.
  24794. * @property [tilingScheme = new GeographicTilingScheme()] - The tiling scheme to use to divide the world into tiles.
  24795. * This parameter is ignored when accessing a tiled server.
  24796. * @property [ellipsoid] - The ellipsoid. If the tilingScheme is specified and used,
  24797. * this parameter is ignored and the tiling scheme's ellipsoid is used instead. If neither
  24798. * parameter is specified, the WGS84 ellipsoid is used.
  24799. * @property [credit] - A credit for the data source, which is displayed on the canvas. This parameter is ignored when accessing a tiled server.
  24800. * @property [tileWidth = 256] - The width of each tile in pixels. This parameter is ignored when accessing a tiled server.
  24801. * @property [tileHeight = 256] - The height of each tile in pixels. This parameter is ignored when accessing a tiled server.
  24802. * @property [maximumLevel] - The maximum tile level to request, or undefined if there is no maximum. This parameter is ignored when accessing
  24803. * a tiled server.
  24804. */
  24805. type ConstructorOptions = {
  24806. url: Resource | string;
  24807. token?: string;
  24808. tileDiscardPolicy?: TileDiscardPolicy;
  24809. usePreCachedTilesIfAvailable?: boolean;
  24810. layers?: string;
  24811. enablePickFeatures?: boolean;
  24812. rectangle?: Rectangle;
  24813. tilingScheme?: TilingScheme;
  24814. ellipsoid?: Ellipsoid;
  24815. credit?: Credit | string;
  24816. tileWidth?: number;
  24817. tileHeight?: number;
  24818. maximumLevel?: number;
  24819. };
  24820. }
  24821. /**
  24822. * Provides tiled imagery hosted by an ArcGIS MapServer. By default, the server's pre-cached tiles are
  24823. * used, if available.
  24824. * @example
  24825. * const esri = new Cesium.ArcGisMapServerImageryProvider({
  24826. * url : 'https://services.arcgisonline.com/ArcGIS/rest/services/World_Imagery/MapServer'
  24827. * });
  24828. * @param options - Object describing initialization options
  24829. */
  24830. export class ArcGisMapServerImageryProvider {
  24831. constructor(options: ArcGisMapServerImageryProvider.ConstructorOptions);
  24832. /**
  24833. * The default alpha blending value of this provider, with 0.0 representing fully transparent and
  24834. * 1.0 representing fully opaque.
  24835. */
  24836. defaultAlpha: number | undefined;
  24837. /**
  24838. * The default alpha blending value on the night side of the globe of this provider, with 0.0 representing fully transparent and
  24839. * 1.0 representing fully opaque.
  24840. */
  24841. defaultNightAlpha: number | undefined;
  24842. /**
  24843. * The default alpha blending value on the day side of the globe of this provider, with 0.0 representing fully transparent and
  24844. * 1.0 representing fully opaque.
  24845. */
  24846. defaultDayAlpha: number | undefined;
  24847. /**
  24848. * The default brightness of this provider. 1.0 uses the unmodified imagery color. Less than 1.0
  24849. * makes the imagery darker while greater than 1.0 makes it brighter.
  24850. */
  24851. defaultBrightness: number | undefined;
  24852. /**
  24853. * The default contrast of this provider. 1.0 uses the unmodified imagery color. Less than 1.0 reduces
  24854. * the contrast while greater than 1.0 increases it.
  24855. */
  24856. defaultContrast: number | undefined;
  24857. /**
  24858. * The default hue of this provider in radians. 0.0 uses the unmodified imagery color.
  24859. */
  24860. defaultHue: number | undefined;
  24861. /**
  24862. * The default saturation of this provider. 1.0 uses the unmodified imagery color. Less than 1.0 reduces the
  24863. * saturation while greater than 1.0 increases it.
  24864. */
  24865. defaultSaturation: number | undefined;
  24866. /**
  24867. * The default gamma correction to apply to this provider. 1.0 uses the unmodified imagery color.
  24868. */
  24869. defaultGamma: number | undefined;
  24870. /**
  24871. * The default texture minification filter to apply to this provider.
  24872. */
  24873. defaultMinificationFilter: TextureMinificationFilter;
  24874. /**
  24875. * The default texture magnification filter to apply to this provider.
  24876. */
  24877. defaultMagnificationFilter: TextureMagnificationFilter;
  24878. /**
  24879. * Gets or sets a value indicating whether feature picking is enabled. If true, {@link ArcGisMapServerImageryProvider#pickFeatures} will
  24880. * invoke the "identify" operation on the ArcGIS server and return the features included in the response. If false,
  24881. * {@link ArcGisMapServerImageryProvider#pickFeatures} will immediately return undefined (indicating no pickable features)
  24882. * without communicating with the server.
  24883. */
  24884. enablePickFeatures: boolean;
  24885. /**
  24886. * Gets the URL of the ArcGIS MapServer.
  24887. */
  24888. readonly url: string;
  24889. /**
  24890. * Gets the ArcGIS token used to authenticate with the ArcGis MapServer service.
  24891. */
  24892. readonly token: string;
  24893. /**
  24894. * Gets the proxy used by this provider.
  24895. */
  24896. readonly proxy: Proxy;
  24897. /**
  24898. * Gets the width of each tile, in pixels. This function should
  24899. * not be called before {@link ArcGisMapServerImageryProvider#ready} returns true.
  24900. */
  24901. readonly tileWidth: number;
  24902. /**
  24903. * Gets the height of each tile, in pixels. This function should
  24904. * not be called before {@link ArcGisMapServerImageryProvider#ready} returns true.
  24905. */
  24906. readonly tileHeight: number;
  24907. /**
  24908. * Gets the maximum level-of-detail that can be requested. This function should
  24909. * not be called before {@link ArcGisMapServerImageryProvider#ready} returns true.
  24910. */
  24911. readonly maximumLevel: number | undefined;
  24912. /**
  24913. * Gets the minimum level-of-detail that can be requested. This function should
  24914. * not be called before {@link ArcGisMapServerImageryProvider#ready} returns true.
  24915. */
  24916. readonly minimumLevel: number;
  24917. /**
  24918. * Gets the tiling scheme used by this provider. This function should
  24919. * not be called before {@link ArcGisMapServerImageryProvider#ready} returns true.
  24920. */
  24921. readonly tilingScheme: TilingScheme;
  24922. /**
  24923. * Gets the rectangle, in radians, of the imagery provided by this instance. This function should
  24924. * not be called before {@link ArcGisMapServerImageryProvider#ready} returns true.
  24925. */
  24926. readonly rectangle: Rectangle;
  24927. /**
  24928. * Gets the tile discard policy. If not undefined, the discard policy is responsible
  24929. * for filtering out "missing" tiles via its shouldDiscardImage function. If this function
  24930. * returns undefined, no tiles are filtered. This function should
  24931. * not be called before {@link ArcGisMapServerImageryProvider#ready} returns true.
  24932. */
  24933. readonly tileDiscardPolicy: TileDiscardPolicy;
  24934. /**
  24935. * Gets an event that is raised when the imagery provider encounters an asynchronous error. By subscribing
  24936. * to the event, you will be notified of the error and can potentially recover from it. Event listeners
  24937. * are passed an instance of {@link TileProviderError}.
  24938. */
  24939. readonly errorEvent: Event;
  24940. /**
  24941. * Gets a value indicating whether or not the provider is ready for use.
  24942. */
  24943. readonly ready: boolean;
  24944. /**
  24945. * Gets a promise that resolves to true when the provider is ready for use.
  24946. */
  24947. readonly readyPromise: Promise<boolean>;
  24948. /**
  24949. * Gets the credit to display when this imagery provider is active. Typically this is used to credit
  24950. * the source of the imagery. This function should not be called before {@link ArcGisMapServerImageryProvider#ready} returns true.
  24951. */
  24952. readonly credit: Credit;
  24953. /**
  24954. * Gets a value indicating whether this imagery provider is using pre-cached tiles from the
  24955. * ArcGIS MapServer. If the imagery provider is not yet ready ({@link ArcGisMapServerImageryProvider#ready}), this function
  24956. * will return the value of `options.usePreCachedTilesIfAvailable`, even if the MapServer does
  24957. * not have pre-cached tiles.
  24958. */
  24959. readonly usingPrecachedTiles: boolean;
  24960. /**
  24961. * Gets a value indicating whether or not the images provided by this imagery provider
  24962. * include an alpha channel. If this property is false, an alpha channel, if present, will
  24963. * be ignored. If this property is true, any images without an alpha channel will be treated
  24964. * as if their alpha is 1.0 everywhere. When this property is false, memory usage
  24965. * and texture upload time are reduced.
  24966. */
  24967. readonly hasAlphaChannel: boolean;
  24968. /**
  24969. * Gets the comma-separated list of layer IDs to show.
  24970. */
  24971. layers: string;
  24972. /**
  24973. * Gets the credits to be displayed when a given tile is displayed.
  24974. * @param x - The tile X coordinate.
  24975. * @param y - The tile Y coordinate.
  24976. * @param level - The tile level;
  24977. * @returns The credits to be displayed when the tile is displayed.
  24978. */
  24979. getTileCredits(x: number, y: number, level: number): Credit[];
  24980. /**
  24981. * Requests the image for a given tile. This function should
  24982. * not be called before {@link ArcGisMapServerImageryProvider#ready} returns true.
  24983. * @param x - The tile X coordinate.
  24984. * @param y - The tile Y coordinate.
  24985. * @param level - The tile level.
  24986. * @param [request] - The request object. Intended for internal use only.
  24987. * @returns A promise for the image that will resolve when the image is available, or
  24988. * undefined if there are too many active requests to the server, and the request should be retried later.
  24989. */
  24990. requestImage(x: number, y: number, level: number, request?: Request): Promise<ImageryTypes> | undefined;
  24991. /**
  24992. * /**
  24993. * Asynchronously determines what features, if any, are located at a given longitude and latitude within
  24994. * a tile. This function should not be called before {@link ImageryProvider#ready} returns true.
  24995. * @param x - The tile X coordinate.
  24996. * @param y - The tile Y coordinate.
  24997. * @param level - The tile level.
  24998. * @param longitude - The longitude at which to pick features.
  24999. * @param latitude - The latitude at which to pick features.
  25000. * @returns A promise for the picked features that will resolve when the asynchronous
  25001. * picking completes. The resolved value is an array of {@link ImageryLayerFeatureInfo}
  25002. * instances. The array may be empty if no features are found at the given location.
  25003. */
  25004. pickFeatures(x: number, y: number, level: number, longitude: number, latitude: number): Promise<ImageryLayerFeatureInfo[]> | undefined;
  25005. }
  25006. /**
  25007. * An enum describing the x, y, and z axes and helper conversion functions.
  25008. */
  25009. export enum Axis {
  25010. /**
  25011. * Denotes the x-axis.
  25012. */
  25013. X = 0,
  25014. /**
  25015. * Denotes the y-axis.
  25016. */
  25017. Y = 1,
  25018. /**
  25019. * Denotes the z-axis.
  25020. */
  25021. Z = 2
  25022. }
  25023. /**
  25024. * A viewport-aligned image positioned in the 3D scene, that is created
  25025. * and rendered using a {@link BillboardCollection}. A billboard is created and its initial
  25026. * properties are set by calling {@link BillboardCollection#add}.
  25027. * <br /><br />
  25028. * <div align='center'>
  25029. * <img src='Images/Billboard.png' width='400' height='300' /><br />
  25030. * Example billboards
  25031. * </div>
  25032. */
  25033. export class Billboard {
  25034. constructor();
  25035. /**
  25036. * Determines if this billboard will be shown. Use this to hide or show a billboard, instead
  25037. * of removing it and re-adding it to the collection.
  25038. */
  25039. show: boolean;
  25040. /**
  25041. * Gets or sets the Cartesian position of this billboard.
  25042. */
  25043. position: Cartesian3;
  25044. /**
  25045. * Gets or sets the height reference of this billboard.
  25046. */
  25047. heightReference: HeightReference;
  25048. /**
  25049. * Gets or sets the pixel offset in screen space from the origin of this billboard. This is commonly used
  25050. * to align multiple billboards and labels at the same position, e.g., an image and text. The
  25051. * screen space origin is the top, left corner of the canvas; <code>x</code> increases from
  25052. * left to right, and <code>y</code> increases from top to bottom.
  25053. * <br /><br />
  25054. * <div align='center'>
  25055. * <table border='0' cellpadding='5'><tr>
  25056. * <td align='center'><code>default</code><br/><img src='Images/Billboard.setPixelOffset.default.png' width='250' height='188' /></td>
  25057. * <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>
  25058. * </tr></table>
  25059. * The billboard's origin is indicated by the yellow point.
  25060. * </div>
  25061. */
  25062. pixelOffset: Cartesian2;
  25063. /**
  25064. * Gets or sets near and far scaling properties of a Billboard based on the billboard's distance from the camera.
  25065. * A billboard's scale will interpolate between the {@link NearFarScalar#nearValue} and
  25066. * {@link NearFarScalar#farValue} while the camera distance falls within the lower and upper bounds
  25067. * of the specified {@link NearFarScalar#near} and {@link NearFarScalar#far}.
  25068. * Outside of these ranges the billboard's scale remains clamped to the nearest bound. If undefined,
  25069. * scaleByDistance will be disabled.
  25070. * @example
  25071. * // Example 1.
  25072. * // Set a billboard's scaleByDistance to scale by 1.5 when the
  25073. * // camera is 1500 meters from the billboard and disappear as
  25074. * // the camera distance approaches 8.0e6 meters.
  25075. * b.scaleByDistance = new Cesium.NearFarScalar(1.5e2, 1.5, 8.0e6, 0.0);
  25076. * @example
  25077. * // Example 2.
  25078. * // disable scaling by distance
  25079. * b.scaleByDistance = undefined;
  25080. */
  25081. scaleByDistance: NearFarScalar;
  25082. /**
  25083. * Gets or sets near and far translucency properties of a Billboard based on the billboard's distance from the camera.
  25084. * A billboard's translucency will interpolate between the {@link NearFarScalar#nearValue} and
  25085. * {@link NearFarScalar#farValue} while the camera distance falls within the lower and upper bounds
  25086. * of the specified {@link NearFarScalar#near} and {@link NearFarScalar#far}.
  25087. * Outside of these ranges the billboard's translucency remains clamped to the nearest bound. If undefined,
  25088. * translucencyByDistance will be disabled.
  25089. * @example
  25090. * // Example 1.
  25091. * // Set a billboard's translucency to 1.0 when the
  25092. * // camera is 1500 meters from the billboard and disappear as
  25093. * // the camera distance approaches 8.0e6 meters.
  25094. * b.translucencyByDistance = new Cesium.NearFarScalar(1.5e2, 1.0, 8.0e6, 0.0);
  25095. * @example
  25096. * // Example 2.
  25097. * // disable translucency by distance
  25098. * b.translucencyByDistance = undefined;
  25099. */
  25100. translucencyByDistance: NearFarScalar;
  25101. /**
  25102. * Gets or sets near and far pixel offset scaling properties of a Billboard based on the billboard's distance from the camera.
  25103. * A billboard's pixel offset will be scaled between the {@link NearFarScalar#nearValue} and
  25104. * {@link NearFarScalar#farValue} while the camera distance falls within the lower and upper bounds
  25105. * of the specified {@link NearFarScalar#near} and {@link NearFarScalar#far}.
  25106. * Outside of these ranges the billboard's pixel offset scale remains clamped to the nearest bound. If undefined,
  25107. * pixelOffsetScaleByDistance will be disabled.
  25108. * @example
  25109. * // Example 1.
  25110. * // Set a billboard's pixel offset scale to 0.0 when the
  25111. * // camera is 1500 meters from the billboard and scale pixel offset to 10.0 pixels
  25112. * // in the y direction the camera distance approaches 8.0e6 meters.
  25113. * b.pixelOffset = new Cesium.Cartesian2(0.0, 1.0);
  25114. * b.pixelOffsetScaleByDistance = new Cesium.NearFarScalar(1.5e2, 0.0, 8.0e6, 10.0);
  25115. * @example
  25116. * // Example 2.
  25117. * // disable pixel offset by distance
  25118. * b.pixelOffsetScaleByDistance = undefined;
  25119. */
  25120. pixelOffsetScaleByDistance: NearFarScalar;
  25121. /**
  25122. * Gets or sets the 3D Cartesian offset applied to this billboard in eye coordinates. Eye coordinates is a left-handed
  25123. * coordinate system, where <code>x</code> points towards the viewer's right, <code>y</code> points up, and
  25124. * <code>z</code> points into the screen. Eye coordinates use the same scale as world and model coordinates,
  25125. * which is typically meters.
  25126. * <br /><br />
  25127. * An eye offset is commonly used to arrange multiple billboards or objects at the same position, e.g., to
  25128. * arrange a billboard above its corresponding 3D model.
  25129. * <br /><br />
  25130. * Below, the billboard is positioned at the center of the Earth but an eye offset makes it always
  25131. * appear on top of the Earth regardless of the viewer's or Earth's orientation.
  25132. * <br /><br />
  25133. * <div align='center'>
  25134. * <table border='0' cellpadding='5'><tr>
  25135. * <td align='center'><img src='Images/Billboard.setEyeOffset.one.png' width='250' height='188' /></td>
  25136. * <td align='center'><img src='Images/Billboard.setEyeOffset.two.png' width='250' height='188' /></td>
  25137. * </tr></table>
  25138. * <code>b.eyeOffset = new Cartesian3(0.0, 8000000.0, 0.0);</code><br /><br />
  25139. * </div>
  25140. */
  25141. eyeOffset: Cartesian3;
  25142. /**
  25143. * Gets or sets the horizontal origin of this billboard, which determines if the billboard is
  25144. * to the left, center, or right of its anchor position.
  25145. * <br /><br />
  25146. * <div align='center'>
  25147. * <img src='Images/Billboard.setHorizontalOrigin.png' width='648' height='196' /><br />
  25148. * </div>
  25149. * @example
  25150. * // Use a bottom, left origin
  25151. * b.horizontalOrigin = Cesium.HorizontalOrigin.LEFT;
  25152. * b.verticalOrigin = Cesium.VerticalOrigin.BOTTOM;
  25153. */
  25154. horizontalOrigin: HorizontalOrigin;
  25155. /**
  25156. * Gets or sets the vertical origin of this billboard, which determines if the billboard is
  25157. * to the above, below, or at the center of its anchor position.
  25158. * <br /><br />
  25159. * <div align='center'>
  25160. * <img src='Images/Billboard.setVerticalOrigin.png' width='695' height='175' /><br />
  25161. * </div>
  25162. * @example
  25163. * // Use a bottom, left origin
  25164. * b.horizontalOrigin = Cesium.HorizontalOrigin.LEFT;
  25165. * b.verticalOrigin = Cesium.VerticalOrigin.BOTTOM;
  25166. */
  25167. verticalOrigin: VerticalOrigin;
  25168. /**
  25169. * Gets or sets the uniform scale that is multiplied with the billboard's image size in pixels.
  25170. * A scale of <code>1.0</code> does not change the size of the billboard; a scale greater than
  25171. * <code>1.0</code> enlarges the billboard; a positive scale less than <code>1.0</code> shrinks
  25172. * the billboard.
  25173. * <br /><br />
  25174. * <div align='center'>
  25175. * <img src='Images/Billboard.setScale.png' width='400' height='300' /><br/>
  25176. * From left to right in the above image, the scales are <code>0.5</code>, <code>1.0</code>,
  25177. * and <code>2.0</code>.
  25178. * </div>
  25179. */
  25180. scale: number;
  25181. /**
  25182. * Gets or sets the color that is multiplied with the billboard's texture. This has two common use cases. First,
  25183. * the same white texture may be used by many different billboards, each with a different color, to create
  25184. * colored billboards. Second, the color's alpha component can be used to make the billboard translucent as shown below.
  25185. * An alpha of <code>0.0</code> makes the billboard transparent, and <code>1.0</code> makes the billboard opaque.
  25186. * <br /><br />
  25187. * <div align='center'>
  25188. * <table border='0' cellpadding='5'><tr>
  25189. * <td align='center'><code>default</code><br/><img src='Images/Billboard.setColor.Alpha255.png' width='250' height='188' /></td>
  25190. * <td align='center'><code>alpha : 0.5</code><br/><img src='Images/Billboard.setColor.Alpha127.png' width='250' height='188' /></td>
  25191. * </tr></table>
  25192. * </div>
  25193. * <br />
  25194. * The red, green, blue, and alpha values are indicated by <code>value</code>'s <code>red</code>, <code>green</code>,
  25195. * <code>blue</code>, and <code>alpha</code> properties as shown in Example 1. These components range from <code>0.0</code>
  25196. * (no intensity) to <code>1.0</code> (full intensity).
  25197. * @example
  25198. * // Example 1. Assign yellow.
  25199. * b.color = Cesium.Color.YELLOW;
  25200. * @example
  25201. * // Example 2. Make a billboard 50% translucent.
  25202. * b.color = new Cesium.Color(1.0, 1.0, 1.0, 0.5);
  25203. */
  25204. color: Color;
  25205. /**
  25206. * Gets or sets the rotation angle in radians.
  25207. */
  25208. rotation: number;
  25209. /**
  25210. * Gets or sets the aligned axis in world space. The aligned axis is the unit vector that the billboard up vector points towards.
  25211. * The default is the zero vector, which means the billboard is aligned to the screen up vector.
  25212. * @example
  25213. * // Example 1.
  25214. * // Have the billboard up vector point north
  25215. * billboard.alignedAxis = Cesium.Cartesian3.UNIT_Z;
  25216. * @example
  25217. * // Example 2.
  25218. * // Have the billboard point east.
  25219. * billboard.alignedAxis = Cesium.Cartesian3.UNIT_Z;
  25220. * billboard.rotation = -Cesium.Math.PI_OVER_TWO;
  25221. * @example
  25222. * // Example 3.
  25223. * // Reset the aligned axis
  25224. * billboard.alignedAxis = Cesium.Cartesian3.ZERO;
  25225. */
  25226. alignedAxis: Cartesian3;
  25227. /**
  25228. * Gets or sets a width for the billboard. If undefined, the image width will be used.
  25229. */
  25230. width: number;
  25231. /**
  25232. * Gets or sets a height for the billboard. If undefined, the image height will be used.
  25233. */
  25234. height: number;
  25235. /**
  25236. * Gets or sets if the billboard size is in meters or pixels. <code>true</code> to size the billboard in meters;
  25237. * otherwise, the size is in pixels.
  25238. */
  25239. sizeInMeters: boolean;
  25240. /**
  25241. * Gets or sets the condition specifying at what distance from the camera that this billboard will be displayed.
  25242. */
  25243. distanceDisplayCondition: DistanceDisplayCondition;
  25244. /**
  25245. * Gets or sets the distance from the camera at which to disable the depth test to, for example, prevent clipping against terrain.
  25246. * When set to zero, the depth test is always applied. When set to Number.POSITIVE_INFINITY, the depth test is never applied.
  25247. */
  25248. disableDepthTestDistance: number;
  25249. /**
  25250. * Gets or sets the user-defined object returned when the billboard is picked.
  25251. */
  25252. id: any;
  25253. /**
  25254. * <p>
  25255. * Gets or sets the image to be used for this billboard. If a texture has already been created for the
  25256. * given image, the existing texture is used.
  25257. * </p>
  25258. * <p>
  25259. * This property can be set to a loaded Image, a URL which will be loaded as an Image automatically,
  25260. * a canvas, or another billboard's image property (from the same billboard collection).
  25261. * </p>
  25262. * @example
  25263. * // load an image from a URL
  25264. * b.image = 'some/image/url.png';
  25265. *
  25266. * // assuming b1 and b2 are billboards in the same billboard collection,
  25267. * // use the same image for both billboards.
  25268. * b2.image = b1.image;
  25269. */
  25270. image: string;
  25271. /**
  25272. * When <code>true</code>, this billboard is ready to render, i.e., the image
  25273. * has been downloaded and the WebGL resources are created.
  25274. */
  25275. readonly ready: boolean;
  25276. /**
  25277. * <p>
  25278. * Sets the image to be used for this billboard. If a texture has already been created for the
  25279. * given id, the existing texture is used.
  25280. * </p>
  25281. * <p>
  25282. * This function is useful for dynamically creating textures that are shared across many billboards.
  25283. * Only the first billboard will actually call the function and create the texture, while subsequent
  25284. * billboards created with the same id will simply re-use the existing texture.
  25285. * </p>
  25286. * <p>
  25287. * To load an image from a URL, setting the {@link Billboard#image} property is more convenient.
  25288. * </p>
  25289. * @example
  25290. * // create a billboard image dynamically
  25291. * function drawImage(id) {
  25292. * // create and draw an image using a canvas
  25293. * const canvas = document.createElement('canvas');
  25294. * const context2D = canvas.getContext('2d');
  25295. * // ... draw image
  25296. * return canvas;
  25297. * }
  25298. * // drawImage will be called to create the texture
  25299. * b.setImage('myImage', drawImage);
  25300. *
  25301. * // subsequent billboards created in the same collection using the same id will use the existing
  25302. * // texture, without the need to create the canvas or draw the image
  25303. * b2.setImage('myImage', drawImage);
  25304. * @param id - The id of the image. This can be any string that uniquely identifies the image.
  25305. * @param image - The image to load. This parameter
  25306. * can either be a loaded Image or Canvas, a URL which will be loaded as an Image automatically,
  25307. * or a function which will be called to create the image if it hasn't been loaded already.
  25308. */
  25309. setImage(id: string, image: HTMLImageElement | HTMLCanvasElement | string | Resource | Billboard.CreateImageCallback): void;
  25310. /**
  25311. * Uses a sub-region of the image with the given id as the image for this billboard,
  25312. * measured in pixels from the bottom-left.
  25313. * @param id - The id of the image to use.
  25314. * @param subRegion - The sub-region of the image.
  25315. */
  25316. setImageSubRegion(id: string, subRegion: BoundingRectangle): void;
  25317. /**
  25318. * Computes the screen-space position of the billboard's origin, taking into account eye and pixel offsets.
  25319. * The screen space origin is the top, left corner of the canvas; <code>x</code> increases from
  25320. * left to right, and <code>y</code> increases from top to bottom.
  25321. * @example
  25322. * console.log(b.computeScreenSpacePosition(scene).toString());
  25323. * @param scene - The scene.
  25324. * @param [result] - The object onto which to store the result.
  25325. * @returns The screen-space position of the billboard.
  25326. */
  25327. computeScreenSpacePosition(scene: Scene, result?: Cartesian2): Cartesian2;
  25328. /**
  25329. * Determines if this billboard equals another billboard. Billboards are equal if all their properties
  25330. * are equal. Billboards in different collections can be equal.
  25331. * @param other - The billboard to compare for equality.
  25332. * @returns <code>true</code> if the billboards are equal; otherwise, <code>false</code>.
  25333. */
  25334. equals(other: Billboard): boolean;
  25335. }
  25336. export namespace Billboard {
  25337. /**
  25338. * A function that creates an image.
  25339. * @param id - The identifier of the image to load.
  25340. */
  25341. type CreateImageCallback = (id: string) => HTMLImageElement | HTMLCanvasElement | Promise<HTMLImageElement | HTMLCanvasElement>;
  25342. }
  25343. /**
  25344. * A renderable collection of billboards. Billboards are viewport-aligned
  25345. * images positioned in the 3D scene.
  25346. * <br /><br />
  25347. * <div align='center'>
  25348. * <img src='Images/Billboard.png' width='400' height='300' /><br />
  25349. * Example billboards
  25350. * </div>
  25351. * <br /><br />
  25352. * Billboards are added and removed from the collection using {@link BillboardCollection#add}
  25353. * and {@link BillboardCollection#remove}. Billboards in a collection automatically share textures
  25354. * for images with the same identifier.
  25355. * @example
  25356. * // Create a billboard collection with two billboards
  25357. * const billboards = scene.primitives.add(new Cesium.BillboardCollection());
  25358. * billboards.add({
  25359. * position : new Cesium.Cartesian3(1.0, 2.0, 3.0),
  25360. * image : 'url/to/image'
  25361. * });
  25362. * billboards.add({
  25363. * position : new Cesium.Cartesian3(4.0, 5.0, 6.0),
  25364. * image : 'url/to/another/image'
  25365. * });
  25366. * @param [options] - Object with the following properties:
  25367. * @param [options.modelMatrix = Matrix4.IDENTITY] - The 4x4 transformation matrix that transforms each billboard from model to world coordinates.
  25368. * @param [options.debugShowBoundingVolume = false] - For debugging only. Determines if this primitive's commands' bounding spheres are shown.
  25369. * @param [options.scene] - Must be passed in for billboards that use the height reference property or will be depth tested against the globe.
  25370. * @param [options.blendOption = BlendOption.OPAQUE_AND_TRANSLUCENT] - The billboard blending option. The default
  25371. * is used for rendering both opaque and translucent billboards. However, if either all of the billboards are completely opaque or all are completely translucent,
  25372. * setting the technique to BlendOption.OPAQUE or BlendOption.TRANSLUCENT can improve performance by up to 2x.
  25373. * @param [options.show = true] - Determines if the billboards in the collection will be shown.
  25374. */
  25375. export class BillboardCollection {
  25376. constructor(options?: {
  25377. modelMatrix?: Matrix4;
  25378. debugShowBoundingVolume?: boolean;
  25379. scene?: Scene;
  25380. blendOption?: BlendOption;
  25381. show?: boolean;
  25382. });
  25383. /**
  25384. * Determines if billboards in this collection will be shown.
  25385. */
  25386. show: boolean;
  25387. /**
  25388. * The 4x4 transformation matrix that transforms each billboard in this collection from model to world coordinates.
  25389. * When this is the identity matrix, the billboards are drawn in world coordinates, i.e., Earth's WGS84 coordinates.
  25390. * Local reference frames can be used by providing a different transformation matrix, like that returned
  25391. * by {@link Transforms.eastNorthUpToFixedFrame}.
  25392. * @example
  25393. * const center = Cesium.Cartesian3.fromDegrees(-75.59777, 40.03883);
  25394. * billboards.modelMatrix = Cesium.Transforms.eastNorthUpToFixedFrame(center);
  25395. * billboards.add({
  25396. * image : 'url/to/image',
  25397. * position : new Cesium.Cartesian3(0.0, 0.0, 0.0) // center
  25398. * });
  25399. * billboards.add({
  25400. * image : 'url/to/image',
  25401. * position : new Cesium.Cartesian3(1000000.0, 0.0, 0.0) // east
  25402. * });
  25403. * billboards.add({
  25404. * image : 'url/to/image',
  25405. * position : new Cesium.Cartesian3(0.0, 1000000.0, 0.0) // north
  25406. * });
  25407. * billboards.add({
  25408. * image : 'url/to/image',
  25409. * position : new Cesium.Cartesian3(0.0, 0.0, 1000000.0) // up
  25410. * });
  25411. */
  25412. modelMatrix: Matrix4;
  25413. /**
  25414. * This property is for debugging only; it is not for production use nor is it optimized.
  25415. * <p>
  25416. * Draws the bounding sphere for each draw command in the primitive.
  25417. * </p>
  25418. */
  25419. debugShowBoundingVolume: boolean;
  25420. /**
  25421. * This property is for debugging only; it is not for production use nor is it optimized.
  25422. * <p>
  25423. * Draws the texture atlas for this BillboardCollection as a fullscreen quad.
  25424. * </p>
  25425. */
  25426. debugShowTextureAtlas: boolean;
  25427. /**
  25428. * The billboard blending option. The default is used for rendering both opaque and translucent billboards.
  25429. * However, if either all of the billboards are completely opaque or all are completely translucent,
  25430. * setting the technique to BlendOption.OPAQUE or BlendOption.TRANSLUCENT can improve
  25431. * performance by up to 2x.
  25432. */
  25433. blendOption: BlendOption;
  25434. /**
  25435. * Returns the number of billboards in this collection. This is commonly used with
  25436. * {@link BillboardCollection#get} to iterate over all the billboards
  25437. * in the collection.
  25438. */
  25439. length: number;
  25440. /**
  25441. * Creates and adds a billboard with the specified initial properties to the collection.
  25442. * The added billboard is returned so it can be modified or removed from the collection later.
  25443. * @example
  25444. * // Example 1: Add a billboard, specifying all the default values.
  25445. * const b = billboards.add({
  25446. * show : true,
  25447. * position : Cesium.Cartesian3.ZERO,
  25448. * pixelOffset : Cesium.Cartesian2.ZERO,
  25449. * eyeOffset : Cesium.Cartesian3.ZERO,
  25450. * heightReference : Cesium.HeightReference.NONE,
  25451. * horizontalOrigin : Cesium.HorizontalOrigin.CENTER,
  25452. * verticalOrigin : Cesium.VerticalOrigin.CENTER,
  25453. * scale : 1.0,
  25454. * image : 'url/to/image',
  25455. * imageSubRegion : undefined,
  25456. * color : Cesium.Color.WHITE,
  25457. * id : undefined,
  25458. * rotation : 0.0,
  25459. * alignedAxis : Cesium.Cartesian3.ZERO,
  25460. * width : undefined,
  25461. * height : undefined,
  25462. * scaleByDistance : undefined,
  25463. * translucencyByDistance : undefined,
  25464. * pixelOffsetScaleByDistance : undefined,
  25465. * sizeInMeters : false,
  25466. * distanceDisplayCondition : undefined
  25467. * });
  25468. * @example
  25469. * // Example 2: Specify only the billboard's cartographic position.
  25470. * const b = billboards.add({
  25471. * position : Cesium.Cartesian3.fromDegrees(longitude, latitude, height)
  25472. * });
  25473. * @param [options] - A template describing the billboard's properties as shown in Example 1.
  25474. * @returns The billboard that was added to the collection.
  25475. */
  25476. add(options?: any): Billboard;
  25477. /**
  25478. * Removes a billboard from the collection.
  25479. * @example
  25480. * const b = billboards.add(...);
  25481. * billboards.remove(b); // Returns true
  25482. * @param billboard - The billboard to remove.
  25483. * @returns <code>true</code> if the billboard was removed; <code>false</code> if the billboard was not found in the collection.
  25484. */
  25485. remove(billboard: Billboard): boolean;
  25486. /**
  25487. * Removes all billboards from the collection.
  25488. * @example
  25489. * billboards.add(...);
  25490. * billboards.add(...);
  25491. * billboards.removeAll();
  25492. */
  25493. removeAll(): void;
  25494. /**
  25495. * Check whether this collection contains a given billboard.
  25496. * @param [billboard] - The billboard to check for.
  25497. * @returns true if this collection contains the billboard, false otherwise.
  25498. */
  25499. contains(billboard?: Billboard): boolean;
  25500. /**
  25501. * Returns the billboard in the collection at the specified index. Indices are zero-based
  25502. * and increase as billboards are added. Removing a billboard shifts all billboards after
  25503. * it to the left, changing their indices. This function is commonly used with
  25504. * {@link BillboardCollection#length} to iterate over all the billboards
  25505. * in the collection.
  25506. * @example
  25507. * // Toggle the show property of every billboard in the collection
  25508. * const len = billboards.length;
  25509. * for (let i = 0; i < len; ++i) {
  25510. * const b = billboards.get(i);
  25511. * b.show = !b.show;
  25512. * }
  25513. * @param index - The zero-based index of the billboard.
  25514. * @returns The billboard at the specified index.
  25515. */
  25516. get(index: number): Billboard;
  25517. /**
  25518. * Called when {@link Viewer} or {@link CesiumWidget} render the scene to
  25519. * get the draw commands needed to render this primitive.
  25520. * <p>
  25521. * Do not call this function directly. This is documented just to
  25522. * list the exceptions that may be propagated when the scene is rendered:
  25523. * </p>
  25524. */
  25525. update(): void;
  25526. /**
  25527. * Returns true if this object was destroyed; otherwise, false.
  25528. * <br /><br />
  25529. * If this object was destroyed, it should not be used; calling any function other than
  25530. * <code>isDestroyed</code> will result in a {@link DeveloperError} exception.
  25531. * @returns <code>true</code> if this object was destroyed; otherwise, <code>false</code>.
  25532. */
  25533. isDestroyed(): boolean;
  25534. /**
  25535. * Destroys the WebGL resources held by this object. Destroying an object allows for deterministic
  25536. * release of WebGL resources, instead of relying on the garbage collector to destroy this object.
  25537. * <br /><br />
  25538. * Once an object is destroyed, it should not be used; calling any function other than
  25539. * <code>isDestroyed</code> will result in a {@link DeveloperError} exception. Therefore,
  25540. * assign the return value (<code>undefined</code>) to the object as done in the example.
  25541. * @example
  25542. * billboards = billboards && billboards.destroy();
  25543. */
  25544. destroy(): void;
  25545. }
  25546. export namespace BingMapsImageryProvider {
  25547. /**
  25548. * Initialization options for the BingMapsImageryProvider constructor
  25549. * @property url - The url of the Bing Maps server hosting the imagery.
  25550. * @property key - The Bing Maps key for your application, which can be
  25551. * created at {@link https://www.bingmapsportal.com/}.
  25552. * @property [tileProtocol] - The protocol to use when loading tiles, e.g. 'http' or 'https'.
  25553. * By default, tiles are loaded using the same protocol as the page.
  25554. * @property [mapStyle = BingMapsStyle.AERIAL] - The type of Bing Maps imagery to load.
  25555. * @property [culture = ''] - The culture to use when requesting Bing Maps imagery. Not
  25556. * all cultures are supported. See {@link http://msdn.microsoft.com/en-us/library/hh441729.aspx}
  25557. * for information on the supported cultures.
  25558. * @property [ellipsoid] - The ellipsoid. If not specified, the WGS84 ellipsoid is used.
  25559. * @property [tileDiscardPolicy] - The policy that determines if a tile
  25560. * is invalid and should be discarded. By default, a {@link DiscardEmptyTileImagePolicy}
  25561. * will be used, with the expectation that the Bing Maps server will send a zero-length response for missing tiles.
  25562. * To ensure that no tiles are discarded, construct and pass a {@link NeverTileDiscardPolicy} for this parameter.
  25563. */
  25564. type ConstructorOptions = {
  25565. url: Resource | string;
  25566. key: string;
  25567. tileProtocol?: string;
  25568. mapStyle?: BingMapsStyle;
  25569. culture?: string;
  25570. ellipsoid?: Ellipsoid;
  25571. tileDiscardPolicy?: TileDiscardPolicy;
  25572. };
  25573. }
  25574. /**
  25575. * Provides tiled imagery using the Bing Maps Imagery REST API.
  25576. * @example
  25577. * const bing = new Cesium.BingMapsImageryProvider({
  25578. * url : 'https://dev.virtualearth.net',
  25579. * key : 'get-yours-at-https://www.bingmapsportal.com/',
  25580. * mapStyle : Cesium.BingMapsStyle.AERIAL
  25581. * });
  25582. * @param options - Object describing initialization options
  25583. */
  25584. export class BingMapsImageryProvider {
  25585. constructor(options: BingMapsImageryProvider.ConstructorOptions);
  25586. /**
  25587. * The default alpha blending value of this provider, with 0.0 representing fully transparent and
  25588. * 1.0 representing fully opaque.
  25589. */
  25590. defaultAlpha: number | undefined;
  25591. /**
  25592. * The default alpha blending value on the night side of the globe of this provider, with 0.0 representing fully transparent and
  25593. * 1.0 representing fully opaque.
  25594. */
  25595. defaultNightAlpha: number | undefined;
  25596. /**
  25597. * The default alpha blending value on the day side of the globe of this provider, with 0.0 representing fully transparent and
  25598. * 1.0 representing fully opaque.
  25599. */
  25600. defaultDayAlpha: number | undefined;
  25601. /**
  25602. * The default brightness of this provider. 1.0 uses the unmodified imagery color. Less than 1.0
  25603. * makes the imagery darker while greater than 1.0 makes it brighter.
  25604. */
  25605. defaultBrightness: number | undefined;
  25606. /**
  25607. * The default contrast of this provider. 1.0 uses the unmodified imagery color. Less than 1.0 reduces
  25608. * the contrast while greater than 1.0 increases it.
  25609. */
  25610. defaultContrast: number | undefined;
  25611. /**
  25612. * The default hue of this provider in radians. 0.0 uses the unmodified imagery color.
  25613. */
  25614. defaultHue: number | undefined;
  25615. /**
  25616. * The default saturation of this provider. 1.0 uses the unmodified imagery color. Less than 1.0 reduces the
  25617. * saturation while greater than 1.0 increases it.
  25618. */
  25619. defaultSaturation: number | undefined;
  25620. /**
  25621. * The default gamma correction to apply to this provider. 1.0 uses the unmodified imagery color.
  25622. */
  25623. defaultGamma: number | undefined;
  25624. /**
  25625. * The default texture minification filter to apply to this provider.
  25626. */
  25627. defaultMinificationFilter: TextureMinificationFilter;
  25628. /**
  25629. * The default texture magnification filter to apply to this provider.
  25630. */
  25631. defaultMagnificationFilter: TextureMagnificationFilter;
  25632. /**
  25633. * Gets the name of the BingMaps server url hosting the imagery.
  25634. */
  25635. readonly url: string;
  25636. /**
  25637. * Gets the proxy used by this provider.
  25638. */
  25639. readonly proxy: Proxy;
  25640. /**
  25641. * Gets the Bing Maps key.
  25642. */
  25643. readonly key: string;
  25644. /**
  25645. * Gets the type of Bing Maps imagery to load.
  25646. */
  25647. readonly mapStyle: BingMapsStyle;
  25648. /**
  25649. * The culture to use when requesting Bing Maps imagery. Not
  25650. * all cultures are supported. See {@link http://msdn.microsoft.com/en-us/library/hh441729.aspx}
  25651. * for information on the supported cultures.
  25652. */
  25653. readonly culture: string;
  25654. /**
  25655. * Gets the width of each tile, in pixels. This function should
  25656. * not be called before {@link BingMapsImageryProvider#ready} returns true.
  25657. */
  25658. readonly tileWidth: number;
  25659. /**
  25660. * Gets the height of each tile, in pixels. This function should
  25661. * not be called before {@link BingMapsImageryProvider#ready} returns true.
  25662. */
  25663. readonly tileHeight: number;
  25664. /**
  25665. * Gets the maximum level-of-detail that can be requested. This function should
  25666. * not be called before {@link BingMapsImageryProvider#ready} returns true.
  25667. */
  25668. readonly maximumLevel: number | undefined;
  25669. /**
  25670. * Gets the minimum level-of-detail that can be requested. This function should
  25671. * not be called before {@link BingMapsImageryProvider#ready} returns true.
  25672. */
  25673. readonly minimumLevel: number;
  25674. /**
  25675. * Gets the tiling scheme used by this provider. This function should
  25676. * not be called before {@link BingMapsImageryProvider#ready} returns true.
  25677. */
  25678. readonly tilingScheme: TilingScheme;
  25679. /**
  25680. * Gets the rectangle, in radians, of the imagery provided by this instance. This function should
  25681. * not be called before {@link BingMapsImageryProvider#ready} returns true.
  25682. */
  25683. readonly rectangle: Rectangle;
  25684. /**
  25685. * Gets the tile discard policy. If not undefined, the discard policy is responsible
  25686. * for filtering out "missing" tiles via its shouldDiscardImage function. If this function
  25687. * returns undefined, no tiles are filtered. This function should
  25688. * not be called before {@link BingMapsImageryProvider#ready} returns true.
  25689. */
  25690. readonly tileDiscardPolicy: TileDiscardPolicy;
  25691. /**
  25692. * Gets an event that is raised when the imagery provider encounters an asynchronous error. By subscribing
  25693. * to the event, you will be notified of the error and can potentially recover from it. Event listeners
  25694. * are passed an instance of {@link TileProviderError}.
  25695. */
  25696. readonly errorEvent: Event;
  25697. /**
  25698. * Gets a value indicating whether or not the provider is ready for use.
  25699. */
  25700. readonly ready: boolean;
  25701. /**
  25702. * Gets a promise that resolves to true when the provider is ready for use.
  25703. */
  25704. readonly readyPromise: Promise<boolean>;
  25705. /**
  25706. * Gets the credit to display when this imagery provider is active. Typically this is used to credit
  25707. * the source of the imagery. This function should not be called before {@link BingMapsImageryProvider#ready} returns true.
  25708. */
  25709. readonly credit: Credit;
  25710. /**
  25711. * Gets a value indicating whether or not the images provided by this imagery provider
  25712. * include an alpha channel. If this property is false, an alpha channel, if present, will
  25713. * be ignored. If this property is true, any images without an alpha channel will be treated
  25714. * as if their alpha is 1.0 everywhere. Setting this property to false reduces memory usage
  25715. * and texture upload time.
  25716. */
  25717. readonly hasAlphaChannel: boolean;
  25718. /**
  25719. * Gets the credits to be displayed when a given tile is displayed.
  25720. * @param x - The tile X coordinate.
  25721. * @param y - The tile Y coordinate.
  25722. * @param level - The tile level;
  25723. * @returns The credits to be displayed when the tile is displayed.
  25724. */
  25725. getTileCredits(x: number, y: number, level: number): Credit[];
  25726. /**
  25727. * Requests the image for a given tile. This function should
  25728. * not be called before {@link BingMapsImageryProvider#ready} returns true.
  25729. * @param x - The tile X coordinate.
  25730. * @param y - The tile Y coordinate.
  25731. * @param level - The tile level.
  25732. * @param [request] - The request object. Intended for internal use only.
  25733. * @returns A promise for the image that will resolve when the image is available, or
  25734. * undefined if there are too many active requests to the server, and the request should be retried later.
  25735. */
  25736. requestImage(x: number, y: number, level: number, request?: Request): Promise<ImageryTypes> | undefined;
  25737. /**
  25738. * Picking features is not currently supported by this imagery provider, so this function simply returns
  25739. * undefined.
  25740. * @param x - The tile X coordinate.
  25741. * @param y - The tile Y coordinate.
  25742. * @param level - The tile level.
  25743. * @param longitude - The longitude at which to pick features.
  25744. * @param latitude - The latitude at which to pick features.
  25745. * @returns Undefined since picking is not supported.
  25746. */
  25747. pickFeatures(x: number, y: number, level: number, longitude: number, latitude: number): undefined;
  25748. /**
  25749. * Converts a tiles (x, y, level) position into a quadkey used to request an image
  25750. * from a Bing Maps server.
  25751. * @param x - The tile's x coordinate.
  25752. * @param y - The tile's y coordinate.
  25753. * @param level - The tile's zoom level.
  25754. */
  25755. static tileXYToQuadKey(x: number, y: number, level: number): void;
  25756. /**
  25757. * Converts a tile's quadkey used to request an image from a Bing Maps server into the
  25758. * (x, y, level) position.
  25759. * @param quadkey - The tile's quad key
  25760. */
  25761. static quadKeyToTileXY(quadkey: string): void;
  25762. /**
  25763. * Gets or sets the URL to the Bing logo for display in the credit.
  25764. */
  25765. static logoUrl: string;
  25766. }
  25767. /**
  25768. * The types of imagery provided by Bing Maps.
  25769. */
  25770. export enum BingMapsStyle {
  25771. /**
  25772. * Aerial imagery.
  25773. */
  25774. AERIAL = "Aerial",
  25775. /**
  25776. * Aerial imagery with a road overlay.
  25777. */
  25778. AERIAL_WITH_LABELS = "AerialWithLabels",
  25779. /**
  25780. * Aerial imagery with a road overlay.
  25781. */
  25782. AERIAL_WITH_LABELS_ON_DEMAND = "AerialWithLabelsOnDemand",
  25783. /**
  25784. * Roads without additional imagery.
  25785. */
  25786. ROAD = "Road",
  25787. /**
  25788. * Roads without additional imagery.
  25789. */
  25790. ROAD_ON_DEMAND = "RoadOnDemand",
  25791. /**
  25792. * A dark version of the road maps.
  25793. */
  25794. CANVAS_DARK = "CanvasDark",
  25795. /**
  25796. * A lighter version of the road maps.
  25797. */
  25798. CANVAS_LIGHT = "CanvasLight",
  25799. /**
  25800. * A grayscale version of the road maps.
  25801. */
  25802. CANVAS_GRAY = "CanvasGray",
  25803. /**
  25804. * Ordnance Survey imagery. This imagery is visible only for the London, UK area.
  25805. */
  25806. ORDNANCE_SURVEY = "OrdnanceSurvey",
  25807. /**
  25808. * Collins Bart imagery.
  25809. */
  25810. COLLINS_BART = "CollinsBart"
  25811. }
  25812. /**
  25813. * Determines how two pixels' values are combined.
  25814. */
  25815. export enum BlendEquation {
  25816. /**
  25817. * Pixel values are added componentwise. This is used in additive blending for translucency.
  25818. */
  25819. ADD = WebGLConstants.FUNC_ADD,
  25820. /**
  25821. * Pixel values are subtracted componentwise (source - destination). This is used in alpha blending for translucency.
  25822. */
  25823. SUBTRACT = WebGLConstants.FUNC_SUBTRACT,
  25824. /**
  25825. * Pixel values are subtracted componentwise (destination - source).
  25826. */
  25827. REVERSE_SUBTRACT = WebGLConstants.FUNC_REVERSE_SUBTRACT,
  25828. /**
  25829. * Pixel values are given to the minimum function (min(source, destination)).
  25830. *
  25831. * This equation operates on each pixel color component.
  25832. */
  25833. MIN = WebGLConstants.MIN,
  25834. /**
  25835. * Pixel values are given to the maximum function (max(source, destination)).
  25836. *
  25837. * This equation operates on each pixel color component.
  25838. */
  25839. MAX = WebGLConstants.MAX
  25840. }
  25841. /**
  25842. * Determines how blending factors are computed.
  25843. */
  25844. export enum BlendFunction {
  25845. /**
  25846. * The blend factor is zero.
  25847. */
  25848. ZERO = WebGLConstants.ZERO,
  25849. /**
  25850. * The blend factor is one.
  25851. */
  25852. ONE = WebGLConstants.ONE,
  25853. /**
  25854. * The blend factor is the source color.
  25855. */
  25856. SOURCE_COLOR = WebGLConstants.SRC_COLOR,
  25857. /**
  25858. * The blend factor is one minus the source color.
  25859. */
  25860. ONE_MINUS_SOURCE_COLOR = WebGLConstants.ONE_MINUS_SRC_COLOR,
  25861. /**
  25862. * The blend factor is the destination color.
  25863. */
  25864. DESTINATION_COLOR = WebGLConstants.DST_COLOR,
  25865. /**
  25866. * The blend factor is one minus the destination color.
  25867. */
  25868. ONE_MINUS_DESTINATION_COLOR = WebGLConstants.ONE_MINUS_DST_COLOR,
  25869. /**
  25870. * The blend factor is the source alpha.
  25871. */
  25872. SOURCE_ALPHA = WebGLConstants.SRC_ALPHA,
  25873. /**
  25874. * The blend factor is one minus the source alpha.
  25875. */
  25876. ONE_MINUS_SOURCE_ALPHA = WebGLConstants.ONE_MINUS_SRC_ALPHA,
  25877. /**
  25878. * The blend factor is the destination alpha.
  25879. */
  25880. DESTINATION_ALPHA = WebGLConstants.DST_ALPHA,
  25881. /**
  25882. * The blend factor is one minus the destination alpha.
  25883. */
  25884. ONE_MINUS_DESTINATION_ALPHA = WebGLConstants.ONE_MINUS_DST_ALPHA,
  25885. /**
  25886. * The blend factor is the constant color.
  25887. */
  25888. CONSTANT_COLOR = WebGLConstants.CONSTANT_COLOR,
  25889. /**
  25890. * The blend factor is one minus the constant color.
  25891. */
  25892. ONE_MINUS_CONSTANT_COLOR = WebGLConstants.ONE_MINUS_CONSTANT_COLOR,
  25893. /**
  25894. * The blend factor is the constant alpha.
  25895. */
  25896. CONSTANT_ALPHA = WebGLConstants.CONSTANT_ALPHA,
  25897. /**
  25898. * The blend factor is one minus the constant alpha.
  25899. */
  25900. ONE_MINUS_CONSTANT_ALPHA = WebGLConstants.ONE_MINUS_CONSTANT_ALPHA,
  25901. /**
  25902. * The blend factor is the saturated source alpha.
  25903. */
  25904. SOURCE_ALPHA_SATURATE = WebGLConstants.SRC_ALPHA_SATURATE
  25905. }
  25906. /**
  25907. * Determines how opaque and translucent parts of billboards, points, and labels are blended with the scene.
  25908. */
  25909. export enum BlendOption {
  25910. /**
  25911. * The billboards, points, or labels in the collection are completely opaque.
  25912. */
  25913. OPAQUE = 0,
  25914. /**
  25915. * The billboards, points, or labels in the collection are completely translucent.
  25916. */
  25917. TRANSLUCENT = 1,
  25918. /**
  25919. * The billboards, points, or labels in the collection are both opaque and translucent.
  25920. */
  25921. OPAQUE_AND_TRANSLUCENT = 2
  25922. }
  25923. /**
  25924. * The blending state combines {@link BlendEquation} and {@link BlendFunction} and the
  25925. * <code>enabled</code> flag to define the full blending state for combining source and
  25926. * destination fragments when rendering.
  25927. * <p>
  25928. * This is a helper when using custom render states with {@link Appearance#renderState}.
  25929. * </p>
  25930. */
  25931. export namespace BlendingState {
  25932. /**
  25933. * Blending is disabled.
  25934. */
  25935. const DISABLED: any;
  25936. /**
  25937. * Blending is enabled using alpha blending, <code>source(source.alpha) + destination(1 - source.alpha)</code>.
  25938. */
  25939. const ALPHA_BLEND: any;
  25940. /**
  25941. * Blending is enabled using alpha blending with premultiplied alpha, <code>source + destination(1 - source.alpha)</code>.
  25942. */
  25943. const PRE_MULTIPLIED_ALPHA_BLEND: any;
  25944. /**
  25945. * Blending is enabled using additive blending, <code>source(source.alpha) + destination</code>.
  25946. */
  25947. const ADDITIVE_BLEND: any;
  25948. }
  25949. /**
  25950. * A ParticleEmitter that emits particles within a box.
  25951. * Particles will be positioned randomly within the box and have initial velocities emanating from the center of the box.
  25952. * @param dimensions - The width, height and depth dimensions of the box.
  25953. */
  25954. export class BoxEmitter {
  25955. constructor(dimensions: Cartesian3);
  25956. /**
  25957. * The width, height and depth dimensions of the box in meters.
  25958. */
  25959. dimensions: Cartesian3;
  25960. }
  25961. /**
  25962. * An orientation given by a pair of unit vectors
  25963. * @property direction - The unit "direction" vector
  25964. * @property up - The unit "up" vector
  25965. */
  25966. export type DirectionUp = {
  25967. direction: Cartesian3;
  25968. up: Cartesian3;
  25969. };
  25970. /**
  25971. * An orientation given by numeric heading, pitch, and roll
  25972. * @property heading - The heading in radians
  25973. * @property pitch - The pitch in radians
  25974. * @property roll - The roll in meters
  25975. */
  25976. export type HeadingPitchRollValues = {
  25977. heading: number;
  25978. pitch: number;
  25979. roll: number;
  25980. };
  25981. /**
  25982. * The camera is defined by a position, orientation, and view frustum.
  25983. * <br /><br />
  25984. * The orientation forms an orthonormal basis with a view, up and right = view x up unit vectors.
  25985. * <br /><br />
  25986. * The viewing frustum is defined by 6 planes.
  25987. * Each plane is represented by a {@link Cartesian4} object, where the x, y, and z components
  25988. * define the unit vector normal to the plane, and the w component is the distance of the
  25989. * plane from the origin/camera position.
  25990. * @example
  25991. * // Create a camera looking down the negative z-axis, positioned at the origin,
  25992. * // with a field of view of 60 degrees, and 1:1 aspect ratio.
  25993. * const camera = new Cesium.Camera(scene);
  25994. * camera.position = new Cesium.Cartesian3();
  25995. * camera.direction = Cesium.Cartesian3.negate(Cesium.Cartesian3.UNIT_Z, new Cesium.Cartesian3());
  25996. * camera.up = Cesium.Cartesian3.clone(Cesium.Cartesian3.UNIT_Y);
  25997. * camera.frustum.fov = Cesium.Math.PI_OVER_THREE;
  25998. * camera.frustum.near = 1.0;
  25999. * camera.frustum.far = 2.0;
  26000. * @param scene - The scene.
  26001. */
  26002. export class Camera {
  26003. constructor(scene: Scene);
  26004. /**
  26005. * The position of the camera.
  26006. */
  26007. position: Cartesian3;
  26008. /**
  26009. * The view direction of the camera.
  26010. */
  26011. direction: Cartesian3;
  26012. /**
  26013. * The up direction of the camera.
  26014. */
  26015. up: Cartesian3;
  26016. /**
  26017. * The right direction of the camera.
  26018. */
  26019. right: Cartesian3;
  26020. /**
  26021. * The region of space in view.
  26022. */
  26023. frustum: PerspectiveFrustum | PerspectiveOffCenterFrustum | OrthographicFrustum;
  26024. /**
  26025. * The default amount to move the camera when an argument is not
  26026. * provided to the move methods.
  26027. */
  26028. defaultMoveAmount: number;
  26029. /**
  26030. * The default amount to rotate the camera when an argument is not
  26031. * provided to the look methods.
  26032. */
  26033. defaultLookAmount: number;
  26034. /**
  26035. * The default amount to rotate the camera when an argument is not
  26036. * provided to the rotate methods.
  26037. */
  26038. defaultRotateAmount: number;
  26039. /**
  26040. * The default amount to move the camera when an argument is not
  26041. * provided to the zoom methods.
  26042. */
  26043. defaultZoomAmount: number;
  26044. /**
  26045. * If set, the camera will not be able to rotate past this axis in either direction.
  26046. */
  26047. constrainedAxis: Cartesian3;
  26048. /**
  26049. * The factor multiplied by the the map size used to determine where to clamp the camera position
  26050. * when zooming out from the surface. The default is 1.5. Only valid for 2D and the map is rotatable.
  26051. */
  26052. maximumZoomFactor: number;
  26053. /**
  26054. * 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.
  26055. */
  26056. percentageChanged: number;
  26057. /**
  26058. * The default rectangle the camera will view on creation.
  26059. */
  26060. static DEFAULT_VIEW_RECTANGLE: Rectangle;
  26061. /**
  26062. * A scalar to multiply to the camera position and add it back after setting the camera to view the rectangle.
  26063. * A value of zero means the camera will view the entire {@link Camera#DEFAULT_VIEW_RECTANGLE}, a value greater than zero
  26064. * will move it further away from the extent, and a value less than zero will move it close to the extent.
  26065. */
  26066. static DEFAULT_VIEW_FACTOR: number;
  26067. /**
  26068. * The default heading/pitch/range that is used when the camera flies to a location that contains a bounding sphere.
  26069. */
  26070. static DEFAULT_OFFSET: HeadingPitchRange;
  26071. /**
  26072. * Gets the camera's reference frame. The inverse of this transformation is appended to the view matrix.
  26073. */
  26074. readonly transform: Matrix4;
  26075. /**
  26076. * Gets the inverse camera transform.
  26077. */
  26078. readonly inverseTransform: Matrix4;
  26079. /**
  26080. * Gets the view matrix.
  26081. */
  26082. readonly viewMatrix: Matrix4;
  26083. /**
  26084. * Gets the inverse view matrix.
  26085. */
  26086. readonly inverseViewMatrix: Matrix4;
  26087. /**
  26088. * Gets the {@link Cartographic} position of the camera, with longitude and latitude
  26089. * expressed in radians and height in meters. In 2D and Columbus View, it is possible
  26090. * for the returned longitude and latitude to be outside the range of valid longitudes
  26091. * and latitudes when the camera is outside the map.
  26092. */
  26093. readonly positionCartographic: Cartographic;
  26094. /**
  26095. * Gets the position of the camera in world coordinates.
  26096. */
  26097. readonly positionWC: Cartesian3;
  26098. /**
  26099. * Gets the view direction of the camera in world coordinates.
  26100. */
  26101. readonly directionWC: Cartesian3;
  26102. /**
  26103. * Gets the up direction of the camera in world coordinates.
  26104. */
  26105. readonly upWC: Cartesian3;
  26106. /**
  26107. * Gets the right direction of the camera in world coordinates.
  26108. */
  26109. readonly rightWC: Cartesian3;
  26110. /**
  26111. * Gets the camera heading in radians.
  26112. */
  26113. readonly heading: number;
  26114. /**
  26115. * Gets the camera pitch in radians.
  26116. */
  26117. readonly pitch: number;
  26118. /**
  26119. * Gets the camera roll in radians.
  26120. */
  26121. readonly roll: number;
  26122. /**
  26123. * Gets the event that will be raised at when the camera starts to move.
  26124. */
  26125. readonly moveStart: Event;
  26126. /**
  26127. * Gets the event that will be raised when the camera has stopped moving.
  26128. */
  26129. readonly moveEnd: Event;
  26130. /**
  26131. * Gets the event that will be raised when the camera has changed by <code>percentageChanged</code>.
  26132. */
  26133. readonly changed: Event;
  26134. /**
  26135. * Sets the camera position, orientation and transform.
  26136. * @example
  26137. * // 1. Set position with a top-down view
  26138. * viewer.camera.setView({
  26139. * destination : Cesium.Cartesian3.fromDegrees(-117.16, 32.71, 15000.0)
  26140. * });
  26141. *
  26142. * // 2 Set view with heading, pitch and roll
  26143. * viewer.camera.setView({
  26144. * destination : cartesianPosition,
  26145. * orientation: {
  26146. * heading : Cesium.Math.toRadians(90.0), // east, default value is 0.0 (north)
  26147. * pitch : Cesium.Math.toRadians(-90), // default value (looking down)
  26148. * roll : 0.0 // default value
  26149. * }
  26150. * });
  26151. *
  26152. * // 3. Change heading, pitch and roll with the camera position remaining the same.
  26153. * viewer.camera.setView({
  26154. * orientation: {
  26155. * heading : Cesium.Math.toRadians(90.0), // east, default value is 0.0 (north)
  26156. * pitch : Cesium.Math.toRadians(-90), // default value (looking down)
  26157. * roll : 0.0 // default value
  26158. * }
  26159. * });
  26160. *
  26161. *
  26162. * // 4. View rectangle with a top-down view
  26163. * viewer.camera.setView({
  26164. * destination : Cesium.Rectangle.fromDegrees(west, south, east, north)
  26165. * });
  26166. *
  26167. * // 5. Set position with an orientation using unit vectors.
  26168. * viewer.camera.setView({
  26169. * destination : Cesium.Cartesian3.fromDegrees(-122.19, 46.25, 5000.0),
  26170. * orientation : {
  26171. * direction : new Cesium.Cartesian3(-0.04231243104240401, -0.20123236049443421, -0.97862924300734),
  26172. * up : new Cesium.Cartesian3(-0.47934589305293746, -0.8553216253114552, 0.1966022179118339)
  26173. * }
  26174. * });
  26175. * @param options - Object with the following properties:
  26176. * @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.
  26177. * @param [options.orientation] - An object that contains either direction and up properties or heading, pitch and roll properties. By default, the direction will point
  26178. * 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
  26179. * y direction in Columbus view. Orientation is not used in 2D when in infinite scrolling mode.
  26180. * @param [options.endTransform] - Transform matrix representing the reference frame of the camera.
  26181. * @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>.
  26182. */
  26183. setView(options: {
  26184. destination?: Cartesian3 | Rectangle;
  26185. orientation?: HeadingPitchRollValues | DirectionUp;
  26186. endTransform?: Matrix4;
  26187. convert?: boolean;
  26188. }): void;
  26189. /**
  26190. * Fly the camera to the home view. Use {@link Camera#.DEFAULT_VIEW_RECTANGLE} to set
  26191. * the default view for the 3D scene. The home view for 2D and columbus view shows the
  26192. * entire map.
  26193. * @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}
  26194. */
  26195. flyHome(duration?: number): void;
  26196. /**
  26197. * Transform a vector or point from world coordinates to the camera's reference frame.
  26198. * @param cartesian - The vector or point to transform.
  26199. * @param [result] - The object onto which to store the result.
  26200. * @returns The transformed vector or point.
  26201. */
  26202. worldToCameraCoordinates(cartesian: Cartesian4, result?: Cartesian4): Cartesian4;
  26203. /**
  26204. * Transform a point from world coordinates to the camera's reference frame.
  26205. * @param cartesian - The point to transform.
  26206. * @param [result] - The object onto which to store the result.
  26207. * @returns The transformed point.
  26208. */
  26209. worldToCameraCoordinatesPoint(cartesian: Cartesian3, result?: Cartesian3): Cartesian3;
  26210. /**
  26211. * Transform a vector from world coordinates to the camera's reference frame.
  26212. * @param cartesian - The vector to transform.
  26213. * @param [result] - The object onto which to store the result.
  26214. * @returns The transformed vector.
  26215. */
  26216. worldToCameraCoordinatesVector(cartesian: Cartesian3, result?: Cartesian3): Cartesian3;
  26217. /**
  26218. * Transform a vector or point from the camera's reference frame to world coordinates.
  26219. * @param cartesian - The vector or point to transform.
  26220. * @param [result] - The object onto which to store the result.
  26221. * @returns The transformed vector or point.
  26222. */
  26223. cameraToWorldCoordinates(cartesian: Cartesian4, result?: Cartesian4): Cartesian4;
  26224. /**
  26225. * Transform a point from the camera's reference frame to world coordinates.
  26226. * @param cartesian - The point to transform.
  26227. * @param [result] - The object onto which to store the result.
  26228. * @returns The transformed point.
  26229. */
  26230. cameraToWorldCoordinatesPoint(cartesian: Cartesian3, result?: Cartesian3): Cartesian3;
  26231. /**
  26232. * Transform a vector from the camera's reference frame to world coordinates.
  26233. * @param cartesian - The vector to transform.
  26234. * @param [result] - The object onto which to store the result.
  26235. * @returns The transformed vector.
  26236. */
  26237. cameraToWorldCoordinatesVector(cartesian: Cartesian3, result?: Cartesian3): Cartesian3;
  26238. /**
  26239. * Translates the camera's position by <code>amount</code> along <code>direction</code>.
  26240. * @param direction - The direction to move.
  26241. * @param [amount] - The amount, in meters, to move. Defaults to <code>defaultMoveAmount</code>.
  26242. */
  26243. move(direction: Cartesian3, amount?: number): void;
  26244. /**
  26245. * Translates the camera's position by <code>amount</code> along the camera's view vector.
  26246. * When in 2D mode, this will zoom in the camera instead of translating the camera's position.
  26247. * @param [amount] - The amount, in meters, to move. Defaults to <code>defaultMoveAmount</code>.
  26248. */
  26249. moveForward(amount?: number): void;
  26250. /**
  26251. * Translates the camera's position by <code>amount</code> along the opposite direction
  26252. * of the camera's view vector.
  26253. * When in 2D mode, this will zoom out the camera instead of translating the camera's position.
  26254. * @param [amount] - The amount, in meters, to move. Defaults to <code>defaultMoveAmount</code>.
  26255. */
  26256. moveBackward(amount?: number): void;
  26257. /**
  26258. * Translates the camera's position by <code>amount</code> along the camera's up vector.
  26259. * @param [amount] - The amount, in meters, to move. Defaults to <code>defaultMoveAmount</code>.
  26260. */
  26261. moveUp(amount?: number): void;
  26262. /**
  26263. * Translates the camera's position by <code>amount</code> along the opposite direction
  26264. * of the camera's up vector.
  26265. * @param [amount] - The amount, in meters, to move. Defaults to <code>defaultMoveAmount</code>.
  26266. */
  26267. moveDown(amount?: number): void;
  26268. /**
  26269. * Translates the camera's position by <code>amount</code> along the camera's right vector.
  26270. * @param [amount] - The amount, in meters, to move. Defaults to <code>defaultMoveAmount</code>.
  26271. */
  26272. moveRight(amount?: number): void;
  26273. /**
  26274. * Translates the camera's position by <code>amount</code> along the opposite direction
  26275. * of the camera's right vector.
  26276. * @param [amount] - The amount, in meters, to move. Defaults to <code>defaultMoveAmount</code>.
  26277. */
  26278. moveLeft(amount?: number): void;
  26279. /**
  26280. * Rotates the camera around its up vector by amount, in radians, in the opposite direction
  26281. * of its right vector if not in 2D mode.
  26282. * @param [amount] - The amount, in radians, to rotate by. Defaults to <code>defaultLookAmount</code>.
  26283. */
  26284. lookLeft(amount?: number): void;
  26285. /**
  26286. * Rotates the camera around its up vector by amount, in radians, in the direction
  26287. * of its right vector if not in 2D mode.
  26288. * @param [amount] - The amount, in radians, to rotate by. Defaults to <code>defaultLookAmount</code>.
  26289. */
  26290. lookRight(amount?: number): void;
  26291. /**
  26292. * Rotates the camera around its right vector by amount, in radians, in the direction
  26293. * of its up vector if not in 2D mode.
  26294. * @param [amount] - The amount, in radians, to rotate by. Defaults to <code>defaultLookAmount</code>.
  26295. */
  26296. lookUp(amount?: number): void;
  26297. /**
  26298. * Rotates the camera around its right vector by amount, in radians, in the opposite direction
  26299. * of its up vector if not in 2D mode.
  26300. * @param [amount] - The amount, in radians, to rotate by. Defaults to <code>defaultLookAmount</code>.
  26301. */
  26302. lookDown(amount?: number): void;
  26303. /**
  26304. * Rotate each of the camera's orientation vectors around <code>axis</code> by <code>angle</code>
  26305. * @param axis - The axis to rotate around.
  26306. * @param [angle] - The angle, in radians, to rotate by. Defaults to <code>defaultLookAmount</code>.
  26307. */
  26308. look(axis: Cartesian3, angle?: number): void;
  26309. /**
  26310. * Rotate the camera counter-clockwise around its direction vector by amount, in radians.
  26311. * @param [amount] - The amount, in radians, to rotate by. Defaults to <code>defaultLookAmount</code>.
  26312. */
  26313. twistLeft(amount?: number): void;
  26314. /**
  26315. * Rotate the camera clockwise around its direction vector by amount, in radians.
  26316. * @param [amount] - The amount, in radians, to rotate by. Defaults to <code>defaultLookAmount</code>.
  26317. */
  26318. twistRight(amount?: number): void;
  26319. /**
  26320. * Rotates the camera around <code>axis</code> by <code>angle</code>. The distance
  26321. * of the camera's position to the center of the camera's reference frame remains the same.
  26322. * @param axis - The axis to rotate around given in world coordinates.
  26323. * @param [angle] - The angle, in radians, to rotate by. Defaults to <code>defaultRotateAmount</code>.
  26324. */
  26325. rotate(axis: Cartesian3, angle?: number): void;
  26326. /**
  26327. * Rotates the camera around the center of the camera's reference frame by angle downwards.
  26328. * @param [angle] - The angle, in radians, to rotate by. Defaults to <code>defaultRotateAmount</code>.
  26329. */
  26330. rotateDown(angle?: number): void;
  26331. /**
  26332. * Rotates the camera around the center of the camera's reference frame by angle upwards.
  26333. * @param [angle] - The angle, in radians, to rotate by. Defaults to <code>defaultRotateAmount</code>.
  26334. */
  26335. rotateUp(angle?: number): void;
  26336. /**
  26337. * Rotates the camera around the center of the camera's reference frame by angle to the right.
  26338. * @param [angle] - The angle, in radians, to rotate by. Defaults to <code>defaultRotateAmount</code>.
  26339. */
  26340. rotateRight(angle?: number): void;
  26341. /**
  26342. * Rotates the camera around the center of the camera's reference frame by angle to the left.
  26343. * @param [angle] - The angle, in radians, to rotate by. Defaults to <code>defaultRotateAmount</code>.
  26344. */
  26345. rotateLeft(angle?: number): void;
  26346. /**
  26347. * Zooms <code>amount</code> along the camera's view vector.
  26348. * @param [amount] - The amount to move. Defaults to <code>defaultZoomAmount</code>.
  26349. */
  26350. zoomIn(amount?: number): void;
  26351. /**
  26352. * Zooms <code>amount</code> along the opposite direction of
  26353. * the camera's view vector.
  26354. * @param [amount] - The amount to move. Defaults to <code>defaultZoomAmount</code>.
  26355. */
  26356. zoomOut(amount?: number): void;
  26357. /**
  26358. * Gets the magnitude of the camera position. In 3D, this is the vector magnitude. In 2D and
  26359. * Columbus view, this is the distance to the map.
  26360. * @returns The magnitude of the position.
  26361. */
  26362. getMagnitude(): number;
  26363. /**
  26364. * Sets the camera position and orientation using a target and offset. The target must be given in
  26365. * 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.
  26366. * 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
  26367. * is heading/pitch/range, then the heading and the pitch angles are defined in the reference frame defined by the transformation matrix.
  26368. * The heading is the angle from y axis and increasing towards the x axis. Pitch is the rotation from the xy-plane. Positive pitch
  26369. * angles are below the plane. Negative pitch angles are above the plane. The range is the distance from the center.
  26370. *
  26371. * In 2D, there must be a top down view. The camera will be placed above the target looking down. The height above the
  26372. * target will be the magnitude of the offset. The heading will be determined from the offset. If the heading cannot be
  26373. * determined from the offset, the heading will be north.
  26374. * @example
  26375. * // 1. Using a cartesian offset
  26376. * const center = Cesium.Cartesian3.fromDegrees(-98.0, 40.0);
  26377. * viewer.camera.lookAt(center, new Cesium.Cartesian3(0.0, -4790000.0, 3930000.0));
  26378. *
  26379. * // 2. Using a HeadingPitchRange offset
  26380. * const center = Cesium.Cartesian3.fromDegrees(-72.0, 40.0);
  26381. * const heading = Cesium.Math.toRadians(50.0);
  26382. * const pitch = Cesium.Math.toRadians(-20.0);
  26383. * const range = 5000.0;
  26384. * viewer.camera.lookAt(center, new Cesium.HeadingPitchRange(heading, pitch, range));
  26385. * @param target - The target position in world coordinates.
  26386. * @param offset - The offset from the target in the local east-north-up reference frame centered at the target.
  26387. */
  26388. lookAt(target: Cartesian3, offset: Cartesian3 | HeadingPitchRange): void;
  26389. /**
  26390. * Sets the camera position and orientation using a target and transformation matrix. The offset can be either a cartesian or heading/pitch/range.
  26391. * 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
  26392. * is heading/pitch/range, then the heading and the pitch angles are defined in the reference frame defined by the transformation matrix.
  26393. * The heading is the angle from y axis and increasing towards the x axis. Pitch is the rotation from the xy-plane. Positive pitch
  26394. * angles are below the plane. Negative pitch angles are above the plane. The range is the distance from the center.
  26395. *
  26396. * 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
  26397. * target will be the magnitude of the offset. The heading will be determined from the offset. If the heading cannot be
  26398. * determined from the offset, the heading will be north.
  26399. * @example
  26400. * // 1. Using a cartesian offset
  26401. * const transform = Cesium.Transforms.eastNorthUpToFixedFrame(Cesium.Cartesian3.fromDegrees(-98.0, 40.0));
  26402. * viewer.camera.lookAtTransform(transform, new Cesium.Cartesian3(0.0, -4790000.0, 3930000.0));
  26403. *
  26404. * // 2. Using a HeadingPitchRange offset
  26405. * const transform = Cesium.Transforms.eastNorthUpToFixedFrame(Cesium.Cartesian3.fromDegrees(-72.0, 40.0));
  26406. * const heading = Cesium.Math.toRadians(50.0);
  26407. * const pitch = Cesium.Math.toRadians(-20.0);
  26408. * const range = 5000.0;
  26409. * viewer.camera.lookAtTransform(transform, new Cesium.HeadingPitchRange(heading, pitch, range));
  26410. * @param transform - The transformation matrix defining the reference frame.
  26411. * @param [offset] - The offset from the target in a reference frame centered at the target.
  26412. */
  26413. lookAtTransform(transform: Matrix4, offset?: Cartesian3 | HeadingPitchRange): void;
  26414. /**
  26415. * Get the camera position needed to view a rectangle on an ellipsoid or map
  26416. * @param rectangle - The rectangle to view.
  26417. * @param [result] - The camera position needed to view the rectangle
  26418. * @returns The camera position needed to view the rectangle
  26419. */
  26420. getRectangleCameraCoordinates(rectangle: Rectangle, result?: Cartesian3): Cartesian3;
  26421. /**
  26422. * Pick an ellipsoid or map.
  26423. * @example
  26424. * const canvas = viewer.scene.canvas;
  26425. * const center = new Cesium.Cartesian2(canvas.clientWidth / 2.0, canvas.clientHeight / 2.0);
  26426. * const ellipsoid = viewer.scene.globe.ellipsoid;
  26427. * const result = viewer.camera.pickEllipsoid(center, ellipsoid);
  26428. * @param windowPosition - The x and y coordinates of a pixel.
  26429. * @param [ellipsoid = Ellipsoid.WGS84] - The ellipsoid to pick.
  26430. * @param [result] - The object onto which to store the result.
  26431. * @returns If the ellipsoid or map was picked,
  26432. * returns the point on the surface of the ellipsoid or map in world
  26433. * coordinates. If the ellipsoid or map was not picked, returns undefined.
  26434. */
  26435. pickEllipsoid(windowPosition: Cartesian2, ellipsoid?: Ellipsoid, result?: Cartesian3): Cartesian3 | undefined;
  26436. /**
  26437. * Create a ray from the camera position through the pixel at <code>windowPosition</code>
  26438. * in world coordinates.
  26439. * @param windowPosition - The x and y coordinates of a pixel.
  26440. * @param [result] - The object onto which to store the result.
  26441. * @returns Returns the {@link Cartesian3} position and direction of the ray, or undefined if the pick ray cannot be determined.
  26442. */
  26443. getPickRay(windowPosition: Cartesian2, result?: Ray): Ray | undefined;
  26444. /**
  26445. * Return the distance from the camera to the front of the bounding sphere.
  26446. * @param boundingSphere - The bounding sphere in world coordinates.
  26447. * @returns The distance to the bounding sphere.
  26448. */
  26449. distanceToBoundingSphere(boundingSphere: BoundingSphere): number;
  26450. /**
  26451. * Return the pixel size in meters.
  26452. * @param boundingSphere - The bounding sphere in world coordinates.
  26453. * @param drawingBufferWidth - The drawing buffer width.
  26454. * @param drawingBufferHeight - The drawing buffer height.
  26455. * @returns The pixel size in meters.
  26456. */
  26457. getPixelSize(boundingSphere: BoundingSphere, drawingBufferWidth: number, drawingBufferHeight: number): number;
  26458. /**
  26459. * Cancels the current camera flight and leaves the camera at its current location.
  26460. * If no flight is in progress, this this function does nothing.
  26461. */
  26462. cancelFlight(): void;
  26463. /**
  26464. * Completes the current camera flight and moves the camera immediately to its final destination.
  26465. * If no flight is in progress, this this function does nothing.
  26466. */
  26467. completeFlight(): void;
  26468. /**
  26469. * Flies the camera from its current position to a new position.
  26470. * @example
  26471. * // 1. Fly to a position with a top-down view
  26472. * viewer.camera.flyTo({
  26473. * destination : Cesium.Cartesian3.fromDegrees(-117.16, 32.71, 15000.0)
  26474. * });
  26475. *
  26476. * // 2. Fly to a Rectangle with a top-down view
  26477. * viewer.camera.flyTo({
  26478. * destination : Cesium.Rectangle.fromDegrees(west, south, east, north)
  26479. * });
  26480. *
  26481. * // 3. Fly to a position with an orientation using unit vectors.
  26482. * viewer.camera.flyTo({
  26483. * destination : Cesium.Cartesian3.fromDegrees(-122.19, 46.25, 5000.0),
  26484. * orientation : {
  26485. * direction : new Cesium.Cartesian3(-0.04231243104240401, -0.20123236049443421, -0.97862924300734),
  26486. * up : new Cesium.Cartesian3(-0.47934589305293746, -0.8553216253114552, 0.1966022179118339)
  26487. * }
  26488. * });
  26489. *
  26490. * // 4. Fly to a position with an orientation using heading, pitch and roll.
  26491. * viewer.camera.flyTo({
  26492. * destination : Cesium.Cartesian3.fromDegrees(-122.19, 46.25, 5000.0),
  26493. * orientation : {
  26494. * heading : Cesium.Math.toRadians(175.0),
  26495. * pitch : Cesium.Math.toRadians(-35.0),
  26496. * roll : 0.0
  26497. * }
  26498. * });
  26499. * @param options - Object with the following properties:
  26500. * @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.
  26501. * @param [options.orientation] - An object that contains either direction and up properties or heading, pitch and roll properties. By default, the direction will point
  26502. * 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
  26503. * y direction in Columbus view. Orientation is not used in 2D when in infinite scrolling mode.
  26504. * @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.
  26505. * @param [options.complete] - The function to execute when the flight is complete.
  26506. * @param [options.cancel] - The function to execute if the flight is cancelled.
  26507. * @param [options.endTransform] - Transform matrix representing the reference frame the camera will be in when the flight is completed.
  26508. * @param [options.maximumHeight] - The maximum height at the peak of the flight.
  26509. * @param [options.pitchAdjustHeight] - If camera flyes higher than that value, adjust pitch duiring the flight to look down, and keep Earth in viewport.
  26510. * @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.
  26511. * @param [options.flyOverLongitudeWeight] - Fly over the lon specifyed via flyOverLongitude only if that way is not longer than short way times flyOverLongitudeWeight.
  26512. * @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>.
  26513. * @param [options.easingFunction] - Controls how the time is interpolated over the duration of the flight.
  26514. */
  26515. flyTo(options: {
  26516. destination: Cartesian3 | Rectangle;
  26517. orientation?: any;
  26518. duration?: number;
  26519. complete?: Camera.FlightCompleteCallback;
  26520. cancel?: Camera.FlightCancelledCallback;
  26521. endTransform?: Matrix4;
  26522. maximumHeight?: number;
  26523. pitchAdjustHeight?: number;
  26524. flyOverLongitude?: number;
  26525. flyOverLongitudeWeight?: number;
  26526. convert?: boolean;
  26527. easingFunction?: EasingFunction.Callback;
  26528. }): void;
  26529. /**
  26530. * Sets the camera so that the current view contains the provided bounding sphere.
  26531. *
  26532. * <p>The offset is heading/pitch/range in the local east-north-up reference frame centered at the center of the bounding sphere.
  26533. * The heading and the pitch angles are defined in the local east-north-up reference frame.
  26534. * The heading is the angle from y axis and increasing towards the x axis. Pitch is the rotation from the xy-plane. Positive pitch
  26535. * angles are below the plane. Negative pitch angles are above the plane. The range is the distance from the center. If the range is
  26536. * zero, a range will be computed such that the whole bounding sphere is visible.</p>
  26537. *
  26538. * <p>In 2D, there must be a top down view. The camera will be placed above the target looking down. The height above the
  26539. * target will be the range. The heading will be determined from the offset. If the heading cannot be
  26540. * determined from the offset, the heading will be north.</p>
  26541. * @param boundingSphere - The bounding sphere to view, in world coordinates.
  26542. * @param [offset] - The offset from the target in the local east-north-up reference frame centered at the target.
  26543. */
  26544. viewBoundingSphere(boundingSphere: BoundingSphere, offset?: HeadingPitchRange): void;
  26545. /**
  26546. * Flies the camera to a location where the current view contains the provided bounding sphere.
  26547. *
  26548. * <p> The offset is heading/pitch/range in the local east-north-up reference frame centered at the center of the bounding sphere.
  26549. * The heading and the pitch angles are defined in the local east-north-up reference frame.
  26550. * The heading is the angle from y axis and increasing towards the x axis. Pitch is the rotation from the xy-plane. Positive pitch
  26551. * angles are below the plane. Negative pitch angles are above the plane. The range is the distance from the center. If the range is
  26552. * zero, a range will be computed such that the whole bounding sphere is visible.</p>
  26553. *
  26554. * <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
  26555. * target will be the range. The heading will be aligned to local north.</p>
  26556. * @param boundingSphere - The bounding sphere to view, in world coordinates.
  26557. * @param [options] - Object with the following properties:
  26558. * @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.
  26559. * @param [options.offset] - The offset from the target in the local east-north-up reference frame centered at the target.
  26560. * @param [options.complete] - The function to execute when the flight is complete.
  26561. * @param [options.cancel] - The function to execute if the flight is cancelled.
  26562. * @param [options.endTransform] - Transform matrix representing the reference frame the camera will be in when the flight is completed.
  26563. * @param [options.maximumHeight] - The maximum height at the peak of the flight.
  26564. * @param [options.pitchAdjustHeight] - If camera flyes higher than that value, adjust pitch duiring the flight to look down, and keep Earth in viewport.
  26565. * @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.
  26566. * @param [options.flyOverLongitudeWeight] - Fly over the lon specifyed via flyOverLongitude only if that way is not longer than short way times flyOverLongitudeWeight.
  26567. * @param [options.easingFunction] - Controls how the time is interpolated over the duration of the flight.
  26568. */
  26569. flyToBoundingSphere(boundingSphere: BoundingSphere, options?: {
  26570. duration?: number;
  26571. offset?: HeadingPitchRange;
  26572. complete?: Camera.FlightCompleteCallback;
  26573. cancel?: Camera.FlightCancelledCallback;
  26574. endTransform?: Matrix4;
  26575. maximumHeight?: number;
  26576. pitchAdjustHeight?: number;
  26577. flyOverLongitude?: number;
  26578. flyOverLongitudeWeight?: number;
  26579. easingFunction?: EasingFunction.Callback;
  26580. }): void;
  26581. /**
  26582. * Computes the approximate visible rectangle on the ellipsoid.
  26583. * @param [ellipsoid = Ellipsoid.WGS84] - The ellipsoid that you want to know the visible region.
  26584. * @param [result] - The rectangle in which to store the result
  26585. * @returns The visible rectangle or undefined if the ellipsoid isn't visible at all.
  26586. */
  26587. computeViewRectangle(ellipsoid?: Ellipsoid, result?: Rectangle): Rectangle | undefined;
  26588. /**
  26589. * Switches the frustum/projection to perspective.
  26590. *
  26591. * This function is a no-op in 2D which must always be orthographic.
  26592. */
  26593. switchToPerspectiveFrustum(): void;
  26594. /**
  26595. * Switches the frustum/projection to orthographic.
  26596. *
  26597. * This function is a no-op in 2D which will always be orthographic.
  26598. */
  26599. switchToOrthographicFrustum(): void;
  26600. }
  26601. export namespace Camera {
  26602. /**
  26603. * A function that will execute when a flight completes.
  26604. */
  26605. type FlightCompleteCallback = () => void;
  26606. /**
  26607. * A function that will execute when a flight is cancelled.
  26608. */
  26609. type FlightCancelledCallback = () => void;
  26610. }
  26611. /**
  26612. * Aggregates input events. For example, suppose the following inputs are received between frames:
  26613. * left mouse button down, mouse move, mouse move, left mouse button up. These events will be aggregated into
  26614. * one event with a start and end position of the mouse.
  26615. * @param [canvas = document] - The element to handle events for.
  26616. */
  26617. export class CameraEventAggregator {
  26618. constructor(canvas?: HTMLCanvasElement);
  26619. /**
  26620. * Gets the current mouse position.
  26621. */
  26622. currentMousePosition: Cartesian2;
  26623. /**
  26624. * Gets whether any mouse button is down, a touch has started, or the wheel has been moved.
  26625. */
  26626. anyButtonDown: boolean;
  26627. /**
  26628. * Gets if a mouse button down or touch has started and has been moved.
  26629. * @param type - The camera event type.
  26630. * @param [modifier] - The keyboard modifier.
  26631. * @returns Returns <code>true</code> if a mouse button down or touch has started and has been moved; otherwise, <code>false</code>
  26632. */
  26633. isMoving(type: CameraEventType, modifier?: KeyboardEventModifier): boolean;
  26634. /**
  26635. * Gets the aggregated start and end position of the current event.
  26636. * @param type - The camera event type.
  26637. * @param [modifier] - The keyboard modifier.
  26638. * @returns An object with two {@link Cartesian2} properties: <code>startPosition</code> and <code>endPosition</code>.
  26639. */
  26640. getMovement(type: CameraEventType, modifier?: KeyboardEventModifier): any;
  26641. /**
  26642. * Gets the start and end position of the last move event (not the aggregated event).
  26643. * @param type - The camera event type.
  26644. * @param [modifier] - The keyboard modifier.
  26645. * @returns An object with two {@link Cartesian2} properties: <code>startPosition</code> and <code>endPosition</code> or <code>undefined</code>.
  26646. */
  26647. getLastMovement(type: CameraEventType, modifier?: KeyboardEventModifier): any | undefined;
  26648. /**
  26649. * Gets whether the mouse button is down or a touch has started.
  26650. * @param type - The camera event type.
  26651. * @param [modifier] - The keyboard modifier.
  26652. * @returns Whether the mouse button is down or a touch has started.
  26653. */
  26654. isButtonDown(type: CameraEventType, modifier?: KeyboardEventModifier): boolean;
  26655. /**
  26656. * Gets the mouse position that started the aggregation.
  26657. * @param type - The camera event type.
  26658. * @param [modifier] - The keyboard modifier.
  26659. * @returns The mouse position.
  26660. */
  26661. getStartMousePosition(type: CameraEventType, modifier?: KeyboardEventModifier): Cartesian2;
  26662. /**
  26663. * Gets the time the button was pressed or the touch was started.
  26664. * @param type - The camera event type.
  26665. * @param [modifier] - The keyboard modifier.
  26666. * @returns The time the button was pressed or the touch was started.
  26667. */
  26668. getButtonPressTime(type: CameraEventType, modifier?: KeyboardEventModifier): Date;
  26669. /**
  26670. * Gets the time the button was released or the touch was ended.
  26671. * @param type - The camera event type.
  26672. * @param [modifier] - The keyboard modifier.
  26673. * @returns The time the button was released or the touch was ended.
  26674. */
  26675. getButtonReleaseTime(type: CameraEventType, modifier?: KeyboardEventModifier): Date;
  26676. /**
  26677. * Signals that all of the events have been handled and the aggregator should be reset to handle new events.
  26678. */
  26679. reset(): void;
  26680. /**
  26681. * Returns true if this object was destroyed; otherwise, false.
  26682. * <br /><br />
  26683. * If this object was destroyed, it should not be used; calling any function other than
  26684. * <code>isDestroyed</code> will result in a {@link DeveloperError} exception.
  26685. * @returns <code>true</code> if this object was destroyed; otherwise, <code>false</code>.
  26686. */
  26687. isDestroyed(): boolean;
  26688. /**
  26689. * Removes mouse listeners held by this object.
  26690. * <br /><br />
  26691. * Once an object is destroyed, it should not be used; calling any function other than
  26692. * <code>isDestroyed</code> will result in a {@link DeveloperError} exception. Therefore,
  26693. * assign the return value (<code>undefined</code>) to the object as done in the example.
  26694. * @example
  26695. * handler = handler && handler.destroy();
  26696. */
  26697. destroy(): void;
  26698. }
  26699. /**
  26700. * Enumerates the available input for interacting with the camera.
  26701. */
  26702. export enum CameraEventType {
  26703. /**
  26704. * A left mouse button press followed by moving the mouse and releasing the button.
  26705. */
  26706. LEFT_DRAG = 0,
  26707. /**
  26708. * A right mouse button press followed by moving the mouse and releasing the button.
  26709. */
  26710. RIGHT_DRAG = 1,
  26711. /**
  26712. * A middle mouse button press followed by moving the mouse and releasing the button.
  26713. */
  26714. MIDDLE_DRAG = 2,
  26715. /**
  26716. * Scrolling the middle mouse button.
  26717. */
  26718. WHEEL = 3,
  26719. /**
  26720. * A two-finger touch on a touch surface.
  26721. */
  26722. PINCH = 4
  26723. }
  26724. /**
  26725. * A tile in a {@link Cesium3DTileset}. When a tile is first created, its content is not loaded;
  26726. * the content is loaded on-demand when needed based on the view.
  26727. * <p>
  26728. * Do not construct this directly, instead access tiles through {@link Cesium3DTileset#tileVisible}.
  26729. * </p>
  26730. */
  26731. export class Cesium3DTile {
  26732. constructor();
  26733. /**
  26734. * The local transform of this tile.
  26735. */
  26736. transform: Matrix4;
  26737. /**
  26738. * The final computed transform of this tile.
  26739. */
  26740. readonly computedTransform: Matrix4;
  26741. /**
  26742. * The error, in meters, introduced if this tile is rendered and its children are not.
  26743. * This is used to compute screen space error, i.e., the error measured in pixels.
  26744. */
  26745. readonly geometricError: number;
  26746. /**
  26747. * Gets the tile's children.
  26748. */
  26749. readonly children: Cesium3DTile[];
  26750. /**
  26751. * This tile's parent or <code>undefined</code> if this tile is the root.
  26752. * <p>
  26753. * When a tile's content points to an external tileset JSON file, the external tileset's
  26754. * root tile's parent is not <code>undefined</code>; instead, the parent references
  26755. * the tile (with its content pointing to an external tileset JSON file) as if the two tilesets were merged.
  26756. * </p>
  26757. */
  26758. readonly parent: Cesium3DTile;
  26759. /**
  26760. * The time in seconds after the tile's content is ready when the content expires and new content is requested.
  26761. */
  26762. expireDuration: number;
  26763. /**
  26764. * The date when the content expires and new content is requested.
  26765. */
  26766. expireDate: JulianDate;
  26767. /**
  26768. * The tileset containing this tile.
  26769. */
  26770. readonly tileset: Cesium3DTileset;
  26771. /**
  26772. * The tile's content. This represents the actual tile's payload,
  26773. * not the content's metadata in the tileset JSON file.
  26774. */
  26775. readonly content: Cesium3DTileContent;
  26776. /**
  26777. * Get the bounding sphere derived from the tile's bounding volume.
  26778. */
  26779. readonly boundingSphere: BoundingSphere;
  26780. /**
  26781. * Returns the <code>extras</code> property in the tileset JSON for this tile, which contains application specific metadata.
  26782. * Returns <code>undefined</code> if <code>extras</code> does not exist.
  26783. */
  26784. readonly extras: any;
  26785. }
  26786. /**
  26787. * Defines how per-feature colors set from the Cesium API or declarative styling blend with the source colors from
  26788. * the original feature, e.g. glTF material or per-point color in the tile.
  26789. * <p>
  26790. * When <code>REPLACE</code> or <code>MIX</code> are used and the source color is a glTF material, the technique must assign the
  26791. * <code>_3DTILESDIFFUSE</code> semantic to the diffuse color parameter. Otherwise only <code>HIGHLIGHT</code> is supported.
  26792. * </p>
  26793. * <p>
  26794. * A feature whose color evaluates to white (1.0, 1.0, 1.0) is always rendered without color blending, regardless of the
  26795. * tileset's color blend mode.
  26796. * </p>
  26797. * <pre><code>
  26798. * "techniques": {
  26799. * "technique0": {
  26800. * "parameters": {
  26801. * "diffuse": {
  26802. * "semantic": "_3DTILESDIFFUSE",
  26803. * "type": 35666
  26804. * }
  26805. * }
  26806. * }
  26807. * }
  26808. * </code></pre>
  26809. */
  26810. export enum Cesium3DTileColorBlendMode {
  26811. /**
  26812. * Multiplies the source color by the feature color.
  26813. */
  26814. HIGHLIGHT = 0,
  26815. /**
  26816. * Replaces the source color with the feature color.
  26817. */
  26818. REPLACE = 1,
  26819. /**
  26820. * Blends the source color and feature color together.
  26821. */
  26822. MIX = 2
  26823. }
  26824. /**
  26825. * The content of a tile in a {@link Cesium3DTileset}.
  26826. * <p>
  26827. * Derived classes of this interface provide access to individual features in the tile.
  26828. * Access derived objects through {@link Cesium3DTile#content}.
  26829. * </p>
  26830. * <p>
  26831. * This type describes an interface and is not intended to be instantiated directly.
  26832. * </p>
  26833. */
  26834. export class Cesium3DTileContent {
  26835. constructor();
  26836. /**
  26837. * Gets the number of features in the tile.
  26838. */
  26839. readonly featuresLength: number;
  26840. /**
  26841. * Gets the number of points in the tile.
  26842. * <p>
  26843. * Only applicable for tiles with Point Cloud content. This is different than {@link Cesium3DTileContent#featuresLength} which
  26844. * equals the number of groups of points as distinguished by the <code>BATCH_ID</code> feature table semantic.
  26845. * </p>
  26846. */
  26847. readonly pointsLength: number;
  26848. /**
  26849. * Gets the number of triangles in the tile.
  26850. */
  26851. readonly trianglesLength: number;
  26852. /**
  26853. * Gets the tile's geometry memory in bytes.
  26854. */
  26855. readonly geometryByteLength: number;
  26856. /**
  26857. * Gets the tile's texture memory in bytes.
  26858. */
  26859. readonly texturesByteLength: number;
  26860. /**
  26861. * Gets the amount of memory used by the batch table textures, in bytes.
  26862. */
  26863. readonly batchTableByteLength: number;
  26864. /**
  26865. * 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.
  26866. */
  26867. readonly innerContents: any[];
  26868. /**
  26869. * Gets the promise that will be resolved when the tile's content is ready to render.
  26870. */
  26871. readonly readyPromise: Promise<Cesium3DTileContent>;
  26872. /**
  26873. * Gets the tileset for this tile.
  26874. */
  26875. readonly tileset: Cesium3DTileset;
  26876. /**
  26877. * Gets the tile containing this content.
  26878. */
  26879. readonly tile: Cesium3DTile;
  26880. /**
  26881. * Gets the url of the tile's content.
  26882. */
  26883. readonly url: string;
  26884. /**
  26885. * Returns whether the feature has this property.
  26886. * @param batchId - The batchId for the feature.
  26887. * @param name - The case-sensitive name of the property.
  26888. * @returns <code>true</code> if the feature has this property; otherwise, <code>false</code>.
  26889. */
  26890. hasProperty(batchId: number, name: string): boolean;
  26891. /**
  26892. * Returns the {@link Cesium3DTileFeature} object for the feature with the
  26893. * given <code>batchId</code>. This object is used to get and modify the
  26894. * feature's properties.
  26895. * <p>
  26896. * Features in a tile are ordered by <code>batchId</code>, an index used to retrieve their metadata from the batch table.
  26897. * </p>
  26898. * @param batchId - The batchId for the feature.
  26899. * @returns The corresponding {@link Cesium3DTileFeature} object.
  26900. */
  26901. getFeature(batchId: number): Cesium3DTileFeature;
  26902. }
  26903. /**
  26904. * A feature of a {@link Cesium3DTileset}.
  26905. * <p>
  26906. * Provides access to a feature's properties stored in the tile's batch table, as well
  26907. * as the ability to show/hide a feature and change its highlight color via
  26908. * {@link Cesium3DTileFeature#show} and {@link Cesium3DTileFeature#color}, respectively.
  26909. * </p>
  26910. * <p>
  26911. * Modifications to a <code>Cesium3DTileFeature</code> object have the lifetime of the tile's
  26912. * content. If the tile's content is unloaded, e.g., due to it going out of view and needing
  26913. * to free space in the cache for visible tiles, listen to the {@link Cesium3DTileset#tileUnload} event to save any
  26914. * modifications. Also listen to the {@link Cesium3DTileset#tileVisible} event to reapply any modifications.
  26915. * </p>
  26916. * <p>
  26917. * Do not construct this directly. Access it through {@link Cesium3DTileContent#getFeature}
  26918. * or picking using {@link Scene#pick}.
  26919. * </p>
  26920. * @example
  26921. * // On mouse over, display all the properties for a feature in the console log.
  26922. * handler.setInputAction(function(movement) {
  26923. * const feature = scene.pick(movement.endPosition);
  26924. * if (feature instanceof Cesium.Cesium3DTileFeature) {
  26925. * const propertyNames = feature.getPropertyNames();
  26926. * const length = propertyNames.length;
  26927. * for (let i = 0; i < length; ++i) {
  26928. * const propertyName = propertyNames[i];
  26929. * console.log(propertyName + ': ' + feature.getProperty(propertyName));
  26930. * }
  26931. * }
  26932. * }, Cesium.ScreenSpaceEventType.MOUSE_MOVE);
  26933. */
  26934. export class Cesium3DTileFeature {
  26935. constructor();
  26936. /**
  26937. * Gets or sets if the feature will be shown. This is set for all features
  26938. * when a style's show is evaluated.
  26939. */
  26940. show: boolean;
  26941. /**
  26942. * Gets or sets the highlight color multiplied with the feature's color. When
  26943. * this is white, the feature's color is not changed. This is set for all features
  26944. * when a style's color is evaluated.
  26945. */
  26946. color: Color;
  26947. /**
  26948. * Gets a typed array containing the ECEF positions of the polyline.
  26949. * Returns undefined if {@link Cesium3DTileset#vectorKeepDecodedPositions} is false
  26950. * or the feature is not a polyline in a vector tile.
  26951. */
  26952. polylinePositions: Float64Array;
  26953. /**
  26954. * Gets the tileset containing the feature.
  26955. */
  26956. readonly tileset: Cesium3DTileset;
  26957. /**
  26958. * All objects returned by {@link Scene#pick} have a <code>primitive</code> property. This returns
  26959. * the tileset containing the feature.
  26960. */
  26961. readonly primitive: Cesium3DTileset;
  26962. /**
  26963. * Get the feature ID associated with this feature. For 3D Tiles 1.0, the
  26964. * batch ID is returned. For EXT_mesh_features, this is the feature ID from
  26965. * the selected feature ID set.
  26966. */
  26967. readonly featureId: number;
  26968. /**
  26969. * Returns whether the feature contains this property. This includes properties from this feature's
  26970. * class and inherited classes when using a batch table hierarchy.
  26971. * @param name - The case-sensitive name of the property.
  26972. * @returns Whether the feature contains this property.
  26973. */
  26974. hasProperty(name: string): boolean;
  26975. /**
  26976. * Returns an array of property names for the feature. This includes properties from this feature's
  26977. * class and inherited classes when using a batch table hierarchy.
  26978. * @param [results] - An array into which to store the results.
  26979. * @returns The names of the feature's properties.
  26980. */
  26981. getPropertyNames(results?: string[]): string[];
  26982. /**
  26983. * Returns a copy of the value of the feature's property with the given name. This includes properties from this feature's
  26984. * class and inherited classes when using a batch table hierarchy.
  26985. * @example
  26986. * // Display all the properties for a feature in the console log.
  26987. * const propertyNames = feature.getPropertyNames();
  26988. * const length = propertyNames.length;
  26989. * for (let i = 0; i < length; ++i) {
  26990. * const propertyName = propertyNames[i];
  26991. * console.log(propertyName + ': ' + feature.getProperty(propertyName));
  26992. * }
  26993. * @param name - The case-sensitive name of the property.
  26994. * @returns The value of the property or <code>undefined</code> if the feature does not have this property.
  26995. */
  26996. getProperty(name: string): any;
  26997. /**
  26998. * Returns a copy of the feature's property with the given name, examining all
  26999. * the metadata from 3D Tiles 1.0 formats, the EXT_structural_metadata and legacy
  27000. * EXT_feature_metadata glTF extensions, and the metadata present either in the
  27001. * tileset JSON (3D Tiles 1.1) or in the 3DTILES_metadata 3D Tiles extension.
  27002. * Metadata is checked against name from most specific to most general and the
  27003. * first match is returned. Metadata is checked in this order:
  27004. *
  27005. * <ol>
  27006. * <li>Batch table (structural metadata) property by semantic</li>
  27007. * <li>Batch table (structural metadata) property by property ID</li>
  27008. * <li>Content metadata property by semantic</li>
  27009. * <li>Content metadata property by property</li>
  27010. * <li>Tile metadata property by semantic</li>
  27011. * <li>Tile metadata property by property ID</li>
  27012. * <li>Subtree metadata property by semantic</li>
  27013. * <li>Subtree metadata property by property ID</li>
  27014. * <li>Group metadata property by semantic</li>
  27015. * <li>Group metadata property by property ID</li>
  27016. * <li>Tileset metadata property by semantic</li>
  27017. * <li>Tileset metadata property by property ID</li>
  27018. * <li>Otherwise, return undefined</li>
  27019. * </ol>
  27020. * <p>
  27021. * For 3D Tiles Next details, see the {@link https://github.com/CesiumGS/3d-tiles/tree/main/extensions/3DTILES_metadata|3DTILES_metadata Extension}
  27022. * 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}
  27023. * 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}
  27024. * </p>
  27025. * @param content - The content for accessing the metadata
  27026. * @param batchId - The batch ID (or feature ID) of the feature to get a property for
  27027. * @param name - The semantic or property ID of the feature. Semantics are checked before property IDs in each granularity of metadata.
  27028. * @returns The value of the property or <code>undefined</code> if the feature does not have this property.
  27029. */
  27030. static getPropertyInherited(content: Cesium3DTileContent, batchId: number, name: string): any;
  27031. /**
  27032. * Sets the value of the feature's property with the given name.
  27033. * <p>
  27034. * If a property with the given name doesn't exist, it is created.
  27035. * </p>
  27036. * @example
  27037. * const height = feature.getProperty('Height'); // e.g., the height of a building
  27038. * @example
  27039. * const name = 'clicked';
  27040. * if (feature.getProperty(name)) {
  27041. * console.log('already clicked');
  27042. * } else {
  27043. * feature.setProperty(name, true);
  27044. * console.log('first click');
  27045. * }
  27046. * @param name - The case-sensitive name of the property.
  27047. * @param value - The value of the property that will be copied.
  27048. */
  27049. setProperty(name: string, value: any): void;
  27050. }
  27051. /**
  27052. * A point feature of a {@link Cesium3DTileset}.
  27053. * <p>
  27054. * Provides access to a feature's properties stored in the tile's batch table, as well
  27055. * as the ability to show/hide a feature and change its point properties
  27056. * </p>
  27057. * <p>
  27058. * Modifications to a <code>Cesium3DTilePointFeature</code> object have the lifetime of the tile's
  27059. * content. If the tile's content is unloaded, e.g., due to it going out of view and needing
  27060. * to free space in the cache for visible tiles, listen to the {@link Cesium3DTileset#tileUnload} event to save any
  27061. * modifications. Also listen to the {@link Cesium3DTileset#tileVisible} event to reapply any modifications.
  27062. * </p>
  27063. * <p>
  27064. * Do not construct this directly. Access it through {@link Cesium3DTileContent#getFeature}
  27065. * or picking using {@link Scene#pick} and {@link Scene#pickPosition}.
  27066. * </p>
  27067. * @example
  27068. * // On mouse over, display all the properties for a feature in the console log.
  27069. * handler.setInputAction(function(movement) {
  27070. * const feature = scene.pick(movement.endPosition);
  27071. * if (feature instanceof Cesium.Cesium3DTilePointFeature) {
  27072. * const propertyNames = feature.getPropertyNames();
  27073. * const length = propertyNames.length;
  27074. * for (let i = 0; i < length; ++i) {
  27075. * const propertyName = propertyNames[i];
  27076. * console.log(propertyName + ': ' + feature.getProperty(propertyName));
  27077. * }
  27078. * }
  27079. * }, Cesium.ScreenSpaceEventType.MOUSE_MOVE);
  27080. */
  27081. export class Cesium3DTilePointFeature {
  27082. constructor();
  27083. /**
  27084. * Gets or sets if the feature will be shown. This is set for all features
  27085. * when a style's show is evaluated.
  27086. */
  27087. show: boolean;
  27088. /**
  27089. * Gets or sets the color of the point of this feature.
  27090. * <p>
  27091. * Only applied when <code>image</code> is <code>undefined</code>.
  27092. * </p>
  27093. */
  27094. color: Color;
  27095. /**
  27096. * Gets or sets the point size of this feature.
  27097. * <p>
  27098. * Only applied when <code>image</code> is <code>undefined</code>.
  27099. * </p>
  27100. */
  27101. pointSize: number;
  27102. /**
  27103. * Gets or sets the point outline color of this feature.
  27104. * <p>
  27105. * Only applied when <code>image</code> is <code>undefined</code>.
  27106. * </p>
  27107. */
  27108. pointOutlineColor: Color;
  27109. /**
  27110. * Gets or sets the point outline width in pixels of this feature.
  27111. * <p>
  27112. * Only applied when <code>image</code> is <code>undefined</code>.
  27113. * </p>
  27114. */
  27115. pointOutlineWidth: number;
  27116. /**
  27117. * Gets or sets the label color of this feature.
  27118. * <p>
  27119. * The color will be applied to the label if <code>labelText</code> is defined.
  27120. * </p>
  27121. */
  27122. labelColor: Color;
  27123. /**
  27124. * Gets or sets the label outline color of this feature.
  27125. * <p>
  27126. * The outline color will be applied to the label if <code>labelText</code> is defined.
  27127. * </p>
  27128. */
  27129. labelOutlineColor: Color;
  27130. /**
  27131. * Gets or sets the outline width in pixels of this feature.
  27132. * <p>
  27133. * The outline width will be applied to the point if <code>labelText</code> is defined.
  27134. * </p>
  27135. */
  27136. labelOutlineWidth: number;
  27137. /**
  27138. * Gets or sets the font of this feature.
  27139. * <p>
  27140. * Only applied when the <code>labelText</code> is defined.
  27141. * </p>
  27142. */
  27143. font: string;
  27144. /**
  27145. * Gets or sets the fill and outline style of this feature.
  27146. * <p>
  27147. * Only applied when <code>labelText</code> is defined.
  27148. * </p>
  27149. */
  27150. labelStyle: LabelStyle;
  27151. /**
  27152. * Gets or sets the text for this feature.
  27153. */
  27154. labelText: string;
  27155. /**
  27156. * Gets or sets the background color of the text for this feature.
  27157. * <p>
  27158. * Only applied when <code>labelText</code> is defined.
  27159. * </p>
  27160. */
  27161. backgroundColor: Color;
  27162. /**
  27163. * Gets or sets the background padding of the text for this feature.
  27164. * <p>
  27165. * Only applied when <code>labelText</code> is defined.
  27166. * </p>
  27167. */
  27168. backgroundPadding: Cartesian2;
  27169. /**
  27170. * Gets or sets whether to display the background of the text for this feature.
  27171. * <p>
  27172. * Only applied when <code>labelText</code> is defined.
  27173. * </p>
  27174. */
  27175. backgroundEnabled: boolean;
  27176. /**
  27177. * Gets or sets the near and far scaling properties for this feature.
  27178. */
  27179. scaleByDistance: NearFarScalar;
  27180. /**
  27181. * Gets or sets the near and far translucency properties for this feature.
  27182. */
  27183. translucencyByDistance: NearFarScalar;
  27184. /**
  27185. * Gets or sets the condition specifying at what distance from the camera that this feature will be displayed.
  27186. */
  27187. distanceDisplayCondition: DistanceDisplayCondition;
  27188. /**
  27189. * Gets or sets the height offset in meters of this feature.
  27190. */
  27191. heightOffset: number;
  27192. /**
  27193. * Gets or sets whether the anchor line is displayed.
  27194. * <p>
  27195. * Only applied when <code>heightOffset</code> is defined.
  27196. * </p>
  27197. */
  27198. anchorLineEnabled: boolean;
  27199. /**
  27200. * Gets or sets the color for the anchor line.
  27201. * <p>
  27202. * Only applied when <code>heightOffset</code> is defined.
  27203. * </p>
  27204. */
  27205. anchorLineColor: Color;
  27206. /**
  27207. * Gets or sets the image of this feature.
  27208. */
  27209. image: string;
  27210. /**
  27211. * Gets or sets the distance where depth testing will be disabled.
  27212. */
  27213. disableDepthTestDistance: number;
  27214. /**
  27215. * Gets or sets the horizontal origin of this point, which determines if the point is
  27216. * to the left, center, or right of its anchor position.
  27217. */
  27218. horizontalOrigin: HorizontalOrigin;
  27219. /**
  27220. * Gets or sets the vertical origin of this point, which determines if the point is
  27221. * to the bottom, center, or top of its anchor position.
  27222. */
  27223. verticalOrigin: VerticalOrigin;
  27224. /**
  27225. * Gets or sets the horizontal origin of this point's text, which determines if the point's text is
  27226. * to the left, center, or right of its anchor position.
  27227. */
  27228. labelHorizontalOrigin: HorizontalOrigin;
  27229. /**
  27230. * Get or sets the vertical origin of this point's text, which determines if the point's text is
  27231. * to the bottom, center, top, or baseline of it's anchor point.
  27232. */
  27233. labelVerticalOrigin: VerticalOrigin;
  27234. /**
  27235. * Gets the tileset containing the feature.
  27236. */
  27237. readonly tileset: Cesium3DTileset;
  27238. /**
  27239. * All objects returned by {@link Scene#pick} have a <code>primitive</code> property. This returns
  27240. * the tileset containing the feature.
  27241. */
  27242. readonly primitive: Cesium3DTileset;
  27243. /**
  27244. * Returns whether the feature contains this property. This includes properties from this feature's
  27245. * class and inherited classes when using a batch table hierarchy.
  27246. * @param name - The case-sensitive name of the property.
  27247. * @returns Whether the feature contains this property.
  27248. */
  27249. hasProperty(name: string): boolean;
  27250. /**
  27251. * Returns an array of property names for the feature. This includes properties from this feature's
  27252. * class and inherited classes when using a batch table hierarchy.
  27253. * @param [results] - An array into which to store the results.
  27254. * @returns The names of the feature's properties.
  27255. */
  27256. getPropertyNames(results?: string[]): string[];
  27257. /**
  27258. * Returns a copy of the value of the feature's property with the given name. This includes properties from this feature's
  27259. * class and inherited classes when using a batch table hierarchy.
  27260. * @example
  27261. * // Display all the properties for a feature in the console log.
  27262. * const propertyNames = feature.getPropertyNames();
  27263. * const length = propertyNames.length;
  27264. * for (let i = 0; i < length; ++i) {
  27265. * const propertyName = propertyNames[i];
  27266. * console.log(propertyName + ': ' + feature.getProperty(propertyName));
  27267. * }
  27268. * @param name - The case-sensitive name of the property.
  27269. * @returns The value of the property or <code>undefined</code> if the feature does not have this property.
  27270. */
  27271. getProperty(name: string): any;
  27272. /**
  27273. * Sets the value of the feature's property with the given name.
  27274. * <p>
  27275. * If a property with the given name doesn't exist, it is created.
  27276. * </p>
  27277. * @example
  27278. * const height = feature.getProperty('Height'); // e.g., the height of a building
  27279. * @example
  27280. * const name = 'clicked';
  27281. * if (feature.getProperty(name)) {
  27282. * console.log('already clicked');
  27283. * } else {
  27284. * feature.setProperty(name, true);
  27285. * console.log('first click');
  27286. * }
  27287. * @param name - The case-sensitive name of the property.
  27288. * @param value - The value of the property that will be copied.
  27289. */
  27290. setProperty(name: string, value: any): void;
  27291. }
  27292. /**
  27293. * A style that is applied to a {@link Cesium3DTileset}.
  27294. * <p>
  27295. * Evaluates an expression defined using the
  27296. * {@link https://github.com/CesiumGS/3d-tiles/tree/main/specification/Styling|3D Tiles Styling language}.
  27297. * </p>
  27298. * @example
  27299. * tileset.style = new Cesium.Cesium3DTileStyle({
  27300. * color : {
  27301. * conditions : [
  27302. * ['${Height} >= 100', 'color("purple", 0.5)'],
  27303. * ['${Height} >= 50', 'color("red")'],
  27304. * ['true', 'color("blue")']
  27305. * ]
  27306. * },
  27307. * show : '${Height} > 0',
  27308. * meta : {
  27309. * description : '"Building id ${id} has height ${Height}."'
  27310. * }
  27311. * });
  27312. * @example
  27313. * tileset.style = new Cesium.Cesium3DTileStyle({
  27314. * color : 'vec4(${Temperature})',
  27315. * pointSize : '${Temperature} * 2.0'
  27316. * });
  27317. * @param [style] - The url of a style or an object defining a style.
  27318. */
  27319. export class Cesium3DTileStyle {
  27320. constructor(style?: Resource | string | any);
  27321. /**
  27322. * Gets the object defining the style using the
  27323. * {@link https://github.com/CesiumGS/3d-tiles/tree/main/specification/Styling|3D Tiles Styling language}.
  27324. */
  27325. readonly style: any;
  27326. /**
  27327. * When <code>true</code>, the style is ready and its expressions can be evaluated. When
  27328. * a style is constructed with an object, as opposed to a url, this is <code>true</code> immediately.
  27329. */
  27330. readonly ready: boolean;
  27331. /**
  27332. * Gets the promise that will be resolved when the the style is ready and its expressions can be evaluated.
  27333. */
  27334. readonly readyPromise: Promise<Cesium3DTileStyle>;
  27335. /**
  27336. * 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.
  27337. * The getter will return the internal {@link Expression} or {@link ConditionsExpression}, which may differ from the value provided to the setter.
  27338. * <p>
  27339. * The expression must return or convert to a <code>Boolean</code>.
  27340. * </p>
  27341. * <p>
  27342. * This expression is applicable to all tile formats.
  27343. * </p>
  27344. * @example
  27345. * const style = new Cesium3DTileStyle({
  27346. * show : '(regExp("^Chest").test(${County})) && (${YearBuilt} >= 1970)'
  27347. * });
  27348. * style.show.evaluate(feature); // returns true or false depending on the feature's properties
  27349. * @example
  27350. * const style = new Cesium.Cesium3DTileStyle();
  27351. * // Override show expression with a custom function
  27352. * style.show = {
  27353. * evaluate : function(feature) {
  27354. * return true;
  27355. * }
  27356. * };
  27357. * @example
  27358. * const style = new Cesium.Cesium3DTileStyle();
  27359. * // Override show expression with a boolean
  27360. * style.show = true;
  27361. * };
  27362. * @example
  27363. * const style = new Cesium.Cesium3DTileStyle();
  27364. * // Override show expression with a string
  27365. * style.show = '${Height} > 0';
  27366. * };
  27367. * @example
  27368. * const style = new Cesium.Cesium3DTileStyle();
  27369. * // Override show expression with a condition
  27370. * style.show = {
  27371. * conditions: [
  27372. * ['${height} > 2', 'false'],
  27373. * ['true', 'true']
  27374. * ];
  27375. * };
  27376. */
  27377. show: StyleExpression;
  27378. /**
  27379. * 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.
  27380. * The getter will return the internal {@link Expression} or {@link ConditionsExpression}, which may differ from the value provided to the setter.
  27381. * <p>
  27382. * The expression must return a <code>Color</code>.
  27383. * </p>
  27384. * <p>
  27385. * This expression is applicable to all tile formats.
  27386. * </p>
  27387. * @example
  27388. * const style = new Cesium3DTileStyle({
  27389. * color : '(${Temperature} > 90) ? color("red") : color("white")'
  27390. * });
  27391. * style.color.evaluateColor(feature, result); // returns a Cesium.Color object
  27392. * @example
  27393. * const style = new Cesium.Cesium3DTileStyle();
  27394. * // Override color expression with a custom function
  27395. * style.color = {
  27396. * evaluateColor : function(feature, result) {
  27397. * return Cesium.Color.clone(Cesium.Color.WHITE, result);
  27398. * }
  27399. * };
  27400. * @example
  27401. * const style = new Cesium.Cesium3DTileStyle();
  27402. * // Override color expression with a string
  27403. * style.color = 'color("blue")';
  27404. * @example
  27405. * const style = new Cesium.Cesium3DTileStyle();
  27406. * // Override color expression with a condition
  27407. * style.color = {
  27408. * conditions : [
  27409. * ['${height} > 2', 'color("cyan")'],
  27410. * ['true', 'color("blue")']
  27411. * ]
  27412. * };
  27413. */
  27414. color: StyleExpression;
  27415. /**
  27416. * 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.
  27417. * The getter will return the internal {@link Expression} or {@link ConditionsExpression}, which may differ from the value provided to the setter.
  27418. * <p>
  27419. * The expression must return a <code>Number</code>.
  27420. * </p>
  27421. * <p>
  27422. * This expression is only applicable to point features in a Vector tile or a Point Cloud tile.
  27423. * </p>
  27424. * @example
  27425. * const style = new Cesium3DTileStyle({
  27426. * pointSize : '(${Temperature} > 90) ? 2.0 : 1.0'
  27427. * });
  27428. * style.pointSize.evaluate(feature); // returns a Number
  27429. * @example
  27430. * const style = new Cesium.Cesium3DTileStyle();
  27431. * // Override pointSize expression with a custom function
  27432. * style.pointSize = {
  27433. * evaluate : function(feature) {
  27434. * return 1.0;
  27435. * }
  27436. * };
  27437. * @example
  27438. * const style = new Cesium.Cesium3DTileStyle();
  27439. * // Override pointSize expression with a number
  27440. * style.pointSize = 1.0;
  27441. * @example
  27442. * const style = new Cesium.Cesium3DTileStyle();
  27443. * // Override pointSize expression with a string
  27444. * style.pointSize = '${height} / 10';
  27445. * @example
  27446. * const style = new Cesium.Cesium3DTileStyle();
  27447. * // Override pointSize expression with a condition
  27448. * style.pointSize = {
  27449. * conditions : [
  27450. * ['${height} > 2', '1.0'],
  27451. * ['true', '2.0']
  27452. * ]
  27453. * };
  27454. */
  27455. pointSize: StyleExpression;
  27456. /**
  27457. * 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.
  27458. * The getter will return the internal {@link Expression} or {@link ConditionsExpression}, which may differ from the value provided to the setter.
  27459. * <p>
  27460. * The expression must return a <code>Color</code>.
  27461. * </p>
  27462. * <p>
  27463. * This expression is only applicable to point features in a Vector tile.
  27464. * </p>
  27465. * @example
  27466. * const style = new Cesium.Cesium3DTileStyle();
  27467. * // Override pointOutlineColor expression with a string
  27468. * style.pointOutlineColor = 'color("blue")';
  27469. * @example
  27470. * const style = new Cesium.Cesium3DTileStyle();
  27471. * // Override pointOutlineColor expression with a condition
  27472. * style.pointOutlineColor = {
  27473. * conditions : [
  27474. * ['${height} > 2', 'color("cyan")'],
  27475. * ['true', 'color("blue")']
  27476. * ]
  27477. * };
  27478. */
  27479. pointOutlineColor: StyleExpression;
  27480. /**
  27481. * 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.
  27482. * The getter will return the internal {@link Expression} or {@link ConditionsExpression}, which may differ from the value provided to the setter.
  27483. * <p>
  27484. * The expression must return a <code>Number</code>.
  27485. * </p>
  27486. * <p>
  27487. * This expression is only applicable to point features in a Vector tile.
  27488. * </p>
  27489. * @example
  27490. * const style = new Cesium.Cesium3DTileStyle();
  27491. * // Override pointOutlineWidth expression with a string
  27492. * style.pointOutlineWidth = '5';
  27493. * @example
  27494. * const style = new Cesium.Cesium3DTileStyle();
  27495. * // Override pointOutlineWidth expression with a condition
  27496. * style.pointOutlineWidth = {
  27497. * conditions : [
  27498. * ['${height} > 2', '5'],
  27499. * ['true', '0']
  27500. * ]
  27501. * };
  27502. */
  27503. pointOutlineWidth: StyleExpression;
  27504. /**
  27505. * 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.
  27506. * The getter will return the internal {@link Expression} or {@link ConditionsExpression}, which may differ from the value provided to the setter.
  27507. * <p>
  27508. * The expression must return a <code>Color</code>.
  27509. * </p>
  27510. * <p>
  27511. * This expression is only applicable to point features in a Vector tile.
  27512. * </p>
  27513. * @example
  27514. * const style = new Cesium.Cesium3DTileStyle();
  27515. * // Override labelColor expression with a string
  27516. * style.labelColor = 'color("blue")';
  27517. * @example
  27518. * const style = new Cesium.Cesium3DTileStyle();
  27519. * // Override labelColor expression with a condition
  27520. * style.labelColor = {
  27521. * conditions : [
  27522. * ['${height} > 2', 'color("cyan")'],
  27523. * ['true', 'color("blue")']
  27524. * ]
  27525. * };
  27526. */
  27527. labelColor: StyleExpression;
  27528. /**
  27529. * 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.
  27530. * The getter will return the internal {@link Expression} or {@link ConditionsExpression}, which may differ from the value provided to the setter.
  27531. * <p>
  27532. * The expression must return a <code>Color</code>.
  27533. * </p>
  27534. * <p>
  27535. * This expression is only applicable to point features in a Vector tile.
  27536. * </p>
  27537. * @example
  27538. * const style = new Cesium.Cesium3DTileStyle();
  27539. * // Override labelOutlineColor expression with a string
  27540. * style.labelOutlineColor = 'color("blue")';
  27541. * @example
  27542. * const style = new Cesium.Cesium3DTileStyle();
  27543. * // Override labelOutlineColor expression with a condition
  27544. * style.labelOutlineColor = {
  27545. * conditions : [
  27546. * ['${height} > 2', 'color("cyan")'],
  27547. * ['true', 'color("blue")']
  27548. * ]
  27549. * };
  27550. */
  27551. labelOutlineColor: StyleExpression;
  27552. /**
  27553. * 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.
  27554. * The getter will return the internal {@link Expression} or {@link ConditionsExpression}, which may differ from the value provided to the setter.
  27555. * <p>
  27556. * The expression must return a <code>Number</code>.
  27557. * </p>
  27558. * <p>
  27559. * This expression is only applicable to point features in a Vector tile.
  27560. * </p>
  27561. * @example
  27562. * const style = new Cesium.Cesium3DTileStyle();
  27563. * // Override labelOutlineWidth expression with a string
  27564. * style.labelOutlineWidth = '5';
  27565. * @example
  27566. * const style = new Cesium.Cesium3DTileStyle();
  27567. * // Override labelOutlineWidth expression with a condition
  27568. * style.labelOutlineWidth = {
  27569. * conditions : [
  27570. * ['${height} > 2', '5'],
  27571. * ['true', '0']
  27572. * ]
  27573. * };
  27574. */
  27575. labelOutlineWidth: StyleExpression;
  27576. /**
  27577. * 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.
  27578. * The getter will return the internal {@link Expression} or {@link ConditionsExpression}, which may differ from the value provided to the setter.
  27579. * <p>
  27580. * The expression must return a <code>String</code>.
  27581. * </p>
  27582. * <p>
  27583. * This expression is only applicable to point features in a Vector tile.
  27584. * </p>
  27585. * @example
  27586. * const style = new Cesium3DTileStyle({
  27587. * font : '(${Temperature} > 90) ? "30px Helvetica" : "24px Helvetica"'
  27588. * });
  27589. * style.font.evaluate(feature); // returns a String
  27590. * @example
  27591. * const style = new Cesium.Cesium3DTileStyle();
  27592. * // Override font expression with a custom function
  27593. * style.font = {
  27594. * evaluate : function(feature) {
  27595. * return '24px Helvetica';
  27596. * }
  27597. * };
  27598. */
  27599. font: StyleExpression;
  27600. /**
  27601. * 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.
  27602. * The getter will return the internal {@link Expression} or {@link ConditionsExpression}, which may differ from the value provided to the setter.
  27603. * <p>
  27604. * The expression must return a <code>LabelStyle</code>.
  27605. * </p>
  27606. * <p>
  27607. * This expression is only applicable to point features in a Vector tile.
  27608. * </p>
  27609. * @example
  27610. * const style = new Cesium3DTileStyle({
  27611. * labelStyle : '(${Temperature} > 90) ? ' + LabelStyle.FILL_AND_OUTLINE + ' : ' + LabelStyle.FILL
  27612. * });
  27613. * style.labelStyle.evaluate(feature); // returns a LabelStyle
  27614. * @example
  27615. * const style = new Cesium.Cesium3DTileStyle();
  27616. * // Override labelStyle expression with a custom function
  27617. * style.labelStyle = {
  27618. * evaluate : function(feature) {
  27619. * return LabelStyle.FILL;
  27620. * }
  27621. * };
  27622. */
  27623. labelStyle: StyleExpression;
  27624. /**
  27625. * 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.
  27626. * The getter will return the internal {@link Expression} or {@link ConditionsExpression}, which may differ from the value provided to the setter.
  27627. * <p>
  27628. * The expression must return a <code>String</code>.
  27629. * </p>
  27630. * <p>
  27631. * This expression is only applicable to point features in a Vector tile.
  27632. * </p>
  27633. * @example
  27634. * const style = new Cesium3DTileStyle({
  27635. * labelText : '(${Temperature} > 90) ? ">90" : "<=90"'
  27636. * });
  27637. * style.labelText.evaluate(feature); // returns a String
  27638. * @example
  27639. * const style = new Cesium.Cesium3DTileStyle();
  27640. * // Override labelText expression with a custom function
  27641. * style.labelText = {
  27642. * evaluate : function(feature) {
  27643. * return 'Example label text';
  27644. * }
  27645. * };
  27646. */
  27647. labelText: StyleExpression;
  27648. /**
  27649. * 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.
  27650. * The getter will return the internal {@link Expression} or {@link ConditionsExpression}, which may differ from the value provided to the setter.
  27651. * <p>
  27652. * The expression must return a <code>Color</code>.
  27653. * </p>
  27654. * <p>
  27655. * This expression is only applicable to point features in a Vector tile.
  27656. * </p>
  27657. * @example
  27658. * const style = new Cesium.Cesium3DTileStyle();
  27659. * // Override backgroundColor expression with a string
  27660. * style.backgroundColor = 'color("blue")';
  27661. * @example
  27662. * const style = new Cesium.Cesium3DTileStyle();
  27663. * // Override backgroundColor expression with a condition
  27664. * style.backgroundColor = {
  27665. * conditions : [
  27666. * ['${height} > 2', 'color("cyan")'],
  27667. * ['true', 'color("blue")']
  27668. * ]
  27669. * };
  27670. */
  27671. backgroundColor: StyleExpression;
  27672. /**
  27673. * 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.
  27674. * The getter will return the internal {@link Expression} or {@link ConditionsExpression}, which may differ from the value provided to the setter.
  27675. * <p>
  27676. * The expression must return a <code>Cartesian2</code>.
  27677. * </p>
  27678. * <p>
  27679. * This expression is only applicable to point features in a Vector tile.
  27680. * </p>
  27681. * @example
  27682. * const style = new Cesium.Cesium3DTileStyle();
  27683. * // Override backgroundPadding expression with a string
  27684. * style.backgroundPadding = 'vec2(5.0, 7.0)';
  27685. * style.backgroundPadding.evaluate(feature); // returns a Cartesian2
  27686. */
  27687. backgroundPadding: StyleExpression;
  27688. /**
  27689. * 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.
  27690. * The getter will return the internal {@link Expression} or {@link ConditionsExpression}, which may differ from the value provided to the setter.
  27691. * <p>
  27692. * The expression must return a <code>Boolean</code>.
  27693. * </p>
  27694. * <p>
  27695. * This expression is only applicable to point features in a Vector tile.
  27696. * </p>
  27697. * @example
  27698. * const style = new Cesium.Cesium3DTileStyle();
  27699. * // Override backgroundEnabled expression with a string
  27700. * style.backgroundEnabled = 'true';
  27701. * @example
  27702. * const style = new Cesium.Cesium3DTileStyle();
  27703. * // Override backgroundEnabled expression with a condition
  27704. * style.backgroundEnabled = {
  27705. * conditions : [
  27706. * ['${height} > 2', 'true'],
  27707. * ['true', 'false']
  27708. * ]
  27709. * };
  27710. */
  27711. backgroundEnabled: StyleExpression;
  27712. /**
  27713. * 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.
  27714. * The getter will return the internal {@link Expression} or {@link ConditionsExpression}, which may differ from the value provided to the setter.
  27715. * <p>
  27716. * The expression must return a <code>Cartesian4</code>.
  27717. * </p>
  27718. * <p>
  27719. * This expression is only applicable to point features in a Vector tile.
  27720. * </p>
  27721. * @example
  27722. * const style = new Cesium.Cesium3DTileStyle();
  27723. * // Override scaleByDistance expression with a string
  27724. * style.scaleByDistance = 'vec4(1.5e2, 2.0, 1.5e7, 0.5)';
  27725. * style.scaleByDistance.evaluate(feature); // returns a Cartesian4
  27726. */
  27727. scaleByDistance: StyleExpression;
  27728. /**
  27729. * 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.
  27730. * The getter will return the internal {@link Expression} or {@link ConditionsExpression}, which may differ from the value provided to the setter.
  27731. * <p>
  27732. * The expression must return a <code>Cartesian4</code>.
  27733. * </p>
  27734. * <p>
  27735. * This expression is only applicable to point features in a Vector tile.
  27736. * </p>
  27737. * @example
  27738. * const style = new Cesium.Cesium3DTileStyle();
  27739. * // Override translucencyByDistance expression with a string
  27740. * style.translucencyByDistance = 'vec4(1.5e2, 1.0, 1.5e7, 0.2)';
  27741. * style.translucencyByDistance.evaluate(feature); // returns a Cartesian4
  27742. */
  27743. translucencyByDistance: StyleExpression;
  27744. /**
  27745. * 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.
  27746. * The getter will return the internal {@link Expression} or {@link ConditionsExpression}, which may differ from the value provided to the setter.
  27747. * <p>
  27748. * The expression must return a <code>Cartesian2</code>.
  27749. * </p>
  27750. * <p>
  27751. * This expression is only applicable to point features in a Vector tile.
  27752. * </p>
  27753. * @example
  27754. * const style = new Cesium.Cesium3DTileStyle();
  27755. * // Override distanceDisplayCondition expression with a string
  27756. * style.distanceDisplayCondition = 'vec2(0.0, 5.5e6)';
  27757. * style.distanceDisplayCondition.evaluate(feature); // returns a Cartesian2
  27758. */
  27759. distanceDisplayCondition: StyleExpression;
  27760. /**
  27761. * 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.
  27762. * The getter will return the internal {@link Expression} or {@link ConditionsExpression}, which may differ from the value provided to the setter.
  27763. * <p>
  27764. * The expression must return a <code>Number</code>.
  27765. * </p>
  27766. * <p>
  27767. * This expression is only applicable to point features in a Vector tile.
  27768. * </p>
  27769. * @example
  27770. * const style = new Cesium.Cesium3DTileStyle();
  27771. * // Override heightOffset expression with a string
  27772. * style.heightOffset = '2.0';
  27773. * @example
  27774. * const style = new Cesium.Cesium3DTileStyle();
  27775. * // Override heightOffset expression with a condition
  27776. * style.heightOffset = {
  27777. * conditions : [
  27778. * ['${height} > 2', '4.0'],
  27779. * ['true', '2.0']
  27780. * ]
  27781. * };
  27782. */
  27783. heightOffset: StyleExpression;
  27784. /**
  27785. * 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.
  27786. * The getter will return the internal {@link Expression} or {@link ConditionsExpression}, which may differ from the value provided to the setter.
  27787. * <p>
  27788. * The expression must return a <code>Boolean</code>.
  27789. * </p>
  27790. * <p>
  27791. * This expression is only applicable to point features in a Vector tile.
  27792. * </p>
  27793. * @example
  27794. * const style = new Cesium.Cesium3DTileStyle();
  27795. * // Override anchorLineEnabled expression with a string
  27796. * style.anchorLineEnabled = 'true';
  27797. * @example
  27798. * const style = new Cesium.Cesium3DTileStyle();
  27799. * // Override anchorLineEnabled expression with a condition
  27800. * style.anchorLineEnabled = {
  27801. * conditions : [
  27802. * ['${height} > 2', 'true'],
  27803. * ['true', 'false']
  27804. * ]
  27805. * };
  27806. */
  27807. anchorLineEnabled: StyleExpression;
  27808. /**
  27809. * 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.
  27810. * The getter will return the internal {@link Expression} or {@link ConditionsExpression}, which may differ from the value provided to the setter.
  27811. * <p>
  27812. * The expression must return a <code>Color</code>.
  27813. * </p>
  27814. * <p>
  27815. * This expression is only applicable to point features in a Vector tile.
  27816. * </p>
  27817. * @example
  27818. * const style = new Cesium.Cesium3DTileStyle();
  27819. * // Override anchorLineColor expression with a string
  27820. * style.anchorLineColor = 'color("blue")';
  27821. * @example
  27822. * const style = new Cesium.Cesium3DTileStyle();
  27823. * // Override anchorLineColor expression with a condition
  27824. * style.anchorLineColor = {
  27825. * conditions : [
  27826. * ['${height} > 2', 'color("cyan")'],
  27827. * ['true', 'color("blue")']
  27828. * ]
  27829. * };
  27830. */
  27831. anchorLineColor: StyleExpression;
  27832. /**
  27833. * 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.
  27834. * The getter will return the internal {@link Expression} or {@link ConditionsExpression}, which may differ from the value provided to the setter.
  27835. * <p>
  27836. * The expression must return a <code>String</code>.
  27837. * </p>
  27838. * <p>
  27839. * This expression is only applicable to point features in a Vector tile.
  27840. * </p>
  27841. * @example
  27842. * const style = new Cesium3DTileStyle({
  27843. * image : '(${Temperature} > 90) ? "/url/to/image1" : "/url/to/image2"'
  27844. * });
  27845. * style.image.evaluate(feature); // returns a String
  27846. * @example
  27847. * const style = new Cesium.Cesium3DTileStyle();
  27848. * // Override image expression with a custom function
  27849. * style.image = {
  27850. * evaluate : function(feature) {
  27851. * return '/url/to/image';
  27852. * }
  27853. * };
  27854. */
  27855. image: StyleExpression;
  27856. /**
  27857. * 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.
  27858. * The getter will return the internal {@link Expression} or {@link ConditionsExpression}, which may differ from the value provided to the setter.
  27859. * <p>
  27860. * The expression must return a <code>Number</code>.
  27861. * </p>
  27862. * <p>
  27863. * This expression is only applicable to point features in a Vector tile.
  27864. * </p>
  27865. * @example
  27866. * const style = new Cesium.Cesium3DTileStyle();
  27867. * // Override disableDepthTestDistance expression with a string
  27868. * style.disableDepthTestDistance = '1000.0';
  27869. * style.disableDepthTestDistance.evaluate(feature); // returns a Number
  27870. */
  27871. disableDepthTestDistance: StyleExpression;
  27872. /**
  27873. * 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.
  27874. * The getter will return the internal {@link Expression} or {@link ConditionsExpression}, which may differ from the value provided to the setter.
  27875. * <p>
  27876. * The expression must return a <code>HorizontalOrigin</code>.
  27877. * </p>
  27878. * <p>
  27879. * This expression is only applicable to point features in a Vector tile.
  27880. * </p>
  27881. * @example
  27882. * const style = new Cesium3DTileStyle({
  27883. * horizontalOrigin : HorizontalOrigin.LEFT
  27884. * });
  27885. * style.horizontalOrigin.evaluate(feature); // returns a HorizontalOrigin
  27886. * @example
  27887. * const style = new Cesium.Cesium3DTileStyle();
  27888. * // Override horizontalOrigin expression with a custom function
  27889. * style.horizontalOrigin = {
  27890. * evaluate : function(feature) {
  27891. * return HorizontalOrigin.CENTER;
  27892. * }
  27893. * };
  27894. */
  27895. horizontalOrigin: StyleExpression;
  27896. /**
  27897. * 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.
  27898. * The getter will return the internal {@link Expression} or {@link ConditionsExpression}, which may differ from the value provided to the setter.
  27899. * <p>
  27900. * The expression must return a <code>VerticalOrigin</code>.
  27901. * </p>
  27902. * <p>
  27903. * This expression is only applicable to point features in a Vector tile.
  27904. * </p>
  27905. * @example
  27906. * const style = new Cesium3DTileStyle({
  27907. * verticalOrigin : VerticalOrigin.TOP
  27908. * });
  27909. * style.verticalOrigin.evaluate(feature); // returns a VerticalOrigin
  27910. * @example
  27911. * const style = new Cesium.Cesium3DTileStyle();
  27912. * // Override verticalOrigin expression with a custom function
  27913. * style.verticalOrigin = {
  27914. * evaluate : function(feature) {
  27915. * return VerticalOrigin.CENTER;
  27916. * }
  27917. * };
  27918. */
  27919. verticalOrigin: StyleExpression;
  27920. /**
  27921. * 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.
  27922. * The getter will return the internal {@link Expression} or {@link ConditionsExpression}, which may differ from the value provided to the setter.
  27923. * <p>
  27924. * The expression must return a <code>HorizontalOrigin</code>.
  27925. * </p>
  27926. * <p>
  27927. * This expression is only applicable to point features in a Vector tile.
  27928. * </p>
  27929. * @example
  27930. * const style = new Cesium3DTileStyle({
  27931. * labelHorizontalOrigin : HorizontalOrigin.LEFT
  27932. * });
  27933. * style.labelHorizontalOrigin.evaluate(feature); // returns a HorizontalOrigin
  27934. * @example
  27935. * const style = new Cesium.Cesium3DTileStyle();
  27936. * // Override labelHorizontalOrigin expression with a custom function
  27937. * style.labelHorizontalOrigin = {
  27938. * evaluate : function(feature) {
  27939. * return HorizontalOrigin.CENTER;
  27940. * }
  27941. * };
  27942. */
  27943. labelHorizontalOrigin: StyleExpression;
  27944. /**
  27945. * 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.
  27946. * The getter will return the internal {@link Expression} or {@link ConditionsExpression}, which may differ from the value provided to the setter.
  27947. * <p>
  27948. * The expression must return a <code>VerticalOrigin</code>.
  27949. * </p>
  27950. * <p>
  27951. * This expression is only applicable to point features in a Vector tile.
  27952. * </p>
  27953. * @example
  27954. * const style = new Cesium3DTileStyle({
  27955. * labelVerticalOrigin : VerticalOrigin.TOP
  27956. * });
  27957. * style.labelVerticalOrigin.evaluate(feature); // returns a VerticalOrigin
  27958. * @example
  27959. * const style = new Cesium.Cesium3DTileStyle();
  27960. * // Override labelVerticalOrigin expression with a custom function
  27961. * style.labelVerticalOrigin = {
  27962. * evaluate : function(feature) {
  27963. * return VerticalOrigin.CENTER;
  27964. * }
  27965. * };
  27966. */
  27967. labelVerticalOrigin: StyleExpression;
  27968. /**
  27969. * Gets or sets the object containing application-specific expression that can be explicitly
  27970. * evaluated, e.g., for display in a UI.
  27971. * @example
  27972. * const style = new Cesium3DTileStyle({
  27973. * meta : {
  27974. * description : '"Building id ${id} has height ${Height}."'
  27975. * }
  27976. * });
  27977. * style.meta.description.evaluate(feature); // returns a String with the substituted variables
  27978. */
  27979. meta: StyleExpression;
  27980. }
  27981. /**
  27982. * A {@link https://github.com/CesiumGS/3d-tiles/tree/main/specification|3D Tiles tileset},
  27983. * used for streaming massive heterogeneous 3D geospatial datasets.
  27984. * @example
  27985. * const tileset = scene.primitives.add(new Cesium.Cesium3DTileset({
  27986. * url : 'http://localhost:8002/tilesets/Seattle/tileset.json'
  27987. * }));
  27988. * @example
  27989. * // Common setting for the skipLevelOfDetail optimization
  27990. * const tileset = scene.primitives.add(new Cesium.Cesium3DTileset({
  27991. * url : 'http://localhost:8002/tilesets/Seattle/tileset.json',
  27992. * skipLevelOfDetail : true,
  27993. * baseScreenSpaceError : 1024,
  27994. * skipScreenSpaceErrorFactor : 16,
  27995. * skipLevels : 1,
  27996. * immediatelyLoadDesiredLevelOfDetail : false,
  27997. * loadSiblings : false,
  27998. * cullWithChildrenBounds : true
  27999. * }));
  28000. * @example
  28001. * // Common settings for the dynamicScreenSpaceError optimization
  28002. * const tileset = scene.primitives.add(new Cesium.Cesium3DTileset({
  28003. * url : 'http://localhost:8002/tilesets/Seattle/tileset.json',
  28004. * dynamicScreenSpaceError : true,
  28005. * dynamicScreenSpaceErrorDensity : 0.00278,
  28006. * dynamicScreenSpaceErrorFactor : 4.0,
  28007. * dynamicScreenSpaceErrorHeightFalloff : 0.25
  28008. * }));
  28009. * @param options - Object with the following properties:
  28010. * @param options.url - The url to a tileset JSON file.
  28011. * @param [options.show = true] - Determines if the tileset will be shown.
  28012. * @param [options.modelMatrix = Matrix4.IDENTITY] - A 4x4 transformation matrix that transforms the tileset's root tile.
  28013. * @param [options.shadows = ShadowMode.ENABLED] - Determines whether the tileset casts or receives shadows from light sources.
  28014. * @param [options.maximumScreenSpaceError = 16] - The maximum screen space error used to drive level of detail refinement.
  28015. * @param [options.maximumMemoryUsage = 512] - The maximum amount of memory in MB that can be used by the tileset.
  28016. * @param [options.cullWithChildrenBounds = true] - Optimization option. Whether to cull tiles using the union of their children bounding volumes.
  28017. * @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.
  28018. * @param [options.cullRequestsWhileMovingMultiplier = 60.0] - Optimization option. Multiplier used in culling requests while moving. Larger is more aggressive culling, smaller less aggressive culling.
  28019. * @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.
  28020. * @param [options.preloadFlightDestinations = true] - Optimization option. Preload tiles at the camera's flight destination while the camera is in flight.
  28021. * @param [options.preferLeaves = false] - Optimization option. Prefer loading of leaves first.
  28022. * @param [options.dynamicScreenSpaceError = false] - Optimization option. Reduce the screen space error for tiles that are further away from the camera.
  28023. * @param [options.dynamicScreenSpaceErrorDensity = 0.00278] - Density used to adjust the dynamic screen space error, similar to fog density.
  28024. * @param [options.dynamicScreenSpaceErrorFactor = 4.0] - A factor used to increase the computed dynamic screen space error.
  28025. * @param [options.dynamicScreenSpaceErrorHeightFalloff = 0.25] - A ratio of the tileset's height at which the density starts to falloff.
  28026. * @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.
  28027. * @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.
  28028. * @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.
  28029. * @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}.
  28030. * @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}
  28031. * @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.
  28032. * @param [options.skipLevelOfDetail = false] - Optimization option. Determines if level of detail skipping should be applied during the traversal.
  28033. * @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.
  28034. * @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.
  28035. * @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.
  28036. * @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.
  28037. * @param [options.loadSiblings = false] - When <code>skipLevelOfDetail</code> is <code>true</code>, determines whether siblings of visible tiles are always downloaded during traversal.
  28038. * @param [options.clippingPlanes] - The {@link ClippingPlaneCollection} used to selectively disable rendering the tileset.
  28039. * @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.
  28040. * @param [options.ellipsoid = Ellipsoid.WGS84] - The ellipsoid determining the size and shape of the globe.
  28041. * @param [options.pointCloudShading] - Options for constructing a {@link PointCloudShading} object to control point attenuation based on geometric error and lighting.
  28042. * @param [options.lightColor] - The light color when shading models. When <code>undefined</code> the scene's light color is used instead.
  28043. * @param [options.imageBasedLighting] - The properties for managing image-based lighting for this tileset.
  28044. * @param [options.imageBasedLightingFactor = new Cartesian2(1.0, 1.0)] - Scales the diffuse and specular image-based lighting from the earth, sky, atmosphere and star skybox. Deprecated in Cesium 1.92, will be removed in Cesium 1.94.
  28045. * @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. Deprecated in Cesium 1.92, will be removed in Cesium 1.94.
  28046. * @param [options.sphericalHarmonicCoefficients] - The third order spherical harmonic coefficients used for the diffuse color of image-based lighting. Deprecated in Cesium 1.92, will be removed in Cesium 1.94.
  28047. * @param [options.specularEnvironmentMaps] - A URL to a KTX2 file that contains a cube map of the specular lighting and the convoluted specular mipmaps. Deprecated in Cesium 1.92, will be removed in Cesium 1.94.
  28048. * @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.
  28049. * @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.
  28050. * @param [options.vectorClassificationOnly = false] - Indicates that only the tileset's vector tiles should be used for classification.
  28051. * @param [options.vectorKeepDecodedPositions = false] - Whether vector tiles should keep decoded positions in memory. This is used with {@link Cesium3DTileFeature.getPolylinePositions}.
  28052. * @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.
  28053. * @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.
  28054. * @param [options.showCreditsOnScreen = false] - Whether to display the credits of this tileset on screen.
  28055. * @param [options.splitDirection = SplitDirection.NONE] - The {@link SplitDirection} split to apply to this tileset.
  28056. * @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.
  28057. * @param [options.debugFreezeFrame = false] - For debugging only. Determines if only the tiles from last frame should be used for rendering.
  28058. * @param [options.debugColorizeTiles = false] - For debugging only. When true, assigns a random color to each tile.
  28059. * @param [options.debugWireframe = false] - For debugging only. When true, render's each tile's content as a wireframe.
  28060. * @param [options.debugShowBoundingVolume = false] - For debugging only. When true, renders the bounding volume for each tile.
  28061. * @param [options.debugShowContentBoundingVolume = false] - For debugging only. When true, renders the bounding volume for each tile's content.
  28062. * @param [options.debugShowViewerRequestVolume = false] - For debugging only. When true, renders the viewer request volume for each tile.
  28063. * @param [options.debugShowGeometricError = false] - For debugging only. When true, draws labels to indicate the geometric error of each tile.
  28064. * @param [options.debugShowRenderingStatistics = false] - For debugging only. When true, draws labels to indicate the number of commands, points, triangles and features for each tile.
  28065. * @param [options.debugShowMemoryUsage = false] - For debugging only. When true, draws labels to indicate the texture and geometry memory in megabytes used by each tile.
  28066. * @param [options.debugShowUrl = false] - For debugging only. When true, draws labels to indicate the url of each tile.
  28067. */
  28068. export class Cesium3DTileset {
  28069. constructor(options: {
  28070. url: Resource | string | Promise<Resource> | Promise<string>;
  28071. show?: boolean;
  28072. modelMatrix?: Matrix4;
  28073. shadows?: ShadowMode;
  28074. maximumScreenSpaceError?: number;
  28075. maximumMemoryUsage?: number;
  28076. cullWithChildrenBounds?: boolean;
  28077. cullRequestsWhileMoving?: boolean;
  28078. cullRequestsWhileMovingMultiplier?: number;
  28079. preloadWhenHidden?: boolean;
  28080. preloadFlightDestinations?: boolean;
  28081. preferLeaves?: boolean;
  28082. dynamicScreenSpaceError?: boolean;
  28083. dynamicScreenSpaceErrorDensity?: number;
  28084. dynamicScreenSpaceErrorFactor?: number;
  28085. dynamicScreenSpaceErrorHeightFalloff?: number;
  28086. progressiveResolutionHeightFraction?: number;
  28087. foveatedScreenSpaceError?: boolean;
  28088. foveatedConeSize?: number;
  28089. foveatedMinimumScreenSpaceErrorRelaxation?: number;
  28090. foveatedInterpolationCallback?: Cesium3DTileset.foveatedInterpolationCallback;
  28091. foveatedTimeDelay?: number;
  28092. skipLevelOfDetail?: boolean;
  28093. baseScreenSpaceError?: number;
  28094. skipScreenSpaceErrorFactor?: number;
  28095. skipLevels?: number;
  28096. immediatelyLoadDesiredLevelOfDetail?: boolean;
  28097. loadSiblings?: boolean;
  28098. clippingPlanes?: ClippingPlaneCollection;
  28099. classificationType?: ClassificationType;
  28100. ellipsoid?: Ellipsoid;
  28101. pointCloudShading?: any;
  28102. lightColor?: Cartesian3;
  28103. imageBasedLighting?: ImageBasedLighting;
  28104. imageBasedLightingFactor?: Cartesian2;
  28105. luminanceAtZenith?: number;
  28106. sphericalHarmonicCoefficients?: Cartesian3[];
  28107. specularEnvironmentMaps?: string;
  28108. backFaceCulling?: boolean;
  28109. showOutline?: boolean;
  28110. vectorClassificationOnly?: boolean;
  28111. vectorKeepDecodedPositions?: boolean;
  28112. featureIdLabel?: string | number;
  28113. instanceFeatureIdLabel?: string | number;
  28114. showCreditsOnScreen?: boolean;
  28115. splitDirection?: SplitDirection;
  28116. debugHeatmapTilePropertyName?: string;
  28117. debugFreezeFrame?: boolean;
  28118. debugColorizeTiles?: boolean;
  28119. debugWireframe?: boolean;
  28120. debugShowBoundingVolume?: boolean;
  28121. debugShowContentBoundingVolume?: boolean;
  28122. debugShowViewerRequestVolume?: boolean;
  28123. debugShowGeometricError?: boolean;
  28124. debugShowRenderingStatistics?: boolean;
  28125. debugShowMemoryUsage?: boolean;
  28126. debugShowUrl?: boolean;
  28127. });
  28128. /**
  28129. * 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.
  28130. */
  28131. cullRequestsWhileMoving: boolean;
  28132. /**
  28133. * Optimization option. Multiplier used in culling requests while moving. Larger is more aggressive culling, smaller less aggressive culling.
  28134. */
  28135. cullRequestsWhileMovingMultiplier: number;
  28136. /**
  28137. * 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.
  28138. */
  28139. progressiveResolutionHeightFraction: number;
  28140. /**
  28141. * Optimization option. Prefer loading of leaves first.
  28142. */
  28143. preferLeaves: boolean;
  28144. /**
  28145. * Preload tiles when <code>tileset.show</code> is <code>false</code>. Loads tiles as if the tileset is visible but does not render them.
  28146. */
  28147. preloadWhenHidden: boolean;
  28148. /**
  28149. * Optimization option. Fetch tiles at the camera's flight destination while the camera is in flight.
  28150. */
  28151. preloadFlightDestinations: boolean;
  28152. /**
  28153. * Optimization option. Whether the tileset should refine based on a dynamic screen space error. Tiles that are further
  28154. * away will be rendered with lower detail than closer tiles. This improves performance by rendering fewer
  28155. * tiles and making less requests, but may result in a slight drop in visual quality for tiles in the distance.
  28156. * The algorithm is biased towards "street views" where the camera is close to the ground plane of the tileset and looking
  28157. * at the horizon. In addition results are more accurate for tightly fitting bounding volumes like box and region.
  28158. */
  28159. dynamicScreenSpaceError: boolean;
  28160. /**
  28161. * Optimization option. Prioritize loading tiles in the center of the screen by temporarily raising the
  28162. * screen space error for tiles around the edge of the screen. Screen space error returns to normal once all
  28163. * the tiles in the center of the screen as determined by the {@link Cesium3DTileset#foveatedConeSize} are loaded.
  28164. */
  28165. foveatedScreenSpaceError: boolean;
  28166. /**
  28167. * Gets or sets a callback to control how much to raise the screen space error for tiles outside the foveated cone,
  28168. * interpolating between {@link Cesium3DTileset#foveatedMinimumScreenSpaceErrorRelaxation} and {@link Cesium3DTileset#maximumScreenSpaceError}.
  28169. */
  28170. foveatedInterpolationCallback: Cesium3DTileset.foveatedInterpolationCallback;
  28171. /**
  28172. * Optimization option. Used when {@link Cesium3DTileset#foveatedScreenSpaceError} is true to control
  28173. * how long in seconds to wait after the camera stops moving before deferred tiles start loading in.
  28174. * This time delay prevents requesting tiles around the edges of the screen when the camera is moving.
  28175. * Setting this to 0.0 will immediately request all tiles in any given view.
  28176. */
  28177. foveatedTimeDelay: number;
  28178. /**
  28179. * A scalar that determines the density used to adjust the dynamic screen space error, similar to {@link Fog}. Increasing this
  28180. * value has the effect of increasing the maximum screen space error for all tiles, but in a non-linear fashion.
  28181. * The error starts at 0.0 and increases exponentially until a midpoint is reached, and then approaches 1.0 asymptotically.
  28182. * This has the effect of keeping high detail in the closer tiles and lower detail in the further tiles, with all tiles
  28183. * beyond a certain distance all roughly having an error of 1.0.
  28184. * <p>
  28185. * The dynamic error is in the range [0.0, 1.0) and is multiplied by <code>dynamicScreenSpaceErrorFactor</code> to produce the
  28186. * final dynamic error. This dynamic error is then subtracted from the tile's actual screen space error.
  28187. * </p>
  28188. * <p>
  28189. * Increasing <code>dynamicScreenSpaceErrorDensity</code> has the effect of moving the error midpoint closer to the camera.
  28190. * It is analogous to moving fog closer to the camera.
  28191. * </p>
  28192. */
  28193. dynamicScreenSpaceErrorDensity: number;
  28194. /**
  28195. * A factor used to increase the screen space error of tiles for dynamic screen space error. As this value increases less tiles
  28196. * are requested for rendering and tiles in the distance will have lower detail. If set to zero, the feature will be disabled.
  28197. */
  28198. dynamicScreenSpaceErrorFactor: number;
  28199. /**
  28200. * A ratio of the tileset's height at which the density starts to falloff. If the camera is below this height the
  28201. * full computed density is applied, otherwise the density falls off. This has the effect of higher density at
  28202. * street level views.
  28203. * <p>
  28204. * Valid values are between 0.0 and 1.0.
  28205. * </p>
  28206. */
  28207. dynamicScreenSpaceErrorHeightFalloff: number;
  28208. /**
  28209. * Determines whether the tileset casts or receives shadows from light sources.
  28210. * <p>
  28211. * 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.
  28212. * </p>
  28213. * <p>
  28214. * Shadows are rendered only when {@link Viewer#shadows} is <code>true</code>.
  28215. * </p>
  28216. */
  28217. shadows: ShadowMode;
  28218. /**
  28219. * Determines if the tileset will be shown.
  28220. */
  28221. show: boolean;
  28222. /**
  28223. * Defines how per-feature colors set from the Cesium API or declarative styling blend with the source colors from
  28224. * the original feature, e.g. glTF material or per-point color in the tile.
  28225. */
  28226. colorBlendMode: Cesium3DTileColorBlendMode;
  28227. /**
  28228. * Defines the value used to linearly interpolate between the source color and feature color when the {@link Cesium3DTileset#colorBlendMode} is <code>MIX</code>.
  28229. * 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
  28230. * resulting in a mix of the source color and feature color.
  28231. */
  28232. colorBlendAmount: number;
  28233. /**
  28234. * The event fired to indicate progress of loading new tiles. This event is fired when a new tile
  28235. * is requested, when a requested tile is finished downloading, and when a downloaded tile has been
  28236. * processed and is ready to render.
  28237. * <p>
  28238. * The number of pending tile requests, <code>numberOfPendingRequests</code>, and number of tiles
  28239. * processing, <code>numberOfTilesProcessing</code> are passed to the event listener.
  28240. * </p>
  28241. * <p>
  28242. * This event is fired at the end of the frame after the scene is rendered.
  28243. * </p>
  28244. * @example
  28245. * tileset.loadProgress.addEventListener(function(numberOfPendingRequests, numberOfTilesProcessing) {
  28246. * if ((numberOfPendingRequests === 0) && (numberOfTilesProcessing === 0)) {
  28247. * console.log('Stopped loading');
  28248. * return;
  28249. * }
  28250. *
  28251. * console.log('Loading: requests: ' + numberOfPendingRequests + ', processing: ' + numberOfTilesProcessing);
  28252. * });
  28253. */
  28254. loadProgress: Event;
  28255. /**
  28256. * The event fired to indicate that all tiles that meet the screen space error this frame are loaded. The tileset
  28257. * is completely loaded for this view.
  28258. * <p>
  28259. * This event is fired at the end of the frame after the scene is rendered.
  28260. * </p>
  28261. * @example
  28262. * tileset.allTilesLoaded.addEventListener(function() {
  28263. * console.log('All tiles are loaded');
  28264. * });
  28265. */
  28266. allTilesLoaded: Event;
  28267. /**
  28268. * The event fired to indicate that all tiles that meet the screen space error this frame are loaded. This event
  28269. * is fired once when all tiles in the initial view are loaded.
  28270. * <p>
  28271. * This event is fired at the end of the frame after the scene is rendered.
  28272. * </p>
  28273. * @example
  28274. * tileset.initialTilesLoaded.addEventListener(function() {
  28275. * console.log('Initial tiles are loaded');
  28276. * });
  28277. */
  28278. initialTilesLoaded: Event;
  28279. /**
  28280. * The event fired to indicate that a tile's content was loaded.
  28281. * <p>
  28282. * The loaded {@link Cesium3DTile} is passed to the event listener.
  28283. * </p>
  28284. * <p>
  28285. * This event is fired during the tileset traversal while the frame is being rendered
  28286. * so that updates to the tile take effect in the same frame. Do not create or modify
  28287. * Cesium entities or primitives during the event listener.
  28288. * </p>
  28289. * @example
  28290. * tileset.tileLoad.addEventListener(function(tile) {
  28291. * console.log('A tile was loaded.');
  28292. * });
  28293. */
  28294. tileLoad: Event;
  28295. /**
  28296. * The event fired to indicate that a tile's content was unloaded.
  28297. * <p>
  28298. * The unloaded {@link Cesium3DTile} is passed to the event listener.
  28299. * </p>
  28300. * <p>
  28301. * This event is fired immediately before the tile's content is unloaded while the frame is being
  28302. * rendered so that the event listener has access to the tile's content. Do not create
  28303. * or modify Cesium entities or primitives during the event listener.
  28304. * </p>
  28305. * @example
  28306. * tileset.tileUnload.addEventListener(function(tile) {
  28307. * console.log('A tile was unloaded from the cache.');
  28308. * });
  28309. */
  28310. tileUnload: Event;
  28311. /**
  28312. * The event fired to indicate that a tile's content failed to load.
  28313. * <p>
  28314. * If there are no event listeners, error messages will be logged to the console.
  28315. * </p>
  28316. * <p>
  28317. * The error object passed to the listener contains two properties:
  28318. * <ul>
  28319. * <li><code>url</code>: the url of the failed tile.</li>
  28320. * <li><code>message</code>: the error message.</li>
  28321. * </ul>
  28322. * <p>
  28323. * If multiple contents are present, this event is raised once per inner content with errors.
  28324. * </p>
  28325. * @example
  28326. * tileset.tileFailed.addEventListener(function(error) {
  28327. * console.log('An error occurred loading tile: ' + error.url);
  28328. * console.log('Error: ' + error.message);
  28329. * });
  28330. */
  28331. tileFailed: Event;
  28332. /**
  28333. * This event fires once for each visible tile in a frame. This can be used to manually
  28334. * style a tileset.
  28335. * <p>
  28336. * The visible {@link Cesium3DTile} is passed to the event listener.
  28337. * </p>
  28338. * <p>
  28339. * This event is fired during the tileset traversal while the frame is being rendered
  28340. * so that updates to the tile take effect in the same frame. Do not create or modify
  28341. * Cesium entities or primitives during the event listener.
  28342. * </p>
  28343. * @example
  28344. * tileset.tileVisible.addEventListener(function(tile) {
  28345. * if (tile.content instanceof Cesium.Batched3DModel3DTileContent) {
  28346. * console.log('A Batched 3D Model tile is visible.');
  28347. * }
  28348. * });
  28349. * @example
  28350. * // Apply a red style and then manually set random colors for every other feature when the tile becomes visible.
  28351. * tileset.style = new Cesium.Cesium3DTileStyle({
  28352. * color : 'color("red")'
  28353. * });
  28354. * tileset.tileVisible.addEventListener(function(tile) {
  28355. * const content = tile.content;
  28356. * const featuresLength = content.featuresLength;
  28357. * for (let i = 0; i < featuresLength; i+=2) {
  28358. * content.getFeature(i).color = Cesium.Color.fromRandom();
  28359. * }
  28360. * });
  28361. */
  28362. tileVisible: Event;
  28363. /**
  28364. * Optimization option. Determines if level of detail skipping should be applied during the traversal.
  28365. * <p>
  28366. * The common strategy for replacement-refinement traversal is to store all levels of the tree in memory and require
  28367. * all children to be loaded before the parent can refine. With this optimization levels of the tree can be skipped
  28368. * entirely and children can be rendered alongside their parents. The tileset requires significantly less memory when
  28369. * using this optimization.
  28370. * </p>
  28371. */
  28372. skipLevelOfDetail: boolean;
  28373. /**
  28374. * The screen space error that must be reached before skipping levels of detail.
  28375. * <p>
  28376. * Only used when {@link Cesium3DTileset#skipLevelOfDetail} is <code>true</code>.
  28377. * </p>
  28378. */
  28379. baseScreenSpaceError: number;
  28380. /**
  28381. * Multiplier defining the minimum screen space error to skip.
  28382. * For example, if a tile has screen space error of 100, no tiles will be loaded unless they
  28383. * are leaves or have a screen space error <code><= 100 / skipScreenSpaceErrorFactor</code>.
  28384. * <p>
  28385. * Only used when {@link Cesium3DTileset#skipLevelOfDetail} is <code>true</code>.
  28386. * </p>
  28387. */
  28388. skipScreenSpaceErrorFactor: number;
  28389. /**
  28390. * Constant defining the minimum number of levels to skip when loading tiles. When it is 0, no levels are skipped.
  28391. * For example, if a tile is level 1, no tiles will be loaded unless they are at level greater than 2.
  28392. * <p>
  28393. * Only used when {@link Cesium3DTileset#skipLevelOfDetail} is <code>true</code>.
  28394. * </p>
  28395. */
  28396. skipLevels: number;
  28397. /**
  28398. * When true, only tiles that meet the maximum screen space error will ever be downloaded.
  28399. * Skipping factors are ignored and just the desired tiles are loaded.
  28400. * <p>
  28401. * Only used when {@link Cesium3DTileset#skipLevelOfDetail} is <code>true</code>.
  28402. * </p>
  28403. */
  28404. immediatelyLoadDesiredLevelOfDetail: boolean;
  28405. /**
  28406. * Determines whether siblings of visible tiles are always downloaded during traversal.
  28407. * This may be useful for ensuring that tiles are already available when the viewer turns left/right.
  28408. * <p>
  28409. * Only used when {@link Cesium3DTileset#skipLevelOfDetail} is <code>true</code>.
  28410. * </p>
  28411. */
  28412. loadSiblings: boolean;
  28413. /**
  28414. * The light color when shading models. When <code>undefined</code> the scene's light color is used instead.
  28415. * <p>
  28416. * For example, disabling additional light sources by setting <code>model.imageBasedLighting.imageBasedLightingFactor = new Cartesian2(0.0, 0.0)</code> will make the
  28417. * model much darker. Here, increasing the intensity of the light source will make the model brighter.
  28418. * </p>
  28419. */
  28420. lightColor: Cartesian3;
  28421. /**
  28422. * Whether to cull back-facing geometry. When true, back face culling is determined
  28423. * by the glTF material's doubleSided property; when false, back face culling is disabled.
  28424. */
  28425. backFaceCulling: boolean;
  28426. /**
  28427. * Whether to display the outline for models using the
  28428. * {@link https://github.com/KhronosGroup/glTF/tree/master/extensions/2.0/Vendor/CESIUM_primitive_outline|CESIUM_primitive_outline} extension.
  28429. * When true, outlines are displayed. When false, outlines are not displayed.
  28430. */
  28431. readonly showOutline: boolean;
  28432. /**
  28433. * The {@link SplitDirection} to apply to this tileset.
  28434. */
  28435. splitDirection: SplitDirection;
  28436. /**
  28437. * This property is for debugging only; it is not optimized for production use.
  28438. * <p>
  28439. * Determines if only the tiles from last frame should be used for rendering. This
  28440. * effectively "freezes" the tileset to the previous frame so it is possible to zoom
  28441. * out and see what was rendered.
  28442. * </p>
  28443. */
  28444. debugFreezeFrame: boolean;
  28445. /**
  28446. * This property is for debugging only; it is not optimized for production use.
  28447. * <p>
  28448. * When true, assigns a random color to each tile. This is useful for visualizing
  28449. * what features belong to what tiles, especially with additive refinement where features
  28450. * from parent tiles may be interleaved with features from child tiles.
  28451. * </p>
  28452. */
  28453. debugColorizeTiles: boolean;
  28454. /**
  28455. * This property is for debugging only; it is not optimized for production use.
  28456. * <p>
  28457. * When true, renders each tile's content as a wireframe.
  28458. * </p>
  28459. */
  28460. debugWireframe: boolean;
  28461. /**
  28462. * This property is for debugging only; it is not optimized for production use.
  28463. * <p>
  28464. * When true, renders the bounding volume for each visible tile. The bounding volume is
  28465. * white if the tile has a content bounding volume or is empty; otherwise, it is red. Tiles that don't meet the
  28466. * screen space error and are still refining to their descendants are yellow.
  28467. * </p>
  28468. */
  28469. debugShowBoundingVolume: 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's content. The bounding volume is
  28474. * blue if the tile has a content bounding volume; otherwise it is red.
  28475. * </p>
  28476. */
  28477. debugShowContentBoundingVolume: boolean;
  28478. /**
  28479. * This property is for debugging only; it is not optimized for production use.
  28480. * <p>
  28481. * When true, renders the viewer request volume for each tile.
  28482. * </p>
  28483. */
  28484. debugShowViewerRequestVolume: boolean;
  28485. /**
  28486. * This property is for debugging only; it is not optimized for production use.
  28487. * <p>
  28488. * When true, draws labels to indicate the geometric error of each tile.
  28489. * </p>
  28490. */
  28491. debugShowGeometricError: boolean;
  28492. /**
  28493. * This property is for debugging only; it is not optimized for production use.
  28494. * <p>
  28495. * When true, draws labels to indicate the number of commands, points, triangles and features of each tile.
  28496. * </p>
  28497. */
  28498. debugShowRenderingStatistics: boolean;
  28499. /**
  28500. * This property is for debugging only; it is not optimized for production use.
  28501. * <p>
  28502. * When true, draws labels to indicate the geometry and texture memory usage of each tile.
  28503. * </p>
  28504. */
  28505. debugShowMemoryUsage: boolean;
  28506. /**
  28507. * This property is for debugging only; it is not optimized for production use.
  28508. * <p>
  28509. * When true, draws labels to indicate the url of each tile.
  28510. * </p>
  28511. */
  28512. debugShowUrl: boolean;
  28513. /**
  28514. * Function for examining vector lines as they are being streamed.
  28515. */
  28516. examineVectorLinesFunction: (...params: any[]) => any;
  28517. /**
  28518. * Gets the tileset's asset object property, which contains metadata about the tileset.
  28519. * <p>
  28520. * See the {@link https://github.com/CesiumGS/3d-tiles/tree/main/specification#reference-asset|asset schema reference}
  28521. * in the 3D Tiles spec for the full set of properties.
  28522. * </p>
  28523. */
  28524. readonly asset: any;
  28525. /**
  28526. * Gets the tileset's extensions object property.
  28527. */
  28528. readonly extensions: any;
  28529. /**
  28530. * The {@link ClippingPlaneCollection} used to selectively disable rendering the tileset.
  28531. */
  28532. clippingPlanes: ClippingPlaneCollection;
  28533. /**
  28534. * Gets the tileset's properties dictionary object, which contains metadata about per-feature properties.
  28535. * <p>
  28536. * See the {@link https://github.com/CesiumGS/3d-tiles/tree/main/specification#reference-properties|properties schema reference}
  28537. * in the 3D Tiles spec for the full set of properties.
  28538. * </p>
  28539. * @example
  28540. * console.log('Maximum building height: ' + tileset.properties.height.maximum);
  28541. * console.log('Minimum building height: ' + tileset.properties.height.minimum);
  28542. */
  28543. readonly properties: any;
  28544. /**
  28545. * When <code>true</code>, the tileset's root tile is loaded and the tileset is ready to render.
  28546. * This is set to <code>true</code> right before {@link Cesium3DTileset#readyPromise} is resolved.
  28547. */
  28548. readonly ready: boolean;
  28549. /**
  28550. * Gets the promise that will be resolved when the tileset's root tile is loaded and the tileset is ready to render.
  28551. * <p>
  28552. * This promise is resolved at the end of the frame before the first frame the tileset is rendered in.
  28553. * </p>
  28554. * @example
  28555. * tileset.readyPromise.then(function(tileset) {
  28556. * // tile.properties is not defined until readyPromise resolves.
  28557. * const properties = tileset.properties;
  28558. * if (Cesium.defined(properties)) {
  28559. * for (const name in properties) {
  28560. * console.log(properties[name]);
  28561. * }
  28562. * }
  28563. * });
  28564. */
  28565. readonly readyPromise: Promise<Cesium3DTileset>;
  28566. /**
  28567. * When <code>true</code>, all tiles that meet the screen space error this frame are loaded. The tileset is
  28568. * completely loaded for this view.
  28569. */
  28570. readonly tilesLoaded: boolean;
  28571. /**
  28572. * The resource used to fetch the tileset JSON file
  28573. */
  28574. readonly resource: Resource;
  28575. /**
  28576. * The base path that non-absolute paths in tileset JSON file are relative to.
  28577. */
  28578. readonly basePath: string;
  28579. /**
  28580. * The style, defined using the
  28581. * {@link https://github.com/CesiumGS/3d-tiles/tree/main/specification/Styling|3D Tiles Styling language},
  28582. * applied to each feature in the tileset.
  28583. * <p>
  28584. * Assign <code>undefined</code> to remove the style, which will restore the visual
  28585. * appearance of the tileset to its default when no style was applied.
  28586. * </p>
  28587. * <p>
  28588. * The style is applied to a tile before the {@link Cesium3DTileset#tileVisible}
  28589. * event is raised, so code in <code>tileVisible</code> can manually set a feature's
  28590. * properties (e.g. color and show) after the style is applied. When
  28591. * a new style is assigned any manually set properties are overwritten.
  28592. * </p>
  28593. * <p>
  28594. * Use an always "true" condition to specify the Color for all objects that are not
  28595. * overridden by pre-existing conditions. Otherwise, the default color Cesium.Color.White
  28596. * will be used. Similarly, use an always "true" condition to specify the show property
  28597. * for all objects that are not overridden by pre-existing conditions. Otherwise, the
  28598. * default show value true will be used.
  28599. * </p>
  28600. * @example
  28601. * tileset.style = new Cesium.Cesium3DTileStyle({
  28602. * color : {
  28603. * conditions : [
  28604. * ['${Height} >= 100', 'color("purple", 0.5)'],
  28605. * ['${Height} >= 50', 'color("red")'],
  28606. * ['true', 'color("blue")']
  28607. * ]
  28608. * },
  28609. * show : '${Height} > 0',
  28610. * meta : {
  28611. * description : '"Building id ${id} has height ${Height}."'
  28612. * }
  28613. * });
  28614. */
  28615. style: Cesium3DTileStyle | undefined;
  28616. /**
  28617. * A custom shader to apply to all tiles in the tileset. Only used for
  28618. * contents that use {@link ModelExperimental}. Using custom shaders with a
  28619. * {@link Cesium3DTileStyle} may lead to undefined behavior.
  28620. * <p>
  28621. * To enable {@link ModelExperimental}, set {@link ExperimentalFeatures.enableModelExperimental} or tileset.enableModelExperimental to <code>true</code>.
  28622. * </p>
  28623. */
  28624. customShader: CustomShader | undefined;
  28625. /**
  28626. * The maximum screen space error used to drive level of detail refinement. This value helps determine when a tile
  28627. * refines to its descendants, and therefore plays a major role in balancing performance with visual quality.
  28628. * <p>
  28629. * A tile's screen space error is roughly equivalent to the number of pixels wide that would be drawn if a sphere with a
  28630. * radius equal to the tile's <b>geometric error</b> were rendered at the tile's position. If this value exceeds
  28631. * <code>maximumScreenSpaceError</code> the tile refines to its descendants.
  28632. * </p>
  28633. * <p>
  28634. * Depending on the tileset, <code>maximumScreenSpaceError</code> may need to be tweaked to achieve the right balance.
  28635. * Higher values provide better performance but lower visual quality.
  28636. * </p>
  28637. */
  28638. maximumScreenSpaceError: number;
  28639. /**
  28640. * The maximum amount of GPU memory (in MB) that may be used to cache tiles. This value is estimated from
  28641. * geometry, textures, and batch table textures of loaded tiles. For point clouds, this value also
  28642. * includes per-point metadata.
  28643. * <p>
  28644. * Tiles not in view are unloaded to enforce this.
  28645. * </p>
  28646. * <p>
  28647. * If decreasing this value results in unloading tiles, the tiles are unloaded the next frame.
  28648. * </p>
  28649. * <p>
  28650. * If tiles sized more than <code>maximumMemoryUsage</code> are needed
  28651. * to meet the desired screen space error, determined by {@link Cesium3DTileset#maximumScreenSpaceError},
  28652. * for the current view, then the memory usage of the tiles loaded will exceed
  28653. * <code>maximumMemoryUsage</code>. For example, if the maximum is 256 MB, but
  28654. * 300 MB of tiles are needed to meet the screen space error, then 300 MB of tiles may be loaded. When
  28655. * these tiles go out of view, they will be unloaded.
  28656. * </p>
  28657. */
  28658. maximumMemoryUsage: number;
  28659. /**
  28660. * Options for controlling point size based on geometric error and eye dome lighting.
  28661. */
  28662. pointCloudShading: PointCloudShading;
  28663. /**
  28664. * The root tile.
  28665. */
  28666. readonly root: Cesium3DTile;
  28667. /**
  28668. * The tileset's bounding sphere.
  28669. * @example
  28670. * const tileset = viewer.scene.primitives.add(new Cesium.Cesium3DTileset({
  28671. * url : 'http://localhost:8002/tilesets/Seattle/tileset.json'
  28672. * }));
  28673. *
  28674. * tileset.readyPromise.then(function(tileset) {
  28675. * // Set the camera to view the newly added tileset
  28676. * viewer.camera.viewBoundingSphere(tileset.boundingSphere, new Cesium.HeadingPitchRange(0, -0.5, 0));
  28677. * });
  28678. */
  28679. readonly boundingSphere: BoundingSphere;
  28680. /**
  28681. * A 4x4 transformation matrix that transforms the entire tileset.
  28682. * @example
  28683. * // Adjust a tileset's height from the globe's surface.
  28684. * const heightOffset = 20.0;
  28685. * const boundingSphere = tileset.boundingSphere;
  28686. * const cartographic = Cesium.Cartographic.fromCartesian(boundingSphere.center);
  28687. * const surface = Cesium.Cartesian3.fromRadians(cartographic.longitude, cartographic.latitude, 0.0);
  28688. * const offset = Cesium.Cartesian3.fromRadians(cartographic.longitude, cartographic.latitude, heightOffset);
  28689. * const translation = Cesium.Cartesian3.subtract(offset, surface, new Cesium.Cartesian3());
  28690. * tileset.modelMatrix = Cesium.Matrix4.fromTranslation(translation);
  28691. */
  28692. modelMatrix: Matrix4;
  28693. /**
  28694. * Returns the time, in milliseconds, since the tileset was loaded and first updated.
  28695. */
  28696. readonly timeSinceLoad: number;
  28697. /**
  28698. * The total amount of GPU memory in bytes used by the tileset. This value is estimated from
  28699. * geometry, texture, and batch table textures of loaded tiles. For point clouds, this value also
  28700. * includes per-point metadata.
  28701. */
  28702. readonly totalMemoryUsageInBytes: number;
  28703. /**
  28704. * Determines whether terrain, 3D Tiles or both will be classified by this tileset.
  28705. * <p>
  28706. * This option is only applied to tilesets containing batched 3D models, geometry data, or vector data. Even when undefined, vector data and geometry data
  28707. * must render as classifications and will default to rendering on both terrain and other 3D Tiles tilesets.
  28708. * </p>
  28709. * <p>
  28710. * When enabled for batched 3D model tilesets, there are a few requirements/limitations on the glTF:
  28711. * <ul>
  28712. * <li>POSITION and _BATCHID semantics are required.</li>
  28713. * <li>All indices with the same batch id must occupy contiguous sections of the index buffer.</li>
  28714. * <li>All shaders and techniques are ignored. The generated shader simply multiplies the position by the model-view-projection matrix.</li>
  28715. * <li>The only supported extensions are CESIUM_RTC and WEB3D_quantized_attributes.</li>
  28716. * <li>Only one node is supported.</li>
  28717. * <li>Only one mesh per node is supported.</li>
  28718. * <li>Only one primitive per mesh is supported.</li>
  28719. * </ul>
  28720. * </p>
  28721. */
  28722. readonly classificationType: ClassificationType;
  28723. /**
  28724. * Gets an ellipsoid describing the shape of the globe.
  28725. */
  28726. readonly ellipsoid: Ellipsoid;
  28727. /**
  28728. * Optimization option. Used when {@link Cesium3DTileset#foveatedScreenSpaceError} is true to control the cone size that determines which tiles are deferred.
  28729. * 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}.
  28730. * 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.
  28731. */
  28732. foveatedConeSize: number;
  28733. /**
  28734. * Optimization option. Used when {@link Cesium3DTileset#foveatedScreenSpaceError} is true to control the starting screen space error relaxation for tiles outside the foveated cone.
  28735. * The screen space error will be raised starting with this value up to {@link Cesium3DTileset#maximumScreenSpaceError} based on the provided {@link Cesium3DTileset#foveatedInterpolationCallback}.
  28736. */
  28737. foveatedMinimumScreenSpaceErrorRelaxation: number;
  28738. /**
  28739. * Returns the <code>extras</code> property at the top-level of the tileset JSON, which contains application specific metadata.
  28740. * Returns <code>undefined</code> if <code>extras</code> does not exist.
  28741. */
  28742. readonly extras: any;
  28743. /**
  28744. * The properties for managing image-based lighting on this tileset.
  28745. */
  28746. imageBasedLighting: ImageBasedLighting;
  28747. /**
  28748. * Cesium adds lighting from the earth, sky, atmosphere, and star skybox. This cartesian is used to scale the final
  28749. * diffuse and specular lighting contribution from those sources to the final color. A value of 0.0 will disable those light sources.
  28750. */
  28751. imageBasedLightingFactor: Cartesian2;
  28752. /**
  28753. * The sun's luminance at the zenith in kilo candela per meter squared to use for this model's procedural environment map.
  28754. * This is used when {@link Cesium3DTileset#specularEnvironmentMaps} and {@link Cesium3DTileset#sphericalHarmonicCoefficients} are not defined.
  28755. */
  28756. luminanceAtZenith: number;
  28757. /**
  28758. * The third order spherical harmonic coefficients used for the diffuse color of image-based lighting. When <code>undefined</code>, a diffuse irradiance
  28759. * computed from the atmosphere color is used.
  28760. * <p>
  28761. * There are nine <code>Cartesian3</code> coefficients.
  28762. * 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>
  28763. * </p>
  28764. *
  28765. * These values can be obtained by preprocessing the environment map using the <code>cmgen</code> tool of
  28766. * {@link https://github.com/google/filament/releases|Google's Filament project}. This will also generate a KTX file that can be
  28767. * supplied to {@link Cesium3DTileset#specularEnvironmentMaps}.
  28768. */
  28769. sphericalHarmonicCoefficients: Cartesian3[];
  28770. /**
  28771. * A URL to a KTX file that contains a cube map of the specular lighting and the convoluted specular mipmaps.
  28772. */
  28773. specularEnvironmentMaps: string;
  28774. /**
  28775. * Indicates that only the tileset's vector tiles should be used for classification.
  28776. */
  28777. vectorClassificationOnly: boolean;
  28778. /**
  28779. * Whether vector tiles should keep decoded positions in memory.
  28780. * This is used with {@link Cesium3DTileFeature.getPolylinePositions}.
  28781. */
  28782. vectorKeepDecodedPositions: boolean;
  28783. /**
  28784. * Determines whether the credits of the tileset will be displayed on the screen
  28785. */
  28786. showCreditsOnScreen: boolean;
  28787. /**
  28788. * Label of the feature ID set to use for picking and styling.
  28789. * <p>
  28790. * For EXT_mesh_features, this is the feature ID's label property, or
  28791. * "featureId_N" (where N is the index in the featureIds array) when not
  28792. * specified. EXT_feature_metadata did not have a label field, so such
  28793. * feature ID sets are always labeled "featureId_N" where N is the index in
  28794. * the list of all feature Ids, where feature ID attributes are listed before
  28795. * feature ID textures.
  28796. * </p>
  28797. * <p>
  28798. * If featureIdLabel is set to an integer N, it is converted to
  28799. * the string "featureId_N" automatically. If both per-primitive and
  28800. * per-instance feature IDs are present, the instance feature IDs take
  28801. * priority.
  28802. * </p>
  28803. */
  28804. featureIdLabel: string;
  28805. /**
  28806. * Label of the instance feature ID set used for picking and styling.
  28807. * <p>
  28808. * If instanceFeatureIdLabel is set to an integer N, it is converted to
  28809. * the string "instanceFeatureId_N" automatically.
  28810. * If both per-primitive and per-instance feature IDs are present, the
  28811. * instance feature IDs take priority.
  28812. * </p>
  28813. */
  28814. instanceFeatureIdLabel: string;
  28815. /**
  28816. * Provides a hook to override the method used to request the tileset json
  28817. * useful when fetching tilesets from remote servers
  28818. * @param tilesetUrl - The url of the json file to be fetched
  28819. * @returns A promise that resolves with the fetched json data
  28820. */
  28821. static loadJson(tilesetUrl: Resource | string): Promise<object>;
  28822. /**
  28823. * Marks the tileset's {@link Cesium3DTileset#style} as dirty, which forces all
  28824. * features to re-evaluate the style in the next frame each is visible.
  28825. */
  28826. makeStyleDirty(): void;
  28827. /**
  28828. * Unloads all tiles that weren't selected the previous frame. This can be used to
  28829. * explicitly manage the tile cache and reduce the total number of tiles loaded below
  28830. * {@link Cesium3DTileset#maximumMemoryUsage}.
  28831. * <p>
  28832. * Tile unloads occur at the next frame to keep all the WebGL delete calls
  28833. * within the render loop.
  28834. * </p>
  28835. */
  28836. trimLoadedTiles(): void;
  28837. /**
  28838. * <code>true</code> if the tileset JSON file lists the extension in extensionsUsed; otherwise, <code>false</code>.
  28839. * @param extensionName - The name of the extension to check.
  28840. * @returns <code>true</code> if the tileset JSON file lists the extension in extensionsUsed; otherwise, <code>false</code>.
  28841. */
  28842. hasExtension(extensionName: string): boolean;
  28843. /**
  28844. * Returns true if this object was destroyed; otherwise, false.
  28845. * <br /><br />
  28846. * If this object was destroyed, it should not be used; calling any function other than
  28847. * <code>isDestroyed</code> will result in a {@link DeveloperError} exception.
  28848. * @returns <code>true</code> if this object was destroyed; otherwise, <code>false</code>.
  28849. */
  28850. isDestroyed(): boolean;
  28851. /**
  28852. * Destroys the WebGL resources held by this object. Destroying an object allows for deterministic
  28853. * release of WebGL resources, instead of relying on the garbage collector to destroy this object.
  28854. * <br /><br />
  28855. * Once an object is destroyed, it should not be used; calling any function other than
  28856. * <code>isDestroyed</code> will result in a {@link DeveloperError} exception. Therefore,
  28857. * assign the return value (<code>undefined</code>) to the object as done in the example.
  28858. * @example
  28859. * tileset = tileset && tileset.destroy();
  28860. */
  28861. destroy(): void;
  28862. }
  28863. export namespace Cesium3DTileset {
  28864. /**
  28865. * 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,
  28866. * interpolating between {@link Cesium3DTileset#foveatedMinimumScreenSpaceErrorRelaxation} and {@link Cesium3DTileset#maximumScreenSpaceError}.
  28867. * @param p - The start value to interpolate.
  28868. * @param q - The end value to interpolate.
  28869. * @param time - The time of interpolation generally in the range <code>[0.0, 1.0]</code>.
  28870. */
  28871. type foveatedInterpolationCallback = (p: number, q: number, time: number) => number;
  28872. }
  28873. /**
  28874. * A ParticleEmitter that emits particles from a circle.
  28875. * Particles will be positioned within a circle and have initial velocities going along the z vector.
  28876. * @param [radius = 1.0] - The radius of the circle in meters.
  28877. */
  28878. export class CircleEmitter {
  28879. constructor(radius?: number);
  28880. /**
  28881. * The radius of the circle in meters.
  28882. */
  28883. radius: number;
  28884. /**
  28885. * The angle of the cone in radians.
  28886. */
  28887. angle: number;
  28888. }
  28889. /**
  28890. * A classification primitive represents a volume enclosing geometry in the {@link Scene} to be highlighted.
  28891. * <p>
  28892. * A primitive combines geometry instances with an {@link Appearance} that describes the full shading, including
  28893. * {@link Material} and {@link RenderState}. Roughly, the geometry instance defines the structure and placement,
  28894. * and the appearance defines the visual characteristics. Decoupling geometry and appearance allows us to mix
  28895. * and match most of them and add a new geometry or appearance independently of each other.
  28896. * Only {@link PerInstanceColorAppearance} with the same color across all instances is supported at this time when using
  28897. * ClassificationPrimitive directly.
  28898. * For full {@link Appearance} support when classifying terrain or 3D Tiles use {@link GroundPrimitive} instead.
  28899. * </p>
  28900. * <p>
  28901. * For correct rendering, this feature requires the EXT_frag_depth WebGL extension. For hardware that do not support this extension, there
  28902. * will be rendering artifacts for some viewing angles.
  28903. * </p>
  28904. * <p>
  28905. * Valid geometries are {@link BoxGeometry}, {@link CylinderGeometry}, {@link EllipsoidGeometry}, {@link PolylineVolumeGeometry}, and {@link SphereGeometry}.
  28906. * </p>
  28907. * <p>
  28908. * Geometries that follow the surface of the ellipsoid, such as {@link CircleGeometry}, {@link CorridorGeometry}, {@link EllipseGeometry}, {@link PolygonGeometry}, and {@link RectangleGeometry},
  28909. * are also valid if they are extruded volumes; otherwise, they will not be rendered.
  28910. * </p>
  28911. * @param [options] - Object with the following properties:
  28912. * @param [options.geometryInstances] - The geometry instances to render. This can either be a single instance or an array of length one.
  28913. * @param [options.appearance] - The appearance used to render the primitive. Defaults to PerInstanceColorAppearance when GeometryInstances have a color attribute.
  28914. * @param [options.show = true] - Determines if this primitive will be shown.
  28915. * @param [options.vertexCacheOptimize = false] - When <code>true</code>, geometry vertices are optimized for the pre and post-vertex-shader caches.
  28916. * @param [options.interleave = false] - When <code>true</code>, geometry vertex attributes are interleaved, which can slightly improve rendering performance but increases load time.
  28917. * @param [options.compressVertices = true] - When <code>true</code>, the geometry vertices are compressed, which will save memory.
  28918. * @param [options.releaseGeometryInstances = true] - When <code>true</code>, the primitive does not keep a reference to the input <code>geometryInstances</code> to save memory.
  28919. * @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.
  28920. * @param [options.asynchronous = true] - Determines if the primitive will be created asynchronously or block until ready. If false initializeTerrainHeights() must be called first.
  28921. * @param [options.classificationType = ClassificationType.BOTH] - Determines whether terrain, 3D Tiles or both will be classified.
  28922. * @param [options.debugShowBoundingVolume = false] - For debugging only. Determines if this primitive's commands' bounding spheres are shown.
  28923. * @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
  28924. * creation for the volumes to be created before the geometry is released or options.releaseGeometryInstance must be <code>false</code>.
  28925. */
  28926. export class ClassificationPrimitive {
  28927. constructor(options?: {
  28928. geometryInstances?: any[] | GeometryInstance;
  28929. appearance?: Appearance;
  28930. show?: boolean;
  28931. vertexCacheOptimize?: boolean;
  28932. interleave?: boolean;
  28933. compressVertices?: boolean;
  28934. releaseGeometryInstances?: boolean;
  28935. allowPicking?: boolean;
  28936. asynchronous?: boolean;
  28937. classificationType?: ClassificationType;
  28938. debugShowBoundingVolume?: boolean;
  28939. debugShowShadowVolume?: boolean;
  28940. });
  28941. /**
  28942. * The geometry instance rendered with this primitive. This may
  28943. * be <code>undefined</code> if <code>options.releaseGeometryInstances</code>
  28944. * is <code>true</code> when the primitive is constructed.
  28945. * <p>
  28946. * Changing this property after the primitive is rendered has no effect.
  28947. * </p>
  28948. * <p>
  28949. * Because of the rendering technique used, all geometry instances must be the same color.
  28950. * If there is an instance with a differing color, a <code>DeveloperError</code> will be thrown
  28951. * on the first attempt to render.
  28952. * </p>
  28953. */
  28954. readonly geometryInstances: any[] | GeometryInstance;
  28955. /**
  28956. * Determines if the primitive will be shown. This affects all geometry
  28957. * instances in the primitive.
  28958. */
  28959. show: boolean;
  28960. /**
  28961. * Determines whether terrain, 3D Tiles or both will be classified.
  28962. */
  28963. classificationType: ClassificationType;
  28964. /**
  28965. * This property is for debugging only; it is not for production use nor is it optimized.
  28966. * <p>
  28967. * Draws the bounding sphere for each draw command in the primitive.
  28968. * </p>
  28969. */
  28970. debugShowBoundingVolume: boolean;
  28971. /**
  28972. * This property is for debugging only; it is not for production use nor is it optimized.
  28973. * <p>
  28974. * Draws the shadow volume for each geometry in the primitive.
  28975. * </p>
  28976. */
  28977. debugShowShadowVolume: boolean;
  28978. /**
  28979. * When <code>true</code>, geometry vertices are optimized for the pre and post-vertex-shader caches.
  28980. */
  28981. readonly vertexCacheOptimize: boolean;
  28982. /**
  28983. * Determines if geometry vertex attributes are interleaved, which can slightly improve rendering performance.
  28984. */
  28985. readonly interleave: boolean;
  28986. /**
  28987. * When <code>true</code>, the primitive does not keep a reference to the input <code>geometryInstances</code> to save memory.
  28988. */
  28989. readonly releaseGeometryInstances: boolean;
  28990. /**
  28991. * When <code>true</code>, each geometry instance will only be pickable with {@link Scene#pick}. When <code>false</code>, GPU memory is saved.
  28992. */
  28993. readonly allowPicking: boolean;
  28994. /**
  28995. * Determines if the geometry instances will be created and batched on a web worker.
  28996. */
  28997. readonly asynchronous: boolean;
  28998. /**
  28999. * When <code>true</code>, geometry vertices are compressed, which will save memory.
  29000. */
  29001. readonly compressVertices: boolean;
  29002. /**
  29003. * Determines if the primitive is complete and ready to render. If this property is
  29004. * true, the primitive will be rendered the next time that {@link ClassificationPrimitive#update}
  29005. * is called.
  29006. */
  29007. readonly ready: boolean;
  29008. /**
  29009. * Gets a promise that resolves when the primitive is ready to render.
  29010. */
  29011. readonly readyPromise: Promise<ClassificationPrimitive>;
  29012. /**
  29013. * Determines if ClassificationPrimitive rendering is supported.
  29014. * @param scene - The scene.
  29015. * @returns <code>true</code> if ClassificationPrimitives are supported; otherwise, returns <code>false</code>
  29016. */
  29017. static isSupported(scene: Scene): boolean;
  29018. /**
  29019. * Called when {@link Viewer} or {@link CesiumWidget} render the scene to
  29020. * get the draw commands needed to render this primitive.
  29021. * <p>
  29022. * Do not call this function directly. This is documented just to
  29023. * list the exceptions that may be propagated when the scene is rendered:
  29024. * </p>
  29025. */
  29026. update(): void;
  29027. /**
  29028. * Returns the modifiable per-instance attributes for a {@link GeometryInstance}.
  29029. * @example
  29030. * const attributes = primitive.getGeometryInstanceAttributes('an id');
  29031. * attributes.color = Cesium.ColorGeometryInstanceAttribute.toValue(Cesium.Color.AQUA);
  29032. * attributes.show = Cesium.ShowGeometryInstanceAttribute.toValue(true);
  29033. * @param id - The id of the {@link GeometryInstance}.
  29034. * @returns The typed array in the attribute's format or undefined if the is no instance with id.
  29035. */
  29036. getGeometryInstanceAttributes(id: any): any;
  29037. /**
  29038. * Returns true if this object was destroyed; otherwise, false.
  29039. * <p>
  29040. * If this object was destroyed, it should not be used; calling any function other than
  29041. * <code>isDestroyed</code> will result in a {@link DeveloperError} exception.
  29042. * </p>
  29043. * @returns <code>true</code> if this object was destroyed; otherwise, <code>false</code>.
  29044. */
  29045. isDestroyed(): boolean;
  29046. /**
  29047. * Destroys the WebGL resources held by this object. Destroying an object allows for deterministic
  29048. * release of WebGL resources, instead of relying on the garbage collector to destroy this object.
  29049. * <p>
  29050. * Once an object is destroyed, it should not be used; calling any function other than
  29051. * <code>isDestroyed</code> will result in a {@link DeveloperError} exception. Therefore,
  29052. * assign the return value (<code>undefined</code>) to the object as done in the example.
  29053. * </p>
  29054. * @example
  29055. * e = e && e.destroy();
  29056. */
  29057. destroy(): void;
  29058. }
  29059. /**
  29060. * Whether a classification affects terrain, 3D Tiles or both.
  29061. */
  29062. export enum ClassificationType {
  29063. /**
  29064. * Only terrain will be classified.
  29065. */
  29066. TERRAIN = 0,
  29067. /**
  29068. * Only 3D Tiles will be classified.
  29069. */
  29070. CESIUM_3D_TILE = 1,
  29071. /**
  29072. * Both terrain and 3D Tiles will be classified.
  29073. */
  29074. BOTH = 2
  29075. }
  29076. /**
  29077. * A Plane in Hessian Normal form to be used with {@link ClippingPlaneCollection}.
  29078. * Compatible with mathematics functions in {@link Plane}
  29079. * @param normal - The plane's normal (normalized).
  29080. * @param distance - The shortest distance from the origin to the plane. The sign of
  29081. * <code>distance</code> determines which side of the plane the origin
  29082. * is on. If <code>distance</code> is positive, the origin is in the half-space
  29083. * in the direction of the normal; if negative, the origin is in the half-space
  29084. * opposite to the normal; if zero, the plane passes through the origin.
  29085. */
  29086. export class ClippingPlane {
  29087. constructor(normal: Cartesian3, distance: number);
  29088. /**
  29089. * The shortest distance from the origin to the plane. The sign of
  29090. * <code>distance</code> determines which side of the plane the origin
  29091. * is on. If <code>distance</code> is positive, the origin is in the half-space
  29092. * in the direction of the normal; if negative, the origin is in the half-space
  29093. * opposite to the normal; if zero, the plane passes through the origin.
  29094. */
  29095. distance: number;
  29096. /**
  29097. * The plane's normal.
  29098. */
  29099. normal: Cartesian3;
  29100. /**
  29101. * Create a ClippingPlane from a Plane object.
  29102. * @param plane - The plane containing parameters to copy
  29103. * @param [result] - The object on which to store the result
  29104. * @returns The ClippingPlane generated from the plane's parameters.
  29105. */
  29106. static fromPlane(plane: Plane, result?: ClippingPlane): ClippingPlane;
  29107. /**
  29108. * Clones the ClippingPlane without setting its ownership.
  29109. * @param clippingPlane - The ClippingPlane to be cloned
  29110. * @param [result] - The object on which to store the cloned parameters.
  29111. * @returns a clone of the input ClippingPlane
  29112. */
  29113. static clone(clippingPlane: ClippingPlane, result?: ClippingPlane): ClippingPlane;
  29114. }
  29115. /**
  29116. * Specifies a set of clipping planes. Clipping planes selectively disable rendering in a region on the
  29117. * outside of the specified list of {@link ClippingPlane} objects for a single gltf model, 3D Tileset, or the globe.
  29118. * <p>
  29119. * 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
  29120. * through the center of the object.
  29121. * </p>
  29122. * <p>
  29123. * 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.
  29124. * </p>
  29125. * @example
  29126. * // This clipping plane's distance is positive, which means its normal
  29127. * // is facing the origin. This will clip everything that is behind
  29128. * // the plane, which is anything with y coordinate < -5.
  29129. * const clippingPlanes = new Cesium.ClippingPlaneCollection({
  29130. * planes : [
  29131. * new Cesium.ClippingPlane(new Cesium.Cartesian3(0.0, 1.0, 0.0), 5.0)
  29132. * ],
  29133. * });
  29134. * // Create an entity and attach the ClippingPlaneCollection to the model.
  29135. * const entity = viewer.entities.add({
  29136. * position : Cesium.Cartesian3.fromDegrees(-123.0744619, 44.0503706, 10000),
  29137. * model : {
  29138. * uri : 'model.gltf',
  29139. * minimumPixelSize : 128,
  29140. * maximumScale : 20000,
  29141. * clippingPlanes : clippingPlanes
  29142. * }
  29143. * });
  29144. * viewer.zoomTo(entity);
  29145. * @param [options] - Object with the following properties:
  29146. * @param [options.planes = []] - An array of {@link ClippingPlane} objects used to selectively disable rendering on the outside of each plane.
  29147. * @param [options.enabled = true] - Determines whether the clipping planes are active.
  29148. * @param [options.modelMatrix = Matrix4.IDENTITY] - The 4x4 transformation matrix specifying an additional transform relative to the clipping planes original coordinate system.
  29149. * @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.
  29150. * @param [options.edgeColor = Color.WHITE] - The color applied to highlight the edge along which an object is clipped.
  29151. * @param [options.edgeWidth = 0.0] - The width, in pixels, of the highlight applied to the edge along which an object is clipped.
  29152. */
  29153. export class ClippingPlaneCollection {
  29154. constructor(options?: {
  29155. planes?: ClippingPlane[];
  29156. enabled?: boolean;
  29157. modelMatrix?: Matrix4;
  29158. unionClippingRegions?: boolean;
  29159. edgeColor?: Color;
  29160. edgeWidth?: number;
  29161. });
  29162. /**
  29163. * The 4x4 transformation matrix specifying an additional transform relative to the clipping planes
  29164. * original coordinate system.
  29165. */
  29166. modelMatrix: Matrix4;
  29167. /**
  29168. * The color applied to highlight the edge along which an object is clipped.
  29169. */
  29170. edgeColor: Color;
  29171. /**
  29172. * The width, in pixels, of the highlight applied to the edge along which an object is clipped.
  29173. */
  29174. edgeWidth: number;
  29175. /**
  29176. * An event triggered when a new clipping plane is added to the collection. Event handlers
  29177. * are passed the new plane and the index at which it was added.
  29178. */
  29179. planeAdded: Event;
  29180. /**
  29181. * An event triggered when a new clipping plane is removed from the collection. Event handlers
  29182. * are passed the new plane and the index from which it was removed.
  29183. */
  29184. planeRemoved: Event;
  29185. /**
  29186. * Returns the number of planes in this collection. This is commonly used with
  29187. * {@link ClippingPlaneCollection#get} to iterate over all the planes
  29188. * in the collection.
  29189. */
  29190. readonly length: number;
  29191. /**
  29192. * If true, a region will be clipped if it is on the outside of any plane in the
  29193. * collection. Otherwise, a region will only be clipped if it is on the
  29194. * outside of every plane.
  29195. */
  29196. unionClippingRegions: boolean;
  29197. /**
  29198. * If true, clipping will be enabled.
  29199. */
  29200. enabled: boolean;
  29201. /**
  29202. * Adds the specified {@link ClippingPlane} to the collection to be used to selectively disable rendering
  29203. * on the outside of each plane. Use {@link ClippingPlaneCollection#unionClippingRegions} to modify
  29204. * how modify the clipping behavior of multiple planes.
  29205. * @param plane - The ClippingPlane to add to the collection.
  29206. */
  29207. add(plane: ClippingPlane): void;
  29208. /**
  29209. * Returns the plane in the collection at the specified index. Indices are zero-based
  29210. * and increase as planes are added. Removing a plane shifts all planes after
  29211. * it to the left, changing their indices. This function is commonly used with
  29212. * {@link ClippingPlaneCollection#length} to iterate over all the planes
  29213. * in the collection.
  29214. * @param index - The zero-based index of the plane.
  29215. * @returns The ClippingPlane at the specified index.
  29216. */
  29217. get(index: number): ClippingPlane;
  29218. /**
  29219. * Checks whether this collection contains a ClippingPlane equal to the given ClippingPlane.
  29220. * @param [clippingPlane] - The ClippingPlane to check for.
  29221. * @returns true if this collection contains the ClippingPlane, false otherwise.
  29222. */
  29223. contains(clippingPlane?: ClippingPlane): boolean;
  29224. /**
  29225. * Removes the first occurrence of the given ClippingPlane from the collection.
  29226. * @returns <code>true</code> if the plane was removed; <code>false</code> if the plane was not found in the collection.
  29227. */
  29228. remove(clippingPlane: ClippingPlane): boolean;
  29229. /**
  29230. * Removes all planes from the collection.
  29231. */
  29232. removeAll(): void;
  29233. /**
  29234. * Called when {@link Viewer} or {@link CesiumWidget} render the scene to
  29235. * build the resources for clipping planes.
  29236. * <p>
  29237. * Do not call this function directly.
  29238. * </p>
  29239. */
  29240. update(): void;
  29241. /**
  29242. * Returns true if this object was destroyed; otherwise, false.
  29243. * <br /><br />
  29244. * If this object was destroyed, it should not be used; calling any function other than
  29245. * <code>isDestroyed</code> will result in a {@link DeveloperError} exception.
  29246. * @returns <code>true</code> if this object was destroyed; otherwise, <code>false</code>.
  29247. */
  29248. isDestroyed(): boolean;
  29249. /**
  29250. * Destroys the WebGL resources held by this object. Destroying an object allows for deterministic
  29251. * release of WebGL resources, instead of relying on the garbage collector to destroy this object.
  29252. * <br /><br />
  29253. * Once an object is destroyed, it should not be used; calling any function other than
  29254. * <code>isDestroyed</code> will result in a {@link DeveloperError} exception. Therefore,
  29255. * assign the return value (<code>undefined</code>) to the object as done in the example.
  29256. * @example
  29257. * clippingPlanes = clippingPlanes && clippingPlanes.destroy();
  29258. */
  29259. destroy(): void;
  29260. }
  29261. /**
  29262. * A renderable collection of clouds in the 3D scene.
  29263. * <br /><br />
  29264. * <div align='center'>
  29265. * <img src='Images/CumulusCloud.png' width='400' height='300' /><br />
  29266. * Example cumulus clouds
  29267. * </div>
  29268. * <br /><br />
  29269. * Clouds are added and removed from the collection using {@link CloudCollection#add}
  29270. * and {@link CloudCollection#remove}.
  29271. * @example
  29272. * // Create a cloud collection with two cumulus clouds
  29273. * const clouds = scene.primitives.add(new Cesium.CloudCollection());
  29274. * clouds.add({
  29275. * position : new Cesium.Cartesian3(1.0, 2.0, 3.0),
  29276. * maximumSize: new Cesium.Cartesian3(20.0, 12.0, 8.0)
  29277. * });
  29278. * clouds.add({
  29279. * position : new Cesium.Cartesian3(4.0, 5.0, 6.0),
  29280. * maximumSize: new Cesium.Cartesian3(15.0, 9.0, 9.0),
  29281. * slice: 0.5
  29282. * });
  29283. * @param [options] - Object with the following properties:
  29284. * @param [options.show = true] - Whether to display the clouds.
  29285. * @param [options.noiseDetail = 16.0] - Desired amount of detail in the noise texture.
  29286. * @param [options.noiseOffset = Cartesian3.ZERO] - Desired translation of data in noise texture.
  29287. * @param [options.debugBillboards = false] - For debugging only. Determines if the billboards are rendered with an opaque color.
  29288. * @param [options.debugEllipsoids = false] - For debugging only. Determines if the clouds will be rendered as opaque ellipsoids.
  29289. */
  29290. export class CloudCollection {
  29291. constructor(options?: {
  29292. show?: boolean;
  29293. noiseDetail?: number;
  29294. noiseOffset?: number;
  29295. debugBillboards?: boolean;
  29296. debugEllipsoids?: boolean;
  29297. });
  29298. /**
  29299. * <p>
  29300. * Controls the amount of detail captured in the precomputed noise texture
  29301. * used to render the cumulus clouds. In order for the texture to be tileable,
  29302. * this must be a power of two. For best results, set this to be a power of two
  29303. * between <code>8.0</code> and <code>32.0</code> (inclusive).
  29304. * </p>
  29305. *
  29306. * <div align='center'>
  29307. * <table border='0' cellpadding='5'><tr>
  29308. * <td align='center'>
  29309. * <code>clouds.noiseDetail = 8.0;</code><br/>
  29310. * <img src='Images/CloudCollection.noiseDetail8.png' width='250' height='158' />
  29311. * </td>
  29312. * <td align='center'>
  29313. * <code>clouds.noiseDetail = 32.0;</code><br/>
  29314. * <img src='Images/CloudCollection.noiseDetail32.png' width='250' height='158' />
  29315. * </td>
  29316. * </tr></table>
  29317. * </div>
  29318. */
  29319. noiseDetail: number;
  29320. /**
  29321. * <p>
  29322. * Applies a translation to noise texture coordinates to generate different data.
  29323. * This can be modified if the default noise does not generate good-looking clouds.
  29324. * </p>
  29325. *
  29326. * <div align='center'>
  29327. * <table border='0' cellpadding='5'><tr>
  29328. * <td align='center'>
  29329. * <code>default</code><br/>
  29330. * <img src='Images/CloudCollection.noiseOffsetdefault.png' width='250' height='158' />
  29331. * </td>
  29332. * <td align='center'>
  29333. * <code>clouds.noiseOffset = new Cesium.Cartesian3(10, 20, 10);</code><br/>
  29334. * <img src='Images/CloudCollection.noiseOffsetx10y20z10.png' width='250' height='158' />
  29335. * </td>
  29336. * </tr></table>
  29337. * </div>
  29338. */
  29339. noiseOffset: Cartesian3;
  29340. /**
  29341. * Determines if billboards in this collection will be shown.
  29342. */
  29343. show: boolean;
  29344. /**
  29345. * This property is for debugging only; it is not for production use nor is it optimized.
  29346. * <p>
  29347. * Renders the billboards with one opaque color for the sake of debugging.
  29348. * </p>
  29349. */
  29350. debugBillboards: boolean;
  29351. /**
  29352. * This property is for debugging only; it is not for production use nor is it optimized.
  29353. * <p>
  29354. * Draws the clouds as opaque, monochrome ellipsoids for the sake of debugging.
  29355. * If <code>debugBillboards</code> is also true, then the ellipsoids will draw on top of the billboards.
  29356. * </p>
  29357. */
  29358. debugEllipsoids: boolean;
  29359. /**
  29360. * Returns the number of clouds in this collection.
  29361. */
  29362. length: number;
  29363. /**
  29364. * Creates and adds a cloud with the specified initial properties to the collection.
  29365. * The added cloud is returned so it can be modified or removed from the collection later.
  29366. * @example
  29367. * // Example 1: Add a cumulus cloud, specifying all the default values.
  29368. * const c = clouds.add({
  29369. * show : true,
  29370. * position : Cesium.Cartesian3.ZERO,
  29371. * scale : new Cesium.Cartesian2(20.0, 12.0),
  29372. * maximumSize: new Cesium.Cartesian3(20.0, 12.0, 12.0),
  29373. * slice: -1.0,
  29374. * cloudType : CloudType.CUMULUS
  29375. * });
  29376. * @example
  29377. * // Example 2: Specify only the cloud's cartographic position.
  29378. * const c = clouds.add({
  29379. * position : Cesium.Cartesian3.fromDegrees(longitude, latitude, height)
  29380. * });
  29381. * @param [options] - A template describing the cloud's properties as shown in Example 1.
  29382. * @returns The cloud that was added to the collection.
  29383. */
  29384. add(options?: any): CumulusCloud;
  29385. /**
  29386. * Removes a cloud from the collection.
  29387. * @example
  29388. * const c = clouds.add(...);
  29389. * clouds.remove(c); // Returns true
  29390. * @param cloud - The cloud to remove.
  29391. * @returns <code>true</code> if the cloud was removed; <code>false</code> if the cloud was not found in the collection.
  29392. */
  29393. remove(cloud: CumulusCloud): boolean;
  29394. /**
  29395. * Removes all clouds from the collection.
  29396. * @example
  29397. * clouds.add(...);
  29398. * clouds.add(...);
  29399. * clouds.removeAll();
  29400. */
  29401. removeAll(): void;
  29402. /**
  29403. * Check whether this collection contains a given cloud.
  29404. * @param [cloud] - The cloud to check for.
  29405. * @returns true if this collection contains the cloud, false otherwise.
  29406. */
  29407. contains(cloud?: CumulusCloud): boolean;
  29408. /**
  29409. * Returns the cloud in the collection at the specified index. Indices are zero-based
  29410. * and increase as clouds are added. Removing a cloud shifts all clouds after
  29411. * it to the left, changing their indices. This function is commonly used with
  29412. * {@link CloudCollection#length} to iterate over all the clouds in the collection.
  29413. * @example
  29414. * // Toggle the show property of every cloud in the collection
  29415. * const len = clouds.length;
  29416. * for (let i = 0; i < len; ++i) {
  29417. * const c = clouds.get(i);
  29418. * c.show = !c.show;
  29419. * }
  29420. * @param index - The zero-based index of the cloud.
  29421. * @returns The cloud at the specified index.
  29422. */
  29423. get(index: number): CumulusCloud;
  29424. /**
  29425. * Returns true if this object was destroyed; otherwise, false.
  29426. * <br /><br />
  29427. * If this object was destroyed, it should not be used; calling any function other than
  29428. * <code>isDestroyed</code> will result in a {@link DeveloperError} exception.
  29429. * @returns <code>true</code> if this object was destroyed; otherwise, <code>false</code>.
  29430. */
  29431. isDestroyed(): boolean;
  29432. /**
  29433. * Destroys the WebGL resources held by this object. Destroying an object allows for deterministic
  29434. * release of WebGL resources, instead of relying on the garbage collector to destroy this object.
  29435. * <br /><br />
  29436. * Once an object is destroyed, it should not be used; calling any function other than
  29437. * <code>isDestroyed</code> will result in a {@link DeveloperError} exception. Therefore,
  29438. * assign the return value (<code>undefined</code>) to the object as done in the example.
  29439. * @example
  29440. * clouds = clouds && clouds.destroy();
  29441. */
  29442. destroy(): void;
  29443. }
  29444. /**
  29445. * Specifies the type of the cloud that is added to a {@link CloudCollection} in {@link CloudCollection#add}.
  29446. */
  29447. export enum CloudType {
  29448. /**
  29449. * Cumulus cloud.
  29450. */
  29451. CUMULUS = 0
  29452. }
  29453. /**
  29454. * Defines different modes for blending between a target color and a primitive's source color.
  29455. *
  29456. * HIGHLIGHT multiplies the source color by the target color
  29457. * REPLACE replaces the source color with the target color
  29458. * MIX blends the source color and target color together
  29459. */
  29460. export enum ColorBlendMode {
  29461. HIGHLIGHT = 0,
  29462. REPLACE = 1,
  29463. MIX = 2
  29464. }
  29465. /**
  29466. * An expression for a style applied to a {@link Cesium3DTileset}.
  29467. * <p>
  29468. * Evaluates a conditions expression defined using the
  29469. * {@link https://github.com/CesiumGS/3d-tiles/tree/main/specification/Styling|3D Tiles Styling language}.
  29470. * </p>
  29471. * <p>
  29472. * Implements the {@link StyleExpression} interface.
  29473. * </p>
  29474. * @example
  29475. * const expression = new Cesium.ConditionsExpression({
  29476. * conditions : [
  29477. * ['${Area} > 10, 'color("#FF0000")'],
  29478. * ['${id} !== "1"', 'color("#00FF00")'],
  29479. * ['true', 'color("#FFFFFF")']
  29480. * ]
  29481. * });
  29482. * expression.evaluateColor(feature, result); // returns a Cesium.Color object
  29483. * @param [conditionsExpression] - The conditions expression defined using the 3D Tiles Styling language.
  29484. * @param [defines] - Defines in the style.
  29485. */
  29486. export class ConditionsExpression {
  29487. constructor(conditionsExpression?: any, defines?: any);
  29488. /**
  29489. * Gets the conditions expression defined in the 3D Tiles Styling language.
  29490. */
  29491. readonly conditionsExpression: any;
  29492. /**
  29493. * Evaluates the result of an expression, optionally using the provided feature's properties. If the result of
  29494. * the expression in the
  29495. * {@link https://github.com/CesiumGS/3d-tiles/tree/main/specification/Styling|3D Tiles Styling language}
  29496. * is of type <code>Boolean</code>, <code>Number</code>, or <code>String</code>, the corresponding JavaScript
  29497. * primitive type will be returned. If the result is a <code>RegExp</code>, a Javascript <code>RegExp</code>
  29498. * object will be returned. If the result is a <code>Cartesian2</code>, <code>Cartesian3</code>, or <code>Cartesian4</code>,
  29499. * a {@link Cartesian2}, {@link Cartesian3}, or {@link Cartesian4} object will be returned. If the <code>result</code> argument is
  29500. * a {@link Color}, the {@link Cartesian4} value is converted to a {@link Color} and then returned.
  29501. * @param feature - The feature whose properties may be used as variables in the expression.
  29502. * @param [result] - The object onto which to store the result.
  29503. * @returns The result of evaluating the expression.
  29504. */
  29505. evaluate(feature: Cesium3DTileFeature, result?: any): boolean | number | string | RegExp | Cartesian2 | Cartesian3 | Cartesian4 | Color;
  29506. /**
  29507. * Evaluates the result of a Color expression, using the values defined by a feature.
  29508. * <p>
  29509. * This is equivalent to {@link ConditionsExpression#evaluate} but always returns a {@link Color} object.
  29510. * </p>
  29511. * @param feature - The feature whose properties may be used as variables in the expression.
  29512. * @param [result] - The object in which to store the result
  29513. * @returns The modified result parameter or a new Color instance if one was not provided.
  29514. */
  29515. evaluateColor(feature: Cesium3DTileFeature, result?: Color): Color;
  29516. }
  29517. /**
  29518. * A ParticleEmitter that emits particles within a cone.
  29519. * Particles will be positioned at the tip of the cone and have initial velocities going towards the base.
  29520. * @param [angle = Cesium.Math.toRadians(30.0)] - The angle of the cone in radians.
  29521. */
  29522. export class ConeEmitter {
  29523. constructor(angle?: number);
  29524. }
  29525. /**
  29526. * The credit display is responsible for displaying credits on screen.
  29527. * @example
  29528. * const creditDisplay = new Cesium.CreditDisplay(creditContainer);
  29529. * @param container - The HTML element where credits will be displayed
  29530. * @param [delimiter = ' • '] - The string to separate text credits
  29531. * @param [viewport = document.body] - The HTML element that will contain the credits popup
  29532. */
  29533. export class CreditDisplay {
  29534. constructor(container: HTMLElement, delimiter?: string, viewport?: HTMLElement);
  29535. /**
  29536. * The HTML element where credits will be displayed.
  29537. */
  29538. container: HTMLElement;
  29539. /**
  29540. * Adds a credit to the list of current credits to be displayed in the credit container
  29541. * @param credit - The credit to display
  29542. */
  29543. addCredit(credit: Credit): void;
  29544. /**
  29545. * Adds credits that will persist until they are removed
  29546. * @param credit - The credit to added to defaults
  29547. */
  29548. addDefaultCredit(credit: Credit): void;
  29549. /**
  29550. * Removes a default credit
  29551. * @param credit - The credit to be removed from defaults
  29552. */
  29553. removeDefaultCredit(credit: Credit): void;
  29554. /**
  29555. * Updates the credit display before a new frame is rendered.
  29556. */
  29557. update(): void;
  29558. /**
  29559. * Resets the credit display to a beginning of frame state, clearing out current credits.
  29560. */
  29561. beginFrame(): void;
  29562. /**
  29563. * Sets the credit display to the end of frame state, displaying credits from the last frame in the credit container.
  29564. */
  29565. endFrame(): void;
  29566. /**
  29567. * Destroys the resources held by this object. Destroying an object allows for deterministic
  29568. * release of resources, instead of relying on the garbage collector to destroy this object.
  29569. * <br /><br />
  29570. * Once an object is destroyed, it should not be used; calling any function other than
  29571. * <code>isDestroyed</code> will result in a {@link DeveloperError} exception. Therefore,
  29572. * assign the return value (<code>undefined</code>) to the object as done in the example.
  29573. */
  29574. destroy(): void;
  29575. /**
  29576. * Returns true if this object was destroyed; otherwise, false.
  29577. * <br /><br />
  29578. * @returns <code>true</code> if this object was destroyed; otherwise, <code>false</code>.
  29579. */
  29580. isDestroyed(): boolean;
  29581. /**
  29582. * Gets or sets the Cesium logo credit.
  29583. */
  29584. static cesiumCredit: Credit;
  29585. }
  29586. /**
  29587. * Determines which triangles, if any, are culled.
  29588. */
  29589. export enum CullFace {
  29590. /**
  29591. * Front-facing triangles are culled.
  29592. */
  29593. FRONT = WebGLConstants.FRONT,
  29594. /**
  29595. * Back-facing triangles are culled.
  29596. */
  29597. BACK = WebGLConstants.BACK,
  29598. /**
  29599. * Both front-facing and back-facing triangles are culled.
  29600. */
  29601. FRONT_AND_BACK = WebGLConstants.FRONT_AND_BACK
  29602. }
  29603. /**
  29604. * A cumulus cloud billboard positioned in the 3D scene, that is created and rendered using a {@link CloudCollection}.
  29605. * A cloud is created and its initial properties are set by calling {@link CloudCollection#add}.
  29606. * and {@link CloudCollection#remove}.
  29607. * <br /><br />
  29608. * <div align='center'>
  29609. * <img src='Images/CumulusCloud.png' width='400' height='300' /><br />
  29610. * Example cumulus clouds
  29611. * </div>
  29612. */
  29613. export class CumulusCloud {
  29614. constructor();
  29615. /**
  29616. * Determines if this cumulus cloud will be shown. Use this to hide or show a cloud, instead
  29617. * of removing it and re-adding it to the collection.
  29618. */
  29619. show: boolean;
  29620. /**
  29621. * Gets or sets the Cartesian position of this cumulus cloud.
  29622. */
  29623. position: Cartesian3;
  29624. /**
  29625. * <p>Gets or sets the scale of the cumulus cloud billboard in meters.
  29626. * The <code>scale</code> property will affect the size of the billboard,
  29627. * but not the cloud's actual appearance.</p>
  29628. * <div align='center'>
  29629. * <table border='0' cellpadding='5'><tr>
  29630. * <td align='center'>
  29631. * <code>cloud.scale = new Cesium.Cartesian2(12, 8);</code><br/>
  29632. * <img src='Images/CumulusCloud.scalex12y8.png' width='250' height='158' />
  29633. * </td>
  29634. * <td align='center'>
  29635. * <code>cloud.scale = new Cesium.Cartesian2(24, 10);</code><br/>
  29636. * <img src='Images/CumulusCloud.scalex24y10.png' width='250' height='158' />
  29637. * </td>
  29638. * </tr></table>
  29639. * </div>
  29640. *
  29641. * <p>To modify the cloud's appearance, modify its <code>maximumSize</code>
  29642. * and <code>slice</code> properties.</p>
  29643. */
  29644. scale: Cartesian2;
  29645. /**
  29646. * <p>Gets or sets the maximum size of the cumulus cloud rendered on the billboard.
  29647. * This defines a maximum ellipsoid volume that the cloud can appear in.
  29648. * Rather than guaranteeing a specific size, this specifies a boundary for the
  29649. * cloud to appear in, and changing it can affect the shape of the cloud.</p>
  29650. * <p>Changing the z-value of <code>maximumSize</code> has the most dramatic effect
  29651. * on the cloud's appearance because it changes the depth of the cloud, and thus the
  29652. * positions at which the cloud-shaping texture is sampled.</p>
  29653. * <div align='center'>
  29654. * <table border='0' cellpadding='5'>
  29655. * <tr>
  29656. * <td align='center'>
  29657. * <code>cloud.maximumSize = new Cesium.Cartesian3(14, 9, 10);</code><br/>
  29658. * <img src='Images/CumulusCloud.maximumSizex14y9z10.png' width='250' height='158' />
  29659. * </td>
  29660. * <td align='center'>
  29661. * <code>cloud.maximumSize.x = 25;</code><br/>
  29662. * <img src='Images/CumulusCloud.maximumSizex25.png' width='250' height='158' />
  29663. * </td>
  29664. * </tr>
  29665. * <tr>
  29666. * <td align='center'>
  29667. * <code>cloud.maximumSize.y = 5;</code><br/>
  29668. * <img src='Images/CumulusCloud.maximumSizey5.png' width='250' height='158' />
  29669. * </td>
  29670. * <td align='center'>
  29671. * <code>cloud.maximumSize.z = 17;</code><br/>
  29672. * <img src='Images/CumulusCloud.maximumSizez17.png' width='250' height='158' />
  29673. * </td>
  29674. * </tr>
  29675. * </table>
  29676. * </div>
  29677. *
  29678. * <p>To modify the billboard's actual size, modify the cloud's <code>scale</code> property.</p>
  29679. */
  29680. maximumSize: Cartesian3;
  29681. /**
  29682. * Sets the color of the cloud
  29683. */
  29684. color: Color;
  29685. /**
  29686. * <p>Gets or sets the "slice" of the cloud that is rendered on the billboard, i.e.
  29687. * the specific cross-section of the cloud chosen for the billboard's appearance.
  29688. * Given a value between 0 and 1, the slice specifies how deeply into the cloud
  29689. * to intersect based on its maximum size in the z-direction.</p>
  29690. * <div align='center'>
  29691. * <table border='0' cellpadding='5'><tr>
  29692. * <td align='center'><code>cloud.slice = 0.32;</code><br/><img src='Images/CumulusCloud.slice0.32.png' width='250' height='158' /></td>
  29693. * <td align='center'><code>cloud.slice = 0.5;</code><br/><img src='Images/CumulusCloud.slice0.5.png' width='250' height='158' /></td>
  29694. * <td align='center'><code>cloud.slice = 0.6;</code><br/><img src='Images/CumulusCloud.slice0.6.png' width='250' height='158' /></td>
  29695. * </tr></table>
  29696. * </div>
  29697. *
  29698. * <br />
  29699. * <p>Due to the nature in which this slice is calculated,
  29700. * values below <code>0.2</code> may result in cross-sections that are too small,
  29701. * and the edge of the ellipsoid will be visible. Similarly, values above <code>0.7</code>
  29702. * will cause the cloud to appear smaller. Values outside the range <code>[0.1, 0.9]</code>
  29703. * should be avoided entirely because they do not produce desirable results.</p>
  29704. *
  29705. * <div align='center'>
  29706. * <table border='0' cellpadding='5'><tr>
  29707. * <td align='center'><code>cloud.slice = 0.08;</code><br/><img src='Images/CumulusCloud.slice0.08.png' width='250' height='158' /></td>
  29708. * <td align='center'><code>cloud.slice = 0.8;</code><br/><img src='Images/CumulusCloud.slice0.8.png' width='250' height='158' /></td>
  29709. * </tr></table>
  29710. * </div>
  29711. *
  29712. * <p>If <code>slice</code> is set to a negative number, the cloud will not render a cross-section.
  29713. * Instead, it will render the outside of the ellipsoid that is visible. For clouds with
  29714. * small values of `maximumSize.z`, this can produce good-looking results, but for larger
  29715. * clouds, this can result in a cloud that is undesirably warped to the ellipsoid volume.</p>
  29716. *
  29717. * <div align='center'>
  29718. * <table border='0' cellpadding='5'><tr>
  29719. * <td align='center'>
  29720. * <code>cloud.slice = -1.0;<br/>cloud.maximumSize.z = 18;</code><br/>
  29721. * <img src='Images/CumulusCloud.slice-1z18.png' width='250' height='158' />
  29722. * </td>
  29723. * <td align='center'>
  29724. * <code>cloud.slice = -1.0;<br/>cloud.maximumSize.z = 30;</code><br/>
  29725. * <img src='Images/CumulusCloud.slice-1z30.png' width='250' height='158' /></td>
  29726. * </tr></table>
  29727. * </div>
  29728. */
  29729. slice: number;
  29730. /**
  29731. * Gets or sets the brightness of the cloud. This can be used to give clouds
  29732. * a darker, grayer appearance.
  29733. * <br /><br />
  29734. * <div align='center'>
  29735. * <table border='0' cellpadding='5'><tr>
  29736. * <td align='center'><code>cloud.brightness = 1.0;</code><br/><img src='Images/CumulusCloud.brightness1.png' width='250' height='158' /></td>
  29737. * <td align='center'><code>cloud.brightness = 0.6;</code><br/><img src='Images/CumulusCloud.brightness0.6.png' width='250' height='158' /></td>
  29738. * <td align='center'><code>cloud.brightness = 0.0;</code><br/><img src='Images/CumulusCloud.brightness0.png' width='250' height='158' /></td>
  29739. * </tr></table>
  29740. * </div>
  29741. */
  29742. brightness: number;
  29743. }
  29744. /**
  29745. * Visualizes a vertex attribute by displaying it as a color for debugging.
  29746. * <p>
  29747. * Components for well-known unit-length vectors, i.e., <code>normal</code>,
  29748. * <code>tangent</code>, and <code>bitangent</code>, are scaled and biased
  29749. * from [-1.0, 1.0] to (-1.0, 1.0).
  29750. * </p>
  29751. * @example
  29752. * const primitive = new Cesium.Primitive({
  29753. * geometryInstances : // ...
  29754. * appearance : new Cesium.DebugAppearance({
  29755. * attributeName : 'normal'
  29756. * })
  29757. * });
  29758. * @param options - Object with the following properties:
  29759. * @param options.attributeName - The name of the attribute to visualize.
  29760. * @param [options.perInstanceAttribute = false] - Boolean that determines whether this attribute is a per-instance geometry attribute.
  29761. * @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>.
  29762. * @param [options.vertexShaderSource] - Optional GLSL vertex shader source to override the default vertex shader.
  29763. * @param [options.fragmentShaderSource] - Optional GLSL fragment shader source to override the default fragment shader.
  29764. * @param [options.renderState] - Optional render state to override the default render state.
  29765. */
  29766. export class DebugAppearance {
  29767. constructor(options: {
  29768. attributeName: string;
  29769. perInstanceAttribute?: boolean;
  29770. glslDatatype?: string;
  29771. vertexShaderSource?: string;
  29772. fragmentShaderSource?: string;
  29773. renderState?: any;
  29774. });
  29775. /**
  29776. * This property is part of the {@link Appearance} interface, but is not
  29777. * used by {@link DebugAppearance} since a fully custom fragment shader is used.
  29778. */
  29779. material: Material;
  29780. /**
  29781. * When <code>true</code>, the geometry is expected to appear translucent.
  29782. */
  29783. translucent: boolean;
  29784. /**
  29785. * The GLSL source code for the vertex shader.
  29786. */
  29787. readonly vertexShaderSource: string;
  29788. /**
  29789. * The GLSL source code for the fragment shader. The full fragment shader
  29790. * source is built procedurally taking into account the {@link DebugAppearance#material}.
  29791. * Use {@link DebugAppearance#getFragmentShaderSource} to get the full source.
  29792. */
  29793. readonly fragmentShaderSource: string;
  29794. /**
  29795. * The WebGL fixed-function state to use when rendering the geometry.
  29796. */
  29797. readonly renderState: any;
  29798. /**
  29799. * When <code>true</code>, the geometry is expected to be closed.
  29800. */
  29801. readonly closed: boolean;
  29802. /**
  29803. * The name of the attribute being visualized.
  29804. */
  29805. readonly attributeName: string;
  29806. /**
  29807. * The GLSL datatype of the attribute being visualized.
  29808. */
  29809. readonly glslDatatype: string;
  29810. /**
  29811. * Returns the full GLSL fragment shader source, which for {@link DebugAppearance} is just
  29812. * {@link DebugAppearance#fragmentShaderSource}.
  29813. * @returns The full GLSL fragment shader source.
  29814. */
  29815. getFragmentShaderSource(): string;
  29816. /**
  29817. * Determines if the geometry is translucent based on {@link DebugAppearance#translucent}.
  29818. * @returns <code>true</code> if the appearance is translucent.
  29819. */
  29820. isTranslucent(): boolean;
  29821. /**
  29822. * Creates a render state. This is not the final render state instance; instead,
  29823. * it can contain a subset of render state properties identical to the render state
  29824. * created in the context.
  29825. * @returns The render state.
  29826. */
  29827. getRenderState(): any;
  29828. }
  29829. /**
  29830. * Draws the outline of the camera's view frustum.
  29831. * @example
  29832. * primitives.add(new Cesium.DebugCameraPrimitive({
  29833. * camera : camera,
  29834. * color : Cesium.Color.YELLOW
  29835. * }));
  29836. * @param options - Object with the following properties:
  29837. * @param options.camera - The camera.
  29838. * @param [options.frustumSplits] - Distances to the near and far planes of the camera frustums. This overrides the camera's frustum near and far values.
  29839. * @param [options.color = Color.CYAN] - The color of the debug outline.
  29840. * @param [options.updateOnChange = true] - Whether the primitive updates when the underlying camera changes.
  29841. * @param [options.show = true] - Determines if this primitive will be shown.
  29842. * @param [options.id] - A user-defined object to return when the instance is picked with {@link Scene#pick}.
  29843. */
  29844. export class DebugCameraPrimitive {
  29845. constructor(options: {
  29846. camera: Camera;
  29847. frustumSplits?: number[];
  29848. color?: Color;
  29849. updateOnChange?: boolean;
  29850. show?: boolean;
  29851. id?: any;
  29852. });
  29853. /**
  29854. * Determines if this primitive will be shown.
  29855. */
  29856. show: boolean;
  29857. /**
  29858. * User-defined value returned when the primitive is picked.
  29859. */
  29860. id: any;
  29861. /**
  29862. * Returns true if this object was destroyed; otherwise, false.
  29863. * <p>
  29864. * If this object was destroyed, it should not be used; calling any function other than
  29865. * <code>isDestroyed</code> will result in a {@link DeveloperError} exception.
  29866. * </p>
  29867. * @returns <code>true</code> if this object was destroyed; otherwise, <code>false</code>.
  29868. */
  29869. isDestroyed(): boolean;
  29870. /**
  29871. * Destroys the WebGL resources held by this object. Destroying an object allows for deterministic
  29872. * release of WebGL resources, instead of relying on the garbage collector to destroy this object.
  29873. * <p>
  29874. * Once an object is destroyed, it should not be used; calling any function other than
  29875. * <code>isDestroyed</code> will result in a {@link DeveloperError} exception. Therefore,
  29876. * assign the return value (<code>undefined</code>) to the object as done in the example.
  29877. * </p>
  29878. * @example
  29879. * p = p && p.destroy();
  29880. */
  29881. destroy(): void;
  29882. }
  29883. /**
  29884. * Draws the axes of a reference frame defined by a matrix that transforms to world
  29885. * coordinates, i.e., Earth's WGS84 coordinates. The most prominent example is
  29886. * a primitives <code>modelMatrix</code>.
  29887. * <p>
  29888. * The X axis is red; Y is green; and Z is blue.
  29889. * </p>
  29890. * <p>
  29891. * This is for debugging only; it is not optimized for production use.
  29892. * </p>
  29893. * @example
  29894. * primitives.add(new Cesium.DebugModelMatrixPrimitive({
  29895. * modelMatrix : primitive.modelMatrix, // primitive to debug
  29896. * length : 100000.0,
  29897. * width : 10.0
  29898. * }));
  29899. * @param [options] - Object with the following properties:
  29900. * @param [options.length = 10000000.0] - The length of the axes in meters.
  29901. * @param [options.width = 2.0] - The width of the axes in pixels.
  29902. * @param [options.modelMatrix = Matrix4.IDENTITY] - The 4x4 matrix that defines the reference frame, i.e., origin plus axes, to visualize.
  29903. * @param [options.show = true] - Determines if this primitive will be shown.
  29904. * @param [options.id] - A user-defined object to return when the instance is picked with {@link Scene#pick}
  29905. */
  29906. export class DebugModelMatrixPrimitive {
  29907. constructor(options?: {
  29908. length?: number;
  29909. width?: number;
  29910. modelMatrix?: Matrix4;
  29911. show?: boolean;
  29912. id?: any;
  29913. });
  29914. /**
  29915. * The length of the axes in meters.
  29916. */
  29917. length: number;
  29918. /**
  29919. * The width of the axes in pixels.
  29920. */
  29921. width: number;
  29922. /**
  29923. * Determines if this primitive will be shown.
  29924. */
  29925. show: boolean;
  29926. /**
  29927. * The 4x4 matrix that defines the reference frame, i.e., origin plus axes, to visualize.
  29928. */
  29929. modelMatrix: Matrix4;
  29930. /**
  29931. * User-defined value returned when the primitive is picked.
  29932. */
  29933. id: any;
  29934. /**
  29935. * Returns true if this object was destroyed; otherwise, false.
  29936. * <p>
  29937. * If this object was destroyed, it should not be used; calling any function other than
  29938. * <code>isDestroyed</code> will result in a {@link DeveloperError} exception.
  29939. * </p>
  29940. * @returns <code>true</code> if this object was destroyed; otherwise, <code>false</code>.
  29941. */
  29942. isDestroyed(): boolean;
  29943. /**
  29944. * Destroys the WebGL resources held by this object. Destroying an object allows for deterministic
  29945. * release of WebGL resources, instead of relying on the garbage collector to destroy this object.
  29946. * <p>
  29947. * Once an object is destroyed, it should not be used; calling any function other than
  29948. * <code>isDestroyed</code> will result in a {@link DeveloperError} exception. Therefore,
  29949. * assign the return value (<code>undefined</code>) to the object as done in the example.
  29950. * </p>
  29951. * @example
  29952. * p = p && p.destroy();
  29953. */
  29954. destroy(): void;
  29955. }
  29956. /**
  29957. * Determines the function used to compare two depths for the depth test.
  29958. */
  29959. export enum DepthFunction {
  29960. /**
  29961. * The depth test never passes.
  29962. */
  29963. NEVER = WebGLConstants.NEVER,
  29964. /**
  29965. * The depth test passes if the incoming depth is less than the stored depth.
  29966. */
  29967. LESS = WebGLConstants.LESS,
  29968. /**
  29969. * The depth test passes if the incoming depth is equal to the stored depth.
  29970. */
  29971. EQUAL = WebGLConstants.EQUAL,
  29972. /**
  29973. * The depth test passes if the incoming depth is less than or equal to the stored depth.
  29974. */
  29975. LESS_OR_EQUAL = WebGLConstants.LEQUAL,
  29976. /**
  29977. * The depth test passes if the incoming depth is greater than the stored depth.
  29978. */
  29979. GREATER = WebGLConstants.GREATER,
  29980. /**
  29981. * The depth test passes if the incoming depth is not equal to the stored depth.
  29982. */
  29983. NOT_EQUAL = WebGLConstants.NOTEQUAL,
  29984. /**
  29985. * The depth test passes if the incoming depth is greater than or equal to the stored depth.
  29986. */
  29987. GREATER_OR_EQUAL = WebGLConstants.GEQUAL,
  29988. /**
  29989. * The depth test always passes.
  29990. */
  29991. ALWAYS = WebGLConstants.ALWAYS
  29992. }
  29993. /**
  29994. * A light that gets emitted in a single direction from infinitely far away.
  29995. * @param options - Object with the following properties:
  29996. * @param options.direction - The direction in which light gets emitted.
  29997. * @param [options.color = Color.WHITE] - The color of the light.
  29998. * @param [options.intensity = 1.0] - The intensity of the light.
  29999. */
  30000. export class DirectionalLight {
  30001. constructor(options: {
  30002. direction: Cartesian3;
  30003. color?: Color;
  30004. intensity?: number;
  30005. });
  30006. /**
  30007. * The direction in which light gets emitted.
  30008. */
  30009. direction: Cartesian3;
  30010. /**
  30011. * The color of the light.
  30012. */
  30013. color: Color;
  30014. /**
  30015. * The intensity of the light.
  30016. */
  30017. intensity: number;
  30018. }
  30019. /**
  30020. * A policy for discarding tile images that contain no data (and so aren't actually images).
  30021. * This policy discards {@link DiscardEmptyTileImagePolicy.EMPTY_IMAGE}, which is
  30022. * expected to be used in place of any empty tile images by the image loading code.
  30023. */
  30024. export class DiscardEmptyTileImagePolicy {
  30025. constructor();
  30026. /**
  30027. * Determines if the discard policy is ready to process images.
  30028. * @returns True if the discard policy is ready to process images; otherwise, false.
  30029. */
  30030. isReady(): boolean;
  30031. /**
  30032. * Given a tile image, decide whether to discard that image.
  30033. * @param image - An image to test.
  30034. * @returns True if the image should be discarded; otherwise, false.
  30035. */
  30036. shouldDiscardImage(image: HTMLImageElement): boolean;
  30037. /**
  30038. * Default value for representing an empty image.
  30039. */
  30040. static readonly EMPTY_IMAGE: HTMLImageElement;
  30041. }
  30042. /**
  30043. * A policy for discarding tile images that match a known image containing a
  30044. * "missing" image.
  30045. * @param options - Object with the following properties:
  30046. * @param options.missingImageUrl - The URL of the known missing image.
  30047. * @param options.pixelsToCheck - An array of {@link Cartesian2} pixel positions to
  30048. * compare against the missing image.
  30049. * @param [options.disableCheckIfAllPixelsAreTransparent = false] - If true, the discard check will be disabled
  30050. * if all of the pixelsToCheck in the missingImageUrl have an alpha value of 0. If false, the
  30051. * discard check will proceed no matter the values of the pixelsToCheck.
  30052. */
  30053. export class DiscardMissingTileImagePolicy {
  30054. constructor(options: {
  30055. missingImageUrl: Resource | string;
  30056. pixelsToCheck: Cartesian2[];
  30057. disableCheckIfAllPixelsAreTransparent?: boolean;
  30058. });
  30059. /**
  30060. * Determines if the discard policy is ready to process images.
  30061. * @returns True if the discard policy is ready to process images; otherwise, false.
  30062. */
  30063. isReady(): boolean;
  30064. /**
  30065. * Given a tile image, decide whether to discard that image.
  30066. * @param image - An image to test.
  30067. * @returns True if the image should be discarded; otherwise, false.
  30068. */
  30069. shouldDiscardImage(image: HTMLImageElement): boolean;
  30070. }
  30071. /**
  30072. * An appearance for geometry on the surface of the ellipsoid like {@link PolygonGeometry}
  30073. * and {@link RectangleGeometry}, which supports all materials like {@link MaterialAppearance}
  30074. * with {@link MaterialAppearance.MaterialSupport.ALL}. However, this appearance requires
  30075. * fewer vertex attributes since the fragment shader can procedurally compute <code>normal</code>,
  30076. * <code>tangent</code>, and <code>bitangent</code>.
  30077. * @example
  30078. * const primitive = new Cesium.Primitive({
  30079. * geometryInstances : new Cesium.GeometryInstance({
  30080. * geometry : new Cesium.PolygonGeometry({
  30081. * vertexFormat : Cesium.EllipsoidSurfaceAppearance.VERTEX_FORMAT,
  30082. * // ...
  30083. * })
  30084. * }),
  30085. * appearance : new Cesium.EllipsoidSurfaceAppearance({
  30086. * material : Cesium.Material.fromType('Stripe')
  30087. * })
  30088. * });
  30089. * @param [options] - Object with the following properties:
  30090. * @param [options.flat = false] - When <code>true</code>, flat shading is used in the fragment shader, which means lighting is not taking into account.
  30091. * @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}.
  30092. * @param [options.translucent = true] - When <code>true</code>, the geometry is expected to appear translucent so {@link EllipsoidSurfaceAppearance#renderState} has alpha blending enabled.
  30093. * @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.
  30094. * @param [options.material = Material.ColorType] - The material used to determine the fragment color.
  30095. * @param [options.vertexShaderSource] - Optional GLSL vertex shader source to override the default vertex shader.
  30096. * @param [options.fragmentShaderSource] - Optional GLSL fragment shader source to override the default fragment shader.
  30097. * @param [options.renderState] - Optional render state to override the default render state.
  30098. */
  30099. export class EllipsoidSurfaceAppearance {
  30100. constructor(options?: {
  30101. flat?: boolean;
  30102. faceForward?: boolean;
  30103. translucent?: boolean;
  30104. aboveGround?: boolean;
  30105. material?: Material;
  30106. vertexShaderSource?: string;
  30107. fragmentShaderSource?: string;
  30108. renderState?: any;
  30109. });
  30110. /**
  30111. * The material used to determine the fragment color. Unlike other {@link EllipsoidSurfaceAppearance}
  30112. * properties, this is not read-only, so an appearance's material can change on the fly.
  30113. */
  30114. material: Material;
  30115. /**
  30116. * When <code>true</code>, the geometry is expected to appear translucent.
  30117. */
  30118. translucent: boolean;
  30119. /**
  30120. * The GLSL source code for the vertex shader.
  30121. */
  30122. readonly vertexShaderSource: string;
  30123. /**
  30124. * The GLSL source code for the fragment shader. The full fragment shader
  30125. * source is built procedurally taking into account {@link EllipsoidSurfaceAppearance#material},
  30126. * {@link EllipsoidSurfaceAppearance#flat}, and {@link EllipsoidSurfaceAppearance#faceForward}.
  30127. * Use {@link EllipsoidSurfaceAppearance#getFragmentShaderSource} to get the full source.
  30128. */
  30129. readonly fragmentShaderSource: string;
  30130. /**
  30131. * The WebGL fixed-function state to use when rendering the geometry.
  30132. * <p>
  30133. * The render state can be explicitly defined when constructing a {@link EllipsoidSurfaceAppearance}
  30134. * instance, or it is set implicitly via {@link EllipsoidSurfaceAppearance#translucent}
  30135. * and {@link EllipsoidSurfaceAppearance#aboveGround}.
  30136. * </p>
  30137. */
  30138. readonly renderState: any;
  30139. /**
  30140. * When <code>true</code>, the geometry is expected to be closed so
  30141. * {@link EllipsoidSurfaceAppearance#renderState} has backface culling enabled.
  30142. * If the viewer enters the geometry, it will not be visible.
  30143. */
  30144. readonly closed: boolean;
  30145. /**
  30146. * The {@link VertexFormat} that this appearance instance is compatible with.
  30147. * A geometry can have more vertex attributes and still be compatible - at a
  30148. * potential performance cost - but it can't have less.
  30149. */
  30150. readonly vertexFormat: VertexFormat;
  30151. /**
  30152. * When <code>true</code>, flat shading is used in the fragment shader,
  30153. * which means lighting is not taking into account.
  30154. */
  30155. readonly flat: boolean;
  30156. /**
  30157. * When <code>true</code>, the fragment shader flips the surface normal
  30158. * as needed to ensure that the normal faces the viewer to avoid
  30159. * dark spots. This is useful when both sides of a geometry should be
  30160. * shaded like {@link WallGeometry}.
  30161. */
  30162. readonly faceForward: boolean;
  30163. /**
  30164. * When <code>true</code>, the geometry is expected to be on the ellipsoid's
  30165. * surface - not at a constant height above it - so {@link EllipsoidSurfaceAppearance#renderState}
  30166. * has backface culling enabled.
  30167. */
  30168. readonly aboveGround: boolean;
  30169. /**
  30170. * The {@link VertexFormat} that all {@link EllipsoidSurfaceAppearance} instances
  30171. * are compatible with, which requires only <code>position</code> and <code>st</code>
  30172. * attributes. Other attributes are procedurally computed in the fragment shader.
  30173. */
  30174. static readonly VERTEX_FORMAT: VertexFormat;
  30175. /**
  30176. * Procedurally creates the full GLSL fragment shader source. For {@link EllipsoidSurfaceAppearance},
  30177. * this is derived from {@link EllipsoidSurfaceAppearance#fragmentShaderSource}, {@link EllipsoidSurfaceAppearance#flat},
  30178. * and {@link EllipsoidSurfaceAppearance#faceForward}.
  30179. * @returns The full GLSL fragment shader source.
  30180. */
  30181. getFragmentShaderSource(): string;
  30182. /**
  30183. * Determines if the geometry is translucent based on {@link EllipsoidSurfaceAppearance#translucent} and {@link Material#isTranslucent}.
  30184. * @returns <code>true</code> if the appearance is translucent.
  30185. */
  30186. isTranslucent(): boolean;
  30187. /**
  30188. * Creates a render state. This is not the final render state instance; instead,
  30189. * it can contain a subset of render state properties identical to the render state
  30190. * created in the context.
  30191. * @returns The render state.
  30192. */
  30193. getRenderState(): any;
  30194. }
  30195. /**
  30196. * An expression for a style applied to a {@link Cesium3DTileset}.
  30197. * <p>
  30198. * Evaluates an expression defined using the
  30199. * {@link https://github.com/CesiumGS/3d-tiles/tree/main/specification/Styling|3D Tiles Styling language}.
  30200. * </p>
  30201. * <p>
  30202. * Implements the {@link StyleExpression} interface.
  30203. * </p>
  30204. * @example
  30205. * const expression = new Cesium.Expression('(regExp("^Chest").test(${County})) && (${YearBuilt} >= 1970)');
  30206. * expression.evaluate(feature); // returns true or false depending on the feature's properties
  30207. * @example
  30208. * const expression = new Cesium.Expression('(${Temperature} > 90) ? color("red") : color("white")');
  30209. * expression.evaluateColor(feature, result); // returns a Cesium.Color object
  30210. * @param [expression] - The expression defined using the 3D Tiles Styling language.
  30211. * @param [defines] - Defines in the style.
  30212. */
  30213. export class Expression {
  30214. constructor(expression?: string, defines?: any);
  30215. /**
  30216. * Gets the expression defined in the 3D Tiles Styling language.
  30217. */
  30218. readonly expression: string;
  30219. /**
  30220. * Evaluates the result of an expression, optionally using the provided feature's properties. If the result of
  30221. * the expression in the
  30222. * {@link https://github.com/CesiumGS/3d-tiles/tree/main/specification/Styling|3D Tiles Styling language}
  30223. * is of type <code>Boolean</code>, <code>Number</code>, or <code>String</code>, the corresponding JavaScript
  30224. * primitive type will be returned. If the result is a <code>RegExp</code>, a Javascript <code>RegExp</code>
  30225. * object will be returned. If the result is a <code>Cartesian2</code>, <code>Cartesian3</code>, or <code>Cartesian4</code>,
  30226. * a {@link Cartesian2}, {@link Cartesian3}, or {@link Cartesian4} object will be returned. If the <code>result</code> argument is
  30227. * a {@link Color}, the {@link Cartesian4} value is converted to a {@link Color} and then returned.
  30228. * @param feature - The feature whose properties may be used as variables in the expression.
  30229. * @param [result] - The object onto which to store the result.
  30230. * @returns The result of evaluating the expression.
  30231. */
  30232. evaluate(feature: Cesium3DTileFeature, result?: any): boolean | number | string | RegExp | Cartesian2 | Cartesian3 | Cartesian4 | Color;
  30233. /**
  30234. * Evaluates the result of a Color expression, optionally using the provided feature's properties.
  30235. * <p>
  30236. * This is equivalent to {@link Expression#evaluate} but always returns a {@link Color} object.
  30237. * </p>
  30238. * @param feature - The feature whose properties may be used as variables in the expression.
  30239. * @param [result] - The object in which to store the result
  30240. * @returns The modified result parameter or a new Color instance if one was not provided.
  30241. */
  30242. evaluateColor(feature: Cesium3DTileFeature, result?: Color): Color;
  30243. }
  30244. /**
  30245. * Blends the atmosphere to geometry far from the camera for horizon views. Allows for additional
  30246. * performance improvements by rendering less geometry and dispatching less terrain requests.
  30247. */
  30248. export class Fog {
  30249. constructor();
  30250. /**
  30251. * <code>true</code> if fog is enabled, <code>false</code> otherwise.
  30252. */
  30253. enabled: boolean;
  30254. /**
  30255. * <code>true</code> if fog is renderable in shaders, <code>false</code> otherwise.
  30256. * This allows to benefits from optimized tile loading strategy based on fog density without the actual visual rendering.
  30257. */
  30258. renderable: boolean;
  30259. /**
  30260. * A scalar that determines the density of the fog. Terrain that is in full fog are culled.
  30261. * The density of the fog increases as this number approaches 1.0 and becomes less dense as it approaches zero.
  30262. * The more dense the fog is, the more aggressively the terrain is culled. For example, if the camera is a height of
  30263. * 1000.0m above the ellipsoid, increasing the value to 3.0e-3 will cause many tiles close to the viewer be culled.
  30264. * Decreasing the value will push the fog further from the viewer, but decrease performance as more of the terrain is rendered.
  30265. */
  30266. density: number;
  30267. /**
  30268. * A factor used to increase the screen space error of terrain tiles when they are partially in fog. The effect is to reduce
  30269. * the number of terrain tiles requested for rendering. If set to zero, the feature will be disabled. If the value is increased
  30270. * for mountainous regions, less tiles will need to be requested, but the terrain meshes near the horizon may be a noticeably
  30271. * lower resolution. If the value is increased in a relatively flat area, there will be little noticeable change on the horizon.
  30272. */
  30273. screenSpaceErrorFactor: number;
  30274. /**
  30275. * 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
  30276. * the brightness at all.
  30277. */
  30278. minimumBrightness: number;
  30279. }
  30280. /**
  30281. * Monitors the frame rate (frames per second) in a {@link Scene} and raises an event if the frame rate is
  30282. * lower than a threshold. Later, if the frame rate returns to the required level, a separate event is raised.
  30283. * To avoid creating multiple FrameRateMonitors for a single {@link Scene}, use {@link FrameRateMonitor.fromScene}
  30284. * instead of constructing an instance explicitly.
  30285. * @param [options] - Object with the following properties:
  30286. * @param options.scene - The Scene instance for which to monitor performance.
  30287. * @param [options.samplingWindow = 5.0] - The length of the sliding window over which to compute the average frame rate, in seconds.
  30288. * @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
  30289. * switches back to the tab) before starting to measure performance, in seconds.
  30290. * @param [options.warmupPeriod = 5.0] - The length of the warmup period, in seconds. During the warmup period, a separate
  30291. * (usually lower) frame rate is required.
  30292. * @param [options.minimumFrameRateDuringWarmup = 4] - The minimum frames-per-second that are required for acceptable performance during
  30293. * the warmup period. If the frame rate averages less than this during any samplingWindow during the warmupPeriod, the
  30294. * lowFrameRate event will be raised and the page will redirect to the redirectOnLowFrameRateUrl, if any.
  30295. * @param [options.minimumFrameRateAfterWarmup = 8] - The minimum frames-per-second that are required for acceptable performance after
  30296. * the end of the warmup period. If the frame rate averages less than this during any samplingWindow after the warmupPeriod, the
  30297. * lowFrameRate event will be raised and the page will redirect to the redirectOnLowFrameRateUrl, if any.
  30298. */
  30299. export class FrameRateMonitor {
  30300. constructor(options?: {
  30301. scene: Scene;
  30302. samplingWindow?: number;
  30303. quietPeriod?: number;
  30304. warmupPeriod?: number;
  30305. minimumFrameRateDuringWarmup?: number;
  30306. minimumFrameRateAfterWarmup?: number;
  30307. });
  30308. /**
  30309. * Gets or sets the length of the sliding window over which to compute the average frame rate, in seconds.
  30310. */
  30311. samplingWindow: number;
  30312. /**
  30313. * Gets or sets the length of time to wait at startup and each time the page becomes visible (i.e. when the user
  30314. * switches back to the tab) before starting to measure performance, in seconds.
  30315. */
  30316. quietPeriod: number;
  30317. /**
  30318. * Gets or sets the length of the warmup period, in seconds. During the warmup period, a separate
  30319. * (usually lower) frame rate is required.
  30320. */
  30321. warmupPeriod: number;
  30322. /**
  30323. * Gets or sets the minimum frames-per-second that are required for acceptable performance during
  30324. * the warmup period. If the frame rate averages less than this during any <code>samplingWindow</code> during the <code>warmupPeriod</code>, the
  30325. * <code>lowFrameRate</code> event will be raised and the page will redirect to the <code>redirectOnLowFrameRateUrl</code>, if any.
  30326. */
  30327. minimumFrameRateDuringWarmup: number;
  30328. /**
  30329. * Gets or sets the minimum frames-per-second that are required for acceptable performance after
  30330. * 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
  30331. * <code>lowFrameRate</code> event will be raised and the page will redirect to the <code>redirectOnLowFrameRateUrl</code>, if any.
  30332. */
  30333. minimumFrameRateAfterWarmup: number;
  30334. /**
  30335. * The default frame rate monitoring settings. These settings are used when {@link FrameRateMonitor.fromScene}
  30336. * needs to create a new frame rate monitor, and for any settings that are not passed to the
  30337. * {@link FrameRateMonitor} constructor.
  30338. */
  30339. static defaultSettings: any;
  30340. /**
  30341. * Gets the {@link FrameRateMonitor} for a given scene. If the scene does not yet have
  30342. * a {@link FrameRateMonitor}, one is created with the {@link FrameRateMonitor.defaultSettings}.
  30343. * @param scene - The scene for which to get the {@link FrameRateMonitor}.
  30344. * @returns The scene's {@link FrameRateMonitor}.
  30345. */
  30346. static fromScene(scene: Scene): FrameRateMonitor;
  30347. /**
  30348. * Gets the {@link Scene} instance for which to monitor performance.
  30349. */
  30350. scene: Scene;
  30351. /**
  30352. * Gets the event that is raised when a low frame rate is detected. The function will be passed
  30353. * the {@link Scene} instance as its first parameter and the average number of frames per second
  30354. * over the sampling window as its second parameter.
  30355. */
  30356. lowFrameRate: Event;
  30357. /**
  30358. * Gets the event that is raised when the frame rate returns to a normal level after having been low.
  30359. * The function will be passed the {@link Scene} instance as its first parameter and the average
  30360. * number of frames per second over the sampling window as its second parameter.
  30361. */
  30362. nominalFrameRate: Event;
  30363. /**
  30364. * Gets the most recently computed average frames-per-second over the last <code>samplingWindow</code>.
  30365. * This property may be undefined if the frame rate has not been computed.
  30366. */
  30367. lastFramesPerSecond: number;
  30368. /**
  30369. * Pauses monitoring of the frame rate. To resume monitoring, {@link FrameRateMonitor#unpause}
  30370. * must be called once for each time this function is called.
  30371. */
  30372. pause(): void;
  30373. /**
  30374. * Resumes monitoring of the frame rate. If {@link FrameRateMonitor#pause} was called
  30375. * multiple times, this function must be called the same number of times in order to
  30376. * actually resume monitoring.
  30377. */
  30378. unpause(): void;
  30379. /**
  30380. * Returns true if this object was destroyed; otherwise, false.
  30381. * <br /><br />
  30382. * If this object was destroyed, it should not be used; calling any function other than
  30383. * <code>isDestroyed</code> will result in a {@link DeveloperError} exception.
  30384. * @returns True if this object was destroyed; otherwise, false.
  30385. */
  30386. isDestroyed(): boolean;
  30387. /**
  30388. * Unsubscribes this instance from all events it is listening to.
  30389. * Once an object is destroyed, it should not be used; calling any function other than
  30390. * <code>isDestroyed</code> will result in a {@link DeveloperError} exception. Therefore,
  30391. * assign the return value (<code>undefined</code>) to the object as done in the example.
  30392. */
  30393. destroy(): void;
  30394. }
  30395. /**
  30396. * Describes the format in which to request GetFeatureInfo from a Web Map Service (WMS) server.
  30397. * @param type - The type of response to expect from a GetFeatureInfo request. Valid
  30398. * values are 'json', 'xml', 'html', or 'text'.
  30399. * @param [format] - The info format to request from the WMS server. This is usually a
  30400. * MIME type such as 'application/json' or text/xml'. If this parameter is not specified, the provider will request 'json'
  30401. * using 'application/json', 'xml' using 'text/xml', 'html' using 'text/html', and 'text' using 'text/plain'.
  30402. * @param [callback] - A function to invoke with the GetFeatureInfo response from the WMS server
  30403. * in order to produce an array of picked {@link ImageryLayerFeatureInfo} instances. If this parameter is not specified,
  30404. * a default function for the type of response is used.
  30405. */
  30406. export class GetFeatureInfoFormat {
  30407. constructor(type: string, format?: string, callback?: (...params: any[]) => any);
  30408. }
  30409. /**
  30410. * The globe rendered in the scene, including its terrain ({@link Globe#terrainProvider})
  30411. * and imagery layers ({@link Globe#imageryLayers}). Access the globe using {@link Scene#globe}.
  30412. * @param [ellipsoid = Ellipsoid.WGS84] - Determines the size and shape of the
  30413. * globe.
  30414. */
  30415. export class Globe {
  30416. constructor(ellipsoid?: Ellipsoid);
  30417. /**
  30418. * Determines if the globe will be shown.
  30419. */
  30420. show: boolean;
  30421. /**
  30422. * The maximum screen-space error used to drive level-of-detail refinement. Higher
  30423. * values will provide better performance but lower visual quality.
  30424. */
  30425. maximumScreenSpaceError: number;
  30426. /**
  30427. * The size of the terrain tile cache, expressed as a number of tiles. Any additional
  30428. * tiles beyond this number will be freed, as long as they aren't needed for rendering
  30429. * this frame. A larger number will consume more memory but will show detail faster
  30430. * when, for example, zooming out and then back in.
  30431. */
  30432. tileCacheSize: number;
  30433. /**
  30434. * Gets or sets the number of loading descendant tiles that is considered "too many".
  30435. * If a tile has too many loading descendants, that tile will be loaded and rendered before any of
  30436. * its descendants are loaded and rendered. This means more feedback for the user that something
  30437. * is happening at the cost of a longer overall load time. Setting this to 0 will cause each
  30438. * tile level to be loaded successively, significantly increasing load time. Setting it to a large
  30439. * number (e.g. 1000) will minimize the number of tiles that are loaded but tend to make
  30440. * detail appear all at once after a long wait.
  30441. */
  30442. loadingDescendantLimit: number;
  30443. /**
  30444. * Gets or sets a value indicating whether the ancestors of rendered tiles should be preloaded.
  30445. * Setting this to true optimizes the zoom-out experience and provides more detail in
  30446. * newly-exposed areas when panning. The down side is that it requires loading more tiles.
  30447. */
  30448. preloadAncestors: boolean;
  30449. /**
  30450. * Gets or sets a value indicating whether the siblings of rendered tiles should be preloaded.
  30451. * Setting this to true causes tiles with the same parent as a rendered tile to be loaded, even
  30452. * if they are culled. Setting this to true may provide a better panning experience at the
  30453. * cost of loading more tiles.
  30454. */
  30455. preloadSiblings: boolean;
  30456. /**
  30457. * The color to use to highlight terrain fill tiles. If undefined, fill tiles are not
  30458. * highlighted at all. The alpha value is used to alpha blend with the tile's
  30459. * actual color. Because terrain fill tiles do not represent the actual terrain surface,
  30460. * it may be useful in some applications to indicate visually that they are not to be trusted.
  30461. */
  30462. fillHighlightColor: Color;
  30463. /**
  30464. * Enable lighting the globe with the scene's light source.
  30465. */
  30466. enableLighting: boolean;
  30467. /**
  30468. * A multiplier to adjust terrain lambert lighting.
  30469. * This number is multiplied by the result of <code>czm_getLambertDiffuse</code> in GlobeFS.glsl.
  30470. * This only takes effect when <code>enableLighting</code> is <code>true</code>.
  30471. */
  30472. lambertDiffuseMultiplier: number;
  30473. /**
  30474. * Enable dynamic lighting effects on atmosphere and fog. This only takes effect
  30475. * when <code>enableLighting</code> is <code>true</code>.
  30476. */
  30477. dynamicAtmosphereLighting: boolean;
  30478. /**
  30479. * Whether dynamic atmosphere lighting uses the sun direction instead of the scene's
  30480. * light direction. This only takes effect when <code>enableLighting</code> and
  30481. * <code>dynamicAtmosphereLighting</code> are <code>true</code>.
  30482. */
  30483. dynamicAtmosphereLightingFromSun: boolean;
  30484. /**
  30485. * Enable the ground atmosphere, which is drawn over the globe when viewed from a distance between <code>lightingFadeInDistance</code> and <code>lightingFadeOutDistance</code>.
  30486. */
  30487. showGroundAtmosphere: boolean;
  30488. /**
  30489. * The intensity of the light that is used for computing the ground atmosphere color.
  30490. */
  30491. atmosphereLightIntensity: number;
  30492. /**
  30493. * The Rayleigh scattering coefficient used in the atmospheric scattering equations for the ground atmosphere.
  30494. */
  30495. atmosphereRayleighCoefficient: Cartesian3;
  30496. /**
  30497. * The Mie scattering coefficient used in the atmospheric scattering equations for the ground atmosphere.
  30498. */
  30499. atmosphereMieCoefficient: Cartesian3;
  30500. /**
  30501. * The Rayleigh scale height used in the atmospheric scattering equations for the ground atmosphere, in meters.
  30502. */
  30503. atmosphereRayleighScaleHeight: number;
  30504. /**
  30505. * The Mie scale height used in the atmospheric scattering equations for the ground atmosphere, in meters.
  30506. */
  30507. atmosphereMieScaleHeight: number;
  30508. /**
  30509. * The anisotropy of the medium to consider for Mie scattering.
  30510. * <p>
  30511. * Valid values are between -1.0 and 1.0.
  30512. * </p>
  30513. */
  30514. atmosphereMieAnisotropy: number;
  30515. /**
  30516. * The distance where everything becomes lit. This only takes effect
  30517. * when <code>enableLighting</code> or <code>showGroundAtmosphere</code> is <code>true</code>.
  30518. */
  30519. lightingFadeOutDistance: number;
  30520. /**
  30521. * The distance where lighting resumes. This only takes effect
  30522. * when <code>enableLighting</code> or <code>showGroundAtmosphere</code> is <code>true</code>.
  30523. */
  30524. lightingFadeInDistance: number;
  30525. /**
  30526. * The distance where the darkness of night from the ground atmosphere fades out to a lit ground atmosphere.
  30527. * This only takes effect when <code>showGroundAtmosphere</code>, <code>enableLighting</code>, and
  30528. * <code>dynamicAtmosphereLighting</code> are <code>true</code>.
  30529. */
  30530. nightFadeOutDistance: number;
  30531. /**
  30532. * The distance where the darkness of night from the ground atmosphere fades in to an unlit ground atmosphere.
  30533. * This only takes effect when <code>showGroundAtmosphere</code>, <code>enableLighting</code>, and
  30534. * <code>dynamicAtmosphereLighting</code> are <code>true</code>.
  30535. */
  30536. nightFadeInDistance: number;
  30537. /**
  30538. * True if an animated wave effect should be shown in areas of the globe
  30539. * covered by water; otherwise, false. This property is ignored if the
  30540. * <code>terrainProvider</code> does not provide a water mask.
  30541. */
  30542. showWaterEffect: boolean;
  30543. /**
  30544. * True if primitives such as billboards, polylines, labels, etc. should be depth-tested
  30545. * against the terrain surface, or false if such primitives should always be drawn on top
  30546. * of terrain unless they're on the opposite side of the globe. The disadvantage of depth
  30547. * testing primitives against terrain is that slight numerical noise or terrain level-of-detail
  30548. * switched can sometimes make a primitive that should be on the surface disappear underneath it.
  30549. */
  30550. depthTestAgainstTerrain: boolean;
  30551. /**
  30552. * Determines whether the globe casts or receives shadows from light sources. Setting the globe
  30553. * to cast shadows may impact performance since the terrain is rendered again from the light's perspective.
  30554. * Currently only terrain that is in view casts shadows. By default the globe does not cast shadows.
  30555. */
  30556. shadows: ShadowMode;
  30557. /**
  30558. * The hue shift to apply to the atmosphere. Defaults to 0.0 (no shift).
  30559. * A hue shift of 1.0 indicates a complete rotation of the hues available.
  30560. */
  30561. atmosphereHueShift: number;
  30562. /**
  30563. * The saturation shift to apply to the atmosphere. Defaults to 0.0 (no shift).
  30564. * A saturation shift of -1.0 is monochrome.
  30565. */
  30566. atmosphereSaturationShift: number;
  30567. /**
  30568. * The brightness shift to apply to the atmosphere. Defaults to 0.0 (no shift).
  30569. * A brightness shift of -1.0 is complete darkness, which will let space show through.
  30570. */
  30571. atmosphereBrightnessShift: number;
  30572. /**
  30573. * A scalar used to exaggerate the terrain. Defaults to <code>1.0</code> (no exaggeration).
  30574. * A value of <code>2.0</code> scales the terrain by 2x.
  30575. * A value of <code>0.0</code> makes the terrain completely flat.
  30576. * Note that terrain exaggeration will not modify any other primitive as they are positioned relative to the ellipsoid.
  30577. */
  30578. terrainExaggeration: number;
  30579. /**
  30580. * The height from which terrain is exaggerated. Defaults to <code>0.0</code> (scaled relative to ellipsoid surface).
  30581. * Terrain that is above this height will scale upwards and terrain that is below this height will scale downwards.
  30582. * Note that terrain exaggeration will not modify any other primitive as they are positioned relative to the ellipsoid.
  30583. * If {@link Globe#terrainExaggeration} is <code>1.0</code> this value will have no effect.
  30584. */
  30585. terrainExaggerationRelativeHeight: number;
  30586. /**
  30587. * Whether to show terrain skirts. Terrain skirts are geometry extending downwards from a tile's edges used to hide seams between neighboring tiles.
  30588. * Skirts are always hidden when the camera is underground or translucency is enabled.
  30589. */
  30590. showSkirts: boolean;
  30591. /**
  30592. * Whether to cull back-facing terrain. Back faces are not culled when the camera is underground or translucency is enabled.
  30593. */
  30594. backFaceCulling: boolean;
  30595. /**
  30596. * Gets an ellipsoid describing the shape of this globe.
  30597. */
  30598. ellipsoid: Ellipsoid;
  30599. /**
  30600. * Gets the collection of image layers that will be rendered on this globe.
  30601. */
  30602. imageryLayers: ImageryLayerCollection;
  30603. /**
  30604. * Gets an event that's raised when an imagery layer is added, shown, hidden, moved, or removed.
  30605. */
  30606. readonly imageryLayersUpdatedEvent: Event;
  30607. /**
  30608. * Returns <code>true</code> when the tile load queue is empty, <code>false</code> otherwise. When the load queue is empty,
  30609. * all terrain and imagery for the current view have been loaded.
  30610. */
  30611. readonly tilesLoaded: boolean;
  30612. /**
  30613. * Gets or sets the color of the globe when no imagery is available.
  30614. */
  30615. baseColor: Color;
  30616. /**
  30617. * A property specifying a {@link ClippingPlaneCollection} used to selectively disable rendering on the outside of each plane.
  30618. */
  30619. clippingPlanes: ClippingPlaneCollection;
  30620. /**
  30621. * A property specifying a {@link Rectangle} used to limit globe rendering to a cartographic area.
  30622. * Defaults to the maximum extent of cartographic coordinates.
  30623. */
  30624. cartographicLimitRectangle: Rectangle;
  30625. /**
  30626. * The normal map to use for rendering waves in the ocean. Setting this property will
  30627. * only have an effect if the configured terrain provider includes a water mask.
  30628. */
  30629. oceanNormalMapUrl: string;
  30630. /**
  30631. * The terrain provider providing surface geometry for this globe.
  30632. */
  30633. terrainProvider: TerrainProvider;
  30634. /**
  30635. * Gets an event that's raised when the terrain provider is changed
  30636. */
  30637. readonly terrainProviderChanged: Event;
  30638. /**
  30639. * 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,
  30640. * all terrain and imagery for the current view have been loaded. The event passes the new length of the tile load queue.
  30641. */
  30642. tileLoadProgressEvent: Event;
  30643. /**
  30644. * 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
  30645. * {@link https://github.com/CesiumGS/cesium/wiki/Fabric|Fabric}.
  30646. */
  30647. material: Material | undefined;
  30648. /**
  30649. * The color to render the back side of the globe when the camera is underground or the globe is translucent,
  30650. * blended with the globe color based on the camera's distance.
  30651. * <br /><br />
  30652. * To disable underground coloring, set <code>undergroundColor</code> to <code>undefined</code>.
  30653. */
  30654. undergroundColor: Color;
  30655. /**
  30656. * Gets or sets the near and far distance for blending {@link Globe#undergroundColor} with the globe color.
  30657. * The alpha will interpolate between the {@link NearFarScalar#nearValue} and
  30658. * {@link NearFarScalar#farValue} while the camera distance falls within the lower and upper bounds
  30659. * of the specified {@link NearFarScalar#near} and {@link NearFarScalar#far}.
  30660. * Outside of these ranges the alpha remains clamped to the nearest bound. If undefined,
  30661. * the underground color will not be blended with the globe color.
  30662. * <br /> <br />
  30663. * When the camera is above the ellipsoid the distance is computed from the nearest
  30664. * point on the ellipsoid instead of the camera's position.
  30665. */
  30666. undergroundColorAlphaByDistance: NearFarScalar;
  30667. /**
  30668. * Properties for controlling globe translucency.
  30669. */
  30670. translucency: GlobeTranslucency;
  30671. /**
  30672. * Find an intersection between a ray and the globe surface that was rendered. The ray must be given in world coordinates.
  30673. * @example
  30674. * // find intersection of ray through a pixel and the globe
  30675. * const ray = viewer.camera.getPickRay(windowCoordinates);
  30676. * const intersection = globe.pick(ray, scene);
  30677. * @param ray - The ray to test for intersection.
  30678. * @param scene - The scene.
  30679. * @param [result] - The object onto which to store the result.
  30680. * @returns The intersection or <code>undefined</code> if none was found.
  30681. */
  30682. pick(ray: Ray, scene: Scene, result?: Cartesian3): Cartesian3 | undefined;
  30683. /**
  30684. * Get the height of the surface at a given cartographic.
  30685. * @param cartographic - The cartographic for which to find the height.
  30686. * @returns The height of the cartographic or undefined if it could not be found.
  30687. */
  30688. getHeight(cartographic: Cartographic): number | undefined;
  30689. /**
  30690. * Returns true if this object was destroyed; otherwise, false.
  30691. * <br /><br />
  30692. * If this object was destroyed, it should not be used; calling any function other than
  30693. * <code>isDestroyed</code> will result in a {@link DeveloperError} exception.
  30694. * @returns True if this object was destroyed; otherwise, false.
  30695. */
  30696. isDestroyed(): boolean;
  30697. /**
  30698. * Destroys the WebGL resources held by this object. Destroying an object allows for deterministic
  30699. * release of WebGL resources, instead of relying on the garbage collector to destroy this object.
  30700. * <br /><br />
  30701. * Once an object is destroyed, it should not be used; calling any function other than
  30702. * <code>isDestroyed</code> will result in a {@link DeveloperError} exception. Therefore,
  30703. * assign the return value (<code>undefined</code>) to the object as done in the example.
  30704. * @example
  30705. * globe = globe && globe.destroy();
  30706. */
  30707. destroy(): void;
  30708. }
  30709. /**
  30710. * Properties for controlling globe translucency.
  30711. */
  30712. export class GlobeTranslucency {
  30713. constructor();
  30714. /**
  30715. * When true, the globe is rendered as a translucent surface.
  30716. * <br /><br />
  30717. * The alpha is computed by blending {@link Globe#material}, {@link Globe#imageryLayers},
  30718. * and {@link Globe#baseColor}, all of which may contain translucency, and then multiplying by
  30719. * {@link GlobeTranslucency#frontFaceAlpha} and {@link GlobeTranslucency#frontFaceAlphaByDistance} for front faces and
  30720. * {@link GlobeTranslucency#backFaceAlpha} and {@link GlobeTranslucency#backFaceAlphaByDistance} for back faces.
  30721. * When the camera is underground back faces and front faces are swapped, i.e. back-facing geometry
  30722. * is considered front facing.
  30723. * <br /><br />
  30724. * Translucency is disabled by default.
  30725. */
  30726. enabled: boolean;
  30727. /**
  30728. * A constant translucency to apply to front faces of the globe.
  30729. * <br /><br />
  30730. * {@link GlobeTranslucency#enabled} must be set to true for this option to take effect.
  30731. * @example
  30732. * // Set front face translucency to 0.5.
  30733. * globe.translucency.frontFaceAlpha = 0.5;
  30734. * globe.translucency.enabled = true;
  30735. */
  30736. frontFaceAlpha: number;
  30737. /**
  30738. * Gets or sets near and far translucency properties of front faces of the globe based on the distance to the camera.
  30739. * The translucency will interpolate between the {@link NearFarScalar#nearValue} and
  30740. * {@link NearFarScalar#farValue} while the camera distance falls within the lower and upper bounds
  30741. * of the specified {@link NearFarScalar#near} and {@link NearFarScalar#far}.
  30742. * Outside of these ranges the translucency remains clamped to the nearest bound. If undefined,
  30743. * frontFaceAlphaByDistance will be disabled.
  30744. * <br /><br />
  30745. * {@link GlobeTranslucency#enabled} must be set to true for this option to take effect.
  30746. * @example
  30747. * // Example 1.
  30748. * // Set front face translucency to 0.5 when the
  30749. * // camera is 1500 meters from the surface and 1.0
  30750. * // as the camera distance approaches 8.0e6 meters.
  30751. * globe.translucency.frontFaceAlphaByDistance = new Cesium.NearFarScalar(1.5e2, 0.5, 8.0e6, 1.0);
  30752. * globe.translucency.enabled = true;
  30753. * @example
  30754. * // Example 2.
  30755. * // Disable front face translucency by distance
  30756. * globe.translucency.frontFaceAlphaByDistance = undefined;
  30757. */
  30758. frontFaceAlphaByDistance: NearFarScalar;
  30759. /**
  30760. * A constant translucency to apply to back faces of the globe.
  30761. * <br /><br />
  30762. * {@link GlobeTranslucency#enabled} must be set to true for this option to take effect.
  30763. * @example
  30764. * // Set back face translucency to 0.5.
  30765. * globe.translucency.backFaceAlpha = 0.5;
  30766. * globe.translucency.enabled = true;
  30767. */
  30768. backFaceAlpha: number;
  30769. /**
  30770. * Gets or sets near and far translucency properties of back faces of the globe based on the distance to the camera.
  30771. * The translucency will interpolate between the {@link NearFarScalar#nearValue} and
  30772. * {@link NearFarScalar#farValue} while the camera distance falls within the lower and upper bounds
  30773. * of the specified {@link NearFarScalar#near} and {@link NearFarScalar#far}.
  30774. * Outside of these ranges the translucency remains clamped to the nearest bound. If undefined,
  30775. * backFaceAlphaByDistance will be disabled.
  30776. * <br /><br />
  30777. * {@link GlobeTranslucency#enabled} must be set to true for this option to take effect.
  30778. * @example
  30779. * // Example 1.
  30780. * // Set back face translucency to 0.5 when the
  30781. * // camera is 1500 meters from the surface and 1.0
  30782. * // as the camera distance approaches 8.0e6 meters.
  30783. * globe.translucency.backFaceAlphaByDistance = new Cesium.NearFarScalar(1.5e2, 0.5, 8.0e6, 1.0);
  30784. * globe.translucency.enabled = true;
  30785. * @example
  30786. * // Example 2.
  30787. * // Disable back face translucency by distance
  30788. * globe.translucency.backFaceAlphaByDistance = undefined;
  30789. */
  30790. backFaceAlphaByDistance: NearFarScalar;
  30791. /**
  30792. * A property specifying a {@link Rectangle} used to limit translucency to a cartographic area.
  30793. * Defaults to the maximum extent of cartographic coordinates.
  30794. */
  30795. rectangle: Rectangle;
  30796. }
  30797. export namespace GoogleEarthEnterpriseImageryProvider {
  30798. /**
  30799. * Initialization options for the GoogleEarthEnterpriseImageryProvider constructor
  30800. * @property url - The url of the Google Earth Enterprise server hosting the imagery.
  30801. * @property metadata - A metadata object that can be used to share metadata requests with a GoogleEarthEnterpriseTerrainProvider.
  30802. * @property [ellipsoid] - The ellipsoid. If not specified, the WGS84 ellipsoid is used.
  30803. * @property [tileDiscardPolicy] - The policy that determines if a tile
  30804. * is invalid and should be discarded. If this value is not specified, a default
  30805. * is to discard tiles that fail to download.
  30806. * @property [credit] - A credit for the data source, which is displayed on the canvas.
  30807. */
  30808. type ConstructorOptions = {
  30809. url: Resource | string;
  30810. metadata: GoogleEarthEnterpriseMetadata;
  30811. ellipsoid?: Ellipsoid;
  30812. tileDiscardPolicy?: TileDiscardPolicy;
  30813. credit?: Credit | string;
  30814. };
  30815. }
  30816. /**
  30817. * Provides tiled imagery using the Google Earth Enterprise REST API.
  30818. *
  30819. * Notes: This provider is for use with the 3D Earth API of Google Earth Enterprise,
  30820. * {@link GoogleEarthEnterpriseMapsProvider} should be used with 2D Maps API.
  30821. * @example
  30822. * const geeMetadata = new GoogleEarthEnterpriseMetadata('http://www.earthenterprise.org/3d');
  30823. * const gee = new Cesium.GoogleEarthEnterpriseImageryProvider({
  30824. * metadata : geeMetadata
  30825. * });
  30826. * @param options - Object describing initialization options
  30827. */
  30828. export class GoogleEarthEnterpriseImageryProvider {
  30829. constructor(options: GoogleEarthEnterpriseImageryProvider.ConstructorOptions);
  30830. /**
  30831. * The default alpha blending value of this provider, with 0.0 representing fully transparent and
  30832. * 1.0 representing fully opaque.
  30833. */
  30834. defaultAlpha: number | undefined;
  30835. /**
  30836. * The default alpha blending value on the night side of the globe of this provider, with 0.0 representing fully transparent and
  30837. * 1.0 representing fully opaque.
  30838. */
  30839. defaultNightAlpha: number | undefined;
  30840. /**
  30841. * The default alpha blending value on the day side of the globe of this provider, with 0.0 representing fully transparent and
  30842. * 1.0 representing fully opaque.
  30843. */
  30844. defaultDayAlpha: number | undefined;
  30845. /**
  30846. * The default brightness of this provider. 1.0 uses the unmodified imagery color. Less than 1.0
  30847. * makes the imagery darker while greater than 1.0 makes it brighter.
  30848. */
  30849. defaultBrightness: number | undefined;
  30850. /**
  30851. * The default contrast of this provider. 1.0 uses the unmodified imagery color. Less than 1.0 reduces
  30852. * the contrast while greater than 1.0 increases it.
  30853. */
  30854. defaultContrast: number | undefined;
  30855. /**
  30856. * The default hue of this provider in radians. 0.0 uses the unmodified imagery color.
  30857. */
  30858. defaultHue: number | undefined;
  30859. /**
  30860. * The default saturation of this provider. 1.0 uses the unmodified imagery color. Less than 1.0 reduces the
  30861. * saturation while greater than 1.0 increases it.
  30862. */
  30863. defaultSaturation: number | undefined;
  30864. /**
  30865. * The default gamma correction to apply to this provider. 1.0 uses the unmodified imagery color.
  30866. */
  30867. defaultGamma: number | undefined;
  30868. /**
  30869. * The default texture minification filter to apply to this provider.
  30870. */
  30871. defaultMinificationFilter: TextureMinificationFilter;
  30872. /**
  30873. * The default texture magnification filter to apply to this provider.
  30874. */
  30875. defaultMagnificationFilter: TextureMagnificationFilter;
  30876. /**
  30877. * Gets the name of the Google Earth Enterprise server url hosting the imagery.
  30878. */
  30879. readonly url: string;
  30880. /**
  30881. * Gets the proxy used by this provider.
  30882. */
  30883. readonly proxy: Proxy;
  30884. /**
  30885. * Gets the width of each tile, in pixels. This function should
  30886. * not be called before {@link GoogleEarthEnterpriseImageryProvider#ready} returns true.
  30887. */
  30888. readonly tileWidth: number;
  30889. /**
  30890. * Gets the height of each tile, in pixels. This function should
  30891. * not be called before {@link GoogleEarthEnterpriseImageryProvider#ready} returns true.
  30892. */
  30893. readonly tileHeight: number;
  30894. /**
  30895. * Gets the maximum level-of-detail that can be requested. This function should
  30896. * not be called before {@link GoogleEarthEnterpriseImageryProvider#ready} returns true.
  30897. */
  30898. readonly maximumLevel: number | undefined;
  30899. /**
  30900. * Gets the minimum level-of-detail that can be requested. This function should
  30901. * not be called before {@link GoogleEarthEnterpriseImageryProvider#ready} returns true.
  30902. */
  30903. readonly minimumLevel: number;
  30904. /**
  30905. * Gets the tiling scheme used by this provider. This function should
  30906. * not be called before {@link GoogleEarthEnterpriseImageryProvider#ready} returns true.
  30907. */
  30908. readonly tilingScheme: TilingScheme;
  30909. /**
  30910. * Gets the rectangle, in radians, of the imagery provided by this instance. This function should
  30911. * not be called before {@link GoogleEarthEnterpriseImageryProvider#ready} returns true.
  30912. */
  30913. readonly rectangle: Rectangle;
  30914. /**
  30915. * Gets the tile discard policy. If not undefined, the discard policy is responsible
  30916. * for filtering out "missing" tiles via its shouldDiscardImage function. If this function
  30917. * returns undefined, no tiles are filtered. This function should
  30918. * not be called before {@link GoogleEarthEnterpriseImageryProvider#ready} returns true.
  30919. */
  30920. readonly tileDiscardPolicy: TileDiscardPolicy;
  30921. /**
  30922. * Gets an event that is raised when the imagery provider encounters an asynchronous error. By subscribing
  30923. * to the event, you will be notified of the error and can potentially recover from it. Event listeners
  30924. * are passed an instance of {@link TileProviderError}.
  30925. */
  30926. readonly errorEvent: Event;
  30927. /**
  30928. * Gets a value indicating whether or not the provider is ready for use.
  30929. */
  30930. readonly ready: boolean;
  30931. /**
  30932. * Gets a promise that resolves to true when the provider is ready for use.
  30933. */
  30934. readonly readyPromise: Promise<boolean>;
  30935. /**
  30936. * Gets the credit to display when this imagery provider is active. Typically this is used to credit
  30937. * the source of the imagery. This function should not be called before {@link GoogleEarthEnterpriseImageryProvider#ready} returns true.
  30938. */
  30939. readonly credit: Credit;
  30940. /**
  30941. * Gets a value indicating whether or not the images provided by this imagery provider
  30942. * include an alpha channel. If this property is false, an alpha channel, if present, will
  30943. * be ignored. If this property is true, any images without an alpha channel will be treated
  30944. * as if their alpha is 1.0 everywhere. Setting this property to false reduces memory usage
  30945. * and texture upload time.
  30946. */
  30947. readonly hasAlphaChannel: boolean;
  30948. /**
  30949. * Gets the credits to be displayed when a given tile is displayed.
  30950. * @param x - The tile X coordinate.
  30951. * @param y - The tile Y coordinate.
  30952. * @param level - The tile level;
  30953. * @returns The credits to be displayed when the tile is displayed.
  30954. */
  30955. getTileCredits(x: number, y: number, level: number): Credit[];
  30956. /**
  30957. * Requests the image for a given tile. This function should
  30958. * not be called before {@link GoogleEarthEnterpriseImageryProvider#ready} returns true.
  30959. * @param x - The tile X coordinate.
  30960. * @param y - The tile Y coordinate.
  30961. * @param level - The tile level.
  30962. * @param [request] - The request object. Intended for internal use only.
  30963. * @returns A promise for the image that will resolve when the image is available, or
  30964. * undefined if there are too many active requests to the server, and the request should be retried later.
  30965. */
  30966. requestImage(x: number, y: number, level: number, request?: Request): Promise<ImageryTypes> | undefined;
  30967. /**
  30968. * Picking features is not currently supported by this imagery provider, so this function simply returns
  30969. * undefined.
  30970. * @param x - The tile X coordinate.
  30971. * @param y - The tile Y coordinate.
  30972. * @param level - The tile level.
  30973. * @param longitude - The longitude at which to pick features.
  30974. * @param latitude - The latitude at which to pick features.
  30975. * @returns Undefined since picking is not supported.
  30976. */
  30977. pickFeatures(x: number, y: number, level: number, longitude: number, latitude: number): undefined;
  30978. }
  30979. export namespace GoogleEarthEnterpriseMapsProvider {
  30980. /**
  30981. * Initialization options for the GoogleEarthEnterpriseMapsProvider constructor
  30982. * @property url - The url of the Google Earth server hosting the imagery.
  30983. * @property channel - The channel (id) to be used when requesting data from the server.
  30984. * The channel number can be found by looking at the json file located at:
  30985. * earth.localdomain/default_map/query?request=Json&vars=geeServerDefs The /default_map path may
  30986. * differ depending on your Google Earth Enterprise server configuration. Look for the "id" that
  30987. * is associated with a "ImageryMaps" requestType. There may be more than one id available.
  30988. * Example:
  30989. * {
  30990. * layers: [
  30991. * {
  30992. * id: 1002,
  30993. * requestType: "ImageryMaps"
  30994. * },
  30995. * {
  30996. * id: 1007,
  30997. * requestType: "VectorMapsRaster"
  30998. * }
  30999. * ]
  31000. * }
  31001. * @property [path = "/default_map"] - The path of the Google Earth server hosting the imagery.
  31002. * @property [maximumLevel] - The maximum level-of-detail supported by the Google Earth
  31003. * Enterprise server, or undefined if there is no limit.
  31004. * @property [tileDiscardPolicy] - The policy that determines if a tile
  31005. * is invalid and should be discarded. To ensure that no tiles are discarded, construct and pass
  31006. * a {@link NeverTileDiscardPolicy} for this parameter.
  31007. * @property [ellipsoid] - The ellipsoid. If not specified, the WGS84 ellipsoid is used.
  31008. */
  31009. type ConstructorOptions = {
  31010. url: Resource | string;
  31011. channel: number;
  31012. path?: string;
  31013. maximumLevel?: number;
  31014. tileDiscardPolicy?: TileDiscardPolicy;
  31015. ellipsoid?: Ellipsoid;
  31016. };
  31017. }
  31018. /**
  31019. * Provides tiled imagery using the Google Earth Imagery API.
  31020. *
  31021. * Notes: This imagery provider does not work with the public Google Earth servers. It works with the
  31022. * Google Earth Enterprise Server.
  31023. *
  31024. * By default the Google Earth Enterprise server does not set the
  31025. * {@link http://www.w3.org/TR/cors/|Cross-Origin Resource Sharing} headers. You can either
  31026. * use a proxy server which adds these headers, or in the /opt/google/gehttpd/conf/gehttpd.conf
  31027. * and add the 'Header set Access-Control-Allow-Origin "*"' option to the '&lt;Directory /&gt;' and
  31028. * '&lt;Directory "/opt/google/gehttpd/htdocs"&gt;' directives.
  31029. *
  31030. * This provider is for use with 2D Maps API as part of Google Earth Enterprise. For 3D Earth API uses, it
  31031. * is necessary to use {@link GoogleEarthEnterpriseImageryProvider}
  31032. * @example
  31033. * const google = new Cesium.GoogleEarthEnterpriseMapsProvider({
  31034. * url : 'https://earth.localdomain',
  31035. * channel : 1008
  31036. * });
  31037. * @param options - Object describing initialization options
  31038. */
  31039. export class GoogleEarthEnterpriseMapsProvider {
  31040. constructor(options: GoogleEarthEnterpriseMapsProvider.ConstructorOptions);
  31041. /**
  31042. * The default alpha blending value of this provider, with 0.0 representing fully transparent and
  31043. * 1.0 representing fully opaque.
  31044. */
  31045. defaultAlpha: number | undefined;
  31046. /**
  31047. * The default alpha blending value on the night side of the globe of this provider, with 0.0 representing fully transparent and
  31048. * 1.0 representing fully opaque.
  31049. */
  31050. defaultNightAlpha: number | undefined;
  31051. /**
  31052. * The default alpha blending value on the day side of the globe of this provider, with 0.0 representing fully transparent and
  31053. * 1.0 representing fully opaque.
  31054. */
  31055. defaultDayAlpha: number | undefined;
  31056. /**
  31057. * The default brightness of this provider. 1.0 uses the unmodified imagery color. Less than 1.0
  31058. * makes the imagery darker while greater than 1.0 makes it brighter.
  31059. */
  31060. defaultBrightness: number | undefined;
  31061. /**
  31062. * The default contrast of this provider. 1.0 uses the unmodified imagery color. Less than 1.0 reduces
  31063. * the contrast while greater than 1.0 increases it.
  31064. */
  31065. defaultContrast: number | undefined;
  31066. /**
  31067. * The default hue of this provider in radians. 0.0 uses the unmodified imagery color.
  31068. */
  31069. defaultHue: number | undefined;
  31070. /**
  31071. * The default saturation of this provider. 1.0 uses the unmodified imagery color. Less than 1.0 reduces the
  31072. * saturation while greater than 1.0 increases it.
  31073. */
  31074. defaultSaturation: number | undefined;
  31075. /**
  31076. * The default gamma correction to apply to this provider. 1.0 uses the unmodified imagery color.
  31077. */
  31078. defaultGamma: number | undefined;
  31079. /**
  31080. * The default texture minification filter to apply to this provider.
  31081. */
  31082. defaultMinificationFilter: TextureMinificationFilter;
  31083. /**
  31084. * The default texture magnification filter to apply to this provider.
  31085. */
  31086. defaultMagnificationFilter: TextureMagnificationFilter;
  31087. /**
  31088. * Gets the URL of the Google Earth MapServer.
  31089. */
  31090. readonly url: string;
  31091. /**
  31092. * Gets the url path of the data on the Google Earth server.
  31093. */
  31094. readonly path: string;
  31095. /**
  31096. * Gets the proxy used by this provider.
  31097. */
  31098. readonly proxy: Proxy;
  31099. /**
  31100. * Gets the imagery channel (id) currently being used.
  31101. */
  31102. readonly channel: number;
  31103. /**
  31104. * Gets the width of each tile, in pixels. This function should
  31105. * not be called before {@link GoogleEarthEnterpriseMapsProvider#ready} returns true.
  31106. */
  31107. readonly tileWidth: number;
  31108. /**
  31109. * Gets the height of each tile, in pixels. This function should
  31110. * not be called before {@link GoogleEarthEnterpriseMapsProvider#ready} returns true.
  31111. */
  31112. readonly tileHeight: number;
  31113. /**
  31114. * Gets the maximum level-of-detail that can be requested. This function should
  31115. * not be called before {@link GoogleEarthEnterpriseMapsProvider#ready} returns true.
  31116. */
  31117. readonly maximumLevel: number | undefined;
  31118. /**
  31119. * Gets the minimum level-of-detail that can be requested. This function should
  31120. * not be called before {@link GoogleEarthEnterpriseMapsProvider#ready} returns true.
  31121. */
  31122. readonly minimumLevel: number;
  31123. /**
  31124. * Gets the tiling scheme used by this provider. This function should
  31125. * not be called before {@link GoogleEarthEnterpriseMapsProvider#ready} returns true.
  31126. */
  31127. readonly tilingScheme: TilingScheme;
  31128. /**
  31129. * Gets the version of the data used by this provider. This function should
  31130. * not be called before {@link GoogleEarthEnterpriseMapsProvider#ready} returns true.
  31131. */
  31132. readonly version: number;
  31133. /**
  31134. * Gets the type of data that is being requested from the provider. This function should
  31135. * not be called before {@link GoogleEarthEnterpriseMapsProvider#ready} returns true.
  31136. */
  31137. readonly requestType: string;
  31138. /**
  31139. * Gets the rectangle, in radians, of the imagery provided by this instance. This function should
  31140. * not be called before {@link GoogleEarthEnterpriseMapsProvider#ready} returns true.
  31141. */
  31142. readonly rectangle: Rectangle;
  31143. /**
  31144. * Gets the tile discard policy. If not undefined, the discard policy is responsible
  31145. * for filtering out "missing" tiles via its shouldDiscardImage function. If this function
  31146. * returns undefined, no tiles are filtered. This function should
  31147. * not be called before {@link GoogleEarthEnterpriseMapsProvider#ready} returns true.
  31148. */
  31149. readonly tileDiscardPolicy: TileDiscardPolicy;
  31150. /**
  31151. * Gets an event that is raised when the imagery provider encounters an asynchronous error. By subscribing
  31152. * to the event, you will be notified of the error and can potentially recover from it. Event listeners
  31153. * are passed an instance of {@link TileProviderError}.
  31154. */
  31155. readonly errorEvent: Event;
  31156. /**
  31157. * Gets a value indicating whether or not the provider is ready for use.
  31158. */
  31159. readonly ready: boolean;
  31160. /**
  31161. * Gets a promise that resolves to true when the provider is ready for use.
  31162. */
  31163. readonly readyPromise: Promise<boolean>;
  31164. /**
  31165. * Gets the credit to display when this imagery provider is active. Typically this is used to credit
  31166. * the source of the imagery. This function should not be called before {@link GoogleEarthEnterpriseMapsProvider#ready} returns true.
  31167. */
  31168. readonly credit: Credit;
  31169. /**
  31170. * Gets a value indicating whether or not the images provided by this imagery provider
  31171. * include an alpha channel. If this property is false, an alpha channel, if present, will
  31172. * be ignored. If this property is true, any images without an alpha channel will be treated
  31173. * as if their alpha is 1.0 everywhere. When this property is false, memory usage
  31174. * and texture upload time are reduced.
  31175. */
  31176. readonly hasAlphaChannel: boolean;
  31177. /**
  31178. * Gets the credits to be displayed when a given tile is displayed.
  31179. * @param x - The tile X coordinate.
  31180. * @param y - The tile Y coordinate.
  31181. * @param level - The tile level;
  31182. * @returns The credits to be displayed when the tile is displayed.
  31183. */
  31184. getTileCredits(x: number, y: number, level: number): Credit[];
  31185. /**
  31186. * Requests the image for a given tile. This function should
  31187. * not be called before {@link GoogleEarthEnterpriseMapsProvider#ready} returns true.
  31188. * @param x - The tile X coordinate.
  31189. * @param y - The tile Y coordinate.
  31190. * @param level - The tile level.
  31191. * @param [request] - The request object. Intended for internal use only.
  31192. * @returns A promise for the image that will resolve when the image is available, or
  31193. * undefined if there are too many active requests to the server, and the request should be retried later.
  31194. */
  31195. requestImage(x: number, y: number, level: number, request?: Request): Promise<ImageryTypes> | undefined;
  31196. /**
  31197. * Picking features is not currently supported by this imagery provider, so this function simply returns
  31198. * undefined.
  31199. * @param x - The tile X coordinate.
  31200. * @param y - The tile Y coordinate.
  31201. * @param level - The tile level.
  31202. * @param longitude - The longitude at which to pick features.
  31203. * @param latitude - The latitude at which to pick features.
  31204. * @returns Undefined since picking is not supported.
  31205. */
  31206. pickFeatures(x: number, y: number, level: number, longitude: number, latitude: number): undefined;
  31207. /**
  31208. * Gets or sets the URL to the Google Earth logo for display in the credit.
  31209. */
  31210. static logoUrl: string;
  31211. }
  31212. export namespace GridImageryProvider {
  31213. /**
  31214. * Initialization options for the GridImageryProvider constructor
  31215. * @property [tilingScheme = new GeographicTilingScheme()] - The tiling scheme for which to draw tiles.
  31216. * @property [ellipsoid] - The ellipsoid. If the tilingScheme is specified,
  31217. * this parameter is ignored and the tiling scheme's ellipsoid is used instead. If neither
  31218. * parameter is specified, the WGS84 ellipsoid is used.
  31219. * @property [cells = 8] - The number of grids cells.
  31220. * @property [color = Color(1.0, 1.0, 1.0, 0.4)] - The color to draw grid lines.
  31221. * @property [glowColor = Color(0.0, 1.0, 0.0, 0.05)] - The color to draw glow for grid lines.
  31222. * @property [glowWidth = 6] - The width of lines used for rendering the line glow effect.
  31223. * @property [backgroundColor = Color(0.0, 0.5, 0.0, 0.2)] - Background fill color.
  31224. * @property [tileWidth = 256] - The width of the tile for level-of-detail selection purposes.
  31225. * @property [tileHeight = 256] - The height of the tile for level-of-detail selection purposes.
  31226. * @property [canvasSize = 256] - The size of the canvas used for rendering.
  31227. */
  31228. type ConstructorOptions = {
  31229. tilingScheme?: TilingScheme;
  31230. ellipsoid?: Ellipsoid;
  31231. cells?: number;
  31232. color?: Color;
  31233. glowColor?: Color;
  31234. glowWidth?: number;
  31235. backgroundColor?: Color;
  31236. tileWidth?: number;
  31237. tileHeight?: number;
  31238. canvasSize?: number;
  31239. };
  31240. }
  31241. /**
  31242. * An {@link ImageryProvider} that draws a wireframe grid on every tile with controllable background and glow.
  31243. * May be useful for custom rendering effects or debugging terrain.
  31244. * @param options - Object describing initialization options
  31245. */
  31246. export class GridImageryProvider {
  31247. constructor(options: GridImageryProvider.ConstructorOptions);
  31248. /**
  31249. * The default alpha blending value of this provider, with 0.0 representing fully transparent and
  31250. * 1.0 representing fully opaque.
  31251. */
  31252. defaultAlpha: number | undefined;
  31253. /**
  31254. * The default alpha blending value on the night side of the globe of this provider, with 0.0 representing fully transparent and
  31255. * 1.0 representing fully opaque.
  31256. */
  31257. defaultNightAlpha: number | undefined;
  31258. /**
  31259. * The default alpha blending value on the day side of the globe of this provider, with 0.0 representing fully transparent and
  31260. * 1.0 representing fully opaque.
  31261. */
  31262. defaultDayAlpha: number | undefined;
  31263. /**
  31264. * The default brightness of this provider. 1.0 uses the unmodified imagery color. Less than 1.0
  31265. * makes the imagery darker while greater than 1.0 makes it brighter.
  31266. */
  31267. defaultBrightness: number | undefined;
  31268. /**
  31269. * The default contrast of this provider. 1.0 uses the unmodified imagery color. Less than 1.0 reduces
  31270. * the contrast while greater than 1.0 increases it.
  31271. */
  31272. defaultContrast: number | undefined;
  31273. /**
  31274. * The default hue of this provider in radians. 0.0 uses the unmodified imagery color.
  31275. */
  31276. defaultHue: number | undefined;
  31277. /**
  31278. * The default saturation of this provider. 1.0 uses the unmodified imagery color. Less than 1.0 reduces the
  31279. * saturation while greater than 1.0 increases it.
  31280. */
  31281. defaultSaturation: number | undefined;
  31282. /**
  31283. * The default gamma correction to apply to this provider. 1.0 uses the unmodified imagery color.
  31284. */
  31285. defaultGamma: number | undefined;
  31286. /**
  31287. * The default texture minification filter to apply to this provider.
  31288. */
  31289. defaultMinificationFilter: TextureMinificationFilter;
  31290. /**
  31291. * The default texture magnification filter to apply to this provider.
  31292. */
  31293. defaultMagnificationFilter: TextureMagnificationFilter;
  31294. /**
  31295. * Gets the proxy used by this provider.
  31296. */
  31297. readonly proxy: Proxy;
  31298. /**
  31299. * Gets the width of each tile, in pixels. This function should
  31300. * not be called before {@link GridImageryProvider#ready} returns true.
  31301. */
  31302. readonly tileWidth: number;
  31303. /**
  31304. * Gets the height of each tile, in pixels. This function should
  31305. * not be called before {@link GridImageryProvider#ready} returns true.
  31306. */
  31307. readonly tileHeight: number;
  31308. /**
  31309. * Gets the maximum level-of-detail that can be requested. This function should
  31310. * not be called before {@link GridImageryProvider#ready} returns true.
  31311. */
  31312. readonly maximumLevel: number | undefined;
  31313. /**
  31314. * Gets the minimum level-of-detail that can be requested. This function should
  31315. * not be called before {@link GridImageryProvider#ready} returns true.
  31316. */
  31317. readonly minimumLevel: number;
  31318. /**
  31319. * Gets the tiling scheme used by this provider. This function should
  31320. * not be called before {@link GridImageryProvider#ready} returns true.
  31321. */
  31322. readonly tilingScheme: TilingScheme;
  31323. /**
  31324. * Gets the rectangle, in radians, of the imagery provided by this instance. This function should
  31325. * not be called before {@link GridImageryProvider#ready} returns true.
  31326. */
  31327. readonly rectangle: Rectangle;
  31328. /**
  31329. * Gets the tile discard policy. If not undefined, the discard policy is responsible
  31330. * for filtering out "missing" tiles via its shouldDiscardImage function. If this function
  31331. * returns undefined, no tiles are filtered. This function should
  31332. * not be called before {@link GridImageryProvider#ready} returns true.
  31333. */
  31334. readonly tileDiscardPolicy: TileDiscardPolicy;
  31335. /**
  31336. * Gets an event that is raised when the imagery provider encounters an asynchronous error. By subscribing
  31337. * to the event, you will be notified of the error and can potentially recover from it. Event listeners
  31338. * are passed an instance of {@link TileProviderError}.
  31339. */
  31340. readonly errorEvent: Event;
  31341. /**
  31342. * Gets a value indicating whether or not the provider is ready for use.
  31343. */
  31344. readonly ready: boolean;
  31345. /**
  31346. * Gets a promise that resolves to true when the provider is ready for use.
  31347. */
  31348. readonly readyPromise: Promise<boolean>;
  31349. /**
  31350. * Gets the credit to display when this imagery provider is active. Typically this is used to credit
  31351. * the source of the imagery. This function should not be called before {@link GridImageryProvider#ready} returns true.
  31352. */
  31353. readonly credit: Credit;
  31354. /**
  31355. * Gets a value indicating whether or not the images provided by this imagery provider
  31356. * include an alpha channel. If this property is false, an alpha channel, if present, will
  31357. * be ignored. If this property is true, any images without an alpha channel will be treated
  31358. * as if their alpha is 1.0 everywhere. When this property is false, memory usage
  31359. * and texture upload time are reduced.
  31360. */
  31361. readonly hasAlphaChannel: boolean;
  31362. /**
  31363. * Draws a grid of lines into a canvas.
  31364. */
  31365. _drawGrid(): void;
  31366. /**
  31367. * Render a grid into a canvas with background and glow
  31368. */
  31369. _createGridCanvas(): void;
  31370. /**
  31371. * Gets the credits to be displayed when a given tile is displayed.
  31372. * @param x - The tile X coordinate.
  31373. * @param y - The tile Y coordinate.
  31374. * @param level - The tile level;
  31375. * @returns The credits to be displayed when the tile is displayed.
  31376. */
  31377. getTileCredits(x: number, y: number, level: number): Credit[];
  31378. /**
  31379. * Requests the image for a given tile. This function should
  31380. * not be called before {@link GridImageryProvider#ready} returns true.
  31381. * @param x - The tile X coordinate.
  31382. * @param y - The tile Y coordinate.
  31383. * @param level - The tile level.
  31384. * @param [request] - The request object. Intended for internal use only.
  31385. * @returns The resolved image as a Canvas DOM object.
  31386. */
  31387. requestImage(x: number, y: number, level: number, request?: Request): Promise<HTMLCanvasElement>;
  31388. /**
  31389. * Picking features is not currently supported by this imagery provider, so this function simply returns
  31390. * undefined.
  31391. * @param x - The tile X coordinate.
  31392. * @param y - The tile Y coordinate.
  31393. * @param level - The tile level.
  31394. * @param longitude - The longitude at which to pick features.
  31395. * @param latitude - The latitude at which to pick features.
  31396. * @returns Undefined since picking is not supported.
  31397. */
  31398. pickFeatures(x: number, y: number, level: number, longitude: number, latitude: number): undefined;
  31399. }
  31400. /**
  31401. * A GroundPolylinePrimitive represents a polyline draped over the terrain or 3D Tiles in the {@link Scene}.
  31402. * <p>
  31403. * Only to be used with GeometryInstances containing {@link GroundPolylineGeometry}.
  31404. * </p>
  31405. * @example
  31406. * // 1. Draw a polyline on terrain with a basic color material
  31407. *
  31408. * const instance = new Cesium.GeometryInstance({
  31409. * geometry : new Cesium.GroundPolylineGeometry({
  31410. * positions : Cesium.Cartesian3.fromDegreesArray([
  31411. * -112.1340164450331, 36.05494287836128,
  31412. * -112.08821010582645, 36.097804071380715
  31413. * ]),
  31414. * width : 4.0
  31415. * }),
  31416. * id : 'object returned when this instance is picked and to get/set per-instance attributes'
  31417. * });
  31418. *
  31419. * scene.groundPrimitives.add(new Cesium.GroundPolylinePrimitive({
  31420. * geometryInstances : instance,
  31421. * appearance : new Cesium.PolylineMaterialAppearance()
  31422. * }));
  31423. *
  31424. * // 2. Draw a looped polyline on terrain with per-instance color and a distance display condition.
  31425. * // Distance display conditions for polylines on terrain are based on an approximate terrain height
  31426. * // instead of true terrain height.
  31427. *
  31428. * const instance2 = new Cesium.GeometryInstance({
  31429. * geometry : new Cesium.GroundPolylineGeometry({
  31430. * positions : Cesium.Cartesian3.fromDegreesArray([
  31431. * -112.1340164450331, 36.05494287836128,
  31432. * -112.08821010582645, 36.097804071380715,
  31433. * -112.13296079730024, 36.168769146801104
  31434. * ]),
  31435. * loop : true,
  31436. * width : 4.0
  31437. * }),
  31438. * attributes : {
  31439. * color : Cesium.ColorGeometryInstanceAttribute.fromColor(Cesium.Color.fromCssColorString('green').withAlpha(0.7)),
  31440. * distanceDisplayCondition : new Cesium.DistanceDisplayConditionGeometryInstanceAttribute(1000, 30000)
  31441. * },
  31442. * id : 'object returned when this instance is picked and to get/set per-instance attributes'
  31443. * });
  31444. *
  31445. * scene.groundPrimitives.add(new Cesium.GroundPolylinePrimitive({
  31446. * geometryInstances : instance2,
  31447. * appearance : new Cesium.PolylineColorAppearance()
  31448. * }));
  31449. * @param [options] - Object with the following properties:
  31450. * @param [options.geometryInstances] - GeometryInstances containing GroundPolylineGeometry
  31451. * @param [options.appearance] - The Appearance used to render the polyline. Defaults to a white color {@link Material} on a {@link PolylineMaterialAppearance}.
  31452. * @param [options.show = true] - Determines if this primitive will be shown.
  31453. * @param [options.interleave = false] - When <code>true</code>, geometry vertex attributes are interleaved, which can slightly improve rendering performance but increases load time.
  31454. * @param [options.releaseGeometryInstances = true] - When <code>true</code>, the primitive does not keep a reference to the input <code>geometryInstances</code> to save memory.
  31455. * @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.
  31456. * @param [options.asynchronous = true] - Determines if the primitive will be created asynchronously or block until ready. If false initializeTerrainHeights() must be called first.
  31457. * @param [options.classificationType = ClassificationType.BOTH] - Determines whether terrain, 3D Tiles or both will be classified.
  31458. * @param [options.debugShowBoundingVolume = false] - For debugging only. Determines if this primitive's commands' bounding spheres are shown.
  31459. * @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.
  31460. */
  31461. export class GroundPolylinePrimitive {
  31462. constructor(options?: {
  31463. geometryInstances?: any[] | GeometryInstance;
  31464. appearance?: Appearance;
  31465. show?: boolean;
  31466. interleave?: boolean;
  31467. releaseGeometryInstances?: boolean;
  31468. allowPicking?: boolean;
  31469. asynchronous?: boolean;
  31470. classificationType?: ClassificationType;
  31471. debugShowBoundingVolume?: boolean;
  31472. debugShowShadowVolume?: boolean;
  31473. });
  31474. /**
  31475. * The geometry instances rendered with this primitive. This may
  31476. * be <code>undefined</code> if <code>options.releaseGeometryInstances</code>
  31477. * is <code>true</code> when the primitive is constructed.
  31478. * <p>
  31479. * Changing this property after the primitive is rendered has no effect.
  31480. * </p>
  31481. */
  31482. readonly geometryInstances: any[] | GeometryInstance;
  31483. /**
  31484. * The {@link Appearance} used to shade this primitive. Each geometry
  31485. * instance is shaded with the same appearance. Some appearances, like
  31486. * {@link PolylineColorAppearance} allow giving each instance unique
  31487. * properties.
  31488. */
  31489. appearance: Appearance;
  31490. /**
  31491. * Determines if the primitive will be shown. This affects all geometry
  31492. * instances in the primitive.
  31493. */
  31494. show: boolean;
  31495. /**
  31496. * Determines whether terrain, 3D Tiles or both will be classified.
  31497. */
  31498. classificationType: ClassificationType;
  31499. /**
  31500. * This property is for debugging only; it is not for production use nor is it optimized.
  31501. * <p>
  31502. * Draws the bounding sphere for each draw command in the primitive.
  31503. * </p>
  31504. */
  31505. debugShowBoundingVolume: boolean;
  31506. /**
  31507. * Determines if geometry vertex attributes are interleaved, which can slightly improve rendering performance.
  31508. */
  31509. readonly interleave: boolean;
  31510. /**
  31511. * When <code>true</code>, the primitive does not keep a reference to the input <code>geometryInstances</code> to save memory.
  31512. */
  31513. readonly releaseGeometryInstances: boolean;
  31514. /**
  31515. * When <code>true</code>, each geometry instance will only be pickable with {@link Scene#pick}. When <code>false</code>, GPU memory is saved.
  31516. */
  31517. readonly allowPicking: boolean;
  31518. /**
  31519. * Determines if the geometry instances will be created and batched on a web worker.
  31520. */
  31521. readonly asynchronous: boolean;
  31522. /**
  31523. * Determines if the primitive is complete and ready to render. If this property is
  31524. * true, the primitive will be rendered the next time that {@link GroundPolylinePrimitive#update}
  31525. * is called.
  31526. */
  31527. readonly ready: boolean;
  31528. /**
  31529. * Gets a promise that resolves when the primitive is ready to render.
  31530. */
  31531. readonly readyPromise: Promise<GroundPolylinePrimitive>;
  31532. /**
  31533. * This property is for debugging only; it is not for production use nor is it optimized.
  31534. * <p>
  31535. * If true, draws the shadow volume for each geometry in the primitive.
  31536. * </p>
  31537. */
  31538. readonly debugShowShadowVolume: boolean;
  31539. /**
  31540. * Initializes the minimum and maximum terrain heights. This only needs to be called if you are creating the
  31541. * GroundPolylinePrimitive synchronously.
  31542. * @returns A promise that will resolve once the terrain heights have been loaded.
  31543. */
  31544. static initializeTerrainHeights(): Promise<void>;
  31545. /**
  31546. * Called when {@link Viewer} or {@link CesiumWidget} render the scene to
  31547. * get the draw commands needed to render this primitive.
  31548. * <p>
  31549. * Do not call this function directly. This is documented just to
  31550. * list the exceptions that may be propagated when the scene is rendered:
  31551. * </p>
  31552. */
  31553. update(): void;
  31554. /**
  31555. * Returns the modifiable per-instance attributes for a {@link GeometryInstance}.
  31556. * @example
  31557. * const attributes = primitive.getGeometryInstanceAttributes('an id');
  31558. * attributes.color = Cesium.ColorGeometryInstanceAttribute.toValue(Cesium.Color.AQUA);
  31559. * attributes.show = Cesium.ShowGeometryInstanceAttribute.toValue(true);
  31560. * @param id - The id of the {@link GeometryInstance}.
  31561. * @returns The typed array in the attribute's format or undefined if the is no instance with id.
  31562. */
  31563. getGeometryInstanceAttributes(id: any): any;
  31564. /**
  31565. * Checks if the given Scene supports GroundPolylinePrimitives.
  31566. * GroundPolylinePrimitives require support for the WEBGL_depth_texture extension.
  31567. * @param scene - The current scene.
  31568. * @returns Whether or not the current scene supports GroundPolylinePrimitives.
  31569. */
  31570. static isSupported(scene: Scene): boolean;
  31571. /**
  31572. * Returns true if this object was destroyed; otherwise, false.
  31573. * <p>
  31574. * If this object was destroyed, it should not be used; calling any function other than
  31575. * <code>isDestroyed</code> will result in a {@link DeveloperError} exception.
  31576. * </p>
  31577. * @returns <code>true</code> if this object was destroyed; otherwise, <code>false</code>.
  31578. */
  31579. isDestroyed(): boolean;
  31580. /**
  31581. * Destroys the WebGL resources held by this object. Destroying an object allows for deterministic
  31582. * release of WebGL resources, instead of relying on the garbage collector to destroy this object.
  31583. * <p>
  31584. * Once an object is destroyed, it should not be used; calling any function other than
  31585. * <code>isDestroyed</code> will result in a {@link DeveloperError} exception. Therefore,
  31586. * assign the return value (<code>undefined</code>) to the object as done in the example.
  31587. * </p>
  31588. * @example
  31589. * e = e && e.destroy();
  31590. */
  31591. destroy(): void;
  31592. }
  31593. /**
  31594. * A ground primitive represents geometry draped over terrain or 3D Tiles in the {@link Scene}.
  31595. * <p>
  31596. * A primitive combines geometry instances with an {@link Appearance} that describes the full shading, including
  31597. * {@link Material} and {@link RenderState}. Roughly, the geometry instance defines the structure and placement,
  31598. * and the appearance defines the visual characteristics. Decoupling geometry and appearance allows us to mix
  31599. * and match most of them and add a new geometry or appearance independently of each other.
  31600. * </p>
  31601. * <p>
  31602. * Support for the WEBGL_depth_texture extension is required to use GeometryInstances with different PerInstanceColors
  31603. * or materials besides PerInstanceColorAppearance.
  31604. * </p>
  31605. * <p>
  31606. * Textured GroundPrimitives were designed for notional patterns and are not meant for precisely mapping
  31607. * textures to terrain - for that use case, use {@link SingleTileImageryProvider}.
  31608. * </p>
  31609. * <p>
  31610. * For correct rendering, this feature requires the EXT_frag_depth WebGL extension. For hardware that do not support this extension, there
  31611. * will be rendering artifacts for some viewing angles.
  31612. * </p>
  31613. * <p>
  31614. * Valid geometries are {@link CircleGeometry}, {@link CorridorGeometry}, {@link EllipseGeometry}, {@link PolygonGeometry}, and {@link RectangleGeometry}.
  31615. * </p>
  31616. * @example
  31617. * // Example 1: Create primitive with a single instance
  31618. * const rectangleInstance = new Cesium.GeometryInstance({
  31619. * geometry : new Cesium.RectangleGeometry({
  31620. * rectangle : Cesium.Rectangle.fromDegrees(-140.0, 30.0, -100.0, 40.0)
  31621. * }),
  31622. * id : 'rectangle',
  31623. * attributes : {
  31624. * color : new Cesium.ColorGeometryInstanceAttribute(0.0, 1.0, 1.0, 0.5)
  31625. * }
  31626. * });
  31627. * scene.primitives.add(new Cesium.GroundPrimitive({
  31628. * geometryInstances : rectangleInstance
  31629. * }));
  31630. *
  31631. * // Example 2: Batch instances
  31632. * const color = new Cesium.ColorGeometryInstanceAttribute(0.0, 1.0, 1.0, 0.5); // Both instances must have the same color.
  31633. * const rectangleInstance = new Cesium.GeometryInstance({
  31634. * geometry : new Cesium.RectangleGeometry({
  31635. * rectangle : Cesium.Rectangle.fromDegrees(-140.0, 30.0, -100.0, 40.0)
  31636. * }),
  31637. * id : 'rectangle',
  31638. * attributes : {
  31639. * color : color
  31640. * }
  31641. * });
  31642. * const ellipseInstance = new Cesium.GeometryInstance({
  31643. * geometry : new Cesium.EllipseGeometry({
  31644. * center : Cesium.Cartesian3.fromDegrees(-105.0, 40.0),
  31645. * semiMinorAxis : 300000.0,
  31646. * semiMajorAxis : 400000.0
  31647. * }),
  31648. * id : 'ellipse',
  31649. * attributes : {
  31650. * color : color
  31651. * }
  31652. * });
  31653. * scene.primitives.add(new Cesium.GroundPrimitive({
  31654. * geometryInstances : [rectangleInstance, ellipseInstance]
  31655. * }));
  31656. * @param [options] - Object with the following properties:
  31657. * @param [options.geometryInstances] - The geometry instances to render.
  31658. * @param [options.appearance] - The appearance used to render the primitive. Defaults to a flat PerInstanceColorAppearance when GeometryInstances have a color attribute.
  31659. * @param [options.show = true] - Determines if this primitive will be shown.
  31660. * @param [options.vertexCacheOptimize = false] - When <code>true</code>, geometry vertices are optimized for the pre and post-vertex-shader caches.
  31661. * @param [options.interleave = false] - When <code>true</code>, geometry vertex attributes are interleaved, which can slightly improve rendering performance but increases load time.
  31662. * @param [options.compressVertices = true] - When <code>true</code>, the geometry vertices are compressed, which will save memory.
  31663. * @param [options.releaseGeometryInstances = true] - When <code>true</code>, the primitive does not keep a reference to the input <code>geometryInstances</code> to save memory.
  31664. * @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.
  31665. * @param [options.asynchronous = true] - Determines if the primitive will be created asynchronously or block until ready. If false initializeTerrainHeights() must be called first.
  31666. * @param [options.classificationType = ClassificationType.BOTH] - Determines whether terrain, 3D Tiles or both will be classified.
  31667. * @param [options.debugShowBoundingVolume = false] - For debugging only. Determines if this primitive's commands' bounding spheres are shown.
  31668. * @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
  31669. * creation for the volumes to be created before the geometry is released or options.releaseGeometryInstance must be <code>false</code>.
  31670. */
  31671. export class GroundPrimitive {
  31672. constructor(options?: {
  31673. geometryInstances?: any[] | GeometryInstance;
  31674. appearance?: Appearance;
  31675. show?: boolean;
  31676. vertexCacheOptimize?: boolean;
  31677. interleave?: boolean;
  31678. compressVertices?: boolean;
  31679. releaseGeometryInstances?: boolean;
  31680. allowPicking?: boolean;
  31681. asynchronous?: boolean;
  31682. classificationType?: ClassificationType;
  31683. debugShowBoundingVolume?: boolean;
  31684. debugShowShadowVolume?: boolean;
  31685. });
  31686. /**
  31687. * The {@link Appearance} used to shade this primitive. Each geometry
  31688. * instance is shaded with the same appearance. Some appearances, like
  31689. * {@link PerInstanceColorAppearance} allow giving each instance unique
  31690. * properties.
  31691. */
  31692. appearance: Appearance;
  31693. /**
  31694. * The geometry instances rendered with this primitive. This may
  31695. * be <code>undefined</code> if <code>options.releaseGeometryInstances</code>
  31696. * is <code>true</code> when the primitive is constructed.
  31697. * <p>
  31698. * Changing this property after the primitive is rendered has no effect.
  31699. * </p>
  31700. */
  31701. readonly geometryInstances: any[] | GeometryInstance;
  31702. /**
  31703. * Determines if the primitive will be shown. This affects all geometry
  31704. * instances in the primitive.
  31705. */
  31706. show: boolean;
  31707. /**
  31708. * Determines whether terrain, 3D Tiles or both will be classified.
  31709. */
  31710. classificationType: ClassificationType;
  31711. /**
  31712. * This property is for debugging only; it is not for production use nor is it optimized.
  31713. * <p>
  31714. * Draws the bounding sphere for each draw command in the primitive.
  31715. * </p>
  31716. */
  31717. debugShowBoundingVolume: boolean;
  31718. /**
  31719. * This property is for debugging only; it is not for production use nor is it optimized.
  31720. * <p>
  31721. * Draws the shadow volume for each geometry in the primitive.
  31722. * </p>
  31723. */
  31724. debugShowShadowVolume: boolean;
  31725. /**
  31726. * When <code>true</code>, geometry vertices are optimized for the pre and post-vertex-shader caches.
  31727. */
  31728. readonly vertexCacheOptimize: boolean;
  31729. /**
  31730. * Determines if geometry vertex attributes are interleaved, which can slightly improve rendering performance.
  31731. */
  31732. readonly interleave: boolean;
  31733. /**
  31734. * When <code>true</code>, the primitive does not keep a reference to the input <code>geometryInstances</code> to save memory.
  31735. */
  31736. readonly releaseGeometryInstances: boolean;
  31737. /**
  31738. * When <code>true</code>, each geometry instance will only be pickable with {@link Scene#pick}. When <code>false</code>, GPU memory is saved.
  31739. */
  31740. readonly allowPicking: boolean;
  31741. /**
  31742. * Determines if the geometry instances will be created and batched on a web worker.
  31743. */
  31744. readonly asynchronous: boolean;
  31745. /**
  31746. * When <code>true</code>, geometry vertices are compressed, which will save memory.
  31747. */
  31748. readonly compressVertices: boolean;
  31749. /**
  31750. * Determines if the primitive is complete and ready to render. If this property is
  31751. * true, the primitive will be rendered the next time that {@link GroundPrimitive#update}
  31752. * is called.
  31753. */
  31754. readonly ready: boolean;
  31755. /**
  31756. * Gets a promise that resolves when the primitive is ready to render.
  31757. */
  31758. readonly readyPromise: Promise<GroundPrimitive>;
  31759. /**
  31760. * Determines if GroundPrimitive rendering is supported.
  31761. * @param scene - The scene.
  31762. * @returns <code>true</code> if GroundPrimitives are supported; otherwise, returns <code>false</code>
  31763. */
  31764. static isSupported(scene: Scene): boolean;
  31765. /**
  31766. * Initializes the minimum and maximum terrain heights. This only needs to be called if you are creating the
  31767. * GroundPrimitive synchronously.
  31768. * @returns A promise that will resolve once the terrain heights have been loaded.
  31769. */
  31770. static initializeTerrainHeights(): Promise<void>;
  31771. /**
  31772. * Called when {@link Viewer} or {@link CesiumWidget} render the scene to
  31773. * get the draw commands needed to render this primitive.
  31774. * <p>
  31775. * Do not call this function directly. This is documented just to
  31776. * list the exceptions that may be propagated when the scene is rendered:
  31777. * </p>
  31778. */
  31779. update(): void;
  31780. /**
  31781. * Returns the modifiable per-instance attributes for a {@link GeometryInstance}.
  31782. * @example
  31783. * const attributes = primitive.getGeometryInstanceAttributes('an id');
  31784. * attributes.color = Cesium.ColorGeometryInstanceAttribute.toValue(Cesium.Color.AQUA);
  31785. * attributes.show = Cesium.ShowGeometryInstanceAttribute.toValue(true);
  31786. * @param id - The id of the {@link GeometryInstance}.
  31787. * @returns The typed array in the attribute's format or undefined if the is no instance with id.
  31788. */
  31789. getGeometryInstanceAttributes(id: any): any;
  31790. /**
  31791. * Returns true if this object was destroyed; otherwise, false.
  31792. * <p>
  31793. * If this object was destroyed, it should not be used; calling any function other than
  31794. * <code>isDestroyed</code> will result in a {@link DeveloperError} exception.
  31795. * </p>
  31796. * @returns <code>true</code> if this object was destroyed; otherwise, <code>false</code>.
  31797. */
  31798. isDestroyed(): boolean;
  31799. /**
  31800. * Destroys the WebGL resources held by this object. Destroying an object allows for deterministic
  31801. * release of WebGL resources, instead of relying on the garbage collector to destroy this object.
  31802. * <p>
  31803. * Once an object is destroyed, it should not be used; calling any function other than
  31804. * <code>isDestroyed</code> will result in a {@link DeveloperError} exception. Therefore,
  31805. * assign the return value (<code>undefined</code>) to the object as done in the example.
  31806. * </p>
  31807. * @example
  31808. * e = e && e.destroy();
  31809. */
  31810. destroy(): void;
  31811. /**
  31812. * Checks if the given Scene supports materials on GroundPrimitives.
  31813. * Materials on GroundPrimitives require support for the WEBGL_depth_texture extension.
  31814. * @param scene - The current scene.
  31815. * @returns Whether or not the current scene supports materials on GroundPrimitives.
  31816. */
  31817. static supportsMaterials(scene: Scene): boolean;
  31818. }
  31819. /**
  31820. * Represents the position relative to the terrain.
  31821. */
  31822. export enum HeightReference {
  31823. /**
  31824. * The position is absolute.
  31825. */
  31826. NONE = 0,
  31827. /**
  31828. * The position is clamped to the terrain.
  31829. */
  31830. CLAMP_TO_GROUND = 1,
  31831. /**
  31832. * The position height is the height above the terrain.
  31833. */
  31834. RELATIVE_TO_GROUND = 2
  31835. }
  31836. /**
  31837. * The horizontal location of an origin relative to an object, e.g., a {@link Billboard}
  31838. * or {@link Label}. For example, setting the horizontal origin to <code>LEFT</code>
  31839. * or <code>RIGHT</code> will display a billboard to the left or right (in screen space)
  31840. * of the anchor position.
  31841. * <br /><br />
  31842. * <div align='center'>
  31843. * <img src='Images/Billboard.setHorizontalOrigin.png' width='648' height='196' /><br />
  31844. * </div>
  31845. */
  31846. export enum HorizontalOrigin {
  31847. /**
  31848. * The origin is at the horizontal center of the object.
  31849. */
  31850. CENTER = 0,
  31851. /**
  31852. * The origin is on the left side of the object.
  31853. */
  31854. LEFT = 1,
  31855. /**
  31856. * The origin is on the right side of the object.
  31857. */
  31858. RIGHT = -1
  31859. }
  31860. /**
  31861. * Properties for managing image-based lighting on tilesets and models.
  31862. * Also manages the necessary resources and textures.
  31863. * <p>
  31864. * If specular environment maps are used, {@link ImageBasedLighting#destroy} must be called
  31865. * when the image-based lighting is no longer needed to clean up GPU resources properly.
  31866. * If a model or tileset creates an instance of ImageBasedLighting, it will handle this.
  31867. * Otherwise, the application is responsible for calling destroy().
  31868. * </p>
  31869. * @param [options.imageBasedLightingFactor = Cartesian2(1.0, 1.0)] - Scales diffuse and specular image-based lighting from the earth, sky, atmosphere and star skybox.
  31870. * @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.
  31871. * @param [options.sphericalHarmonicCoefficients] - The third order spherical harmonic coefficients used for the diffuse color of image-based lighting.
  31872. * @param [options.specularEnvironmentMaps] - A URL to a KTX2 file that contains a cube map of the specular lighting and the convoluted specular mipmaps.
  31873. */
  31874. export class ImageBasedLighting {
  31875. constructor();
  31876. /**
  31877. * Cesium adds lighting from the earth, sky, atmosphere, and star skybox.
  31878. * This cartesian is used to scale the final diffuse and specular lighting
  31879. * contribution from those sources to the final color. A value of 0.0 will
  31880. * disable those light sources.
  31881. */
  31882. imageBasedLightingFactor: Cartesian2;
  31883. /**
  31884. * The sun's luminance at the zenith in kilo candela per meter squared
  31885. * to use for this model's procedural environment map. This is used when
  31886. * {@link ImageBasedLighting#specularEnvironmentMaps} and {@link ImageBasedLighting#sphericalHarmonicCoefficients}
  31887. * are not defined.
  31888. */
  31889. luminanceAtZenith: number;
  31890. /**
  31891. * The third order spherical harmonic coefficients used for the diffuse color of image-based lighting. When <code>undefined</code>, a diffuse irradiance
  31892. * computed from the atmosphere color is used.
  31893. * <p>
  31894. * There are nine <code>Cartesian3</code> coefficients.
  31895. * 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>
  31896. * </p>
  31897. *
  31898. * These values can be obtained by preprocessing the environment map using the <code>cmgen</code> tool of
  31899. * {@link https://github.com/google/filament/releases|Google's Filament project}. This will also generate a KTX file that can be
  31900. * supplied to {@link Model#specularEnvironmentMaps}.
  31901. */
  31902. sphericalHarmonicCoefficients: Cartesian3[];
  31903. /**
  31904. * A URL to a KTX2 file that contains a cube map of the specular lighting and the convoluted specular mipmaps.
  31905. */
  31906. specularEnvironmentMaps: string;
  31907. }
  31908. /**
  31909. * An imagery layer that displays tiled image data from a single imagery provider
  31910. * on a {@link Globe}.
  31911. * @param imageryProvider - The imagery provider to use.
  31912. * @param [options] - Object with the following properties:
  31913. * @param [options.rectangle = imageryProvider.rectangle] - The rectangle of the layer. This rectangle
  31914. * can limit the visible portion of the imagery provider.
  31915. * @param [options.alpha = 1.0] - The alpha blending value of this layer, from 0.0 to 1.0.
  31916. * This can either be a simple number or a function with the signature
  31917. * <code>function(frameState, layer, x, y, level)</code>. The function is passed the
  31918. * current frame state, this layer, and the x, y, and level coordinates of the
  31919. * imagery tile for which the alpha is required, and it is expected to return
  31920. * the alpha value to use for the tile.
  31921. * @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.
  31922. * This can either be a simple number or a function with the signature
  31923. * <code>function(frameState, layer, x, y, level)</code>. The function is passed the
  31924. * current frame state, this layer, and the x, y, and level coordinates of the
  31925. * imagery tile for which the alpha is required, and it is expected to return
  31926. * the alpha value to use for the tile. This only takes effect when <code>enableLighting</code> is <code>true</code>.
  31927. * @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.
  31928. * This can either be a simple number or a function with the signature
  31929. * <code>function(frameState, layer, x, y, level)</code>. The function is passed the
  31930. * current frame state, this layer, and the x, y, and level coordinates of the
  31931. * imagery tile for which the alpha is required, and it is expected to return
  31932. * the alpha value to use for the tile. This only takes effect when <code>enableLighting</code> is <code>true</code>.
  31933. * @param [options.brightness = 1.0] - The brightness of this layer. 1.0 uses the unmodified imagery
  31934. * color. Less than 1.0 makes the imagery darker while greater than 1.0 makes it brighter.
  31935. * This can either be a simple number or a function with the signature
  31936. * <code>function(frameState, layer, x, y, level)</code>. The function is passed the
  31937. * current frame state, this layer, and the x, y, and level coordinates of the
  31938. * imagery tile for which the brightness is required, and it is expected to return
  31939. * the brightness value to use for the tile. The function is executed for every
  31940. * frame and for every tile, so it must be fast.
  31941. * @param [options.contrast = 1.0] - The contrast of this layer. 1.0 uses the unmodified imagery color.
  31942. * Less than 1.0 reduces the contrast while greater than 1.0 increases it.
  31943. * This can either be a simple number or a function with the signature
  31944. * <code>function(frameState, layer, x, y, level)</code>. The function is passed the
  31945. * current frame state, this layer, and the x, y, and level coordinates of the
  31946. * imagery tile for which the contrast is required, and it is expected to return
  31947. * the contrast value to use for the tile. The function is executed for every
  31948. * frame and for every tile, so it must be fast.
  31949. * @param [options.hue = 0.0] - The hue of this layer. 0.0 uses the unmodified imagery color.
  31950. * This can either be a simple number or a function with the signature
  31951. * <code>function(frameState, layer, x, y, level)</code>. The function is passed the
  31952. * current frame state, this layer, and the x, y, and level coordinates
  31953. * of the imagery tile for which the hue is required, and it is expected to return
  31954. * the contrast value to use for the tile. The function is executed for every
  31955. * frame and for every tile, so it must be fast.
  31956. * @param [options.saturation = 1.0] - The saturation of this layer. 1.0 uses the unmodified imagery color.
  31957. * Less than 1.0 reduces the saturation while greater than 1.0 increases it.
  31958. * This can either be a simple number or a function with the signature
  31959. * <code>function(frameState, layer, x, y, level)</code>. The function is passed the
  31960. * current frame state, this layer, and the x, y, and level coordinates
  31961. * of the imagery tile for which the saturation is required, and it is expected to return
  31962. * the contrast value to use for the tile. The function is executed for every
  31963. * frame and for every tile, so it must be fast.
  31964. * @param [options.gamma = 1.0] - The gamma correction to apply to this layer. 1.0 uses the unmodified imagery color.
  31965. * This can either be a simple number or a function with the signature
  31966. * <code>function(frameState, layer, x, y, level)</code>. The function is passed the
  31967. * current frame state, this layer, and the x, y, and level coordinates of the
  31968. * imagery tile for which the gamma is required, and it is expected to return
  31969. * the gamma value to use for the tile. The function is executed for every
  31970. * frame and for every tile, so it must be fast.
  31971. * @param [options.splitDirection = SplitDirection.NONE] - The {@link SplitDirection} split to apply to this layer.
  31972. * @param [options.minificationFilter = TextureMinificationFilter.LINEAR] - The
  31973. * texture minification filter to apply to this layer. Possible values
  31974. * are <code>TextureMinificationFilter.LINEAR</code> and
  31975. * <code>TextureMinificationFilter.NEAREST</code>.
  31976. * @param [options.magnificationFilter = TextureMagnificationFilter.LINEAR] - The
  31977. * texture minification filter to apply to this layer. Possible values
  31978. * are <code>TextureMagnificationFilter.LINEAR</code> and
  31979. * <code>TextureMagnificationFilter.NEAREST</code>.
  31980. * @param [options.show = true] - True if the layer is shown; otherwise, false.
  31981. * @param [options.maximumAnisotropy = maximum supported] - The maximum anisotropy level to use
  31982. * for texture filtering. If this parameter is not specified, the maximum anisotropy supported
  31983. * by the WebGL stack will be used. Larger values make the imagery look better in horizon
  31984. * views.
  31985. * @param [options.minimumTerrainLevel] - The minimum terrain level-of-detail at which to show this imagery layer,
  31986. * or undefined to show it at all levels. Level zero is the least-detailed level.
  31987. * @param [options.maximumTerrainLevel] - The maximum terrain level-of-detail at which to show this imagery layer,
  31988. * or undefined to show it at all levels. Level zero is the least-detailed level.
  31989. * @param [options.cutoutRectangle] - Cartographic rectangle for cutting out a portion of this ImageryLayer.
  31990. * @param [options.colorToAlpha] - Color to be used as alpha.
  31991. * @param [options.colorToAlphaThreshold = 0.004] - Threshold for color-to-alpha.
  31992. */
  31993. export class ImageryLayer {
  31994. constructor(imageryProvider: ImageryProvider, options?: {
  31995. rectangle?: Rectangle;
  31996. alpha?: number | ((...params: any[]) => any);
  31997. nightAlpha?: number | ((...params: any[]) => any);
  31998. dayAlpha?: number | ((...params: any[]) => any);
  31999. brightness?: number | ((...params: any[]) => any);
  32000. contrast?: number | ((...params: any[]) => any);
  32001. hue?: number | ((...params: any[]) => any);
  32002. saturation?: number | ((...params: any[]) => any);
  32003. gamma?: number | ((...params: any[]) => any);
  32004. splitDirection?: SplitDirection | ((...params: any[]) => any);
  32005. minificationFilter?: TextureMinificationFilter;
  32006. magnificationFilter?: TextureMagnificationFilter;
  32007. show?: boolean;
  32008. maximumAnisotropy?: number;
  32009. minimumTerrainLevel?: number;
  32010. maximumTerrainLevel?: number;
  32011. cutoutRectangle?: Rectangle;
  32012. colorToAlpha?: Color;
  32013. colorToAlphaThreshold?: number;
  32014. });
  32015. /**
  32016. * The alpha blending value of this layer, with 0.0 representing fully transparent and
  32017. * 1.0 representing fully opaque.
  32018. */
  32019. alpha: number;
  32020. /**
  32021. * The alpha blending value of this layer on the night side of the globe, with 0.0 representing fully transparent and
  32022. * 1.0 representing fully opaque. This only takes effect when {@link Globe#enableLighting} is <code>true</code>.
  32023. */
  32024. nightAlpha: number;
  32025. /**
  32026. * The alpha blending value of this layer on the day side of the globe, with 0.0 representing fully transparent and
  32027. * 1.0 representing fully opaque. This only takes effect when {@link Globe#enableLighting} is <code>true</code>.
  32028. */
  32029. dayAlpha: number;
  32030. /**
  32031. * The brightness of this layer. 1.0 uses the unmodified imagery color. Less than 1.0
  32032. * makes the imagery darker while greater than 1.0 makes it brighter.
  32033. */
  32034. brightness: number;
  32035. /**
  32036. * The contrast of this layer. 1.0 uses the unmodified imagery color. Less than 1.0 reduces
  32037. * the contrast while greater than 1.0 increases it.
  32038. */
  32039. contrast: number;
  32040. /**
  32041. * The hue of this layer in radians. 0.0 uses the unmodified imagery color.
  32042. */
  32043. hue: number;
  32044. /**
  32045. * The saturation of this layer. 1.0 uses the unmodified imagery color. Less than 1.0 reduces the
  32046. * saturation while greater than 1.0 increases it.
  32047. */
  32048. saturation: number;
  32049. /**
  32050. * The gamma correction to apply to this layer. 1.0 uses the unmodified imagery color.
  32051. */
  32052. gamma: number;
  32053. /**
  32054. * The {@link SplitDirection} to apply to this layer.
  32055. */
  32056. splitDirection: SplitDirection;
  32057. /**
  32058. * The {@link TextureMinificationFilter} to apply to this layer.
  32059. * Possible values are {@link TextureMinificationFilter.LINEAR} (the default)
  32060. * and {@link TextureMinificationFilter.NEAREST}.
  32061. *
  32062. * To take effect, this property must be set immediately after adding the imagery layer.
  32063. * Once a texture is loaded it won't be possible to change the texture filter used.
  32064. */
  32065. minificationFilter: TextureMinificationFilter;
  32066. /**
  32067. * The {@link TextureMagnificationFilter} to apply to this layer.
  32068. * Possible values are {@link TextureMagnificationFilter.LINEAR} (the default)
  32069. * and {@link TextureMagnificationFilter.NEAREST}.
  32070. *
  32071. * To take effect, this property must be set immediately after adding the imagery layer.
  32072. * Once a texture is loaded it won't be possible to change the texture filter used.
  32073. */
  32074. magnificationFilter: TextureMagnificationFilter;
  32075. /**
  32076. * Determines if this layer is shown.
  32077. */
  32078. show: boolean;
  32079. /**
  32080. * Rectangle cutout in this layer of imagery.
  32081. */
  32082. cutoutRectangle: Rectangle;
  32083. /**
  32084. * Color value that should be set to transparent.
  32085. */
  32086. colorToAlpha: Color;
  32087. /**
  32088. * Normalized (0-1) threshold for color-to-alpha.
  32089. */
  32090. colorToAlphaThreshold: number;
  32091. /**
  32092. * Gets the imagery provider for this layer.
  32093. */
  32094. readonly imageryProvider: ImageryProvider;
  32095. /**
  32096. * Gets the rectangle of this layer. If this rectangle is smaller than the rectangle of the
  32097. * {@link ImageryProvider}, only a portion of the imagery provider is shown.
  32098. */
  32099. readonly rectangle: Rectangle;
  32100. /**
  32101. * This value is used as the default brightness for the imagery layer if one is not provided during construction
  32102. * or by the imagery provider. This value does not modify the brightness of the imagery.
  32103. */
  32104. static DEFAULT_BRIGHTNESS: number;
  32105. /**
  32106. * This value is used as the default contrast for the imagery layer if one is not provided during construction
  32107. * or by the imagery provider. This value does not modify the contrast of the imagery.
  32108. */
  32109. static DEFAULT_CONTRAST: number;
  32110. /**
  32111. * This value is used as the default hue for the imagery layer if one is not provided during construction
  32112. * or by the imagery provider. This value does not modify the hue of the imagery.
  32113. */
  32114. static DEFAULT_HUE: number;
  32115. /**
  32116. * This value is used as the default saturation for the imagery layer if one is not provided during construction
  32117. * or by the imagery provider. This value does not modify the saturation of the imagery.
  32118. */
  32119. static DEFAULT_SATURATION: number;
  32120. /**
  32121. * This value is used as the default gamma for the imagery layer if one is not provided during construction
  32122. * or by the imagery provider. This value does not modify the gamma of the imagery.
  32123. */
  32124. static DEFAULT_GAMMA: number;
  32125. /**
  32126. * This value is used as the default split for the imagery layer if one is not provided during construction
  32127. * or by the imagery provider.
  32128. */
  32129. static DEFAULT_SPLIT: SplitDirection;
  32130. /**
  32131. * This value is used as the default texture minification filter for the imagery layer if one is not provided
  32132. * during construction or by the imagery provider.
  32133. */
  32134. static DEFAULT_MINIFICATION_FILTER: TextureMinificationFilter;
  32135. /**
  32136. * This value is used as the default texture magnification filter for the imagery layer if one is not provided
  32137. * during construction or by the imagery provider.
  32138. */
  32139. static DEFAULT_MAGNIFICATION_FILTER: TextureMagnificationFilter;
  32140. /**
  32141. * This value is used as the default threshold for color-to-alpha if one is not provided
  32142. * during construction or by the imagery provider.
  32143. */
  32144. static DEFAULT_APPLY_COLOR_TO_ALPHA_THRESHOLD: number;
  32145. /**
  32146. * Gets a value indicating whether this layer is the base layer in the
  32147. * {@link ImageryLayerCollection}. The base layer is the one that underlies all
  32148. * others. It is special in that it is treated as if it has global rectangle, even if
  32149. * it actually does not, by stretching the texels at the edges over the entire
  32150. * globe.
  32151. * @returns true if this is the base layer; otherwise, false.
  32152. */
  32153. isBaseLayer(): boolean;
  32154. /**
  32155. * Returns true if this object was destroyed; otherwise, false.
  32156. * <br /><br />
  32157. * If this object was destroyed, it should not be used; calling any function other than
  32158. * <code>isDestroyed</code> will result in a {@link DeveloperError} exception.
  32159. * @returns True if this object was destroyed; otherwise, false.
  32160. */
  32161. isDestroyed(): boolean;
  32162. /**
  32163. * Destroys the WebGL resources held by this object. Destroying an object allows for deterministic
  32164. * release of WebGL resources, instead of relying on the garbage collector to destroy this object.
  32165. * <br /><br />
  32166. * Once an object is destroyed, it should not be used; calling any function other than
  32167. * <code>isDestroyed</code> will result in a {@link DeveloperError} exception. Therefore,
  32168. * assign the return value (<code>undefined</code>) to the object as done in the example.
  32169. * @example
  32170. * imageryLayer = imageryLayer && imageryLayer.destroy();
  32171. */
  32172. destroy(): void;
  32173. /**
  32174. * Computes the intersection of this layer's rectangle with the imagery provider's availability rectangle,
  32175. * producing the overall bounds of imagery that can be produced by this layer.
  32176. * @example
  32177. * // Zoom to an imagery layer.
  32178. * imageryLayer.getViewableRectangle().then(function (rectangle) {
  32179. * return camera.flyTo({
  32180. * destination: rectangle
  32181. * });
  32182. * });
  32183. * @returns A promise to a rectangle which defines the overall bounds of imagery that can be produced by this layer.
  32184. */
  32185. getViewableRectangle(): Promise<Rectangle>;
  32186. }
  32187. /**
  32188. * An ordered collection of imagery layers.
  32189. */
  32190. export class ImageryLayerCollection {
  32191. constructor();
  32192. /**
  32193. * An event that is raised when a layer is added to the collection. Event handlers are passed the layer that
  32194. * was added and the index at which it was added.
  32195. */
  32196. layerAdded: Event;
  32197. /**
  32198. * An event that is raised when a layer is removed from the collection. Event handlers are passed the layer that
  32199. * was removed and the index from which it was removed.
  32200. */
  32201. layerRemoved: Event;
  32202. /**
  32203. * An event that is raised when a layer changes position in the collection. Event handlers are passed the layer that
  32204. * was moved, its new index after the move, and its old index prior to the move.
  32205. */
  32206. layerMoved: Event;
  32207. /**
  32208. * An event that is raised when a layer is shown or hidden by setting the
  32209. * {@link ImageryLayer#show} property. Event handlers are passed a reference to this layer,
  32210. * the index of the layer in the collection, and a flag that is true if the layer is now
  32211. * shown or false if it is now hidden.
  32212. */
  32213. layerShownOrHidden: Event;
  32214. /**
  32215. * Gets the number of layers in this collection.
  32216. */
  32217. length: number;
  32218. /**
  32219. * Adds a layer to the collection.
  32220. * @param layer - the layer to add.
  32221. * @param [index] - the index to add the layer at. If omitted, the layer will
  32222. * be added on top of all existing layers.
  32223. */
  32224. add(layer: ImageryLayer, index?: number): void;
  32225. /**
  32226. * Creates a new layer using the given ImageryProvider and adds it to the collection.
  32227. * @param imageryProvider - the imagery provider to create a new layer for.
  32228. * @param [index] - the index to add the layer at. If omitted, the layer will
  32229. * added on top of all existing layers.
  32230. * @returns The newly created layer.
  32231. */
  32232. addImageryProvider(imageryProvider: ImageryProvider, index?: number): ImageryLayer;
  32233. /**
  32234. * Removes a layer from this collection, if present.
  32235. * @param layer - The layer to remove.
  32236. * @param [destroy = true] - whether to destroy the layers in addition to removing them.
  32237. * @returns true if the layer was in the collection and was removed,
  32238. * false if the layer was not in the collection.
  32239. */
  32240. remove(layer: ImageryLayer, destroy?: boolean): boolean;
  32241. /**
  32242. * Removes all layers from this collection.
  32243. * @param [destroy = true] - whether to destroy the layers in addition to removing them.
  32244. */
  32245. removeAll(destroy?: boolean): void;
  32246. /**
  32247. * Checks to see if the collection contains a given layer.
  32248. * @param layer - the layer to check for.
  32249. * @returns true if the collection contains the layer, false otherwise.
  32250. */
  32251. contains(layer: ImageryLayer): boolean;
  32252. /**
  32253. * Determines the index of a given layer in the collection.
  32254. * @param layer - The layer to find the index of.
  32255. * @returns The index of the layer in the collection, or -1 if the layer does not exist in the collection.
  32256. */
  32257. indexOf(layer: ImageryLayer): number;
  32258. /**
  32259. * Gets a layer by index from the collection.
  32260. * @param index - the index to retrieve.
  32261. * @returns The imagery layer at the given index.
  32262. */
  32263. get(index: number): ImageryLayer;
  32264. /**
  32265. * Raises a layer up one position in the collection.
  32266. * @param layer - the layer to move.
  32267. */
  32268. raise(layer: ImageryLayer): void;
  32269. /**
  32270. * Lowers a layer down one position in the collection.
  32271. * @param layer - the layer to move.
  32272. */
  32273. lower(layer: ImageryLayer): void;
  32274. /**
  32275. * Raises a layer to the top of the collection.
  32276. * @param layer - the layer to move.
  32277. */
  32278. raiseToTop(layer: ImageryLayer): void;
  32279. /**
  32280. * Lowers a layer to the bottom of the collection.
  32281. * @param layer - the layer to move.
  32282. */
  32283. lowerToBottom(layer: ImageryLayer): void;
  32284. /**
  32285. * Determines the imagery layers that are intersected by a pick ray. To compute a pick ray from a
  32286. * location on the screen, use {@link Camera.getPickRay}.
  32287. * @param ray - The ray to test for intersection.
  32288. * @param scene - The scene.
  32289. * @returns An array that includes all of
  32290. * the layers that are intersected by a given pick ray. Undefined if
  32291. * no layers are selected.
  32292. */
  32293. pickImageryLayers(ray: Ray, scene: Scene): ImageryLayer[] | undefined;
  32294. /**
  32295. * Asynchronously determines the imagery layer features that are intersected by a pick ray. The intersected imagery
  32296. * layer features are found by invoking {@link ImageryProvider#pickFeatures} for each imagery layer tile intersected
  32297. * by the pick ray. To compute a pick ray from a location on the screen, use {@link Camera.getPickRay}.
  32298. * @example
  32299. * const pickRay = viewer.camera.getPickRay(windowPosition);
  32300. * const featuresPromise = viewer.imageryLayers.pickImageryLayerFeatures(pickRay, viewer.scene);
  32301. * if (!Cesium.defined(featuresPromise)) {
  32302. * console.log('No features picked.');
  32303. * } else {
  32304. * Promise.resolve(featuresPromise).then(function(features) {
  32305. * // This function is called asynchronously when the list if picked features is available.
  32306. * console.log('Number of features: ' + features.length);
  32307. * if (features.length > 0) {
  32308. * console.log('First feature name: ' + features[0].name);
  32309. * }
  32310. * });
  32311. * }
  32312. * @param ray - The ray to test for intersection.
  32313. * @param scene - The scene.
  32314. * @returns A promise that resolves to an array of features intersected by the pick ray.
  32315. * If it can be quickly determined that no features are intersected (for example,
  32316. * because no active imagery providers support {@link ImageryProvider#pickFeatures}
  32317. * or because the pick ray does not intersect the surface), this function will
  32318. * return undefined.
  32319. */
  32320. pickImageryLayerFeatures(ray: Ray, scene: Scene): Promise<ImageryLayerFeatureInfo[]> | undefined;
  32321. /**
  32322. * Returns true if this object was destroyed; otherwise, false.
  32323. * <br /><br />
  32324. * If this object was destroyed, it should not be used; calling any function other than
  32325. * <code>isDestroyed</code> will result in a {@link DeveloperError} exception.
  32326. * @returns true if this object was destroyed; otherwise, false.
  32327. */
  32328. isDestroyed(): boolean;
  32329. /**
  32330. * Destroys the WebGL resources held by all layers in this collection. Explicitly destroying this
  32331. * object allows for deterministic release of WebGL resources, instead of relying on the garbage
  32332. * collector.
  32333. * <br /><br />
  32334. * Once this object is destroyed, it should not be used; calling any function other than
  32335. * <code>isDestroyed</code> will result in a {@link DeveloperError} exception. Therefore,
  32336. * assign the return value (<code>undefined</code>) to the object as done in the example.
  32337. * @example
  32338. * layerCollection = layerCollection && layerCollection.destroy();
  32339. */
  32340. destroy(): void;
  32341. }
  32342. /**
  32343. * Describes a rasterized feature, such as a point, polygon, polyline, etc., in an imagery layer.
  32344. */
  32345. export class ImageryLayerFeatureInfo {
  32346. constructor();
  32347. /**
  32348. * Gets or sets the name of the feature.
  32349. */
  32350. name: string | undefined;
  32351. /**
  32352. * Gets or sets an HTML description of the feature. The HTML is not trusted and should
  32353. * be sanitized before display to the user.
  32354. */
  32355. description: string | undefined;
  32356. /**
  32357. * Gets or sets the position of the feature, or undefined if the position is not known.
  32358. */
  32359. position: Cartographic | undefined;
  32360. /**
  32361. * Gets or sets the raw data describing the feature. The raw data may be in any
  32362. * number of formats, such as GeoJSON, KML, etc.
  32363. */
  32364. data: any | undefined;
  32365. /**
  32366. * Gets or sets the image layer of the feature.
  32367. */
  32368. imageryLayer: any | undefined;
  32369. /**
  32370. * Configures the name of this feature by selecting an appropriate property. The name will be obtained from
  32371. * one of the following sources, in this order: 1) the property with the name 'name', 2) the property with the name 'title',
  32372. * 3) the first property containing the word 'name', 4) the first property containing the word 'title'. If
  32373. * the name cannot be obtained from any of these sources, the existing name will be left unchanged.
  32374. * @param properties - An object literal containing the properties of the feature.
  32375. */
  32376. configureNameFromProperties(properties: any): void;
  32377. /**
  32378. * Configures the description of this feature by creating an HTML table of properties and their values.
  32379. * @param properties - An object literal containing the properties of the feature.
  32380. */
  32381. configureDescriptionFromProperties(properties: any): void;
  32382. }
  32383. /**
  32384. * The format in which {@link ImageryProvider} methods return an image may
  32385. * vary by provider, configuration, or server settings. Most common are
  32386. * <code>HTMLImageElement</code>, <code>HTMLCanvasElement</code>, or on supported
  32387. * browsers, <code>ImageBitmap</code>.
  32388. *
  32389. * See the documentation for each ImageryProvider class for more information about how they return images.
  32390. */
  32391. export type ImageryTypes = HTMLImageElement | HTMLCanvasElement | ImageBitmap;
  32392. /**
  32393. * Provides imagery to be displayed on the surface of an ellipsoid. This type describes an
  32394. * interface and is not intended to be instantiated directly.
  32395. */
  32396. export class ImageryProvider {
  32397. constructor();
  32398. /**
  32399. * The default alpha blending value of this provider, with 0.0 representing fully transparent and
  32400. * 1.0 representing fully opaque.
  32401. */
  32402. defaultAlpha: number | undefined;
  32403. /**
  32404. * The default alpha blending value on the night side of the globe of this provider, with 0.0 representing fully transparent and
  32405. * 1.0 representing fully opaque.
  32406. */
  32407. defaultNightAlpha: number | undefined;
  32408. /**
  32409. * The default alpha blending value on the day side of the globe of this provider, with 0.0 representing fully transparent and
  32410. * 1.0 representing fully opaque.
  32411. */
  32412. defaultDayAlpha: number | undefined;
  32413. /**
  32414. * The default brightness of this provider. 1.0 uses the unmodified imagery color. Less than 1.0
  32415. * makes the imagery darker while greater than 1.0 makes it brighter.
  32416. */
  32417. defaultBrightness: number | undefined;
  32418. /**
  32419. * The default contrast of this provider. 1.0 uses the unmodified imagery color. Less than 1.0 reduces
  32420. * the contrast while greater than 1.0 increases it.
  32421. */
  32422. defaultContrast: number | undefined;
  32423. /**
  32424. * The default hue of this provider in radians. 0.0 uses the unmodified imagery color.
  32425. */
  32426. defaultHue: number | undefined;
  32427. /**
  32428. * The default saturation of this provider. 1.0 uses the unmodified imagery color. Less than 1.0 reduces the
  32429. * saturation while greater than 1.0 increases it.
  32430. */
  32431. defaultSaturation: number | undefined;
  32432. /**
  32433. * The default gamma correction to apply to this provider. 1.0 uses the unmodified imagery color.
  32434. */
  32435. defaultGamma: number | undefined;
  32436. /**
  32437. * The default texture minification filter to apply to this provider.
  32438. */
  32439. defaultMinificationFilter: TextureMinificationFilter;
  32440. /**
  32441. * The default texture magnification filter to apply to this provider.
  32442. */
  32443. defaultMagnificationFilter: TextureMagnificationFilter;
  32444. /**
  32445. * Gets a value indicating whether or not the provider is ready for use.
  32446. */
  32447. readonly ready: boolean;
  32448. /**
  32449. * Gets a promise that resolves to true when the provider is ready for use.
  32450. */
  32451. readonly readyPromise: Promise<boolean>;
  32452. /**
  32453. * Gets the rectangle, in radians, of the imagery provided by the instance. This function should
  32454. * not be called before {@link ImageryProvider#ready} returns true.
  32455. */
  32456. readonly rectangle: Rectangle;
  32457. /**
  32458. * Gets the width of each tile, in pixels. This function should
  32459. * not be called before {@link ImageryProvider#ready} returns true.
  32460. */
  32461. readonly tileWidth: number;
  32462. /**
  32463. * Gets the height of each tile, in pixels. This function should
  32464. * not be called before {@link ImageryProvider#ready} returns true.
  32465. */
  32466. readonly tileHeight: number;
  32467. /**
  32468. * Gets the maximum level-of-detail that can be requested. This function should
  32469. * not be called before {@link ImageryProvider#ready} returns true.
  32470. */
  32471. readonly maximumLevel: number | undefined;
  32472. /**
  32473. * Gets the minimum level-of-detail that can be requested. This function should
  32474. * not be called before {@link ImageryProvider#ready} returns true. Generally,
  32475. * a minimum level should only be used when the rectangle of the imagery is small
  32476. * enough that the number of tiles at the minimum level is small. An imagery
  32477. * provider with more than a few tiles at the minimum level will lead to
  32478. * rendering problems.
  32479. */
  32480. readonly minimumLevel: number;
  32481. /**
  32482. * Gets the tiling scheme used by the provider. This function should
  32483. * not be called before {@link ImageryProvider#ready} returns true.
  32484. */
  32485. readonly tilingScheme: TilingScheme;
  32486. /**
  32487. * Gets the tile discard policy. If not undefined, the discard policy is responsible
  32488. * for filtering out "missing" tiles via its shouldDiscardImage function. If this function
  32489. * returns undefined, no tiles are filtered. This function should
  32490. * not be called before {@link ImageryProvider#ready} returns true.
  32491. */
  32492. readonly tileDiscardPolicy: TileDiscardPolicy;
  32493. /**
  32494. * Gets an event that is raised when the imagery provider encounters an asynchronous error.. By subscribing
  32495. * to the event, you will be notified of the error and can potentially recover from it. Event listeners
  32496. * are passed an instance of {@link TileProviderError}.
  32497. */
  32498. readonly errorEvent: Event;
  32499. /**
  32500. * Gets the credit to display when this imagery provider is active. Typically this is used to credit
  32501. * the source of the imagery. This function should
  32502. * not be called before {@link ImageryProvider#ready} returns true.
  32503. */
  32504. readonly credit: Credit;
  32505. /**
  32506. * Gets the proxy used by this provider.
  32507. */
  32508. readonly proxy: Proxy;
  32509. /**
  32510. * Gets a value indicating whether or not the images provided by this imagery provider
  32511. * include an alpha channel. If this property is false, an alpha channel, if present, will
  32512. * be ignored. If this property is true, any images without an alpha channel will be treated
  32513. * as if their alpha is 1.0 everywhere. When this property is false, memory usage
  32514. * and texture upload time are reduced.
  32515. */
  32516. readonly hasAlphaChannel: boolean;
  32517. /**
  32518. * Gets the credits to be displayed when a given tile is displayed.
  32519. * @param x - The tile X coordinate.
  32520. * @param y - The tile Y coordinate.
  32521. * @param level - The tile level;
  32522. * @returns The credits to be displayed when the tile is displayed.
  32523. */
  32524. getTileCredits(x: number, y: number, level: number): Credit[];
  32525. /**
  32526. * Requests the image for a given tile. This function should
  32527. * not be called before {@link ImageryProvider#ready} returns true.
  32528. * @param x - The tile X coordinate.
  32529. * @param y - The tile Y coordinate.
  32530. * @param level - The tile level.
  32531. * @param [request] - The request object. Intended for internal use only.
  32532. * @returns Returns a promise for the image that will resolve when the image is available, or
  32533. * undefined if there are too many active requests to the server, and the request should be retried later.
  32534. */
  32535. requestImage(x: number, y: number, level: number, request?: Request): Promise<ImageryTypes> | undefined;
  32536. /**
  32537. * Asynchronously determines what features, if any, are located at a given longitude and latitude within
  32538. * a tile. This function should not be called before {@link ImageryProvider#ready} returns true.
  32539. * This function is optional, so it may not exist on all ImageryProviders.
  32540. * @param x - The tile X coordinate.
  32541. * @param y - The tile Y coordinate.
  32542. * @param level - The tile level.
  32543. * @param longitude - The longitude at which to pick features.
  32544. * @param latitude - The latitude at which to pick features.
  32545. * @returns A promise for the picked features that will resolve when the asynchronous
  32546. * picking completes. The resolved value is an array of {@link ImageryLayerFeatureInfo}
  32547. * instances. The array may be empty if no features are found at the given location.
  32548. * It may also be undefined if picking is not supported.
  32549. */
  32550. pickFeatures(x: number, y: number, level: number, longitude: number, latitude: number): Promise<ImageryLayerFeatureInfo[]> | undefined;
  32551. /**
  32552. * Loads an image from a given URL. If the server referenced by the URL already has
  32553. * too many requests pending, this function will instead return undefined, indicating
  32554. * that the request should be retried later.
  32555. * @param imageryProvider - The imagery provider for the URL.
  32556. * @param url - The URL of the image.
  32557. * @returns A promise for the image that will resolve when the image is available, or
  32558. * undefined if there are too many active requests to the server, and the request should be retried later.
  32559. */
  32560. static loadImage(imageryProvider: ImageryProvider, url: Resource | string): Promise<ImageryTypes | CompressedTextureBuffer> | undefined;
  32561. }
  32562. /**
  32563. * This enumeration is deprecated. Use {@link SplitPosition} instead.
  32564. */
  32565. export enum ImagerySplitDirection {
  32566. }
  32567. export namespace IonImageryProvider {
  32568. /**
  32569. * Initialization options for the TileMapServiceImageryProvider constructor
  32570. * @property assetId - An ion imagery asset ID
  32571. * @property [accessToken = Ion.defaultAccessToken] - The access token to use.
  32572. * @property [server = Ion.defaultServer] - The resource to the Cesium ion API server.
  32573. */
  32574. type ConstructorOptions = {
  32575. assetId: number;
  32576. accessToken?: string;
  32577. server?: string | Resource;
  32578. };
  32579. }
  32580. /**
  32581. * Provides tiled imagery using the Cesium ion REST API.
  32582. * @example
  32583. * viewer.imageryLayers.addImageryProvider(new Cesium.IonImageryProvider({ assetId : 23489024 }));
  32584. * @param options - Object describing initialization options
  32585. */
  32586. export class IonImageryProvider {
  32587. constructor(options: IonImageryProvider.ConstructorOptions);
  32588. /**
  32589. * The default alpha blending value of this provider, with 0.0 representing fully transparent and
  32590. * 1.0 representing fully opaque.
  32591. */
  32592. defaultAlpha: number | undefined;
  32593. /**
  32594. * The default alpha blending value on the night side of the globe of this provider, with 0.0 representing fully transparent and
  32595. * 1.0 representing fully opaque.
  32596. */
  32597. defaultNightAlpha: number | undefined;
  32598. /**
  32599. * The default alpha blending value on the day side of the globe of this provider, with 0.0 representing fully transparent and
  32600. * 1.0 representing fully opaque.
  32601. */
  32602. defaultDayAlpha: number | undefined;
  32603. /**
  32604. * The default brightness of this provider. 1.0 uses the unmodified imagery color. Less than 1.0
  32605. * makes the imagery darker while greater than 1.0 makes it brighter.
  32606. */
  32607. defaultBrightness: number | undefined;
  32608. /**
  32609. * The default contrast of this provider. 1.0 uses the unmodified imagery color. Less than 1.0 reduces
  32610. * the contrast while greater than 1.0 increases it.
  32611. */
  32612. defaultContrast: number | undefined;
  32613. /**
  32614. * The default hue of this provider in radians. 0.0 uses the unmodified imagery color.
  32615. */
  32616. defaultHue: number | undefined;
  32617. /**
  32618. * The default saturation of this provider. 1.0 uses the unmodified imagery color. Less than 1.0 reduces the
  32619. * saturation while greater than 1.0 increases it.
  32620. */
  32621. defaultSaturation: number | undefined;
  32622. /**
  32623. * The default gamma correction to apply to this provider. 1.0 uses the unmodified imagery color.
  32624. */
  32625. defaultGamma: number | undefined;
  32626. /**
  32627. * The default texture minification filter to apply to this provider.
  32628. */
  32629. defaultMinificationFilter: TextureMinificationFilter;
  32630. /**
  32631. * The default texture magnification filter to apply to this provider.
  32632. */
  32633. defaultMagnificationFilter: TextureMagnificationFilter;
  32634. /**
  32635. * Gets a value indicating whether or not the provider is ready for use.
  32636. */
  32637. readonly ready: boolean;
  32638. /**
  32639. * Gets a promise that resolves to true when the provider is ready for use.
  32640. */
  32641. readonly readyPromise: Promise<boolean>;
  32642. /**
  32643. * Gets the rectangle, in radians, of the imagery provided by the instance. This function should
  32644. * not be called before {@link IonImageryProvider#ready} returns true.
  32645. */
  32646. readonly rectangle: Rectangle;
  32647. /**
  32648. * Gets the width of each tile, in pixels. This function should
  32649. * not be called before {@link IonImageryProvider#ready} returns true.
  32650. */
  32651. readonly tileWidth: number;
  32652. /**
  32653. * Gets the height of each tile, in pixels. This function should
  32654. * not be called before {@link IonImageryProvider#ready} returns true.
  32655. */
  32656. readonly tileHeight: number;
  32657. /**
  32658. * Gets the maximum level-of-detail that can be requested. This function should
  32659. * not be called before {@link IonImageryProvider#ready} returns true.
  32660. */
  32661. readonly maximumLevel: number | undefined;
  32662. /**
  32663. * Gets the minimum level-of-detail that can be requested. This function should
  32664. * not be called before {@link IonImageryProvider#ready} returns true. Generally,
  32665. * a minimum level should only be used when the rectangle of the imagery is small
  32666. * enough that the number of tiles at the minimum level is small. An imagery
  32667. * provider with more than a few tiles at the minimum level will lead to
  32668. * rendering problems.
  32669. */
  32670. readonly minimumLevel: number;
  32671. /**
  32672. * Gets the tiling scheme used by the provider. This function should
  32673. * not be called before {@link IonImageryProvider#ready} returns true.
  32674. */
  32675. readonly tilingScheme: TilingScheme;
  32676. /**
  32677. * Gets the tile discard policy. If not undefined, the discard policy is responsible
  32678. * for filtering out "missing" tiles via its shouldDiscardImage function. If this function
  32679. * returns undefined, no tiles are filtered. This function should
  32680. * not be called before {@link IonImageryProvider#ready} returns true.
  32681. */
  32682. readonly tileDiscardPolicy: TileDiscardPolicy;
  32683. /**
  32684. * Gets an event that is raised when the imagery provider encounters an asynchronous error. By subscribing
  32685. * to the event, you will be notified of the error and can potentially recover from it. Event listeners
  32686. * are passed an instance of {@link TileProviderError}.
  32687. */
  32688. readonly errorEvent: Event;
  32689. /**
  32690. * Gets the credit to display when this imagery provider is active. Typically this is used to credit
  32691. * the source of the imagery. This function should
  32692. * not be called before {@link IonImageryProvider#ready} returns true.
  32693. */
  32694. readonly credit: Credit;
  32695. /**
  32696. * Gets a value indicating whether or not the images provided by this imagery provider
  32697. * include an alpha channel. If this property is false, an alpha channel, if present, will
  32698. * be ignored. If this property is true, any images without an alpha channel will be treated
  32699. * as if their alpha is 1.0 everywhere. When this property is false, memory usage
  32700. * and texture upload time are reduced.
  32701. */
  32702. readonly hasAlphaChannel: boolean;
  32703. /**
  32704. * Gets the proxy used by this provider.
  32705. */
  32706. readonly proxy: Proxy;
  32707. /**
  32708. * Gets the credits to be displayed when a given tile is displayed.
  32709. * @param x - The tile X coordinate.
  32710. * @param y - The tile Y coordinate.
  32711. * @param level - The tile level;
  32712. * @returns The credits to be displayed when the tile is displayed.
  32713. */
  32714. getTileCredits(x: number, y: number, level: number): Credit[];
  32715. /**
  32716. * Requests the image for a given tile. This function should
  32717. * not be called before {@link IonImageryProvider#ready} returns true.
  32718. * @param x - The tile X coordinate.
  32719. * @param y - The tile Y coordinate.
  32720. * @param level - The tile level.
  32721. * @param [request] - The request object. Intended for internal use only.
  32722. * @returns A promise for the image that will resolve when the image is available, or
  32723. * undefined if there are too many active requests to the server, and the request should be retried later.
  32724. */
  32725. requestImage(x: number, y: number, level: number, request?: Request): Promise<ImageryTypes> | undefined;
  32726. /**
  32727. * Asynchronously determines what features, if any, are located at a given longitude and latitude within
  32728. * a tile. This function should not be called before {@link IonImageryProvider#ready} returns true.
  32729. * This function is optional, so it may not exist on all ImageryProviders.
  32730. * @param x - The tile X coordinate.
  32731. * @param y - The tile Y coordinate.
  32732. * @param level - The tile level.
  32733. * @param longitude - The longitude at which to pick features.
  32734. * @param latitude - The latitude at which to pick features.
  32735. * @returns A promise for the picked features that will resolve when the asynchronous
  32736. * picking completes. The resolved value is an array of {@link ImageryLayerFeatureInfo}
  32737. * instances. The array may be empty if no features are found at the given location.
  32738. * It may also be undefined if picking is not supported.
  32739. */
  32740. pickFeatures(x: number, y: number, level: number, longitude: number, latitude: number): Promise<ImageryLayerFeatureInfo[]> | undefined;
  32741. }
  32742. /**
  32743. * The types of imagery provided by {@link createWorldImagery}.
  32744. */
  32745. export enum IonWorldImageryStyle {
  32746. /**
  32747. * Aerial imagery.
  32748. */
  32749. AERIAL = 2,
  32750. /**
  32751. * Aerial imagery with a road overlay.
  32752. */
  32753. AERIAL_WITH_LABELS = 3,
  32754. /**
  32755. * Roads without additional imagery.
  32756. */
  32757. ROAD = 4
  32758. }
  32759. /**
  32760. * A Label draws viewport-aligned text positioned in the 3D scene. This constructor
  32761. * should not be used directly, instead create labels by calling {@link LabelCollection#add}.
  32762. */
  32763. export class Label {
  32764. constructor();
  32765. /**
  32766. * Determines if this label will be shown. Use this to hide or show a label, instead
  32767. * of removing it and re-adding it to the collection.
  32768. */
  32769. show: boolean;
  32770. /**
  32771. * Gets or sets the Cartesian position of this label.
  32772. */
  32773. position: Cartesian3;
  32774. /**
  32775. * Gets or sets the height reference of this billboard.
  32776. */
  32777. heightReference: HeightReference;
  32778. /**
  32779. * Gets or sets the text of this label.
  32780. */
  32781. text: string;
  32782. /**
  32783. * Gets or sets the font used to draw this label. Fonts are specified using the same syntax as the CSS 'font' property.
  32784. */
  32785. font: string;
  32786. /**
  32787. * Gets or sets the fill color of this label.
  32788. */
  32789. fillColor: Color;
  32790. /**
  32791. * Gets or sets the outline color of this label.
  32792. */
  32793. outlineColor: Color;
  32794. /**
  32795. * Gets or sets the outline width of this label.
  32796. */
  32797. outlineWidth: number;
  32798. /**
  32799. * Determines if a background behind this label will be shown.
  32800. */
  32801. showBackground: boolean;
  32802. /**
  32803. * Gets or sets the background color of this label.
  32804. */
  32805. backgroundColor: Color;
  32806. /**
  32807. * Gets or sets the background padding, in pixels, of this label. The <code>x</code> value
  32808. * controls horizontal padding, and the <code>y</code> value controls vertical padding.
  32809. */
  32810. backgroundPadding: Cartesian2;
  32811. /**
  32812. * Gets or sets the style of this label.
  32813. */
  32814. style: LabelStyle;
  32815. /**
  32816. * Gets or sets the pixel offset in screen space from the origin of this label. This is commonly used
  32817. * to align multiple labels and billboards at the same position, e.g., an image and text. The
  32818. * screen space origin is the top, left corner of the canvas; <code>x</code> increases from
  32819. * left to right, and <code>y</code> increases from top to bottom.
  32820. * <br /><br />
  32821. * <div align='center'>
  32822. * <table border='0' cellpadding='5'><tr>
  32823. * <td align='center'><code>default</code><br/><img src='Images/Label.setPixelOffset.default.png' width='250' height='188' /></td>
  32824. * <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>
  32825. * </tr></table>
  32826. * The label's origin is indicated by the yellow point.
  32827. * </div>
  32828. */
  32829. pixelOffset: Cartesian2;
  32830. /**
  32831. * Gets or sets near and far translucency properties of a Label based on the Label's distance from the camera.
  32832. * A label's translucency will interpolate between the {@link NearFarScalar#nearValue} and
  32833. * {@link NearFarScalar#farValue} while the camera distance falls within the lower and upper bounds
  32834. * of the specified {@link NearFarScalar#near} and {@link NearFarScalar#far}.
  32835. * Outside of these ranges the label's translucency remains clamped to the nearest bound. If undefined,
  32836. * translucencyByDistance will be disabled.
  32837. * @example
  32838. * // Example 1.
  32839. * // Set a label's translucencyByDistance to 1.0 when the
  32840. * // camera is 1500 meters from the label and disappear as
  32841. * // the camera distance approaches 8.0e6 meters.
  32842. * text.translucencyByDistance = new Cesium.NearFarScalar(1.5e2, 1.0, 8.0e6, 0.0);
  32843. * @example
  32844. * // Example 2.
  32845. * // disable translucency by distance
  32846. * text.translucencyByDistance = undefined;
  32847. */
  32848. translucencyByDistance: NearFarScalar;
  32849. /**
  32850. * Gets or sets near and far pixel offset scaling properties of a Label based on the Label's distance from the camera.
  32851. * A label's pixel offset will be scaled between the {@link NearFarScalar#nearValue} and
  32852. * {@link NearFarScalar#farValue} while the camera distance falls within the lower and upper bounds
  32853. * of the specified {@link NearFarScalar#near} and {@link NearFarScalar#far}.
  32854. * Outside of these ranges the label's pixel offset scaling remains clamped to the nearest bound. If undefined,
  32855. * pixelOffsetScaleByDistance will be disabled.
  32856. * @example
  32857. * // Example 1.
  32858. * // Set a label's pixel offset scale to 0.0 when the
  32859. * // camera is 1500 meters from the label and scale pixel offset to 10.0 pixels
  32860. * // in the y direction the camera distance approaches 8.0e6 meters.
  32861. * text.pixelOffset = new Cesium.Cartesian2(0.0, 1.0);
  32862. * text.pixelOffsetScaleByDistance = new Cesium.NearFarScalar(1.5e2, 0.0, 8.0e6, 10.0);
  32863. * @example
  32864. * // Example 2.
  32865. * // disable pixel offset by distance
  32866. * text.pixelOffsetScaleByDistance = undefined;
  32867. */
  32868. pixelOffsetScaleByDistance: NearFarScalar;
  32869. /**
  32870. * Gets or sets near and far scaling properties of a Label based on the label's distance from the camera.
  32871. * A label's scale will interpolate between the {@link NearFarScalar#nearValue} and
  32872. * {@link NearFarScalar#farValue} while the camera distance falls within the lower and upper bounds
  32873. * of the specified {@link NearFarScalar#near} and {@link NearFarScalar#far}.
  32874. * Outside of these ranges the label's scale remains clamped to the nearest bound. If undefined,
  32875. * scaleByDistance will be disabled.
  32876. * @example
  32877. * // Example 1.
  32878. * // Set a label's scaleByDistance to scale by 1.5 when the
  32879. * // camera is 1500 meters from the label and disappear as
  32880. * // the camera distance approaches 8.0e6 meters.
  32881. * label.scaleByDistance = new Cesium.NearFarScalar(1.5e2, 1.5, 8.0e6, 0.0);
  32882. * @example
  32883. * // Example 2.
  32884. * // disable scaling by distance
  32885. * label.scaleByDistance = undefined;
  32886. */
  32887. scaleByDistance: NearFarScalar;
  32888. /**
  32889. * Gets and sets the 3D Cartesian offset applied to this label in eye coordinates. Eye coordinates is a left-handed
  32890. * coordinate system, where <code>x</code> points towards the viewer's right, <code>y</code> points up, and
  32891. * <code>z</code> points into the screen. Eye coordinates use the same scale as world and model coordinates,
  32892. * which is typically meters.
  32893. * <br /><br />
  32894. * An eye offset is commonly used to arrange multiple label or objects at the same position, e.g., to
  32895. * arrange a label above its corresponding 3D model.
  32896. * <br /><br />
  32897. * Below, the label is positioned at the center of the Earth but an eye offset makes it always
  32898. * appear on top of the Earth regardless of the viewer's or Earth's orientation.
  32899. * <br /><br />
  32900. * <div align='center'>
  32901. * <table border='0' cellpadding='5'><tr>
  32902. * <td align='center'><img src='Images/Billboard.setEyeOffset.one.png' width='250' height='188' /></td>
  32903. * <td align='center'><img src='Images/Billboard.setEyeOffset.two.png' width='250' height='188' /></td>
  32904. * </tr></table>
  32905. * <code>l.eyeOffset = new Cartesian3(0.0, 8000000.0, 0.0);</code><br /><br />
  32906. * </div>
  32907. */
  32908. eyeOffset: Cartesian3;
  32909. /**
  32910. * Gets or sets the horizontal origin of this label, which determines if the label is drawn
  32911. * to the left, center, or right of its anchor position.
  32912. * <br /><br />
  32913. * <div align='center'>
  32914. * <img src='Images/Billboard.setHorizontalOrigin.png' width='648' height='196' /><br />
  32915. * </div>
  32916. * @example
  32917. * // Use a top, right origin
  32918. * l.horizontalOrigin = Cesium.HorizontalOrigin.RIGHT;
  32919. * l.verticalOrigin = Cesium.VerticalOrigin.TOP;
  32920. */
  32921. horizontalOrigin: HorizontalOrigin;
  32922. /**
  32923. * Gets or sets the vertical origin of this label, which determines if the label is
  32924. * to the above, below, or at the center of its anchor position.
  32925. * <br /><br />
  32926. * <div align='center'>
  32927. * <img src='Images/Billboard.setVerticalOrigin.png' width='695' height='175' /><br />
  32928. * </div>
  32929. * @example
  32930. * // Use a top, right origin
  32931. * l.horizontalOrigin = Cesium.HorizontalOrigin.RIGHT;
  32932. * l.verticalOrigin = Cesium.VerticalOrigin.TOP;
  32933. */
  32934. verticalOrigin: VerticalOrigin;
  32935. /**
  32936. * Gets or sets the uniform scale that is multiplied with the label's size in pixels.
  32937. * A scale of <code>1.0</code> does not change the size of the label; a scale greater than
  32938. * <code>1.0</code> enlarges the label; a positive scale less than <code>1.0</code> shrinks
  32939. * the label.
  32940. * <br /><br />
  32941. * Applying a large scale value may pixelate the label. To make text larger without pixelation,
  32942. * use a larger font size when calling {@link Label#font} instead.
  32943. * <br /><br />
  32944. * <div align='center'>
  32945. * <img src='Images/Label.setScale.png' width='400' height='300' /><br/>
  32946. * From left to right in the above image, the scales are <code>0.5</code>, <code>1.0</code>,
  32947. * and <code>2.0</code>.
  32948. * </div>
  32949. */
  32950. scale: number;
  32951. /**
  32952. * Gets the total scale of the label, which is the label's scale multiplied by the computed relative size
  32953. * of the desired font compared to the generated glyph size.
  32954. */
  32955. totalScale: number;
  32956. /**
  32957. * Gets or sets the condition specifying at what distance from the camera that this label will be displayed.
  32958. */
  32959. distanceDisplayCondition: DistanceDisplayCondition;
  32960. /**
  32961. * Gets or sets the distance from the camera at which to disable the depth test to, for example, prevent clipping against terrain.
  32962. * When set to zero, the depth test is always applied. When set to Number.POSITIVE_INFINITY, the depth test is never applied.
  32963. */
  32964. disableDepthTestDistance: number;
  32965. /**
  32966. * Gets or sets the user-defined value returned when the label is picked.
  32967. */
  32968. id: any;
  32969. /**
  32970. * Computes the screen-space position of the label's origin, taking into account eye and pixel offsets.
  32971. * The screen space origin is the top, left corner of the canvas; <code>x</code> increases from
  32972. * left to right, and <code>y</code> increases from top to bottom.
  32973. * @example
  32974. * console.log(l.computeScreenSpacePosition(scene).toString());
  32975. * @param scene - The scene the label is in.
  32976. * @param [result] - The object onto which to store the result.
  32977. * @returns The screen-space position of the label.
  32978. */
  32979. computeScreenSpacePosition(scene: Scene, result?: Cartesian2): Cartesian2;
  32980. /**
  32981. * Determines if this label equals another label. Labels are equal if all their properties
  32982. * are equal. Labels in different collections can be equal.
  32983. * @param other - The label to compare for equality.
  32984. * @returns <code>true</code> if the labels are equal; otherwise, <code>false</code>.
  32985. */
  32986. equals(other: Label): boolean;
  32987. /**
  32988. * Returns true if this object was destroyed; otherwise, false.
  32989. * <br /><br />
  32990. * If this object was destroyed, it should not be used; calling any function other than
  32991. * <code>isDestroyed</code> will result in a {@link DeveloperError} exception.
  32992. * @returns True if this object was destroyed; otherwise, false.
  32993. */
  32994. isDestroyed(): boolean;
  32995. /**
  32996. * Determines whether or not run the algorithm, that match the text of the label to right-to-left languages
  32997. * @example
  32998. * // Example 1.
  32999. * // Set a label's rightToLeft before init
  33000. * Cesium.Label.enableRightToLeftDetection = true;
  33001. * const myLabelEntity = viewer.entities.add({
  33002. * label: {
  33003. * id: 'my label',
  33004. * text: 'זה טקסט בעברית \n ועכשיו יורדים שורה',
  33005. * }
  33006. * });
  33007. * @example
  33008. * // Example 2.
  33009. * const myLabelEntity = viewer.entities.add({
  33010. * label: {
  33011. * id: 'my label',
  33012. * text: 'English text'
  33013. * }
  33014. * });
  33015. * // Set a label's rightToLeft after init
  33016. * Cesium.Label.enableRightToLeftDetection = true;
  33017. * myLabelEntity.text = 'טקסט חדש';
  33018. */
  33019. static enableRightToLeftDetection: boolean;
  33020. }
  33021. /**
  33022. * A renderable collection of labels. Labels are viewport-aligned text positioned in the 3D scene.
  33023. * Each label can have a different font, color, scale, etc.
  33024. * <br /><br />
  33025. * <div align='center'>
  33026. * <img src='Images/Label.png' width='400' height='300' /><br />
  33027. * Example labels
  33028. * </div>
  33029. * <br /><br />
  33030. * Labels are added and removed from the collection using {@link LabelCollection#add}
  33031. * and {@link LabelCollection#remove}.
  33032. * @example
  33033. * // Create a label collection with two labels
  33034. * const labels = scene.primitives.add(new Cesium.LabelCollection());
  33035. * labels.add({
  33036. * position : new Cesium.Cartesian3(1.0, 2.0, 3.0),
  33037. * text : 'A label'
  33038. * });
  33039. * labels.add({
  33040. * position : new Cesium.Cartesian3(4.0, 5.0, 6.0),
  33041. * text : 'Another label'
  33042. * });
  33043. * @param [options] - Object with the following properties:
  33044. * @param [options.modelMatrix = Matrix4.IDENTITY] - The 4x4 transformation matrix that transforms each label from model to world coordinates.
  33045. * @param [options.debugShowBoundingVolume = false] - For debugging only. Determines if this primitive's commands' bounding spheres are shown.
  33046. * @param [options.scene] - Must be passed in for labels that use the height reference property or will be depth tested against the globe.
  33047. * @param [options.blendOption = BlendOption.OPAQUE_AND_TRANSLUCENT] - The label blending option. The default
  33048. * is used for rendering both opaque and translucent labels. However, if either all of the labels are completely opaque or all are completely translucent,
  33049. * setting the technique to BlendOption.OPAQUE or BlendOption.TRANSLUCENT can improve performance by up to 2x.
  33050. * @param [options.show = true] - Determines if the labels in the collection will be shown.
  33051. */
  33052. export class LabelCollection {
  33053. constructor(options?: {
  33054. modelMatrix?: Matrix4;
  33055. debugShowBoundingVolume?: boolean;
  33056. scene?: Scene;
  33057. blendOption?: BlendOption;
  33058. show?: boolean;
  33059. });
  33060. /**
  33061. * Determines if labels in this collection will be shown.
  33062. */
  33063. show: boolean;
  33064. /**
  33065. * The 4x4 transformation matrix that transforms each label in this collection from model to world coordinates.
  33066. * When this is the identity matrix, the labels are drawn in world coordinates, i.e., Earth's WGS84 coordinates.
  33067. * Local reference frames can be used by providing a different transformation matrix, like that returned
  33068. * by {@link Transforms.eastNorthUpToFixedFrame}.
  33069. * @example
  33070. * const center = Cesium.Cartesian3.fromDegrees(-75.59777, 40.03883);
  33071. * labels.modelMatrix = Cesium.Transforms.eastNorthUpToFixedFrame(center);
  33072. * labels.add({
  33073. * position : new Cesium.Cartesian3(0.0, 0.0, 0.0),
  33074. * text : 'Center'
  33075. * });
  33076. * labels.add({
  33077. * position : new Cesium.Cartesian3(1000000.0, 0.0, 0.0),
  33078. * text : 'East'
  33079. * });
  33080. * labels.add({
  33081. * position : new Cesium.Cartesian3(0.0, 1000000.0, 0.0),
  33082. * text : 'North'
  33083. * });
  33084. * labels.add({
  33085. * position : new Cesium.Cartesian3(0.0, 0.0, 1000000.0),
  33086. * text : 'Up'
  33087. * });
  33088. */
  33089. modelMatrix: Matrix4;
  33090. /**
  33091. * This property is for debugging only; it is not for production use nor is it optimized.
  33092. * <p>
  33093. * Draws the bounding sphere for each draw command in the primitive.
  33094. * </p>
  33095. */
  33096. debugShowBoundingVolume: boolean;
  33097. /**
  33098. * The label blending option. The default is used for rendering both opaque and translucent labels.
  33099. * However, if either all of the labels are completely opaque or all are completely translucent,
  33100. * setting the technique to BlendOption.OPAQUE or BlendOption.TRANSLUCENT can improve
  33101. * performance by up to 2x.
  33102. */
  33103. blendOption: BlendOption;
  33104. /**
  33105. * Returns the number of labels in this collection. This is commonly used with
  33106. * {@link LabelCollection#get} to iterate over all the labels
  33107. * in the collection.
  33108. */
  33109. length: number;
  33110. /**
  33111. * Creates and adds a label with the specified initial properties to the collection.
  33112. * The added label is returned so it can be modified or removed from the collection later.
  33113. * @example
  33114. * // Example 1: Add a label, specifying all the default values.
  33115. * const l = labels.add({
  33116. * show : true,
  33117. * position : Cesium.Cartesian3.ZERO,
  33118. * text : '',
  33119. * font : '30px sans-serif',
  33120. * fillColor : Cesium.Color.WHITE,
  33121. * outlineColor : Cesium.Color.BLACK,
  33122. * outlineWidth : 1.0,
  33123. * showBackground : false,
  33124. * backgroundColor : new Cesium.Color(0.165, 0.165, 0.165, 0.8),
  33125. * backgroundPadding : new Cesium.Cartesian2(7, 5),
  33126. * style : Cesium.LabelStyle.FILL,
  33127. * pixelOffset : Cesium.Cartesian2.ZERO,
  33128. * eyeOffset : Cesium.Cartesian3.ZERO,
  33129. * horizontalOrigin : Cesium.HorizontalOrigin.LEFT,
  33130. * verticalOrigin : Cesium.VerticalOrigin.BASELINE,
  33131. * scale : 1.0,
  33132. * translucencyByDistance : undefined,
  33133. * pixelOffsetScaleByDistance : undefined,
  33134. * heightReference : HeightReference.NONE,
  33135. * distanceDisplayCondition : undefined
  33136. * });
  33137. * @example
  33138. * // Example 2: Specify only the label's cartographic position,
  33139. * // text, and font.
  33140. * const l = labels.add({
  33141. * position : Cesium.Cartesian3.fromRadians(longitude, latitude, height),
  33142. * text : 'Hello World',
  33143. * font : '24px Helvetica',
  33144. * });
  33145. * @param [options] - A template describing the label's properties as shown in Example 1.
  33146. * @returns The label that was added to the collection.
  33147. */
  33148. add(options?: any): Label;
  33149. /**
  33150. * Removes a label from the collection. Once removed, a label is no longer usable.
  33151. * @example
  33152. * const l = labels.add(...);
  33153. * labels.remove(l); // Returns true
  33154. * @param label - The label to remove.
  33155. * @returns <code>true</code> if the label was removed; <code>false</code> if the label was not found in the collection.
  33156. */
  33157. remove(label: Label): boolean;
  33158. /**
  33159. * Removes all labels from the collection.
  33160. * @example
  33161. * labels.add(...);
  33162. * labels.add(...);
  33163. * labels.removeAll();
  33164. */
  33165. removeAll(): void;
  33166. /**
  33167. * Check whether this collection contains a given label.
  33168. * @param label - The label to check for.
  33169. * @returns true if this collection contains the label, false otherwise.
  33170. */
  33171. contains(label: Label): boolean;
  33172. /**
  33173. * Returns the label in the collection at the specified index. Indices are zero-based
  33174. * and increase as labels are added. Removing a label shifts all labels after
  33175. * it to the left, changing their indices. This function is commonly used with
  33176. * {@link LabelCollection#length} to iterate over all the labels
  33177. * in the collection.
  33178. * @example
  33179. * // Toggle the show property of every label in the collection
  33180. * const len = labels.length;
  33181. * for (let i = 0; i < len; ++i) {
  33182. * const l = billboards.get(i);
  33183. * l.show = !l.show;
  33184. * }
  33185. * @param index - The zero-based index of the billboard.
  33186. * @returns The label at the specified index.
  33187. */
  33188. get(index: number): Label;
  33189. /**
  33190. * Returns true if this object was destroyed; otherwise, false.
  33191. * <br /><br />
  33192. * If this object was destroyed, it should not be used; calling any function other than
  33193. * <code>isDestroyed</code> will result in a {@link DeveloperError} exception.
  33194. * @returns True if this object was destroyed; otherwise, false.
  33195. */
  33196. isDestroyed(): boolean;
  33197. /**
  33198. * Destroys the WebGL resources held by this object. Destroying an object allows for deterministic
  33199. * release of WebGL resources, instead of relying on the garbage collector to destroy this object.
  33200. * <br /><br />
  33201. * Once an object is destroyed, it should not be used; calling any function other than
  33202. * <code>isDestroyed</code> will result in a {@link DeveloperError} exception. Therefore,
  33203. * assign the return value (<code>undefined</code>) to the object as done in the example.
  33204. * @example
  33205. * labels = labels && labels.destroy();
  33206. */
  33207. destroy(): void;
  33208. }
  33209. /**
  33210. * Describes how to draw a label.
  33211. */
  33212. export enum LabelStyle {
  33213. /**
  33214. * Fill the text of the label, but do not outline.
  33215. */
  33216. FILL = 0,
  33217. /**
  33218. * Outline the text of the label, but do not fill.
  33219. */
  33220. OUTLINE = 1,
  33221. /**
  33222. * Fill and outline the text of the label.
  33223. */
  33224. FILL_AND_OUTLINE = 2
  33225. }
  33226. /**
  33227. * 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.
  33228. */
  33229. export class Light {
  33230. constructor();
  33231. /**
  33232. * The color of the light.
  33233. */
  33234. color: Color;
  33235. /**
  33236. * The intensity controls the strength of the light. <code>intensity</code> has a minimum value of 0.0 and no maximum value.
  33237. */
  33238. intensity: number;
  33239. }
  33240. /**
  33241. * Describes how the map will operate in 2D.
  33242. */
  33243. export enum MapMode2D {
  33244. /**
  33245. * The 2D map can be rotated about the z axis.
  33246. */
  33247. ROTATE = 0,
  33248. /**
  33249. * The 2D map can be scrolled infinitely in the horizontal direction.
  33250. */
  33251. INFINITE_SCROLL = 1
  33252. }
  33253. export namespace MapboxImageryProvider {
  33254. /**
  33255. * Initialization options for the MapboxImageryProvider constructor
  33256. * @property [url = 'https://api.mapbox.com/v4/'] - The Mapbox server url.
  33257. * @property mapId - The Mapbox Map ID.
  33258. * @property accessToken - The public access token for the imagery.
  33259. * @property [format = 'png'] - The format of the image request.
  33260. * @property [ellipsoid] - The ellipsoid. If not specified, the WGS84 ellipsoid is used.
  33261. * @property [minimumLevel = 0] - The minimum level-of-detail supported by the imagery provider. Take care when specifying
  33262. * this that the number of tiles at the minimum level is small, such as four or less. A larger number is likely
  33263. * to result in rendering problems.
  33264. * @property [maximumLevel] - The maximum level-of-detail supported by the imagery provider, or undefined if there is no limit.
  33265. * @property [rectangle = Rectangle.MAX_VALUE] - The rectangle, in radians, covered by the image.
  33266. * @property [credit] - A credit for the data source, which is displayed on the canvas.
  33267. */
  33268. type ConstructorOptions = {
  33269. url?: string;
  33270. mapId: string;
  33271. accessToken: string;
  33272. format?: string;
  33273. ellipsoid?: Ellipsoid;
  33274. minimumLevel?: number;
  33275. maximumLevel?: number;
  33276. rectangle?: Rectangle;
  33277. credit?: Credit | string;
  33278. };
  33279. }
  33280. /**
  33281. * Provides tiled imagery hosted by Mapbox.
  33282. * @example
  33283. * // Mapbox tile provider
  33284. * const mapbox = new Cesium.MapboxImageryProvider({
  33285. * mapId: 'mapbox.streets',
  33286. * accessToken: 'thisIsMyAccessToken'
  33287. * });
  33288. * @param options - Object describing initialization options
  33289. */
  33290. export class MapboxImageryProvider {
  33291. constructor(options: MapboxImageryProvider.ConstructorOptions);
  33292. /**
  33293. * The default alpha blending value of this provider, with 0.0 representing fully transparent and
  33294. * 1.0 representing fully opaque.
  33295. */
  33296. defaultAlpha: number | undefined;
  33297. /**
  33298. * The default alpha blending value on the night side of the globe of this provider, with 0.0 representing fully transparent and
  33299. * 1.0 representing fully opaque.
  33300. */
  33301. defaultNightAlpha: number | undefined;
  33302. /**
  33303. * The default alpha blending value on the day side of the globe of this provider, with 0.0 representing fully transparent and
  33304. * 1.0 representing fully opaque.
  33305. */
  33306. defaultDayAlpha: number | undefined;
  33307. /**
  33308. * The default brightness of this provider. 1.0 uses the unmodified imagery color. Less than 1.0
  33309. * makes the imagery darker while greater than 1.0 makes it brighter.
  33310. */
  33311. defaultBrightness: number | undefined;
  33312. /**
  33313. * The default contrast of this provider. 1.0 uses the unmodified imagery color. Less than 1.0 reduces
  33314. * the contrast while greater than 1.0 increases it.
  33315. */
  33316. defaultContrast: number | undefined;
  33317. /**
  33318. * The default hue of this provider in radians. 0.0 uses the unmodified imagery color.
  33319. */
  33320. defaultHue: number | undefined;
  33321. /**
  33322. * The default saturation of this provider. 1.0 uses the unmodified imagery color. Less than 1.0 reduces the
  33323. * saturation while greater than 1.0 increases it.
  33324. */
  33325. defaultSaturation: number | undefined;
  33326. /**
  33327. * The default gamma correction to apply to this provider. 1.0 uses the unmodified imagery color.
  33328. */
  33329. defaultGamma: number | undefined;
  33330. /**
  33331. * The default texture minification filter to apply to this provider.
  33332. */
  33333. defaultMinificationFilter: TextureMinificationFilter;
  33334. /**
  33335. * The default texture magnification filter to apply to this provider.
  33336. */
  33337. defaultMagnificationFilter: TextureMagnificationFilter;
  33338. /**
  33339. * Gets the URL of the Mapbox server.
  33340. */
  33341. readonly url: string;
  33342. /**
  33343. * Gets a value indicating whether or not the provider is ready for use.
  33344. */
  33345. readonly ready: boolean;
  33346. /**
  33347. * Gets a promise that resolves to true when the provider is ready for use.
  33348. */
  33349. readonly readyPromise: Promise<boolean>;
  33350. /**
  33351. * Gets the rectangle, in radians, of the imagery provided by the instance. This function should
  33352. * not be called before {@link MapboxImageryProvider#ready} returns true.
  33353. */
  33354. readonly rectangle: Rectangle;
  33355. /**
  33356. * Gets the width of each tile, in pixels. This function should
  33357. * not be called before {@link MapboxImageryProvider#ready} returns true.
  33358. */
  33359. readonly tileWidth: number;
  33360. /**
  33361. * Gets the height of each tile, in pixels. This function should
  33362. * not be called before {@link MapboxImageryProvider#ready} returns true.
  33363. */
  33364. readonly tileHeight: number;
  33365. /**
  33366. * Gets the maximum level-of-detail that can be requested. This function should
  33367. * not be called before {@link MapboxImageryProvider#ready} returns true.
  33368. */
  33369. readonly maximumLevel: number | undefined;
  33370. /**
  33371. * Gets the minimum level-of-detail that can be requested. This function should
  33372. * not be called before {@link MapboxImageryProvider#ready} returns true. Generally,
  33373. * a minimum level should only be used when the rectangle of the imagery is small
  33374. * enough that the number of tiles at the minimum level is small. An imagery
  33375. * provider with more than a few tiles at the minimum level will lead to
  33376. * rendering problems.
  33377. */
  33378. readonly minimumLevel: number;
  33379. /**
  33380. * Gets the tiling scheme used by the provider. This function should
  33381. * not be called before {@link MapboxImageryProvider#ready} returns true.
  33382. */
  33383. readonly tilingScheme: TilingScheme;
  33384. /**
  33385. * Gets the tile discard policy. If not undefined, the discard policy is responsible
  33386. * for filtering out "missing" tiles via its shouldDiscardImage function. If this function
  33387. * returns undefined, no tiles are filtered. This function should
  33388. * not be called before {@link MapboxImageryProvider#ready} returns true.
  33389. */
  33390. readonly tileDiscardPolicy: TileDiscardPolicy;
  33391. /**
  33392. * Gets an event that is raised when the imagery provider encounters an asynchronous error.. By subscribing
  33393. * to the event, you will be notified of the error and can potentially recover from it. Event listeners
  33394. * are passed an instance of {@link TileProviderError}.
  33395. */
  33396. readonly errorEvent: Event;
  33397. /**
  33398. * Gets the credit to display when this imagery provider is active. Typically this is used to credit
  33399. * the source of the imagery. This function should
  33400. * not be called before {@link MapboxImageryProvider#ready} returns true.
  33401. */
  33402. readonly credit: Credit;
  33403. /**
  33404. * Gets the proxy used by this provider.
  33405. */
  33406. readonly proxy: Proxy;
  33407. /**
  33408. * Gets a value indicating whether or not the images provided by this imagery provider
  33409. * include an alpha channel. If this property is false, an alpha channel, if present, will
  33410. * be ignored. If this property is true, any images without an alpha channel will be treated
  33411. * as if their alpha is 1.0 everywhere. When this property is false, memory usage
  33412. * and texture upload time are reduced.
  33413. */
  33414. readonly hasAlphaChannel: boolean;
  33415. /**
  33416. * Gets the credits to be displayed when a given tile is displayed.
  33417. * @param x - The tile X coordinate.
  33418. * @param y - The tile Y coordinate.
  33419. * @param level - The tile level;
  33420. * @returns The credits to be displayed when the tile is displayed.
  33421. */
  33422. getTileCredits(x: number, y: number, level: number): Credit[];
  33423. /**
  33424. * Requests the image for a given tile. This function should
  33425. * not be called before {@link MapboxImageryProvider#ready} returns true.
  33426. * @param x - The tile X coordinate.
  33427. * @param y - The tile Y coordinate.
  33428. * @param level - The tile level.
  33429. * @param [request] - The request object. Intended for internal use only.
  33430. * @returns A promise for the image that will resolve when the image is available, or
  33431. * undefined if there are too many active requests to the server, and the request should be retried later.
  33432. */
  33433. requestImage(x: number, y: number, level: number, request?: Request): Promise<ImageryTypes> | undefined;
  33434. /**
  33435. * Asynchronously determines what features, if any, are located at a given longitude and latitude within
  33436. * a tile. This function should not be called before {@link MapboxImageryProvider#ready} returns true.
  33437. * This function is optional, so it may not exist on all ImageryProviders.
  33438. * @param x - The tile X coordinate.
  33439. * @param y - The tile Y coordinate.
  33440. * @param level - The tile level.
  33441. * @param longitude - The longitude at which to pick features.
  33442. * @param latitude - The latitude at which to pick features.
  33443. * @returns A promise for the picked features that will resolve when the asynchronous
  33444. * picking completes. The resolved value is an array of {@link ImageryLayerFeatureInfo}
  33445. * instances. The array may be empty if no features are found at the given location.
  33446. * It may also be undefined if picking is not supported.
  33447. */
  33448. pickFeatures(x: number, y: number, level: number, longitude: number, latitude: number): Promise<ImageryLayerFeatureInfo[]> | undefined;
  33449. }
  33450. export namespace MapboxStyleImageryProvider {
  33451. /**
  33452. * Initialization options for the MapboxStyleImageryProvider constructor
  33453. * @property [url = 'https://api.mapbox.com/styles/v1/'] - The Mapbox server url.
  33454. * @property [username = 'mapbox'] - The username of the map account.
  33455. * @property styleId - The Mapbox Style ID.
  33456. * @property accessToken - The public access token for the imagery.
  33457. * @property [tilesize = 512] - The size of the image tiles.
  33458. * @property [scaleFactor] - Determines if tiles are rendered at a @2x scale factor.
  33459. * @property [ellipsoid] - The ellipsoid. If not specified, the WGS84 ellipsoid is used.
  33460. * @property [minimumLevel = 0] - The minimum level-of-detail supported by the imagery provider. Take care when specifying
  33461. * this that the number of tiles at the minimum level is small, such as four or less. A larger number is likely
  33462. * to result in rendering problems.
  33463. * @property [maximumLevel] - The maximum level-of-detail supported by the imagery provider, or undefined if there is no limit.
  33464. * @property [rectangle = Rectangle.MAX_VALUE] - The rectangle, in radians, covered by the image.
  33465. * @property [credit] - A credit for the data source, which is displayed on the canvas.
  33466. */
  33467. type ConstructorOptions = {
  33468. url?: Resource | string;
  33469. username?: string;
  33470. styleId: string;
  33471. accessToken: string;
  33472. tilesize?: number;
  33473. scaleFactor?: boolean;
  33474. ellipsoid?: Ellipsoid;
  33475. minimumLevel?: number;
  33476. maximumLevel?: number;
  33477. rectangle?: Rectangle;
  33478. credit?: Credit | string;
  33479. };
  33480. }
  33481. /**
  33482. * Provides tiled imagery hosted by Mapbox.
  33483. * @example
  33484. * // Mapbox style provider
  33485. * const mapbox = new Cesium.MapboxStyleImageryProvider({
  33486. * styleId: 'streets-v11',
  33487. * accessToken: 'thisIsMyAccessToken'
  33488. * });
  33489. * @param options - Object describing initialization options
  33490. */
  33491. export class MapboxStyleImageryProvider {
  33492. constructor(options: MapboxStyleImageryProvider.ConstructorOptions);
  33493. /**
  33494. * The default alpha blending value of this provider, with 0.0 representing fully transparent and
  33495. * 1.0 representing fully opaque.
  33496. */
  33497. defaultAlpha: number | undefined;
  33498. /**
  33499. * The default alpha blending value on the night side of the globe of this provider, with 0.0 representing fully transparent and
  33500. * 1.0 representing fully opaque.
  33501. */
  33502. defaultNightAlpha: number | undefined;
  33503. /**
  33504. * The default alpha blending value on the day side of the globe of this provider, with 0.0 representing fully transparent and
  33505. * 1.0 representing fully opaque.
  33506. */
  33507. defaultDayAlpha: number | undefined;
  33508. /**
  33509. * The default brightness of this provider. 1.0 uses the unmodified imagery color. Less than 1.0
  33510. * makes the imagery darker while greater than 1.0 makes it brighter.
  33511. */
  33512. defaultBrightness: number | undefined;
  33513. /**
  33514. * The default contrast of this provider. 1.0 uses the unmodified imagery color. Less than 1.0 reduces
  33515. * the contrast while greater than 1.0 increases it.
  33516. */
  33517. defaultContrast: number | undefined;
  33518. /**
  33519. * The default hue of this provider in radians. 0.0 uses the unmodified imagery color.
  33520. */
  33521. defaultHue: number | undefined;
  33522. /**
  33523. * The default saturation of this provider. 1.0 uses the unmodified imagery color. Less than 1.0 reduces the
  33524. * saturation while greater than 1.0 increases it.
  33525. */
  33526. defaultSaturation: number | undefined;
  33527. /**
  33528. * The default gamma correction to apply to this provider. 1.0 uses the unmodified imagery color.
  33529. */
  33530. defaultGamma: number | undefined;
  33531. /**
  33532. * The default texture minification filter to apply to this provider.
  33533. */
  33534. defaultMinificationFilter: TextureMinificationFilter;
  33535. /**
  33536. * The default texture magnification filter to apply to this provider.
  33537. */
  33538. defaultMagnificationFilter: TextureMagnificationFilter;
  33539. /**
  33540. * Gets the URL of the Mapbox server.
  33541. */
  33542. readonly url: string;
  33543. /**
  33544. * Gets a value indicating whether or not the provider is ready for use.
  33545. */
  33546. readonly ready: boolean;
  33547. /**
  33548. * Gets a promise that resolves to true when the provider is ready for use.
  33549. */
  33550. readonly readyPromise: Promise<boolean>;
  33551. /**
  33552. * Gets the rectangle, in radians, of the imagery provided by the instance. This function should
  33553. * not be called before {@link MapboxStyleImageryProvider#ready} returns true.
  33554. */
  33555. readonly rectangle: Rectangle;
  33556. /**
  33557. * Gets the width of each tile, in pixels. This function should
  33558. * not be called before {@link MapboxStyleImageryProvider#ready} returns true.
  33559. */
  33560. readonly tileWidth: number;
  33561. /**
  33562. * Gets the height of each tile, in pixels. This function should
  33563. * not be called before {@link MapboxStyleImageryProvider#ready} returns true.
  33564. */
  33565. readonly tileHeight: number;
  33566. /**
  33567. * Gets the maximum level-of-detail that can be requested. This function should
  33568. * not be called before {@link MapboxStyleImageryProvider#ready} returns true.
  33569. */
  33570. readonly maximumLevel: number | undefined;
  33571. /**
  33572. * Gets the minimum level-of-detail that can be requested. This function should
  33573. * not be called before {@link MapboxStyleImageryProvider#ready} returns true. Generally,
  33574. * a minimum level should only be used when the rectangle of the imagery is small
  33575. * enough that the number of tiles at the minimum level is small. An imagery
  33576. * provider with more than a few tiles at the minimum level will lead to
  33577. * rendering problems.
  33578. */
  33579. readonly minimumLevel: number;
  33580. /**
  33581. * Gets the tiling scheme used by the provider. This function should
  33582. * not be called before {@link MapboxStyleImageryProvider#ready} returns true.
  33583. */
  33584. readonly tilingScheme: TilingScheme;
  33585. /**
  33586. * Gets the tile discard policy. If not undefined, the discard policy is responsible
  33587. * for filtering out "missing" tiles via its shouldDiscardImage function. If this function
  33588. * returns undefined, no tiles are filtered. This function should
  33589. * not be called before {@link MapboxStyleImageryProvider#ready} returns true.
  33590. */
  33591. readonly tileDiscardPolicy: TileDiscardPolicy;
  33592. /**
  33593. * Gets an event that is raised when the imagery provider encounters an asynchronous error.. By subscribing
  33594. * to the event, you will be notified of the error and can potentially recover from it. Event listeners
  33595. * are passed an instance of {@link TileProviderError}.
  33596. */
  33597. readonly errorEvent: Event;
  33598. /**
  33599. * Gets the credit to display when this imagery provider is active. Typically this is used to credit
  33600. * the source of the imagery. This function should
  33601. * not be called before {@link MapboxStyleImageryProvider#ready} returns true.
  33602. */
  33603. readonly credit: Credit;
  33604. /**
  33605. * Gets the proxy used by this provider.
  33606. */
  33607. readonly proxy: Proxy;
  33608. /**
  33609. * Gets a value indicating whether or not the images provided by this imagery provider
  33610. * include an alpha channel. If this property is false, an alpha channel, if present, will
  33611. * be ignored. If this property is true, any images without an alpha channel will be treated
  33612. * as if their alpha is 1.0 everywhere. When this property is false, memory usage
  33613. * and texture upload time are reduced.
  33614. */
  33615. readonly hasAlphaChannel: boolean;
  33616. /**
  33617. * Gets the credits to be displayed when a given tile is displayed.
  33618. * @param x - The tile X coordinate.
  33619. * @param y - The tile Y coordinate.
  33620. * @param level - The tile level;
  33621. * @returns The credits to be displayed when the tile is displayed.
  33622. */
  33623. getTileCredits(x: number, y: number, level: number): Credit[];
  33624. /**
  33625. * Requests the image for a given tile. This function should
  33626. * not be called before {@link MapboxStyleImageryProvider#ready} returns true.
  33627. * @param x - The tile X coordinate.
  33628. * @param y - The tile Y coordinate.
  33629. * @param level - The tile level.
  33630. * @param [request] - The request object. Intended for internal use only.
  33631. * @returns A promise for the image that will resolve when the image is available, or
  33632. * undefined if there are too many active requests to the server, and the request should be retried later.
  33633. */
  33634. requestImage(x: number, y: number, level: number, request?: Request): Promise<ImageryTypes> | undefined;
  33635. /**
  33636. * Asynchronously determines what features, if any, are located at a given longitude and latitude within
  33637. * a tile. This function should not be called before {@link MapboxStyleImageryProvider#ready} returns true.
  33638. * This function is optional, so it may not exist on all ImageryProviders.
  33639. * @param x - The tile X coordinate.
  33640. * @param y - The tile Y coordinate.
  33641. * @param level - The tile level.
  33642. * @param longitude - The longitude at which to pick features.
  33643. * @param latitude - The latitude at which to pick features.
  33644. * @returns A promise for the picked features that will resolve when the asynchronous
  33645. * picking completes. The resolved value is an array of {@link ImageryLayerFeatureInfo}
  33646. * instances. The array may be empty if no features are found at the given location.
  33647. * It may also be undefined if picking is not supported.
  33648. */
  33649. pickFeatures(x: number, y: number, level: number, longitude: number, latitude: number): Promise<ImageryLayerFeatureInfo[]> | undefined;
  33650. }
  33651. /**
  33652. * A Material defines surface appearance through a combination of diffuse, specular,
  33653. * normal, emission, and alpha components. These values are specified using a
  33654. * JSON schema called Fabric which gets parsed and assembled into glsl shader code
  33655. * behind-the-scenes. Check out the {@link https://github.com/CesiumGS/cesium/wiki/Fabric|wiki page}
  33656. * for more details on Fabric.
  33657. * <br /><br />
  33658. * <style type="text/css">
  33659. * #materialDescriptions code {
  33660. * font-weight: normal;
  33661. * font-family: Consolas, 'Lucida Console', Monaco, monospace;
  33662. * color: #A35A00;
  33663. * }
  33664. * #materialDescriptions ul, #materialDescriptions ul ul {
  33665. * list-style-type: none;
  33666. * }
  33667. * #materialDescriptions ul ul {
  33668. * margin-bottom: 10px;
  33669. * }
  33670. * #materialDescriptions ul ul li {
  33671. * font-weight: normal;
  33672. * color: #000000;
  33673. * text-indent: -2em;
  33674. * margin-left: 2em;
  33675. * }
  33676. * #materialDescriptions ul li {
  33677. * font-weight: bold;
  33678. * color: #0053CF;
  33679. * }
  33680. * </style>
  33681. *
  33682. * Base material types and their uniforms:
  33683. * <div id='materialDescriptions'>
  33684. * <ul>
  33685. * <li>Color</li>
  33686. * <ul>
  33687. * <li><code>color</code>: rgba color object.</li>
  33688. * </ul>
  33689. * <li>Image</li>
  33690. * <ul>
  33691. * <li><code>image</code>: path to image.</li>
  33692. * <li><code>repeat</code>: Object with x and y values specifying the number of times to repeat the image.</li>
  33693. * </ul>
  33694. * <li>DiffuseMap</li>
  33695. * <ul>
  33696. * <li><code>image</code>: path to image.</li>
  33697. * <li><code>channels</code>: Three character string containing any combination of r, g, b, and a for selecting the desired image channels.</li>
  33698. * <li><code>repeat</code>: Object with x and y values specifying the number of times to repeat the image.</li>
  33699. * </ul>
  33700. * <li>AlphaMap</li>
  33701. * <ul>
  33702. * <li><code>image</code>: path to image.</li>
  33703. * <li><code>channel</code>: One character string containing r, g, b, or a for selecting the desired image channel. </li>
  33704. * <li><code>repeat</code>: Object with x and y values specifying the number of times to repeat the image.</li>
  33705. * </ul>
  33706. * <li>SpecularMap</li>
  33707. * <ul>
  33708. * <li><code>image</code>: path to image.</li>
  33709. * <li><code>channel</code>: One character string containing r, g, b, or a for selecting the desired image channel. </li>
  33710. * <li><code>repeat</code>: Object with x and y values specifying the number of times to repeat the image.</li>
  33711. * </ul>
  33712. * <li>EmissionMap</li>
  33713. * <ul>
  33714. * <li><code>image</code>: path to image.</li>
  33715. * <li><code>channels</code>: Three character string containing any combination of r, g, b, and a for selecting the desired image channels. </li>
  33716. * <li><code>repeat</code>: Object with x and y values specifying the number of times to repeat the image.</li>
  33717. * </ul>
  33718. * <li>BumpMap</li>
  33719. * <ul>
  33720. * <li><code>image</code>: path to image.</li>
  33721. * <li><code>channel</code>: One character string containing r, g, b, or a for selecting the desired image channel. </li>
  33722. * <li><code>repeat</code>: Object with x and y values specifying the number of times to repeat the image.</li>
  33723. * <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>
  33724. * </ul>
  33725. * <li>NormalMap</li>
  33726. * <ul>
  33727. * <li><code>image</code>: path to image.</li>
  33728. * <li><code>channels</code>: Three character string containing any combination of r, g, b, and a for selecting the desired image channels. </li>
  33729. * <li><code>repeat</code>: Object with x and y values specifying the number of times to repeat the image.</li>
  33730. * <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>
  33731. * </ul>
  33732. * <li>Grid</li>
  33733. * <ul>
  33734. * <li><code>color</code>: rgba color object for the whole material.</li>
  33735. * <li><code>cellAlpha</code>: Alpha value for the cells between grid lines. This will be combined with color.alpha.</li>
  33736. * <li><code>lineCount</code>: Object with x and y values specifying the number of columns and rows respectively.</li>
  33737. * <li><code>lineThickness</code>: Object with x and y values specifying the thickness of grid lines (in pixels where available).</li>
  33738. * <li><code>lineOffset</code>: Object with x and y values specifying the offset of grid lines (range is 0 to 1).</li>
  33739. * </ul>
  33740. * <li>Stripe</li>
  33741. * <ul>
  33742. * <li><code>horizontal</code>: Boolean that determines if the stripes are horizontal or vertical.</li>
  33743. * <li><code>evenColor</code>: rgba color object for the stripe's first color.</li>
  33744. * <li><code>oddColor</code>: rgba color object for the stripe's second color.</li>
  33745. * <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>
  33746. * <li><code>repeat</code>: Number that controls the total number of stripes, half light and half dark.</li>
  33747. * </ul>
  33748. * <li>Checkerboard</li>
  33749. * <ul>
  33750. * <li><code>lightColor</code>: rgba color object for the checkerboard's light alternating color.</li>
  33751. * <li><code>darkColor</code>: rgba color object for the checkerboard's dark alternating color.</li>
  33752. * <li><code>repeat</code>: Object with x and y values specifying the number of columns and rows respectively.</li>
  33753. * </ul>
  33754. * <li>Dot</li>
  33755. * <ul>
  33756. * <li><code>lightColor</code>: rgba color object for the dot color.</li>
  33757. * <li><code>darkColor</code>: rgba color object for the background color.</li>
  33758. * <li><code>repeat</code>: Object with x and y values specifying the number of columns and rows of dots respectively.</li>
  33759. * </ul>
  33760. * <li>Water</li>
  33761. * <ul>
  33762. * <li><code>baseWaterColor</code>: rgba color object base color of the water.</li>
  33763. * <li><code>blendColor</code>: rgba color object used when blending from water to non-water areas.</li>
  33764. * <li><code>specularMap</code>: Single channel texture used to indicate areas of water.</li>
  33765. * <li><code>normalMap</code>: Normal map for water normal perturbation.</li>
  33766. * <li><code>frequency</code>: Number that controls the number of waves.</li>
  33767. * <li><code>animationSpeed</code>: Number that controls the animations speed of the water.</li>
  33768. * <li><code>amplitude</code>: Number that controls the amplitude of water waves.</li>
  33769. * <li><code>specularIntensity</code>: Number that controls the intensity of specular reflections.</li>
  33770. * </ul>
  33771. * <li>RimLighting</li>
  33772. * <ul>
  33773. * <li><code>color</code>: diffuse color and alpha.</li>
  33774. * <li><code>rimColor</code>: diffuse color and alpha of the rim.</li>
  33775. * <li><code>width</code>: Number that determines the rim's width.</li>
  33776. * </ul>
  33777. * <li>Fade</li>
  33778. * <ul>
  33779. * <li><code>fadeInColor</code>: diffuse color and alpha at <code>time</code></li>
  33780. * <li><code>fadeOutColor</code>: diffuse color and alpha at <code>maximumDistance</code> from <code>time</code></li>
  33781. * <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>
  33782. * <li><code>repeat</code>: true if the fade should wrap around the texture coodinates.</li>
  33783. * <li><code>fadeDirection</code>: Object with x and y values specifying if the fade should be in the x and y directions.</li>
  33784. * <li><code>time</code>: Object with x and y values between 0.0 and 1.0 of the <code>fadeInColor</code> position</li>
  33785. * </ul>
  33786. * <li>PolylineArrow</li>
  33787. * <ul>
  33788. * <li><code>color</code>: diffuse color and alpha.</li>
  33789. * </ul>
  33790. * <li>PolylineDash</li>
  33791. * <ul>
  33792. * <li><code>color</code>: color for the line.</li>
  33793. * <li><code>gapColor</code>: color for the gaps in the line.</li>
  33794. * <li><code>dashLength</code>: Dash length in pixels.</li>
  33795. * <li><code>dashPattern</code>: The 16 bit stipple pattern for the line..</li>
  33796. * </ul>
  33797. * <li>PolylineGlow</li>
  33798. * <ul>
  33799. * <li><code>color</code>: color and maximum alpha for the glow on the line.</li>
  33800. * <li><code>glowPower</code>: strength of the glow, as a percentage of the total line width (less than 1.0).</li>
  33801. * <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>
  33802. * </ul>
  33803. * <li>PolylineOutline</li>
  33804. * <ul>
  33805. * <li><code>color</code>: diffuse color and alpha for the interior of the line.</li>
  33806. * <li><code>outlineColor</code>: diffuse color and alpha for the outline.</li>
  33807. * <li><code>outlineWidth</code>: width of the outline in pixels.</li>
  33808. * </ul>
  33809. * <li>ElevationContour</li>
  33810. * <ul>
  33811. * <li><code>color</code>: color and alpha for the contour line.</li>
  33812. * <li><code>spacing</code>: spacing for contour lines in meters.</li>
  33813. * <li><code>width</code>: Number specifying the width of the grid lines in pixels.</li>
  33814. * </ul>
  33815. * <li>ElevationRamp</li>
  33816. * <ul>
  33817. * <li><code>image</code>: color ramp image to use for coloring the terrain.</li>
  33818. * <li><code>minimumHeight</code>: minimum height for the ramp.</li>
  33819. * <li><code>maximumHeight</code>: maximum height for the ramp.</li>
  33820. * </ul>
  33821. * <li>SlopeRamp</li>
  33822. * <ul>
  33823. * <li><code>image</code>: color ramp image to use for coloring the terrain by slope.</li>
  33824. * </ul>
  33825. * <li>AspectRamp</li>
  33826. * <ul>
  33827. * <li><code>image</code>: color ramp image to use for color the terrain by aspect.</li>
  33828. * </ul>
  33829. * <li>ElevationBand</li>
  33830. * <ul>
  33831. * <li><code>heights</code>: image of heights sorted from lowest to highest.</li>
  33832. * <li><code>colors</code>: image of colors at the corresponding heights.</li>
  33833. * </ul>
  33834. * </ul>
  33835. * </ul>
  33836. * </div>
  33837. * @example
  33838. * // Create a color material with fromType:
  33839. * polygon.material = Cesium.Material.fromType('Color');
  33840. * polygon.material.uniforms.color = new Cesium.Color(1.0, 1.0, 0.0, 1.0);
  33841. *
  33842. * // Create the default material:
  33843. * polygon.material = new Cesium.Material();
  33844. *
  33845. * // Create a color material with full Fabric notation:
  33846. * polygon.material = new Cesium.Material({
  33847. * fabric : {
  33848. * type : 'Color',
  33849. * uniforms : {
  33850. * color : new Cesium.Color(1.0, 1.0, 0.0, 1.0)
  33851. * }
  33852. * }
  33853. * });
  33854. * @param [options] - Object with the following properties:
  33855. * @param [options.strict = false] - Throws errors for issues that would normally be ignored, including unused uniforms or materials.
  33856. * @param [options.translucent = true] - When <code>true</code> or a function that returns <code>true</code>, the geometry
  33857. * with this material is expected to appear translucent.
  33858. * @param [options.minificationFilter = TextureMinificationFilter.LINEAR] - The {@link TextureMinificationFilter} to apply to this material's textures.
  33859. * @param [options.magnificationFilter = TextureMagnificationFilter.LINEAR] - The {@link TextureMagnificationFilter} to apply to this material's textures.
  33860. * @param options.fabric - The fabric JSON used to generate the material.
  33861. */
  33862. export class Material {
  33863. constructor(options?: {
  33864. strict?: boolean;
  33865. translucent?: boolean | ((...params: any[]) => any);
  33866. minificationFilter?: TextureMinificationFilter;
  33867. magnificationFilter?: TextureMagnificationFilter;
  33868. fabric: any;
  33869. });
  33870. /**
  33871. * The material type. Can be an existing type or a new type. If no type is specified in fabric, type is a GUID.
  33872. */
  33873. type: string;
  33874. /**
  33875. * The glsl shader source for this material.
  33876. */
  33877. shaderSource: string;
  33878. /**
  33879. * Maps sub-material names to Material objects.
  33880. */
  33881. materials: any;
  33882. /**
  33883. * Maps uniform names to their values.
  33884. */
  33885. uniforms: any;
  33886. /**
  33887. * When <code>true</code> or a function that returns <code>true</code>,
  33888. * the geometry is expected to appear translucent.
  33889. */
  33890. translucent: boolean | ((...params: any[]) => any);
  33891. /**
  33892. * Creates a new material using an existing material type.
  33893. * <br /><br />
  33894. * Shorthand for: new Material({fabric : {type : type}});
  33895. * @example
  33896. * const material = Cesium.Material.fromType('Color', {
  33897. * color : new Cesium.Color(1.0, 0.0, 0.0, 1.0)
  33898. * });
  33899. * @param type - The base material type.
  33900. * @param [uniforms] - Overrides for the default uniforms.
  33901. * @returns New material object.
  33902. */
  33903. static fromType(type: string, uniforms?: any): Material;
  33904. /**
  33905. * Gets whether or not this material is translucent.
  33906. * @returns <code>true</code> if this material is translucent, <code>false</code> otherwise.
  33907. */
  33908. isTranslucent(): boolean;
  33909. /**
  33910. * Returns true if this object was destroyed; otherwise, false.
  33911. * <br /><br />
  33912. * If this object was destroyed, it should not be used; calling any function other than
  33913. * <code>isDestroyed</code> will result in a {@link DeveloperError} exception.
  33914. * @returns True if this object was destroyed; otherwise, false.
  33915. */
  33916. isDestroyed(): boolean;
  33917. /**
  33918. * Destroys the WebGL resources held by this object. Destroying an object allows for deterministic
  33919. * release of WebGL resources, instead of relying on the garbage collector to destroy this object.
  33920. * <br /><br />
  33921. * Once an object is destroyed, it should not be used; calling any function other than
  33922. * <code>isDestroyed</code> will result in a {@link DeveloperError} exception. Therefore,
  33923. * assign the return value (<code>undefined</code>) to the object as done in the example.
  33924. * @example
  33925. * material = material && material.destroy();
  33926. */
  33927. destroy(): void;
  33928. /**
  33929. * Gets or sets the default texture uniform value.
  33930. */
  33931. static DefaultImageId: string;
  33932. /**
  33933. * Gets or sets the default cube map texture uniform value.
  33934. */
  33935. static DefaultCubeMapId: string;
  33936. /**
  33937. * Gets the name of the color material.
  33938. */
  33939. static readonly ColorType: string;
  33940. /**
  33941. * Gets the name of the image material.
  33942. */
  33943. static readonly ImageType: string;
  33944. /**
  33945. * Gets the name of the diffuce map material.
  33946. */
  33947. static readonly DiffuseMapType: string;
  33948. /**
  33949. * Gets the name of the alpha map material.
  33950. */
  33951. static readonly AlphaMapType: string;
  33952. /**
  33953. * Gets the name of the specular map material.
  33954. */
  33955. static readonly SpecularMapType: string;
  33956. /**
  33957. * Gets the name of the emmision map material.
  33958. */
  33959. static readonly EmissionMapType: string;
  33960. /**
  33961. * Gets the name of the bump map material.
  33962. */
  33963. static readonly BumpMapType: string;
  33964. /**
  33965. * Gets the name of the normal map material.
  33966. */
  33967. static readonly NormalMapType: string;
  33968. /**
  33969. * Gets the name of the grid material.
  33970. */
  33971. static readonly GridType: string;
  33972. /**
  33973. * Gets the name of the stripe material.
  33974. */
  33975. static readonly StripeType: string;
  33976. /**
  33977. * Gets the name of the checkerboard material.
  33978. */
  33979. static readonly CheckerboardType: string;
  33980. /**
  33981. * Gets the name of the dot material.
  33982. */
  33983. static readonly DotType: string;
  33984. /**
  33985. * Gets the name of the water material.
  33986. */
  33987. static readonly WaterType: string;
  33988. /**
  33989. * Gets the name of the rim lighting material.
  33990. */
  33991. static readonly RimLightingType: string;
  33992. /**
  33993. * Gets the name of the fade material.
  33994. */
  33995. static readonly FadeType: string;
  33996. /**
  33997. * Gets the name of the polyline arrow material.
  33998. */
  33999. static readonly PolylineArrowType: string;
  34000. /**
  34001. * Gets the name of the polyline glow material.
  34002. */
  34003. static readonly PolylineDashType: string;
  34004. /**
  34005. * Gets the name of the polyline glow material.
  34006. */
  34007. static readonly PolylineGlowType: string;
  34008. /**
  34009. * Gets the name of the polyline outline material.
  34010. */
  34011. static readonly PolylineOutlineType: string;
  34012. /**
  34013. * Gets the name of the elevation contour material.
  34014. */
  34015. static readonly ElevationContourType: string;
  34016. /**
  34017. * Gets the name of the elevation contour material.
  34018. */
  34019. static readonly ElevationRampType: string;
  34020. /**
  34021. * Gets the name of the slope ramp material.
  34022. */
  34023. static readonly SlopeRampMaterialType: string;
  34024. /**
  34025. * Gets the name of the aspect ramp material.
  34026. */
  34027. static readonly AspectRampMaterialType: string;
  34028. /**
  34029. * Gets the name of the elevation band material.
  34030. */
  34031. static readonly ElevationBandType: string;
  34032. }
  34033. /**
  34034. * An appearance for arbitrary geometry (as opposed to {@link EllipsoidSurfaceAppearance}, for example)
  34035. * that supports shading with materials.
  34036. * @example
  34037. * const primitive = new Cesium.Primitive({
  34038. * geometryInstances : new Cesium.GeometryInstance({
  34039. * geometry : new Cesium.WallGeometry({
  34040. * materialSupport : Cesium.MaterialAppearance.MaterialSupport.BASIC.vertexFormat,
  34041. * // ...
  34042. * })
  34043. * }),
  34044. * appearance : new Cesium.MaterialAppearance({
  34045. * material : Cesium.Material.fromType('Color'),
  34046. * faceForward : true
  34047. * })
  34048. *
  34049. * });
  34050. * @param [options] - Object with the following properties:
  34051. * @param [options.flat = false] - When <code>true</code>, flat shading is used in the fragment shader, which means lighting is not taking into account.
  34052. * @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}.
  34053. * @param [options.translucent = true] - When <code>true</code>, the geometry is expected to appear translucent so {@link MaterialAppearance#renderState} has alpha blending enabled.
  34054. * @param [options.closed = false] - When <code>true</code>, the geometry is expected to be closed so {@link MaterialAppearance#renderState} has backface culling enabled.
  34055. * @param [options.materialSupport = MaterialAppearance.MaterialSupport.TEXTURED] - The type of materials that will be supported.
  34056. * @param [options.material = Material.ColorType] - The material used to determine the fragment color.
  34057. * @param [options.vertexShaderSource] - Optional GLSL vertex shader source to override the default vertex shader.
  34058. * @param [options.fragmentShaderSource] - Optional GLSL fragment shader source to override the default fragment shader.
  34059. * @param [options.renderState] - Optional render state to override the default render state.
  34060. */
  34061. export class MaterialAppearance {
  34062. constructor(options?: {
  34063. flat?: boolean;
  34064. faceForward?: boolean;
  34065. translucent?: boolean;
  34066. closed?: boolean;
  34067. materialSupport?: MaterialAppearance.MaterialSupportType;
  34068. material?: Material;
  34069. vertexShaderSource?: string;
  34070. fragmentShaderSource?: string;
  34071. renderState?: any;
  34072. });
  34073. /**
  34074. * The material used to determine the fragment color. Unlike other {@link MaterialAppearance}
  34075. * properties, this is not read-only, so an appearance's material can change on the fly.
  34076. */
  34077. material: Material;
  34078. /**
  34079. * When <code>true</code>, the geometry is expected to appear translucent.
  34080. */
  34081. translucent: boolean;
  34082. /**
  34083. * The GLSL source code for the vertex shader.
  34084. */
  34085. readonly vertexShaderSource: string;
  34086. /**
  34087. * The GLSL source code for the fragment shader. The full fragment shader
  34088. * source is built procedurally taking into account {@link MaterialAppearance#material},
  34089. * {@link MaterialAppearance#flat}, and {@link MaterialAppearance#faceForward}.
  34090. * Use {@link MaterialAppearance#getFragmentShaderSource} to get the full source.
  34091. */
  34092. readonly fragmentShaderSource: string;
  34093. /**
  34094. * The WebGL fixed-function state to use when rendering the geometry.
  34095. * <p>
  34096. * The render state can be explicitly defined when constructing a {@link MaterialAppearance}
  34097. * instance, or it is set implicitly via {@link MaterialAppearance#translucent}
  34098. * and {@link MaterialAppearance#closed}.
  34099. * </p>
  34100. */
  34101. readonly renderState: any;
  34102. /**
  34103. * When <code>true</code>, the geometry is expected to be closed so
  34104. * {@link MaterialAppearance#renderState} has backface culling enabled.
  34105. * If the viewer enters the geometry, it will not be visible.
  34106. */
  34107. readonly closed: boolean;
  34108. /**
  34109. * The type of materials supported by this instance. This impacts the required
  34110. * {@link VertexFormat} and the complexity of the vertex and fragment shaders.
  34111. */
  34112. readonly materialSupport: MaterialAppearance.MaterialSupportType;
  34113. /**
  34114. * The {@link VertexFormat} that this appearance instance is compatible with.
  34115. * A geometry can have more vertex attributes and still be compatible - at a
  34116. * potential performance cost - but it can't have less.
  34117. */
  34118. readonly vertexFormat: VertexFormat;
  34119. /**
  34120. * When <code>true</code>, flat shading is used in the fragment shader,
  34121. * which means lighting is not taking into account.
  34122. */
  34123. readonly flat: boolean;
  34124. /**
  34125. * When <code>true</code>, the fragment shader flips the surface normal
  34126. * as needed to ensure that the normal faces the viewer to avoid
  34127. * dark spots. This is useful when both sides of a geometry should be
  34128. * shaded like {@link WallGeometry}.
  34129. */
  34130. readonly faceForward: boolean;
  34131. /**
  34132. * Procedurally creates the full GLSL fragment shader source. For {@link MaterialAppearance},
  34133. * this is derived from {@link MaterialAppearance#fragmentShaderSource}, {@link MaterialAppearance#material},
  34134. * {@link MaterialAppearance#flat}, and {@link MaterialAppearance#faceForward}.
  34135. * @returns The full GLSL fragment shader source.
  34136. */
  34137. getFragmentShaderSource(): string;
  34138. /**
  34139. * Determines if the geometry is translucent based on {@link MaterialAppearance#translucent} and {@link Material#isTranslucent}.
  34140. * @returns <code>true</code> if the appearance is translucent.
  34141. */
  34142. isTranslucent(): boolean;
  34143. /**
  34144. * Creates a render state. This is not the final render state instance; instead,
  34145. * it can contain a subset of render state properties identical to the render state
  34146. * created in the context.
  34147. * @returns The render state.
  34148. */
  34149. getRenderState(): any;
  34150. }
  34151. export namespace MaterialAppearance {
  34152. type MaterialSupportType = {
  34153. vertexFormat: VertexFormat;
  34154. vertexShaderSource: string;
  34155. fragmentShaderSource: string;
  34156. };
  34157. /**
  34158. * Determines the type of {@link Material} that is supported by a
  34159. * {@link MaterialAppearance} instance. This is a trade-off between
  34160. * flexibility (a wide array of materials) and memory/performance
  34161. * (required vertex format and GLSL shader complexity.
  34162. */
  34163. namespace MaterialSupport {
  34164. /**
  34165. * Only basic materials, which require just <code>position</code> and
  34166. * <code>normal</code> vertex attributes, are supported.
  34167. */
  34168. const BASIC: MaterialAppearance.MaterialSupportType;
  34169. /**
  34170. * Materials with textures, which require <code>position</code>,
  34171. * <code>normal</code>, and <code>st</code> vertex attributes,
  34172. * are supported. The vast majority of materials fall into this category.
  34173. */
  34174. const TEXTURED: MaterialAppearance.MaterialSupportType;
  34175. /**
  34176. * All materials, including those that work in tangent space, are supported.
  34177. * This requires <code>position</code>, <code>normal</code>, <code>st</code>,
  34178. * <code>tangent</code>, and <code>bitangent</code> vertex attributes.
  34179. */
  34180. const ALL: MaterialAppearance.MaterialSupportType;
  34181. }
  34182. }
  34183. /**
  34184. * A 3D model based on glTF, the runtime asset format for WebGL, OpenGL ES, and OpenGL.
  34185. * <p>
  34186. * Cesium includes support for geometry and materials, glTF animations, and glTF skinning.
  34187. * In addition, individual glTF nodes are pickable with {@link Scene#pick} and animatable
  34188. * with {@link Model#getNode}. glTF cameras and lights are not currently supported.
  34189. * </p>
  34190. * <p>
  34191. * An external glTF asset is created with {@link Model.fromGltf}. glTF JSON can also be
  34192. * created at runtime and passed to this constructor function. In either case, the
  34193. * {@link Model#readyPromise} is resolved when the model is ready to render, i.e.,
  34194. * when the external binary, image, and shader files are downloaded and the WebGL
  34195. * resources are created.
  34196. * </p>
  34197. * <p>
  34198. * Cesium supports glTF assets with the following extensions:
  34199. * <ul>
  34200. * <li>
  34201. * {@link https://github.com/KhronosGroup/glTF/blob/master/extensions/1.0/Khronos/KHR_binary_glTF/README.md|KHR_binary_glTF (glTF 1.0)}
  34202. * </li><li>
  34203. * {@link https://github.com/KhronosGroup/glTF/blob/master/extensions/1.0/Khronos/KHR_materials_common/README.md|KHR_materials_common (glTF 1.0)}
  34204. * </li><li>
  34205. * {@link https://github.com/KhronosGroup/glTF/blob/master/extensions/1.0/Vendor/WEB3D_quantized_attributes/README.md|WEB3D_quantized_attributes (glTF 1.0)}
  34206. * </li><li>
  34207. * {@link https://github.com/KhronosGroup/glTF/tree/master/extensions/2.0/Vendor/AGI_articulations/README.md|AGI_articulations}
  34208. * </li><li>
  34209. * {@link https://github.com/KhronosGroup/glTF/pull/1302|KHR_blend (draft)}
  34210. * </li><li>
  34211. * {@link https://github.com/KhronosGroup/glTF/blob/master/extensions/2.0/Khronos/KHR_draco_mesh_compression/README.md|KHR_draco_mesh_compression}
  34212. * </li><li>
  34213. * {@link https://github.com/KhronosGroup/glTF/tree/master/extensions/2.0/Khronos/KHR_materials_pbrSpecularGlossiness/README.md|KHR_materials_pbrSpecularGlossiness}
  34214. * </li><li>
  34215. * {@link https://github.com/KhronosGroup/glTF/tree/master/extensions/2.0/Khronos/KHR_materials_unlit/README.md|KHR_materials_unlit}
  34216. * </li><li>
  34217. * {@link https://github.com/KhronosGroup/glTF/blob/master/extensions/2.0/Khronos/KHR_techniques_webgl/README.md|KHR_techniques_webgl}
  34218. * </li><li>
  34219. * {@link https://github.com/KhronosGroup/glTF/blob/master/extensions/2.0/Khronos/KHR_texture_transform/README.md|KHR_texture_transform}
  34220. * </li><li>
  34221. * {@link https://github.com/KhronosGroup/glTF/blob/master/extensions/2.0/Khronos/KHR_texture_basisu|KHR_texture_basisu}
  34222. * </li>
  34223. * </ul>
  34224. * </p>
  34225. * <p>
  34226. * Note: for models with compressed textures using the KHR_texture_basisu extension, we recommend power of 2 textures in both dimensions
  34227. * 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})
  34228. * 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}).
  34229. * </p>
  34230. * <p>
  34231. * 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
  34232. * CESIUM_RTC_MODELVIEW parameter semantic that says the node is in WGS84 coordinates translated
  34233. * relative to a local origin.
  34234. * </p>
  34235. * @param [options] - Object with the following properties:
  34236. * @param [options.gltf] - A glTF JSON object, or a binary glTF buffer.
  34237. * @param [options.basePath = ''] - The base path that paths in the glTF JSON are relative to.
  34238. * @param [options.show = true] - Determines if the model primitive will be shown.
  34239. * @param [options.modelMatrix = Matrix4.IDENTITY] - The 4x4 transformation matrix that transforms the model from model to world coordinates.
  34240. * @param [options.scale = 1.0] - A uniform scale applied to this model.
  34241. * @param [options.minimumPixelSize = 0.0] - The approximate minimum pixel size of the model regardless of zoom.
  34242. * @param [options.maximumScale] - The maximum scale size of a model. An upper limit for minimumPixelSize.
  34243. * @param [options.id] - A user-defined object to return when the model is picked with {@link Scene#pick}.
  34244. * @param [options.allowPicking = true] - When <code>true</code>, each glTF mesh and primitive is pickable with {@link Scene#pick}.
  34245. * @param [options.incrementallyLoadTextures = true] - Determine if textures may continue to stream in after the model is loaded.
  34246. * @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.
  34247. * @param [options.clampAnimations = true] - Determines if the model's animations should hold a pose over frames where no keyframes are specified.
  34248. * @param [options.shadows = ShadowMode.ENABLED] - Determines whether the model casts or receives shadows from light sources.
  34249. * @param [options.debugShowBoundingVolume = false] - For debugging only. Draws the bounding sphere for each draw command in the model.
  34250. * @param [options.debugWireframe = false] - For debugging only. Draws the model in wireframe.
  34251. * @param [options.heightReference = HeightReference.NONE] - Determines how the model is drawn relative to terrain.
  34252. * @param [options.scene] - Must be passed in for models that use the height reference property.
  34253. * @param [options.distanceDisplayCondition] - The condition specifying at what distance from the camera that this model will be displayed.
  34254. * @param [options.color = Color.WHITE] - A color that blends with the model's rendered color.
  34255. * @param [options.colorBlendMode = ColorBlendMode.HIGHLIGHT] - Defines how the color blends with the model.
  34256. * @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.
  34257. * @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.
  34258. * @param [options.silhouetteSize = 0.0] - The size of the silhouette in pixels.
  34259. * @param [options.clippingPlanes] - The {@link ClippingPlaneCollection} used to selectively disable rendering the model.
  34260. * @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.
  34261. * @param [options.lightColor] - The light color when shading the model. When <code>undefined</code> the scene's light color is used instead.
  34262. * @param [options.imageBasedLighting] - The properties for managing image-based lighting on this model.
  34263. * @param [options.imageBasedLightingFactor = new Cartesian2(1.0, 1.0)] - Scales diffuse and specular image-based lighting from the earth, sky, atmosphere and star skybox. Deprecated in Cesium 1.92, will be removed in Cesium 1.94.
  34264. * @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. Deprecated in Cesium 1.92, will be removed in Cesium 1.94.
  34265. * @param [options.sphericalHarmonicCoefficients] - The third order spherical harmonic coefficients used for the diffuse color of image-based lighting. Deprecated in Cesium 1.92, will be removed in Cesium 1.94.
  34266. * @param [options.specularEnvironmentMaps] - A URL to a KTX2 file that contains a cube map of the specular lighting and the convoluted specular mipmaps. Deprecated in Cesium 1.92, will be removed in Cesium 1.94.
  34267. * @param [options.credit] - A credit for the data source, which is displayed on the canvas.
  34268. * @param [options.showCreditsOnScreen = false] - Whether to display the credits of this model on screen.
  34269. * @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.
  34270. * @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.
  34271. * @param [options.splitDirection = SplitDirection.NONE] - The {@link SplitDirection} split to apply to this model.
  34272. */
  34273. export class Model {
  34274. constructor(options?: {
  34275. gltf?: any | ArrayBuffer | Uint8Array;
  34276. basePath?: Resource | string;
  34277. show?: boolean;
  34278. modelMatrix?: Matrix4;
  34279. scale?: number;
  34280. minimumPixelSize?: number;
  34281. maximumScale?: number;
  34282. id?: any;
  34283. allowPicking?: boolean;
  34284. incrementallyLoadTextures?: boolean;
  34285. asynchronous?: boolean;
  34286. clampAnimations?: boolean;
  34287. shadows?: ShadowMode;
  34288. debugShowBoundingVolume?: boolean;
  34289. debugWireframe?: boolean;
  34290. heightReference?: HeightReference;
  34291. scene?: Scene;
  34292. distanceDisplayCondition?: DistanceDisplayCondition;
  34293. color?: Color;
  34294. colorBlendMode?: ColorBlendMode;
  34295. colorBlendAmount?: number;
  34296. silhouetteColor?: Color;
  34297. silhouetteSize?: number;
  34298. clippingPlanes?: ClippingPlaneCollection;
  34299. dequantizeInShader?: boolean;
  34300. lightColor?: Cartesian3;
  34301. imageBasedLighting?: ImageBasedLighting;
  34302. imageBasedLightingFactor?: Cartesian2;
  34303. luminanceAtZenith?: number;
  34304. sphericalHarmonicCoefficients?: Cartesian3[];
  34305. specularEnvironmentMaps?: string;
  34306. credit?: Credit | string;
  34307. showCreditsOnScreen?: boolean;
  34308. backFaceCulling?: boolean;
  34309. showOutline?: boolean;
  34310. splitDirection?: SplitDirection;
  34311. });
  34312. /**
  34313. * Determines if the model primitive will be shown.
  34314. */
  34315. show: boolean;
  34316. /**
  34317. * The silhouette color.
  34318. */
  34319. silhouetteColor: Color;
  34320. /**
  34321. * The size of the silhouette in pixels.
  34322. */
  34323. silhouetteSize: number;
  34324. /**
  34325. * The 4x4 transformation matrix that transforms the model from model to world coordinates.
  34326. * When this is the identity matrix, the model is drawn in world coordinates, i.e., Earth's WGS84 coordinates.
  34327. * Local reference frames can be used by providing a different transformation matrix, like that returned
  34328. * by {@link Transforms.eastNorthUpToFixedFrame}.
  34329. * @example
  34330. * const origin = Cesium.Cartesian3.fromDegrees(-95.0, 40.0, 200000.0);
  34331. * m.modelMatrix = Cesium.Transforms.eastNorthUpToFixedFrame(origin);
  34332. */
  34333. modelMatrix: Matrix4;
  34334. /**
  34335. * A uniform scale applied to this model before the {@link Model#modelMatrix}.
  34336. * Values greater than <code>1.0</code> increase the size of the model; values
  34337. * less than <code>1.0</code> decrease.
  34338. */
  34339. scale: number;
  34340. /**
  34341. * The approximate minimum pixel size of the model regardless of zoom.
  34342. * This can be used to ensure that a model is visible even when the viewer
  34343. * zooms out. When <code>0.0</code>, no minimum size is enforced.
  34344. */
  34345. minimumPixelSize: number;
  34346. /**
  34347. * The maximum scale size for a model. This can be used to give
  34348. * an upper limit to the {@link Model#minimumPixelSize}, ensuring that the model
  34349. * is never an unreasonable scale.
  34350. */
  34351. maximumScale: number;
  34352. /**
  34353. * User-defined object returned when the model is picked.
  34354. */
  34355. id: any;
  34356. /**
  34357. * Returns the height reference of the model
  34358. */
  34359. heightReference: HeightReference;
  34360. /**
  34361. * The currently playing glTF animations.
  34362. */
  34363. activeAnimations: ModelAnimationCollection;
  34364. /**
  34365. * Determines if the model's animations should hold a pose over frames where no keyframes are specified.
  34366. */
  34367. clampAnimations: boolean;
  34368. /**
  34369. * Determines whether the model casts or receives shadows from light sources.
  34370. */
  34371. shadows: ShadowMode;
  34372. /**
  34373. * A color that blends with the model's rendered color.
  34374. */
  34375. color: Color;
  34376. /**
  34377. * Defines how the color blends with the model.
  34378. */
  34379. colorBlendMode: ColorBlendMode;
  34380. /**
  34381. * Value used to determine the color strength when the <code>colorBlendMode</code> is <code>MIX</code>.
  34382. * A value of 0.0 results in the model's rendered color while a value of 1.0 results in a solid color, with
  34383. * any value in-between resulting in a mix of the two.
  34384. */
  34385. colorBlendAmount: number;
  34386. /**
  34387. * Whether to cull back-facing geometry. When true, back face culling is
  34388. * determined by the material's doubleSided property; when false, back face
  34389. * culling is disabled. Back faces are not culled if {@link Model#color} is
  34390. * translucent or {@link Model#silhouetteSize} is greater than 0.0.
  34391. */
  34392. backFaceCulling: boolean;
  34393. /**
  34394. * Whether to display the outline for models using the
  34395. * {@link https://github.com/KhronosGroup/glTF/tree/master/extensions/2.0/Vendor/CESIUM_primitive_outline|CESIUM_primitive_outline} extension.
  34396. * When true, outlines are displayed. When false, outlines are not displayed.
  34397. */
  34398. readonly showOutline: boolean;
  34399. /**
  34400. * The {@link SplitDirection} to apply to this model.
  34401. */
  34402. splitDirection: SplitDirection;
  34403. /**
  34404. * This property is for debugging only; it is not for production use nor is it optimized.
  34405. * <p>
  34406. * Draws the bounding sphere for each draw command in the model. A glTF primitive corresponds
  34407. * to one draw command. A glTF mesh has an array of primitives, often of length one.
  34408. * </p>
  34409. */
  34410. debugShowBoundingVolume: boolean;
  34411. /**
  34412. * This property is for debugging only; it is not for production use nor is it optimized.
  34413. * <p>
  34414. * Draws the model in wireframe.
  34415. * </p>
  34416. */
  34417. debugWireframe: boolean;
  34418. /**
  34419. * The object for the glTF JSON, including properties with default values omitted
  34420. * from the JSON provided to this model.
  34421. */
  34422. readonly gltf: any;
  34423. /**
  34424. * The base path that paths in the glTF JSON are relative to. The base
  34425. * path is the same path as the path containing the .gltf file
  34426. * minus the .gltf file, when binary, image, and shader files are
  34427. * in the same directory as the .gltf. When this is <code>''</code>,
  34428. * the app's base path is used.
  34429. */
  34430. readonly basePath: string;
  34431. /**
  34432. * The model's bounding sphere in its local coordinate system. This does not take into
  34433. * account glTF animations and skins nor does it take into account {@link Model#minimumPixelSize}.
  34434. * @example
  34435. * // Center in WGS84 coordinates
  34436. * const center = Cesium.Matrix4.multiplyByPoint(model.modelMatrix, model.boundingSphere.center, new Cesium.Cartesian3());
  34437. */
  34438. readonly boundingSphere: BoundingSphere;
  34439. /**
  34440. * When <code>true</code>, this model is ready to render, i.e., the external binary, image,
  34441. * and shader files were downloaded and the WebGL resources were created. This is set to
  34442. * <code>true</code> right before {@link Model#readyPromise} is resolved.
  34443. */
  34444. readonly ready: boolean;
  34445. /**
  34446. * Gets the promise that will be resolved when this model is ready to render, i.e., when the external binary, image,
  34447. * and shader files were downloaded and the WebGL resources were created.
  34448. * <p>
  34449. * This promise is resolved at the end of the frame before the first frame the model is rendered in.
  34450. * </p>
  34451. * @example
  34452. * // Play all animations at half-speed when the model is ready to render
  34453. * Promise.resolve(model.readyPromise).then(function(model) {
  34454. * model.activeAnimations.addAll({
  34455. * multiplier : 0.5
  34456. * });
  34457. * }).catch(function(error){
  34458. * window.alert(error);
  34459. * });
  34460. */
  34461. readonly readyPromise: Promise<Model>;
  34462. /**
  34463. * Determines if model WebGL resource creation will be spread out over several frames or
  34464. * block until completion once all glTF files are loaded.
  34465. */
  34466. readonly asynchronous: boolean;
  34467. /**
  34468. * When <code>true</code>, each glTF mesh and primitive is pickable with {@link Scene#pick}. When <code>false</code>, GPU memory is saved.
  34469. */
  34470. readonly allowPicking: boolean;
  34471. /**
  34472. * Determine if textures may continue to stream in after the model is loaded.
  34473. */
  34474. readonly incrementallyLoadTextures: boolean;
  34475. /**
  34476. * Return the number of pending texture loads.
  34477. */
  34478. readonly pendingTextureLoads: number;
  34479. /**
  34480. * Gets or sets the condition specifying at what distance from the camera that this model will be displayed.
  34481. */
  34482. distanceDisplayCondition: DistanceDisplayCondition;
  34483. /**
  34484. * The {@link ClippingPlaneCollection} used to selectively disable rendering the model.
  34485. */
  34486. clippingPlanes: ClippingPlaneCollection;
  34487. /**
  34488. * The light color when shading the model. When <code>undefined</code> the scene's light color is used instead.
  34489. * <p>
  34490. * For example, disabling additional light sources by setting <code>model.imageBasedLightingFactor = new Cesium.Cartesian2(0.0, 0.0)</code> will make the
  34491. * model much darker. Here, increasing the intensity of the light source will make the model brighter.
  34492. * </p>
  34493. */
  34494. lightColor: Cartesian3;
  34495. /**
  34496. * The properties for managing image-based lighting on this model.
  34497. */
  34498. imageBasedLighting: ImageBasedLighting;
  34499. /**
  34500. * Cesium adds lighting from the earth, sky, atmosphere, and star skybox. This cartesian is used to scale the final
  34501. * diffuse and specular lighting contribution from those sources to the final color. A value of 0.0 will disable those light sources.
  34502. */
  34503. imageBasedLightingFactor: Cartesian2;
  34504. /**
  34505. * The sun's luminance at the zenith in kilo candela per meter squared to use for this model's procedural environment map.
  34506. * This is used when {@link Model#specularEnvironmentMaps} and {@link Model#sphericalHarmonicCoefficients} are not defined.
  34507. */
  34508. luminanceAtZenith: number;
  34509. /**
  34510. * The third order spherical harmonic coefficients used for the diffuse color of image-based lighting. When <code>undefined</code>, a diffuse irradiance
  34511. * computed from the atmosphere color is used.
  34512. * <p>
  34513. * There are nine <code>Cartesian3</code> coefficients.
  34514. * 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>
  34515. * </p>
  34516. *
  34517. * These values can be obtained by preprocessing the environment map using the <code>cmgen</code> tool of
  34518. * {@link https://github.com/google/filament/releases|Google's Filament project}. This will also generate a KTX file that can be
  34519. * supplied to {@link Model#specularEnvironmentMaps}.
  34520. */
  34521. sphericalHarmonicCoefficients: Cartesian3[];
  34522. /**
  34523. * A URL to a KTX2 file that contains a cube map of the specular lighting and the convoluted specular mipmaps.
  34524. */
  34525. specularEnvironmentMaps: string;
  34526. /**
  34527. * Gets the credit that will be displayed for the model
  34528. */
  34529. credit: Credit;
  34530. /**
  34531. * Gets or sets whether the credits of the model will be displayed on the screen
  34532. */
  34533. showCreditsOnScreen: boolean;
  34534. /**
  34535. * Determines if silhouettes are supported.
  34536. * @param scene - The scene.
  34537. * @returns <code>true</code> if silhouettes are supported; otherwise, returns <code>false</code>
  34538. */
  34539. static silhouetteSupported(scene: Scene): boolean;
  34540. /**
  34541. * <p>
  34542. * Creates a model from a glTF asset. When the model is ready to render, i.e., when the external binary, image,
  34543. * and shader files are downloaded and the WebGL resources are created, the {@link Model#readyPromise} is resolved.
  34544. * </p>
  34545. * <p>
  34546. * The model can be a traditional glTF asset with a .gltf extension or a Binary glTF using the .glb extension.
  34547. * </p>
  34548. * <p>
  34549. * Cesium supports glTF assets with the following extensions:
  34550. * <ul>
  34551. * <li>
  34552. * {@link https://github.com/KhronosGroup/glTF/blob/master/extensions/1.0/Khronos/KHR_binary_glTF/README.md|KHR_binary_glTF (glTF 1.0)}
  34553. * </li><li>
  34554. * {@link https://github.com/KhronosGroup/glTF/blob/master/extensions/1.0/Khronos/KHR_materials_common/README.md|KHR_materials_common (glTF 1.0)}
  34555. * </li><li>
  34556. * {@link https://github.com/KhronosGroup/glTF/blob/master/extensions/1.0/Vendor/WEB3D_quantized_attributes/README.md|WEB3D_quantized_attributes (glTF 1.0)}
  34557. * </li><li>
  34558. * {@link https://github.com/KhronosGroup/glTF/tree/master/extensions/2.0/Vendor/AGI_articulations/README.md|AGI_articulations}
  34559. * </li><li>
  34560. * {@link https://github.com/KhronosGroup/glTF/pull/1302|KHR_blend (draft)}
  34561. * </li><li>
  34562. * {@link https://github.com/KhronosGroup/glTF/blob/master/extensions/2.0/Khronos/KHR_draco_mesh_compression/README.md|KHR_draco_mesh_compression}
  34563. * </li><li>
  34564. * {@link https://github.com/KhronosGroup/glTF/tree/master/extensions/2.0/Khronos/KHR_materials_pbrSpecularGlossiness/README.md|KHR_materials_pbrSpecularGlossiness}
  34565. * </li><li>
  34566. * {@link https://github.com/KhronosGroup/glTF/tree/master/extensions/2.0/Khronos/KHR_materials_unlit/README.md|KHR_materials_unlit}
  34567. * </li><li>
  34568. * {@link https://github.com/KhronosGroup/glTF/blob/master/extensions/2.0/Khronos/KHR_techniques_webgl/README.md|KHR_techniques_webgl}
  34569. * </li><li>
  34570. * {@link https://github.com/KhronosGroup/glTF/blob/master/extensions/2.0/Khronos/KHR_texture_transform/README.md|KHR_texture_transform}
  34571. * </li><li>
  34572. * {@link https://github.com/KhronosGroup/glTF/blob/master/extensions/2.0/Khronos/KHR_texture_basisu/README.md|KHR_texture_basisu}
  34573. * </li>
  34574. * </ul>
  34575. * </p>
  34576. * <p>
  34577. * 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
  34578. * CESIUM_RTC_MODELVIEW parameter semantic that says the node is in WGS84 coordinates translated
  34579. * relative to a local origin.
  34580. * </p>
  34581. * @example
  34582. * // Example 1. Create a model from a glTF asset
  34583. * const model = scene.primitives.add(Cesium.Model.fromGltf({
  34584. * url : './duck/duck.gltf'
  34585. * }));
  34586. * @example
  34587. * // Example 2. Create model and provide all properties and events
  34588. * const origin = Cesium.Cartesian3.fromDegrees(-95.0, 40.0, 200000.0);
  34589. * const modelMatrix = Cesium.Transforms.eastNorthUpToFixedFrame(origin);
  34590. *
  34591. * const model = scene.primitives.add(Cesium.Model.fromGltf({
  34592. * url : './duck/duck.gltf',
  34593. * show : true, // default
  34594. * modelMatrix : modelMatrix,
  34595. * scale : 2.0, // double size
  34596. * minimumPixelSize : 128, // never smaller than 128 pixels
  34597. * maximumScale: 20000, // never larger than 20000 * model size (overrides minimumPixelSize)
  34598. * allowPicking : false, // not pickable
  34599. * debugShowBoundingVolume : false, // default
  34600. * debugWireframe : false
  34601. * }));
  34602. *
  34603. * model.readyPromise.then(function(model) {
  34604. * // Play all animations when the model is ready to render
  34605. * model.activeAnimations.addAll();
  34606. * });
  34607. * @param options - Object with the following properties:
  34608. * @param options.url - The url to the .gltf file.
  34609. * @param [options.basePath] - The base path that paths in the glTF JSON are relative to.
  34610. * @param [options.show = true] - Determines if the model primitive will be shown.
  34611. * @param [options.modelMatrix = Matrix4.IDENTITY] - The 4x4 transformation matrix that transforms the model from model to world coordinates.
  34612. * @param [options.scale = 1.0] - A uniform scale applied to this model.
  34613. * @param [options.minimumPixelSize = 0.0] - The approximate minimum pixel size of the model regardless of zoom.
  34614. * @param [options.maximumScale] - The maximum scale for the model.
  34615. * @param [options.id] - A user-defined object to return when the model is picked with {@link Scene#pick}.
  34616. * @param [options.allowPicking = true] - When <code>true</code>, each glTF mesh and primitive is pickable with {@link Scene#pick}.
  34617. * @param [options.incrementallyLoadTextures = true] - Determine if textures may continue to stream in after the model is loaded.
  34618. * @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.
  34619. * @param [options.clampAnimations = true] - Determines if the model's animations should hold a pose over frames where no keyframes are specified.
  34620. * @param [options.shadows = ShadowMode.ENABLED] - Determines whether the model casts or receives shadows from light sources.
  34621. * @param [options.debugShowBoundingVolume = false] - For debugging only. Draws the bounding sphere for each draw command in the model.
  34622. * @param [options.debugWireframe = false] - For debugging only. Draws the model in wireframe.
  34623. * @param [options.heightReference = HeightReference.NONE] - Determines how the model is drawn relative to terrain.
  34624. * @param [options.scene] - Must be passed in for models that use the height reference property.
  34625. * @param [options.distanceDisplayCondition] - The condition specifying at what distance from the camera that this model will be displayed.
  34626. * @param [options.color = Color.WHITE] - A color that blends with the model's rendered color.
  34627. * @param [options.colorBlendMode = ColorBlendMode.HIGHLIGHT] - Defines how the color blends with the model.
  34628. * @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.
  34629. * @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.
  34630. * @param [options.silhouetteSize = 0.0] - The size of the silhouette in pixels.
  34631. * @param [options.clippingPlanes] - The {@link ClippingPlaneCollection} used to selectively disable rendering the model.
  34632. * @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.
  34633. * @param [options.lightColor] - The light color when shading the model. When <code>undefined</code> the scene's light color is used instead.
  34634. * @param [options.imageBasedLighting] - The properties for managing image-based lighting for this tileset.
  34635. * @param [options.imageBasedLightingFactor = new Cartesian2(1.0, 1.0)] - Scales diffuse and specular image-based lighting from the earth, sky, atmosphere and star skybox. Deprecated in Cesium 1.92, will be removed in Cesium 1.94.
  34636. * @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. Deprecated in Cesium 1.92, will be removed in Cesium 1.94.
  34637. * @param [options.sphericalHarmonicCoefficients] - The third order spherical harmonic coefficients used for the diffuse color of image-based lighting. Deprecated in Cesium 1.92, will be removed in Cesium 1.94.
  34638. * @param [options.specularEnvironmentMaps] - A URL to a KTX2 file that contains a cube map of the specular lighting and the convoluted specular mipmaps. Deprecated in Cesium 1.92, will be removed in Cesium 1.94.
  34639. * @param [options.credit] - A credit for the model, which is displayed on the canvas.
  34640. * @param [options.showCreditsOnScreen = false] - Whether to display the credits of this model on screen.
  34641. * @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.
  34642. * @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.
  34643. * @returns The newly created model.
  34644. */
  34645. static fromGltf(options: {
  34646. url: Resource | string;
  34647. basePath?: Resource | string;
  34648. show?: boolean;
  34649. modelMatrix?: Matrix4;
  34650. scale?: number;
  34651. minimumPixelSize?: number;
  34652. maximumScale?: number;
  34653. id?: any;
  34654. allowPicking?: boolean;
  34655. incrementallyLoadTextures?: boolean;
  34656. asynchronous?: boolean;
  34657. clampAnimations?: boolean;
  34658. shadows?: ShadowMode;
  34659. debugShowBoundingVolume?: boolean;
  34660. debugWireframe?: boolean;
  34661. heightReference?: HeightReference;
  34662. scene?: Scene;
  34663. distanceDisplayCondition?: DistanceDisplayCondition;
  34664. color?: Color;
  34665. colorBlendMode?: ColorBlendMode;
  34666. colorBlendAmount?: number;
  34667. silhouetteColor?: Color;
  34668. silhouetteSize?: number;
  34669. clippingPlanes?: ClippingPlaneCollection;
  34670. dequantizeInShader?: boolean;
  34671. lightColor?: Cartesian3;
  34672. imageBasedLighting?: ImageBasedLighting;
  34673. imageBasedLightingFactor?: Cartesian2;
  34674. luminanceAtZenith?: number;
  34675. sphericalHarmonicCoefficients?: Cartesian3[];
  34676. specularEnvironmentMaps?: string;
  34677. credit?: Credit | string;
  34678. showCreditsOnScreen?: boolean;
  34679. backFaceCulling?: boolean;
  34680. showOutline?: boolean;
  34681. }): Model;
  34682. /**
  34683. * Returns the glTF node with the given <code>name</code> property. This is used to
  34684. * modify a node's transform for animation outside of glTF animations.
  34685. * @example
  34686. * // Apply non-uniform scale to node LOD3sp
  34687. * const node = model.getNode('LOD3sp');
  34688. * node.matrix = Cesium.Matrix4.fromScale(new Cesium.Cartesian3(5.0, 1.0, 1.0), node.matrix);
  34689. * @param name - The glTF name of the node.
  34690. * @returns The node or <code>undefined</code> if no node with <code>name</code> exists.
  34691. */
  34692. getNode(name: string): ModelNode;
  34693. /**
  34694. * Returns the glTF mesh with the given <code>name</code> property.
  34695. * @param name - The glTF name of the mesh.
  34696. * @returns The mesh or <code>undefined</code> if no mesh with <code>name</code> exists.
  34697. */
  34698. getMesh(name: string): ModelMesh;
  34699. /**
  34700. * Returns the glTF material with the given <code>name</code> property.
  34701. * @param name - The glTF name of the material.
  34702. * @returns The material or <code>undefined</code> if no material with <code>name</code> exists.
  34703. */
  34704. getMaterial(name: string): ModelMaterial;
  34705. /**
  34706. * Sets the current value of an articulation stage. After setting one or multiple stage values, call
  34707. * Model.applyArticulations() to cause the node matrices to be recalculated.
  34708. * @param articulationStageKey - The name of the articulation, a space, and the name of the stage.
  34709. * @param value - The numeric value of this stage of the articulation.
  34710. */
  34711. setArticulationStage(articulationStageKey: string, value: number): void;
  34712. /**
  34713. * Applies any modified articulation stages to the matrix of each node that participates
  34714. * in any articulation. Note that this will overwrite any nodeTransformations on participating nodes.
  34715. */
  34716. applyArticulations(): void;
  34717. /**
  34718. * Called when {@link Viewer} or {@link CesiumWidget} render the scene to
  34719. * get the draw commands needed to render this primitive.
  34720. * <p>
  34721. * Do not call this function directly. This is documented just to
  34722. * list the exceptions that may be propagated when the scene is rendered:
  34723. * </p>
  34724. */
  34725. update(): void;
  34726. /**
  34727. * Returns true if this object was destroyed; otherwise, false.
  34728. * <br /><br />
  34729. * If this object was destroyed, it should not be used; calling any function other than
  34730. * <code>isDestroyed</code> will result in a {@link DeveloperError} exception.
  34731. * @returns <code>true</code> if this object was destroyed; otherwise, <code>false</code>.
  34732. */
  34733. isDestroyed(): boolean;
  34734. /**
  34735. * Destroys the WebGL resources held by this object. Destroying an object allows for deterministic
  34736. * release of WebGL resources, instead of relying on the garbage collector to destroy this object.
  34737. * <br /><br />
  34738. * Once an object is destroyed, it should not be used; calling any function other than
  34739. * <code>isDestroyed</code> will result in a {@link DeveloperError} exception. Therefore,
  34740. * assign the return value (<code>undefined</code>) to the object as done in the example.
  34741. * @example
  34742. * model = model && model.destroy();
  34743. */
  34744. destroy(): void;
  34745. }
  34746. /**
  34747. * An active glTF animation. A glTF asset can contain animations. An active animation
  34748. * is an animation that is currently playing or scheduled to be played because it was
  34749. * added to a model's {@link ModelAnimationCollection}. An active animation is an
  34750. * instance of an animation; for example, there can be multiple active animations
  34751. * for the same glTF animation, each with a different start time.
  34752. * <p>
  34753. * Create this by calling {@link ModelAnimationCollection#add}.
  34754. * </p>
  34755. */
  34756. export class ModelAnimation {
  34757. constructor();
  34758. /**
  34759. * When <code>true</code>, the animation is removed after it stops playing.
  34760. * This is slightly more efficient that not removing it, but if, for example,
  34761. * time is reversed, the animation is not played again.
  34762. */
  34763. removeOnStop: boolean;
  34764. /**
  34765. * The event fired when this animation is started. This can be used, for
  34766. * example, to play a sound or start a particle system, when the animation starts.
  34767. * <p>
  34768. * This event is fired at the end of the frame after the scene is rendered.
  34769. * </p>
  34770. * @example
  34771. * animation.start.addEventListener(function(model, animation) {
  34772. * console.log('Animation started: ' + animation.name);
  34773. * });
  34774. */
  34775. start: Event;
  34776. /**
  34777. * The event fired when on each frame when this animation is updated. The
  34778. * current time of the animation, relative to the glTF animation time span, is
  34779. * passed to the event, which allows, for example, starting new animations at a
  34780. * specific time relative to a playing animation.
  34781. * <p>
  34782. * This event is fired at the end of the frame after the scene is rendered.
  34783. * </p>
  34784. * @example
  34785. * animation.update.addEventListener(function(model, animation, time) {
  34786. * console.log('Animation updated: ' + animation.name + '. glTF animation time: ' + time);
  34787. * });
  34788. */
  34789. update: Event;
  34790. /**
  34791. * The event fired when this animation is stopped. This can be used, for
  34792. * example, to play a sound or start a particle system, when the animation stops.
  34793. * <p>
  34794. * This event is fired at the end of the frame after the scene is rendered.
  34795. * </p>
  34796. * @example
  34797. * animation.stop.addEventListener(function(model, animation) {
  34798. * console.log('Animation stopped: ' + animation.name);
  34799. * });
  34800. */
  34801. stop: Event;
  34802. /**
  34803. * The glTF animation name that identifies this animation.
  34804. */
  34805. readonly name: string;
  34806. /**
  34807. * The scene time to start playing this animation. When this is <code>undefined</code>,
  34808. * the animation starts at the next frame.
  34809. */
  34810. readonly startTime: JulianDate;
  34811. /**
  34812. * The delay, in seconds, from {@link ModelAnimation#startTime} to start playing.
  34813. */
  34814. readonly delay: number;
  34815. /**
  34816. * The scene time to stop playing this animation. When this is <code>undefined</code>,
  34817. * the animation is played for its full duration and perhaps repeated depending on
  34818. * {@link ModelAnimation#loop}.
  34819. */
  34820. readonly stopTime: JulianDate;
  34821. /**
  34822. * Values greater than <code>1.0</code> increase the speed that the animation is played relative
  34823. * to the scene clock speed; values less than <code>1.0</code> decrease the speed. A value of
  34824. * <code>1.0</code> plays the animation at the speed in the glTF animation mapped to the scene
  34825. * clock speed. For example, if the scene is played at 2x real-time, a two-second glTF animation
  34826. * will play in one second even if <code>multiplier</code> is <code>1.0</code>.
  34827. */
  34828. readonly multiplier: number;
  34829. /**
  34830. * When <code>true</code>, the animation is played in reverse.
  34831. */
  34832. readonly reverse: boolean;
  34833. /**
  34834. * Determines if and how the animation is looped.
  34835. */
  34836. readonly loop: ModelAnimationLoop;
  34837. }
  34838. /**
  34839. * A collection of active model animations. Access this using {@link Model#activeAnimations}.
  34840. */
  34841. export class ModelAnimationCollection {
  34842. constructor();
  34843. /**
  34844. * The event fired when an animation is added to the collection. This can be used, for
  34845. * example, to keep a UI in sync.
  34846. * @example
  34847. * model.activeAnimations.animationAdded.addEventListener(function(model, animation) {
  34848. * console.log('Animation added: ' + animation.name);
  34849. * });
  34850. */
  34851. animationAdded: Event;
  34852. /**
  34853. * The event fired when an animation is removed from the collection. This can be used, for
  34854. * example, to keep a UI in sync.
  34855. * @example
  34856. * model.activeAnimations.animationRemoved.addEventListener(function(model, animation) {
  34857. * console.log('Animation removed: ' + animation.name);
  34858. * });
  34859. */
  34860. animationRemoved: Event;
  34861. /**
  34862. * The number of animations in the collection.
  34863. */
  34864. readonly length: number;
  34865. /**
  34866. * Creates and adds an animation with the specified initial properties to the collection.
  34867. * <p>
  34868. * This raises the {@link ModelAnimationCollection#animationAdded} event so, for example, a UI can stay in sync.
  34869. * </p>
  34870. * @example
  34871. * // Example 1. Add an animation by name
  34872. * model.activeAnimations.add({
  34873. * name : 'animation name'
  34874. * });
  34875. *
  34876. * // Example 2. Add an animation by index
  34877. * model.activeAnimations.add({
  34878. * index : 0
  34879. * });
  34880. * @example
  34881. * // Example 3. Add an animation and provide all properties and events
  34882. * const startTime = Cesium.JulianDate.now();
  34883. *
  34884. * const animation = model.activeAnimations.add({
  34885. * name : 'another animation name',
  34886. * startTime : startTime,
  34887. * delay : 0.0, // Play at startTime (default)
  34888. * stopTime : Cesium.JulianDate.addSeconds(startTime, 4.0, new Cesium.JulianDate()),
  34889. * removeOnStop : false, // Do not remove when animation stops (default)
  34890. * multiplier : 2.0, // Play at double speed
  34891. * reverse : true, // Play in reverse
  34892. * loop : Cesium.ModelAnimationLoop.REPEAT // Loop the animation
  34893. * });
  34894. *
  34895. * animation.start.addEventListener(function(model, animation) {
  34896. * console.log('Animation started: ' + animation.name);
  34897. * });
  34898. * animation.update.addEventListener(function(model, animation, time) {
  34899. * console.log('Animation updated: ' + animation.name + '. glTF animation time: ' + time);
  34900. * });
  34901. * animation.stop.addEventListener(function(model, animation) {
  34902. * console.log('Animation stopped: ' + animation.name);
  34903. * });
  34904. * @param options - Object with the following properties:
  34905. * @param [options.name] - The glTF animation name that identifies the animation. Must be defined if <code>options.index</code> is <code>undefined</code>.
  34906. * @param [options.index] - The glTF animation index that identifies the animation. Must be defined if <code>options.name</code> is <code>undefined</code>.
  34907. * @param [options.startTime] - The scene time to start playing the animation. When this is <code>undefined</code>, the animation starts at the next frame.
  34908. * @param [options.delay = 0.0] - The delay, in seconds, from <code>startTime</code> to start playing.
  34909. * @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.
  34910. * @param [options.removeOnStop = false] - When <code>true</code>, the animation is removed after it stops playing.
  34911. * @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.
  34912. * @param [options.reverse = false] - When <code>true</code>, the animation is played in reverse.
  34913. * @param [options.loop = ModelAnimationLoop.NONE] - Determines if and how the animation is looped.
  34914. * @returns The animation that was added to the collection.
  34915. */
  34916. add(options: {
  34917. name?: string;
  34918. index?: number;
  34919. startTime?: JulianDate;
  34920. delay?: number;
  34921. stopTime?: JulianDate;
  34922. removeOnStop?: boolean;
  34923. multiplier?: number;
  34924. reverse?: boolean;
  34925. loop?: ModelAnimationLoop;
  34926. }): ModelAnimation;
  34927. /**
  34928. * Creates and adds an animation with the specified initial properties to the collection
  34929. * for each animation in the model.
  34930. * <p>
  34931. * This raises the {@link ModelAnimationCollection#animationAdded} event for each model so, for example, a UI can stay in sync.
  34932. * </p>
  34933. * @example
  34934. * model.activeAnimations.addAll({
  34935. * multiplier : 0.5, // Play at half-speed
  34936. * loop : Cesium.ModelAnimationLoop.REPEAT // Loop the animations
  34937. * });
  34938. * @param [options] - Object with the following properties:
  34939. * @param [options.startTime] - The scene time to start playing the animations. When this is <code>undefined</code>, the animations starts at the next frame.
  34940. * @param [options.delay = 0.0] - The delay, in seconds, from <code>startTime</code> to start playing.
  34941. * @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.
  34942. * @param [options.removeOnStop = false] - When <code>true</code>, the animations are removed after they stop playing.
  34943. * @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.
  34944. * @param [options.reverse = false] - When <code>true</code>, the animations are played in reverse.
  34945. * @param [options.loop = ModelAnimationLoop.NONE] - Determines if and how the animations are looped.
  34946. * @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.
  34947. */
  34948. addAll(options?: {
  34949. startTime?: JulianDate;
  34950. delay?: number;
  34951. stopTime?: JulianDate;
  34952. removeOnStop?: boolean;
  34953. multiplier?: number;
  34954. reverse?: boolean;
  34955. loop?: ModelAnimationLoop;
  34956. }): ModelAnimation[];
  34957. /**
  34958. * Removes an animation from the collection.
  34959. * <p>
  34960. * This raises the {@link ModelAnimationCollection#animationRemoved} event so, for example, a UI can stay in sync.
  34961. * </p>
  34962. * <p>
  34963. * An animation can also be implicitly removed from the collection by setting {@link ModelAnimation#removeOnStop} to
  34964. * <code>true</code>. The {@link ModelAnimationCollection#animationRemoved} event is still fired when the animation is removed.
  34965. * </p>
  34966. * @example
  34967. * const a = model.activeAnimations.add({
  34968. * name : 'animation name'
  34969. * });
  34970. * model.activeAnimations.remove(a); // Returns true
  34971. * @param animation - The animation to remove.
  34972. * @returns <code>true</code> if the animation was removed; <code>false</code> if the animation was not found in the collection.
  34973. */
  34974. remove(animation: ModelAnimation): boolean;
  34975. /**
  34976. * Removes all animations from the collection.
  34977. * <p>
  34978. * This raises the {@link ModelAnimationCollection#animationRemoved} event for each
  34979. * animation so, for example, a UI can stay in sync.
  34980. * </p>
  34981. */
  34982. removeAll(): void;
  34983. /**
  34984. * Determines whether this collection contains a given animation.
  34985. * @param animation - The animation to check for.
  34986. * @returns <code>true</code> if this collection contains the animation, <code>false</code> otherwise.
  34987. */
  34988. contains(animation: ModelAnimation): boolean;
  34989. /**
  34990. * Returns the animation in the collection at the specified index. Indices are zero-based
  34991. * and increase as animations are added. Removing an animation shifts all animations after
  34992. * it to the left, changing their indices. This function is commonly used to iterate over
  34993. * all the animations in the collection.
  34994. * @example
  34995. * // Output the names of all the animations in the collection.
  34996. * const animations = model.activeAnimations;
  34997. * const length = animations.length;
  34998. * for (let i = 0; i < length; ++i) {
  34999. * console.log(animations.get(i).name);
  35000. * }
  35001. * @param index - The zero-based index of the animation.
  35002. * @returns The animation at the specified index.
  35003. */
  35004. get(index: number): ModelAnimation;
  35005. }
  35006. /**
  35007. * Determines if and how a glTF animation is looped.
  35008. */
  35009. export enum ModelAnimationLoop {
  35010. /**
  35011. * Play the animation once; do not loop it.
  35012. */
  35013. NONE = 0,
  35014. /**
  35015. * Loop the animation playing it from the start immediately after it stops.
  35016. */
  35017. REPEAT = 1,
  35018. /**
  35019. * Loop the animation. First, playing it forward, then in reverse, then forward, and so on.
  35020. */
  35021. MIRRORED_REPEAT = 2
  35022. }
  35023. /**
  35024. * An object describing a uniform, its type, and an initial value
  35025. * @property type - The Glsl type of the uniform.
  35026. * @property value - The initial value of the uniform
  35027. */
  35028. export type UniformSpecifier = {
  35029. type: UniformType;
  35030. value: boolean | number | Cartesian2 | Cartesian3 | Cartesian4 | Matrix2 | Matrix3 | Matrix4 | TextureUniform;
  35031. };
  35032. /**
  35033. * A user defined GLSL shader used with {@link ModelExperimental} as well
  35034. * as {@link Cesium3DTileset}.
  35035. * <p>
  35036. * If texture uniforms are used, additional resource management must be done:
  35037. * </p>
  35038. * <ul>
  35039. * <li>
  35040. * The <code>update</code> function must be called each frame. When a
  35041. * custom shader is passed to a {@link ModelExperimental} or a
  35042. * {@link Cesium3DTileset}, this step is handled automaticaly
  35043. * </li>
  35044. * <li>
  35045. * {@link CustomShader#destroy} must be called when the custom shader is
  35046. * no longer needed to clean up GPU resources properly. The application
  35047. * is responsible for calling this method.
  35048. * </li>
  35049. * </ul>
  35050. * <p>
  35051. * 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>.
  35052. * </p>
  35053. * <p>
  35054. * See the {@link https://github.com/CesiumGS/cesium/tree/main/Documentation/CustomShaderGuide|Custom Shader Guide} for more detailed documentation.
  35055. * </p>
  35056. * @example
  35057. * const customShader = new CustomShader({
  35058. * uniforms: {
  35059. * u_colorIndex: {
  35060. * type: Cesium.UniformType.FLOAT,
  35061. * value: 1.0
  35062. * },
  35063. * u_normalMap: {
  35064. * type: Cesium.UniformType.SAMPLER_2D,
  35065. * value: new Cesium.TextureUniform({
  35066. * url: "http://example.com/normal.png"
  35067. * })
  35068. * }
  35069. * },
  35070. * varyings: {
  35071. * v_selectedColor: Cesium.VaryingType.VEC3
  35072. * },
  35073. * vertexShaderText: `
  35074. * void vertexMain(VertexInput vsInput, inout czm_modelVertexOutput vsOutput) {
  35075. * v_selectedColor = mix(vsInput.attributes.color_0, vsInput.attributes.color_1, u_colorIndex);
  35076. * vsOutput.positionMC += 0.1 * vsInput.attributes.normal;
  35077. * }
  35078. * `,
  35079. * fragmentShaderText: `
  35080. * void fragmentMain(FragmentInput fsInput, inout czm_modelMaterial material) {
  35081. * material.normal = texture2D(u_normalMap, fsInput.attributes.texCoord_0);
  35082. * material.diffuse = v_selectedColor;
  35083. * }
  35084. * `
  35085. * });
  35086. * @param options - An object with the following options
  35087. * @param [options.mode = CustomShaderMode.MODIFY_MATERIAL] - The custom shader mode, which determines how the custom shader code is inserted into the fragment shader.
  35088. * @param [options.lightingModel] - The lighting model (e.g. PBR or unlit). If present, this overrides the default lighting for the model.
  35089. * @param [options.isTranslucent = false] - If set, the model will be rendered as translucent. This overrides the default settings for the model.
  35090. * @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
  35091. * @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.
  35092. * @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.
  35093. * @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.
  35094. */
  35095. export class CustomShader {
  35096. constructor(options: {
  35097. mode?: CustomShaderMode;
  35098. lightingModel?: LightingModel;
  35099. isTranslucent?: boolean;
  35100. uniforms?: {
  35101. [key: string]: UniformSpecifier;
  35102. };
  35103. varyings?: {
  35104. [key: string]: VaryingType;
  35105. };
  35106. vertexShaderText?: string;
  35107. fragmentShaderText?: string;
  35108. });
  35109. /**
  35110. * Update the value of a uniform declared in the shader
  35111. * @param uniformName - The GLSL name of the uniform. This must match one of the uniforms declared in the constructor
  35112. * @param value - The new value of the uniform.
  35113. */
  35114. setUniform(uniformName: string, value: boolean | number | Cartesian2 | Cartesian3 | Cartesian4 | Matrix2 | Matrix3 | Matrix4 | string | Resource): void;
  35115. }
  35116. /**
  35117. * A value determining how the custom shader interacts with the overall
  35118. * fragment shader. This is used by {@link CustomShaderPipelineStage}
  35119. */
  35120. export const mode: CustomShaderMode;
  35121. /**
  35122. * The lighting model to use when using the custom shader.
  35123. * This is used by {@link CustomShaderPipelineStage}
  35124. */
  35125. export const lightingModel: LightingModel;
  35126. /**
  35127. * Additional uniforms as declared by the user.
  35128. */
  35129. export const uniforms: {
  35130. [key: string]: UniformSpecifier;
  35131. };
  35132. /**
  35133. * Additional varyings as declared by the user.
  35134. * This is used by {@link CustomShaderPipelineStage}
  35135. */
  35136. export const varyings: {
  35137. [key: string]: VaryingType;
  35138. };
  35139. /**
  35140. * The user-defined GLSL code for the vertex shader
  35141. */
  35142. export const vertexShaderText: string;
  35143. /**
  35144. * The user-defined GLSL code for the fragment shader
  35145. */
  35146. export const fragmentShaderText: string;
  35147. /**
  35148. * Whether the shader should be rendered as translucent
  35149. */
  35150. export const isTranslucent: boolean;
  35151. /**
  35152. * An enum describing how the {@link CustomShader} will be added to the
  35153. * fragment shader. This determines how the shader interacts with the material.
  35154. */
  35155. export enum CustomShaderMode {
  35156. /**
  35157. * The custom shader will be used to modify the results of the material stage
  35158. * before lighting is applied.
  35159. */
  35160. MODIFY_MATERIAL = "MODIFY_MATERIAL",
  35161. /**
  35162. * The custom shader will be used instead of the material stage. This is a hint
  35163. * to optimize out the material processing code.
  35164. */
  35165. REPLACE_MATERIAL = "REPLACE_MATERIAL"
  35166. }
  35167. /**
  35168. * The lighting model to use for lighting a {@link ModelExperimental}.
  35169. */
  35170. export enum LightingModel {
  35171. /**
  35172. * Use unlit shading, i.e. skip lighting calculations. The model's
  35173. * diffuse color (assumed to be linear RGB, not sRGB) is used directly
  35174. * when computing <code>gl_FragColor</code>. The alpha mode is still
  35175. * applied.
  35176. */
  35177. UNLIT = 0,
  35178. /**
  35179. * Use physically-based rendering lighting calculations. This includes
  35180. * both PBR metallic roughness and PBR specular glossiness. Image-based
  35181. * lighting is also applied when possible.
  35182. */
  35183. PBR = 1
  35184. }
  35185. /**
  35186. * A 3D model. This is a new architecture that is more decoupled than the older {@link Model}. This class is still experimental.
  35187. * <p>
  35188. * Do not call this function directly, instead use the `from` functions to create
  35189. * the Model from your source data type.
  35190. * </p>
  35191. * @param options - Object with the following properties:
  35192. * @param options.resource - The Resource to the 3D model.
  35193. * @param [options.modelMatrix = Matrix4.IDENTITY] - The 4x4 transformation matrix that transforms the model from model to world coordinates.
  35194. * @param [options.scale = 1.0] - A uniform scale applied to this model.
  35195. * @param [options.minimumPixelSize = 0.0] - The approximate minimum pixel size of the model regardless of zoom.
  35196. * @param [options.maximumScale] - The maximum scale size of a model. An upper limit for minimumPixelSize.
  35197. * @param [options.clampAnimations = true] - Determines if the model's animations should hold a pose over frames where no keyframes are specified.
  35198. * @param [options.debugShowBoundingVolume = false] - For debugging only. Draws the bounding sphere for each draw command in the model.
  35199. * @param [options.debugWireframe = false] - For debugging only. Draws the model in wireframe.
  35200. * @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.
  35201. * @param [options.opaquePass = Pass.OPAQUE] - The pass to use in the {@link DrawCommand} for the opaque portions of the model.
  35202. * @param [options.allowPicking = true] - When <code>true</code>, each primitive is pickable with {@link Scene#pick}.
  35203. * @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.
  35204. * @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.
  35205. * @param [options.show = true] - Whether or not to render the model.
  35206. * @param [options.color] - A color that blends with the model's rendered color.
  35207. * @param [options.colorBlendMode = ColorBlendMode.HIGHLIGHT] - Defines how the color blends with the model.
  35208. * @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.
  35209. * @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.
  35210. * @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.
  35211. * @param [options.pointCloudShading] - Options for constructing a {@link PointCloudShading} object to control point attenuation based on geometric error and lighting.
  35212. * @param [options.clippingPlanes] - The {@link ClippingPlaneCollection} used to selectively disable rendering the model.
  35213. * @param [options.lightColor] - The light color when shading the model. When <code>undefined</code> the scene's light color is used instead.
  35214. * @param [options.imageBasedLighting] - The properties for managing image-based lighting on this model.
  35215. * @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.
  35216. * @param [options.shadows = ShadowMode.ENABLED] - Determines whether the model casts or receives shadows from light sources.
  35217. * @param [options.showCreditsOnScreen = false] - Whether to display the credits of this model on screen.
  35218. * @param [options.splitDirection = SplitDirection.NONE] - The {@link SplitDirection} split to apply to this model.
  35219. */
  35220. export class ModelExperimental {
  35221. constructor(options: {
  35222. resource: Resource;
  35223. modelMatrix?: Matrix4;
  35224. scale?: number;
  35225. minimumPixelSize?: number;
  35226. maximumScale?: number;
  35227. clampAnimations?: boolean;
  35228. debugShowBoundingVolume?: boolean;
  35229. debugWireframe?: boolean;
  35230. cull?: boolean;
  35231. opaquePass?: boolean;
  35232. allowPicking?: boolean;
  35233. customShader?: CustomShader;
  35234. content?: Cesium3DTileContent;
  35235. show?: boolean;
  35236. color?: Color;
  35237. colorBlendMode?: ColorBlendMode;
  35238. colorBlendAmount?: number;
  35239. featureIdLabel?: string | number;
  35240. instanceFeatureIdLabel?: string | number;
  35241. pointCloudShading?: any;
  35242. clippingPlanes?: ClippingPlaneCollection;
  35243. lightColor?: Cartesian3;
  35244. imageBasedLighting?: ImageBasedLighting;
  35245. backFaceCulling?: boolean;
  35246. shadows?: ShadowMode;
  35247. showCreditsOnScreen?: boolean;
  35248. splitDirection?: SplitDirection;
  35249. });
  35250. /**
  35251. * When <code>true</code>, this model is ready to render, i.e., the external binary, image,
  35252. * and shader files were downloaded and the WebGL resources were created. This is set to
  35253. * <code>true</code> right before {@link ModelExperimental#readyPromise} is resolved.
  35254. */
  35255. readonly ready: boolean;
  35256. /**
  35257. * Gets the promise that will be resolved when this model is ready to render, i.e. when the external resources
  35258. * have been downloaded and the WebGL resources are created.
  35259. * <p>
  35260. * This promise is resolved at the end of the frame before the first frame the model is rendered in.
  35261. * </p>
  35262. */
  35263. readonly readyPromise: Promise<ModelExperimental>;
  35264. /**
  35265. * The currently playing glTF animations.
  35266. */
  35267. readonly activeAnimations: ModelExperimentalAnimationCollection;
  35268. /**
  35269. * Determines if the model's animations should hold a pose over frames where no keyframes are specified.
  35270. */
  35271. clampAnimations: boolean;
  35272. /**
  35273. * Point cloud shading settings for controlling point cloud attenuation
  35274. * and lighting. For 3D Tiles, this is inherited from the
  35275. * {@link Cesium3DTileset}.
  35276. */
  35277. pointCloudShading: PointCloudShading;
  35278. /**
  35279. * The model's custom shader, if it exists. Using custom shaders with a {@link Cesium3DTileStyle}
  35280. * may lead to undefined behavior.
  35281. */
  35282. customShader: CustomShader;
  35283. /**
  35284. * The color to blend with the model's rendered color.
  35285. */
  35286. color: Color;
  35287. /**
  35288. * Defines how the color blends with the model.
  35289. */
  35290. colorBlendMode: Cesium3DTileColorBlendMode | ColorBlendMode;
  35291. /**
  35292. * 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.
  35293. */
  35294. colorBlendAmount: number;
  35295. /**
  35296. * Gets the model's bounding sphere.
  35297. */
  35298. readonly boundingSphere: BoundingSphere;
  35299. /**
  35300. * This property is for debugging only; it is not for production use nor is it optimized.
  35301. * <p>
  35302. * Draws the bounding sphere for each draw command in the model.
  35303. * </p>
  35304. */
  35305. debugShowBoundingVolume: boolean;
  35306. /**
  35307. * This property is for debugging only; it is not for production use nor is it optimized.
  35308. * <p>
  35309. * Draws the model in wireframe.
  35310. * </p>
  35311. */
  35312. debugWireframe: boolean;
  35313. /**
  35314. * Whether or not to render the model.
  35315. */
  35316. show: boolean;
  35317. /**
  35318. * Label of the feature ID set to use for picking and styling.
  35319. * <p>
  35320. * For EXT_mesh_features, this is the feature ID's label property, or
  35321. * "featureId_N" (where N is the index in the featureIds array) when not
  35322. * specified. EXT_feature_metadata did not have a label field, so such
  35323. * feature ID sets are always labeled "featureId_N" where N is the index in
  35324. * the list of all feature Ids, where feature ID attributes are listed before
  35325. * feature ID textures.
  35326. * </p>
  35327. * <p>
  35328. * If featureIdLabel is set to an integer N, it is converted to
  35329. * the string "featureId_N" automatically. If both per-primitive and
  35330. * per-instance feature IDs are present, the instance feature IDs take
  35331. * priority.
  35332. * </p>
  35333. */
  35334. featureIdLabel: string;
  35335. /**
  35336. * Label of the instance feature ID set used for picking and styling.
  35337. * <p>
  35338. * If instanceFeatureIdLabel is set to an integer N, it is converted to
  35339. * the string "instanceFeatureId_N" automatically.
  35340. * If both per-primitive and per-instance feature IDs are present, the
  35341. * instance feature IDs take priority.
  35342. * </p>
  35343. */
  35344. instanceFeatureIdLabel: string;
  35345. /**
  35346. * The {@link ClippingPlaneCollection} used to selectively disable rendering the model.
  35347. */
  35348. clippingPlanes: ClippingPlaneCollection;
  35349. /**
  35350. * The light color when shading the model. When <code>undefined</code> the scene's light color is used instead.
  35351. * <p>
  35352. * Disabling additional light sources by setting <code>model.imageBasedLightingFactor = new Cartesian2(0.0, 0.0)</code> will make the
  35353. * model much darker. Here, increasing the intensity of the light source will make the model brighter.
  35354. * </p>
  35355. */
  35356. lightColor: Cartesian3;
  35357. /**
  35358. * The properties for managing image-based lighting on this model.
  35359. */
  35360. imageBasedLighting: ImageBasedLighting;
  35361. /**
  35362. * Whether to cull back-facing geometry. When true, back face culling is
  35363. * determined by the material's doubleSided property; when false, back face
  35364. * culling is disabled. Back faces are not culled if the model's color is
  35365. * translucent.
  35366. */
  35367. backFaceCulling: boolean;
  35368. /**
  35369. * A uniform scale applied to this model before the {@link Model#modelMatrix}.
  35370. * Values greater than <code>1.0</code> increase the size of the model; values
  35371. * less than <code>1.0</code> decrease.
  35372. */
  35373. scale: number;
  35374. /**
  35375. * The approximate minimum pixel size of the model regardless of zoom.
  35376. * This can be used to ensure that a model is visible even when the viewer
  35377. * zooms out. When <code>0.0</code>, no minimum size is enforced.
  35378. */
  35379. minimumPixelSize: number;
  35380. /**
  35381. * The maximum scale size for a model. This can be used to give
  35382. * an upper limit to the {@link Model#minimumPixelSize}, ensuring that the model
  35383. * is never an unreasonable scale.
  35384. */
  35385. maximumScale: number;
  35386. /**
  35387. * Determines whether the model casts or receives shadows from light sources.
  35388. */
  35389. shadows: ShadowMode;
  35390. /**
  35391. * Gets or sets whether the credits of the model will be displayed on the screen
  35392. */
  35393. showCreditsOnScreen: boolean;
  35394. /**
  35395. * The {@link SplitDirection} to apply to this model.
  35396. */
  35397. splitDirection: SplitDirection;
  35398. /**
  35399. * Called when {@link Viewer} or {@link CesiumWidget} render the scene to
  35400. * get the draw commands needed to render this primitive.
  35401. * <p>
  35402. * Do not call this function directly. This is documented just to
  35403. * list the exceptions that may be propagated when the scene is rendered:
  35404. * </p>
  35405. */
  35406. update(): void;
  35407. /**
  35408. * Returns true if this object was destroyed; otherwise, false.
  35409. * <br /><br />
  35410. * If this object was destroyed, it should not be used; calling any function other than
  35411. * <code>isDestroyed</code> will result in a {@link DeveloperError} exception.
  35412. * @returns <code>true</code> if this object was destroyed; otherwise, <code>false</code>.
  35413. */
  35414. isDestroyed(): boolean;
  35415. /**
  35416. * Destroys the WebGL resources held by this object. Destroying an object allows for deterministic
  35417. * release of WebGL resources, instead of relying on the garbage collector to destroy this object.
  35418. * <br /><br />
  35419. * Once an object is destroyed, it should not be used; calling any function other than
  35420. * <code>isDestroyed</code> will result in a {@link DeveloperError} exception. Therefore,
  35421. * assign the return value (<code>undefined</code>) to the object as done in the example.
  35422. * @example
  35423. * model = model && model.destroy();
  35424. */
  35425. destroy(): void;
  35426. /**
  35427. * <p>
  35428. * Creates a model from a glTF asset. When the model is ready to render, i.e., when the external binary, image,
  35429. * and shader files are downloaded and the WebGL resources are created, the {@link Model#readyPromise} is resolved.
  35430. * </p>
  35431. * <p>
  35432. * The model can be a traditional glTF asset with a .gltf extension or a Binary glTF using the .glb extension.
  35433. * @param options - Object with the following properties:
  35434. * @param options.gltf - A Resource/URL to a glTF/glb file, a binary glTF buffer, or a JSON object containing the glTF contents
  35435. * @param [options.basePath = ''] - The base path that paths in the glTF JSON are relative to.
  35436. * @param [options.modelMatrix = Matrix4.IDENTITY] - The 4x4 transformation matrix that transforms the model from model to world coordinates.
  35437. * @param [options.scale = 1.0] - A uniform scale applied to this model.
  35438. * @param [options.minimumPixelSize = 0.0] - The approximate minimum pixel size of the model regardless of zoom.
  35439. * @param [options.maximumScale] - The maximum scale size of a model. An upper limit for minimumPixelSize.
  35440. * @param [options.incrementallyLoadTextures = true] - Determine if textures may continue to stream in after the model is loaded.
  35441. * @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.
  35442. * @param [options.debugShowBoundingVolume = false] - For debugging only. Draws the bounding sphere for each draw command in the model.
  35443. * @param [options.debugWireframe = false] - For debugging only. Draws the model in wireframe.
  35444. * @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.
  35445. * @param [options.opaquePass = Pass.OPAQUE] - The pass to use in the {@link DrawCommand} for the opaque portions of the model.
  35446. * @param [options.upAxis = Axis.Y] - The up-axis of the glTF model.
  35447. * @param [options.forwardAxis = Axis.Z] - The forward-axis of the glTF model.
  35448. * @param [options.allowPicking = true] - When <code>true</code>, each primitive is pickable with {@link Scene#pick}.
  35449. * @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.
  35450. * @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.
  35451. * @param [options.show = true] - Whether or not to render the model.
  35452. * @param [options.color] - A color that blends with the model's rendered color.
  35453. * @param [options.colorBlendMode = ColorBlendMode.HIGHLIGHT] - Defines how the color blends with the model.
  35454. * @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.
  35455. * @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.
  35456. * @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.
  35457. * @param [options.pointCloudShading] - Options for constructing a {@link PointCloudShading} object to control point attenuation and lighting.
  35458. * @param [options.clippingPlanes] - The {@link ClippingPlaneCollection} used to selectively disable rendering the model.
  35459. * @param [options.lightColor] - The light color when shading the model. When <code>undefined</code> the scene's light color is used instead.
  35460. * @param [options.imageBasedLighting] - The properties for managing image-based lighting on this model.
  35461. * @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.
  35462. * @param [options.shadows = ShadowMode.ENABLED] - Determines whether the model casts or receives shadows from light sources.
  35463. * @param [options.showCreditsOnScreen = false] - Whether to display the credits of this model on screen.
  35464. * @param [options.splitDirection = SplitDirection.NONE] - The {@link SplitDirection} split to apply to this model.
  35465. * @returns The newly created model.
  35466. */
  35467. static fromGltf(options: {
  35468. gltf: string | Resource | Uint8Array | any;
  35469. basePath?: string | Resource;
  35470. modelMatrix?: Matrix4;
  35471. scale?: number;
  35472. minimumPixelSize?: number;
  35473. maximumScale?: number;
  35474. incrementallyLoadTextures?: boolean;
  35475. releaseGltfJson?: boolean;
  35476. debugShowBoundingVolume?: boolean;
  35477. debugWireframe?: boolean;
  35478. cull?: boolean;
  35479. opaquePass?: boolean;
  35480. upAxis?: Axis;
  35481. forwardAxis?: Axis;
  35482. allowPicking?: boolean;
  35483. customShader?: CustomShader;
  35484. content?: Cesium3DTileContent;
  35485. show?: boolean;
  35486. color?: Color;
  35487. colorBlendMode?: ColorBlendMode;
  35488. colorBlendAmount?: number;
  35489. featureIdLabel?: string | number;
  35490. instanceFeatureIdLabel?: string | number;
  35491. pointCloudShading?: any;
  35492. clippingPlanes?: ClippingPlaneCollection;
  35493. lightColor?: Cartesian3;
  35494. imageBasedLighting?: ImageBasedLighting;
  35495. backFaceCulling?: boolean;
  35496. shadows?: ShadowMode;
  35497. showCreditsOnScreen?: boolean;
  35498. splitDirection?: SplitDirection;
  35499. }): ModelExperimental;
  35500. }
  35501. /**
  35502. * The 4x4 transformation matrix that transforms the model from model to world coordinates.
  35503. * When this is the identity matrix, the model is drawn in world coordinates, i.e., Earth's Cartesian WGS84 coordinates.
  35504. * Local reference frames can be used by providing a different transformation matrix, like that returned
  35505. * by {@link Transforms.eastNorthUpToFixedFrame}.
  35506. * @example
  35507. * const origin = Cesium.Cartesian3.fromDegrees(-95.0, 40.0, 200000.0);
  35508. * m.modelMatrix = Cesium.Transforms.eastNorthUpToFixedFrame(origin);
  35509. */
  35510. export var modelMatrix: Matrix4;
  35511. /**
  35512. * The style to apply the to the features in the model. Cannot be applied if a {@link CustomShader} is also applied.
  35513. */
  35514. export var style: Cesium3DTileStyle;
  35515. /**
  35516. * An active animation derived from a glTF asset. An active animation is an
  35517. * animation that is either currently playing or scheduled to be played due to
  35518. * being added to a model's {@link ModelExperimentalAnimationCollection}. An active animation
  35519. * is an instance of an animation; for example, there can be multiple active
  35520. * animations for the same glTF animation, each with a different start time.
  35521. * <p>
  35522. * Create this by calling {@link ModelExperimentalAnimationCollection#add}.
  35523. * </p>
  35524. */
  35525. export class ModelExperimentalAnimation {
  35526. constructor();
  35527. /**
  35528. * When <code>true</code>, the animation is removed after it stops playing.
  35529. * This is slightly more efficient that not removing it, but if, for example,
  35530. * time is reversed, the animation is not played again.
  35531. */
  35532. removeOnStop: boolean;
  35533. /**
  35534. * The event fired when this animation is started. This can be used, for
  35535. * example, to play a sound or start a particle system, when the animation starts.
  35536. * <p>
  35537. * This event is fired at the end of the frame after the scene is rendered.
  35538. * </p>
  35539. * @example
  35540. * animation.start.addEventListener(function(model, animation) {
  35541. * console.log('Animation started: ' + animation.name);
  35542. * });
  35543. */
  35544. start: Event;
  35545. /**
  35546. * The event fired when on each frame when this animation is updated. The
  35547. * current time of the animation, relative to the glTF animation time span, is
  35548. * passed to the event, which allows, for example, starting new animations at a
  35549. * specific time relative to a playing animation.
  35550. * <p>
  35551. * This event is fired at the end of the frame after the scene is rendered.
  35552. * </p>
  35553. * @example
  35554. * animation.update.addEventListener(function(model, animation, time) {
  35555. * console.log('Animation updated: ' + animation.name + '. glTF animation time: ' + time);
  35556. * });
  35557. */
  35558. update: Event;
  35559. /**
  35560. * The event fired when this animation is stopped. This can be used, for
  35561. * example, to play a sound or start a particle system, when the animation stops.
  35562. * <p>
  35563. * This event is fired at the end of the frame after the scene is rendered.
  35564. * </p>
  35565. * @example
  35566. * animation.stop.addEventListener(function(model, animation) {
  35567. * console.log('Animation stopped: ' + animation.name);
  35568. * });
  35569. */
  35570. stop: Event;
  35571. /**
  35572. * The name that identifies this animation in the model, if it exists.
  35573. */
  35574. readonly name: string;
  35575. /**
  35576. * The scene time to start playing this animation. When this is <code>undefined</code>,
  35577. * the animation starts at the next frame.
  35578. */
  35579. readonly startTime: JulianDate;
  35580. /**
  35581. * The delay, in seconds, from {@link ModelExperimentalAnimation#startTime} to start playing.
  35582. */
  35583. readonly delay: number;
  35584. /**
  35585. * The scene time to stop playing this animation. When this is <code>undefined</code>,
  35586. * the animation is played for its full duration and perhaps repeated depending on
  35587. * {@link ModelExperimentalAnimation#loop}.
  35588. */
  35589. readonly stopTime: JulianDate;
  35590. /**
  35591. * Values greater than <code>1.0</code> increase the speed that the animation is played relative
  35592. * to the scene clock speed; values less than <code>1.0</code> decrease the speed. A value of
  35593. * <code>1.0</code> plays the animation at the speed in the glTF animation mapped to the scene
  35594. * clock speed. For example, if the scene is played at 2x real-time, a two-second glTF animation
  35595. * will play in one second even if <code>multiplier</code> is <code>1.0</code>.
  35596. */
  35597. readonly multiplier: number;
  35598. /**
  35599. * When <code>true</code>, the animation is played in reverse.
  35600. */
  35601. readonly reverse: boolean;
  35602. /**
  35603. * Determines if and how the animation is looped.
  35604. */
  35605. readonly loop: ModelAnimationLoop;
  35606. }
  35607. /**
  35608. * A collection of active model animations. Access this using {@link ModelExperimental#activeAnimations}.
  35609. */
  35610. export class ModelExperimentalAnimationCollection {
  35611. constructor();
  35612. /**
  35613. * The event fired when an animation is added to the collection. This can be used, for
  35614. * example, to keep a UI in sync.
  35615. * @example
  35616. * model.activeAnimations.animationAdded.addEventListener(function(model, animation) {
  35617. * console.log('Animation added: ' + animation.name);
  35618. * });
  35619. */
  35620. animationAdded: Event;
  35621. /**
  35622. * The event fired when an animation is removed from the collection. This can be used, for
  35623. * example, to keep a UI in sync.
  35624. * @example
  35625. * model.activeAnimations.animationRemoved.addEventListener(function(model, animation) {
  35626. * console.log('Animation removed: ' + animation.name);
  35627. * });
  35628. */
  35629. animationRemoved: Event;
  35630. /**
  35631. * The number of animations in the collection.
  35632. */
  35633. readonly length: number;
  35634. /**
  35635. * The model that owns this animation collection.
  35636. */
  35637. readonly model: ModelExperimental;
  35638. /**
  35639. * Creates and adds an animation with the specified initial properties to the collection.
  35640. * <p>
  35641. * This raises the {@link ModelExperimentalAnimationCollection#animationAdded} event so, for example, a UI can stay in sync.
  35642. * </p>
  35643. * @example
  35644. * // Example 1. Add an animation by name
  35645. * model.activeAnimations.add({
  35646. * name : 'animation name'
  35647. * });
  35648. * @example
  35649. * // Example 2. Add an animation by index
  35650. * model.activeAnimations.add({
  35651. * index : 0
  35652. * });
  35653. * @example
  35654. * // Example 3. Add an animation and provide all properties and events
  35655. * const startTime = Cesium.JulianDate.now();
  35656. *
  35657. * const animation = model.activeAnimations.add({
  35658. * name : 'another animation name',
  35659. * startTime : startTime,
  35660. * delay : 0.0, // Play at startTime (default)
  35661. * stopTime : Cesium.JulianDate.addSeconds(startTime, 4.0, new Cesium.JulianDate()),
  35662. * removeOnStop : false, // Do not remove when animation stops (default)
  35663. * multiplier : 2.0, // Play at double speed
  35664. * reverse : true, // Play in reverse
  35665. * loop : Cesium.ModelAnimationLoop.REPEAT // Loop the animation
  35666. * });
  35667. *
  35668. * animation.start.addEventListener(function(model, animation) {
  35669. * console.log('Animation started: ' + animation.name);
  35670. * });
  35671. * animation.update.addEventListener(function(model, animation, time) {
  35672. * console.log('Animation updated: ' + animation.name + '. glTF animation time: ' + time);
  35673. * });
  35674. * animation.stop.addEventListener(function(model, animation) {
  35675. * console.log('Animation stopped: ' + animation.name);
  35676. * });
  35677. * @param options - Object with the following properties:
  35678. * @param [options.name] - The glTF animation name that identifies the animation. Must be defined if <code>options.index</code> is <code>undefined</code>.
  35679. * @param [options.index] - The glTF animation index that identifies the animation. Must be defined if <code>options.name</code> is <code>undefined</code>.
  35680. * @param [options.startTime] - The scene time to start playing the animation. When this is <code>undefined</code>, the animation starts at the next frame.
  35681. * @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.
  35682. * @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.
  35683. * @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.
  35684. * @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.
  35685. * @param [options.reverse = false] - When <code>true</code>, the animation is played in reverse.
  35686. * @param [options.loop = ModelAnimationLoop.NONE] - Determines if and how the animation is looped.
  35687. * @returns The animation that was added to the collection.
  35688. */
  35689. add(options: {
  35690. name?: string;
  35691. index?: number;
  35692. startTime?: JulianDate;
  35693. delay?: number;
  35694. stopTime?: JulianDate;
  35695. removeOnStop?: boolean;
  35696. multiplier?: number;
  35697. reverse?: boolean;
  35698. loop?: ModelAnimationLoop;
  35699. }): ModelAnimation;
  35700. /**
  35701. * Creates and adds animations with the specified initial properties to the collection
  35702. * for all animations in the model.
  35703. * <p>
  35704. * This raises the {@link ModelExperimentalAnimationCollection#animationAdded} event for each model so, for example, a UI can stay in sync.
  35705. * </p>
  35706. * @example
  35707. * model.activeAnimations.addAll({
  35708. * multiplier : 0.5, // Play at half-speed
  35709. * loop : Cesium.ModelAnimationLoop.REPEAT // Loop the animations
  35710. * });
  35711. * @param [options] - Object with the following properties:
  35712. * @param [options.startTime] - The scene time to start playing the animations. When this is <code>undefined</code>, the animations starts at the next frame.
  35713. * @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.
  35714. * @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.
  35715. * @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.
  35716. * @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.
  35717. * @param [options.reverse = false] - When <code>true</code>, the animations are played in reverse.
  35718. * @param [options.loop = ModelAnimationLoop.NONE] - Determines if and how the animations are looped.
  35719. * @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.
  35720. */
  35721. addAll(options?: {
  35722. startTime?: JulianDate;
  35723. delay?: number;
  35724. stopTime?: JulianDate;
  35725. removeOnStop?: boolean;
  35726. multiplier?: number;
  35727. reverse?: boolean;
  35728. loop?: ModelAnimationLoop;
  35729. }): ModelExperimentalAnimation[];
  35730. /**
  35731. * Removes an animation from the collection.
  35732. * <p>
  35733. * This raises the {@link ModelExperimentalAnimationCollection#animationRemoved} event so, for example, a UI can stay in sync.
  35734. * </p>
  35735. * <p>
  35736. * An animation can also be implicitly removed from the collection by setting {@link ModelExperimentalAnimationCollection#removeOnStop} to
  35737. * <code>true</code>. The {@link ModelExperimentalAnimationCollection#animationRemoved} event is still fired when the animation is removed.
  35738. * </p>
  35739. * @example
  35740. * const a = model.activeAnimations.add({
  35741. * name : 'animation name'
  35742. * });
  35743. * model.activeAnimations.remove(a); // Returns true
  35744. * @param runtimeAnimation - The runtime animation to remove.
  35745. * @returns <code>true</code> if the animation was removed; <code>false</code> if the animation was not found in the collection.
  35746. */
  35747. remove(runtimeAnimation: ModelExperimentalAnimation): boolean;
  35748. /**
  35749. * Removes all animations from the collection.
  35750. * <p>
  35751. * This raises the {@link ModelExperimentalAnimationCollection#animationRemoved} event for each
  35752. * animation so, for example, a UI can stay in sync.
  35753. * </p>
  35754. */
  35755. removeAll(): void;
  35756. /**
  35757. * Determines whether this collection contains a given animation.
  35758. * @param runtimeAnimation - The runtime animation to check for.
  35759. * @returns <code>true</code> if this collection contains the animation, <code>false</code> otherwise.
  35760. */
  35761. contains(runtimeAnimation: ModelExperimentalAnimation): boolean;
  35762. /**
  35763. * Returns the animation in the collection at the specified index. Indices are zero-based
  35764. * and increase as animations are added. Removing an animation shifts all animations after
  35765. * it to the left, changing their indices. This function is commonly used to iterate over
  35766. * all the animations in the collection.
  35767. * @example
  35768. * // Output the names of all the animations in the collection.
  35769. * const animations = model.activeAnimations;
  35770. * const length = animations.length;
  35771. * for (let i = 0; i < length; ++i) {
  35772. * console.log(animations.get(i).name);
  35773. * }
  35774. * @param index - The zero-based index of the animation.
  35775. * @returns The runtime animation at the specified index.
  35776. */
  35777. get(index: number): ModelExperimentalAnimation;
  35778. }
  35779. /**
  35780. * The indices of the children of this node in the scene graph.
  35781. */
  35782. export const children: number[];
  35783. /**
  35784. * A feature of a {@link ModelExperimental}.
  35785. * <p>
  35786. * Provides access to a feature's properties stored in the model's feature table.
  35787. * </p>
  35788. * <p>
  35789. * Modifications to a <code>ModelFeature</code> object have the lifetime of the model.
  35790. * </p>
  35791. * <p>
  35792. * Do not construct this directly. Access it through picking using {@link Scene#pick}.
  35793. * </p>
  35794. * @example
  35795. * // On mouse over, display all the properties for a feature in the console log.
  35796. * handler.setInputAction(function(movement) {
  35797. * const feature = scene.pick(movement.endPosition);
  35798. * if (feature instanceof Cesium.ModelFeature) {
  35799. * console.log(feature);
  35800. * }
  35801. * }, Cesium.ScreenSpaceEventType.MOUSE_MOVE);
  35802. * @param options - Object with the following properties:
  35803. * @param options.model - The model the feature belongs to.
  35804. * @param options.featureId - The unique integral identifier for this feature.
  35805. */
  35806. export class ModelFeature {
  35807. constructor(options: {
  35808. model: ModelExperimental;
  35809. featureId: number;
  35810. });
  35811. /**
  35812. * Gets or sets if the feature will be shown. This is set for all features
  35813. * when a style's show is evaluated.
  35814. */
  35815. show: boolean;
  35816. /**
  35817. * Gets or sets the highlight color multiplied with the feature's color. When
  35818. * this is white, the feature's color is not changed. This is set for all features
  35819. * when a style's color is evaluated.
  35820. */
  35821. color: Color;
  35822. /**
  35823. * Get the feature ID associated with this feature. For 3D Tiles 1.0, the
  35824. * batch ID is returned. For EXT_mesh_features, this is the feature ID from
  35825. * the selected feature ID set.
  35826. */
  35827. readonly featureId: number;
  35828. /**
  35829. * Returns whether the feature contains this property.
  35830. * @param name - The case-sensitive name of the property.
  35831. * @returns Whether the feature contains this property.
  35832. */
  35833. hasProperty(name: string): boolean;
  35834. /**
  35835. * Returns a copy of the value of the feature's property with the given name.
  35836. * @example
  35837. * // Display all the properties for a feature in the console log.
  35838. * const propertyNames = feature.getPropertyNames();
  35839. * const length = propertyNames.length;
  35840. * for (let i = 0; i < length; ++i) {
  35841. * const propertyName = propertyNames[i];
  35842. * console.log(propertyName + ': ' + feature.getProperty(propertyName));
  35843. * }
  35844. * @param name - The case-sensitive name of the property.
  35845. * @returns The value of the property or <code>undefined</code> if the feature does not have this property.
  35846. */
  35847. getProperty(name: string): any;
  35848. /**
  35849. * Returns a copy of the feature's property with the given name, examining all
  35850. * the metadata from the EXT_structural_metadata and legacy EXT_feature_metadata glTF
  35851. * extensions. Metadata is checked against name from most specific to most
  35852. * general and the first match is returned. Metadata is checked in this order:
  35853. * <ol>
  35854. * <li>structural metadata property by semantic</li>
  35855. * <li>structural metadata property by property ID</li>
  35856. * </ol>
  35857. * <p>
  35858. * 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
  35859. * previous {@link https://github.com/CesiumGS/glTF/tree/3d-tiles-next/extensions/2.0/Vendor/EXT_feature_metadata|EXT_feature_metadata Extension} for glTF.
  35860. * </p>
  35861. * @param name - The semantic or property ID of the feature. Semantics are checked before property IDs in each granularity of metadata.
  35862. * @returns The value of the property or <code>undefined</code> if the feature does not have this property.
  35863. */
  35864. getPropertyInherited(name: string): any;
  35865. /**
  35866. * Returns an array of property names for the feature.
  35867. * @param [results] - An array into which to store the results.
  35868. * @returns The names of the feature's properties.
  35869. */
  35870. getPropertyNames(results?: string[]): string[];
  35871. /**
  35872. * Sets the value of the feature's property with the given name.
  35873. * @example
  35874. * const height = feature.getProperty('Height'); // e.g., the height of a building
  35875. * @example
  35876. * const name = 'clicked';
  35877. * if (feature.getProperty(name)) {
  35878. * console.log('already clicked');
  35879. * } else {
  35880. * feature.setProperty(name, true);
  35881. * console.log('first click');
  35882. * }
  35883. * @param name - The case-sensitive name of the property.
  35884. * @param value - The value of the property that will be copied.
  35885. * @returns <code>true</code> if the property was set, <code>false</code> otherwise.
  35886. */
  35887. setProperty(name: string, value: any): boolean;
  35888. }
  35889. /**
  35890. * The bounding sphere that contains all the vertices in this primitive.
  35891. */
  35892. export var boundingSphere: BoundingSphere;
  35893. /**
  35894. * A simple struct that serves as a value of a <code>sampler2D</code>-valued
  35895. * uniform. This is used with {@link CustomShader} and {@link TextureManager}
  35896. * @param options - An object with the following properties:
  35897. * @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.
  35898. * @param [options.width] - The width of the image. Required when options.typedArray is present
  35899. * @param [options.height] - The height of the image. Required when options.typedArray is present.
  35900. * @param [options.url] - A URL string or resource pointing to a texture image.
  35901. * @param [options.repeat = true] - When defined, the texture sampler will be set to wrap in both directions
  35902. * @param [options.pixelFormat = PixelFormat.RGBA] - When options.typedArray is defined, this is used to determine the pixel format of the texture
  35903. * @param [options.pixelDatatype = PixelDatatype.UNSIGNED_BYTE] - When options.typedArray is defined, this is the data type of pixel values in the typed array.
  35904. * @param [options.minificationFilter = TextureMinificationFilter.LINEAR] - The minification filter of the texture sampler.
  35905. * @param [options.magnificationFilter = TextureMagnificationFilter.LINEAR] - The magnification filter of the texture sampler.
  35906. * @param [options.maximumAnisotropy = 1.0] - The maximum anisotropy of the texture sampler
  35907. */
  35908. export class TextureUniform {
  35909. constructor(options: {
  35910. typedArray?: Uint8Array;
  35911. width?: number;
  35912. height?: number;
  35913. url?: string | Resource;
  35914. repeat?: boolean;
  35915. pixelFormat?: PixelFormat;
  35916. pixelDatatype?: PixelDatatype;
  35917. minificationFilter?: TextureMinificationFilter;
  35918. magnificationFilter?: TextureMagnificationFilter;
  35919. maximumAnisotropy?: number;
  35920. });
  35921. }
  35922. /**
  35923. * An enum of the basic GLSL uniform types. These can be used with
  35924. * {@link CustomShader} to declare user-defined uniforms.
  35925. */
  35926. export enum UniformType {
  35927. /**
  35928. * A single floating point value.
  35929. */
  35930. FLOAT = "float",
  35931. /**
  35932. * A vector of 2 floating point values.
  35933. */
  35934. VEC2 = "vec2",
  35935. /**
  35936. * A vector of 3 floating point values.
  35937. */
  35938. VEC3 = "vec3",
  35939. /**
  35940. * A vector of 4 floating point values.
  35941. */
  35942. VEC4 = "vec4",
  35943. /**
  35944. * A single integer value
  35945. */
  35946. INT = "int",
  35947. /**
  35948. * A vector of 2 integer values.
  35949. */
  35950. INT_VEC2 = "ivec2",
  35951. /**
  35952. * A vector of 3 integer values.
  35953. */
  35954. INT_VEC3 = "ivec3",
  35955. /**
  35956. * A vector of 4 integer values.
  35957. */
  35958. INT_VEC4 = "ivec4",
  35959. /**
  35960. * A single boolean value.
  35961. */
  35962. BOOL = "bool",
  35963. /**
  35964. * A vector of 2 boolean values.
  35965. */
  35966. BOOL_VEC2 = "bvec2",
  35967. /**
  35968. * A vector of 3 boolean values.
  35969. */
  35970. BOOL_VEC3 = "bvec3",
  35971. /**
  35972. * A vector of 4 boolean values.
  35973. */
  35974. BOOL_VEC4 = "bvec4",
  35975. /**
  35976. * A 2x2 matrix of floating point values.
  35977. */
  35978. MAT2 = "mat2",
  35979. /**
  35980. * A 3x3 matrix of floating point values.
  35981. */
  35982. MAT3 = "mat2",
  35983. /**
  35984. * A 3x3 matrix of floating point values.
  35985. */
  35986. MAT4 = "mat4",
  35987. /**
  35988. * A 2D sampled texture.
  35989. */
  35990. SAMPLER_2D = "sampler2D",
  35991. SAMPLER_CUBE = "samplerCube"
  35992. }
  35993. /**
  35994. * An enum for the GLSL varying types. These can be used for declaring varyings
  35995. * in {@link CustomShader}
  35996. */
  35997. export enum VaryingType {
  35998. /**
  35999. * A single floating point value.
  36000. */
  36001. FLOAT = "float",
  36002. /**
  36003. * A vector of 2 floating point values.
  36004. */
  36005. VEC2 = "vec2",
  36006. /**
  36007. * A vector of 3 floating point values.
  36008. */
  36009. VEC3 = "vec3",
  36010. /**
  36011. * A vector of 4 floating point values.
  36012. */
  36013. VEC4 = "vec4",
  36014. /**
  36015. * A 2x2 matrix of floating point values.
  36016. */
  36017. MAT2 = "mat2",
  36018. /**
  36019. * A 3x3 matrix of floating point values.
  36020. */
  36021. MAT3 = "mat2",
  36022. /**
  36023. * A 3x3 matrix of floating point values.
  36024. */
  36025. MAT4 = "mat4"
  36026. }
  36027. /**
  36028. * A model's material with modifiable parameters. A glTF material
  36029. * contains parameters defined by the material's technique with values
  36030. * defined by the technique and potentially overridden by the material.
  36031. * This class allows changing these values at runtime.
  36032. * <p>
  36033. * Use {@link Model#getMaterial} to create an instance.
  36034. * </p>
  36035. */
  36036. export class ModelMaterial {
  36037. constructor();
  36038. /**
  36039. * The value of the <code>name</code> property of this material.
  36040. */
  36041. readonly name: string;
  36042. /**
  36043. * The index of the material.
  36044. */
  36045. readonly id: string;
  36046. /**
  36047. * Assigns a value to a material parameter. The type for <code>value</code>
  36048. * depends on the glTF type of the parameter. It will be a floating-point
  36049. * number, Cartesian, or matrix.
  36050. * @example
  36051. * material.setValue('diffuse', new Cesium.Cartesian4(1.0, 0.0, 0.0, 1.0)); // vec4
  36052. * material.setValue('shininess', 256.0); // scalar
  36053. * @param name - The name of the parameter.
  36054. * @param [value] - The value to assign to the parameter.
  36055. */
  36056. setValue(name: string, value?: any): void;
  36057. /**
  36058. * Returns the value of the parameter with the given <code>name</code>. The type of the
  36059. * returned object depends on the glTF type of the parameter. It will be a floating-point
  36060. * number, Cartesian, or matrix.
  36061. * @param name - The name of the parameter.
  36062. * @returns The value of the parameter or <code>undefined</code> if the parameter does not exist.
  36063. */
  36064. getValue(name: string): any;
  36065. }
  36066. /**
  36067. * A model's mesh and its materials.
  36068. * <p>
  36069. * Use {@link Model#getMesh} to create an instance.
  36070. * </p>
  36071. */
  36072. export class ModelMesh {
  36073. constructor();
  36074. /**
  36075. * The value of the <code>name</code> property of this mesh.
  36076. */
  36077. readonly name: string;
  36078. /**
  36079. * The index of the mesh.
  36080. */
  36081. readonly id: string;
  36082. /**
  36083. * An array of {@link ModelMaterial} instances indexed by the mesh's
  36084. * primitive indices.
  36085. */
  36086. readonly materials: ModelMaterial[];
  36087. }
  36088. /**
  36089. * A model node with a transform for user-defined animations. A glTF asset can
  36090. * contain animations that target a node's transform. This class allows
  36091. * changing a node's transform externally so animation can be driven by another
  36092. * source, not just an animation in the glTF asset.
  36093. * <p>
  36094. * Use {@link Model#getNode} to create an instance.
  36095. * </p>
  36096. * @example
  36097. * const node = model.getNode('LOD3sp');
  36098. * node.matrix = Cesium.Matrix4.fromScale(new Cesium.Cartesian3(5.0, 1.0, 1.0), node.matrix);
  36099. */
  36100. export class ModelNode {
  36101. constructor();
  36102. /**
  36103. * The value of the <code>name</code> property of this node.
  36104. */
  36105. readonly name: string;
  36106. /**
  36107. * The index of the node.
  36108. */
  36109. readonly id: string;
  36110. /**
  36111. * Determines if this node and its children will be shown.
  36112. */
  36113. show: boolean;
  36114. /**
  36115. * The node's 4x4 matrix transform from its local coordinates to
  36116. * its parent's.
  36117. * <p>
  36118. * For changes to take effect, this property must be assigned to;
  36119. * setting individual elements of the matrix will not work.
  36120. * </p>
  36121. */
  36122. matrix: Matrix4;
  36123. /**
  36124. * Gets the node's original 4x4 matrix transform from its local coordinates to
  36125. * its parent's, without any node transformations or articulations applied.
  36126. */
  36127. originalMatrix: Matrix4;
  36128. }
  36129. /**
  36130. * Draws the Moon in 3D.
  36131. * @example
  36132. * scene.moon = new Cesium.Moon();
  36133. * @param [options] - Object with the following properties:
  36134. * @param [options.show = true] - Determines whether the moon will be rendered.
  36135. * @param [options.textureUrl = buildModuleUrl('Assets/Textures/moonSmall.jpg')] - The moon texture.
  36136. * @param [options.ellipsoid = Ellipsoid.MOON] - The moon ellipsoid.
  36137. * @param [options.onlySunLighting = true] - Use the sun as the only light source.
  36138. */
  36139. export class Moon {
  36140. constructor(options?: {
  36141. show?: boolean;
  36142. textureUrl?: string;
  36143. ellipsoid?: Ellipsoid;
  36144. onlySunLighting?: boolean;
  36145. });
  36146. /**
  36147. * Determines if the moon will be shown.
  36148. */
  36149. show: boolean;
  36150. /**
  36151. * The moon texture.
  36152. */
  36153. textureUrl: string;
  36154. /**
  36155. * Use the sun as the only light source.
  36156. */
  36157. onlySunLighting: boolean;
  36158. /**
  36159. * Get the ellipsoid that defines the shape of the moon.
  36160. */
  36161. readonly ellipsoid: Ellipsoid;
  36162. /**
  36163. * Returns true if this object was destroyed; otherwise, false.
  36164. * <br /><br />
  36165. * If this object was destroyed, it should not be used; calling any function other than
  36166. * <code>isDestroyed</code> will result in a {@link DeveloperError} exception.
  36167. * @returns <code>true</code> if this object was destroyed; otherwise, <code>false</code>.
  36168. */
  36169. isDestroyed(): boolean;
  36170. /**
  36171. * Destroys the WebGL resources held by this object. Destroying an object allows for deterministic
  36172. * release of WebGL resources, instead of relying on the garbage collector to destroy this object.
  36173. * <br /><br />
  36174. * Once an object is destroyed, it should not be used; calling any function other than
  36175. * <code>isDestroyed</code> will result in a {@link DeveloperError} exception. Therefore,
  36176. * assign the return value (<code>undefined</code>) to the object as done in the example.
  36177. * @example
  36178. * moon = moon && moon.destroy();
  36179. */
  36180. destroy(): void;
  36181. }
  36182. /**
  36183. * A {@link TileDiscardPolicy} specifying that tile images should never be discard.
  36184. */
  36185. export class NeverTileDiscardPolicy {
  36186. constructor();
  36187. /**
  36188. * Determines if the discard policy is ready to process images.
  36189. * @returns True if the discard policy is ready to process images; otherwise, false.
  36190. */
  36191. isReady(): boolean;
  36192. /**
  36193. * Given a tile image, decide whether to discard that image.
  36194. * @param image - An image to test.
  36195. * @returns True if the image should be discarded; otherwise, false.
  36196. */
  36197. shouldDiscardImage(image: HTMLImageElement): boolean;
  36198. }
  36199. export namespace OpenStreetMapImageryProvider {
  36200. /**
  36201. * Initialization options for the OpenStreetMapImageryProvider constructor
  36202. * @property [url = 'https://a.tile.openstreetmap.org'] - The OpenStreetMap server url.
  36203. * @property [fileExtension = 'png'] - The file extension for images on the server.
  36204. * @property [rectangle = Rectangle.MAX_VALUE] - The rectangle of the layer.
  36205. * @property [minimumLevel = 0] - The minimum level-of-detail supported by the imagery provider.
  36206. * @property [maximumLevel] - The maximum level-of-detail supported by the imagery provider, or undefined if there is no limit.
  36207. * @property [ellipsoid] - The ellipsoid. If not specified, the WGS84 ellipsoid is used.
  36208. * @property [credit = 'MapQuest, Open Street Map and contributors, CC-BY-SA'] - A credit for the data source, which is displayed on the canvas.
  36209. */
  36210. type ConstructorOptions = {
  36211. url?: string;
  36212. fileExtension?: string;
  36213. rectangle?: Rectangle;
  36214. minimumLevel?: number;
  36215. maximumLevel?: number;
  36216. ellipsoid?: Ellipsoid;
  36217. credit?: Credit | string;
  36218. };
  36219. }
  36220. /**
  36221. * An imagery provider that provides tiled imagery hosted by OpenStreetMap
  36222. * or another provider of Slippy tiles. The default url connects to OpenStreetMap's volunteer-run
  36223. * servers, so you must conform to their
  36224. * {@link http://wiki.openstreetmap.org/wiki/Tile_usage_policy|Tile Usage Policy}.
  36225. * @example
  36226. * const osm = new Cesium.OpenStreetMapImageryProvider({
  36227. * url : 'https://a.tile.openstreetmap.org/'
  36228. * });
  36229. * @param options - Object describing initialization options
  36230. */
  36231. export class OpenStreetMapImageryProvider extends UrlTemplateImageryProvider {
  36232. constructor(options: OpenStreetMapImageryProvider.ConstructorOptions);
  36233. }
  36234. /**
  36235. * A particle emitted by a {@link ParticleSystem}.
  36236. * @param options - An object with the following properties:
  36237. * @param [options.mass = 1.0] - The mass of the particle in kilograms.
  36238. * @param [options.position = Cartesian3.ZERO] - The initial position of the particle in world coordinates.
  36239. * @param [options.velocity = Cartesian3.ZERO] - The velocity vector of the particle in world coordinates.
  36240. * @param [options.life = Number.MAX_VALUE] - The life of the particle in seconds.
  36241. * @param [options.image] - The URI, HTMLImageElement, or HTMLCanvasElement to use for the billboard.
  36242. * @param [options.startColor = Color.WHITE] - The color of a particle when it is born.
  36243. * @param [options.endColor = Color.WHITE] - The color of a particle when it dies.
  36244. * @param [options.startScale = 1.0] - The scale of the particle when it is born.
  36245. * @param [options.endScale = 1.0] - The scale of the particle when it dies.
  36246. * @param [options.imageSize = new Cartesian2(1.0, 1.0)] - The dimensions, width by height, to scale the particle image in pixels.
  36247. */
  36248. export class Particle {
  36249. constructor(options: {
  36250. mass?: number;
  36251. position?: Cartesian3;
  36252. velocity?: Cartesian3;
  36253. life?: number;
  36254. image?: any;
  36255. startColor?: Color;
  36256. endColor?: Color;
  36257. startScale?: number;
  36258. endScale?: number;
  36259. imageSize?: Cartesian2;
  36260. });
  36261. /**
  36262. * The mass of the particle in kilograms.
  36263. */
  36264. mass: number;
  36265. /**
  36266. * The positon of the particle in world coordinates.
  36267. */
  36268. position: Cartesian3;
  36269. /**
  36270. * The velocity of the particle in world coordinates.
  36271. */
  36272. velocity: Cartesian3;
  36273. /**
  36274. * The life of the particle in seconds.
  36275. */
  36276. life: number;
  36277. /**
  36278. * The image to use for the particle.
  36279. */
  36280. image: any;
  36281. /**
  36282. * The color of the particle when it is born.
  36283. */
  36284. startColor: Color;
  36285. /**
  36286. * The color of the particle when it dies.
  36287. */
  36288. endColor: Color;
  36289. /**
  36290. * the scale of the particle when it is born.
  36291. */
  36292. startScale: number;
  36293. /**
  36294. * The scale of the particle when it dies.
  36295. */
  36296. endScale: number;
  36297. /**
  36298. * The dimensions, width by height, to scale the particle image in pixels.
  36299. */
  36300. imageSize: Cartesian2;
  36301. /**
  36302. * Gets the age of the particle in seconds.
  36303. */
  36304. age: number;
  36305. /**
  36306. * Gets the age normalized to a value in the range [0.0, 1.0].
  36307. */
  36308. normalizedAge: number;
  36309. }
  36310. /**
  36311. * Represents a burst of {@link Particle}s from a {@link ParticleSystem} at a given time in the systems lifetime.
  36312. * @param [options] - An object with the following properties:
  36313. * @param [options.time = 0.0] - The time in seconds after the beginning of the particle system's lifetime that the burst will occur.
  36314. * @param [options.minimum = 0.0] - The minimum number of particles emmitted in the burst.
  36315. * @param [options.maximum = 50.0] - The maximum number of particles emitted in the burst.
  36316. */
  36317. export class ParticleBurst {
  36318. constructor(options?: {
  36319. time?: number;
  36320. minimum?: number;
  36321. maximum?: number;
  36322. });
  36323. /**
  36324. * The time in seconds after the beginning of the particle system's lifetime that the burst will occur.
  36325. */
  36326. time: number;
  36327. /**
  36328. * The minimum number of particles emitted.
  36329. */
  36330. minimum: number;
  36331. /**
  36332. * The maximum number of particles emitted.
  36333. */
  36334. maximum: number;
  36335. /**
  36336. * <code>true</code> if the burst has been completed; <code>false</code> otherwise.
  36337. */
  36338. complete: boolean;
  36339. }
  36340. /**
  36341. * <p>
  36342. * An object that initializes a {@link Particle} from a {@link ParticleSystem}.
  36343. * </p>
  36344. * <p>
  36345. * This type describes an interface and is not intended to be instantiated directly.
  36346. * </p>
  36347. */
  36348. export class ParticleEmitter {
  36349. constructor();
  36350. }
  36351. /**
  36352. * A ParticleSystem manages the updating and display of a collection of particles.
  36353. * @param [options] - Object with the following properties:
  36354. * @param [options.show = true] - Whether to display the particle system.
  36355. * @param [options.updateCallback] - The callback function to be called each frame to update a particle.
  36356. * @param [options.emitter = new CircleEmitter(0.5)] - The particle emitter for this system.
  36357. * @param [options.modelMatrix = Matrix4.IDENTITY] - The 4x4 transformation matrix that transforms the particle system from model to world coordinates.
  36358. * @param [options.emitterModelMatrix = Matrix4.IDENTITY] - The 4x4 transformation matrix that transforms the particle system emitter within the particle systems local coordinate system.
  36359. * @param [options.emissionRate = 5] - The number of particles to emit per second.
  36360. * @param [options.bursts] - An array of {@link ParticleBurst}, emitting bursts of particles at periodic times.
  36361. * @param [options.loop = true] - Whether the particle system should loop its bursts when it is complete.
  36362. * @param [options.scale = 1.0] - Sets the scale to apply to the image of the particle for the duration of its particleLife.
  36363. * @param [options.startScale] - The initial scale to apply to the image of the particle at the beginning of its life.
  36364. * @param [options.endScale] - The final scale to apply to the image of the particle at the end of its life.
  36365. * @param [options.color = Color.WHITE] - Sets the color of a particle for the duration of its particleLife.
  36366. * @param [options.startColor] - The color of the particle at the beginning of its life.
  36367. * @param [options.endColor] - The color of the particle at the end of its life.
  36368. * @param [options.image] - The URI, HTMLImageElement, or HTMLCanvasElement to use for the billboard.
  36369. * @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.
  36370. * @param [options.minimumImageSize] - Sets the minimum bound, width by height, above which to randomly scale the particle image's dimensions in pixels.
  36371. * @param [options.maximumImageSize] - Sets the maximum bound, width by height, below which to randomly scale the particle image's dimensions in pixels.
  36372. * @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.
  36373. * @param [options.speed = 1.0] - If set, overrides the minimumSpeed and maximumSpeed inputs with this value.
  36374. * @param [options.minimumSpeed] - Sets the minimum bound in meters per second above which a particle's actual speed will be randomly chosen.
  36375. * @param [options.maximumSpeed] - Sets the maximum bound in meters per second below which a particle's actual speed will be randomly chosen.
  36376. * @param [options.lifetime = Number.MAX_VALUE] - How long the particle system will emit particles, in seconds.
  36377. * @param [options.particleLife = 5.0] - If set, overrides the minimumParticleLife and maximumParticleLife inputs with this value.
  36378. * @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.
  36379. * @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.
  36380. * @param [options.mass = 1.0] - Sets the minimum and maximum mass of particles in kilograms.
  36381. * @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.
  36382. * @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.
  36383. */
  36384. export class ParticleSystem {
  36385. constructor(options?: {
  36386. show?: boolean;
  36387. updateCallback?: ParticleSystem.updateCallback;
  36388. emitter?: ParticleEmitter;
  36389. modelMatrix?: Matrix4;
  36390. emitterModelMatrix?: Matrix4;
  36391. emissionRate?: number;
  36392. bursts?: ParticleBurst[];
  36393. loop?: boolean;
  36394. scale?: number;
  36395. startScale?: number;
  36396. endScale?: number;
  36397. color?: Color;
  36398. startColor?: Color;
  36399. endColor?: Color;
  36400. image?: any;
  36401. imageSize?: Cartesian2;
  36402. minimumImageSize?: Cartesian2;
  36403. maximumImageSize?: Cartesian2;
  36404. sizeInMeters?: boolean;
  36405. speed?: number;
  36406. minimumSpeed?: number;
  36407. maximumSpeed?: number;
  36408. lifetime?: number;
  36409. particleLife?: number;
  36410. minimumParticleLife?: number;
  36411. maximumParticleLife?: number;
  36412. mass?: number;
  36413. minimumMass?: number;
  36414. maximumMass?: number;
  36415. });
  36416. /**
  36417. * Whether to display the particle system.
  36418. */
  36419. show: boolean;
  36420. /**
  36421. * An array of force callbacks. The callback is passed a {@link Particle} and the difference from the last time
  36422. */
  36423. updateCallback: ParticleSystem.updateCallback;
  36424. /**
  36425. * Whether the particle system should loop it's bursts when it is complete.
  36426. */
  36427. loop: boolean;
  36428. /**
  36429. * The URI, HTMLImageElement, or HTMLCanvasElement to use for the billboard.
  36430. */
  36431. image: any;
  36432. /**
  36433. * The particle emitter for this
  36434. */
  36435. emitter: ParticleEmitter;
  36436. /**
  36437. * An array of {@link ParticleBurst}, emitting bursts of particles at periodic times.
  36438. */
  36439. bursts: ParticleBurst[];
  36440. /**
  36441. * The 4x4 transformation matrix that transforms the particle system from model to world coordinates.
  36442. */
  36443. modelMatrix: Matrix4;
  36444. /**
  36445. * The 4x4 transformation matrix that transforms the particle system emitter within the particle systems local coordinate system.
  36446. */
  36447. emitterModelMatrix: Matrix4;
  36448. /**
  36449. * The color of the particle at the beginning of its life.
  36450. */
  36451. startColor: Color;
  36452. /**
  36453. * The color of the particle at the end of its life.
  36454. */
  36455. endColor: Color;
  36456. /**
  36457. * The initial scale to apply to the image of the particle at the beginning of its life.
  36458. */
  36459. startScale: number;
  36460. /**
  36461. * The final scale to apply to the image of the particle at the end of its life.
  36462. */
  36463. endScale: number;
  36464. /**
  36465. * The number of particles to emit per second.
  36466. */
  36467. emissionRate: number;
  36468. /**
  36469. * Sets the minimum bound in meters per second above which a particle's actual speed will be randomly chosen.
  36470. */
  36471. minimumSpeed: number;
  36472. /**
  36473. * Sets the maximum bound in meters per second below which a particle's actual speed will be randomly chosen.
  36474. */
  36475. maximumSpeed: number;
  36476. /**
  36477. * 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.
  36478. */
  36479. minimumParticleLife: number;
  36480. /**
  36481. * 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.
  36482. */
  36483. maximumParticleLife: number;
  36484. /**
  36485. * Sets the minimum mass of particles in kilograms.
  36486. */
  36487. minimumMass: number;
  36488. /**
  36489. * Sets the maximum mass of particles in kilograms.
  36490. */
  36491. maximumMass: number;
  36492. /**
  36493. * Sets the minimum bound, width by height, above which to randomly scale the particle image's dimensions in pixels.
  36494. */
  36495. minimumImageSize: Cartesian2;
  36496. /**
  36497. * Sets the maximum bound, width by height, below which to randomly scale the particle image's dimensions in pixels.
  36498. */
  36499. maximumImageSize: Cartesian2;
  36500. /**
  36501. * 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.
  36502. */
  36503. sizeInMeters: boolean;
  36504. /**
  36505. * How long the particle system will emit particles, in seconds.
  36506. */
  36507. lifetime: number;
  36508. /**
  36509. * Fires an event when the particle system has reached the end of its lifetime.
  36510. */
  36511. complete: Event;
  36512. /**
  36513. * When <code>true</code>, the particle system has reached the end of its lifetime; <code>false</code> otherwise.
  36514. */
  36515. isComplete: boolean;
  36516. /**
  36517. * Returns true if this object was destroyed; otherwise, false.
  36518. * <br /><br />
  36519. * If this object was destroyed, it should not be used; calling any function other than
  36520. * <code>isDestroyed</code> will result in a {@link DeveloperError} exception.
  36521. * @returns <code>true</code> if this object was destroyed; otherwise, <code>false</code>.
  36522. */
  36523. isDestroyed(): boolean;
  36524. /**
  36525. * Destroys the WebGL resources held by this object. Destroying an object allows for deterministic
  36526. * release of WebGL resources, instead of relying on the garbage collector to destroy this object.
  36527. * <br /><br />
  36528. * Once an object is destroyed, it should not be used; calling any function other than
  36529. * <code>isDestroyed</code> will result in a {@link DeveloperError} exception. Therefore,
  36530. * assign the return value (<code>undefined</code>) to the object as done in the example.
  36531. */
  36532. destroy(): void;
  36533. }
  36534. export namespace ParticleSystem {
  36535. /**
  36536. * A function used to modify attributes of the particle at each time step. This can include force modifications,
  36537. * color, sizing, etc.
  36538. * @example
  36539. * function applyGravity(particle, dt) {
  36540. * const position = particle.position;
  36541. * const gravityVector = Cesium.Cartesian3.normalize(position, new Cesium.Cartesian3());
  36542. * Cesium.Cartesian3.multiplyByScalar(gravityVector, GRAVITATIONAL_CONSTANT * dt, gravityVector);
  36543. * particle.velocity = Cesium.Cartesian3.add(particle.velocity, gravityVector, particle.velocity);
  36544. * }
  36545. * @param particle - The particle being updated.
  36546. * @param dt - The time in seconds since the last update.
  36547. */
  36548. type updateCallback = (particle: Particle, dt: number) => void;
  36549. }
  36550. /**
  36551. * An appearance for {@link GeometryInstance} instances with color attributes.
  36552. * This allows several geometry instances, each with a different color, to
  36553. * be drawn with the same {@link Primitive} as shown in the second example below.
  36554. * @example
  36555. * // A solid white line segment
  36556. * const primitive = new Cesium.Primitive({
  36557. * geometryInstances : new Cesium.GeometryInstance({
  36558. * geometry : new Cesium.SimplePolylineGeometry({
  36559. * positions : Cesium.Cartesian3.fromDegreesArray([
  36560. * 0.0, 0.0,
  36561. * 5.0, 0.0
  36562. * ])
  36563. * }),
  36564. * attributes : {
  36565. * color : Cesium.ColorGeometryInstanceAttribute.fromColor(new Cesium.Color(1.0, 1.0, 1.0, 1.0))
  36566. * }
  36567. * }),
  36568. * appearance : new Cesium.PerInstanceColorAppearance({
  36569. * flat : true,
  36570. * translucent : false
  36571. * })
  36572. * });
  36573. *
  36574. * // Two rectangles in a primitive, each with a different color
  36575. * const instance = new Cesium.GeometryInstance({
  36576. * geometry : new Cesium.RectangleGeometry({
  36577. * rectangle : Cesium.Rectangle.fromDegrees(0.0, 20.0, 10.0, 30.0)
  36578. * }),
  36579. * attributes : {
  36580. * color : new Cesium.ColorGeometryInstanceAttribute(1.0, 0.0, 0.0, 0.5)
  36581. * }
  36582. * });
  36583. *
  36584. * const anotherInstance = new Cesium.GeometryInstance({
  36585. * geometry : new Cesium.RectangleGeometry({
  36586. * rectangle : Cesium.Rectangle.fromDegrees(0.0, 40.0, 10.0, 50.0)
  36587. * }),
  36588. * attributes : {
  36589. * color : new Cesium.ColorGeometryInstanceAttribute(0.0, 0.0, 1.0, 0.5)
  36590. * }
  36591. * });
  36592. *
  36593. * const rectanglePrimitive = new Cesium.Primitive({
  36594. * geometryInstances : [instance, anotherInstance],
  36595. * appearance : new Cesium.PerInstanceColorAppearance()
  36596. * });
  36597. * @param [options] - Object with the following properties:
  36598. * @param [options.flat = false] - When <code>true</code>, flat shading is used in the fragment shader, which means lighting is not taking into account.
  36599. * @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}.
  36600. * @param [options.translucent = true] - When <code>true</code>, the geometry is expected to appear translucent so {@link PerInstanceColorAppearance#renderState} has alpha blending enabled.
  36601. * @param [options.closed = false] - When <code>true</code>, the geometry is expected to be closed so {@link PerInstanceColorAppearance#renderState} has backface culling enabled.
  36602. * @param [options.vertexShaderSource] - Optional GLSL vertex shader source to override the default vertex shader.
  36603. * @param [options.fragmentShaderSource] - Optional GLSL fragment shader source to override the default fragment shader.
  36604. * @param [options.renderState] - Optional render state to override the default render state.
  36605. */
  36606. export class PerInstanceColorAppearance {
  36607. constructor(options?: {
  36608. flat?: boolean;
  36609. faceForward?: boolean;
  36610. translucent?: boolean;
  36611. closed?: boolean;
  36612. vertexShaderSource?: string;
  36613. fragmentShaderSource?: string;
  36614. renderState?: any;
  36615. });
  36616. /**
  36617. * This property is part of the {@link Appearance} interface, but is not
  36618. * used by {@link PerInstanceColorAppearance} since a fully custom fragment shader is used.
  36619. */
  36620. material: Material;
  36621. /**
  36622. * When <code>true</code>, the geometry is expected to appear translucent so
  36623. * {@link PerInstanceColorAppearance#renderState} has alpha blending enabled.
  36624. */
  36625. translucent: boolean;
  36626. /**
  36627. * The GLSL source code for the vertex shader.
  36628. */
  36629. readonly vertexShaderSource: string;
  36630. /**
  36631. * The GLSL source code for the fragment shader.
  36632. */
  36633. readonly fragmentShaderSource: string;
  36634. /**
  36635. * The WebGL fixed-function state to use when rendering the geometry.
  36636. * <p>
  36637. * The render state can be explicitly defined when constructing a {@link PerInstanceColorAppearance}
  36638. * instance, or it is set implicitly via {@link PerInstanceColorAppearance#translucent}
  36639. * and {@link PerInstanceColorAppearance#closed}.
  36640. * </p>
  36641. */
  36642. readonly renderState: any;
  36643. /**
  36644. * When <code>true</code>, the geometry is expected to be closed so
  36645. * {@link PerInstanceColorAppearance#renderState} has backface culling enabled.
  36646. * If the viewer enters the geometry, it will not be visible.
  36647. */
  36648. readonly closed: boolean;
  36649. /**
  36650. * The {@link VertexFormat} that this appearance instance is compatible with.
  36651. * A geometry can have more vertex attributes and still be compatible - at a
  36652. * potential performance cost - but it can't have less.
  36653. */
  36654. readonly vertexFormat: VertexFormat;
  36655. /**
  36656. * When <code>true</code>, flat shading is used in the fragment shader,
  36657. * which means lighting is not taking into account.
  36658. */
  36659. readonly flat: boolean;
  36660. /**
  36661. * When <code>true</code>, the fragment shader flips the surface normal
  36662. * as needed to ensure that the normal faces the viewer to avoid
  36663. * dark spots. This is useful when both sides of a geometry should be
  36664. * shaded like {@link WallGeometry}.
  36665. */
  36666. readonly faceForward: boolean;
  36667. /**
  36668. * The {@link VertexFormat} that all {@link PerInstanceColorAppearance} instances
  36669. * are compatible with. This requires only <code>position</code> and <code>normal</code>
  36670. * attributes.
  36671. */
  36672. static readonly VERTEX_FORMAT: VertexFormat;
  36673. /**
  36674. * The {@link VertexFormat} that all {@link PerInstanceColorAppearance} instances
  36675. * are compatible with when {@link PerInstanceColorAppearance#flat} is <code>true</code>.
  36676. * This requires only a <code>position</code> attribute.
  36677. */
  36678. static readonly FLAT_VERTEX_FORMAT: VertexFormat;
  36679. /**
  36680. * Procedurally creates the full GLSL fragment shader source. For {@link PerInstanceColorAppearance},
  36681. * this is derived from {@link PerInstanceColorAppearance#fragmentShaderSource}, {@link PerInstanceColorAppearance#flat},
  36682. * and {@link PerInstanceColorAppearance#faceForward}.
  36683. * @returns The full GLSL fragment shader source.
  36684. */
  36685. getFragmentShaderSource(): string;
  36686. /**
  36687. * Determines if the geometry is translucent based on {@link PerInstanceColorAppearance#translucent}.
  36688. * @returns <code>true</code> if the appearance is translucent.
  36689. */
  36690. isTranslucent(): boolean;
  36691. /**
  36692. * Creates a render state. This is not the final render state instance; instead,
  36693. * it can contain a subset of render state properties identical to the render state
  36694. * created in the context.
  36695. * @returns The render state.
  36696. */
  36697. getRenderState(): any;
  36698. }
  36699. /**
  36700. * Options for performing point attenuation based on geometric error when rendering
  36701. * point clouds using 3D Tiles.
  36702. * @param [options] - Object with the following properties:
  36703. * @param [options.attenuation = false] - Perform point attenuation based on geometric error.
  36704. * @param [options.geometricErrorScale = 1.0] - Scale to be applied to each tile's geometric error.
  36705. * @param [options.maximumAttenuation] - Maximum attenuation in pixels. Defaults to the Cesium3DTileset's maximumScreenSpaceError.
  36706. * @param [options.baseResolution] - Average base resolution for the dataset in meters. Substitute for Geometric Error when not available.
  36707. * @param [options.eyeDomeLighting = true] - When true, use eye dome lighting when drawing with point attenuation.
  36708. * @param [options.eyeDomeLightingStrength = 1.0] - Increasing this value increases contrast on slopes and edges.
  36709. * @param [options.eyeDomeLightingRadius = 1.0] - Increase the thickness of contours from eye dome lighting.
  36710. * @param [options.backFaceCulling = false] - Determines whether back-facing points are hidden. This option works only if data has normals included.
  36711. * @param [options.normalShading = true] - Determines whether a point cloud that contains normals is shaded by the scene's light source.
  36712. */
  36713. export class PointCloudShading {
  36714. constructor(options?: {
  36715. attenuation?: boolean;
  36716. geometricErrorScale?: number;
  36717. maximumAttenuation?: number;
  36718. baseResolution?: number;
  36719. eyeDomeLighting?: boolean;
  36720. eyeDomeLightingStrength?: number;
  36721. eyeDomeLightingRadius?: number;
  36722. backFaceCulling?: boolean;
  36723. normalShading?: boolean;
  36724. });
  36725. /**
  36726. * Perform point attenuation based on geometric error.
  36727. */
  36728. attenuation: boolean;
  36729. /**
  36730. * Scale to be applied to the geometric error before computing attenuation.
  36731. */
  36732. geometricErrorScale: number;
  36733. /**
  36734. * Maximum point attenuation in pixels. If undefined, the Cesium3DTileset's maximumScreenSpaceError will be used.
  36735. */
  36736. maximumAttenuation: number;
  36737. /**
  36738. * Average base resolution for the dataset in meters.
  36739. * Used in place of geometric error when geometric error is 0.
  36740. * If undefined, an approximation will be computed for each tile that has geometric error of 0.
  36741. */
  36742. baseResolution: number;
  36743. /**
  36744. * Use eye dome lighting when drawing with point attenuation
  36745. * Requires support for EXT_frag_depth, OES_texture_float, and WEBGL_draw_buffers extensions in WebGL 1.0,
  36746. * otherwise eye dome lighting is ignored.
  36747. */
  36748. eyeDomeLighting: boolean;
  36749. /**
  36750. * Eye dome lighting strength (apparent contrast)
  36751. */
  36752. eyeDomeLightingStrength: number;
  36753. /**
  36754. * Thickness of contours from eye dome lighting
  36755. */
  36756. eyeDomeLightingRadius: number;
  36757. /**
  36758. * Determines whether back-facing points are hidden.
  36759. * This option works only if data has normals included.
  36760. */
  36761. backFaceCulling: boolean;
  36762. /**
  36763. * Determines whether a point cloud that contains normals is shaded by the scene's light source.
  36764. */
  36765. normalShading: boolean;
  36766. /**
  36767. * Determines if point cloud shading is supported.
  36768. * @param scene - The scene.
  36769. * @returns <code>true</code> if point cloud shading is supported; otherwise, returns <code>false</code>
  36770. */
  36771. static isSupported(scene: Scene): boolean;
  36772. }
  36773. /**
  36774. * A graphical point positioned in the 3D scene, that is created
  36775. * and rendered using a {@link PointPrimitiveCollection}. A point is created and its initial
  36776. * properties are set by calling {@link PointPrimitiveCollection#add}.
  36777. */
  36778. export class PointPrimitive {
  36779. constructor();
  36780. /**
  36781. * Determines if this point will be shown. Use this to hide or show a point, instead
  36782. * of removing it and re-adding it to the collection.
  36783. */
  36784. show: boolean;
  36785. /**
  36786. * Gets or sets the Cartesian position of this point.
  36787. */
  36788. position: Cartesian3;
  36789. /**
  36790. * Gets or sets near and far scaling properties of a point based on the point's distance from the camera.
  36791. * A point's scale will interpolate between the {@link NearFarScalar#nearValue} and
  36792. * {@link NearFarScalar#farValue} while the camera distance falls within the lower and upper bounds
  36793. * of the specified {@link NearFarScalar#near} and {@link NearFarScalar#far}.
  36794. * Outside of these ranges the point's scale remains clamped to the nearest bound. This scale
  36795. * multiplies the pixelSize and outlineWidth to affect the total size of the point. If undefined,
  36796. * scaleByDistance will be disabled.
  36797. * @example
  36798. * // Example 1.
  36799. * // Set a pointPrimitive's scaleByDistance to scale to 15 when the
  36800. * // camera is 1500 meters from the pointPrimitive and disappear as
  36801. * // the camera distance approaches 8.0e6 meters.
  36802. * p.scaleByDistance = new Cesium.NearFarScalar(1.5e2, 15, 8.0e6, 0.0);
  36803. * @example
  36804. * // Example 2.
  36805. * // disable scaling by distance
  36806. * p.scaleByDistance = undefined;
  36807. */
  36808. scaleByDistance: NearFarScalar;
  36809. /**
  36810. * Gets or sets near and far translucency properties of a point based on the point's distance from the camera.
  36811. * A point's translucency will interpolate between the {@link NearFarScalar#nearValue} and
  36812. * {@link NearFarScalar#farValue} while the camera distance falls within the lower and upper bounds
  36813. * of the specified {@link NearFarScalar#near} and {@link NearFarScalar#far}.
  36814. * Outside of these ranges the point's translucency remains clamped to the nearest bound. If undefined,
  36815. * translucencyByDistance will be disabled.
  36816. * @example
  36817. * // Example 1.
  36818. * // Set a point's translucency to 1.0 when the
  36819. * // camera is 1500 meters from the point and disappear as
  36820. * // the camera distance approaches 8.0e6 meters.
  36821. * p.translucencyByDistance = new Cesium.NearFarScalar(1.5e2, 1.0, 8.0e6, 0.0);
  36822. * @example
  36823. * // Example 2.
  36824. * // disable translucency by distance
  36825. * p.translucencyByDistance = undefined;
  36826. */
  36827. translucencyByDistance: NearFarScalar;
  36828. /**
  36829. * Gets or sets the inner size of the point in pixels.
  36830. */
  36831. pixelSize: number;
  36832. /**
  36833. * Gets or sets the inner color of the point.
  36834. * The red, green, blue, and alpha values are indicated by <code>value</code>'s <code>red</code>, <code>green</code>,
  36835. * <code>blue</code>, and <code>alpha</code> properties as shown in Example 1. These components range from <code>0.0</code>
  36836. * (no intensity) to <code>1.0</code> (full intensity).
  36837. * @example
  36838. * // Example 1. Assign yellow.
  36839. * p.color = Cesium.Color.YELLOW;
  36840. * @example
  36841. * // Example 2. Make a pointPrimitive 50% translucent.
  36842. * p.color = new Cesium.Color(1.0, 1.0, 1.0, 0.5);
  36843. */
  36844. color: Color;
  36845. /**
  36846. * Gets or sets the outline color of the point.
  36847. */
  36848. outlineColor: Color;
  36849. /**
  36850. * Gets or sets the outline width in pixels. This width adds to pixelSize,
  36851. * increasing the total size of the point.
  36852. */
  36853. outlineWidth: number;
  36854. /**
  36855. * Gets or sets the condition specifying at what distance from the camera that this point will be displayed.
  36856. */
  36857. distanceDisplayCondition: DistanceDisplayCondition;
  36858. /**
  36859. * Gets or sets the distance from the camera at which to disable the depth test to, for example, prevent clipping against terrain.
  36860. * When set to zero, the depth test is always applied. When set to Number.POSITIVE_INFINITY, the depth test is never applied.
  36861. */
  36862. disableDepthTestDistance: number;
  36863. /**
  36864. * Gets or sets the user-defined value returned when the point is picked.
  36865. */
  36866. id: any;
  36867. /**
  36868. * Computes the screen-space position of the point's origin.
  36869. * The screen space origin is the top, left corner of the canvas; <code>x</code> increases from
  36870. * left to right, and <code>y</code> increases from top to bottom.
  36871. * @example
  36872. * console.log(p.computeScreenSpacePosition(scene).toString());
  36873. * @param scene - The scene.
  36874. * @param [result] - The object onto which to store the result.
  36875. * @returns The screen-space position of the point.
  36876. */
  36877. computeScreenSpacePosition(scene: Scene, result?: Cartesian2): Cartesian2;
  36878. /**
  36879. * Determines if this point equals another point. Points are equal if all their properties
  36880. * are equal. Points in different collections can be equal.
  36881. * @param other - The point to compare for equality.
  36882. * @returns <code>true</code> if the points are equal; otherwise, <code>false</code>.
  36883. */
  36884. equals(other: PointPrimitive): boolean;
  36885. }
  36886. /**
  36887. * A renderable collection of points.
  36888. * <br /><br />
  36889. * Points are added and removed from the collection using {@link PointPrimitiveCollection#add}
  36890. * and {@link PointPrimitiveCollection#remove}.
  36891. * @example
  36892. * // Create a pointPrimitive collection with two points
  36893. * const points = scene.primitives.add(new Cesium.PointPrimitiveCollection());
  36894. * points.add({
  36895. * position : new Cesium.Cartesian3(1.0, 2.0, 3.0),
  36896. * color : Cesium.Color.YELLOW
  36897. * });
  36898. * points.add({
  36899. * position : new Cesium.Cartesian3(4.0, 5.0, 6.0),
  36900. * color : Cesium.Color.CYAN
  36901. * });
  36902. * @param [options] - Object with the following properties:
  36903. * @param [options.modelMatrix = Matrix4.IDENTITY] - The 4x4 transformation matrix that transforms each point from model to world coordinates.
  36904. * @param [options.debugShowBoundingVolume = false] - For debugging only. Determines if this primitive's commands' bounding spheres are shown.
  36905. * @param [options.blendOption = BlendOption.OPAQUE_AND_TRANSLUCENT] - The point blending option. The default
  36906. * is used for rendering both opaque and translucent points. However, if either all of the points are completely opaque or all are completely translucent,
  36907. * setting the technique to BlendOption.OPAQUE or BlendOption.TRANSLUCENT can improve performance by up to 2x.
  36908. * @param [options.show = true] - Determines if the primitives in the collection will be shown.
  36909. */
  36910. export class PointPrimitiveCollection {
  36911. constructor(options?: {
  36912. modelMatrix?: Matrix4;
  36913. debugShowBoundingVolume?: boolean;
  36914. blendOption?: BlendOption;
  36915. show?: boolean;
  36916. });
  36917. /**
  36918. * Determines if primitives in this collection will be shown.
  36919. */
  36920. show: boolean;
  36921. /**
  36922. * The 4x4 transformation matrix that transforms each point in this collection from model to world coordinates.
  36923. * When this is the identity matrix, the pointPrimitives are drawn in world coordinates, i.e., Earth's WGS84 coordinates.
  36924. * Local reference frames can be used by providing a different transformation matrix, like that returned
  36925. * by {@link Transforms.eastNorthUpToFixedFrame}.
  36926. * @example
  36927. * const center = Cesium.Cartesian3.fromDegrees(-75.59777, 40.03883);
  36928. * pointPrimitives.modelMatrix = Cesium.Transforms.eastNorthUpToFixedFrame(center);
  36929. * pointPrimitives.add({
  36930. * color : Cesium.Color.ORANGE,
  36931. * position : new Cesium.Cartesian3(0.0, 0.0, 0.0) // center
  36932. * });
  36933. * pointPrimitives.add({
  36934. * color : Cesium.Color.YELLOW,
  36935. * position : new Cesium.Cartesian3(1000000.0, 0.0, 0.0) // east
  36936. * });
  36937. * pointPrimitives.add({
  36938. * color : Cesium.Color.GREEN,
  36939. * position : new Cesium.Cartesian3(0.0, 1000000.0, 0.0) // north
  36940. * });
  36941. * pointPrimitives.add({
  36942. * color : Cesium.Color.CYAN,
  36943. * position : new Cesium.Cartesian3(0.0, 0.0, 1000000.0) // up
  36944. * });
  36945. */
  36946. modelMatrix: Matrix4;
  36947. /**
  36948. * This property is for debugging only; it is not for production use nor is it optimized.
  36949. * <p>
  36950. * Draws the bounding sphere for each draw command in the primitive.
  36951. * </p>
  36952. */
  36953. debugShowBoundingVolume: boolean;
  36954. /**
  36955. * The point blending option. The default is used for rendering both opaque and translucent points.
  36956. * However, if either all of the points are completely opaque or all are completely translucent,
  36957. * setting the technique to BlendOption.OPAQUE or BlendOption.TRANSLUCENT can improve
  36958. * performance by up to 2x.
  36959. */
  36960. blendOption: BlendOption;
  36961. /**
  36962. * Returns the number of points in this collection. This is commonly used with
  36963. * {@link PointPrimitiveCollection#get} to iterate over all the points
  36964. * in the collection.
  36965. */
  36966. length: number;
  36967. /**
  36968. * Creates and adds a point with the specified initial properties to the collection.
  36969. * The added point is returned so it can be modified or removed from the collection later.
  36970. * @example
  36971. * // Example 1: Add a point, specifying all the default values.
  36972. * const p = pointPrimitives.add({
  36973. * show : true,
  36974. * position : Cesium.Cartesian3.ZERO,
  36975. * pixelSize : 10.0,
  36976. * color : Cesium.Color.WHITE,
  36977. * outlineColor : Cesium.Color.TRANSPARENT,
  36978. * outlineWidth : 0.0,
  36979. * id : undefined
  36980. * });
  36981. * @example
  36982. * // Example 2: Specify only the point's cartographic position.
  36983. * const p = pointPrimitives.add({
  36984. * position : Cesium.Cartesian3.fromDegrees(longitude, latitude, height)
  36985. * });
  36986. * @param [options] - A template describing the point's properties as shown in Example 1.
  36987. * @returns The point that was added to the collection.
  36988. */
  36989. add(options?: any): PointPrimitive;
  36990. /**
  36991. * Removes a point from the collection.
  36992. * @example
  36993. * const p = pointPrimitives.add(...);
  36994. * pointPrimitives.remove(p); // Returns true
  36995. * @param pointPrimitive - The point to remove.
  36996. * @returns <code>true</code> if the point was removed; <code>false</code> if the point was not found in the collection.
  36997. */
  36998. remove(pointPrimitive: PointPrimitive): boolean;
  36999. /**
  37000. * Removes all points from the collection.
  37001. * @example
  37002. * pointPrimitives.add(...);
  37003. * pointPrimitives.add(...);
  37004. * pointPrimitives.removeAll();
  37005. */
  37006. removeAll(): void;
  37007. /**
  37008. * Check whether this collection contains a given point.
  37009. * @param [pointPrimitive] - The point to check for.
  37010. * @returns true if this collection contains the point, false otherwise.
  37011. */
  37012. contains(pointPrimitive?: PointPrimitive): boolean;
  37013. /**
  37014. * Returns the point in the collection at the specified index. Indices are zero-based
  37015. * and increase as points are added. Removing a point shifts all points after
  37016. * it to the left, changing their indices. This function is commonly used with
  37017. * {@link PointPrimitiveCollection#length} to iterate over all the points
  37018. * in the collection.
  37019. * @example
  37020. * // Toggle the show property of every point in the collection
  37021. * const len = pointPrimitives.length;
  37022. * for (let i = 0; i < len; ++i) {
  37023. * const p = pointPrimitives.get(i);
  37024. * p.show = !p.show;
  37025. * }
  37026. * @param index - The zero-based index of the point.
  37027. * @returns The point at the specified index.
  37028. */
  37029. get(index: number): PointPrimitive;
  37030. /**
  37031. * Returns true if this object was destroyed; otherwise, false.
  37032. * <br /><br />
  37033. * If this object was destroyed, it should not be used; calling any function other than
  37034. * <code>isDestroyed</code> will result in a {@link DeveloperError} exception.
  37035. * @returns <code>true</code> if this object was destroyed; otherwise, <code>false</code>.
  37036. */
  37037. isDestroyed(): boolean;
  37038. /**
  37039. * Destroys the WebGL resources held by this object. Destroying an object allows for deterministic
  37040. * release of WebGL resources, instead of relying on the garbage collector to destroy this object.
  37041. * <br /><br />
  37042. * Once an object is destroyed, it should not be used; calling any function other than
  37043. * <code>isDestroyed</code> will result in a {@link DeveloperError} exception. Therefore,
  37044. * assign the return value (<code>undefined</code>) to the object as done in the example.
  37045. * @example
  37046. * pointPrimitives = pointPrimitives && pointPrimitives.destroy();
  37047. */
  37048. destroy(): void;
  37049. }
  37050. /**
  37051. * A renderable polyline. Create this by calling {@link PolylineCollection#add}
  37052. * @param options - Object with the following properties:
  37053. * @param [options.show = true] - <code>true</code> if this polyline will be shown; otherwise, <code>false</code>.
  37054. * @param [options.width = 1.0] - The width of the polyline in pixels.
  37055. * @param [options.loop = false] - Whether a line segment will be added between the last and first line positions to make this line a loop.
  37056. * @param [options.material = Material.ColorType] - The material.
  37057. * @param [options.positions] - The positions.
  37058. * @param [options.id] - The user-defined object to be returned when this polyline is picked.
  37059. * @param [options.distanceDisplayCondition] - The condition specifying at what distance from the camera that this polyline will be displayed.
  37060. * @param polylineCollection - The renderable polyline collection.
  37061. */
  37062. export class Polyline {
  37063. constructor(options: {
  37064. show?: boolean;
  37065. width?: number;
  37066. loop?: boolean;
  37067. material?: Material;
  37068. positions?: Cartesian3[];
  37069. id?: any;
  37070. distanceDisplayCondition?: DistanceDisplayCondition;
  37071. }, polylineCollection: PolylineCollection);
  37072. /**
  37073. * Determines if this polyline will be shown. Use this to hide or show a polyline, instead
  37074. * of removing it and re-adding it to the collection.
  37075. */
  37076. show: boolean;
  37077. /**
  37078. * Gets or sets the positions of the polyline.
  37079. * @example
  37080. * polyline.positions = Cesium.Cartesian3.fromDegreesArray([
  37081. * 0.0, 0.0,
  37082. * 10.0, 0.0,
  37083. * 0.0, 20.0
  37084. * ]);
  37085. */
  37086. positions: Cartesian3[];
  37087. /**
  37088. * 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
  37089. * {@link https://github.com/CesiumGS/cesium/wiki/Fabric|Fabric}.
  37090. */
  37091. material: Material;
  37092. /**
  37093. * Gets or sets the width of the polyline.
  37094. */
  37095. width: number;
  37096. /**
  37097. * Gets or sets whether a line segment will be added between the first and last polyline positions.
  37098. */
  37099. loop: boolean;
  37100. /**
  37101. * Gets or sets the user-defined value returned when the polyline is picked.
  37102. */
  37103. id: any;
  37104. /**
  37105. * Gets or sets the condition specifying at what distance from the camera that this polyline will be displayed.
  37106. */
  37107. distanceDisplayCondition: DistanceDisplayCondition;
  37108. }
  37109. /**
  37110. * A renderable collection of polylines.
  37111. * <br /><br />
  37112. * <div align="center">
  37113. * <img src="Images/Polyline.png" width="400" height="300" /><br />
  37114. * Example polylines
  37115. * </div>
  37116. * <br /><br />
  37117. * Polylines are added and removed from the collection using {@link PolylineCollection#add}
  37118. * and {@link PolylineCollection#remove}.
  37119. * @example
  37120. * // Create a polyline collection with two polylines
  37121. * const polylines = new Cesium.PolylineCollection();
  37122. * polylines.add({
  37123. * positions : Cesium.Cartesian3.fromDegreesArray([
  37124. * -75.10, 39.57,
  37125. * -77.02, 38.53,
  37126. * -80.50, 35.14,
  37127. * -80.12, 25.46]),
  37128. * width : 2
  37129. * });
  37130. *
  37131. * polylines.add({
  37132. * positions : Cesium.Cartesian3.fromDegreesArray([
  37133. * -73.10, 37.57,
  37134. * -75.02, 36.53,
  37135. * -78.50, 33.14,
  37136. * -78.12, 23.46]),
  37137. * width : 4
  37138. * });
  37139. * @param [options] - Object with the following properties:
  37140. * @param [options.modelMatrix = Matrix4.IDENTITY] - The 4x4 transformation matrix that transforms each polyline from model to world coordinates.
  37141. * @param [options.debugShowBoundingVolume = false] - For debugging only. Determines if this primitive's commands' bounding spheres are shown.
  37142. * @param [options.show = true] - Determines if the polylines in the collection will be shown.
  37143. */
  37144. export class PolylineCollection {
  37145. constructor(options?: {
  37146. modelMatrix?: Matrix4;
  37147. debugShowBoundingVolume?: boolean;
  37148. show?: boolean;
  37149. });
  37150. /**
  37151. * Determines if polylines in this collection will be shown.
  37152. */
  37153. show: boolean;
  37154. /**
  37155. * The 4x4 transformation matrix that transforms each polyline in this collection from model to world coordinates.
  37156. * When this is the identity matrix, the polylines are drawn in world coordinates, i.e., Earth's WGS84 coordinates.
  37157. * Local reference frames can be used by providing a different transformation matrix, like that returned
  37158. * by {@link Transforms.eastNorthUpToFixedFrame}.
  37159. */
  37160. modelMatrix: Matrix4;
  37161. /**
  37162. * This property is for debugging only; it is not for production use nor is it optimized.
  37163. * <p>
  37164. * Draws the bounding sphere for each draw command in the primitive.
  37165. * </p>
  37166. */
  37167. debugShowBoundingVolume: boolean;
  37168. /**
  37169. * Returns the number of polylines in this collection. This is commonly used with
  37170. * {@link PolylineCollection#get} to iterate over all the polylines
  37171. * in the collection.
  37172. */
  37173. length: number;
  37174. /**
  37175. * Creates and adds a polyline with the specified initial properties to the collection.
  37176. * The added polyline is returned so it can be modified or removed from the collection later.
  37177. * @example
  37178. * // Example 1: Add a polyline, specifying all the default values.
  37179. * const p = polylines.add({
  37180. * show : true,
  37181. * positions : ellipsoid.cartographicArrayToCartesianArray([
  37182. * Cesium.Cartographic.fromDegrees(-75.10, 39.57),
  37183. * Cesium.Cartographic.fromDegrees(-77.02, 38.53)]),
  37184. * width : 1
  37185. * });
  37186. * @param [options] - A template describing the polyline's properties as shown in Example 1.
  37187. * @returns The polyline that was added to the collection.
  37188. */
  37189. add(options?: any): Polyline;
  37190. /**
  37191. * Removes a polyline from the collection.
  37192. * @example
  37193. * const p = polylines.add(...);
  37194. * polylines.remove(p); // Returns true
  37195. * @param polyline - The polyline to remove.
  37196. * @returns <code>true</code> if the polyline was removed; <code>false</code> if the polyline was not found in the collection.
  37197. */
  37198. remove(polyline: Polyline): boolean;
  37199. /**
  37200. * Removes all polylines from the collection.
  37201. * @example
  37202. * polylines.add(...);
  37203. * polylines.add(...);
  37204. * polylines.removeAll();
  37205. */
  37206. removeAll(): void;
  37207. /**
  37208. * Determines if this collection contains the specified polyline.
  37209. * @param polyline - The polyline to check for.
  37210. * @returns true if this collection contains the polyline, false otherwise.
  37211. */
  37212. contains(polyline: Polyline): boolean;
  37213. /**
  37214. * Returns the polyline in the collection at the specified index. Indices are zero-based
  37215. * and increase as polylines are added. Removing a polyline shifts all polylines after
  37216. * it to the left, changing their indices. This function is commonly used with
  37217. * {@link PolylineCollection#length} to iterate over all the polylines
  37218. * in the collection.
  37219. * @example
  37220. * // Toggle the show property of every polyline in the collection
  37221. * const len = polylines.length;
  37222. * for (let i = 0; i < len; ++i) {
  37223. * const p = polylines.get(i);
  37224. * p.show = !p.show;
  37225. * }
  37226. * @param index - The zero-based index of the polyline.
  37227. * @returns The polyline at the specified index.
  37228. */
  37229. get(index: number): Polyline;
  37230. /**
  37231. * Called when {@link Viewer} or {@link CesiumWidget} render the scene to
  37232. * get the draw commands needed to render this primitive.
  37233. * <p>
  37234. * Do not call this function directly. This is documented just to
  37235. * list the exceptions that may be propagated when the scene is rendered:
  37236. * </p>
  37237. */
  37238. update(): void;
  37239. /**
  37240. * Returns true if this object was destroyed; otherwise, false.
  37241. * <br /><br />
  37242. * If this object was destroyed, it should not be used; calling any function other than
  37243. * <code>isDestroyed</code> will result in a {@link DeveloperError} exception.
  37244. * @returns <code>true</code> if this object was destroyed; otherwise, <code>false</code>.
  37245. */
  37246. isDestroyed(): boolean;
  37247. /**
  37248. * Destroys the WebGL resources held by this object. Destroying an object allows for deterministic
  37249. * release of WebGL resources, instead of relying on the garbage collector to destroy this object.
  37250. * <br /><br />
  37251. * Once an object is destroyed, it should not be used; calling any function other than
  37252. * <code>isDestroyed</code> will result in a {@link DeveloperError} exception. Therefore,
  37253. * assign the return value (<code>undefined</code>) to the object as done in the example.
  37254. * @example
  37255. * polylines = polylines && polylines.destroy();
  37256. */
  37257. destroy(): void;
  37258. }
  37259. /**
  37260. * An appearance for {@link GeometryInstance} instances with color attributes and
  37261. * {@link PolylineGeometry} or {@link GroundPolylineGeometry}.
  37262. * This allows several geometry instances, each with a different color, to
  37263. * be drawn with the same {@link Primitive}.
  37264. * @example
  37265. * // A solid white line segment
  37266. * const primitive = new Cesium.Primitive({
  37267. * geometryInstances : new Cesium.GeometryInstance({
  37268. * geometry : new Cesium.PolylineGeometry({
  37269. * positions : Cesium.Cartesian3.fromDegreesArray([
  37270. * 0.0, 0.0,
  37271. * 5.0, 0.0
  37272. * ]),
  37273. * width : 10.0,
  37274. * vertexFormat : Cesium.PolylineColorAppearance.VERTEX_FORMAT
  37275. * }),
  37276. * attributes : {
  37277. * color : Cesium.ColorGeometryInstanceAttribute.fromColor(new Cesium.Color(1.0, 1.0, 1.0, 1.0))
  37278. * }
  37279. * }),
  37280. * appearance : new Cesium.PolylineColorAppearance({
  37281. * translucent : false
  37282. * })
  37283. * });
  37284. * @param [options] - Object with the following properties:
  37285. * @param [options.translucent = true] - When <code>true</code>, the geometry is expected to appear translucent so {@link PolylineColorAppearance#renderState} has alpha blending enabled.
  37286. * @param [options.vertexShaderSource] - Optional GLSL vertex shader source to override the default vertex shader.
  37287. * @param [options.fragmentShaderSource] - Optional GLSL fragment shader source to override the default fragment shader.
  37288. * @param [options.renderState] - Optional render state to override the default render state.
  37289. */
  37290. export class PolylineColorAppearance {
  37291. constructor(options?: {
  37292. translucent?: boolean;
  37293. vertexShaderSource?: string;
  37294. fragmentShaderSource?: string;
  37295. renderState?: any;
  37296. });
  37297. /**
  37298. * This property is part of the {@link Appearance} interface, but is not
  37299. * used by {@link PolylineColorAppearance} since a fully custom fragment shader is used.
  37300. */
  37301. material: Material;
  37302. /**
  37303. * When <code>true</code>, the geometry is expected to appear translucent so
  37304. * {@link PolylineColorAppearance#renderState} has alpha blending enabled.
  37305. */
  37306. translucent: boolean;
  37307. /**
  37308. * The GLSL source code for the vertex shader.
  37309. */
  37310. readonly vertexShaderSource: string;
  37311. /**
  37312. * The GLSL source code for the fragment shader.
  37313. */
  37314. readonly fragmentShaderSource: string;
  37315. /**
  37316. * The WebGL fixed-function state to use when rendering the geometry.
  37317. * <p>
  37318. * The render state can be explicitly defined when constructing a {@link PolylineColorAppearance}
  37319. * instance, or it is set implicitly via {@link PolylineColorAppearance#translucent}.
  37320. * </p>
  37321. */
  37322. readonly renderState: any;
  37323. /**
  37324. * When <code>true</code>, the geometry is expected to be closed so
  37325. * {@link PolylineColorAppearance#renderState} has backface culling enabled.
  37326. * This is always <code>false</code> for <code>PolylineColorAppearance</code>.
  37327. */
  37328. readonly closed: boolean;
  37329. /**
  37330. * The {@link VertexFormat} that this appearance instance is compatible with.
  37331. * A geometry can have more vertex attributes and still be compatible - at a
  37332. * potential performance cost - but it can't have less.
  37333. */
  37334. readonly vertexFormat: VertexFormat;
  37335. /**
  37336. * The {@link VertexFormat} that all {@link PolylineColorAppearance} instances
  37337. * are compatible with. This requires only a <code>position</code> attribute.
  37338. */
  37339. static readonly VERTEX_FORMAT: VertexFormat;
  37340. /**
  37341. * Procedurally creates the full GLSL fragment shader source.
  37342. * @returns The full GLSL fragment shader source.
  37343. */
  37344. getFragmentShaderSource(): string;
  37345. /**
  37346. * Determines if the geometry is translucent based on {@link PolylineColorAppearance#translucent}.
  37347. * @returns <code>true</code> if the appearance is translucent.
  37348. */
  37349. isTranslucent(): boolean;
  37350. /**
  37351. * Creates a render state. This is not the final render state instance; instead,
  37352. * it can contain a subset of render state properties identical to the render state
  37353. * created in the context.
  37354. * @returns The render state.
  37355. */
  37356. getRenderState(): any;
  37357. }
  37358. /**
  37359. * An appearance for {@link PolylineGeometry} that supports shading with materials.
  37360. * @example
  37361. * const primitive = new Cesium.Primitive({
  37362. * geometryInstances : new Cesium.GeometryInstance({
  37363. * geometry : new Cesium.PolylineGeometry({
  37364. * positions : Cesium.Cartesian3.fromDegreesArray([
  37365. * 0.0, 0.0,
  37366. * 5.0, 0.0
  37367. * ]),
  37368. * width : 10.0,
  37369. * vertexFormat : Cesium.PolylineMaterialAppearance.VERTEX_FORMAT
  37370. * })
  37371. * }),
  37372. * appearance : new Cesium.PolylineMaterialAppearance({
  37373. * material : Cesium.Material.fromType('Color')
  37374. * })
  37375. * });
  37376. * @param [options] - Object with the following properties:
  37377. * @param [options.translucent = true] - When <code>true</code>, the geometry is expected to appear translucent so {@link PolylineMaterialAppearance#renderState} has alpha blending enabled.
  37378. * @param [options.material = Material.ColorType] - The material used to determine the fragment color.
  37379. * @param [options.vertexShaderSource] - Optional GLSL vertex shader source to override the default vertex shader.
  37380. * @param [options.fragmentShaderSource] - Optional GLSL fragment shader source to override the default fragment shader.
  37381. * @param [options.renderState] - Optional render state to override the default render state.
  37382. */
  37383. export class PolylineMaterialAppearance {
  37384. constructor(options?: {
  37385. translucent?: boolean;
  37386. material?: Material;
  37387. vertexShaderSource?: string;
  37388. fragmentShaderSource?: string;
  37389. renderState?: any;
  37390. });
  37391. /**
  37392. * The material used to determine the fragment color. Unlike other {@link PolylineMaterialAppearance}
  37393. * properties, this is not read-only, so an appearance's material can change on the fly.
  37394. */
  37395. material: Material;
  37396. /**
  37397. * When <code>true</code>, the geometry is expected to appear translucent so
  37398. * {@link PolylineMaterialAppearance#renderState} has alpha blending enabled.
  37399. */
  37400. translucent: boolean;
  37401. /**
  37402. * The GLSL source code for the vertex shader.
  37403. */
  37404. readonly vertexShaderSource: string;
  37405. /**
  37406. * The GLSL source code for the fragment shader.
  37407. */
  37408. readonly fragmentShaderSource: string;
  37409. /**
  37410. * The WebGL fixed-function state to use when rendering the geometry.
  37411. * <p>
  37412. * The render state can be explicitly defined when constructing a {@link PolylineMaterialAppearance}
  37413. * instance, or it is set implicitly via {@link PolylineMaterialAppearance#translucent}
  37414. * and {@link PolylineMaterialAppearance#closed}.
  37415. * </p>
  37416. */
  37417. readonly renderState: any;
  37418. /**
  37419. * When <code>true</code>, the geometry is expected to be closed so
  37420. * {@link PolylineMaterialAppearance#renderState} has backface culling enabled.
  37421. * This is always <code>false</code> for <code>PolylineMaterialAppearance</code>.
  37422. */
  37423. readonly closed: boolean;
  37424. /**
  37425. * The {@link VertexFormat} that this appearance instance is compatible with.
  37426. * A geometry can have more vertex attributes and still be compatible - at a
  37427. * potential performance cost - but it can't have less.
  37428. */
  37429. readonly vertexFormat: VertexFormat;
  37430. /**
  37431. * The {@link VertexFormat} that all {@link PolylineMaterialAppearance} instances
  37432. * are compatible with. This requires <code>position</code> and <code>st</code> attributes.
  37433. */
  37434. static readonly VERTEX_FORMAT: VertexFormat;
  37435. /**
  37436. * Procedurally creates the full GLSL fragment shader source. For {@link PolylineMaterialAppearance},
  37437. * this is derived from {@link PolylineMaterialAppearance#fragmentShaderSource} and {@link PolylineMaterialAppearance#material}.
  37438. * @returns The full GLSL fragment shader source.
  37439. */
  37440. getFragmentShaderSource(): string;
  37441. /**
  37442. * Determines if the geometry is translucent based on {@link PolylineMaterialAppearance#translucent} and {@link Material#isTranslucent}.
  37443. * @returns <code>true</code> if the appearance is translucent.
  37444. */
  37445. isTranslucent(): boolean;
  37446. /**
  37447. * Creates a render state. This is not the final render state instance; instead,
  37448. * it can contain a subset of render state properties identical to the render state
  37449. * created in the context.
  37450. * @returns The render state.
  37451. */
  37452. getRenderState(): any;
  37453. }
  37454. /**
  37455. * Runs a post-process stage on either the texture rendered by the scene or the output of a previous post-process stage.
  37456. * @example
  37457. * // Simple stage to change the color
  37458. * const fs =
  37459. * 'uniform sampler2D colorTexture;\n' +
  37460. * 'varying vec2 v_textureCoordinates;\n' +
  37461. * 'uniform float scale;\n' +
  37462. * 'uniform vec3 offset;\n' +
  37463. * 'void main() {\n' +
  37464. * ' vec4 color = texture2D(colorTexture, v_textureCoordinates);\n' +
  37465. * ' gl_FragColor = vec4(color.rgb * scale + offset, 1.0);\n' +
  37466. * '}\n';
  37467. * scene.postProcessStages.add(new Cesium.PostProcessStage({
  37468. * fragmentShader : fs,
  37469. * uniforms : {
  37470. * scale : 1.1,
  37471. * offset : function() {
  37472. * return new Cesium.Cartesian3(0.1, 0.2, 0.3);
  37473. * }
  37474. * }
  37475. * }));
  37476. * @example
  37477. * // Simple stage to change the color of what is selected.
  37478. * // If czm_selected returns true, the current fragment belongs to geometry in the selected array.
  37479. * const fs =
  37480. * 'uniform sampler2D colorTexture;\n' +
  37481. * 'varying vec2 v_textureCoordinates;\n' +
  37482. * 'uniform vec4 highlight;\n' +
  37483. * 'void main() {\n' +
  37484. * ' vec4 color = texture2D(colorTexture, v_textureCoordinates);\n' +
  37485. * ' if (czm_selected()) {\n' +
  37486. * ' vec3 highlighted = highlight.a * highlight.rgb + (1.0 - highlight.a) * color.rgb;\n' +
  37487. * ' gl_FragColor = vec4(highlighted, 1.0);\n' +
  37488. * ' } else { \n' +
  37489. * ' gl_FragColor = color;\n' +
  37490. * ' }\n' +
  37491. * '}\n';
  37492. * const stage = scene.postProcessStages.add(new Cesium.PostProcessStage({
  37493. * fragmentShader : fs,
  37494. * uniforms : {
  37495. * highlight : function() {
  37496. * return new Cesium.Color(1.0, 0.0, 0.0, 0.5);
  37497. * }
  37498. * }
  37499. * }));
  37500. * stage.selected = [cesium3DTileFeature];
  37501. * @param options - An object with the following properties:
  37502. * @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.
  37503. * @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.
  37504. * @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.
  37505. * @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.
  37506. * @param [options.sampleMode = PostProcessStageSampleMode.NEAREST] - How to sample the input color texture.
  37507. * @param [options.pixelFormat = PixelFormat.RGBA] - The color pixel format of the output texture.
  37508. * @param [options.pixelDatatype = PixelDatatype.UNSIGNED_BYTE] - The pixel data type of the output texture.
  37509. * @param [options.clearColor = Color.BLACK] - The color to clear the output texture to.
  37510. * @param [options.scissorRectangle] - The rectangle to use for the scissor test.
  37511. * @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.
  37512. */
  37513. export class PostProcessStage {
  37514. constructor(options: {
  37515. fragmentShader: string;
  37516. uniforms?: any;
  37517. textureScale?: number;
  37518. forcePowerOfTwo?: boolean;
  37519. sampleMode?: PostProcessStageSampleMode;
  37520. pixelFormat?: PixelFormat;
  37521. pixelDatatype?: PixelDatatype;
  37522. clearColor?: Color;
  37523. scissorRectangle?: BoundingRectangle;
  37524. name?: string;
  37525. });
  37526. /**
  37527. * Whether or not to execute this post-process stage when ready.
  37528. */
  37529. enabled: boolean;
  37530. /**
  37531. * Determines if this post-process stage is ready to be executed. A stage is only executed when both <code>ready</code>
  37532. * and {@link PostProcessStage#enabled} are <code>true</code>. A stage will not be ready while it is waiting on textures
  37533. * to load.
  37534. */
  37535. readonly ready: boolean;
  37536. /**
  37537. * The unique name of this post-process stage for reference by other stages in a {@link PostProcessStageComposite}.
  37538. */
  37539. readonly name: string;
  37540. /**
  37541. * The fragment shader to use when execute this post-process stage.
  37542. * <p>
  37543. * The shader must contain a sampler uniform declaration for <code>colorTexture</code>, <code>depthTexture</code>,
  37544. * or both.
  37545. * </p>
  37546. * <p>
  37547. * The shader must contain a <code>vec2</code> varying declaration for <code>v_textureCoordinates</code> for sampling
  37548. * the texture uniforms.
  37549. * </p>
  37550. */
  37551. readonly fragmentShader: string;
  37552. /**
  37553. * An object whose properties are used to set the uniforms of the fragment shader.
  37554. * <p>
  37555. * The object property values can be either a constant or a function. The function will be called
  37556. * each frame before the post-process stage is executed.
  37557. * </p>
  37558. * <p>
  37559. * 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.
  37560. * </p>
  37561. * <p>
  37562. * If this post-process stage is part of a {@link PostProcessStageComposite} that does not execute in series, the constant value can also be
  37563. * the name of another stage in a composite. This will set the uniform to the output texture the stage with that name.
  37564. * </p>
  37565. */
  37566. readonly uniforms: any;
  37567. /**
  37568. * 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.
  37569. */
  37570. readonly textureScale: number;
  37571. /**
  37572. * 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.
  37573. */
  37574. readonly forcePowerOfTwo: number;
  37575. /**
  37576. * How to sample the input color texture.
  37577. */
  37578. readonly sampleMode: PostProcessStageSampleMode;
  37579. /**
  37580. * The color pixel format of the output texture.
  37581. */
  37582. readonly pixelFormat: PixelFormat;
  37583. /**
  37584. * The pixel data type of the output texture.
  37585. */
  37586. readonly pixelDatatype: PixelDatatype;
  37587. /**
  37588. * The color to clear the output texture to.
  37589. */
  37590. readonly clearColor: Color;
  37591. /**
  37592. * The {@link BoundingRectangle} to use for the scissor test. A default bounding rectangle will disable the scissor test.
  37593. */
  37594. readonly scissorRectangle: BoundingRectangle;
  37595. /**
  37596. * The features selected for applying the post-process.
  37597. * <p>
  37598. * In the fragment shader, use <code>czm_selected</code> to determine whether or not to apply the post-process
  37599. * stage to that fragment. For example:
  37600. * <code>
  37601. * if (czm_selected(v_textureCoordinates)) {
  37602. * // apply post-process stage
  37603. * } else {
  37604. * gl_FragColor = texture2D(colorTexture, v_textureCordinates);
  37605. * }
  37606. * </code>
  37607. * </p>
  37608. */
  37609. selected: any[];
  37610. /**
  37611. * Returns true if this object was destroyed; otherwise, false.
  37612. * <p>
  37613. * If this object was destroyed, it should not be used; calling any function other than
  37614. * <code>isDestroyed</code> will result in a {@link DeveloperError} exception.
  37615. * </p>
  37616. * @returns <code>true</code> if this object was destroyed; otherwise, <code>false</code>.
  37617. */
  37618. isDestroyed(): boolean;
  37619. /**
  37620. * Destroys the WebGL resources held by this object. Destroying an object allows for deterministic
  37621. * release of WebGL resources, instead of relying on the garbage collector to destroy this object.
  37622. * <p>
  37623. * Once an object is destroyed, it should not be used; calling any function other than
  37624. * <code>isDestroyed</code> will result in a {@link DeveloperError} exception. Therefore,
  37625. * assign the return value (<code>undefined</code>) to the object as done in the example.
  37626. * </p>
  37627. */
  37628. destroy(): void;
  37629. }
  37630. /**
  37631. * A collection of {@link PostProcessStage}s and/or {@link PostProcessStageComposite}s.
  37632. * <p>
  37633. * The input texture for each post-process stage is the texture rendered to by the scene or the texture rendered
  37634. * to by the previous stage in the collection.
  37635. * </p>
  37636. * <p>
  37637. * If the ambient occlusion or bloom stages are enabled, they will execute before all other stages.
  37638. * </p>
  37639. * <p>
  37640. * If the FXAA stage is enabled, it will execute after all other stages.
  37641. * </p>
  37642. */
  37643. export class PostProcessStageCollection {
  37644. constructor();
  37645. /**
  37646. * Determines if all of the post-process stages in the collection are ready to be executed.
  37647. */
  37648. readonly ready: boolean;
  37649. /**
  37650. * A post-process stage for Fast Approximate Anti-aliasing.
  37651. * <p>
  37652. * When enabled, this stage will execute after all others.
  37653. * </p>
  37654. */
  37655. readonly fxaa: PostProcessStage;
  37656. /**
  37657. * A post-process stage that applies Horizon-based Ambient Occlusion (HBAO) to the input texture.
  37658. * <p>
  37659. * Ambient occlusion simulates shadows from ambient light. These shadows would always be present when the
  37660. * surface receives light and regardless of the light's position.
  37661. * </p>
  37662. * <p>
  37663. * The uniforms have the following properties: <code>intensity</code>, <code>bias</code>, <code>lengthCap</code>,
  37664. * <code>stepSize</code>, <code>frustumLength</code>, <code>ambientOcclusionOnly</code>,
  37665. * <code>delta</code>, <code>sigma</code>, and <code>blurStepSize</code>.
  37666. * </p>
  37667. * <ul>
  37668. * <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>
  37669. *
  37670. * <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,
  37671. * 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>
  37672. *
  37673. * <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,
  37674. * sampling stops in the current direction. The default value is <code>0.26</code>.</li>
  37675. *
  37676. * <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>
  37677. *
  37678. * <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.
  37679. * The default value is <code>1000.0</code>.</li>
  37680. *
  37681. * <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
  37682. * 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>
  37683. * </ul>
  37684. * <p>
  37685. * <code>delta</code>, <code>sigma</code>, and <code>blurStepSize</code> are the same properties as {@link PostProcessStageLibrary#createBlurStage}.
  37686. * The blur is applied to the shadows generated from the image to make them smoother.
  37687. * </p>
  37688. * <p>
  37689. * When enabled, this stage will execute before all others.
  37690. * </p>
  37691. */
  37692. readonly ambientOcclusion: PostProcessStageComposite;
  37693. /**
  37694. * A post-process stage for a bloom effect.
  37695. * <p>
  37696. * A bloom effect adds glow effect, makes bright areas brighter, and dark areas darker.
  37697. * </p>
  37698. * <p>
  37699. * This stage has the following uniforms: <code>contrast</code>, <code>brightness</code>, <code>glowOnly</code>,
  37700. * <code>delta</code>, <code>sigma</code>, and <code>stepSize</code>.
  37701. * </p>
  37702. * <ul>
  37703. * <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>
  37704. *
  37705. * <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
  37706. * added to the brightness. The default value is <code>-0.3</code>.</li>
  37707. *
  37708. * <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.
  37709. * The default value is <code>false</code>. This is a debug option for viewing the effects when changing the other uniform values.</li>
  37710. * </ul>
  37711. * <p>
  37712. * <code>delta</code>, <code>sigma</code>, and <code>stepSize</code> are the same properties as {@link PostProcessStageLibrary#createBlurStage}.
  37713. * The blur is applied to the shadows generated from the image to make them smoother.
  37714. * </p>
  37715. * <p>
  37716. * When enabled, this stage will execute before all others.
  37717. * </p>
  37718. */
  37719. readonly bloom: PostProcessStageComposite;
  37720. /**
  37721. * The number of post-process stages in this collection.
  37722. */
  37723. readonly length: number;
  37724. /**
  37725. * Adds the post-process stage to the collection.
  37726. * @param stage - The post-process stage to add to the collection.
  37727. * @returns The post-process stage that was added to the collection.
  37728. */
  37729. add(stage: PostProcessStage | PostProcessStageComposite): PostProcessStage | PostProcessStageComposite;
  37730. /**
  37731. * Removes a post-process stage from the collection and destroys it.
  37732. * @param stage - The post-process stage to remove from the collection.
  37733. * @returns Whether the post-process stage was removed.
  37734. */
  37735. remove(stage: PostProcessStage | PostProcessStageComposite): boolean;
  37736. /**
  37737. * Returns whether the collection contains a post-process stage.
  37738. * @param stage - The post-process stage.
  37739. * @returns Whether the collection contains the post-process stage.
  37740. */
  37741. contains(stage: PostProcessStage | PostProcessStageComposite): boolean;
  37742. /**
  37743. * Gets the post-process stage at <code>index</code>.
  37744. * @param index - The index of the post-process stage.
  37745. * @returns The post-process stage at index.
  37746. */
  37747. get(index: number): PostProcessStage | PostProcessStageComposite;
  37748. /**
  37749. * Removes all post-process stages from the collection and destroys them.
  37750. */
  37751. removeAll(): void;
  37752. /**
  37753. * Returns true if this object was destroyed; otherwise, false.
  37754. * <p>
  37755. * If this object was destroyed, it should not be used; calling any function other than
  37756. * <code>isDestroyed</code> will result in a {@link DeveloperError} exception.
  37757. * </p>
  37758. * @returns <code>true</code> if this object was destroyed; otherwise, <code>false</code>.
  37759. */
  37760. isDestroyed(): boolean;
  37761. /**
  37762. * Destroys the WebGL resources held by this object. Destroying an object allows for deterministic
  37763. * release of WebGL resources, instead of relying on the garbage collector to destroy this object.
  37764. * <p>
  37765. * Once an object is destroyed, it should not be used; calling any function other than
  37766. * <code>isDestroyed</code> will result in a {@link DeveloperError} exception. Therefore,
  37767. * assign the return value (<code>undefined</code>) to the object as done in the example.
  37768. * </p>
  37769. */
  37770. destroy(): void;
  37771. }
  37772. /**
  37773. * A collection of {@link PostProcessStage}s or other post-process composite stages that execute together logically.
  37774. * <p>
  37775. * All stages are executed in the order of the array. The input texture changes based on the value of <code>inputPreviousStageTexture</code>.
  37776. * 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.
  37777. * 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
  37778. * or the output texture of the previous stage.
  37779. * </p>
  37780. * @example
  37781. * // Example 1: separable blur filter
  37782. * // The input to blurXDirection is the texture rendered to by the scene or the output of the previous stage.
  37783. * // The input to blurYDirection is the texture rendered to by blurXDirection.
  37784. * scene.postProcessStages.add(new Cesium.PostProcessStageComposite({
  37785. * stages : [blurXDirection, blurYDirection]
  37786. * }));
  37787. * @example
  37788. * // Example 2: referencing the output of another post-process stage
  37789. * scene.postProcessStages.add(new Cesium.PostProcessStageComposite({
  37790. * inputPreviousStageTexture : false,
  37791. * stages : [
  37792. * // The same as Example 1.
  37793. * new Cesium.PostProcessStageComposite({
  37794. * inputPreviousStageTexture : true
  37795. * stages : [blurXDirection, blurYDirection],
  37796. * name : 'blur'
  37797. * }),
  37798. * // The input texture for this stage is the same input texture to blurXDirection since inputPreviousStageTexture is false
  37799. * new Cesium.PostProcessStage({
  37800. * fragmentShader : compositeShader,
  37801. * uniforms : {
  37802. * blurTexture : 'blur' // The output of the composite with name 'blur' (the texture that blurYDirection rendered to).
  37803. * }
  37804. * })
  37805. * ]
  37806. * });
  37807. * @example
  37808. * // Example 3: create a uniform alias
  37809. * const uniforms = {};
  37810. * Cesium.defineProperties(uniforms, {
  37811. * filterSize : {
  37812. * get : function() {
  37813. * return blurXDirection.uniforms.filterSize;
  37814. * },
  37815. * set : function(value) {
  37816. * blurXDirection.uniforms.filterSize = blurYDirection.uniforms.filterSize = value;
  37817. * }
  37818. * }
  37819. * });
  37820. * scene.postProcessStages.add(new Cesium.PostProcessStageComposite({
  37821. * stages : [blurXDirection, blurYDirection],
  37822. * uniforms : uniforms
  37823. * }));
  37824. * @param options - An object with the following properties:
  37825. * @param options.stages - An array of {@link PostProcessStage}s or composites to be executed in order.
  37826. * @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.
  37827. * @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.
  37828. * @param [options.uniforms] - An alias to the uniforms of post-process stages.
  37829. */
  37830. export class PostProcessStageComposite {
  37831. constructor(options: {
  37832. stages: any[];
  37833. inputPreviousStageTexture?: boolean;
  37834. name?: string;
  37835. uniforms?: any;
  37836. });
  37837. /**
  37838. * Determines if this post-process stage is ready to be executed.
  37839. */
  37840. readonly ready: boolean;
  37841. /**
  37842. * The unique name of this post-process stage for reference by other stages in a PostProcessStageComposite.
  37843. */
  37844. readonly name: string;
  37845. /**
  37846. * Whether or not to execute this post-process stage when ready.
  37847. */
  37848. enabled: boolean;
  37849. /**
  37850. * 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.
  37851. */
  37852. uniforms: any;
  37853. /**
  37854. * All post-process stages are executed in the order of the array. The input texture changes based on the value of <code>inputPreviousStageTexture</code>.
  37855. * 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.
  37856. * 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
  37857. * or the output texture of the previous stage.
  37858. */
  37859. readonly inputPreviousStageTexture: boolean;
  37860. /**
  37861. * The number of post-process stages in this composite.
  37862. */
  37863. readonly length: number;
  37864. /**
  37865. * The features selected for applying the post-process.
  37866. */
  37867. selected: any[];
  37868. /**
  37869. * Gets the post-process stage at <code>index</code>
  37870. * @param index - The index of the post-process stage or composite.
  37871. * @returns The post-process stage or composite at index.
  37872. */
  37873. get(index: number): PostProcessStage | PostProcessStageComposite;
  37874. /**
  37875. * Returns true if this object was destroyed; otherwise, false.
  37876. * <p>
  37877. * If this object was destroyed, it should not be used; calling any function other than
  37878. * <code>isDestroyed</code> will result in a {@link DeveloperError} exception.
  37879. * </p>
  37880. * @returns <code>true</code> if this object was destroyed; otherwise, <code>false</code>.
  37881. */
  37882. isDestroyed(): boolean;
  37883. /**
  37884. * Destroys the WebGL resources held by this object. Destroying an object allows for deterministic
  37885. * release of WebGL resources, instead of relying on the garbage collector to destroy this object.
  37886. * <p>
  37887. * Once an object is destroyed, it should not be used; calling any function other than
  37888. * <code>isDestroyed</code> will result in a {@link DeveloperError} exception. Therefore,
  37889. * assign the return value (<code>undefined</code>) to the object as done in the example.
  37890. * </p>
  37891. */
  37892. destroy(): void;
  37893. }
  37894. /**
  37895. * Contains functions for creating common post-process stages.
  37896. */
  37897. export namespace PostProcessStageLibrary {
  37898. /**
  37899. * Creates a post-process stage that applies a Gaussian blur to the input texture. This stage is usually applied in conjunction with another stage.
  37900. * <p>
  37901. * This stage has the following uniforms: <code>delta</code>, <code>sigma</code>, and <code>stepSize</code>.
  37902. * </p>
  37903. * <p>
  37904. * <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>.
  37905. * The default value for <code>delta</code> is <code>1.0</code>. The default value for <code>sigma</code> is <code>2.0</code>.
  37906. * <code>stepSize</code> is the distance to the next texel. The default is <code>1.0</code>.
  37907. * </p>
  37908. * @returns A post-process stage that applies a Gaussian blur to the input texture.
  37909. */
  37910. function createBlurStage(): PostProcessStageComposite;
  37911. /**
  37912. * Creates a post-process stage that applies a depth of field effect.
  37913. * <p>
  37914. * Depth of field simulates camera focus. Objects in the scene that are in focus
  37915. * will be clear whereas objects not in focus will be blurred.
  37916. * </p>
  37917. * <p>
  37918. * This stage has the following uniforms: <code>focalDistance</code>, <code>delta</code>, <code>sigma</code>, and <code>stepSize</code>.
  37919. * </p>
  37920. * <p>
  37921. * <code>focalDistance</code> is the distance in meters from the camera to set the camera focus.
  37922. * </p>
  37923. * <p>
  37924. * <code>delta</code>, <code>sigma</code>, and <code>stepSize</code> are the same properties as {@link PostProcessStageLibrary#createBlurStage}.
  37925. * The blur is applied to the areas out of focus.
  37926. * </p>
  37927. * @returns A post-process stage that applies a depth of field effect.
  37928. */
  37929. function createDepthOfFieldStage(): PostProcessStageComposite;
  37930. /**
  37931. * Whether or not a depth of field stage is supported.
  37932. * <p>
  37933. * This stage requires the WEBGL_depth_texture extension.
  37934. * </p>
  37935. * @param scene - The scene.
  37936. * @returns Whether this post process stage is supported.
  37937. */
  37938. function isDepthOfFieldSupported(scene: Scene): boolean;
  37939. /**
  37940. * Creates a post-process stage that detects edges.
  37941. * <p>
  37942. * Writes the color to the output texture with alpha set to 1.0 when it is on an edge.
  37943. * </p>
  37944. * <p>
  37945. * This stage has the following uniforms: <code>color</code> and <code>length</code>
  37946. * </p>
  37947. * <ul>
  37948. * <li><code>color</code> is the color of the highlighted edge. The default is {@link Color#BLACK}.</li>
  37949. * <li><code>length</code> is the length of the edges in pixels. The default is <code>0.5</code>.</li>
  37950. * </ul>
  37951. * <p>
  37952. * This stage is not supported in 2D.
  37953. * </p>
  37954. * @example
  37955. * // multiple silhouette effects
  37956. * const yellowEdge = Cesium.PostProcessLibrary.createEdgeDetectionStage();
  37957. * yellowEdge.uniforms.color = Cesium.Color.YELLOW;
  37958. * yellowEdge.selected = [feature0];
  37959. *
  37960. * const greenEdge = Cesium.PostProcessLibrary.createEdgeDetectionStage();
  37961. * greenEdge.uniforms.color = Cesium.Color.LIME;
  37962. * greenEdge.selected = [feature1];
  37963. *
  37964. * // draw edges around feature0 and feature1
  37965. * postProcessStages.add(Cesium.PostProcessLibrary.createSilhouetteStage([yellowEdge, greenEdge]);
  37966. * @returns A post-process stage that applies an edge detection effect.
  37967. */
  37968. function createEdgeDetectionStage(): PostProcessStage;
  37969. /**
  37970. * Whether or not an edge detection stage is supported.
  37971. * <p>
  37972. * This stage requires the WEBGL_depth_texture extension.
  37973. * </p>
  37974. * @param scene - The scene.
  37975. * @returns Whether this post process stage is supported.
  37976. */
  37977. function isEdgeDetectionSupported(scene: Scene): boolean;
  37978. /**
  37979. * Creates a post-process stage that applies a silhouette effect.
  37980. * <p>
  37981. * A silhouette effect composites the color from the edge detection pass with input color texture.
  37982. * </p>
  37983. * <p>
  37984. * This stage has the following uniforms when <code>edgeDetectionStages</code> is <code>undefined</code>: <code>color</code> and <code>length</code>
  37985. * </p>
  37986. * <p>
  37987. * <code>color</code> is the color of the highlighted edge. The default is {@link Color#BLACK}.
  37988. * <code>length</code> is the length of the edges in pixels. The default is <code>0.5</code>.
  37989. * </p>
  37990. * @param [edgeDetectionStages] - An array of edge detection post process stages.
  37991. * @returns A post-process stage that applies a silhouette effect.
  37992. */
  37993. function createSilhouetteStage(edgeDetectionStages?: PostProcessStage[]): PostProcessStageComposite;
  37994. /**
  37995. * Whether or not a silhouette stage is supported.
  37996. * <p>
  37997. * This stage requires the WEBGL_depth_texture extension.
  37998. * </p>
  37999. * @param scene - The scene.
  38000. * @returns Whether this post process stage is supported.
  38001. */
  38002. function isSilhouetteSupported(scene: Scene): boolean;
  38003. /**
  38004. * Whether or not an ambient occlusion stage is supported.
  38005. * <p>
  38006. * This stage requires the WEBGL_depth_texture extension.
  38007. * </p>
  38008. * @param scene - The scene.
  38009. * @returns Whether this post process stage is supported.
  38010. */
  38011. function isAmbientOcclusionSupported(scene: Scene): boolean;
  38012. /**
  38013. * Creates a post-process stage that renders the input texture with black and white gradations.
  38014. * <p>
  38015. * This stage has one uniform value, <code>gradations</code>, which scales the luminance of each pixel.
  38016. * </p>
  38017. * @returns A post-process stage that renders the input texture with black and white gradations.
  38018. */
  38019. function createBlackAndWhiteStage(): PostProcessStage;
  38020. /**
  38021. * Creates a post-process stage that saturates the input texture.
  38022. * <p>
  38023. * This stage has one uniform value, <code>brightness</code>, which scales the saturation of each pixel.
  38024. * </p>
  38025. * @returns A post-process stage that saturates the input texture.
  38026. */
  38027. function createBrightnessStage(): PostProcessStage;
  38028. /**
  38029. * Creates a post-process stage that adds a night vision effect to the input texture.
  38030. * @returns A post-process stage that adds a night vision effect to the input texture.
  38031. */
  38032. function createNightVisionStage(): PostProcessStage;
  38033. /**
  38034. * Creates a post-process stage that applies an effect simulating light flaring a camera lens.
  38035. * <p>
  38036. * This stage has the following uniforms: <code>dirtTexture</code>, <code>starTexture</code>, <code>intensity</code>, <code>distortion</code>, <code>ghostDispersal</code>,
  38037. * <code>haloWidth</code>, <code>dirtAmount</code>, and <code>earthRadius</code>.
  38038. * <ul>
  38039. * <li><code>dirtTexture</code> is a texture sampled to simulate dirt on the lens.</li>
  38040. * <li><code>starTexture</code> is the texture sampled for the star pattern of the flare.</li>
  38041. * <li><code>intensity</code> is a scalar multiplied by the result of the lens flare. The default value is <code>2.0</code>.</li>
  38042. * <li><code>distortion</code> is a scalar value that affects the chromatic effect distortion. The default value is <code>10.0</code>.</li>
  38043. * <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>
  38044. * <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>
  38045. * <li><code>dirtAmount</code> is a scalar representing the amount of dirt on the lens. The default value is <code>0.4</code>.</li>
  38046. * <li><code>earthRadius</code> is the maximum radius of the earth. The default value is <code>Ellipsoid.WGS84.maximumRadius</code>.</li>
  38047. * </ul>
  38048. * </p>
  38049. * @returns A post-process stage for applying a lens flare effect.
  38050. */
  38051. function createLensFlareStage(): PostProcessStage;
  38052. }
  38053. /**
  38054. * Determines how input texture to a {@link PostProcessStage} is sampled.
  38055. */
  38056. export enum PostProcessStageSampleMode {
  38057. /**
  38058. * Samples the texture by returning the closest texel.
  38059. */
  38060. NEAREST = 0,
  38061. /**
  38062. * Samples the texture through bi-linear interpolation of the four nearest texels.
  38063. */
  38064. LINEAR = 1
  38065. }
  38066. /**
  38067. * A primitive represents geometry in the {@link Scene}. The geometry can be from a single {@link GeometryInstance}
  38068. * as shown in example 1 below, or from an array of instances, even if the geometry is from different
  38069. * geometry types, e.g., an {@link RectangleGeometry} and an {@link EllipsoidGeometry} as shown in Code Example 2.
  38070. * <p>
  38071. * A primitive combines geometry instances with an {@link Appearance} that describes the full shading, including
  38072. * {@link Material} and {@link RenderState}. Roughly, the geometry instance defines the structure and placement,
  38073. * and the appearance defines the visual characteristics. Decoupling geometry and appearance allows us to mix
  38074. * and match most of them and add a new geometry or appearance independently of each other.
  38075. * </p>
  38076. * <p>
  38077. * Combining multiple instances into one primitive is called batching, and significantly improves performance for static data.
  38078. * Instances can be individually picked; {@link Scene#pick} returns their {@link GeometryInstance#id}. Using
  38079. * per-instance appearances like {@link PerInstanceColorAppearance}, each instance can also have a unique color.
  38080. * </p>
  38081. * <p>
  38082. * {@link Geometry} can either be created and batched on a web worker or the main thread. The first two examples
  38083. * show geometry that will be created on a web worker by using the descriptions of the geometry. The third example
  38084. * shows how to create the geometry on the main thread by explicitly calling the <code>createGeometry</code> method.
  38085. * </p>
  38086. * @example
  38087. * // 1. Draw a translucent ellipse on the surface with a checkerboard pattern
  38088. * const instance = new Cesium.GeometryInstance({
  38089. * geometry : new Cesium.EllipseGeometry({
  38090. * center : Cesium.Cartesian3.fromDegrees(-100.0, 20.0),
  38091. * semiMinorAxis : 500000.0,
  38092. * semiMajorAxis : 1000000.0,
  38093. * rotation : Cesium.Math.PI_OVER_FOUR,
  38094. * vertexFormat : Cesium.VertexFormat.POSITION_AND_ST
  38095. * }),
  38096. * id : 'object returned when this instance is picked and to get/set per-instance attributes'
  38097. * });
  38098. * scene.primitives.add(new Cesium.Primitive({
  38099. * geometryInstances : instance,
  38100. * appearance : new Cesium.EllipsoidSurfaceAppearance({
  38101. * material : Cesium.Material.fromType('Checkerboard')
  38102. * })
  38103. * }));
  38104. * @example
  38105. * // 2. Draw different instances each with a unique color
  38106. * const rectangleInstance = new Cesium.GeometryInstance({
  38107. * geometry : new Cesium.RectangleGeometry({
  38108. * rectangle : Cesium.Rectangle.fromDegrees(-140.0, 30.0, -100.0, 40.0),
  38109. * vertexFormat : Cesium.PerInstanceColorAppearance.VERTEX_FORMAT
  38110. * }),
  38111. * id : 'rectangle',
  38112. * attributes : {
  38113. * color : new Cesium.ColorGeometryInstanceAttribute(0.0, 1.0, 1.0, 0.5)
  38114. * }
  38115. * });
  38116. * const ellipsoidInstance = new Cesium.GeometryInstance({
  38117. * geometry : new Cesium.EllipsoidGeometry({
  38118. * radii : new Cesium.Cartesian3(500000.0, 500000.0, 1000000.0),
  38119. * vertexFormat : Cesium.VertexFormat.POSITION_AND_NORMAL
  38120. * }),
  38121. * modelMatrix : Cesium.Matrix4.multiplyByTranslation(Cesium.Transforms.eastNorthUpToFixedFrame(
  38122. * Cesium.Cartesian3.fromDegrees(-95.59777, 40.03883)), new Cesium.Cartesian3(0.0, 0.0, 500000.0), new Cesium.Matrix4()),
  38123. * id : 'ellipsoid',
  38124. * attributes : {
  38125. * color : Cesium.ColorGeometryInstanceAttribute.fromColor(Cesium.Color.AQUA)
  38126. * }
  38127. * });
  38128. * scene.primitives.add(new Cesium.Primitive({
  38129. * geometryInstances : [rectangleInstance, ellipsoidInstance],
  38130. * appearance : new Cesium.PerInstanceColorAppearance()
  38131. * }));
  38132. * @example
  38133. * // 3. Create the geometry on the main thread.
  38134. * scene.primitives.add(new Cesium.Primitive({
  38135. * geometryInstances : new Cesium.GeometryInstance({
  38136. * geometry : Cesium.EllipsoidGeometry.createGeometry(new Cesium.EllipsoidGeometry({
  38137. * radii : new Cesium.Cartesian3(500000.0, 500000.0, 1000000.0),
  38138. * vertexFormat : Cesium.VertexFormat.POSITION_AND_NORMAL
  38139. * })),
  38140. * modelMatrix : Cesium.Matrix4.multiplyByTranslation(Cesium.Transforms.eastNorthUpToFixedFrame(
  38141. * Cesium.Cartesian3.fromDegrees(-95.59777, 40.03883)), new Cesium.Cartesian3(0.0, 0.0, 500000.0), new Cesium.Matrix4()),
  38142. * id : 'ellipsoid',
  38143. * attributes : {
  38144. * color : Cesium.ColorGeometryInstanceAttribute.fromColor(Cesium.Color.AQUA)
  38145. * }
  38146. * }),
  38147. * appearance : new Cesium.PerInstanceColorAppearance(),
  38148. * asynchronous : false
  38149. * }));
  38150. * @param [options] - Object with the following properties:
  38151. * @param [options.geometryInstances] - The geometry instances - or a single geometry instance - to render.
  38152. * @param [options.appearance] - The appearance used to render the primitive.
  38153. * @param [options.depthFailAppearance] - The appearance used to shade this primitive when it fails the depth test.
  38154. * @param [options.show = true] - Determines if this primitive will be shown.
  38155. * @param [options.modelMatrix = Matrix4.IDENTITY] - The 4x4 transformation matrix that transforms the primitive (all geometry instances) from model to world coordinates.
  38156. * @param [options.vertexCacheOptimize = false] - When <code>true</code>, geometry vertices are optimized for the pre and post-vertex-shader caches.
  38157. * @param [options.interleave = false] - When <code>true</code>, geometry vertex attributes are interleaved, which can slightly improve rendering performance but increases load time.
  38158. * @param [options.compressVertices = true] - When <code>true</code>, the geometry vertices are compressed, which will save memory.
  38159. * @param [options.releaseGeometryInstances = true] - When <code>true</code>, the primitive does not keep a reference to the input <code>geometryInstances</code> to save memory.
  38160. * @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.
  38161. * @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.
  38162. * @param [options.asynchronous = true] - Determines if the primitive will be created asynchronously or block until ready.
  38163. * @param [options.debugShowBoundingVolume = false] - For debugging only. Determines if this primitive's commands' bounding spheres are shown.
  38164. * @param [options.shadows = ShadowMode.DISABLED] - Determines whether this primitive casts or receives shadows from light sources.
  38165. */
  38166. export class Primitive {
  38167. constructor(options?: {
  38168. geometryInstances?: GeometryInstance[] | GeometryInstance;
  38169. appearance?: Appearance;
  38170. depthFailAppearance?: Appearance;
  38171. show?: boolean;
  38172. modelMatrix?: Matrix4;
  38173. vertexCacheOptimize?: boolean;
  38174. interleave?: boolean;
  38175. compressVertices?: boolean;
  38176. releaseGeometryInstances?: boolean;
  38177. allowPicking?: boolean;
  38178. cull?: boolean;
  38179. asynchronous?: boolean;
  38180. debugShowBoundingVolume?: boolean;
  38181. shadows?: ShadowMode;
  38182. });
  38183. /**
  38184. * The geometry instances rendered with this primitive. This may
  38185. * be <code>undefined</code> if <code>options.releaseGeometryInstances</code>
  38186. * is <code>true</code> when the primitive is constructed.
  38187. * <p>
  38188. * Changing this property after the primitive is rendered has no effect.
  38189. * </p>
  38190. */
  38191. readonly geometryInstances: GeometryInstance[] | GeometryInstance;
  38192. /**
  38193. * The {@link Appearance} used to shade this primitive. Each geometry
  38194. * instance is shaded with the same appearance. Some appearances, like
  38195. * {@link PerInstanceColorAppearance} allow giving each instance unique
  38196. * properties.
  38197. */
  38198. appearance: Appearance;
  38199. /**
  38200. * The {@link Appearance} used to shade this primitive when it fails the depth test. Each geometry
  38201. * instance is shaded with the same appearance. Some appearances, like
  38202. * {@link PerInstanceColorAppearance} allow giving each instance unique
  38203. * properties.
  38204. *
  38205. * <p>
  38206. * When using an appearance that requires a color attribute, like PerInstanceColorAppearance,
  38207. * add a depthFailColor per-instance attribute instead.
  38208. * </p>
  38209. *
  38210. * <p>
  38211. * Requires the EXT_frag_depth WebGL extension to render properly. If the extension is not supported,
  38212. * there may be artifacts.
  38213. * </p>
  38214. */
  38215. depthFailAppearance: Appearance;
  38216. /**
  38217. * The 4x4 transformation matrix that transforms the primitive (all geometry instances) from model to world coordinates.
  38218. * When this is the identity matrix, the primitive is drawn in world coordinates, i.e., Earth's WGS84 coordinates.
  38219. * Local reference frames can be used by providing a different transformation matrix, like that returned
  38220. * by {@link Transforms.eastNorthUpToFixedFrame}.
  38221. *
  38222. * <p>
  38223. * This property is only supported in 3D mode.
  38224. * </p>
  38225. * @example
  38226. * const origin = Cesium.Cartesian3.fromDegrees(-95.0, 40.0, 200000.0);
  38227. * p.modelMatrix = Cesium.Transforms.eastNorthUpToFixedFrame(origin);
  38228. */
  38229. modelMatrix: Matrix4;
  38230. /**
  38231. * Determines if the primitive will be shown. This affects all geometry
  38232. * instances in the primitive.
  38233. */
  38234. show: boolean;
  38235. /**
  38236. * When <code>true</code>, the renderer frustum culls and horizon culls the primitive's commands
  38237. * based on their bounding volume. Set this to <code>false</code> for a small performance gain
  38238. * if you are manually culling the primitive.
  38239. */
  38240. cull: boolean;
  38241. /**
  38242. * This property is for debugging only; it is not for production use nor is it optimized.
  38243. * <p>
  38244. * Draws the bounding sphere for each draw command in the primitive.
  38245. * </p>
  38246. */
  38247. debugShowBoundingVolume: boolean;
  38248. /**
  38249. * Determines whether this primitive casts or receives shadows from light sources.
  38250. */
  38251. shadows: ShadowMode;
  38252. /**
  38253. * When <code>true</code>, geometry vertices are optimized for the pre and post-vertex-shader caches.
  38254. */
  38255. readonly vertexCacheOptimize: boolean;
  38256. /**
  38257. * Determines if geometry vertex attributes are interleaved, which can slightly improve rendering performance.
  38258. */
  38259. readonly interleave: boolean;
  38260. /**
  38261. * When <code>true</code>, the primitive does not keep a reference to the input <code>geometryInstances</code> to save memory.
  38262. */
  38263. readonly releaseGeometryInstances: boolean;
  38264. /**
  38265. * When <code>true</code>, each geometry instance will only be pickable with {@link Scene#pick}. When <code>false</code>, GPU memory is saved. *
  38266. */
  38267. readonly allowPicking: boolean;
  38268. /**
  38269. * Determines if the geometry instances will be created and batched on a web worker.
  38270. */
  38271. readonly asynchronous: boolean;
  38272. /**
  38273. * When <code>true</code>, geometry vertices are compressed, which will save memory.
  38274. */
  38275. readonly compressVertices: boolean;
  38276. /**
  38277. * Determines if the primitive is complete and ready to render. If this property is
  38278. * true, the primitive will be rendered the next time that {@link Primitive#update}
  38279. * is called.
  38280. */
  38281. readonly ready: boolean;
  38282. /**
  38283. * Gets a promise that resolves when the primitive is ready to render.
  38284. */
  38285. readonly readyPromise: Promise<Primitive>;
  38286. /**
  38287. * Called when {@link Viewer} or {@link CesiumWidget} render the scene to
  38288. * get the draw commands needed to render this primitive.
  38289. * <p>
  38290. * Do not call this function directly. This is documented just to
  38291. * list the exceptions that may be propagated when the scene is rendered:
  38292. * </p>
  38293. */
  38294. update(): void;
  38295. /**
  38296. * Returns the modifiable per-instance attributes for a {@link GeometryInstance}.
  38297. * @example
  38298. * const attributes = primitive.getGeometryInstanceAttributes('an id');
  38299. * attributes.color = Cesium.ColorGeometryInstanceAttribute.toValue(Cesium.Color.AQUA);
  38300. * attributes.show = Cesium.ShowGeometryInstanceAttribute.toValue(true);
  38301. * attributes.distanceDisplayCondition = Cesium.DistanceDisplayConditionGeometryInstanceAttribute.toValue(100.0, 10000.0);
  38302. * attributes.offset = Cesium.OffsetGeometryInstanceAttribute.toValue(Cartesian3.IDENTITY);
  38303. * @param id - The id of the {@link GeometryInstance}.
  38304. * @returns The typed array in the attribute's format or undefined if the is no instance with id.
  38305. */
  38306. getGeometryInstanceAttributes(id: any): any;
  38307. /**
  38308. * Returns true if this object was destroyed; otherwise, false.
  38309. * <p>
  38310. * If this object was destroyed, it should not be used; calling any function other than
  38311. * <code>isDestroyed</code> will result in a {@link DeveloperError} exception.
  38312. * </p>
  38313. * @returns <code>true</code> if this object was destroyed; otherwise, <code>false</code>.
  38314. */
  38315. isDestroyed(): boolean;
  38316. /**
  38317. * Destroys the WebGL resources held by this object. Destroying an object allows for deterministic
  38318. * release of WebGL resources, instead of relying on the garbage collector to destroy this object.
  38319. * <p>
  38320. * Once an object is destroyed, it should not be used; calling any function other than
  38321. * <code>isDestroyed</code> will result in a {@link DeveloperError} exception. Therefore,
  38322. * assign the return value (<code>undefined</code>) to the object as done in the example.
  38323. * </p>
  38324. * @example
  38325. * e = e && e.destroy();
  38326. */
  38327. destroy(): void;
  38328. }
  38329. /**
  38330. * A collection of primitives. This is most often used with {@link Scene#primitives},
  38331. * but <code>PrimitiveCollection</code> is also a primitive itself so collections can
  38332. * be added to collections forming a hierarchy.
  38333. * @example
  38334. * const billboards = new Cesium.BillboardCollection();
  38335. * const labels = new Cesium.LabelCollection();
  38336. *
  38337. * const collection = new Cesium.PrimitiveCollection();
  38338. * collection.add(billboards);
  38339. *
  38340. * scene.primitives.add(collection); // Add collection
  38341. * scene.primitives.add(labels); // Add regular primitive
  38342. * @param [options] - Object with the following properties:
  38343. * @param [options.show = true] - Determines if the primitives in the collection will be shown.
  38344. * @param [options.destroyPrimitives = true] - Determines if primitives in the collection are destroyed when they are removed.
  38345. */
  38346. export class PrimitiveCollection {
  38347. constructor(options?: {
  38348. show?: boolean;
  38349. destroyPrimitives?: boolean;
  38350. });
  38351. /**
  38352. * Determines if primitives in this collection will be shown.
  38353. */
  38354. show: boolean;
  38355. /**
  38356. * Determines if primitives in the collection are destroyed when they are removed by
  38357. * {@link PrimitiveCollection#destroy} or {@link PrimitiveCollection#remove} or implicitly
  38358. * by {@link PrimitiveCollection#removeAll}.
  38359. * @example
  38360. * // Example 1. Primitives are destroyed by default.
  38361. * const primitives = new Cesium.PrimitiveCollection();
  38362. * const labels = primitives.add(new Cesium.LabelCollection());
  38363. * primitives = primitives.destroy();
  38364. * const b = labels.isDestroyed(); // true
  38365. * @example
  38366. * // Example 2. Do not destroy primitives in a collection.
  38367. * const primitives = new Cesium.PrimitiveCollection();
  38368. * primitives.destroyPrimitives = false;
  38369. * const labels = primitives.add(new Cesium.LabelCollection());
  38370. * primitives = primitives.destroy();
  38371. * const b = labels.isDestroyed(); // false
  38372. * labels = labels.destroy(); // explicitly destroy
  38373. */
  38374. destroyPrimitives: boolean;
  38375. /**
  38376. * Gets the number of primitives in the collection.
  38377. */
  38378. readonly length: number;
  38379. /**
  38380. * Adds a primitive to the collection.
  38381. * @example
  38382. * const billboards = scene.primitives.add(new Cesium.BillboardCollection());
  38383. * @param primitive - The primitive to add.
  38384. * @param [index] - The index to add the layer at. If omitted, the primitive will be added at the bottom of all existing primitives.
  38385. * @returns The primitive added to the collection.
  38386. */
  38387. add(primitive: any, index?: number): any;
  38388. /**
  38389. * Removes a primitive from the collection.
  38390. * @example
  38391. * const billboards = scene.primitives.add(new Cesium.BillboardCollection());
  38392. * scene.primitives.remove(billboards); // Returns true
  38393. * @param [primitive] - The primitive to remove.
  38394. * @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.
  38395. */
  38396. remove(primitive?: any): boolean;
  38397. /**
  38398. * Removes all primitives in the collection.
  38399. */
  38400. removeAll(): void;
  38401. /**
  38402. * Determines if this collection contains a primitive.
  38403. * @param [primitive] - The primitive to check for.
  38404. * @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.
  38405. */
  38406. contains(primitive?: any): boolean;
  38407. /**
  38408. * Raises a primitive "up one" in the collection. If all primitives in the collection are drawn
  38409. * on the globe surface, this visually moves the primitive up one.
  38410. * @param [primitive] - The primitive to raise.
  38411. */
  38412. raise(primitive?: any): void;
  38413. /**
  38414. * Raises a primitive to the "top" of the collection. If all primitives in the collection are drawn
  38415. * on the globe surface, this visually moves the primitive to the top.
  38416. * @param [primitive] - The primitive to raise the top.
  38417. */
  38418. raiseToTop(primitive?: any): void;
  38419. /**
  38420. * Lowers a primitive "down one" in the collection. If all primitives in the collection are drawn
  38421. * on the globe surface, this visually moves the primitive down one.
  38422. * @param [primitive] - The primitive to lower.
  38423. */
  38424. lower(primitive?: any): void;
  38425. /**
  38426. * Lowers a primitive to the "bottom" of the collection. If all primitives in the collection are drawn
  38427. * on the globe surface, this visually moves the primitive to the bottom.
  38428. * @param [primitive] - The primitive to lower to the bottom.
  38429. */
  38430. lowerToBottom(primitive?: any): void;
  38431. /**
  38432. * Returns the primitive in the collection at the specified index.
  38433. * @example
  38434. * // Toggle the show property of every primitive in the collection.
  38435. * const primitives = scene.primitives;
  38436. * const length = primitives.length;
  38437. * for (let i = 0; i < length; ++i) {
  38438. * const p = primitives.get(i);
  38439. * p.show = !p.show;
  38440. * }
  38441. * @param index - The zero-based index of the primitive to return.
  38442. * @returns The primitive at the <code>index</code>.
  38443. */
  38444. get(index: number): any;
  38445. /**
  38446. * Returns true if this object was destroyed; otherwise, false.
  38447. * <br /><br />
  38448. * If this object was destroyed, it should not be used; calling any function other than
  38449. * <code>isDestroyed</code> will result in a {@link DeveloperError} exception.
  38450. * @returns True if this object was destroyed; otherwise, false.
  38451. */
  38452. isDestroyed(): boolean;
  38453. /**
  38454. * Destroys the WebGL resources held by each primitive in this collection. Explicitly destroying this
  38455. * collection allows for deterministic release of WebGL resources, instead of relying on the garbage
  38456. * collector to destroy this collection.
  38457. * <br /><br />
  38458. * Since destroying a collection destroys all the contained primitives, only destroy a collection
  38459. * when you are sure no other code is still using any of the contained primitives.
  38460. * <br /><br />
  38461. * Once this collection is destroyed, it should not be used; calling any function other than
  38462. * <code>isDestroyed</code> will result in a {@link DeveloperError} exception. Therefore,
  38463. * assign the return value (<code>undefined</code>) to the object as done in the example.
  38464. * @example
  38465. * primitives = primitives && primitives.destroy();
  38466. */
  38467. destroy(): void;
  38468. }
  38469. /**
  38470. * The container for all 3D graphical objects and state in a Cesium virtual scene. Generally,
  38471. * a scene is not created directly; instead, it is implicitly created by {@link CesiumWidget}.
  38472. * <p>
  38473. * <em><code>contextOptions</code> parameter details:</em>
  38474. * </p>
  38475. * <p>
  38476. * The default values are:
  38477. * <code>
  38478. * {
  38479. * webgl : {
  38480. * alpha : false,
  38481. * depth : true,
  38482. * stencil : false,
  38483. * antialias : true,
  38484. * powerPreference: 'high-performance',
  38485. * premultipliedAlpha : true,
  38486. * preserveDrawingBuffer : false,
  38487. * failIfMajorPerformanceCaveat : false
  38488. * },
  38489. * allowTextureFilterAnisotropic : true
  38490. * }
  38491. * </code>
  38492. * </p>
  38493. * <p>
  38494. * The <code>webgl</code> property corresponds to the {@link http://www.khronos.org/registry/webgl/specs/latest/#5.2|WebGLContextAttributes}
  38495. * object used to create the WebGL context.
  38496. * </p>
  38497. * <p>
  38498. * <code>webgl.alpha</code> defaults to false, which can improve performance compared to the standard WebGL default
  38499. * of true. If an application needs to composite Cesium above other HTML elements using alpha-blending, set
  38500. * <code>webgl.alpha</code> to true.
  38501. * </p>
  38502. * <p>
  38503. * The other <code>webgl</code> properties match the WebGL defaults for {@link http://www.khronos.org/registry/webgl/specs/latest/#5.2|WebGLContextAttributes}.
  38504. * </p>
  38505. * <p>
  38506. * <code>allowTextureFilterAnisotropic</code> defaults to true, which enables anisotropic texture filtering when the
  38507. * WebGL extension is supported. Setting this to false will improve performance, but hurt visual quality, especially for horizon views.
  38508. * </p>
  38509. * @example
  38510. * // Create scene without anisotropic texture filtering
  38511. * const scene = new Cesium.Scene({
  38512. * canvas : canvas,
  38513. * contextOptions : {
  38514. * allowTextureFilterAnisotropic : false
  38515. * }
  38516. * });
  38517. * @param options - Object with the following properties:
  38518. * @param options.canvas - The HTML canvas element to create the scene for.
  38519. * @param [options.contextOptions] - Context and WebGL creation properties. See details above.
  38520. * @param [options.creditContainer] - The HTML element in which the credits will be displayed.
  38521. * @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.
  38522. * @param [options.mapProjection = new GeographicProjection()] - The map projection to use in 2D and Columbus View modes.
  38523. * @param [options.orderIndependentTranslucency = true] - If true and the configuration supports it, use order independent translucency.
  38524. * @param [options.scene3DOnly = false] - If true, optimizes memory use and performance for 3D mode but disables the ability to use 2D or Columbus View.
  38525. * @param [options.shadows = false] - Determines if shadows are cast by light sources.
  38526. * @param [options.mapMode2D = MapMode2D.INFINITE_SCROLL] - Determines if the 2D map is rotatable or can be scrolled infinitely in the horizontal direction.
  38527. * @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}.
  38528. * @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}.
  38529. * @param [depthPlaneEllipsoidOffset = 0.0] - Adjust the DepthPlane to address rendering artefacts below ellipsoid zero elevation.
  38530. * @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.
  38531. */
  38532. export class Scene {
  38533. constructor(options: {
  38534. canvas: HTMLCanvasElement;
  38535. contextOptions?: any;
  38536. creditContainer?: Element;
  38537. creditViewport?: Element;
  38538. mapProjection?: MapProjection;
  38539. orderIndependentTranslucency?: boolean;
  38540. scene3DOnly?: boolean;
  38541. shadows?: boolean;
  38542. mapMode2D?: MapMode2D;
  38543. requestRenderMode?: boolean;
  38544. maximumRenderTimeChange?: number;
  38545. msaaSamples?: number;
  38546. }, depthPlaneEllipsoidOffset?: number);
  38547. /**
  38548. * Exceptions occurring in <code>render</code> are always caught in order to raise the
  38549. * <code>renderError</code> event. If this property is true, the error is rethrown
  38550. * after the event is raised. If this property is false, the <code>render</code> function
  38551. * returns normally after raising the event.
  38552. */
  38553. rethrowRenderErrors: boolean;
  38554. /**
  38555. * Determines whether or not to instantly complete the
  38556. * scene transition animation on user input.
  38557. */
  38558. completeMorphOnUserInput: boolean;
  38559. /**
  38560. * The event fired at the beginning of a scene transition.
  38561. */
  38562. morphStart: Event;
  38563. /**
  38564. * The event fired at the completion of a scene transition.
  38565. */
  38566. morphComplete: Event;
  38567. /**
  38568. * The {@link SkyBox} used to draw the stars.
  38569. */
  38570. skyBox: SkyBox;
  38571. /**
  38572. * The sky atmosphere drawn around the globe.
  38573. */
  38574. skyAtmosphere: SkyAtmosphere;
  38575. /**
  38576. * The {@link Sun}.
  38577. */
  38578. sun: Sun;
  38579. /**
  38580. * Uses a bloom filter on the sun when enabled.
  38581. */
  38582. sunBloom: boolean;
  38583. /**
  38584. * The {@link Moon}
  38585. */
  38586. moon: Moon;
  38587. /**
  38588. * The background color, which is only visible if there is no sky box, i.e., {@link Scene#skyBox} is undefined.
  38589. */
  38590. backgroundColor: Color;
  38591. /**
  38592. * The current morph transition time between 2D/Columbus View and 3D,
  38593. * with 0.0 being 2D or Columbus View and 1.0 being 3D.
  38594. */
  38595. morphTime: number;
  38596. /**
  38597. * The far-to-near ratio of the multi-frustum when using a normal depth buffer.
  38598. * <p>
  38599. * This value is used to create the near and far values for each frustum of the multi-frustum. It is only used
  38600. * when {@link Scene#logarithmicDepthBuffer} is <code>false</code>. When <code>logarithmicDepthBuffer</code> is
  38601. * <code>true</code>, use {@link Scene#logarithmicDepthFarToNearRatio}.
  38602. * </p>
  38603. */
  38604. farToNearRatio: number;
  38605. /**
  38606. * The far-to-near ratio of the multi-frustum when using a logarithmic depth buffer.
  38607. * <p>
  38608. * This value is used to create the near and far values for each frustum of the multi-frustum. It is only used
  38609. * when {@link Scene#logarithmicDepthBuffer} is <code>true</code>. When <code>logarithmicDepthBuffer</code> is
  38610. * <code>false</code>, use {@link Scene#farToNearRatio}.
  38611. * </p>
  38612. */
  38613. logarithmicDepthFarToNearRatio: number;
  38614. /**
  38615. * Determines the uniform depth size in meters of each frustum of the multifrustum in 2D. If a primitive or model close
  38616. * to the surface shows z-fighting, decreasing this will eliminate the artifact, but decrease performance. On the
  38617. * other hand, increasing this will increase performance but may cause z-fighting among primitives close to the surface.
  38618. */
  38619. nearToFarDistance2D: number;
  38620. /**
  38621. * This property is for debugging only; it is not for production use.
  38622. * <p>
  38623. * A function that determines what commands are executed. As shown in the examples below,
  38624. * the function receives the command's <code>owner</code> as an argument, and returns a boolean indicating if the
  38625. * command should be executed.
  38626. * </p>
  38627. * <p>
  38628. * The default is <code>undefined</code>, indicating that all commands are executed.
  38629. * </p>
  38630. * @example
  38631. * // Do not execute any commands.
  38632. * scene.debugCommandFilter = function(command) {
  38633. * return false;
  38634. * };
  38635. *
  38636. * // Execute only the billboard's commands. That is, only draw the billboard.
  38637. * const billboards = new Cesium.BillboardCollection();
  38638. * scene.debugCommandFilter = function(command) {
  38639. * return command.owner === billboards;
  38640. * };
  38641. */
  38642. debugCommandFilter: (...params: any[]) => any;
  38643. /**
  38644. * This property is for debugging only; it is not for production use.
  38645. * <p>
  38646. * When <code>true</code>, commands are randomly shaded. This is useful
  38647. * for performance analysis to see what parts of a scene or model are
  38648. * command-dense and could benefit from batching.
  38649. * </p>
  38650. */
  38651. debugShowCommands: boolean;
  38652. /**
  38653. * This property is for debugging only; it is not for production use.
  38654. * <p>
  38655. * When <code>true</code>, commands are shaded based on the frustums they
  38656. * overlap. Commands in the closest frustum are tinted red, commands in
  38657. * the next closest are green, and commands in the farthest frustum are
  38658. * blue. If a command overlaps more than one frustum, the color components
  38659. * are combined, e.g., a command overlapping the first two frustums is tinted
  38660. * yellow.
  38661. * </p>
  38662. */
  38663. debugShowFrustums: boolean;
  38664. /**
  38665. * This property is for debugging only; it is not for production use.
  38666. * <p>
  38667. * Displays frames per second and time between frames.
  38668. * </p>
  38669. */
  38670. debugShowFramesPerSecond: boolean;
  38671. /**
  38672. * This property is for debugging only; it is not for production use.
  38673. * <p>
  38674. * Indicates which frustum will have depth information displayed.
  38675. * </p>
  38676. */
  38677. debugShowDepthFrustum: number;
  38678. /**
  38679. * This property is for debugging only; it is not for production use.
  38680. * <p>
  38681. * When <code>true</code>, draws outlines to show the boundaries of the camera frustums
  38682. * </p>
  38683. */
  38684. debugShowFrustumPlanes: boolean;
  38685. /**
  38686. * When <code>true</code>, enables picking using the depth buffer.
  38687. */
  38688. useDepthPicking: boolean;
  38689. /**
  38690. * 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.
  38691. *
  38692. * <p>
  38693. * There is a decrease in performance when enabled. There are extra draw calls to write depth for
  38694. * translucent geometry.
  38695. * </p>
  38696. * @example
  38697. * // picking the position of a translucent primitive
  38698. * viewer.screenSpaceEventHandler.setInputAction(function onLeftClick(movement) {
  38699. * const pickedFeature = viewer.scene.pick(movement.position);
  38700. * if (!Cesium.defined(pickedFeature)) {
  38701. * // nothing picked
  38702. * return;
  38703. * }
  38704. * const worldPosition = viewer.scene.pickPosition(movement.position);
  38705. * }, Cesium.ScreenSpaceEventType.LEFT_CLICK);
  38706. */
  38707. pickTranslucentDepth: boolean;
  38708. /**
  38709. * Blends the atmosphere to geometry far from the camera for horizon views. Allows for additional
  38710. * performance improvements by rendering less geometry and dispatching less terrain requests.
  38711. */
  38712. fog: Fog;
  38713. /**
  38714. * The shadow map for the scene's light source. When enabled, models, primitives, and the globe may cast and receive shadows.
  38715. */
  38716. shadowMap: ShadowMap;
  38717. /**
  38718. * When <code>false</code>, 3D Tiles will render normally. When <code>true</code>, classified 3D Tile geometry will render normally and
  38719. * unclassified 3D Tile geometry will render with the color multiplied by {@link Scene#invertClassificationColor}.
  38720. */
  38721. invertClassification: boolean;
  38722. /**
  38723. * The highlight color of unclassified 3D Tile geometry when {@link Scene#invertClassification} is <code>true</code>.
  38724. * <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>
  38725. * <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>
  38726. */
  38727. invertClassificationColor: Color;
  38728. /**
  38729. * The focal length for use when with cardboard or WebVR.
  38730. */
  38731. focalLength: number;
  38732. /**
  38733. * The eye separation distance in meters for use with cardboard or WebVR.
  38734. */
  38735. eyeSeparation: number;
  38736. /**
  38737. * Post processing effects applied to the final render.
  38738. */
  38739. postProcessStages: PostProcessStageCollection;
  38740. /**
  38741. * When <code>true</code>, rendering a frame will only occur when needed as determined by changes within the scene.
  38742. * Enabling improves performance of the application, but requires using {@link Scene#requestRender}
  38743. * to render a new frame explicitly in this mode. This will be necessary in many cases after making changes
  38744. * to the scene in other parts of the API.
  38745. */
  38746. requestRenderMode: boolean;
  38747. /**
  38748. * If {@link Scene#requestRenderMode} is <code>true</code>, this value defines the maximum change in
  38749. * simulation time allowed before a render is requested. Lower values increase the number of frames rendered
  38750. * and higher values decrease the number of frames rendered. If <code>undefined</code>, changes to
  38751. * the simulation time will never request a render.
  38752. * This value impacts the rate of rendering for changes in the scene like lighting, entity property updates,
  38753. * and animations.
  38754. */
  38755. maximumRenderTimeChange: number;
  38756. /**
  38757. * The spherical harmonic coefficients for image-based lighting of PBR models.
  38758. */
  38759. sphericalHarmonicCoefficients: Cartesian3[];
  38760. /**
  38761. * The url to the KTX2 file containing the specular environment map and convoluted mipmaps for image-based lighting of PBR models.
  38762. */
  38763. specularEnvironmentMaps: string;
  38764. /**
  38765. * The light source for shading. Defaults to a directional light from the Sun.
  38766. */
  38767. light: Light;
  38768. /**
  38769. * Gets the canvas element to which this scene is bound.
  38770. */
  38771. readonly canvas: HTMLCanvasElement;
  38772. /**
  38773. * The drawingBufferHeight of the underlying GL context.
  38774. */
  38775. readonly drawingBufferHeight: number;
  38776. /**
  38777. * The drawingBufferHeight of the underlying GL context.
  38778. */
  38779. readonly drawingBufferWidth: number;
  38780. /**
  38781. * The maximum aliased line width, in pixels, supported by this WebGL implementation. It will be at least one.
  38782. */
  38783. readonly maximumAliasedLineWidth: number;
  38784. /**
  38785. * The maximum length in pixels of one edge of a cube map, supported by this WebGL implementation. It will be at least 16.
  38786. */
  38787. readonly maximumCubeMapSize: number;
  38788. /**
  38789. * Returns <code>true</code> if the {@link Scene#pickPosition} function is supported.
  38790. */
  38791. readonly pickPositionSupported: boolean;
  38792. /**
  38793. * Returns <code>true</code> if the {@link Scene#sampleHeight} and {@link Scene#sampleHeightMostDetailed} functions are supported.
  38794. */
  38795. readonly sampleHeightSupported: boolean;
  38796. /**
  38797. * Returns <code>true</code> if the {@link Scene#clampToHeight} and {@link Scene#clampToHeightMostDetailed} functions are supported.
  38798. */
  38799. readonly clampToHeightSupported: boolean;
  38800. /**
  38801. * Returns <code>true</code> if the {@link Scene#invertClassification} is supported.
  38802. */
  38803. readonly invertClassificationSupported: boolean;
  38804. /**
  38805. * Returns <code>true</code> if specular environment maps are supported.
  38806. */
  38807. readonly specularEnvironmentMapsSupported: boolean;
  38808. /**
  38809. * Gets or sets the depth-test ellipsoid.
  38810. */
  38811. globe: Globe;
  38812. /**
  38813. * Gets the collection of primitives.
  38814. */
  38815. readonly primitives: PrimitiveCollection;
  38816. /**
  38817. * Gets the collection of ground primitives.
  38818. */
  38819. readonly groundPrimitives: PrimitiveCollection;
  38820. /**
  38821. * Gets or sets the camera.
  38822. */
  38823. readonly camera: Camera;
  38824. /**
  38825. * Gets the controller for camera input handling.
  38826. */
  38827. readonly screenSpaceCameraController: ScreenSpaceCameraController;
  38828. /**
  38829. * Get the map projection to use in 2D and Columbus View modes.
  38830. */
  38831. readonly mapProjection: MapProjection;
  38832. /**
  38833. * Gets the collection of image layers that will be rendered on the globe.
  38834. */
  38835. readonly imageryLayers: ImageryLayerCollection;
  38836. /**
  38837. * The terrain provider providing surface geometry for the globe.
  38838. */
  38839. terrainProvider: TerrainProvider;
  38840. /**
  38841. * Gets an event that's raised when the terrain provider is changed
  38842. */
  38843. readonly terrainProviderChanged: Event;
  38844. /**
  38845. * Gets the event that will be raised before the scene is updated or rendered. Subscribers to the event
  38846. * receive the Scene instance as the first parameter and the current time as the second parameter.
  38847. */
  38848. readonly preUpdate: Event;
  38849. /**
  38850. * Gets the event that will be raised immediately after the scene is updated and before the scene is rendered.
  38851. * Subscribers to the event receive the Scene instance as the first parameter and the current time as the second
  38852. * parameter.
  38853. */
  38854. readonly postUpdate: Event;
  38855. /**
  38856. * Gets the event that will be raised when an error is thrown inside the <code>render</code> function.
  38857. * The Scene instance and the thrown error are the only two parameters passed to the event handler.
  38858. * By default, errors are not rethrown after this event is raised, but that can be changed by setting
  38859. * the <code>rethrowRenderErrors</code> property.
  38860. */
  38861. readonly renderError: Event;
  38862. /**
  38863. * Gets the event that will be raised after the scene is updated and immediately before the scene is rendered.
  38864. * Subscribers to the event receive the Scene instance as the first parameter and the current time as the second
  38865. * parameter.
  38866. */
  38867. readonly preRender: Event;
  38868. /**
  38869. * Gets the event that will be raised immediately after the scene is rendered. Subscribers to the event
  38870. * receive the Scene instance as the first parameter and the current time as the second parameter.
  38871. */
  38872. readonly postRender: Event;
  38873. /**
  38874. * Gets the simulation time when the scene was last rendered. Returns undefined if the scene has not yet been
  38875. * rendered.
  38876. */
  38877. readonly lastRenderTime: JulianDate;
  38878. /**
  38879. * This property is for debugging only; it is not for production use.
  38880. * <p>
  38881. * When {@link Scene.debugShowFrustums} is <code>true</code>, this contains
  38882. * properties with statistics about the number of command execute per frustum.
  38883. * <code>totalCommands</code> is the total number of commands executed, ignoring
  38884. * overlap. <code>commandsInFrustums</code> is an array with the number of times
  38885. * commands are executed redundantly, e.g., how many commands overlap two or
  38886. * three frustums.
  38887. * </p>
  38888. */
  38889. readonly debugFrustumStatistics: any;
  38890. /**
  38891. * Gets whether or not the scene is optimized for 3D only viewing.
  38892. */
  38893. readonly scene3DOnly: boolean;
  38894. /**
  38895. * Gets whether or not the scene has order independent translucency enabled.
  38896. * Note that this only reflects the original construction option, and there are
  38897. * other factors that could prevent OIT from functioning on a given system configuration.
  38898. */
  38899. readonly orderIndependentTranslucency: boolean;
  38900. /**
  38901. * Gets the unique identifier for this scene.
  38902. */
  38903. readonly id: string;
  38904. /**
  38905. * Gets or sets the current mode of the scene.
  38906. */
  38907. mode: SceneMode;
  38908. /**
  38909. * When <code>true</code>, splits the scene into two viewports with steroscopic views for the left and right eyes.
  38910. * Used for cardboard and WebVR.
  38911. */
  38912. useWebVR: boolean;
  38913. /**
  38914. * Determines if the 2D map is rotatable or can be scrolled infinitely in the horizontal direction.
  38915. */
  38916. readonly mapMode2D: MapMode2D;
  38917. /**
  38918. * Gets or sets the position of the splitter within the viewport. Valid values are between 0.0 and 1.0.
  38919. */
  38920. splitPosition: number;
  38921. /**
  38922. * Gets or sets the position of the Imagery splitter within the viewport. Valid values are between 0.0 and 1.0.
  38923. */
  38924. imagerySplitPosition: number;
  38925. /**
  38926. * The distance from the camera at which to disable the depth test of billboards, labels and points
  38927. * to, for example, prevent clipping against terrain. When set to zero, the depth test should always
  38928. * be applied. When less than zero, the depth test should never be applied. Setting the disableDepthTestDistance
  38929. * property of a billboard, label or point will override this value.
  38930. */
  38931. minimumDisableDepthTestDistance: number;
  38932. /**
  38933. * Whether or not to use a logarithmic depth buffer. Enabling this option will allow for less frustums in the multi-frustum,
  38934. * increasing performance. This property relies on fragmentDepth being supported.
  38935. */
  38936. logarithmicDepthBuffer: boolean;
  38937. /**
  38938. * The value used for gamma correction. This is only used when rendering with high dynamic range.
  38939. */
  38940. gamma: number;
  38941. /**
  38942. * Whether or not to use high dynamic range rendering.
  38943. */
  38944. highDynamicRange: boolean;
  38945. /**
  38946. * Whether or not high dynamic range rendering is supported.
  38947. */
  38948. readonly highDynamicRangeSupported: boolean;
  38949. /**
  38950. * Whether or not the camera is underneath the globe.
  38951. */
  38952. readonly cameraUnderground: boolean;
  38953. /**
  38954. * The sample rate of multisample antialiasing (values greater than 1 enable MSAA).
  38955. */
  38956. msaaSamples: number;
  38957. /**
  38958. * Returns <code>true</code> if the Scene's context supports MSAA.
  38959. */
  38960. readonly msaaSupported: boolean;
  38961. /**
  38962. * Determines if a compressed texture format is supported.
  38963. * @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.
  38964. * @returns Whether or not the format is supported.
  38965. */
  38966. getCompressedTextureFormatSupported(format: string): boolean;
  38967. /**
  38968. * Update and render the scene. It is usually not necessary to call this function
  38969. * directly because {@link CesiumWidget} or {@link Viewer} do it automatically.
  38970. * @param [time] - The simulation time at which to render.
  38971. */
  38972. render(time?: JulianDate): void;
  38973. /**
  38974. * Requests a new rendered frame when {@link Scene#requestRenderMode} is set to <code>true</code>.
  38975. * The render rate will not exceed the {@link CesiumWidget#targetFrameRate}.
  38976. */
  38977. requestRender(): void;
  38978. /**
  38979. * Returns an object with a `primitive` property that contains the first (top) primitive in the scene
  38980. * at a particular window coordinate or undefined if nothing is at the location. Other properties may
  38981. * potentially be set depending on the type of primitive and may be used to further identify the picked object.
  38982. * <p>
  38983. * When a feature of a 3D Tiles tileset is picked, <code>pick</code> returns a {@link Cesium3DTileFeature} object.
  38984. * </p>
  38985. * @example
  38986. * // On mouse over, color the feature yellow.
  38987. * handler.setInputAction(function(movement) {
  38988. * const feature = scene.pick(movement.endPosition);
  38989. * if (feature instanceof Cesium.Cesium3DTileFeature) {
  38990. * feature.color = Cesium.Color.YELLOW;
  38991. * }
  38992. * }, Cesium.ScreenSpaceEventType.MOUSE_MOVE);
  38993. * @param windowPosition - Window coordinates to perform picking on.
  38994. * @param [width = 3] - Width of the pick rectangle.
  38995. * @param [height = 3] - Height of the pick rectangle.
  38996. * @returns Object containing the picked primitive.
  38997. */
  38998. pick(windowPosition: Cartesian2, width?: number, height?: number): any;
  38999. /**
  39000. * Returns the cartesian position reconstructed from the depth buffer and window position.
  39001. * <p>
  39002. * The position reconstructed from the depth buffer in 2D may be slightly different from those
  39003. * reconstructed in 3D and Columbus view. This is caused by the difference in the distribution
  39004. * of depth values of perspective and orthographic projection.
  39005. * </p>
  39006. * <p>
  39007. * Set {@link Scene#pickTranslucentDepth} to <code>true</code> to include the depth of
  39008. * translucent primitives; otherwise, this essentially picks through translucent primitives.
  39009. * </p>
  39010. * @param windowPosition - Window coordinates to perform picking on.
  39011. * @param [result] - The object on which to restore the result.
  39012. * @returns The cartesian position.
  39013. */
  39014. pickPosition(windowPosition: Cartesian2, result?: Cartesian3): Cartesian3;
  39015. /**
  39016. * Returns a list of objects, each containing a `primitive` property, for all primitives at
  39017. * a particular window coordinate position. Other properties may also be set depending on the
  39018. * type of primitive and may be used to further identify the picked object. The primitives in
  39019. * the list are ordered by their visual order in the scene (front to back).
  39020. * @example
  39021. * const pickedObjects = scene.drillPick(new Cesium.Cartesian2(100.0, 200.0));
  39022. * @param windowPosition - Window coordinates to perform picking on.
  39023. * @param [limit] - If supplied, stop drilling after collecting this many picks.
  39024. * @param [width = 3] - Width of the pick rectangle.
  39025. * @param [height = 3] - Height of the pick rectangle.
  39026. * @returns Array of objects, each containing 1 picked primitives.
  39027. */
  39028. drillPick(windowPosition: Cartesian2, limit?: number, width?: number, height?: number): any[];
  39029. /**
  39030. * Returns the height of scene geometry at the given cartographic position or <code>undefined</code> if there was no
  39031. * scene geometry to sample height from. The height of the input position is ignored. May be used to clamp objects to
  39032. * the globe, 3D Tiles, or primitives in the scene.
  39033. * <p>
  39034. * This function only samples height from globe tiles and 3D Tiles that are rendered in the current view. Samples height
  39035. * from all other primitives regardless of their visibility.
  39036. * </p>
  39037. * @example
  39038. * const position = new Cesium.Cartographic(-1.31968, 0.698874);
  39039. * const height = viewer.scene.sampleHeight(position);
  39040. * console.log(height);
  39041. * @param position - The cartographic position to sample height from.
  39042. * @param [objectsToExclude] - A list of primitives, entities, or 3D Tiles features to not sample height from.
  39043. * @param [width = 0.1] - Width of the intersection volume in meters.
  39044. * @returns The height. This may be <code>undefined</code> if there was no scene geometry to sample height from.
  39045. */
  39046. sampleHeight(position: Cartographic, objectsToExclude?: object[], width?: number): number;
  39047. /**
  39048. * Clamps the given cartesian position to the scene geometry along the geodetic surface normal. Returns the
  39049. * clamped position or <code>undefined</code> if there was no scene geometry to clamp to. May be used to clamp
  39050. * objects to the globe, 3D Tiles, or primitives in the scene.
  39051. * <p>
  39052. * This function only clamps to globe tiles and 3D Tiles that are rendered in the current view. Clamps to
  39053. * all other primitives regardless of their visibility.
  39054. * </p>
  39055. * @example
  39056. * // Clamp an entity to the underlying scene geometry
  39057. * const position = entity.position.getValue(Cesium.JulianDate.now());
  39058. * entity.position = viewer.scene.clampToHeight(position);
  39059. * @param cartesian - The cartesian position.
  39060. * @param [objectsToExclude] - A list of primitives, entities, or 3D Tiles features to not clamp to.
  39061. * @param [width = 0.1] - Width of the intersection volume in meters.
  39062. * @param [result] - An optional object to return the clamped position.
  39063. * @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.
  39064. */
  39065. clampToHeight(cartesian: Cartesian3, objectsToExclude?: object[], width?: number, result?: Cartesian3): Cartesian3;
  39066. /**
  39067. * Initiates an asynchronous {@link Scene#sampleHeight} query for an array of {@link Cartographic} positions
  39068. * using the maximum level of detail for 3D Tilesets in the scene. The height of the input positions is ignored.
  39069. * Returns a promise that is resolved when the query completes. Each point height is modified in place.
  39070. * If a height cannot be determined because no geometry can be sampled at that location, or another error occurs,
  39071. * the height is set to undefined.
  39072. * @example
  39073. * const positions = [
  39074. * new Cesium.Cartographic(-1.31968, 0.69887),
  39075. * new Cesium.Cartographic(-1.10489, 0.83923)
  39076. * ];
  39077. * const promise = viewer.scene.sampleHeightMostDetailed(positions);
  39078. * promise.then(function(updatedPosition) {
  39079. * // positions[0].height and positions[1].height have been updated.
  39080. * // updatedPositions is just a reference to positions.
  39081. * }
  39082. * @param positions - The cartographic positions to update with sampled heights.
  39083. * @param [objectsToExclude] - A list of primitives, entities, or 3D Tiles features to not sample height from.
  39084. * @param [width = 0.1] - Width of the intersection volume in meters.
  39085. * @returns A promise that resolves to the provided list of positions when the query has completed.
  39086. */
  39087. sampleHeightMostDetailed(positions: Cartographic[], objectsToExclude?: object[], width?: number): Promise<Cartographic[]>;
  39088. /**
  39089. * Initiates an asynchronous {@link Scene#clampToHeight} query for an array of {@link Cartesian3} positions
  39090. * using the maximum level of detail for 3D Tilesets in the scene. Returns a promise that is resolved when
  39091. * the query completes. Each position is modified in place. If a position cannot be clamped because no geometry
  39092. * can be sampled at that location, or another error occurs, the element in the array is set to undefined.
  39093. * @example
  39094. * const cartesians = [
  39095. * entities[0].position.getValue(Cesium.JulianDate.now()),
  39096. * entities[1].position.getValue(Cesium.JulianDate.now())
  39097. * ];
  39098. * const promise = viewer.scene.clampToHeightMostDetailed(cartesians);
  39099. * promise.then(function(updatedCartesians) {
  39100. * entities[0].position = updatedCartesians[0];
  39101. * entities[1].position = updatedCartesians[1];
  39102. * }
  39103. * @param cartesians - The cartesian positions to update with clamped positions.
  39104. * @param [objectsToExclude] - A list of primitives, entities, or 3D Tiles features to not clamp to.
  39105. * @param [width = 0.1] - Width of the intersection volume in meters.
  39106. * @returns A promise that resolves to the provided list of positions when the query has completed.
  39107. */
  39108. clampToHeightMostDetailed(cartesians: Cartesian3[], objectsToExclude?: object[], width?: number): Promise<Cartesian3[]>;
  39109. /**
  39110. * Transforms a position in cartesian coordinates to canvas coordinates. This is commonly used to place an
  39111. * HTML element at the same screen position as an object in the scene.
  39112. * @example
  39113. * // Output the canvas position of longitude/latitude (0, 0) every time the mouse moves.
  39114. * const scene = widget.scene;
  39115. * const ellipsoid = scene.globe.ellipsoid;
  39116. * const position = Cesium.Cartesian3.fromDegrees(0.0, 0.0);
  39117. * const handler = new Cesium.ScreenSpaceEventHandler(scene.canvas);
  39118. * handler.setInputAction(function(movement) {
  39119. * console.log(scene.cartesianToCanvasCoordinates(position));
  39120. * }, Cesium.ScreenSpaceEventType.MOUSE_MOVE);
  39121. * @param position - The position in cartesian coordinates.
  39122. * @param [result] - An optional object to return the input position transformed to canvas coordinates.
  39123. * @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.
  39124. */
  39125. cartesianToCanvasCoordinates(position: Cartesian3, result?: Cartesian2): Cartesian2;
  39126. /**
  39127. * Instantly completes an active transition.
  39128. */
  39129. completeMorph(): void;
  39130. /**
  39131. * Asynchronously transitions the scene to 2D.
  39132. * @param [duration = 2.0] - The amount of time, in seconds, for transition animations to complete.
  39133. */
  39134. morphTo2D(duration?: number): void;
  39135. /**
  39136. * Asynchronously transitions the scene to Columbus View.
  39137. * @param [duration = 2.0] - The amount of time, in seconds, for transition animations to complete.
  39138. */
  39139. morphToColumbusView(duration?: number): void;
  39140. /**
  39141. * Asynchronously transitions the scene to 3D.
  39142. * @param [duration = 2.0] - The amount of time, in seconds, for transition animations to complete.
  39143. */
  39144. morphTo3D(duration?: number): void;
  39145. /**
  39146. * Returns true if this object was destroyed; otherwise, false.
  39147. * <br /><br />
  39148. * If this object was destroyed, it should not be used; calling any function other than
  39149. * <code>isDestroyed</code> will result in a {@link DeveloperError} exception.
  39150. * @returns <code>true</code> if this object was destroyed; otherwise, <code>false</code>.
  39151. */
  39152. isDestroyed(): boolean;
  39153. /**
  39154. * Destroys the WebGL resources held by this object. Destroying an object allows for deterministic
  39155. * release of WebGL resources, instead of relying on the garbage collector to destroy this object.
  39156. * <br /><br />
  39157. * Once an object is destroyed, it should not be used; calling any function other than
  39158. * <code>isDestroyed</code> will result in a {@link DeveloperError} exception. Therefore,
  39159. * assign the return value (<code>undefined</code>) to the object as done in the example.
  39160. * @example
  39161. * scene = scene && scene.destroy();
  39162. */
  39163. destroy(): void;
  39164. }
  39165. /**
  39166. * Indicates if the scene is viewed in 3D, 2D, or 2.5D Columbus view.
  39167. */
  39168. export enum SceneMode {
  39169. /**
  39170. * Morphing between mode, e.g., 3D to 2D.
  39171. */
  39172. MORPHING = 0,
  39173. /**
  39174. * Columbus View mode. A 2.5D perspective view where the map is laid out
  39175. * flat and objects with non-zero height are drawn above it.
  39176. */
  39177. COLUMBUS_VIEW = 1,
  39178. /**
  39179. * 2D mode. The map is viewed top-down with an orthographic projection.
  39180. */
  39181. SCENE2D = 2,
  39182. /**
  39183. * 3D mode. A traditional 3D perspective view of the globe.
  39184. */
  39185. SCENE3D = 3
  39186. }
  39187. /**
  39188. * Functions that do scene-dependent transforms between rendering-related coordinate systems.
  39189. */
  39190. export namespace SceneTransforms {
  39191. /**
  39192. * Transforms a position in WGS84 coordinates to window coordinates. This is commonly used to place an
  39193. * HTML element at the same screen position as an object in the scene.
  39194. * @example
  39195. * // Output the window position of longitude/latitude (0, 0) every time the mouse moves.
  39196. * const scene = widget.scene;
  39197. * const ellipsoid = scene.globe.ellipsoid;
  39198. * const position = Cesium.Cartesian3.fromDegrees(0.0, 0.0);
  39199. * const handler = new Cesium.ScreenSpaceEventHandler(scene.canvas);
  39200. * handler.setInputAction(function(movement) {
  39201. * console.log(Cesium.SceneTransforms.wgs84ToWindowCoordinates(scene, position));
  39202. * }, Cesium.ScreenSpaceEventType.MOUSE_MOVE);
  39203. * @param scene - The scene.
  39204. * @param position - The position in WGS84 (world) coordinates.
  39205. * @param [result] - An optional object to return the input position transformed to window coordinates.
  39206. * @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.
  39207. */
  39208. function wgs84ToWindowCoordinates(scene: Scene, position: Cartesian3, result?: Cartesian2): Cartesian2;
  39209. /**
  39210. * Transforms a position in WGS84 coordinates to drawing buffer coordinates. This may produce different
  39211. * results from SceneTransforms.wgs84ToWindowCoordinates when the browser zoom is not 100%, or on high-DPI displays.
  39212. * @example
  39213. * // Output the window position of longitude/latitude (0, 0) every time the mouse moves.
  39214. * const scene = widget.scene;
  39215. * const ellipsoid = scene.globe.ellipsoid;
  39216. * const position = Cesium.Cartesian3.fromDegrees(0.0, 0.0);
  39217. * const handler = new Cesium.ScreenSpaceEventHandler(scene.canvas);
  39218. * handler.setInputAction(function(movement) {
  39219. * console.log(Cesium.SceneTransforms.wgs84ToWindowCoordinates(scene, position));
  39220. * }, Cesium.ScreenSpaceEventType.MOUSE_MOVE);
  39221. * @param scene - The scene.
  39222. * @param position - The position in WGS84 (world) coordinates.
  39223. * @param [result] - An optional object to return the input position transformed to window coordinates.
  39224. * @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.
  39225. */
  39226. function wgs84ToDrawingBufferCoordinates(scene: Scene, position: Cartesian3, result?: Cartesian2): Cartesian2;
  39227. }
  39228. /**
  39229. * Modifies the camera position and orientation based on mouse input to a canvas.
  39230. * @param scene - The scene.
  39231. */
  39232. export class ScreenSpaceCameraController {
  39233. constructor(scene: Scene);
  39234. /**
  39235. * If true, inputs are allowed conditionally with the flags enableTranslate, enableZoom,
  39236. * enableRotate, enableTilt, and enableLook. If false, all inputs are disabled.
  39237. *
  39238. * NOTE: This setting is for temporary use cases, such as camera flights and
  39239. * drag-selection of regions (see Picking demo). It is typically set to false at the
  39240. * start of such events, and set true on completion. To keep inputs disabled
  39241. * past the end of camera flights, you must use the other booleans (enableTranslate,
  39242. * enableZoom, enableRotate, enableTilt, and enableLook).
  39243. */
  39244. enableInputs: boolean;
  39245. /**
  39246. * If true, allows the user to pan around the map. If false, the camera stays locked at the current position.
  39247. * This flag only applies in 2D and Columbus view modes.
  39248. */
  39249. enableTranslate: boolean;
  39250. /**
  39251. * If true, allows the user to zoom in and out. If false, the camera is locked to the current distance from the ellipsoid.
  39252. */
  39253. enableZoom: boolean;
  39254. /**
  39255. * If true, allows the user to rotate the world which translates the user's position.
  39256. * This flag only applies in 2D and 3D.
  39257. */
  39258. enableRotate: boolean;
  39259. /**
  39260. * If true, allows the user to tilt the camera. If false, the camera is locked to the current heading.
  39261. * This flag only applies in 3D and Columbus view.
  39262. */
  39263. enableTilt: boolean;
  39264. /**
  39265. * If true, allows the user to use free-look. If false, the camera view direction can only be changed through translating
  39266. * or rotating. This flag only applies in 3D and Columbus view modes.
  39267. */
  39268. enableLook: boolean;
  39269. /**
  39270. * A parameter in the range <code>[0, 1)</code> used to determine how long
  39271. * the camera will continue to spin because of inertia.
  39272. * With value of zero, the camera will have no inertia.
  39273. */
  39274. inertiaSpin: number;
  39275. /**
  39276. * A parameter in the range <code>[0, 1)</code> used to determine how long
  39277. * the camera will continue to translate because of inertia.
  39278. * With value of zero, the camera will have no inertia.
  39279. */
  39280. inertiaTranslate: number;
  39281. /**
  39282. * A parameter in the range <code>[0, 1)</code> used to determine how long
  39283. * the camera will continue to zoom because of inertia.
  39284. * With value of zero, the camera will have no inertia.
  39285. */
  39286. inertiaZoom: number;
  39287. /**
  39288. * A parameter in the range <code>[0, 1)</code> used to limit the range
  39289. * of various user inputs to a percentage of the window width/height per animation frame.
  39290. * This helps keep the camera under control in low-frame-rate situations.
  39291. */
  39292. maximumMovementRatio: number;
  39293. /**
  39294. * Sets the duration, in seconds, of the bounce back animations in 2D and Columbus view.
  39295. */
  39296. bounceAnimationTime: number;
  39297. /**
  39298. * The minimum magnitude, in meters, of the camera position when zooming. Defaults to 1.0.
  39299. */
  39300. minimumZoomDistance: number;
  39301. /**
  39302. * The maximum magnitude, in meters, of the camera position when zooming. Defaults to positive infinity.
  39303. */
  39304. maximumZoomDistance: number;
  39305. /**
  39306. * The input that allows the user to pan around the map. This only applies in 2D and Columbus view modes.
  39307. * <p>
  39308. * The type came be a {@link CameraEventType}, <code>undefined</code>, an object with <code>eventType</code>
  39309. * and <code>modifier</code> properties with types <code>CameraEventType</code> and {@link KeyboardEventModifier},
  39310. * or an array of any of the preceding.
  39311. * </p>
  39312. */
  39313. translateEventTypes: CameraEventType | any[] | undefined;
  39314. /**
  39315. * The input that allows the user to zoom in/out.
  39316. * <p>
  39317. * The type came be a {@link CameraEventType}, <code>undefined</code>, an object with <code>eventType</code>
  39318. * and <code>modifier</code> properties with types <code>CameraEventType</code> and {@link KeyboardEventModifier},
  39319. * or an array of any of the preceding.
  39320. * </p>
  39321. */
  39322. zoomEventTypes: CameraEventType | any[] | undefined;
  39323. /**
  39324. * The input that allows the user to rotate around the globe or another object. This only applies in 3D and Columbus view modes.
  39325. * <p>
  39326. * The type came be a {@link CameraEventType}, <code>undefined</code>, an object with <code>eventType</code>
  39327. * and <code>modifier</code> properties with types <code>CameraEventType</code> and {@link KeyboardEventModifier},
  39328. * or an array of any of the preceding.
  39329. * </p>
  39330. */
  39331. rotateEventTypes: CameraEventType | any[] | undefined;
  39332. /**
  39333. * The input that allows the user to tilt in 3D and Columbus view or twist in 2D.
  39334. * <p>
  39335. * The type came be a {@link CameraEventType}, <code>undefined</code>, an object with <code>eventType</code>
  39336. * and <code>modifier</code> properties with types <code>CameraEventType</code> and {@link KeyboardEventModifier},
  39337. * or an array of any of the preceding.
  39338. * </p>
  39339. */
  39340. tiltEventTypes: CameraEventType | any[] | undefined;
  39341. /**
  39342. * The input that allows the user to change the direction the camera is viewing. This only applies in 3D and Columbus view modes.
  39343. * <p>
  39344. * The type came be a {@link CameraEventType}, <code>undefined</code>, an object with <code>eventType</code>
  39345. * and <code>modifier</code> properties with types <code>CameraEventType</code> and {@link KeyboardEventModifier},
  39346. * or an array of any of the preceding.
  39347. * </p>
  39348. */
  39349. lookEventTypes: CameraEventType | any[] | undefined;
  39350. /**
  39351. * The minimum height the camera must be before picking the terrain instead of the ellipsoid.
  39352. */
  39353. minimumPickingTerrainHeight: number;
  39354. /**
  39355. * The minimum height the camera must be before testing for collision with terrain.
  39356. */
  39357. minimumCollisionTerrainHeight: number;
  39358. /**
  39359. * The minimum height the camera must be before switching from rotating a track ball to
  39360. * free look when clicks originate on the sky or in space.
  39361. */
  39362. minimumTrackBallHeight: number;
  39363. /**
  39364. * Enables or disables camera collision detection with terrain.
  39365. */
  39366. enableCollisionDetection: boolean;
  39367. /**
  39368. * Returns true if this object was destroyed; otherwise, false.
  39369. * <br /><br />
  39370. * If this object was destroyed, it should not be used; calling any function other than
  39371. * <code>isDestroyed</code> will result in a {@link DeveloperError} exception.
  39372. * @returns <code>true</code> if this object was destroyed; otherwise, <code>false</code>.
  39373. */
  39374. isDestroyed(): boolean;
  39375. /**
  39376. * Removes mouse listeners held by this object.
  39377. * <br /><br />
  39378. * Once an object is destroyed, it should not be used; calling any function other than
  39379. * <code>isDestroyed</code> will result in a {@link DeveloperError} exception. Therefore,
  39380. * assign the return value (<code>undefined</code>) to the object as done in the example.
  39381. * @example
  39382. * controller = controller && controller.destroy();
  39383. */
  39384. destroy(): void;
  39385. }
  39386. /**
  39387. * Use {@link Viewer#shadowMap} to get the scene's shadow map. Do not construct this directly.
  39388. *
  39389. * <p>
  39390. * The normalOffset bias pushes the shadows forward slightly, and may be disabled
  39391. * for applications that require ultra precise shadows.
  39392. * </p>
  39393. * @param options - An object containing the following properties:
  39394. * @param options.lightCamera - A camera representing the light source.
  39395. * @param [options.enabled = true] - Whether the shadow map is enabled.
  39396. * @param [options.isPointLight = false] - Whether the light source is a point light. Point light shadows do not use cascades.
  39397. * @param [options.pointLightRadius = 100.0] - Radius of the point light.
  39398. * @param [options.cascadesEnabled = true] - Use multiple shadow maps to cover different partitions of the view frustum.
  39399. * @param [options.numberOfCascades = 4] - The number of cascades to use for the shadow map. Supported values are one and four.
  39400. * @param [options.maximumDistance = 5000.0] - The maximum distance used for generating cascaded shadows. Lower values improve shadow quality.
  39401. * @param [options.size = 2048] - The width and height, in pixels, of each shadow map.
  39402. * @param [options.softShadows = false] - Whether percentage-closer-filtering is enabled for producing softer shadows.
  39403. * @param [options.darkness = 0.3] - The shadow darkness.
  39404. * @param [options.normalOffset = true] - Whether a normal bias is applied to shadows.
  39405. * @param [options.fadingEnabled = true] - Whether shadows start to fade out once the light gets closer to the horizon.
  39406. */
  39407. export class ShadowMap {
  39408. constructor(options: {
  39409. lightCamera: Camera;
  39410. enabled?: boolean;
  39411. isPointLight?: boolean;
  39412. pointLightRadius?: number;
  39413. cascadesEnabled?: boolean;
  39414. numberOfCascades?: number;
  39415. maximumDistance?: number;
  39416. size?: number;
  39417. softShadows?: boolean;
  39418. darkness?: number;
  39419. normalOffset?: boolean;
  39420. fadingEnabled?: boolean;
  39421. });
  39422. /**
  39423. * Determines the darkness of the shadows.
  39424. */
  39425. darkness: number;
  39426. /**
  39427. * Determines whether shadows start to fade out once the light gets closer to the horizon.
  39428. */
  39429. fadingEnabled: boolean;
  39430. /**
  39431. * Determines the maximum distance of the shadow map. Only applicable for cascaded shadows. Larger distances may result in lower quality shadows.
  39432. */
  39433. maximumDistance: number;
  39434. /**
  39435. * Determines if the shadow map will be shown.
  39436. */
  39437. enabled: boolean;
  39438. /**
  39439. * Determines if a normal bias will be applied to shadows.
  39440. */
  39441. normalOffset: boolean;
  39442. /**
  39443. * Determines if soft shadows are enabled. Uses pcf filtering which requires more texture reads and may hurt performance.
  39444. */
  39445. softShadows: boolean;
  39446. /**
  39447. * The width and height, in pixels, of each shadow map.
  39448. */
  39449. size: number;
  39450. }
  39451. /**
  39452. * Specifies whether the object casts or receives shadows from light sources when
  39453. * shadows are enabled.
  39454. */
  39455. export enum ShadowMode {
  39456. /**
  39457. * The object does not cast or receive shadows.
  39458. */
  39459. DISABLED = 0,
  39460. /**
  39461. * The object casts and receives shadows.
  39462. */
  39463. ENABLED = 1,
  39464. /**
  39465. * The object casts shadows only.
  39466. */
  39467. CAST_ONLY = 2,
  39468. /**
  39469. * The object receives shadows only.
  39470. */
  39471. RECEIVE_ONLY = 3
  39472. }
  39473. export namespace SingleTileImageryProvider {
  39474. /**
  39475. * Initialization options for the SingleTileImageryProvider constructor
  39476. * @property url - The url for the tile.
  39477. * @property [rectangle = Rectangle.MAX_VALUE] - The rectangle, in radians, covered by the image.
  39478. * @property [credit] - A credit for the data source, which is displayed on the canvas.
  39479. * @property [ellipsoid] - The ellipsoid. If not specified, the WGS84 ellipsoid is used.
  39480. */
  39481. type ConstructorOptions = {
  39482. url: Resource | string;
  39483. rectangle?: Rectangle;
  39484. credit?: Credit | string;
  39485. ellipsoid?: Ellipsoid;
  39486. };
  39487. }
  39488. /**
  39489. * Provides a single, top-level imagery tile. The single image is assumed to use a
  39490. * {@link GeographicTilingScheme}.
  39491. * @param options - Object describing initialization options
  39492. */
  39493. export class SingleTileImageryProvider {
  39494. constructor(options: SingleTileImageryProvider.ConstructorOptions);
  39495. /**
  39496. * The default alpha blending value of this provider, with 0.0 representing fully transparent and
  39497. * 1.0 representing fully opaque.
  39498. */
  39499. defaultAlpha: number | undefined;
  39500. /**
  39501. * The default alpha blending value on the night side of the globe of this provider, with 0.0 representing fully transparent and
  39502. * 1.0 representing fully opaque.
  39503. */
  39504. defaultNightAlpha: number | undefined;
  39505. /**
  39506. * The default alpha blending value on the day side of the globe of this provider, with 0.0 representing fully transparent and
  39507. * 1.0 representing fully opaque.
  39508. */
  39509. defaultDayAlpha: number | undefined;
  39510. /**
  39511. * The default brightness of this provider. 1.0 uses the unmodified imagery color. Less than 1.0
  39512. * makes the imagery darker while greater than 1.0 makes it brighter.
  39513. */
  39514. defaultBrightness: number | undefined;
  39515. /**
  39516. * The default contrast of this provider. 1.0 uses the unmodified imagery color. Less than 1.0 reduces
  39517. * the contrast while greater than 1.0 increases it.
  39518. */
  39519. defaultContrast: number | undefined;
  39520. /**
  39521. * The default hue of this provider in radians. 0.0 uses the unmodified imagery color.
  39522. */
  39523. defaultHue: number | undefined;
  39524. /**
  39525. * The default saturation of this provider. 1.0 uses the unmodified imagery color. Less than 1.0 reduces the
  39526. * saturation while greater than 1.0 increases it.
  39527. */
  39528. defaultSaturation: number | undefined;
  39529. /**
  39530. * The default gamma correction to apply to this provider. 1.0 uses the unmodified imagery color.
  39531. */
  39532. defaultGamma: number | undefined;
  39533. /**
  39534. * The default texture minification filter to apply to this provider.
  39535. */
  39536. defaultMinificationFilter: TextureMinificationFilter;
  39537. /**
  39538. * The default texture magnification filter to apply to this provider.
  39539. */
  39540. defaultMagnificationFilter: TextureMagnificationFilter;
  39541. /**
  39542. * Gets the URL of the single, top-level imagery tile.
  39543. */
  39544. readonly url: string;
  39545. /**
  39546. * Gets the proxy used by this provider.
  39547. */
  39548. readonly proxy: Proxy;
  39549. /**
  39550. * Gets the width of each tile, in pixels. This function should
  39551. * not be called before {@link SingleTileImageryProvider#ready} returns true.
  39552. */
  39553. readonly tileWidth: number;
  39554. /**
  39555. * Gets the height of each tile, in pixels. This function should
  39556. * not be called before {@link SingleTileImageryProvider#ready} returns true.
  39557. */
  39558. readonly tileHeight: number;
  39559. /**
  39560. * Gets the maximum level-of-detail that can be requested. This function should
  39561. * not be called before {@link SingleTileImageryProvider#ready} returns true.
  39562. */
  39563. readonly maximumLevel: number | undefined;
  39564. /**
  39565. * Gets the minimum level-of-detail that can be requested. This function should
  39566. * not be called before {@link SingleTileImageryProvider#ready} returns true.
  39567. */
  39568. readonly minimumLevel: number;
  39569. /**
  39570. * Gets the tiling scheme used by this provider. This function should
  39571. * not be called before {@link SingleTileImageryProvider#ready} returns true.
  39572. */
  39573. readonly tilingScheme: TilingScheme;
  39574. /**
  39575. * Gets the rectangle, in radians, of the imagery provided by this instance. This function should
  39576. * not be called before {@link SingleTileImageryProvider#ready} returns true.
  39577. */
  39578. readonly rectangle: Rectangle;
  39579. /**
  39580. * Gets the tile discard policy. If not undefined, the discard policy is responsible
  39581. * for filtering out "missing" tiles via its shouldDiscardImage function. If this function
  39582. * returns undefined, no tiles are filtered. This function should
  39583. * not be called before {@link SingleTileImageryProvider#ready} returns true.
  39584. */
  39585. readonly tileDiscardPolicy: TileDiscardPolicy;
  39586. /**
  39587. * Gets an event that is raised when the imagery provider encounters an asynchronous error. By subscribing
  39588. * to the event, you will be notified of the error and can potentially recover from it. Event listeners
  39589. * are passed an instance of {@link TileProviderError}.
  39590. */
  39591. readonly errorEvent: Event;
  39592. /**
  39593. * Gets a value indicating whether or not the provider is ready for use.
  39594. */
  39595. readonly ready: boolean;
  39596. /**
  39597. * Gets a promise that resolves to true when the provider is ready for use.
  39598. */
  39599. readonly readyPromise: Promise<boolean>;
  39600. /**
  39601. * Gets the credit to display when this imagery provider is active. Typically this is used to credit
  39602. * the source of the imagery. This function should not be called before {@link SingleTileImageryProvider#ready} returns true.
  39603. */
  39604. readonly credit: Credit;
  39605. /**
  39606. * Gets a value indicating whether or not the images provided by this imagery provider
  39607. * include an alpha channel. If this property is false, an alpha channel, if present, will
  39608. * be ignored. If this property is true, any images without an alpha channel will be treated
  39609. * as if their alpha is 1.0 everywhere. When this property is false, memory usage
  39610. * and texture upload time are reduced.
  39611. */
  39612. readonly hasAlphaChannel: boolean;
  39613. /**
  39614. * Gets the credits to be displayed when a given tile is displayed.
  39615. * @param x - The tile X coordinate.
  39616. * @param y - The tile Y coordinate.
  39617. * @param level - The tile level;
  39618. * @returns The credits to be displayed when the tile is displayed.
  39619. */
  39620. getTileCredits(x: number, y: number, level: number): Credit[];
  39621. /**
  39622. * Requests the image for a given tile. This function should
  39623. * not be called before {@link SingleTileImageryProvider#ready} returns true.
  39624. * @param x - The tile X coordinate.
  39625. * @param y - The tile Y coordinate.
  39626. * @param level - The tile level.
  39627. * @param [request] - The request object. Intended for internal use only.
  39628. * @returns The resolved image
  39629. */
  39630. requestImage(x: number, y: number, level: number, request?: Request): Promise<ImageryTypes> | undefined;
  39631. /**
  39632. * Picking features is not currently supported by this imagery provider, so this function simply returns
  39633. * undefined.
  39634. * @param x - The tile X coordinate.
  39635. * @param y - The tile Y coordinate.
  39636. * @param level - The tile level.
  39637. * @param longitude - The longitude at which to pick features.
  39638. * @param latitude - The latitude at which to pick features.
  39639. * @returns Undefined since picking is not supported.
  39640. */
  39641. pickFeatures(x: number, y: number, level: number, longitude: number, latitude: number): undefined;
  39642. }
  39643. /**
  39644. * An atmosphere drawn around the limb of the provided ellipsoid. Based on
  39645. * {@link http://nishitalab.org/user/nis/cdrom/sig93_nis.pdf|Display of The Earth Taking Into Account Atmospheric Scattering}.
  39646. * <p>
  39647. * This is only supported in 3D. Atmosphere is faded out when morphing to 2D or Columbus view.
  39648. * </p>
  39649. * @example
  39650. * scene.skyAtmosphere = new Cesium.SkyAtmosphere();
  39651. * @param [ellipsoid = Ellipsoid.WGS84] - The ellipsoid that the atmosphere is drawn around.
  39652. */
  39653. export class SkyAtmosphere {
  39654. constructor(ellipsoid?: Ellipsoid);
  39655. /**
  39656. * Determines if the atmosphere is shown.
  39657. */
  39658. show: boolean;
  39659. /**
  39660. * Compute atmosphere per-fragment instead of per-vertex.
  39661. * This produces better looking atmosphere with a slight performance penalty.
  39662. */
  39663. perFragmentAtmosphere: boolean;
  39664. /**
  39665. * The intensity of the light that is used for computing the sky atmosphere color.
  39666. */
  39667. atmosphereLightIntensity: number;
  39668. /**
  39669. * The Rayleigh scattering coefficient used in the atmospheric scattering equations for the sky atmosphere.
  39670. */
  39671. atmosphereRayleighCoefficient: Cartesian3;
  39672. /**
  39673. * The Mie scattering coefficient used in the atmospheric scattering equations for the sky atmosphere.
  39674. */
  39675. atmosphereMieCoefficient: Cartesian3;
  39676. /**
  39677. * The Rayleigh scale height used in the atmospheric scattering equations for the sky atmosphere, in meters.
  39678. */
  39679. atmosphereRayleighScaleHeight: number;
  39680. /**
  39681. * The Mie scale height used in the atmospheric scattering equations for the sky atmosphere, in meters.
  39682. */
  39683. atmosphereMieScaleHeight: number;
  39684. /**
  39685. * The anisotropy of the medium to consider for Mie scattering.
  39686. * <p>
  39687. * Valid values are between -1.0 and 1.0.
  39688. * </p>
  39689. */
  39690. atmosphereMieAnisotropy: number;
  39691. /**
  39692. * The hue shift to apply to the atmosphere. Defaults to 0.0 (no shift).
  39693. * A hue shift of 1.0 indicates a complete rotation of the hues available.
  39694. */
  39695. hueShift: number;
  39696. /**
  39697. * The saturation shift to apply to the atmosphere. Defaults to 0.0 (no shift).
  39698. * A saturation shift of -1.0 is monochrome.
  39699. */
  39700. saturationShift: number;
  39701. /**
  39702. * The brightness shift to apply to the atmosphere. Defaults to 0.0 (no shift).
  39703. * A brightness shift of -1.0 is complete darkness, which will let space show through.
  39704. */
  39705. brightnessShift: number;
  39706. /**
  39707. * Gets the ellipsoid the atmosphere is drawn around.
  39708. */
  39709. readonly ellipsoid: Ellipsoid;
  39710. /**
  39711. * Returns true if this object was destroyed; otherwise, false.
  39712. * <br /><br />
  39713. * If this object was destroyed, it should not be used; calling any function other than
  39714. * <code>isDestroyed</code> will result in a {@link DeveloperError} exception.
  39715. * @returns <code>true</code> if this object was destroyed; otherwise, <code>false</code>.
  39716. */
  39717. isDestroyed(): boolean;
  39718. /**
  39719. * Destroys the WebGL resources held by this object. Destroying an object allows for deterministic
  39720. * release of WebGL resources, instead of relying on the garbage collector to destroy this object.
  39721. * <br /><br />
  39722. * Once an object is destroyed, it should not be used; calling any function other than
  39723. * <code>isDestroyed</code> will result in a {@link DeveloperError} exception. Therefore,
  39724. * assign the return value (<code>undefined</code>) to the object as done in the example.
  39725. * @example
  39726. * skyAtmosphere = skyAtmosphere && skyAtmosphere.destroy();
  39727. */
  39728. destroy(): void;
  39729. }
  39730. /**
  39731. * A sky box around the scene to draw stars. The sky box is defined using the True Equator Mean Equinox (TEME) axes.
  39732. * <p>
  39733. * This is only supported in 3D. The sky box is faded out when morphing to 2D or Columbus view. The size of
  39734. * the sky box must not exceed {@link Scene#maximumCubeMapSize}.
  39735. * </p>
  39736. * @example
  39737. * scene.skyBox = new Cesium.SkyBox({
  39738. * sources : {
  39739. * positiveX : 'skybox_px.png',
  39740. * negativeX : 'skybox_nx.png',
  39741. * positiveY : 'skybox_py.png',
  39742. * negativeY : 'skybox_ny.png',
  39743. * positiveZ : 'skybox_pz.png',
  39744. * negativeZ : 'skybox_nz.png'
  39745. * }
  39746. * });
  39747. * @param options - Object with the following properties:
  39748. * @param [options.sources] - The source URL or <code>Image</code> object for each of the six cube map faces. See the example below.
  39749. * @param [options.show = true] - Determines if this primitive will be shown.
  39750. */
  39751. export class SkyBox {
  39752. constructor(options: {
  39753. sources?: any;
  39754. show?: boolean;
  39755. });
  39756. /**
  39757. * The sources used to create the cube map faces: an object
  39758. * with <code>positiveX</code>, <code>negativeX</code>, <code>positiveY</code>,
  39759. * <code>negativeY</code>, <code>positiveZ</code>, and <code>negativeZ</code> properties.
  39760. * These can be either URLs or <code>Image</code> objects.
  39761. */
  39762. sources: any;
  39763. /**
  39764. * Determines if the sky box will be shown.
  39765. */
  39766. show: boolean;
  39767. /**
  39768. * Called when {@link Viewer} or {@link CesiumWidget} render the scene to
  39769. * get the draw commands needed to render this primitive.
  39770. * <p>
  39771. * Do not call this function directly. This is documented just to
  39772. * list the exceptions that may be propagated when the scene is rendered:
  39773. * </p>
  39774. */
  39775. update(): void;
  39776. /**
  39777. * Returns true if this object was destroyed; otherwise, false.
  39778. * <br /><br />
  39779. * If this object was destroyed, it should not be used; calling any function other than
  39780. * <code>isDestroyed</code> will result in a {@link DeveloperError} exception.
  39781. * @returns <code>true</code> if this object was destroyed; otherwise, <code>false</code>.
  39782. */
  39783. isDestroyed(): boolean;
  39784. /**
  39785. * Destroys the WebGL resources held by this object. Destroying an object allows for deterministic
  39786. * release of WebGL resources, instead of relying on the garbage collector to destroy this object.
  39787. * <br /><br />
  39788. * Once an object is destroyed, it should not be used; calling any function other than
  39789. * <code>isDestroyed</code> will result in a {@link DeveloperError} exception. Therefore,
  39790. * assign the return value (<code>undefined</code>) to the object as done in the example.
  39791. * @example
  39792. * skyBox = skyBox && skyBox.destroy();
  39793. */
  39794. destroy(): void;
  39795. }
  39796. /**
  39797. * A ParticleEmitter that emits particles within a sphere.
  39798. * Particles will be positioned randomly within the sphere and have initial velocities emanating from the center of the sphere.
  39799. * @param [radius = 1.0] - The radius of the sphere in meters.
  39800. */
  39801. export class SphereEmitter {
  39802. constructor(radius?: number);
  39803. /**
  39804. * The radius of the sphere in meters.
  39805. */
  39806. radius: number;
  39807. }
  39808. /**
  39809. * The direction to display a primitive or ImageryLayer relative to the {@link Scene#splitPosition}.
  39810. */
  39811. export enum SplitDirection {
  39812. /**
  39813. * Display the primitive or ImageryLayer to the left of the {@link Scene#splitPosition}.
  39814. */
  39815. LEFT = -1,
  39816. /**
  39817. * Always display the primitive or ImageryLayer.
  39818. */
  39819. NONE = 0,
  39820. /**
  39821. * Display the primitive or ImageryLayer to the right of the {@link Scene#splitPosition}.
  39822. */
  39823. RIGHT = 1
  39824. }
  39825. /**
  39826. * Determines the function used to compare stencil values for the stencil test.
  39827. */
  39828. export enum StencilFunction {
  39829. /**
  39830. * The stencil test never passes.
  39831. */
  39832. NEVER = WebGLConstants.NEVER,
  39833. /**
  39834. * The stencil test passes when the masked reference value is less than the masked stencil value.
  39835. */
  39836. LESS = WebGLConstants.LESS,
  39837. /**
  39838. * The stencil test passes when the masked reference value is equal to the masked stencil value.
  39839. */
  39840. EQUAL = WebGLConstants.EQUAL,
  39841. /**
  39842. * The stencil test passes when the masked reference value is less than or equal to the masked stencil value.
  39843. */
  39844. LESS_OR_EQUAL = WebGLConstants.LEQUAL,
  39845. /**
  39846. * The stencil test passes when the masked reference value is greater than the masked stencil value.
  39847. */
  39848. GREATER = WebGLConstants.GREATER,
  39849. /**
  39850. * The stencil test passes when the masked reference value is not equal to the masked stencil value.
  39851. */
  39852. NOT_EQUAL = WebGLConstants.NOTEQUAL,
  39853. /**
  39854. * The stencil test passes when the masked reference value is greater than or equal to the masked stencil value.
  39855. */
  39856. GREATER_OR_EQUAL = WebGLConstants.GEQUAL,
  39857. /**
  39858. * The stencil test always passes.
  39859. */
  39860. ALWAYS = WebGLConstants.ALWAYS
  39861. }
  39862. /**
  39863. * Determines the action taken based on the result of the stencil test.
  39864. */
  39865. export enum StencilOperation {
  39866. /**
  39867. * Sets the stencil buffer value to zero.
  39868. */
  39869. ZERO = WebGLConstants.ZERO,
  39870. /**
  39871. * Does not change the stencil buffer.
  39872. */
  39873. KEEP = WebGLConstants.KEEP,
  39874. /**
  39875. * Replaces the stencil buffer value with the reference value.
  39876. */
  39877. REPLACE = WebGLConstants.REPLACE,
  39878. /**
  39879. * Increments the stencil buffer value, clamping to unsigned byte.
  39880. */
  39881. INCREMENT = WebGLConstants.INCR,
  39882. /**
  39883. * Decrements the stencil buffer value, clamping to zero.
  39884. */
  39885. DECREMENT = WebGLConstants.DECR,
  39886. /**
  39887. * Bitwise inverts the existing stencil buffer value.
  39888. */
  39889. INVERT = WebGLConstants.INVERT,
  39890. /**
  39891. * Increments the stencil buffer value, wrapping to zero when exceeding the unsigned byte range.
  39892. */
  39893. INCREMENT_WRAP = WebGLConstants.INCR_WRAP,
  39894. /**
  39895. * Decrements the stencil buffer value, wrapping to the maximum unsigned byte instead of going below zero.
  39896. */
  39897. DECREMENT_WRAP = WebGLConstants.DECR_WRAP
  39898. }
  39899. /**
  39900. * An expression for a style applied to a {@link Cesium3DTileset}.
  39901. * <p>
  39902. * Derived classes of this interface evaluate expressions in the
  39903. * {@link https://github.com/CesiumGS/3d-tiles/tree/main/specification/Styling|3D Tiles Styling language}.
  39904. * </p>
  39905. * <p>
  39906. * This type describes an interface and is not intended to be instantiated directly.
  39907. * </p>
  39908. */
  39909. export class StyleExpression {
  39910. constructor();
  39911. /**
  39912. * Evaluates the result of an expression, optionally using the provided feature's properties. If the result of
  39913. * the expression in the
  39914. * {@link https://github.com/CesiumGS/3d-tiles/tree/main/specification/Styling|3D Tiles Styling language}
  39915. * is of type <code>Boolean</code>, <code>Number</code>, or <code>String</code>, the corresponding JavaScript
  39916. * primitive type will be returned. If the result is a <code>RegExp</code>, a Javascript <code>RegExp</code>
  39917. * object will be returned. If the result is a <code>Cartesian2</code>, <code>Cartesian3</code>, or <code>Cartesian4</code>,
  39918. * a {@link Cartesian2}, {@link Cartesian3}, or {@link Cartesian4} object will be returned. If the <code>result</code> argument is
  39919. * a {@link Color}, the {@link Cartesian4} value is converted to a {@link Color} and then returned.
  39920. * @param feature - The feature whose properties may be used as variables in the expression.
  39921. * @param [result] - The object onto which to store the result.
  39922. * @returns The result of evaluating the expression.
  39923. */
  39924. evaluate(feature: Cesium3DTileFeature, result?: any): boolean | number | string | RegExp | Cartesian2 | Cartesian3 | Cartesian4 | Color;
  39925. /**
  39926. * Evaluates the result of a Color expression, optionally using the provided feature's properties.
  39927. * <p>
  39928. * This is equivalent to {@link StyleExpression#evaluate} but always returns a {@link Color} object.
  39929. * </p>
  39930. * @param feature - The feature whose properties may be used as variables in the expression.
  39931. * @param [result] - The object in which to store the result.
  39932. * @returns The modified result parameter or a new Color instance if one was not provided.
  39933. */
  39934. evaluateColor(feature: Cesium3DTileFeature, result?: Color): Color;
  39935. }
  39936. /**
  39937. * Draws a sun billboard.
  39938. * <p>This is only supported in 3D and Columbus view.</p>
  39939. * @example
  39940. * scene.sun = new Cesium.Sun();
  39941. */
  39942. export class Sun {
  39943. constructor();
  39944. /**
  39945. * Determines if the sun will be shown.
  39946. */
  39947. show: boolean;
  39948. /**
  39949. * Gets or sets a number that controls how "bright" the Sun's lens flare appears
  39950. * to be. Zero shows just the Sun's disc without any flare.
  39951. * Use larger values for a more pronounced flare around the Sun.
  39952. */
  39953. glowFactor: number;
  39954. /**
  39955. * Returns true if this object was destroyed; otherwise, false.
  39956. * <br /><br />
  39957. * If this object was destroyed, it should not be used; calling any function other than
  39958. * <code>isDestroyed</code> will result in a {@link DeveloperError} exception.
  39959. * @returns <code>true</code> if this object was destroyed; otherwise, <code>false</code>.
  39960. */
  39961. isDestroyed(): boolean;
  39962. /**
  39963. * Destroys the WebGL resources held by this object. Destroying an object allows for deterministic
  39964. * release of WebGL resources, instead of relying on the garbage collector to destroy this object.
  39965. * <br /><br />
  39966. * Once an object is destroyed, it should not be used; calling any function other than
  39967. * <code>isDestroyed</code> will result in a {@link DeveloperError} exception. Therefore,
  39968. * assign the return value (<code>undefined</code>) to the object as done in the example.
  39969. * @example
  39970. * sun = sun && sun.destroy();
  39971. *
  39972. *
  39973. */
  39974. destroy(): void;
  39975. }
  39976. /**
  39977. * A directional light source that originates from the Sun.
  39978. * @param [options] - Object with the following properties:
  39979. * @param [options.color = Color.WHITE] - The light's color.
  39980. * @param [options.intensity = 2.0] - The light's intensity.
  39981. */
  39982. export class SunLight {
  39983. constructor(options?: {
  39984. color?: Color;
  39985. intensity?: number;
  39986. });
  39987. /**
  39988. * The color of the light.
  39989. */
  39990. color: Color;
  39991. /**
  39992. * The intensity of the light.
  39993. */
  39994. intensity: number;
  39995. }
  39996. export namespace TileCoordinatesImageryProvider {
  39997. /**
  39998. * Initialization options for the TileCoordinatesImageryProvider constructor
  39999. * @property [tilingScheme = new GeographicTilingScheme()] - The tiling scheme for which to draw tiles.
  40000. * @property [ellipsoid] - The ellipsoid. If the tilingScheme is specified,
  40001. * this parameter is ignored and the tiling scheme's ellipsoid is used instead. If neither
  40002. * parameter is specified, the WGS84 ellipsoid is used.
  40003. * @property [color = Color.YELLOW] - The color to draw the tile box and label.
  40004. * @property [tileWidth = 256] - The width of the tile for level-of-detail selection purposes.
  40005. * @property [tileHeight = 256] - The height of the tile for level-of-detail selection purposes.
  40006. */
  40007. type ConstructorOptions = {
  40008. tilingScheme?: TilingScheme;
  40009. ellipsoid?: Ellipsoid;
  40010. color?: Color;
  40011. tileWidth?: number;
  40012. tileHeight?: number;
  40013. };
  40014. }
  40015. /**
  40016. * An {@link ImageryProvider} that draws a box around every rendered tile in the tiling scheme, and draws
  40017. * a label inside it indicating the X, Y, Level coordinates of the tile. This is mostly useful for
  40018. * debugging terrain and imagery rendering problems.
  40019. * @param [options] - Object describing initialization options
  40020. */
  40021. export class TileCoordinatesImageryProvider {
  40022. constructor(options?: TileCoordinatesImageryProvider.ConstructorOptions);
  40023. /**
  40024. * The default alpha blending value of this provider, with 0.0 representing fully transparent and
  40025. * 1.0 representing fully opaque.
  40026. */
  40027. defaultAlpha: number | undefined;
  40028. /**
  40029. * The default alpha blending value on the night side of the globe of this provider, with 0.0 representing fully transparent and
  40030. * 1.0 representing fully opaque.
  40031. */
  40032. defaultNightAlpha: number | undefined;
  40033. /**
  40034. * The default alpha blending value on the day side of the globe of this provider, with 0.0 representing fully transparent and
  40035. * 1.0 representing fully opaque.
  40036. */
  40037. defaultDayAlpha: number | undefined;
  40038. /**
  40039. * The default brightness of this provider. 1.0 uses the unmodified imagery color. Less than 1.0
  40040. * makes the imagery darker while greater than 1.0 makes it brighter.
  40041. */
  40042. defaultBrightness: number | undefined;
  40043. /**
  40044. * The default contrast of this provider. 1.0 uses the unmodified imagery color. Less than 1.0 reduces
  40045. * the contrast while greater than 1.0 increases it.
  40046. */
  40047. defaultContrast: number | undefined;
  40048. /**
  40049. * The default hue of this provider in radians. 0.0 uses the unmodified imagery color.
  40050. */
  40051. defaultHue: number | undefined;
  40052. /**
  40053. * The default saturation of this provider. 1.0 uses the unmodified imagery color. Less than 1.0 reduces the
  40054. * saturation while greater than 1.0 increases it.
  40055. */
  40056. defaultSaturation: number | undefined;
  40057. /**
  40058. * The default gamma correction to apply to this provider. 1.0 uses the unmodified imagery color.
  40059. */
  40060. defaultGamma: number | undefined;
  40061. /**
  40062. * The default texture minification filter to apply to this provider.
  40063. */
  40064. defaultMinificationFilter: TextureMinificationFilter;
  40065. /**
  40066. * The default texture magnification filter to apply to this provider.
  40067. */
  40068. defaultMagnificationFilter: TextureMagnificationFilter;
  40069. /**
  40070. * Gets the proxy used by this provider.
  40071. */
  40072. readonly proxy: Proxy;
  40073. /**
  40074. * Gets the width of each tile, in pixels. This function should
  40075. * not be called before {@link TileCoordinatesImageryProvider#ready} returns true.
  40076. */
  40077. readonly tileWidth: number;
  40078. /**
  40079. * Gets the height of each tile, in pixels. This function should
  40080. * not be called before {@link TileCoordinatesImageryProvider#ready} returns true.
  40081. */
  40082. readonly tileHeight: number;
  40083. /**
  40084. * Gets the maximum level-of-detail that can be requested. This function should
  40085. * not be called before {@link TileCoordinatesImageryProvider#ready} returns true.
  40086. */
  40087. readonly maximumLevel: number | undefined;
  40088. /**
  40089. * Gets the minimum level-of-detail that can be requested. This function should
  40090. * not be called before {@link TileCoordinatesImageryProvider#ready} returns true.
  40091. */
  40092. readonly minimumLevel: number;
  40093. /**
  40094. * Gets the tiling scheme used by this provider. This function should
  40095. * not be called before {@link TileCoordinatesImageryProvider#ready} returns true.
  40096. */
  40097. readonly tilingScheme: TilingScheme;
  40098. /**
  40099. * Gets the rectangle, in radians, of the imagery provided by this instance. This function should
  40100. * not be called before {@link TileCoordinatesImageryProvider#ready} returns true.
  40101. */
  40102. readonly rectangle: Rectangle;
  40103. /**
  40104. * Gets the tile discard policy. If not undefined, the discard policy is responsible
  40105. * for filtering out "missing" tiles via its shouldDiscardImage function. If this function
  40106. * returns undefined, no tiles are filtered. This function should
  40107. * not be called before {@link TileCoordinatesImageryProvider#ready} returns true.
  40108. */
  40109. readonly tileDiscardPolicy: TileDiscardPolicy;
  40110. /**
  40111. * Gets an event that is raised when the imagery provider encounters an asynchronous error. By subscribing
  40112. * to the event, you will be notified of the error and can potentially recover from it. Event listeners
  40113. * are passed an instance of {@link TileProviderError}.
  40114. */
  40115. readonly errorEvent: Event;
  40116. /**
  40117. * Gets a value indicating whether or not the provider is ready for use.
  40118. */
  40119. readonly ready: boolean;
  40120. /**
  40121. * Gets a promise that resolves to true when the provider is ready for use.
  40122. */
  40123. readonly readyPromise: Promise<boolean>;
  40124. /**
  40125. * Gets the credit to display when this imagery provider is active. Typically this is used to credit
  40126. * the source of the imagery. This function should not be called before {@link TileCoordinatesImageryProvider#ready} returns true.
  40127. */
  40128. readonly credit: Credit;
  40129. /**
  40130. * Gets a value indicating whether or not the images provided by this imagery provider
  40131. * include an alpha channel. If this property is false, an alpha channel, if present, will
  40132. * be ignored. If this property is true, any images without an alpha channel will be treated
  40133. * as if their alpha is 1.0 everywhere. Setting this property to false reduces memory usage
  40134. * and texture upload time.
  40135. */
  40136. readonly hasAlphaChannel: boolean;
  40137. /**
  40138. * Gets the credits to be displayed when a given tile is displayed.
  40139. * @param x - The tile X coordinate.
  40140. * @param y - The tile Y coordinate.
  40141. * @param level - The tile level;
  40142. * @returns The credits to be displayed when the tile is displayed.
  40143. */
  40144. getTileCredits(x: number, y: number, level: number): Credit[];
  40145. /**
  40146. * Requests the image for a given tile. This function should
  40147. * not be called before {@link TileCoordinatesImageryProvider#ready} returns true.
  40148. * @param x - The tile X coordinate.
  40149. * @param y - The tile Y coordinate.
  40150. * @param level - The tile level.
  40151. * @param [request] - The request object. Intended for internal use only.
  40152. * @returns The resolved image as a Canvas DOM object.
  40153. */
  40154. requestImage(x: number, y: number, level: number, request?: Request): Promise<HTMLCanvasElement>;
  40155. /**
  40156. * Picking features is not currently supported by this imagery provider, so this function simply returns
  40157. * undefined.
  40158. * @param x - The tile X coordinate.
  40159. * @param y - The tile Y coordinate.
  40160. * @param level - The tile level.
  40161. * @param longitude - The longitude at which to pick features.
  40162. * @param latitude - The latitude at which to pick features.
  40163. * @returns Undefined since picking is not supported.
  40164. */
  40165. pickFeatures(x: number, y: number, level: number, longitude: number, latitude: number): undefined;
  40166. }
  40167. /**
  40168. * A policy for discarding tile images according to some criteria. This type describes an
  40169. * interface and is not intended to be instantiated directly.
  40170. */
  40171. export class TileDiscardPolicy {
  40172. constructor();
  40173. /**
  40174. * Determines if the discard policy is ready to process images.
  40175. * @returns True if the discard policy is ready to process images; otherwise, false.
  40176. */
  40177. isReady(): boolean;
  40178. /**
  40179. * Given a tile image, decide whether to discard that image.
  40180. * @param image - An image to test.
  40181. * @returns True if the image should be discarded; otherwise, false.
  40182. */
  40183. shouldDiscardImage(image: HTMLImageElement): boolean;
  40184. }
  40185. export namespace TileMapServiceImageryProvider {
  40186. /**
  40187. * Initialization options for the TileMapServiceImageryProvider constructor
  40188. * @property [url = '.'] - Path to image tiles on server.
  40189. * @property [fileExtension = 'png'] - The file extension for images on the server.
  40190. * @property [credit = ''] - A credit for the data source, which is displayed on the canvas.
  40191. * @property [minimumLevel = 0] - The minimum level-of-detail supported by the imagery provider. Take care when specifying
  40192. * this that the number of tiles at the minimum level is small, such as four or less. A larger number is likely
  40193. * to result in rendering problems.
  40194. * @property [maximumLevel] - The maximum level-of-detail supported by the imagery provider, or undefined if there is no limit.
  40195. * @property [rectangle = Rectangle.MAX_VALUE] - The rectangle, in radians, covered by the image.
  40196. * @property [tilingScheme] - The tiling scheme specifying how the ellipsoidal
  40197. * surface is broken into tiles. If this parameter is not provided, a {@link WebMercatorTilingScheme}
  40198. * is used.
  40199. * @property [ellipsoid] - The ellipsoid. If the tilingScheme is specified,
  40200. * this parameter is ignored and the tiling scheme's ellipsoid is used instead. If neither
  40201. * parameter is specified, the WGS84 ellipsoid is used.
  40202. * @property [tileWidth = 256] - Pixel width of image tiles.
  40203. * @property [tileHeight = 256] - Pixel height of image tiles.
  40204. * @property [flipXY] - Older versions of gdal2tiles.py flipped X and Y values in tilemapresource.xml.
  40205. * Specifying this option will do the same, allowing for loading of these incorrect tilesets.
  40206. */
  40207. type ConstructorOptions = {
  40208. url?: Resource | string | Promise<Resource> | Promise<string>;
  40209. fileExtension?: string;
  40210. credit?: Credit | string;
  40211. minimumLevel?: number;
  40212. maximumLevel?: number;
  40213. rectangle?: Rectangle;
  40214. tilingScheme?: TilingScheme;
  40215. ellipsoid?: Ellipsoid;
  40216. tileWidth?: number;
  40217. tileHeight?: number;
  40218. flipXY?: boolean;
  40219. };
  40220. }
  40221. /**
  40222. * An imagery provider that provides tiled imagery as generated by
  40223. * {@link http://www.maptiler.org/|MapTiler}, {@link http://www.klokan.cz/projects/gdal2tiles/|GDAL2Tiles}, etc.
  40224. * @example
  40225. * const tms = new Cesium.TileMapServiceImageryProvider({
  40226. * url : '../images/cesium_maptiler/Cesium_Logo_Color',
  40227. * fileExtension: 'png',
  40228. * maximumLevel: 4,
  40229. * rectangle: new Cesium.Rectangle(
  40230. * Cesium.Math.toRadians(-120.0),
  40231. * Cesium.Math.toRadians(20.0),
  40232. * Cesium.Math.toRadians(-60.0),
  40233. * Cesium.Math.toRadians(40.0))
  40234. * });
  40235. * @param options - Object describing initialization options
  40236. */
  40237. export class TileMapServiceImageryProvider extends UrlTemplateImageryProvider {
  40238. constructor(options: TileMapServiceImageryProvider.ConstructorOptions);
  40239. }
  40240. /**
  40241. * Provides functionality for ImageryProviders that have time dynamic imagery
  40242. * @param options - Object with the following properties:
  40243. * @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.
  40244. * @param options.times - TimeIntervalCollection with its <code>data</code> property being an object containing time dynamic dimension and their values.
  40245. * @param options.requestImageFunction - A function that will request imagery tiles.
  40246. * @param options.reloadFunction - A function that will be called when all imagery tiles need to be reloaded.
  40247. */
  40248. export class TimeDynamicImagery {
  40249. constructor(options: {
  40250. clock: Clock;
  40251. times: TimeIntervalCollection;
  40252. requestImageFunction: (...params: any[]) => any;
  40253. reloadFunction: (...params: any[]) => any;
  40254. });
  40255. /**
  40256. * Gets or sets a clock that is used to get keep the time used for time dynamic parameters.
  40257. */
  40258. clock: Clock;
  40259. /**
  40260. * Gets or sets a time interval collection.
  40261. */
  40262. times: TimeIntervalCollection;
  40263. /**
  40264. * Gets the current interval.
  40265. */
  40266. currentInterval: TimeInterval;
  40267. /**
  40268. * Gets the tile from the cache if its available.
  40269. * @param x - The tile X coordinate.
  40270. * @param y - The tile Y coordinate.
  40271. * @param level - The tile level.
  40272. * @param [request] - The request object. Intended for internal use only.
  40273. * @returns A promise for the image that will resolve when the image is available, or
  40274. * undefined if the tile is not in the cache.
  40275. */
  40276. getFromCache(x: number, y: number, level: number, request?: Request): Promise<HTMLImageElement> | undefined;
  40277. /**
  40278. * Checks if the next interval is approaching and will start preload the tile if necessary. Otherwise it will
  40279. * just add the tile to a list to preload when we approach the next interval.
  40280. * @param x - The tile X coordinate.
  40281. * @param y - The tile Y coordinate.
  40282. * @param level - The tile level.
  40283. * @param [request] - The request object. Intended for internal use only.
  40284. */
  40285. checkApproachingInterval(x: number, y: number, level: number, request?: Request): void;
  40286. }
  40287. /**
  40288. * Provides playback of time-dynamic point cloud data.
  40289. * <p>
  40290. * Point cloud frames are prefetched in intervals determined by the average frame load time and the current clock speed.
  40291. * If intermediate frames cannot be loaded in time to meet playback speed, they will be skipped. If frames are sufficiently
  40292. * small or the clock is sufficiently slow then no frames will be skipped.
  40293. * </p>
  40294. * @param options - Object with the following properties:
  40295. * @param options.clock - A {@link Clock} instance that is used when determining the value for the time dimension.
  40296. * @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>.
  40297. * @param [options.show = true] - Determines if the point cloud will be shown.
  40298. * @param [options.modelMatrix = Matrix4.IDENTITY] - A 4x4 transformation matrix that transforms the point cloud.
  40299. * @param [options.shadows = ShadowMode.ENABLED] - Determines whether the point cloud casts or receives shadows from light sources.
  40300. * @param [options.maximumMemoryUsage = 256] - The maximum amount of memory in MB that can be used by the point cloud.
  40301. * @param [options.shading] - Options for constructing a {@link PointCloudShading} object to control point attenuation and eye dome lighting.
  40302. * @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.
  40303. * @param [options.clippingPlanes] - The {@link ClippingPlaneCollection} used to selectively disable rendering the point cloud.
  40304. */
  40305. export class TimeDynamicPointCloud {
  40306. constructor(options: {
  40307. clock: Clock;
  40308. intervals: TimeIntervalCollection;
  40309. show?: boolean;
  40310. modelMatrix?: Matrix4;
  40311. shadows?: ShadowMode;
  40312. maximumMemoryUsage?: number;
  40313. shading?: any;
  40314. style?: Cesium3DTileStyle;
  40315. clippingPlanes?: ClippingPlaneCollection;
  40316. });
  40317. /**
  40318. * Determines if the point cloud will be shown.
  40319. */
  40320. show: boolean;
  40321. /**
  40322. * A 4x4 transformation matrix that transforms the point cloud.
  40323. */
  40324. modelMatrix: Matrix4;
  40325. /**
  40326. * Determines whether the point cloud casts or receives shadows from light sources.
  40327. * <p>
  40328. * 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.
  40329. * </p>
  40330. * <p>
  40331. * Shadows are rendered only when {@link Viewer#shadows} is <code>true</code>.
  40332. * </p>
  40333. */
  40334. shadows: ShadowMode;
  40335. /**
  40336. * The maximum amount of GPU memory (in MB) that may be used to cache point cloud frames.
  40337. * <p>
  40338. * Frames that are not being loaded or rendered are unloaded to enforce this.
  40339. * </p>
  40340. * <p>
  40341. * If decreasing this value results in unloading tiles, the tiles are unloaded the next frame.
  40342. * </p>
  40343. */
  40344. maximumMemoryUsage: number;
  40345. /**
  40346. * Options for controlling point size based on geometric error and eye dome lighting.
  40347. */
  40348. shading: PointCloudShading;
  40349. /**
  40350. * The style, defined using the
  40351. * {@link https://github.com/CesiumGS/3d-tiles/tree/main/specification/Styling|3D Tiles Styling language},
  40352. * applied to each point in the point cloud.
  40353. * <p>
  40354. * Assign <code>undefined</code> to remove the style, which will restore the visual
  40355. * appearance of the point cloud to its default when no style was applied.
  40356. * </p>
  40357. * @example
  40358. * pointCloud.style = new Cesium.Cesium3DTileStyle({
  40359. * color : {
  40360. * conditions : [
  40361. * ['${Classification} === 0', 'color("purple", 0.5)'],
  40362. * ['${Classification} === 1', 'color("red")'],
  40363. * ['true', '${COLOR}']
  40364. * ]
  40365. * },
  40366. * show : '${Classification} !== 2'
  40367. * });
  40368. */
  40369. style: Cesium3DTileStyle;
  40370. /**
  40371. * The event fired to indicate that a frame failed to load. A frame may fail to load if the
  40372. * request for its uri fails or processing fails due to invalid content.
  40373. * <p>
  40374. * If there are no event listeners, error messages will be logged to the console.
  40375. * </p>
  40376. * <p>
  40377. * The error object passed to the listener contains two properties:
  40378. * <ul>
  40379. * <li><code>uri</code>: the uri of the failed frame.</li>
  40380. * <li><code>message</code>: the error message.</li>
  40381. * </ul>
  40382. * @example
  40383. * pointCloud.frameFailed.addEventListener(function(error) {
  40384. * console.log('An error occurred loading frame: ' + error.uri);
  40385. * console.log('Error: ' + error.message);
  40386. * });
  40387. */
  40388. frameFailed: Event;
  40389. /**
  40390. * The event fired to indicate that a new frame was rendered.
  40391. * <p>
  40392. * The time dynamic point cloud {@link TimeDynamicPointCloud} is passed to the event listener.
  40393. * </p>
  40394. * @example
  40395. * pointCloud.frameChanged.addEventListener(function(timeDynamicPointCloud) {
  40396. * viewer.camera.viewBoundingSphere(timeDynamicPointCloud.boundingSphere);
  40397. * });
  40398. */
  40399. frameChanged: Event;
  40400. /**
  40401. * The {@link ClippingPlaneCollection} used to selectively disable rendering the point cloud.
  40402. */
  40403. clippingPlanes: ClippingPlaneCollection;
  40404. /**
  40405. * The total amount of GPU memory in bytes used by the point cloud.
  40406. */
  40407. readonly totalMemoryUsageInBytes: number;
  40408. /**
  40409. * The bounding sphere of the frame being rendered. Returns <code>undefined</code> if no frame is being rendered.
  40410. */
  40411. readonly boundingSphere: BoundingSphere;
  40412. /**
  40413. * Gets the promise that will be resolved when the point cloud renders a frame for the first time.
  40414. */
  40415. readonly readyPromise: Promise<TimeDynamicPointCloud>;
  40416. /**
  40417. * Marks the point cloud's {@link TimeDynamicPointCloud#style} as dirty, which forces all
  40418. * points to re-evaluate the style in the next frame.
  40419. */
  40420. makeStyleDirty(): void;
  40421. /**
  40422. * Returns true if this object was destroyed; otherwise, false.
  40423. * <br /><br />
  40424. * If this object was destroyed, it should not be used; calling any function other than
  40425. * <code>isDestroyed</code> will result in a {@link DeveloperError} exception.
  40426. * @returns <code>true</code> if this object was destroyed; otherwise, <code>false</code>.
  40427. */
  40428. isDestroyed(): boolean;
  40429. /**
  40430. * Destroys the WebGL resources held by this object. Destroying an object allows for deterministic
  40431. * release of WebGL resources, instead of relying on the garbage collector to destroy this object.
  40432. * <br /><br />
  40433. * Once an object is destroyed, it should not be used; calling any function other than
  40434. * <code>isDestroyed</code> will result in a {@link DeveloperError} exception. Therefore,
  40435. * assign the return value (<code>undefined</code>) to the object as done in the example.
  40436. * @example
  40437. * pointCloud = pointCloud && pointCloud.destroy();
  40438. */
  40439. destroy(): void;
  40440. }
  40441. export namespace UrlTemplateImageryProvider {
  40442. /**
  40443. * Initialization options for the UrlTemplateImageryProvider constructor
  40444. * @property [options] - Object with the following properties:
  40445. * @property url - The URL template to use to request tiles. It has the following keywords:
  40446. * <ul>
  40447. * <li><code>{z}</code>: The level of the tile in the tiling scheme. Level zero is the root of the quadtree pyramid.</li>
  40448. * <li><code>{x}</code>: The tile X coordinate in the tiling scheme, where 0 is the Westernmost tile.</li>
  40449. * <li><code>{y}</code>: The tile Y coordinate in the tiling scheme, where 0 is the Northernmost tile.</li>
  40450. * <li><code>{s}</code>: One of the available subdomains, used to overcome browser limits on the number of simultaneous requests per host.</li>
  40451. * <li><code>{reverseX}</code>: The tile X coordinate in the tiling scheme, where 0 is the Easternmost tile.</li>
  40452. * <li><code>{reverseY}</code>: The tile Y coordinate in the tiling scheme, where 0 is the Southernmost tile.</li>
  40453. * <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>
  40454. * <li><code>{westDegrees}</code>: The Western edge of the tile in geodetic degrees.</li>
  40455. * <li><code>{southDegrees}</code>: The Southern edge of the tile in geodetic degrees.</li>
  40456. * <li><code>{eastDegrees}</code>: The Eastern edge of the tile in geodetic degrees.</li>
  40457. * <li><code>{northDegrees}</code>: The Northern edge of the tile in geodetic degrees.</li>
  40458. * <li><code>{westProjected}</code>: The Western edge of the tile in projected coordinates of the tiling scheme.</li>
  40459. * <li><code>{southProjected}</code>: The Southern edge of the tile in projected coordinates of the tiling scheme.</li>
  40460. * <li><code>{eastProjected}</code>: The Eastern edge of the tile in projected coordinates of the tiling scheme.</li>
  40461. * <li><code>{northProjected}</code>: The Northern edge of the tile in projected coordinates of the tiling scheme.</li>
  40462. * <li><code>{width}</code>: The width of each tile in pixels.</li>
  40463. * <li><code>{height}</code>: The height of each tile in pixels.</li>
  40464. * </ul>
  40465. * @property [pickFeaturesUrl] - The URL template to use to pick features. If this property is not specified,
  40466. * {@link UrlTemplateImageryProvider#pickFeatures} will immediately returned undefined, indicating no
  40467. * features picked. The URL template supports all of the keywords supported by the <code>url</code>
  40468. * parameter, plus the following:
  40469. * <ul>
  40470. * <li><code>{i}</code>: The pixel column (horizontal coordinate) of the picked position, where the Westernmost pixel is 0.</li>
  40471. * <li><code>{j}</code>: The pixel row (vertical coordinate) of the picked position, where the Northernmost pixel is 0.</li>
  40472. * <li><code>{reverseI}</code>: The pixel column (horizontal coordinate) of the picked position, where the Easternmost pixel is 0.</li>
  40473. * <li><code>{reverseJ}</code>: The pixel row (vertical coordinate) of the picked position, where the Southernmost pixel is 0.</li>
  40474. * <li><code>{longitudeDegrees}</code>: The longitude of the picked position in degrees.</li>
  40475. * <li><code>{latitudeDegrees}</code>: The latitude of the picked position in degrees.</li>
  40476. * <li><code>{longitudeProjected}</code>: The longitude of the picked position in the projected coordinates of the tiling scheme.</li>
  40477. * <li><code>{latitudeProjected}</code>: The latitude of the picked position in the projected coordinates of the tiling scheme.</li>
  40478. * <li><code>{format}</code>: The format in which to get feature information, as specified in the {@link GetFeatureInfoFormat}.</li>
  40479. * </ul>
  40480. * @property [urlSchemeZeroPadding] - Gets the URL scheme zero padding for each tile coordinate. The format is '000' where
  40481. * each coordinate will be padded on the left with zeros to match the width of the passed string of zeros. e.g. Setting:
  40482. * urlSchemeZeroPadding : { '{x}' : '0000'}
  40483. * will cause an 'x' value of 12 to return the string '0012' for {x} in the generated URL.
  40484. * It the passed object has the following keywords:
  40485. * <ul>
  40486. * <li> <code>{z}</code>: The zero padding for the level of the tile in the tiling scheme.</li>
  40487. * <li> <code>{x}</code>: The zero padding for the tile X coordinate in the tiling scheme.</li>
  40488. * <li> <code>{y}</code>: The zero padding for the the tile Y coordinate in the tiling scheme.</li>
  40489. * <li> <code>{reverseX}</code>: The zero padding for the tile reverseX coordinate in the tiling scheme.</li>
  40490. * <li> <code>{reverseY}</code>: The zero padding for the tile reverseY coordinate in the tiling scheme.</li>
  40491. * <li> <code>{reverseZ}</code>: The zero padding for the reverseZ coordinate of the tile in the tiling scheme.</li>
  40492. * </ul>
  40493. * @property [subdomains = 'abc'] - The subdomains to use for the <code>{s}</code> placeholder in the URL template.
  40494. * If this parameter is a single string, each character in the string is a subdomain. If it is
  40495. * an array, each element in the array is a subdomain.
  40496. * @property [credit = ''] - A credit for the data source, which is displayed on the canvas.
  40497. * @property [minimumLevel = 0] - The minimum level-of-detail supported by the imagery provider. Take care when specifying
  40498. * this that the number of tiles at the minimum level is small, such as four or less. A larger number is likely
  40499. * to result in rendering problems.
  40500. * @property [maximumLevel] - The maximum level-of-detail supported by the imagery provider, or undefined if there is no limit.
  40501. * @property [rectangle = Rectangle.MAX_VALUE] - The rectangle, in radians, covered by the image.
  40502. * @property [tilingScheme = WebMercatorTilingScheme] - The tiling scheme specifying how the ellipsoidal
  40503. * surface is broken into tiles. If this parameter is not provided, a {@link WebMercatorTilingScheme}
  40504. * is used.
  40505. * @property [ellipsoid] - The ellipsoid. If the tilingScheme is specified,
  40506. * this parameter is ignored and the tiling scheme's ellipsoid is used instead. If neither
  40507. * parameter is specified, the WGS84 ellipsoid is used.
  40508. * @property [tileWidth = 256] - Pixel width of image tiles.
  40509. * @property [tileHeight = 256] - Pixel height of image tiles.
  40510. * @property [hasAlphaChannel = true] - true if the images provided by this imagery provider
  40511. * include an alpha channel; otherwise, false. If this property is false, an alpha channel, if
  40512. * present, will be ignored. If this property is true, any images without an alpha channel will
  40513. * be treated as if their alpha is 1.0 everywhere. When this property is false, memory usage
  40514. * and texture upload time are potentially reduced.
  40515. * @property [getFeatureInfoFormats] - The formats in which to get feature information at a
  40516. * specific location when {@link UrlTemplateImageryProvider#pickFeatures} is invoked. If this
  40517. * parameter is not specified, feature picking is disabled.
  40518. * @property [enablePickFeatures = true] - If true, {@link UrlTemplateImageryProvider#pickFeatures} will
  40519. * request the <code>pickFeaturesUrl</code> and attempt to interpret the features included in the response. If false,
  40520. * {@link UrlTemplateImageryProvider#pickFeatures} will immediately return undefined (indicating no pickable
  40521. * features) without communicating with the server. Set this property to false if you know your data
  40522. * source does not support picking features or if you don't want this provider's features to be pickable. Note
  40523. * that this can be dynamically overridden by modifying the {@link UriTemplateImageryProvider#enablePickFeatures}
  40524. * property.
  40525. * @property [customTags] - Allow to replace custom keywords in the URL template. The object must have strings as keys and functions as values.
  40526. */
  40527. type ConstructorOptions = {
  40528. options?: Promise<object> | any;
  40529. url: Resource | string;
  40530. pickFeaturesUrl?: Resource | string;
  40531. urlSchemeZeroPadding?: any;
  40532. subdomains?: string | string[];
  40533. credit?: Credit | string;
  40534. minimumLevel?: number;
  40535. maximumLevel?: number;
  40536. rectangle?: Rectangle;
  40537. tilingScheme?: TilingScheme;
  40538. ellipsoid?: Ellipsoid;
  40539. tileWidth?: number;
  40540. tileHeight?: number;
  40541. hasAlphaChannel?: boolean;
  40542. getFeatureInfoFormats?: GetFeatureInfoFormat[];
  40543. enablePickFeatures?: boolean;
  40544. customTags?: any;
  40545. };
  40546. }
  40547. /**
  40548. * Provides imagery by requesting tiles using a specified URL template.
  40549. * @example
  40550. * // Access Natural Earth II imagery, which uses a TMS tiling scheme and Geographic (EPSG:4326) project
  40551. * const tms = new Cesium.UrlTemplateImageryProvider({
  40552. * url : Cesium.buildModuleUrl('Assets/Textures/NaturalEarthII') + '/{z}/{x}/{reverseY}.jpg',
  40553. * credit : '© Analytical Graphics, Inc.',
  40554. * tilingScheme : new Cesium.GeographicTilingScheme(),
  40555. * maximumLevel : 5
  40556. * });
  40557. * // Access the CartoDB Positron basemap, which uses an OpenStreetMap-like tiling scheme.
  40558. * const positron = new Cesium.UrlTemplateImageryProvider({
  40559. * url : 'http://{s}.basemaps.cartocdn.com/light_all/{z}/{x}/{y}.png',
  40560. * credit : 'Map tiles by CartoDB, under CC BY 3.0. Data by OpenStreetMap, under ODbL.'
  40561. * });
  40562. * // Access a Web Map Service (WMS) server.
  40563. * const wms = new Cesium.UrlTemplateImageryProvider({
  40564. * url : 'https://programs.communications.gov.au/geoserver/ows?tiled=true&' +
  40565. * 'transparent=true&format=image%2Fpng&exceptions=application%2Fvnd.ogc.se_xml&' +
  40566. * 'styles=&service=WMS&version=1.1.1&request=GetMap&' +
  40567. * 'layers=public%3AMyBroadband_Availability&srs=EPSG%3A3857&' +
  40568. * 'bbox={westProjected}%2C{southProjected}%2C{eastProjected}%2C{northProjected}&' +
  40569. * 'width=256&height=256',
  40570. * rectangle : Cesium.Rectangle.fromDegrees(96.799393, -43.598214999057824, 153.63925700000001, -9.2159219997013)
  40571. * });
  40572. * // Using custom tags in your template url.
  40573. * const custom = new Cesium.UrlTemplateImageryProvider({
  40574. * url : 'https://yoururl/{Time}/{z}/{y}/{x}.png',
  40575. * customTags : {
  40576. * Time: function(imageryProvider, x, y, level) {
  40577. * return '20171231'
  40578. * }
  40579. * }
  40580. * });
  40581. * @param options - Object describing initialization options
  40582. */
  40583. export class UrlTemplateImageryProvider {
  40584. constructor(options: UrlTemplateImageryProvider.ConstructorOptions);
  40585. /**
  40586. * The default alpha blending value of this provider, with 0.0 representing fully transparent and
  40587. * 1.0 representing fully opaque.
  40588. */
  40589. defaultAlpha: number | undefined;
  40590. /**
  40591. * The default alpha blending value on the night side of the globe of this provider, with 0.0 representing fully transparent and
  40592. * 1.0 representing fully opaque.
  40593. */
  40594. defaultNightAlpha: number | undefined;
  40595. /**
  40596. * The default alpha blending value on the day side of the globe of this provider, with 0.0 representing fully transparent and
  40597. * 1.0 representing fully opaque.
  40598. */
  40599. defaultDayAlpha: number | undefined;
  40600. /**
  40601. * The default brightness of this provider. 1.0 uses the unmodified imagery color. Less than 1.0
  40602. * makes the imagery darker while greater than 1.0 makes it brighter.
  40603. */
  40604. defaultBrightness: number | undefined;
  40605. /**
  40606. * The default contrast of this provider. 1.0 uses the unmodified imagery color. Less than 1.0 reduces
  40607. * the contrast while greater than 1.0 increases it.
  40608. */
  40609. defaultContrast: number | undefined;
  40610. /**
  40611. * The default hue of this provider in radians. 0.0 uses the unmodified imagery color.
  40612. */
  40613. defaultHue: number | undefined;
  40614. /**
  40615. * The default saturation of this provider. 1.0 uses the unmodified imagery color. Less than 1.0 reduces the
  40616. * saturation while greater than 1.0 increases it.
  40617. */
  40618. defaultSaturation: number | undefined;
  40619. /**
  40620. * The default gamma correction to apply to this provider. 1.0 uses the unmodified imagery color.
  40621. */
  40622. defaultGamma: number | undefined;
  40623. /**
  40624. * The default texture minification filter to apply to this provider.
  40625. */
  40626. defaultMinificationFilter: TextureMinificationFilter;
  40627. /**
  40628. * The default texture magnification filter to apply to this provider.
  40629. */
  40630. defaultMagnificationFilter: TextureMagnificationFilter;
  40631. /**
  40632. * Gets or sets a value indicating whether feature picking is enabled. If true, {@link UrlTemplateImageryProvider#pickFeatures} will
  40633. * request the <code>options.pickFeaturesUrl</code> and attempt to interpret the features included in the response. If false,
  40634. * {@link UrlTemplateImageryProvider#pickFeatures} will immediately return undefined (indicating no pickable
  40635. * features) without communicating with the server. Set this property to false if you know your data
  40636. * source does not support picking features or if you don't want this provider's features to be pickable.
  40637. */
  40638. enablePickFeatures: boolean;
  40639. /**
  40640. * Gets the URL template to use to request tiles. It has the following keywords:
  40641. * <ul>
  40642. * <li> <code>{z}</code>: The level of the tile in the tiling scheme. Level zero is the root of the quadtree pyramid.</li>
  40643. * <li> <code>{x}</code>: The tile X coordinate in the tiling scheme, where 0 is the Westernmost tile.</li>
  40644. * <li> <code>{y}</code>: The tile Y coordinate in the tiling scheme, where 0 is the Northernmost tile.</li>
  40645. * <li> <code>{s}</code>: One of the available subdomains, used to overcome browser limits on the number of simultaneous requests per host.</li>
  40646. * <li> <code>{reverseX}</code>: The tile X coordinate in the tiling scheme, where 0 is the Easternmost tile.</li>
  40647. * <li> <code>{reverseY}</code>: The tile Y coordinate in the tiling scheme, where 0 is the Southernmost tile.</li>
  40648. * <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>
  40649. * <li> <code>{westDegrees}</code>: The Western edge of the tile in geodetic degrees.</li>
  40650. * <li> <code>{southDegrees}</code>: The Southern edge of the tile in geodetic degrees.</li>
  40651. * <li> <code>{eastDegrees}</code>: The Eastern edge of the tile in geodetic degrees.</li>
  40652. * <li> <code>{northDegrees}</code>: The Northern edge of the tile in geodetic degrees.</li>
  40653. * <li> <code>{westProjected}</code>: The Western edge of the tile in projected coordinates of the tiling scheme.</li>
  40654. * <li> <code>{southProjected}</code>: The Southern edge of the tile in projected coordinates of the tiling scheme.</li>
  40655. * <li> <code>{eastProjected}</code>: The Eastern edge of the tile in projected coordinates of the tiling scheme.</li>
  40656. * <li> <code>{northProjected}</code>: The Northern edge of the tile in projected coordinates of the tiling scheme.</li>
  40657. * <li> <code>{width}</code>: The width of each tile in pixels.</li>
  40658. * <li> <code>{height}</code>: The height of each tile in pixels.</li>
  40659. * </ul>
  40660. */
  40661. readonly url: string;
  40662. /**
  40663. * Gets the URL scheme zero padding for each tile coordinate. The format is '000' where each coordinate will be padded on
  40664. * the left with zeros to match the width of the passed string of zeros. e.g. Setting:
  40665. * urlSchemeZeroPadding : { '{x}' : '0000'}
  40666. * will cause an 'x' value of 12 to return the string '0012' for {x} in the generated URL.
  40667. * It has the following keywords:
  40668. * <ul>
  40669. * <li> <code>{z}</code>: The zero padding for the level of the tile in the tiling scheme.</li>
  40670. * <li> <code>{x}</code>: The zero padding for the tile X coordinate in the tiling scheme.</li>
  40671. * <li> <code>{y}</code>: The zero padding for the the tile Y coordinate in the tiling scheme.</li>
  40672. * <li> <code>{reverseX}</code>: The zero padding for the tile reverseX coordinate in the tiling scheme.</li>
  40673. * <li> <code>{reverseY}</code>: The zero padding for the tile reverseY coordinate in the tiling scheme.</li>
  40674. * <li> <code>{reverseZ}</code>: The zero padding for the reverseZ coordinate of the tile in the tiling scheme.</li>
  40675. * </ul>
  40676. */
  40677. readonly urlSchemeZeroPadding: any;
  40678. /**
  40679. * Gets the URL template to use to use to pick features. If this property is not specified,
  40680. * {@link UrlTemplateImageryProvider#pickFeatures} will immediately return undefined, indicating no
  40681. * features picked. The URL template supports all of the keywords supported by the
  40682. * {@link UrlTemplateImageryProvider#url} property, plus the following:
  40683. * <ul>
  40684. * <li><code>{i}</code>: The pixel column (horizontal coordinate) of the picked position, where the Westernmost pixel is 0.</li>
  40685. * <li><code>{j}</code>: The pixel row (vertical coordinate) of the picked position, where the Northernmost pixel is 0.</li>
  40686. * <li><code>{reverseI}</code>: The pixel column (horizontal coordinate) of the picked position, where the Easternmost pixel is 0.</li>
  40687. * <li><code>{reverseJ}</code>: The pixel row (vertical coordinate) of the picked position, where the Southernmost pixel is 0.</li>
  40688. * <li><code>{longitudeDegrees}</code>: The longitude of the picked position in degrees.</li>
  40689. * <li><code>{latitudeDegrees}</code>: The latitude of the picked position in degrees.</li>
  40690. * <li><code>{longitudeProjected}</code>: The longitude of the picked position in the projected coordinates of the tiling scheme.</li>
  40691. * <li><code>{latitudeProjected}</code>: The latitude of the picked position in the projected coordinates of the tiling scheme.</li>
  40692. * <li><code>{format}</code>: The format in which to get feature information, as specified in the {@link GetFeatureInfoFormat}.</li>
  40693. * </ul>
  40694. */
  40695. readonly pickFeaturesUrl: string;
  40696. /**
  40697. * Gets the proxy used by this provider.
  40698. */
  40699. readonly proxy: Proxy;
  40700. /**
  40701. * Gets the width of each tile, in pixels. This function should
  40702. * not be called before {@link UrlTemplateImageryProvider#ready} returns true.
  40703. */
  40704. readonly tileWidth: number;
  40705. /**
  40706. * Gets the height of each tile, in pixels. This function should
  40707. * not be called before {@link UrlTemplateImageryProvider#ready} returns true.
  40708. */
  40709. readonly tileHeight: number;
  40710. /**
  40711. * Gets the maximum level-of-detail that can be requested, or undefined if there is no limit.
  40712. * This function should not be called before {@link UrlTemplateImageryProvider#ready} returns true.
  40713. */
  40714. readonly maximumLevel: number | undefined;
  40715. /**
  40716. * Gets the minimum level-of-detail that can be requested. This function should
  40717. * not be called before {@link UrlTemplateImageryProvider#ready} returns true.
  40718. */
  40719. readonly minimumLevel: number;
  40720. /**
  40721. * Gets the tiling scheme used by this provider. This function should
  40722. * not be called before {@link UrlTemplateImageryProvider#ready} returns true.
  40723. */
  40724. readonly tilingScheme: TilingScheme;
  40725. /**
  40726. * Gets the rectangle, in radians, of the imagery provided by this instance. This function should
  40727. * not be called before {@link UrlTemplateImageryProvider#ready} returns true.
  40728. */
  40729. readonly rectangle: Rectangle;
  40730. /**
  40731. * Gets the tile discard policy. If not undefined, the discard policy is responsible
  40732. * for filtering out "missing" tiles via its shouldDiscardImage function. If this function
  40733. * returns undefined, no tiles are filtered. This function should
  40734. * not be called before {@link UrlTemplateImageryProvider#ready} returns true.
  40735. */
  40736. readonly tileDiscardPolicy: TileDiscardPolicy;
  40737. /**
  40738. * Gets an event that is raised when the imagery provider encounters an asynchronous error. By subscribing
  40739. * to the event, you will be notified of the error and can potentially recover from it. Event listeners
  40740. * are passed an instance of {@link TileProviderError}.
  40741. */
  40742. readonly errorEvent: Event;
  40743. /**
  40744. * Gets a value indicating whether or not the provider is ready for use.
  40745. */
  40746. readonly ready: boolean;
  40747. /**
  40748. * Gets a promise that resolves to true when the provider is ready for use.
  40749. */
  40750. readonly readyPromise: Promise<boolean>;
  40751. /**
  40752. * Gets the credit to display when this imagery provider is active. Typically this is used to credit
  40753. * the source of the imagery. This function should not be called before {@link UrlTemplateImageryProvider#ready} returns true.
  40754. */
  40755. readonly credit: Credit;
  40756. /**
  40757. * Gets a value indicating whether or not the images provided by this imagery provider
  40758. * include an alpha channel. If this property is false, an alpha channel, if present, will
  40759. * be ignored. If this property is true, any images without an alpha channel will be treated
  40760. * as if their alpha is 1.0 everywhere. When this property is false, memory usage
  40761. * and texture upload time are reduced. This function should
  40762. * not be called before {@link ImageryProvider#ready} returns true.
  40763. */
  40764. readonly hasAlphaChannel: boolean;
  40765. /**
  40766. * Reinitializes this instance. Reinitializing an instance already in use is supported, but it is not
  40767. * recommended because existing tiles provided by the imagery provider will not be updated.
  40768. * @param options - Any of the options that may be passed to the {@link UrlTemplateImageryProvider} constructor.
  40769. */
  40770. reinitialize(options: Promise<object> | any): void;
  40771. /**
  40772. * Gets the credits to be displayed when a given tile is displayed.
  40773. * @param x - The tile X coordinate.
  40774. * @param y - The tile Y coordinate.
  40775. * @param level - The tile level;
  40776. * @returns The credits to be displayed when the tile is displayed.
  40777. */
  40778. getTileCredits(x: number, y: number, level: number): Credit[];
  40779. /**
  40780. * Requests the image for a given tile. This function should
  40781. * not be called before {@link UrlTemplateImageryProvider#ready} returns true.
  40782. * @param x - The tile X coordinate.
  40783. * @param y - The tile Y coordinate.
  40784. * @param level - The tile level.
  40785. * @param [request] - The request object. Intended for internal use only.
  40786. * @returns A promise for the image that will resolve when the image is available, or
  40787. * undefined if there are too many active requests to the server, and the request should be retried later.
  40788. */
  40789. requestImage(x: number, y: number, level: number, request?: Request): Promise<ImageryTypes> | undefined;
  40790. /**
  40791. * Asynchronously determines what features, if any, are located at a given longitude and latitude within
  40792. * a tile. This function should not be called before {@link ImageryProvider#ready} returns true.
  40793. * @param x - The tile X coordinate.
  40794. * @param y - The tile Y coordinate.
  40795. * @param level - The tile level.
  40796. * @param longitude - The longitude at which to pick features.
  40797. * @param latitude - The latitude at which to pick features.
  40798. * @returns A promise for the picked features that will resolve when the asynchronous
  40799. * picking completes. The resolved value is an array of {@link ImageryLayerFeatureInfo}
  40800. * instances. The array may be empty if no features are found at the given location.
  40801. * It may also be undefined if picking is not supported.
  40802. */
  40803. pickFeatures(x: number, y: number, level: number, longitude: number, latitude: number): Promise<ImageryLayerFeatureInfo[]> | undefined;
  40804. }
  40805. /**
  40806. * The vertical location of an origin relative to an object, e.g., a {@link Billboard}
  40807. * or {@link Label}. For example, setting the vertical origin to <code>TOP</code>
  40808. * or <code>BOTTOM</code> will display a billboard above or below (in screen space)
  40809. * the anchor position.
  40810. * <br /><br />
  40811. * <div align='center'>
  40812. * <img src='Images/Billboard.setVerticalOrigin.png' width='695' height='175' /><br />
  40813. * </div>
  40814. */
  40815. export enum VerticalOrigin {
  40816. /**
  40817. * The origin is at the vertical center between <code>BASELINE</code> and <code>TOP</code>.
  40818. */
  40819. CENTER = 0,
  40820. /**
  40821. * The origin is at the bottom of the object.
  40822. */
  40823. BOTTOM = 1,
  40824. /**
  40825. * If the object contains text, the origin is at the baseline of the text, else the origin is at the bottom of the object.
  40826. */
  40827. BASELINE = 2,
  40828. /**
  40829. * The origin is at the top of the object.
  40830. */
  40831. TOP = -1
  40832. }
  40833. /**
  40834. * A viewport aligned quad.
  40835. * @example
  40836. * const viewportQuad = new Cesium.ViewportQuad(new Cesium.BoundingRectangle(0, 0, 80, 40));
  40837. * viewportQuad.material.uniforms.color = new Cesium.Color(1.0, 0.0, 0.0, 1.0);
  40838. * @param [rectangle] - The {@link BoundingRectangle} defining the quad's position within the viewport.
  40839. * @param [material] - The {@link Material} defining the surface appearance of the viewport quad.
  40840. */
  40841. export class ViewportQuad {
  40842. constructor(rectangle?: BoundingRectangle, material?: Material);
  40843. /**
  40844. * Determines if the viewport quad primitive will be shown.
  40845. */
  40846. show: boolean;
  40847. /**
  40848. * The BoundingRectangle defining the quad's position within the viewport.
  40849. * @example
  40850. * viewportQuad.rectangle = new Cesium.BoundingRectangle(0, 0, 80, 40);
  40851. */
  40852. rectangle: BoundingRectangle;
  40853. /**
  40854. * The surface appearance of the viewport quad. This can be one of several built-in {@link Material} objects or a custom material, scripted with
  40855. * {@link https://github.com/CesiumGS/cesium/wiki/Fabric|Fabric}.
  40856. * <p>
  40857. * The default material is <code>Material.ColorType</code>.
  40858. * </p>
  40859. * @example
  40860. * // 1. Change the color of the default material to yellow
  40861. * viewportQuad.material.uniforms.color = new Cesium.Color(1.0, 1.0, 0.0, 1.0);
  40862. *
  40863. * // 2. Change material to horizontal stripes
  40864. * viewportQuad.material = Cesium.Material.fromType(Cesium.Material.StripeType);
  40865. */
  40866. material: Material;
  40867. /**
  40868. * Called when {@link Viewer} or {@link CesiumWidget} render the scene to
  40869. * get the draw commands needed to render this primitive.
  40870. * <p>
  40871. * Do not call this function directly. This is documented just to
  40872. * list the exceptions that may be propagated when the scene is rendered:
  40873. * </p>
  40874. */
  40875. update(): void;
  40876. /**
  40877. * Returns true if this object was destroyed; otherwise, false.
  40878. * <br /><br />
  40879. * If this object was destroyed, it should not be used; calling any function other than
  40880. * <code>isDestroyed</code> will result in a {@link DeveloperError} exception.
  40881. * @returns True if this object was destroyed; otherwise, false.
  40882. */
  40883. isDestroyed(): boolean;
  40884. /**
  40885. * Destroys the WebGL resources held by this object. Destroying an object allows for deterministic
  40886. * release of WebGL resources, instead of relying on the garbage collector to destroy this object.
  40887. * <br /><br />
  40888. * Once an object is destroyed, it should not be used; calling any function other than
  40889. * <code>isDestroyed</code> will result in a {@link DeveloperError} exception. Therefore,
  40890. * assign the return value (<code>undefined</code>) to the object as done in the example.
  40891. * @example
  40892. * quad = quad && quad.destroy();
  40893. */
  40894. destroy(): void;
  40895. }
  40896. /**
  40897. * EPSG codes known to include reverse axis orders, but are not within 4000-5000.
  40898. */
  40899. export const includesReverseAxis: number[];
  40900. /**
  40901. * EPSG codes known to not include reverse axis orders, and are within 4000-5000.
  40902. */
  40903. export const excludesReverseAxis: number[];
  40904. export namespace WebMapServiceImageryProvider {
  40905. /**
  40906. * Initialization options for the WebMapServiceImageryProvider constructor
  40907. * @property url - The URL of the WMS service. The URL supports the same keywords as the {@link UrlTemplateImageryProvider}.
  40908. * @property layers - The layers to include, separated by commas.
  40909. * @property [parameters = WebMapServiceImageryProvider.DefaultParameters] - Additional parameters to pass to the WMS server in the GetMap URL.
  40910. * @property [getFeatureInfoParameters = WebMapServiceImageryProvider.GetFeatureInfoDefaultParameters] - Additional parameters to pass to the WMS server in the GetFeatureInfo URL.
  40911. * @property [enablePickFeatures = true] - If true, {@link WebMapServiceImageryProvider#pickFeatures} will invoke
  40912. * the GetFeatureInfo operation on the WMS server and return the features included in the response. If false,
  40913. * {@link WebMapServiceImageryProvider#pickFeatures} will immediately return undefined (indicating no pickable features)
  40914. * without communicating with the server. Set this property to false if you know your WMS server does not support
  40915. * GetFeatureInfo or if you don't want this provider's features to be pickable. Note that this can be dynamically
  40916. * overridden by modifying the WebMapServiceImageryProvider#enablePickFeatures property.
  40917. * @property [getFeatureInfoFormats = WebMapServiceImageryProvider.DefaultGetFeatureInfoFormats] - The formats
  40918. * in which to try WMS GetFeatureInfo requests.
  40919. * @property [rectangle = Rectangle.MAX_VALUE] - The rectangle of the layer.
  40920. * @property [tilingScheme = new GeographicTilingScheme()] - The tiling scheme to use to divide the world into tiles.
  40921. * @property [ellipsoid] - The ellipsoid. If the tilingScheme is specified,
  40922. * this parameter is ignored and the tiling scheme's ellipsoid is used instead. If neither
  40923. * parameter is specified, the WGS84 ellipsoid is used.
  40924. * @property [tileWidth = 256] - The width of each tile in pixels.
  40925. * @property [tileHeight = 256] - The height of each tile in pixels.
  40926. * @property [minimumLevel = 0] - The minimum level-of-detail supported by the imagery provider. Take care when
  40927. * specifying this that the number of tiles at the minimum level is small, such as four or less. A larger number is
  40928. * likely to result in rendering problems.
  40929. * @property [maximumLevel] - The maximum level-of-detail supported by the imagery provider, or undefined if there is no limit.
  40930. * If not specified, there is no limit.
  40931. * @property [crs] - CRS specification, for use with WMS specification >= 1.3.0.
  40932. * @property [srs] - SRS specification, for use with WMS specification 1.1.0 or 1.1.1
  40933. * @property [credit] - A credit for the data source, which is displayed on the canvas.
  40934. * @property [subdomains = 'abc'] - The subdomains to use for the <code>{s}</code> placeholder in the URL template.
  40935. * If this parameter is a single string, each character in the string is a subdomain. If it is
  40936. * an array, each element in the array is a subdomain.
  40937. * @property [clock] - A Clock instance that is used when determining the value for the time dimension. Required when `times` is specified.
  40938. * @property [times] - TimeIntervalCollection with its data property being an object containing time dynamic dimension and their values.
  40939. * @property [getFeatureInfoUrl] - The getFeatureInfo URL of the WMS service. If the property is not defined then we use the property value of url.
  40940. */
  40941. type ConstructorOptions = {
  40942. url: Resource | string;
  40943. layers: string;
  40944. parameters?: any;
  40945. getFeatureInfoParameters?: any;
  40946. enablePickFeatures?: boolean;
  40947. getFeatureInfoFormats?: GetFeatureInfoFormat[];
  40948. rectangle?: Rectangle;
  40949. tilingScheme?: TilingScheme;
  40950. ellipsoid?: Ellipsoid;
  40951. tileWidth?: number;
  40952. tileHeight?: number;
  40953. minimumLevel?: number;
  40954. maximumLevel?: number;
  40955. crs?: string;
  40956. srs?: string;
  40957. credit?: Credit | string;
  40958. subdomains?: string | string[];
  40959. clock?: Clock;
  40960. times?: TimeIntervalCollection;
  40961. getFeatureInfoUrl?: Resource | string;
  40962. };
  40963. }
  40964. /**
  40965. * Provides tiled imagery hosted by a Web Map Service (WMS) server.
  40966. * @example
  40967. * const provider = new Cesium.WebMapServiceImageryProvider({
  40968. * url : 'https://sampleserver1.arcgisonline.com/ArcGIS/services/Specialty/ESRI_StatesCitiesRivers_USA/MapServer/WMSServer',
  40969. * layers : '0',
  40970. * proxy: new Cesium.DefaultProxy('/proxy/')
  40971. * });
  40972. *
  40973. * viewer.imageryLayers.addImageryProvider(provider);
  40974. * @param options - Object describing initialization options
  40975. */
  40976. export class WebMapServiceImageryProvider {
  40977. constructor(options: WebMapServiceImageryProvider.ConstructorOptions);
  40978. /**
  40979. * The default alpha blending value of this provider, with 0.0 representing fully transparent and
  40980. * 1.0 representing fully opaque.
  40981. */
  40982. defaultAlpha: number | undefined;
  40983. /**
  40984. * The default alpha blending value on the night side of the globe of this provider, with 0.0 representing fully transparent and
  40985. * 1.0 representing fully opaque.
  40986. */
  40987. defaultNightAlpha: number | undefined;
  40988. /**
  40989. * The default alpha blending value on the day side of the globe of this provider, with 0.0 representing fully transparent and
  40990. * 1.0 representing fully opaque.
  40991. */
  40992. defaultDayAlpha: number | undefined;
  40993. /**
  40994. * The default brightness of this provider. 1.0 uses the unmodified imagery color. Less than 1.0
  40995. * makes the imagery darker while greater than 1.0 makes it brighter.
  40996. */
  40997. defaultBrightness: number | undefined;
  40998. /**
  40999. * The default contrast of this provider. 1.0 uses the unmodified imagery color. Less than 1.0 reduces
  41000. * the contrast while greater than 1.0 increases it.
  41001. */
  41002. defaultContrast: number | undefined;
  41003. /**
  41004. * The default hue of this provider in radians. 0.0 uses the unmodified imagery color.
  41005. */
  41006. defaultHue: number | undefined;
  41007. /**
  41008. * The default saturation of this provider. 1.0 uses the unmodified imagery color. Less than 1.0 reduces the
  41009. * saturation while greater than 1.0 increases it.
  41010. */
  41011. defaultSaturation: number | undefined;
  41012. /**
  41013. * The default gamma correction to apply to this provider. 1.0 uses the unmodified imagery color.
  41014. */
  41015. defaultGamma: number | undefined;
  41016. /**
  41017. * The default texture minification filter to apply to this provider.
  41018. */
  41019. defaultMinificationFilter: TextureMinificationFilter;
  41020. /**
  41021. * The default texture magnification filter to apply to this provider.
  41022. */
  41023. defaultMagnificationFilter: TextureMagnificationFilter;
  41024. /**
  41025. * Gets the URL of the WMS server.
  41026. */
  41027. readonly url: string;
  41028. /**
  41029. * Gets the proxy used by this provider.
  41030. */
  41031. readonly proxy: Proxy;
  41032. /**
  41033. * Gets the names of the WMS layers, separated by commas.
  41034. */
  41035. readonly layers: string;
  41036. /**
  41037. * Gets the width of each tile, in pixels. This function should
  41038. * not be called before {@link WebMapServiceImageryProvider#ready} returns true.
  41039. */
  41040. readonly tileWidth: number;
  41041. /**
  41042. * Gets the height of each tile, in pixels. This function should
  41043. * not be called before {@link WebMapServiceImageryProvider#ready} returns true.
  41044. */
  41045. readonly tileHeight: number;
  41046. /**
  41047. * Gets the maximum level-of-detail that can be requested. This function should
  41048. * not be called before {@link WebMapServiceImageryProvider#ready} returns true.
  41049. */
  41050. readonly maximumLevel: number | undefined;
  41051. /**
  41052. * Gets the minimum level-of-detail that can be requested. This function should
  41053. * not be called before {@link WebMapServiceImageryProvider#ready} returns true.
  41054. */
  41055. readonly minimumLevel: number;
  41056. /**
  41057. * Gets the tiling scheme used by this provider. This function should
  41058. * not be called before {@link WebMapServiceImageryProvider#ready} returns true.
  41059. */
  41060. readonly tilingScheme: TilingScheme;
  41061. /**
  41062. * Gets the rectangle, in radians, of the imagery provided by this instance. This function should
  41063. * not be called before {@link WebMapServiceImageryProvider#ready} returns true.
  41064. */
  41065. readonly rectangle: Rectangle;
  41066. /**
  41067. * Gets the tile discard policy. If not undefined, the discard policy is responsible
  41068. * for filtering out "missing" tiles via its shouldDiscardImage function. If this function
  41069. * returns undefined, no tiles are filtered. This function should
  41070. * not be called before {@link WebMapServiceImageryProvider#ready} returns true.
  41071. */
  41072. readonly tileDiscardPolicy: TileDiscardPolicy;
  41073. /**
  41074. * Gets an event that is raised when the imagery provider encounters an asynchronous error. By subscribing
  41075. * to the event, you will be notified of the error and can potentially recover from it. Event listeners
  41076. * are passed an instance of {@link TileProviderError}.
  41077. */
  41078. readonly errorEvent: Event;
  41079. /**
  41080. * Gets a value indicating whether or not the provider is ready for use.
  41081. */
  41082. readonly ready: boolean;
  41083. /**
  41084. * Gets a promise that resolves to true when the provider is ready for use.
  41085. */
  41086. readonly readyPromise: Promise<boolean>;
  41087. /**
  41088. * Gets the credit to display when this imagery provider is active. Typically this is used to credit
  41089. * the source of the imagery. This function should not be called before {@link WebMapServiceImageryProvider#ready} returns true.
  41090. */
  41091. readonly credit: Credit;
  41092. /**
  41093. * Gets a value indicating whether or not the images provided by this imagery provider
  41094. * include an alpha channel. If this property is false, an alpha channel, if present, will
  41095. * be ignored. If this property is true, any images without an alpha channel will be treated
  41096. * as if their alpha is 1.0 everywhere. When this property is false, memory usage
  41097. * and texture upload time are reduced.
  41098. */
  41099. readonly hasAlphaChannel: boolean;
  41100. /**
  41101. * Gets or sets a value indicating whether feature picking is enabled. If true, {@link WebMapServiceImageryProvider#pickFeatures} will
  41102. * invoke the <code>GetFeatureInfo</code> service on the WMS server and attempt to interpret the features included in the response. If false,
  41103. * {@link WebMapServiceImageryProvider#pickFeatures} will immediately return undefined (indicating no pickable
  41104. * features) without communicating with the server. Set this property to false if you know your data
  41105. * source does not support picking features or if you don't want this provider's features to be pickable.
  41106. */
  41107. enablePickFeatures: boolean;
  41108. /**
  41109. * Gets or sets a clock that is used to get keep the time used for time dynamic parameters.
  41110. */
  41111. clock: Clock;
  41112. /**
  41113. * Gets or sets a time interval collection that is used to get time dynamic parameters. The data of each
  41114. * TimeInterval is an object containing the keys and values of the properties that are used during
  41115. * tile requests.
  41116. */
  41117. times: TimeIntervalCollection;
  41118. /**
  41119. * Gets the getFeatureInfo URL of the WMS server.
  41120. */
  41121. readonly getFeatureInfoUrl: Resource | string;
  41122. /**
  41123. * Gets the credits to be displayed when a given tile is displayed.
  41124. * @param x - The tile X coordinate.
  41125. * @param y - The tile Y coordinate.
  41126. * @param level - The tile level;
  41127. * @returns The credits to be displayed when the tile is displayed.
  41128. */
  41129. getTileCredits(x: number, y: number, level: number): Credit[];
  41130. /**
  41131. * Requests the image for a given tile. This function should
  41132. * not be called before {@link WebMapServiceImageryProvider#ready} returns true.
  41133. * @param x - The tile X coordinate.
  41134. * @param y - The tile Y coordinate.
  41135. * @param level - The tile level.
  41136. * @param [request] - The request object. Intended for internal use only.
  41137. * @returns A promise for the image that will resolve when the image is available, or
  41138. * undefined if there are too many active requests to the server, and the request should be retried later.
  41139. */
  41140. requestImage(x: number, y: number, level: number, request?: Request): Promise<ImageryTypes> | undefined;
  41141. /**
  41142. * Asynchronously determines what features, if any, are located at a given longitude and latitude within
  41143. * a tile. This function should not be called before {@link ImageryProvider#ready} returns true.
  41144. * @param x - The tile X coordinate.
  41145. * @param y - The tile Y coordinate.
  41146. * @param level - The tile level.
  41147. * @param longitude - The longitude at which to pick features.
  41148. * @param latitude - The latitude at which to pick features.
  41149. * @returns A promise for the picked features that will resolve when the asynchronous
  41150. * picking completes. The resolved value is an array of {@link ImageryLayerFeatureInfo}
  41151. * instances. The array may be empty if no features are found at the given location.
  41152. */
  41153. pickFeatures(x: number, y: number, level: number, longitude: number, latitude: number): Promise<ImageryLayerFeatureInfo[]> | undefined;
  41154. /**
  41155. * The default parameters to include in the WMS URL to obtain images. The values are as follows:
  41156. * service=WMS
  41157. * version=1.1.1
  41158. * request=GetMap
  41159. * styles=
  41160. * format=image/jpeg
  41161. */
  41162. static readonly DefaultParameters: any;
  41163. /**
  41164. * The default parameters to include in the WMS URL to get feature information. The values are as follows:
  41165. * service=WMS
  41166. * version=1.1.1
  41167. * request=GetFeatureInfo
  41168. */
  41169. static readonly GetFeatureInfoDefaultParameters: any;
  41170. }
  41171. export namespace WebMapTileServiceImageryProvider {
  41172. /**
  41173. * Initialization options for the WebMapTileServiceImageryProvider constructor
  41174. * @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.
  41175. * @property [format = 'image/jpeg'] - The MIME type for images to retrieve from the server.
  41176. * @property layer - The layer name for WMTS requests.
  41177. * @property style - The style name for WMTS requests.
  41178. * @property tileMatrixSetID - The identifier of the TileMatrixSet to use for WMTS requests.
  41179. * @property [tileMatrixLabels] - A list of identifiers in the TileMatrix to use for WMTS requests, one per TileMatrix level.
  41180. * @property [clock] - A Clock instance that is used when determining the value for the time dimension. Required when `times` is specified.
  41181. * @property [times] - TimeIntervalCollection with its <code>data</code> property being an object containing time dynamic dimension and their values.
  41182. * @property [dimensions] - A object containing static dimensions and their values.
  41183. * @property [tileWidth = 256] - The tile width in pixels.
  41184. * @property [tileHeight = 256] - The tile height in pixels.
  41185. * @property [tilingScheme] - The tiling scheme corresponding to the organization of the tiles in the TileMatrixSet.
  41186. * @property [rectangle = Rectangle.MAX_VALUE] - The rectangle covered by the layer.
  41187. * @property [minimumLevel = 0] - The minimum level-of-detail supported by the imagery provider.
  41188. * @property [maximumLevel] - The maximum level-of-detail supported by the imagery provider, or undefined if there is no limit.
  41189. * @property [ellipsoid] - The ellipsoid. If not specified, the WGS84 ellipsoid is used.
  41190. * @property [credit] - A credit for the data source, which is displayed on the canvas.
  41191. * @property [subdomains = 'abc'] - The subdomains to use for the <code>{s}</code> placeholder in the URL template.
  41192. * If this parameter is a single string, each character in the string is a subdomain. If it is
  41193. * an array, each element in the array is a subdomain.
  41194. */
  41195. type ConstructorOptions = {
  41196. url: Resource | string;
  41197. format?: string;
  41198. layer: string;
  41199. style: string;
  41200. tileMatrixSetID: string;
  41201. tileMatrixLabels?: any[];
  41202. clock?: Clock;
  41203. times?: TimeIntervalCollection;
  41204. dimensions?: any;
  41205. tileWidth?: number;
  41206. tileHeight?: number;
  41207. tilingScheme?: TilingScheme;
  41208. rectangle?: Rectangle;
  41209. minimumLevel?: number;
  41210. maximumLevel?: number;
  41211. ellipsoid?: Ellipsoid;
  41212. credit?: Credit | string;
  41213. subdomains?: string | string[];
  41214. };
  41215. }
  41216. /**
  41217. * Provides tiled imagery served by {@link http://www.opengeospatial.org/standards/wmts|WMTS 1.0.0} compliant servers.
  41218. * This provider supports HTTP KVP-encoded and RESTful GetTile requests, but does not yet support the SOAP encoding.
  41219. * @example
  41220. * // Example 1. USGS shaded relief tiles (KVP)
  41221. * const shadedRelief1 = new Cesium.WebMapTileServiceImageryProvider({
  41222. * url : 'http://basemap.nationalmap.gov/arcgis/rest/services/USGSShadedReliefOnly/MapServer/WMTS',
  41223. * layer : 'USGSShadedReliefOnly',
  41224. * style : 'default',
  41225. * format : 'image/jpeg',
  41226. * tileMatrixSetID : 'default028mm',
  41227. * // tileMatrixLabels : ['default028mm:0', 'default028mm:1', 'default028mm:2' ...],
  41228. * maximumLevel: 19,
  41229. * credit : new Cesium.Credit('U. S. Geological Survey')
  41230. * });
  41231. * viewer.imageryLayers.addImageryProvider(shadedRelief1);
  41232. * @example
  41233. * // Example 2. USGS shaded relief tiles (RESTful)
  41234. * const shadedRelief2 = new Cesium.WebMapTileServiceImageryProvider({
  41235. * url : 'http://basemap.nationalmap.gov/arcgis/rest/services/USGSShadedReliefOnly/MapServer/WMTS/tile/1.0.0/USGSShadedReliefOnly/{Style}/{TileMatrixSet}/{TileMatrix}/{TileRow}/{TileCol}.jpg',
  41236. * layer : 'USGSShadedReliefOnly',
  41237. * style : 'default',
  41238. * format : 'image/jpeg',
  41239. * tileMatrixSetID : 'default028mm',
  41240. * maximumLevel: 19,
  41241. * credit : new Cesium.Credit('U. S. Geological Survey')
  41242. * });
  41243. * viewer.imageryLayers.addImageryProvider(shadedRelief2);
  41244. * @example
  41245. * // Example 3. NASA time dynamic weather data (RESTful)
  41246. * const times = Cesium.TimeIntervalCollection.fromIso8601({
  41247. * iso8601: '2015-07-30/2017-06-16/P1D',
  41248. * dataCallback: function dataCallback(interval, index) {
  41249. * return {
  41250. * Time: Cesium.JulianDate.toIso8601(interval.start)
  41251. * };
  41252. * }
  41253. * });
  41254. * const weather = new Cesium.WebMapTileServiceImageryProvider({
  41255. * url : 'https://gibs.earthdata.nasa.gov/wmts/epsg4326/best/AMSR2_Snow_Water_Equivalent/default/{Time}/{TileMatrixSet}/{TileMatrix}/{TileRow}/{TileCol}.png',
  41256. * layer : 'AMSR2_Snow_Water_Equivalent',
  41257. * style : 'default',
  41258. * tileMatrixSetID : '2km',
  41259. * maximumLevel : 5,
  41260. * format : 'image/png',
  41261. * clock: clock,
  41262. * times: times,
  41263. * credit : new Cesium.Credit('NASA Global Imagery Browse Services for EOSDIS')
  41264. * });
  41265. * viewer.imageryLayers.addImageryProvider(weather);
  41266. * @param options - Object describing initialization options
  41267. */
  41268. export class WebMapTileServiceImageryProvider {
  41269. constructor(options: WebMapTileServiceImageryProvider.ConstructorOptions);
  41270. /**
  41271. * The default alpha blending value of this provider, with 0.0 representing fully transparent and
  41272. * 1.0 representing fully opaque.
  41273. */
  41274. defaultAlpha: number | undefined;
  41275. /**
  41276. * The default alpha blending value on the night side of the globe of this provider, with 0.0 representing fully transparent and
  41277. * 1.0 representing fully opaque.
  41278. */
  41279. defaultNightAlpha: number | undefined;
  41280. /**
  41281. * The default alpha blending value on the day side of the globe of this provider, with 0.0 representing fully transparent and
  41282. * 1.0 representing fully opaque.
  41283. */
  41284. defaultDayAlpha: number | undefined;
  41285. /**
  41286. * The default brightness of this provider. 1.0 uses the unmodified imagery color. Less than 1.0
  41287. * makes the imagery darker while greater than 1.0 makes it brighter.
  41288. */
  41289. defaultBrightness: number | undefined;
  41290. /**
  41291. * The default contrast of this provider. 1.0 uses the unmodified imagery color. Less than 1.0 reduces
  41292. * the contrast while greater than 1.0 increases it.
  41293. */
  41294. defaultContrast: number | undefined;
  41295. /**
  41296. * The default hue of this provider in radians. 0.0 uses the unmodified imagery color.
  41297. */
  41298. defaultHue: number | undefined;
  41299. /**
  41300. * The default saturation of this provider. 1.0 uses the unmodified imagery color. Less than 1.0 reduces the
  41301. * saturation while greater than 1.0 increases it.
  41302. */
  41303. defaultSaturation: number | undefined;
  41304. /**
  41305. * The default gamma correction to apply to this provider. 1.0 uses the unmodified imagery color.
  41306. */
  41307. defaultGamma: number | undefined;
  41308. /**
  41309. * The default texture minification filter to apply to this provider.
  41310. */
  41311. defaultMinificationFilter: TextureMinificationFilter;
  41312. /**
  41313. * The default texture magnification filter to apply to this provider.
  41314. */
  41315. defaultMagnificationFilter: TextureMagnificationFilter;
  41316. /**
  41317. * Gets the URL of the service hosting the imagery.
  41318. */
  41319. readonly url: string;
  41320. /**
  41321. * Gets the proxy used by this provider.
  41322. */
  41323. readonly proxy: Proxy;
  41324. /**
  41325. * Gets the width of each tile, in pixels. This function should
  41326. * not be called before {@link WebMapTileServiceImageryProvider#ready} returns true.
  41327. */
  41328. readonly tileWidth: number;
  41329. /**
  41330. * Gets the height of each tile, in pixels. This function should
  41331. * not be called before {@link WebMapTileServiceImageryProvider#ready} returns true.
  41332. */
  41333. readonly tileHeight: number;
  41334. /**
  41335. * Gets the maximum level-of-detail that can be requested. This function should
  41336. * not be called before {@link WebMapTileServiceImageryProvider#ready} returns true.
  41337. */
  41338. readonly maximumLevel: number | undefined;
  41339. /**
  41340. * Gets the minimum level-of-detail that can be requested. This function should
  41341. * not be called before {@link WebMapTileServiceImageryProvider#ready} returns true.
  41342. */
  41343. readonly minimumLevel: number;
  41344. /**
  41345. * Gets the tiling scheme used by this provider. This function should
  41346. * not be called before {@link WebMapTileServiceImageryProvider#ready} returns true.
  41347. */
  41348. readonly tilingScheme: TilingScheme;
  41349. /**
  41350. * Gets the rectangle, in radians, of the imagery provided by this instance. This function should
  41351. * not be called before {@link WebMapTileServiceImageryProvider#ready} returns true.
  41352. */
  41353. readonly rectangle: Rectangle;
  41354. /**
  41355. * Gets the tile discard policy. If not undefined, the discard policy is responsible
  41356. * for filtering out "missing" tiles via its shouldDiscardImage function. If this function
  41357. * returns undefined, no tiles are filtered. This function should
  41358. * not be called before {@link WebMapTileServiceImageryProvider#ready} returns true.
  41359. */
  41360. readonly tileDiscardPolicy: TileDiscardPolicy;
  41361. /**
  41362. * Gets an event that is raised when the imagery provider encounters an asynchronous error. By subscribing
  41363. * to the event, you will be notified of the error and can potentially recover from it. Event listeners
  41364. * are passed an instance of {@link TileProviderError}.
  41365. */
  41366. readonly errorEvent: Event;
  41367. /**
  41368. * Gets the mime type of images returned by this imagery provider.
  41369. */
  41370. readonly format: string;
  41371. /**
  41372. * Gets a value indicating whether or not the provider is ready for use.
  41373. */
  41374. readonly ready: boolean;
  41375. /**
  41376. * Gets a promise that resolves to true when the provider is ready for use.
  41377. */
  41378. readonly readyPromise: Promise<boolean>;
  41379. /**
  41380. * Gets the credit to display when this imagery provider is active. Typically this is used to credit
  41381. * the source of the imagery. This function should not be called before {@link WebMapTileServiceImageryProvider#ready} returns true.
  41382. */
  41383. readonly credit: Credit;
  41384. /**
  41385. * Gets a value indicating whether or not the images provided by this imagery provider
  41386. * include an alpha channel. If this property is false, an alpha channel, if present, will
  41387. * be ignored. If this property is true, any images without an alpha channel will be treated
  41388. * as if their alpha is 1.0 everywhere. When this property is false, memory usage
  41389. * and texture upload time are reduced.
  41390. */
  41391. readonly hasAlphaChannel: boolean;
  41392. /**
  41393. * Gets or sets a clock that is used to get keep the time used for time dynamic parameters.
  41394. */
  41395. clock: Clock;
  41396. /**
  41397. * Gets or sets a time interval collection that is used to get time dynamic parameters. The data of each
  41398. * TimeInterval is an object containing the keys and values of the properties that are used during
  41399. * tile requests.
  41400. */
  41401. times: TimeIntervalCollection;
  41402. /**
  41403. * Gets or sets an object that contains static dimensions and their values.
  41404. */
  41405. dimensions: any;
  41406. /**
  41407. * Gets the credits to be displayed when a given tile is displayed.
  41408. * @param x - The tile X coordinate.
  41409. * @param y - The tile Y coordinate.
  41410. * @param level - The tile level;
  41411. * @returns The credits to be displayed when the tile is displayed.
  41412. */
  41413. getTileCredits(x: number, y: number, level: number): Credit[];
  41414. /**
  41415. * Requests the image for a given tile. This function should
  41416. * not be called before {@link WebMapTileServiceImageryProvider#ready} returns true.
  41417. * @param x - The tile X coordinate.
  41418. * @param y - The tile Y coordinate.
  41419. * @param level - The tile level.
  41420. * @param [request] - The request object. Intended for internal use only.
  41421. * @returns A promise for the image that will resolve when the image is available, or
  41422. * undefined if there are too many active requests to the server, and the request should be retried later.
  41423. */
  41424. requestImage(x: number, y: number, level: number, request?: Request): Promise<ImageryTypes> | undefined;
  41425. /**
  41426. * Picking features is not currently supported by this imagery provider, so this function simply returns
  41427. * undefined.
  41428. * @param x - The tile X coordinate.
  41429. * @param y - The tile Y coordinate.
  41430. * @param level - The tile level.
  41431. * @param longitude - The longitude at which to pick features.
  41432. * @param latitude - The latitude at which to pick features.
  41433. * @returns Undefined since picking is not supported.
  41434. */
  41435. pickFeatures(x: number, y: number, level: number, longitude: number, latitude: number): undefined;
  41436. }
  41437. /**
  41438. * @property height - The height.
  41439. * @property color - The color at this height.
  41440. */
  41441. export type createElevationBandMaterialEntry = {
  41442. height: number;
  41443. color: Color;
  41444. };
  41445. /**
  41446. * @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>.
  41447. * @property [extendDownwards = false] - If <code>true</code>, the band's minimum elevation color will extend infinitely downwards.
  41448. * @property [extendUpwards = false] - If <code>true</code>, the band's maximum elevation color will extend infinitely upwards.
  41449. */
  41450. export type createElevationBandMaterialBand = {
  41451. entries: createElevationBandMaterialEntry[];
  41452. extendDownwards?: boolean;
  41453. extendUpwards?: boolean;
  41454. };
  41455. /**
  41456. * Creates a {@link Material} that combines multiple layers of color/gradient bands and maps them to terrain heights.
  41457. *
  41458. * The shader does a binary search over all the heights to find out which colors are above and below a given height, and
  41459. * interpolates between them for the final color. This material supports hundreds of entries relatively cheaply.
  41460. * @example
  41461. * scene.globe.material = Cesium.createElevationBandMaterial({
  41462. * scene : scene,
  41463. * layers : [{
  41464. * entries : [{
  41465. * height : 4200.0,
  41466. * color : new Cesium.Color(0.0, 0.0, 0.0, 1.0)
  41467. * }, {
  41468. * height : 8848.0,
  41469. * color : new Cesium.Color(1.0, 1.0, 1.0, 1.0)
  41470. * }],
  41471. * extendDownwards : true,
  41472. * extendUpwards : true,
  41473. * }, {
  41474. * entries : [{
  41475. * height : 7000.0,
  41476. * color : new Cesium.Color(1.0, 0.0, 0.0, 0.5)
  41477. * }, {
  41478. * height : 7100.0,
  41479. * color : new Cesium.Color(1.0, 0.0, 0.0, 0.5)
  41480. * }]
  41481. * }]
  41482. * });
  41483. * @param options - Object with the following properties:
  41484. * @param options.scene - The scene where the visualization is taking place.
  41485. * @param options.layers - A list of bands ordered from lowest to highest precedence.
  41486. * @returns A new {@link Material} instance.
  41487. */
  41488. export function createElevationBandMaterial(options: {
  41489. scene: Scene;
  41490. layers: createElevationBandMaterialBand[];
  41491. }): Material;
  41492. /**
  41493. * Creates a {@link Cesium3DTileset} instance for the
  41494. * {@link https://cesium.com/content/cesium-osm-buildings/|Cesium OSM Buildings}
  41495. * tileset.
  41496. * @example
  41497. * // Create Cesium OSM Buildings with default styling
  41498. * const viewer = new Cesium.Viewer('cesiumContainer');
  41499. * viewer.scene.primitives.add(Cesium.createOsmBuildings());
  41500. * @example
  41501. * // Create Cesium OSM Buildings with a custom style highlighting
  41502. * // schools and hospitals.
  41503. * viewer.scene.primitives.add(Cesium.createOsmBuildings({
  41504. * style: new Cesium.Cesium3DTileStyle({
  41505. * color: {
  41506. * conditions: [
  41507. * ["${feature['building']} === 'hospital'", "color('#0000FF')"],
  41508. * ["${feature['building']} === 'school'", "color('#00FF00')"],
  41509. * [true, "color('#ffffff')"]
  41510. * ]
  41511. * }
  41512. * })
  41513. * }));
  41514. * @param [options] - Construction options. Any options allowed by the {@link Cesium3DTileset} constructor
  41515. * may be specified here. In addition to those, the following properties are supported:
  41516. * @param [options.defaultColor = Color.WHITE] - The default color to use for buildings
  41517. * that do not have a color. This parameter is ignored if <code>options.style</code> is specified.
  41518. * @param [options.style] - The style to use with the tileset. If not
  41519. * specified, a default style is used which gives each building or building part a
  41520. * color inferred from its OpenStreetMap <code>tags</code>. If no color can be inferred,
  41521. * <code>options.defaultColor</code> is used.
  41522. * @param [options.showOutline = true] - Whether to show outlines around buildings. When true,
  41523. * outlines are displayed. When false, outlines are not displayed.
  41524. */
  41525. export function createOsmBuildings(options?: {
  41526. defaultColor?: Color;
  41527. style?: Cesium3DTileStyle;
  41528. showOutline?: boolean;
  41529. }): Cesium3DTileset;
  41530. /**
  41531. * Creates a {@link Primitive} to visualize well-known vector vertex attributes:
  41532. * <code>normal</code>, <code>tangent</code>, and <code>bitangent</code>. Normal
  41533. * is red; tangent is green; and bitangent is blue. If an attribute is not
  41534. * present, it is not drawn.
  41535. * @example
  41536. * scene.primitives.add(Cesium.createTangentSpaceDebugPrimitive({
  41537. * geometry : instance.geometry,
  41538. * length : 100000.0,
  41539. * modelMatrix : instance.modelMatrix
  41540. * }));
  41541. * @param options - Object with the following properties:
  41542. * @param options.geometry - The <code>Geometry</code> instance with the attribute.
  41543. * @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.
  41544. * @param [options.modelMatrix = Matrix4.IDENTITY] - The model matrix that transforms to transform the geometry from model to world coordinates.
  41545. * @returns A new <code>Primitive</code> instance with geometry for the vectors.
  41546. */
  41547. export function createTangentSpaceDebugPrimitive(options: {
  41548. geometry: Geometry;
  41549. length?: number;
  41550. modelMatrix?: Matrix4;
  41551. }): Primitive;
  41552. /**
  41553. * Creates an {@link IonImageryProvider} instance for ion's default global base imagery layer, currently Bing Maps.
  41554. * @example
  41555. * // Create Cesium World Terrain with default settings
  41556. * const viewer = new Cesium.Viewer('cesiumContainer', {
  41557. * imageryProvider : Cesium.createWorldImagery();
  41558. * });
  41559. * @example
  41560. * // Create Cesium World Terrain with water and normals.
  41561. * const viewer = new Cesium.Viewer('cesiumContainer', {
  41562. * imageryProvider : Cesium.createWorldImagery({
  41563. * style: Cesium.IonWorldImageryStyle.AERIAL_WITH_LABELS
  41564. * })
  41565. * });
  41566. * @param [options] - Object with the following properties:
  41567. * @param [options.style = IonWorldImageryStyle] - The style of base imagery, only AERIAL, AERIAL_WITH_LABELS, and ROAD are currently supported.
  41568. */
  41569. export function createWorldImagery(options?: {
  41570. style?: IonWorldImageryStyle;
  41571. }): IonImageryProvider;
  41572. /**
  41573. * <span style="display: block; text-align: center;">
  41574. * <img src="Images/AnimationWidget.png" width="211" height="142" alt="" />
  41575. * <br />Animation widget
  41576. * </span>
  41577. * <br /><br />
  41578. * The Animation widget provides buttons for play, pause, and reverse, along with the
  41579. * current time and date, surrounded by a "shuttle ring" for controlling the speed of animation.
  41580. * <br /><br />
  41581. * The "shuttle ring" concept is borrowed from video editing, where typically a
  41582. * "jog wheel" can be rotated to move past individual animation frames very slowly, and
  41583. * a surrounding shuttle ring can be twisted to control direction and speed of fast playback.
  41584. * Cesium typically treats time as continuous (not broken into pre-defined animation frames),
  41585. * so this widget offers no jog wheel. Instead, the shuttle ring is capable of both fast and
  41586. * very slow playback. Click and drag the shuttle ring pointer itself (shown above in green),
  41587. * or click in the rest of the ring area to nudge the pointer to the next preset speed in that direction.
  41588. * <br /><br />
  41589. * The Animation widget also provides a "realtime" button (in the upper-left) that keeps
  41590. * animation time in sync with the end user's system clock, typically displaying
  41591. * "today" or "right now." This mode is not available in {@link ClockRange.CLAMPED} or
  41592. * {@link ClockRange.LOOP_STOP} mode if the current time is outside of {@link Clock}'s startTime and endTime.
  41593. * @example
  41594. * // In HTML head, include a link to Animation.css stylesheet,
  41595. * // and in the body, include: <div id="animationContainer"></div>
  41596. *
  41597. * const clock = new Cesium.Clock();
  41598. * const clockViewModel = new Cesium.ClockViewModel(clock);
  41599. * const viewModel = new Cesium.AnimationViewModel(clockViewModel);
  41600. * const widget = new Cesium.Animation('animationContainer', viewModel);
  41601. *
  41602. * function tick() {
  41603. * clock.tick();
  41604. * Cesium.requestAnimationFrame(tick);
  41605. * }
  41606. * Cesium.requestAnimationFrame(tick);
  41607. * @param container - The DOM element or ID that will contain the widget.
  41608. * @param viewModel - The view model used by this widget.
  41609. */
  41610. export class Animation {
  41611. constructor(container: Element | string, viewModel: AnimationViewModel);
  41612. /**
  41613. * Gets the parent container.
  41614. */
  41615. readonly container: Element;
  41616. /**
  41617. * Gets the view model.
  41618. */
  41619. readonly viewModel: AnimationViewModel;
  41620. /**
  41621. * @returns true if the object has been destroyed, false otherwise.
  41622. */
  41623. isDestroyed(): boolean;
  41624. /**
  41625. * Destroys the animation widget. Should be called if permanently
  41626. * removing the widget from layout.
  41627. */
  41628. destroy(): void;
  41629. /**
  41630. * Resizes the widget to match the container size.
  41631. * This function should be called whenever the container size is changed.
  41632. */
  41633. resize(): void;
  41634. /**
  41635. * Updates the widget to reflect any modified CSS rules for theming.
  41636. * @example
  41637. * //Switch to the cesium-lighter theme.
  41638. * document.body.className = 'cesium-lighter';
  41639. * animation.applyThemeChanges();
  41640. */
  41641. applyThemeChanges(): void;
  41642. }
  41643. /**
  41644. * The view model for the {@link Animation} widget.
  41645. * @param clockViewModel - The ClockViewModel instance to use.
  41646. */
  41647. export class AnimationViewModel {
  41648. constructor(clockViewModel: ClockViewModel);
  41649. /**
  41650. * Gets or sets whether the shuttle ring is currently being dragged. This property is observable.
  41651. */
  41652. shuttleRingDragging: boolean;
  41653. /**
  41654. * Gets or sets whether dragging the shuttle ring should cause the multiplier
  41655. * to snap to the defined tick values rather than interpolating between them.
  41656. * This property is observable.
  41657. */
  41658. snapToTicks: boolean;
  41659. /**
  41660. * Gets the string representation of the current time. This property is observable.
  41661. */
  41662. timeLabel: string;
  41663. /**
  41664. * Gets the string representation of the current date. This property is observable.
  41665. */
  41666. dateLabel: string;
  41667. /**
  41668. * Gets the string representation of the current multiplier. This property is observable.
  41669. */
  41670. multiplierLabel: string;
  41671. /**
  41672. * Gets or sets the current shuttle ring angle. This property is observable.
  41673. */
  41674. shuttleRingAngle: number;
  41675. /**
  41676. * Gets or sets the default date formatter used by new instances.
  41677. */
  41678. static defaultDateFormatter: AnimationViewModel.DateFormatter;
  41679. /**
  41680. * Gets or sets the default array of known clock multipliers associated with new instances of the shuttle ring.
  41681. */
  41682. static defaultTicks: number[];
  41683. /**
  41684. * Gets or sets the default time formatter used by new instances.
  41685. */
  41686. static defaultTimeFormatter: AnimationViewModel.TimeFormatter;
  41687. /**
  41688. * Gets a copy of the array of positive known clock multipliers to associate with the shuttle ring.
  41689. * @returns The array of known clock multipliers associated with the shuttle ring.
  41690. */
  41691. getShuttleRingTicks(): number[];
  41692. /**
  41693. * Sets the array of positive known clock multipliers to associate with the shuttle ring.
  41694. * These values will have negative equivalents created for them and sets both the minimum
  41695. * and maximum range of values for the shuttle ring as well as the values that are snapped
  41696. * to when a single click is made. The values need not be in order, as they will be sorted
  41697. * automatically, and duplicate values will be removed.
  41698. * @param positiveTicks - The list of known positive clock multipliers to associate with the shuttle ring.
  41699. */
  41700. setShuttleRingTicks(positiveTicks: number[]): void;
  41701. /**
  41702. * Gets a command that decreases the speed of animation.
  41703. */
  41704. slower: Command;
  41705. /**
  41706. * Gets a command that increases the speed of animation.
  41707. */
  41708. faster: Command;
  41709. /**
  41710. * Gets the clock view model.
  41711. */
  41712. clockViewModel: ClockViewModel;
  41713. /**
  41714. * Gets the pause toggle button view model.
  41715. */
  41716. pauseViewModel: ToggleButtonViewModel;
  41717. /**
  41718. * Gets the reverse toggle button view model.
  41719. */
  41720. playReverseViewModel: ToggleButtonViewModel;
  41721. /**
  41722. * Gets the play toggle button view model.
  41723. */
  41724. playForwardViewModel: ToggleButtonViewModel;
  41725. /**
  41726. * Gets the realtime toggle button view model.
  41727. */
  41728. playRealtimeViewModel: ToggleButtonViewModel;
  41729. /**
  41730. * Gets or sets the function which formats a date for display.
  41731. */
  41732. dateFormatter: AnimationViewModel.DateFormatter;
  41733. /**
  41734. * Gets or sets the function which formats a time for display.
  41735. */
  41736. timeFormatter: AnimationViewModel.TimeFormatter;
  41737. }
  41738. export namespace AnimationViewModel {
  41739. /**
  41740. * A function that formats a date for display.
  41741. * @param date - The date to be formatted
  41742. * @param viewModel - The AnimationViewModel instance requesting formatting.
  41743. */
  41744. type DateFormatter = (date: JulianDate, viewModel: AnimationViewModel) => string;
  41745. /**
  41746. * A function that formats a time for display.
  41747. * @param date - The date to be formatted
  41748. * @param viewModel - The AnimationViewModel instance requesting formatting.
  41749. */
  41750. type TimeFormatter = (date: JulianDate, viewModel: AnimationViewModel) => string;
  41751. }
  41752. /**
  41753. * <span style="display: block; text-align: center;">
  41754. * <img src="Images/BaseLayerPicker.png" width="264" height="287" alt="" />
  41755. * <br />BaseLayerPicker with its drop-panel open.
  41756. * </span>
  41757. * <br /><br />
  41758. * The BaseLayerPicker is a single button widget that displays a panel of available imagery and
  41759. * terrain providers. When imagery is selected, the corresponding imagery layer is created and inserted
  41760. * as the base layer of the imagery collection; removing the existing base. When terrain is selected,
  41761. * it replaces the current terrain provider. Each item in the available providers list contains a name,
  41762. * a representative icon, and a tooltip to display more information when hovered. The list is initially
  41763. * empty, and must be configured before use, as illustrated in the below example.
  41764. * @example
  41765. * // In HTML head, include a link to the BaseLayerPicker.css stylesheet,
  41766. * // and in the body, include: <div id="baseLayerPickerContainer"
  41767. * // style="position:absolute;top:24px;right:24px;width:38px;height:38px;"></div>
  41768. *
  41769. * //Create the list of available providers we would like the user to select from.
  41770. * //This example uses 3, OpenStreetMap, The Black Marble, and a single, non-streaming world image.
  41771. * const imageryViewModels = [];
  41772. * imageryViewModels.push(new Cesium.ProviderViewModel({
  41773. * name : 'Open\u00adStreet\u00adMap',
  41774. * iconUrl : Cesium.buildModuleUrl('Widgets/Images/ImageryProviders/openStreetMap.png'),
  41775. * tooltip : 'OpenStreetMap (OSM) is a collaborative project to create a free editable \
  41776. * map of the world.\nhttp://www.openstreetmap.org',
  41777. * creationFunction : function() {
  41778. * return new Cesium.OpenStreetMapImageryProvider({
  41779. * url : 'https://a.tile.openstreetmap.org/'
  41780. * });
  41781. * }
  41782. * }));
  41783. *
  41784. * imageryViewModels.push(new Cesium.ProviderViewModel({
  41785. * name : 'Earth at Night',
  41786. * iconUrl : Cesium.buildModuleUrl('Widgets/Images/ImageryProviders/blackMarble.png'),
  41787. * tooltip : 'The lights of cities and villages trace the outlines of civilization \
  41788. * in this global view of the Earth at night as seen by NASA/NOAA\'s Suomi NPP satellite.',
  41789. * creationFunction : function() {
  41790. * return new Cesium.IonImageryProvider({ assetId: 3812 });
  41791. * }
  41792. * }));
  41793. *
  41794. * imageryViewModels.push(new Cesium.ProviderViewModel({
  41795. * name : 'Natural Earth\u00a0II',
  41796. * iconUrl : Cesium.buildModuleUrl('Widgets/Images/ImageryProviders/naturalEarthII.png'),
  41797. * tooltip : 'Natural Earth II, darkened for contrast.\nhttp://www.naturalearthdata.com/',
  41798. * creationFunction : function() {
  41799. * return new Cesium.TileMapServiceImageryProvider({
  41800. * url : Cesium.buildModuleUrl('Assets/Textures/NaturalEarthII')
  41801. * });
  41802. * }
  41803. * }));
  41804. *
  41805. * //Create a CesiumWidget without imagery, if you haven't already done so.
  41806. * const cesiumWidget = new Cesium.CesiumWidget('cesiumContainer', { imageryProvider: false });
  41807. *
  41808. * //Finally, create the baseLayerPicker widget using our view models.
  41809. * const layers = cesiumWidget.imageryLayers;
  41810. * const baseLayerPicker = new Cesium.BaseLayerPicker('baseLayerPickerContainer', {
  41811. * globe : cesiumWidget.scene.globe,
  41812. * imageryProviderViewModels : imageryViewModels
  41813. * });
  41814. * @param container - The parent HTML container node or ID for this widget.
  41815. * @param options - Object with the following properties:
  41816. * @param options.globe - The Globe to use.
  41817. * @param [options.imageryProviderViewModels = []] - The array of ProviderViewModel instances to use for imagery.
  41818. * @param [options.selectedImageryProviderViewModel] - The view model for the current base imagery layer, if not supplied the first available imagery layer is used.
  41819. * @param [options.terrainProviderViewModels = []] - The array of ProviderViewModel instances to use for terrain.
  41820. * @param [options.selectedTerrainProviderViewModel] - The view model for the current base terrain layer, if not supplied the first available terrain layer is used.
  41821. */
  41822. export class BaseLayerPicker {
  41823. constructor(container: Element | string, options: {
  41824. globe: Globe;
  41825. imageryProviderViewModels?: ProviderViewModel[];
  41826. selectedImageryProviderViewModel?: ProviderViewModel;
  41827. terrainProviderViewModels?: ProviderViewModel[];
  41828. selectedTerrainProviderViewModel?: ProviderViewModel;
  41829. });
  41830. /**
  41831. * Gets the parent container.
  41832. */
  41833. container: Element;
  41834. /**
  41835. * Gets the view model.
  41836. */
  41837. viewModel: BaseLayerPickerViewModel;
  41838. /**
  41839. * @returns true if the object has been destroyed, false otherwise.
  41840. */
  41841. isDestroyed(): boolean;
  41842. /**
  41843. * Destroys the widget. Should be called if permanently
  41844. * removing the widget from layout.
  41845. */
  41846. destroy(): void;
  41847. }
  41848. /**
  41849. * The view model for {@link BaseLayerPicker}.
  41850. * @param options - Object with the following properties:
  41851. * @param options.globe - The Globe to use.
  41852. * @param [options.imageryProviderViewModels = []] - The array of ProviderViewModel instances to use for imagery.
  41853. * @param [options.selectedImageryProviderViewModel] - The view model for the current base imagery layer, if not supplied the first available imagery layer is used.
  41854. * @param [options.terrainProviderViewModels = []] - The array of ProviderViewModel instances to use for terrain.
  41855. * @param [options.selectedTerrainProviderViewModel] - The view model for the current base terrain layer, if not supplied the first available terrain layer is used.
  41856. */
  41857. export class BaseLayerPickerViewModel {
  41858. constructor(options: {
  41859. globe: Globe;
  41860. imageryProviderViewModels?: ProviderViewModel[];
  41861. selectedImageryProviderViewModel?: ProviderViewModel;
  41862. terrainProviderViewModels?: ProviderViewModel[];
  41863. selectedTerrainProviderViewModel?: ProviderViewModel;
  41864. });
  41865. /**
  41866. * Gets or sets an array of ProviderViewModel instances available for imagery selection.
  41867. * This property is observable.
  41868. */
  41869. imageryProviderViewModels: ProviderViewModel[];
  41870. /**
  41871. * Gets or sets an array of ProviderViewModel instances available for terrain selection.
  41872. * This property is observable.
  41873. */
  41874. terrainProviderViewModels: ProviderViewModel[];
  41875. /**
  41876. * Gets or sets whether the imagery selection drop-down is currently visible.
  41877. */
  41878. dropDownVisible: boolean;
  41879. /**
  41880. * Gets the button tooltip. This property is observable.
  41881. */
  41882. buttonTooltip: string;
  41883. /**
  41884. * Gets the button background image. This property is observable.
  41885. */
  41886. buttonImageUrl: string;
  41887. /**
  41888. * Gets or sets the currently selected imagery. This property is observable.
  41889. */
  41890. selectedImagery: ProviderViewModel;
  41891. /**
  41892. * Gets or sets the currently selected terrain. This property is observable.
  41893. */
  41894. selectedTerrain: ProviderViewModel;
  41895. /**
  41896. * Gets the command to toggle the visibility of the drop down.
  41897. */
  41898. toggleDropDown: Command;
  41899. /**
  41900. * Gets the globe.
  41901. */
  41902. globe: Globe;
  41903. }
  41904. /**
  41905. * A view model that represents each item in the {@link BaseLayerPicker}.
  41906. * @param options - The object containing all parameters.
  41907. * @param options.name - The name of the layer.
  41908. * @param options.tooltip - The tooltip to show when the item is moused over.
  41909. * @param options.iconUrl - An icon representing the layer.
  41910. * @param [options.category] - A category for the layer.
  41911. * @param options.creationFunction - A function or Command
  41912. * that creates one or more providers which will be added to the globe when this item is selected.
  41913. */
  41914. export class ProviderViewModel {
  41915. constructor(options: {
  41916. name: string;
  41917. tooltip: string;
  41918. iconUrl: string;
  41919. category?: string;
  41920. creationFunction: ProviderViewModel.CreationFunction | Command;
  41921. });
  41922. /**
  41923. * Gets the display name. This property is observable.
  41924. */
  41925. name: string;
  41926. /**
  41927. * Gets the tooltip. This property is observable.
  41928. */
  41929. tooltip: string;
  41930. /**
  41931. * Gets the icon. This property is observable.
  41932. */
  41933. iconUrl: string;
  41934. /**
  41935. * Gets the Command that creates one or more providers which will be added to
  41936. * the globe when this item is selected.
  41937. */
  41938. readonly creationCommand: Command;
  41939. /**
  41940. * Gets the category
  41941. */
  41942. readonly category: string;
  41943. }
  41944. export namespace ProviderViewModel {
  41945. /**
  41946. * A function which creates one or more providers.
  41947. */
  41948. type CreationFunction = () => ImageryProvider | TerrainProvider | ImageryProvider[] | TerrainProvider[];
  41949. }
  41950. /**
  41951. * Inspector widget to aid in debugging 3D Tiles
  41952. * @param container - The DOM element or ID that will contain the widget.
  41953. * @param scene - the Scene instance to use.
  41954. */
  41955. export class Cesium3DTilesInspector {
  41956. constructor(container: Element | string, scene: Scene);
  41957. /**
  41958. * Gets the parent container.
  41959. */
  41960. container: Element;
  41961. /**
  41962. * Gets the view model.
  41963. */
  41964. viewModel: Cesium3DTilesInspectorViewModel;
  41965. /**
  41966. * @returns true if the object has been destroyed, false otherwise.
  41967. */
  41968. isDestroyed(): boolean;
  41969. /**
  41970. * Destroys the widget. Should be called if permanently
  41971. * removing the widget from layout.
  41972. */
  41973. destroy(): void;
  41974. }
  41975. /**
  41976. * The view model for {@link Cesium3DTilesInspector}.
  41977. * @param scene - The scene instance to use.
  41978. * @param performanceContainer - The container for the performance display
  41979. */
  41980. export class Cesium3DTilesInspectorViewModel {
  41981. constructor(scene: Scene, performanceContainer: HTMLElement);
  41982. /**
  41983. * Gets or sets the flag to enable performance display. This property is observable.
  41984. */
  41985. performance: boolean;
  41986. /**
  41987. * Gets or sets the flag to show statistics. This property is observable.
  41988. */
  41989. showStatistics: boolean;
  41990. /**
  41991. * Gets or sets the flag to show pick statistics. This property is observable.
  41992. */
  41993. showPickStatistics: boolean;
  41994. /**
  41995. * Gets or sets the flag to show the inspector. This property is observable.
  41996. */
  41997. inspectorVisible: boolean;
  41998. /**
  41999. * Gets or sets the flag to show the tileset section. This property is observable.
  42000. */
  42001. tilesetVisible: boolean;
  42002. /**
  42003. * Gets or sets the flag to show the display section. This property is observable.
  42004. */
  42005. displayVisible: boolean;
  42006. /**
  42007. * Gets or sets the flag to show the update section. This property is observable.
  42008. */
  42009. updateVisible: boolean;
  42010. /**
  42011. * Gets or sets the flag to show the logging section. This property is observable.
  42012. */
  42013. loggingVisible: boolean;
  42014. /**
  42015. * Gets or sets the flag to show the style section. This property is observable.
  42016. */
  42017. styleVisible: boolean;
  42018. /**
  42019. * Gets or sets the flag to show the tile info section. This property is observable.
  42020. */
  42021. tileDebugLabelsVisible: boolean;
  42022. /**
  42023. * Gets or sets the flag to show the optimization info section. This property is observable.
  42024. */
  42025. optimizationVisible: boolean;
  42026. /**
  42027. * Gets or sets the JSON for the tileset style. This property is observable.
  42028. */
  42029. styleString: string;
  42030. /**
  42031. * Gets the names of the properties in the tileset. This property is observable.
  42032. */
  42033. readonly properties: string[];
  42034. /**
  42035. * Gets or sets the flag to enable dynamic screen space error. This property is observable.
  42036. */
  42037. dynamicScreenSpaceError: boolean;
  42038. /**
  42039. * Gets or sets the color blend mode. This property is observable.
  42040. */
  42041. colorBlendMode: Cesium3DTileColorBlendMode;
  42042. /**
  42043. * Gets or sets the flag to enable picking. This property is observable.
  42044. */
  42045. picking: boolean;
  42046. /**
  42047. * Gets or sets the flag to colorize tiles. This property is observable.
  42048. */
  42049. colorize: boolean;
  42050. /**
  42051. * Gets or sets the flag to draw with wireframe. This property is observable.
  42052. */
  42053. wireframe: boolean;
  42054. /**
  42055. * Gets or sets the flag to show bounding volumes. This property is observable.
  42056. */
  42057. showBoundingVolumes: boolean;
  42058. /**
  42059. * Gets or sets the flag to show content volumes. This property is observable.
  42060. */
  42061. showContentBoundingVolumes: boolean;
  42062. /**
  42063. * Gets or sets the flag to show request volumes. This property is observable.
  42064. */
  42065. showRequestVolumes: boolean;
  42066. /**
  42067. * Gets or sets the flag to suspend updates. This property is observable.
  42068. */
  42069. freezeFrame: boolean;
  42070. /**
  42071. * Gets or sets the flag to show debug labels only for the currently picked tile. This property is observable.
  42072. */
  42073. showOnlyPickedTileDebugLabel: boolean;
  42074. /**
  42075. * Gets or sets the flag to show tile geometric error. This property is observable.
  42076. */
  42077. showGeometricError: boolean;
  42078. /**
  42079. * Displays the number of commands, points, triangles and features used per tile. This property is observable.
  42080. */
  42081. showRenderingStatistics: boolean;
  42082. /**
  42083. * Displays the memory used per tile. This property is observable.
  42084. */
  42085. showMemoryUsage: boolean;
  42086. /**
  42087. * Gets or sets the flag to show the tile url. This property is observable.
  42088. */
  42089. showUrl: boolean;
  42090. /**
  42091. * Gets or sets the maximum screen space error. This property is observable.
  42092. */
  42093. maximumScreenSpaceError: number;
  42094. /**
  42095. * Gets or sets the dynamic screen space error density. This property is observable.
  42096. */
  42097. dynamicScreenSpaceErrorDensity: number;
  42098. /**
  42099. * Gets or sets the dynamic screen space error density slider value.
  42100. * This allows the slider to be exponential because values tend to be closer to 0 than 1.
  42101. * This property is observable.
  42102. */
  42103. dynamicScreenSpaceErrorDensitySliderValue: number;
  42104. /**
  42105. * Gets or sets the dynamic screen space error factor. This property is observable.
  42106. */
  42107. dynamicScreenSpaceErrorFactor: number;
  42108. /**
  42109. * Gets or sets the flag to enable point cloud shading. This property is observable.
  42110. */
  42111. pointCloudShading: boolean;
  42112. /**
  42113. * Gets or sets the geometric error scale. This property is observable.
  42114. */
  42115. geometricErrorScale: number;
  42116. /**
  42117. * Gets or sets the maximum attenuation. This property is observable.
  42118. */
  42119. maximumAttenuation: number;
  42120. /**
  42121. * Gets or sets the base resolution. This property is observable.
  42122. */
  42123. baseResolution: number;
  42124. /**
  42125. * Gets or sets the flag to enable eye dome lighting. This property is observable.
  42126. */
  42127. eyeDomeLighting: boolean;
  42128. /**
  42129. * Gets or sets the eye dome lighting strength. This property is observable.
  42130. */
  42131. eyeDomeLightingStrength: number;
  42132. /**
  42133. * Gets or sets the eye dome lighting radius. This property is observable.
  42134. */
  42135. eyeDomeLightingRadius: number;
  42136. /**
  42137. * Gets or sets the pick state
  42138. */
  42139. pickActive: boolean;
  42140. /**
  42141. * Gets or sets the flag to determine if level of detail skipping should be applied during the traversal.
  42142. * This property is observable.
  42143. */
  42144. skipLevelOfDetail: boolean;
  42145. /**
  42146. * Gets or sets the multiplier defining the minimum screen space error to skip. This property is observable.
  42147. */
  42148. skipScreenSpaceErrorFactor: number;
  42149. /**
  42150. * Gets or sets the screen space error that must be reached before skipping levels of detail. This property is observable.
  42151. */
  42152. baseScreenSpaceError: number;
  42153. /**
  42154. * Gets or sets the constant defining the minimum number of levels to skip when loading tiles. This property is observable.
  42155. */
  42156. skipLevels: number;
  42157. /**
  42158. * Gets or sets the flag which, when true, only tiles that meet the maximum screen space error will ever be downloaded.
  42159. * This property is observable.
  42160. */
  42161. immediatelyLoadDesiredLevelOfDetail: boolean;
  42162. /**
  42163. * Gets or sets the flag which determines whether siblings of visible tiles are always downloaded during traversal.
  42164. * This property is observable
  42165. */
  42166. loadSiblings: boolean;
  42167. /**
  42168. * Gets the scene
  42169. */
  42170. readonly scene: Scene;
  42171. /**
  42172. * Gets the performance container
  42173. */
  42174. readonly performanceContainer: HTMLElement;
  42175. /**
  42176. * Gets the statistics text. This property is observable.
  42177. */
  42178. readonly statisticsText: string;
  42179. /**
  42180. * Gets the pick statistics text. This property is observable.
  42181. */
  42182. readonly pickStatisticsText: string;
  42183. /**
  42184. * Gets the available blend modes
  42185. */
  42186. readonly colorBlendModes: object[];
  42187. /**
  42188. * Gets the editor error message
  42189. */
  42190. readonly editorError: string;
  42191. /**
  42192. * Gets or sets the tileset of the view model.
  42193. */
  42194. tileset: Cesium3DTileset;
  42195. /**
  42196. * Gets the current feature of the view model.
  42197. */
  42198. feature: Cesium3DTileFeature;
  42199. /**
  42200. * Gets the current tile of the view model
  42201. */
  42202. tile: Cesium3DTile;
  42203. /**
  42204. * Toggles the pick tileset mode
  42205. */
  42206. togglePickTileset(): void;
  42207. /**
  42208. * Toggles the inspector visibility
  42209. */
  42210. toggleInspector(): void;
  42211. /**
  42212. * Toggles the visibility of the tileset section
  42213. */
  42214. toggleTileset(): void;
  42215. /**
  42216. * Toggles the visibility of the display section
  42217. */
  42218. toggleDisplay(): void;
  42219. /**
  42220. * Toggles the visibility of the update section
  42221. */
  42222. toggleUpdate(): void;
  42223. /**
  42224. * Toggles the visibility of the logging section
  42225. */
  42226. toggleLogging(): void;
  42227. /**
  42228. * Toggles the visibility of the style section
  42229. */
  42230. toggleStyle(): void;
  42231. /**
  42232. * Toggles the visibility of the tile Debug Info section
  42233. */
  42234. toggleTileDebugLabels(): void;
  42235. /**
  42236. * Toggles the visibility of the optimization section
  42237. */
  42238. toggleOptimization(): void;
  42239. /**
  42240. * Trims tile cache
  42241. */
  42242. trimTilesCache(): void;
  42243. /**
  42244. * Compiles the style in the style editor.
  42245. */
  42246. compileStyle(): void;
  42247. /**
  42248. * Handles key press events on the style editor.
  42249. */
  42250. styleEditorKeyPress(): void;
  42251. /**
  42252. * @returns true if the object has been destroyed, false otherwise.
  42253. */
  42254. isDestroyed(): boolean;
  42255. /**
  42256. * Destroys the widget. Should be called if permanently
  42257. * removing the widget from layout.
  42258. */
  42259. destroy(): void;
  42260. /**
  42261. * Generates an HTML string of the statistics
  42262. * @param tileset - The tileset
  42263. * @param isPick - Whether this is getting the statistics for the pick pass
  42264. * @returns The formatted statistics
  42265. */
  42266. static getStatistics(tileset: Cesium3DTileset, isPick: boolean): string;
  42267. }
  42268. /**
  42269. * Inspector widget to aid in debugging
  42270. * @param container - The DOM element or ID that will contain the widget.
  42271. * @param scene - The Scene instance to use.
  42272. */
  42273. export class CesiumInspector {
  42274. constructor(container: Element | string, scene: Scene);
  42275. /**
  42276. * Gets the parent container.
  42277. */
  42278. container: Element;
  42279. /**
  42280. * Gets the view model.
  42281. */
  42282. viewModel: CesiumInspectorViewModel;
  42283. /**
  42284. * @returns true if the object has been destroyed, false otherwise.
  42285. */
  42286. isDestroyed(): boolean;
  42287. /**
  42288. * Destroys the widget. Should be called if permanently
  42289. * removing the widget from layout.
  42290. */
  42291. destroy(): void;
  42292. }
  42293. /**
  42294. * The view model for {@link CesiumInspector}.
  42295. * @param scene - The scene instance to use.
  42296. * @param performanceContainer - The instance to use for performance container.
  42297. */
  42298. export class CesiumInspectorViewModel {
  42299. constructor(scene: Scene, performanceContainer: Element);
  42300. /**
  42301. * Gets or sets the show frustums state. This property is observable.
  42302. */
  42303. frustums: boolean;
  42304. /**
  42305. * Gets or sets the show frustum planes state. This property is observable.
  42306. */
  42307. frustumPlanes: boolean;
  42308. /**
  42309. * Gets or sets the show performance display state. This property is observable.
  42310. */
  42311. performance: boolean;
  42312. /**
  42313. * Gets or sets the shader cache text. This property is observable.
  42314. */
  42315. shaderCacheText: string;
  42316. /**
  42317. * Gets or sets the show primitive bounding sphere state. This property is observable.
  42318. */
  42319. primitiveBoundingSphere: boolean;
  42320. /**
  42321. * Gets or sets the show primitive reference frame state. This property is observable.
  42322. */
  42323. primitiveReferenceFrame: boolean;
  42324. /**
  42325. * Gets or sets the filter primitive state. This property is observable.
  42326. */
  42327. filterPrimitive: boolean;
  42328. /**
  42329. * Gets or sets the show tile bounding sphere state. This property is observable.
  42330. */
  42331. tileBoundingSphere: boolean;
  42332. /**
  42333. * Gets or sets the filter tile state. This property is observable.
  42334. */
  42335. filterTile: boolean;
  42336. /**
  42337. * Gets or sets the show wireframe state. This property is observable.
  42338. */
  42339. wireframe: boolean;
  42340. /**
  42341. * Gets or sets the index of the depth frustum to display. This property is observable.
  42342. */
  42343. depthFrustum: number;
  42344. /**
  42345. * Gets or sets the suspend updates state. This property is observable.
  42346. */
  42347. suspendUpdates: boolean;
  42348. /**
  42349. * Gets or sets the show tile coordinates state. This property is observable.
  42350. */
  42351. tileCoordinates: boolean;
  42352. /**
  42353. * Gets or sets the frustum statistic text. This property is observable.
  42354. */
  42355. frustumStatisticText: string;
  42356. /**
  42357. * Gets or sets the selected tile information text. This property is observable.
  42358. */
  42359. tileText: string;
  42360. /**
  42361. * Gets if a primitive has been selected. This property is observable.
  42362. */
  42363. hasPickedPrimitive: boolean;
  42364. /**
  42365. * Gets if a tile has been selected. This property is observable
  42366. */
  42367. hasPickedTile: boolean;
  42368. /**
  42369. * Gets if the picking primitive command is active. This property is observable.
  42370. */
  42371. pickPrimitiveActive: boolean;
  42372. /**
  42373. * Gets if the picking tile command is active. This property is observable.
  42374. */
  42375. pickTileActive: boolean;
  42376. /**
  42377. * Gets or sets if the cesium inspector drop down is visible. This property is observable.
  42378. */
  42379. dropDownVisible: boolean;
  42380. /**
  42381. * Gets or sets if the general section is visible. This property is observable.
  42382. */
  42383. generalVisible: boolean;
  42384. /**
  42385. * Gets or sets if the primitive section is visible. This property is observable.
  42386. */
  42387. primitivesVisible: boolean;
  42388. /**
  42389. * Gets or sets if the terrain section is visible. This property is observable.
  42390. */
  42391. terrainVisible: boolean;
  42392. /**
  42393. * Gets or sets the index of the depth frustum text. This property is observable.
  42394. */
  42395. depthFrustumText: string;
  42396. /**
  42397. * Gets the scene to control.
  42398. */
  42399. scene: Scene;
  42400. /**
  42401. * Gets the container of the PerformanceDisplay
  42402. */
  42403. performanceContainer: Element;
  42404. /**
  42405. * Gets the command to toggle the visibility of the drop down.
  42406. */
  42407. toggleDropDown: Command;
  42408. /**
  42409. * Gets the command to toggle the visibility of a BoundingSphere for a primitive
  42410. */
  42411. showPrimitiveBoundingSphere: Command;
  42412. /**
  42413. * Gets the command to toggle the visibility of a {@link DebugModelMatrixPrimitive} for the model matrix of a primitive
  42414. */
  42415. showPrimitiveReferenceFrame: Command;
  42416. /**
  42417. * Gets the command to toggle a filter that renders only a selected primitive
  42418. */
  42419. doFilterPrimitive: Command;
  42420. /**
  42421. * Gets the command to increment the depth frustum index to be shown
  42422. */
  42423. incrementDepthFrustum: Command;
  42424. /**
  42425. * Gets the command to decrement the depth frustum index to be shown
  42426. */
  42427. decrementDepthFrustum: Command;
  42428. /**
  42429. * Gets the command to toggle the visibility of tile coordinates
  42430. */
  42431. showTileCoordinates: Command;
  42432. /**
  42433. * Gets the command to toggle the visibility of a BoundingSphere for a selected tile
  42434. */
  42435. showTileBoundingSphere: Command;
  42436. /**
  42437. * Gets the command to toggle a filter that renders only a selected tile
  42438. */
  42439. doFilterTile: Command;
  42440. /**
  42441. * Gets the command to expand and collapse the general section
  42442. */
  42443. toggleGeneral: Command;
  42444. /**
  42445. * Gets the command to expand and collapse the primitives section
  42446. */
  42447. togglePrimitives: Command;
  42448. /**
  42449. * Gets the command to expand and collapse the terrain section
  42450. */
  42451. toggleTerrain: Command;
  42452. /**
  42453. * Gets the command to pick a primitive
  42454. */
  42455. pickPrimitive: Command;
  42456. /**
  42457. * Gets the command to pick a tile
  42458. */
  42459. pickTile: Command;
  42460. /**
  42461. * Gets the command to pick a tile
  42462. */
  42463. selectParent: Command;
  42464. /**
  42465. * Gets the command to pick a tile
  42466. */
  42467. selectNW: Command;
  42468. /**
  42469. * Gets the command to pick a tile
  42470. */
  42471. selectNE: Command;
  42472. /**
  42473. * Gets the command to pick a tile
  42474. */
  42475. selectSW: Command;
  42476. /**
  42477. * Gets the command to pick a tile
  42478. */
  42479. selectSE: Command;
  42480. /**
  42481. * Gets or sets the current selected primitive
  42482. */
  42483. primitive: Command;
  42484. /**
  42485. * Gets or sets the current selected tile
  42486. */
  42487. tile: Command;
  42488. /**
  42489. * @returns true if the object has been destroyed, false otherwise.
  42490. */
  42491. isDestroyed(): boolean;
  42492. /**
  42493. * Destroys the widget. Should be called if permanently
  42494. * removing the widget from layout.
  42495. */
  42496. destroy(): void;
  42497. }
  42498. /**
  42499. * A widget containing a Cesium scene.
  42500. * @example
  42501. * // For each example, include a link to CesiumWidget.css stylesheet in HTML head,
  42502. * // and in the body, include: <div id="cesiumContainer"></div>
  42503. *
  42504. * //Widget with no terrain and default Bing Maps imagery provider.
  42505. * const widget = new Cesium.CesiumWidget('cesiumContainer');
  42506. *
  42507. * //Widget with ion imagery and Cesium World Terrain.
  42508. * const widget2 = new Cesium.CesiumWidget('cesiumContainer', {
  42509. * imageryProvider : Cesium.createWorldImagery(),
  42510. * terrainProvider : Cesium.createWorldTerrain(),
  42511. * skyBox : new Cesium.SkyBox({
  42512. * sources : {
  42513. * positiveX : 'stars/TychoSkymapII.t3_08192x04096_80_px.jpg',
  42514. * negativeX : 'stars/TychoSkymapII.t3_08192x04096_80_mx.jpg',
  42515. * positiveY : 'stars/TychoSkymapII.t3_08192x04096_80_py.jpg',
  42516. * negativeY : 'stars/TychoSkymapII.t3_08192x04096_80_my.jpg',
  42517. * positiveZ : 'stars/TychoSkymapII.t3_08192x04096_80_pz.jpg',
  42518. * negativeZ : 'stars/TychoSkymapII.t3_08192x04096_80_mz.jpg'
  42519. * }
  42520. * }),
  42521. * // Show Columbus View map with Web Mercator projection
  42522. * sceneMode : Cesium.SceneMode.COLUMBUS_VIEW,
  42523. * mapProjection : new Cesium.WebMercatorProjection()
  42524. * });
  42525. * @param container - The DOM element or ID that will contain the widget.
  42526. * @param [options] - Object with the following properties:
  42527. * @param [options.clock = new Clock()] - The clock to use to control current time.
  42528. * @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.
  42529. * @param [options.terrainProvider = new EllipsoidTerrainProvider] - The terrain provider.
  42530. * @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.
  42531. * @param [options.skyAtmosphere] - Blue sky, and the glow around the Earth's limb. Set to <code>false</code> to turn it off.
  42532. * @param [options.sceneMode = SceneMode.SCENE3D] - The initial scene mode.
  42533. * @param [options.scene3DOnly = false] - When <code>true</code>, each geometry instance will only be rendered in 3D to save GPU memory.
  42534. * @param [options.orderIndependentTranslucency = true] - If true and the configuration supports it, use order independent translucency.
  42535. * @param [options.mapProjection = new GeographicProjection()] - The map projection to use in 2D and Columbus View modes.
  42536. * @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.
  42537. * @param [options.useDefaultRenderLoop = true] - True if this widget should control the render loop, false otherwise.
  42538. * @param [options.useBrowserRecommendedResolution = true] - If true, render at the browser's recommended resolution and ignore <code>window.devicePixelRatio</code>.
  42539. * @param [options.targetFrameRate] - The target frame rate when using the default render loop.
  42540. * @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.
  42541. * @param [options.contextOptions] - Context and WebGL creation properties corresponding to <code>options</code> passed to {@link Scene}.
  42542. * @param [options.creditContainer] - The DOM element or ID that will contain the {@link CreditDisplay}. If not specified, the credits are added
  42543. * to the bottom of the widget itself.
  42544. * @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.
  42545. * @param [options.shadows = false] - Determines if shadows are cast by light sources.
  42546. * @param [options.terrainShadows = ShadowMode.RECEIVE_ONLY] - Determines if the terrain casts or receives shadows from light sources.
  42547. * @param [options.mapMode2D = MapMode2D.INFINITE_SCROLL] - Determines if the 2D map is rotatable or can be scrolled infinitely in the horizontal direction.
  42548. * @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}.
  42549. * @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}.
  42550. * @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.
  42551. */
  42552. export class CesiumWidget {
  42553. constructor(container: Element | string, options?: {
  42554. clock?: Clock;
  42555. imageryProvider?: ImageryProvider | false;
  42556. terrainProvider?: TerrainProvider;
  42557. skyBox?: SkyBox | false;
  42558. skyAtmosphere?: SkyAtmosphere | false;
  42559. sceneMode?: SceneMode;
  42560. scene3DOnly?: boolean;
  42561. orderIndependentTranslucency?: boolean;
  42562. mapProjection?: MapProjection;
  42563. globe?: Globe | false;
  42564. useDefaultRenderLoop?: boolean;
  42565. useBrowserRecommendedResolution?: boolean;
  42566. targetFrameRate?: number;
  42567. showRenderLoopErrors?: boolean;
  42568. contextOptions?: any;
  42569. creditContainer?: Element | string;
  42570. creditViewport?: Element | string;
  42571. shadows?: boolean;
  42572. terrainShadows?: ShadowMode;
  42573. mapMode2D?: MapMode2D;
  42574. requestRenderMode?: boolean;
  42575. maximumRenderTimeChange?: number;
  42576. msaaSamples?: number;
  42577. });
  42578. /**
  42579. * Gets the parent container.
  42580. */
  42581. readonly container: Element;
  42582. /**
  42583. * Gets the canvas.
  42584. */
  42585. readonly canvas: HTMLCanvasElement;
  42586. /**
  42587. * Gets the credit container.
  42588. */
  42589. readonly creditContainer: Element;
  42590. /**
  42591. * Gets the credit viewport
  42592. */
  42593. readonly creditViewport: Element;
  42594. /**
  42595. * Gets the scene.
  42596. */
  42597. readonly scene: Scene;
  42598. /**
  42599. * Gets the collection of image layers that will be rendered on the globe.
  42600. */
  42601. readonly imageryLayers: ImageryLayerCollection;
  42602. /**
  42603. * The terrain provider providing surface geometry for the globe.
  42604. */
  42605. terrainProvider: TerrainProvider;
  42606. /**
  42607. * Gets the camera.
  42608. */
  42609. readonly camera: Camera;
  42610. /**
  42611. * Gets the clock.
  42612. */
  42613. readonly clock: Clock;
  42614. /**
  42615. * Gets the screen space event handler.
  42616. */
  42617. readonly screenSpaceEventHandler: ScreenSpaceEventHandler;
  42618. /**
  42619. * Gets or sets the target frame rate of the widget when <code>useDefaultRenderLoop</code>
  42620. * is true. If undefined, the browser's {@link requestAnimationFrame} implementation
  42621. * determines the frame rate. If defined, this value must be greater than 0. A value higher
  42622. * than the underlying requestAnimationFrame implementation will have no effect.
  42623. */
  42624. targetFrameRate: number;
  42625. /**
  42626. * Gets or sets whether or not this widget should control the render loop.
  42627. * If set to true the widget will use {@link requestAnimationFrame} to
  42628. * perform rendering and resizing of the widget, as well as drive the
  42629. * simulation clock. If set to false, you must manually call the
  42630. * <code>resize</code>, <code>render</code> methods as part of a custom
  42631. * render loop. If an error occurs during rendering, {@link Scene}'s
  42632. * <code>renderError</code> event will be raised and this property
  42633. * will be set to false. It must be set back to true to continue rendering
  42634. * after the error.
  42635. */
  42636. useDefaultRenderLoop: boolean;
  42637. /**
  42638. * Gets or sets a scaling factor for rendering resolution. Values less than 1.0 can improve
  42639. * performance on less powerful devices while values greater than 1.0 will render at a higher
  42640. * resolution and then scale down, resulting in improved visual fidelity.
  42641. * For example, if the widget is laid out at a size of 640x480, setting this value to 0.5
  42642. * will cause the scene to be rendered at 320x240 and then scaled up while setting
  42643. * it to 2.0 will cause the scene to be rendered at 1280x960 and then scaled down.
  42644. */
  42645. resolutionScale: number;
  42646. /**
  42647. * Boolean flag indicating if the browser's recommended resolution is used.
  42648. * If true, the browser's device pixel ratio is ignored and 1.0 is used instead,
  42649. * effectively rendering based on CSS pixels instead of device pixels. This can improve
  42650. * performance on less powerful devices that have high pixel density. When false, rendering
  42651. * will be in device pixels. {@link CesiumWidget#resolutionScale} will still take effect whether
  42652. * this flag is true or false.
  42653. */
  42654. useBrowserRecommendedResolution: boolean;
  42655. /**
  42656. * Show an error panel to the user containing a title and a longer error message,
  42657. * which can be dismissed using an OK button. This panel is displayed automatically
  42658. * when a render loop error occurs, if showRenderLoopErrors was not false when the
  42659. * widget was constructed.
  42660. * @param title - The title to be displayed on the error panel. This string is interpreted as text.
  42661. * @param [message] - A helpful, user-facing message to display prior to the detailed error information. This string is interpreted as HTML.
  42662. * @param [error] - The error to be displayed on the error panel. This string is formatted using {@link formatError} and then displayed as text.
  42663. */
  42664. showErrorPanel(title: string, message?: string, error?: string): void;
  42665. /**
  42666. * @returns true if the object has been destroyed, false otherwise.
  42667. */
  42668. isDestroyed(): boolean;
  42669. /**
  42670. * Destroys the widget. Should be called if permanently
  42671. * removing the widget from layout.
  42672. */
  42673. destroy(): void;
  42674. /**
  42675. * Updates the canvas size, camera aspect ratio, and viewport size.
  42676. * This function is called automatically as needed unless
  42677. * <code>useDefaultRenderLoop</code> is set to false.
  42678. */
  42679. resize(): void;
  42680. /**
  42681. * Renders the scene. This function is called automatically
  42682. * unless <code>useDefaultRenderLoop</code> is set to false;
  42683. */
  42684. render(): void;
  42685. }
  42686. /**
  42687. * A view model which exposes a {@link Clock} for user interfaces.
  42688. * @param [clock] - The clock object wrapped by this view model, if undefined a new instance will be created.
  42689. */
  42690. export class ClockViewModel {
  42691. constructor(clock?: Clock);
  42692. /**
  42693. * Gets the current system time.
  42694. * This property is observable.
  42695. */
  42696. systemTime: JulianDate;
  42697. /**
  42698. * Gets or sets the start time of the clock.
  42699. * See {@link Clock#startTime}.
  42700. * This property is observable.
  42701. */
  42702. startTime: JulianDate;
  42703. /**
  42704. * Gets or sets the stop time of the clock.
  42705. * See {@link Clock#stopTime}.
  42706. * This property is observable.
  42707. */
  42708. stopTime: JulianDate;
  42709. /**
  42710. * Gets or sets the current time.
  42711. * See {@link Clock#currentTime}.
  42712. * This property is observable.
  42713. */
  42714. currentTime: JulianDate;
  42715. /**
  42716. * Gets or sets the clock multiplier.
  42717. * See {@link Clock#multiplier}.
  42718. * This property is observable.
  42719. */
  42720. multiplier: number;
  42721. /**
  42722. * Gets or sets the clock step setting.
  42723. * See {@link Clock#clockStep}.
  42724. * This property is observable.
  42725. */
  42726. clockStep: ClockStep;
  42727. /**
  42728. * Gets or sets the clock range setting.
  42729. * See {@link Clock#clockRange}.
  42730. * This property is observable.
  42731. */
  42732. clockRange: ClockRange;
  42733. /**
  42734. * Gets or sets whether the clock can animate.
  42735. * See {@link Clock#canAnimate}.
  42736. * This property is observable.
  42737. */
  42738. canAnimate: boolean;
  42739. /**
  42740. * Gets or sets whether the clock should animate.
  42741. * See {@link Clock#shouldAnimate}.
  42742. * This property is observable.
  42743. */
  42744. shouldAnimate: boolean;
  42745. /**
  42746. * Gets the underlying Clock.
  42747. */
  42748. clock: Clock;
  42749. /**
  42750. * Updates the view model with the contents of the underlying clock.
  42751. * Can be called to force an update of the viewModel if the underlying
  42752. * clock has changed and <code>Clock.tick</code> has not yet been called.
  42753. */
  42754. synchronize(): void;
  42755. /**
  42756. * @returns true if the object has been destroyed, false otherwise.
  42757. */
  42758. isDestroyed(): boolean;
  42759. /**
  42760. * Destroys the view model. Should be called to
  42761. * properly clean up the view model when it is no longer needed.
  42762. */
  42763. destroy(): void;
  42764. }
  42765. /**
  42766. * A Command is a function with an extra <code>canExecute</code> observable property to determine
  42767. * whether the command can be executed. When executed, a Command function will check the
  42768. * value of <code>canExecute</code> and throw if false.
  42769. *
  42770. * This type describes an interface and is not intended to be instantiated directly.
  42771. * See {@link createCommand} to create a command from a function.
  42772. */
  42773. export class Command {
  42774. constructor();
  42775. /**
  42776. * Gets whether this command can currently be executed. This property is observable.
  42777. */
  42778. canExecute: boolean;
  42779. /**
  42780. * Gets an event which is raised before the command executes, the event
  42781. * is raised with an object containing two properties: a <code>cancel</code> property,
  42782. * which if set to false by the listener will prevent the command from being executed, and
  42783. * an <code>args</code> property, which is the array of arguments being passed to the command.
  42784. */
  42785. beforeExecute: Event;
  42786. /**
  42787. * Gets an event which is raised after the command executes, the event
  42788. * is raised with the return value of the command as its only parameter.
  42789. */
  42790. afterExecute: Event;
  42791. }
  42792. /**
  42793. * A single button widget for toggling fullscreen mode.
  42794. * @param container - The DOM element or ID that will contain the widget.
  42795. * @param [fullscreenElement = document.body] - The element or id to be placed into fullscreen mode.
  42796. */
  42797. export class FullscreenButton {
  42798. constructor(container: Element | string, fullscreenElement?: Element | string);
  42799. /**
  42800. * Gets the parent container.
  42801. */
  42802. container: Element;
  42803. /**
  42804. * Gets the view model.
  42805. */
  42806. viewModel: FullscreenButtonViewModel;
  42807. /**
  42808. * @returns true if the object has been destroyed, false otherwise.
  42809. */
  42810. isDestroyed(): boolean;
  42811. /**
  42812. * Destroys the widget. Should be called if permanently
  42813. * removing the widget from layout.
  42814. */
  42815. destroy(): void;
  42816. }
  42817. /**
  42818. * The view model for {@link FullscreenButton}.
  42819. * @param [fullscreenElement = document.body] - The element or id to be placed into fullscreen mode.
  42820. * @param [container] - The DOM element or ID that will contain the widget.
  42821. */
  42822. export class FullscreenButtonViewModel {
  42823. constructor(fullscreenElement?: Element | string, container?: Element | string);
  42824. /**
  42825. * Gets whether or not fullscreen mode is active. This property is observable.
  42826. */
  42827. isFullscreen: boolean;
  42828. /**
  42829. * Gets or sets whether or not fullscreen functionality should be enabled. This property is observable.
  42830. */
  42831. isFullscreenEnabled: boolean;
  42832. /**
  42833. * Gets the tooltip. This property is observable.
  42834. */
  42835. tooltip: string;
  42836. /**
  42837. * Gets or sets the HTML element to place into fullscreen mode when the
  42838. * corresponding button is pressed.
  42839. */
  42840. fullscreenElement: Element;
  42841. /**
  42842. * Gets the Command to toggle fullscreen mode.
  42843. */
  42844. command: Command;
  42845. /**
  42846. * @returns true if the object has been destroyed, false otherwise.
  42847. */
  42848. isDestroyed(): boolean;
  42849. /**
  42850. * Destroys the view model. Should be called to
  42851. * properly clean up the view model when it is no longer needed.
  42852. */
  42853. destroy(): void;
  42854. }
  42855. /**
  42856. * A widget for finding addresses and landmarks, and flying the camera to them. Geocoding is
  42857. * performed using {@link https://cesium.com/cesium-ion/|Cesium ion}.
  42858. * @param options - Object with the following properties:
  42859. * @param options.container - The DOM element or ID that will contain the widget.
  42860. * @param options.scene - The Scene instance to use.
  42861. * @param [options.geocoderServices] - The geocoder services to be used
  42862. * @param [options.autoComplete = true] - True if the geocoder should query as the user types to autocomplete
  42863. * @param [options.flightDuration = 1.5] - The duration of the camera flight to an entered location, in seconds.
  42864. * @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.
  42865. */
  42866. export class Geocoder {
  42867. constructor(options: {
  42868. container: Element | string;
  42869. scene: Scene;
  42870. geocoderServices?: GeocoderService[];
  42871. autoComplete?: boolean;
  42872. flightDuration?: number;
  42873. destinationFound?: Geocoder.DestinationFoundFunction;
  42874. });
  42875. /**
  42876. * Gets the parent container.
  42877. */
  42878. container: Element;
  42879. /**
  42880. * Gets the parent container.
  42881. */
  42882. searchSuggestionsContainer: Element;
  42883. /**
  42884. * Gets the view model.
  42885. */
  42886. viewModel: GeocoderViewModel;
  42887. /**
  42888. * @returns true if the object has been destroyed, false otherwise.
  42889. */
  42890. isDestroyed(): boolean;
  42891. /**
  42892. * Destroys the widget. Should be called if permanently
  42893. * removing the widget from layout.
  42894. */
  42895. destroy(): void;
  42896. }
  42897. export namespace Geocoder {
  42898. /**
  42899. * A function that handles the result of a successful geocode.
  42900. * @param viewModel - The view model.
  42901. * @param destination - The destination result of the geocode.
  42902. */
  42903. type DestinationFoundFunction = (viewModel: GeocoderViewModel, destination: Cartesian3 | Rectangle) => void;
  42904. }
  42905. /**
  42906. * The view model for the {@link Geocoder} widget.
  42907. * @param options - Object with the following properties:
  42908. * @param options.scene - The Scene instance to use.
  42909. * @param [options.geocoderServices] - Geocoder services to use for geocoding queries.
  42910. * If more than one are supplied, suggestions will be gathered for the geocoders that support it,
  42911. * and if no suggestion is selected the result from the first geocoder service wil be used.
  42912. * @param [options.flightDuration] - The duration of the camera flight to an entered location, in seconds.
  42913. * @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.
  42914. */
  42915. export class GeocoderViewModel {
  42916. constructor(options: {
  42917. scene: Scene;
  42918. geocoderServices?: GeocoderService[];
  42919. flightDuration?: number;
  42920. destinationFound?: Geocoder.DestinationFoundFunction;
  42921. });
  42922. /**
  42923. * Gets or sets a value indicating if this instance should always show its text input field.
  42924. */
  42925. keepExpanded: boolean;
  42926. /**
  42927. * True if the geocoder should query as the user types to autocomplete
  42928. */
  42929. autoComplete: boolean;
  42930. /**
  42931. * Gets and sets the command called when a geocode destination is found
  42932. */
  42933. destinationFound: Geocoder.DestinationFoundFunction;
  42934. /**
  42935. * Gets a value indicating whether a search is currently in progress. This property is observable.
  42936. */
  42937. isSearchInProgress: boolean;
  42938. /**
  42939. * Gets or sets the text to search for. The text can be an address, or longitude, latitude,
  42940. * and optional height, where longitude and latitude are in degrees and height is in meters.
  42941. */
  42942. searchText: string;
  42943. /**
  42944. * Gets or sets the the duration of the camera flight in seconds.
  42945. * A value of zero causes the camera to instantly switch to the geocoding location.
  42946. * The duration will be computed based on the distance when undefined.
  42947. */
  42948. flightDuration: number | undefined;
  42949. /**
  42950. * Gets the event triggered on flight completion.
  42951. */
  42952. complete: Event;
  42953. /**
  42954. * Gets the scene to control.
  42955. */
  42956. scene: Scene;
  42957. /**
  42958. * Gets the Command that is executed when the button is clicked.
  42959. */
  42960. search: Command;
  42961. /**
  42962. * Gets the currently selected geocoder search suggestion
  42963. */
  42964. selectedSuggestion: any;
  42965. /**
  42966. * Gets the list of geocoder search suggestions
  42967. */
  42968. suggestions: object[];
  42969. /**
  42970. * Destroys the widget. Should be called if permanently
  42971. * removing the widget from layout.
  42972. */
  42973. destroy(): void;
  42974. /**
  42975. * A function to fly to the destination found by a successful geocode.
  42976. */
  42977. static flyToDestination: Geocoder.DestinationFoundFunction;
  42978. }
  42979. /**
  42980. * A single button widget for returning to the default camera view of the current scene.
  42981. * @param container - The DOM element or ID that will contain the widget.
  42982. * @param scene - The Scene instance to use.
  42983. * @param [duration] - The time, in seconds, it takes to complete the camera flight home.
  42984. */
  42985. export class HomeButton {
  42986. constructor(container: Element | string, scene: Scene, duration?: number);
  42987. /**
  42988. * Gets the parent container.
  42989. */
  42990. container: Element;
  42991. /**
  42992. * Gets the view model.
  42993. */
  42994. viewModel: HomeButtonViewModel;
  42995. /**
  42996. * @returns true if the object has been destroyed, false otherwise.
  42997. */
  42998. isDestroyed(): boolean;
  42999. /**
  43000. * Destroys the widget. Should be called if permanently
  43001. * removing the widget from layout.
  43002. */
  43003. destroy(): void;
  43004. }
  43005. /**
  43006. * The view model for {@link HomeButton}.
  43007. * @param scene - The scene instance to use.
  43008. * @param [duration] - The duration of the camera flight in seconds.
  43009. */
  43010. export class HomeButtonViewModel {
  43011. constructor(scene: Scene, duration?: number);
  43012. /**
  43013. * Gets or sets the tooltip. This property is observable.
  43014. */
  43015. tooltip: string;
  43016. /**
  43017. * Gets the scene to control.
  43018. */
  43019. scene: Scene;
  43020. /**
  43021. * Gets the Command that is executed when the button is clicked.
  43022. */
  43023. command: Command;
  43024. /**
  43025. * Gets or sets the the duration of the camera flight in seconds.
  43026. * A value of zero causes the camera to instantly switch to home view.
  43027. * The duration will be computed based on the distance when undefined.
  43028. */
  43029. duration: number | undefined;
  43030. }
  43031. /**
  43032. * A widget for displaying information or a description.
  43033. * @param container - The DOM element or ID that will contain the widget.
  43034. */
  43035. export class InfoBox {
  43036. constructor(container: Element | string);
  43037. /**
  43038. * Gets the parent container.
  43039. */
  43040. container: Element;
  43041. /**
  43042. * Gets the view model.
  43043. */
  43044. viewModel: InfoBoxViewModel;
  43045. /**
  43046. * Gets the iframe used to display the description.
  43047. */
  43048. frame: HTMLIFrameElement;
  43049. /**
  43050. * @returns true if the object has been destroyed, false otherwise.
  43051. */
  43052. isDestroyed(): boolean;
  43053. /**
  43054. * Destroys the widget. Should be called if permanently
  43055. * removing the widget from layout.
  43056. */
  43057. destroy(): void;
  43058. }
  43059. /**
  43060. * The view model for {@link InfoBox}.
  43061. */
  43062. export class InfoBoxViewModel {
  43063. constructor();
  43064. /**
  43065. * Gets or sets the maximum height of the info box in pixels. This property is observable.
  43066. */
  43067. maxHeight: number;
  43068. /**
  43069. * Gets or sets whether the camera tracking icon is enabled.
  43070. */
  43071. enableCamera: boolean;
  43072. /**
  43073. * Gets or sets the status of current camera tracking of the selected object.
  43074. */
  43075. isCameraTracking: boolean;
  43076. /**
  43077. * Gets or sets the visibility of the info box.
  43078. */
  43079. showInfo: boolean;
  43080. /**
  43081. * Gets or sets the title text in the info box.
  43082. */
  43083. titleText: string;
  43084. /**
  43085. * Gets or sets the description HTML for the info box.
  43086. */
  43087. description: string;
  43088. /**
  43089. * Gets the SVG path of the camera icon, which can change to be "crossed out" or not.
  43090. */
  43091. cameraIconPath: string;
  43092. /**
  43093. * Gets the maximum height of sections within the info box, minus an offset, in CSS-ready form.
  43094. * @param offset - The offset in pixels.
  43095. */
  43096. maxHeightOffset(offset: number): string;
  43097. /**
  43098. * Gets an {@link Event} that is fired when the user clicks the camera icon.
  43099. */
  43100. cameraClicked: Event;
  43101. /**
  43102. * Gets an {@link Event} that is fired when the user closes the info box.
  43103. */
  43104. closeClicked: Event;
  43105. }
  43106. /**
  43107. * <p>The NavigationHelpButton is a single button widget for displaying instructions for
  43108. * navigating the globe with the mouse.</p><p style="clear: both;"></p><br/>
  43109. * @example
  43110. * // In HTML head, include a link to the NavigationHelpButton.css stylesheet,
  43111. * // and in the body, include: <div id="navigationHelpButtonContainer"></div>
  43112. *
  43113. * const navigationHelpButton = new Cesium.NavigationHelpButton({
  43114. * container : 'navigationHelpButtonContainer'
  43115. * });
  43116. * @param options - Object with the following properties:
  43117. * @param options.container - The DOM element or ID that will contain the widget.
  43118. * @param [options.instructionsInitiallyVisible = false] - True if the navigation instructions should initially be visible; otherwise, false.
  43119. */
  43120. export class NavigationHelpButton {
  43121. constructor(options: {
  43122. container: Element | string;
  43123. instructionsInitiallyVisible?: boolean;
  43124. });
  43125. /**
  43126. * Gets the parent container.
  43127. */
  43128. container: Element;
  43129. /**
  43130. * Gets the view model.
  43131. */
  43132. viewModel: NavigationHelpButtonViewModel;
  43133. /**
  43134. * @returns true if the object has been destroyed, false otherwise.
  43135. */
  43136. isDestroyed(): boolean;
  43137. /**
  43138. * Destroys the widget. Should be called if permanently
  43139. * removing the widget from layout.
  43140. */
  43141. destroy(): void;
  43142. }
  43143. /**
  43144. * The view model for {@link NavigationHelpButton}.
  43145. */
  43146. export class NavigationHelpButtonViewModel {
  43147. constructor();
  43148. /**
  43149. * Gets or sets whether the instructions are currently shown. This property is observable.
  43150. */
  43151. showInstructions: boolean;
  43152. /**
  43153. * Gets or sets the tooltip. This property is observable.
  43154. */
  43155. tooltip: string;
  43156. /**
  43157. * Gets the Command that is executed when the button is clicked.
  43158. */
  43159. command: Command;
  43160. /**
  43161. * Gets the Command that is executed when the mouse instructions should be shown.
  43162. */
  43163. showClick: Command;
  43164. /**
  43165. * Gets the Command that is executed when the touch instructions should be shown.
  43166. */
  43167. showTouch: Command;
  43168. }
  43169. /**
  43170. * Monitors performance of the application and displays a message if poor performance is detected.
  43171. * @param [options] - Object with the following properties:
  43172. * @param options.container - The DOM element or ID that will contain the widget.
  43173. * @param options.scene - The {@link Scene} for which to monitor performance.
  43174. * @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
  43175. * message to display when a low frame rate is detected. The message is interpeted as HTML, so make sure
  43176. * it comes from a trusted source so that your application is not vulnerable to cross-site scripting attacks.
  43177. */
  43178. export class PerformanceWatchdog {
  43179. constructor(options?: {
  43180. container: Element | string;
  43181. scene: Scene;
  43182. lowFrameRateMessage?: string;
  43183. });
  43184. /**
  43185. * Gets the parent container.
  43186. */
  43187. container: Element;
  43188. /**
  43189. * Gets the view model.
  43190. */
  43191. viewModel: PerformanceWatchdogViewModel;
  43192. /**
  43193. * @returns true if the object has been destroyed, false otherwise.
  43194. */
  43195. isDestroyed(): boolean;
  43196. /**
  43197. * Destroys the widget. Should be called if permanently
  43198. * removing the widget from layout.
  43199. */
  43200. destroy(): void;
  43201. }
  43202. /**
  43203. * The view model for {@link PerformanceWatchdog}.
  43204. * @param [options] - Object with the following properties:
  43205. * @param options.scene - The Scene instance for which to monitor performance.
  43206. * @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
  43207. * message to display when a low frame rate is detected. The message is interpeted as HTML, so make sure
  43208. * it comes from a trusted source so that your application is not vulnerable to cross-site scripting attacks.
  43209. */
  43210. export class PerformanceWatchdogViewModel {
  43211. constructor(options?: {
  43212. scene: Scene;
  43213. lowFrameRateMessage?: string;
  43214. });
  43215. /**
  43216. * Gets or sets the message to display when a low frame rate is detected. This string will be interpreted as HTML.
  43217. */
  43218. lowFrameRateMessage: string;
  43219. /**
  43220. * Gets or sets a value indicating whether the low frame rate message has previously been dismissed by the user. If it has
  43221. * been dismissed, the message will not be redisplayed, no matter the frame rate.
  43222. */
  43223. lowFrameRateMessageDismissed: boolean;
  43224. /**
  43225. * Gets or sets a value indicating whether the low frame rate message is currently being displayed.
  43226. */
  43227. showingLowFrameRateMessage: boolean;
  43228. /**
  43229. * Gets the {@link Scene} instance for which to monitor performance.
  43230. */
  43231. scene: Scene;
  43232. /**
  43233. * Gets a command that dismisses the low frame rate message. Once it is dismissed, the message
  43234. * will not be redisplayed.
  43235. */
  43236. dismissMessage: Command;
  43237. }
  43238. /**
  43239. * The ProjectionPicker is a single button widget for switching between perspective and orthographic projections.
  43240. * @example
  43241. * // In HTML head, include a link to the ProjectionPicker.css stylesheet,
  43242. * // and in the body, include: <div id="projectionPickerContainer"></div>
  43243. * // Note: This code assumes you already have a Scene instance.
  43244. *
  43245. * const projectionPicker = new Cesium.ProjectionPicker('projectionPickerContainer', scene);
  43246. * @param container - The DOM element or ID that will contain the widget.
  43247. * @param scene - The Scene instance to use.
  43248. */
  43249. export class ProjectionPicker {
  43250. constructor(container: Element | string, scene: Scene);
  43251. /**
  43252. * Gets the parent container.
  43253. */
  43254. container: Element;
  43255. /**
  43256. * Gets the view model.
  43257. */
  43258. viewModel: ProjectionPickerViewModel;
  43259. /**
  43260. * @returns true if the object has been destroyed, false otherwise.
  43261. */
  43262. isDestroyed(): boolean;
  43263. /**
  43264. * Destroys the widget. Should be called if permanently
  43265. * removing the widget from layout.
  43266. */
  43267. destroy(): void;
  43268. }
  43269. /**
  43270. * The view model for {@link ProjectionPicker}.
  43271. * @param scene - The Scene to switch projections.
  43272. */
  43273. export class ProjectionPickerViewModel {
  43274. constructor(scene: Scene);
  43275. /**
  43276. * Gets or sets whether the button drop-down is currently visible. This property is observable.
  43277. */
  43278. dropDownVisible: boolean;
  43279. /**
  43280. * Gets or sets the perspective projection tooltip. This property is observable.
  43281. */
  43282. tooltipPerspective: string;
  43283. /**
  43284. * Gets or sets the orthographic projection tooltip. This property is observable.
  43285. */
  43286. tooltipOrthographic: string;
  43287. /**
  43288. * Gets the currently active tooltip. This property is observable.
  43289. */
  43290. selectedTooltip: string;
  43291. /**
  43292. * Gets or sets the current SceneMode. This property is observable.
  43293. */
  43294. sceneMode: SceneMode;
  43295. /**
  43296. * Gets the scene
  43297. */
  43298. scene: Scene;
  43299. /**
  43300. * Gets the command to toggle the drop down box.
  43301. */
  43302. toggleDropDown: Command;
  43303. /**
  43304. * Gets the command to switch to a perspective projection.
  43305. */
  43306. switchToPerspective: Command;
  43307. /**
  43308. * Gets the command to switch to orthographic projection.
  43309. */
  43310. switchToOrthographic: Command;
  43311. /**
  43312. * Gets whether the scene is currently using an orthographic projection.
  43313. */
  43314. isOrthographicProjection: Command;
  43315. /**
  43316. * @returns true if the object has been destroyed, false otherwise.
  43317. */
  43318. isDestroyed(): boolean;
  43319. /**
  43320. * Destroys the view model.
  43321. */
  43322. destroy(): void;
  43323. }
  43324. /**
  43325. * <img src="Images/sceneModePicker.png" style="float: left; margin-right: 10px;" width="44" height="116" />
  43326. * <p>The SceneModePicker is a single button widget for switching between scene modes;
  43327. * shown to the left in its expanded state. Programatic switching of scene modes will
  43328. * be automatically reflected in the widget as long as the specified Scene
  43329. * is used to perform the change.</p><p style="clear: both;"></p><br/>
  43330. * @example
  43331. * // In HTML head, include a link to the SceneModePicker.css stylesheet,
  43332. * // and in the body, include: <div id="sceneModePickerContainer"></div>
  43333. * // Note: This code assumes you already have a Scene instance.
  43334. *
  43335. * const sceneModePicker = new Cesium.SceneModePicker('sceneModePickerContainer', scene);
  43336. * @param container - The DOM element or ID that will contain the widget.
  43337. * @param scene - The Scene instance to use.
  43338. * @param [duration = 2.0] - The time, in seconds, it takes for the scene to transition.
  43339. */
  43340. export class SceneModePicker {
  43341. constructor(container: Element | string, scene: Scene, duration?: number);
  43342. /**
  43343. * Gets the parent container.
  43344. */
  43345. container: Element;
  43346. /**
  43347. * Gets the view model.
  43348. */
  43349. viewModel: SceneModePickerViewModel;
  43350. /**
  43351. * @returns true if the object has been destroyed, false otherwise.
  43352. */
  43353. isDestroyed(): boolean;
  43354. /**
  43355. * Destroys the widget. Should be called if permanently
  43356. * removing the widget from layout.
  43357. */
  43358. destroy(): void;
  43359. }
  43360. /**
  43361. * The view model for {@link SceneModePicker}.
  43362. * @param scene - The Scene to morph
  43363. * @param [duration = 2.0] - The duration of scene morph animations, in seconds
  43364. */
  43365. export class SceneModePickerViewModel {
  43366. constructor(scene: Scene, duration?: number);
  43367. /**
  43368. * Gets or sets the current SceneMode. This property is observable.
  43369. */
  43370. sceneMode: SceneMode;
  43371. /**
  43372. * Gets or sets whether the button drop-down is currently visible. This property is observable.
  43373. */
  43374. dropDownVisible: boolean;
  43375. /**
  43376. * Gets or sets the 2D tooltip. This property is observable.
  43377. */
  43378. tooltip2D: string;
  43379. /**
  43380. * Gets or sets the 3D tooltip. This property is observable.
  43381. */
  43382. tooltip3D: string;
  43383. /**
  43384. * Gets or sets the Columbus View tooltip. This property is observable.
  43385. */
  43386. tooltipColumbusView: string;
  43387. /**
  43388. * Gets the currently active tooltip. This property is observable.
  43389. */
  43390. selectedTooltip: string;
  43391. /**
  43392. * Gets the scene
  43393. */
  43394. scene: Scene;
  43395. /**
  43396. * Gets or sets the the duration of scene mode transition animations in seconds.
  43397. * A value of zero causes the scene to instantly change modes.
  43398. */
  43399. duration: number;
  43400. /**
  43401. * Gets the command to toggle the drop down box.
  43402. */
  43403. toggleDropDown: Command;
  43404. /**
  43405. * Gets the command to morph to 2D.
  43406. */
  43407. morphTo2D: Command;
  43408. /**
  43409. * Gets the command to morph to 3D.
  43410. */
  43411. morphTo3D: Command;
  43412. /**
  43413. * Gets the command to morph to Columbus View.
  43414. */
  43415. morphToColumbusView: Command;
  43416. /**
  43417. * @returns true if the object has been destroyed, false otherwise.
  43418. */
  43419. isDestroyed(): boolean;
  43420. /**
  43421. * Destroys the view model.
  43422. */
  43423. destroy(): void;
  43424. }
  43425. /**
  43426. * A widget for displaying an indicator on a selected object.
  43427. * @param container - The DOM element or ID that will contain the widget.
  43428. * @param scene - The Scene instance to use.
  43429. */
  43430. export class SelectionIndicator {
  43431. constructor(container: Element | string, scene: Scene);
  43432. /**
  43433. * Gets the parent container.
  43434. */
  43435. container: Element;
  43436. /**
  43437. * Gets the view model.
  43438. */
  43439. viewModel: SelectionIndicatorViewModel;
  43440. /**
  43441. * @returns true if the object has been destroyed, false otherwise.
  43442. */
  43443. isDestroyed(): boolean;
  43444. /**
  43445. * Destroys the widget. Should be called if permanently
  43446. * removing the widget from layout.
  43447. */
  43448. destroy(): void;
  43449. }
  43450. /**
  43451. * The view model for {@link SelectionIndicator}.
  43452. * @param scene - The scene instance to use for screen-space coordinate conversion.
  43453. * @param selectionIndicatorElement - The element containing all elements that make up the selection indicator.
  43454. * @param container - The DOM element that contains the widget.
  43455. */
  43456. export class SelectionIndicatorViewModel {
  43457. constructor(scene: Scene, selectionIndicatorElement: Element, container: Element);
  43458. /**
  43459. * Gets or sets the world position of the object for which to display the selection indicator.
  43460. */
  43461. position: Cartesian3;
  43462. /**
  43463. * Gets or sets the visibility of the selection indicator.
  43464. */
  43465. showSelection: boolean;
  43466. /**
  43467. * Gets the visibility of the position indicator. This can be false even if an
  43468. * object is selected, when the selected object has no position.
  43469. */
  43470. isVisible: boolean;
  43471. /**
  43472. * Gets or sets the function for converting the world position of the object to the screen space position.
  43473. * @example
  43474. * selectionIndicatorViewModel.computeScreenSpacePosition = function(position, result) {
  43475. * return Cesium.SceneTransforms.wgs84ToWindowCoordinates(scene, position, result);
  43476. * };
  43477. */
  43478. computeScreenSpacePosition: SelectionIndicatorViewModel.ComputeScreenSpacePosition;
  43479. /**
  43480. * Updates the view of the selection indicator to match the position and content properties of the view model.
  43481. * This function should be called as part of the render loop.
  43482. */
  43483. update(): void;
  43484. /**
  43485. * Animate the indicator to draw attention to the selection.
  43486. */
  43487. animateAppear(): void;
  43488. /**
  43489. * Animate the indicator to release the selection.
  43490. */
  43491. animateDepart(): void;
  43492. /**
  43493. * Gets the HTML element containing the selection indicator.
  43494. */
  43495. container: Element;
  43496. /**
  43497. * Gets the HTML element that holds the selection indicator.
  43498. */
  43499. selectionIndicatorElement: Element;
  43500. /**
  43501. * Gets the scene being used.
  43502. */
  43503. scene: Scene;
  43504. }
  43505. export namespace SelectionIndicatorViewModel {
  43506. /**
  43507. * A function that converts the world position of an object to a screen space position.
  43508. * @param position - The position in WGS84 (world) coordinates.
  43509. * @param result - An object to return the input position transformed to window coordinates.
  43510. */
  43511. type ComputeScreenSpacePosition = (position: Cartesian3, result: Cartesian2) => Cartesian2;
  43512. }
  43513. /**
  43514. * A Knockout binding handler that creates a DOM element for a single SVG path.
  43515. * This binding handler will be registered as cesiumSvgPath.
  43516. *
  43517. * <p>
  43518. * The parameter to this binding is an object with the following properties:
  43519. * </p>
  43520. *
  43521. * <ul>
  43522. * <li>path: The SVG path as a string.</li>
  43523. * <li>width: The width of the SVG path with no transformations applied.</li>
  43524. * <li>height: The height of the SVG path with no transformations applied.</li>
  43525. * <li>css: Optional. A string containing additional CSS classes to apply to the SVG. 'cesium-svgPath-svg' is always applied.</li>
  43526. * </ul>
  43527. * @example
  43528. * // Create an SVG as a child of a div
  43529. * <div data-bind="cesiumSvgPath: { path: 'M 100 100 L 300 100 L 200 300 z', width: 28, height: 28 }"></div>
  43530. *
  43531. * // parameters can be observable from the view model
  43532. * <div data-bind="cesiumSvgPath: { path: currentPath, width: currentWidth, height: currentHeight }"></div>
  43533. *
  43534. * // or the whole object can be observable from the view model
  43535. * <div data-bind="cesiumSvgPath: svgPathOptions"></div>
  43536. */
  43537. export namespace SvgPathBindingHandler {
  43538. function register(): void;
  43539. }
  43540. /**
  43541. * The Timeline is a widget for displaying and controlling the current scene time.
  43542. * @param container - The parent HTML container node for this widget.
  43543. * @param clock - The clock to use.
  43544. */
  43545. export class Timeline {
  43546. constructor(container: Element, clock: Clock);
  43547. /**
  43548. * Gets the parent container.
  43549. */
  43550. container: Element;
  43551. /**
  43552. * @returns true if the object has been destroyed, false otherwise.
  43553. */
  43554. isDestroyed(): boolean;
  43555. /**
  43556. * Destroys the widget. Should be called if permanently
  43557. * removing the widget from layout.
  43558. */
  43559. destroy(): void;
  43560. /**
  43561. * Sets the view to the provided times.
  43562. * @param startTime - The start time.
  43563. * @param stopTime - The stop time.
  43564. */
  43565. zoomTo(startTime: JulianDate, stopTime: JulianDate): void;
  43566. /**
  43567. * Resizes the widget to match the container size.
  43568. */
  43569. resize(): void;
  43570. }
  43571. /**
  43572. * A view model which exposes the properties of a toggle button.
  43573. * @param command - The command which will be executed when the button is toggled.
  43574. * @param [options] - Object with the following properties:
  43575. * @param [options.toggled = false] - A boolean indicating whether the button should be initially toggled.
  43576. * @param [options.tooltip = ''] - A string containing the button's tooltip.
  43577. */
  43578. export class ToggleButtonViewModel {
  43579. constructor(command: Command, options?: {
  43580. toggled?: boolean;
  43581. tooltip?: string;
  43582. });
  43583. /**
  43584. * Gets or sets whether the button is currently toggled. This property is observable.
  43585. */
  43586. toggled: boolean;
  43587. /**
  43588. * Gets or sets the button's tooltip. This property is observable.
  43589. */
  43590. tooltip: string;
  43591. /**
  43592. * Gets the command which will be executed when the button is toggled.
  43593. */
  43594. command: Command;
  43595. }
  43596. /**
  43597. * A single button widget for toggling vr mode.
  43598. * @param container - The DOM element or ID that will contain the widget.
  43599. * @param scene - The scene.
  43600. * @param [vrElement = document.body] - The element or id to be placed into vr mode.
  43601. */
  43602. export class VRButton {
  43603. constructor(container: Element | string, scene: Scene, vrElement?: Element | string);
  43604. /**
  43605. * Gets the parent container.
  43606. */
  43607. container: Element;
  43608. /**
  43609. * Gets the view model.
  43610. */
  43611. viewModel: VRButtonViewModel;
  43612. /**
  43613. * @returns true if the object has been destroyed, false otherwise.
  43614. */
  43615. isDestroyed(): boolean;
  43616. /**
  43617. * Destroys the widget. Should be called if permanently
  43618. * removing the widget from layout.
  43619. */
  43620. destroy(): void;
  43621. }
  43622. /**
  43623. * The view model for {@link VRButton}.
  43624. * @param scene - The scene.
  43625. * @param [vrElement = document.body] - The element or id to be placed into VR mode.
  43626. */
  43627. export class VRButtonViewModel {
  43628. constructor(scene: Scene, vrElement?: Element | string);
  43629. /**
  43630. * Gets whether or not VR mode is active.
  43631. */
  43632. isVRMode: boolean;
  43633. /**
  43634. * Gets or sets whether or not VR functionality should be enabled.
  43635. */
  43636. isVREnabled: boolean;
  43637. /**
  43638. * Gets the tooltip. This property is observable.
  43639. */
  43640. tooltip: string;
  43641. /**
  43642. * Gets or sets the HTML element to place into VR mode when the
  43643. * corresponding button is pressed.
  43644. */
  43645. vrElement: Element;
  43646. /**
  43647. * Gets the Command to toggle VR mode.
  43648. */
  43649. command: Command;
  43650. /**
  43651. * @returns true if the object has been destroyed, false otherwise.
  43652. */
  43653. isDestroyed(): boolean;
  43654. /**
  43655. * Destroys the view model. Should be called to
  43656. * properly clean up the view model when it is no longer needed.
  43657. */
  43658. destroy(): void;
  43659. }
  43660. export namespace Viewer {
  43661. /**
  43662. * Initialization options for the Viewer constructor
  43663. * @property [animation = true] - If set to false, the Animation widget will not be created.
  43664. * @property [baseLayerPicker = true] - If set to false, the BaseLayerPicker widget will not be created.
  43665. * @property [fullscreenButton = true] - If set to false, the FullscreenButton widget will not be created.
  43666. * @property [vrButton = false] - If set to true, the VRButton widget will be created.
  43667. * @property [geocoder = true] - If set to false, the Geocoder widget will not be created.
  43668. * @property [homeButton = true] - If set to false, the HomeButton widget will not be created.
  43669. * @property [infoBox = true] - If set to false, the InfoBox widget will not be created.
  43670. * @property [sceneModePicker = true] - If set to false, the SceneModePicker widget will not be created.
  43671. * @property [selectionIndicator = true] - If set to false, the SelectionIndicator widget will not be created.
  43672. * @property [timeline = true] - If set to false, the Timeline widget will not be created.
  43673. * @property [navigationHelpButton = true] - If set to false, the navigation help button will not be created.
  43674. * @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.
  43675. * @property [scene3DOnly = false] - When <code>true</code>, each geometry instance will only be rendered in 3D to save GPU memory.
  43676. * @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}.
  43677. * @property [clockViewModel = new ClockViewModel(clock)] - The clock view model to use to control current time.
  43678. * @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.
  43679. * @property [imageryProviderViewModels = createDefaultImageryProviderViewModels()] - The array of ProviderViewModels to be selectable from the BaseLayerPicker. This value is only valid if `baseLayerPicker` is set to true.
  43680. * @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.
  43681. * @property [terrainProviderViewModels = createDefaultTerrainProviderViewModels()] - The array of ProviderViewModels to be selectable from the BaseLayerPicker. This value is only valid if `baseLayerPicker` is set to true.
  43682. * @property [imageryProvider = createWorldImagery()] - The imagery provider to use. This value is only valid if `baseLayerPicker` is set to false.
  43683. * @property [terrainProvider = new EllipsoidTerrainProvider()] - The terrain provider to use
  43684. * @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.
  43685. * @property [skyAtmosphere] - Blue sky, and the glow around the Earth's limb. Set to <code>false</code> to turn it off.
  43686. * @property [fullscreenElement = document.body] - The element or id to be placed into fullscreen mode when the full screen button is pressed.
  43687. * @property [useDefaultRenderLoop = true] - True if this widget should control the render loop, false otherwise.
  43688. * @property [targetFrameRate] - The target frame rate when using the default render loop.
  43689. * @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.
  43690. * @property [useBrowserRecommendedResolution = true] - If true, render at the browser's recommended resolution and ignore <code>window.devicePixelRatio</code>.
  43691. * @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.
  43692. * @property [contextOptions] - Context and WebGL creation properties corresponding to <code>options</code> passed to {@link Scene}.
  43693. * @property [sceneMode = SceneMode.SCENE3D] - The initial scene mode.
  43694. * @property [mapProjection = new GeographicProjection()] - The map projection to use in 2D and Columbus View modes.
  43695. * @property [globe = new Globe(mapProjection.ellipsoid)] - The globe to use in the scene. If set to <code>false</code>, no globe will be added.
  43696. * @property [orderIndependentTranslucency = true] - If true and the configuration supports it, use order independent translucency.
  43697. * @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.
  43698. * @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.
  43699. * @property [dataSources = new DataSourceCollection()] - The collection of data sources visualized by the widget. If this parameter is provided,
  43700. * the instance is assumed to be owned by the caller and will not be destroyed when the viewer is destroyed.
  43701. * @property [shadows = false] - Determines if shadows are cast by light sources.
  43702. * @property [terrainShadows = ShadowMode.RECEIVE_ONLY] - Determines if the terrain casts or receives shadows from light sources.
  43703. * @property [mapMode2D = MapMode2D.INFINITE_SCROLL] - Determines if the 2D map is rotatable or can be scrolled infinitely in the horizontal direction.
  43704. * @property [projectionPicker = false] - If set to true, the ProjectionPicker widget will be created.
  43705. * @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}.
  43706. * @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}.
  43707. * @property [depthPlaneEllipsoidOffset = 0.0] - Adjust the DepthPlane to address rendering artefacts below ellipsoid zero elevation.
  43708. * @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.
  43709. */
  43710. type ConstructorOptions = {
  43711. animation?: boolean;
  43712. baseLayerPicker?: boolean;
  43713. fullscreenButton?: boolean;
  43714. vrButton?: boolean;
  43715. geocoder?: boolean | GeocoderService[];
  43716. homeButton?: boolean;
  43717. infoBox?: boolean;
  43718. sceneModePicker?: boolean;
  43719. selectionIndicator?: boolean;
  43720. timeline?: boolean;
  43721. navigationHelpButton?: boolean;
  43722. navigationInstructionsInitiallyVisible?: boolean;
  43723. scene3DOnly?: boolean;
  43724. shouldAnimate?: boolean;
  43725. clockViewModel?: ClockViewModel;
  43726. selectedImageryProviderViewModel?: ProviderViewModel;
  43727. imageryProviderViewModels?: ProviderViewModel[];
  43728. selectedTerrainProviderViewModel?: ProviderViewModel;
  43729. terrainProviderViewModels?: ProviderViewModel[];
  43730. imageryProvider?: ImageryProvider;
  43731. terrainProvider?: TerrainProvider;
  43732. skyBox?: SkyBox | false;
  43733. skyAtmosphere?: SkyAtmosphere | false;
  43734. fullscreenElement?: Element | string;
  43735. useDefaultRenderLoop?: boolean;
  43736. targetFrameRate?: number;
  43737. showRenderLoopErrors?: boolean;
  43738. useBrowserRecommendedResolution?: boolean;
  43739. automaticallyTrackDataSourceClocks?: boolean;
  43740. contextOptions?: any;
  43741. sceneMode?: SceneMode;
  43742. mapProjection?: MapProjection;
  43743. globe?: Globe | false;
  43744. orderIndependentTranslucency?: boolean;
  43745. creditContainer?: Element | string;
  43746. creditViewport?: Element | string;
  43747. dataSources?: DataSourceCollection;
  43748. shadows?: boolean;
  43749. terrainShadows?: ShadowMode;
  43750. mapMode2D?: MapMode2D;
  43751. projectionPicker?: boolean;
  43752. requestRenderMode?: boolean;
  43753. maximumRenderTimeChange?: number;
  43754. depthPlaneEllipsoidOffset?: number;
  43755. msaaSamples?: number;
  43756. };
  43757. /**
  43758. * A function that augments a Viewer instance with additional functionality.
  43759. * @param viewer - The viewer instance.
  43760. * @param options - Options object to be passed to the mixin function.
  43761. */
  43762. type ViewerMixin = (viewer: Viewer, options: any) => void;
  43763. }
  43764. /**
  43765. * A base widget for building applications. It composites all of the standard Cesium widgets into one reusable package.
  43766. * The widget can always be extended by using mixins, which add functionality useful for a variety of applications.
  43767. * @example
  43768. * //Initialize the viewer widget with several custom options and mixins.
  43769. * const viewer = new Cesium.Viewer('cesiumContainer', {
  43770. * //Start in Columbus Viewer
  43771. * sceneMode : Cesium.SceneMode.COLUMBUS_VIEW,
  43772. * //Use Cesium World Terrain
  43773. * terrainProvider : Cesium.createWorldTerrain(),
  43774. * //Hide the base layer picker
  43775. * baseLayerPicker : false,
  43776. * //Use OpenStreetMaps
  43777. * imageryProvider : new Cesium.OpenStreetMapImageryProvider({
  43778. * url : 'https://a.tile.openstreetmap.org/'
  43779. * }),
  43780. * skyBox : new Cesium.SkyBox({
  43781. * sources : {
  43782. * positiveX : 'stars/TychoSkymapII.t3_08192x04096_80_px.jpg',
  43783. * negativeX : 'stars/TychoSkymapII.t3_08192x04096_80_mx.jpg',
  43784. * positiveY : 'stars/TychoSkymapII.t3_08192x04096_80_py.jpg',
  43785. * negativeY : 'stars/TychoSkymapII.t3_08192x04096_80_my.jpg',
  43786. * positiveZ : 'stars/TychoSkymapII.t3_08192x04096_80_pz.jpg',
  43787. * negativeZ : 'stars/TychoSkymapII.t3_08192x04096_80_mz.jpg'
  43788. * }
  43789. * }),
  43790. * // Show Columbus View map with Web Mercator projection
  43791. * mapProjection : new Cesium.WebMercatorProjection()
  43792. * });
  43793. *
  43794. * //Add basic drag and drop functionality
  43795. * viewer.extend(Cesium.viewerDragDropMixin);
  43796. *
  43797. * //Show a pop-up alert if we encounter an error when processing a dropped file
  43798. * viewer.dropError.addEventListener(function(dropHandler, name, error) {
  43799. * console.log(error);
  43800. * window.alert(error);
  43801. * });
  43802. * @param container - The DOM element or ID that will contain the widget.
  43803. * @param [options] - Object describing initialization options
  43804. */
  43805. export class Viewer {
  43806. constructor(container: Element | string, options?: Viewer.ConstructorOptions);
  43807. /**
  43808. * Gets the parent container.
  43809. */
  43810. readonly container: Element;
  43811. /**
  43812. * Gets the DOM element for the area at the bottom of the window containing the
  43813. * {@link CreditDisplay} and potentially other things.
  43814. */
  43815. readonly bottomContainer: Element;
  43816. /**
  43817. * Gets the CesiumWidget.
  43818. */
  43819. readonly cesiumWidget: CesiumWidget;
  43820. /**
  43821. * Gets the selection indicator.
  43822. */
  43823. readonly selectionIndicator: SelectionIndicator;
  43824. /**
  43825. * Gets the info box.
  43826. */
  43827. readonly infoBox: InfoBox;
  43828. /**
  43829. * Gets the Geocoder.
  43830. */
  43831. readonly geocoder: Geocoder;
  43832. /**
  43833. * Gets the HomeButton.
  43834. */
  43835. readonly homeButton: HomeButton;
  43836. /**
  43837. * Gets the SceneModePicker.
  43838. */
  43839. readonly sceneModePicker: SceneModePicker;
  43840. /**
  43841. * Gets the ProjectionPicker.
  43842. */
  43843. readonly projectionPicker: ProjectionPicker;
  43844. /**
  43845. * Gets the BaseLayerPicker.
  43846. */
  43847. readonly baseLayerPicker: BaseLayerPicker;
  43848. /**
  43849. * Gets the NavigationHelpButton.
  43850. */
  43851. readonly navigationHelpButton: NavigationHelpButton;
  43852. /**
  43853. * Gets the Animation widget.
  43854. */
  43855. readonly animation: Animation;
  43856. /**
  43857. * Gets the Timeline widget.
  43858. */
  43859. readonly timeline: Timeline;
  43860. /**
  43861. * Gets the FullscreenButton.
  43862. */
  43863. readonly fullscreenButton: FullscreenButton;
  43864. /**
  43865. * Gets the VRButton.
  43866. */
  43867. readonly vrButton: VRButton;
  43868. /**
  43869. * Gets the display used for {@link DataSource} visualization.
  43870. */
  43871. readonly dataSourceDisplay: DataSourceDisplay;
  43872. /**
  43873. * Gets the collection of entities not tied to a particular data source.
  43874. * This is a shortcut to [dataSourceDisplay.defaultDataSource.entities]{@link Viewer#dataSourceDisplay}.
  43875. */
  43876. readonly entities: EntityCollection;
  43877. /**
  43878. * Gets the set of {@link DataSource} instances to be visualized.
  43879. */
  43880. readonly dataSources: DataSourceCollection;
  43881. /**
  43882. * Gets the canvas.
  43883. */
  43884. readonly canvas: HTMLCanvasElement;
  43885. /**
  43886. * Gets the scene.
  43887. */
  43888. readonly scene: Scene;
  43889. /**
  43890. * Determines if shadows are cast by light sources.
  43891. */
  43892. shadows: boolean;
  43893. /**
  43894. * Determines if the terrain casts or shadows from light sources.
  43895. */
  43896. terrainShadows: ShadowMode;
  43897. /**
  43898. * Get the scene's shadow map
  43899. */
  43900. readonly shadowMap: ShadowMap;
  43901. /**
  43902. * Gets the collection of image layers that will be rendered on the globe.
  43903. */
  43904. readonly imageryLayers: ImageryLayerCollection;
  43905. /**
  43906. * The terrain provider providing surface geometry for the globe.
  43907. */
  43908. terrainProvider: TerrainProvider;
  43909. /**
  43910. * Gets the camera.
  43911. */
  43912. readonly camera: Camera;
  43913. /**
  43914. * Gets the post-process stages.
  43915. */
  43916. readonly postProcessStages: PostProcessStageCollection;
  43917. /**
  43918. * Gets the clock.
  43919. */
  43920. readonly clock: Clock;
  43921. /**
  43922. * Gets the clock view model.
  43923. */
  43924. readonly clockViewModel: ClockViewModel;
  43925. /**
  43926. * Gets the screen space event handler.
  43927. */
  43928. readonly screenSpaceEventHandler: ScreenSpaceEventHandler;
  43929. /**
  43930. * Gets or sets the target frame rate of the widget when <code>useDefaultRenderLoop</code>
  43931. * is true. If undefined, the browser's {@link requestAnimationFrame} implementation
  43932. * determines the frame rate. If defined, this value must be greater than 0. A value higher
  43933. * than the underlying requestAnimationFrame implementation will have no effect.
  43934. */
  43935. targetFrameRate: number;
  43936. /**
  43937. * Gets or sets whether or not this widget should control the render loop.
  43938. * If set to true the widget will use {@link requestAnimationFrame} to
  43939. * perform rendering and resizing of the widget, as well as drive the
  43940. * simulation clock. If set to false, you must manually call the
  43941. * <code>resize</code>, <code>render</code> methods
  43942. * as part of a custom render loop. If an error occurs during rendering, {@link Scene}'s
  43943. * <code>renderError</code> event will be raised and this property
  43944. * will be set to false. It must be set back to true to continue rendering
  43945. * after the error.
  43946. */
  43947. useDefaultRenderLoop: boolean;
  43948. /**
  43949. * Gets or sets a scaling factor for rendering resolution. Values less than 1.0 can improve
  43950. * performance on less powerful devices while values greater than 1.0 will render at a higher
  43951. * resolution and then scale down, resulting in improved visual fidelity.
  43952. * For example, if the widget is laid out at a size of 640x480, setting this value to 0.5
  43953. * will cause the scene to be rendered at 320x240 and then scaled up while setting
  43954. * it to 2.0 will cause the scene to be rendered at 1280x960 and then scaled down.
  43955. */
  43956. resolutionScale: number;
  43957. /**
  43958. * Boolean flag indicating if the browser's recommended resolution is used.
  43959. * If true, the browser's device pixel ratio is ignored and 1.0 is used instead,
  43960. * effectively rendering based on CSS pixels instead of device pixels. This can improve
  43961. * performance on less powerful devices that have high pixel density. When false, rendering
  43962. * will be in device pixels. {@link Viewer#resolutionScale} will still take effect whether
  43963. * this flag is true or false.
  43964. */
  43965. useBrowserRecommendedResolution: boolean;
  43966. /**
  43967. * Gets or sets whether or not data sources can temporarily pause
  43968. * animation in order to avoid showing an incomplete picture to the user.
  43969. * For example, if asynchronous primitives are being processed in the
  43970. * background, the clock will not advance until the geometry is ready.
  43971. */
  43972. allowDataSourcesToSuspendAnimation: boolean;
  43973. /**
  43974. * Gets or sets the Entity instance currently being tracked by the camera.
  43975. */
  43976. trackedEntity: Entity | undefined;
  43977. /**
  43978. * Gets or sets the object instance for which to display a selection indicator.
  43979. *
  43980. * If a user interactively picks a Cesium3DTilesFeature instance, then this property
  43981. * will contain a transient Entity instance with a property named "feature" that is
  43982. * the instance that was picked.
  43983. */
  43984. selectedEntity: Entity | undefined;
  43985. /**
  43986. * Gets the event that is raised when the selected entity changes.
  43987. */
  43988. readonly selectedEntityChanged: Event;
  43989. /**
  43990. * Gets the event that is raised when the tracked entity changes.
  43991. */
  43992. readonly trackedEntityChanged: Event;
  43993. /**
  43994. * Gets or sets the data source to track with the viewer's clock.
  43995. */
  43996. clockTrackedDataSource: DataSource;
  43997. /**
  43998. * Extends the base viewer functionality with the provided mixin.
  43999. * A mixin may add additional properties, functions, or other behavior
  44000. * to the provided viewer instance.
  44001. * @param mixin - The Viewer mixin to add to this instance.
  44002. * @param [options] - The options object to be passed to the mixin function.
  44003. */
  44004. extend(mixin: Viewer.ViewerMixin, options?: any): void;
  44005. /**
  44006. * Resizes the widget to match the container size.
  44007. * This function is called automatically as needed unless
  44008. * <code>useDefaultRenderLoop</code> is set to false.
  44009. */
  44010. resize(): void;
  44011. /**
  44012. * This forces the widget to re-think its layout, including
  44013. * widget sizes and credit placement.
  44014. */
  44015. forceResize(): void;
  44016. /**
  44017. * Renders the scene. This function is called automatically
  44018. * unless <code>useDefaultRenderLoop</code> is set to false;
  44019. */
  44020. render(): void;
  44021. /**
  44022. * @returns true if the object has been destroyed, false otherwise.
  44023. */
  44024. isDestroyed(): boolean;
  44025. /**
  44026. * Destroys the widget. Should be called if permanently
  44027. * removing the widget from layout.
  44028. */
  44029. destroy(): void;
  44030. /**
  44031. * Asynchronously sets the camera to view the provided entity, entities, or data source.
  44032. * If the data source is still in the process of loading or the visualization is otherwise still loading,
  44033. * this method waits for the data to be ready before performing the zoom.
  44034. *
  44035. * <p>The offset is heading/pitch/range in the local east-north-up reference frame centered at the center of the bounding sphere.
  44036. * The heading and the pitch angles are defined in the local east-north-up reference frame.
  44037. * The heading is the angle from y axis and increasing towards the x axis. Pitch is the rotation from the xy-plane. Positive pitch
  44038. * angles are above the plane. Negative pitch angles are below the plane. The range is the distance from the center. If the range is
  44039. * zero, a range will be computed such that the whole bounding sphere is visible.</p>
  44040. *
  44041. * <p>In 2D, there must be a top down view. The camera will be placed above the target looking down. The height above the
  44042. * target will be the range. The heading will be determined from the offset. If the heading cannot be
  44043. * determined from the offset, the heading will be north.</p>
  44044. * @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.
  44045. * @param [offset] - The offset from the center of the entity in the local east-north-up reference frame.
  44046. * @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.
  44047. */
  44048. zoomTo(target: Entity | Entity[] | EntityCollection | DataSource | ImageryLayer | Cesium3DTileset | TimeDynamicPointCloud | Promise<Entity | Entity[] | EntityCollection | DataSource | ImageryLayer | Cesium3DTileset | TimeDynamicPointCloud>, offset?: HeadingPitchRange): Promise<boolean>;
  44049. /**
  44050. * Flies the camera to the provided entity, entities, or data source.
  44051. * If the data source is still in the process of loading or the visualization is otherwise still loading,
  44052. * this method waits for the data to be ready before performing the flight.
  44053. *
  44054. * <p>The offset is heading/pitch/range in the local east-north-up reference frame centered at the center of the bounding sphere.
  44055. * The heading and the pitch angles are defined in the local east-north-up reference frame.
  44056. * The heading is the angle from y axis and increasing towards the x axis. Pitch is the rotation from the xy-plane. Positive pitch
  44057. * angles are above the plane. Negative pitch angles are below the plane. The range is the distance from the center. If the range is
  44058. * zero, a range will be computed such that the whole bounding sphere is visible.</p>
  44059. *
  44060. * <p>In 2D, there must be a top down view. The camera will be placed above the target looking down. The height above the
  44061. * target will be the range. The heading will be determined from the offset. If the heading cannot be
  44062. * determined from the offset, the heading will be north.</p>
  44063. * @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.
  44064. * @param [options] - Object with the following properties:
  44065. * @param [options.duration = 3.0] - The duration of the flight in seconds.
  44066. * @param [options.maximumHeight] - The maximum height at the peak of the flight.
  44067. * @param [options.offset] - The offset from the target in the local east-north-up reference frame centered at the target.
  44068. * @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
  44069. */
  44070. flyTo(target: Entity | Entity[] | EntityCollection | DataSource | ImageryLayer | Cesium3DTileset | TimeDynamicPointCloud | Promise<Entity | Entity[] | EntityCollection | DataSource | ImageryLayer | Cesium3DTileset | TimeDynamicPointCloud>, options?: {
  44071. duration?: number;
  44072. maximumHeight?: number;
  44073. offset?: HeadingPitchRange;
  44074. }): Promise<boolean>;
  44075. }
  44076. /**
  44077. * A mixin which adds the {@link Cesium3DTilesInspector} widget to the {@link Viewer} widget.
  44078. * Rather than being called directly, this function is normally passed as
  44079. * a parameter to {@link Viewer#extend}, as shown in the example below.
  44080. * @example
  44081. * const viewer = new Cesium.Viewer('cesiumContainer');
  44082. * viewer.extend(Cesium.viewerCesium3DTilesInspectorMixin);
  44083. * @param viewer - The viewer instance.
  44084. */
  44085. export function viewerCesium3DTilesInspectorMixin(viewer: Viewer): void;
  44086. /**
  44087. * A mixin which adds the CesiumInspector widget to the Viewer widget.
  44088. * Rather than being called directly, this function is normally passed as
  44089. * a parameter to {@link Viewer#extend}, as shown in the example below.
  44090. * @example
  44091. * const viewer = new Cesium.Viewer('cesiumContainer');
  44092. * viewer.extend(Cesium.viewerCesiumInspectorMixin);
  44093. * @param viewer - The viewer instance.
  44094. */
  44095. export function viewerCesiumInspectorMixin(viewer: Viewer): void;
  44096. /**
  44097. * A mixin which adds default drag and drop support for CZML files to the Viewer widget.
  44098. * Rather than being called directly, this function is normally passed as
  44099. * a parameter to {@link Viewer#extend}, as shown in the example below.
  44100. * @example
  44101. * // Add basic drag and drop support and pop up an alert window on error.
  44102. * const viewer = new Cesium.Viewer('cesiumContainer');
  44103. * viewer.extend(Cesium.viewerDragDropMixin);
  44104. * viewer.dropError.addEventListener(function(viewerArg, source, error) {
  44105. * window.alert('Error processing ' + source + ':' + error);
  44106. * });
  44107. * @param viewer - The viewer instance.
  44108. * @param [options] - Object with the following properties:
  44109. * @param [options.dropTarget = viewer.container] - The DOM element which will serve as the drop target.
  44110. * @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.
  44111. * @param [options.flyToOnDrop = true] - When true, dropping files will fly to the data source once it is loaded.
  44112. * @param [options.clampToGround = true] - When true, datasources are clamped to the ground.
  44113. * @param [options.proxy] - The proxy to be used for KML network links.
  44114. */
  44115. export function viewerDragDropMixin(viewer: Viewer, options?: {
  44116. dropTarget?: Element | string;
  44117. clearOnDrop?: boolean;
  44118. flyToOnDrop?: boolean;
  44119. clampToGround?: boolean;
  44120. proxy?: Proxy;
  44121. }): void;
  44122. /**
  44123. * A mixin which adds the {@link PerformanceWatchdog} widget to the {@link Viewer} widget.
  44124. * Rather than being called directly, this function is normally passed as
  44125. * a parameter to {@link Viewer#extend}, as shown in the example below.
  44126. * @example
  44127. * const viewer = new Cesium.Viewer('cesiumContainer');
  44128. * viewer.extend(Cesium.viewerPerformanceWatchdogMixin, {
  44129. * lowFrameRateMessage : 'Why is this going so <em>slowly</em>?'
  44130. * });
  44131. * @param viewer - The viewer instance.
  44132. * @param [options] - An object with properties.
  44133. * @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
  44134. * message to display when a low frame rate is detected. The message is interpeted as HTML, so make sure
  44135. * it comes from a trusted source so that your application is not vulnerable to cross-site scripting attacks.
  44136. */
  44137. export function viewerPerformanceWatchdogMixin(viewer: Viewer, options?: {
  44138. lowFrameRateMessage?: string;
  44139. }): void;
  44140. /**
  44141. * Create a Command from a given function, for use with ViewModels.
  44142. *
  44143. * A Command is a function with an extra <code>canExecute</code> observable property to determine
  44144. * whether the command can be executed. When executed, a Command function will check the
  44145. * value of <code>canExecute</code> and throw if false. It also provides events for when
  44146. * a command has been or is about to be executed.
  44147. * @param func - The function to execute.
  44148. * @param [canExecute = true] - A boolean indicating whether the function can currently be executed.
  44149. */
  44150. export function createCommand(func: (...params: any[]) => any, canExecute?: boolean): void;
  44151. }
  44152. declare module "cesium/Source/Core/ArcGISTiledElevationTerrainProvider" { import { ArcGISTiledElevationTerrainProvider } from 'cesium'; export default ArcGISTiledElevationTerrainProvider; }
  44153. declare module "cesium/Source/Core/AssociativeArray" { import { AssociativeArray } from 'cesium'; export default AssociativeArray; }
  44154. declare module "cesium/Source/Core/AxisAlignedBoundingBox" { import { AxisAlignedBoundingBox } from 'cesium'; export default AxisAlignedBoundingBox; }
  44155. declare module "cesium/Source/Core/BingMapsGeocoderService" { import { BingMapsGeocoderService } from 'cesium'; export default BingMapsGeocoderService; }
  44156. declare module "cesium/Source/Core/BoundingRectangle" { import { BoundingRectangle } from 'cesium'; export default BoundingRectangle; }
  44157. declare module "cesium/Source/Core/BoundingSphere" { import { BoundingSphere } from 'cesium'; export default BoundingSphere; }
  44158. declare module "cesium/Source/Core/BoxGeometry" { import { BoxGeometry } from 'cesium'; export default BoxGeometry; }
  44159. declare module "cesium/Source/Core/BoxOutlineGeometry" { import { BoxOutlineGeometry } from 'cesium'; export default BoxOutlineGeometry; }
  44160. declare module "cesium/Source/Core/Cartesian2" { import { Cartesian2 } from 'cesium'; export default Cartesian2; }
  44161. declare module "cesium/Source/Core/Cartesian3" { import { Cartesian3 } from 'cesium'; export default Cartesian3; }
  44162. declare module "cesium/Source/Core/Cartesian4" { import { Cartesian4 } from 'cesium'; export default Cartesian4; }
  44163. declare module "cesium/Source/Core/Cartographic" { import { Cartographic } from 'cesium'; export default Cartographic; }
  44164. declare module "cesium/Source/Core/CartographicGeocoderService" { import { CartographicGeocoderService } from 'cesium'; export default CartographicGeocoderService; }
  44165. declare module "cesium/Source/Core/CatmullRomSpline" { import { CatmullRomSpline } from 'cesium'; export default CatmullRomSpline; }
  44166. declare module "cesium/Source/Core/CesiumTerrainProvider" { import { CesiumTerrainProvider } from 'cesium'; export default CesiumTerrainProvider; }
  44167. declare module "cesium/Source/Core/CircleGeometry" { import { CircleGeometry } from 'cesium'; export default CircleGeometry; }
  44168. declare module "cesium/Source/Core/CircleOutlineGeometry" { import { CircleOutlineGeometry } from 'cesium'; export default CircleOutlineGeometry; }
  44169. declare module "cesium/Source/Core/Clock" { import { Clock } from 'cesium'; export default Clock; }
  44170. declare module "cesium/Source/Core/Color" { import { Color } from 'cesium'; export default Color; }
  44171. declare module "cesium/Source/Core/ColorGeometryInstanceAttribute" { import { ColorGeometryInstanceAttribute } from 'cesium'; export default ColorGeometryInstanceAttribute; }
  44172. declare module "cesium/Source/Core/CompressedTextureBuffer" { import { CompressedTextureBuffer } from 'cesium'; export default CompressedTextureBuffer; }
  44173. declare module "cesium/Source/Core/ConstantSpline" { import { ConstantSpline } from 'cesium'; export default ConstantSpline; }
  44174. declare module "cesium/Source/Core/CoplanarPolygonGeometry" { import { CoplanarPolygonGeometry } from 'cesium'; export default CoplanarPolygonGeometry; }
  44175. declare module "cesium/Source/Core/CoplanarPolygonOutlineGeometry" { import { CoplanarPolygonOutlineGeometry } from 'cesium'; export default CoplanarPolygonOutlineGeometry; }
  44176. declare module "cesium/Source/Core/CorridorGeometry" { import { CorridorGeometry } from 'cesium'; export default CorridorGeometry; }
  44177. declare module "cesium/Source/Core/CorridorOutlineGeometry" { import { CorridorOutlineGeometry } from 'cesium'; export default CorridorOutlineGeometry; }
  44178. declare module "cesium/Source/Core/Credit" { import { Credit } from 'cesium'; export default Credit; }
  44179. declare module "cesium/Source/Core/CubicRealPolynomial" { import { CubicRealPolynomial } from 'cesium'; export default CubicRealPolynomial; }
  44180. declare module "cesium/Source/Core/CullingVolume" { import { CullingVolume } from 'cesium'; export default CullingVolume; }
  44181. declare module "cesium/Source/Core/CustomHeightmapTerrainProvider" { import { CustomHeightmapTerrainProvider } from 'cesium'; export default CustomHeightmapTerrainProvider; }
  44182. declare module "cesium/Source/Core/CylinderGeometry" { import { CylinderGeometry } from 'cesium'; export default CylinderGeometry; }
  44183. declare module "cesium/Source/Core/CylinderOutlineGeometry" { import { CylinderOutlineGeometry } from 'cesium'; export default CylinderOutlineGeometry; }
  44184. declare module "cesium/Source/Core/DefaultProxy" { import { DefaultProxy } from 'cesium'; export default DefaultProxy; }
  44185. declare module "cesium/Source/Core/DeveloperError" { import { DeveloperError } from 'cesium'; export default DeveloperError; }
  44186. declare module "cesium/Source/Core/DistanceDisplayCondition" { import { DistanceDisplayCondition } from 'cesium'; export default DistanceDisplayCondition; }
  44187. declare module "cesium/Source/Core/DistanceDisplayConditionGeometryInstanceAttribute" { import { DistanceDisplayConditionGeometryInstanceAttribute } from 'cesium'; export default DistanceDisplayConditionGeometryInstanceAttribute; }
  44188. declare module "cesium/Source/Core/EasingFunction" { import { EasingFunction } from 'cesium'; export default EasingFunction; }
  44189. declare module "cesium/Source/Core/EllipseGeometry" { import { EllipseGeometry } from 'cesium'; export default EllipseGeometry; }
  44190. declare module "cesium/Source/Core/EllipseOutlineGeometry" { import { EllipseOutlineGeometry } from 'cesium'; export default EllipseOutlineGeometry; }
  44191. declare module "cesium/Source/Core/Ellipsoid" { import { Ellipsoid } from 'cesium'; export default Ellipsoid; }
  44192. declare module "cesium/Source/Core/EllipsoidGeodesic" { import { EllipsoidGeodesic } from 'cesium'; export default EllipsoidGeodesic; }
  44193. declare module "cesium/Source/Core/EllipsoidGeometry" { import { EllipsoidGeometry } from 'cesium'; export default EllipsoidGeometry; }
  44194. declare module "cesium/Source/Core/EllipsoidOutlineGeometry" { import { EllipsoidOutlineGeometry } from 'cesium'; export default EllipsoidOutlineGeometry; }
  44195. declare module "cesium/Source/Core/EllipsoidRhumbLine" { import { EllipsoidRhumbLine } from 'cesium'; export default EllipsoidRhumbLine; }
  44196. declare module "cesium/Source/Core/EllipsoidTangentPlane" { import { EllipsoidTangentPlane } from 'cesium'; export default EllipsoidTangentPlane; }
  44197. declare module "cesium/Source/Core/EllipsoidTerrainProvider" { import { EllipsoidTerrainProvider } from 'cesium'; export default EllipsoidTerrainProvider; }
  44198. declare module "cesium/Source/Core/Event" { import { Event } from 'cesium'; export default Event; }
  44199. declare module "cesium/Source/Core/EventHelper" { import { EventHelper } from 'cesium'; export default EventHelper; }
  44200. declare module "cesium/Source/Core/ExperimentalFeatures" { import { ExperimentalFeatures } from 'cesium'; export default ExperimentalFeatures; }
  44201. declare module "cesium/Source/Core/FeatureDetection" { import { FeatureDetection } from 'cesium'; export default FeatureDetection; }
  44202. declare module "cesium/Source/Core/FrustumGeometry" { import { FrustumGeometry } from 'cesium'; export default FrustumGeometry; }
  44203. declare module "cesium/Source/Core/FrustumOutlineGeometry" { import { FrustumOutlineGeometry } from 'cesium'; export default FrustumOutlineGeometry; }
  44204. declare module "cesium/Source/Core/Fullscreen" { import { Fullscreen } from 'cesium'; export default Fullscreen; }
  44205. declare module "cesium/Source/Core/GeocoderService" { import { GeocoderService } from 'cesium'; export default GeocoderService; }
  44206. declare module "cesium/Source/Core/GeographicProjection" { import { GeographicProjection } from 'cesium'; export default GeographicProjection; }
  44207. declare module "cesium/Source/Core/GeographicTilingScheme" { import { GeographicTilingScheme } from 'cesium'; export default GeographicTilingScheme; }
  44208. declare module "cesium/Source/Core/Geometry" { import { Geometry } from 'cesium'; export default Geometry; }
  44209. declare module "cesium/Source/Core/GeometryAttribute" { import { GeometryAttribute } from 'cesium'; export default GeometryAttribute; }
  44210. declare module "cesium/Source/Core/GeometryAttributes" { import { GeometryAttributes } from 'cesium'; export default GeometryAttributes; }
  44211. declare module "cesium/Source/Core/GeometryFactory" { import { GeometryFactory } from 'cesium'; export default GeometryFactory; }
  44212. declare module "cesium/Source/Core/GeometryInstance" { import { GeometryInstance } from 'cesium'; export default GeometryInstance; }
  44213. declare module "cesium/Source/Core/GeometryInstanceAttribute" { import { GeometryInstanceAttribute } from 'cesium'; export default GeometryInstanceAttribute; }
  44214. declare module "cesium/Source/Core/GeometryPipeline" { import { GeometryPipeline } from 'cesium'; export default GeometryPipeline; }
  44215. declare module "cesium/Source/Core/GoogleEarthEnterpriseMetadata" { import { GoogleEarthEnterpriseMetadata } from 'cesium'; export default GoogleEarthEnterpriseMetadata; }
  44216. declare module "cesium/Source/Core/GoogleEarthEnterpriseTerrainData" { import { GoogleEarthEnterpriseTerrainData } from 'cesium'; export default GoogleEarthEnterpriseTerrainData; }
  44217. declare module "cesium/Source/Core/GoogleEarthEnterpriseTerrainProvider" { import { GoogleEarthEnterpriseTerrainProvider } from 'cesium'; export default GoogleEarthEnterpriseTerrainProvider; }
  44218. declare module "cesium/Source/Core/GregorianDate" { import { GregorianDate } from 'cesium'; export default GregorianDate; }
  44219. declare module "cesium/Source/Core/GroundPolylineGeometry" { import { GroundPolylineGeometry } from 'cesium'; export default GroundPolylineGeometry; }
  44220. declare module "cesium/Source/Core/HeadingPitchRange" { import { HeadingPitchRange } from 'cesium'; export default HeadingPitchRange; }
  44221. declare module "cesium/Source/Core/HeadingPitchRoll" { import { HeadingPitchRoll } from 'cesium'; export default HeadingPitchRoll; }
  44222. declare module "cesium/Source/Core/HeightmapTerrainData" { import { HeightmapTerrainData } from 'cesium'; export default HeightmapTerrainData; }
  44223. declare module "cesium/Source/Core/HermitePolynomialApproximation" { import { HermitePolynomialApproximation } from 'cesium'; export default HermitePolynomialApproximation; }
  44224. declare module "cesium/Source/Core/HermiteSpline" { import { HermiteSpline } from 'cesium'; export default HermiteSpline; }
  44225. declare module "cesium/Source/Core/HilbertOrder" { import { HilbertOrder } from 'cesium'; export default HilbertOrder; }
  44226. declare module "cesium/Source/Core/InterpolationAlgorithm" { import { InterpolationAlgorithm } from 'cesium'; export default InterpolationAlgorithm; }
  44227. declare module "cesium/Source/Core/IntersectionTests" { import { IntersectionTests } from 'cesium'; export default IntersectionTests; }
  44228. declare module "cesium/Source/Core/Intersections2D" { import { Intersections2D } from 'cesium'; export default Intersections2D; }
  44229. declare module "cesium/Source/Core/Interval" { import { Interval } from 'cesium'; export default Interval; }
  44230. declare module "cesium/Source/Core/Ion" { import { Ion } from 'cesium'; export default Ion; }
  44231. declare module "cesium/Source/Core/IonGeocoderService" { import { IonGeocoderService } from 'cesium'; export default IonGeocoderService; }
  44232. declare module "cesium/Source/Core/IonResource" { import { IonResource } from 'cesium'; export default IonResource; }
  44233. declare module "cesium/Source/Core/Iso8601" { import { Iso8601 } from 'cesium'; export default Iso8601; }
  44234. declare module "cesium/Source/Core/JulianDate" { import { JulianDate } from 'cesium'; export default JulianDate; }
  44235. declare module "cesium/Source/Core/LagrangePolynomialApproximation" { import { LagrangePolynomialApproximation } from 'cesium'; export default LagrangePolynomialApproximation; }
  44236. declare module "cesium/Source/Core/LeapSecond" { import { LeapSecond } from 'cesium'; export default LeapSecond; }
  44237. declare module "cesium/Source/Core/LinearApproximation" { import { LinearApproximation } from 'cesium'; export default LinearApproximation; }
  44238. declare module "cesium/Source/Core/LinearSpline" { import { LinearSpline } from 'cesium'; export default LinearSpline; }
  44239. declare module "cesium/Source/Core/MapProjection" { import { MapProjection } from 'cesium'; export default MapProjection; }
  44240. declare module "cesium/Source/Core/Math" { import { Math } from 'cesium'; export default Math; }
  44241. declare module "cesium/Source/Core/Matrix2" { import { Matrix2 } from 'cesium'; export default Matrix2; }
  44242. declare module "cesium/Source/Core/Matrix3" { import { Matrix3 } from 'cesium'; export default Matrix3; }
  44243. declare module "cesium/Source/Core/Matrix4" { import { Matrix4 } from 'cesium'; export default Matrix4; }
  44244. declare module "cesium/Source/Core/MorphWeightSpline" { import { MorphWeightSpline } from 'cesium'; export default MorphWeightSpline; }
  44245. declare module "cesium/Source/Core/NearFarScalar" { import { NearFarScalar } from 'cesium'; export default NearFarScalar; }
  44246. declare module "cesium/Source/Core/Occluder" { import { Occluder } from 'cesium'; export default Occluder; }
  44247. declare module "cesium/Source/Core/OpenCageGeocoderService" { import { OpenCageGeocoderService } from 'cesium'; export default OpenCageGeocoderService; }
  44248. declare module "cesium/Source/Core/OrientedBoundingBox" { import { OrientedBoundingBox } from 'cesium'; export default OrientedBoundingBox; }
  44249. declare module "cesium/Source/Core/OrthographicFrustum" { import { OrthographicFrustum } from 'cesium'; export default OrthographicFrustum; }
  44250. declare module "cesium/Source/Core/OrthographicOffCenterFrustum" { import { OrthographicOffCenterFrustum } from 'cesium'; export default OrthographicOffCenterFrustum; }
  44251. declare module "cesium/Source/Core/Packable" { import { Packable } from 'cesium'; export default Packable; }
  44252. declare module "cesium/Source/Core/PackableForInterpolation" { import { PackableForInterpolation } from 'cesium'; export default PackableForInterpolation; }
  44253. declare module "cesium/Source/Core/PeliasGeocoderService" { import { PeliasGeocoderService } from 'cesium'; export default PeliasGeocoderService; }
  44254. declare module "cesium/Source/Core/PerspectiveFrustum" { import { PerspectiveFrustum } from 'cesium'; export default PerspectiveFrustum; }
  44255. declare module "cesium/Source/Core/PerspectiveOffCenterFrustum" { import { PerspectiveOffCenterFrustum } from 'cesium'; export default PerspectiveOffCenterFrustum; }
  44256. declare module "cesium/Source/Core/PinBuilder" { import { PinBuilder } from 'cesium'; export default PinBuilder; }
  44257. declare module "cesium/Source/Core/Plane" { import { Plane } from 'cesium'; export default Plane; }
  44258. declare module "cesium/Source/Core/PlaneGeometry" { import { PlaneGeometry } from 'cesium'; export default PlaneGeometry; }
  44259. declare module "cesium/Source/Core/PlaneOutlineGeometry" { import { PlaneOutlineGeometry } from 'cesium'; export default PlaneOutlineGeometry; }
  44260. declare module "cesium/Source/Core/PolygonGeometry" { import { PolygonGeometry } from 'cesium'; export default PolygonGeometry; }
  44261. declare module "cesium/Source/Core/PolygonHierarchy" { import { PolygonHierarchy } from 'cesium'; export default PolygonHierarchy; }
  44262. declare module "cesium/Source/Core/PolygonOutlineGeometry" { import { PolygonOutlineGeometry } from 'cesium'; export default PolygonOutlineGeometry; }
  44263. declare module "cesium/Source/Core/PolylineGeometry" { import { PolylineGeometry } from 'cesium'; export default PolylineGeometry; }
  44264. declare module "cesium/Source/Core/PolylineVolumeGeometry" { import { PolylineVolumeGeometry } from 'cesium'; export default PolylineVolumeGeometry; }
  44265. declare module "cesium/Source/Core/PolylineVolumeOutlineGeometry" { import { PolylineVolumeOutlineGeometry } from 'cesium'; export default PolylineVolumeOutlineGeometry; }
  44266. declare module "cesium/Source/Core/Proxy" { import { Proxy } from 'cesium'; export default Proxy; }
  44267. declare module "cesium/Source/Core/QuadraticRealPolynomial" { import { QuadraticRealPolynomial } from 'cesium'; export default QuadraticRealPolynomial; }
  44268. declare module "cesium/Source/Core/QuantizedMeshTerrainData" { import { QuantizedMeshTerrainData } from 'cesium'; export default QuantizedMeshTerrainData; }
  44269. declare module "cesium/Source/Core/QuarticRealPolynomial" { import { QuarticRealPolynomial } from 'cesium'; export default QuarticRealPolynomial; }
  44270. declare module "cesium/Source/Core/Quaternion" { import { Quaternion } from 'cesium'; export default Quaternion; }
  44271. declare module "cesium/Source/Core/QuaternionSpline" { import { QuaternionSpline } from 'cesium'; export default QuaternionSpline; }
  44272. declare module "cesium/Source/Core/Queue" { import { Queue } from 'cesium'; export default Queue; }
  44273. declare module "cesium/Source/Core/Ray" { import { Ray } from 'cesium'; export default Ray; }
  44274. declare module "cesium/Source/Core/Rectangle" { import { Rectangle } from 'cesium'; export default Rectangle; }
  44275. declare module "cesium/Source/Core/RectangleGeometry" { import { RectangleGeometry } from 'cesium'; export default RectangleGeometry; }
  44276. declare module "cesium/Source/Core/RectangleOutlineGeometry" { import { RectangleOutlineGeometry } from 'cesium'; export default RectangleOutlineGeometry; }
  44277. declare module "cesium/Source/Core/Request" { import { Request } from 'cesium'; export default Request; }
  44278. declare module "cesium/Source/Core/RequestErrorEvent" { import { RequestErrorEvent } from 'cesium'; export default RequestErrorEvent; }
  44279. declare module "cesium/Source/Core/RequestScheduler" { import { RequestScheduler } from 'cesium'; export default RequestScheduler; }
  44280. declare module "cesium/Source/Core/Resource" { import { Resource } from 'cesium'; export default Resource; }
  44281. declare module "cesium/Source/Core/RuntimeError" { import { RuntimeError } from 'cesium'; export default RuntimeError; }
  44282. declare module "cesium/Source/Core/ScreenSpaceEventHandler" { import { ScreenSpaceEventHandler } from 'cesium'; export default ScreenSpaceEventHandler; }
  44283. declare module "cesium/Source/Core/ShowGeometryInstanceAttribute" { import { ShowGeometryInstanceAttribute } from 'cesium'; export default ShowGeometryInstanceAttribute; }
  44284. declare module "cesium/Source/Core/Simon1994PlanetaryPositions" { import { Simon1994PlanetaryPositions } from 'cesium'; export default Simon1994PlanetaryPositions; }
  44285. declare module "cesium/Source/Core/SimplePolylineGeometry" { import { SimplePolylineGeometry } from 'cesium'; export default SimplePolylineGeometry; }
  44286. declare module "cesium/Source/Core/SphereGeometry" { import { SphereGeometry } from 'cesium'; export default SphereGeometry; }
  44287. declare module "cesium/Source/Core/SphereOutlineGeometry" { import { SphereOutlineGeometry } from 'cesium'; export default SphereOutlineGeometry; }
  44288. declare module "cesium/Source/Core/Spherical" { import { Spherical } from 'cesium'; export default Spherical; }
  44289. declare module "cesium/Source/Core/Spline" { import { Spline } from 'cesium'; export default Spline; }
  44290. declare module "cesium/Source/Core/SteppedSpline" { import { SteppedSpline } from 'cesium'; export default SteppedSpline; }
  44291. declare module "cesium/Source/Core/TaskProcessor" { import { TaskProcessor } from 'cesium'; export default TaskProcessor; }
  44292. declare module "cesium/Source/Core/TerrainData" { import { TerrainData } from 'cesium'; export default TerrainData; }
  44293. declare module "cesium/Source/Core/TerrainProvider" { import { TerrainProvider } from 'cesium'; export default TerrainProvider; }
  44294. declare module "cesium/Source/Core/TileAvailability" { import { TileAvailability } from 'cesium'; export default TileAvailability; }
  44295. declare module "cesium/Source/Core/TileProviderError" { import { TileProviderError } from 'cesium'; export default TileProviderError; }
  44296. declare module "cesium/Source/Core/TilingScheme" { import { TilingScheme } from 'cesium'; export default TilingScheme; }
  44297. declare module "cesium/Source/Core/TimeInterval" { import { TimeInterval } from 'cesium'; export default TimeInterval; }
  44298. declare module "cesium/Source/Core/TimeIntervalCollection" { import { TimeIntervalCollection } from 'cesium'; export default TimeIntervalCollection; }
  44299. declare module "cesium/Source/Core/Transforms" { import { Transforms } from 'cesium'; export default Transforms; }
  44300. declare module "cesium/Source/Core/TranslationRotationScale" { import { TranslationRotationScale } from 'cesium'; export default TranslationRotationScale; }
  44301. declare module "cesium/Source/Core/TridiagonalSystemSolver" { import { TridiagonalSystemSolver } from 'cesium'; export default TridiagonalSystemSolver; }
  44302. declare module "cesium/Source/Core/TrustedServers" { import { TrustedServers } from 'cesium'; export default TrustedServers; }
  44303. declare module "cesium/Source/Core/VRTheWorldTerrainProvider" { import { VRTheWorldTerrainProvider } from 'cesium'; export default VRTheWorldTerrainProvider; }
  44304. declare module "cesium/Source/Core/VertexFormat" { import { VertexFormat } from 'cesium'; export default VertexFormat; }
  44305. declare module "cesium/Source/Core/VideoSynchronizer" { import { VideoSynchronizer } from 'cesium'; export default VideoSynchronizer; }
  44306. declare module "cesium/Source/Core/WallGeometry" { import { WallGeometry } from 'cesium'; export default WallGeometry; }
  44307. declare module "cesium/Source/Core/WallOutlineGeometry" { import { WallOutlineGeometry } from 'cesium'; export default WallOutlineGeometry; }
  44308. declare module "cesium/Source/Core/WebMercatorProjection" { import { WebMercatorProjection } from 'cesium'; export default WebMercatorProjection; }
  44309. declare module "cesium/Source/Core/WebMercatorTilingScheme" { import { WebMercatorTilingScheme } from 'cesium'; export default WebMercatorTilingScheme; }
  44310. declare module "cesium/Source/Core/barycentricCoordinates" { import { barycentricCoordinates } from 'cesium'; export default barycentricCoordinates; }
  44311. declare module "cesium/Source/Core/binarySearch" { import { binarySearch } from 'cesium'; export default binarySearch; }
  44312. declare module "cesium/Source/Core/buildModuleUrl" { import { buildModuleUrl } from 'cesium'; export default buildModuleUrl; }
  44313. declare module "cesium/Source/Core/cancelAnimationFrame" { import { cancelAnimationFrame } from 'cesium'; export default cancelAnimationFrame; }
  44314. declare module "cesium/Source/Core/clone" { import { clone } from 'cesium'; export default clone; }
  44315. declare module "cesium/Source/Core/combine" { import { combine } from 'cesium'; export default combine; }
  44316. declare module "cesium/Source/Core/createGuid" { import { createGuid } from 'cesium'; export default createGuid; }
  44317. declare module "cesium/Source/Core/createWorldTerrain" { import { createWorldTerrain } from 'cesium'; export default createWorldTerrain; }
  44318. declare module "cesium/Source/Core/defaultValue" { import { defaultValue } from 'cesium'; export default defaultValue; }
  44319. declare module "cesium/Source/Core/defined" { import { defined } from 'cesium'; export default defined; }
  44320. declare module "cesium/Source/Core/destroyObject" { import { destroyObject } from 'cesium'; export default destroyObject; }
  44321. declare module "cesium/Source/Core/formatError" { import { formatError } from 'cesium'; export default formatError; }
  44322. declare module "cesium/Source/Core/getAbsoluteUri" { import { getAbsoluteUri } from 'cesium'; export default getAbsoluteUri; }
  44323. declare module "cesium/Source/Core/getBaseUri" { import { getBaseUri } from 'cesium'; export default getBaseUri; }
  44324. declare module "cesium/Source/Core/getExtensionFromUri" { import { getExtensionFromUri } from 'cesium'; export default getExtensionFromUri; }
  44325. declare module "cesium/Source/Core/getFilenameFromUri" { import { getFilenameFromUri } from 'cesium'; export default getFilenameFromUri; }
  44326. declare module "cesium/Source/Core/getImagePixels" { import { getImagePixels } from 'cesium'; export default getImagePixels; }
  44327. declare module "cesium/Source/Core/getTimestamp" { import { getTimestamp } from 'cesium'; export default getTimestamp; }
  44328. declare module "cesium/Source/Core/isLeapYear" { import { isLeapYear } from 'cesium'; export default isLeapYear; }
  44329. declare module "cesium/Source/Core/mergeSort" { import { mergeSort } from 'cesium'; export default mergeSort; }
  44330. declare module "cesium/Source/Core/objectToQuery" { import { objectToQuery } from 'cesium'; export default objectToQuery; }
  44331. declare module "cesium/Source/Core/pointInsideTriangle" { import { pointInsideTriangle } from 'cesium'; export default pointInsideTriangle; }
  44332. declare module "cesium/Source/Core/queryToObject" { import { queryToObject } from 'cesium'; export default queryToObject; }
  44333. declare module "cesium/Source/Core/requestAnimationFrame" { import { requestAnimationFrame } from 'cesium'; export default requestAnimationFrame; }
  44334. declare module "cesium/Source/Core/sampleTerrain" { import { sampleTerrain } from 'cesium'; export default sampleTerrain; }
  44335. declare module "cesium/Source/Core/sampleTerrainMostDetailed" { import { sampleTerrainMostDetailed } from 'cesium'; export default sampleTerrainMostDetailed; }
  44336. declare module "cesium/Source/Core/subdivideArray" { import { subdivideArray } from 'cesium'; export default subdivideArray; }
  44337. declare module "cesium/Source/Core/writeTextToCanvas" { import { writeTextToCanvas } from 'cesium'; export default writeTextToCanvas; }
  44338. declare module "cesium/Source/DataSources/BillboardGraphics" { import { BillboardGraphics } from 'cesium'; export default BillboardGraphics; }
  44339. declare module "cesium/Source/DataSources/BillboardVisualizer" { import { BillboardVisualizer } from 'cesium'; export default BillboardVisualizer; }
  44340. declare module "cesium/Source/DataSources/BoxGeometryUpdater" { import { BoxGeometryUpdater } from 'cesium'; export default BoxGeometryUpdater; }
  44341. declare module "cesium/Source/DataSources/BoxGraphics" { import { BoxGraphics } from 'cesium'; export default BoxGraphics; }
  44342. declare module "cesium/Source/DataSources/CallbackProperty" { import { CallbackProperty } from 'cesium'; export default CallbackProperty; }
  44343. declare module "cesium/Source/DataSources/Cesium3DTilesetGraphics" { import { Cesium3DTilesetGraphics } from 'cesium'; export default Cesium3DTilesetGraphics; }
  44344. declare module "cesium/Source/DataSources/Cesium3DTilesetVisualizer" { import { Cesium3DTilesetVisualizer } from 'cesium'; export default Cesium3DTilesetVisualizer; }
  44345. declare module "cesium/Source/DataSources/CheckerboardMaterialProperty" { import { CheckerboardMaterialProperty } from 'cesium'; export default CheckerboardMaterialProperty; }
  44346. declare module "cesium/Source/DataSources/ColorMaterialProperty" { import { ColorMaterialProperty } from 'cesium'; export default ColorMaterialProperty; }
  44347. declare module "cesium/Source/DataSources/CompositeEntityCollection" { import { CompositeEntityCollection } from 'cesium'; export default CompositeEntityCollection; }
  44348. declare module "cesium/Source/DataSources/CompositeMaterialProperty" { import { CompositeMaterialProperty } from 'cesium'; export default CompositeMaterialProperty; }
  44349. declare module "cesium/Source/DataSources/CompositePositionProperty" { import { CompositePositionProperty } from 'cesium'; export default CompositePositionProperty; }
  44350. declare module "cesium/Source/DataSources/CompositeProperty" { import { CompositeProperty } from 'cesium'; export default CompositeProperty; }
  44351. declare module "cesium/Source/DataSources/ConstantPositionProperty" { import { ConstantPositionProperty } from 'cesium'; export default ConstantPositionProperty; }
  44352. declare module "cesium/Source/DataSources/ConstantProperty" { import { ConstantProperty } from 'cesium'; export default ConstantProperty; }
  44353. declare module "cesium/Source/DataSources/CorridorGeometryUpdater" { import { CorridorGeometryUpdater } from 'cesium'; export default CorridorGeometryUpdater; }
  44354. declare module "cesium/Source/DataSources/CorridorGraphics" { import { CorridorGraphics } from 'cesium'; export default CorridorGraphics; }
  44355. declare module "cesium/Source/DataSources/CustomDataSource" { import { CustomDataSource } from 'cesium'; export default CustomDataSource; }
  44356. declare module "cesium/Source/DataSources/CylinderGeometryUpdater" { import { CylinderGeometryUpdater } from 'cesium'; export default CylinderGeometryUpdater; }
  44357. declare module "cesium/Source/DataSources/CylinderGraphics" { import { CylinderGraphics } from 'cesium'; export default CylinderGraphics; }
  44358. declare module "cesium/Source/DataSources/CzmlDataSource" { import { CzmlDataSource } from 'cesium'; export default CzmlDataSource; }
  44359. declare module "cesium/Source/DataSources/DataSource" { import { DataSource } from 'cesium'; export default DataSource; }
  44360. declare module "cesium/Source/DataSources/DataSourceClock" { import { DataSourceClock } from 'cesium'; export default DataSourceClock; }
  44361. declare module "cesium/Source/DataSources/DataSourceCollection" { import { DataSourceCollection } from 'cesium'; export default DataSourceCollection; }
  44362. declare module "cesium/Source/DataSources/DataSourceDisplay" { import { DataSourceDisplay } from 'cesium'; export default DataSourceDisplay; }
  44363. declare module "cesium/Source/DataSources/EllipseGeometryUpdater" { import { EllipseGeometryUpdater } from 'cesium'; export default EllipseGeometryUpdater; }
  44364. declare module "cesium/Source/DataSources/EllipseGraphics" { import { EllipseGraphics } from 'cesium'; export default EllipseGraphics; }
  44365. declare module "cesium/Source/DataSources/EllipsoidGeometryUpdater" { import { EllipsoidGeometryUpdater } from 'cesium'; export default EllipsoidGeometryUpdater; }
  44366. declare module "cesium/Source/DataSources/EllipsoidGraphics" { import { EllipsoidGraphics } from 'cesium'; export default EllipsoidGraphics; }
  44367. declare module "cesium/Source/DataSources/Entity" { import { Entity } from 'cesium'; export default Entity; }
  44368. declare module "cesium/Source/DataSources/EntityCluster" { import { EntityCluster } from 'cesium'; export default EntityCluster; }
  44369. declare module "cesium/Source/DataSources/EntityCollection" { import { EntityCollection } from 'cesium'; export default EntityCollection; }
  44370. declare module "cesium/Source/DataSources/EntityView" { import { EntityView } from 'cesium'; export default EntityView; }
  44371. declare module "cesium/Source/DataSources/GeoJsonDataSource" { import { GeoJsonDataSource } from 'cesium'; export default GeoJsonDataSource; }
  44372. declare module "cesium/Source/DataSources/GeometryUpdater" { import { GeometryUpdater } from 'cesium'; export default GeometryUpdater; }
  44373. declare module "cesium/Source/DataSources/GeometryVisualizer" { import { GeometryVisualizer } from 'cesium'; export default GeometryVisualizer; }
  44374. declare module "cesium/Source/DataSources/GpxDataSource" { import { GpxDataSource } from 'cesium'; export default GpxDataSource; }
  44375. declare module "cesium/Source/DataSources/GridMaterialProperty" { import { GridMaterialProperty } from 'cesium'; export default GridMaterialProperty; }
  44376. declare module "cesium/Source/DataSources/GroundGeometryUpdater" { import { GroundGeometryUpdater } from 'cesium'; export default GroundGeometryUpdater; }
  44377. declare module "cesium/Source/DataSources/ImageMaterialProperty" { import { ImageMaterialProperty } from 'cesium'; export default ImageMaterialProperty; }
  44378. declare module "cesium/Source/DataSources/KmlCamera" { import { KmlCamera } from 'cesium'; export default KmlCamera; }
  44379. declare module "cesium/Source/DataSources/KmlDataSource" { import { KmlDataSource } from 'cesium'; export default KmlDataSource; }
  44380. declare module "cesium/Source/DataSources/KmlLookAt" { import { KmlLookAt } from 'cesium'; export default KmlLookAt; }
  44381. declare module "cesium/Source/DataSources/KmlTour" { import { KmlTour } from 'cesium'; export default KmlTour; }
  44382. declare module "cesium/Source/DataSources/KmlTourFlyTo" { import { KmlTourFlyTo } from 'cesium'; export default KmlTourFlyTo; }
  44383. declare module "cesium/Source/DataSources/KmlTourWait" { import { KmlTourWait } from 'cesium'; export default KmlTourWait; }
  44384. declare module "cesium/Source/DataSources/LabelGraphics" { import { LabelGraphics } from 'cesium'; export default LabelGraphics; }
  44385. declare module "cesium/Source/DataSources/LabelVisualizer" { import { LabelVisualizer } from 'cesium'; export default LabelVisualizer; }
  44386. declare module "cesium/Source/DataSources/MaterialProperty" { import { MaterialProperty } from 'cesium'; export default MaterialProperty; }
  44387. declare module "cesium/Source/DataSources/ModelGraphics" { import { ModelGraphics } from 'cesium'; export default ModelGraphics; }
  44388. declare module "cesium/Source/DataSources/ModelVisualizer" { import { ModelVisualizer } from 'cesium'; export default ModelVisualizer; }
  44389. declare module "cesium/Source/DataSources/NodeTransformationProperty" { import { NodeTransformationProperty } from 'cesium'; export default NodeTransformationProperty; }
  44390. declare module "cesium/Source/DataSources/PathGraphics" { import { PathGraphics } from 'cesium'; export default PathGraphics; }
  44391. declare module "cesium/Source/DataSources/PathVisualizer" { import { PathVisualizer } from 'cesium'; export default PathVisualizer; }
  44392. declare module "cesium/Source/DataSources/PlaneGeometryUpdater" { import { PlaneGeometryUpdater } from 'cesium'; export default PlaneGeometryUpdater; }
  44393. declare module "cesium/Source/DataSources/PlaneGraphics" { import { PlaneGraphics } from 'cesium'; export default PlaneGraphics; }
  44394. declare module "cesium/Source/DataSources/PointGraphics" { import { PointGraphics } from 'cesium'; export default PointGraphics; }
  44395. declare module "cesium/Source/DataSources/PointVisualizer" { import { PointVisualizer } from 'cesium'; export default PointVisualizer; }
  44396. declare module "cesium/Source/DataSources/PolygonGeometryUpdater" { import { PolygonGeometryUpdater } from 'cesium'; export default PolygonGeometryUpdater; }
  44397. declare module "cesium/Source/DataSources/PolygonGraphics" { import { PolygonGraphics } from 'cesium'; export default PolygonGraphics; }
  44398. declare module "cesium/Source/DataSources/PolylineArrowMaterialProperty" { import { PolylineArrowMaterialProperty } from 'cesium'; export default PolylineArrowMaterialProperty; }
  44399. declare module "cesium/Source/DataSources/PolylineDashMaterialProperty" { import { PolylineDashMaterialProperty } from 'cesium'; export default PolylineDashMaterialProperty; }
  44400. declare module "cesium/Source/DataSources/PolylineGeometryUpdater" { import { PolylineGeometryUpdater } from 'cesium'; export default PolylineGeometryUpdater; }
  44401. declare module "cesium/Source/DataSources/PolylineGlowMaterialProperty" { import { PolylineGlowMaterialProperty } from 'cesium'; export default PolylineGlowMaterialProperty; }
  44402. declare module "cesium/Source/DataSources/PolylineGraphics" { import { PolylineGraphics } from 'cesium'; export default PolylineGraphics; }
  44403. declare module "cesium/Source/DataSources/PolylineOutlineMaterialProperty" { import { PolylineOutlineMaterialProperty } from 'cesium'; export default PolylineOutlineMaterialProperty; }
  44404. declare module "cesium/Source/DataSources/PolylineVisualizer" { import { PolylineVisualizer } from 'cesium'; export default PolylineVisualizer; }
  44405. declare module "cesium/Source/DataSources/PolylineVolumeGeometryUpdater" { import { PolylineVolumeGeometryUpdater } from 'cesium'; export default PolylineVolumeGeometryUpdater; }
  44406. declare module "cesium/Source/DataSources/PolylineVolumeGraphics" { import { PolylineVolumeGraphics } from 'cesium'; export default PolylineVolumeGraphics; }
  44407. declare module "cesium/Source/DataSources/PositionProperty" { import { PositionProperty } from 'cesium'; export default PositionProperty; }
  44408. declare module "cesium/Source/DataSources/PositionPropertyArray" { import { PositionPropertyArray } from 'cesium'; export default PositionPropertyArray; }
  44409. declare module "cesium/Source/DataSources/Property" { import { Property } from 'cesium'; export default Property; }
  44410. declare module "cesium/Source/DataSources/PropertyArray" { import { PropertyArray } from 'cesium'; export default PropertyArray; }
  44411. declare module "cesium/Source/DataSources/PropertyBag" { import { PropertyBag } from 'cesium'; export default PropertyBag; }
  44412. declare module "cesium/Source/DataSources/RectangleGeometryUpdater" { import { RectangleGeometryUpdater } from 'cesium'; export default RectangleGeometryUpdater; }
  44413. declare module "cesium/Source/DataSources/RectangleGraphics" { import { RectangleGraphics } from 'cesium'; export default RectangleGraphics; }
  44414. declare module "cesium/Source/DataSources/ReferenceProperty" { import { ReferenceProperty } from 'cesium'; export default ReferenceProperty; }
  44415. declare module "cesium/Source/DataSources/Rotation" { import { Rotation } from 'cesium'; export default Rotation; }
  44416. declare module "cesium/Source/DataSources/SampledPositionProperty" { import { SampledPositionProperty } from 'cesium'; export default SampledPositionProperty; }
  44417. declare module "cesium/Source/DataSources/SampledProperty" { import { SampledProperty } from 'cesium'; export default SampledProperty; }
  44418. declare module "cesium/Source/DataSources/StripeMaterialProperty" { import { StripeMaterialProperty } from 'cesium'; export default StripeMaterialProperty; }
  44419. declare module "cesium/Source/DataSources/TimeIntervalCollectionPositionProperty" { import { TimeIntervalCollectionPositionProperty } from 'cesium'; export default TimeIntervalCollectionPositionProperty; }
  44420. declare module "cesium/Source/DataSources/TimeIntervalCollectionProperty" { import { TimeIntervalCollectionProperty } from 'cesium'; export default TimeIntervalCollectionProperty; }
  44421. declare module "cesium/Source/DataSources/VelocityOrientationProperty" { import { VelocityOrientationProperty } from 'cesium'; export default VelocityOrientationProperty; }
  44422. declare module "cesium/Source/DataSources/VelocityVectorProperty" { import { VelocityVectorProperty } from 'cesium'; export default VelocityVectorProperty; }
  44423. declare module "cesium/Source/DataSources/Visualizer" { import { Visualizer } from 'cesium'; export default Visualizer; }
  44424. declare module "cesium/Source/DataSources/WallGeometryUpdater" { import { WallGeometryUpdater } from 'cesium'; export default WallGeometryUpdater; }
  44425. declare module "cesium/Source/DataSources/WallGraphics" { import { WallGraphics } from 'cesium'; export default WallGraphics; }
  44426. declare module "cesium/Source/DataSources/exportKml" { import { exportKml } from 'cesium'; export default exportKml; }
  44427. declare module "cesium/Source/Scene/Appearance" { import { Appearance } from 'cesium'; export default Appearance; }
  44428. declare module "cesium/Source/Scene/ArcGisMapServerImageryProvider" { import { ArcGisMapServerImageryProvider } from 'cesium'; export default ArcGisMapServerImageryProvider; }
  44429. declare module "cesium/Source/Scene/Billboard" { import { Billboard } from 'cesium'; export default Billboard; }
  44430. declare module "cesium/Source/Scene/BillboardCollection" { import { BillboardCollection } from 'cesium'; export default BillboardCollection; }
  44431. declare module "cesium/Source/Scene/BingMapsImageryProvider" { import { BingMapsImageryProvider } from 'cesium'; export default BingMapsImageryProvider; }
  44432. declare module "cesium/Source/Scene/BlendingState" { import { BlendingState } from 'cesium'; export default BlendingState; }
  44433. declare module "cesium/Source/Scene/BoxEmitter" { import { BoxEmitter } from 'cesium'; export default BoxEmitter; }
  44434. declare module "cesium/Source/Scene/Camera" { import { Camera } from 'cesium'; export default Camera; }
  44435. declare module "cesium/Source/Scene/CameraEventAggregator" { import { CameraEventAggregator } from 'cesium'; export default CameraEventAggregator; }
  44436. declare module "cesium/Source/Scene/Cesium3DTile" { import { Cesium3DTile } from 'cesium'; export default Cesium3DTile; }
  44437. declare module "cesium/Source/Scene/Cesium3DTileContent" { import { Cesium3DTileContent } from 'cesium'; export default Cesium3DTileContent; }
  44438. declare module "cesium/Source/Scene/Cesium3DTileFeature" { import { Cesium3DTileFeature } from 'cesium'; export default Cesium3DTileFeature; }
  44439. declare module "cesium/Source/Scene/Cesium3DTilePointFeature" { import { Cesium3DTilePointFeature } from 'cesium'; export default Cesium3DTilePointFeature; }
  44440. declare module "cesium/Source/Scene/Cesium3DTileStyle" { import { Cesium3DTileStyle } from 'cesium'; export default Cesium3DTileStyle; }
  44441. declare module "cesium/Source/Scene/Cesium3DTileset" { import { Cesium3DTileset } from 'cesium'; export default Cesium3DTileset; }
  44442. declare module "cesium/Source/Scene/CircleEmitter" { import { CircleEmitter } from 'cesium'; export default CircleEmitter; }
  44443. declare module "cesium/Source/Scene/ClassificationPrimitive" { import { ClassificationPrimitive } from 'cesium'; export default ClassificationPrimitive; }
  44444. declare module "cesium/Source/Scene/ClippingPlane" { import { ClippingPlane } from 'cesium'; export default ClippingPlane; }
  44445. declare module "cesium/Source/Scene/ClippingPlaneCollection" { import { ClippingPlaneCollection } from 'cesium'; export default ClippingPlaneCollection; }
  44446. declare module "cesium/Source/Scene/CloudCollection" { import { CloudCollection } from 'cesium'; export default CloudCollection; }
  44447. declare module "cesium/Source/Scene/ConditionsExpression" { import { ConditionsExpression } from 'cesium'; export default ConditionsExpression; }
  44448. declare module "cesium/Source/Scene/ConeEmitter" { import { ConeEmitter } from 'cesium'; export default ConeEmitter; }
  44449. declare module "cesium/Source/Scene/CreditDisplay" { import { CreditDisplay } from 'cesium'; export default CreditDisplay; }
  44450. declare module "cesium/Source/Scene/CumulusCloud" { import { CumulusCloud } from 'cesium'; export default CumulusCloud; }
  44451. declare module "cesium/Source/Scene/DebugAppearance" { import { DebugAppearance } from 'cesium'; export default DebugAppearance; }
  44452. declare module "cesium/Source/Scene/DebugCameraPrimitive" { import { DebugCameraPrimitive } from 'cesium'; export default DebugCameraPrimitive; }
  44453. declare module "cesium/Source/Scene/DebugModelMatrixPrimitive" { import { DebugModelMatrixPrimitive } from 'cesium'; export default DebugModelMatrixPrimitive; }
  44454. declare module "cesium/Source/Scene/DirectionalLight" { import { DirectionalLight } from 'cesium'; export default DirectionalLight; }
  44455. declare module "cesium/Source/Scene/DiscardEmptyTileImagePolicy" { import { DiscardEmptyTileImagePolicy } from 'cesium'; export default DiscardEmptyTileImagePolicy; }
  44456. declare module "cesium/Source/Scene/DiscardMissingTileImagePolicy" { import { DiscardMissingTileImagePolicy } from 'cesium'; export default DiscardMissingTileImagePolicy; }
  44457. declare module "cesium/Source/Scene/EllipsoidSurfaceAppearance" { import { EllipsoidSurfaceAppearance } from 'cesium'; export default EllipsoidSurfaceAppearance; }
  44458. declare module "cesium/Source/Scene/Expression" { import { Expression } from 'cesium'; export default Expression; }
  44459. declare module "cesium/Source/Scene/Fog" { import { Fog } from 'cesium'; export default Fog; }
  44460. declare module "cesium/Source/Scene/FrameRateMonitor" { import { FrameRateMonitor } from 'cesium'; export default FrameRateMonitor; }
  44461. declare module "cesium/Source/Scene/GetFeatureInfoFormat" { import { GetFeatureInfoFormat } from 'cesium'; export default GetFeatureInfoFormat; }
  44462. declare module "cesium/Source/Scene/Globe" { import { Globe } from 'cesium'; export default Globe; }
  44463. declare module "cesium/Source/Scene/GlobeTranslucency" { import { GlobeTranslucency } from 'cesium'; export default GlobeTranslucency; }
  44464. declare module "cesium/Source/Scene/GoogleEarthEnterpriseImageryProvider" { import { GoogleEarthEnterpriseImageryProvider } from 'cesium'; export default GoogleEarthEnterpriseImageryProvider; }
  44465. declare module "cesium/Source/Scene/GoogleEarthEnterpriseMapsProvider" { import { GoogleEarthEnterpriseMapsProvider } from 'cesium'; export default GoogleEarthEnterpriseMapsProvider; }
  44466. declare module "cesium/Source/Scene/GridImageryProvider" { import { GridImageryProvider } from 'cesium'; export default GridImageryProvider; }
  44467. declare module "cesium/Source/Scene/GroundPolylinePrimitive" { import { GroundPolylinePrimitive } from 'cesium'; export default GroundPolylinePrimitive; }
  44468. declare module "cesium/Source/Scene/GroundPrimitive" { import { GroundPrimitive } from 'cesium'; export default GroundPrimitive; }
  44469. declare module "cesium/Source/Scene/ImageBasedLighting" { import { ImageBasedLighting } from 'cesium'; export default ImageBasedLighting; }
  44470. declare module "cesium/Source/Scene/ImageryLayer" { import { ImageryLayer } from 'cesium'; export default ImageryLayer; }
  44471. declare module "cesium/Source/Scene/ImageryLayerCollection" { import { ImageryLayerCollection } from 'cesium'; export default ImageryLayerCollection; }
  44472. declare module "cesium/Source/Scene/ImageryLayerFeatureInfo" { import { ImageryLayerFeatureInfo } from 'cesium'; export default ImageryLayerFeatureInfo; }
  44473. declare module "cesium/Source/Scene/ImageryProvider" { import { ImageryProvider } from 'cesium'; export default ImageryProvider; }
  44474. declare module "cesium/Source/Scene/IonImageryProvider" { import { IonImageryProvider } from 'cesium'; export default IonImageryProvider; }
  44475. declare module "cesium/Source/Scene/Label" { import { Label } from 'cesium'; export default Label; }
  44476. declare module "cesium/Source/Scene/LabelCollection" { import { LabelCollection } from 'cesium'; export default LabelCollection; }
  44477. declare module "cesium/Source/Scene/Light" { import { Light } from 'cesium'; export default Light; }
  44478. declare module "cesium/Source/Scene/MapboxImageryProvider" { import { MapboxImageryProvider } from 'cesium'; export default MapboxImageryProvider; }
  44479. declare module "cesium/Source/Scene/MapboxStyleImageryProvider" { import { MapboxStyleImageryProvider } from 'cesium'; export default MapboxStyleImageryProvider; }
  44480. declare module "cesium/Source/Scene/Material" { import { Material } from 'cesium'; export default Material; }
  44481. declare module "cesium/Source/Scene/MaterialAppearance" { import { MaterialAppearance } from 'cesium'; export default MaterialAppearance; }
  44482. declare module "cesium/Source/Scene/Model" { import { Model } from 'cesium'; export default Model; }
  44483. declare module "cesium/Source/Scene/ModelAnimation" { import { ModelAnimation } from 'cesium'; export default ModelAnimation; }
  44484. declare module "cesium/Source/Scene/ModelAnimationCollection" { import { ModelAnimationCollection } from 'cesium'; export default ModelAnimationCollection; }
  44485. declare module "cesium/Source/Scene/ModelMaterial" { import { ModelMaterial } from 'cesium'; export default ModelMaterial; }
  44486. declare module "cesium/Source/Scene/ModelMesh" { import { ModelMesh } from 'cesium'; export default ModelMesh; }
  44487. declare module "cesium/Source/Scene/ModelNode" { import { ModelNode } from 'cesium'; export default ModelNode; }
  44488. declare module "cesium/Source/Scene/Moon" { import { Moon } from 'cesium'; export default Moon; }
  44489. declare module "cesium/Source/Scene/NeverTileDiscardPolicy" { import { NeverTileDiscardPolicy } from 'cesium'; export default NeverTileDiscardPolicy; }
  44490. declare module "cesium/Source/Scene/OpenStreetMapImageryProvider" { import { OpenStreetMapImageryProvider } from 'cesium'; export default OpenStreetMapImageryProvider; }
  44491. declare module "cesium/Source/Scene/Particle" { import { Particle } from 'cesium'; export default Particle; }
  44492. declare module "cesium/Source/Scene/ParticleBurst" { import { ParticleBurst } from 'cesium'; export default ParticleBurst; }
  44493. declare module "cesium/Source/Scene/ParticleEmitter" { import { ParticleEmitter } from 'cesium'; export default ParticleEmitter; }
  44494. declare module "cesium/Source/Scene/ParticleSystem" { import { ParticleSystem } from 'cesium'; export default ParticleSystem; }
  44495. declare module "cesium/Source/Scene/PerInstanceColorAppearance" { import { PerInstanceColorAppearance } from 'cesium'; export default PerInstanceColorAppearance; }
  44496. declare module "cesium/Source/Scene/PointCloudShading" { import { PointCloudShading } from 'cesium'; export default PointCloudShading; }
  44497. declare module "cesium/Source/Scene/PointPrimitive" { import { PointPrimitive } from 'cesium'; export default PointPrimitive; }
  44498. declare module "cesium/Source/Scene/PointPrimitiveCollection" { import { PointPrimitiveCollection } from 'cesium'; export default PointPrimitiveCollection; }
  44499. declare module "cesium/Source/Scene/Polyline" { import { Polyline } from 'cesium'; export default Polyline; }
  44500. declare module "cesium/Source/Scene/PolylineCollection" { import { PolylineCollection } from 'cesium'; export default PolylineCollection; }
  44501. declare module "cesium/Source/Scene/PolylineColorAppearance" { import { PolylineColorAppearance } from 'cesium'; export default PolylineColorAppearance; }
  44502. declare module "cesium/Source/Scene/PolylineMaterialAppearance" { import { PolylineMaterialAppearance } from 'cesium'; export default PolylineMaterialAppearance; }
  44503. declare module "cesium/Source/Scene/PostProcessStage" { import { PostProcessStage } from 'cesium'; export default PostProcessStage; }
  44504. declare module "cesium/Source/Scene/PostProcessStageCollection" { import { PostProcessStageCollection } from 'cesium'; export default PostProcessStageCollection; }
  44505. declare module "cesium/Source/Scene/PostProcessStageComposite" { import { PostProcessStageComposite } from 'cesium'; export default PostProcessStageComposite; }
  44506. declare module "cesium/Source/Scene/PostProcessStageLibrary" { import { PostProcessStageLibrary } from 'cesium'; export default PostProcessStageLibrary; }
  44507. declare module "cesium/Source/Scene/Primitive" { import { Primitive } from 'cesium'; export default Primitive; }
  44508. declare module "cesium/Source/Scene/PrimitiveCollection" { import { PrimitiveCollection } from 'cesium'; export default PrimitiveCollection; }
  44509. declare module "cesium/Source/Scene/Scene" { import { Scene } from 'cesium'; export default Scene; }
  44510. declare module "cesium/Source/Scene/SceneTransforms" { import { SceneTransforms } from 'cesium'; export default SceneTransforms; }
  44511. declare module "cesium/Source/Scene/ScreenSpaceCameraController" { import { ScreenSpaceCameraController } from 'cesium'; export default ScreenSpaceCameraController; }
  44512. declare module "cesium/Source/Scene/ShadowMap" { import { ShadowMap } from 'cesium'; export default ShadowMap; }
  44513. declare module "cesium/Source/Scene/SingleTileImageryProvider" { import { SingleTileImageryProvider } from 'cesium'; export default SingleTileImageryProvider; }
  44514. declare module "cesium/Source/Scene/SkyAtmosphere" { import { SkyAtmosphere } from 'cesium'; export default SkyAtmosphere; }
  44515. declare module "cesium/Source/Scene/SkyBox" { import { SkyBox } from 'cesium'; export default SkyBox; }
  44516. declare module "cesium/Source/Scene/SphereEmitter" { import { SphereEmitter } from 'cesium'; export default SphereEmitter; }
  44517. declare module "cesium/Source/Scene/StyleExpression" { import { StyleExpression } from 'cesium'; export default StyleExpression; }
  44518. declare module "cesium/Source/Scene/Sun" { import { Sun } from 'cesium'; export default Sun; }
  44519. declare module "cesium/Source/Scene/SunLight" { import { SunLight } from 'cesium'; export default SunLight; }
  44520. declare module "cesium/Source/Scene/TileCoordinatesImageryProvider" { import { TileCoordinatesImageryProvider } from 'cesium'; export default TileCoordinatesImageryProvider; }
  44521. declare module "cesium/Source/Scene/TileDiscardPolicy" { import { TileDiscardPolicy } from 'cesium'; export default TileDiscardPolicy; }
  44522. declare module "cesium/Source/Scene/TileMapServiceImageryProvider" { import { TileMapServiceImageryProvider } from 'cesium'; export default TileMapServiceImageryProvider; }
  44523. declare module "cesium/Source/Scene/TimeDynamicImagery" { import { TimeDynamicImagery } from 'cesium'; export default TimeDynamicImagery; }
  44524. declare module "cesium/Source/Scene/TimeDynamicPointCloud" { import { TimeDynamicPointCloud } from 'cesium'; export default TimeDynamicPointCloud; }
  44525. declare module "cesium/Source/Scene/UrlTemplateImageryProvider" { import { UrlTemplateImageryProvider } from 'cesium'; export default UrlTemplateImageryProvider; }
  44526. declare module "cesium/Source/Scene/ViewportQuad" { import { ViewportQuad } from 'cesium'; export default ViewportQuad; }
  44527. declare module "cesium/Source/Scene/WebMapServiceImageryProvider" { import { WebMapServiceImageryProvider } from 'cesium'; export default WebMapServiceImageryProvider; }
  44528. declare module "cesium/Source/Scene/WebMapTileServiceImageryProvider" { import { WebMapTileServiceImageryProvider } from 'cesium'; export default WebMapTileServiceImageryProvider; }
  44529. declare module "cesium/Source/Scene/createElevationBandMaterial" { import { createElevationBandMaterial } from 'cesium'; export default createElevationBandMaterial; }
  44530. declare module "cesium/Source/Scene/createOsmBuildings" { import { createOsmBuildings } from 'cesium'; export default createOsmBuildings; }
  44531. declare module "cesium/Source/Scene/createTangentSpaceDebugPrimitive" { import { createTangentSpaceDebugPrimitive } from 'cesium'; export default createTangentSpaceDebugPrimitive; }
  44532. declare module "cesium/Source/Scene/createWorldImagery" { import { createWorldImagery } from 'cesium'; export default createWorldImagery; }
  44533. declare module "cesium/Source/Widgets/ClockViewModel" { import { ClockViewModel } from 'cesium'; export default ClockViewModel; }
  44534. declare module "cesium/Source/Widgets/Command" { import { Command } from 'cesium'; export default Command; }
  44535. declare module "cesium/Source/Widgets/SvgPathBindingHandler" { import { SvgPathBindingHandler } from 'cesium'; export default SvgPathBindingHandler; }
  44536. declare module "cesium/Source/Widgets/ToggleButtonViewModel" { import { ToggleButtonViewModel } from 'cesium'; export default ToggleButtonViewModel; }
  44537. declare module "cesium/Source/Widgets/createCommand" { import { createCommand } from 'cesium'; export default createCommand; }
  44538. declare module "cesium/Source/Scene/ModelExperimental/CustomShader" { import { CustomShader } from 'cesium'; export default CustomShader; }
  44539. declare module "cesium/Source/Scene/ModelExperimental/ModelExperimental" { import { ModelExperimental } from 'cesium'; export default ModelExperimental; }
  44540. declare module "cesium/Source/Scene/ModelExperimental/ModelExperimentalAnimation" { import { ModelExperimentalAnimation } from 'cesium'; export default ModelExperimentalAnimation; }
  44541. declare module "cesium/Source/Scene/ModelExperimental/ModelExperimentalAnimationCollection" { import { ModelExperimentalAnimationCollection } from 'cesium'; export default ModelExperimentalAnimationCollection; }
  44542. declare module "cesium/Source/Scene/ModelExperimental/ModelFeature" { import { ModelFeature } from 'cesium'; export default ModelFeature; }
  44543. declare module "cesium/Source/Scene/ModelExperimental/TextureUniform" { import { TextureUniform } from 'cesium'; export default TextureUniform; }
  44544. declare module "cesium/Source/Widgets/Animation/Animation" { import { Animation } from 'cesium'; export default Animation; }
  44545. declare module "cesium/Source/Widgets/Animation/AnimationViewModel" { import { AnimationViewModel } from 'cesium'; export default AnimationViewModel; }
  44546. declare module "cesium/Source/Widgets/BaseLayerPicker/BaseLayerPicker" { import { BaseLayerPicker } from 'cesium'; export default BaseLayerPicker; }
  44547. declare module "cesium/Source/Widgets/BaseLayerPicker/BaseLayerPickerViewModel" { import { BaseLayerPickerViewModel } from 'cesium'; export default BaseLayerPickerViewModel; }
  44548. declare module "cesium/Source/Widgets/BaseLayerPicker/ProviderViewModel" { import { ProviderViewModel } from 'cesium'; export default ProviderViewModel; }
  44549. declare module "cesium/Source/Widgets/Cesium3DTilesInspector/Cesium3DTilesInspector" { import { Cesium3DTilesInspector } from 'cesium'; export default Cesium3DTilesInspector; }
  44550. declare module "cesium/Source/Widgets/Cesium3DTilesInspector/Cesium3DTilesInspectorViewModel" { import { Cesium3DTilesInspectorViewModel } from 'cesium'; export default Cesium3DTilesInspectorViewModel; }
  44551. declare module "cesium/Source/Widgets/CesiumInspector/CesiumInspector" { import { CesiumInspector } from 'cesium'; export default CesiumInspector; }
  44552. declare module "cesium/Source/Widgets/CesiumInspector/CesiumInspectorViewModel" { import { CesiumInspectorViewModel } from 'cesium'; export default CesiumInspectorViewModel; }
  44553. declare module "cesium/Source/Widgets/CesiumWidget/CesiumWidget" { import { CesiumWidget } from 'cesium'; export default CesiumWidget; }
  44554. declare module "cesium/Source/Widgets/FullscreenButton/FullscreenButton" { import { FullscreenButton } from 'cesium'; export default FullscreenButton; }
  44555. declare module "cesium/Source/Widgets/FullscreenButton/FullscreenButtonViewModel" { import { FullscreenButtonViewModel } from 'cesium'; export default FullscreenButtonViewModel; }
  44556. declare module "cesium/Source/Widgets/Geocoder/Geocoder" { import { Geocoder } from 'cesium'; export default Geocoder; }
  44557. declare module "cesium/Source/Widgets/Geocoder/GeocoderViewModel" { import { GeocoderViewModel } from 'cesium'; export default GeocoderViewModel; }
  44558. declare module "cesium/Source/Widgets/HomeButton/HomeButton" { import { HomeButton } from 'cesium'; export default HomeButton; }
  44559. declare module "cesium/Source/Widgets/HomeButton/HomeButtonViewModel" { import { HomeButtonViewModel } from 'cesium'; export default HomeButtonViewModel; }
  44560. declare module "cesium/Source/Widgets/InfoBox/InfoBox" { import { InfoBox } from 'cesium'; export default InfoBox; }
  44561. declare module "cesium/Source/Widgets/InfoBox/InfoBoxViewModel" { import { InfoBoxViewModel } from 'cesium'; export default InfoBoxViewModel; }
  44562. declare module "cesium/Source/Widgets/NavigationHelpButton/NavigationHelpButton" { import { NavigationHelpButton } from 'cesium'; export default NavigationHelpButton; }
  44563. declare module "cesium/Source/Widgets/NavigationHelpButton/NavigationHelpButtonViewModel" { import { NavigationHelpButtonViewModel } from 'cesium'; export default NavigationHelpButtonViewModel; }
  44564. declare module "cesium/Source/Widgets/PerformanceWatchdog/PerformanceWatchdog" { import { PerformanceWatchdog } from 'cesium'; export default PerformanceWatchdog; }
  44565. declare module "cesium/Source/Widgets/PerformanceWatchdog/PerformanceWatchdogViewModel" { import { PerformanceWatchdogViewModel } from 'cesium'; export default PerformanceWatchdogViewModel; }
  44566. declare module "cesium/Source/Widgets/ProjectionPicker/ProjectionPicker" { import { ProjectionPicker } from 'cesium'; export default ProjectionPicker; }
  44567. declare module "cesium/Source/Widgets/ProjectionPicker/ProjectionPickerViewModel" { import { ProjectionPickerViewModel } from 'cesium'; export default ProjectionPickerViewModel; }
  44568. declare module "cesium/Source/Widgets/SceneModePicker/SceneModePicker" { import { SceneModePicker } from 'cesium'; export default SceneModePicker; }
  44569. declare module "cesium/Source/Widgets/SceneModePicker/SceneModePickerViewModel" { import { SceneModePickerViewModel } from 'cesium'; export default SceneModePickerViewModel; }
  44570. declare module "cesium/Source/Widgets/SelectionIndicator/SelectionIndicator" { import { SelectionIndicator } from 'cesium'; export default SelectionIndicator; }
  44571. declare module "cesium/Source/Widgets/SelectionIndicator/SelectionIndicatorViewModel" { import { SelectionIndicatorViewModel } from 'cesium'; export default SelectionIndicatorViewModel; }
  44572. declare module "cesium/Source/Widgets/Timeline/Timeline" { import { Timeline } from 'cesium'; export default Timeline; }
  44573. declare module "cesium/Source/Widgets/VRButton/VRButton" { import { VRButton } from 'cesium'; export default VRButton; }
  44574. declare module "cesium/Source/Widgets/VRButton/VRButtonViewModel" { import { VRButtonViewModel } from 'cesium'; export default VRButtonViewModel; }
  44575. declare module "cesium/Source/Widgets/Viewer/Viewer" { import { Viewer } from 'cesium'; export default Viewer; }
  44576. declare module "cesium/Source/Widgets/Viewer/viewerCesium3DTilesInspectorMixin" { import { viewerCesium3DTilesInspectorMixin } from 'cesium'; export default viewerCesium3DTilesInspectorMixin; }
  44577. declare module "cesium/Source/Widgets/Viewer/viewerCesiumInspectorMixin" { import { viewerCesiumInspectorMixin } from 'cesium'; export default viewerCesiumInspectorMixin; }
  44578. declare module "cesium/Source/Widgets/Viewer/viewerDragDropMixin" { import { viewerDragDropMixin } from 'cesium'; export default viewerDragDropMixin; }
  44579. declare module "cesium/Source/Widgets/Viewer/viewerPerformanceWatchdogMixin" { import { viewerPerformanceWatchdogMixin } from 'cesium'; export default viewerPerformanceWatchdogMixin; }