Cesium.d.ts 1.9 MB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569157015711572157315741575157615771578157915801581158215831584158515861587158815891590159115921593159415951596159715981599160016011602160316041605160616071608160916101611161216131614161516161617161816191620162116221623162416251626162716281629163016311632163316341635163616371638163916401641164216431644164516461647164816491650165116521653165416551656165716581659166016611662166316641665166616671668166916701671167216731674167516761677167816791680168116821683168416851686168716881689169016911692169316941695169616971698169917001701170217031704170517061707170817091710171117121713171417151716171717181719172017211722172317241725172617271728172917301731173217331734173517361737173817391740174117421743174417451746174717481749175017511752175317541755175617571758175917601761176217631764176517661767176817691770177117721773177417751776177717781779178017811782178317841785178617871788178917901791179217931794179517961797179817991800180118021803180418051806180718081809181018111812181318141815181618171818181918201821182218231824182518261827182818291830183118321833183418351836183718381839184018411842184318441845184618471848184918501851185218531854185518561857185818591860186118621863186418651866186718681869187018711872187318741875187618771878187918801881188218831884188518861887188818891890189118921893189418951896189718981899190019011902190319041905190619071908190919101911191219131914191519161917191819191920192119221923192419251926192719281929193019311932193319341935193619371938193919401941194219431944194519461947194819491950195119521953195419551956195719581959196019611962196319641965196619671968196919701971197219731974197519761977197819791980198119821983198419851986198719881989199019911992199319941995199619971998199920002001200220032004200520062007200820092010201120122013201420152016201720182019202020212022202320242025202620272028202920302031203220332034203520362037203820392040204120422043204420452046204720482049205020512052205320542055205620572058205920602061206220632064206520662067206820692070207120722073207420752076207720782079208020812082208320842085208620872088208920902091209220932094209520962097209820992100210121022103210421052106210721082109211021112112211321142115211621172118211921202121212221232124212521262127212821292130213121322133213421352136213721382139214021412142214321442145214621472148214921502151215221532154215521562157215821592160216121622163216421652166216721682169217021712172217321742175217621772178217921802181218221832184218521862187218821892190219121922193219421952196219721982199220022012202220322042205220622072208220922102211221222132214221522162217221822192220222122222223222422252226222722282229223022312232223322342235223622372238223922402241224222432244224522462247224822492250225122522253225422552256225722582259226022612262226322642265226622672268226922702271227222732274227522762277227822792280228122822283228422852286228722882289229022912292229322942295229622972298229923002301230223032304230523062307230823092310231123122313231423152316231723182319232023212322232323242325232623272328232923302331233223332334233523362337233823392340234123422343234423452346234723482349235023512352235323542355235623572358235923602361236223632364236523662367236823692370237123722373237423752376237723782379238023812382238323842385238623872388238923902391239223932394239523962397239823992400240124022403240424052406240724082409241024112412241324142415241624172418241924202421242224232424242524262427242824292430243124322433243424352436243724382439244024412442244324442445244624472448244924502451245224532454245524562457245824592460246124622463246424652466246724682469247024712472247324742475247624772478247924802481248224832484248524862487248824892490249124922493249424952496249724982499250025012502250325042505250625072508250925102511251225132514251525162517251825192520252125222523252425252526252725282529253025312532253325342535253625372538253925402541254225432544254525462547254825492550255125522553255425552556255725582559256025612562256325642565256625672568256925702571257225732574257525762577257825792580258125822583258425852586258725882589259025912592259325942595259625972598259926002601260226032604260526062607260826092610261126122613261426152616261726182619262026212622262326242625262626272628262926302631263226332634263526362637263826392640264126422643264426452646264726482649265026512652265326542655265626572658265926602661266226632664266526662667266826692670267126722673267426752676267726782679268026812682268326842685268626872688268926902691269226932694269526962697269826992700270127022703270427052706270727082709271027112712271327142715271627172718271927202721272227232724272527262727272827292730273127322733273427352736273727382739274027412742274327442745274627472748274927502751275227532754275527562757275827592760276127622763276427652766276727682769277027712772277327742775277627772778277927802781278227832784278527862787278827892790279127922793279427952796279727982799280028012802280328042805280628072808280928102811281228132814281528162817281828192820282128222823282428252826282728282829283028312832283328342835283628372838283928402841284228432844284528462847284828492850285128522853285428552856285728582859286028612862286328642865286628672868286928702871287228732874287528762877287828792880288128822883288428852886288728882889289028912892289328942895289628972898289929002901290229032904290529062907290829092910291129122913291429152916291729182919292029212922292329242925292629272928292929302931293229332934293529362937293829392940294129422943294429452946294729482949295029512952295329542955295629572958295929602961296229632964296529662967296829692970297129722973297429752976297729782979298029812982298329842985298629872988298929902991299229932994299529962997299829993000300130023003300430053006300730083009301030113012301330143015301630173018301930203021302230233024302530263027302830293030303130323033303430353036303730383039304030413042304330443045304630473048304930503051305230533054305530563057305830593060306130623063306430653066306730683069307030713072307330743075307630773078307930803081308230833084308530863087308830893090309130923093309430953096309730983099310031013102310331043105310631073108310931103111311231133114311531163117311831193120312131223123312431253126312731283129313031313132313331343135313631373138313931403141314231433144314531463147314831493150315131523153315431553156315731583159316031613162316331643165316631673168316931703171317231733174317531763177317831793180318131823183318431853186318731883189319031913192319331943195319631973198319932003201320232033204320532063207320832093210321132123213321432153216321732183219322032213222322332243225322632273228322932303231323232333234323532363237323832393240324132423243324432453246324732483249325032513252325332543255325632573258325932603261326232633264326532663267326832693270327132723273327432753276327732783279328032813282328332843285328632873288328932903291329232933294329532963297329832993300330133023303330433053306330733083309331033113312331333143315331633173318331933203321332233233324332533263327332833293330333133323333333433353336333733383339334033413342334333443345334633473348334933503351335233533354335533563357335833593360336133623363336433653366336733683369337033713372337333743375337633773378337933803381338233833384338533863387338833893390339133923393339433953396339733983399340034013402340334043405340634073408340934103411341234133414341534163417341834193420342134223423342434253426342734283429343034313432343334343435343634373438343934403441344234433444344534463447344834493450345134523453345434553456345734583459346034613462346334643465346634673468346934703471347234733474347534763477347834793480348134823483348434853486348734883489349034913492349334943495349634973498349935003501350235033504350535063507350835093510351135123513351435153516351735183519352035213522352335243525352635273528352935303531353235333534353535363537353835393540354135423543354435453546354735483549355035513552355335543555355635573558355935603561356235633564356535663567356835693570357135723573357435753576357735783579358035813582358335843585358635873588358935903591359235933594359535963597359835993600360136023603360436053606360736083609361036113612361336143615361636173618361936203621362236233624362536263627362836293630363136323633363436353636363736383639364036413642364336443645364636473648364936503651365236533654365536563657365836593660366136623663366436653666366736683669367036713672367336743675367636773678367936803681368236833684368536863687368836893690369136923693369436953696369736983699370037013702370337043705370637073708370937103711371237133714371537163717371837193720372137223723372437253726372737283729373037313732373337343735373637373738373937403741374237433744374537463747374837493750375137523753375437553756375737583759376037613762376337643765376637673768376937703771377237733774377537763777377837793780378137823783378437853786378737883789379037913792379337943795379637973798379938003801380238033804380538063807380838093810381138123813381438153816381738183819382038213822382338243825382638273828382938303831383238333834383538363837383838393840384138423843384438453846384738483849385038513852385338543855385638573858385938603861386238633864386538663867386838693870387138723873387438753876387738783879388038813882388338843885388638873888388938903891389238933894389538963897389838993900390139023903390439053906390739083909391039113912391339143915391639173918391939203921392239233924392539263927392839293930393139323933393439353936393739383939394039413942394339443945394639473948394939503951395239533954395539563957395839593960396139623963396439653966396739683969397039713972397339743975397639773978397939803981398239833984398539863987398839893990399139923993399439953996399739983999400040014002400340044005400640074008400940104011401240134014401540164017401840194020402140224023402440254026402740284029403040314032403340344035403640374038403940404041404240434044404540464047404840494050405140524053405440554056405740584059406040614062406340644065406640674068406940704071407240734074407540764077407840794080408140824083408440854086408740884089409040914092409340944095409640974098409941004101410241034104410541064107410841094110411141124113411441154116411741184119412041214122412341244125412641274128412941304131413241334134413541364137413841394140414141424143414441454146414741484149415041514152415341544155415641574158415941604161416241634164416541664167416841694170417141724173417441754176417741784179418041814182418341844185418641874188418941904191419241934194419541964197419841994200420142024203420442054206420742084209421042114212421342144215421642174218421942204221422242234224422542264227422842294230423142324233423442354236423742384239424042414242424342444245424642474248424942504251425242534254425542564257425842594260426142624263426442654266426742684269427042714272427342744275427642774278427942804281428242834284428542864287428842894290429142924293429442954296429742984299430043014302430343044305430643074308430943104311431243134314431543164317431843194320432143224323432443254326432743284329433043314332433343344335433643374338433943404341434243434344434543464347434843494350435143524353435443554356435743584359436043614362436343644365436643674368436943704371437243734374437543764377437843794380438143824383438443854386438743884389439043914392439343944395439643974398439944004401440244034404440544064407440844094410441144124413441444154416441744184419442044214422442344244425442644274428442944304431443244334434443544364437443844394440444144424443444444454446444744484449445044514452445344544455445644574458445944604461446244634464446544664467446844694470447144724473447444754476447744784479448044814482448344844485448644874488448944904491449244934494449544964497449844994500450145024503450445054506450745084509451045114512451345144515451645174518451945204521452245234524452545264527452845294530453145324533453445354536453745384539454045414542454345444545454645474548454945504551455245534554455545564557455845594560456145624563456445654566456745684569457045714572457345744575457645774578457945804581458245834584458545864587458845894590459145924593459445954596459745984599460046014602460346044605460646074608460946104611461246134614461546164617461846194620462146224623462446254626462746284629463046314632463346344635463646374638463946404641464246434644464546464647464846494650465146524653465446554656465746584659466046614662466346644665466646674668466946704671467246734674467546764677467846794680468146824683468446854686468746884689469046914692469346944695469646974698469947004701470247034704470547064707470847094710471147124713471447154716471747184719472047214722472347244725472647274728472947304731473247334734473547364737473847394740474147424743474447454746474747484749475047514752475347544755475647574758475947604761476247634764476547664767476847694770477147724773477447754776477747784779478047814782478347844785478647874788478947904791479247934794479547964797479847994800480148024803480448054806480748084809481048114812481348144815481648174818481948204821482248234824482548264827482848294830483148324833483448354836483748384839484048414842484348444845484648474848484948504851485248534854485548564857485848594860486148624863486448654866486748684869487048714872487348744875487648774878487948804881488248834884488548864887488848894890489148924893489448954896489748984899490049014902490349044905490649074908490949104911491249134914491549164917491849194920492149224923492449254926492749284929493049314932493349344935493649374938493949404941494249434944494549464947494849494950495149524953495449554956495749584959496049614962496349644965496649674968496949704971497249734974497549764977497849794980498149824983498449854986498749884989499049914992499349944995499649974998499950005001500250035004500550065007500850095010501150125013501450155016501750185019502050215022502350245025502650275028502950305031503250335034503550365037503850395040504150425043504450455046504750485049505050515052505350545055505650575058505950605061506250635064506550665067506850695070507150725073507450755076507750785079508050815082508350845085508650875088508950905091509250935094509550965097509850995100510151025103510451055106510751085109511051115112511351145115511651175118511951205121512251235124512551265127512851295130513151325133513451355136513751385139514051415142514351445145514651475148514951505151515251535154515551565157515851595160516151625163516451655166516751685169517051715172517351745175517651775178517951805181518251835184518551865187518851895190519151925193519451955196519751985199520052015202520352045205520652075208520952105211521252135214521552165217521852195220522152225223522452255226522752285229523052315232523352345235523652375238523952405241524252435244524552465247524852495250525152525253525452555256525752585259526052615262526352645265526652675268526952705271527252735274527552765277527852795280528152825283528452855286528752885289529052915292529352945295529652975298529953005301530253035304530553065307530853095310531153125313531453155316531753185319532053215322532353245325532653275328532953305331533253335334533553365337533853395340534153425343534453455346534753485349535053515352535353545355535653575358535953605361536253635364536553665367536853695370537153725373537453755376537753785379538053815382538353845385538653875388538953905391539253935394539553965397539853995400540154025403540454055406540754085409541054115412541354145415541654175418541954205421542254235424542554265427542854295430543154325433543454355436543754385439544054415442544354445445544654475448544954505451545254535454545554565457545854595460546154625463546454655466546754685469547054715472547354745475547654775478547954805481548254835484548554865487548854895490549154925493549454955496549754985499550055015502550355045505550655075508550955105511551255135514551555165517551855195520552155225523552455255526552755285529553055315532553355345535553655375538553955405541554255435544554555465547554855495550555155525553555455555556555755585559556055615562556355645565556655675568556955705571557255735574557555765577557855795580558155825583558455855586558755885589559055915592559355945595559655975598559956005601560256035604560556065607560856095610561156125613561456155616561756185619562056215622562356245625562656275628562956305631563256335634563556365637563856395640564156425643564456455646564756485649565056515652565356545655565656575658565956605661566256635664566556665667566856695670567156725673567456755676567756785679568056815682568356845685568656875688568956905691569256935694569556965697569856995700570157025703570457055706570757085709571057115712571357145715571657175718571957205721572257235724572557265727572857295730573157325733573457355736573757385739574057415742574357445745574657475748574957505751575257535754575557565757575857595760576157625763576457655766576757685769577057715772577357745775577657775778577957805781578257835784578557865787578857895790579157925793579457955796579757985799580058015802580358045805580658075808580958105811581258135814581558165817581858195820582158225823582458255826582758285829583058315832583358345835583658375838583958405841584258435844584558465847584858495850585158525853585458555856585758585859586058615862586358645865586658675868586958705871587258735874587558765877587858795880588158825883588458855886588758885889589058915892589358945895589658975898589959005901590259035904590559065907590859095910591159125913591459155916591759185919592059215922592359245925592659275928592959305931593259335934593559365937593859395940594159425943594459455946594759485949595059515952595359545955595659575958595959605961596259635964596559665967596859695970597159725973597459755976597759785979598059815982598359845985598659875988598959905991599259935994599559965997599859996000600160026003600460056006600760086009601060116012601360146015601660176018601960206021602260236024602560266027602860296030603160326033603460356036603760386039604060416042604360446045604660476048604960506051605260536054605560566057605860596060606160626063606460656066606760686069607060716072607360746075607660776078607960806081608260836084608560866087608860896090609160926093609460956096609760986099610061016102610361046105610661076108610961106111611261136114611561166117611861196120612161226123612461256126612761286129613061316132613361346135613661376138613961406141614261436144614561466147614861496150615161526153615461556156615761586159616061616162616361646165616661676168616961706171617261736174617561766177617861796180618161826183618461856186618761886189619061916192619361946195619661976198619962006201620262036204620562066207620862096210621162126213621462156216621762186219622062216222622362246225622662276228622962306231623262336234623562366237623862396240624162426243624462456246624762486249625062516252625362546255625662576258625962606261626262636264626562666267626862696270627162726273627462756276627762786279628062816282628362846285628662876288628962906291629262936294629562966297629862996300630163026303630463056306630763086309631063116312631363146315631663176318631963206321632263236324632563266327632863296330633163326333633463356336633763386339634063416342634363446345634663476348634963506351635263536354635563566357635863596360636163626363636463656366636763686369637063716372637363746375637663776378637963806381638263836384638563866387638863896390639163926393639463956396639763986399640064016402640364046405640664076408640964106411641264136414641564166417641864196420642164226423642464256426642764286429643064316432643364346435643664376438643964406441644264436444644564466447644864496450645164526453645464556456645764586459646064616462646364646465646664676468646964706471647264736474647564766477647864796480648164826483648464856486648764886489649064916492649364946495649664976498649965006501650265036504650565066507650865096510651165126513651465156516651765186519652065216522652365246525652665276528652965306531653265336534653565366537653865396540654165426543654465456546654765486549655065516552655365546555655665576558655965606561656265636564656565666567656865696570657165726573657465756576657765786579658065816582658365846585658665876588658965906591659265936594659565966597659865996600660166026603660466056606660766086609661066116612661366146615661666176618661966206621662266236624662566266627662866296630663166326633663466356636663766386639664066416642664366446645664666476648664966506651665266536654665566566657665866596660666166626663666466656666666766686669667066716672667366746675667666776678667966806681668266836684668566866687668866896690669166926693669466956696669766986699670067016702670367046705670667076708670967106711671267136714671567166717671867196720672167226723672467256726672767286729673067316732673367346735673667376738673967406741674267436744674567466747674867496750675167526753675467556756675767586759676067616762676367646765676667676768676967706771677267736774677567766777677867796780678167826783678467856786678767886789679067916792679367946795679667976798679968006801680268036804680568066807680868096810681168126813681468156816681768186819682068216822682368246825682668276828682968306831683268336834683568366837683868396840684168426843684468456846684768486849685068516852685368546855685668576858685968606861686268636864686568666867686868696870687168726873687468756876687768786879688068816882688368846885688668876888688968906891689268936894689568966897689868996900690169026903690469056906690769086909691069116912691369146915691669176918691969206921692269236924692569266927692869296930693169326933693469356936693769386939694069416942694369446945694669476948694969506951695269536954695569566957695869596960696169626963696469656966696769686969697069716972697369746975697669776978697969806981698269836984698569866987698869896990699169926993699469956996699769986999700070017002700370047005700670077008700970107011701270137014701570167017701870197020702170227023702470257026702770287029703070317032703370347035703670377038703970407041704270437044704570467047704870497050705170527053705470557056705770587059706070617062706370647065706670677068706970707071707270737074707570767077707870797080708170827083708470857086708770887089709070917092709370947095709670977098709971007101710271037104710571067107710871097110711171127113711471157116711771187119712071217122712371247125712671277128712971307131713271337134713571367137713871397140714171427143714471457146714771487149715071517152715371547155715671577158715971607161716271637164716571667167716871697170717171727173717471757176717771787179718071817182718371847185718671877188718971907191719271937194719571967197719871997200720172027203720472057206720772087209721072117212721372147215721672177218721972207221722272237224722572267227722872297230723172327233723472357236723772387239724072417242724372447245724672477248724972507251725272537254725572567257725872597260726172627263726472657266726772687269727072717272727372747275727672777278727972807281728272837284728572867287728872897290729172927293729472957296729772987299730073017302730373047305730673077308730973107311731273137314731573167317731873197320732173227323732473257326732773287329733073317332733373347335733673377338733973407341734273437344734573467347734873497350735173527353735473557356735773587359736073617362736373647365736673677368736973707371737273737374737573767377737873797380738173827383738473857386738773887389739073917392739373947395739673977398739974007401740274037404740574067407740874097410741174127413741474157416741774187419742074217422742374247425742674277428742974307431743274337434743574367437743874397440744174427443744474457446744774487449745074517452745374547455745674577458745974607461746274637464746574667467746874697470747174727473747474757476747774787479748074817482748374847485748674877488748974907491749274937494749574967497749874997500750175027503750475057506750775087509751075117512751375147515751675177518751975207521752275237524752575267527752875297530753175327533753475357536753775387539754075417542754375447545754675477548754975507551755275537554755575567557755875597560756175627563756475657566756775687569757075717572757375747575757675777578757975807581758275837584758575867587758875897590759175927593759475957596759775987599760076017602760376047605760676077608760976107611761276137614761576167617761876197620762176227623762476257626762776287629763076317632763376347635763676377638763976407641764276437644764576467647764876497650765176527653765476557656765776587659766076617662766376647665766676677668766976707671767276737674767576767677767876797680768176827683768476857686768776887689769076917692769376947695769676977698769977007701770277037704770577067707770877097710771177127713771477157716771777187719772077217722772377247725772677277728772977307731773277337734773577367737773877397740774177427743774477457746774777487749775077517752775377547755775677577758775977607761776277637764776577667767776877697770777177727773777477757776777777787779778077817782778377847785778677877788778977907791779277937794779577967797779877997800780178027803780478057806780778087809781078117812781378147815781678177818781978207821782278237824782578267827782878297830783178327833783478357836783778387839784078417842784378447845784678477848784978507851785278537854785578567857785878597860786178627863786478657866786778687869787078717872787378747875787678777878787978807881788278837884788578867887788878897890789178927893789478957896789778987899790079017902790379047905790679077908790979107911791279137914791579167917791879197920792179227923792479257926792779287929793079317932793379347935793679377938793979407941794279437944794579467947794879497950795179527953795479557956795779587959796079617962796379647965796679677968796979707971797279737974797579767977797879797980798179827983798479857986798779887989799079917992799379947995799679977998799980008001800280038004800580068007800880098010801180128013801480158016801780188019802080218022802380248025802680278028802980308031803280338034803580368037803880398040804180428043804480458046804780488049805080518052805380548055805680578058805980608061806280638064806580668067806880698070807180728073807480758076807780788079808080818082808380848085808680878088808980908091809280938094809580968097809880998100810181028103810481058106810781088109811081118112811381148115811681178118811981208121812281238124812581268127812881298130813181328133813481358136813781388139814081418142814381448145814681478148814981508151815281538154815581568157815881598160816181628163816481658166816781688169817081718172817381748175817681778178817981808181818281838184818581868187818881898190819181928193819481958196819781988199820082018202820382048205820682078208820982108211821282138214821582168217821882198220822182228223822482258226822782288229823082318232823382348235823682378238823982408241824282438244824582468247824882498250825182528253825482558256825782588259826082618262826382648265826682678268826982708271827282738274827582768277827882798280828182828283828482858286828782888289829082918292829382948295829682978298829983008301830283038304830583068307830883098310831183128313831483158316831783188319832083218322832383248325832683278328832983308331833283338334833583368337833883398340834183428343834483458346834783488349835083518352835383548355835683578358835983608361836283638364836583668367836883698370837183728373837483758376837783788379838083818382838383848385838683878388838983908391839283938394839583968397839883998400840184028403840484058406840784088409841084118412841384148415841684178418841984208421842284238424842584268427842884298430843184328433843484358436843784388439844084418442844384448445844684478448844984508451845284538454845584568457845884598460846184628463846484658466846784688469847084718472847384748475847684778478847984808481848284838484848584868487848884898490849184928493849484958496849784988499850085018502850385048505850685078508850985108511851285138514851585168517851885198520852185228523852485258526852785288529853085318532853385348535853685378538853985408541854285438544854585468547854885498550855185528553855485558556855785588559856085618562856385648565856685678568856985708571857285738574857585768577857885798580858185828583858485858586858785888589859085918592859385948595859685978598859986008601860286038604860586068607860886098610861186128613861486158616861786188619862086218622862386248625862686278628862986308631863286338634863586368637863886398640864186428643864486458646864786488649865086518652865386548655865686578658865986608661866286638664866586668667866886698670867186728673867486758676867786788679868086818682868386848685868686878688868986908691869286938694869586968697869886998700870187028703870487058706870787088709871087118712871387148715871687178718871987208721872287238724872587268727872887298730873187328733873487358736873787388739874087418742874387448745874687478748874987508751875287538754875587568757875887598760876187628763876487658766876787688769877087718772877387748775877687778778877987808781878287838784878587868787878887898790879187928793879487958796879787988799880088018802880388048805880688078808880988108811881288138814881588168817881888198820882188228823882488258826882788288829883088318832883388348835883688378838883988408841884288438844884588468847884888498850885188528853885488558856885788588859886088618862886388648865886688678868886988708871887288738874887588768877887888798880888188828883888488858886888788888889889088918892889388948895889688978898889989008901890289038904890589068907890889098910891189128913891489158916891789188919892089218922892389248925892689278928892989308931893289338934893589368937893889398940894189428943894489458946894789488949895089518952895389548955895689578958895989608961896289638964896589668967896889698970897189728973897489758976897789788979898089818982898389848985898689878988898989908991899289938994899589968997899889999000900190029003900490059006900790089009901090119012901390149015901690179018901990209021902290239024902590269027902890299030903190329033903490359036903790389039904090419042904390449045904690479048904990509051905290539054905590569057905890599060906190629063906490659066906790689069907090719072907390749075907690779078907990809081908290839084908590869087908890899090909190929093909490959096909790989099910091019102910391049105910691079108910991109111911291139114911591169117911891199120912191229123912491259126912791289129913091319132913391349135913691379138913991409141914291439144914591469147914891499150915191529153915491559156915791589159916091619162916391649165916691679168916991709171917291739174917591769177917891799180918191829183918491859186918791889189919091919192919391949195919691979198919992009201920292039204920592069207920892099210921192129213921492159216921792189219922092219222922392249225922692279228922992309231923292339234923592369237923892399240924192429243924492459246924792489249925092519252925392549255925692579258925992609261926292639264926592669267926892699270927192729273927492759276927792789279928092819282928392849285928692879288928992909291929292939294929592969297929892999300930193029303930493059306930793089309931093119312931393149315931693179318931993209321932293239324932593269327932893299330933193329333933493359336933793389339934093419342934393449345934693479348934993509351935293539354935593569357935893599360936193629363936493659366936793689369937093719372937393749375937693779378937993809381938293839384938593869387938893899390939193929393939493959396939793989399940094019402940394049405940694079408940994109411941294139414941594169417941894199420942194229423942494259426942794289429943094319432943394349435943694379438943994409441944294439444944594469447944894499450945194529453945494559456945794589459946094619462946394649465946694679468946994709471947294739474947594769477947894799480948194829483948494859486948794889489949094919492949394949495949694979498949995009501950295039504950595069507950895099510951195129513951495159516951795189519952095219522952395249525952695279528952995309531953295339534953595369537953895399540954195429543954495459546954795489549955095519552955395549555955695579558955995609561956295639564956595669567956895699570957195729573957495759576957795789579958095819582958395849585958695879588958995909591959295939594959595969597959895999600960196029603960496059606960796089609961096119612961396149615961696179618961996209621962296239624962596269627962896299630963196329633963496359636963796389639964096419642964396449645964696479648964996509651965296539654965596569657965896599660966196629663966496659666966796689669967096719672967396749675967696779678967996809681968296839684968596869687968896899690969196929693969496959696969796989699970097019702970397049705970697079708970997109711971297139714971597169717971897199720972197229723972497259726972797289729973097319732973397349735973697379738973997409741974297439744974597469747974897499750975197529753975497559756975797589759976097619762976397649765976697679768976997709771977297739774977597769777977897799780978197829783978497859786978797889789979097919792979397949795979697979798979998009801980298039804980598069807980898099810981198129813981498159816981798189819982098219822982398249825982698279828982998309831983298339834983598369837983898399840984198429843984498459846984798489849985098519852985398549855985698579858985998609861986298639864986598669867986898699870987198729873987498759876987798789879988098819882988398849885988698879888988998909891989298939894989598969897989898999900990199029903990499059906990799089909991099119912991399149915991699179918991999209921992299239924992599269927992899299930993199329933993499359936993799389939994099419942994399449945994699479948994999509951995299539954995599569957995899599960996199629963996499659966996799689969997099719972997399749975997699779978997999809981998299839984998599869987998899899990999199929993999499959996999799989999100001000110002100031000410005100061000710008100091001010011100121001310014100151001610017100181001910020100211002210023100241002510026100271002810029100301003110032100331003410035100361003710038100391004010041100421004310044100451004610047100481004910050100511005210053100541005510056100571005810059100601006110062100631006410065100661006710068100691007010071100721007310074100751007610077100781007910080100811008210083100841008510086100871008810089100901009110092100931009410095100961009710098100991010010101101021010310104101051010610107101081010910110101111011210113101141011510116101171011810119101201012110122101231012410125101261012710128101291013010131101321013310134101351013610137101381013910140101411014210143101441014510146101471014810149101501015110152101531015410155101561015710158101591016010161101621016310164101651016610167101681016910170101711017210173101741017510176101771017810179101801018110182101831018410185101861018710188101891019010191101921019310194101951019610197101981019910200102011020210203102041020510206102071020810209102101021110212102131021410215102161021710218102191022010221102221022310224102251022610227102281022910230102311023210233102341023510236102371023810239102401024110242102431024410245102461024710248102491025010251102521025310254102551025610257102581025910260102611026210263102641026510266102671026810269102701027110272102731027410275102761027710278102791028010281102821028310284102851028610287102881028910290102911029210293102941029510296102971029810299103001030110302103031030410305103061030710308103091031010311103121031310314103151031610317103181031910320103211032210323103241032510326103271032810329103301033110332103331033410335103361033710338103391034010341103421034310344103451034610347103481034910350103511035210353103541035510356103571035810359103601036110362103631036410365103661036710368103691037010371103721037310374103751037610377103781037910380103811038210383103841038510386103871038810389103901039110392103931039410395103961039710398103991040010401104021040310404104051040610407104081040910410104111041210413104141041510416104171041810419104201042110422104231042410425104261042710428104291043010431104321043310434104351043610437104381043910440104411044210443104441044510446104471044810449104501045110452104531045410455104561045710458104591046010461104621046310464104651046610467104681046910470104711047210473104741047510476104771047810479104801048110482104831048410485104861048710488104891049010491104921049310494104951049610497104981049910500105011050210503105041050510506105071050810509105101051110512105131051410515105161051710518105191052010521105221052310524105251052610527105281052910530105311053210533105341053510536105371053810539105401054110542105431054410545105461054710548105491055010551105521055310554105551055610557105581055910560105611056210563105641056510566105671056810569105701057110572105731057410575105761057710578105791058010581105821058310584105851058610587105881058910590105911059210593105941059510596105971059810599106001060110602106031060410605106061060710608106091061010611106121061310614106151061610617106181061910620106211062210623106241062510626106271062810629106301063110632106331063410635106361063710638106391064010641106421064310644106451064610647106481064910650106511065210653106541065510656106571065810659106601066110662106631066410665106661066710668106691067010671106721067310674106751067610677106781067910680106811068210683106841068510686106871068810689106901069110692106931069410695106961069710698106991070010701107021070310704107051070610707107081070910710107111071210713107141071510716107171071810719107201072110722107231072410725107261072710728107291073010731107321073310734107351073610737107381073910740107411074210743107441074510746107471074810749107501075110752107531075410755107561075710758107591076010761107621076310764107651076610767107681076910770107711077210773107741077510776107771077810779107801078110782107831078410785107861078710788107891079010791107921079310794107951079610797107981079910800108011080210803108041080510806108071080810809108101081110812108131081410815108161081710818108191082010821108221082310824108251082610827108281082910830108311083210833108341083510836108371083810839108401084110842108431084410845108461084710848108491085010851108521085310854108551085610857108581085910860108611086210863108641086510866108671086810869108701087110872108731087410875108761087710878108791088010881108821088310884108851088610887108881088910890108911089210893108941089510896108971089810899109001090110902109031090410905109061090710908109091091010911109121091310914109151091610917109181091910920109211092210923109241092510926109271092810929109301093110932109331093410935109361093710938109391094010941109421094310944109451094610947109481094910950109511095210953109541095510956109571095810959109601096110962109631096410965109661096710968109691097010971109721097310974109751097610977109781097910980109811098210983109841098510986109871098810989109901099110992109931099410995109961099710998109991100011001110021100311004110051100611007110081100911010110111101211013110141101511016110171101811019110201102111022110231102411025110261102711028110291103011031110321103311034110351103611037110381103911040110411104211043110441104511046110471104811049110501105111052110531105411055110561105711058110591106011061110621106311064110651106611067110681106911070110711107211073110741107511076110771107811079110801108111082110831108411085110861108711088110891109011091110921109311094110951109611097110981109911100111011110211103111041110511106111071110811109111101111111112111131111411115111161111711118111191112011121111221112311124111251112611127111281112911130111311113211133111341113511136111371113811139111401114111142111431114411145111461114711148111491115011151111521115311154111551115611157111581115911160111611116211163111641116511166111671116811169111701117111172111731117411175111761117711178111791118011181111821118311184111851118611187111881118911190111911119211193111941119511196111971119811199112001120111202112031120411205112061120711208112091121011211112121121311214112151121611217112181121911220112211122211223112241122511226112271122811229112301123111232112331123411235112361123711238112391124011241112421124311244112451124611247112481124911250112511125211253112541125511256112571125811259112601126111262112631126411265112661126711268112691127011271112721127311274112751127611277112781127911280112811128211283112841128511286112871128811289112901129111292112931129411295112961129711298112991130011301113021130311304113051130611307113081130911310113111131211313113141131511316113171131811319113201132111322113231132411325113261132711328113291133011331113321133311334113351133611337113381133911340113411134211343113441134511346113471134811349113501135111352113531135411355113561135711358113591136011361113621136311364113651136611367113681136911370113711137211373113741137511376113771137811379113801138111382113831138411385113861138711388113891139011391113921139311394113951139611397113981139911400114011140211403114041140511406114071140811409114101141111412114131141411415114161141711418114191142011421114221142311424114251142611427114281142911430114311143211433114341143511436114371143811439114401144111442114431144411445114461144711448114491145011451114521145311454114551145611457114581145911460114611146211463114641146511466114671146811469114701147111472114731147411475114761147711478114791148011481114821148311484114851148611487114881148911490114911149211493114941149511496114971149811499115001150111502115031150411505115061150711508115091151011511115121151311514115151151611517115181151911520115211152211523115241152511526115271152811529115301153111532115331153411535115361153711538115391154011541115421154311544115451154611547115481154911550115511155211553115541155511556115571155811559115601156111562115631156411565115661156711568115691157011571115721157311574115751157611577115781157911580115811158211583115841158511586115871158811589115901159111592115931159411595115961159711598115991160011601116021160311604116051160611607116081160911610116111161211613116141161511616116171161811619116201162111622116231162411625116261162711628116291163011631116321163311634116351163611637116381163911640116411164211643116441164511646116471164811649116501165111652116531165411655116561165711658116591166011661116621166311664116651166611667116681166911670116711167211673116741167511676116771167811679116801168111682116831168411685116861168711688116891169011691116921169311694116951169611697116981169911700117011170211703117041170511706117071170811709117101171111712117131171411715117161171711718117191172011721117221172311724117251172611727117281172911730117311173211733117341173511736117371173811739117401174111742117431174411745117461174711748117491175011751117521175311754117551175611757117581175911760117611176211763117641176511766117671176811769117701177111772117731177411775117761177711778117791178011781117821178311784117851178611787117881178911790117911179211793117941179511796117971179811799118001180111802118031180411805118061180711808118091181011811118121181311814118151181611817118181181911820118211182211823118241182511826118271182811829118301183111832118331183411835118361183711838118391184011841118421184311844118451184611847118481184911850118511185211853118541185511856118571185811859118601186111862118631186411865118661186711868118691187011871118721187311874118751187611877118781187911880118811188211883118841188511886118871188811889118901189111892118931189411895118961189711898118991190011901119021190311904119051190611907119081190911910119111191211913119141191511916119171191811919119201192111922119231192411925119261192711928119291193011931119321193311934119351193611937119381193911940119411194211943119441194511946119471194811949119501195111952119531195411955119561195711958119591196011961119621196311964119651196611967119681196911970119711197211973119741197511976119771197811979119801198111982119831198411985119861198711988119891199011991119921199311994119951199611997119981199912000120011200212003120041200512006120071200812009120101201112012120131201412015120161201712018120191202012021120221202312024120251202612027120281202912030120311203212033120341203512036120371203812039120401204112042120431204412045120461204712048120491205012051120521205312054120551205612057120581205912060120611206212063120641206512066120671206812069120701207112072120731207412075120761207712078120791208012081120821208312084120851208612087120881208912090120911209212093120941209512096120971209812099121001210112102121031210412105121061210712108121091211012111121121211312114121151211612117121181211912120121211212212123121241212512126121271212812129121301213112132121331213412135121361213712138121391214012141121421214312144121451214612147121481214912150121511215212153121541215512156121571215812159121601216112162121631216412165121661216712168121691217012171121721217312174121751217612177121781217912180121811218212183121841218512186121871218812189121901219112192121931219412195121961219712198121991220012201122021220312204122051220612207122081220912210122111221212213122141221512216122171221812219122201222112222122231222412225122261222712228122291223012231122321223312234122351223612237122381223912240122411224212243122441224512246122471224812249122501225112252122531225412255122561225712258122591226012261122621226312264122651226612267122681226912270122711227212273122741227512276122771227812279122801228112282122831228412285122861228712288122891229012291122921229312294122951229612297122981229912300123011230212303123041230512306123071230812309123101231112312123131231412315123161231712318123191232012321123221232312324123251232612327123281232912330123311233212333123341233512336123371233812339123401234112342123431234412345123461234712348123491235012351123521235312354123551235612357123581235912360123611236212363123641236512366123671236812369123701237112372123731237412375123761237712378123791238012381123821238312384123851238612387123881238912390123911239212393123941239512396123971239812399124001240112402124031240412405124061240712408124091241012411124121241312414124151241612417124181241912420124211242212423124241242512426124271242812429124301243112432124331243412435124361243712438124391244012441124421244312444124451244612447124481244912450124511245212453124541245512456124571245812459124601246112462124631246412465124661246712468124691247012471124721247312474124751247612477124781247912480124811248212483124841248512486124871248812489124901249112492124931249412495124961249712498124991250012501125021250312504125051250612507125081250912510125111251212513125141251512516125171251812519125201252112522125231252412525125261252712528125291253012531125321253312534125351253612537125381253912540125411254212543125441254512546125471254812549125501255112552125531255412555125561255712558125591256012561125621256312564125651256612567125681256912570125711257212573125741257512576125771257812579125801258112582125831258412585125861258712588125891259012591125921259312594125951259612597125981259912600126011260212603126041260512606126071260812609126101261112612126131261412615126161261712618126191262012621126221262312624126251262612627126281262912630126311263212633126341263512636126371263812639126401264112642126431264412645126461264712648126491265012651126521265312654126551265612657126581265912660126611266212663126641266512666126671266812669126701267112672126731267412675126761267712678126791268012681126821268312684126851268612687126881268912690126911269212693126941269512696126971269812699127001270112702127031270412705127061270712708127091271012711127121271312714127151271612717127181271912720127211272212723127241272512726127271272812729127301273112732127331273412735127361273712738127391274012741127421274312744127451274612747127481274912750127511275212753127541275512756127571275812759127601276112762127631276412765127661276712768127691277012771127721277312774127751277612777127781277912780127811278212783127841278512786127871278812789127901279112792127931279412795127961279712798127991280012801128021280312804128051280612807128081280912810128111281212813128141281512816128171281812819128201282112822128231282412825128261282712828128291283012831128321283312834128351283612837128381283912840128411284212843128441284512846128471284812849128501285112852128531285412855128561285712858128591286012861128621286312864128651286612867128681286912870128711287212873128741287512876128771287812879128801288112882128831288412885128861288712888128891289012891128921289312894128951289612897128981289912900129011290212903129041290512906129071290812909129101291112912129131291412915129161291712918129191292012921129221292312924129251292612927129281292912930129311293212933129341293512936129371293812939129401294112942129431294412945129461294712948129491295012951129521295312954129551295612957129581295912960129611296212963129641296512966129671296812969129701297112972129731297412975129761297712978129791298012981129821298312984129851298612987129881298912990129911299212993129941299512996129971299812999130001300113002130031300413005130061300713008130091301013011130121301313014130151301613017130181301913020130211302213023130241302513026130271302813029130301303113032130331303413035130361303713038130391304013041130421304313044130451304613047130481304913050130511305213053130541305513056130571305813059130601306113062130631306413065130661306713068130691307013071130721307313074130751307613077130781307913080130811308213083130841308513086130871308813089130901309113092130931309413095130961309713098130991310013101131021310313104131051310613107131081310913110131111311213113131141311513116131171311813119131201312113122131231312413125131261312713128131291313013131131321313313134131351313613137131381313913140131411314213143131441314513146131471314813149131501315113152131531315413155131561315713158131591316013161131621316313164131651316613167131681316913170131711317213173131741317513176131771317813179131801318113182131831318413185131861318713188131891319013191131921319313194131951319613197131981319913200132011320213203132041320513206132071320813209132101321113212132131321413215132161321713218132191322013221132221322313224132251322613227132281322913230132311323213233132341323513236132371323813239132401324113242132431324413245132461324713248132491325013251132521325313254132551325613257132581325913260132611326213263132641326513266132671326813269132701327113272132731327413275132761327713278132791328013281132821328313284132851328613287132881328913290132911329213293132941329513296132971329813299133001330113302133031330413305133061330713308133091331013311133121331313314133151331613317133181331913320133211332213323133241332513326133271332813329133301333113332133331333413335133361333713338133391334013341133421334313344133451334613347133481334913350133511335213353133541335513356133571335813359133601336113362133631336413365133661336713368133691337013371133721337313374133751337613377133781337913380133811338213383133841338513386133871338813389133901339113392133931339413395133961339713398133991340013401134021340313404134051340613407134081340913410134111341213413134141341513416134171341813419134201342113422134231342413425134261342713428134291343013431134321343313434134351343613437134381343913440134411344213443134441344513446134471344813449134501345113452134531345413455134561345713458134591346013461134621346313464134651346613467134681346913470134711347213473134741347513476134771347813479134801348113482134831348413485134861348713488134891349013491134921349313494134951349613497134981349913500135011350213503135041350513506135071350813509135101351113512135131351413515135161351713518135191352013521135221352313524135251352613527135281352913530135311353213533135341353513536135371353813539135401354113542135431354413545135461354713548135491355013551135521355313554135551355613557135581355913560135611356213563135641356513566135671356813569135701357113572135731357413575135761357713578135791358013581135821358313584135851358613587135881358913590135911359213593135941359513596135971359813599136001360113602136031360413605136061360713608136091361013611136121361313614136151361613617136181361913620136211362213623136241362513626136271362813629136301363113632136331363413635136361363713638136391364013641136421364313644136451364613647136481364913650136511365213653136541365513656136571365813659136601366113662136631366413665136661366713668136691367013671136721367313674136751367613677136781367913680136811368213683136841368513686136871368813689136901369113692136931369413695136961369713698136991370013701137021370313704137051370613707137081370913710137111371213713137141371513716137171371813719137201372113722137231372413725137261372713728137291373013731137321373313734137351373613737137381373913740137411374213743137441374513746137471374813749137501375113752137531375413755137561375713758137591376013761137621376313764137651376613767137681376913770137711377213773137741377513776137771377813779137801378113782137831378413785137861378713788137891379013791137921379313794137951379613797137981379913800138011380213803138041380513806138071380813809138101381113812138131381413815138161381713818138191382013821138221382313824138251382613827138281382913830138311383213833138341383513836138371383813839138401384113842138431384413845138461384713848138491385013851138521385313854138551385613857138581385913860138611386213863138641386513866138671386813869138701387113872138731387413875138761387713878138791388013881138821388313884138851388613887138881388913890138911389213893138941389513896138971389813899139001390113902139031390413905139061390713908139091391013911139121391313914139151391613917139181391913920139211392213923139241392513926139271392813929139301393113932139331393413935139361393713938139391394013941139421394313944139451394613947139481394913950139511395213953139541395513956139571395813959139601396113962139631396413965139661396713968139691397013971139721397313974139751397613977139781397913980139811398213983139841398513986139871398813989139901399113992139931399413995139961399713998139991400014001140021400314004140051400614007140081400914010140111401214013140141401514016140171401814019140201402114022140231402414025140261402714028140291403014031140321403314034140351403614037140381403914040140411404214043140441404514046140471404814049140501405114052140531405414055140561405714058140591406014061140621406314064140651406614067140681406914070140711407214073140741407514076140771407814079140801408114082140831408414085140861408714088140891409014091140921409314094140951409614097140981409914100141011410214103141041410514106141071410814109141101411114112141131411414115141161411714118141191412014121141221412314124141251412614127141281412914130141311413214133141341413514136141371413814139141401414114142141431414414145141461414714148141491415014151141521415314154141551415614157141581415914160141611416214163141641416514166141671416814169141701417114172141731417414175141761417714178141791418014181141821418314184141851418614187141881418914190141911419214193141941419514196141971419814199142001420114202142031420414205142061420714208142091421014211142121421314214142151421614217142181421914220142211422214223142241422514226142271422814229142301423114232142331423414235142361423714238142391424014241142421424314244142451424614247142481424914250142511425214253142541425514256142571425814259142601426114262142631426414265142661426714268142691427014271142721427314274142751427614277142781427914280142811428214283142841428514286142871428814289142901429114292142931429414295142961429714298142991430014301143021430314304143051430614307143081430914310143111431214313143141431514316143171431814319143201432114322143231432414325143261432714328143291433014331143321433314334143351433614337143381433914340143411434214343143441434514346143471434814349143501435114352143531435414355143561435714358143591436014361143621436314364143651436614367143681436914370143711437214373143741437514376143771437814379143801438114382143831438414385143861438714388143891439014391143921439314394143951439614397143981439914400144011440214403144041440514406144071440814409144101441114412144131441414415144161441714418144191442014421144221442314424144251442614427144281442914430144311443214433144341443514436144371443814439144401444114442144431444414445144461444714448144491445014451144521445314454144551445614457144581445914460144611446214463144641446514466144671446814469144701447114472144731447414475144761447714478144791448014481144821448314484144851448614487144881448914490144911449214493144941449514496144971449814499145001450114502145031450414505145061450714508145091451014511145121451314514145151451614517145181451914520145211452214523145241452514526145271452814529145301453114532145331453414535145361453714538145391454014541145421454314544145451454614547145481454914550145511455214553145541455514556145571455814559145601456114562145631456414565145661456714568145691457014571145721457314574145751457614577145781457914580145811458214583145841458514586145871458814589145901459114592145931459414595145961459714598145991460014601146021460314604146051460614607146081460914610146111461214613146141461514616146171461814619146201462114622146231462414625146261462714628146291463014631146321463314634146351463614637146381463914640146411464214643146441464514646146471464814649146501465114652146531465414655146561465714658146591466014661146621466314664146651466614667146681466914670146711467214673146741467514676146771467814679146801468114682146831468414685146861468714688146891469014691146921469314694146951469614697146981469914700147011470214703147041470514706147071470814709147101471114712147131471414715147161471714718147191472014721147221472314724147251472614727147281472914730147311473214733147341473514736147371473814739147401474114742147431474414745147461474714748147491475014751147521475314754147551475614757147581475914760147611476214763147641476514766147671476814769147701477114772147731477414775147761477714778147791478014781147821478314784147851478614787147881478914790147911479214793147941479514796147971479814799148001480114802148031480414805148061480714808148091481014811148121481314814148151481614817148181481914820148211482214823148241482514826148271482814829148301483114832148331483414835148361483714838148391484014841148421484314844148451484614847148481484914850148511485214853148541485514856148571485814859148601486114862148631486414865148661486714868148691487014871148721487314874148751487614877148781487914880148811488214883148841488514886148871488814889148901489114892148931489414895148961489714898148991490014901149021490314904149051490614907149081490914910149111491214913149141491514916149171491814919149201492114922149231492414925149261492714928149291493014931149321493314934149351493614937149381493914940149411494214943149441494514946149471494814949149501495114952149531495414955149561495714958149591496014961149621496314964149651496614967149681496914970149711497214973149741497514976149771497814979149801498114982149831498414985149861498714988149891499014991149921499314994149951499614997149981499915000150011500215003150041500515006150071500815009150101501115012150131501415015150161501715018150191502015021150221502315024150251502615027150281502915030150311503215033150341503515036150371503815039150401504115042150431504415045150461504715048150491505015051150521505315054150551505615057150581505915060150611506215063150641506515066150671506815069150701507115072150731507415075150761507715078150791508015081150821508315084150851508615087150881508915090150911509215093150941509515096150971509815099151001510115102151031510415105151061510715108151091511015111151121511315114151151511615117151181511915120151211512215123151241512515126151271512815129151301513115132151331513415135151361513715138151391514015141151421514315144151451514615147151481514915150151511515215153151541515515156151571515815159151601516115162151631516415165151661516715168151691517015171151721517315174151751517615177151781517915180151811518215183151841518515186151871518815189151901519115192151931519415195151961519715198151991520015201152021520315204152051520615207152081520915210152111521215213152141521515216152171521815219152201522115222152231522415225152261522715228152291523015231152321523315234152351523615237152381523915240152411524215243152441524515246152471524815249152501525115252152531525415255152561525715258152591526015261152621526315264152651526615267152681526915270152711527215273152741527515276152771527815279152801528115282152831528415285152861528715288152891529015291152921529315294152951529615297152981529915300153011530215303153041530515306153071530815309153101531115312153131531415315153161531715318153191532015321153221532315324153251532615327153281532915330153311533215333153341533515336153371533815339153401534115342153431534415345153461534715348153491535015351153521535315354153551535615357153581535915360153611536215363153641536515366153671536815369153701537115372153731537415375153761537715378153791538015381153821538315384153851538615387153881538915390153911539215393153941539515396153971539815399154001540115402154031540415405154061540715408154091541015411154121541315414154151541615417154181541915420154211542215423154241542515426154271542815429154301543115432154331543415435154361543715438154391544015441154421544315444154451544615447154481544915450154511545215453154541545515456154571545815459154601546115462154631546415465154661546715468154691547015471154721547315474154751547615477154781547915480154811548215483154841548515486154871548815489154901549115492154931549415495154961549715498154991550015501155021550315504155051550615507155081550915510155111551215513155141551515516155171551815519155201552115522155231552415525155261552715528155291553015531155321553315534155351553615537155381553915540155411554215543155441554515546155471554815549155501555115552155531555415555155561555715558155591556015561155621556315564155651556615567155681556915570155711557215573155741557515576155771557815579155801558115582155831558415585155861558715588155891559015591155921559315594155951559615597155981559915600156011560215603156041560515606156071560815609156101561115612156131561415615156161561715618156191562015621156221562315624156251562615627156281562915630156311563215633156341563515636156371563815639156401564115642156431564415645156461564715648156491565015651156521565315654156551565615657156581565915660156611566215663156641566515666156671566815669156701567115672156731567415675156761567715678156791568015681156821568315684156851568615687156881568915690156911569215693156941569515696156971569815699157001570115702157031570415705157061570715708157091571015711157121571315714157151571615717157181571915720157211572215723157241572515726157271572815729157301573115732157331573415735157361573715738157391574015741157421574315744157451574615747157481574915750157511575215753157541575515756157571575815759157601576115762157631576415765157661576715768157691577015771157721577315774157751577615777157781577915780157811578215783157841578515786157871578815789157901579115792157931579415795157961579715798157991580015801158021580315804158051580615807158081580915810158111581215813158141581515816158171581815819158201582115822158231582415825158261582715828158291583015831158321583315834158351583615837158381583915840158411584215843158441584515846158471584815849158501585115852158531585415855158561585715858158591586015861158621586315864158651586615867158681586915870158711587215873158741587515876158771587815879158801588115882158831588415885158861588715888158891589015891158921589315894158951589615897158981589915900159011590215903159041590515906159071590815909159101591115912159131591415915159161591715918159191592015921159221592315924159251592615927159281592915930159311593215933159341593515936159371593815939159401594115942159431594415945159461594715948159491595015951159521595315954159551595615957159581595915960159611596215963159641596515966159671596815969159701597115972159731597415975159761597715978159791598015981159821598315984159851598615987159881598915990159911599215993159941599515996159971599815999160001600116002160031600416005160061600716008160091601016011160121601316014160151601616017160181601916020160211602216023160241602516026160271602816029160301603116032160331603416035160361603716038160391604016041160421604316044160451604616047160481604916050160511605216053160541605516056160571605816059160601606116062160631606416065160661606716068160691607016071160721607316074160751607616077160781607916080160811608216083160841608516086160871608816089160901609116092160931609416095160961609716098160991610016101161021610316104161051610616107161081610916110161111611216113161141611516116161171611816119161201612116122161231612416125161261612716128161291613016131161321613316134161351613616137161381613916140161411614216143161441614516146161471614816149161501615116152161531615416155161561615716158161591616016161161621616316164161651616616167161681616916170161711617216173161741617516176161771617816179161801618116182161831618416185161861618716188161891619016191161921619316194161951619616197161981619916200162011620216203162041620516206162071620816209162101621116212162131621416215162161621716218162191622016221162221622316224162251622616227162281622916230162311623216233162341623516236162371623816239162401624116242162431624416245162461624716248162491625016251162521625316254162551625616257162581625916260162611626216263162641626516266162671626816269162701627116272162731627416275162761627716278162791628016281162821628316284162851628616287162881628916290162911629216293162941629516296162971629816299163001630116302163031630416305163061630716308163091631016311163121631316314163151631616317163181631916320163211632216323163241632516326163271632816329163301633116332163331633416335163361633716338163391634016341163421634316344163451634616347163481634916350163511635216353163541635516356163571635816359163601636116362163631636416365163661636716368163691637016371163721637316374163751637616377163781637916380163811638216383163841638516386163871638816389163901639116392163931639416395163961639716398163991640016401164021640316404164051640616407164081640916410164111641216413164141641516416164171641816419164201642116422164231642416425164261642716428164291643016431164321643316434164351643616437164381643916440164411644216443164441644516446164471644816449164501645116452164531645416455164561645716458164591646016461164621646316464164651646616467164681646916470164711647216473164741647516476164771647816479164801648116482164831648416485164861648716488164891649016491164921649316494164951649616497164981649916500165011650216503165041650516506165071650816509165101651116512165131651416515165161651716518165191652016521165221652316524165251652616527165281652916530165311653216533165341653516536165371653816539165401654116542165431654416545165461654716548165491655016551165521655316554165551655616557165581655916560165611656216563165641656516566165671656816569165701657116572165731657416575165761657716578165791658016581165821658316584165851658616587165881658916590165911659216593165941659516596165971659816599166001660116602166031660416605166061660716608166091661016611166121661316614166151661616617166181661916620166211662216623166241662516626166271662816629166301663116632166331663416635166361663716638166391664016641166421664316644166451664616647166481664916650166511665216653166541665516656166571665816659166601666116662166631666416665166661666716668166691667016671166721667316674166751667616677166781667916680166811668216683166841668516686166871668816689166901669116692166931669416695166961669716698166991670016701167021670316704167051670616707167081670916710167111671216713167141671516716167171671816719167201672116722167231672416725167261672716728167291673016731167321673316734167351673616737167381673916740167411674216743167441674516746167471674816749167501675116752167531675416755167561675716758167591676016761167621676316764167651676616767167681676916770167711677216773167741677516776167771677816779167801678116782167831678416785167861678716788167891679016791167921679316794167951679616797167981679916800168011680216803168041680516806168071680816809168101681116812168131681416815168161681716818168191682016821168221682316824168251682616827168281682916830168311683216833168341683516836168371683816839168401684116842168431684416845168461684716848168491685016851168521685316854168551685616857168581685916860168611686216863168641686516866168671686816869168701687116872168731687416875168761687716878168791688016881168821688316884168851688616887168881688916890168911689216893168941689516896168971689816899169001690116902169031690416905169061690716908169091691016911169121691316914169151691616917169181691916920169211692216923169241692516926169271692816929169301693116932169331693416935169361693716938169391694016941169421694316944169451694616947169481694916950169511695216953169541695516956169571695816959169601696116962169631696416965169661696716968169691697016971169721697316974169751697616977169781697916980169811698216983169841698516986169871698816989169901699116992169931699416995169961699716998169991700017001170021700317004170051700617007170081700917010170111701217013170141701517016170171701817019170201702117022170231702417025170261702717028170291703017031170321703317034170351703617037170381703917040170411704217043170441704517046170471704817049170501705117052170531705417055170561705717058170591706017061170621706317064170651706617067170681706917070170711707217073170741707517076170771707817079170801708117082170831708417085170861708717088170891709017091170921709317094170951709617097170981709917100171011710217103171041710517106171071710817109171101711117112171131711417115171161711717118171191712017121171221712317124171251712617127171281712917130171311713217133171341713517136171371713817139171401714117142171431714417145171461714717148171491715017151171521715317154171551715617157171581715917160171611716217163171641716517166171671716817169171701717117172171731717417175171761717717178171791718017181171821718317184171851718617187171881718917190171911719217193171941719517196171971719817199172001720117202172031720417205172061720717208172091721017211172121721317214172151721617217172181721917220172211722217223172241722517226172271722817229172301723117232172331723417235172361723717238172391724017241172421724317244172451724617247172481724917250172511725217253172541725517256172571725817259172601726117262172631726417265172661726717268172691727017271172721727317274172751727617277172781727917280172811728217283172841728517286172871728817289172901729117292172931729417295172961729717298172991730017301173021730317304173051730617307173081730917310173111731217313173141731517316173171731817319173201732117322173231732417325173261732717328173291733017331173321733317334173351733617337173381733917340173411734217343173441734517346173471734817349173501735117352173531735417355173561735717358173591736017361173621736317364173651736617367173681736917370173711737217373173741737517376173771737817379173801738117382173831738417385173861738717388173891739017391173921739317394173951739617397173981739917400174011740217403174041740517406174071740817409174101741117412174131741417415174161741717418174191742017421174221742317424174251742617427174281742917430174311743217433174341743517436174371743817439174401744117442174431744417445174461744717448174491745017451174521745317454174551745617457174581745917460174611746217463174641746517466174671746817469174701747117472174731747417475174761747717478174791748017481174821748317484174851748617487174881748917490174911749217493174941749517496174971749817499175001750117502175031750417505175061750717508175091751017511175121751317514175151751617517175181751917520175211752217523175241752517526175271752817529175301753117532175331753417535175361753717538175391754017541175421754317544175451754617547175481754917550175511755217553175541755517556175571755817559175601756117562175631756417565175661756717568175691757017571175721757317574175751757617577175781757917580175811758217583175841758517586175871758817589175901759117592175931759417595175961759717598175991760017601176021760317604176051760617607176081760917610176111761217613176141761517616176171761817619176201762117622176231762417625176261762717628176291763017631176321763317634176351763617637176381763917640176411764217643176441764517646176471764817649176501765117652176531765417655176561765717658176591766017661176621766317664176651766617667176681766917670176711767217673176741767517676176771767817679176801768117682176831768417685176861768717688176891769017691176921769317694176951769617697176981769917700177011770217703177041770517706177071770817709177101771117712177131771417715177161771717718177191772017721177221772317724177251772617727177281772917730177311773217733177341773517736177371773817739177401774117742177431774417745177461774717748177491775017751177521775317754177551775617757177581775917760177611776217763177641776517766177671776817769177701777117772177731777417775177761777717778177791778017781177821778317784177851778617787177881778917790177911779217793177941779517796177971779817799178001780117802178031780417805178061780717808178091781017811178121781317814178151781617817178181781917820178211782217823178241782517826178271782817829178301783117832178331783417835178361783717838178391784017841178421784317844178451784617847178481784917850178511785217853178541785517856178571785817859178601786117862178631786417865178661786717868178691787017871178721787317874178751787617877178781787917880178811788217883178841788517886178871788817889178901789117892178931789417895178961789717898178991790017901179021790317904179051790617907179081790917910179111791217913179141791517916179171791817919179201792117922179231792417925179261792717928179291793017931179321793317934179351793617937179381793917940179411794217943179441794517946179471794817949179501795117952179531795417955179561795717958179591796017961179621796317964179651796617967179681796917970179711797217973179741797517976179771797817979179801798117982179831798417985179861798717988179891799017991179921799317994179951799617997179981799918000180011800218003180041800518006180071800818009180101801118012180131801418015180161801718018180191802018021180221802318024180251802618027180281802918030180311803218033180341803518036180371803818039180401804118042180431804418045180461804718048180491805018051180521805318054180551805618057180581805918060180611806218063180641806518066180671806818069180701807118072180731807418075180761807718078180791808018081180821808318084180851808618087180881808918090180911809218093180941809518096180971809818099181001810118102181031810418105181061810718108181091811018111181121811318114181151811618117181181811918120181211812218123181241812518126181271812818129181301813118132181331813418135181361813718138181391814018141181421814318144181451814618147181481814918150181511815218153181541815518156181571815818159181601816118162181631816418165181661816718168181691817018171181721817318174181751817618177181781817918180181811818218183181841818518186181871818818189181901819118192181931819418195181961819718198181991820018201182021820318204182051820618207182081820918210182111821218213182141821518216182171821818219182201822118222182231822418225182261822718228182291823018231182321823318234182351823618237182381823918240182411824218243182441824518246182471824818249182501825118252182531825418255182561825718258182591826018261182621826318264182651826618267182681826918270182711827218273182741827518276182771827818279182801828118282182831828418285182861828718288182891829018291182921829318294182951829618297182981829918300183011830218303183041830518306183071830818309183101831118312183131831418315183161831718318183191832018321183221832318324183251832618327183281832918330183311833218333183341833518336183371833818339183401834118342183431834418345183461834718348183491835018351183521835318354183551835618357183581835918360183611836218363183641836518366183671836818369183701837118372183731837418375183761837718378183791838018381183821838318384183851838618387183881838918390183911839218393183941839518396183971839818399184001840118402184031840418405184061840718408184091841018411184121841318414184151841618417184181841918420184211842218423184241842518426184271842818429184301843118432184331843418435184361843718438184391844018441184421844318444184451844618447184481844918450184511845218453184541845518456184571845818459184601846118462184631846418465184661846718468184691847018471184721847318474184751847618477184781847918480184811848218483184841848518486184871848818489184901849118492184931849418495184961849718498184991850018501185021850318504185051850618507185081850918510185111851218513185141851518516185171851818519185201852118522185231852418525185261852718528185291853018531185321853318534185351853618537185381853918540185411854218543185441854518546185471854818549185501855118552185531855418555185561855718558185591856018561185621856318564185651856618567185681856918570185711857218573185741857518576185771857818579185801858118582185831858418585185861858718588185891859018591185921859318594185951859618597185981859918600186011860218603186041860518606186071860818609186101861118612186131861418615186161861718618186191862018621186221862318624186251862618627186281862918630186311863218633186341863518636186371863818639186401864118642186431864418645186461864718648186491865018651186521865318654186551865618657186581865918660186611866218663186641866518666186671866818669186701867118672186731867418675186761867718678186791868018681186821868318684186851868618687186881868918690186911869218693186941869518696186971869818699187001870118702187031870418705187061870718708187091871018711187121871318714187151871618717187181871918720187211872218723187241872518726187271872818729187301873118732187331873418735187361873718738187391874018741187421874318744187451874618747187481874918750187511875218753187541875518756187571875818759187601876118762187631876418765187661876718768187691877018771187721877318774187751877618777187781877918780187811878218783187841878518786187871878818789187901879118792187931879418795187961879718798187991880018801188021880318804188051880618807188081880918810188111881218813188141881518816188171881818819188201882118822188231882418825188261882718828188291883018831188321883318834188351883618837188381883918840188411884218843188441884518846188471884818849188501885118852188531885418855188561885718858188591886018861188621886318864188651886618867188681886918870188711887218873188741887518876188771887818879188801888118882188831888418885188861888718888188891889018891188921889318894188951889618897188981889918900189011890218903189041890518906189071890818909189101891118912189131891418915189161891718918189191892018921189221892318924189251892618927189281892918930189311893218933189341893518936189371893818939189401894118942189431894418945189461894718948189491895018951189521895318954189551895618957189581895918960189611896218963189641896518966189671896818969189701897118972189731897418975189761897718978189791898018981189821898318984189851898618987189881898918990189911899218993189941899518996189971899818999190001900119002190031900419005190061900719008190091901019011190121901319014190151901619017190181901919020190211902219023190241902519026190271902819029190301903119032190331903419035190361903719038190391904019041190421904319044190451904619047190481904919050190511905219053190541905519056190571905819059190601906119062190631906419065190661906719068190691907019071190721907319074190751907619077190781907919080190811908219083190841908519086190871908819089190901909119092190931909419095190961909719098190991910019101191021910319104191051910619107191081910919110191111911219113191141911519116191171911819119191201912119122191231912419125191261912719128191291913019131191321913319134191351913619137191381913919140191411914219143191441914519146191471914819149191501915119152191531915419155191561915719158191591916019161191621916319164191651916619167191681916919170191711917219173191741917519176191771917819179191801918119182191831918419185191861918719188191891919019191191921919319194191951919619197191981919919200192011920219203192041920519206192071920819209192101921119212192131921419215192161921719218192191922019221192221922319224192251922619227192281922919230192311923219233192341923519236192371923819239192401924119242192431924419245192461924719248192491925019251192521925319254192551925619257192581925919260192611926219263192641926519266192671926819269192701927119272192731927419275192761927719278192791928019281192821928319284192851928619287192881928919290192911929219293192941929519296192971929819299193001930119302193031930419305193061930719308193091931019311193121931319314193151931619317193181931919320193211932219323193241932519326193271932819329193301933119332193331933419335193361933719338193391934019341193421934319344193451934619347193481934919350193511935219353193541935519356193571935819359193601936119362193631936419365193661936719368193691937019371193721937319374193751937619377193781937919380193811938219383193841938519386193871938819389193901939119392193931939419395193961939719398193991940019401194021940319404194051940619407194081940919410194111941219413194141941519416194171941819419194201942119422194231942419425194261942719428194291943019431194321943319434194351943619437194381943919440194411944219443194441944519446194471944819449194501945119452194531945419455194561945719458194591946019461194621946319464194651946619467194681946919470194711947219473194741947519476194771947819479194801948119482194831948419485194861948719488194891949019491194921949319494194951949619497194981949919500195011950219503195041950519506195071950819509195101951119512195131951419515195161951719518195191952019521195221952319524195251952619527195281952919530195311953219533195341953519536195371953819539195401954119542195431954419545195461954719548195491955019551195521955319554195551955619557195581955919560195611956219563195641956519566195671956819569195701957119572195731957419575195761957719578195791958019581195821958319584195851958619587195881958919590195911959219593195941959519596195971959819599196001960119602196031960419605196061960719608196091961019611196121961319614196151961619617196181961919620196211962219623196241962519626196271962819629196301963119632196331963419635196361963719638196391964019641196421964319644196451964619647196481964919650196511965219653196541965519656196571965819659196601966119662196631966419665196661966719668196691967019671196721967319674196751967619677196781967919680196811968219683196841968519686196871968819689196901969119692196931969419695196961969719698196991970019701197021970319704197051970619707197081970919710197111971219713197141971519716197171971819719197201972119722197231972419725197261972719728197291973019731197321973319734197351973619737197381973919740197411974219743197441974519746197471974819749197501975119752197531975419755197561975719758197591976019761197621976319764197651976619767197681976919770197711977219773197741977519776197771977819779197801978119782197831978419785197861978719788197891979019791197921979319794197951979619797197981979919800198011980219803198041980519806198071980819809198101981119812198131981419815198161981719818198191982019821198221982319824198251982619827198281982919830198311983219833198341983519836198371983819839198401984119842198431984419845198461984719848198491985019851198521985319854198551985619857198581985919860198611986219863198641986519866198671986819869198701987119872198731987419875198761987719878198791988019881198821988319884198851988619887198881988919890198911989219893198941989519896198971989819899199001990119902199031990419905199061990719908199091991019911199121991319914199151991619917199181991919920199211992219923199241992519926199271992819929199301993119932199331993419935199361993719938199391994019941199421994319944199451994619947199481994919950199511995219953199541995519956199571995819959199601996119962199631996419965199661996719968199691997019971199721997319974199751997619977199781997919980199811998219983199841998519986199871998819989199901999119992199931999419995199961999719998199992000020001200022000320004200052000620007200082000920010200112001220013200142001520016200172001820019200202002120022200232002420025200262002720028200292003020031200322003320034200352003620037200382003920040200412004220043200442004520046200472004820049200502005120052200532005420055200562005720058200592006020061200622006320064200652006620067200682006920070200712007220073200742007520076200772007820079200802008120082200832008420085200862008720088200892009020091200922009320094200952009620097200982009920100201012010220103201042010520106201072010820109201102011120112201132011420115201162011720118201192012020121201222012320124201252012620127201282012920130201312013220133201342013520136201372013820139201402014120142201432014420145201462014720148201492015020151201522015320154201552015620157201582015920160201612016220163201642016520166201672016820169201702017120172201732017420175201762017720178201792018020181201822018320184201852018620187201882018920190201912019220193201942019520196201972019820199202002020120202202032020420205202062020720208202092021020211202122021320214202152021620217202182021920220202212022220223202242022520226202272022820229202302023120232202332023420235202362023720238202392024020241202422024320244202452024620247202482024920250202512025220253202542025520256202572025820259202602026120262202632026420265202662026720268202692027020271202722027320274202752027620277202782027920280202812028220283202842028520286202872028820289202902029120292202932029420295202962029720298202992030020301203022030320304203052030620307203082030920310203112031220313203142031520316203172031820319203202032120322203232032420325203262032720328203292033020331203322033320334203352033620337203382033920340203412034220343203442034520346203472034820349203502035120352203532035420355203562035720358203592036020361203622036320364203652036620367203682036920370203712037220373203742037520376203772037820379203802038120382203832038420385203862038720388203892039020391203922039320394203952039620397203982039920400204012040220403204042040520406204072040820409204102041120412204132041420415204162041720418204192042020421204222042320424204252042620427204282042920430204312043220433204342043520436204372043820439204402044120442204432044420445204462044720448204492045020451204522045320454204552045620457204582045920460204612046220463204642046520466204672046820469204702047120472204732047420475204762047720478204792048020481204822048320484204852048620487204882048920490204912049220493204942049520496204972049820499205002050120502205032050420505205062050720508205092051020511205122051320514205152051620517205182051920520205212052220523205242052520526205272052820529205302053120532205332053420535205362053720538205392054020541205422054320544205452054620547205482054920550205512055220553205542055520556205572055820559205602056120562205632056420565205662056720568205692057020571205722057320574205752057620577205782057920580205812058220583205842058520586205872058820589205902059120592205932059420595205962059720598205992060020601206022060320604206052060620607206082060920610206112061220613206142061520616206172061820619206202062120622206232062420625206262062720628206292063020631206322063320634206352063620637206382063920640206412064220643206442064520646206472064820649206502065120652206532065420655206562065720658206592066020661206622066320664206652066620667206682066920670206712067220673206742067520676206772067820679206802068120682206832068420685206862068720688206892069020691206922069320694206952069620697206982069920700207012070220703207042070520706207072070820709207102071120712207132071420715207162071720718207192072020721207222072320724207252072620727207282072920730207312073220733207342073520736207372073820739207402074120742207432074420745207462074720748207492075020751207522075320754207552075620757207582075920760207612076220763207642076520766207672076820769207702077120772207732077420775207762077720778207792078020781207822078320784207852078620787207882078920790207912079220793207942079520796207972079820799208002080120802208032080420805208062080720808208092081020811208122081320814208152081620817208182081920820208212082220823208242082520826208272082820829208302083120832208332083420835208362083720838208392084020841208422084320844208452084620847208482084920850208512085220853208542085520856208572085820859208602086120862208632086420865208662086720868208692087020871208722087320874208752087620877208782087920880208812088220883208842088520886208872088820889208902089120892208932089420895208962089720898208992090020901209022090320904209052090620907209082090920910209112091220913209142091520916209172091820919209202092120922209232092420925209262092720928209292093020931209322093320934209352093620937209382093920940209412094220943209442094520946209472094820949209502095120952209532095420955209562095720958209592096020961209622096320964209652096620967209682096920970209712097220973209742097520976209772097820979209802098120982209832098420985209862098720988209892099020991209922099320994209952099620997209982099921000210012100221003210042100521006210072100821009210102101121012210132101421015210162101721018210192102021021210222102321024210252102621027210282102921030210312103221033210342103521036210372103821039210402104121042210432104421045210462104721048210492105021051210522105321054210552105621057210582105921060210612106221063210642106521066210672106821069210702107121072210732107421075210762107721078210792108021081210822108321084210852108621087210882108921090210912109221093210942109521096210972109821099211002110121102211032110421105211062110721108211092111021111211122111321114211152111621117211182111921120211212112221123211242112521126211272112821129211302113121132211332113421135211362113721138211392114021141211422114321144211452114621147211482114921150211512115221153211542115521156211572115821159211602116121162211632116421165211662116721168211692117021171211722117321174211752117621177211782117921180211812118221183211842118521186211872118821189211902119121192211932119421195211962119721198211992120021201212022120321204212052120621207212082120921210212112121221213212142121521216212172121821219212202122121222212232122421225212262122721228212292123021231212322123321234212352123621237212382123921240212412124221243212442124521246212472124821249212502125121252212532125421255212562125721258212592126021261212622126321264212652126621267212682126921270212712127221273212742127521276212772127821279212802128121282212832128421285212862128721288212892129021291212922129321294212952129621297212982129921300213012130221303213042130521306213072130821309213102131121312213132131421315213162131721318213192132021321213222132321324213252132621327213282132921330213312133221333213342133521336213372133821339213402134121342213432134421345213462134721348213492135021351213522135321354213552135621357213582135921360213612136221363213642136521366213672136821369213702137121372213732137421375213762137721378213792138021381213822138321384213852138621387213882138921390213912139221393213942139521396213972139821399214002140121402214032140421405214062140721408214092141021411214122141321414214152141621417214182141921420214212142221423214242142521426214272142821429214302143121432214332143421435214362143721438214392144021441214422144321444214452144621447214482144921450214512145221453214542145521456214572145821459214602146121462214632146421465214662146721468214692147021471214722147321474214752147621477214782147921480214812148221483214842148521486214872148821489214902149121492214932149421495214962149721498214992150021501215022150321504215052150621507215082150921510215112151221513215142151521516215172151821519215202152121522215232152421525215262152721528215292153021531215322153321534215352153621537215382153921540215412154221543215442154521546215472154821549215502155121552215532155421555215562155721558215592156021561215622156321564215652156621567215682156921570215712157221573215742157521576215772157821579215802158121582215832158421585215862158721588215892159021591215922159321594215952159621597215982159921600216012160221603216042160521606216072160821609216102161121612216132161421615216162161721618216192162021621216222162321624216252162621627216282162921630216312163221633216342163521636216372163821639216402164121642216432164421645216462164721648216492165021651216522165321654216552165621657216582165921660216612166221663216642166521666216672166821669216702167121672216732167421675216762167721678216792168021681216822168321684216852168621687216882168921690216912169221693216942169521696216972169821699217002170121702217032170421705217062170721708217092171021711217122171321714217152171621717217182171921720217212172221723217242172521726217272172821729217302173121732217332173421735217362173721738217392174021741217422174321744217452174621747217482174921750217512175221753217542175521756217572175821759217602176121762217632176421765217662176721768217692177021771217722177321774217752177621777217782177921780217812178221783217842178521786217872178821789217902179121792217932179421795217962179721798217992180021801218022180321804218052180621807218082180921810218112181221813218142181521816218172181821819218202182121822218232182421825218262182721828218292183021831218322183321834218352183621837218382183921840218412184221843218442184521846218472184821849218502185121852218532185421855218562185721858218592186021861218622186321864218652186621867218682186921870218712187221873218742187521876218772187821879218802188121882218832188421885218862188721888218892189021891218922189321894218952189621897218982189921900219012190221903219042190521906219072190821909219102191121912219132191421915219162191721918219192192021921219222192321924219252192621927219282192921930219312193221933219342193521936219372193821939219402194121942219432194421945219462194721948219492195021951219522195321954219552195621957219582195921960219612196221963219642196521966219672196821969219702197121972219732197421975219762197721978219792198021981219822198321984219852198621987219882198921990219912199221993219942199521996219972199821999220002200122002220032200422005220062200722008220092201022011220122201322014220152201622017220182201922020220212202222023220242202522026220272202822029220302203122032220332203422035220362203722038220392204022041220422204322044220452204622047220482204922050220512205222053220542205522056220572205822059220602206122062220632206422065220662206722068220692207022071220722207322074220752207622077220782207922080220812208222083220842208522086220872208822089220902209122092220932209422095220962209722098220992210022101221022210322104221052210622107221082210922110221112211222113221142211522116221172211822119221202212122122221232212422125221262212722128221292213022131221322213322134221352213622137221382213922140221412214222143221442214522146221472214822149221502215122152221532215422155221562215722158221592216022161221622216322164221652216622167221682216922170221712217222173221742217522176221772217822179221802218122182221832218422185221862218722188221892219022191221922219322194221952219622197221982219922200222012220222203222042220522206222072220822209222102221122212222132221422215222162221722218222192222022221222222222322224222252222622227222282222922230222312223222233222342223522236222372223822239222402224122242222432224422245222462224722248222492225022251222522225322254222552225622257222582225922260222612226222263222642226522266222672226822269222702227122272222732227422275222762227722278222792228022281222822228322284222852228622287222882228922290222912229222293222942229522296222972229822299223002230122302223032230422305223062230722308223092231022311223122231322314223152231622317223182231922320223212232222323223242232522326223272232822329223302233122332223332233422335223362233722338223392234022341223422234322344223452234622347223482234922350223512235222353223542235522356223572235822359223602236122362223632236422365223662236722368223692237022371223722237322374223752237622377223782237922380223812238222383223842238522386223872238822389223902239122392223932239422395223962239722398223992240022401224022240322404224052240622407224082240922410224112241222413224142241522416224172241822419224202242122422224232242422425224262242722428224292243022431224322243322434224352243622437224382243922440224412244222443224442244522446224472244822449224502245122452224532245422455224562245722458224592246022461224622246322464224652246622467224682246922470224712247222473224742247522476224772247822479224802248122482224832248422485224862248722488224892249022491224922249322494224952249622497224982249922500225012250222503225042250522506225072250822509225102251122512225132251422515225162251722518225192252022521225222252322524225252252622527225282252922530225312253222533225342253522536225372253822539225402254122542225432254422545225462254722548225492255022551225522255322554225552255622557225582255922560225612256222563225642256522566225672256822569225702257122572225732257422575225762257722578225792258022581225822258322584225852258622587225882258922590225912259222593225942259522596225972259822599226002260122602226032260422605226062260722608226092261022611226122261322614226152261622617226182261922620226212262222623226242262522626226272262822629226302263122632226332263422635226362263722638226392264022641226422264322644226452264622647226482264922650226512265222653226542265522656226572265822659226602266122662226632266422665226662266722668226692267022671226722267322674226752267622677226782267922680226812268222683226842268522686226872268822689226902269122692226932269422695226962269722698226992270022701227022270322704227052270622707227082270922710227112271222713227142271522716227172271822719227202272122722227232272422725227262272722728227292273022731227322273322734227352273622737227382273922740227412274222743227442274522746227472274822749227502275122752227532275422755227562275722758227592276022761227622276322764227652276622767227682276922770227712277222773227742277522776227772277822779227802278122782227832278422785227862278722788227892279022791227922279322794227952279622797227982279922800228012280222803228042280522806228072280822809228102281122812228132281422815228162281722818228192282022821228222282322824228252282622827228282282922830228312283222833228342283522836228372283822839228402284122842228432284422845228462284722848228492285022851228522285322854228552285622857228582285922860228612286222863228642286522866228672286822869228702287122872228732287422875228762287722878228792288022881228822288322884228852288622887228882288922890228912289222893228942289522896228972289822899229002290122902229032290422905229062290722908229092291022911229122291322914229152291622917229182291922920229212292222923229242292522926229272292822929229302293122932229332293422935229362293722938229392294022941229422294322944229452294622947229482294922950229512295222953229542295522956229572295822959229602296122962229632296422965229662296722968229692297022971229722297322974229752297622977229782297922980229812298222983229842298522986229872298822989229902299122992229932299422995229962299722998229992300023001230022300323004230052300623007230082300923010230112301223013230142301523016230172301823019230202302123022230232302423025230262302723028230292303023031230322303323034230352303623037230382303923040230412304223043230442304523046230472304823049230502305123052230532305423055230562305723058230592306023061230622306323064230652306623067230682306923070230712307223073230742307523076230772307823079230802308123082230832308423085230862308723088230892309023091230922309323094230952309623097230982309923100231012310223103231042310523106231072310823109231102311123112231132311423115231162311723118231192312023121231222312323124231252312623127231282312923130231312313223133231342313523136231372313823139231402314123142231432314423145231462314723148231492315023151231522315323154231552315623157231582315923160231612316223163231642316523166231672316823169231702317123172231732317423175231762317723178231792318023181231822318323184231852318623187231882318923190231912319223193231942319523196231972319823199232002320123202232032320423205232062320723208232092321023211232122321323214232152321623217232182321923220232212322223223232242322523226232272322823229232302323123232232332323423235232362323723238232392324023241232422324323244232452324623247232482324923250232512325223253232542325523256232572325823259232602326123262232632326423265232662326723268232692327023271232722327323274232752327623277232782327923280232812328223283232842328523286232872328823289232902329123292232932329423295232962329723298232992330023301233022330323304233052330623307233082330923310233112331223313233142331523316233172331823319233202332123322233232332423325233262332723328233292333023331233322333323334233352333623337233382333923340233412334223343233442334523346233472334823349233502335123352233532335423355233562335723358233592336023361233622336323364233652336623367233682336923370233712337223373233742337523376233772337823379233802338123382233832338423385233862338723388233892339023391233922339323394233952339623397233982339923400234012340223403234042340523406234072340823409234102341123412234132341423415234162341723418234192342023421234222342323424234252342623427234282342923430234312343223433234342343523436234372343823439234402344123442234432344423445234462344723448234492345023451234522345323454234552345623457234582345923460234612346223463234642346523466234672346823469234702347123472234732347423475234762347723478234792348023481234822348323484234852348623487234882348923490234912349223493234942349523496234972349823499235002350123502235032350423505235062350723508235092351023511235122351323514235152351623517235182351923520235212352223523235242352523526235272352823529235302353123532235332353423535235362353723538235392354023541235422354323544235452354623547235482354923550235512355223553235542355523556235572355823559235602356123562235632356423565235662356723568235692357023571235722357323574235752357623577235782357923580235812358223583235842358523586235872358823589235902359123592235932359423595235962359723598235992360023601236022360323604236052360623607236082360923610236112361223613236142361523616236172361823619236202362123622236232362423625236262362723628236292363023631236322363323634236352363623637236382363923640236412364223643236442364523646236472364823649236502365123652236532365423655236562365723658236592366023661236622366323664236652366623667236682366923670236712367223673236742367523676236772367823679236802368123682236832368423685236862368723688236892369023691236922369323694236952369623697236982369923700237012370223703237042370523706237072370823709237102371123712237132371423715237162371723718237192372023721237222372323724237252372623727237282372923730237312373223733237342373523736237372373823739237402374123742237432374423745237462374723748237492375023751237522375323754237552375623757237582375923760237612376223763237642376523766237672376823769237702377123772237732377423775237762377723778237792378023781237822378323784237852378623787237882378923790237912379223793237942379523796237972379823799238002380123802238032380423805238062380723808238092381023811238122381323814238152381623817238182381923820238212382223823238242382523826238272382823829238302383123832238332383423835238362383723838238392384023841238422384323844238452384623847238482384923850238512385223853238542385523856238572385823859238602386123862238632386423865238662386723868238692387023871238722387323874238752387623877238782387923880238812388223883238842388523886238872388823889238902389123892238932389423895238962389723898238992390023901239022390323904239052390623907239082390923910239112391223913239142391523916239172391823919239202392123922239232392423925239262392723928239292393023931239322393323934239352393623937239382393923940239412394223943239442394523946239472394823949239502395123952239532395423955239562395723958239592396023961239622396323964239652396623967239682396923970239712397223973239742397523976239772397823979239802398123982239832398423985239862398723988239892399023991239922399323994239952399623997239982399924000240012400224003240042400524006240072400824009240102401124012240132401424015240162401724018240192402024021240222402324024240252402624027240282402924030240312403224033240342403524036240372403824039240402404124042240432404424045240462404724048240492405024051240522405324054240552405624057240582405924060240612406224063240642406524066240672406824069240702407124072240732407424075240762407724078240792408024081240822408324084240852408624087240882408924090240912409224093240942409524096240972409824099241002410124102241032410424105241062410724108241092411024111241122411324114241152411624117241182411924120241212412224123241242412524126241272412824129241302413124132241332413424135241362413724138241392414024141241422414324144241452414624147241482414924150241512415224153241542415524156241572415824159241602416124162241632416424165241662416724168241692417024171241722417324174241752417624177241782417924180241812418224183241842418524186241872418824189241902419124192241932419424195241962419724198241992420024201242022420324204242052420624207242082420924210242112421224213242142421524216242172421824219242202422124222242232422424225242262422724228242292423024231242322423324234242352423624237242382423924240242412424224243242442424524246242472424824249242502425124252242532425424255242562425724258242592426024261242622426324264242652426624267242682426924270242712427224273242742427524276242772427824279242802428124282242832428424285242862428724288242892429024291242922429324294242952429624297242982429924300243012430224303243042430524306243072430824309243102431124312243132431424315243162431724318243192432024321243222432324324243252432624327243282432924330243312433224333243342433524336243372433824339243402434124342243432434424345243462434724348243492435024351243522435324354243552435624357243582435924360243612436224363243642436524366243672436824369243702437124372243732437424375243762437724378243792438024381243822438324384243852438624387243882438924390243912439224393243942439524396243972439824399244002440124402244032440424405244062440724408244092441024411244122441324414244152441624417244182441924420244212442224423244242442524426244272442824429244302443124432244332443424435244362443724438244392444024441244422444324444244452444624447244482444924450244512445224453244542445524456244572445824459244602446124462244632446424465244662446724468244692447024471244722447324474244752447624477244782447924480244812448224483244842448524486244872448824489244902449124492244932449424495244962449724498244992450024501245022450324504245052450624507245082450924510245112451224513245142451524516245172451824519245202452124522245232452424525245262452724528245292453024531245322453324534245352453624537245382453924540245412454224543245442454524546245472454824549245502455124552245532455424555245562455724558245592456024561245622456324564245652456624567245682456924570245712457224573245742457524576245772457824579245802458124582245832458424585245862458724588245892459024591245922459324594245952459624597245982459924600246012460224603246042460524606246072460824609246102461124612246132461424615246162461724618246192462024621246222462324624246252462624627246282462924630246312463224633246342463524636246372463824639246402464124642246432464424645246462464724648246492465024651246522465324654246552465624657246582465924660246612466224663246642466524666246672466824669246702467124672246732467424675246762467724678246792468024681246822468324684246852468624687246882468924690246912469224693246942469524696246972469824699247002470124702247032470424705247062470724708247092471024711247122471324714247152471624717247182471924720247212472224723247242472524726247272472824729247302473124732247332473424735247362473724738247392474024741247422474324744247452474624747247482474924750247512475224753247542475524756247572475824759247602476124762247632476424765247662476724768247692477024771247722477324774247752477624777247782477924780247812478224783247842478524786247872478824789247902479124792247932479424795247962479724798247992480024801248022480324804248052480624807248082480924810248112481224813248142481524816248172481824819248202482124822248232482424825248262482724828248292483024831248322483324834248352483624837248382483924840248412484224843248442484524846248472484824849248502485124852248532485424855248562485724858248592486024861248622486324864248652486624867248682486924870248712487224873248742487524876248772487824879248802488124882248832488424885248862488724888248892489024891248922489324894248952489624897248982489924900249012490224903249042490524906249072490824909249102491124912249132491424915249162491724918249192492024921249222492324924249252492624927249282492924930249312493224933249342493524936249372493824939249402494124942249432494424945249462494724948249492495024951249522495324954249552495624957249582495924960249612496224963249642496524966249672496824969249702497124972249732497424975249762497724978249792498024981249822498324984249852498624987249882498924990249912499224993249942499524996249972499824999250002500125002250032500425005250062500725008250092501025011250122501325014250152501625017250182501925020250212502225023250242502525026250272502825029250302503125032250332503425035250362503725038250392504025041250422504325044250452504625047250482504925050250512505225053250542505525056250572505825059250602506125062250632506425065250662506725068250692507025071250722507325074250752507625077250782507925080250812508225083250842508525086250872508825089250902509125092250932509425095250962509725098250992510025101251022510325104251052510625107251082510925110251112511225113251142511525116251172511825119251202512125122251232512425125251262512725128251292513025131251322513325134251352513625137251382513925140251412514225143251442514525146251472514825149251502515125152251532515425155251562515725158251592516025161251622516325164251652516625167251682516925170251712517225173251742517525176251772517825179251802518125182251832518425185251862518725188251892519025191251922519325194251952519625197251982519925200252012520225203252042520525206252072520825209252102521125212252132521425215252162521725218252192522025221252222522325224252252522625227252282522925230252312523225233252342523525236252372523825239252402524125242252432524425245252462524725248252492525025251252522525325254252552525625257252582525925260252612526225263252642526525266252672526825269252702527125272252732527425275252762527725278252792528025281252822528325284252852528625287252882528925290252912529225293252942529525296252972529825299253002530125302253032530425305253062530725308253092531025311253122531325314253152531625317253182531925320253212532225323253242532525326253272532825329253302533125332253332533425335253362533725338253392534025341253422534325344253452534625347253482534925350253512535225353253542535525356253572535825359253602536125362253632536425365253662536725368253692537025371253722537325374253752537625377253782537925380253812538225383253842538525386253872538825389253902539125392253932539425395253962539725398253992540025401254022540325404254052540625407254082540925410254112541225413254142541525416254172541825419254202542125422254232542425425254262542725428254292543025431254322543325434254352543625437254382543925440254412544225443254442544525446254472544825449254502545125452254532545425455254562545725458254592546025461254622546325464254652546625467254682546925470254712547225473254742547525476254772547825479254802548125482254832548425485254862548725488254892549025491254922549325494254952549625497254982549925500255012550225503255042550525506255072550825509255102551125512255132551425515255162551725518255192552025521255222552325524255252552625527255282552925530255312553225533255342553525536255372553825539255402554125542255432554425545255462554725548255492555025551255522555325554255552555625557255582555925560255612556225563255642556525566255672556825569255702557125572255732557425575255762557725578255792558025581255822558325584255852558625587255882558925590255912559225593255942559525596255972559825599256002560125602256032560425605256062560725608256092561025611256122561325614256152561625617256182561925620256212562225623256242562525626256272562825629256302563125632256332563425635256362563725638256392564025641256422564325644256452564625647256482564925650256512565225653256542565525656256572565825659256602566125662256632566425665256662566725668256692567025671256722567325674256752567625677256782567925680256812568225683256842568525686256872568825689256902569125692256932569425695256962569725698256992570025701257022570325704257052570625707257082570925710257112571225713257142571525716257172571825719257202572125722257232572425725257262572725728257292573025731257322573325734257352573625737257382573925740257412574225743257442574525746257472574825749257502575125752257532575425755257562575725758257592576025761257622576325764257652576625767257682576925770257712577225773257742577525776257772577825779257802578125782257832578425785257862578725788257892579025791257922579325794257952579625797257982579925800258012580225803258042580525806258072580825809258102581125812258132581425815258162581725818258192582025821258222582325824258252582625827258282582925830258312583225833258342583525836258372583825839258402584125842258432584425845258462584725848258492585025851258522585325854258552585625857258582585925860258612586225863258642586525866258672586825869258702587125872258732587425875258762587725878258792588025881258822588325884258852588625887258882588925890258912589225893258942589525896258972589825899259002590125902259032590425905259062590725908259092591025911259122591325914259152591625917259182591925920259212592225923259242592525926259272592825929259302593125932259332593425935259362593725938259392594025941259422594325944259452594625947259482594925950259512595225953259542595525956259572595825959259602596125962259632596425965259662596725968259692597025971259722597325974259752597625977259782597925980259812598225983259842598525986259872598825989259902599125992259932599425995259962599725998259992600026001260022600326004260052600626007260082600926010260112601226013260142601526016260172601826019260202602126022260232602426025260262602726028260292603026031260322603326034260352603626037260382603926040260412604226043260442604526046260472604826049260502605126052260532605426055260562605726058260592606026061260622606326064260652606626067260682606926070260712607226073260742607526076260772607826079260802608126082260832608426085260862608726088260892609026091260922609326094260952609626097260982609926100261012610226103261042610526106261072610826109261102611126112261132611426115261162611726118261192612026121261222612326124261252612626127261282612926130261312613226133261342613526136261372613826139261402614126142261432614426145261462614726148261492615026151261522615326154261552615626157261582615926160261612616226163261642616526166261672616826169261702617126172261732617426175261762617726178261792618026181261822618326184261852618626187261882618926190261912619226193261942619526196261972619826199262002620126202262032620426205262062620726208262092621026211262122621326214262152621626217262182621926220262212622226223262242622526226262272622826229262302623126232262332623426235262362623726238262392624026241262422624326244262452624626247262482624926250262512625226253262542625526256262572625826259262602626126262262632626426265262662626726268262692627026271262722627326274262752627626277262782627926280262812628226283262842628526286262872628826289262902629126292262932629426295262962629726298262992630026301263022630326304263052630626307263082630926310263112631226313263142631526316263172631826319263202632126322263232632426325263262632726328263292633026331263322633326334263352633626337263382633926340263412634226343263442634526346263472634826349263502635126352263532635426355263562635726358263592636026361263622636326364263652636626367263682636926370263712637226373263742637526376263772637826379263802638126382263832638426385263862638726388263892639026391263922639326394263952639626397263982639926400264012640226403264042640526406264072640826409264102641126412264132641426415264162641726418264192642026421264222642326424264252642626427264282642926430264312643226433264342643526436264372643826439264402644126442264432644426445264462644726448264492645026451264522645326454264552645626457264582645926460264612646226463264642646526466264672646826469264702647126472264732647426475264762647726478264792648026481264822648326484264852648626487264882648926490264912649226493264942649526496264972649826499265002650126502265032650426505265062650726508265092651026511265122651326514265152651626517265182651926520265212652226523265242652526526265272652826529265302653126532265332653426535265362653726538265392654026541265422654326544265452654626547265482654926550265512655226553265542655526556265572655826559265602656126562265632656426565265662656726568265692657026571265722657326574265752657626577265782657926580265812658226583265842658526586265872658826589265902659126592265932659426595265962659726598265992660026601266022660326604266052660626607266082660926610266112661226613266142661526616266172661826619266202662126622266232662426625266262662726628266292663026631266322663326634266352663626637266382663926640266412664226643266442664526646266472664826649266502665126652266532665426655266562665726658266592666026661266622666326664266652666626667266682666926670266712667226673266742667526676266772667826679266802668126682266832668426685266862668726688266892669026691266922669326694266952669626697266982669926700267012670226703267042670526706267072670826709267102671126712267132671426715267162671726718267192672026721267222672326724267252672626727267282672926730267312673226733267342673526736267372673826739267402674126742267432674426745267462674726748267492675026751267522675326754267552675626757267582675926760267612676226763267642676526766267672676826769267702677126772267732677426775267762677726778267792678026781267822678326784267852678626787267882678926790267912679226793267942679526796267972679826799268002680126802268032680426805268062680726808268092681026811268122681326814268152681626817268182681926820268212682226823268242682526826268272682826829268302683126832268332683426835268362683726838268392684026841268422684326844268452684626847268482684926850268512685226853268542685526856268572685826859268602686126862268632686426865268662686726868268692687026871268722687326874268752687626877268782687926880268812688226883268842688526886268872688826889268902689126892268932689426895268962689726898268992690026901269022690326904269052690626907269082690926910269112691226913269142691526916269172691826919269202692126922269232692426925269262692726928269292693026931269322693326934269352693626937269382693926940269412694226943269442694526946269472694826949269502695126952269532695426955269562695726958269592696026961269622696326964269652696626967269682696926970269712697226973269742697526976269772697826979269802698126982269832698426985269862698726988269892699026991269922699326994269952699626997269982699927000270012700227003270042700527006270072700827009270102701127012270132701427015270162701727018270192702027021270222702327024270252702627027270282702927030270312703227033270342703527036270372703827039270402704127042270432704427045270462704727048270492705027051270522705327054270552705627057270582705927060270612706227063270642706527066270672706827069270702707127072270732707427075270762707727078270792708027081270822708327084270852708627087270882708927090270912709227093270942709527096270972709827099271002710127102271032710427105271062710727108271092711027111271122711327114271152711627117271182711927120271212712227123271242712527126271272712827129271302713127132271332713427135271362713727138271392714027141271422714327144271452714627147271482714927150271512715227153271542715527156271572715827159271602716127162271632716427165271662716727168271692717027171271722717327174271752717627177271782717927180271812718227183271842718527186271872718827189271902719127192271932719427195271962719727198271992720027201272022720327204272052720627207272082720927210272112721227213272142721527216272172721827219272202722127222272232722427225272262722727228272292723027231272322723327234272352723627237272382723927240272412724227243272442724527246272472724827249272502725127252272532725427255272562725727258272592726027261272622726327264272652726627267272682726927270272712727227273272742727527276272772727827279272802728127282272832728427285272862728727288272892729027291272922729327294272952729627297272982729927300273012730227303273042730527306273072730827309273102731127312273132731427315273162731727318273192732027321273222732327324273252732627327273282732927330273312733227333273342733527336273372733827339273402734127342273432734427345273462734727348273492735027351273522735327354273552735627357273582735927360273612736227363273642736527366273672736827369273702737127372273732737427375273762737727378273792738027381273822738327384273852738627387273882738927390273912739227393273942739527396273972739827399274002740127402274032740427405274062740727408274092741027411274122741327414274152741627417274182741927420274212742227423274242742527426274272742827429274302743127432274332743427435274362743727438274392744027441274422744327444274452744627447274482744927450274512745227453274542745527456274572745827459274602746127462274632746427465274662746727468274692747027471274722747327474274752747627477274782747927480274812748227483274842748527486274872748827489274902749127492274932749427495274962749727498274992750027501275022750327504275052750627507275082750927510275112751227513275142751527516275172751827519275202752127522275232752427525275262752727528275292753027531275322753327534275352753627537275382753927540275412754227543275442754527546275472754827549275502755127552275532755427555275562755727558275592756027561275622756327564275652756627567275682756927570275712757227573275742757527576275772757827579275802758127582275832758427585275862758727588275892759027591275922759327594275952759627597275982759927600276012760227603276042760527606276072760827609276102761127612276132761427615276162761727618276192762027621276222762327624276252762627627276282762927630276312763227633276342763527636276372763827639276402764127642276432764427645276462764727648276492765027651276522765327654276552765627657276582765927660276612766227663276642766527666276672766827669276702767127672276732767427675276762767727678276792768027681276822768327684276852768627687276882768927690276912769227693276942769527696276972769827699277002770127702277032770427705277062770727708277092771027711277122771327714277152771627717277182771927720277212772227723277242772527726277272772827729277302773127732277332773427735277362773727738277392774027741277422774327744277452774627747277482774927750277512775227753277542775527756277572775827759277602776127762277632776427765277662776727768277692777027771277722777327774277752777627777277782777927780277812778227783277842778527786277872778827789277902779127792277932779427795277962779727798277992780027801278022780327804278052780627807278082780927810278112781227813278142781527816278172781827819278202782127822278232782427825278262782727828278292783027831278322783327834278352783627837278382783927840278412784227843278442784527846278472784827849278502785127852278532785427855278562785727858278592786027861278622786327864278652786627867278682786927870278712787227873278742787527876278772787827879278802788127882278832788427885278862788727888278892789027891278922789327894278952789627897278982789927900279012790227903279042790527906279072790827909279102791127912279132791427915279162791727918279192792027921279222792327924279252792627927279282792927930279312793227933279342793527936279372793827939279402794127942279432794427945279462794727948279492795027951279522795327954279552795627957279582795927960279612796227963279642796527966279672796827969279702797127972279732797427975279762797727978279792798027981279822798327984279852798627987279882798927990279912799227993279942799527996279972799827999280002800128002280032800428005280062800728008280092801028011280122801328014280152801628017280182801928020280212802228023280242802528026280272802828029280302803128032280332803428035280362803728038280392804028041280422804328044280452804628047280482804928050280512805228053280542805528056280572805828059280602806128062280632806428065280662806728068280692807028071280722807328074280752807628077280782807928080280812808228083280842808528086280872808828089280902809128092280932809428095280962809728098280992810028101281022810328104281052810628107281082810928110281112811228113281142811528116281172811828119281202812128122281232812428125281262812728128281292813028131281322813328134281352813628137281382813928140281412814228143281442814528146281472814828149281502815128152281532815428155281562815728158281592816028161281622816328164281652816628167281682816928170281712817228173281742817528176281772817828179281802818128182281832818428185281862818728188281892819028191281922819328194281952819628197281982819928200282012820228203282042820528206282072820828209282102821128212282132821428215282162821728218282192822028221282222822328224282252822628227282282822928230282312823228233282342823528236282372823828239282402824128242282432824428245282462824728248282492825028251282522825328254282552825628257282582825928260282612826228263282642826528266282672826828269282702827128272282732827428275282762827728278282792828028281282822828328284282852828628287282882828928290282912829228293282942829528296282972829828299283002830128302283032830428305283062830728308283092831028311283122831328314283152831628317283182831928320283212832228323283242832528326283272832828329283302833128332283332833428335283362833728338283392834028341283422834328344283452834628347283482834928350283512835228353283542835528356283572835828359283602836128362283632836428365283662836728368283692837028371283722837328374283752837628377283782837928380283812838228383283842838528386283872838828389283902839128392283932839428395283962839728398283992840028401284022840328404284052840628407284082840928410284112841228413284142841528416284172841828419284202842128422284232842428425284262842728428284292843028431284322843328434284352843628437284382843928440284412844228443284442844528446284472844828449284502845128452284532845428455284562845728458284592846028461284622846328464284652846628467284682846928470284712847228473284742847528476284772847828479284802848128482284832848428485284862848728488284892849028491284922849328494284952849628497284982849928500285012850228503285042850528506285072850828509285102851128512285132851428515285162851728518285192852028521285222852328524285252852628527285282852928530285312853228533285342853528536285372853828539285402854128542285432854428545285462854728548285492855028551285522855328554285552855628557285582855928560285612856228563285642856528566285672856828569285702857128572285732857428575285762857728578285792858028581285822858328584285852858628587285882858928590285912859228593285942859528596285972859828599286002860128602286032860428605286062860728608286092861028611286122861328614286152861628617286182861928620286212862228623286242862528626286272862828629286302863128632286332863428635286362863728638286392864028641286422864328644286452864628647286482864928650286512865228653286542865528656286572865828659286602866128662286632866428665286662866728668286692867028671286722867328674286752867628677286782867928680286812868228683286842868528686286872868828689286902869128692286932869428695286962869728698286992870028701287022870328704287052870628707287082870928710287112871228713287142871528716287172871828719287202872128722287232872428725287262872728728287292873028731287322873328734287352873628737287382873928740287412874228743287442874528746287472874828749287502875128752287532875428755287562875728758287592876028761287622876328764287652876628767287682876928770287712877228773287742877528776287772877828779287802878128782287832878428785287862878728788287892879028791287922879328794287952879628797287982879928800288012880228803288042880528806288072880828809288102881128812288132881428815288162881728818288192882028821288222882328824288252882628827288282882928830288312883228833288342883528836288372883828839288402884128842288432884428845288462884728848288492885028851288522885328854288552885628857288582885928860288612886228863288642886528866288672886828869288702887128872288732887428875288762887728878288792888028881288822888328884288852888628887288882888928890288912889228893288942889528896288972889828899289002890128902289032890428905289062890728908289092891028911289122891328914289152891628917289182891928920289212892228923289242892528926289272892828929289302893128932289332893428935289362893728938289392894028941289422894328944289452894628947289482894928950289512895228953289542895528956289572895828959289602896128962289632896428965289662896728968289692897028971289722897328974289752897628977289782897928980289812898228983289842898528986289872898828989289902899128992289932899428995289962899728998289992900029001290022900329004290052900629007290082900929010290112901229013290142901529016290172901829019290202902129022290232902429025290262902729028290292903029031290322903329034290352903629037290382903929040290412904229043290442904529046290472904829049290502905129052290532905429055290562905729058290592906029061290622906329064290652906629067290682906929070290712907229073290742907529076290772907829079290802908129082290832908429085290862908729088290892909029091290922909329094290952909629097290982909929100291012910229103291042910529106291072910829109291102911129112291132911429115291162911729118291192912029121291222912329124291252912629127291282912929130291312913229133291342913529136291372913829139291402914129142291432914429145291462914729148291492915029151291522915329154291552915629157291582915929160291612916229163291642916529166291672916829169291702917129172291732917429175291762917729178291792918029181291822918329184291852918629187291882918929190291912919229193291942919529196291972919829199292002920129202292032920429205292062920729208292092921029211292122921329214292152921629217292182921929220292212922229223292242922529226292272922829229292302923129232292332923429235292362923729238292392924029241292422924329244292452924629247292482924929250292512925229253292542925529256292572925829259292602926129262292632926429265292662926729268292692927029271292722927329274292752927629277292782927929280292812928229283292842928529286292872928829289292902929129292292932929429295292962929729298292992930029301293022930329304293052930629307293082930929310293112931229313293142931529316293172931829319293202932129322293232932429325293262932729328293292933029331293322933329334293352933629337293382933929340293412934229343293442934529346293472934829349293502935129352293532935429355293562935729358293592936029361293622936329364293652936629367293682936929370293712937229373293742937529376293772937829379293802938129382293832938429385293862938729388293892939029391293922939329394293952939629397293982939929400294012940229403294042940529406294072940829409294102941129412294132941429415294162941729418294192942029421294222942329424294252942629427294282942929430294312943229433294342943529436294372943829439294402944129442294432944429445294462944729448294492945029451294522945329454294552945629457294582945929460294612946229463294642946529466294672946829469294702947129472294732947429475294762947729478294792948029481294822948329484294852948629487294882948929490294912949229493294942949529496294972949829499295002950129502295032950429505295062950729508295092951029511295122951329514295152951629517295182951929520295212952229523295242952529526295272952829529295302953129532295332953429535295362953729538295392954029541295422954329544295452954629547295482954929550295512955229553295542955529556295572955829559295602956129562295632956429565295662956729568295692957029571295722957329574295752957629577295782957929580295812958229583295842958529586295872958829589295902959129592295932959429595295962959729598295992960029601296022960329604296052960629607296082960929610296112961229613296142961529616296172961829619296202962129622296232962429625296262962729628296292963029631296322963329634296352963629637296382963929640296412964229643296442964529646296472964829649296502965129652296532965429655296562965729658296592966029661296622966329664296652966629667296682966929670296712967229673296742967529676296772967829679296802968129682296832968429685296862968729688296892969029691296922969329694296952969629697296982969929700297012970229703297042970529706297072970829709297102971129712297132971429715297162971729718297192972029721297222972329724297252972629727297282972929730297312973229733297342973529736297372973829739297402974129742297432974429745297462974729748297492975029751297522975329754297552975629757297582975929760297612976229763297642976529766297672976829769297702977129772297732977429775297762977729778297792978029781297822978329784297852978629787297882978929790297912979229793297942979529796297972979829799298002980129802298032980429805298062980729808298092981029811298122981329814298152981629817298182981929820298212982229823298242982529826298272982829829298302983129832298332983429835298362983729838298392984029841298422984329844298452984629847298482984929850298512985229853298542985529856298572985829859298602986129862298632986429865298662986729868298692987029871298722987329874298752987629877298782987929880298812988229883298842988529886298872988829889298902989129892298932989429895298962989729898298992990029901299022990329904299052990629907299082990929910299112991229913299142991529916299172991829919299202992129922299232992429925299262992729928299292993029931299322993329934299352993629937299382993929940299412994229943299442994529946299472994829949299502995129952299532995429955299562995729958299592996029961299622996329964299652996629967299682996929970299712997229973299742997529976299772997829979299802998129982299832998429985299862998729988299892999029991299922999329994299952999629997299982999930000300013000230003300043000530006300073000830009300103001130012300133001430015300163001730018300193002030021300223002330024300253002630027300283002930030300313003230033300343003530036300373003830039300403004130042300433004430045300463004730048300493005030051300523005330054300553005630057300583005930060300613006230063300643006530066300673006830069300703007130072300733007430075300763007730078300793008030081300823008330084300853008630087300883008930090300913009230093300943009530096300973009830099301003010130102301033010430105301063010730108301093011030111301123011330114301153011630117301183011930120301213012230123301243012530126301273012830129301303013130132301333013430135301363013730138301393014030141301423014330144301453014630147301483014930150301513015230153301543015530156301573015830159301603016130162301633016430165301663016730168301693017030171301723017330174301753017630177301783017930180301813018230183301843018530186301873018830189301903019130192301933019430195301963019730198301993020030201302023020330204302053020630207302083020930210302113021230213302143021530216302173021830219302203022130222302233022430225302263022730228302293023030231302323023330234302353023630237302383023930240302413024230243302443024530246302473024830249302503025130252302533025430255302563025730258302593026030261302623026330264302653026630267302683026930270302713027230273302743027530276302773027830279302803028130282302833028430285302863028730288302893029030291302923029330294302953029630297302983029930300303013030230303303043030530306303073030830309303103031130312303133031430315303163031730318303193032030321303223032330324303253032630327303283032930330303313033230333303343033530336303373033830339303403034130342303433034430345303463034730348303493035030351303523035330354303553035630357303583035930360303613036230363303643036530366303673036830369303703037130372303733037430375303763037730378303793038030381303823038330384303853038630387303883038930390303913039230393303943039530396303973039830399304003040130402304033040430405304063040730408304093041030411304123041330414304153041630417304183041930420304213042230423304243042530426304273042830429304303043130432304333043430435304363043730438304393044030441304423044330444304453044630447304483044930450304513045230453304543045530456304573045830459304603046130462304633046430465304663046730468304693047030471304723047330474304753047630477304783047930480304813048230483304843048530486304873048830489304903049130492304933049430495304963049730498304993050030501305023050330504305053050630507305083050930510305113051230513305143051530516305173051830519305203052130522305233052430525305263052730528305293053030531305323053330534305353053630537305383053930540305413054230543305443054530546305473054830549305503055130552305533055430555305563055730558305593056030561305623056330564305653056630567305683056930570305713057230573305743057530576305773057830579305803058130582305833058430585305863058730588305893059030591305923059330594305953059630597305983059930600306013060230603306043060530606306073060830609306103061130612306133061430615306163061730618306193062030621306223062330624306253062630627306283062930630306313063230633306343063530636306373063830639306403064130642306433064430645306463064730648306493065030651306523065330654306553065630657306583065930660306613066230663306643066530666306673066830669306703067130672306733067430675306763067730678306793068030681306823068330684306853068630687306883068930690306913069230693306943069530696306973069830699307003070130702307033070430705307063070730708307093071030711307123071330714307153071630717307183071930720307213072230723307243072530726307273072830729307303073130732307333073430735307363073730738307393074030741307423074330744307453074630747307483074930750307513075230753307543075530756307573075830759307603076130762307633076430765307663076730768307693077030771307723077330774307753077630777307783077930780307813078230783307843078530786307873078830789307903079130792307933079430795307963079730798307993080030801308023080330804308053080630807308083080930810308113081230813308143081530816308173081830819308203082130822308233082430825308263082730828308293083030831308323083330834308353083630837308383083930840308413084230843308443084530846308473084830849308503085130852308533085430855308563085730858308593086030861308623086330864308653086630867308683086930870308713087230873308743087530876308773087830879308803088130882308833088430885308863088730888308893089030891308923089330894308953089630897308983089930900309013090230903309043090530906309073090830909309103091130912309133091430915309163091730918309193092030921309223092330924309253092630927309283092930930309313093230933309343093530936309373093830939309403094130942309433094430945309463094730948309493095030951309523095330954309553095630957309583095930960309613096230963309643096530966309673096830969309703097130972309733097430975309763097730978309793098030981309823098330984309853098630987309883098930990309913099230993309943099530996309973099830999310003100131002310033100431005310063100731008310093101031011310123101331014310153101631017310183101931020310213102231023310243102531026310273102831029310303103131032310333103431035310363103731038310393104031041310423104331044310453104631047310483104931050310513105231053310543105531056310573105831059310603106131062310633106431065310663106731068310693107031071310723107331074310753107631077310783107931080310813108231083310843108531086310873108831089310903109131092310933109431095310963109731098310993110031101311023110331104311053110631107311083110931110311113111231113311143111531116311173111831119311203112131122311233112431125311263112731128311293113031131311323113331134311353113631137311383113931140311413114231143311443114531146311473114831149311503115131152311533115431155311563115731158311593116031161311623116331164311653116631167311683116931170311713117231173311743117531176311773117831179311803118131182311833118431185311863118731188311893119031191311923119331194311953119631197311983119931200312013120231203312043120531206312073120831209312103121131212312133121431215312163121731218312193122031221312223122331224312253122631227312283122931230312313123231233312343123531236312373123831239312403124131242312433124431245312463124731248312493125031251312523125331254312553125631257312583125931260312613126231263312643126531266312673126831269312703127131272312733127431275312763127731278312793128031281312823128331284312853128631287312883128931290312913129231293312943129531296312973129831299313003130131302313033130431305313063130731308313093131031311313123131331314313153131631317313183131931320313213132231323313243132531326313273132831329313303133131332313333133431335313363133731338313393134031341313423134331344313453134631347313483134931350313513135231353313543135531356313573135831359313603136131362313633136431365313663136731368313693137031371313723137331374313753137631377313783137931380313813138231383313843138531386313873138831389313903139131392313933139431395313963139731398313993140031401314023140331404314053140631407314083140931410314113141231413314143141531416314173141831419314203142131422314233142431425314263142731428314293143031431314323143331434314353143631437314383143931440314413144231443314443144531446314473144831449314503145131452314533145431455314563145731458314593146031461314623146331464314653146631467314683146931470314713147231473314743147531476314773147831479314803148131482314833148431485314863148731488314893149031491314923149331494314953149631497314983149931500315013150231503315043150531506315073150831509315103151131512315133151431515315163151731518315193152031521315223152331524315253152631527315283152931530315313153231533315343153531536315373153831539315403154131542315433154431545315463154731548315493155031551315523155331554315553155631557315583155931560315613156231563315643156531566315673156831569315703157131572315733157431575315763157731578315793158031581315823158331584315853158631587315883158931590315913159231593315943159531596315973159831599316003160131602316033160431605316063160731608316093161031611316123161331614316153161631617316183161931620316213162231623316243162531626316273162831629316303163131632316333163431635316363163731638316393164031641316423164331644316453164631647316483164931650316513165231653316543165531656316573165831659316603166131662316633166431665316663166731668316693167031671316723167331674316753167631677316783167931680316813168231683316843168531686316873168831689316903169131692316933169431695316963169731698316993170031701317023170331704317053170631707317083170931710317113171231713317143171531716317173171831719317203172131722317233172431725317263172731728317293173031731317323173331734317353173631737317383173931740317413174231743317443174531746317473174831749317503175131752317533175431755317563175731758317593176031761317623176331764317653176631767317683176931770317713177231773317743177531776317773177831779317803178131782317833178431785317863178731788317893179031791317923179331794317953179631797317983179931800318013180231803318043180531806318073180831809318103181131812318133181431815318163181731818318193182031821318223182331824318253182631827318283182931830318313183231833318343183531836318373183831839318403184131842318433184431845318463184731848318493185031851318523185331854318553185631857318583185931860318613186231863318643186531866318673186831869318703187131872318733187431875318763187731878318793188031881318823188331884318853188631887318883188931890318913189231893318943189531896318973189831899319003190131902319033190431905319063190731908319093191031911319123191331914319153191631917319183191931920319213192231923319243192531926319273192831929319303193131932319333193431935319363193731938319393194031941319423194331944319453194631947319483194931950319513195231953319543195531956319573195831959319603196131962319633196431965319663196731968319693197031971319723197331974319753197631977319783197931980319813198231983319843198531986319873198831989319903199131992319933199431995319963199731998319993200032001320023200332004320053200632007320083200932010320113201232013320143201532016320173201832019320203202132022320233202432025320263202732028320293203032031320323203332034320353203632037320383203932040320413204232043320443204532046320473204832049320503205132052320533205432055320563205732058320593206032061320623206332064320653206632067320683206932070320713207232073320743207532076320773207832079320803208132082320833208432085320863208732088320893209032091320923209332094320953209632097320983209932100321013210232103321043210532106321073210832109321103211132112321133211432115321163211732118321193212032121321223212332124321253212632127321283212932130321313213232133321343213532136321373213832139321403214132142321433214432145321463214732148321493215032151321523215332154321553215632157321583215932160321613216232163321643216532166321673216832169321703217132172321733217432175321763217732178321793218032181321823218332184321853218632187321883218932190321913219232193321943219532196321973219832199322003220132202322033220432205322063220732208322093221032211322123221332214322153221632217322183221932220322213222232223322243222532226322273222832229322303223132232322333223432235322363223732238322393224032241322423224332244322453224632247322483224932250322513225232253322543225532256322573225832259322603226132262322633226432265322663226732268322693227032271322723227332274322753227632277322783227932280322813228232283322843228532286322873228832289322903229132292322933229432295322963229732298322993230032301323023230332304323053230632307323083230932310323113231232313323143231532316323173231832319323203232132322323233232432325323263232732328323293233032331323323233332334323353233632337323383233932340323413234232343323443234532346323473234832349323503235132352323533235432355323563235732358323593236032361323623236332364323653236632367323683236932370323713237232373323743237532376323773237832379323803238132382323833238432385323863238732388323893239032391323923239332394323953239632397323983239932400324013240232403324043240532406324073240832409324103241132412324133241432415324163241732418324193242032421324223242332424324253242632427324283242932430324313243232433324343243532436324373243832439324403244132442324433244432445324463244732448324493245032451324523245332454324553245632457324583245932460324613246232463324643246532466324673246832469324703247132472324733247432475324763247732478324793248032481324823248332484324853248632487324883248932490324913249232493324943249532496324973249832499325003250132502325033250432505325063250732508325093251032511325123251332514325153251632517325183251932520325213252232523325243252532526325273252832529325303253132532325333253432535325363253732538325393254032541325423254332544325453254632547325483254932550325513255232553325543255532556325573255832559325603256132562325633256432565325663256732568325693257032571325723257332574325753257632577325783257932580325813258232583325843258532586325873258832589325903259132592325933259432595325963259732598325993260032601326023260332604326053260632607326083260932610326113261232613326143261532616326173261832619326203262132622326233262432625326263262732628326293263032631326323263332634326353263632637326383263932640326413264232643326443264532646326473264832649326503265132652326533265432655326563265732658326593266032661326623266332664326653266632667326683266932670326713267232673326743267532676326773267832679326803268132682326833268432685326863268732688326893269032691326923269332694326953269632697326983269932700327013270232703327043270532706327073270832709327103271132712327133271432715327163271732718327193272032721327223272332724327253272632727327283272932730327313273232733327343273532736327373273832739327403274132742327433274432745327463274732748327493275032751327523275332754327553275632757327583275932760327613276232763327643276532766327673276832769327703277132772327733277432775327763277732778327793278032781327823278332784327853278632787327883278932790327913279232793327943279532796327973279832799328003280132802328033280432805328063280732808328093281032811328123281332814328153281632817328183281932820328213282232823328243282532826328273282832829328303283132832328333283432835328363283732838328393284032841328423284332844328453284632847328483284932850328513285232853328543285532856328573285832859328603286132862328633286432865328663286732868328693287032871328723287332874328753287632877328783287932880328813288232883328843288532886328873288832889328903289132892328933289432895328963289732898328993290032901329023290332904329053290632907329083290932910329113291232913329143291532916329173291832919329203292132922329233292432925329263292732928329293293032931329323293332934329353293632937329383293932940329413294232943329443294532946329473294832949329503295132952329533295432955329563295732958329593296032961329623296332964329653296632967329683296932970329713297232973329743297532976329773297832979329803298132982329833298432985329863298732988329893299032991329923299332994329953299632997329983299933000330013300233003330043300533006330073300833009330103301133012330133301433015330163301733018330193302033021330223302333024330253302633027330283302933030330313303233033330343303533036330373303833039330403304133042330433304433045330463304733048330493305033051330523305333054330553305633057330583305933060330613306233063330643306533066330673306833069330703307133072330733307433075330763307733078330793308033081330823308333084330853308633087330883308933090330913309233093330943309533096330973309833099331003310133102331033310433105331063310733108331093311033111331123311333114331153311633117331183311933120331213312233123331243312533126331273312833129331303313133132331333313433135331363313733138331393314033141331423314333144331453314633147331483314933150331513315233153331543315533156331573315833159331603316133162331633316433165331663316733168331693317033171331723317333174331753317633177331783317933180331813318233183331843318533186331873318833189331903319133192331933319433195331963319733198331993320033201332023320333204332053320633207332083320933210332113321233213332143321533216332173321833219332203322133222332233322433225332263322733228332293323033231332323323333234332353323633237332383323933240332413324233243332443324533246332473324833249332503325133252332533325433255332563325733258332593326033261332623326333264332653326633267332683326933270332713327233273332743327533276332773327833279332803328133282332833328433285332863328733288332893329033291332923329333294332953329633297332983329933300333013330233303333043330533306333073330833309333103331133312333133331433315333163331733318333193332033321333223332333324333253332633327333283332933330333313333233333333343333533336333373333833339333403334133342333433334433345333463334733348333493335033351333523335333354333553335633357333583335933360333613336233363333643336533366333673336833369333703337133372333733337433375333763337733378333793338033381333823338333384333853338633387333883338933390333913339233393333943339533396333973339833399334003340133402334033340433405334063340733408334093341033411334123341333414334153341633417334183341933420334213342233423334243342533426334273342833429334303343133432334333343433435334363343733438334393344033441334423344333444334453344633447334483344933450334513345233453334543345533456334573345833459334603346133462334633346433465334663346733468334693347033471334723347333474334753347633477334783347933480334813348233483334843348533486334873348833489334903349133492334933349433495334963349733498334993350033501335023350333504335053350633507335083350933510335113351233513335143351533516335173351833519335203352133522335233352433525335263352733528335293353033531335323353333534335353353633537335383353933540335413354233543335443354533546335473354833549335503355133552335533355433555335563355733558335593356033561335623356333564335653356633567335683356933570335713357233573335743357533576335773357833579335803358133582335833358433585335863358733588335893359033591335923359333594335953359633597335983359933600336013360233603336043360533606336073360833609336103361133612336133361433615336163361733618336193362033621336223362333624336253362633627336283362933630336313363233633336343363533636336373363833639336403364133642336433364433645336463364733648336493365033651336523365333654336553365633657336583365933660336613366233663336643366533666336673366833669336703367133672336733367433675336763367733678336793368033681336823368333684336853368633687336883368933690336913369233693336943369533696336973369833699337003370133702337033370433705337063370733708337093371033711337123371333714337153371633717337183371933720337213372233723337243372533726337273372833729337303373133732337333373433735337363373733738337393374033741337423374333744337453374633747337483374933750337513375233753337543375533756337573375833759337603376133762337633376433765337663376733768337693377033771337723377333774337753377633777337783377933780337813378233783337843378533786337873378833789337903379133792337933379433795337963379733798337993380033801338023380333804338053380633807338083380933810338113381233813338143381533816338173381833819338203382133822338233382433825338263382733828338293383033831338323383333834338353383633837338383383933840338413384233843338443384533846338473384833849338503385133852338533385433855338563385733858338593386033861338623386333864338653386633867338683386933870338713387233873338743387533876338773387833879338803388133882338833388433885338863388733888338893389033891338923389333894338953389633897338983389933900339013390233903339043390533906339073390833909339103391133912339133391433915339163391733918339193392033921339223392333924339253392633927339283392933930339313393233933339343393533936339373393833939339403394133942339433394433945339463394733948339493395033951339523395333954339553395633957339583395933960339613396233963339643396533966339673396833969339703397133972339733397433975339763397733978339793398033981339823398333984339853398633987339883398933990339913399233993339943399533996339973399833999340003400134002340033400434005340063400734008340093401034011340123401334014340153401634017340183401934020340213402234023340243402534026340273402834029340303403134032340333403434035340363403734038340393404034041340423404334044340453404634047340483404934050340513405234053340543405534056340573405834059340603406134062340633406434065340663406734068340693407034071340723407334074340753407634077340783407934080340813408234083340843408534086340873408834089340903409134092340933409434095340963409734098340993410034101341023410334104341053410634107341083410934110341113411234113341143411534116341173411834119341203412134122341233412434125341263412734128341293413034131341323413334134341353413634137341383413934140341413414234143341443414534146341473414834149341503415134152341533415434155341563415734158341593416034161341623416334164341653416634167341683416934170341713417234173341743417534176341773417834179341803418134182341833418434185341863418734188341893419034191341923419334194341953419634197341983419934200342013420234203342043420534206342073420834209342103421134212342133421434215342163421734218342193422034221342223422334224342253422634227342283422934230342313423234233342343423534236342373423834239342403424134242342433424434245342463424734248342493425034251342523425334254342553425634257342583425934260342613426234263342643426534266342673426834269342703427134272342733427434275342763427734278342793428034281342823428334284342853428634287342883428934290342913429234293342943429534296342973429834299343003430134302343033430434305343063430734308343093431034311343123431334314343153431634317343183431934320343213432234323343243432534326343273432834329343303433134332343333433434335343363433734338343393434034341343423434334344343453434634347343483434934350343513435234353343543435534356343573435834359343603436134362343633436434365343663436734368343693437034371343723437334374343753437634377343783437934380343813438234383343843438534386343873438834389343903439134392343933439434395343963439734398343993440034401344023440334404344053440634407344083440934410344113441234413344143441534416344173441834419344203442134422344233442434425344263442734428344293443034431344323443334434344353443634437344383443934440344413444234443344443444534446344473444834449344503445134452344533445434455344563445734458344593446034461344623446334464344653446634467344683446934470344713447234473344743447534476344773447834479344803448134482344833448434485344863448734488344893449034491344923449334494344953449634497344983449934500345013450234503345043450534506345073450834509345103451134512345133451434515345163451734518345193452034521345223452334524345253452634527345283452934530345313453234533345343453534536345373453834539345403454134542345433454434545345463454734548345493455034551345523455334554345553455634557345583455934560345613456234563345643456534566345673456834569345703457134572345733457434575345763457734578345793458034581345823458334584345853458634587345883458934590345913459234593345943459534596345973459834599346003460134602346033460434605346063460734608346093461034611346123461334614346153461634617346183461934620346213462234623346243462534626346273462834629346303463134632346333463434635346363463734638346393464034641346423464334644346453464634647346483464934650346513465234653346543465534656346573465834659346603466134662346633466434665346663466734668346693467034671346723467334674346753467634677346783467934680346813468234683346843468534686346873468834689346903469134692346933469434695346963469734698346993470034701347023470334704347053470634707347083470934710347113471234713347143471534716347173471834719347203472134722347233472434725347263472734728347293473034731347323473334734347353473634737347383473934740347413474234743347443474534746347473474834749347503475134752347533475434755347563475734758347593476034761347623476334764347653476634767347683476934770347713477234773347743477534776347773477834779347803478134782347833478434785347863478734788347893479034791347923479334794347953479634797347983479934800348013480234803348043480534806348073480834809348103481134812348133481434815348163481734818348193482034821348223482334824348253482634827348283482934830348313483234833348343483534836348373483834839348403484134842348433484434845348463484734848348493485034851348523485334854348553485634857348583485934860348613486234863348643486534866348673486834869348703487134872348733487434875348763487734878348793488034881348823488334884348853488634887348883488934890348913489234893348943489534896348973489834899349003490134902349033490434905349063490734908349093491034911349123491334914349153491634917349183491934920349213492234923349243492534926349273492834929349303493134932349333493434935349363493734938349393494034941349423494334944349453494634947349483494934950349513495234953349543495534956349573495834959349603496134962349633496434965349663496734968349693497034971349723497334974349753497634977349783497934980349813498234983349843498534986349873498834989349903499134992349933499434995349963499734998349993500035001350023500335004350053500635007350083500935010350113501235013350143501535016350173501835019350203502135022350233502435025350263502735028350293503035031350323503335034350353503635037350383503935040350413504235043350443504535046350473504835049350503505135052350533505435055350563505735058350593506035061350623506335064350653506635067350683506935070350713507235073350743507535076350773507835079350803508135082350833508435085350863508735088350893509035091350923509335094350953509635097350983509935100351013510235103351043510535106351073510835109351103511135112351133511435115351163511735118351193512035121351223512335124351253512635127351283512935130351313513235133351343513535136351373513835139351403514135142351433514435145351463514735148351493515035151351523515335154351553515635157351583515935160351613516235163351643516535166351673516835169351703517135172351733517435175351763517735178351793518035181351823518335184351853518635187351883518935190351913519235193351943519535196351973519835199352003520135202352033520435205352063520735208352093521035211352123521335214352153521635217352183521935220352213522235223352243522535226352273522835229352303523135232352333523435235352363523735238352393524035241352423524335244352453524635247352483524935250352513525235253352543525535256352573525835259352603526135262352633526435265352663526735268352693527035271352723527335274352753527635277352783527935280352813528235283352843528535286352873528835289352903529135292352933529435295352963529735298352993530035301353023530335304353053530635307353083530935310353113531235313353143531535316353173531835319353203532135322353233532435325353263532735328353293533035331353323533335334353353533635337353383533935340353413534235343353443534535346353473534835349353503535135352353533535435355353563535735358353593536035361353623536335364353653536635367353683536935370353713537235373353743537535376353773537835379353803538135382353833538435385353863538735388353893539035391353923539335394353953539635397353983539935400354013540235403354043540535406354073540835409354103541135412354133541435415354163541735418354193542035421354223542335424354253542635427354283542935430354313543235433354343543535436354373543835439354403544135442354433544435445354463544735448354493545035451354523545335454354553545635457354583545935460354613546235463354643546535466354673546835469354703547135472354733547435475354763547735478354793548035481354823548335484354853548635487354883548935490354913549235493354943549535496354973549835499355003550135502355033550435505355063550735508355093551035511355123551335514355153551635517355183551935520355213552235523355243552535526355273552835529355303553135532355333553435535355363553735538355393554035541355423554335544355453554635547355483554935550355513555235553355543555535556355573555835559355603556135562355633556435565355663556735568355693557035571355723557335574355753557635577355783557935580355813558235583355843558535586355873558835589355903559135592355933559435595355963559735598355993560035601356023560335604356053560635607356083560935610356113561235613356143561535616356173561835619356203562135622356233562435625356263562735628356293563035631356323563335634356353563635637356383563935640356413564235643356443564535646356473564835649356503565135652356533565435655356563565735658356593566035661356623566335664356653566635667356683566935670356713567235673356743567535676356773567835679356803568135682356833568435685356863568735688356893569035691356923569335694356953569635697356983569935700357013570235703357043570535706357073570835709357103571135712357133571435715357163571735718357193572035721357223572335724357253572635727357283572935730357313573235733357343573535736357373573835739357403574135742357433574435745357463574735748357493575035751357523575335754357553575635757357583575935760357613576235763357643576535766357673576835769357703577135772357733577435775357763577735778357793578035781357823578335784357853578635787357883578935790357913579235793357943579535796357973579835799358003580135802358033580435805358063580735808358093581035811358123581335814358153581635817358183581935820358213582235823358243582535826358273582835829358303583135832358333583435835358363583735838358393584035841358423584335844358453584635847358483584935850358513585235853358543585535856358573585835859358603586135862358633586435865358663586735868358693587035871358723587335874358753587635877358783587935880358813588235883358843588535886358873588835889358903589135892358933589435895358963589735898358993590035901359023590335904359053590635907359083590935910359113591235913359143591535916359173591835919359203592135922359233592435925359263592735928359293593035931359323593335934359353593635937359383593935940359413594235943359443594535946359473594835949359503595135952359533595435955359563595735958359593596035961359623596335964359653596635967359683596935970359713597235973359743597535976359773597835979359803598135982359833598435985359863598735988359893599035991359923599335994359953599635997359983599936000360013600236003360043600536006360073600836009360103601136012360133601436015360163601736018360193602036021360223602336024360253602636027360283602936030360313603236033360343603536036360373603836039360403604136042360433604436045360463604736048360493605036051360523605336054360553605636057360583605936060360613606236063360643606536066360673606836069360703607136072360733607436075360763607736078360793608036081360823608336084360853608636087360883608936090360913609236093360943609536096360973609836099361003610136102361033610436105361063610736108361093611036111361123611336114361153611636117361183611936120361213612236123361243612536126361273612836129361303613136132361333613436135361363613736138361393614036141361423614336144361453614636147361483614936150361513615236153361543615536156361573615836159361603616136162361633616436165361663616736168361693617036171361723617336174361753617636177361783617936180361813618236183361843618536186361873618836189361903619136192361933619436195361963619736198361993620036201362023620336204362053620636207362083620936210362113621236213362143621536216362173621836219362203622136222362233622436225362263622736228362293623036231362323623336234362353623636237362383623936240362413624236243362443624536246362473624836249362503625136252362533625436255362563625736258362593626036261362623626336264362653626636267362683626936270362713627236273362743627536276362773627836279362803628136282362833628436285362863628736288362893629036291362923629336294362953629636297362983629936300363013630236303363043630536306363073630836309363103631136312363133631436315363163631736318363193632036321363223632336324363253632636327363283632936330363313633236333363343633536336363373633836339363403634136342363433634436345363463634736348363493635036351363523635336354363553635636357363583635936360363613636236363363643636536366363673636836369363703637136372363733637436375363763637736378363793638036381363823638336384363853638636387363883638936390363913639236393363943639536396363973639836399364003640136402364033640436405364063640736408364093641036411364123641336414364153641636417364183641936420364213642236423364243642536426364273642836429364303643136432364333643436435364363643736438364393644036441364423644336444364453644636447364483644936450364513645236453364543645536456364573645836459364603646136462364633646436465364663646736468364693647036471364723647336474364753647636477364783647936480364813648236483364843648536486364873648836489364903649136492364933649436495364963649736498364993650036501365023650336504365053650636507365083650936510365113651236513365143651536516365173651836519365203652136522365233652436525365263652736528365293653036531365323653336534365353653636537365383653936540365413654236543365443654536546365473654836549365503655136552365533655436555365563655736558365593656036561365623656336564365653656636567365683656936570365713657236573365743657536576365773657836579365803658136582365833658436585365863658736588365893659036591365923659336594365953659636597365983659936600366013660236603366043660536606366073660836609366103661136612366133661436615366163661736618366193662036621366223662336624366253662636627366283662936630366313663236633366343663536636366373663836639366403664136642366433664436645366463664736648366493665036651366523665336654366553665636657366583665936660366613666236663366643666536666366673666836669366703667136672366733667436675366763667736678366793668036681366823668336684366853668636687366883668936690366913669236693366943669536696366973669836699367003670136702367033670436705367063670736708367093671036711367123671336714367153671636717367183671936720367213672236723367243672536726367273672836729367303673136732367333673436735367363673736738367393674036741367423674336744367453674636747367483674936750367513675236753367543675536756367573675836759367603676136762367633676436765367663676736768367693677036771367723677336774367753677636777367783677936780367813678236783367843678536786367873678836789367903679136792367933679436795367963679736798367993680036801368023680336804368053680636807368083680936810368113681236813368143681536816368173681836819368203682136822368233682436825368263682736828368293683036831368323683336834368353683636837368383683936840368413684236843368443684536846368473684836849368503685136852368533685436855368563685736858368593686036861368623686336864368653686636867368683686936870368713687236873368743687536876368773687836879368803688136882368833688436885368863688736888368893689036891368923689336894368953689636897368983689936900369013690236903369043690536906369073690836909369103691136912369133691436915369163691736918369193692036921369223692336924369253692636927369283692936930369313693236933369343693536936369373693836939369403694136942369433694436945369463694736948369493695036951369523695336954369553695636957369583695936960369613696236963369643696536966369673696836969369703697136972369733697436975369763697736978369793698036981369823698336984369853698636987369883698936990369913699236993369943699536996369973699836999370003700137002370033700437005370063700737008370093701037011370123701337014370153701637017370183701937020370213702237023370243702537026370273702837029370303703137032370333703437035370363703737038370393704037041370423704337044370453704637047370483704937050370513705237053370543705537056370573705837059370603706137062370633706437065370663706737068370693707037071370723707337074370753707637077370783707937080370813708237083370843708537086370873708837089370903709137092370933709437095370963709737098370993710037101371023710337104371053710637107371083710937110371113711237113371143711537116371173711837119371203712137122371233712437125371263712737128371293713037131371323713337134371353713637137371383713937140371413714237143371443714537146371473714837149371503715137152371533715437155371563715737158371593716037161371623716337164371653716637167371683716937170371713717237173371743717537176371773717837179371803718137182371833718437185371863718737188371893719037191371923719337194371953719637197371983719937200372013720237203372043720537206372073720837209372103721137212372133721437215372163721737218372193722037221372223722337224372253722637227372283722937230372313723237233372343723537236372373723837239372403724137242372433724437245372463724737248372493725037251372523725337254372553725637257372583725937260372613726237263372643726537266372673726837269372703727137272372733727437275372763727737278372793728037281372823728337284372853728637287372883728937290372913729237293372943729537296372973729837299373003730137302373033730437305373063730737308373093731037311373123731337314373153731637317373183731937320373213732237323373243732537326373273732837329373303733137332373333733437335373363733737338373393734037341373423734337344373453734637347373483734937350373513735237353373543735537356373573735837359373603736137362373633736437365373663736737368373693737037371373723737337374373753737637377373783737937380373813738237383373843738537386373873738837389373903739137392373933739437395373963739737398373993740037401374023740337404374053740637407374083740937410374113741237413374143741537416374173741837419374203742137422374233742437425374263742737428374293743037431374323743337434374353743637437374383743937440374413744237443374443744537446374473744837449374503745137452374533745437455374563745737458374593746037461374623746337464374653746637467374683746937470374713747237473374743747537476374773747837479374803748137482374833748437485374863748737488374893749037491374923749337494374953749637497374983749937500375013750237503375043750537506375073750837509375103751137512375133751437515375163751737518375193752037521375223752337524375253752637527375283752937530375313753237533375343753537536375373753837539375403754137542375433754437545375463754737548375493755037551375523755337554375553755637557375583755937560375613756237563375643756537566375673756837569375703757137572375733757437575375763757737578375793758037581375823758337584375853758637587375883758937590375913759237593375943759537596375973759837599376003760137602376033760437605376063760737608376093761037611376123761337614376153761637617376183761937620376213762237623376243762537626376273762837629376303763137632376333763437635376363763737638376393764037641376423764337644376453764637647376483764937650376513765237653376543765537656376573765837659376603766137662376633766437665376663766737668376693767037671376723767337674376753767637677376783767937680376813768237683376843768537686376873768837689376903769137692376933769437695376963769737698376993770037701377023770337704377053770637707377083770937710377113771237713377143771537716377173771837719377203772137722377233772437725377263772737728377293773037731377323773337734377353773637737377383773937740377413774237743377443774537746377473774837749377503775137752377533775437755377563775737758377593776037761377623776337764377653776637767377683776937770377713777237773377743777537776377773777837779377803778137782377833778437785377863778737788377893779037791377923779337794377953779637797377983779937800378013780237803378043780537806378073780837809378103781137812378133781437815378163781737818378193782037821378223782337824378253782637827378283782937830378313783237833378343783537836378373783837839378403784137842378433784437845378463784737848378493785037851378523785337854378553785637857378583785937860378613786237863378643786537866378673786837869378703787137872378733787437875378763787737878378793788037881378823788337884378853788637887378883788937890378913789237893378943789537896378973789837899379003790137902379033790437905379063790737908379093791037911379123791337914379153791637917379183791937920379213792237923379243792537926379273792837929379303793137932379333793437935379363793737938379393794037941379423794337944379453794637947379483794937950379513795237953379543795537956379573795837959379603796137962379633796437965379663796737968379693797037971379723797337974379753797637977379783797937980379813798237983379843798537986379873798837989379903799137992379933799437995379963799737998379993800038001380023800338004380053800638007380083800938010380113801238013380143801538016380173801838019380203802138022380233802438025380263802738028380293803038031380323803338034380353803638037380383803938040380413804238043380443804538046380473804838049380503805138052380533805438055380563805738058380593806038061380623806338064380653806638067380683806938070380713807238073380743807538076380773807838079380803808138082380833808438085380863808738088380893809038091380923809338094380953809638097380983809938100381013810238103381043810538106381073810838109381103811138112381133811438115381163811738118381193812038121381223812338124381253812638127381283812938130381313813238133381343813538136381373813838139381403814138142381433814438145381463814738148381493815038151381523815338154381553815638157381583815938160381613816238163381643816538166381673816838169381703817138172381733817438175381763817738178381793818038181381823818338184381853818638187381883818938190381913819238193381943819538196381973819838199382003820138202382033820438205382063820738208382093821038211382123821338214382153821638217382183821938220382213822238223382243822538226382273822838229382303823138232382333823438235382363823738238382393824038241382423824338244382453824638247382483824938250382513825238253382543825538256382573825838259382603826138262382633826438265382663826738268382693827038271382723827338274382753827638277382783827938280382813828238283382843828538286382873828838289382903829138292382933829438295382963829738298382993830038301383023830338304383053830638307383083830938310383113831238313383143831538316383173831838319383203832138322383233832438325383263832738328383293833038331383323833338334383353833638337383383833938340383413834238343383443834538346383473834838349383503835138352383533835438355383563835738358383593836038361383623836338364383653836638367383683836938370383713837238373383743837538376383773837838379383803838138382383833838438385383863838738388383893839038391383923839338394383953839638397383983839938400384013840238403384043840538406384073840838409384103841138412384133841438415384163841738418384193842038421384223842338424384253842638427384283842938430384313843238433384343843538436384373843838439384403844138442384433844438445384463844738448384493845038451384523845338454384553845638457384583845938460384613846238463384643846538466384673846838469384703847138472384733847438475384763847738478384793848038481384823848338484384853848638487384883848938490384913849238493384943849538496384973849838499385003850138502385033850438505385063850738508385093851038511385123851338514385153851638517385183851938520385213852238523385243852538526385273852838529385303853138532385333853438535385363853738538385393854038541385423854338544385453854638547385483854938550385513855238553385543855538556385573855838559385603856138562385633856438565385663856738568385693857038571385723857338574385753857638577385783857938580385813858238583385843858538586385873858838589385903859138592385933859438595385963859738598385993860038601386023860338604386053860638607386083860938610386113861238613386143861538616386173861838619386203862138622386233862438625386263862738628386293863038631386323863338634386353863638637386383863938640386413864238643386443864538646386473864838649386503865138652386533865438655386563865738658386593866038661386623866338664386653866638667386683866938670386713867238673386743867538676386773867838679386803868138682386833868438685386863868738688386893869038691386923869338694386953869638697386983869938700387013870238703387043870538706387073870838709387103871138712387133871438715387163871738718387193872038721387223872338724387253872638727387283872938730387313873238733387343873538736387373873838739387403874138742387433874438745387463874738748387493875038751387523875338754387553875638757387583875938760387613876238763387643876538766387673876838769387703877138772387733877438775387763877738778387793878038781387823878338784387853878638787387883878938790387913879238793387943879538796387973879838799388003880138802388033880438805388063880738808388093881038811388123881338814388153881638817388183881938820388213882238823388243882538826388273882838829388303883138832388333883438835388363883738838388393884038841388423884338844388453884638847388483884938850388513885238853388543885538856388573885838859388603886138862388633886438865388663886738868388693887038871388723887338874388753887638877388783887938880388813888238883388843888538886388873888838889388903889138892388933889438895388963889738898388993890038901389023890338904389053890638907389083890938910389113891238913389143891538916389173891838919389203892138922389233892438925389263892738928389293893038931389323893338934389353893638937389383893938940389413894238943389443894538946389473894838949389503895138952389533895438955389563895738958389593896038961389623896338964389653896638967389683896938970389713897238973389743897538976389773897838979389803898138982389833898438985389863898738988389893899038991389923899338994389953899638997389983899939000390013900239003390043900539006390073900839009390103901139012390133901439015390163901739018390193902039021390223902339024390253902639027390283902939030390313903239033390343903539036390373903839039390403904139042390433904439045390463904739048390493905039051390523905339054390553905639057390583905939060390613906239063390643906539066390673906839069390703907139072390733907439075390763907739078390793908039081390823908339084390853908639087390883908939090390913909239093390943909539096390973909839099391003910139102391033910439105391063910739108391093911039111391123911339114391153911639117391183911939120391213912239123391243912539126391273912839129391303913139132391333913439135391363913739138391393914039141391423914339144391453914639147391483914939150391513915239153391543915539156391573915839159391603916139162391633916439165391663916739168391693917039171391723917339174391753917639177391783917939180391813918239183391843918539186391873918839189391903919139192391933919439195391963919739198391993920039201392023920339204392053920639207392083920939210392113921239213392143921539216392173921839219392203922139222392233922439225392263922739228392293923039231392323923339234392353923639237392383923939240392413924239243392443924539246392473924839249392503925139252392533925439255392563925739258392593926039261392623926339264392653926639267392683926939270392713927239273392743927539276392773927839279392803928139282392833928439285392863928739288392893929039291392923929339294392953929639297392983929939300393013930239303393043930539306393073930839309393103931139312393133931439315393163931739318393193932039321393223932339324393253932639327393283932939330393313933239333393343933539336393373933839339393403934139342393433934439345393463934739348393493935039351393523935339354393553935639357393583935939360393613936239363393643936539366393673936839369393703937139372393733937439375393763937739378393793938039381393823938339384393853938639387393883938939390393913939239393393943939539396393973939839399394003940139402394033940439405394063940739408394093941039411394123941339414394153941639417394183941939420394213942239423394243942539426394273942839429394303943139432394333943439435394363943739438394393944039441394423944339444394453944639447394483944939450394513945239453394543945539456394573945839459394603946139462394633946439465394663946739468394693947039471394723947339474394753947639477394783947939480394813948239483394843948539486394873948839489394903949139492394933949439495394963949739498394993950039501395023950339504395053950639507395083950939510395113951239513395143951539516395173951839519395203952139522395233952439525395263952739528395293953039531395323953339534395353953639537395383953939540395413954239543395443954539546395473954839549395503955139552395533955439555395563955739558395593956039561395623956339564395653956639567395683956939570395713957239573395743957539576395773957839579395803958139582395833958439585395863958739588395893959039591395923959339594395953959639597395983959939600396013960239603396043960539606396073960839609396103961139612396133961439615396163961739618396193962039621396223962339624396253962639627396283962939630396313963239633396343963539636396373963839639396403964139642396433964439645396463964739648396493965039651396523965339654396553965639657396583965939660396613966239663396643966539666396673966839669396703967139672396733967439675396763967739678396793968039681396823968339684396853968639687396883968939690396913969239693396943969539696396973969839699397003970139702397033970439705397063970739708397093971039711397123971339714397153971639717397183971939720397213972239723397243972539726397273972839729397303973139732397333973439735397363973739738397393974039741397423974339744397453974639747397483974939750397513975239753397543975539756397573975839759397603976139762397633976439765397663976739768397693977039771397723977339774397753977639777397783977939780397813978239783397843978539786397873978839789397903979139792397933979439795397963979739798397993980039801398023980339804398053980639807398083980939810398113981239813398143981539816398173981839819398203982139822398233982439825398263982739828398293983039831398323983339834398353983639837398383983939840398413984239843398443984539846398473984839849398503985139852398533985439855398563985739858398593986039861398623986339864398653986639867398683986939870398713987239873398743987539876398773987839879398803988139882398833988439885398863988739888398893989039891398923989339894398953989639897398983989939900399013990239903399043990539906399073990839909399103991139912399133991439915399163991739918399193992039921399223992339924399253992639927399283992939930399313993239933399343993539936399373993839939399403994139942399433994439945399463994739948399493995039951399523995339954399553995639957399583995939960399613996239963399643996539966399673996839969399703997139972399733997439975399763997739978399793998039981399823998339984399853998639987399883998939990399913999239993399943999539996399973999839999400004000140002400034000440005400064000740008400094001040011400124001340014400154001640017400184001940020400214002240023400244002540026400274002840029400304003140032400334003440035400364003740038400394004040041400424004340044400454004640047400484004940050400514005240053400544005540056400574005840059400604006140062400634006440065400664006740068400694007040071400724007340074400754007640077400784007940080400814008240083400844008540086400874008840089400904009140092400934009440095400964009740098400994010040101401024010340104401054010640107401084010940110401114011240113401144011540116401174011840119401204012140122401234012440125401264012740128401294013040131401324013340134401354013640137401384013940140401414014240143401444014540146401474014840149401504015140152401534015440155401564015740158401594016040161401624016340164401654016640167401684016940170401714017240173401744017540176401774017840179401804018140182401834018440185401864018740188401894019040191401924019340194401954019640197401984019940200402014020240203402044020540206402074020840209402104021140212402134021440215402164021740218402194022040221402224022340224402254022640227402284022940230402314023240233402344023540236402374023840239402404024140242402434024440245402464024740248402494025040251402524025340254402554025640257402584025940260402614026240263402644026540266402674026840269402704027140272402734027440275402764027740278402794028040281402824028340284402854028640287402884028940290402914029240293402944029540296402974029840299403004030140302403034030440305403064030740308403094031040311403124031340314403154031640317403184031940320403214032240323403244032540326403274032840329403304033140332403334033440335403364033740338403394034040341403424034340344403454034640347403484034940350403514035240353403544035540356403574035840359403604036140362403634036440365403664036740368403694037040371403724037340374403754037640377403784037940380403814038240383403844038540386403874038840389403904039140392403934039440395403964039740398403994040040401404024040340404404054040640407404084040940410404114041240413404144041540416404174041840419404204042140422404234042440425404264042740428404294043040431404324043340434404354043640437404384043940440404414044240443404444044540446404474044840449404504045140452404534045440455404564045740458404594046040461404624046340464404654046640467404684046940470404714047240473404744047540476404774047840479404804048140482404834048440485404864048740488404894049040491404924049340494404954049640497404984049940500405014050240503405044050540506405074050840509405104051140512405134051440515405164051740518405194052040521405224052340524405254052640527405284052940530405314053240533405344053540536405374053840539405404054140542405434054440545405464054740548405494055040551405524055340554405554055640557405584055940560405614056240563405644056540566405674056840569405704057140572405734057440575405764057740578405794058040581405824058340584405854058640587405884058940590405914059240593405944059540596405974059840599406004060140602406034060440605406064060740608406094061040611406124061340614406154061640617406184061940620406214062240623406244062540626406274062840629406304063140632406334063440635406364063740638406394064040641406424064340644406454064640647406484064940650406514065240653406544065540656406574065840659406604066140662406634066440665406664066740668406694067040671406724067340674406754067640677406784067940680406814068240683406844068540686406874068840689406904069140692406934069440695406964069740698406994070040701407024070340704407054070640707407084070940710407114071240713407144071540716407174071840719407204072140722407234072440725407264072740728407294073040731407324073340734407354073640737407384073940740407414074240743407444074540746407474074840749407504075140752407534075440755407564075740758407594076040761407624076340764407654076640767407684076940770407714077240773407744077540776407774077840779407804078140782407834078440785407864078740788407894079040791407924079340794407954079640797407984079940800408014080240803408044080540806408074080840809408104081140812408134081440815408164081740818408194082040821408224082340824408254082640827408284082940830408314083240833408344083540836408374083840839408404084140842408434084440845408464084740848408494085040851408524085340854408554085640857408584085940860408614086240863408644086540866408674086840869408704087140872408734087440875408764087740878408794088040881408824088340884408854088640887408884088940890408914089240893408944089540896408974089840899409004090140902409034090440905409064090740908409094091040911409124091340914409154091640917409184091940920409214092240923409244092540926409274092840929409304093140932409334093440935409364093740938409394094040941409424094340944409454094640947409484094940950409514095240953409544095540956409574095840959409604096140962409634096440965409664096740968409694097040971409724097340974409754097640977409784097940980409814098240983409844098540986409874098840989409904099140992409934099440995409964099740998409994100041001410024100341004410054100641007410084100941010410114101241013410144101541016410174101841019410204102141022410234102441025410264102741028410294103041031410324103341034410354103641037410384103941040410414104241043410444104541046410474104841049410504105141052410534105441055410564105741058410594106041061410624106341064410654106641067410684106941070410714107241073410744107541076410774107841079410804108141082410834108441085410864108741088410894109041091410924109341094410954109641097410984109941100411014110241103411044110541106411074110841109411104111141112411134111441115411164111741118411194112041121411224112341124411254112641127411284112941130411314113241133411344113541136411374113841139411404114141142411434114441145411464114741148411494115041151411524115341154411554115641157411584115941160411614116241163411644116541166411674116841169411704117141172411734117441175411764117741178411794118041181411824118341184411854118641187411884118941190411914119241193411944119541196411974119841199412004120141202412034120441205412064120741208412094121041211412124121341214412154121641217412184121941220412214122241223412244122541226412274122841229412304123141232412334123441235412364123741238412394124041241412424124341244412454124641247412484124941250412514125241253412544125541256412574125841259412604126141262412634126441265412664126741268412694127041271412724127341274412754127641277412784127941280412814128241283412844128541286412874128841289412904129141292412934129441295412964129741298412994130041301413024130341304413054130641307413084130941310413114131241313413144131541316413174131841319413204132141322413234132441325413264132741328413294133041331413324133341334413354133641337413384133941340413414134241343413444134541346413474134841349413504135141352413534135441355413564135741358413594136041361413624136341364413654136641367413684136941370413714137241373413744137541376413774137841379413804138141382413834138441385413864138741388413894139041391413924139341394413954139641397413984139941400414014140241403414044140541406414074140841409414104141141412414134141441415414164141741418414194142041421414224142341424414254142641427414284142941430414314143241433414344143541436414374143841439414404144141442414434144441445414464144741448414494145041451414524145341454414554145641457414584145941460414614146241463414644146541466414674146841469414704147141472414734147441475414764147741478414794148041481414824148341484414854148641487414884148941490414914149241493414944149541496414974149841499415004150141502415034150441505415064150741508415094151041511415124151341514415154151641517415184151941520415214152241523415244152541526415274152841529415304153141532415334153441535415364153741538415394154041541415424154341544415454154641547415484154941550415514155241553415544155541556415574155841559415604156141562415634156441565415664156741568415694157041571415724157341574415754157641577415784157941580415814158241583415844158541586415874158841589415904159141592415934159441595415964159741598415994160041601416024160341604416054160641607416084160941610416114161241613416144161541616416174161841619416204162141622416234162441625416264162741628416294163041631416324163341634416354163641637416384163941640416414164241643416444164541646416474164841649416504165141652416534165441655416564165741658416594166041661416624166341664416654166641667416684166941670416714167241673416744167541676416774167841679416804168141682416834168441685416864168741688416894169041691416924169341694416954169641697416984169941700417014170241703417044170541706417074170841709417104171141712417134171441715417164171741718417194172041721417224172341724417254172641727417284172941730417314173241733417344173541736417374173841739417404174141742417434174441745417464174741748417494175041751417524175341754417554175641757417584175941760417614176241763417644176541766417674176841769417704177141772417734177441775417764177741778417794178041781417824178341784417854178641787417884178941790417914179241793417944179541796417974179841799418004180141802418034180441805418064180741808418094181041811418124181341814418154181641817418184181941820418214182241823418244182541826418274182841829418304183141832418334183441835418364183741838418394184041841418424184341844418454184641847418484184941850418514185241853418544185541856418574185841859418604186141862418634186441865418664186741868418694187041871418724187341874418754187641877418784187941880418814188241883418844188541886418874188841889418904189141892418934189441895418964189741898418994190041901419024190341904419054190641907419084190941910419114191241913419144191541916419174191841919419204192141922419234192441925419264192741928419294193041931419324193341934419354193641937419384193941940419414194241943419444194541946419474194841949419504195141952419534195441955419564195741958419594196041961419624196341964419654196641967419684196941970419714197241973419744197541976419774197841979419804198141982419834198441985419864198741988419894199041991419924199341994419954199641997419984199942000420014200242003420044200542006420074200842009420104201142012420134201442015420164201742018420194202042021420224202342024420254202642027420284202942030420314203242033420344203542036420374203842039420404204142042420434204442045420464204742048420494205042051420524205342054420554205642057420584205942060420614206242063420644206542066420674206842069420704207142072420734207442075420764207742078420794208042081420824208342084420854208642087420884208942090420914209242093420944209542096420974209842099421004210142102421034210442105421064210742108421094211042111421124211342114421154211642117421184211942120421214212242123421244212542126421274212842129421304213142132421334213442135421364213742138421394214042141421424214342144421454214642147421484214942150421514215242153421544215542156421574215842159421604216142162421634216442165421664216742168421694217042171421724217342174421754217642177421784217942180421814218242183421844218542186421874218842189421904219142192421934219442195421964219742198421994220042201422024220342204422054220642207422084220942210422114221242213422144221542216422174221842219422204222142222422234222442225422264222742228422294223042231422324223342234422354223642237422384223942240422414224242243422444224542246422474224842249422504225142252422534225442255422564225742258422594226042261422624226342264422654226642267422684226942270422714227242273422744227542276422774227842279422804228142282422834228442285422864228742288422894229042291422924229342294422954229642297422984229942300423014230242303423044230542306423074230842309423104231142312423134231442315423164231742318423194232042321423224232342324423254232642327423284232942330423314233242333423344233542336423374233842339423404234142342423434234442345423464234742348423494235042351423524235342354423554235642357423584235942360423614236242363423644236542366423674236842369423704237142372423734237442375423764237742378423794238042381423824238342384423854238642387423884238942390423914239242393423944239542396423974239842399424004240142402424034240442405424064240742408424094241042411424124241342414424154241642417424184241942420424214242242423424244242542426424274242842429424304243142432424334243442435424364243742438424394244042441424424244342444424454244642447424484244942450424514245242453424544245542456424574245842459424604246142462424634246442465424664246742468424694247042471424724247342474424754247642477424784247942480424814248242483424844248542486424874248842489424904249142492424934249442495424964249742498424994250042501425024250342504425054250642507425084250942510425114251242513425144251542516425174251842519425204252142522425234252442525425264252742528425294253042531425324253342534425354253642537425384253942540425414254242543425444254542546425474254842549425504255142552425534255442555425564255742558425594256042561425624256342564425654256642567425684256942570425714257242573425744257542576425774257842579425804258142582425834258442585425864258742588425894259042591425924259342594425954259642597425984259942600426014260242603426044260542606426074260842609426104261142612426134261442615426164261742618426194262042621426224262342624426254262642627426284262942630426314263242633426344263542636426374263842639426404264142642426434264442645426464264742648426494265042651426524265342654426554265642657426584265942660426614266242663426644266542666426674266842669426704267142672426734267442675426764267742678426794268042681426824268342684426854268642687426884268942690
  1. declare module "cesium" {
  2. /**
  3. * Private interfaces to support PropertyBag being a dictionary-like object.
  4. */
  5. interface DictionaryLike {
  6. [index: string]: any;
  7. }
  8. /**
  9. * Enum containing WebGL Constant values by name.
  10. * for use without an active WebGL context, or in cases where certain constants are unavailable using the WebGL context
  11. * (For example, in [Safari 9]{@link https://github.com/CesiumGS/cesium/issues/2989}).
  12. *
  13. * These match the constants from the [WebGL 1.0]{@link https://www.khronos.org/registry/webgl/specs/latest/1.0/}
  14. * and [WebGL 2.0]{@link https://www.khronos.org/registry/webgl/specs/latest/2.0/}
  15. * specifications.
  16. */
  17. export enum WebGLConstants {
  18. DEPTH_BUFFER_BIT = 256,
  19. STENCIL_BUFFER_BIT = 1024,
  20. COLOR_BUFFER_BIT = 16384,
  21. POINTS = 0,
  22. LINES = 1,
  23. LINE_LOOP = 2,
  24. LINE_STRIP = 3,
  25. TRIANGLES = 4,
  26. TRIANGLE_STRIP = 5,
  27. TRIANGLE_FAN = 6,
  28. ZERO = 0,
  29. ONE = 1,
  30. SRC_COLOR = 768,
  31. ONE_MINUS_SRC_COLOR = 769,
  32. SRC_ALPHA = 770,
  33. ONE_MINUS_SRC_ALPHA = 771,
  34. DST_ALPHA = 772,
  35. ONE_MINUS_DST_ALPHA = 773,
  36. DST_COLOR = 774,
  37. ONE_MINUS_DST_COLOR = 775,
  38. SRC_ALPHA_SATURATE = 776,
  39. FUNC_ADD = 32774,
  40. BLEND_EQUATION = 32777,
  41. BLEND_EQUATION_RGB = 32777,
  42. BLEND_EQUATION_ALPHA = 34877,
  43. FUNC_SUBTRACT = 32778,
  44. FUNC_REVERSE_SUBTRACT = 32779,
  45. BLEND_DST_RGB = 32968,
  46. BLEND_SRC_RGB = 32969,
  47. BLEND_DST_ALPHA = 32970,
  48. BLEND_SRC_ALPHA = 32971,
  49. CONSTANT_COLOR = 32769,
  50. ONE_MINUS_CONSTANT_COLOR = 32770,
  51. CONSTANT_ALPHA = 32771,
  52. ONE_MINUS_CONSTANT_ALPHA = 32772,
  53. BLEND_COLOR = 32773,
  54. ARRAY_BUFFER = 34962,
  55. ELEMENT_ARRAY_BUFFER = 34963,
  56. ARRAY_BUFFER_BINDING = 34964,
  57. ELEMENT_ARRAY_BUFFER_BINDING = 34965,
  58. STREAM_DRAW = 35040,
  59. STATIC_DRAW = 35044,
  60. DYNAMIC_DRAW = 35048,
  61. BUFFER_SIZE = 34660,
  62. BUFFER_USAGE = 34661,
  63. CURRENT_VERTEX_ATTRIB = 34342,
  64. FRONT = 1028,
  65. BACK = 1029,
  66. FRONT_AND_BACK = 1032,
  67. CULL_FACE = 2884,
  68. BLEND = 3042,
  69. DITHER = 3024,
  70. STENCIL_TEST = 2960,
  71. DEPTH_TEST = 2929,
  72. SCISSOR_TEST = 3089,
  73. POLYGON_OFFSET_FILL = 32823,
  74. SAMPLE_ALPHA_TO_COVERAGE = 32926,
  75. SAMPLE_COVERAGE = 32928,
  76. NO_ERROR = 0,
  77. INVALID_ENUM = 1280,
  78. INVALID_VALUE = 1281,
  79. INVALID_OPERATION = 1282,
  80. OUT_OF_MEMORY = 1285,
  81. CW = 2304,
  82. CCW = 2305,
  83. LINE_WIDTH = 2849,
  84. ALIASED_POINT_SIZE_RANGE = 33901,
  85. ALIASED_LINE_WIDTH_RANGE = 33902,
  86. CULL_FACE_MODE = 2885,
  87. FRONT_FACE = 2886,
  88. DEPTH_RANGE = 2928,
  89. DEPTH_WRITEMASK = 2930,
  90. DEPTH_CLEAR_VALUE = 2931,
  91. DEPTH_FUNC = 2932,
  92. STENCIL_CLEAR_VALUE = 2961,
  93. STENCIL_FUNC = 2962,
  94. STENCIL_FAIL = 2964,
  95. STENCIL_PASS_DEPTH_FAIL = 2965,
  96. STENCIL_PASS_DEPTH_PASS = 2966,
  97. STENCIL_REF = 2967,
  98. STENCIL_VALUE_MASK = 2963,
  99. STENCIL_WRITEMASK = 2968,
  100. STENCIL_BACK_FUNC = 34816,
  101. STENCIL_BACK_FAIL = 34817,
  102. STENCIL_BACK_PASS_DEPTH_FAIL = 34818,
  103. STENCIL_BACK_PASS_DEPTH_PASS = 34819,
  104. STENCIL_BACK_REF = 36003,
  105. STENCIL_BACK_VALUE_MASK = 36004,
  106. STENCIL_BACK_WRITEMASK = 36005,
  107. VIEWPORT = 2978,
  108. SCISSOR_BOX = 3088,
  109. COLOR_CLEAR_VALUE = 3106,
  110. COLOR_WRITEMASK = 3107,
  111. UNPACK_ALIGNMENT = 3317,
  112. PACK_ALIGNMENT = 3333,
  113. MAX_TEXTURE_SIZE = 3379,
  114. MAX_VIEWPORT_DIMS = 3386,
  115. SUBPIXEL_BITS = 3408,
  116. RED_BITS = 3410,
  117. GREEN_BITS = 3411,
  118. BLUE_BITS = 3412,
  119. ALPHA_BITS = 3413,
  120. DEPTH_BITS = 3414,
  121. STENCIL_BITS = 3415,
  122. POLYGON_OFFSET_UNITS = 10752,
  123. POLYGON_OFFSET_FACTOR = 32824,
  124. TEXTURE_BINDING_2D = 32873,
  125. SAMPLE_BUFFERS = 32936,
  126. SAMPLES = 32937,
  127. SAMPLE_COVERAGE_VALUE = 32938,
  128. SAMPLE_COVERAGE_INVERT = 32939,
  129. COMPRESSED_TEXTURE_FORMATS = 34467,
  130. DONT_CARE = 4352,
  131. FASTEST = 4353,
  132. NICEST = 4354,
  133. GENERATE_MIPMAP_HINT = 33170,
  134. BYTE = 5120,
  135. UNSIGNED_BYTE = 5121,
  136. SHORT = 5122,
  137. UNSIGNED_SHORT = 5123,
  138. INT = 5124,
  139. UNSIGNED_INT = 5125,
  140. FLOAT = 5126,
  141. DEPTH_COMPONENT = 6402,
  142. ALPHA = 6406,
  143. RGB = 6407,
  144. RGBA = 6408,
  145. LUMINANCE = 6409,
  146. LUMINANCE_ALPHA = 6410,
  147. UNSIGNED_SHORT_4_4_4_4 = 32819,
  148. UNSIGNED_SHORT_5_5_5_1 = 32820,
  149. UNSIGNED_SHORT_5_6_5 = 33635,
  150. FRAGMENT_SHADER = 35632,
  151. VERTEX_SHADER = 35633,
  152. MAX_VERTEX_ATTRIBS = 34921,
  153. MAX_VERTEX_UNIFORM_VECTORS = 36347,
  154. MAX_VARYING_VECTORS = 36348,
  155. MAX_COMBINED_TEXTURE_IMAGE_UNITS = 35661,
  156. MAX_VERTEX_TEXTURE_IMAGE_UNITS = 35660,
  157. MAX_TEXTURE_IMAGE_UNITS = 34930,
  158. MAX_FRAGMENT_UNIFORM_VECTORS = 36349,
  159. SHADER_TYPE = 35663,
  160. DELETE_STATUS = 35712,
  161. LINK_STATUS = 35714,
  162. VALIDATE_STATUS = 35715,
  163. ATTACHED_SHADERS = 35717,
  164. ACTIVE_UNIFORMS = 35718,
  165. ACTIVE_ATTRIBUTES = 35721,
  166. SHADING_LANGUAGE_VERSION = 35724,
  167. CURRENT_PROGRAM = 35725,
  168. NEVER = 512,
  169. LESS = 513,
  170. EQUAL = 514,
  171. LEQUAL = 515,
  172. GREATER = 516,
  173. NOTEQUAL = 517,
  174. GEQUAL = 518,
  175. ALWAYS = 519,
  176. KEEP = 7680,
  177. REPLACE = 7681,
  178. INCR = 7682,
  179. DECR = 7683,
  180. INVERT = 5386,
  181. INCR_WRAP = 34055,
  182. DECR_WRAP = 34056,
  183. VENDOR = 7936,
  184. RENDERER = 7937,
  185. VERSION = 7938,
  186. NEAREST = 9728,
  187. LINEAR = 9729,
  188. NEAREST_MIPMAP_NEAREST = 9984,
  189. LINEAR_MIPMAP_NEAREST = 9985,
  190. NEAREST_MIPMAP_LINEAR = 9986,
  191. LINEAR_MIPMAP_LINEAR = 9987,
  192. TEXTURE_MAG_FILTER = 10240,
  193. TEXTURE_MIN_FILTER = 10241,
  194. TEXTURE_WRAP_S = 10242,
  195. TEXTURE_WRAP_T = 10243,
  196. TEXTURE_2D = 3553,
  197. TEXTURE = 5890,
  198. TEXTURE_CUBE_MAP = 34067,
  199. TEXTURE_BINDING_CUBE_MAP = 34068,
  200. TEXTURE_CUBE_MAP_POSITIVE_X = 34069,
  201. TEXTURE_CUBE_MAP_NEGATIVE_X = 34070,
  202. TEXTURE_CUBE_MAP_POSITIVE_Y = 34071,
  203. TEXTURE_CUBE_MAP_NEGATIVE_Y = 34072,
  204. TEXTURE_CUBE_MAP_POSITIVE_Z = 34073,
  205. TEXTURE_CUBE_MAP_NEGATIVE_Z = 34074,
  206. MAX_CUBE_MAP_TEXTURE_SIZE = 34076,
  207. TEXTURE0 = 33984,
  208. TEXTURE1 = 33985,
  209. TEXTURE2 = 33986,
  210. TEXTURE3 = 33987,
  211. TEXTURE4 = 33988,
  212. TEXTURE5 = 33989,
  213. TEXTURE6 = 33990,
  214. TEXTURE7 = 33991,
  215. TEXTURE8 = 33992,
  216. TEXTURE9 = 33993,
  217. TEXTURE10 = 33994,
  218. TEXTURE11 = 33995,
  219. TEXTURE12 = 33996,
  220. TEXTURE13 = 33997,
  221. TEXTURE14 = 33998,
  222. TEXTURE15 = 33999,
  223. TEXTURE16 = 34000,
  224. TEXTURE17 = 34001,
  225. TEXTURE18 = 34002,
  226. TEXTURE19 = 34003,
  227. TEXTURE20 = 34004,
  228. TEXTURE21 = 34005,
  229. TEXTURE22 = 34006,
  230. TEXTURE23 = 34007,
  231. TEXTURE24 = 34008,
  232. TEXTURE25 = 34009,
  233. TEXTURE26 = 34010,
  234. TEXTURE27 = 34011,
  235. TEXTURE28 = 34012,
  236. TEXTURE29 = 34013,
  237. TEXTURE30 = 34014,
  238. TEXTURE31 = 34015,
  239. ACTIVE_TEXTURE = 34016,
  240. REPEAT = 10497,
  241. CLAMP_TO_EDGE = 33071,
  242. MIRRORED_REPEAT = 33648,
  243. FLOAT_VEC2 = 35664,
  244. FLOAT_VEC3 = 35665,
  245. FLOAT_VEC4 = 35666,
  246. INT_VEC2 = 35667,
  247. INT_VEC3 = 35668,
  248. INT_VEC4 = 35669,
  249. BOOL = 35670,
  250. BOOL_VEC2 = 35671,
  251. BOOL_VEC3 = 35672,
  252. BOOL_VEC4 = 35673,
  253. FLOAT_MAT2 = 35674,
  254. FLOAT_MAT3 = 35675,
  255. FLOAT_MAT4 = 35676,
  256. SAMPLER_2D = 35678,
  257. SAMPLER_CUBE = 35680,
  258. VERTEX_ATTRIB_ARRAY_ENABLED = 34338,
  259. VERTEX_ATTRIB_ARRAY_SIZE = 34339,
  260. VERTEX_ATTRIB_ARRAY_STRIDE = 34340,
  261. VERTEX_ATTRIB_ARRAY_TYPE = 34341,
  262. VERTEX_ATTRIB_ARRAY_NORMALIZED = 34922,
  263. VERTEX_ATTRIB_ARRAY_POINTER = 34373,
  264. VERTEX_ATTRIB_ARRAY_BUFFER_BINDING = 34975,
  265. IMPLEMENTATION_COLOR_READ_TYPE = 35738,
  266. IMPLEMENTATION_COLOR_READ_FORMAT = 35739,
  267. COMPILE_STATUS = 35713,
  268. LOW_FLOAT = 36336,
  269. MEDIUM_FLOAT = 36337,
  270. HIGH_FLOAT = 36338,
  271. LOW_INT = 36339,
  272. MEDIUM_INT = 36340,
  273. HIGH_INT = 36341,
  274. FRAMEBUFFER = 36160,
  275. RENDERBUFFER = 36161,
  276. RGBA4 = 32854,
  277. RGB5_A1 = 32855,
  278. RGB565 = 36194,
  279. DEPTH_COMPONENT16 = 33189,
  280. STENCIL_INDEX = 6401,
  281. STENCIL_INDEX8 = 36168,
  282. DEPTH_STENCIL = 34041,
  283. RENDERBUFFER_WIDTH = 36162,
  284. RENDERBUFFER_HEIGHT = 36163,
  285. RENDERBUFFER_INTERNAL_FORMAT = 36164,
  286. RENDERBUFFER_RED_SIZE = 36176,
  287. RENDERBUFFER_GREEN_SIZE = 36177,
  288. RENDERBUFFER_BLUE_SIZE = 36178,
  289. RENDERBUFFER_ALPHA_SIZE = 36179,
  290. RENDERBUFFER_DEPTH_SIZE = 36180,
  291. RENDERBUFFER_STENCIL_SIZE = 36181,
  292. FRAMEBUFFER_ATTACHMENT_OBJECT_TYPE = 36048,
  293. FRAMEBUFFER_ATTACHMENT_OBJECT_NAME = 36049,
  294. FRAMEBUFFER_ATTACHMENT_TEXTURE_LEVEL = 36050,
  295. FRAMEBUFFER_ATTACHMENT_TEXTURE_CUBE_MAP_FACE = 36051,
  296. COLOR_ATTACHMENT0 = 36064,
  297. DEPTH_ATTACHMENT = 36096,
  298. STENCIL_ATTACHMENT = 36128,
  299. DEPTH_STENCIL_ATTACHMENT = 33306,
  300. NONE = 0,
  301. FRAMEBUFFER_COMPLETE = 36053,
  302. FRAMEBUFFER_INCOMPLETE_ATTACHMENT = 36054,
  303. FRAMEBUFFER_INCOMPLETE_MISSING_ATTACHMENT = 36055,
  304. FRAMEBUFFER_INCOMPLETE_DIMENSIONS = 36057,
  305. FRAMEBUFFER_UNSUPPORTED = 36061,
  306. FRAMEBUFFER_BINDING = 36006,
  307. RENDERBUFFER_BINDING = 36007,
  308. MAX_RENDERBUFFER_SIZE = 34024,
  309. INVALID_FRAMEBUFFER_OPERATION = 1286,
  310. UNPACK_FLIP_Y_WEBGL = 37440,
  311. UNPACK_PREMULTIPLY_ALPHA_WEBGL = 37441,
  312. CONTEXT_LOST_WEBGL = 37442,
  313. UNPACK_COLORSPACE_CONVERSION_WEBGL = 37443,
  314. BROWSER_DEFAULT_WEBGL = 37444,
  315. COMPRESSED_RGB_S3TC_DXT1_EXT = 33776,
  316. COMPRESSED_RGBA_S3TC_DXT1_EXT = 33777,
  317. COMPRESSED_RGBA_S3TC_DXT3_EXT = 33778,
  318. COMPRESSED_RGBA_S3TC_DXT5_EXT = 33779,
  319. COMPRESSED_RGB_PVRTC_4BPPV1_IMG = 35840,
  320. COMPRESSED_RGB_PVRTC_2BPPV1_IMG = 35841,
  321. COMPRESSED_RGBA_PVRTC_4BPPV1_IMG = 35842,
  322. COMPRESSED_RGBA_PVRTC_2BPPV1_IMG = 35843,
  323. COMPRESSED_RGB_ETC1_WEBGL = 36196,
  324. HALF_FLOAT_OES = 36193,
  325. DOUBLE = 5130,
  326. READ_BUFFER = 3074,
  327. UNPACK_ROW_LENGTH = 3314,
  328. UNPACK_SKIP_ROWS = 3315,
  329. UNPACK_SKIP_PIXELS = 3316,
  330. PACK_ROW_LENGTH = 3330,
  331. PACK_SKIP_ROWS = 3331,
  332. PACK_SKIP_PIXELS = 3332,
  333. COLOR = 6144,
  334. DEPTH = 6145,
  335. STENCIL = 6146,
  336. RED = 6403,
  337. RGB8 = 32849,
  338. RGBA8 = 32856,
  339. RGB10_A2 = 32857,
  340. TEXTURE_BINDING_3D = 32874,
  341. UNPACK_SKIP_IMAGES = 32877,
  342. UNPACK_IMAGE_HEIGHT = 32878,
  343. TEXTURE_3D = 32879,
  344. TEXTURE_WRAP_R = 32882,
  345. MAX_3D_TEXTURE_SIZE = 32883,
  346. UNSIGNED_INT_2_10_10_10_REV = 33640,
  347. MAX_ELEMENTS_VERTICES = 33000,
  348. MAX_ELEMENTS_INDICES = 33001,
  349. TEXTURE_MIN_LOD = 33082,
  350. TEXTURE_MAX_LOD = 33083,
  351. TEXTURE_BASE_LEVEL = 33084,
  352. TEXTURE_MAX_LEVEL = 33085,
  353. MIN = 32775,
  354. MAX = 32776,
  355. DEPTH_COMPONENT24 = 33190,
  356. MAX_TEXTURE_LOD_BIAS = 34045,
  357. TEXTURE_COMPARE_MODE = 34892,
  358. TEXTURE_COMPARE_FUNC = 34893,
  359. CURRENT_QUERY = 34917,
  360. QUERY_RESULT = 34918,
  361. QUERY_RESULT_AVAILABLE = 34919,
  362. STREAM_READ = 35041,
  363. STREAM_COPY = 35042,
  364. STATIC_READ = 35045,
  365. STATIC_COPY = 35046,
  366. DYNAMIC_READ = 35049,
  367. DYNAMIC_COPY = 35050,
  368. MAX_DRAW_BUFFERS = 34852,
  369. DRAW_BUFFER0 = 34853,
  370. DRAW_BUFFER1 = 34854,
  371. DRAW_BUFFER2 = 34855,
  372. DRAW_BUFFER3 = 34856,
  373. DRAW_BUFFER4 = 34857,
  374. DRAW_BUFFER5 = 34858,
  375. DRAW_BUFFER6 = 34859,
  376. DRAW_BUFFER7 = 34860,
  377. DRAW_BUFFER8 = 34861,
  378. DRAW_BUFFER9 = 34862,
  379. DRAW_BUFFER10 = 34863,
  380. DRAW_BUFFER11 = 34864,
  381. DRAW_BUFFER12 = 34865,
  382. DRAW_BUFFER13 = 34866,
  383. DRAW_BUFFER14 = 34867,
  384. DRAW_BUFFER15 = 34868,
  385. MAX_FRAGMENT_UNIFORM_COMPONENTS = 35657,
  386. MAX_VERTEX_UNIFORM_COMPONENTS = 35658,
  387. SAMPLER_3D = 35679,
  388. SAMPLER_2D_SHADOW = 35682,
  389. FRAGMENT_SHADER_DERIVATIVE_HINT = 35723,
  390. PIXEL_PACK_BUFFER = 35051,
  391. PIXEL_UNPACK_BUFFER = 35052,
  392. PIXEL_PACK_BUFFER_BINDING = 35053,
  393. PIXEL_UNPACK_BUFFER_BINDING = 35055,
  394. FLOAT_MAT2x3 = 35685,
  395. FLOAT_MAT2x4 = 35686,
  396. FLOAT_MAT3x2 = 35687,
  397. FLOAT_MAT3x4 = 35688,
  398. FLOAT_MAT4x2 = 35689,
  399. FLOAT_MAT4x3 = 35690,
  400. SRGB = 35904,
  401. SRGB8 = 35905,
  402. SRGB8_ALPHA8 = 35907,
  403. COMPARE_REF_TO_TEXTURE = 34894,
  404. RGBA32F = 34836,
  405. RGB32F = 34837,
  406. RGBA16F = 34842,
  407. RGB16F = 34843,
  408. VERTEX_ATTRIB_ARRAY_INTEGER = 35069,
  409. MAX_ARRAY_TEXTURE_LAYERS = 35071,
  410. MIN_PROGRAM_TEXEL_OFFSET = 35076,
  411. MAX_PROGRAM_TEXEL_OFFSET = 35077,
  412. MAX_VARYING_COMPONENTS = 35659,
  413. TEXTURE_2D_ARRAY = 35866,
  414. TEXTURE_BINDING_2D_ARRAY = 35869,
  415. R11F_G11F_B10F = 35898,
  416. UNSIGNED_INT_10F_11F_11F_REV = 35899,
  417. RGB9_E5 = 35901,
  418. UNSIGNED_INT_5_9_9_9_REV = 35902,
  419. TRANSFORM_FEEDBACK_BUFFER_MODE = 35967,
  420. MAX_TRANSFORM_FEEDBACK_SEPARATE_COMPONENTS = 35968,
  421. TRANSFORM_FEEDBACK_VARYINGS = 35971,
  422. TRANSFORM_FEEDBACK_BUFFER_START = 35972,
  423. TRANSFORM_FEEDBACK_BUFFER_SIZE = 35973,
  424. TRANSFORM_FEEDBACK_PRIMITIVES_WRITTEN = 35976,
  425. RASTERIZER_DISCARD = 35977,
  426. MAX_TRANSFORM_FEEDBACK_INTERLEAVED_COMPONENTS = 35978,
  427. MAX_TRANSFORM_FEEDBACK_SEPARATE_ATTRIBS = 35979,
  428. INTERLEAVED_ATTRIBS = 35980,
  429. SEPARATE_ATTRIBS = 35981,
  430. TRANSFORM_FEEDBACK_BUFFER = 35982,
  431. TRANSFORM_FEEDBACK_BUFFER_BINDING = 35983,
  432. RGBA32UI = 36208,
  433. RGB32UI = 36209,
  434. RGBA16UI = 36214,
  435. RGB16UI = 36215,
  436. RGBA8UI = 36220,
  437. RGB8UI = 36221,
  438. RGBA32I = 36226,
  439. RGB32I = 36227,
  440. RGBA16I = 36232,
  441. RGB16I = 36233,
  442. RGBA8I = 36238,
  443. RGB8I = 36239,
  444. RED_INTEGER = 36244,
  445. RGB_INTEGER = 36248,
  446. RGBA_INTEGER = 36249,
  447. SAMPLER_2D_ARRAY = 36289,
  448. SAMPLER_2D_ARRAY_SHADOW = 36292,
  449. SAMPLER_CUBE_SHADOW = 36293,
  450. UNSIGNED_INT_VEC2 = 36294,
  451. UNSIGNED_INT_VEC3 = 36295,
  452. UNSIGNED_INT_VEC4 = 36296,
  453. INT_SAMPLER_2D = 36298,
  454. INT_SAMPLER_3D = 36299,
  455. INT_SAMPLER_CUBE = 36300,
  456. INT_SAMPLER_2D_ARRAY = 36303,
  457. UNSIGNED_INT_SAMPLER_2D = 36306,
  458. UNSIGNED_INT_SAMPLER_3D = 36307,
  459. UNSIGNED_INT_SAMPLER_CUBE = 36308,
  460. UNSIGNED_INT_SAMPLER_2D_ARRAY = 36311,
  461. DEPTH_COMPONENT32F = 36012,
  462. DEPTH32F_STENCIL8 = 36013,
  463. FLOAT_32_UNSIGNED_INT_24_8_REV = 36269,
  464. FRAMEBUFFER_ATTACHMENT_COLOR_ENCODING = 33296,
  465. FRAMEBUFFER_ATTACHMENT_COMPONENT_TYPE = 33297,
  466. FRAMEBUFFER_ATTACHMENT_RED_SIZE = 33298,
  467. FRAMEBUFFER_ATTACHMENT_GREEN_SIZE = 33299,
  468. FRAMEBUFFER_ATTACHMENT_BLUE_SIZE = 33300,
  469. FRAMEBUFFER_ATTACHMENT_ALPHA_SIZE = 33301,
  470. FRAMEBUFFER_ATTACHMENT_DEPTH_SIZE = 33302,
  471. FRAMEBUFFER_ATTACHMENT_STENCIL_SIZE = 33303,
  472. FRAMEBUFFER_DEFAULT = 33304,
  473. UNSIGNED_INT_24_8 = 34042,
  474. DEPTH24_STENCIL8 = 35056,
  475. UNSIGNED_NORMALIZED = 35863,
  476. DRAW_FRAMEBUFFER_BINDING = 36006,
  477. READ_FRAMEBUFFER = 36008,
  478. DRAW_FRAMEBUFFER = 36009,
  479. READ_FRAMEBUFFER_BINDING = 36010,
  480. RENDERBUFFER_SAMPLES = 36011,
  481. FRAMEBUFFER_ATTACHMENT_TEXTURE_LAYER = 36052,
  482. MAX_COLOR_ATTACHMENTS = 36063,
  483. COLOR_ATTACHMENT1 = 36065,
  484. COLOR_ATTACHMENT2 = 36066,
  485. COLOR_ATTACHMENT3 = 36067,
  486. COLOR_ATTACHMENT4 = 36068,
  487. COLOR_ATTACHMENT5 = 36069,
  488. COLOR_ATTACHMENT6 = 36070,
  489. COLOR_ATTACHMENT7 = 36071,
  490. COLOR_ATTACHMENT8 = 36072,
  491. COLOR_ATTACHMENT9 = 36073,
  492. COLOR_ATTACHMENT10 = 36074,
  493. COLOR_ATTACHMENT11 = 36075,
  494. COLOR_ATTACHMENT12 = 36076,
  495. COLOR_ATTACHMENT13 = 36077,
  496. COLOR_ATTACHMENT14 = 36078,
  497. COLOR_ATTACHMENT15 = 36079,
  498. FRAMEBUFFER_INCOMPLETE_MULTISAMPLE = 36182,
  499. MAX_SAMPLES = 36183,
  500. HALF_FLOAT = 5131,
  501. RG = 33319,
  502. RG_INTEGER = 33320,
  503. R8 = 33321,
  504. RG8 = 33323,
  505. R16F = 33325,
  506. R32F = 33326,
  507. RG16F = 33327,
  508. RG32F = 33328,
  509. R8I = 33329,
  510. R8UI = 33330,
  511. R16I = 33331,
  512. R16UI = 33332,
  513. R32I = 33333,
  514. R32UI = 33334,
  515. RG8I = 33335,
  516. RG8UI = 33336,
  517. RG16I = 33337,
  518. RG16UI = 33338,
  519. RG32I = 33339,
  520. RG32UI = 33340,
  521. VERTEX_ARRAY_BINDING = 34229,
  522. R8_SNORM = 36756,
  523. RG8_SNORM = 36757,
  524. RGB8_SNORM = 36758,
  525. RGBA8_SNORM = 36759,
  526. SIGNED_NORMALIZED = 36764,
  527. COPY_READ_BUFFER = 36662,
  528. COPY_WRITE_BUFFER = 36663,
  529. COPY_READ_BUFFER_BINDING = 36662,
  530. COPY_WRITE_BUFFER_BINDING = 36663,
  531. UNIFORM_BUFFER = 35345,
  532. UNIFORM_BUFFER_BINDING = 35368,
  533. UNIFORM_BUFFER_START = 35369,
  534. UNIFORM_BUFFER_SIZE = 35370,
  535. MAX_VERTEX_UNIFORM_BLOCKS = 35371,
  536. MAX_FRAGMENT_UNIFORM_BLOCKS = 35373,
  537. MAX_COMBINED_UNIFORM_BLOCKS = 35374,
  538. MAX_UNIFORM_BUFFER_BINDINGS = 35375,
  539. MAX_UNIFORM_BLOCK_SIZE = 35376,
  540. MAX_COMBINED_VERTEX_UNIFORM_COMPONENTS = 35377,
  541. MAX_COMBINED_FRAGMENT_UNIFORM_COMPONENTS = 35379,
  542. UNIFORM_BUFFER_OFFSET_ALIGNMENT = 35380,
  543. ACTIVE_UNIFORM_BLOCKS = 35382,
  544. UNIFORM_TYPE = 35383,
  545. UNIFORM_SIZE = 35384,
  546. UNIFORM_BLOCK_INDEX = 35386,
  547. UNIFORM_OFFSET = 35387,
  548. UNIFORM_ARRAY_STRIDE = 35388,
  549. UNIFORM_MATRIX_STRIDE = 35389,
  550. UNIFORM_IS_ROW_MAJOR = 35390,
  551. UNIFORM_BLOCK_BINDING = 35391,
  552. UNIFORM_BLOCK_DATA_SIZE = 35392,
  553. UNIFORM_BLOCK_ACTIVE_UNIFORMS = 35394,
  554. UNIFORM_BLOCK_ACTIVE_UNIFORM_INDICES = 35395,
  555. UNIFORM_BLOCK_REFERENCED_BY_VERTEX_SHADER = 35396,
  556. UNIFORM_BLOCK_REFERENCED_BY_FRAGMENT_SHADER = 35398,
  557. INVALID_INDEX = 4294967295,
  558. MAX_VERTEX_OUTPUT_COMPONENTS = 37154,
  559. MAX_FRAGMENT_INPUT_COMPONENTS = 37157,
  560. MAX_SERVER_WAIT_TIMEOUT = 37137,
  561. OBJECT_TYPE = 37138,
  562. SYNC_CONDITION = 37139,
  563. SYNC_STATUS = 37140,
  564. SYNC_FLAGS = 37141,
  565. SYNC_FENCE = 37142,
  566. SYNC_GPU_COMMANDS_COMPLETE = 37143,
  567. UNSIGNALED = 37144,
  568. SIGNALED = 37145,
  569. ALREADY_SIGNALED = 37146,
  570. TIMEOUT_EXPIRED = 37147,
  571. CONDITION_SATISFIED = 37148,
  572. WAIT_FAILED = 37149,
  573. SYNC_FLUSH_COMMANDS_BIT = 1,
  574. VERTEX_ATTRIB_ARRAY_DIVISOR = 35070,
  575. ANY_SAMPLES_PASSED = 35887,
  576. ANY_SAMPLES_PASSED_CONSERVATIVE = 36202,
  577. SAMPLER_BINDING = 35097,
  578. RGB10_A2UI = 36975,
  579. INT_2_10_10_10_REV = 36255,
  580. TRANSFORM_FEEDBACK = 36386,
  581. TRANSFORM_FEEDBACK_PAUSED = 36387,
  582. TRANSFORM_FEEDBACK_ACTIVE = 36388,
  583. TRANSFORM_FEEDBACK_BINDING = 36389,
  584. COMPRESSED_R11_EAC = 37488,
  585. COMPRESSED_SIGNED_R11_EAC = 37489,
  586. COMPRESSED_RG11_EAC = 37490,
  587. COMPRESSED_SIGNED_RG11_EAC = 37491,
  588. COMPRESSED_RGB8_ETC2 = 37492,
  589. COMPRESSED_SRGB8_ETC2 = 37493,
  590. COMPRESSED_RGB8_PUNCHTHROUGH_ALPHA1_ETC2 = 37494,
  591. COMPRESSED_SRGB8_PUNCHTHROUGH_ALPHA1_ETC2 = 37495,
  592. COMPRESSED_RGBA8_ETC2_EAC = 37496,
  593. COMPRESSED_SRGB8_ALPHA8_ETC2_EAC = 37497,
  594. TEXTURE_IMMUTABLE_FORMAT = 37167,
  595. MAX_ELEMENT_INDEX = 36203,
  596. TEXTURE_IMMUTABLE_LEVELS = 33503,
  597. MAX_TEXTURE_MAX_ANISOTROPY_EXT = 34047
  598. }/**
  599. * A {@link TerrainProvider} that produces terrain geometry by tessellating height maps
  600. * retrieved from Elevation Tiles of an an ArcGIS ImageService.
  601. * @example
  602. * var terrainProvider = new Cesium.ArcGISTiledElevationTerrainProvider({
  603. * url : 'https://elevation3d.arcgis.com/arcgis/rest/services/WorldElevation3D/Terrain3D/ImageServer',
  604. * token : 'KED1aF_I4UzXOHy3BnhwyBHU4l5oY6rO6walkmHoYqGp4XyIWUd5YZUC1ZrLAzvV40pR6gBXQayh0eFA8m6vPg..'
  605. * });
  606. * viewer.terrainProvider = terrainProvider;
  607. *
  608. *
  609. * @param options - Object with the following properties:
  610. * @param options.url - The URL of the ArcGIS ImageServer service.
  611. * @param [options.token] - The authorization token to use to connect to the service.
  612. * @param [options.ellipsoid] - The ellipsoid. If the tilingScheme is specified,
  613. * this parameter is ignored and the tiling scheme's ellipsoid is used instead.
  614. * If neither parameter is specified, the WGS84 ellipsoid is used.
  615. */
  616. export class ArcGISTiledElevationTerrainProvider {
  617. constructor(options: {
  618. url: Resource | string | Promise<Resource> | Promise<string>;
  619. token?: string;
  620. ellipsoid?: Ellipsoid;
  621. });
  622. /**
  623. * Gets an event that is raised when the terrain provider encounters an asynchronous error. By subscribing
  624. * to the event, you will be notified of the error and can potentially recover from it. Event listeners
  625. * are passed an instance of {@link TileProviderError}.
  626. */
  627. errorEvent: Event;
  628. /**
  629. * Gets the credit to display when this terrain provider is active. Typically this is used to credit
  630. * the source of the terrain. This function should not be called before {@link ArcGISTiledElevationTerrainProvider#ready} returns true.
  631. */
  632. credit: Credit;
  633. /**
  634. * Gets the tiling scheme used by this provider. This function should
  635. * not be called before {@link ArcGISTiledElevationTerrainProvider#ready} returns true.
  636. */
  637. tilingScheme: GeographicTilingScheme;
  638. /**
  639. * Gets a value indicating whether or not the provider is ready for use.
  640. */
  641. ready: boolean;
  642. /**
  643. * Gets a promise that resolves to true when the provider is ready for use.
  644. */
  645. readonly readyPromise: Promise<boolean>;
  646. /**
  647. * Gets a value indicating whether or not the provider includes a water mask. The water mask
  648. * indicates which areas of the globe are water rather than land, so they can be rendered
  649. * as a reflective surface with animated waves. This function should not be
  650. * called before {@link ArcGISTiledElevationTerrainProvider#ready} returns true.
  651. */
  652. hasWaterMask: boolean;
  653. /**
  654. * Gets a value indicating whether or not the requested tiles include vertex normals.
  655. * This function should not be called before {@link ArcGISTiledElevationTerrainProvider#ready} returns true.
  656. */
  657. hasVertexNormals: boolean;
  658. /**
  659. * Gets an object that can be used to determine availability of terrain from this provider, such as
  660. * at points and in rectangles. This function should not be called before
  661. * {@link TerrainProvider#ready} returns true. This property may be undefined if availability
  662. * information is not available.
  663. */
  664. availability: TileAvailability;
  665. /**
  666. * Requests the geometry for a given tile. This function should not be called before
  667. * {@link ArcGISTiledElevationTerrainProvider#ready} returns true. The result includes terrain
  668. * data and indicates that all child tiles are available.
  669. * @param x - The X coordinate of the tile for which to request geometry.
  670. * @param y - The Y coordinate of the tile for which to request geometry.
  671. * @param level - The level of the tile for which to request geometry.
  672. * @param [request] - The request object. Intended for internal use only.
  673. * @returns A promise for the requested geometry. If this method
  674. * returns undefined instead of a promise, it is an indication that too many requests are already
  675. * pending and the request will be retried later.
  676. */
  677. requestTileGeometry(x: number, y: number, level: number, request?: Request): Promise<TerrainData> | undefined;
  678. /**
  679. * Gets the maximum geometric error allowed in a tile at a given level.
  680. * @param level - The tile level for which to get the maximum geometric error.
  681. * @returns The maximum geometric error.
  682. */
  683. getLevelMaximumGeometricError(level: number): number;
  684. /**
  685. * Determines whether data for a tile is available to be loaded.
  686. * @param x - The X coordinate of the tile for which to request geometry.
  687. * @param y - The Y coordinate of the tile for which to request geometry.
  688. * @param level - The level of the tile for which to request geometry.
  689. * @returns Undefined if not supported, otherwise true or false.
  690. */
  691. getTileDataAvailable(x: number, y: number, level: number): boolean;
  692. /**
  693. * Makes sure we load availability data for a tile
  694. * @param x - The X coordinate of the tile for which to request geometry.
  695. * @param y - The Y coordinate of the tile for which to request geometry.
  696. * @param level - The level of the tile for which to request geometry.
  697. * @returns Undefined if nothing need to be loaded or a Promise that resolves when all required tiles are loaded
  698. */
  699. loadTileDataAvailability(x: number, y: number, level: number): undefined | Promise<void>;
  700. }
  701. /**
  702. * ArcType defines the path that should be taken connecting vertices.
  703. */
  704. export enum ArcType {
  705. /**
  706. * Straight line that does not conform to the surface of the ellipsoid.
  707. */
  708. NONE = 0,
  709. /**
  710. * Follow geodesic path.
  711. */
  712. GEODESIC = 1,
  713. /**
  714. * Follow rhumb or loxodrome path.
  715. */
  716. RHUMB = 2
  717. }
  718. /**
  719. * A collection of key-value pairs that is stored as a hash for easy
  720. * lookup but also provides an array for fast iteration.
  721. */
  722. export class AssociativeArray {
  723. constructor();
  724. /**
  725. * Gets the number of items in the collection.
  726. */
  727. length: number;
  728. /**
  729. * Gets an unordered array of all values in the collection.
  730. * This is a live array that will automatically reflect the values in the collection,
  731. * it should not be modified directly.
  732. */
  733. values: any[];
  734. /**
  735. * Determines if the provided key is in the array.
  736. * @param key - The key to check.
  737. * @returns <code>true</code> if the key is in the array, <code>false</code> otherwise.
  738. */
  739. contains(key: string | number): boolean;
  740. /**
  741. * Associates the provided key with the provided value. If the key already
  742. * exists, it is overwritten with the new value.
  743. * @param key - A unique identifier.
  744. * @param value - The value to associate with the provided key.
  745. */
  746. set(key: string | number, value: any): void;
  747. /**
  748. * Retrieves the value associated with the provided key.
  749. * @param key - The key whose value is to be retrieved.
  750. * @returns The associated value, or undefined if the key does not exist in the collection.
  751. */
  752. get(key: string | number): any;
  753. /**
  754. * Removes a key-value pair from the collection.
  755. * @param key - The key to be removed.
  756. * @returns True if it was removed, false if the key was not in the collection.
  757. */
  758. remove(key: string | number): boolean;
  759. /**
  760. * Clears the collection.
  761. */
  762. removeAll(): void;
  763. }
  764. /**
  765. * Creates an instance of an AxisAlignedBoundingBox from the minimum and maximum points along the x, y, and z axes.
  766. * @param [minimum = Cartesian3.ZERO] - The minimum point along the x, y, and z axes.
  767. * @param [maximum = Cartesian3.ZERO] - The maximum point along the x, y, and z axes.
  768. * @param [center] - The center of the box; automatically computed if not supplied.
  769. */
  770. export class AxisAlignedBoundingBox {
  771. constructor(minimum?: Cartesian3, maximum?: Cartesian3, center?: Cartesian3);
  772. /**
  773. * The minimum point defining the bounding box.
  774. */
  775. minimum: Cartesian3;
  776. /**
  777. * The maximum point defining the bounding box.
  778. */
  779. maximum: Cartesian3;
  780. /**
  781. * The center point of the bounding box.
  782. */
  783. center: Cartesian3;
  784. /**
  785. * Computes an instance of an AxisAlignedBoundingBox. The box is determined by
  786. * finding the points spaced the farthest apart on the x, y, and z axes.
  787. * @example
  788. * // Compute an axis aligned bounding box enclosing two points.
  789. * var box = Cesium.AxisAlignedBoundingBox.fromPoints([new Cesium.Cartesian3(2, 0, 0), new Cesium.Cartesian3(-2, 0, 0)]);
  790. * @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.
  791. * @param [result] - The object onto which to store the result.
  792. * @returns The modified result parameter or a new AxisAlignedBoundingBox instance if one was not provided.
  793. */
  794. static fromPoints(positions: Cartesian3[], result?: AxisAlignedBoundingBox): AxisAlignedBoundingBox;
  795. /**
  796. * Duplicates a AxisAlignedBoundingBox instance.
  797. * @param box - The bounding box to duplicate.
  798. * @param [result] - The object onto which to store the result.
  799. * @returns The modified result parameter or a new AxisAlignedBoundingBox instance if none was provided. (Returns undefined if box is undefined)
  800. */
  801. static clone(box: AxisAlignedBoundingBox, result?: AxisAlignedBoundingBox): AxisAlignedBoundingBox;
  802. /**
  803. * Compares the provided AxisAlignedBoundingBox componentwise and returns
  804. * <code>true</code> if they are equal, <code>false</code> otherwise.
  805. * @param [left] - The first AxisAlignedBoundingBox.
  806. * @param [right] - The second AxisAlignedBoundingBox.
  807. * @returns <code>true</code> if left and right are equal, <code>false</code> otherwise.
  808. */
  809. static equals(left?: AxisAlignedBoundingBox, right?: AxisAlignedBoundingBox): boolean;
  810. /**
  811. * Determines which side of a plane a box is located.
  812. * @param box - The bounding box to test.
  813. * @param plane - The plane to test against.
  814. * @returns {@link Intersect.INSIDE} if the entire box is on the side of the plane
  815. * the normal is pointing, {@link Intersect.OUTSIDE} if the entire box is
  816. * on the opposite side, and {@link Intersect.INTERSECTING} if the box
  817. * intersects the plane.
  818. */
  819. static intersectPlane(box: AxisAlignedBoundingBox, plane: Plane): Intersect;
  820. /**
  821. * Duplicates this AxisAlignedBoundingBox instance.
  822. * @param [result] - The object onto which to store the result.
  823. * @returns The modified result parameter or a new AxisAlignedBoundingBox instance if one was not provided.
  824. */
  825. clone(result?: AxisAlignedBoundingBox): AxisAlignedBoundingBox;
  826. /**
  827. * Determines which side of a plane this box is located.
  828. * @param plane - The plane to test against.
  829. * @returns {@link Intersect.INSIDE} if the entire box is on the side of the plane
  830. * the normal is pointing, {@link Intersect.OUTSIDE} if the entire box is
  831. * on the opposite side, and {@link Intersect.INTERSECTING} if the box
  832. * intersects the plane.
  833. */
  834. intersectPlane(plane: Plane): Intersect;
  835. /**
  836. * Compares this AxisAlignedBoundingBox against the provided AxisAlignedBoundingBox componentwise and returns
  837. * <code>true</code> if they are equal, <code>false</code> otherwise.
  838. * @param [right] - The right hand side AxisAlignedBoundingBox.
  839. * @returns <code>true</code> if they are equal, <code>false</code> otherwise.
  840. */
  841. equals(right?: AxisAlignedBoundingBox): boolean;
  842. }
  843. /**
  844. * Object for setting and retrieving the default Bing Maps API key.
  845. *
  846. * A Bing API key is only required if you are using {@link BingMapsImageryProvider}
  847. * or {@link BingMapsGeocoderService}. You can create your own key at
  848. * {@link https://www.bingmapsportal.com/}.
  849. */
  850. export namespace BingMapsApi {
  851. /**
  852. * The default Bing Maps API key to use if one is not provided to the
  853. * constructor of an object that uses the Bing Maps API.
  854. */
  855. var defaultKey: string;
  856. /**
  857. * Gets the key to use to access the Bing Maps API. If the provided
  858. * key is defined, it is returned. Otherwise, returns {@link BingMapsApi.defaultKey}.
  859. * @param providedKey - The provided key to use if defined.
  860. * @returns The Bing Maps API key to use.
  861. */
  862. function getKey(providedKey: string | null | undefined): string | undefined;
  863. }
  864. /**
  865. * Provides geocoding through Bing Maps.
  866. * @param options - Object with the following properties:
  867. * @param options.key - A key to use with the Bing Maps geocoding service
  868. */
  869. export class BingMapsGeocoderService {
  870. constructor(options: {
  871. key: string;
  872. });
  873. /**
  874. * The URL endpoint for the Bing geocoder service
  875. */
  876. readonly url: string;
  877. /**
  878. * The key for the Bing geocoder service
  879. */
  880. readonly key: string;
  881. /**
  882. * @param query - The query to be sent to the geocoder service
  883. */
  884. geocode(query: string): Promise<GeocoderService.Result[]>;
  885. }
  886. /**
  887. * A bounding rectangle given by a corner, width and height.
  888. * @param [x = 0.0] - The x coordinate of the rectangle.
  889. * @param [y = 0.0] - The y coordinate of the rectangle.
  890. * @param [width = 0.0] - The width of the rectangle.
  891. * @param [height = 0.0] - The height of the rectangle.
  892. */
  893. export class BoundingRectangle {
  894. constructor(x?: number, y?: number, width?: number, height?: number);
  895. /**
  896. * The x coordinate of the rectangle.
  897. */
  898. x: number;
  899. /**
  900. * The y coordinate of the rectangle.
  901. */
  902. y: number;
  903. /**
  904. * The width of the rectangle.
  905. */
  906. width: number;
  907. /**
  908. * The height of the rectangle.
  909. */
  910. height: number;
  911. /**
  912. * The number of elements used to pack the object into an array.
  913. */
  914. static packedLength: number;
  915. /**
  916. * Stores the provided instance into the provided array.
  917. * @param value - The value to pack.
  918. * @param array - The array to pack into.
  919. * @param [startingIndex = 0] - The index into the array at which to start packing the elements.
  920. * @returns The array that was packed into
  921. */
  922. static pack(value: BoundingRectangle, array: number[], startingIndex?: number): number[];
  923. /**
  924. * Retrieves an instance from a packed array.
  925. * @param array - The packed array.
  926. * @param [startingIndex = 0] - The starting index of the element to be unpacked.
  927. * @param [result] - The object into which to store the result.
  928. * @returns The modified result parameter or a new BoundingRectangle instance if one was not provided.
  929. */
  930. static unpack(array: number[], startingIndex?: number, result?: BoundingRectangle): BoundingRectangle;
  931. /**
  932. * Computes a bounding rectangle enclosing the list of 2D points.
  933. * The rectangle is oriented with the corner at the bottom left.
  934. * @param positions - List of points that the bounding rectangle will enclose. Each point must have <code>x</code> and <code>y</code> properties.
  935. * @param [result] - The object onto which to store the result.
  936. * @returns The modified result parameter or a new BoundingRectangle instance if one was not provided.
  937. */
  938. static fromPoints(positions: Cartesian2[], result?: BoundingRectangle): BoundingRectangle;
  939. /**
  940. * Computes a bounding rectangle from a rectangle.
  941. * @param rectangle - The valid rectangle used to create a bounding rectangle.
  942. * @param [projection = GeographicProjection] - The projection used to project the rectangle into 2D.
  943. * @param [result] - The object onto which to store the result.
  944. * @returns The modified result parameter or a new BoundingRectangle instance if one was not provided.
  945. */
  946. static fromRectangle(rectangle: Rectangle, projection?: any, result?: BoundingRectangle): BoundingRectangle;
  947. /**
  948. * Duplicates a BoundingRectangle instance.
  949. * @param rectangle - The bounding rectangle to duplicate.
  950. * @param [result] - The object onto which to store the result.
  951. * @returns The modified result parameter or a new BoundingRectangle instance if one was not provided. (Returns undefined if rectangle is undefined)
  952. */
  953. static clone(rectangle: BoundingRectangle, result?: BoundingRectangle): BoundingRectangle;
  954. /**
  955. * Computes a bounding rectangle that is the union of the left and right bounding rectangles.
  956. * @param left - A rectangle to enclose in bounding rectangle.
  957. * @param right - A rectangle to enclose in a bounding rectangle.
  958. * @param [result] - The object onto which to store the result.
  959. * @returns The modified result parameter or a new BoundingRectangle instance if one was not provided.
  960. */
  961. static union(left: BoundingRectangle, right: BoundingRectangle, result?: BoundingRectangle): BoundingRectangle;
  962. /**
  963. * Computes a bounding rectangle by enlarging the provided rectangle until it contains the provided point.
  964. * @param rectangle - A rectangle to expand.
  965. * @param point - A point to enclose in a bounding rectangle.
  966. * @param [result] - The object onto which to store the result.
  967. * @returns The modified result parameter or a new BoundingRectangle instance if one was not provided.
  968. */
  969. static expand(rectangle: BoundingRectangle, point: Cartesian2, result?: BoundingRectangle): BoundingRectangle;
  970. /**
  971. * Determines if two rectangles intersect.
  972. * @param left - A rectangle to check for intersection.
  973. * @param right - The other rectangle to check for intersection.
  974. * @returns <code>Intersect.INTESECTING</code> if the rectangles intersect, <code>Intersect.OUTSIDE</code> otherwise.
  975. */
  976. static intersect(left: BoundingRectangle, right: BoundingRectangle): Intersect;
  977. /**
  978. * Compares the provided BoundingRectangles componentwise and returns
  979. * <code>true</code> if they are equal, <code>false</code> otherwise.
  980. * @param [left] - The first BoundingRectangle.
  981. * @param [right] - The second BoundingRectangle.
  982. * @returns <code>true</code> if left and right are equal, <code>false</code> otherwise.
  983. */
  984. static equals(left?: BoundingRectangle, right?: BoundingRectangle): boolean;
  985. /**
  986. * Duplicates this BoundingRectangle instance.
  987. * @param [result] - The object onto which to store the result.
  988. * @returns The modified result parameter or a new BoundingRectangle instance if one was not provided.
  989. */
  990. clone(result?: BoundingRectangle): BoundingRectangle;
  991. /**
  992. * Determines if this rectangle intersects with another.
  993. * @param right - A rectangle to check for intersection.
  994. * @returns <code>Intersect.INTESECTING</code> if the rectangles intersect, <code>Intersect.OUTSIDE</code> otherwise.
  995. */
  996. intersect(right: BoundingRectangle): Intersect;
  997. /**
  998. * Compares this BoundingRectangle against the provided BoundingRectangle componentwise and returns
  999. * <code>true</code> if they are equal, <code>false</code> otherwise.
  1000. * @param [right] - The right hand side BoundingRectangle.
  1001. * @returns <code>true</code> if they are equal, <code>false</code> otherwise.
  1002. */
  1003. equals(right?: BoundingRectangle): boolean;
  1004. }
  1005. /**
  1006. * A bounding sphere with a center and a radius.
  1007. * @param [center = Cartesian3.ZERO] - The center of the bounding sphere.
  1008. * @param [radius = 0.0] - The radius of the bounding sphere.
  1009. */
  1010. export class BoundingSphere {
  1011. constructor(center?: Cartesian3, radius?: number);
  1012. /**
  1013. * The center point of the sphere.
  1014. */
  1015. center: Cartesian3;
  1016. /**
  1017. * The radius of the sphere.
  1018. */
  1019. radius: number;
  1020. /**
  1021. * Computes a tight-fitting bounding sphere enclosing a list of 3D Cartesian points.
  1022. * The bounding sphere is computed by running two algorithms, a naive algorithm and
  1023. * Ritter's algorithm. The smaller of the two spheres is used to ensure a tight fit.
  1024. * @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.
  1025. * @param [result] - The object onto which to store the result.
  1026. * @returns The modified result parameter or a new BoundingSphere instance if one was not provided.
  1027. */
  1028. static fromPoints(positions?: Cartesian3[], result?: BoundingSphere): BoundingSphere;
  1029. /**
  1030. * Computes a bounding sphere from a rectangle projected in 2D.
  1031. * @param [rectangle] - The rectangle around which to create a bounding sphere.
  1032. * @param [projection = GeographicProjection] - The projection used to project the rectangle into 2D.
  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 fromRectangle2D(rectangle?: Rectangle, projection?: any, result?: BoundingSphere): BoundingSphere;
  1037. /**
  1038. * Computes a bounding sphere from a rectangle projected in 2D. The bounding sphere accounts for the
  1039. * object's minimum and maximum heights over the rectangle.
  1040. * @param [rectangle] - The rectangle around which to create a bounding sphere.
  1041. * @param [projection = GeographicProjection] - The projection used to project the rectangle into 2D.
  1042. * @param [minimumHeight = 0.0] - The minimum height over the rectangle.
  1043. * @param [maximumHeight = 0.0] - The maximum height over the rectangle.
  1044. * @param [result] - The object onto which to store the result.
  1045. * @returns The modified result parameter or a new BoundingSphere instance if none was provided.
  1046. */
  1047. static fromRectangleWithHeights2D(rectangle?: Rectangle, projection?: any, minimumHeight?: number, maximumHeight?: number, result?: BoundingSphere): BoundingSphere;
  1048. /**
  1049. * Computes a bounding sphere from a rectangle in 3D. The bounding sphere is created using a subsample of points
  1050. * on the ellipsoid and contained in the rectangle. It may not be accurate for all rectangles on all types of ellipsoids.
  1051. * @param [rectangle] - The valid rectangle used to create a bounding sphere.
  1052. * @param [ellipsoid = Ellipsoid.WGS84] - The ellipsoid used to determine positions of the rectangle.
  1053. * @param [surfaceHeight = 0.0] - The height above the surface of the ellipsoid.
  1054. * @param [result] - The object onto which to store the result.
  1055. * @returns The modified result parameter or a new BoundingSphere instance if none was provided.
  1056. */
  1057. static fromRectangle3D(rectangle?: Rectangle, ellipsoid?: Ellipsoid, surfaceHeight?: number, result?: BoundingSphere): BoundingSphere;
  1058. /**
  1059. * Computes a tight-fitting bounding sphere enclosing a list of 3D points, where the points are
  1060. * stored in a flat array in X, Y, Z, order. The bounding sphere is computed by running two
  1061. * algorithms, a naive algorithm and Ritter's algorithm. The smaller of the two spheres is used to
  1062. * ensure a tight fit.
  1063. * @example
  1064. * // Compute the bounding sphere from 3 positions, each specified relative to a center.
  1065. * // In addition to the X, Y, and Z coordinates, the points array contains two additional
  1066. * // elements per point which are ignored for the purpose of computing the bounding sphere.
  1067. * var center = new Cesium.Cartesian3(1.0, 2.0, 3.0);
  1068. * var points = [1.0, 2.0, 3.0, 0.1, 0.2,
  1069. * 4.0, 5.0, 6.0, 0.1, 0.2,
  1070. * 7.0, 8.0, 9.0, 0.1, 0.2];
  1071. * var sphere = Cesium.BoundingSphere.fromVertices(points, center, 5);
  1072. * @param [positions] - An array of points that the bounding sphere will enclose. Each point
  1073. * is formed from three elements in the array in the order X, Y, Z.
  1074. * @param [center = Cartesian3.ZERO] - The position to which the positions are relative, which need not be the
  1075. * origin of the coordinate system. This is useful when the positions are to be used for
  1076. * relative-to-center (RTC) rendering.
  1077. * @param [stride = 3] - The number of array elements per vertex. It must be at least 3, but it may
  1078. * be higher. Regardless of the value of this parameter, the X coordinate of the first position
  1079. * is at array index 0, the Y coordinate is at array index 1, and the Z coordinate is at array index
  1080. * 2. When stride is 3, the X coordinate of the next position then begins at array index 3. If
  1081. * the stride is 5, however, two array elements are skipped and the next position begins at array
  1082. * index 5.
  1083. * @param [result] - The object onto which to store the result.
  1084. * @returns The modified result parameter or a new BoundingSphere instance if one was not provided.
  1085. */
  1086. static fromVertices(positions?: number[], center?: Cartesian3, stride?: number, result?: BoundingSphere): BoundingSphere;
  1087. /**
  1088. * Computes a tight-fitting bounding sphere enclosing a list of EncodedCartesian3s, where the points are
  1089. * stored in parallel flat arrays in X, Y, Z, order. The bounding sphere is computed by running two
  1090. * algorithms, a naive algorithm and Ritter's algorithm. The smaller of the two spheres is used to
  1091. * ensure a tight fit.
  1092. * @param [positionsHigh] - An array of high bits of the encoded cartesians that the bounding sphere will enclose. Each point
  1093. * is formed from three elements in the array in the order X, Y, Z.
  1094. * @param [positionsLow] - An array of low bits of the encoded cartesians that the bounding sphere will enclose. Each point
  1095. * is formed from three elements in the array in the order X, Y, Z.
  1096. * @param [result] - The object onto which to store the result.
  1097. * @returns The modified result parameter or a new BoundingSphere instance if one was not provided.
  1098. */
  1099. static fromEncodedCartesianVertices(positionsHigh?: number[], positionsLow?: number[], result?: BoundingSphere): BoundingSphere;
  1100. /**
  1101. * Computes a bounding sphere from the corner points of an axis-aligned bounding box. The sphere
  1102. * tighly and fully encompases the box.
  1103. * @example
  1104. * // Create a bounding sphere around the unit cube
  1105. * var sphere = Cesium.BoundingSphere.fromCornerPoints(new Cesium.Cartesian3(-0.5, -0.5, -0.5), new Cesium.Cartesian3(0.5, 0.5, 0.5));
  1106. * @param [corner] - The minimum height over the rectangle.
  1107. * @param [oppositeCorner] - The maximum height over the rectangle.
  1108. * @param [result] - The object onto which to store the result.
  1109. * @returns The modified result parameter or a new BoundingSphere instance if none was provided.
  1110. */
  1111. static fromCornerPoints(corner?: Cartesian3, oppositeCorner?: Cartesian3, result?: BoundingSphere): BoundingSphere;
  1112. /**
  1113. * Creates a bounding sphere encompassing an ellipsoid.
  1114. * @example
  1115. * var boundingSphere = Cesium.BoundingSphere.fromEllipsoid(ellipsoid);
  1116. * @param ellipsoid - The ellipsoid around which to create a bounding sphere.
  1117. * @param [result] - The object onto which to store the result.
  1118. * @returns The modified result parameter or a new BoundingSphere instance if none was provided.
  1119. */
  1120. static fromEllipsoid(ellipsoid: Ellipsoid, result?: BoundingSphere): BoundingSphere;
  1121. /**
  1122. * Computes a tight-fitting bounding sphere enclosing the provided array of bounding spheres.
  1123. * @param [boundingSpheres] - The array of bounding spheres.
  1124. * @param [result] - The object onto which to store the result.
  1125. * @returns The modified result parameter or a new BoundingSphere instance if none was provided.
  1126. */
  1127. static fromBoundingSpheres(boundingSpheres?: BoundingSphere[], result?: BoundingSphere): BoundingSphere;
  1128. /**
  1129. * Computes a tight-fitting bounding sphere enclosing the provided oriented bounding box.
  1130. * @param orientedBoundingBox - The oriented bounding box.
  1131. * @param [result] - The object onto which to store the result.
  1132. * @returns The modified result parameter or a new BoundingSphere instance if none was provided.
  1133. */
  1134. static fromOrientedBoundingBox(orientedBoundingBox: OrientedBoundingBox, result?: BoundingSphere): BoundingSphere;
  1135. /**
  1136. * Duplicates a BoundingSphere instance.
  1137. * @param sphere - The bounding sphere to duplicate.
  1138. * @param [result] - The object onto which to store the result.
  1139. * @returns The modified result parameter or a new BoundingSphere instance if none was provided. (Returns undefined if sphere is undefined)
  1140. */
  1141. static clone(sphere: BoundingSphere, result?: BoundingSphere): BoundingSphere;
  1142. /**
  1143. * The number of elements used to pack the object into an array.
  1144. */
  1145. static packedLength: number;
  1146. /**
  1147. * Stores the provided instance into the provided array.
  1148. * @param value - The value to pack.
  1149. * @param array - The array to pack into.
  1150. * @param [startingIndex = 0] - The index into the array at which to start packing the elements.
  1151. * @returns The array that was packed into
  1152. */
  1153. static pack(value: BoundingSphere, array: number[], startingIndex?: number): number[];
  1154. /**
  1155. * Retrieves an instance from a packed array.
  1156. * @param array - The packed array.
  1157. * @param [startingIndex = 0] - The starting index of the element to be unpacked.
  1158. * @param [result] - The object into which to store the result.
  1159. * @returns The modified result parameter or a new BoundingSphere instance if one was not provided.
  1160. */
  1161. static unpack(array: number[], startingIndex?: number, result?: BoundingSphere): BoundingSphere;
  1162. /**
  1163. * Computes a bounding sphere that contains both the left and right bounding spheres.
  1164. * @param left - A sphere to enclose in a bounding sphere.
  1165. * @param right - A sphere to enclose in a bounding sphere.
  1166. * @param [result] - The object onto which to store the result.
  1167. * @returns The modified result parameter or a new BoundingSphere instance if none was provided.
  1168. */
  1169. static union(left: BoundingSphere, right: BoundingSphere, result?: BoundingSphere): BoundingSphere;
  1170. /**
  1171. * Computes a bounding sphere by enlarging the provided sphere to contain the provided point.
  1172. * @param sphere - A sphere to expand.
  1173. * @param point - A point to enclose in a bounding sphere.
  1174. * @param [result] - The object onto which to store the result.
  1175. * @returns The modified result parameter or a new BoundingSphere instance if none was provided.
  1176. */
  1177. static expand(sphere: BoundingSphere, point: Cartesian3, result?: BoundingSphere): BoundingSphere;
  1178. /**
  1179. * Determines which side of a plane a sphere is located.
  1180. * @param sphere - The bounding sphere to test.
  1181. * @param plane - The plane to test against.
  1182. * @returns {@link Intersect.INSIDE} if the entire sphere is on the side of the plane
  1183. * the normal is pointing, {@link Intersect.OUTSIDE} if the entire sphere is
  1184. * on the opposite side, and {@link Intersect.INTERSECTING} if the sphere
  1185. * intersects the plane.
  1186. */
  1187. static intersectPlane(sphere: BoundingSphere, plane: Plane): Intersect;
  1188. /**
  1189. * Applies a 4x4 affine transformation matrix to a bounding sphere.
  1190. * @param sphere - The bounding sphere to apply the transformation to.
  1191. * @param transform - The transformation matrix to apply to the bounding sphere.
  1192. * @param [result] - The object onto which to store the result.
  1193. * @returns The modified result parameter or a new BoundingSphere instance if none was provided.
  1194. */
  1195. static transform(sphere: BoundingSphere, transform: Matrix4, result?: BoundingSphere): BoundingSphere;
  1196. /**
  1197. * Computes the estimated distance squared from the closest point on a bounding sphere to a point.
  1198. * @example
  1199. * // Sort bounding spheres from back to front
  1200. * spheres.sort(function(a, b) {
  1201. * return Cesium.BoundingSphere.distanceSquaredTo(b, camera.positionWC) - Cesium.BoundingSphere.distanceSquaredTo(a, camera.positionWC);
  1202. * });
  1203. * @param sphere - The sphere.
  1204. * @param cartesian - The point
  1205. * @returns The estimated distance squared from the bounding sphere to the point.
  1206. */
  1207. static distanceSquaredTo(sphere: BoundingSphere, cartesian: Cartesian3): number;
  1208. /**
  1209. * Applies a 4x4 affine transformation matrix to a bounding sphere where there is no scale
  1210. * The transformation matrix is not verified to have a uniform scale of 1.
  1211. * This method is faster than computing the general bounding sphere transform using {@link BoundingSphere.transform}.
  1212. * @example
  1213. * var modelMatrix = Cesium.Transforms.eastNorthUpToFixedFrame(positionOnEllipsoid);
  1214. * var boundingSphere = new Cesium.BoundingSphere();
  1215. * var newBoundingSphere = Cesium.BoundingSphere.transformWithoutScale(boundingSphere, modelMatrix);
  1216. * @param sphere - The bounding sphere to apply the transformation to.
  1217. * @param transform - The transformation matrix to apply to the bounding sphere.
  1218. * @param [result] - The object onto which to store the result.
  1219. * @returns The modified result parameter or a new BoundingSphere instance if none was provided.
  1220. */
  1221. static transformWithoutScale(sphere: BoundingSphere, transform: Matrix4, result?: BoundingSphere): BoundingSphere;
  1222. /**
  1223. * The distances calculated by the vector from the center of the bounding sphere to position projected onto direction
  1224. * plus/minus the radius of the bounding sphere.
  1225. * <br>
  1226. * If you imagine the infinite number of planes with normal direction, this computes the smallest distance to the
  1227. * closest and farthest planes from position that intersect the bounding sphere.
  1228. * @param sphere - The bounding sphere to calculate the distance to.
  1229. * @param position - The position to calculate the distance from.
  1230. * @param direction - The direction from position.
  1231. * @param [result] - A Interval to store the nearest and farthest distances.
  1232. * @returns The nearest and farthest distances on the bounding sphere from position in direction.
  1233. */
  1234. static computePlaneDistances(sphere: BoundingSphere, position: Cartesian3, direction: Cartesian3, result?: Interval): Interval;
  1235. /**
  1236. * Creates a bounding sphere in 2D from a bounding sphere in 3D world coordinates.
  1237. * @param sphere - The bounding sphere to transform to 2D.
  1238. * @param [projection = GeographicProjection] - The projection to 2D.
  1239. * @param [result] - The object onto which to store the result.
  1240. * @returns The modified result parameter or a new BoundingSphere instance if none was provided.
  1241. */
  1242. static projectTo2D(sphere: BoundingSphere, projection?: any, result?: BoundingSphere): BoundingSphere;
  1243. /**
  1244. * Determines whether or not a sphere is hidden from view by the occluder.
  1245. * @param sphere - The bounding sphere surrounding the occludee object.
  1246. * @param occluder - The occluder.
  1247. * @returns <code>true</code> if the sphere is not visible; otherwise <code>false</code>.
  1248. */
  1249. static isOccluded(sphere: BoundingSphere, occluder: Occluder): boolean;
  1250. /**
  1251. * Compares the provided BoundingSphere componentwise and returns
  1252. * <code>true</code> if they are equal, <code>false</code> otherwise.
  1253. * @param [left] - The first BoundingSphere.
  1254. * @param [right] - The second BoundingSphere.
  1255. * @returns <code>true</code> if left and right are equal, <code>false</code> otherwise.
  1256. */
  1257. static equals(left?: BoundingSphere, right?: BoundingSphere): boolean;
  1258. /**
  1259. * Determines which side of a plane the sphere is located.
  1260. * @param plane - The plane to test against.
  1261. * @returns {@link Intersect.INSIDE} if the entire sphere is on the side of the plane
  1262. * the normal is pointing, {@link Intersect.OUTSIDE} if the entire sphere is
  1263. * on the opposite side, and {@link Intersect.INTERSECTING} if the sphere
  1264. * intersects the plane.
  1265. */
  1266. intersectPlane(plane: Plane): Intersect;
  1267. /**
  1268. * Computes the estimated distance squared from the closest point on a bounding sphere to a point.
  1269. * @example
  1270. * // Sort bounding spheres from back to front
  1271. * spheres.sort(function(a, b) {
  1272. * return b.distanceSquaredTo(camera.positionWC) - a.distanceSquaredTo(camera.positionWC);
  1273. * });
  1274. * @param cartesian - The point
  1275. * @returns The estimated distance squared from the bounding sphere to the point.
  1276. */
  1277. distanceSquaredTo(cartesian: Cartesian3): number;
  1278. /**
  1279. * The distances calculated by the vector from the center of the bounding sphere to position projected onto direction
  1280. * plus/minus the radius of the bounding sphere.
  1281. * <br>
  1282. * If you imagine the infinite number of planes with normal direction, this computes the smallest distance to the
  1283. * closest and farthest planes from position that intersect the bounding sphere.
  1284. * @param position - The position to calculate the distance from.
  1285. * @param direction - The direction from position.
  1286. * @param [result] - A Interval to store the nearest and farthest distances.
  1287. * @returns The nearest and farthest distances on the bounding sphere from position in direction.
  1288. */
  1289. computePlaneDistances(position: Cartesian3, direction: Cartesian3, result?: Interval): Interval;
  1290. /**
  1291. * Determines whether or not a sphere is hidden from view by the occluder.
  1292. * @param occluder - The occluder.
  1293. * @returns <code>true</code> if the sphere is not visible; otherwise <code>false</code>.
  1294. */
  1295. isOccluded(occluder: Occluder): boolean;
  1296. /**
  1297. * Compares this BoundingSphere against the provided BoundingSphere componentwise and returns
  1298. * <code>true</code> if they are equal, <code>false</code> otherwise.
  1299. * @param [right] - The right hand side BoundingSphere.
  1300. * @returns <code>true</code> if they are equal, <code>false</code> otherwise.
  1301. */
  1302. equals(right?: BoundingSphere): boolean;
  1303. /**
  1304. * Duplicates this BoundingSphere instance.
  1305. * @param [result] - The object onto which to store the result.
  1306. * @returns The modified result parameter or a new BoundingSphere instance if none was provided.
  1307. */
  1308. clone(result?: BoundingSphere): BoundingSphere;
  1309. /**
  1310. * Computes the radius of the BoundingSphere.
  1311. * @returns The radius of the BoundingSphere.
  1312. */
  1313. volume(): number;
  1314. }
  1315. /**
  1316. * Describes a cube centered at the origin.
  1317. * @example
  1318. * var box = new Cesium.BoxGeometry({
  1319. * vertexFormat : Cesium.VertexFormat.POSITION_ONLY,
  1320. * maximum : new Cesium.Cartesian3(250000.0, 250000.0, 250000.0),
  1321. * minimum : new Cesium.Cartesian3(-250000.0, -250000.0, -250000.0)
  1322. * });
  1323. * var geometry = Cesium.BoxGeometry.createGeometry(box);
  1324. * @param options - Object with the following properties:
  1325. * @param options.minimum - The minimum x, y, and z coordinates of the box.
  1326. * @param options.maximum - The maximum x, y, and z coordinates of the box.
  1327. * @param [options.vertexFormat = VertexFormat.DEFAULT] - The vertex attributes to be computed.
  1328. */
  1329. export class BoxGeometry {
  1330. constructor(options: {
  1331. minimum: Cartesian3;
  1332. maximum: Cartesian3;
  1333. vertexFormat?: VertexFormat;
  1334. });
  1335. /**
  1336. * Creates a cube centered at the origin given its dimensions.
  1337. * @example
  1338. * var box = Cesium.BoxGeometry.fromDimensions({
  1339. * vertexFormat : Cesium.VertexFormat.POSITION_ONLY,
  1340. * dimensions : new Cesium.Cartesian3(500000.0, 500000.0, 500000.0)
  1341. * });
  1342. * var geometry = Cesium.BoxGeometry.createGeometry(box);
  1343. * @param options - Object with the following properties:
  1344. * @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.
  1345. * @param [options.vertexFormat = VertexFormat.DEFAULT] - The vertex attributes to be computed.
  1346. */
  1347. static fromDimensions(options: {
  1348. dimensions: Cartesian3;
  1349. vertexFormat?: VertexFormat;
  1350. }): BoxGeometry;
  1351. /**
  1352. * Creates a cube from the dimensions of an AxisAlignedBoundingBox.
  1353. * @example
  1354. * var aabb = Cesium.AxisAlignedBoundingBox.fromPoints(Cesium.Cartesian3.fromDegreesArray([
  1355. * -72.0, 40.0,
  1356. * -70.0, 35.0,
  1357. * -75.0, 30.0,
  1358. * -70.0, 30.0,
  1359. * -68.0, 40.0
  1360. * ]));
  1361. * var box = Cesium.BoxGeometry.fromAxisAlignedBoundingBox(aabb);
  1362. * @param boundingBox - A description of the AxisAlignedBoundingBox.
  1363. */
  1364. static fromAxisAlignedBoundingBox(boundingBox: AxisAlignedBoundingBox): BoxGeometry;
  1365. /**
  1366. * The number of elements used to pack the object into an array.
  1367. */
  1368. static packedLength: number;
  1369. /**
  1370. * Stores the provided instance into the provided array.
  1371. * @param value - The value to pack.
  1372. * @param array - The array to pack into.
  1373. * @param [startingIndex = 0] - The index into the array at which to start packing the elements.
  1374. * @returns The array that was packed into
  1375. */
  1376. static pack(value: BoxGeometry, array: number[], startingIndex?: number): number[];
  1377. /**
  1378. * Retrieves an instance from a packed array.
  1379. * @param array - The packed array.
  1380. * @param [startingIndex = 0] - The starting index of the element to be unpacked.
  1381. * @param [result] - The object into which to store the result.
  1382. * @returns The modified result parameter or a new BoxGeometry instance if one was not provided.
  1383. */
  1384. static unpack(array: number[], startingIndex?: number, result?: BoxGeometry): BoxGeometry;
  1385. /**
  1386. * Computes the geometric representation of a box, including its vertices, indices, and a bounding sphere.
  1387. * @param boxGeometry - A description of the box.
  1388. * @returns The computed vertices and indices.
  1389. */
  1390. static createGeometry(boxGeometry: BoxGeometry): Geometry | undefined;
  1391. }
  1392. /**
  1393. * A description of the outline of a cube centered at the origin.
  1394. * @example
  1395. * var box = new Cesium.BoxOutlineGeometry({
  1396. * maximum : new Cesium.Cartesian3(250000.0, 250000.0, 250000.0),
  1397. * minimum : new Cesium.Cartesian3(-250000.0, -250000.0, -250000.0)
  1398. * });
  1399. * var geometry = Cesium.BoxOutlineGeometry.createGeometry(box);
  1400. * @param options - Object with the following properties:
  1401. * @param options.minimum - The minimum x, y, and z coordinates of the box.
  1402. * @param options.maximum - The maximum x, y, and z coordinates of the box.
  1403. */
  1404. export class BoxOutlineGeometry {
  1405. constructor(options: {
  1406. minimum: Cartesian3;
  1407. maximum: Cartesian3;
  1408. });
  1409. /**
  1410. * Creates an outline of a cube centered at the origin given its dimensions.
  1411. * @example
  1412. * var box = Cesium.BoxOutlineGeometry.fromDimensions({
  1413. * dimensions : new Cesium.Cartesian3(500000.0, 500000.0, 500000.0)
  1414. * });
  1415. * var geometry = Cesium.BoxOutlineGeometry.createGeometry(box);
  1416. * @param options - Object with the following properties:
  1417. * @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.
  1418. */
  1419. static fromDimensions(options: {
  1420. dimensions: Cartesian3;
  1421. }): BoxOutlineGeometry;
  1422. /**
  1423. * Creates an outline of a cube from the dimensions of an AxisAlignedBoundingBox.
  1424. * @example
  1425. * var aabb = Cesium.AxisAlignedBoundingBox.fromPoints(Cesium.Cartesian3.fromDegreesArray([
  1426. * -72.0, 40.0,
  1427. * -70.0, 35.0,
  1428. * -75.0, 30.0,
  1429. * -70.0, 30.0,
  1430. * -68.0, 40.0
  1431. * ]));
  1432. * var box = Cesium.BoxOutlineGeometry.fromAxisAlignedBoundingBox(aabb);
  1433. *
  1434. *
  1435. * @param boundingBox - A description of the AxisAlignedBoundingBox.
  1436. */
  1437. static fromAxisAlignedBoundingBox(boundingBox: AxisAlignedBoundingBox): BoxOutlineGeometry;
  1438. /**
  1439. * The number of elements used to pack the object into an array.
  1440. */
  1441. static packedLength: number;
  1442. /**
  1443. * Stores the provided instance into the provided array.
  1444. * @param value - The value to pack.
  1445. * @param array - The array to pack into.
  1446. * @param [startingIndex = 0] - The index into the array at which to start packing the elements.
  1447. * @returns The array that was packed into
  1448. */
  1449. static pack(value: BoxOutlineGeometry, array: number[], startingIndex?: number): number[];
  1450. /**
  1451. * Retrieves an instance from a packed array.
  1452. * @param array - The packed array.
  1453. * @param [startingIndex = 0] - The starting index of the element to be unpacked.
  1454. * @param [result] - The object into which to store the result.
  1455. * @returns The modified result parameter or a new BoxOutlineGeometry instance if one was not provided.
  1456. */
  1457. static unpack(array: number[], startingIndex?: number, result?: BoxOutlineGeometry): BoxOutlineGeometry;
  1458. /**
  1459. * Computes the geometric representation of an outline of a box, including its vertices, indices, and a bounding sphere.
  1460. * @param boxGeometry - A description of the box outline.
  1461. * @returns The computed vertices and indices.
  1462. */
  1463. static createGeometry(boxGeometry: BoxOutlineGeometry): Geometry | undefined;
  1464. }
  1465. /**
  1466. * A 2D Cartesian point.
  1467. * @param [x = 0.0] - The X component.
  1468. * @param [y = 0.0] - The Y component.
  1469. */
  1470. export class Cartesian2 {
  1471. constructor(x?: number, y?: number);
  1472. /**
  1473. * The X component.
  1474. */
  1475. x: number;
  1476. /**
  1477. * The Y component.
  1478. */
  1479. y: number;
  1480. /**
  1481. * Creates a Cartesian2 instance from x and y coordinates.
  1482. * @param x - The x coordinate.
  1483. * @param y - The y coordinate.
  1484. * @param [result] - The object onto which to store the result.
  1485. * @returns The modified result parameter or a new Cartesian2 instance if one was not provided.
  1486. */
  1487. static fromElements(x: number, y: number, result?: Cartesian2): Cartesian2;
  1488. /**
  1489. * Duplicates a Cartesian2 instance.
  1490. * @param cartesian - The Cartesian to duplicate.
  1491. * @param [result] - The object onto which to store the result.
  1492. * @returns The modified result parameter or a new Cartesian2 instance if one was not provided. (Returns undefined if cartesian is undefined)
  1493. */
  1494. static clone(cartesian: Cartesian2, result?: Cartesian2): Cartesian2;
  1495. /**
  1496. * Creates a Cartesian2 instance from an existing Cartesian3. This simply takes the
  1497. * x and y properties of the Cartesian3 and drops z.
  1498. * @param cartesian - The Cartesian3 instance to create a Cartesian2 instance from.
  1499. * @param [result] - The object onto which to store the result.
  1500. * @returns The modified result parameter or a new Cartesian2 instance if one was not provided.
  1501. */
  1502. static fromCartesian3(cartesian: Cartesian3, result?: Cartesian2): Cartesian2;
  1503. /**
  1504. * Creates a Cartesian2 instance from an existing Cartesian4. This simply takes the
  1505. * x and y properties of the Cartesian4 and drops z and w.
  1506. * @param cartesian - The Cartesian4 instance to create a Cartesian2 instance from.
  1507. * @param [result] - The object onto which to store the result.
  1508. * @returns The modified result parameter or a new Cartesian2 instance if one was not provided.
  1509. */
  1510. static fromCartesian4(cartesian: Cartesian4, result?: Cartesian2): Cartesian2;
  1511. /**
  1512. * The number of elements used to pack the object into an array.
  1513. */
  1514. static packedLength: number;
  1515. /**
  1516. * Stores the provided instance into the provided array.
  1517. * @param value - The value to pack.
  1518. * @param array - The array to pack into.
  1519. * @param [startingIndex = 0] - The index into the array at which to start packing the elements.
  1520. * @returns The array that was packed into
  1521. */
  1522. static pack(value: Cartesian2, array: number[], startingIndex?: number): number[];
  1523. /**
  1524. * Retrieves an instance from a packed array.
  1525. * @param array - The packed array.
  1526. * @param [startingIndex = 0] - The starting index of the element to be unpacked.
  1527. * @param [result] - The object into which to store the result.
  1528. * @returns The modified result parameter or a new Cartesian2 instance if one was not provided.
  1529. */
  1530. static unpack(array: number[], startingIndex?: number, result?: Cartesian2): Cartesian2;
  1531. /**
  1532. * Flattens an array of Cartesian2s into and array of components.
  1533. * @param array - The array of cartesians to pack.
  1534. * @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.
  1535. * @returns The packed array.
  1536. */
  1537. static packArray(array: Cartesian2[], result?: number[]): number[];
  1538. /**
  1539. * Unpacks an array of cartesian components into and array of Cartesian2s.
  1540. * @param array - The array of components to unpack.
  1541. * @param [result] - The array onto which to store the result.
  1542. * @returns The unpacked array.
  1543. */
  1544. static unpackArray(array: number[], result?: Cartesian2[]): Cartesian2[];
  1545. /**
  1546. * Creates a Cartesian2 from two consecutive elements in an array.
  1547. * @example
  1548. * // Create a Cartesian2 with (1.0, 2.0)
  1549. * var v = [1.0, 2.0];
  1550. * var p = Cesium.Cartesian2.fromArray(v);
  1551. *
  1552. * // Create a Cartesian2 with (1.0, 2.0) using an offset into an array
  1553. * var v2 = [0.0, 0.0, 1.0, 2.0];
  1554. * var p2 = Cesium.Cartesian2.fromArray(v2, 2);
  1555. * @param array - The array whose two consecutive elements correspond to the x and y components, respectively.
  1556. * @param [startingIndex = 0] - The offset into the array of the first element, which corresponds to the x component.
  1557. * @param [result] - The object onto which to store the result.
  1558. * @returns The modified result parameter or a new Cartesian2 instance if one was not provided.
  1559. */
  1560. static fromArray(array: number[], startingIndex?: number, result?: Cartesian2): Cartesian2;
  1561. /**
  1562. * Computes the value of the maximum component for the supplied Cartesian.
  1563. * @param cartesian - The cartesian to use.
  1564. * @returns The value of the maximum component.
  1565. */
  1566. static maximumComponent(cartesian: Cartesian2): number;
  1567. /**
  1568. * Computes the value of the minimum component for the supplied Cartesian.
  1569. * @param cartesian - The cartesian to use.
  1570. * @returns The value of the minimum component.
  1571. */
  1572. static minimumComponent(cartesian: Cartesian2): number;
  1573. /**
  1574. * Compares two Cartesians and computes a Cartesian which contains the minimum components of the supplied Cartesians.
  1575. * @param first - A cartesian to compare.
  1576. * @param second - A cartesian to compare.
  1577. * @param result - The object into which to store the result.
  1578. * @returns A cartesian with the minimum components.
  1579. */
  1580. static minimumByComponent(first: Cartesian2, second: Cartesian2, result: Cartesian2): Cartesian2;
  1581. /**
  1582. * Compares two Cartesians and computes a Cartesian which contains the maximum components of the supplied Cartesians.
  1583. * @param first - A cartesian to compare.
  1584. * @param second - A cartesian to compare.
  1585. * @param result - The object into which to store the result.
  1586. * @returns A cartesian with the maximum components.
  1587. */
  1588. static maximumByComponent(first: Cartesian2, second: Cartesian2, result: Cartesian2): Cartesian2;
  1589. /**
  1590. * Computes the provided Cartesian's squared magnitude.
  1591. * @param cartesian - The Cartesian instance whose squared magnitude is to be computed.
  1592. * @returns The squared magnitude.
  1593. */
  1594. static magnitudeSquared(cartesian: Cartesian2): number;
  1595. /**
  1596. * Computes the Cartesian's magnitude (length).
  1597. * @param cartesian - The Cartesian instance whose magnitude is to be computed.
  1598. * @returns The magnitude.
  1599. */
  1600. static magnitude(cartesian: Cartesian2): number;
  1601. /**
  1602. * Computes the distance between two points.
  1603. * @example
  1604. * // Returns 1.0
  1605. * var d = Cesium.Cartesian2.distance(new Cesium.Cartesian2(1.0, 0.0), new Cesium.Cartesian2(2.0, 0.0));
  1606. * @param left - The first point to compute the distance from.
  1607. * @param right - The second point to compute the distance to.
  1608. * @returns The distance between two points.
  1609. */
  1610. static distance(left: Cartesian2, right: Cartesian2): number;
  1611. /**
  1612. * Computes the squared distance between two points. Comparing squared distances
  1613. * using this function is more efficient than comparing distances using {@link Cartesian2#distance}.
  1614. * @example
  1615. * // Returns 4.0, not 2.0
  1616. * var d = Cesium.Cartesian2.distance(new Cesium.Cartesian2(1.0, 0.0), new Cesium.Cartesian2(3.0, 0.0));
  1617. * @param left - The first point to compute the distance from.
  1618. * @param right - The second point to compute the distance to.
  1619. * @returns The distance between two points.
  1620. */
  1621. static distanceSquared(left: Cartesian2, right: Cartesian2): number;
  1622. /**
  1623. * Computes the normalized form of the supplied Cartesian.
  1624. * @param cartesian - The Cartesian to be normalized.
  1625. * @param result - The object onto which to store the result.
  1626. * @returns The modified result parameter.
  1627. */
  1628. static normalize(cartesian: Cartesian2, result: Cartesian2): Cartesian2;
  1629. /**
  1630. * Computes the dot (scalar) product of two Cartesians.
  1631. * @param left - The first Cartesian.
  1632. * @param right - The second Cartesian.
  1633. * @returns The dot product.
  1634. */
  1635. static dot(left: Cartesian2, right: Cartesian2): number;
  1636. /**
  1637. * Computes the componentwise product of two Cartesians.
  1638. * @param left - The first Cartesian.
  1639. * @param right - The second Cartesian.
  1640. * @param result - The object onto which to store the result.
  1641. * @returns The modified result parameter.
  1642. */
  1643. static multiplyComponents(left: Cartesian2, right: Cartesian2, result: Cartesian2): Cartesian2;
  1644. /**
  1645. * Computes the componentwise quotient of two Cartesians.
  1646. * @param left - The first Cartesian.
  1647. * @param right - The second Cartesian.
  1648. * @param result - The object onto which to store the result.
  1649. * @returns The modified result parameter.
  1650. */
  1651. static divideComponents(left: Cartesian2, right: Cartesian2, result: Cartesian2): Cartesian2;
  1652. /**
  1653. * Computes the componentwise sum of two Cartesians.
  1654. * @param left - The first Cartesian.
  1655. * @param right - The second Cartesian.
  1656. * @param result - The object onto which to store the result.
  1657. * @returns The modified result parameter.
  1658. */
  1659. static add(left: Cartesian2, right: Cartesian2, result: Cartesian2): Cartesian2;
  1660. /**
  1661. * Computes the componentwise difference of two Cartesians.
  1662. * @param left - The first Cartesian.
  1663. * @param right - The second Cartesian.
  1664. * @param result - The object onto which to store the result.
  1665. * @returns The modified result parameter.
  1666. */
  1667. static subtract(left: Cartesian2, right: Cartesian2, result: Cartesian2): Cartesian2;
  1668. /**
  1669. * Multiplies the provided Cartesian componentwise by the provided scalar.
  1670. * @param cartesian - The Cartesian to be scaled.
  1671. * @param scalar - The scalar to multiply with.
  1672. * @param result - The object onto which to store the result.
  1673. * @returns The modified result parameter.
  1674. */
  1675. static multiplyByScalar(cartesian: Cartesian2, scalar: number, result: Cartesian2): Cartesian2;
  1676. /**
  1677. * Divides the provided Cartesian componentwise by the provided scalar.
  1678. * @param cartesian - The Cartesian to be divided.
  1679. * @param scalar - The scalar to divide by.
  1680. * @param result - The object onto which to store the result.
  1681. * @returns The modified result parameter.
  1682. */
  1683. static divideByScalar(cartesian: Cartesian2, scalar: number, result: Cartesian2): Cartesian2;
  1684. /**
  1685. * Negates the provided Cartesian.
  1686. * @param cartesian - The Cartesian to be negated.
  1687. * @param result - The object onto which to store the result.
  1688. * @returns The modified result parameter.
  1689. */
  1690. static negate(cartesian: Cartesian2, result: Cartesian2): Cartesian2;
  1691. /**
  1692. * Computes the absolute value of the provided Cartesian.
  1693. * @param cartesian - The Cartesian whose absolute value is to be computed.
  1694. * @param result - The object onto which to store the result.
  1695. * @returns The modified result parameter.
  1696. */
  1697. static abs(cartesian: Cartesian2, result: Cartesian2): Cartesian2;
  1698. /**
  1699. * Computes the linear interpolation or extrapolation at t using the provided cartesians.
  1700. * @param start - The value corresponding to t at 0.0.
  1701. * @param end - The value corresponding to t at 1.0.
  1702. * @param t - The point along t at which to interpolate.
  1703. * @param result - The object onto which to store the result.
  1704. * @returns The modified result parameter.
  1705. */
  1706. static lerp(start: Cartesian2, end: Cartesian2, t: number, result: Cartesian2): Cartesian2;
  1707. /**
  1708. * Returns the angle, in radians, between the provided Cartesians.
  1709. * @param left - The first Cartesian.
  1710. * @param right - The second Cartesian.
  1711. * @returns The angle between the Cartesians.
  1712. */
  1713. static angleBetween(left: Cartesian2, right: Cartesian2): number;
  1714. /**
  1715. * Returns the axis that is most orthogonal to the provided Cartesian.
  1716. * @param cartesian - The Cartesian on which to find the most orthogonal axis.
  1717. * @param result - The object onto which to store the result.
  1718. * @returns The most orthogonal axis.
  1719. */
  1720. static mostOrthogonalAxis(cartesian: Cartesian2, result: Cartesian2): Cartesian2;
  1721. /**
  1722. * Compares the provided Cartesians componentwise and returns
  1723. * <code>true</code> if they are equal, <code>false</code> otherwise.
  1724. * @param [left] - The first Cartesian.
  1725. * @param [right] - The second Cartesian.
  1726. * @returns <code>true</code> if left and right are equal, <code>false</code> otherwise.
  1727. */
  1728. static equals(left?: Cartesian2, right?: Cartesian2): boolean;
  1729. /**
  1730. * Compares the provided Cartesians componentwise and returns
  1731. * <code>true</code> if they pass an absolute or relative tolerance test,
  1732. * <code>false</code> otherwise.
  1733. * @param [left] - The first Cartesian.
  1734. * @param [right] - The second Cartesian.
  1735. * @param [relativeEpsilon = 0] - The relative epsilon tolerance to use for equality testing.
  1736. * @param [absoluteEpsilon = relativeEpsilon] - The absolute epsilon tolerance to use for equality testing.
  1737. * @returns <code>true</code> if left and right are within the provided epsilon, <code>false</code> otherwise.
  1738. */
  1739. static equalsEpsilon(left?: Cartesian2, right?: Cartesian2, relativeEpsilon?: number, absoluteEpsilon?: number): boolean;
  1740. /**
  1741. * An immutable Cartesian2 instance initialized to (0.0, 0.0).
  1742. */
  1743. static readonly ZERO: Cartesian2;
  1744. /**
  1745. * An immutable Cartesian2 instance initialized to (1.0, 0.0).
  1746. */
  1747. static readonly UNIT_X: Cartesian2;
  1748. /**
  1749. * An immutable Cartesian2 instance initialized to (0.0, 1.0).
  1750. */
  1751. static readonly UNIT_Y: Cartesian2;
  1752. /**
  1753. * Duplicates this Cartesian2 instance.
  1754. * @param [result] - The object onto which to store the result.
  1755. * @returns The modified result parameter or a new Cartesian2 instance if one was not provided.
  1756. */
  1757. clone(result?: Cartesian2): Cartesian2;
  1758. /**
  1759. * Compares this Cartesian against the provided Cartesian componentwise and returns
  1760. * <code>true</code> if they are equal, <code>false</code> otherwise.
  1761. * @param [right] - The right hand side Cartesian.
  1762. * @returns <code>true</code> if they are equal, <code>false</code> otherwise.
  1763. */
  1764. equals(right?: Cartesian2): boolean;
  1765. /**
  1766. * Compares this Cartesian against the provided Cartesian componentwise and returns
  1767. * <code>true</code> if they pass an absolute or relative tolerance test,
  1768. * <code>false</code> otherwise.
  1769. * @param [right] - The right hand side Cartesian.
  1770. * @param [relativeEpsilon = 0] - The relative epsilon tolerance to use for equality testing.
  1771. * @param [absoluteEpsilon = relativeEpsilon] - The absolute epsilon tolerance to use for equality testing.
  1772. * @returns <code>true</code> if they are within the provided epsilon, <code>false</code> otherwise.
  1773. */
  1774. equalsEpsilon(right?: Cartesian2, relativeEpsilon?: number, absoluteEpsilon?: number): boolean;
  1775. /**
  1776. * Creates a string representing this Cartesian in the format '(x, y)'.
  1777. * @returns A string representing the provided Cartesian in the format '(x, y)'.
  1778. */
  1779. toString(): string;
  1780. }
  1781. /**
  1782. * A 3D Cartesian point.
  1783. * @param [x = 0.0] - The X component.
  1784. * @param [y = 0.0] - The Y component.
  1785. * @param [z = 0.0] - The Z component.
  1786. */
  1787. export class Cartesian3 {
  1788. constructor(x?: number, y?: number, z?: number);
  1789. /**
  1790. * The X component.
  1791. */
  1792. x: number;
  1793. /**
  1794. * The Y component.
  1795. */
  1796. y: number;
  1797. /**
  1798. * The Z component.
  1799. */
  1800. z: number;
  1801. /**
  1802. * Converts the provided Spherical into Cartesian3 coordinates.
  1803. * @param spherical - The Spherical to be converted to Cartesian3.
  1804. * @param [result] - The object onto which to store the result.
  1805. * @returns The modified result parameter or a new Cartesian3 instance if one was not provided.
  1806. */
  1807. static fromSpherical(spherical: Spherical, result?: Cartesian3): Cartesian3;
  1808. /**
  1809. * Creates a Cartesian3 instance from x, y and z coordinates.
  1810. * @param x - The x coordinate.
  1811. * @param y - The y coordinate.
  1812. * @param z - The z coordinate.
  1813. * @param [result] - The object onto which to store the result.
  1814. * @returns The modified result parameter or a new Cartesian3 instance if one was not provided.
  1815. */
  1816. static fromElements(x: number, y: number, z: number, result?: Cartesian3): Cartesian3;
  1817. /**
  1818. * Duplicates a Cartesian3 instance.
  1819. * @param cartesian - The Cartesian to duplicate.
  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. (Returns undefined if cartesian is undefined)
  1822. */
  1823. static clone(cartesian: Cartesian3, result?: Cartesian3): Cartesian3;
  1824. /**
  1825. * Creates a Cartesian3 instance from an existing Cartesian4. This simply takes the
  1826. * x, y, and z properties of the Cartesian4 and drops w.
  1827. * @param cartesian - The Cartesian4 instance to create a Cartesian3 instance from.
  1828. * @param [result] - The object onto which to store the result.
  1829. * @returns The modified result parameter or a new Cartesian3 instance if one was not provided.
  1830. */
  1831. static fromCartesian4(cartesian: Cartesian4, result?: Cartesian3): Cartesian3;
  1832. /**
  1833. * The number of elements used to pack the object into an array.
  1834. */
  1835. static packedLength: number;
  1836. /**
  1837. * Stores the provided instance into the provided array.
  1838. * @param value - The value to pack.
  1839. * @param array - The array to pack into.
  1840. * @param [startingIndex = 0] - The index into the array at which to start packing the elements.
  1841. * @returns The array that was packed into
  1842. */
  1843. static pack(value: Cartesian3, array: number[], startingIndex?: number): number[];
  1844. /**
  1845. * Retrieves an instance from a packed array.
  1846. * @param array - The packed array.
  1847. * @param [startingIndex = 0] - The starting index of the element to be unpacked.
  1848. * @param [result] - The object into which to store the result.
  1849. * @returns The modified result parameter or a new Cartesian3 instance if one was not provided.
  1850. */
  1851. static unpack(array: number[], startingIndex?: number, result?: Cartesian3): Cartesian3;
  1852. /**
  1853. * Flattens an array of Cartesian3s into an array of components.
  1854. * @param array - The array of cartesians to pack.
  1855. * @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.
  1856. * @returns The packed array.
  1857. */
  1858. static packArray(array: Cartesian3[], result?: number[]): number[];
  1859. /**
  1860. * Unpacks an array of cartesian components into an array of Cartesian3s.
  1861. * @param array - The array of components to unpack.
  1862. * @param [result] - The array onto which to store the result.
  1863. * @returns The unpacked array.
  1864. */
  1865. static unpackArray(array: number[], result?: Cartesian3[]): Cartesian3[];
  1866. /**
  1867. * Creates a Cartesian3 from three consecutive elements in an array.
  1868. * @example
  1869. * // Create a Cartesian3 with (1.0, 2.0, 3.0)
  1870. * var v = [1.0, 2.0, 3.0];
  1871. * var p = Cesium.Cartesian3.fromArray(v);
  1872. *
  1873. * // Create a Cartesian3 with (1.0, 2.0, 3.0) using an offset into an array
  1874. * var v2 = [0.0, 0.0, 1.0, 2.0, 3.0];
  1875. * var p2 = Cesium.Cartesian3.fromArray(v2, 2);
  1876. * @param array - The array whose three consecutive elements correspond to the x, y, and z components, respectively.
  1877. * @param [startingIndex = 0] - The offset into the array of the first element, which corresponds to the x component.
  1878. * @param [result] - The object onto which to store the result.
  1879. * @returns The modified result parameter or a new Cartesian3 instance if one was not provided.
  1880. */
  1881. static fromArray(array: number[], startingIndex?: number, result?: Cartesian3): Cartesian3;
  1882. /**
  1883. * Computes the value of the maximum component for the supplied Cartesian.
  1884. * @param cartesian - The cartesian to use.
  1885. * @returns The value of the maximum component.
  1886. */
  1887. static maximumComponent(cartesian: Cartesian3): number;
  1888. /**
  1889. * Computes the value of the minimum component for the supplied Cartesian.
  1890. * @param cartesian - The cartesian to use.
  1891. * @returns The value of the minimum component.
  1892. */
  1893. static minimumComponent(cartesian: Cartesian3): number;
  1894. /**
  1895. * Compares two Cartesians and computes a Cartesian which contains the minimum components of the supplied Cartesians.
  1896. * @param first - A cartesian to compare.
  1897. * @param second - A cartesian to compare.
  1898. * @param result - The object into which to store the result.
  1899. * @returns A cartesian with the minimum components.
  1900. */
  1901. static minimumByComponent(first: Cartesian3, second: Cartesian3, result: Cartesian3): Cartesian3;
  1902. /**
  1903. * Compares two Cartesians and computes a Cartesian which contains the maximum components of the supplied Cartesians.
  1904. * @param first - A cartesian to compare.
  1905. * @param second - A cartesian to compare.
  1906. * @param result - The object into which to store the result.
  1907. * @returns A cartesian with the maximum components.
  1908. */
  1909. static maximumByComponent(first: Cartesian3, second: Cartesian3, result: Cartesian3): Cartesian3;
  1910. /**
  1911. * Computes the provided Cartesian's squared magnitude.
  1912. * @param cartesian - The Cartesian instance whose squared magnitude is to be computed.
  1913. * @returns The squared magnitude.
  1914. */
  1915. static magnitudeSquared(cartesian: Cartesian3): number;
  1916. /**
  1917. * Computes the Cartesian's magnitude (length).
  1918. * @param cartesian - The Cartesian instance whose magnitude is to be computed.
  1919. * @returns The magnitude.
  1920. */
  1921. static magnitude(cartesian: Cartesian3): number;
  1922. /**
  1923. * Computes the distance between two points.
  1924. * @example
  1925. * // Returns 1.0
  1926. * var d = Cesium.Cartesian3.distance(new Cesium.Cartesian3(1.0, 0.0, 0.0), new Cesium.Cartesian3(2.0, 0.0, 0.0));
  1927. * @param left - The first point to compute the distance from.
  1928. * @param right - The second point to compute the distance to.
  1929. * @returns The distance between two points.
  1930. */
  1931. static distance(left: Cartesian3, right: Cartesian3): number;
  1932. /**
  1933. * Computes the squared distance between two points. Comparing squared distances
  1934. * using this function is more efficient than comparing distances using {@link Cartesian3#distance}.
  1935. * @example
  1936. * // Returns 4.0, not 2.0
  1937. * var d = Cesium.Cartesian3.distanceSquared(new Cesium.Cartesian3(1.0, 0.0, 0.0), new Cesium.Cartesian3(3.0, 0.0, 0.0));
  1938. * @param left - The first point to compute the distance from.
  1939. * @param right - The second point to compute the distance to.
  1940. * @returns The distance between two points.
  1941. */
  1942. static distanceSquared(left: Cartesian3, right: Cartesian3): number;
  1943. /**
  1944. * Computes the normalized form of the supplied Cartesian.
  1945. * @param cartesian - The Cartesian to be normalized.
  1946. * @param result - The object onto which to store the result.
  1947. * @returns The modified result parameter.
  1948. */
  1949. static normalize(cartesian: Cartesian3, result: Cartesian3): Cartesian3;
  1950. /**
  1951. * Computes the dot (scalar) product of two Cartesians.
  1952. * @param left - The first Cartesian.
  1953. * @param right - The second Cartesian.
  1954. * @returns The dot product.
  1955. */
  1956. static dot(left: Cartesian3, right: Cartesian3): number;
  1957. /**
  1958. * Computes the componentwise product of two Cartesians.
  1959. * @param left - The first Cartesian.
  1960. * @param right - The second Cartesian.
  1961. * @param result - The object onto which to store the result.
  1962. * @returns The modified result parameter.
  1963. */
  1964. static multiplyComponents(left: Cartesian3, right: Cartesian3, result: Cartesian3): Cartesian3;
  1965. /**
  1966. * Computes the componentwise quotient of two Cartesians.
  1967. * @param left - The first Cartesian.
  1968. * @param right - The second Cartesian.
  1969. * @param result - The object onto which to store the result.
  1970. * @returns The modified result parameter.
  1971. */
  1972. static divideComponents(left: Cartesian3, right: Cartesian3, result: Cartesian3): Cartesian3;
  1973. /**
  1974. * Computes the componentwise sum of two Cartesians.
  1975. * @param left - The first Cartesian.
  1976. * @param right - The second Cartesian.
  1977. * @param result - The object onto which to store the result.
  1978. * @returns The modified result parameter.
  1979. */
  1980. static add(left: Cartesian3, right: Cartesian3, result: Cartesian3): Cartesian3;
  1981. /**
  1982. * Computes the componentwise difference of two Cartesians.
  1983. * @param left - The first Cartesian.
  1984. * @param right - The second Cartesian.
  1985. * @param result - The object onto which to store the result.
  1986. * @returns The modified result parameter.
  1987. */
  1988. static subtract(left: Cartesian3, right: Cartesian3, result: Cartesian3): Cartesian3;
  1989. /**
  1990. * Multiplies the provided Cartesian componentwise by the provided scalar.
  1991. * @param cartesian - The Cartesian to be scaled.
  1992. * @param scalar - The scalar to multiply with.
  1993. * @param result - The object onto which to store the result.
  1994. * @returns The modified result parameter.
  1995. */
  1996. static multiplyByScalar(cartesian: Cartesian3, scalar: number, result: Cartesian3): Cartesian3;
  1997. /**
  1998. * Divides the provided Cartesian componentwise by the provided scalar.
  1999. * @param cartesian - The Cartesian to be divided.
  2000. * @param scalar - The scalar to divide by.
  2001. * @param result - The object onto which to store the result.
  2002. * @returns The modified result parameter.
  2003. */
  2004. static divideByScalar(cartesian: Cartesian3, scalar: number, result: Cartesian3): Cartesian3;
  2005. /**
  2006. * Negates the provided Cartesian.
  2007. * @param cartesian - The Cartesian to be negated.
  2008. * @param result - The object onto which to store the result.
  2009. * @returns The modified result parameter.
  2010. */
  2011. static negate(cartesian: Cartesian3, result: Cartesian3): Cartesian3;
  2012. /**
  2013. * Computes the absolute value of the provided Cartesian.
  2014. * @param cartesian - The Cartesian whose absolute value is to be computed.
  2015. * @param result - The object onto which to store the result.
  2016. * @returns The modified result parameter.
  2017. */
  2018. static abs(cartesian: Cartesian3, result: Cartesian3): Cartesian3;
  2019. /**
  2020. * Computes the linear interpolation or extrapolation at t using the provided cartesians.
  2021. * @param start - The value corresponding to t at 0.0.
  2022. * @param end - The value corresponding to t at 1.0.
  2023. * @param t - The point along t at which to interpolate.
  2024. * @param result - The object onto which to store the result.
  2025. * @returns The modified result parameter.
  2026. */
  2027. static lerp(start: Cartesian3, end: Cartesian3, t: number, result: Cartesian3): Cartesian3;
  2028. /**
  2029. * Returns the angle, in radians, between the provided Cartesians.
  2030. * @param left - The first Cartesian.
  2031. * @param right - The second Cartesian.
  2032. * @returns The angle between the Cartesians.
  2033. */
  2034. static angleBetween(left: Cartesian3, right: Cartesian3): number;
  2035. /**
  2036. * Returns the axis that is most orthogonal to the provided Cartesian.
  2037. * @param cartesian - The Cartesian on which to find the most orthogonal axis.
  2038. * @param result - The object onto which to store the result.
  2039. * @returns The most orthogonal axis.
  2040. */
  2041. static mostOrthogonalAxis(cartesian: Cartesian3, result: Cartesian3): Cartesian3;
  2042. /**
  2043. * Projects vector a onto vector b
  2044. * @param a - The vector that needs projecting
  2045. * @param b - The vector to project onto
  2046. * @param result - The result cartesian
  2047. * @returns The modified result parameter
  2048. */
  2049. static projectVector(a: Cartesian3, b: Cartesian3, result: Cartesian3): Cartesian3;
  2050. /**
  2051. * Compares the provided Cartesians componentwise and returns
  2052. * <code>true</code> if they are equal, <code>false</code> otherwise.
  2053. * @param [left] - The first Cartesian.
  2054. * @param [right] - The second Cartesian.
  2055. * @returns <code>true</code> if left and right are equal, <code>false</code> otherwise.
  2056. */
  2057. static equals(left?: Cartesian3, right?: Cartesian3): boolean;
  2058. /**
  2059. * Compares the provided Cartesians componentwise and returns
  2060. * <code>true</code> if they pass an absolute or relative tolerance test,
  2061. * <code>false</code> otherwise.
  2062. * @param [left] - The first Cartesian.
  2063. * @param [right] - The second Cartesian.
  2064. * @param [relativeEpsilon = 0] - The relative epsilon tolerance to use for equality testing.
  2065. * @param [absoluteEpsilon = relativeEpsilon] - The absolute epsilon tolerance to use for equality testing.
  2066. * @returns <code>true</code> if left and right are within the provided epsilon, <code>false</code> otherwise.
  2067. */
  2068. static equalsEpsilon(left?: Cartesian3, right?: Cartesian3, relativeEpsilon?: number, absoluteEpsilon?: number): boolean;
  2069. /**
  2070. * Computes the cross (outer) product of two Cartesians.
  2071. * @param left - The first Cartesian.
  2072. * @param right - The second Cartesian.
  2073. * @param result - The object onto which to store the result.
  2074. * @returns The cross product.
  2075. */
  2076. static cross(left: Cartesian3, right: Cartesian3, result: Cartesian3): Cartesian3;
  2077. /**
  2078. * Computes the midpoint between the right and left Cartesian.
  2079. * @param left - The first Cartesian.
  2080. * @param right - The second Cartesian.
  2081. * @param result - The object onto which to store the result.
  2082. * @returns The midpoint.
  2083. */
  2084. static midpoint(left: Cartesian3, right: Cartesian3, result: Cartesian3): Cartesian3;
  2085. /**
  2086. * Returns a Cartesian3 position from longitude and latitude values given in degrees.
  2087. * @example
  2088. * var position = Cesium.Cartesian3.fromDegrees(-115.0, 37.0);
  2089. * @param longitude - The longitude, in degrees
  2090. * @param latitude - The latitude, in degrees
  2091. * @param [height = 0.0] - The height, in meters, above the ellipsoid.
  2092. * @param [ellipsoid = Ellipsoid.WGS84] - The ellipsoid on which the position lies.
  2093. * @param [result] - The object onto which to store the result.
  2094. * @returns The position
  2095. */
  2096. static fromDegrees(longitude: number, latitude: number, height?: number, ellipsoid?: Ellipsoid, result?: Cartesian3): Cartesian3;
  2097. /**
  2098. * Returns a Cartesian3 position from longitude and latitude values given in radians.
  2099. * @example
  2100. * var position = Cesium.Cartesian3.fromRadians(-2.007, 0.645);
  2101. * @param longitude - The longitude, in radians
  2102. * @param latitude - The latitude, in radians
  2103. * @param [height = 0.0] - The height, in meters, above the ellipsoid.
  2104. * @param [ellipsoid = Ellipsoid.WGS84] - The ellipsoid on which the position lies.
  2105. * @param [result] - The object onto which to store the result.
  2106. * @returns The position
  2107. */
  2108. static fromRadians(longitude: number, latitude: number, height?: number, ellipsoid?: Ellipsoid, result?: Cartesian3): Cartesian3;
  2109. /**
  2110. * Returns an array of Cartesian3 positions given an array of longitude and latitude values given in degrees.
  2111. * @example
  2112. * var positions = Cesium.Cartesian3.fromDegreesArray([-115.0, 37.0, -107.0, 33.0]);
  2113. * @param coordinates - A list of longitude and latitude values. Values alternate [longitude, latitude, longitude, latitude...].
  2114. * @param [ellipsoid = Ellipsoid.WGS84] - The ellipsoid on which the coordinates lie.
  2115. * @param [result] - An array of Cartesian3 objects to store the result.
  2116. * @returns The array of positions.
  2117. */
  2118. static fromDegreesArray(coordinates: number[], ellipsoid?: Ellipsoid, result?: Cartesian3[]): Cartesian3[];
  2119. /**
  2120. * Returns an array of Cartesian3 positions given an array of longitude and latitude values given in radians.
  2121. * @example
  2122. * var positions = Cesium.Cartesian3.fromRadiansArray([-2.007, 0.645, -1.867, .575]);
  2123. * @param coordinates - A list of longitude and latitude values. Values alternate [longitude, latitude, longitude, latitude...].
  2124. * @param [ellipsoid = Ellipsoid.WGS84] - The ellipsoid on which the coordinates lie.
  2125. * @param [result] - An array of Cartesian3 objects to store the result.
  2126. * @returns The array of positions.
  2127. */
  2128. static fromRadiansArray(coordinates: number[], ellipsoid?: Ellipsoid, result?: Cartesian3[]): Cartesian3[];
  2129. /**
  2130. * Returns an array of Cartesian3 positions given an array of longitude, latitude and height values where longitude and latitude are given in degrees.
  2131. * @example
  2132. * var positions = Cesium.Cartesian3.fromDegreesArrayHeights([-115.0, 37.0, 100000.0, -107.0, 33.0, 150000.0]);
  2133. * @param coordinates - A list of longitude, latitude and height values. Values alternate [longitude, latitude, height, longitude, latitude, height...].
  2134. * @param [ellipsoid = Ellipsoid.WGS84] - The ellipsoid on which the position lies.
  2135. * @param [result] - An array of Cartesian3 objects to store the result.
  2136. * @returns The array of positions.
  2137. */
  2138. static fromDegreesArrayHeights(coordinates: number[], ellipsoid?: Ellipsoid, result?: Cartesian3[]): Cartesian3[];
  2139. /**
  2140. * Returns an array of Cartesian3 positions given an array of longitude, latitude and height values where longitude and latitude are given in radians.
  2141. * @example
  2142. * var positions = Cesium.Cartesian3.fromRadiansArrayHeights([-2.007, 0.645, 100000.0, -1.867, .575, 150000.0]);
  2143. * @param coordinates - A list of longitude, latitude and height values. Values alternate [longitude, latitude, height, longitude, latitude, height...].
  2144. * @param [ellipsoid = Ellipsoid.WGS84] - The ellipsoid on which the position lies.
  2145. * @param [result] - An array of Cartesian3 objects to store the result.
  2146. * @returns The array of positions.
  2147. */
  2148. static fromRadiansArrayHeights(coordinates: number[], ellipsoid?: Ellipsoid, result?: Cartesian3[]): Cartesian3[];
  2149. /**
  2150. * An immutable Cartesian3 instance initialized to (0.0, 0.0, 0.0).
  2151. */
  2152. static readonly ZERO: Cartesian3;
  2153. /**
  2154. * An immutable Cartesian3 instance initialized to (1.0, 0.0, 0.0).
  2155. */
  2156. static readonly UNIT_X: Cartesian3;
  2157. /**
  2158. * An immutable Cartesian3 instance initialized to (0.0, 1.0, 0.0).
  2159. */
  2160. static readonly UNIT_Y: Cartesian3;
  2161. /**
  2162. * An immutable Cartesian3 instance initialized to (0.0, 0.0, 1.0).
  2163. */
  2164. static readonly UNIT_Z: Cartesian3;
  2165. /**
  2166. * Duplicates this Cartesian3 instance.
  2167. * @param [result] - The object onto which to store the result.
  2168. * @returns The modified result parameter or a new Cartesian3 instance if one was not provided.
  2169. */
  2170. clone(result?: Cartesian3): Cartesian3;
  2171. /**
  2172. * Compares this Cartesian against the provided Cartesian componentwise and returns
  2173. * <code>true</code> if they are equal, <code>false</code> otherwise.
  2174. * @param [right] - The right hand side Cartesian.
  2175. * @returns <code>true</code> if they are equal, <code>false</code> otherwise.
  2176. */
  2177. equals(right?: Cartesian3): boolean;
  2178. /**
  2179. * Compares this Cartesian against the provided Cartesian componentwise and returns
  2180. * <code>true</code> if they pass an absolute or relative tolerance test,
  2181. * <code>false</code> otherwise.
  2182. * @param [right] - The right hand side Cartesian.
  2183. * @param [relativeEpsilon = 0] - The relative epsilon tolerance to use for equality testing.
  2184. * @param [absoluteEpsilon = relativeEpsilon] - The absolute epsilon tolerance to use for equality testing.
  2185. * @returns <code>true</code> if they are within the provided epsilon, <code>false</code> otherwise.
  2186. */
  2187. equalsEpsilon(right?: Cartesian3, relativeEpsilon?: number, absoluteEpsilon?: number): boolean;
  2188. /**
  2189. * Creates a string representing this Cartesian in the format '(x, y, z)'.
  2190. * @returns A string representing this Cartesian in the format '(x, y, z)'.
  2191. */
  2192. toString(): string;
  2193. }
  2194. /**
  2195. * A 4D Cartesian point.
  2196. * @param [x = 0.0] - The X component.
  2197. * @param [y = 0.0] - The Y component.
  2198. * @param [z = 0.0] - The Z component.
  2199. * @param [w = 0.0] - The W component.
  2200. */
  2201. export class Cartesian4 {
  2202. constructor(x?: number, y?: number, z?: number, w?: number);
  2203. /**
  2204. * The X component.
  2205. */
  2206. x: number;
  2207. /**
  2208. * The Y component.
  2209. */
  2210. y: number;
  2211. /**
  2212. * The Z component.
  2213. */
  2214. z: number;
  2215. /**
  2216. * The W component.
  2217. */
  2218. w: number;
  2219. /**
  2220. * Creates a Cartesian4 instance from x, y, z and w coordinates.
  2221. * @param x - The x coordinate.
  2222. * @param y - The y coordinate.
  2223. * @param z - The z coordinate.
  2224. * @param w - The w coordinate.
  2225. * @param [result] - The object onto which to store the result.
  2226. * @returns The modified result parameter or a new Cartesian4 instance if one was not provided.
  2227. */
  2228. static fromElements(x: number, y: number, z: number, w: number, result?: Cartesian4): Cartesian4;
  2229. /**
  2230. * Creates a Cartesian4 instance from a {@link Color}. <code>red</code>, <code>green</code>, <code>blue</code>,
  2231. * and <code>alpha</code> map to <code>x</code>, <code>y</code>, <code>z</code>, and <code>w</code>, respectively.
  2232. * @param color - The source color.
  2233. * @param [result] - The object onto which to store the result.
  2234. * @returns The modified result parameter or a new Cartesian4 instance if one was not provided.
  2235. */
  2236. static fromColor(color: Color, result?: Cartesian4): Cartesian4;
  2237. /**
  2238. * Duplicates a Cartesian4 instance.
  2239. * @param cartesian - The Cartesian to duplicate.
  2240. * @param [result] - The object onto which to store the result.
  2241. * @returns The modified result parameter or a new Cartesian4 instance if one was not provided. (Returns undefined if cartesian is undefined)
  2242. */
  2243. static clone(cartesian: Cartesian4, result?: Cartesian4): Cartesian4;
  2244. /**
  2245. * The number of elements used to pack the object into an array.
  2246. */
  2247. static packedLength: number;
  2248. /**
  2249. * Stores the provided instance into the provided array.
  2250. * @param value - The value to pack.
  2251. * @param array - The array to pack into.
  2252. * @param [startingIndex = 0] - The index into the array at which to start packing the elements.
  2253. * @returns The array that was packed into
  2254. */
  2255. static pack(value: Cartesian4, array: number[], startingIndex?: number): number[];
  2256. /**
  2257. * Retrieves an instance from a packed array.
  2258. * @param array - The packed array.
  2259. * @param [startingIndex = 0] - The starting index of the element to be unpacked.
  2260. * @param [result] - The object into which to store the result.
  2261. * @returns The modified result parameter or a new Cartesian4 instance if one was not provided.
  2262. */
  2263. static unpack(array: number[], startingIndex?: number, result?: Cartesian4): Cartesian4;
  2264. /**
  2265. * Flattens an array of Cartesian4s into and array of components.
  2266. * @param array - The array of cartesians to pack.
  2267. * @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.
  2268. * @returns The packed array.
  2269. */
  2270. static packArray(array: Cartesian4[], result?: number[]): number[];
  2271. /**
  2272. * Unpacks an array of cartesian components into and array of Cartesian4s.
  2273. * @param array - The array of components to unpack.
  2274. * @param [result] - The array onto which to store the result.
  2275. * @returns The unpacked array.
  2276. */
  2277. static unpackArray(array: number[], result?: Cartesian4[]): Cartesian4[];
  2278. /**
  2279. * Creates a Cartesian4 from four consecutive elements in an array.
  2280. * @example
  2281. * // Create a Cartesian4 with (1.0, 2.0, 3.0, 4.0)
  2282. * var v = [1.0, 2.0, 3.0, 4.0];
  2283. * var p = Cesium.Cartesian4.fromArray(v);
  2284. *
  2285. * // Create a Cartesian4 with (1.0, 2.0, 3.0, 4.0) using an offset into an array
  2286. * var v2 = [0.0, 0.0, 1.0, 2.0, 3.0, 4.0];
  2287. * var p2 = Cesium.Cartesian4.fromArray(v2, 2);
  2288. * @param array - The array whose four consecutive elements correspond to the x, y, z, and w components, respectively.
  2289. * @param [startingIndex = 0] - The offset into the array of the first element, which corresponds to the x component.
  2290. * @param [result] - The object onto which to store the result.
  2291. * @returns The modified result parameter or a new Cartesian4 instance if one was not provided.
  2292. */
  2293. static fromArray(array: number[], startingIndex?: number, result?: Cartesian4): Cartesian4;
  2294. /**
  2295. * Computes the value of the maximum component for the supplied Cartesian.
  2296. * @param cartesian - The cartesian to use.
  2297. * @returns The value of the maximum component.
  2298. */
  2299. static maximumComponent(cartesian: Cartesian4): number;
  2300. /**
  2301. * Computes the value of the minimum component for the supplied Cartesian.
  2302. * @param cartesian - The cartesian to use.
  2303. * @returns The value of the minimum component.
  2304. */
  2305. static minimumComponent(cartesian: Cartesian4): number;
  2306. /**
  2307. * Compares two Cartesians and computes a Cartesian which contains the minimum components of the supplied Cartesians.
  2308. * @param first - A cartesian to compare.
  2309. * @param second - A cartesian to compare.
  2310. * @param result - The object into which to store the result.
  2311. * @returns A cartesian with the minimum components.
  2312. */
  2313. static minimumByComponent(first: Cartesian4, second: Cartesian4, result: Cartesian4): Cartesian4;
  2314. /**
  2315. * Compares two Cartesians and computes a Cartesian which contains the maximum components of the supplied Cartesians.
  2316. * @param first - A cartesian to compare.
  2317. * @param second - A cartesian to compare.
  2318. * @param result - The object into which to store the result.
  2319. * @returns A cartesian with the maximum components.
  2320. */
  2321. static maximumByComponent(first: Cartesian4, second: Cartesian4, result: Cartesian4): Cartesian4;
  2322. /**
  2323. * Computes the provided Cartesian's squared magnitude.
  2324. * @param cartesian - The Cartesian instance whose squared magnitude is to be computed.
  2325. * @returns The squared magnitude.
  2326. */
  2327. static magnitudeSquared(cartesian: Cartesian4): number;
  2328. /**
  2329. * Computes the Cartesian's magnitude (length).
  2330. * @param cartesian - The Cartesian instance whose magnitude is to be computed.
  2331. * @returns The magnitude.
  2332. */
  2333. static magnitude(cartesian: Cartesian4): number;
  2334. /**
  2335. * Computes the 4-space distance between two points.
  2336. * @example
  2337. * // Returns 1.0
  2338. * var d = Cesium.Cartesian4.distance(
  2339. * new Cesium.Cartesian4(1.0, 0.0, 0.0, 0.0),
  2340. * new Cesium.Cartesian4(2.0, 0.0, 0.0, 0.0));
  2341. * @param left - The first point to compute the distance from.
  2342. * @param right - The second point to compute the distance to.
  2343. * @returns The distance between two points.
  2344. */
  2345. static distance(left: Cartesian4, right: Cartesian4): number;
  2346. /**
  2347. * Computes the squared distance between two points. Comparing squared distances
  2348. * using this function is more efficient than comparing distances using {@link Cartesian4#distance}.
  2349. * @example
  2350. * // Returns 4.0, not 2.0
  2351. * var d = Cesium.Cartesian4.distance(
  2352. * new Cesium.Cartesian4(1.0, 0.0, 0.0, 0.0),
  2353. * new Cesium.Cartesian4(3.0, 0.0, 0.0, 0.0));
  2354. * @param left - The first point to compute the distance from.
  2355. * @param right - The second point to compute the distance to.
  2356. * @returns The distance between two points.
  2357. */
  2358. static distanceSquared(left: Cartesian4, right: Cartesian4): number;
  2359. /**
  2360. * Computes the normalized form of the supplied Cartesian.
  2361. * @param cartesian - The Cartesian to be normalized.
  2362. * @param result - The object onto which to store the result.
  2363. * @returns The modified result parameter.
  2364. */
  2365. static normalize(cartesian: Cartesian4, result: Cartesian4): Cartesian4;
  2366. /**
  2367. * Computes the dot (scalar) product of two Cartesians.
  2368. * @param left - The first Cartesian.
  2369. * @param right - The second Cartesian.
  2370. * @returns The dot product.
  2371. */
  2372. static dot(left: Cartesian4, right: Cartesian4): number;
  2373. /**
  2374. * Computes the componentwise product of two Cartesians.
  2375. * @param left - The first Cartesian.
  2376. * @param right - The second Cartesian.
  2377. * @param result - The object onto which to store the result.
  2378. * @returns The modified result parameter.
  2379. */
  2380. static multiplyComponents(left: Cartesian4, right: Cartesian4, result: Cartesian4): Cartesian4;
  2381. /**
  2382. * Computes the componentwise quotient of two Cartesians.
  2383. * @param left - The first Cartesian.
  2384. * @param right - The second Cartesian.
  2385. * @param result - The object onto which to store the result.
  2386. * @returns The modified result parameter.
  2387. */
  2388. static divideComponents(left: Cartesian4, right: Cartesian4, result: Cartesian4): Cartesian4;
  2389. /**
  2390. * Computes the componentwise sum of two Cartesians.
  2391. * @param left - The first Cartesian.
  2392. * @param right - The second Cartesian.
  2393. * @param result - The object onto which to store the result.
  2394. * @returns The modified result parameter.
  2395. */
  2396. static add(left: Cartesian4, right: Cartesian4, result: Cartesian4): Cartesian4;
  2397. /**
  2398. * Computes the componentwise difference of two Cartesians.
  2399. * @param left - The first Cartesian.
  2400. * @param right - The second Cartesian.
  2401. * @param result - The object onto which to store the result.
  2402. * @returns The modified result parameter.
  2403. */
  2404. static subtract(left: Cartesian4, right: Cartesian4, result: Cartesian4): Cartesian4;
  2405. /**
  2406. * Multiplies the provided Cartesian componentwise by the provided scalar.
  2407. * @param cartesian - The Cartesian to be scaled.
  2408. * @param scalar - The scalar to multiply with.
  2409. * @param result - The object onto which to store the result.
  2410. * @returns The modified result parameter.
  2411. */
  2412. static multiplyByScalar(cartesian: Cartesian4, scalar: number, result: Cartesian4): Cartesian4;
  2413. /**
  2414. * Divides the provided Cartesian componentwise by the provided scalar.
  2415. * @param cartesian - The Cartesian to be divided.
  2416. * @param scalar - The scalar to divide by.
  2417. * @param result - The object onto which to store the result.
  2418. * @returns The modified result parameter.
  2419. */
  2420. static divideByScalar(cartesian: Cartesian4, scalar: number, result: Cartesian4): Cartesian4;
  2421. /**
  2422. * Negates the provided Cartesian.
  2423. * @param cartesian - The Cartesian to be negated.
  2424. * @param result - The object onto which to store the result.
  2425. * @returns The modified result parameter.
  2426. */
  2427. static negate(cartesian: Cartesian4, result: Cartesian4): Cartesian4;
  2428. /**
  2429. * Computes the absolute value of the provided Cartesian.
  2430. * @param cartesian - The Cartesian whose absolute value is to be computed.
  2431. * @param result - The object onto which to store the result.
  2432. * @returns The modified result parameter.
  2433. */
  2434. static abs(cartesian: Cartesian4, result: Cartesian4): Cartesian4;
  2435. /**
  2436. * Computes the linear interpolation or extrapolation at t using the provided cartesians.
  2437. * @param start - The value corresponding to t at 0.0.
  2438. * @param end - The value corresponding to t at 1.0.
  2439. * @param t - The point along t at which to interpolate.
  2440. * @param result - The object onto which to store the result.
  2441. * @returns The modified result parameter.
  2442. */
  2443. static lerp(start: Cartesian4, end: Cartesian4, t: number, result: Cartesian4): Cartesian4;
  2444. /**
  2445. * Returns the axis that is most orthogonal to the provided Cartesian.
  2446. * @param cartesian - The Cartesian on which to find the most orthogonal axis.
  2447. * @param result - The object onto which to store the result.
  2448. * @returns The most orthogonal axis.
  2449. */
  2450. static mostOrthogonalAxis(cartesian: Cartesian4, result: Cartesian4): Cartesian4;
  2451. /**
  2452. * Compares the provided Cartesians componentwise and returns
  2453. * <code>true</code> if they are equal, <code>false</code> otherwise.
  2454. * @param [left] - The first Cartesian.
  2455. * @param [right] - The second Cartesian.
  2456. * @returns <code>true</code> if left and right are equal, <code>false</code> otherwise.
  2457. */
  2458. static equals(left?: Cartesian4, right?: Cartesian4): boolean;
  2459. /**
  2460. * Compares the provided Cartesians componentwise and returns
  2461. * <code>true</code> if they pass an absolute or relative tolerance test,
  2462. * <code>false</code> otherwise.
  2463. * @param [left] - The first Cartesian.
  2464. * @param [right] - The second Cartesian.
  2465. * @param [relativeEpsilon = 0] - The relative epsilon tolerance to use for equality testing.
  2466. * @param [absoluteEpsilon = relativeEpsilon] - The absolute epsilon tolerance to use for equality testing.
  2467. * @returns <code>true</code> if left and right are within the provided epsilon, <code>false</code> otherwise.
  2468. */
  2469. static equalsEpsilon(left?: Cartesian4, right?: Cartesian4, relativeEpsilon?: number, absoluteEpsilon?: number): boolean;
  2470. /**
  2471. * An immutable Cartesian4 instance initialized to (0.0, 0.0, 0.0, 0.0).
  2472. */
  2473. static readonly ZERO: Cartesian4;
  2474. /**
  2475. * An immutable Cartesian4 instance initialized to (1.0, 0.0, 0.0, 0.0).
  2476. */
  2477. static readonly UNIT_X: Cartesian4;
  2478. /**
  2479. * An immutable Cartesian4 instance initialized to (0.0, 1.0, 0.0, 0.0).
  2480. */
  2481. static readonly UNIT_Y: Cartesian4;
  2482. /**
  2483. * An immutable Cartesian4 instance initialized to (0.0, 0.0, 1.0, 0.0).
  2484. */
  2485. static readonly UNIT_Z: Cartesian4;
  2486. /**
  2487. * An immutable Cartesian4 instance initialized to (0.0, 0.0, 0.0, 1.0).
  2488. */
  2489. static readonly UNIT_W: Cartesian4;
  2490. /**
  2491. * Duplicates this Cartesian4 instance.
  2492. * @param [result] - The object onto which to store the result.
  2493. * @returns The modified result parameter or a new Cartesian4 instance if one was not provided.
  2494. */
  2495. clone(result?: Cartesian4): Cartesian4;
  2496. /**
  2497. * Compares this Cartesian against the provided Cartesian componentwise and returns
  2498. * <code>true</code> if they are equal, <code>false</code> otherwise.
  2499. * @param [right] - The right hand side Cartesian.
  2500. * @returns <code>true</code> if they are equal, <code>false</code> otherwise.
  2501. */
  2502. equals(right?: Cartesian4): boolean;
  2503. /**
  2504. * Compares this Cartesian against the provided Cartesian componentwise and returns
  2505. * <code>true</code> if they pass an absolute or relative tolerance test,
  2506. * <code>false</code> otherwise.
  2507. * @param [right] - The right hand side Cartesian.
  2508. * @param [relativeEpsilon = 0] - The relative epsilon tolerance to use for equality testing.
  2509. * @param [absoluteEpsilon = relativeEpsilon] - The absolute epsilon tolerance to use for equality testing.
  2510. * @returns <code>true</code> if they are within the provided epsilon, <code>false</code> otherwise.
  2511. */
  2512. equalsEpsilon(right?: Cartesian4, relativeEpsilon?: number, absoluteEpsilon?: number): boolean;
  2513. /**
  2514. * Creates a string representing this Cartesian in the format '(x, y, z, w)'.
  2515. * @returns A string representing the provided Cartesian in the format '(x, y, z, w)'.
  2516. */
  2517. toString(): string;
  2518. /**
  2519. * Packs an arbitrary floating point value to 4 values representable using uint8.
  2520. * @param value - A floating point number
  2521. * @param [result] - The Cartesian4 that will contain the packed float.
  2522. * @returns A Cartesian4 representing the float packed to values in x, y, z, and w.
  2523. */
  2524. static packFloat(value: number, result?: Cartesian4): Cartesian4;
  2525. }
  2526. /**
  2527. * A position defined by longitude, latitude, and height.
  2528. * @param [longitude = 0.0] - The longitude, in radians.
  2529. * @param [latitude = 0.0] - The latitude, in radians.
  2530. * @param [height = 0.0] - The height, in meters, above the ellipsoid.
  2531. */
  2532. export class Cartographic {
  2533. constructor(longitude?: number, latitude?: number, height?: number);
  2534. /**
  2535. * The longitude, in radians.
  2536. */
  2537. longitude: number;
  2538. /**
  2539. * The latitude, in radians.
  2540. */
  2541. latitude: number;
  2542. /**
  2543. * The height, in meters, above the ellipsoid.
  2544. */
  2545. height: number;
  2546. /**
  2547. * Creates a new Cartographic instance from longitude and latitude
  2548. * specified in radians.
  2549. * @param longitude - The longitude, in radians.
  2550. * @param latitude - The latitude, in radians.
  2551. * @param [height = 0.0] - The height, in meters, above the ellipsoid.
  2552. * @param [result] - The object onto which to store the result.
  2553. * @returns The modified result parameter or a new Cartographic instance if one was not provided.
  2554. */
  2555. static fromRadians(longitude: number, latitude: number, height?: number, result?: Cartographic): Cartographic;
  2556. /**
  2557. * Creates a new Cartographic instance from longitude and latitude
  2558. * specified in degrees. The values in the resulting object will
  2559. * be in radians.
  2560. * @param longitude - The longitude, in degrees.
  2561. * @param latitude - The latitude, in degrees.
  2562. * @param [height = 0.0] - The height, in meters, above the ellipsoid.
  2563. * @param [result] - The object onto which to store the result.
  2564. * @returns The modified result parameter or a new Cartographic instance if one was not provided.
  2565. */
  2566. static fromDegrees(longitude: number, latitude: number, height?: number, result?: Cartographic): Cartographic;
  2567. /**
  2568. * Creates a new Cartographic instance from a Cartesian position. The values in the
  2569. * resulting object will be in radians.
  2570. * @param cartesian - The Cartesian position to convert to cartographic representation.
  2571. * @param [ellipsoid = Ellipsoid.WGS84] - The ellipsoid on which the position lies.
  2572. * @param [result] - The object onto which to store the result.
  2573. * @returns The modified result parameter, new Cartographic instance if none was provided, or undefined if the cartesian is at the center of the ellipsoid.
  2574. */
  2575. static fromCartesian(cartesian: Cartesian3, ellipsoid?: Ellipsoid, result?: Cartographic): Cartographic;
  2576. /**
  2577. * Creates a new Cartesian3 instance from a Cartographic input. The values in the inputted
  2578. * object should be in radians.
  2579. * @param cartographic - Input to be converted into a Cartesian3 output.
  2580. * @param [ellipsoid = Ellipsoid.WGS84] - The ellipsoid on which the position lies.
  2581. * @param [result] - The object onto which to store the result.
  2582. * @returns The position
  2583. */
  2584. static toCartesian(cartographic: Cartographic, ellipsoid?: Ellipsoid, result?: Cartesian3): Cartesian3;
  2585. /**
  2586. * Duplicates a Cartographic instance.
  2587. * @param cartographic - The cartographic to duplicate.
  2588. * @param [result] - The object onto which to store the result.
  2589. * @returns The modified result parameter or a new Cartographic instance if one was not provided. (Returns undefined if cartographic is undefined)
  2590. */
  2591. static clone(cartographic: Cartographic, result?: Cartographic): Cartographic;
  2592. /**
  2593. * Compares the provided cartographics componentwise and returns
  2594. * <code>true</code> if they are equal, <code>false</code> otherwise.
  2595. * @param [left] - The first cartographic.
  2596. * @param [right] - The second cartographic.
  2597. * @returns <code>true</code> if left and right are equal, <code>false</code> otherwise.
  2598. */
  2599. static equals(left?: Cartographic, right?: Cartographic): boolean;
  2600. /**
  2601. * Compares the provided cartographics componentwise and returns
  2602. * <code>true</code> if they are within the provided epsilon,
  2603. * <code>false</code> otherwise.
  2604. * @param [left] - The first cartographic.
  2605. * @param [right] - The second cartographic.
  2606. * @param [epsilon = 0] - The epsilon to use for equality testing.
  2607. * @returns <code>true</code> if left and right are within the provided epsilon, <code>false</code> otherwise.
  2608. */
  2609. static equalsEpsilon(left?: Cartographic, right?: Cartographic, epsilon?: number): boolean;
  2610. /**
  2611. * An immutable Cartographic instance initialized to (0.0, 0.0, 0.0).
  2612. */
  2613. static readonly ZERO: Cartographic;
  2614. /**
  2615. * Duplicates this instance.
  2616. * @param [result] - The object onto which to store the result.
  2617. * @returns The modified result parameter or a new Cartographic instance if one was not provided.
  2618. */
  2619. clone(result?: Cartographic): Cartographic;
  2620. /**
  2621. * Compares the provided against this cartographic componentwise and returns
  2622. * <code>true</code> if they are equal, <code>false</code> otherwise.
  2623. * @param [right] - The second cartographic.
  2624. * @returns <code>true</code> if left and right are equal, <code>false</code> otherwise.
  2625. */
  2626. equals(right?: Cartographic): boolean;
  2627. /**
  2628. * Compares the provided against this cartographic componentwise and returns
  2629. * <code>true</code> if they are within the provided epsilon,
  2630. * <code>false</code> otherwise.
  2631. * @param [right] - The second cartographic.
  2632. * @param [epsilon = 0] - The epsilon to use for equality testing.
  2633. * @returns <code>true</code> if left and right are within the provided epsilon, <code>false</code> otherwise.
  2634. */
  2635. equalsEpsilon(right?: Cartographic, epsilon?: number): boolean;
  2636. /**
  2637. * Creates a string representing this cartographic in the format '(longitude, latitude, height)'.
  2638. * @returns A string representing the provided cartographic in the format '(longitude, latitude, height)'.
  2639. */
  2640. toString(): string;
  2641. }
  2642. /**
  2643. * Geocodes queries containing longitude and latitude coordinates and an optional height.
  2644. * Query format: `longitude latitude (height)` with longitude/latitude in degrees and height in meters.
  2645. */
  2646. export class CartographicGeocoderService {
  2647. constructor();
  2648. /**
  2649. * @param query - The query to be sent to the geocoder service
  2650. */
  2651. geocode(query: string): Promise<GeocoderService.Result[]>;
  2652. }
  2653. /**
  2654. * A Catmull-Rom spline is a cubic spline where the tangent at control points,
  2655. * except the first and last, are computed using the previous and next control points.
  2656. * Catmull-Rom splines are in the class C<sup>1</sup>.
  2657. * @example
  2658. * // spline above the earth from Philadelphia to Los Angeles
  2659. * var spline = new Cesium.CatmullRomSpline({
  2660. * times : [ 0.0, 1.5, 3.0, 4.5, 6.0 ],
  2661. * points : [
  2662. * new Cesium.Cartesian3(1235398.0, -4810983.0, 4146266.0),
  2663. * new Cesium.Cartesian3(1372574.0, -5345182.0, 4606657.0),
  2664. * new Cesium.Cartesian3(-757983.0, -5542796.0, 4514323.0),
  2665. * new Cesium.Cartesian3(-2821260.0, -5248423.0, 4021290.0),
  2666. * new Cesium.Cartesian3(-2539788.0, -4724797.0, 3620093.0)
  2667. * ]
  2668. * });
  2669. *
  2670. * var p0 = spline.evaluate(times[i]); // equal to positions[i]
  2671. * var p1 = spline.evaluate(times[i] + delta); // interpolated value when delta < times[i + 1] - times[i]
  2672. * @param options - Object with the following properties:
  2673. * @param options.times - An array of strictly increasing, unit-less, floating-point times at each point.
  2674. * The values are in no way connected to the clock time. They are the parameterization for the curve.
  2675. * @param options.points - The array of {@link Cartesian3} control points.
  2676. * @param [options.firstTangent] - The tangent of the curve at the first control point.
  2677. * If the tangent is not given, it will be estimated.
  2678. * @param [options.lastTangent] - The tangent of the curve at the last control point.
  2679. * If the tangent is not given, it will be estimated.
  2680. */
  2681. export class CatmullRomSpline {
  2682. constructor(options: {
  2683. times: number[];
  2684. points: Cartesian3[];
  2685. firstTangent?: Cartesian3;
  2686. lastTangent?: Cartesian3;
  2687. });
  2688. /**
  2689. * An array of times for the control points.
  2690. */
  2691. readonly times: number[];
  2692. /**
  2693. * An array of {@link Cartesian3} control points.
  2694. */
  2695. readonly points: Cartesian3[];
  2696. /**
  2697. * The tangent at the first control point.
  2698. */
  2699. readonly firstTangent: Cartesian3;
  2700. /**
  2701. * The tangent at the last control point.
  2702. */
  2703. readonly lastTangent: Cartesian3;
  2704. /**
  2705. * Finds an index <code>i</code> in <code>times</code> such that the parameter
  2706. * <code>time</code> is in the interval <code>[times[i], times[i + 1]]</code>.
  2707. * @param time - The time.
  2708. * @returns The index for the element at the start of the interval.
  2709. */
  2710. findTimeInterval(time: number): number;
  2711. /**
  2712. * Wraps the given time to the period covered by the spline.
  2713. * @param time - The time.
  2714. * @returns The time, wrapped around to the updated animation.
  2715. */
  2716. wrapTime(time: number): number;
  2717. /**
  2718. * Clamps the given time to the period covered by the spline.
  2719. * @param time - The time.
  2720. * @returns The time, clamped to the animation period.
  2721. */
  2722. clampTime(time: number): number;
  2723. /**
  2724. * Evaluates the curve at a given time.
  2725. * @param time - The time at which to evaluate the curve.
  2726. * @param [result] - The object onto which to store the result.
  2727. * @returns The modified result parameter or a new instance of the point on the curve at the given time.
  2728. */
  2729. evaluate(time: number, result?: Cartesian3): Cartesian3;
  2730. }
  2731. /**
  2732. * A {@link TerrainProvider} that accesses terrain data in a Cesium terrain format.
  2733. * @example
  2734. * // Create Arctic DEM terrain with normals.
  2735. * var viewer = new Cesium.Viewer('cesiumContainer', {
  2736. * terrainProvider : new Cesium.CesiumTerrainProvider({
  2737. * url : Cesium.IonResource.fromAssetId(3956),
  2738. * requestVertexNormals : true
  2739. * })
  2740. * });
  2741. * @param options - Object with the following properties:
  2742. * @param options.url - The URL of the Cesium terrain server.
  2743. * @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.
  2744. * @param [options.requestWaterMask = false] - Flag that indicates if the client should request per tile water masks from the server, if available.
  2745. * @param [options.requestMetadata = true] - Flag that indicates if the client should request per tile metadata from the server, if available.
  2746. * @param [options.ellipsoid] - The ellipsoid. If not specified, the WGS84 ellipsoid is used.
  2747. * @param [options.credit] - A credit for the data source, which is displayed on the canvas.
  2748. */
  2749. export class CesiumTerrainProvider {
  2750. constructor(options: {
  2751. url: Resource | string | Promise<Resource> | Promise<string>;
  2752. requestVertexNormals?: boolean;
  2753. requestWaterMask?: boolean;
  2754. requestMetadata?: boolean;
  2755. ellipsoid?: Ellipsoid;
  2756. credit?: Credit | string;
  2757. });
  2758. /**
  2759. * Requests the geometry for a given tile. This function should not be called before
  2760. * {@link CesiumTerrainProvider#ready} returns true. The result must include terrain data and
  2761. * may optionally include a water mask and an indication of which child tiles are available.
  2762. * @param x - The X coordinate of the tile for which to request geometry.
  2763. * @param y - The Y coordinate of the tile for which to request geometry.
  2764. * @param level - The level of the tile for which to request geometry.
  2765. * @param [request] - The request object. Intended for internal use only.
  2766. * @returns A promise for the requested geometry. If this method
  2767. * returns undefined instead of a promise, it is an indication that too many requests are already
  2768. * pending and the request will be retried later.
  2769. */
  2770. requestTileGeometry(x: number, y: number, level: number, request?: Request): Promise<TerrainData> | undefined;
  2771. /**
  2772. * Gets an event that is raised when the terrain provider encounters an asynchronous error. By subscribing
  2773. * to the event, you will be notified of the error and can potentially recover from it. Event listeners
  2774. * are passed an instance of {@link TileProviderError}.
  2775. */
  2776. errorEvent: Event;
  2777. /**
  2778. * Gets the credit to display when this terrain provider is active. Typically this is used to credit
  2779. * the source of the terrain. This function should not be called before {@link CesiumTerrainProvider#ready} returns true.
  2780. */
  2781. credit: Credit;
  2782. /**
  2783. * Gets the tiling scheme used by this provider. This function should
  2784. * not be called before {@link CesiumTerrainProvider#ready} returns true.
  2785. */
  2786. tilingScheme: GeographicTilingScheme;
  2787. /**
  2788. * Gets a value indicating whether or not the provider is ready for use.
  2789. */
  2790. ready: boolean;
  2791. /**
  2792. * Gets a promise that resolves to true when the provider is ready for use.
  2793. */
  2794. readonly readyPromise: Promise<boolean>;
  2795. /**
  2796. * Gets a value indicating whether or not the provider includes a water mask. The water mask
  2797. * indicates which areas of the globe are water rather than land, so they can be rendered
  2798. * as a reflective surface with animated waves. This function should not be
  2799. * called before {@link CesiumTerrainProvider#ready} returns true.
  2800. */
  2801. hasWaterMask: boolean;
  2802. /**
  2803. * Gets a value indicating whether or not the requested tiles include vertex normals.
  2804. * This function should not be called before {@link CesiumTerrainProvider#ready} returns true.
  2805. */
  2806. hasVertexNormals: boolean;
  2807. /**
  2808. * Gets a value indicating whether or not the requested tiles include metadata.
  2809. * This function should not be called before {@link CesiumTerrainProvider#ready} returns true.
  2810. */
  2811. hasMetadata: boolean;
  2812. /**
  2813. * Boolean flag that indicates if the client should request vertex normals from the server.
  2814. * Vertex normals data is appended to the standard tile mesh data only if the client requests the vertex normals and
  2815. * if the server provides vertex normals.
  2816. */
  2817. requestVertexNormals: boolean;
  2818. /**
  2819. * Boolean flag that indicates if the client should request a watermask from the server.
  2820. * Watermask data is appended to the standard tile mesh data only if the client requests the watermask and
  2821. * if the server provides a watermask.
  2822. */
  2823. requestWaterMask: boolean;
  2824. /**
  2825. * Boolean flag that indicates if the client should request metadata from the server.
  2826. * Metadata is appended to the standard tile mesh data only if the client requests the metadata and
  2827. * if the server provides a metadata.
  2828. */
  2829. requestMetadata: boolean;
  2830. /**
  2831. * Gets an object that can be used to determine availability of terrain from this provider, such as
  2832. * at points and in rectangles. This function should not be called before
  2833. * {@link CesiumTerrainProvider#ready} returns true. This property may be undefined if availability
  2834. * information is not available. Note that this reflects tiles that are known to be available currently.
  2835. * Additional tiles may be discovered to be available in the future, e.g. if availability information
  2836. * exists deeper in the tree rather than it all being discoverable at the root. However, a tile that
  2837. * is available now will not become unavailable in the future.
  2838. */
  2839. availability: TileAvailability;
  2840. /**
  2841. * Gets the maximum geometric error allowed in a tile at a given level.
  2842. * @param level - The tile level for which to get the maximum geometric error.
  2843. * @returns The maximum geometric error.
  2844. */
  2845. getLevelMaximumGeometricError(level: number): number;
  2846. /**
  2847. * Determines whether data for a tile is available to be loaded.
  2848. * @param x - The X coordinate of the tile for which to request geometry.
  2849. * @param y - The Y coordinate of the tile for which to request geometry.
  2850. * @param level - The level of the tile for which to request geometry.
  2851. * @returns Undefined if not supported or availability is unknown, otherwise true or false.
  2852. */
  2853. getTileDataAvailable(x: number, y: number, level: number): boolean;
  2854. /**
  2855. * Makes sure we load availability data for a tile
  2856. * @param x - The X coordinate of the tile for which to request geometry.
  2857. * @param y - The Y coordinate of the tile for which to request geometry.
  2858. * @param level - The level of the tile for which to request geometry.
  2859. * @returns Undefined if nothing need to be loaded or a Promise that resolves when all required tiles are loaded
  2860. */
  2861. loadTileDataAvailability(x: number, y: number, level: number): undefined | Promise<void>;
  2862. }
  2863. /**
  2864. * A description of a circle on the ellipsoid. Circle geometry can be rendered with both {@link Primitive} and {@link GroundPrimitive}.
  2865. * @example
  2866. * // Create a circle.
  2867. * var circle = new Cesium.CircleGeometry({
  2868. * center : Cesium.Cartesian3.fromDegrees(-75.59777, 40.03883),
  2869. * radius : 100000.0
  2870. * });
  2871. * var geometry = Cesium.CircleGeometry.createGeometry(circle);
  2872. * @param options - Object with the following properties:
  2873. * @param options.center - The circle's center point in the fixed frame.
  2874. * @param options.radius - The radius in meters.
  2875. * @param [options.ellipsoid = Ellipsoid.WGS84] - The ellipsoid the circle will be on.
  2876. * @param [options.height = 0.0] - The distance in meters between the circle and the ellipsoid surface.
  2877. * @param [options.granularity = 0.02] - The angular distance between points on the circle in radians.
  2878. * @param [options.vertexFormat = VertexFormat.DEFAULT] - The vertex attributes to be computed.
  2879. * @param [options.extrudedHeight = 0.0] - The distance in meters between the circle's extruded face and the ellipsoid surface.
  2880. * @param [options.stRotation = 0.0] - The rotation of the texture coordinates, in radians. A positive rotation is counter-clockwise.
  2881. */
  2882. export class CircleGeometry {
  2883. constructor(options: {
  2884. center: Cartesian3;
  2885. radius: number;
  2886. ellipsoid?: Ellipsoid;
  2887. height?: number;
  2888. granularity?: number;
  2889. vertexFormat?: VertexFormat;
  2890. extrudedHeight?: number;
  2891. stRotation?: number;
  2892. });
  2893. /**
  2894. * The number of elements used to pack the object into an array.
  2895. */
  2896. static packedLength: number;
  2897. /**
  2898. * Stores the provided instance into the provided array.
  2899. * @param value - The value to pack.
  2900. * @param array - The array to pack into.
  2901. * @param [startingIndex = 0] - The index into the array at which to start packing the elements.
  2902. * @returns The array that was packed into
  2903. */
  2904. static pack(value: CircleGeometry, array: number[], startingIndex?: number): number[];
  2905. /**
  2906. * Retrieves an instance from a packed array.
  2907. * @param array - The packed array.
  2908. * @param [startingIndex = 0] - The starting index of the element to be unpacked.
  2909. * @param [result] - The object into which to store the result.
  2910. * @returns The modified result parameter or a new CircleGeometry instance if one was not provided.
  2911. */
  2912. static unpack(array: number[], startingIndex?: number, result?: CircleGeometry): CircleGeometry;
  2913. /**
  2914. * Computes the geometric representation of a circle on an ellipsoid, including its vertices, indices, and a bounding sphere.
  2915. * @param circleGeometry - A description of the circle.
  2916. * @returns The computed vertices and indices.
  2917. */
  2918. static createGeometry(circleGeometry: CircleGeometry): Geometry | undefined;
  2919. }
  2920. /**
  2921. * A description of the outline of a circle on the ellipsoid.
  2922. * @example
  2923. * // Create a circle.
  2924. * var circle = new Cesium.CircleOutlineGeometry({
  2925. * center : Cesium.Cartesian3.fromDegrees(-75.59777, 40.03883),
  2926. * radius : 100000.0
  2927. * });
  2928. * var geometry = Cesium.CircleOutlineGeometry.createGeometry(circle);
  2929. * @param options - Object with the following properties:
  2930. * @param options.center - The circle's center point in the fixed frame.
  2931. * @param options.radius - The radius in meters.
  2932. * @param [options.ellipsoid = Ellipsoid.WGS84] - The ellipsoid the circle will be on.
  2933. * @param [options.height = 0.0] - The distance in meters between the circle and the ellipsoid surface.
  2934. * @param [options.granularity = 0.02] - The angular distance between points on the circle in radians.
  2935. * @param [options.extrudedHeight = 0.0] - The distance in meters between the circle's extruded face and the ellipsoid surface.
  2936. * @param [options.numberOfVerticalLines = 16] - Number of lines to draw between the top and bottom of an extruded circle.
  2937. */
  2938. export class CircleOutlineGeometry {
  2939. constructor(options: {
  2940. center: Cartesian3;
  2941. radius: number;
  2942. ellipsoid?: Ellipsoid;
  2943. height?: number;
  2944. granularity?: number;
  2945. extrudedHeight?: number;
  2946. numberOfVerticalLines?: number;
  2947. });
  2948. /**
  2949. * The number of elements used to pack the object into an array.
  2950. */
  2951. static packedLength: number;
  2952. /**
  2953. * Stores the provided instance into the provided array.
  2954. * @param value - The value to pack.
  2955. * @param array - The array to pack into.
  2956. * @param [startingIndex = 0] - The index into the array at which to start packing the elements.
  2957. * @returns The array that was packed into
  2958. */
  2959. static pack(value: CircleOutlineGeometry, array: number[], startingIndex?: number): number[];
  2960. /**
  2961. * Retrieves an instance from a packed array.
  2962. * @param array - The packed array.
  2963. * @param [startingIndex = 0] - The starting index of the element to be unpacked.
  2964. * @param [result] - The object into which to store the result.
  2965. * @returns The modified result parameter or a new CircleOutlineGeometry instance if one was not provided.
  2966. */
  2967. static unpack(array: number[], startingIndex?: number, result?: CircleOutlineGeometry): CircleOutlineGeometry;
  2968. /**
  2969. * Computes the geometric representation of an outline of a circle on an ellipsoid, including its vertices, indices, and a bounding sphere.
  2970. * @param circleGeometry - A description of the circle.
  2971. * @returns The computed vertices and indices.
  2972. */
  2973. static createGeometry(circleGeometry: CircleOutlineGeometry): Geometry | undefined;
  2974. }
  2975. /**
  2976. * A simple clock for keeping track of simulated time.
  2977. * @example
  2978. * // Create a clock that loops on Christmas day 2013 and runs in real-time.
  2979. * var clock = new Cesium.Clock({
  2980. * startTime : Cesium.JulianDate.fromIso8601("2013-12-25"),
  2981. * currentTime : Cesium.JulianDate.fromIso8601("2013-12-25"),
  2982. * stopTime : Cesium.JulianDate.fromIso8601("2013-12-26"),
  2983. * clockRange : Cesium.ClockRange.LOOP_STOP,
  2984. * clockStep : Cesium.ClockStep.SYSTEM_CLOCK_MULTIPLIER
  2985. * });
  2986. * @param [options] - Object with the following properties:
  2987. * @param [options.startTime] - The start time of the clock.
  2988. * @param [options.stopTime] - The stop time of the clock.
  2989. * @param [options.currentTime] - The current time.
  2990. * @param [options.multiplier = 1.0] - Determines how much time advances when {@link Clock#tick} is called, negative values allow for advancing backwards.
  2991. * @param [options.clockStep = ClockStep.SYSTEM_CLOCK_MULTIPLIER] - Determines if calls to {@link Clock#tick} are frame dependent or system clock dependent.
  2992. * @param [options.clockRange = ClockRange.UNBOUNDED] - Determines how the clock should behave when {@link Clock#startTime} or {@link Clock#stopTime} is reached.
  2993. * @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.
  2994. * @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.
  2995. */
  2996. export class Clock {
  2997. constructor(options?: {
  2998. startTime?: JulianDate;
  2999. stopTime?: JulianDate;
  3000. currentTime?: JulianDate;
  3001. multiplier?: number;
  3002. clockStep?: ClockStep;
  3003. clockRange?: ClockRange;
  3004. canAnimate?: boolean;
  3005. shouldAnimate?: boolean;
  3006. });
  3007. /**
  3008. * The start time of the clock.
  3009. */
  3010. startTime: JulianDate;
  3011. /**
  3012. * The stop time of the clock.
  3013. */
  3014. stopTime: JulianDate;
  3015. /**
  3016. * Determines how the clock should behave when
  3017. * {@link Clock#startTime} or {@link Clock#stopTime}
  3018. * is reached.
  3019. */
  3020. clockRange: ClockRange;
  3021. /**
  3022. * Indicates whether {@link Clock#tick} can advance time. This could be false if data is being buffered,
  3023. * for example. The clock will only advance time when both
  3024. * {@link Clock#canAnimate} and {@link Clock#shouldAnimate} are true.
  3025. */
  3026. canAnimate: boolean;
  3027. /**
  3028. * An {@link Event} that is fired whenever {@link Clock#tick} is called.
  3029. */
  3030. onTick: Event;
  3031. /**
  3032. * An {@link Event} that is fired whenever {@link Clock#stopTime} is reached.
  3033. */
  3034. onStop: Event;
  3035. /**
  3036. * The current time.
  3037. * Changing this property will change
  3038. * {@link Clock#clockStep} from {@link ClockStep.SYSTEM_CLOCK} to
  3039. * {@link ClockStep.SYSTEM_CLOCK_MULTIPLIER}.
  3040. */
  3041. currentTime: JulianDate;
  3042. /**
  3043. * Gets or sets how much time advances when {@link Clock#tick} is called. Negative values allow for advancing backwards.
  3044. * If {@link Clock#clockStep} is set to {@link ClockStep.TICK_DEPENDENT}, this is the number of seconds to advance.
  3045. * If {@link Clock#clockStep} is set to {@link ClockStep.SYSTEM_CLOCK_MULTIPLIER}, this value is multiplied by the
  3046. * elapsed system time since the last call to {@link Clock#tick}.
  3047. * Changing this property will change
  3048. * {@link Clock#clockStep} from {@link ClockStep.SYSTEM_CLOCK} to
  3049. * {@link ClockStep.SYSTEM_CLOCK_MULTIPLIER}.
  3050. */
  3051. multiplier: number;
  3052. /**
  3053. * Determines if calls to {@link Clock#tick} are frame dependent or system clock dependent.
  3054. * Changing this property to {@link ClockStep.SYSTEM_CLOCK} will set
  3055. * {@link Clock#multiplier} to 1.0, {@link Clock#shouldAnimate} to true, and
  3056. * {@link Clock#currentTime} to the current system clock time.
  3057. */
  3058. clockStep: ClockStep;
  3059. /**
  3060. * Indicates whether {@link Clock#tick} should attempt to advance time.
  3061. * The clock will only advance time when both
  3062. * {@link Clock#canAnimate} and {@link Clock#shouldAnimate} are true.
  3063. * Changing this property will change
  3064. * {@link Clock#clockStep} from {@link ClockStep.SYSTEM_CLOCK} to
  3065. * {@link ClockStep.SYSTEM_CLOCK_MULTIPLIER}.
  3066. */
  3067. shouldAnimate: boolean;
  3068. /**
  3069. * Advances the clock from the current time based on the current configuration options.
  3070. * tick should be called every frame, regardless of whether animation is taking place
  3071. * or not. To control animation, use the {@link Clock#shouldAnimate} property.
  3072. * @returns The new value of the {@link Clock#currentTime} property.
  3073. */
  3074. tick(): JulianDate;
  3075. }
  3076. /**
  3077. * Constants used by {@link Clock#tick} to determine behavior
  3078. * when {@link Clock#startTime} or {@link Clock#stopTime} is reached.
  3079. */
  3080. export enum ClockRange {
  3081. /**
  3082. * {@link Clock#tick} will always advances the clock in its current direction.
  3083. */
  3084. UNBOUNDED = 0,
  3085. /**
  3086. * When {@link Clock#startTime} or {@link Clock#stopTime} is reached,
  3087. * {@link Clock#tick} will not advance {@link Clock#currentTime} any further.
  3088. */
  3089. CLAMPED = 1,
  3090. /**
  3091. * When {@link Clock#stopTime} is reached, {@link Clock#tick} will advance
  3092. * {@link Clock#currentTime} to the opposite end of the interval. When
  3093. * time is moving backwards, {@link Clock#tick} will not advance past
  3094. * {@link Clock#startTime}
  3095. */
  3096. LOOP_STOP = 2
  3097. }
  3098. /**
  3099. * Constants to determine how much time advances with each call
  3100. * to {@link Clock#tick}.
  3101. */
  3102. export enum ClockStep {
  3103. /**
  3104. * {@link Clock#tick} advances the current time by a fixed step,
  3105. * which is the number of seconds specified by {@link Clock#multiplier}.
  3106. */
  3107. TICK_DEPENDENT = 0,
  3108. /**
  3109. * {@link Clock#tick} advances the current time by the amount of system
  3110. * time elapsed since the previous call multiplied by {@link Clock#multiplier}.
  3111. */
  3112. SYSTEM_CLOCK_MULTIPLIER = 1,
  3113. /**
  3114. * {@link Clock#tick} sets the clock to the current system time;
  3115. * ignoring all other settings.
  3116. */
  3117. SYSTEM_CLOCK = 2
  3118. }
  3119. /**
  3120. * A color, specified using red, green, blue, and alpha values,
  3121. * which range from <code>0</code> (no intensity) to <code>1.0</code> (full intensity).
  3122. * @param [red = 1.0] - The red component.
  3123. * @param [green = 1.0] - The green component.
  3124. * @param [blue = 1.0] - The blue component.
  3125. * @param [alpha = 1.0] - The alpha component.
  3126. */
  3127. export class Color {
  3128. constructor(red?: number, green?: number, blue?: number, alpha?: number);
  3129. /**
  3130. * The red component.
  3131. */
  3132. red: number;
  3133. /**
  3134. * The green component.
  3135. */
  3136. green: number;
  3137. /**
  3138. * The blue component.
  3139. */
  3140. blue: number;
  3141. /**
  3142. * The alpha component.
  3143. */
  3144. alpha: number;
  3145. /**
  3146. * Creates a Color instance from a {@link Cartesian4}. <code>x</code>, <code>y</code>, <code>z</code>,
  3147. * and <code>w</code> map to <code>red</code>, <code>green</code>, <code>blue</code>, and <code>alpha</code>, respectively.
  3148. * @param cartesian - The source cartesian.
  3149. * @param [result] - The object onto which to store the result.
  3150. * @returns The modified result parameter or a new Color instance if one was not provided.
  3151. */
  3152. static fromCartesian4(cartesian: Cartesian4, result?: Color): Color;
  3153. /**
  3154. * Creates a new Color specified using red, green, blue, and alpha values
  3155. * that are in the range of 0 to 255, converting them internally to a range of 0.0 to 1.0.
  3156. * @param [red = 255] - The red component.
  3157. * @param [green = 255] - The green component.
  3158. * @param [blue = 255] - The blue component.
  3159. * @param [alpha = 255] - The alpha component.
  3160. * @param [result] - The object onto which to store the result.
  3161. * @returns The modified result parameter or a new Color instance if one was not provided.
  3162. */
  3163. static fromBytes(red?: number, green?: number, blue?: number, alpha?: number, result?: Color): Color;
  3164. /**
  3165. * Creates a new Color that has the same red, green, and blue components
  3166. * of the specified color, but with the specified alpha value.
  3167. * @example
  3168. * var translucentRed = Cesium.Color.fromAlpha(Cesium.Color.RED, 0.9);
  3169. * @param color - The base color
  3170. * @param alpha - The new alpha component.
  3171. * @param [result] - The object onto which to store the result.
  3172. * @returns The modified result parameter or a new Color instance if one was not provided.
  3173. */
  3174. static fromAlpha(color: Color, alpha: number, result?: Color): Color;
  3175. /**
  3176. * Creates a new Color from a single numeric unsigned 32-bit RGBA value, using the endianness
  3177. * of the system.
  3178. * @example
  3179. * var color = Cesium.Color.fromRgba(0x67ADDFFF);
  3180. * @param rgba - A single numeric unsigned 32-bit RGBA value.
  3181. * @param [result] - The object to store the result in, if undefined a new instance will be created.
  3182. * @returns The color object.
  3183. */
  3184. static fromRgba(rgba: number, result?: Color): Color;
  3185. /**
  3186. * Creates a Color instance from hue, saturation, and lightness.
  3187. * @param [hue = 0] - The hue angle 0...1
  3188. * @param [saturation = 0] - The saturation value 0...1
  3189. * @param [lightness = 0] - The lightness value 0...1
  3190. * @param [alpha = 1.0] - The alpha component 0...1
  3191. * @param [result] - The object to store the result in, if undefined a new instance will be created.
  3192. * @returns The color object.
  3193. */
  3194. static fromHsl(hue?: number, saturation?: number, lightness?: number, alpha?: number, result?: Color): Color;
  3195. /**
  3196. * Creates a random color using the provided options. For reproducible random colors, you should
  3197. * call {@link Math#setRandomNumberSeed} once at the beginning of your application.
  3198. * @example
  3199. * //Create a completely random color
  3200. * var color = Cesium.Color.fromRandom();
  3201. *
  3202. * //Create a random shade of yellow.
  3203. * var color = Cesium.Color.fromRandom({
  3204. * red : 1.0,
  3205. * green : 1.0,
  3206. * alpha : 1.0
  3207. * });
  3208. *
  3209. * //Create a random bright color.
  3210. * var color = Cesium.Color.fromRandom({
  3211. * minimumRed : 0.75,
  3212. * minimumGreen : 0.75,
  3213. * minimumBlue : 0.75,
  3214. * alpha : 1.0
  3215. * });
  3216. * @param [options] - Object with the following properties:
  3217. * @param [options.red] - If specified, the red component to use instead of a randomized value.
  3218. * @param [options.minimumRed = 0.0] - The maximum red value to generate if none was specified.
  3219. * @param [options.maximumRed = 1.0] - The minimum red value to generate if none was specified.
  3220. * @param [options.green] - If specified, the green component to use instead of a randomized value.
  3221. * @param [options.minimumGreen = 0.0] - The maximum green value to generate if none was specified.
  3222. * @param [options.maximumGreen = 1.0] - The minimum green value to generate if none was specified.
  3223. * @param [options.blue] - If specified, the blue component to use instead of a randomized value.
  3224. * @param [options.minimumBlue = 0.0] - The maximum blue value to generate if none was specified.
  3225. * @param [options.maximumBlue = 1.0] - The minimum blue value to generate if none was specified.
  3226. * @param [options.alpha] - If specified, the alpha component to use instead of a randomized value.
  3227. * @param [options.minimumAlpha = 0.0] - The maximum alpha value to generate if none was specified.
  3228. * @param [options.maximumAlpha = 1.0] - The minimum alpha value to generate if none was specified.
  3229. * @param [result] - The object to store the result in, if undefined a new instance will be created.
  3230. * @returns The modified result parameter or a new instance if result was undefined.
  3231. */
  3232. static fromRandom(options?: {
  3233. red?: number;
  3234. minimumRed?: number;
  3235. maximumRed?: number;
  3236. green?: number;
  3237. minimumGreen?: number;
  3238. maximumGreen?: number;
  3239. blue?: number;
  3240. minimumBlue?: number;
  3241. maximumBlue?: number;
  3242. alpha?: number;
  3243. minimumAlpha?: number;
  3244. maximumAlpha?: number;
  3245. }, result?: Color): Color;
  3246. /**
  3247. * Creates a Color instance from a CSS color value.
  3248. * @example
  3249. * var cesiumBlue = Cesium.Color.fromCssColorString('#67ADDF');
  3250. * var green = Cesium.Color.fromCssColorString('green');
  3251. * @param color - The CSS color value in #rgb, #rgba, #rrggbb, #rrggbbaa, rgb(), rgba(), hsl(), or hsla() format.
  3252. * @param [result] - The object to store the result in, if undefined a new instance will be created.
  3253. * @returns The color object, or undefined if the string was not a valid CSS color.
  3254. */
  3255. static fromCssColorString(color: string, result?: Color): Color;
  3256. /**
  3257. * The number of elements used to pack the object into an array.
  3258. */
  3259. static packedLength: number;
  3260. /**
  3261. * Stores the provided instance into the provided array.
  3262. * @param value - The value to pack.
  3263. * @param array - The array to pack into.
  3264. * @param [startingIndex = 0] - The index into the array at which to start packing the elements.
  3265. * @returns The array that was packed into
  3266. */
  3267. static pack(value: Color, array: number[], startingIndex?: number): number[];
  3268. /**
  3269. * Retrieves an instance from a packed array.
  3270. * @param array - The packed array.
  3271. * @param [startingIndex = 0] - The starting index of the element to be unpacked.
  3272. * @param [result] - The object into which to store the result.
  3273. * @returns The modified result parameter or a new Color instance if one was not provided.
  3274. */
  3275. static unpack(array: number[], startingIndex?: number, result?: Color): Color;
  3276. /**
  3277. * Converts a 'byte' color component in the range of 0 to 255 into
  3278. * a 'float' color component in the range of 0 to 1.0.
  3279. * @param number - The number to be converted.
  3280. * @returns The converted number.
  3281. */
  3282. static byteToFloat(number: number): number;
  3283. /**
  3284. * Converts a 'float' color component in the range of 0 to 1.0 into
  3285. * a 'byte' color component in the range of 0 to 255.
  3286. * @param number - The number to be converted.
  3287. * @returns The converted number.
  3288. */
  3289. static floatToByte(number: number): number;
  3290. /**
  3291. * Duplicates a Color.
  3292. * @param color - The Color to duplicate.
  3293. * @param [result] - The object to store the result in, if undefined a new instance will be created.
  3294. * @returns The modified result parameter or a new instance if result was undefined. (Returns undefined if color is undefined)
  3295. */
  3296. static clone(color: Color, result?: Color): Color;
  3297. /**
  3298. * Returns true if the first Color equals the second color.
  3299. * @param left - The first Color to compare for equality.
  3300. * @param right - The second Color to compare for equality.
  3301. * @returns <code>true</code> if the Colors are equal; otherwise, <code>false</code>.
  3302. */
  3303. static equals(left: Color, right: Color): boolean;
  3304. /**
  3305. * Returns a duplicate of a Color instance.
  3306. * @param [result] - The object to store the result in, if undefined a new instance will be created.
  3307. * @returns The modified result parameter or a new instance if result was undefined.
  3308. */
  3309. clone(result?: Color): Color;
  3310. /**
  3311. * Returns true if this Color equals other.
  3312. * @param other - The Color to compare for equality.
  3313. * @returns <code>true</code> if the Colors are equal; otherwise, <code>false</code>.
  3314. */
  3315. equals(other: Color): boolean;
  3316. /**
  3317. * Returns <code>true</code> if this Color equals other componentwise within the specified epsilon.
  3318. * @param other - The Color to compare for equality.
  3319. * @param [epsilon = 0.0] - The epsilon to use for equality testing.
  3320. * @returns <code>true</code> if the Colors are equal within the specified epsilon; otherwise, <code>false</code>.
  3321. */
  3322. equalsEpsilon(other: Color, epsilon?: number): boolean;
  3323. /**
  3324. * Creates a string representing this Color in the format '(red, green, blue, alpha)'.
  3325. * @returns A string representing this Color in the format '(red, green, blue, alpha)'.
  3326. */
  3327. toString(): string;
  3328. /**
  3329. * Creates a string containing the CSS color value for this color.
  3330. * @returns The CSS equivalent of this color.
  3331. */
  3332. toCssColorString(): string;
  3333. /**
  3334. * Creates a string containing CSS hex string color value for this color.
  3335. * @returns The CSS hex string equivalent of this color.
  3336. */
  3337. toCssHexString(): string;
  3338. /**
  3339. * Converts this color to an array of red, green, blue, and alpha values
  3340. * that are in the range of 0 to 255.
  3341. * @param [result] - The array to store the result in, if undefined a new instance will be created.
  3342. * @returns The modified result parameter or a new instance if result was undefined.
  3343. */
  3344. toBytes(result?: number[]): number[];
  3345. /**
  3346. * Converts this color to a single numeric unsigned 32-bit RGBA value, using the endianness
  3347. * of the system.
  3348. * @example
  3349. * var rgba = Cesium.Color.BLUE.toRgba();
  3350. * @returns A single numeric unsigned 32-bit RGBA value.
  3351. */
  3352. toRgba(): number;
  3353. /**
  3354. * Brightens this color by the provided magnitude.
  3355. * @example
  3356. * var brightBlue = Cesium.Color.BLUE.brighten(0.5, new Cesium.Color());
  3357. * @param magnitude - A positive number indicating the amount to brighten.
  3358. * @param result - The object onto which to store the result.
  3359. * @returns The modified result parameter.
  3360. */
  3361. brighten(magnitude: number, result: Color): Color;
  3362. /**
  3363. * Darkens this color by the provided magnitude.
  3364. * @example
  3365. * var darkBlue = Cesium.Color.BLUE.darken(0.5, new Cesium.Color());
  3366. * @param magnitude - A positive number indicating the amount to darken.
  3367. * @param result - The object onto which to store the result.
  3368. * @returns The modified result parameter.
  3369. */
  3370. darken(magnitude: number, result: Color): Color;
  3371. /**
  3372. * Creates a new Color that has the same red, green, and blue components
  3373. * as this Color, but with the specified alpha value.
  3374. * @example
  3375. * var translucentRed = Cesium.Color.RED.withAlpha(0.9);
  3376. * @param alpha - The new alpha component.
  3377. * @param [result] - The object onto which to store the result.
  3378. * @returns The modified result parameter or a new Color instance if one was not provided.
  3379. */
  3380. withAlpha(alpha: number, result?: Color): Color;
  3381. /**
  3382. * Computes the componentwise sum of two Colors.
  3383. * @param left - The first Color.
  3384. * @param right - The second Color.
  3385. * @param result - The object onto which to store the result.
  3386. * @returns The modified result parameter.
  3387. */
  3388. static add(left: Color, right: Color, result: Color): Color;
  3389. /**
  3390. * Computes the componentwise difference of two Colors.
  3391. * @param left - The first Color.
  3392. * @param right - The second Color.
  3393. * @param result - The object onto which to store the result.
  3394. * @returns The modified result parameter.
  3395. */
  3396. static subtract(left: Color, right: Color, result: Color): Color;
  3397. /**
  3398. * Computes the componentwise product of two Colors.
  3399. * @param left - The first Color.
  3400. * @param right - The second Color.
  3401. * @param result - The object onto which to store the result.
  3402. * @returns The modified result parameter.
  3403. */
  3404. static multiply(left: Color, right: Color, result: Color): Color;
  3405. /**
  3406. * Computes the componentwise quotient of two Colors.
  3407. * @param left - The first Color.
  3408. * @param right - The second Color.
  3409. * @param result - The object onto which to store the result.
  3410. * @returns The modified result parameter.
  3411. */
  3412. static divide(left: Color, right: Color, result: Color): Color;
  3413. /**
  3414. * Computes the componentwise modulus of two Colors.
  3415. * @param left - The first Color.
  3416. * @param right - The second Color.
  3417. * @param result - The object onto which to store the result.
  3418. * @returns The modified result parameter.
  3419. */
  3420. static mod(left: Color, right: Color, result: Color): Color;
  3421. /**
  3422. * Computes the linear interpolation or extrapolation at t between the provided colors.
  3423. * @param start - The color corresponding to t at 0.0.
  3424. * @param end - The color corresponding to t at 1.0.
  3425. * @param t - The point along t at which to interpolate.
  3426. * @param result - The object onto which to store the result.
  3427. * @returns The modified result parameter.
  3428. */
  3429. static lerp(start: Color, end: Color, t: number, result: Color): Color;
  3430. /**
  3431. * Multiplies the provided Color componentwise by the provided scalar.
  3432. * @param color - The Color to be scaled.
  3433. * @param scalar - The scalar to multiply with.
  3434. * @param result - The object onto which to store the result.
  3435. * @returns The modified result parameter.
  3436. */
  3437. static multiplyByScalar(color: Color, scalar: number, result: Color): Color;
  3438. /**
  3439. * Divides the provided Color componentwise by the provided scalar.
  3440. * @param color - The Color to be divided.
  3441. * @param scalar - The scalar to divide with.
  3442. * @param result - The object onto which to store the result.
  3443. * @returns The modified result parameter.
  3444. */
  3445. static divideByScalar(color: Color, scalar: number, result: Color): Color;
  3446. /**
  3447. * An immutable Color instance initialized to CSS color #F0F8FF
  3448. * <span class="colorSwath" style="background: #F0F8FF;"></span>
  3449. */
  3450. static readonly ALICEBLUE: Color;
  3451. /**
  3452. * An immutable Color instance initialized to CSS color #FAEBD7
  3453. * <span class="colorSwath" style="background: #FAEBD7;"></span>
  3454. */
  3455. static readonly ANTIQUEWHITE: Color;
  3456. /**
  3457. * An immutable Color instance initialized to CSS color #00FFFF
  3458. * <span class="colorSwath" style="background: #00FFFF;"></span>
  3459. */
  3460. static readonly AQUA: Color;
  3461. /**
  3462. * An immutable Color instance initialized to CSS color #7FFFD4
  3463. * <span class="colorSwath" style="background: #7FFFD4;"></span>
  3464. */
  3465. static readonly AQUAMARINE: Color;
  3466. /**
  3467. * An immutable Color instance initialized to CSS color #F0FFFF
  3468. * <span class="colorSwath" style="background: #F0FFFF;"></span>
  3469. */
  3470. static readonly AZURE: Color;
  3471. /**
  3472. * An immutable Color instance initialized to CSS color #F5F5DC
  3473. * <span class="colorSwath" style="background: #F5F5DC;"></span>
  3474. */
  3475. static readonly BEIGE: Color;
  3476. /**
  3477. * An immutable Color instance initialized to CSS color #FFE4C4
  3478. * <span class="colorSwath" style="background: #FFE4C4;"></span>
  3479. */
  3480. static readonly BISQUE: Color;
  3481. /**
  3482. * An immutable Color instance initialized to CSS color #000000
  3483. * <span class="colorSwath" style="background: #000000;"></span>
  3484. */
  3485. static readonly BLACK: Color;
  3486. /**
  3487. * An immutable Color instance initialized to CSS color #FFEBCD
  3488. * <span class="colorSwath" style="background: #FFEBCD;"></span>
  3489. */
  3490. static readonly BLANCHEDALMOND: Color;
  3491. /**
  3492. * An immutable Color instance initialized to CSS color #0000FF
  3493. * <span class="colorSwath" style="background: #0000FF;"></span>
  3494. */
  3495. static readonly BLUE: Color;
  3496. /**
  3497. * An immutable Color instance initialized to CSS color #8A2BE2
  3498. * <span class="colorSwath" style="background: #8A2BE2;"></span>
  3499. */
  3500. static readonly BLUEVIOLET: Color;
  3501. /**
  3502. * An immutable Color instance initialized to CSS color #A52A2A
  3503. * <span class="colorSwath" style="background: #A52A2A;"></span>
  3504. */
  3505. static readonly BROWN: Color;
  3506. /**
  3507. * An immutable Color instance initialized to CSS color #DEB887
  3508. * <span class="colorSwath" style="background: #DEB887;"></span>
  3509. */
  3510. static readonly BURLYWOOD: Color;
  3511. /**
  3512. * An immutable Color instance initialized to CSS color #5F9EA0
  3513. * <span class="colorSwath" style="background: #5F9EA0;"></span>
  3514. */
  3515. static readonly CADETBLUE: Color;
  3516. /**
  3517. * An immutable Color instance initialized to CSS color #7FFF00
  3518. * <span class="colorSwath" style="background: #7FFF00;"></span>
  3519. */
  3520. static readonly CHARTREUSE: Color;
  3521. /**
  3522. * An immutable Color instance initialized to CSS color #D2691E
  3523. * <span class="colorSwath" style="background: #D2691E;"></span>
  3524. */
  3525. static readonly CHOCOLATE: Color;
  3526. /**
  3527. * An immutable Color instance initialized to CSS color #FF7F50
  3528. * <span class="colorSwath" style="background: #FF7F50;"></span>
  3529. */
  3530. static readonly CORAL: Color;
  3531. /**
  3532. * An immutable Color instance initialized to CSS color #6495ED
  3533. * <span class="colorSwath" style="background: #6495ED;"></span>
  3534. */
  3535. static readonly CORNFLOWERBLUE: Color;
  3536. /**
  3537. * An immutable Color instance initialized to CSS color #FFF8DC
  3538. * <span class="colorSwath" style="background: #FFF8DC;"></span>
  3539. */
  3540. static readonly CORNSILK: Color;
  3541. /**
  3542. * An immutable Color instance initialized to CSS color #DC143C
  3543. * <span class="colorSwath" style="background: #DC143C;"></span>
  3544. */
  3545. static readonly CRIMSON: Color;
  3546. /**
  3547. * An immutable Color instance initialized to CSS color #00FFFF
  3548. * <span class="colorSwath" style="background: #00FFFF;"></span>
  3549. */
  3550. static readonly CYAN: Color;
  3551. /**
  3552. * An immutable Color instance initialized to CSS color #00008B
  3553. * <span class="colorSwath" style="background: #00008B;"></span>
  3554. */
  3555. static readonly DARKBLUE: Color;
  3556. /**
  3557. * An immutable Color instance initialized to CSS color #008B8B
  3558. * <span class="colorSwath" style="background: #008B8B;"></span>
  3559. */
  3560. static readonly DARKCYAN: Color;
  3561. /**
  3562. * An immutable Color instance initialized to CSS color #B8860B
  3563. * <span class="colorSwath" style="background: #B8860B;"></span>
  3564. */
  3565. static readonly DARKGOLDENROD: Color;
  3566. /**
  3567. * An immutable Color instance initialized to CSS color #A9A9A9
  3568. * <span class="colorSwath" style="background: #A9A9A9;"></span>
  3569. */
  3570. static readonly DARKGRAY: Color;
  3571. /**
  3572. * An immutable Color instance initialized to CSS color #006400
  3573. * <span class="colorSwath" style="background: #006400;"></span>
  3574. */
  3575. static readonly DARKGREEN: Color;
  3576. /**
  3577. * An immutable Color instance initialized to CSS color #A9A9A9
  3578. * <span class="colorSwath" style="background: #A9A9A9;"></span>
  3579. */
  3580. static readonly DARKGREY: Color;
  3581. /**
  3582. * An immutable Color instance initialized to CSS color #BDB76B
  3583. * <span class="colorSwath" style="background: #BDB76B;"></span>
  3584. */
  3585. static readonly DARKKHAKI: Color;
  3586. /**
  3587. * An immutable Color instance initialized to CSS color #8B008B
  3588. * <span class="colorSwath" style="background: #8B008B;"></span>
  3589. */
  3590. static readonly DARKMAGENTA: Color;
  3591. /**
  3592. * An immutable Color instance initialized to CSS color #556B2F
  3593. * <span class="colorSwath" style="background: #556B2F;"></span>
  3594. */
  3595. static readonly DARKOLIVEGREEN: Color;
  3596. /**
  3597. * An immutable Color instance initialized to CSS color #FF8C00
  3598. * <span class="colorSwath" style="background: #FF8C00;"></span>
  3599. */
  3600. static readonly DARKORANGE: Color;
  3601. /**
  3602. * An immutable Color instance initialized to CSS color #9932CC
  3603. * <span class="colorSwath" style="background: #9932CC;"></span>
  3604. */
  3605. static readonly DARKORCHID: Color;
  3606. /**
  3607. * An immutable Color instance initialized to CSS color #8B0000
  3608. * <span class="colorSwath" style="background: #8B0000;"></span>
  3609. */
  3610. static readonly DARKRED: Color;
  3611. /**
  3612. * An immutable Color instance initialized to CSS color #E9967A
  3613. * <span class="colorSwath" style="background: #E9967A;"></span>
  3614. */
  3615. static readonly DARKSALMON: Color;
  3616. /**
  3617. * An immutable Color instance initialized to CSS color #8FBC8F
  3618. * <span class="colorSwath" style="background: #8FBC8F;"></span>
  3619. */
  3620. static readonly DARKSEAGREEN: Color;
  3621. /**
  3622. * An immutable Color instance initialized to CSS color #483D8B
  3623. * <span class="colorSwath" style="background: #483D8B;"></span>
  3624. */
  3625. static readonly DARKSLATEBLUE: Color;
  3626. /**
  3627. * An immutable Color instance initialized to CSS color #2F4F4F
  3628. * <span class="colorSwath" style="background: #2F4F4F;"></span>
  3629. */
  3630. static readonly DARKSLATEGRAY: Color;
  3631. /**
  3632. * An immutable Color instance initialized to CSS color #2F4F4F
  3633. * <span class="colorSwath" style="background: #2F4F4F;"></span>
  3634. */
  3635. static readonly DARKSLATEGREY: Color;
  3636. /**
  3637. * An immutable Color instance initialized to CSS color #00CED1
  3638. * <span class="colorSwath" style="background: #00CED1;"></span>
  3639. */
  3640. static readonly DARKTURQUOISE: Color;
  3641. /**
  3642. * An immutable Color instance initialized to CSS color #9400D3
  3643. * <span class="colorSwath" style="background: #9400D3;"></span>
  3644. */
  3645. static readonly DARKVIOLET: Color;
  3646. /**
  3647. * An immutable Color instance initialized to CSS color #FF1493
  3648. * <span class="colorSwath" style="background: #FF1493;"></span>
  3649. */
  3650. static readonly DEEPPINK: Color;
  3651. /**
  3652. * An immutable Color instance initialized to CSS color #00BFFF
  3653. * <span class="colorSwath" style="background: #00BFFF;"></span>
  3654. */
  3655. static readonly DEEPSKYBLUE: Color;
  3656. /**
  3657. * An immutable Color instance initialized to CSS color #696969
  3658. * <span class="colorSwath" style="background: #696969;"></span>
  3659. */
  3660. static readonly DIMGRAY: Color;
  3661. /**
  3662. * An immutable Color instance initialized to CSS color #696969
  3663. * <span class="colorSwath" style="background: #696969;"></span>
  3664. */
  3665. static readonly DIMGREY: Color;
  3666. /**
  3667. * An immutable Color instance initialized to CSS color #1E90FF
  3668. * <span class="colorSwath" style="background: #1E90FF;"></span>
  3669. */
  3670. static readonly DODGERBLUE: Color;
  3671. /**
  3672. * An immutable Color instance initialized to CSS color #B22222
  3673. * <span class="colorSwath" style="background: #B22222;"></span>
  3674. */
  3675. static readonly FIREBRICK: Color;
  3676. /**
  3677. * An immutable Color instance initialized to CSS color #FFFAF0
  3678. * <span class="colorSwath" style="background: #FFFAF0;"></span>
  3679. */
  3680. static readonly FLORALWHITE: Color;
  3681. /**
  3682. * An immutable Color instance initialized to CSS color #228B22
  3683. * <span class="colorSwath" style="background: #228B22;"></span>
  3684. */
  3685. static readonly FORESTGREEN: Color;
  3686. /**
  3687. * An immutable Color instance initialized to CSS color #FF00FF
  3688. * <span class="colorSwath" style="background: #FF00FF;"></span>
  3689. */
  3690. static readonly FUCHSIA: Color;
  3691. /**
  3692. * An immutable Color instance initialized to CSS color #DCDCDC
  3693. * <span class="colorSwath" style="background: #DCDCDC;"></span>
  3694. */
  3695. static readonly GAINSBORO: Color;
  3696. /**
  3697. * An immutable Color instance initialized to CSS color #F8F8FF
  3698. * <span class="colorSwath" style="background: #F8F8FF;"></span>
  3699. */
  3700. static readonly GHOSTWHITE: Color;
  3701. /**
  3702. * An immutable Color instance initialized to CSS color #FFD700
  3703. * <span class="colorSwath" style="background: #FFD700;"></span>
  3704. */
  3705. static readonly GOLD: Color;
  3706. /**
  3707. * An immutable Color instance initialized to CSS color #DAA520
  3708. * <span class="colorSwath" style="background: #DAA520;"></span>
  3709. */
  3710. static readonly GOLDENROD: Color;
  3711. /**
  3712. * An immutable Color instance initialized to CSS color #808080
  3713. * <span class="colorSwath" style="background: #808080;"></span>
  3714. */
  3715. static readonly GRAY: Color;
  3716. /**
  3717. * An immutable Color instance initialized to CSS color #008000
  3718. * <span class="colorSwath" style="background: #008000;"></span>
  3719. */
  3720. static readonly GREEN: Color;
  3721. /**
  3722. * An immutable Color instance initialized to CSS color #ADFF2F
  3723. * <span class="colorSwath" style="background: #ADFF2F;"></span>
  3724. */
  3725. static readonly GREENYELLOW: Color;
  3726. /**
  3727. * An immutable Color instance initialized to CSS color #808080
  3728. * <span class="colorSwath" style="background: #808080;"></span>
  3729. */
  3730. static readonly GREY: Color;
  3731. /**
  3732. * An immutable Color instance initialized to CSS color #F0FFF0
  3733. * <span class="colorSwath" style="background: #F0FFF0;"></span>
  3734. */
  3735. static readonly HONEYDEW: Color;
  3736. /**
  3737. * An immutable Color instance initialized to CSS color #FF69B4
  3738. * <span class="colorSwath" style="background: #FF69B4;"></span>
  3739. */
  3740. static readonly HOTPINK: Color;
  3741. /**
  3742. * An immutable Color instance initialized to CSS color #CD5C5C
  3743. * <span class="colorSwath" style="background: #CD5C5C;"></span>
  3744. */
  3745. static readonly INDIANRED: Color;
  3746. /**
  3747. * An immutable Color instance initialized to CSS color #4B0082
  3748. * <span class="colorSwath" style="background: #4B0082;"></span>
  3749. */
  3750. static readonly INDIGO: Color;
  3751. /**
  3752. * An immutable Color instance initialized to CSS color #FFFFF0
  3753. * <span class="colorSwath" style="background: #FFFFF0;"></span>
  3754. */
  3755. static readonly IVORY: Color;
  3756. /**
  3757. * An immutable Color instance initialized to CSS color #F0E68C
  3758. * <span class="colorSwath" style="background: #F0E68C;"></span>
  3759. */
  3760. static readonly KHAKI: Color;
  3761. /**
  3762. * An immutable Color instance initialized to CSS color #E6E6FA
  3763. * <span class="colorSwath" style="background: #E6E6FA;"></span>
  3764. */
  3765. static readonly LAVENDER: Color;
  3766. /**
  3767. * An immutable Color instance initialized to CSS color #FFF0F5
  3768. * <span class="colorSwath" style="background: #FFF0F5;"></span>
  3769. */
  3770. static readonly LAVENDAR_BLUSH: Color;
  3771. /**
  3772. * An immutable Color instance initialized to CSS color #7CFC00
  3773. * <span class="colorSwath" style="background: #7CFC00;"></span>
  3774. */
  3775. static readonly LAWNGREEN: Color;
  3776. /**
  3777. * An immutable Color instance initialized to CSS color #FFFACD
  3778. * <span class="colorSwath" style="background: #FFFACD;"></span>
  3779. */
  3780. static readonly LEMONCHIFFON: Color;
  3781. /**
  3782. * An immutable Color instance initialized to CSS color #ADD8E6
  3783. * <span class="colorSwath" style="background: #ADD8E6;"></span>
  3784. */
  3785. static readonly LIGHTBLUE: Color;
  3786. /**
  3787. * An immutable Color instance initialized to CSS color #F08080
  3788. * <span class="colorSwath" style="background: #F08080;"></span>
  3789. */
  3790. static readonly LIGHTCORAL: Color;
  3791. /**
  3792. * An immutable Color instance initialized to CSS color #E0FFFF
  3793. * <span class="colorSwath" style="background: #E0FFFF;"></span>
  3794. */
  3795. static readonly LIGHTCYAN: Color;
  3796. /**
  3797. * An immutable Color instance initialized to CSS color #FAFAD2
  3798. * <span class="colorSwath" style="background: #FAFAD2;"></span>
  3799. */
  3800. static readonly LIGHTGOLDENRODYELLOW: Color;
  3801. /**
  3802. * An immutable Color instance initialized to CSS color #D3D3D3
  3803. * <span class="colorSwath" style="background: #D3D3D3;"></span>
  3804. */
  3805. static readonly LIGHTGRAY: Color;
  3806. /**
  3807. * An immutable Color instance initialized to CSS color #90EE90
  3808. * <span class="colorSwath" style="background: #90EE90;"></span>
  3809. */
  3810. static readonly LIGHTGREEN: Color;
  3811. /**
  3812. * An immutable Color instance initialized to CSS color #D3D3D3
  3813. * <span class="colorSwath" style="background: #D3D3D3;"></span>
  3814. */
  3815. static readonly LIGHTGREY: Color;
  3816. /**
  3817. * An immutable Color instance initialized to CSS color #FFB6C1
  3818. * <span class="colorSwath" style="background: #FFB6C1;"></span>
  3819. */
  3820. static readonly LIGHTPINK: Color;
  3821. /**
  3822. * An immutable Color instance initialized to CSS color #20B2AA
  3823. * <span class="colorSwath" style="background: #20B2AA;"></span>
  3824. */
  3825. static readonly LIGHTSEAGREEN: Color;
  3826. /**
  3827. * An immutable Color instance initialized to CSS color #87CEFA
  3828. * <span class="colorSwath" style="background: #87CEFA;"></span>
  3829. */
  3830. static readonly LIGHTSKYBLUE: Color;
  3831. /**
  3832. * An immutable Color instance initialized to CSS color #778899
  3833. * <span class="colorSwath" style="background: #778899;"></span>
  3834. */
  3835. static readonly LIGHTSLATEGRAY: Color;
  3836. /**
  3837. * An immutable Color instance initialized to CSS color #778899
  3838. * <span class="colorSwath" style="background: #778899;"></span>
  3839. */
  3840. static readonly LIGHTSLATEGREY: Color;
  3841. /**
  3842. * An immutable Color instance initialized to CSS color #B0C4DE
  3843. * <span class="colorSwath" style="background: #B0C4DE;"></span>
  3844. */
  3845. static readonly LIGHTSTEELBLUE: Color;
  3846. /**
  3847. * An immutable Color instance initialized to CSS color #FFFFE0
  3848. * <span class="colorSwath" style="background: #FFFFE0;"></span>
  3849. */
  3850. static readonly LIGHTYELLOW: Color;
  3851. /**
  3852. * An immutable Color instance initialized to CSS color #00FF00
  3853. * <span class="colorSwath" style="background: #00FF00;"></span>
  3854. */
  3855. static readonly LIME: Color;
  3856. /**
  3857. * An immutable Color instance initialized to CSS color #32CD32
  3858. * <span class="colorSwath" style="background: #32CD32;"></span>
  3859. */
  3860. static readonly LIMEGREEN: Color;
  3861. /**
  3862. * An immutable Color instance initialized to CSS color #FAF0E6
  3863. * <span class="colorSwath" style="background: #FAF0E6;"></span>
  3864. */
  3865. static readonly LINEN: Color;
  3866. /**
  3867. * An immutable Color instance initialized to CSS color #FF00FF
  3868. * <span class="colorSwath" style="background: #FF00FF;"></span>
  3869. */
  3870. static readonly MAGENTA: Color;
  3871. /**
  3872. * An immutable Color instance initialized to CSS color #800000
  3873. * <span class="colorSwath" style="background: #800000;"></span>
  3874. */
  3875. static readonly MAROON: Color;
  3876. /**
  3877. * An immutable Color instance initialized to CSS color #66CDAA
  3878. * <span class="colorSwath" style="background: #66CDAA;"></span>
  3879. */
  3880. static readonly MEDIUMAQUAMARINE: Color;
  3881. /**
  3882. * An immutable Color instance initialized to CSS color #0000CD
  3883. * <span class="colorSwath" style="background: #0000CD;"></span>
  3884. */
  3885. static readonly MEDIUMBLUE: Color;
  3886. /**
  3887. * An immutable Color instance initialized to CSS color #BA55D3
  3888. * <span class="colorSwath" style="background: #BA55D3;"></span>
  3889. */
  3890. static readonly MEDIUMORCHID: Color;
  3891. /**
  3892. * An immutable Color instance initialized to CSS color #9370DB
  3893. * <span class="colorSwath" style="background: #9370DB;"></span>
  3894. */
  3895. static readonly MEDIUMPURPLE: Color;
  3896. /**
  3897. * An immutable Color instance initialized to CSS color #3CB371
  3898. * <span class="colorSwath" style="background: #3CB371;"></span>
  3899. */
  3900. static readonly MEDIUMSEAGREEN: Color;
  3901. /**
  3902. * An immutable Color instance initialized to CSS color #7B68EE
  3903. * <span class="colorSwath" style="background: #7B68EE;"></span>
  3904. */
  3905. static readonly MEDIUMSLATEBLUE: Color;
  3906. /**
  3907. * An immutable Color instance initialized to CSS color #00FA9A
  3908. * <span class="colorSwath" style="background: #00FA9A;"></span>
  3909. */
  3910. static readonly MEDIUMSPRINGGREEN: Color;
  3911. /**
  3912. * An immutable Color instance initialized to CSS color #48D1CC
  3913. * <span class="colorSwath" style="background: #48D1CC;"></span>
  3914. */
  3915. static readonly MEDIUMTURQUOISE: Color;
  3916. /**
  3917. * An immutable Color instance initialized to CSS color #C71585
  3918. * <span class="colorSwath" style="background: #C71585;"></span>
  3919. */
  3920. static readonly MEDIUMVIOLETRED: Color;
  3921. /**
  3922. * An immutable Color instance initialized to CSS color #191970
  3923. * <span class="colorSwath" style="background: #191970;"></span>
  3924. */
  3925. static readonly MIDNIGHTBLUE: Color;
  3926. /**
  3927. * An immutable Color instance initialized to CSS color #F5FFFA
  3928. * <span class="colorSwath" style="background: #F5FFFA;"></span>
  3929. */
  3930. static readonly MINTCREAM: Color;
  3931. /**
  3932. * An immutable Color instance initialized to CSS color #FFE4E1
  3933. * <span class="colorSwath" style="background: #FFE4E1;"></span>
  3934. */
  3935. static readonly MISTYROSE: Color;
  3936. /**
  3937. * An immutable Color instance initialized to CSS color #FFE4B5
  3938. * <span class="colorSwath" style="background: #FFE4B5;"></span>
  3939. */
  3940. static readonly MOCCASIN: Color;
  3941. /**
  3942. * An immutable Color instance initialized to CSS color #FFDEAD
  3943. * <span class="colorSwath" style="background: #FFDEAD;"></span>
  3944. */
  3945. static readonly NAVAJOWHITE: Color;
  3946. /**
  3947. * An immutable Color instance initialized to CSS color #000080
  3948. * <span class="colorSwath" style="background: #000080;"></span>
  3949. */
  3950. static readonly NAVY: Color;
  3951. /**
  3952. * An immutable Color instance initialized to CSS color #FDF5E6
  3953. * <span class="colorSwath" style="background: #FDF5E6;"></span>
  3954. */
  3955. static readonly OLDLACE: Color;
  3956. /**
  3957. * An immutable Color instance initialized to CSS color #808000
  3958. * <span class="colorSwath" style="background: #808000;"></span>
  3959. */
  3960. static readonly OLIVE: Color;
  3961. /**
  3962. * An immutable Color instance initialized to CSS color #6B8E23
  3963. * <span class="colorSwath" style="background: #6B8E23;"></span>
  3964. */
  3965. static readonly OLIVEDRAB: Color;
  3966. /**
  3967. * An immutable Color instance initialized to CSS color #FFA500
  3968. * <span class="colorSwath" style="background: #FFA500;"></span>
  3969. */
  3970. static readonly ORANGE: Color;
  3971. /**
  3972. * An immutable Color instance initialized to CSS color #FF4500
  3973. * <span class="colorSwath" style="background: #FF4500;"></span>
  3974. */
  3975. static readonly ORANGERED: Color;
  3976. /**
  3977. * An immutable Color instance initialized to CSS color #DA70D6
  3978. * <span class="colorSwath" style="background: #DA70D6;"></span>
  3979. */
  3980. static readonly ORCHID: Color;
  3981. /**
  3982. * An immutable Color instance initialized to CSS color #EEE8AA
  3983. * <span class="colorSwath" style="background: #EEE8AA;"></span>
  3984. */
  3985. static readonly PALEGOLDENROD: Color;
  3986. /**
  3987. * An immutable Color instance initialized to CSS color #98FB98
  3988. * <span class="colorSwath" style="background: #98FB98;"></span>
  3989. */
  3990. static readonly PALEGREEN: Color;
  3991. /**
  3992. * An immutable Color instance initialized to CSS color #AFEEEE
  3993. * <span class="colorSwath" style="background: #AFEEEE;"></span>
  3994. */
  3995. static readonly PALETURQUOISE: Color;
  3996. /**
  3997. * An immutable Color instance initialized to CSS color #DB7093
  3998. * <span class="colorSwath" style="background: #DB7093;"></span>
  3999. */
  4000. static readonly PALEVIOLETRED: Color;
  4001. /**
  4002. * An immutable Color instance initialized to CSS color #FFEFD5
  4003. * <span class="colorSwath" style="background: #FFEFD5;"></span>
  4004. */
  4005. static readonly PAPAYAWHIP: Color;
  4006. /**
  4007. * An immutable Color instance initialized to CSS color #FFDAB9
  4008. * <span class="colorSwath" style="background: #FFDAB9;"></span>
  4009. */
  4010. static readonly PEACHPUFF: Color;
  4011. /**
  4012. * An immutable Color instance initialized to CSS color #CD853F
  4013. * <span class="colorSwath" style="background: #CD853F;"></span>
  4014. */
  4015. static readonly PERU: Color;
  4016. /**
  4017. * An immutable Color instance initialized to CSS color #FFC0CB
  4018. * <span class="colorSwath" style="background: #FFC0CB;"></span>
  4019. */
  4020. static readonly PINK: Color;
  4021. /**
  4022. * An immutable Color instance initialized to CSS color #DDA0DD
  4023. * <span class="colorSwath" style="background: #DDA0DD;"></span>
  4024. */
  4025. static readonly PLUM: Color;
  4026. /**
  4027. * An immutable Color instance initialized to CSS color #B0E0E6
  4028. * <span class="colorSwath" style="background: #B0E0E6;"></span>
  4029. */
  4030. static readonly POWDERBLUE: Color;
  4031. /**
  4032. * An immutable Color instance initialized to CSS color #800080
  4033. * <span class="colorSwath" style="background: #800080;"></span>
  4034. */
  4035. static readonly PURPLE: Color;
  4036. /**
  4037. * An immutable Color instance initialized to CSS color #FF0000
  4038. * <span class="colorSwath" style="background: #FF0000;"></span>
  4039. */
  4040. static readonly RED: Color;
  4041. /**
  4042. * An immutable Color instance initialized to CSS color #BC8F8F
  4043. * <span class="colorSwath" style="background: #BC8F8F;"></span>
  4044. */
  4045. static readonly ROSYBROWN: Color;
  4046. /**
  4047. * An immutable Color instance initialized to CSS color #4169E1
  4048. * <span class="colorSwath" style="background: #4169E1;"></span>
  4049. */
  4050. static readonly ROYALBLUE: Color;
  4051. /**
  4052. * An immutable Color instance initialized to CSS color #8B4513
  4053. * <span class="colorSwath" style="background: #8B4513;"></span>
  4054. */
  4055. static readonly SADDLEBROWN: Color;
  4056. /**
  4057. * An immutable Color instance initialized to CSS color #FA8072
  4058. * <span class="colorSwath" style="background: #FA8072;"></span>
  4059. */
  4060. static readonly SALMON: Color;
  4061. /**
  4062. * An immutable Color instance initialized to CSS color #F4A460
  4063. * <span class="colorSwath" style="background: #F4A460;"></span>
  4064. */
  4065. static readonly SANDYBROWN: Color;
  4066. /**
  4067. * An immutable Color instance initialized to CSS color #2E8B57
  4068. * <span class="colorSwath" style="background: #2E8B57;"></span>
  4069. */
  4070. static readonly SEAGREEN: Color;
  4071. /**
  4072. * An immutable Color instance initialized to CSS color #FFF5EE
  4073. * <span class="colorSwath" style="background: #FFF5EE;"></span>
  4074. */
  4075. static readonly SEASHELL: Color;
  4076. /**
  4077. * An immutable Color instance initialized to CSS color #A0522D
  4078. * <span class="colorSwath" style="background: #A0522D;"></span>
  4079. */
  4080. static readonly SIENNA: Color;
  4081. /**
  4082. * An immutable Color instance initialized to CSS color #C0C0C0
  4083. * <span class="colorSwath" style="background: #C0C0C0;"></span>
  4084. */
  4085. static readonly SILVER: Color;
  4086. /**
  4087. * An immutable Color instance initialized to CSS color #87CEEB
  4088. * <span class="colorSwath" style="background: #87CEEB;"></span>
  4089. */
  4090. static readonly SKYBLUE: Color;
  4091. /**
  4092. * An immutable Color instance initialized to CSS color #6A5ACD
  4093. * <span class="colorSwath" style="background: #6A5ACD;"></span>
  4094. */
  4095. static readonly SLATEBLUE: Color;
  4096. /**
  4097. * An immutable Color instance initialized to CSS color #708090
  4098. * <span class="colorSwath" style="background: #708090;"></span>
  4099. */
  4100. static readonly SLATEGRAY: Color;
  4101. /**
  4102. * An immutable Color instance initialized to CSS color #708090
  4103. * <span class="colorSwath" style="background: #708090;"></span>
  4104. */
  4105. static readonly SLATEGREY: Color;
  4106. /**
  4107. * An immutable Color instance initialized to CSS color #FFFAFA
  4108. * <span class="colorSwath" style="background: #FFFAFA;"></span>
  4109. */
  4110. static readonly SNOW: Color;
  4111. /**
  4112. * An immutable Color instance initialized to CSS color #00FF7F
  4113. * <span class="colorSwath" style="background: #00FF7F;"></span>
  4114. */
  4115. static readonly SPRINGGREEN: Color;
  4116. /**
  4117. * An immutable Color instance initialized to CSS color #4682B4
  4118. * <span class="colorSwath" style="background: #4682B4;"></span>
  4119. */
  4120. static readonly STEELBLUE: Color;
  4121. /**
  4122. * An immutable Color instance initialized to CSS color #D2B48C
  4123. * <span class="colorSwath" style="background: #D2B48C;"></span>
  4124. */
  4125. static readonly TAN: Color;
  4126. /**
  4127. * An immutable Color instance initialized to CSS color #008080
  4128. * <span class="colorSwath" style="background: #008080;"></span>
  4129. */
  4130. static readonly TEAL: Color;
  4131. /**
  4132. * An immutable Color instance initialized to CSS color #D8BFD8
  4133. * <span class="colorSwath" style="background: #D8BFD8;"></span>
  4134. */
  4135. static readonly THISTLE: Color;
  4136. /**
  4137. * An immutable Color instance initialized to CSS color #FF6347
  4138. * <span class="colorSwath" style="background: #FF6347;"></span>
  4139. */
  4140. static readonly TOMATO: Color;
  4141. /**
  4142. * An immutable Color instance initialized to CSS color #40E0D0
  4143. * <span class="colorSwath" style="background: #40E0D0;"></span>
  4144. */
  4145. static readonly TURQUOISE: Color;
  4146. /**
  4147. * An immutable Color instance initialized to CSS color #EE82EE
  4148. * <span class="colorSwath" style="background: #EE82EE;"></span>
  4149. */
  4150. static readonly VIOLET: Color;
  4151. /**
  4152. * An immutable Color instance initialized to CSS color #F5DEB3
  4153. * <span class="colorSwath" style="background: #F5DEB3;"></span>
  4154. */
  4155. static readonly WHEAT: Color;
  4156. /**
  4157. * An immutable Color instance initialized to CSS color #FFFFFF
  4158. * <span class="colorSwath" style="background: #FFFFFF;"></span>
  4159. */
  4160. static readonly WHITE: Color;
  4161. /**
  4162. * An immutable Color instance initialized to CSS color #F5F5F5
  4163. * <span class="colorSwath" style="background: #F5F5F5;"></span>
  4164. */
  4165. static readonly WHITESMOKE: Color;
  4166. /**
  4167. * An immutable Color instance initialized to CSS color #FFFF00
  4168. * <span class="colorSwath" style="background: #FFFF00;"></span>
  4169. */
  4170. static readonly YELLOW: Color;
  4171. /**
  4172. * An immutable Color instance initialized to CSS color #9ACD32
  4173. * <span class="colorSwath" style="background: #9ACD32;"></span>
  4174. */
  4175. static readonly YELLOWGREEN: Color;
  4176. /**
  4177. * An immutable Color instance initialized to CSS transparent.
  4178. * <span class="colorSwath" style="background: transparent;"></span>
  4179. */
  4180. static readonly TRANSPARENT: Color;
  4181. }
  4182. /**
  4183. * Value and type information for per-instance geometry color.
  4184. * @example
  4185. * var instance = new Cesium.GeometryInstance({
  4186. * geometry : Cesium.BoxGeometry.fromDimensions({
  4187. * dimensions : new Cesium.Cartesian3(1000000.0, 1000000.0, 500000.0)
  4188. * }),
  4189. * modelMatrix : Cesium.Matrix4.multiplyByTranslation(Cesium.Transforms.eastNorthUpToFixedFrame(
  4190. * Cesium.Cartesian3.fromDegrees(0.0, 0.0)), new Cesium.Cartesian3(0.0, 0.0, 1000000.0), new Cesium.Matrix4()),
  4191. * id : 'box',
  4192. * attributes : {
  4193. * color : new Cesium.ColorGeometryInstanceAttribute(red, green, blue, alpha)
  4194. * }
  4195. * });
  4196. * @param [red = 1.0] - The red component.
  4197. * @param [green = 1.0] - The green component.
  4198. * @param [blue = 1.0] - The blue component.
  4199. * @param [alpha = 1.0] - The alpha component.
  4200. */
  4201. export class ColorGeometryInstanceAttribute {
  4202. constructor(red?: number, green?: number, blue?: number, alpha?: number);
  4203. /**
  4204. * The values for the attributes stored in a typed array.
  4205. */
  4206. value: Uint8Array;
  4207. /**
  4208. * The datatype of each component in the attribute, e.g., individual elements in
  4209. * {@link ColorGeometryInstanceAttribute#value}.
  4210. */
  4211. readonly componentDatatype: ComponentDatatype;
  4212. /**
  4213. * The number of components in the attributes, i.e., {@link ColorGeometryInstanceAttribute#value}.
  4214. */
  4215. readonly componentsPerAttribute: number;
  4216. /**
  4217. * When <code>true</code> and <code>componentDatatype</code> is an integer format,
  4218. * indicate that the components should be mapped to the range [0, 1] (unsigned)
  4219. * or [-1, 1] (signed) when they are accessed as floating-point for rendering.
  4220. */
  4221. readonly normalize: boolean;
  4222. /**
  4223. * Creates a new {@link ColorGeometryInstanceAttribute} instance given the provided {@link Color}.
  4224. * @example
  4225. * var instance = new Cesium.GeometryInstance({
  4226. * geometry : geometry,
  4227. * attributes : {
  4228. * color : Cesium.ColorGeometryInstanceAttribute.fromColor(Cesium.Color.CORNFLOWERBLUE),
  4229. * }
  4230. * });
  4231. * @param color - The color.
  4232. * @returns The new {@link ColorGeometryInstanceAttribute} instance.
  4233. */
  4234. static fromColor(color: Color): ColorGeometryInstanceAttribute;
  4235. /**
  4236. * Converts a color to a typed array that can be used to assign a color attribute.
  4237. * @example
  4238. * var attributes = primitive.getGeometryInstanceAttributes('an id');
  4239. * attributes.color = Cesium.ColorGeometryInstanceAttribute.toValue(Cesium.Color.AQUA, attributes.color);
  4240. * @param color - The color.
  4241. * @param [result] - The array to store the result in, if undefined a new instance will be created.
  4242. * @returns The modified result parameter or a new instance if result was undefined.
  4243. */
  4244. static toValue(color: Color, result?: Uint8Array): Uint8Array;
  4245. /**
  4246. * Compares the provided ColorGeometryInstanceAttributes and returns
  4247. * <code>true</code> if they are equal, <code>false</code> otherwise.
  4248. * @param [left] - The first ColorGeometryInstanceAttribute.
  4249. * @param [right] - The second ColorGeometryInstanceAttribute.
  4250. * @returns <code>true</code> if left and right are equal, <code>false</code> otherwise.
  4251. */
  4252. static equals(left?: ColorGeometryInstanceAttribute, right?: ColorGeometryInstanceAttribute): boolean;
  4253. }
  4254. /**
  4255. * WebGL component datatypes. Components are intrinsics,
  4256. * which form attributes, which form vertices.
  4257. */
  4258. export enum ComponentDatatype {
  4259. /**
  4260. * 8-bit signed byte corresponding to <code>gl.BYTE</code> and the type
  4261. * of an element in <code>Int8Array</code>.
  4262. */
  4263. BYTE = WebGLConstants.BYTE,
  4264. /**
  4265. * 8-bit unsigned byte corresponding to <code>UNSIGNED_BYTE</code> and the type
  4266. * of an element in <code>Uint8Array</code>.
  4267. */
  4268. UNSIGNED_BYTE = WebGLConstants.UNSIGNED_BYTE,
  4269. /**
  4270. * 16-bit signed short corresponding to <code>SHORT</code> and the type
  4271. * of an element in <code>Int16Array</code>.
  4272. */
  4273. SHORT = WebGLConstants.SHORT,
  4274. /**
  4275. * 16-bit unsigned short corresponding to <code>UNSIGNED_SHORT</code> and the type
  4276. * of an element in <code>Uint16Array</code>.
  4277. */
  4278. UNSIGNED_SHORT = WebGLConstants.UNSIGNED_SHORT,
  4279. /**
  4280. * 32-bit signed int corresponding to <code>INT</code> and the type
  4281. * of an element in <code>Int32Array</code>.
  4282. */
  4283. INT = WebGLConstants.INT,
  4284. /**
  4285. * 32-bit unsigned int corresponding to <code>UNSIGNED_INT</code> and the type
  4286. * of an element in <code>Uint32Array</code>.
  4287. */
  4288. UNSIGNED_INT = WebGLConstants.UNSIGNED_INT,
  4289. /**
  4290. * 32-bit floating-point corresponding to <code>FLOAT</code> and the type
  4291. * of an element in <code>Float32Array</code>.
  4292. */
  4293. FLOAT = WebGLConstants.FLOAT,
  4294. /**
  4295. * 64-bit floating-point corresponding to <code>gl.DOUBLE</code> (in Desktop OpenGL;
  4296. * this is not supported in WebGL, and is emulated in Cesium via {@link GeometryPipeline.encodeAttribute})
  4297. * and the type of an element in <code>Float64Array</code>.
  4298. */
  4299. DOUBLE = WebGLConstants.DOUBLE
  4300. }
  4301. /**
  4302. * Describes a compressed texture and contains a compressed texture buffer.
  4303. * @param internalFormat - The pixel format of the compressed texture.
  4304. * @param width - The width of the texture.
  4305. * @param height - The height of the texture.
  4306. * @param buffer - The compressed texture buffer.
  4307. */
  4308. export class CompressedTextureBuffer {
  4309. constructor(internalFormat: PixelFormat, width: number, height: number, buffer: Uint8Array);
  4310. /**
  4311. * The format of the compressed texture.
  4312. */
  4313. readonly internalFormat: PixelFormat;
  4314. /**
  4315. * The width of the texture.
  4316. */
  4317. readonly width: number;
  4318. /**
  4319. * The height of the texture.
  4320. */
  4321. readonly height: number;
  4322. /**
  4323. * The compressed texture buffer.
  4324. */
  4325. readonly bufferView: Uint8Array;
  4326. /**
  4327. * Creates a shallow clone of a compressed texture buffer.
  4328. * @param object - The compressed texture buffer to be cloned.
  4329. * @returns A shallow clone of the compressed texture buffer.
  4330. */
  4331. static clone(object: CompressedTextureBuffer): CompressedTextureBuffer;
  4332. /**
  4333. * Creates a shallow clone of this compressed texture buffer.
  4334. * @returns A shallow clone of the compressed texture buffer.
  4335. */
  4336. clone(): CompressedTextureBuffer;
  4337. }
  4338. /**
  4339. * A description of a polygon composed of arbitrary coplanar positions.
  4340. * @example
  4341. * var polygon = new Cesium.CoplanarPolygonGeometry({
  4342. * positions : Cesium.Cartesian3.fromDegreesArrayHeights([
  4343. * -90.0, 30.0, 0.0,
  4344. * -90.0, 30.0, 1000.0,
  4345. * -80.0, 30.0, 1000.0,
  4346. * -80.0, 30.0, 0.0
  4347. * ])
  4348. * });
  4349. * var geometry = Cesium.CoplanarPolygonGeometry.createGeometry(polygon);
  4350. * @param options - Object with the following properties:
  4351. * @param options.polygonHierarchy - A polygon hierarchy that can include holes.
  4352. * @param [options.stRotation = 0.0] - The rotation of the texture coordinates, in radians. A positive rotation is counter-clockwise.
  4353. * @param [options.vertexFormat = VertexFormat.DEFAULT] - The vertex attributes to be computed.
  4354. * @param [options.ellipsoid = Ellipsoid.WGS84] - The ellipsoid to be used as a reference.
  4355. */
  4356. export class CoplanarPolygonGeometry {
  4357. constructor(options: {
  4358. polygonHierarchy: PolygonHierarchy;
  4359. stRotation?: number;
  4360. vertexFormat?: VertexFormat;
  4361. ellipsoid?: Ellipsoid;
  4362. });
  4363. /**
  4364. * The number of elements used to pack the object into an array.
  4365. */
  4366. packedLength: number;
  4367. /**
  4368. * A description of a coplanar polygon from an array of positions.
  4369. * @example
  4370. * // create a polygon from points
  4371. * var polygon = Cesium.CoplanarPolygonGeometry.fromPositions({
  4372. * positions : Cesium.Cartesian3.fromDegreesArray([
  4373. * -72.0, 40.0,
  4374. * -70.0, 35.0,
  4375. * -75.0, 30.0,
  4376. * -70.0, 30.0,
  4377. * -68.0, 40.0
  4378. * ])
  4379. * });
  4380. * var geometry = Cesium.PolygonGeometry.createGeometry(polygon);
  4381. * @param options - Object with the following properties:
  4382. * @param options.positions - An array of positions that defined the corner points of the polygon.
  4383. * @param [options.vertexFormat = VertexFormat.DEFAULT] - The vertex attributes to be computed.
  4384. * @param [options.stRotation = 0.0] - The rotation of the texture coordinates, in radians. A positive rotation is counter-clockwise.
  4385. * @param [options.ellipsoid = Ellipsoid.WGS84] - The ellipsoid to be used as a reference.
  4386. */
  4387. static fromPositions(options: {
  4388. positions: Cartesian3[];
  4389. vertexFormat?: VertexFormat;
  4390. stRotation?: number;
  4391. ellipsoid?: Ellipsoid;
  4392. }): CoplanarPolygonGeometry;
  4393. /**
  4394. * Stores the provided instance into the provided array.
  4395. * @param value - The value to pack.
  4396. * @param array - The array to pack into.
  4397. * @param [startingIndex = 0] - The index into the array at which to start packing the elements.
  4398. * @returns The array that was packed into
  4399. */
  4400. static pack(value: CoplanarPolygonGeometry, array: number[], startingIndex?: number): number[];
  4401. /**
  4402. * Retrieves an instance from a packed array.
  4403. * @param array - The packed array.
  4404. * @param [startingIndex = 0] - The starting index of the element to be unpacked.
  4405. * @param [result] - The object into which to store the result.
  4406. * @returns The modified result parameter or a new CoplanarPolygonGeometry instance if one was not provided.
  4407. */
  4408. static unpack(array: number[], startingIndex?: number, result?: CoplanarPolygonGeometry): CoplanarPolygonGeometry;
  4409. /**
  4410. * Computes the geometric representation of an arbitrary coplanar polygon, including its vertices, indices, and a bounding sphere.
  4411. * @param polygonGeometry - A description of the polygon.
  4412. * @returns The computed vertices and indices.
  4413. */
  4414. static createGeometry(polygonGeometry: CoplanarPolygonGeometry): Geometry | undefined;
  4415. }
  4416. /**
  4417. * A description of the outline of a polygon composed of arbitrary coplanar positions.
  4418. * @example
  4419. * var polygonOutline = new Cesium.CoplanarPolygonOutlineGeometry({
  4420. * positions : Cesium.Cartesian3.fromDegreesArrayHeights([
  4421. * -90.0, 30.0, 0.0,
  4422. * -90.0, 30.0, 1000.0,
  4423. * -80.0, 30.0, 1000.0,
  4424. * -80.0, 30.0, 0.0
  4425. * ])
  4426. * });
  4427. * var geometry = Cesium.CoplanarPolygonOutlineGeometry.createGeometry(polygonOutline);
  4428. * @param options - Object with the following properties:
  4429. * @param options.polygonHierarchy - A polygon hierarchy that can include holes.
  4430. */
  4431. export class CoplanarPolygonOutlineGeometry {
  4432. constructor(options: {
  4433. polygonHierarchy: PolygonHierarchy;
  4434. });
  4435. /**
  4436. * The number of elements used to pack the object into an array.
  4437. */
  4438. packedLength: number;
  4439. /**
  4440. * A description of a coplanar polygon outline from an array of positions.
  4441. * @param options - Object with the following properties:
  4442. * @param options.positions - An array of positions that defined the corner points of the polygon.
  4443. */
  4444. static fromPositions(options: {
  4445. positions: Cartesian3[];
  4446. }): CoplanarPolygonOutlineGeometry;
  4447. /**
  4448. * Stores the provided instance into the provided array.
  4449. * @param value - The value to pack.
  4450. * @param array - The array to pack into.
  4451. * @param [startingIndex = 0] - The index into the array at which to start packing the elements.
  4452. * @returns The array that was packed into
  4453. */
  4454. static pack(value: CoplanarPolygonOutlineGeometry, array: number[], startingIndex?: number): number[];
  4455. /**
  4456. * Retrieves an instance from a packed array.
  4457. * @param array - The packed array.
  4458. * @param [startingIndex = 0] - The starting index of the element to be unpacked.
  4459. * @param [result] - The object into which to store the result.
  4460. * @returns The modified result parameter or a new CoplanarPolygonOutlineGeometry instance if one was not provided.
  4461. */
  4462. static unpack(array: number[], startingIndex?: number, result?: CoplanarPolygonOutlineGeometry): CoplanarPolygonOutlineGeometry;
  4463. /**
  4464. * Computes the geometric representation of an arbitrary coplanar polygon, including its vertices, indices, and a bounding sphere.
  4465. * @param polygonGeometry - A description of the polygon.
  4466. * @returns The computed vertices and indices.
  4467. */
  4468. static createGeometry(polygonGeometry: CoplanarPolygonOutlineGeometry): Geometry | undefined;
  4469. }
  4470. /**
  4471. * Style options for corners.
  4472. */
  4473. export enum CornerType {
  4474. /**
  4475. * <img src="Images/CornerTypeRounded.png" style="vertical-align: middle;" width="186" height="189" />
  4476. *
  4477. * Corner has a smooth edge.
  4478. */
  4479. ROUNDED = 0,
  4480. /**
  4481. * <img src="Images/CornerTypeMitered.png" style="vertical-align: middle;" width="186" height="189" />
  4482. *
  4483. * Corner point is the intersection of adjacent edges.
  4484. */
  4485. MITERED = 1,
  4486. /**
  4487. * <img src="Images/CornerTypeBeveled.png" style="vertical-align: middle;" width="186" height="189" />
  4488. *
  4489. * Corner is clipped.
  4490. */
  4491. BEVELED = 2
  4492. }
  4493. /**
  4494. * A description of a corridor. Corridor geometry can be rendered with both {@link Primitive} and {@link GroundPrimitive}.
  4495. * @example
  4496. * var corridor = new Cesium.CorridorGeometry({
  4497. * vertexFormat : Cesium.VertexFormat.POSITION_ONLY,
  4498. * positions : Cesium.Cartesian3.fromDegreesArray([-72.0, 40.0, -70.0, 35.0]),
  4499. * width : 100000
  4500. * });
  4501. * @param options - Object with the following properties:
  4502. * @param options.positions - An array of positions that define the center of the corridor.
  4503. * @param options.width - The distance between the edges of the corridor in meters.
  4504. * @param [options.ellipsoid = Ellipsoid.WGS84] - The ellipsoid to be used as a reference.
  4505. * @param [options.granularity = Math.RADIANS_PER_DEGREE] - The distance, in radians, between each latitude and longitude. Determines the number of positions in the buffer.
  4506. * @param [options.height = 0] - The distance in meters between the ellipsoid surface and the positions.
  4507. * @param [options.extrudedHeight] - The distance in meters between the ellipsoid surface and the extruded face.
  4508. * @param [options.vertexFormat = VertexFormat.DEFAULT] - The vertex attributes to be computed.
  4509. * @param [options.cornerType = CornerType.ROUNDED] - Determines the style of the corners.
  4510. */
  4511. export class CorridorGeometry {
  4512. constructor(options: {
  4513. positions: Cartesian3[];
  4514. width: number;
  4515. ellipsoid?: Ellipsoid;
  4516. granularity?: number;
  4517. height?: number;
  4518. extrudedHeight?: number;
  4519. vertexFormat?: VertexFormat;
  4520. cornerType?: CornerType;
  4521. });
  4522. /**
  4523. * The number of elements used to pack the object into an array.
  4524. */
  4525. packedLength: number;
  4526. /**
  4527. * Stores the provided instance into the provided array.
  4528. * @param value - The value to pack.
  4529. * @param array - The array to pack into.
  4530. * @param [startingIndex = 0] - The index into the array at which to start packing the elements.
  4531. * @returns The array that was packed into
  4532. */
  4533. static pack(value: CorridorGeometry, array: number[], startingIndex?: number): number[];
  4534. /**
  4535. * Retrieves an instance from a packed array.
  4536. * @param array - The packed array.
  4537. * @param [startingIndex = 0] - The starting index of the element to be unpacked.
  4538. * @param [result] - The object into which to store the result.
  4539. * @returns The modified result parameter or a new CorridorGeometry instance if one was not provided.
  4540. */
  4541. static unpack(array: number[], startingIndex?: number, result?: CorridorGeometry): CorridorGeometry;
  4542. /**
  4543. * Computes the bounding rectangle given the provided options
  4544. * @param options - Object with the following properties:
  4545. * @param options.positions - An array of positions that define the center of the corridor.
  4546. * @param options.width - The distance between the edges of the corridor in meters.
  4547. * @param [options.ellipsoid = Ellipsoid.WGS84] - The ellipsoid to be used as a reference.
  4548. * @param [options.cornerType = CornerType.ROUNDED] - Determines the style of the corners.
  4549. * @param [result] - An object in which to store the result.
  4550. * @returns The result rectangle.
  4551. */
  4552. static computeRectangle(options: {
  4553. positions: Cartesian3[];
  4554. width: number;
  4555. ellipsoid?: Ellipsoid;
  4556. cornerType?: CornerType;
  4557. }, result?: Rectangle): Rectangle;
  4558. /**
  4559. * Computes the geometric representation of a corridor, including its vertices, indices, and a bounding sphere.
  4560. * @param corridorGeometry - A description of the corridor.
  4561. * @returns The computed vertices and indices.
  4562. */
  4563. static createGeometry(corridorGeometry: CorridorGeometry): Geometry | undefined;
  4564. }
  4565. /**
  4566. * A description of a corridor outline.
  4567. * @example
  4568. * var corridor = new Cesium.CorridorOutlineGeometry({
  4569. * positions : Cesium.Cartesian3.fromDegreesArray([-72.0, 40.0, -70.0, 35.0]),
  4570. * width : 100000
  4571. * });
  4572. * @param options - Object with the following properties:
  4573. * @param options.positions - An array of positions that define the center of the corridor outline.
  4574. * @param options.width - The distance between the edges of the corridor outline.
  4575. * @param [options.ellipsoid = Ellipsoid.WGS84] - The ellipsoid to be used as a reference.
  4576. * @param [options.granularity = Math.RADIANS_PER_DEGREE] - The distance, in radians, between each latitude and longitude. Determines the number of positions in the buffer.
  4577. * @param [options.height = 0] - The distance in meters between the positions and the ellipsoid surface.
  4578. * @param [options.extrudedHeight] - The distance in meters between the extruded face and the ellipsoid surface.
  4579. * @param [options.cornerType = CornerType.ROUNDED] - Determines the style of the corners.
  4580. */
  4581. export class CorridorOutlineGeometry {
  4582. constructor(options: {
  4583. positions: Cartesian3[];
  4584. width: number;
  4585. ellipsoid?: Ellipsoid;
  4586. granularity?: number;
  4587. height?: number;
  4588. extrudedHeight?: number;
  4589. cornerType?: CornerType;
  4590. });
  4591. /**
  4592. * The number of elements used to pack the object into an array.
  4593. */
  4594. packedLength: number;
  4595. /**
  4596. * Stores the provided instance into the provided array.
  4597. * @param value - The value to pack.
  4598. * @param array - The array to pack into.
  4599. * @param [startingIndex = 0] - The index into the array at which to start packing the elements.
  4600. * @returns The array that was packed into
  4601. */
  4602. static pack(value: CorridorOutlineGeometry, array: number[], startingIndex?: number): number[];
  4603. /**
  4604. * Retrieves an instance from a packed array.
  4605. * @param array - The packed array.
  4606. * @param [startingIndex = 0] - The starting index of the element to be unpacked.
  4607. * @param [result] - The object into which to store the result.
  4608. * @returns The modified result parameter or a new CorridorOutlineGeometry instance if one was not provided.
  4609. */
  4610. static unpack(array: number[], startingIndex?: number, result?: CorridorOutlineGeometry): CorridorOutlineGeometry;
  4611. /**
  4612. * Computes the geometric representation of a corridor, including its vertices, indices, and a bounding sphere.
  4613. * @param corridorOutlineGeometry - A description of the corridor.
  4614. * @returns The computed vertices and indices.
  4615. */
  4616. static createGeometry(corridorOutlineGeometry: CorridorOutlineGeometry): Geometry | undefined;
  4617. }
  4618. /**
  4619. * A credit contains data pertaining to how to display attributions/credits for certain content on the screen.
  4620. * @example
  4621. * //Create a credit with a tooltip, image and link
  4622. * var credit = new Cesium.Credit('<a href="https://cesium.com/" target="_blank"><img src="/images/cesium_logo.png" title="Cesium"/></a>');
  4623. * @param html - An string representing an html code snippet
  4624. * @param [showOnScreen = false] - If true, the credit will be visible in the main credit container. Otherwise, it will appear in a popover
  4625. */
  4626. export class Credit {
  4627. constructor(html: string, showOnScreen?: boolean);
  4628. /**
  4629. * The credit content
  4630. */
  4631. readonly html: string;
  4632. /**
  4633. * Whether the credit should be displayed on screen or in a lightbox
  4634. */
  4635. readonly showOnScreen: boolean;
  4636. /**
  4637. * Gets the credit element
  4638. */
  4639. readonly element: HTMLElement;
  4640. /**
  4641. * Returns true if the credits are equal
  4642. * @param left - The first credit
  4643. * @param right - The second credit
  4644. * @returns <code>true</code> if left and right are equal, <code>false</code> otherwise.
  4645. */
  4646. static equals(left: Credit, right: Credit): boolean;
  4647. /**
  4648. * Returns true if the credits are equal
  4649. * @param credit - The credit to compare to.
  4650. * @returns <code>true</code> if left and right are equal, <code>false</code> otherwise.
  4651. */
  4652. equals(credit: Credit): boolean;
  4653. /**
  4654. * Duplicates a Credit instance.
  4655. * @param [credit] - The Credit to duplicate.
  4656. * @returns A new Credit instance that is a duplicate of the one provided. (Returns undefined if the credit is undefined)
  4657. */
  4658. static clone(credit?: Credit): Credit;
  4659. }
  4660. /**
  4661. * Defines functions for 3rd order polynomial functions of one variable with only real coefficients.
  4662. */
  4663. export namespace CubicRealPolynomial {
  4664. /**
  4665. * Provides the discriminant of the cubic equation from the supplied coefficients.
  4666. * @param a - The coefficient of the 3rd order monomial.
  4667. * @param b - The coefficient of the 2nd order monomial.
  4668. * @param c - The coefficient of the 1st order monomial.
  4669. * @param d - The coefficient of the 0th order monomial.
  4670. * @returns The value of the discriminant.
  4671. */
  4672. function computeDiscriminant(a: number, b: number, c: number, d: number): number;
  4673. /**
  4674. * Provides the real valued roots of the cubic polynomial with the provided coefficients.
  4675. * @param a - The coefficient of the 3rd order monomial.
  4676. * @param b - The coefficient of the 2nd order monomial.
  4677. * @param c - The coefficient of the 1st order monomial.
  4678. * @param d - The coefficient of the 0th order monomial.
  4679. * @returns The real valued roots.
  4680. */
  4681. function computeRealRoots(a: number, b: number, c: number, d: number): number[];
  4682. }
  4683. /**
  4684. * The culling volume defined by planes.
  4685. * @param [planes] - An array of clipping planes.
  4686. */
  4687. export class CullingVolume {
  4688. constructor(planes?: Cartesian4[]);
  4689. /**
  4690. * Each plane is represented by a Cartesian4 object, where the x, y, and z components
  4691. * define the unit vector normal to the plane, and the w component is the distance of the
  4692. * plane from the origin.
  4693. */
  4694. planes: Cartesian4[];
  4695. /**
  4696. * Constructs a culling volume from a bounding sphere. Creates six planes that create a box containing the sphere.
  4697. * The planes are aligned to the x, y, and z axes in world coordinates.
  4698. * @param boundingSphere - The bounding sphere used to create the culling volume.
  4699. * @param [result] - The object onto which to store the result.
  4700. * @returns The culling volume created from the bounding sphere.
  4701. */
  4702. static fromBoundingSphere(boundingSphere: BoundingSphere, result?: CullingVolume): CullingVolume;
  4703. /**
  4704. * Determines whether a bounding volume intersects the culling volume.
  4705. * @param boundingVolume - The bounding volume whose intersection with the culling volume is to be tested.
  4706. * @returns Intersect.OUTSIDE, Intersect.INTERSECTING, or Intersect.INSIDE.
  4707. */
  4708. computeVisibility(boundingVolume: any): Intersect;
  4709. }
  4710. /**
  4711. * A description of a cylinder.
  4712. * @example
  4713. * // create cylinder geometry
  4714. * var cylinder = new Cesium.CylinderGeometry({
  4715. * length: 200000,
  4716. * topRadius: 80000,
  4717. * bottomRadius: 200000,
  4718. * });
  4719. * var geometry = Cesium.CylinderGeometry.createGeometry(cylinder);
  4720. * @param options - Object with the following properties:
  4721. * @param options.length - The length of the cylinder.
  4722. * @param options.topRadius - The radius of the top of the cylinder.
  4723. * @param options.bottomRadius - The radius of the bottom of the cylinder.
  4724. * @param [options.slices = 128] - The number of edges around the perimeter of the cylinder.
  4725. * @param [options.vertexFormat = VertexFormat.DEFAULT] - The vertex attributes to be computed.
  4726. */
  4727. export class CylinderGeometry {
  4728. constructor(options: {
  4729. length: number;
  4730. topRadius: number;
  4731. bottomRadius: number;
  4732. slices?: number;
  4733. vertexFormat?: VertexFormat;
  4734. });
  4735. /**
  4736. * The number of elements used to pack the object into an array.
  4737. */
  4738. static packedLength: number;
  4739. /**
  4740. * Stores the provided instance into the provided array.
  4741. * @param value - The value to pack.
  4742. * @param array - The array to pack into.
  4743. * @param [startingIndex = 0] - The index into the array at which to start packing the elements.
  4744. * @returns The array that was packed into
  4745. */
  4746. static pack(value: CylinderGeometry, array: number[], startingIndex?: number): number[];
  4747. /**
  4748. * Retrieves an instance from a packed array.
  4749. * @param array - The packed array.
  4750. * @param [startingIndex = 0] - The starting index of the element to be unpacked.
  4751. * @param [result] - The object into which to store the result.
  4752. * @returns The modified result parameter or a new CylinderGeometry instance if one was not provided.
  4753. */
  4754. static unpack(array: number[], startingIndex?: number, result?: CylinderGeometry): CylinderGeometry;
  4755. /**
  4756. * Computes the geometric representation of a cylinder, including its vertices, indices, and a bounding sphere.
  4757. * @param cylinderGeometry - A description of the cylinder.
  4758. * @returns The computed vertices and indices.
  4759. */
  4760. static createGeometry(cylinderGeometry: CylinderGeometry): Geometry | undefined;
  4761. }
  4762. /**
  4763. * A description of the outline of a cylinder.
  4764. * @example
  4765. * // create cylinder geometry
  4766. * var cylinder = new Cesium.CylinderOutlineGeometry({
  4767. * length: 200000,
  4768. * topRadius: 80000,
  4769. * bottomRadius: 200000,
  4770. * });
  4771. * var geometry = Cesium.CylinderOutlineGeometry.createGeometry(cylinder);
  4772. * @param options - Object with the following properties:
  4773. * @param options.length - The length of the cylinder.
  4774. * @param options.topRadius - The radius of the top of the cylinder.
  4775. * @param options.bottomRadius - The radius of the bottom of the cylinder.
  4776. * @param [options.slices = 128] - The number of edges around the perimeter of the cylinder.
  4777. * @param [options.numberOfVerticalLines = 16] - Number of lines to draw between the top and bottom surfaces of the cylinder.
  4778. */
  4779. export class CylinderOutlineGeometry {
  4780. constructor(options: {
  4781. length: number;
  4782. topRadius: number;
  4783. bottomRadius: number;
  4784. slices?: number;
  4785. numberOfVerticalLines?: number;
  4786. });
  4787. /**
  4788. * The number of elements used to pack the object into an array.
  4789. */
  4790. static packedLength: number;
  4791. /**
  4792. * Stores the provided instance into the provided array.
  4793. * @param value - The value to pack.
  4794. * @param array - The array to pack into.
  4795. * @param [startingIndex = 0] - The index into the array at which to start packing the elements.
  4796. * @returns The array that was packed into
  4797. */
  4798. static pack(value: CylinderOutlineGeometry, array: number[], startingIndex?: number): number[];
  4799. /**
  4800. * Retrieves an instance from a packed array.
  4801. * @param array - The packed array.
  4802. * @param [startingIndex = 0] - The starting index of the element to be unpacked.
  4803. * @param [result] - The object into which to store the result.
  4804. * @returns The modified result parameter or a new CylinderOutlineGeometry instance if one was not provided.
  4805. */
  4806. static unpack(array: number[], startingIndex?: number, result?: CylinderOutlineGeometry): CylinderOutlineGeometry;
  4807. /**
  4808. * Computes the geometric representation of an outline of a cylinder, including its vertices, indices, and a bounding sphere.
  4809. * @param cylinderGeometry - A description of the cylinder outline.
  4810. * @returns The computed vertices and indices.
  4811. */
  4812. static createGeometry(cylinderGeometry: CylinderOutlineGeometry): Geometry | undefined;
  4813. }
  4814. /**
  4815. * A simple proxy that appends the desired resource as the sole query parameter
  4816. * to the given proxy URL.
  4817. * @param proxy - The proxy URL that will be used to requests all resources.
  4818. */
  4819. export class DefaultProxy extends Proxy {
  4820. constructor(proxy: string);
  4821. /**
  4822. * Get the final URL to use to request a given resource.
  4823. * @param resource - The resource to request.
  4824. * @returns proxied resource
  4825. */
  4826. getURL(resource: string): string;
  4827. }
  4828. /**
  4829. * Constructs an exception object that is thrown due to a developer error, e.g., invalid argument,
  4830. * argument out of range, etc. This exception should only be thrown during development;
  4831. * it usually indicates a bug in the calling code. This exception should never be
  4832. * caught; instead the calling code should strive not to generate it.
  4833. * <br /><br />
  4834. * On the other hand, a {@link RuntimeError} indicates an exception that may
  4835. * be thrown at runtime, e.g., out of memory, that the calling code should be prepared
  4836. * to catch.
  4837. * @param [message] - The error message for this exception.
  4838. */
  4839. export class DeveloperError extends Error {
  4840. constructor(message?: string);
  4841. /**
  4842. * 'DeveloperError' indicating that this exception was thrown due to a developer error.
  4843. */
  4844. readonly name: string;
  4845. /**
  4846. * The explanation for why this exception was thrown.
  4847. */
  4848. readonly message: string;
  4849. /**
  4850. * The stack trace of this exception, if available.
  4851. */
  4852. readonly stack: string;
  4853. }
  4854. /**
  4855. * Determines visibility based on the distance to the camera.
  4856. * @example
  4857. * // Make a billboard that is only visible when the distance to the camera is between 10 and 20 meters.
  4858. * billboard.distanceDisplayCondition = new Cesium.DistanceDisplayCondition(10.0, 20.0);
  4859. * @param [near = 0.0] - The smallest distance in the interval where the object is visible.
  4860. * @param [far = Number.MAX_VALUE] - The largest distance in the interval where the object is visible.
  4861. */
  4862. export class DistanceDisplayCondition {
  4863. constructor(near?: number, far?: number);
  4864. /**
  4865. * The smallest distance in the interval where the object is visible.
  4866. */
  4867. near: number;
  4868. /**
  4869. * The largest distance in the interval where the object is visible.
  4870. */
  4871. far: number;
  4872. /**
  4873. * The number of elements used to pack the object into an array.
  4874. */
  4875. static packedLength: number;
  4876. /**
  4877. * Stores the provided instance into the provided array.
  4878. * @param value - The value to pack.
  4879. * @param array - The array to pack into.
  4880. * @param [startingIndex = 0] - The index into the array at which to start packing the elements.
  4881. * @returns The array that was packed into
  4882. */
  4883. static pack(value: DistanceDisplayCondition, array: number[], startingIndex?: number): number[];
  4884. /**
  4885. * Retrieves an instance from a packed array.
  4886. * @param array - The packed array.
  4887. * @param [startingIndex = 0] - The starting index of the element to be unpacked.
  4888. * @param [result] - The object into which to store the result.
  4889. * @returns The modified result parameter or a new DistanceDisplayCondition instance if one was not provided.
  4890. */
  4891. static unpack(array: number[], startingIndex?: number, result?: DistanceDisplayCondition): DistanceDisplayCondition;
  4892. /**
  4893. * Determines if two distance display conditions are equal.
  4894. * @param left - A distance display condition.
  4895. * @param right - Another distance display condition.
  4896. * @returns Whether the two distance display conditions are equal.
  4897. */
  4898. static equals(left: DistanceDisplayCondition, right: DistanceDisplayCondition): boolean;
  4899. /**
  4900. * Duplicates a distance display condition instance.
  4901. * @param [value] - The distance display condition to duplicate.
  4902. * @param [result] - The result onto which to store the result.
  4903. * @returns The duplicated instance.
  4904. */
  4905. static clone(value?: DistanceDisplayCondition, result?: DistanceDisplayCondition): DistanceDisplayCondition;
  4906. /**
  4907. * Duplicates this instance.
  4908. * @param [result] - The result onto which to store the result.
  4909. * @returns The duplicated instance.
  4910. */
  4911. clone(result?: DistanceDisplayCondition): DistanceDisplayCondition;
  4912. /**
  4913. * Determines if this distance display condition is equal to another.
  4914. * @param other - Another distance display condition.
  4915. * @returns Whether this distance display condition is equal to the other.
  4916. */
  4917. equals(other: DistanceDisplayCondition): boolean;
  4918. }
  4919. /**
  4920. * Value and type information for per-instance geometry attribute that determines if the geometry instance has a distance display condition.
  4921. * @example
  4922. * var instance = new Cesium.GeometryInstance({
  4923. * geometry : new Cesium.BoxGeometry({
  4924. * vertexFormat : Cesium.VertexFormat.POSITION_AND_NORMAL,
  4925. * minimum : new Cesium.Cartesian3(-250000.0, -250000.0, -250000.0),
  4926. * maximum : new Cesium.Cartesian3(250000.0, 250000.0, 250000.0)
  4927. * }),
  4928. * modelMatrix : Cesium.Matrix4.multiplyByTranslation(Cesium.Transforms.eastNorthUpToFixedFrame(
  4929. * Cesium.Cartesian3.fromDegrees(-75.59777, 40.03883)), new Cesium.Cartesian3(0.0, 0.0, 1000000.0), new Cesium.Matrix4()),
  4930. * id : 'box',
  4931. * attributes : {
  4932. * distanceDisplayCondition : new Cesium.DistanceDisplayConditionGeometryInstanceAttribute(100.0, 10000.0)
  4933. * }
  4934. * });
  4935. * @param [near = 0.0] - The near distance.
  4936. * @param [far = Number.MAX_VALUE] - The far distance.
  4937. */
  4938. export class DistanceDisplayConditionGeometryInstanceAttribute {
  4939. constructor(near?: number, far?: number);
  4940. /**
  4941. * The values for the attributes stored in a typed array.
  4942. */
  4943. value: Float32Array;
  4944. /**
  4945. * The datatype of each component in the attribute, e.g., individual elements in
  4946. * {@link DistanceDisplayConditionGeometryInstanceAttribute#value}.
  4947. */
  4948. readonly componentDatatype: ComponentDatatype;
  4949. /**
  4950. * The number of components in the attributes, i.e., {@link DistanceDisplayConditionGeometryInstanceAttribute#value}.
  4951. */
  4952. readonly componentsPerAttribute: number;
  4953. /**
  4954. * When <code>true</code> and <code>componentDatatype</code> is an integer format,
  4955. * indicate that the components should be mapped to the range [0, 1] (unsigned)
  4956. * or [-1, 1] (signed) when they are accessed as floating-point for rendering.
  4957. */
  4958. readonly normalize: boolean;
  4959. /**
  4960. * Creates a new {@link DistanceDisplayConditionGeometryInstanceAttribute} instance given the provided an enabled flag and {@link DistanceDisplayCondition}.
  4961. * @example
  4962. * var distanceDisplayCondition = new Cesium.DistanceDisplayCondition(100.0, 10000.0);
  4963. * var instance = new Cesium.GeometryInstance({
  4964. * geometry : geometry,
  4965. * attributes : {
  4966. * distanceDisplayCondition : Cesium.DistanceDisplayConditionGeometryInstanceAttribute.fromDistanceDisplayCondition(distanceDisplayCondition)
  4967. * }
  4968. * });
  4969. * @param distanceDisplayCondition - The distance display condition.
  4970. * @returns The new {@link DistanceDisplayConditionGeometryInstanceAttribute} instance.
  4971. */
  4972. static fromDistanceDisplayCondition(distanceDisplayCondition: DistanceDisplayCondition): DistanceDisplayConditionGeometryInstanceAttribute;
  4973. /**
  4974. * Converts a distance display condition to a typed array that can be used to assign a distance display condition attribute.
  4975. * @example
  4976. * var attributes = primitive.getGeometryInstanceAttributes('an id');
  4977. * attributes.distanceDisplayCondition = Cesium.DistanceDisplayConditionGeometryInstanceAttribute.toValue(distanceDisplayCondition, attributes.distanceDisplayCondition);
  4978. * @param distanceDisplayCondition - The distance display condition value.
  4979. * @param [result] - The array to store the result in, if undefined a new instance will be created.
  4980. * @returns The modified result parameter or a new instance if result was undefined.
  4981. */
  4982. static toValue(distanceDisplayCondition: DistanceDisplayCondition, result?: Float32Array): Float32Array;
  4983. }
  4984. /**
  4985. * Easing functions for use with TweenCollection. These function are from
  4986. * {@link https://github.com/sole/tween.js/|Tween.js} and Robert Penner. See the
  4987. * {@link http://sole.github.io/tween.js/examples/03_graphs.html|Tween.js graphs for each function}.
  4988. */
  4989. export namespace EasingFunction {
  4990. /**
  4991. * Linear easing.
  4992. */
  4993. const LINEAR_NONE: EasingFunction.Callback;
  4994. /**
  4995. * Quadratic in.
  4996. */
  4997. const QUADRACTIC_IN: EasingFunction.Callback;
  4998. /**
  4999. * Quadratic out.
  5000. */
  5001. const QUADRACTIC_OUT: EasingFunction.Callback;
  5002. /**
  5003. * Quadratic in then out.
  5004. */
  5005. const QUADRACTIC_IN_OUT: EasingFunction.Callback;
  5006. /**
  5007. * Cubic in.
  5008. */
  5009. const CUBIC_IN: EasingFunction.Callback;
  5010. /**
  5011. * Cubic out.
  5012. */
  5013. const CUBIC_OUT: EasingFunction.Callback;
  5014. /**
  5015. * Cubic in then out.
  5016. */
  5017. const CUBIC_IN_OUT: EasingFunction.Callback;
  5018. /**
  5019. * Quartic in.
  5020. */
  5021. const QUARTIC_IN: EasingFunction.Callback;
  5022. /**
  5023. * Quartic out.
  5024. */
  5025. const QUARTIC_OUT: EasingFunction.Callback;
  5026. /**
  5027. * Quartic in then out.
  5028. */
  5029. const QUARTIC_IN_OUT: EasingFunction.Callback;
  5030. /**
  5031. * Quintic in.
  5032. */
  5033. const QUINTIC_IN: EasingFunction.Callback;
  5034. /**
  5035. * Quintic out.
  5036. */
  5037. const QUINTIC_OUT: EasingFunction.Callback;
  5038. /**
  5039. * Quintic in then out.
  5040. */
  5041. const QUINTIC_IN_OUT: EasingFunction.Callback;
  5042. /**
  5043. * Sinusoidal in.
  5044. */
  5045. const SINUSOIDAL_IN: EasingFunction.Callback;
  5046. /**
  5047. * Sinusoidal out.
  5048. */
  5049. const SINUSOIDAL_OUT: EasingFunction.Callback;
  5050. /**
  5051. * Sinusoidal in then out.
  5052. */
  5053. const SINUSOIDAL_IN_OUT: EasingFunction.Callback;
  5054. /**
  5055. * Exponential in.
  5056. */
  5057. const EXPONENTIAL_IN: EasingFunction.Callback;
  5058. /**
  5059. * Exponential out.
  5060. */
  5061. const EXPONENTIAL_OUT: EasingFunction.Callback;
  5062. /**
  5063. * Exponential in then out.
  5064. */
  5065. const EXPONENTIAL_IN_OUT: EasingFunction.Callback;
  5066. /**
  5067. * Circular in.
  5068. */
  5069. const CIRCULAR_IN: EasingFunction.Callback;
  5070. /**
  5071. * Circular out.
  5072. */
  5073. const CIRCULAR_OUT: EasingFunction.Callback;
  5074. /**
  5075. * Circular in then out.
  5076. */
  5077. const CIRCULAR_IN_OUT: EasingFunction.Callback;
  5078. /**
  5079. * Elastic in.
  5080. */
  5081. const ELASTIC_IN: EasingFunction.Callback;
  5082. /**
  5083. * Elastic out.
  5084. */
  5085. const ELASTIC_OUT: EasingFunction.Callback;
  5086. /**
  5087. * Elastic in then out.
  5088. */
  5089. const ELASTIC_IN_OUT: EasingFunction.Callback;
  5090. /**
  5091. * Back in.
  5092. */
  5093. const BACK_IN: EasingFunction.Callback;
  5094. /**
  5095. * Back out.
  5096. */
  5097. const BACK_OUT: EasingFunction.Callback;
  5098. /**
  5099. * Back in then out.
  5100. */
  5101. const BACK_IN_OUT: EasingFunction.Callback;
  5102. /**
  5103. * Bounce in.
  5104. */
  5105. const BOUNCE_IN: EasingFunction.Callback;
  5106. /**
  5107. * Bounce out.
  5108. */
  5109. const BOUNCE_OUT: EasingFunction.Callback;
  5110. /**
  5111. * Bounce in then out.
  5112. */
  5113. const BOUNCE_IN_OUT: EasingFunction.Callback;
  5114. /**
  5115. * Function interface for implementing a custom easing function.
  5116. * @example
  5117. * function quadraticIn(time) {
  5118. * return time * time;
  5119. * }
  5120. * @example
  5121. * function quadraticOut(time) {
  5122. * return time * (2.0 - time);
  5123. * }
  5124. * @param time - The time in the range <code>[0, 1]</code>.
  5125. */
  5126. type Callback = (time: number) => number;
  5127. }
  5128. /**
  5129. * A description of an ellipse on an ellipsoid. Ellipse geometry can be rendered with both {@link Primitive} and {@link GroundPrimitive}.
  5130. * @example
  5131. * // Create an ellipse.
  5132. * var ellipse = new Cesium.EllipseGeometry({
  5133. * center : Cesium.Cartesian3.fromDegrees(-75.59777, 40.03883),
  5134. * semiMajorAxis : 500000.0,
  5135. * semiMinorAxis : 300000.0,
  5136. * rotation : Cesium.Math.toRadians(60.0)
  5137. * });
  5138. * var geometry = Cesium.EllipseGeometry.createGeometry(ellipse);
  5139. * @param options - Object with the following properties:
  5140. * @param options.center - The ellipse's center point in the fixed frame.
  5141. * @param options.semiMajorAxis - The length of the ellipse's semi-major axis in meters.
  5142. * @param options.semiMinorAxis - The length of the ellipse's semi-minor axis in meters.
  5143. * @param [options.ellipsoid = Ellipsoid.WGS84] - The ellipsoid the ellipse will be on.
  5144. * @param [options.height = 0.0] - The distance in meters between the ellipse and the ellipsoid surface.
  5145. * @param [options.extrudedHeight] - The distance in meters between the ellipse's extruded face and the ellipsoid surface.
  5146. * @param [options.rotation = 0.0] - The angle of rotation counter-clockwise from north.
  5147. * @param [options.stRotation = 0.0] - The rotation of the texture coordinates counter-clockwise from north.
  5148. * @param [options.granularity = Math.RADIANS_PER_DEGREE] - The angular distance between points on the ellipse in radians.
  5149. * @param [options.vertexFormat = VertexFormat.DEFAULT] - The vertex attributes to be computed.
  5150. */
  5151. export class EllipseGeometry {
  5152. constructor(options: {
  5153. center: Cartesian3;
  5154. semiMajorAxis: number;
  5155. semiMinorAxis: number;
  5156. ellipsoid?: Ellipsoid;
  5157. height?: number;
  5158. extrudedHeight?: number;
  5159. rotation?: number;
  5160. stRotation?: number;
  5161. granularity?: number;
  5162. vertexFormat?: VertexFormat;
  5163. });
  5164. /**
  5165. * The number of elements used to pack the object into an array.
  5166. */
  5167. static packedLength: number;
  5168. /**
  5169. * Stores the provided instance into the provided array.
  5170. * @param value - The value to pack.
  5171. * @param array - The array to pack into.
  5172. * @param [startingIndex = 0] - The index into the array at which to start packing the elements.
  5173. * @returns The array that was packed into
  5174. */
  5175. static pack(value: EllipseGeometry, array: number[], startingIndex?: number): number[];
  5176. /**
  5177. * Retrieves an instance from a packed array.
  5178. * @param array - The packed array.
  5179. * @param [startingIndex = 0] - The starting index of the element to be unpacked.
  5180. * @param [result] - The object into which to store the result.
  5181. * @returns The modified result parameter or a new EllipseGeometry instance if one was not provided.
  5182. */
  5183. static unpack(array: number[], startingIndex?: number, result?: EllipseGeometry): EllipseGeometry;
  5184. /**
  5185. * Computes the bounding rectangle based on the provided options
  5186. * @param options - Object with the following properties:
  5187. * @param options.center - The ellipse's center point in the fixed frame.
  5188. * @param options.semiMajorAxis - The length of the ellipse's semi-major axis in meters.
  5189. * @param options.semiMinorAxis - The length of the ellipse's semi-minor axis in meters.
  5190. * @param [options.ellipsoid = Ellipsoid.WGS84] - The ellipsoid the ellipse will be on.
  5191. * @param [options.rotation = 0.0] - The angle of rotation counter-clockwise from north.
  5192. * @param [options.granularity = Math.RADIANS_PER_DEGREE] - The angular distance between points on the ellipse in radians.
  5193. * @param [result] - An object in which to store the result
  5194. * @returns The result rectangle
  5195. */
  5196. static computeRectangle(options: {
  5197. center: Cartesian3;
  5198. semiMajorAxis: number;
  5199. semiMinorAxis: number;
  5200. ellipsoid?: Ellipsoid;
  5201. rotation?: number;
  5202. granularity?: number;
  5203. }, result?: Rectangle): Rectangle;
  5204. /**
  5205. * Computes the geometric representation of a ellipse on an ellipsoid, including its vertices, indices, and a bounding sphere.
  5206. * @param ellipseGeometry - A description of the ellipse.
  5207. * @returns The computed vertices and indices.
  5208. */
  5209. static createGeometry(ellipseGeometry: EllipseGeometry): Geometry | undefined;
  5210. }
  5211. /**
  5212. * A description of the outline of an ellipse on an ellipsoid.
  5213. * @example
  5214. * var ellipse = new Cesium.EllipseOutlineGeometry({
  5215. * center : Cesium.Cartesian3.fromDegrees(-75.59777, 40.03883),
  5216. * semiMajorAxis : 500000.0,
  5217. * semiMinorAxis : 300000.0,
  5218. * rotation : Cesium.Math.toRadians(60.0)
  5219. * });
  5220. * var geometry = Cesium.EllipseOutlineGeometry.createGeometry(ellipse);
  5221. * @param options - Object with the following properties:
  5222. * @param options.center - The ellipse's center point in the fixed frame.
  5223. * @param options.semiMajorAxis - The length of the ellipse's semi-major axis in meters.
  5224. * @param options.semiMinorAxis - The length of the ellipse's semi-minor axis in meters.
  5225. * @param [options.ellipsoid = Ellipsoid.WGS84] - The ellipsoid the ellipse will be on.
  5226. * @param [options.height = 0.0] - The distance in meters between the ellipse and the ellipsoid surface.
  5227. * @param [options.extrudedHeight] - The distance in meters between the ellipse's extruded face and the ellipsoid surface.
  5228. * @param [options.rotation = 0.0] - The angle from north (counter-clockwise) in radians.
  5229. * @param [options.granularity = 0.02] - The angular distance between points on the ellipse in radians.
  5230. * @param [options.numberOfVerticalLines = 16] - Number of lines to draw between the top and bottom surface of an extruded ellipse.
  5231. */
  5232. export class EllipseOutlineGeometry {
  5233. constructor(options: {
  5234. center: Cartesian3;
  5235. semiMajorAxis: number;
  5236. semiMinorAxis: number;
  5237. ellipsoid?: Ellipsoid;
  5238. height?: number;
  5239. extrudedHeight?: number;
  5240. rotation?: number;
  5241. granularity?: number;
  5242. numberOfVerticalLines?: number;
  5243. });
  5244. /**
  5245. * The number of elements used to pack the object into an array.
  5246. */
  5247. static packedLength: number;
  5248. /**
  5249. * Stores the provided instance into the provided array.
  5250. * @param value - The value to pack.
  5251. * @param array - The array to pack into.
  5252. * @param [startingIndex = 0] - The index into the array at which to start packing the elements.
  5253. * @returns The array that was packed into
  5254. */
  5255. static pack(value: EllipseOutlineGeometry, array: number[], startingIndex?: number): number[];
  5256. /**
  5257. * Retrieves an instance from a packed array.
  5258. * @param array - The packed array.
  5259. * @param [startingIndex = 0] - The starting index of the element to be unpacked.
  5260. * @param [result] - The object into which to store the result.
  5261. * @returns The modified result parameter or a new EllipseOutlineGeometry instance if one was not provided.
  5262. */
  5263. static unpack(array: number[], startingIndex?: number, result?: EllipseOutlineGeometry): EllipseOutlineGeometry;
  5264. /**
  5265. * Computes the geometric representation of an outline of an ellipse on an ellipsoid, including its vertices, indices, and a bounding sphere.
  5266. * @param ellipseGeometry - A description of the ellipse.
  5267. * @returns The computed vertices and indices.
  5268. */
  5269. static createGeometry(ellipseGeometry: EllipseOutlineGeometry): Geometry | undefined;
  5270. }
  5271. /**
  5272. * A quadratic surface defined in Cartesian coordinates by the equation
  5273. * <code>(x / a)^2 + (y / b)^2 + (z / c)^2 = 1</code>. Primarily used
  5274. * by Cesium to represent the shape of planetary bodies.
  5275. *
  5276. * Rather than constructing this object directly, one of the provided
  5277. * constants is normally used.
  5278. * @param [x = 0] - The radius in the x direction.
  5279. * @param [y = 0] - The radius in the y direction.
  5280. * @param [z = 0] - The radius in the z direction.
  5281. */
  5282. export class Ellipsoid {
  5283. constructor(x?: number, y?: number, z?: number);
  5284. /**
  5285. * Gets the radii of the ellipsoid.
  5286. */
  5287. readonly radii: Cartesian3;
  5288. /**
  5289. * Gets the squared radii of the ellipsoid.
  5290. */
  5291. readonly radiiSquared: Cartesian3;
  5292. /**
  5293. * Gets the radii of the ellipsoid raise to the fourth power.
  5294. */
  5295. readonly radiiToTheFourth: Cartesian3;
  5296. /**
  5297. * Gets one over the radii of the ellipsoid.
  5298. */
  5299. readonly oneOverRadii: Cartesian3;
  5300. /**
  5301. * Gets one over the squared radii of the ellipsoid.
  5302. */
  5303. readonly oneOverRadiiSquared: Cartesian3;
  5304. /**
  5305. * Gets the minimum radius of the ellipsoid.
  5306. */
  5307. readonly minimumRadius: number;
  5308. /**
  5309. * Gets the maximum radius of the ellipsoid.
  5310. */
  5311. readonly maximumRadius: number;
  5312. /**
  5313. * Duplicates an Ellipsoid instance.
  5314. * @param ellipsoid - The ellipsoid to duplicate.
  5315. * @param [result] - The object onto which to store the result, or undefined if a new
  5316. * instance should be created.
  5317. * @returns The cloned Ellipsoid. (Returns undefined if ellipsoid is undefined)
  5318. */
  5319. static clone(ellipsoid: Ellipsoid, result?: Ellipsoid): Ellipsoid;
  5320. /**
  5321. * Computes an Ellipsoid from a Cartesian specifying the radii in x, y, and z directions.
  5322. * @param [cartesian = Cartesian3.ZERO] - The ellipsoid's radius in the x, y, and z directions.
  5323. * @param [result] - The object onto which to store the result, or undefined if a new
  5324. * instance should be created.
  5325. * @returns A new Ellipsoid instance.
  5326. */
  5327. static fromCartesian3(cartesian?: Cartesian3, result?: Ellipsoid): Ellipsoid;
  5328. /**
  5329. * An Ellipsoid instance initialized to the WGS84 standard.
  5330. */
  5331. static readonly WGS84: Ellipsoid;
  5332. /**
  5333. * An Ellipsoid instance initialized to radii of (1.0, 1.0, 1.0).
  5334. */
  5335. static readonly UNIT_SPHERE: Ellipsoid;
  5336. /**
  5337. * An Ellipsoid instance initialized to a sphere with the lunar radius.
  5338. */
  5339. static readonly MOON: Ellipsoid;
  5340. /**
  5341. * Duplicates an Ellipsoid instance.
  5342. * @param [result] - The object onto which to store the result, or undefined if a new
  5343. * instance should be created.
  5344. * @returns The cloned Ellipsoid.
  5345. */
  5346. clone(result?: Ellipsoid): Ellipsoid;
  5347. /**
  5348. * The number of elements used to pack the object into an array.
  5349. */
  5350. static packedLength: number;
  5351. /**
  5352. * Stores the provided instance into the provided array.
  5353. * @param value - The value to pack.
  5354. * @param array - The array to pack into.
  5355. * @param [startingIndex = 0] - The index into the array at which to start packing the elements.
  5356. * @returns The array that was packed into
  5357. */
  5358. static pack(value: Ellipsoid, array: number[], startingIndex?: number): number[];
  5359. /**
  5360. * Retrieves an instance from a packed array.
  5361. * @param array - The packed array.
  5362. * @param [startingIndex = 0] - The starting index of the element to be unpacked.
  5363. * @param [result] - The object into which to store the result.
  5364. * @returns The modified result parameter or a new Ellipsoid instance if one was not provided.
  5365. */
  5366. static unpack(array: number[], startingIndex?: number, result?: Ellipsoid): Ellipsoid;
  5367. /**
  5368. * Computes the unit vector directed from the center of this ellipsoid toward the provided Cartesian position.
  5369. * @param cartesian - The Cartesian for which to to determine the geocentric normal.
  5370. * @param [result] - The object onto which to store the result.
  5371. * @returns The modified result parameter or a new Cartesian3 instance if none was provided.
  5372. */
  5373. geocentricSurfaceNormal(cartesian: Cartesian3, result?: Cartesian3): Cartesian3;
  5374. /**
  5375. * Computes the normal of the plane tangent to the surface of the ellipsoid at the provided position.
  5376. * @param cartographic - The cartographic position for which to to determine the geodetic normal.
  5377. * @param [result] - The object onto which to store the result.
  5378. * @returns The modified result parameter or a new Cartesian3 instance if none was provided.
  5379. */
  5380. geodeticSurfaceNormalCartographic(cartographic: Cartographic, result?: Cartesian3): Cartesian3;
  5381. /**
  5382. * Computes the normal of the plane tangent to the surface of the ellipsoid at the provided position.
  5383. * @param cartesian - The Cartesian position for which to to determine the surface normal.
  5384. * @param [result] - The object onto which to store the result.
  5385. * @returns The modified result parameter or a new Cartesian3 instance if none was provided.
  5386. */
  5387. geodeticSurfaceNormal(cartesian: Cartesian3, result?: Cartesian3): Cartesian3;
  5388. /**
  5389. * Converts the provided cartographic to Cartesian representation.
  5390. * @example
  5391. * //Create a Cartographic and determine it's Cartesian representation on a WGS84 ellipsoid.
  5392. * var position = new Cesium.Cartographic(Cesium.Math.toRadians(21), Cesium.Math.toRadians(78), 5000);
  5393. * var cartesianPosition = Cesium.Ellipsoid.WGS84.cartographicToCartesian(position);
  5394. * @param cartographic - The cartographic position.
  5395. * @param [result] - The object onto which to store the result.
  5396. * @returns The modified result parameter or a new Cartesian3 instance if none was provided.
  5397. */
  5398. cartographicToCartesian(cartographic: Cartographic, result?: Cartesian3): Cartesian3;
  5399. /**
  5400. * Converts the provided array of cartographics to an array of Cartesians.
  5401. * @example
  5402. * //Convert an array of Cartographics and determine their Cartesian representation on a WGS84 ellipsoid.
  5403. * var positions = [new Cesium.Cartographic(Cesium.Math.toRadians(21), Cesium.Math.toRadians(78), 0),
  5404. * new Cesium.Cartographic(Cesium.Math.toRadians(21.321), Cesium.Math.toRadians(78.123), 100),
  5405. * new Cesium.Cartographic(Cesium.Math.toRadians(21.645), Cesium.Math.toRadians(78.456), 250)];
  5406. * var cartesianPositions = Cesium.Ellipsoid.WGS84.cartographicArrayToCartesianArray(positions);
  5407. * @param cartographics - An array of cartographic positions.
  5408. * @param [result] - The object onto which to store the result.
  5409. * @returns The modified result parameter or a new Array instance if none was provided.
  5410. */
  5411. cartographicArrayToCartesianArray(cartographics: Cartographic[], result?: Cartesian3[]): Cartesian3[];
  5412. /**
  5413. * Converts the provided cartesian to cartographic representation.
  5414. * The cartesian is undefined at the center of the ellipsoid.
  5415. * @example
  5416. * //Create a Cartesian and determine it's Cartographic representation on a WGS84 ellipsoid.
  5417. * var position = new Cesium.Cartesian3(17832.12, 83234.52, 952313.73);
  5418. * var cartographicPosition = Cesium.Ellipsoid.WGS84.cartesianToCartographic(position);
  5419. * @param cartesian - The Cartesian position to convert to cartographic representation.
  5420. * @param [result] - The object onto which to store the result.
  5421. * @returns The modified result parameter, new Cartographic instance if none was provided, or undefined if the cartesian is at the center of the ellipsoid.
  5422. */
  5423. cartesianToCartographic(cartesian: Cartesian3, result?: Cartographic): Cartographic;
  5424. /**
  5425. * Converts the provided array of cartesians to an array of cartographics.
  5426. * @example
  5427. * //Create an array of Cartesians and determine their Cartographic representation on a WGS84 ellipsoid.
  5428. * var positions = [new Cesium.Cartesian3(17832.12, 83234.52, 952313.73),
  5429. * new Cesium.Cartesian3(17832.13, 83234.53, 952313.73),
  5430. * new Cesium.Cartesian3(17832.14, 83234.54, 952313.73)]
  5431. * var cartographicPositions = Cesium.Ellipsoid.WGS84.cartesianArrayToCartographicArray(positions);
  5432. * @param cartesians - An array of Cartesian positions.
  5433. * @param [result] - The object onto which to store the result.
  5434. * @returns The modified result parameter or a new Array instance if none was provided.
  5435. */
  5436. cartesianArrayToCartographicArray(cartesians: Cartesian3[], result?: Cartographic[]): Cartographic[];
  5437. /**
  5438. * Scales the provided Cartesian position along the geodetic surface normal
  5439. * so that it is on the surface of this ellipsoid. If the position is
  5440. * at the center of the ellipsoid, this function returns undefined.
  5441. * @param cartesian - The Cartesian position to scale.
  5442. * @param [result] - The object onto which to store the result.
  5443. * @returns The modified result parameter, a new Cartesian3 instance if none was provided, or undefined if the position is at the center.
  5444. */
  5445. scaleToGeodeticSurface(cartesian: Cartesian3, result?: Cartesian3): Cartesian3;
  5446. /**
  5447. * Scales the provided Cartesian position along the geocentric surface normal
  5448. * so that it is on the surface of this ellipsoid.
  5449. * @param cartesian - The Cartesian position to scale.
  5450. * @param [result] - The object onto which to store the result.
  5451. * @returns The modified result parameter or a new Cartesian3 instance if none was provided.
  5452. */
  5453. scaleToGeocentricSurface(cartesian: Cartesian3, result?: Cartesian3): Cartesian3;
  5454. /**
  5455. * Transforms a Cartesian X, Y, Z position to the ellipsoid-scaled space by multiplying
  5456. * its components by the result of {@link Ellipsoid#oneOverRadii}.
  5457. * @param position - The position to transform.
  5458. * @param [result] - The position to which to copy the result, or undefined to create and
  5459. * return a new instance.
  5460. * @returns The position expressed in the scaled space. The returned instance is the
  5461. * one passed as the result parameter if it is not undefined, or a new instance of it is.
  5462. */
  5463. transformPositionToScaledSpace(position: Cartesian3, result?: Cartesian3): Cartesian3;
  5464. /**
  5465. * Transforms a Cartesian X, Y, Z position from the ellipsoid-scaled space by multiplying
  5466. * its components by the result of {@link Ellipsoid#radii}.
  5467. * @param position - The position to transform.
  5468. * @param [result] - The position to which to copy the result, or undefined to create and
  5469. * return a new instance.
  5470. * @returns The position expressed in the unscaled space. The returned instance is the
  5471. * one passed as the result parameter if it is not undefined, or a new instance of it is.
  5472. */
  5473. transformPositionFromScaledSpace(position: Cartesian3, result?: Cartesian3): Cartesian3;
  5474. /**
  5475. * Compares this Ellipsoid against the provided Ellipsoid componentwise and returns
  5476. * <code>true</code> if they are equal, <code>false</code> otherwise.
  5477. * @param [right] - The other Ellipsoid.
  5478. * @returns <code>true</code> if they are equal, <code>false</code> otherwise.
  5479. */
  5480. equals(right?: Ellipsoid): boolean;
  5481. /**
  5482. * Creates a string representing this Ellipsoid in the format '(radii.x, radii.y, radii.z)'.
  5483. * @returns A string representing this ellipsoid in the format '(radii.x, radii.y, radii.z)'.
  5484. */
  5485. toString(): string;
  5486. /**
  5487. * Computes a point which is the intersection of the surface normal with the z-axis.
  5488. * @param position - the position. must be on the surface of the ellipsoid.
  5489. * @param [buffer = 0.0] - A buffer to subtract from the ellipsoid size when checking if the point is inside the ellipsoid.
  5490. * 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.
  5491. * In WGS84 datum, intersection point is at max z = +-42841.31151331382 (0.673% of z-axis).
  5492. * Intersection point could be outside the ellipsoid if the ratio of MajorAxis / AxisOfRotation is bigger than the square root of 2
  5493. * @param [result] - The cartesian to which to copy the result, or undefined to create and
  5494. * return a new instance.
  5495. * @returns the intersection point if it's inside the ellipsoid, undefined otherwise
  5496. */
  5497. getSurfaceNormalIntersectionWithZAxis(position: Cartesian3, buffer?: number, result?: Cartesian3): Cartesian3 | undefined;
  5498. /**
  5499. * Computes an approximation of the surface area of a rectangle on the surface of an ellipsoid using
  5500. * Gauss-Legendre 10th order quadrature.
  5501. * @param rectangle - The rectangle used for computing the surface area.
  5502. * @returns The approximate area of the rectangle on the surface of this ellipsoid.
  5503. */
  5504. surfaceArea(rectangle: Rectangle): number;
  5505. }
  5506. /**
  5507. * Initializes a geodesic on the ellipsoid connecting the two provided planetodetic points.
  5508. * @param [start] - The initial planetodetic point on the path.
  5509. * @param [end] - The final planetodetic point on the path.
  5510. * @param [ellipsoid = Ellipsoid.WGS84] - The ellipsoid on which the geodesic lies.
  5511. */
  5512. export class EllipsoidGeodesic {
  5513. constructor(start?: Cartographic, end?: Cartographic, ellipsoid?: Ellipsoid);
  5514. /**
  5515. * Gets the ellipsoid.
  5516. */
  5517. readonly ellipsoid: Ellipsoid;
  5518. /**
  5519. * Gets the surface distance between the start and end point
  5520. */
  5521. readonly surfaceDistance: number;
  5522. /**
  5523. * Gets the initial planetodetic point on the path.
  5524. */
  5525. readonly start: Cartographic;
  5526. /**
  5527. * Gets the final planetodetic point on the path.
  5528. */
  5529. readonly end: Cartographic;
  5530. /**
  5531. * Gets the heading at the initial point.
  5532. */
  5533. readonly startHeading: number;
  5534. /**
  5535. * Gets the heading at the final point.
  5536. */
  5537. readonly endHeading: number;
  5538. /**
  5539. * Sets the start and end points of the geodesic
  5540. * @param start - The initial planetodetic point on the path.
  5541. * @param end - The final planetodetic point on the path.
  5542. */
  5543. setEndPoints(start: Cartographic, end: Cartographic): void;
  5544. /**
  5545. * Provides the location of a point at the indicated portion along the geodesic.
  5546. * @param fraction - The portion of the distance between the initial and final points.
  5547. * @param [result] - The object in which to store the result.
  5548. * @returns The location of the point along the geodesic.
  5549. */
  5550. interpolateUsingFraction(fraction: number, result?: Cartographic): Cartographic;
  5551. /**
  5552. * Provides the location of a point at the indicated distance along the geodesic.
  5553. * @param distance - The distance from the inital point to the point of interest along the geodesic
  5554. * @param [result] - The object in which to store the result.
  5555. * @returns The location of the point along the geodesic.
  5556. */
  5557. interpolateUsingSurfaceDistance(distance: number, result?: Cartographic): Cartographic;
  5558. }
  5559. /**
  5560. * A description of an ellipsoid centered at the origin.
  5561. * @example
  5562. * var ellipsoid = new Cesium.EllipsoidGeometry({
  5563. * vertexFormat : Cesium.VertexFormat.POSITION_ONLY,
  5564. * radii : new Cesium.Cartesian3(1000000.0, 500000.0, 500000.0)
  5565. * });
  5566. * var geometry = Cesium.EllipsoidGeometry.createGeometry(ellipsoid);
  5567. * @param [options] - Object with the following properties:
  5568. * @param [options.radii = Cartesian3(1.0, 1.0, 1.0)] - The radii of the ellipsoid in the x, y, and z directions.
  5569. * @param [options.innerRadii = options.radii] - The inner radii of the ellipsoid in the x, y, and z directions.
  5570. * @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.
  5571. * @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.
  5572. * @param [options.minimumCone = 0.0] - The minimum angle measured from the positive z-axis and toward the negative z-axis.
  5573. * @param [options.maximumCone = PI] - The maximum angle measured from the positive z-axis and toward the negative z-axis.
  5574. * @param [options.stackPartitions = 64] - The number of times to partition the ellipsoid into stacks.
  5575. * @param [options.slicePartitions = 64] - The number of times to partition the ellipsoid into radial slices.
  5576. * @param [options.vertexFormat = VertexFormat.DEFAULT] - The vertex attributes to be computed.
  5577. */
  5578. export class EllipsoidGeometry {
  5579. constructor(options?: {
  5580. radii?: Cartesian3;
  5581. innerRadii?: Cartesian3;
  5582. minimumClock?: number;
  5583. maximumClock?: number;
  5584. minimumCone?: number;
  5585. maximumCone?: number;
  5586. stackPartitions?: number;
  5587. slicePartitions?: number;
  5588. vertexFormat?: VertexFormat;
  5589. });
  5590. /**
  5591. * The number of elements used to pack the object into an array.
  5592. */
  5593. static packedLength: number;
  5594. /**
  5595. * Stores the provided instance into the provided array.
  5596. * @param value - The value to pack.
  5597. * @param array - The array to pack into.
  5598. * @param [startingIndex = 0] - The index into the array at which to start packing the elements.
  5599. * @returns The array that was packed into
  5600. */
  5601. static pack(value: EllipsoidGeometry, array: number[], startingIndex?: number): number[];
  5602. /**
  5603. * Retrieves an instance from a packed array.
  5604. * @param array - The packed array.
  5605. * @param [startingIndex = 0] - The starting index of the element to be unpacked.
  5606. * @param [result] - The object into which to store the result.
  5607. * @returns The modified result parameter or a new EllipsoidGeometry instance if one was not provided.
  5608. */
  5609. static unpack(array: number[], startingIndex?: number, result?: EllipsoidGeometry): EllipsoidGeometry;
  5610. /**
  5611. * Computes the geometric representation of an ellipsoid, including its vertices, indices, and a bounding sphere.
  5612. * @param ellipsoidGeometry - A description of the ellipsoid.
  5613. * @returns The computed vertices and indices.
  5614. */
  5615. static createGeometry(ellipsoidGeometry: EllipsoidGeometry): Geometry | undefined;
  5616. }
  5617. /**
  5618. * A description of the outline of an ellipsoid centered at the origin.
  5619. * @example
  5620. * var ellipsoid = new Cesium.EllipsoidOutlineGeometry({
  5621. * radii : new Cesium.Cartesian3(1000000.0, 500000.0, 500000.0),
  5622. * stackPartitions: 6,
  5623. * slicePartitions: 5
  5624. * });
  5625. * var geometry = Cesium.EllipsoidOutlineGeometry.createGeometry(ellipsoid);
  5626. * @param [options] - Object with the following properties:
  5627. * @param [options.radii = Cartesian3(1.0, 1.0, 1.0)] - The radii of the ellipsoid in the x, y, and z directions.
  5628. * @param [options.innerRadii = options.radii] - The inner radii of the ellipsoid in the x, y, and z directions.
  5629. * @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.
  5630. * @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.
  5631. * @param [options.minimumCone = 0.0] - The minimum angle measured from the positive z-axis and toward the negative z-axis.
  5632. * @param [options.maximumCone = PI] - The maximum angle measured from the positive z-axis and toward the negative z-axis.
  5633. * @param [options.stackPartitions = 10] - The count of stacks for the ellipsoid (1 greater than the number of parallel lines).
  5634. * @param [options.slicePartitions = 8] - The count of slices for the ellipsoid (Equal to the number of radial lines).
  5635. * @param [options.subdivisions = 128] - The number of points per line, determining the granularity of the curvature.
  5636. */
  5637. export class EllipsoidOutlineGeometry {
  5638. constructor(options?: {
  5639. radii?: Cartesian3;
  5640. innerRadii?: Cartesian3;
  5641. minimumClock?: number;
  5642. maximumClock?: number;
  5643. minimumCone?: number;
  5644. maximumCone?: number;
  5645. stackPartitions?: number;
  5646. slicePartitions?: number;
  5647. subdivisions?: number;
  5648. });
  5649. /**
  5650. * The number of elements used to pack the object into an array.
  5651. */
  5652. static packedLength: number;
  5653. /**
  5654. * Stores the provided instance into the provided array.
  5655. * @param value - The value to pack.
  5656. * @param array - The array to pack into.
  5657. * @param [startingIndex = 0] - The index into the array at which to start packing the elements.
  5658. * @returns The array that was packed into
  5659. */
  5660. static pack(value: EllipsoidOutlineGeometry, array: number[], startingIndex?: number): number[];
  5661. /**
  5662. * Retrieves an instance from a packed array.
  5663. * @param array - The packed array.
  5664. * @param [startingIndex = 0] - The starting index of the element to be unpacked.
  5665. * @param [result] - The object into which to store the result.
  5666. * @returns The modified result parameter or a new EllipsoidOutlineGeometry instance if one was not provided.
  5667. */
  5668. static unpack(array: number[], startingIndex?: number, result?: EllipsoidOutlineGeometry): EllipsoidOutlineGeometry;
  5669. /**
  5670. * Computes the geometric representation of an outline of an ellipsoid, including its vertices, indices, and a bounding sphere.
  5671. * @param ellipsoidGeometry - A description of the ellipsoid outline.
  5672. * @returns The computed vertices and indices.
  5673. */
  5674. static createGeometry(ellipsoidGeometry: EllipsoidOutlineGeometry): Geometry | undefined;
  5675. }
  5676. /**
  5677. * Initializes a rhumb line on the ellipsoid connecting the two provided planetodetic points.
  5678. * @param [start] - The initial planetodetic point on the path.
  5679. * @param [end] - The final planetodetic point on the path.
  5680. * @param [ellipsoid = Ellipsoid.WGS84] - The ellipsoid on which the rhumb line lies.
  5681. */
  5682. export class EllipsoidRhumbLine {
  5683. constructor(start?: Cartographic, end?: Cartographic, ellipsoid?: Ellipsoid);
  5684. /**
  5685. * Gets the ellipsoid.
  5686. */
  5687. readonly ellipsoid: Ellipsoid;
  5688. /**
  5689. * Gets the surface distance between the start and end point
  5690. */
  5691. readonly surfaceDistance: number;
  5692. /**
  5693. * Gets the initial planetodetic point on the path.
  5694. */
  5695. readonly start: Cartographic;
  5696. /**
  5697. * Gets the final planetodetic point on the path.
  5698. */
  5699. readonly end: Cartographic;
  5700. /**
  5701. * Gets the heading from the start point to the end point.
  5702. */
  5703. readonly heading: number;
  5704. /**
  5705. * Create a rhumb line using an initial position with a heading and distance.
  5706. * @param start - The initial planetodetic point on the path.
  5707. * @param heading - The heading in radians.
  5708. * @param distance - The rhumb line distance between the start and end point.
  5709. * @param [ellipsoid = Ellipsoid.WGS84] - The ellipsoid on which the rhumb line lies.
  5710. * @param [result] - The object in which to store the result.
  5711. * @returns The EllipsoidRhumbLine object.
  5712. */
  5713. static fromStartHeadingDistance(start: Cartographic, heading: number, distance: number, ellipsoid?: Ellipsoid, result?: EllipsoidRhumbLine): EllipsoidRhumbLine;
  5714. /**
  5715. * Sets the start and end points of the rhumb line.
  5716. * @param start - The initial planetodetic point on the path.
  5717. * @param end - The final planetodetic point on the path.
  5718. */
  5719. setEndPoints(start: Cartographic, end: Cartographic): void;
  5720. /**
  5721. * Provides the location of a point at the indicated portion along the rhumb line.
  5722. * @param fraction - The portion of the distance between the initial and final points.
  5723. * @param [result] - The object in which to store the result.
  5724. * @returns The location of the point along the rhumb line.
  5725. */
  5726. interpolateUsingFraction(fraction: number, result?: Cartographic): Cartographic;
  5727. /**
  5728. * Provides the location of a point at the indicated distance along the rhumb line.
  5729. * @param distance - The distance from the inital point to the point of interest along the rhumbLine.
  5730. * @param [result] - The object in which to store the result.
  5731. * @returns The location of the point along the rhumb line.
  5732. */
  5733. interpolateUsingSurfaceDistance(distance: number, result?: Cartographic): Cartographic;
  5734. /**
  5735. * Provides the location of a point at the indicated longitude along the rhumb line.
  5736. * 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.
  5737. * @param intersectionLongitude - The longitude, in radians, at which to find the intersection point from the starting point using the heading.
  5738. * @param [result] - The object in which to store the result.
  5739. * @returns The location of the intersection point along the rhumb line, undefined if there is no intersection or infinite intersections.
  5740. */
  5741. findIntersectionWithLongitude(intersectionLongitude: number, result?: Cartographic): Cartographic;
  5742. /**
  5743. * Provides the location of a point at the indicated latitude along the rhumb line.
  5744. * 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.
  5745. * @param intersectionLatitude - The latitude, in radians, at which to find the intersection point from the starting point using the heading.
  5746. * @param [result] - The object in which to store the result.
  5747. * @returns The location of the intersection point along the rhumb line, undefined if there is no intersection or infinite intersections.
  5748. */
  5749. findIntersectionWithLatitude(intersectionLatitude: number, result?: Cartographic): Cartographic;
  5750. }
  5751. /**
  5752. * A plane tangent to the provided ellipsoid at the provided origin.
  5753. * If origin is not on the surface of the ellipsoid, it's surface projection will be used.
  5754. * If origin is at the center of the ellipsoid, an exception will be thrown.
  5755. * @param origin - The point on the surface of the ellipsoid where the tangent plane touches.
  5756. * @param [ellipsoid = Ellipsoid.WGS84] - The ellipsoid to use.
  5757. */
  5758. export class EllipsoidTangentPlane {
  5759. constructor(origin: Cartesian3, ellipsoid?: Ellipsoid);
  5760. /**
  5761. * Gets the ellipsoid.
  5762. */
  5763. ellipsoid: Ellipsoid;
  5764. /**
  5765. * Gets the origin.
  5766. */
  5767. origin: Cartesian3;
  5768. /**
  5769. * Gets the plane which is tangent to the ellipsoid.
  5770. */
  5771. readonly plane: Plane;
  5772. /**
  5773. * Gets the local X-axis (east) of the tangent plane.
  5774. */
  5775. readonly xAxis: Cartesian3;
  5776. /**
  5777. * Gets the local Y-axis (north) of the tangent plane.
  5778. */
  5779. readonly yAxis: Cartesian3;
  5780. /**
  5781. * Gets the local Z-axis (up) of the tangent plane.
  5782. */
  5783. readonly zAxis: Cartesian3;
  5784. /**
  5785. * Creates a new instance from the provided ellipsoid and the center
  5786. * point of the provided Cartesians.
  5787. * @param cartesians - The list of positions surrounding the center point.
  5788. * @param [ellipsoid = Ellipsoid.WGS84] - The ellipsoid to use.
  5789. */
  5790. static fromPoints(cartesians: Cartesian3[], ellipsoid?: Ellipsoid): void;
  5791. /**
  5792. * Computes the projection of the provided 3D position onto the 2D plane, radially outward from the {@link EllipsoidTangentPlane.ellipsoid} coordinate system origin.
  5793. * @param cartesian - The point to project.
  5794. * @param [result] - The object onto which to store the result.
  5795. * @returns The modified result parameter or a new Cartesian2 instance if none was provided. Undefined if there is no intersection point
  5796. */
  5797. projectPointOntoPlane(cartesian: Cartesian3, result?: Cartesian2): Cartesian2;
  5798. /**
  5799. * Computes the projection of the provided 3D positions onto the 2D plane (where possible), radially outward from the global origin.
  5800. * The resulting array may be shorter than the input array - if a single projection is impossible it will not be included.
  5801. * @param cartesians - The array of points to project.
  5802. * @param [result] - The array of Cartesian2 instances onto which to store results.
  5803. * @returns The modified result parameter or a new array of Cartesian2 instances if none was provided.
  5804. */
  5805. projectPointsOntoPlane(cartesians: Cartesian3[], result?: Cartesian2[]): Cartesian2[];
  5806. /**
  5807. * Computes the projection of the provided 3D position onto the 2D plane, along the plane normal.
  5808. * @param cartesian - The point to project.
  5809. * @param [result] - The object onto which to store the result.
  5810. * @returns The modified result parameter or a new Cartesian2 instance if none was provided.
  5811. */
  5812. projectPointToNearestOnPlane(cartesian: Cartesian3, result?: Cartesian2): Cartesian2;
  5813. /**
  5814. * Computes the projection of the provided 3D positions onto the 2D plane, along the plane normal.
  5815. * @param cartesians - The array of points to project.
  5816. * @param [result] - The array of Cartesian2 instances onto which to store results.
  5817. * @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>.
  5818. */
  5819. projectPointsToNearestOnPlane(cartesians: Cartesian3[], result?: Cartesian2[]): Cartesian2[];
  5820. /**
  5821. * Computes the projection of the provided 2D position onto the 3D ellipsoid.
  5822. * @param cartesian - The points to project.
  5823. * @param [result] - The Cartesian3 instance to store result.
  5824. * @returns The modified result parameter or a new Cartesian3 instance if none was provided.
  5825. */
  5826. projectPointOntoEllipsoid(cartesian: Cartesian2, result?: Cartesian3): Cartesian3;
  5827. /**
  5828. * Computes the projection of the provided 2D positions onto the 3D ellipsoid.
  5829. * @param cartesians - The array of points to project.
  5830. * @param [result] - The array of Cartesian3 instances onto which to store results.
  5831. * @returns The modified result parameter or a new array of Cartesian3 instances if none was provided.
  5832. */
  5833. projectPointsOntoEllipsoid(cartesians: Cartesian2[], result?: Cartesian3[]): Cartesian3[];
  5834. }
  5835. /**
  5836. * A very simple {@link TerrainProvider} that produces geometry by tessellating an ellipsoidal
  5837. * surface.
  5838. * @param [options] - Object with the following properties:
  5839. * @param [options.tilingScheme] - The tiling scheme specifying how the ellipsoidal
  5840. * surface is broken into tiles. If this parameter is not provided, a {@link GeographicTilingScheme}
  5841. * is used.
  5842. * @param [options.ellipsoid] - The ellipsoid. If the tilingScheme is specified,
  5843. * this parameter is ignored and the tiling scheme's ellipsoid is used instead. If neither
  5844. * parameter is specified, the WGS84 ellipsoid is used.
  5845. */
  5846. export class EllipsoidTerrainProvider {
  5847. constructor(options?: {
  5848. tilingScheme?: TilingScheme;
  5849. ellipsoid?: Ellipsoid;
  5850. });
  5851. /**
  5852. * Gets an event that is raised when the terrain provider encounters an asynchronous error. By subscribing
  5853. * to the event, you will be notified of the error and can potentially recover from it. Event listeners
  5854. * are passed an instance of {@link TileProviderError}.
  5855. */
  5856. errorEvent: Event;
  5857. /**
  5858. * Gets the credit to display when this terrain provider is active. Typically this is used to credit
  5859. * the source of the terrain. This function should not be called before {@link EllipsoidTerrainProvider#ready} returns true.
  5860. */
  5861. credit: Credit;
  5862. /**
  5863. * Gets the tiling scheme used by this provider. This function should
  5864. * not be called before {@link EllipsoidTerrainProvider#ready} returns true.
  5865. */
  5866. tilingScheme: GeographicTilingScheme;
  5867. /**
  5868. * Gets a value indicating whether or not the provider is ready for use.
  5869. */
  5870. ready: boolean;
  5871. /**
  5872. * Gets a promise that resolves to true when the provider is ready for use.
  5873. */
  5874. readonly readyPromise: Promise<boolean>;
  5875. /**
  5876. * Gets a value indicating whether or not the provider includes a water mask. The water mask
  5877. * indicates which areas of the globe are water rather than land, so they can be rendered
  5878. * as a reflective surface with animated waves. This function should not be
  5879. * called before {@link EllipsoidTerrainProvider#ready} returns true.
  5880. */
  5881. hasWaterMask: boolean;
  5882. /**
  5883. * Gets a value indicating whether or not the requested tiles include vertex normals.
  5884. * This function should not be called before {@link EllipsoidTerrainProvider#ready} returns true.
  5885. */
  5886. hasVertexNormals: boolean;
  5887. /**
  5888. * Gets an object that can be used to determine availability of terrain from this provider, such as
  5889. * at points and in rectangles. This function should not be called before
  5890. * {@link TerrainProvider#ready} returns true. This property may be undefined if availability
  5891. * information is not available.
  5892. */
  5893. availability: TileAvailability;
  5894. /**
  5895. * Requests the geometry for a given tile. This function should not be called before
  5896. * {@link TerrainProvider#ready} returns true. The result includes terrain
  5897. * data and indicates that all child tiles are available.
  5898. * @param x - The X coordinate of the tile for which to request geometry.
  5899. * @param y - The Y coordinate of the tile for which to request geometry.
  5900. * @param level - The level of the tile for which to request geometry.
  5901. * @param [request] - The request object. Intended for internal use only.
  5902. * @returns A promise for the requested geometry. If this method
  5903. * returns undefined instead of a promise, it is an indication that too many requests are already
  5904. * pending and the request will be retried later.
  5905. */
  5906. requestTileGeometry(x: number, y: number, level: number, request?: Request): Promise<TerrainData> | undefined;
  5907. /**
  5908. * Gets the maximum geometric error allowed in a tile at a given level.
  5909. * @param level - The tile level for which to get the maximum geometric error.
  5910. * @returns The maximum geometric error.
  5911. */
  5912. getLevelMaximumGeometricError(level: number): number;
  5913. /**
  5914. * Determines whether data for a tile is available to be loaded.
  5915. * @param x - The X coordinate of the tile for which to request geometry.
  5916. * @param y - The Y coordinate of the tile for which to request geometry.
  5917. * @param level - The level of the tile for which to request geometry.
  5918. * @returns Undefined if not supported, otherwise true or false.
  5919. */
  5920. getTileDataAvailable(x: number, y: number, level: number): boolean;
  5921. /**
  5922. * Makes sure we load availability data for a tile
  5923. * @param x - The X coordinate of the tile for which to request geometry.
  5924. * @param y - The Y coordinate of the tile for which to request geometry.
  5925. * @param level - The level of the tile for which to request geometry.
  5926. * @returns Undefined if nothing need to be loaded or a Promise that resolves when all required tiles are loaded
  5927. */
  5928. loadTileDataAvailability(x: number, y: number, level: number): undefined | Promise<void>;
  5929. }
  5930. /**
  5931. * A generic utility class for managing subscribers for a particular event.
  5932. * This class is usually instantiated inside of a container class and
  5933. * exposed as a property for others to subscribe to.
  5934. * @example
  5935. * MyObject.prototype.myListener = function(arg1, arg2) {
  5936. * this.myArg1Copy = arg1;
  5937. * this.myArg2Copy = arg2;
  5938. * }
  5939. *
  5940. * var myObjectInstance = new MyObject();
  5941. * var evt = new Cesium.Event();
  5942. * evt.addEventListener(MyObject.prototype.myListener, myObjectInstance);
  5943. * evt.raiseEvent('1', '2');
  5944. * evt.removeEventListener(MyObject.prototype.myListener);
  5945. */
  5946. export class Event {
  5947. constructor();
  5948. /**
  5949. * The number of listeners currently subscribed to the event.
  5950. */
  5951. readonly numberOfListeners: number;
  5952. /**
  5953. * Registers a callback function to be executed whenever the event is raised.
  5954. * An optional scope can be provided to serve as the <code>this</code> pointer
  5955. * in which the function will execute.
  5956. * @param listener - The function to be executed when the event is raised.
  5957. * @param [scope] - An optional object scope to serve as the <code>this</code>
  5958. * pointer in which the listener function will execute.
  5959. * @returns A function that will remove this event listener when invoked.
  5960. */
  5961. addEventListener(listener: (...params: any[]) => any, scope?: any): Event.RemoveCallback;
  5962. /**
  5963. * Unregisters a previously registered callback.
  5964. * @param listener - The function to be unregistered.
  5965. * @param [scope] - The scope that was originally passed to addEventListener.
  5966. * @returns <code>true</code> if the listener was removed; <code>false</code> if the listener and scope are not registered with the event.
  5967. */
  5968. removeEventListener(listener: (...params: any[]) => any, scope?: any): boolean;
  5969. /**
  5970. * Raises the event by calling each registered listener with all supplied arguments.
  5971. * @param arguments - This method takes any number of parameters and passes them through to the listener functions.
  5972. */
  5973. raiseEvent(...arguments: any[]): void;
  5974. }
  5975. export namespace Event {
  5976. /**
  5977. * A function that removes a listener.
  5978. */
  5979. type RemoveCallback = () => void;
  5980. }
  5981. /**
  5982. * A convenience object that simplifies the common pattern of attaching event listeners
  5983. * to several events, then removing all those listeners at once later, for example, in
  5984. * a destroy method.
  5985. * @example
  5986. * var helper = new Cesium.EventHelper();
  5987. *
  5988. * helper.add(someObject.event, listener1, this);
  5989. * helper.add(otherObject.event, listener2, this);
  5990. *
  5991. * // later...
  5992. * helper.removeAll();
  5993. */
  5994. export class EventHelper {
  5995. constructor();
  5996. /**
  5997. * Adds a listener to an event, and records the registration to be cleaned up later.
  5998. * @param event - The event to attach to.
  5999. * @param listener - The function to be executed when the event is raised.
  6000. * @param [scope] - An optional object scope to serve as the <code>this</code>
  6001. * pointer in which the listener function will execute.
  6002. * @returns A function that will remove this event listener when invoked.
  6003. */
  6004. add(event: Event, listener: (...params: any[]) => any, scope?: any): EventHelper.RemoveCallback;
  6005. /**
  6006. * Unregisters all previously added listeners.
  6007. */
  6008. removeAll(): void;
  6009. }
  6010. export namespace EventHelper {
  6011. /**
  6012. * A function that removes a listener.
  6013. */
  6014. type RemoveCallback = () => void;
  6015. }
  6016. /**
  6017. * Constants to determine how an interpolated value is extrapolated
  6018. * when querying outside the bounds of available data.
  6019. */
  6020. export enum ExtrapolationType {
  6021. /**
  6022. * No extrapolation occurs.
  6023. */
  6024. NONE = 0,
  6025. /**
  6026. * The first or last value is used when outside the range of sample data.
  6027. */
  6028. HOLD = 1,
  6029. /**
  6030. * The value is extrapolated.
  6031. */
  6032. EXTRAPOLATE = 2
  6033. }
  6034. /**
  6035. * A set of functions to detect whether the current browser supports
  6036. * various features.
  6037. */
  6038. export namespace FeatureDetection {
  6039. /**
  6040. * Detects whether the current browser supports the full screen standard.
  6041. * @returns true if the browser supports the full screen standard, false if not.
  6042. */
  6043. function supportsFullscreen(): boolean;
  6044. /**
  6045. * Detects whether the current browser supports typed arrays.
  6046. * @returns true if the browser supports typed arrays, false if not.
  6047. */
  6048. function supportsTypedArrays(): boolean;
  6049. /**
  6050. * Detects whether the current browser supports Web Workers.
  6051. * @returns true if the browsers supports Web Workers, false if not.
  6052. */
  6053. function supportsWebWorkers(): boolean;
  6054. /**
  6055. * Detects whether the current browser supports Web Assembly.
  6056. * @returns true if the browsers supports Web Assembly, false if not.
  6057. */
  6058. function supportsWebAssembly(): boolean;
  6059. }
  6060. /**
  6061. * Describes a frustum at the given the origin and orientation.
  6062. * @param options - Object with the following properties:
  6063. * @param options.frustum - The frustum.
  6064. * @param options.origin - The origin of the frustum.
  6065. * @param options.orientation - The orientation of the frustum.
  6066. * @param [options.vertexFormat = VertexFormat.DEFAULT] - The vertex attributes to be computed.
  6067. */
  6068. export class FrustumGeometry {
  6069. constructor(options: {
  6070. frustum: PerspectiveFrustum | OrthographicFrustum;
  6071. origin: Cartesian3;
  6072. orientation: Quaternion;
  6073. vertexFormat?: VertexFormat;
  6074. });
  6075. /**
  6076. * The number of elements used to pack the object into an array.
  6077. */
  6078. packedLength: number;
  6079. /**
  6080. * Stores the provided instance into the provided array.
  6081. * @param value - The value to pack.
  6082. * @param array - The array to pack into.
  6083. * @param [startingIndex = 0] - The index into the array at which to start packing the elements.
  6084. * @returns The array that was packed into
  6085. */
  6086. static pack(value: FrustumGeometry, array: number[], startingIndex?: number): number[];
  6087. /**
  6088. * Retrieves an instance from a packed array.
  6089. * @param array - The packed array.
  6090. * @param [startingIndex = 0] - The starting index of the element to be unpacked.
  6091. * @param [result] - The object into which to store the result.
  6092. */
  6093. static unpack(array: number[], startingIndex?: number, result?: FrustumGeometry): void;
  6094. /**
  6095. * Computes the geometric representation of a frustum, including its vertices, indices, and a bounding sphere.
  6096. * @param frustumGeometry - A description of the frustum.
  6097. * @returns The computed vertices and indices.
  6098. */
  6099. static createGeometry(frustumGeometry: FrustumGeometry): Geometry | undefined;
  6100. }
  6101. /**
  6102. * A description of the outline of a frustum with the given the origin and orientation.
  6103. * @param options - Object with the following properties:
  6104. * @param options.frustum - The frustum.
  6105. * @param options.origin - The origin of the frustum.
  6106. * @param options.orientation - The orientation of the frustum.
  6107. */
  6108. export class FrustumOutlineGeometry {
  6109. constructor(options: {
  6110. frustum: PerspectiveFrustum | OrthographicFrustum;
  6111. origin: Cartesian3;
  6112. orientation: Quaternion;
  6113. });
  6114. /**
  6115. * The number of elements used to pack the object into an array.
  6116. */
  6117. packedLength: number;
  6118. /**
  6119. * Stores the provided instance into the provided array.
  6120. * @param value - The value to pack.
  6121. * @param array - The array to pack into.
  6122. * @param [startingIndex = 0] - The index into the array at which to start packing the elements.
  6123. * @returns The array that was packed into
  6124. */
  6125. static pack(value: FrustumOutlineGeometry, array: number[], startingIndex?: number): number[];
  6126. /**
  6127. * Retrieves an instance from a packed array.
  6128. * @param array - The packed array.
  6129. * @param [startingIndex = 0] - The starting index of the element to be unpacked.
  6130. * @param [result] - The object into which to store the result.
  6131. */
  6132. static unpack(array: number[], startingIndex?: number, result?: FrustumOutlineGeometry): void;
  6133. /**
  6134. * Computes the geometric representation of a frustum outline, including its vertices, indices, and a bounding sphere.
  6135. * @param frustumGeometry - A description of the frustum.
  6136. * @returns The computed vertices and indices.
  6137. */
  6138. static createGeometry(frustumGeometry: FrustumOutlineGeometry): Geometry | undefined;
  6139. }
  6140. /**
  6141. * Browser-independent functions for working with the standard fullscreen API.
  6142. */
  6143. export namespace Fullscreen {
  6144. /**
  6145. * The element that is currently fullscreen, if any. To simply check if the
  6146. * browser is in fullscreen mode or not, use {@link Fullscreen#fullscreen}.
  6147. */
  6148. const element: any;
  6149. /**
  6150. * The name of the event on the document that is fired when fullscreen is
  6151. * entered or exited. This event name is intended for use with addEventListener.
  6152. * In your event handler, to determine if the browser is in fullscreen mode or not,
  6153. * use {@link Fullscreen#fullscreen}.
  6154. */
  6155. const changeEventName: string;
  6156. /**
  6157. * The name of the event that is fired when a fullscreen error
  6158. * occurs. This event name is intended for use with addEventListener.
  6159. */
  6160. const errorEventName: string;
  6161. /**
  6162. * Determine whether the browser will allow an element to be made fullscreen, or not.
  6163. * For example, by default, iframes cannot go fullscreen unless the containing page
  6164. * adds an "allowfullscreen" attribute (or prefixed equivalent).
  6165. */
  6166. const enabled: boolean;
  6167. /**
  6168. * Determines if the browser is currently in fullscreen mode.
  6169. */
  6170. const fullscreen: boolean;
  6171. /**
  6172. * Detects whether the browser supports the standard fullscreen API.
  6173. * @returns <code>true</code> if the browser supports the standard fullscreen API,
  6174. * <code>false</code> otherwise.
  6175. */
  6176. function supportsFullscreen(): boolean;
  6177. /**
  6178. * Asynchronously requests the browser to enter fullscreen mode on the given element.
  6179. * If fullscreen mode is not supported by the browser, does nothing.
  6180. * @example
  6181. * // Put the entire page into fullscreen.
  6182. * Cesium.Fullscreen.requestFullscreen(document.body)
  6183. *
  6184. * // Place only the Cesium canvas into fullscreen.
  6185. * Cesium.Fullscreen.requestFullscreen(scene.canvas)
  6186. * @param element - The HTML element which will be placed into fullscreen mode.
  6187. * @param [vrDevice] - The HMDVRDevice device.
  6188. */
  6189. function requestFullscreen(element: any, vrDevice?: any): void;
  6190. /**
  6191. * Asynchronously exits fullscreen mode. If the browser is not currently
  6192. * in fullscreen, or if fullscreen mode is not supported by the browser, does nothing.
  6193. */
  6194. function exitFullscreen(): void;
  6195. }
  6196. /**
  6197. * The type of geocoding to be performed by a {@link GeocoderService}.
  6198. */
  6199. export enum GeocodeType {
  6200. /**
  6201. * Perform a search where the input is considered complete.
  6202. */
  6203. SEARCH = 0,
  6204. /**
  6205. * Perform an auto-complete using partial input, typically
  6206. * reserved for providing possible results as a user is typing.
  6207. */
  6208. AUTOCOMPLETE = 1
  6209. }
  6210. export namespace GeocoderService {
  6211. /**
  6212. * @property displayName - The display name for a location
  6213. * @property destination - The bounding box for a location
  6214. */
  6215. type Result = {
  6216. displayName: string;
  6217. destination: Rectangle | Cartesian3;
  6218. };
  6219. }
  6220. /**
  6221. * Provides geocoding through an external service. This type describes an interface and
  6222. * is not intended to be used.
  6223. */
  6224. export class GeocoderService {
  6225. constructor();
  6226. /**
  6227. * @param query - The query to be sent to the geocoder service
  6228. * @param [type = GeocodeType.SEARCH] - The type of geocode to perform.
  6229. */
  6230. geocode(query: string, type?: GeocodeType): Promise<GeocoderService.Result[]>;
  6231. }
  6232. /**
  6233. * A simple map projection where longitude and latitude are linearly mapped to X and Y by multiplying
  6234. * them by the {@link Ellipsoid#maximumRadius}. This projection
  6235. * is commonly known as geographic, equirectangular, equidistant cylindrical, or plate carrée. It
  6236. * is also known as EPSG:4326.
  6237. * @param [ellipsoid = Ellipsoid.WGS84] - The ellipsoid.
  6238. */
  6239. export class GeographicProjection {
  6240. constructor(ellipsoid?: Ellipsoid);
  6241. /**
  6242. * Gets the {@link Ellipsoid}.
  6243. */
  6244. readonly ellipsoid: Ellipsoid;
  6245. /**
  6246. * Projects a set of {@link Cartographic} coordinates, in radians, to map coordinates, in meters.
  6247. * X and Y are the longitude and latitude, respectively, multiplied by the maximum radius of the
  6248. * ellipsoid. Z is the unmodified height.
  6249. * @param cartographic - The coordinates to project.
  6250. * @param [result] - An instance into which to copy the result. If this parameter is
  6251. * undefined, a new instance is created and returned.
  6252. * @returns The projected coordinates. If the result parameter is not undefined, the
  6253. * coordinates are copied there and that instance is returned. Otherwise, a new instance is
  6254. * created and returned.
  6255. */
  6256. project(cartographic: Cartographic, result?: Cartesian3): Cartesian3;
  6257. /**
  6258. * Unprojects a set of projected {@link Cartesian3} coordinates, in meters, to {@link Cartographic}
  6259. * coordinates, in radians. Longitude and Latitude are the X and Y coordinates, respectively,
  6260. * divided by the maximum radius of the ellipsoid. Height is the unmodified Z coordinate.
  6261. * @param cartesian - The Cartesian position to unproject with height (z) in meters.
  6262. * @param [result] - An instance into which to copy the result. If this parameter is
  6263. * undefined, a new instance is created and returned.
  6264. * @returns The unprojected coordinates. If the result parameter is not undefined, the
  6265. * coordinates are copied there and that instance is returned. Otherwise, a new instance is
  6266. * created and returned.
  6267. */
  6268. unproject(cartesian: Cartesian3, result?: Cartographic): Cartographic;
  6269. }
  6270. /**
  6271. * A tiling scheme for geometry referenced to a simple {@link GeographicProjection} where
  6272. * longitude and latitude are directly mapped to X and Y. This projection is commonly
  6273. * known as geographic, equirectangular, equidistant cylindrical, or plate carrée.
  6274. * @param [options] - Object with the following properties:
  6275. * @param [options.ellipsoid = Ellipsoid.WGS84] - The ellipsoid whose surface is being tiled. Defaults to
  6276. * the WGS84 ellipsoid.
  6277. * @param [options.rectangle = Rectangle.MAX_VALUE] - The rectangle, in radians, covered by the tiling scheme.
  6278. * @param [options.numberOfLevelZeroTilesX = 2] - The number of tiles in the X direction at level zero of
  6279. * the tile tree.
  6280. * @param [options.numberOfLevelZeroTilesY = 1] - The number of tiles in the Y direction at level zero of
  6281. * the tile tree.
  6282. */
  6283. export class GeographicTilingScheme {
  6284. constructor(options?: {
  6285. ellipsoid?: Ellipsoid;
  6286. rectangle?: Rectangle;
  6287. numberOfLevelZeroTilesX?: number;
  6288. numberOfLevelZeroTilesY?: number;
  6289. });
  6290. /**
  6291. * Gets the ellipsoid that is tiled by this tiling scheme.
  6292. */
  6293. ellipsoid: Ellipsoid;
  6294. /**
  6295. * Gets the rectangle, in radians, covered by this tiling scheme.
  6296. */
  6297. rectangle: Rectangle;
  6298. /**
  6299. * Gets the map projection used by this tiling scheme.
  6300. */
  6301. projection: MapProjection;
  6302. /**
  6303. * Gets the total number of tiles in the X direction at a specified level-of-detail.
  6304. * @param level - The level-of-detail.
  6305. * @returns The number of tiles in the X direction at the given level.
  6306. */
  6307. getNumberOfXTilesAtLevel(level: number): number;
  6308. /**
  6309. * Gets the total number of tiles in the Y direction at a specified level-of-detail.
  6310. * @param level - The level-of-detail.
  6311. * @returns The number of tiles in the Y direction at the given level.
  6312. */
  6313. getNumberOfYTilesAtLevel(level: number): number;
  6314. /**
  6315. * Transforms a rectangle specified in geodetic radians to the native coordinate system
  6316. * of this tiling scheme.
  6317. * @param rectangle - The rectangle to transform.
  6318. * @param [result] - The instance to which to copy the result, or undefined if a new instance
  6319. * should be created.
  6320. * @returns The specified 'result', or a new object containing the native rectangle if 'result'
  6321. * is undefined.
  6322. */
  6323. rectangleToNativeRectangle(rectangle: Rectangle, result?: Rectangle): Rectangle;
  6324. /**
  6325. * Converts tile x, y coordinates and level to a rectangle expressed in the native coordinates
  6326. * of the tiling scheme.
  6327. * @param x - The integer x coordinate of the tile.
  6328. * @param y - The integer y coordinate of the tile.
  6329. * @param level - The tile level-of-detail. Zero is the least detailed.
  6330. * @param [result] - The instance to which to copy the result, or undefined if a new instance
  6331. * should be created.
  6332. * @returns The specified 'result', or a new object containing the rectangle
  6333. * if 'result' is undefined.
  6334. */
  6335. tileXYToNativeRectangle(x: number, y: number, level: number, result?: any): Rectangle;
  6336. /**
  6337. * Converts tile x, y coordinates and level to a cartographic rectangle in radians.
  6338. * @param x - The integer x coordinate of the tile.
  6339. * @param y - The integer y coordinate of the tile.
  6340. * @param level - The tile level-of-detail. Zero is the least detailed.
  6341. * @param [result] - The instance to which to copy the result, or undefined if a new instance
  6342. * should be created.
  6343. * @returns The specified 'result', or a new object containing the rectangle
  6344. * if 'result' is undefined.
  6345. */
  6346. tileXYToRectangle(x: number, y: number, level: number, result?: any): Rectangle;
  6347. /**
  6348. * Calculates the tile x, y coordinates of the tile containing
  6349. * a given cartographic position.
  6350. * @param position - The position.
  6351. * @param level - The tile level-of-detail. Zero is the least detailed.
  6352. * @param [result] - The instance to which to copy the result, or undefined if a new instance
  6353. * should be created.
  6354. * @returns The specified 'result', or a new object containing the tile x, y coordinates
  6355. * if 'result' is undefined.
  6356. */
  6357. positionToTileXY(position: Cartographic, level: number, result?: Cartesian2): Cartesian2;
  6358. }
  6359. /**
  6360. * A geometry representation with attributes forming vertices and optional index data
  6361. * defining primitives. Geometries and an {@link Appearance}, which describes the shading,
  6362. * can be assigned to a {@link Primitive} for visualization. A <code>Primitive</code> can
  6363. * be created from many heterogeneous - in many cases - geometries for performance.
  6364. * <p>
  6365. * Geometries can be transformed and optimized using functions in {@link GeometryPipeline}.
  6366. * </p>
  6367. * @example
  6368. * // Create geometry with a position attribute and indexed lines.
  6369. * var positions = new Float64Array([
  6370. * 0.0, 0.0, 0.0,
  6371. * 7500000.0, 0.0, 0.0,
  6372. * 0.0, 7500000.0, 0.0
  6373. * ]);
  6374. *
  6375. * var geometry = new Cesium.Geometry({
  6376. * attributes : {
  6377. * position : new Cesium.GeometryAttribute({
  6378. * componentDatatype : Cesium.ComponentDatatype.DOUBLE,
  6379. * componentsPerAttribute : 3,
  6380. * values : positions
  6381. * })
  6382. * },
  6383. * indices : new Uint16Array([0, 1, 1, 2, 2, 0]),
  6384. * primitiveType : Cesium.PrimitiveType.LINES,
  6385. * boundingSphere : Cesium.BoundingSphere.fromVertices(positions)
  6386. * });
  6387. * @param options - Object with the following properties:
  6388. * @param options.attributes - Attributes, which make up the geometry's vertices.
  6389. * @param [options.primitiveType = PrimitiveType.TRIANGLES] - The type of primitives in the geometry.
  6390. * @param [options.indices] - Optional index data that determines the primitives in the geometry.
  6391. * @param [options.boundingSphere] - An optional bounding sphere that fully enclosed the geometry.
  6392. */
  6393. export class Geometry {
  6394. constructor(options: {
  6395. attributes: GeometryAttributes;
  6396. primitiveType?: PrimitiveType;
  6397. indices?: Uint16Array | Uint32Array;
  6398. boundingSphere?: BoundingSphere;
  6399. });
  6400. /**
  6401. * Attributes, which make up the geometry's vertices. Each property in this object corresponds to a
  6402. * {@link GeometryAttribute} containing the attribute's data.
  6403. * <p>
  6404. * Attributes are always stored non-interleaved in a Geometry.
  6405. * </p>
  6406. * <p>
  6407. * There are reserved attribute names with well-known semantics. The following attributes
  6408. * are created by a Geometry (depending on the provided {@link VertexFormat}.
  6409. * <ul>
  6410. * <li><code>position</code> - 3D vertex position. 64-bit floating-point (for precision). 3 components per attribute. See {@link VertexFormat#position}.</li>
  6411. * <li><code>normal</code> - Normal (normalized), commonly used for lighting. 32-bit floating-point. 3 components per attribute. See {@link VertexFormat#normal}.</li>
  6412. * <li><code>st</code> - 2D texture coordinate. 32-bit floating-point. 2 components per attribute. See {@link VertexFormat#st}.</li>
  6413. * <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>
  6414. * <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>
  6415. * </ul>
  6416. * </p>
  6417. * <p>
  6418. * The following attribute names are generally not created by a Geometry, but are added
  6419. * to a Geometry by a {@link Primitive} or {@link GeometryPipeline} functions to prepare
  6420. * the geometry for rendering.
  6421. * <ul>
  6422. * <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>
  6423. * <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>
  6424. * <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>
  6425. * <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>
  6426. * <li><code>color</code> - RGBA color (normalized) usually from {@link GeometryInstance#color}. 32-bit floating-point. 4 components per attribute.</li>
  6427. * <li><code>pickColor</code> - RGBA color used for picking. 32-bit floating-point. 4 components per attribute.</li>
  6428. * </ul>
  6429. * </p>
  6430. * @example
  6431. * geometry.attributes.position = new Cesium.GeometryAttribute({
  6432. * componentDatatype : Cesium.ComponentDatatype.FLOAT,
  6433. * componentsPerAttribute : 3,
  6434. * values : new Float32Array(0)
  6435. * });
  6436. */
  6437. attributes: GeometryAttributes;
  6438. /**
  6439. * Optional index data that - along with {@link Geometry#primitiveType} -
  6440. * determines the primitives in the geometry.
  6441. */
  6442. indices: any[];
  6443. /**
  6444. * The type of primitives in the geometry. This is most often {@link PrimitiveType.TRIANGLES},
  6445. * but can varying based on the specific geometry.
  6446. */
  6447. primitiveType: PrimitiveType;
  6448. /**
  6449. * An optional bounding sphere that fully encloses the geometry. This is
  6450. * commonly used for culling.
  6451. */
  6452. boundingSphere: BoundingSphere;
  6453. /**
  6454. * Computes the number of vertices in a geometry. The runtime is linear with
  6455. * respect to the number of attributes in a vertex, not the number of vertices.
  6456. * @example
  6457. * var numVertices = Cesium.Geometry.computeNumberOfVertices(geometry);
  6458. * @param geometry - The geometry.
  6459. * @returns The number of vertices in the geometry.
  6460. */
  6461. static computeNumberOfVertices(geometry: Geometry): number;
  6462. }
  6463. /**
  6464. * Values and type information for geometry attributes. A {@link Geometry}
  6465. * generally contains one or more attributes. All attributes together form
  6466. * the geometry's vertices.
  6467. * @example
  6468. * var geometry = new Cesium.Geometry({
  6469. * attributes : {
  6470. * position : new Cesium.GeometryAttribute({
  6471. * componentDatatype : Cesium.ComponentDatatype.FLOAT,
  6472. * componentsPerAttribute : 3,
  6473. * values : new Float32Array([
  6474. * 0.0, 0.0, 0.0,
  6475. * 7500000.0, 0.0, 0.0,
  6476. * 0.0, 7500000.0, 0.0
  6477. * ])
  6478. * })
  6479. * },
  6480. * primitiveType : Cesium.PrimitiveType.LINE_LOOP
  6481. * });
  6482. * @param [options] - Object with the following properties:
  6483. * @param [options.componentDatatype] - The datatype of each component in the attribute, e.g., individual elements in values.
  6484. * @param [options.componentsPerAttribute] - A number between 1 and 4 that defines the number of components in an attributes.
  6485. * @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.
  6486. * @param [options.values] - The values for the attributes stored in a typed array.
  6487. */
  6488. export class GeometryAttribute {
  6489. constructor(options?: {
  6490. componentDatatype?: ComponentDatatype;
  6491. componentsPerAttribute?: number;
  6492. normalize?: boolean;
  6493. values?: number[] | Int8Array | Uint8Array | Int16Array | Uint16Array | Int32Array | Uint32Array | Float32Array | Float64Array;
  6494. });
  6495. /**
  6496. * The datatype of each component in the attribute, e.g., individual elements in
  6497. * {@link GeometryAttribute#values}.
  6498. */
  6499. componentDatatype: ComponentDatatype;
  6500. /**
  6501. * A number between 1 and 4 that defines the number of components in an attributes.
  6502. * For example, a position attribute with x, y, and z components would have 3 as
  6503. * shown in the code example.
  6504. * @example
  6505. * attribute.componentDatatype = Cesium.ComponentDatatype.FLOAT;
  6506. * attribute.componentsPerAttribute = 3;
  6507. * attribute.values = new Float32Array([
  6508. * 0.0, 0.0, 0.0,
  6509. * 7500000.0, 0.0, 0.0,
  6510. * 0.0, 7500000.0, 0.0
  6511. * ]);
  6512. */
  6513. componentsPerAttribute: number;
  6514. /**
  6515. * When <code>true</code> and <code>componentDatatype</code> is an integer format,
  6516. * indicate that the components should be mapped to the range [0, 1] (unsigned)
  6517. * or [-1, 1] (signed) when they are accessed as floating-point for rendering.
  6518. * <p>
  6519. * This is commonly used when storing colors using {@link ComponentDatatype.UNSIGNED_BYTE}.
  6520. * </p>
  6521. * @example
  6522. * attribute.componentDatatype = Cesium.ComponentDatatype.UNSIGNED_BYTE;
  6523. * attribute.componentsPerAttribute = 4;
  6524. * attribute.normalize = true;
  6525. * attribute.values = new Uint8Array([
  6526. * Cesium.Color.floatToByte(color.red),
  6527. * Cesium.Color.floatToByte(color.green),
  6528. * Cesium.Color.floatToByte(color.blue),
  6529. * Cesium.Color.floatToByte(color.alpha)
  6530. * ]);
  6531. */
  6532. normalize: boolean;
  6533. /**
  6534. * The values for the attributes stored in a typed array. In the code example,
  6535. * every three elements in <code>values</code> defines one attributes since
  6536. * <code>componentsPerAttribute</code> is 3.
  6537. * @example
  6538. * attribute.componentDatatype = Cesium.ComponentDatatype.FLOAT;
  6539. * attribute.componentsPerAttribute = 3;
  6540. * attribute.values = new Float32Array([
  6541. * 0.0, 0.0, 0.0,
  6542. * 7500000.0, 0.0, 0.0,
  6543. * 0.0, 7500000.0, 0.0
  6544. * ]);
  6545. */
  6546. values: number[] | Int8Array | Uint8Array | Int16Array | Uint16Array | Int32Array | Uint32Array | Float32Array | Float64Array;
  6547. }
  6548. /**
  6549. * Attributes, which make up a geometry's vertices. Each property in this object corresponds to a
  6550. * {@link GeometryAttribute} containing the attribute's data.
  6551. * <p>
  6552. * Attributes are always stored non-interleaved in a Geometry.
  6553. * </p>
  6554. */
  6555. export class GeometryAttributes {
  6556. constructor();
  6557. /**
  6558. * The 3D position attribute.
  6559. * <p>
  6560. * 64-bit floating-point (for precision). 3 components per attribute.
  6561. * </p>
  6562. */
  6563. position: GeometryAttribute;
  6564. /**
  6565. * The normal attribute (normalized), which is commonly used for lighting.
  6566. * <p>
  6567. * 32-bit floating-point. 3 components per attribute.
  6568. * </p>
  6569. */
  6570. normal: GeometryAttribute;
  6571. /**
  6572. * The 2D texture coordinate attribute.
  6573. * <p>
  6574. * 32-bit floating-point. 2 components per attribute
  6575. * </p>
  6576. */
  6577. st: GeometryAttribute;
  6578. /**
  6579. * The bitangent attribute (normalized), which is used for tangent-space effects like bump mapping.
  6580. * <p>
  6581. * 32-bit floating-point. 3 components per attribute.
  6582. * </p>
  6583. */
  6584. bitangent: GeometryAttribute;
  6585. /**
  6586. * The tangent attribute (normalized), which is used for tangent-space effects like bump mapping.
  6587. * <p>
  6588. * 32-bit floating-point. 3 components per attribute.
  6589. * </p>
  6590. */
  6591. tangent: GeometryAttribute;
  6592. /**
  6593. * The color attribute.
  6594. * <p>
  6595. * 8-bit unsigned integer. 4 components per attribute.
  6596. * </p>
  6597. */
  6598. color: GeometryAttribute;
  6599. }
  6600. /**
  6601. * Base class for all geometry creation utility classes that can be passed to {@link GeometryInstance}
  6602. * for asynchronous geometry creation.
  6603. */
  6604. export class GeometryFactory {
  6605. constructor();
  6606. /**
  6607. * Returns a geometry.
  6608. * @param geometryFactory - A description of the circle.
  6609. * @returns The computed vertices and indices.
  6610. */
  6611. static createGeometry(geometryFactory: GeometryFactory): Geometry | undefined;
  6612. }
  6613. /**
  6614. * Geometry instancing allows one {@link Geometry} object to be positions in several
  6615. * different locations and colored uniquely. For example, one {@link BoxGeometry} can
  6616. * be instanced several times, each with a different <code>modelMatrix</code> to change
  6617. * its position, rotation, and scale.
  6618. * @example
  6619. * // Create geometry for a box, and two instances that refer to it.
  6620. * // One instance positions the box on the bottom and colored aqua.
  6621. * // The other instance positions the box on the top and color white.
  6622. * var geometry = Cesium.BoxGeometry.fromDimensions({
  6623. * vertexFormat : Cesium.VertexFormat.POSITION_AND_NORMAL,
  6624. * dimensions : new Cesium.Cartesian3(1000000.0, 1000000.0, 500000.0)
  6625. * });
  6626. * var instanceBottom = new Cesium.GeometryInstance({
  6627. * geometry : geometry,
  6628. * modelMatrix : Cesium.Matrix4.multiplyByTranslation(Cesium.Transforms.eastNorthUpToFixedFrame(
  6629. * Cesium.Cartesian3.fromDegrees(-75.59777, 40.03883)), new Cesium.Cartesian3(0.0, 0.0, 1000000.0), new Cesium.Matrix4()),
  6630. * attributes : {
  6631. * color : Cesium.ColorGeometryInstanceAttribute.fromColor(Cesium.Color.AQUA)
  6632. * },
  6633. * id : 'bottom'
  6634. * });
  6635. * var instanceTop = new Cesium.GeometryInstance({
  6636. * geometry : geometry,
  6637. * modelMatrix : Cesium.Matrix4.multiplyByTranslation(Cesium.Transforms.eastNorthUpToFixedFrame(
  6638. * Cesium.Cartesian3.fromDegrees(-75.59777, 40.03883)), new Cesium.Cartesian3(0.0, 0.0, 3000000.0), new Cesium.Matrix4()),
  6639. * attributes : {
  6640. * color : Cesium.ColorGeometryInstanceAttribute.fromColor(Cesium.Color.AQUA)
  6641. * },
  6642. * id : 'top'
  6643. * });
  6644. * @param options - Object with the following properties:
  6645. * @param options.geometry - The geometry to instance.
  6646. * @param [options.modelMatrix = Matrix4.IDENTITY] - The model matrix that transforms to transform the geometry from model to world coordinates.
  6647. * @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}.
  6648. * @param [options.attributes] - Per-instance attributes like a show or color attribute shown in the example below.
  6649. */
  6650. export class GeometryInstance {
  6651. constructor(options: {
  6652. geometry: Geometry | GeometryFactory;
  6653. modelMatrix?: Matrix4;
  6654. id?: any;
  6655. attributes?: any;
  6656. });
  6657. /**
  6658. * The geometry being instanced.
  6659. */
  6660. geometry: Geometry;
  6661. /**
  6662. * The 4x4 transformation matrix that transforms the geometry from model to world coordinates.
  6663. * When this is the identity matrix, the geometry is drawn in world coordinates, i.e., Earth's WGS84 coordinates.
  6664. * Local reference frames can be used by providing a different transformation matrix, like that returned
  6665. * by {@link Transforms.eastNorthUpToFixedFrame}.
  6666. */
  6667. modelMatrix: Matrix4;
  6668. /**
  6669. * User-defined object returned when the instance is picked or used to get/set per-instance attributes.
  6670. */
  6671. id: any;
  6672. /**
  6673. * Per-instance attributes like {@link ColorGeometryInstanceAttribute} or {@link ShowGeometryInstanceAttribute}.
  6674. * {@link Geometry} attributes varying per vertex; these attributes are constant for the entire instance.
  6675. */
  6676. attributes: any;
  6677. }
  6678. /**
  6679. * Values and type information for per-instance geometry attributes.
  6680. * @example
  6681. * var instance = new Cesium.GeometryInstance({
  6682. * geometry : Cesium.BoxGeometry.fromDimensions({
  6683. * dimensions : new Cesium.Cartesian3(1000000.0, 1000000.0, 500000.0)
  6684. * }),
  6685. * modelMatrix : Cesium.Matrix4.multiplyByTranslation(Cesium.Transforms.eastNorthUpToFixedFrame(
  6686. * Cesium.Cartesian3.fromDegrees(0.0, 0.0)), new Cesium.Cartesian3(0.0, 0.0, 1000000.0), new Cesium.Matrix4()),
  6687. * id : 'box',
  6688. * attributes : {
  6689. * color : new Cesium.GeometryInstanceAttribute({
  6690. * componentDatatype : Cesium.ComponentDatatype.UNSIGNED_BYTE,
  6691. * componentsPerAttribute : 4,
  6692. * normalize : true,
  6693. * value : [255, 255, 0, 255]
  6694. * })
  6695. * }
  6696. * });
  6697. * @param options - Object with the following properties:
  6698. * @param options.componentDatatype - The datatype of each component in the attribute, e.g., individual elements in values.
  6699. * @param options.componentsPerAttribute - A number between 1 and 4 that defines the number of components in an attributes.
  6700. * @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.
  6701. * @param options.value - The value for the attribute.
  6702. */
  6703. export class GeometryInstanceAttribute {
  6704. constructor(options: {
  6705. componentDatatype: ComponentDatatype;
  6706. componentsPerAttribute: number;
  6707. normalize?: boolean;
  6708. value: number[];
  6709. });
  6710. /**
  6711. * The datatype of each component in the attribute, e.g., individual elements in
  6712. * {@link GeometryInstanceAttribute#value}.
  6713. */
  6714. componentDatatype: ComponentDatatype;
  6715. /**
  6716. * A number between 1 and 4 that defines the number of components in an attributes.
  6717. * For example, a position attribute with x, y, and z components would have 3 as
  6718. * shown in the code example.
  6719. * @example
  6720. * show : new Cesium.GeometryInstanceAttribute({
  6721. * componentDatatype : Cesium.ComponentDatatype.UNSIGNED_BYTE,
  6722. * componentsPerAttribute : 1,
  6723. * normalize : true,
  6724. * value : [1.0]
  6725. * })
  6726. */
  6727. componentsPerAttribute: number;
  6728. /**
  6729. * When <code>true</code> and <code>componentDatatype</code> is an integer format,
  6730. * indicate that the components should be mapped to the range [0, 1] (unsigned)
  6731. * or [-1, 1] (signed) when they are accessed as floating-point for rendering.
  6732. * <p>
  6733. * This is commonly used when storing colors using {@link ComponentDatatype.UNSIGNED_BYTE}.
  6734. * </p>
  6735. * @example
  6736. * attribute.componentDatatype = Cesium.ComponentDatatype.UNSIGNED_BYTE;
  6737. * attribute.componentsPerAttribute = 4;
  6738. * attribute.normalize = true;
  6739. * attribute.value = [
  6740. * Cesium.Color.floatToByte(color.red),
  6741. * Cesium.Color.floatToByte(color.green),
  6742. * Cesium.Color.floatToByte(color.blue),
  6743. * Cesium.Color.floatToByte(color.alpha)
  6744. * ];
  6745. */
  6746. normalize: boolean;
  6747. /**
  6748. * The values for the attributes stored in a typed array. In the code example,
  6749. * every three elements in <code>values</code> defines one attributes since
  6750. * <code>componentsPerAttribute</code> is 3.
  6751. * @example
  6752. * show : new Cesium.GeometryInstanceAttribute({
  6753. * componentDatatype : Cesium.ComponentDatatype.UNSIGNED_BYTE,
  6754. * componentsPerAttribute : 1,
  6755. * normalize : true,
  6756. * value : [1.0]
  6757. * })
  6758. */
  6759. value: number[];
  6760. }
  6761. /**
  6762. * Content pipeline functions for geometries.
  6763. */
  6764. export namespace GeometryPipeline {
  6765. /**
  6766. * Converts a geometry's triangle indices to line indices. If the geometry has an <code>indices</code>
  6767. * and its <code>primitiveType</code> is <code>TRIANGLES</code>, <code>TRIANGLE_STRIP</code>,
  6768. * <code>TRIANGLE_FAN</code>, it is converted to <code>LINES</code>; otherwise, the geometry is not changed.
  6769. * <p>
  6770. * This is commonly used to create a wireframe geometry for visual debugging.
  6771. * </p>
  6772. * @example
  6773. * geometry = Cesium.GeometryPipeline.toWireframe(geometry);
  6774. * @param geometry - The geometry to modify.
  6775. * @returns The modified <code>geometry</code> argument, with its triangle indices converted to lines.
  6776. */
  6777. function toWireframe(geometry: Geometry): Geometry;
  6778. /**
  6779. * Creates a new {@link Geometry} with <code>LINES</code> representing the provided
  6780. * attribute (<code>attributeName</code>) for the provided geometry. This is used to
  6781. * visualize vector attributes like normals, tangents, and bitangents.
  6782. * @example
  6783. * var geometry = Cesium.GeometryPipeline.createLineSegmentsForVectors(instance.geometry, 'bitangent', 100000.0);
  6784. * @param geometry - The <code>Geometry</code> instance with the attribute.
  6785. * @param [attributeName = 'normal'] - The name of the attribute.
  6786. * @param [length = 10000.0] - The length of each line segment in meters. This can be negative to point the vector in the opposite direction.
  6787. * @returns A new <code>Geometry</code> instance with line segments for the vector.
  6788. */
  6789. function createLineSegmentsForVectors(geometry: Geometry, attributeName?: string, length?: number): Geometry;
  6790. /**
  6791. * Creates an object that maps attribute names to unique locations (indices)
  6792. * for matching vertex attributes and shader programs.
  6793. * @example
  6794. * var attributeLocations = Cesium.GeometryPipeline.createAttributeLocations(geometry);
  6795. * // Example output
  6796. * // {
  6797. * // 'position' : 0,
  6798. * // 'normal' : 1
  6799. * // }
  6800. * @param geometry - The geometry, which is not modified, to create the object for.
  6801. * @returns An object with attribute name / index pairs.
  6802. */
  6803. function createAttributeLocations(geometry: Geometry): any;
  6804. /**
  6805. * Reorders a geometry's attributes and <code>indices</code> to achieve better performance from the GPU's pre-vertex-shader cache.
  6806. * @example
  6807. * geometry = Cesium.GeometryPipeline.reorderForPreVertexCache(geometry);
  6808. * @param geometry - The geometry to modify.
  6809. * @returns The modified <code>geometry</code> argument, with its attributes and indices reordered for the GPU's pre-vertex-shader cache.
  6810. */
  6811. function reorderForPreVertexCache(geometry: Geometry): Geometry;
  6812. /**
  6813. * Reorders a geometry's <code>indices</code> to achieve better performance from the GPU's
  6814. * post vertex-shader cache by using the Tipsify algorithm. If the geometry <code>primitiveType</code>
  6815. * is not <code>TRIANGLES</code> or the geometry does not have an <code>indices</code>, this function has no effect.
  6816. * @example
  6817. * geometry = Cesium.GeometryPipeline.reorderForPostVertexCache(geometry);
  6818. * @param geometry - The geometry to modify.
  6819. * @param [cacheCapacity = 24] - The number of vertices that can be held in the GPU's vertex cache.
  6820. * @returns The modified <code>geometry</code> argument, with its indices reordered for the post-vertex-shader cache.
  6821. */
  6822. function reorderForPostVertexCache(geometry: Geometry, cacheCapacity?: number): Geometry;
  6823. /**
  6824. * Splits a geometry into multiple geometries, if necessary, to ensure that indices in the
  6825. * <code>indices</code> fit into unsigned shorts. This is used to meet the WebGL requirements
  6826. * when unsigned int indices are not supported.
  6827. * <p>
  6828. * If the geometry does not have any <code>indices</code>, this function has no effect.
  6829. * </p>
  6830. * @example
  6831. * var geometries = Cesium.GeometryPipeline.fitToUnsignedShortIndices(geometry);
  6832. * @param geometry - The geometry to be split into multiple geometries.
  6833. * @returns An array of geometries, each with indices that fit into unsigned shorts.
  6834. */
  6835. function fitToUnsignedShortIndices(geometry: Geometry): Geometry[];
  6836. /**
  6837. * Projects a geometry's 3D <code>position</code> attribute to 2D, replacing the <code>position</code>
  6838. * attribute with separate <code>position3D</code> and <code>position2D</code> attributes.
  6839. * <p>
  6840. * If the geometry does not have a <code>position</code>, this function has no effect.
  6841. * </p>
  6842. * @example
  6843. * geometry = Cesium.GeometryPipeline.projectTo2D(geometry, 'position', 'position3D', 'position2D');
  6844. * @param geometry - The geometry to modify.
  6845. * @param attributeName - The name of the attribute.
  6846. * @param attributeName3D - The name of the attribute in 3D.
  6847. * @param attributeName2D - The name of the attribute in 2D.
  6848. * @param [projection = new GeographicProjection()] - The projection to use.
  6849. * @returns The modified <code>geometry</code> argument with <code>position3D</code> and <code>position2D</code> attributes.
  6850. */
  6851. function projectTo2D(geometry: Geometry, attributeName: string, attributeName3D: string, attributeName2D: string, projection?: any): Geometry;
  6852. /**
  6853. * Encodes floating-point geometry attribute values as two separate attributes to improve
  6854. * rendering precision.
  6855. * <p>
  6856. * This is commonly used to create high-precision position vertex attributes.
  6857. * </p>
  6858. * @example
  6859. * geometry = Cesium.GeometryPipeline.encodeAttribute(geometry, 'position3D', 'position3DHigh', 'position3DLow');
  6860. * @param geometry - The geometry to modify.
  6861. * @param attributeName - The name of the attribute.
  6862. * @param attributeHighName - The name of the attribute for the encoded high bits.
  6863. * @param attributeLowName - The name of the attribute for the encoded low bits.
  6864. * @returns The modified <code>geometry</code> argument, with its encoded attribute.
  6865. */
  6866. function encodeAttribute(geometry: Geometry, attributeName: string, attributeHighName: string, attributeLowName: string): Geometry;
  6867. /**
  6868. * Transforms a geometry instance to world coordinates. This changes
  6869. * the instance's <code>modelMatrix</code> to {@link Matrix4.IDENTITY} and transforms the
  6870. * following attributes if they are present: <code>position</code>, <code>normal</code>,
  6871. * <code>tangent</code>, and <code>bitangent</code>.
  6872. * @example
  6873. * Cesium.GeometryPipeline.transformToWorldCoordinates(instance);
  6874. * @param instance - The geometry instance to modify.
  6875. * @returns The modified <code>instance</code> argument, with its attributes transforms to world coordinates.
  6876. */
  6877. function transformToWorldCoordinates(instance: GeometryInstance): GeometryInstance;
  6878. /**
  6879. * Computes per-vertex normals for a geometry containing <code>TRIANGLES</code> by averaging the normals of
  6880. * all triangles incident to the vertex. The result is a new <code>normal</code> attribute added to the geometry.
  6881. * This assumes a counter-clockwise winding order.
  6882. * @example
  6883. * Cesium.GeometryPipeline.computeNormal(geometry);
  6884. * @param geometry - The geometry to modify.
  6885. * @returns The modified <code>geometry</code> argument with the computed <code>normal</code> attribute.
  6886. */
  6887. function computeNormal(geometry: Geometry): Geometry;
  6888. /**
  6889. * Computes per-vertex tangents and bitangents for a geometry containing <code>TRIANGLES</code>.
  6890. * The result is new <code>tangent</code> and <code>bitangent</code> attributes added to the geometry.
  6891. * This assumes a counter-clockwise winding order.
  6892. * <p>
  6893. * Based on <a href="http://www.terathon.com/code/tangent.html">Computing Tangent Space Basis Vectors
  6894. * for an Arbitrary Mesh</a> by Eric Lengyel.
  6895. * </p>
  6896. * @example
  6897. * Cesium.GeometryPipeline.computeTangentAndBiTangent(geometry);
  6898. * @param geometry - The geometry to modify.
  6899. * @returns The modified <code>geometry</code> argument with the computed <code>tangent</code> and <code>bitangent</code> attributes.
  6900. */
  6901. function computeTangentAndBitangent(geometry: Geometry): Geometry;
  6902. /**
  6903. * Compresses and packs geometry normal attribute values to save memory.
  6904. * @example
  6905. * geometry = Cesium.GeometryPipeline.compressVertices(geometry);
  6906. * @param geometry - The geometry to modify.
  6907. * @returns The modified <code>geometry</code> argument, with its normals compressed and packed.
  6908. */
  6909. function compressVertices(geometry: Geometry): Geometry;
  6910. }
  6911. /**
  6912. * Provides metadata using the Google Earth Enterprise REST API. This is used by the GoogleEarthEnterpriseImageryProvider
  6913. * and GoogleEarthEnterpriseTerrainProvider to share metadata requests.
  6914. * @param resourceOrUrl - The url of the Google Earth Enterprise server hosting the imagery
  6915. */
  6916. export class GoogleEarthEnterpriseMetadata {
  6917. constructor(resourceOrUrl: Resource | string);
  6918. /**
  6919. * True if imagery is available.
  6920. */
  6921. imageryPresent: boolean;
  6922. /**
  6923. * True if imagery is sent as a protocol buffer, false if sent as plain images. If undefined we will try both.
  6924. */
  6925. protoImagery: boolean;
  6926. /**
  6927. * True if terrain is available.
  6928. */
  6929. terrainPresent: boolean;
  6930. /**
  6931. * Exponent used to compute constant to calculate negative height values.
  6932. */
  6933. negativeAltitudeExponentBias: number;
  6934. /**
  6935. * Threshold where any numbers smaller are actually negative values. They are multiplied by -2^negativeAltitudeExponentBias.
  6936. */
  6937. negativeAltitudeThreshold: number;
  6938. /**
  6939. * Dictionary of provider id to copyright strings.
  6940. */
  6941. providers: any;
  6942. /**
  6943. * Key used to decode packets
  6944. */
  6945. key: ArrayBuffer;
  6946. /**
  6947. * Gets the name of the Google Earth Enterprise server.
  6948. */
  6949. readonly url: string;
  6950. /**
  6951. * Gets the proxy used for metadata requests.
  6952. */
  6953. readonly proxy: Proxy;
  6954. /**
  6955. * Gets the resource used for metadata requests.
  6956. */
  6957. readonly resource: Resource;
  6958. /**
  6959. * Gets a promise that resolves to true when the metadata is ready for use.
  6960. */
  6961. readonly readyPromise: Promise<boolean>;
  6962. /**
  6963. * Converts a tiles (x, y, level) position into a quadkey used to request an image
  6964. * from a Google Earth Enterprise server.
  6965. * @param x - The tile's x coordinate.
  6966. * @param y - The tile's y coordinate.
  6967. * @param level - The tile's zoom level.
  6968. */
  6969. static tileXYToQuadKey(x: number, y: number, level: number): void;
  6970. /**
  6971. * Converts a tile's quadkey used to request an image from a Google Earth Enterprise server into the
  6972. * (x, y, level) position.
  6973. * @param quadkey - The tile's quad key
  6974. */
  6975. static quadKeyToTileXY(quadkey: string): void;
  6976. }
  6977. /**
  6978. * Terrain data for a single tile from a Google Earth Enterprise server.
  6979. * @example
  6980. * var buffer = ...
  6981. * var childTileMask = ...
  6982. * var terrainData = new Cesium.GoogleEarthEnterpriseTerrainData({
  6983. * buffer : heightBuffer,
  6984. * childTileMask : childTileMask
  6985. * });
  6986. * @param options - Object with the following properties:
  6987. * @param options.buffer - The buffer containing terrain data.
  6988. * @param options.negativeAltitudeExponentBias - Multiplier for negative terrain heights that are encoded as very small positive values.
  6989. * @param options.negativeElevationThreshold - Threshold for negative values
  6990. * @param [options.childTileMask = 15] - A bit mask indicating which of this tile's four children exist.
  6991. * If a child's bit is set, geometry will be requested for that tile as well when it
  6992. * is needed. If the bit is cleared, the child tile is not requested and geometry is
  6993. * instead upsampled from the parent. The bit values are as follows:
  6994. * <table>
  6995. * <tr><th>Bit Position</th><th>Bit Value</th><th>Child Tile</th></tr>
  6996. * <tr><td>0</td><td>1</td><td>Southwest</td></tr>
  6997. * <tr><td>1</td><td>2</td><td>Southeast</td></tr>
  6998. * <tr><td>2</td><td>4</td><td>Northeast</td></tr>
  6999. * <tr><td>3</td><td>8</td><td>Northwest</td></tr>
  7000. * </table>
  7001. * @param [options.createdByUpsampling = false] - True if this instance was created by upsampling another instance;
  7002. * otherwise, false.
  7003. * @param [options.credits] - Array of credits for this tile.
  7004. */
  7005. export class GoogleEarthEnterpriseTerrainData {
  7006. constructor(options: {
  7007. buffer: ArrayBuffer;
  7008. negativeAltitudeExponentBias: number;
  7009. negativeElevationThreshold: number;
  7010. childTileMask?: number;
  7011. createdByUpsampling?: boolean;
  7012. credits?: Credit[];
  7013. });
  7014. /**
  7015. * An array of credits for this tile
  7016. */
  7017. credits: Credit[];
  7018. /**
  7019. * The water mask included in this terrain data, if any. A water mask is a rectangular
  7020. * Uint8Array or image where a value of 255 indicates water and a value of 0 indicates land.
  7021. * Values in between 0 and 255 are allowed as well to smoothly blend between land and water.
  7022. */
  7023. waterMask: Uint8Array | HTMLImageElement | HTMLCanvasElement;
  7024. /**
  7025. * Computes the terrain height at a specified longitude and latitude.
  7026. * @param rectangle - The rectangle covered by this terrain data.
  7027. * @param longitude - The longitude in radians.
  7028. * @param latitude - The latitude in radians.
  7029. * @returns The terrain height at the specified position. If the position
  7030. * is outside the rectangle, this method will extrapolate the height, which is likely to be wildly
  7031. * incorrect for positions far outside the rectangle.
  7032. */
  7033. interpolateHeight(rectangle: Rectangle, longitude: number, latitude: number): number;
  7034. /**
  7035. * Upsamples this terrain data for use by a descendant tile. The resulting instance will contain a subset of the
  7036. * height samples in this instance, interpolated if necessary.
  7037. * @param tilingScheme - The tiling scheme of this terrain data.
  7038. * @param thisX - The X coordinate of this tile in the tiling scheme.
  7039. * @param thisY - The Y coordinate of this tile in the tiling scheme.
  7040. * @param thisLevel - The level of this tile in the tiling scheme.
  7041. * @param descendantX - The X coordinate within the tiling scheme of the descendant tile for which we are upsampling.
  7042. * @param descendantY - The Y coordinate within the tiling scheme of the descendant tile for which we are upsampling.
  7043. * @param descendantLevel - The level within the tiling scheme of the descendant tile for which we are upsampling.
  7044. * @returns A promise for upsampled heightmap terrain data for the descendant tile,
  7045. * or undefined if too many asynchronous upsample operations are in progress and the request has been
  7046. * deferred.
  7047. */
  7048. upsample(tilingScheme: TilingScheme, thisX: number, thisY: number, thisLevel: number, descendantX: number, descendantY: number, descendantLevel: number): Promise<HeightmapTerrainData> | undefined;
  7049. /**
  7050. * Determines if a given child tile is available, based on the
  7051. * {@link HeightmapTerrainData.childTileMask}. The given child tile coordinates are assumed
  7052. * to be one of the four children of this tile. If non-child tile coordinates are
  7053. * given, the availability of the southeast child tile is returned.
  7054. * @param thisX - The tile X coordinate of this (the parent) tile.
  7055. * @param thisY - The tile Y coordinate of this (the parent) tile.
  7056. * @param childX - The tile X coordinate of the child tile to check for availability.
  7057. * @param childY - The tile Y coordinate of the child tile to check for availability.
  7058. * @returns True if the child tile is available; otherwise, false.
  7059. */
  7060. isChildAvailable(thisX: number, thisY: number, childX: number, childY: number): boolean;
  7061. /**
  7062. * Gets a value indicating whether or not this terrain data was created by upsampling lower resolution
  7063. * terrain data. If this value is false, the data was obtained from some other source, such
  7064. * as by downloading it from a remote server. This method should return true for instances
  7065. * returned from a call to {@link HeightmapTerrainData#upsample}.
  7066. * @returns True if this instance was created by upsampling; otherwise, false.
  7067. */
  7068. wasCreatedByUpsampling(): boolean;
  7069. }
  7070. /**
  7071. * Provides tiled terrain using the Google Earth Enterprise REST API.
  7072. * @example
  7073. * var geeMetadata = new GoogleEarthEnterpriseMetadata('http://www.earthenterprise.org/3d');
  7074. * var gee = new Cesium.GoogleEarthEnterpriseTerrainProvider({
  7075. * metadata : geeMetadata
  7076. * });
  7077. * @param options - Object with the following properties:
  7078. * @param options.url - The url of the Google Earth Enterprise server hosting the imagery.
  7079. * @param options.metadata - A metadata object that can be used to share metadata requests with a GoogleEarthEnterpriseImageryProvider.
  7080. * @param [options.ellipsoid] - The ellipsoid. If not specified, the WGS84 ellipsoid is used.
  7081. * @param [options.credit] - A credit for the data source, which is displayed on the canvas.
  7082. */
  7083. export class GoogleEarthEnterpriseTerrainProvider {
  7084. constructor(options: {
  7085. url: Resource | string;
  7086. metadata: GoogleEarthEnterpriseMetadata;
  7087. ellipsoid?: Ellipsoid;
  7088. credit?: Credit | string;
  7089. });
  7090. /**
  7091. * Gets the name of the Google Earth Enterprise server url hosting the imagery.
  7092. */
  7093. readonly url: string;
  7094. /**
  7095. * Gets the proxy used by this provider.
  7096. */
  7097. readonly proxy: Proxy;
  7098. /**
  7099. * Gets the tiling scheme used by this provider. This function should
  7100. * not be called before {@link GoogleEarthEnterpriseTerrainProvider#ready} returns true.
  7101. */
  7102. readonly tilingScheme: TilingScheme;
  7103. /**
  7104. * Gets an event that is raised when the imagery provider encounters an asynchronous error. By subscribing
  7105. * to the event, you will be notified of the error and can potentially recover from it. Event listeners
  7106. * are passed an instance of {@link TileProviderError}.
  7107. */
  7108. readonly errorEvent: Event;
  7109. /**
  7110. * Gets a value indicating whether or not the provider is ready for use.
  7111. */
  7112. readonly ready: boolean;
  7113. /**
  7114. * Gets a promise that resolves to true when the provider is ready for use.
  7115. */
  7116. readonly readyPromise: Promise<boolean>;
  7117. /**
  7118. * Gets the credit to display when this terrain provider is active. Typically this is used to credit
  7119. * the source of the terrain. This function should not be called before {@link GoogleEarthEnterpriseTerrainProvider#ready} returns true.
  7120. */
  7121. readonly credit: Credit;
  7122. /**
  7123. * Gets a value indicating whether or not the provider includes a water mask. The water mask
  7124. * indicates which areas of the globe are water rather than land, so they can be rendered
  7125. * as a reflective surface with animated waves. This function should not be
  7126. * called before {@link GoogleEarthEnterpriseTerrainProvider#ready} returns true.
  7127. */
  7128. hasWaterMask: boolean;
  7129. /**
  7130. * Gets a value indicating whether or not the requested tiles include vertex normals.
  7131. * This function should not be called before {@link GoogleEarthEnterpriseTerrainProvider#ready} returns true.
  7132. */
  7133. hasVertexNormals: boolean;
  7134. /**
  7135. * Gets an object that can be used to determine availability of terrain from this provider, such as
  7136. * at points and in rectangles. This function should not be called before
  7137. * {@link GoogleEarthEnterpriseTerrainProvider#ready} returns true. This property may be undefined if availability
  7138. * information is not available.
  7139. */
  7140. availability: TileAvailability;
  7141. /**
  7142. * Requests the geometry for a given tile. This function should not be called before
  7143. * {@link GoogleEarthEnterpriseTerrainProvider#ready} returns true. The result must include terrain data and
  7144. * may optionally include a water mask and an indication of which child tiles are available.
  7145. * @param x - The X coordinate of the tile for which to request geometry.
  7146. * @param y - The Y coordinate of the tile for which to request geometry.
  7147. * @param level - The level of the tile for which to request geometry.
  7148. * @param [request] - The request object. Intended for internal use only.
  7149. * @returns A promise for the requested geometry. If this method
  7150. * returns undefined instead of a promise, it is an indication that too many requests are already
  7151. * pending and the request will be retried later.
  7152. */
  7153. requestTileGeometry(x: number, y: number, level: number, request?: Request): Promise<TerrainData> | undefined;
  7154. /**
  7155. * Gets the maximum geometric error allowed in a tile at a given level.
  7156. * @param level - The tile level for which to get the maximum geometric error.
  7157. * @returns The maximum geometric error.
  7158. */
  7159. getLevelMaximumGeometricError(level: number): number;
  7160. /**
  7161. * Determines whether data for a tile is available to be loaded.
  7162. * @param x - The X coordinate of the tile for which to request geometry.
  7163. * @param y - The Y coordinate of the tile for which to request geometry.
  7164. * @param level - The level of the tile for which to request geometry.
  7165. * @returns Undefined if not supported, otherwise true or false.
  7166. */
  7167. getTileDataAvailable(x: number, y: number, level: number): boolean;
  7168. /**
  7169. * Makes sure we load availability data for a tile
  7170. * @param x - The X coordinate of the tile for which to request geometry.
  7171. * @param y - The Y coordinate of the tile for which to request geometry.
  7172. * @param level - The level of the tile for which to request geometry.
  7173. * @returns Undefined if nothing need to be loaded or a Promise that resolves when all required tiles are loaded
  7174. */
  7175. loadTileDataAvailability(x: number, y: number, level: number): undefined | Promise<void>;
  7176. }
  7177. /**
  7178. * Represents a Gregorian date in a more precise format than the JavaScript Date object.
  7179. * In addition to submillisecond precision, this object can also represent leap seconds.
  7180. * @param [year] - The year as a whole number.
  7181. * @param [month] - The month as a whole number with range [1, 12].
  7182. * @param [day] - The day of the month as a whole number starting at 1.
  7183. * @param [hour] - The hour as a whole number with range [0, 23].
  7184. * @param [minute] - The minute of the hour as a whole number with range [0, 59].
  7185. * @param [second] - The second of the minute as a whole number with range [0, 60], with 60 representing a leap second.
  7186. * @param [millisecond] - The millisecond of the second as a floating point number with range [0.0, 1000.0).
  7187. * @param [isLeapSecond] - Whether this time is during a leap second.
  7188. */
  7189. export class GregorianDate {
  7190. constructor(year?: number, month?: number, day?: number, hour?: number, minute?: number, second?: number, millisecond?: number, isLeapSecond?: boolean);
  7191. /**
  7192. * Gets or sets the year as a whole number.
  7193. */
  7194. year: number;
  7195. /**
  7196. * Gets or sets the month as a whole number with range [1, 12].
  7197. */
  7198. month: number;
  7199. /**
  7200. * Gets or sets the day of the month as a whole number starting at 1.
  7201. */
  7202. day: number;
  7203. /**
  7204. * Gets or sets the hour as a whole number with range [0, 23].
  7205. */
  7206. hour: number;
  7207. /**
  7208. * Gets or sets the minute of the hour as a whole number with range [0, 59].
  7209. */
  7210. minute: number;
  7211. /**
  7212. * Gets or sets the second of the minute as a whole number with range [0, 60], with 60 representing a leap second.
  7213. */
  7214. second: number;
  7215. /**
  7216. * Gets or sets the millisecond of the second as a floating point number with range [0.0, 1000.0).
  7217. */
  7218. millisecond: number;
  7219. /**
  7220. * Gets or sets whether this time is during a leap second.
  7221. */
  7222. isLeapSecond: boolean;
  7223. }
  7224. /**
  7225. * A description of a polyline on terrain or 3D Tiles. Only to be used with {@link GroundPolylinePrimitive}.
  7226. * @example
  7227. * var positions = Cesium.Cartesian3.fromDegreesArray([
  7228. * -112.1340164450331, 36.05494287836128,
  7229. * -112.08821010582645, 36.097804071380715,
  7230. * -112.13296079730024, 36.168769146801104
  7231. * ]);
  7232. *
  7233. * var geometry = new Cesium.GroundPolylineGeometry({
  7234. * positions : positions
  7235. * });
  7236. * @param options - Options with the following properties:
  7237. * @param options.positions - An array of {@link Cartesian3} defining the polyline's points. Heights above the ellipsoid will be ignored.
  7238. * @param [options.width = 1.0] - The screen space width in pixels.
  7239. * @param [options.granularity = 9999.0] - The distance interval in meters used for interpolating options.points. Defaults to 9999.0 meters. Zero indicates no interpolation.
  7240. * @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.
  7241. * @param [options.arcType = ArcType.GEODESIC] - The type of line the polyline segments must follow. Valid options are {@link ArcType.GEODESIC} and {@link ArcType.RHUMB}.
  7242. */
  7243. export class GroundPolylineGeometry {
  7244. constructor(options: {
  7245. positions: Cartesian3[];
  7246. width?: number;
  7247. granularity?: number;
  7248. loop?: boolean;
  7249. arcType?: ArcType;
  7250. });
  7251. /**
  7252. * The screen space width in pixels.
  7253. */
  7254. width: number;
  7255. /**
  7256. * The distance interval used for interpolating options.points. Zero indicates no interpolation.
  7257. * Default of 9999.0 allows centimeter accuracy with 32 bit floating point.
  7258. */
  7259. granularity: boolean;
  7260. /**
  7261. * Whether during geometry creation a line segment will be added between the last and first line positions to make this Polyline a loop.
  7262. * If the geometry has two positions this parameter will be ignored.
  7263. */
  7264. loop: boolean;
  7265. /**
  7266. * The type of path the polyline must follow. Valid options are {@link ArcType.GEODESIC} and {@link ArcType.RHUMB}.
  7267. */
  7268. arcType: ArcType;
  7269. /**
  7270. * Stores the provided instance into the provided array.
  7271. * @param value - The value to pack.
  7272. * @param array - The array to pack into.
  7273. * @param [startingIndex = 0] - The index into the array at which to start packing the elements.
  7274. * @returns The array that was packed into
  7275. */
  7276. static pack(value: PolygonGeometry, array: number[], startingIndex?: number): number[];
  7277. /**
  7278. * Retrieves an instance from a packed array.
  7279. * @param array - The packed array.
  7280. * @param [startingIndex = 0] - The starting index of the element to be unpacked.
  7281. * @param [result] - The object into which to store the result.
  7282. */
  7283. static unpack(array: number[], startingIndex?: number, result?: PolygonGeometry): void;
  7284. }
  7285. /**
  7286. * Defines a heading angle, pitch angle, and range in a local frame.
  7287. * Heading is the rotation from the local north direction where a positive angle is increasing eastward.
  7288. * Pitch is the rotation from the local xy-plane. Positive pitch angles are above the plane. Negative pitch
  7289. * angles are below the plane. Range is the distance from the center of the frame.
  7290. * @param [heading = 0.0] - The heading angle in radians.
  7291. * @param [pitch = 0.0] - The pitch angle in radians.
  7292. * @param [range = 0.0] - The distance from the center in meters.
  7293. */
  7294. export class HeadingPitchRange {
  7295. constructor(heading?: number, pitch?: number, range?: number);
  7296. /**
  7297. * Heading is the rotation from the local north direction where a positive angle is increasing eastward.
  7298. */
  7299. heading: number;
  7300. /**
  7301. * Pitch is the rotation from the local xy-plane. Positive pitch angles
  7302. * are above the plane. Negative pitch angles are below the plane.
  7303. */
  7304. pitch: number;
  7305. /**
  7306. * Range is the distance from the center of the local frame.
  7307. */
  7308. range: number;
  7309. /**
  7310. * Duplicates a HeadingPitchRange instance.
  7311. * @param hpr - The HeadingPitchRange to duplicate.
  7312. * @param [result] - The object onto which to store the result.
  7313. * @returns The modified result parameter or a new HeadingPitchRange instance if one was not provided. (Returns undefined if hpr is undefined)
  7314. */
  7315. static clone(hpr: HeadingPitchRange, result?: HeadingPitchRange): HeadingPitchRange;
  7316. }
  7317. /**
  7318. * A rotation expressed as a heading, pitch, and roll. Heading is the rotation about the
  7319. * negative z axis. Pitch is the rotation about the negative y axis. Roll is the rotation about
  7320. * the positive x axis.
  7321. * @param [heading = 0.0] - The heading component in radians.
  7322. * @param [pitch = 0.0] - The pitch component in radians.
  7323. * @param [roll = 0.0] - The roll component in radians.
  7324. */
  7325. export class HeadingPitchRoll {
  7326. constructor(heading?: number, pitch?: number, roll?: number);
  7327. /**
  7328. * Gets or sets the heading.
  7329. */
  7330. heading: number;
  7331. /**
  7332. * Gets or sets the pitch.
  7333. */
  7334. pitch: number;
  7335. /**
  7336. * Gets or sets the roll.
  7337. */
  7338. roll: number;
  7339. /**
  7340. * Computes the heading, pitch and roll from a quaternion (see http://en.wikipedia.org/wiki/Conversion_between_quaternions_and_Euler_angles )
  7341. * @param quaternion - The quaternion from which to retrieve heading, pitch, and roll, all expressed in radians.
  7342. * @param [result] - The object in which to store the result. If not provided, a new instance is created and returned.
  7343. * @returns The modified result parameter or a new HeadingPitchRoll instance if one was not provided.
  7344. */
  7345. static fromQuaternion(quaternion: Quaternion, result?: HeadingPitchRoll): HeadingPitchRoll;
  7346. /**
  7347. * Returns a new HeadingPitchRoll instance from angles given in degrees.
  7348. * @param heading - the heading in degrees
  7349. * @param pitch - the pitch in degrees
  7350. * @param roll - the heading in degrees
  7351. * @param [result] - The object in which to store the result. If not provided, a new instance is created and returned.
  7352. * @returns A new HeadingPitchRoll instance
  7353. */
  7354. static fromDegrees(heading: number, pitch: number, roll: number, result?: HeadingPitchRoll): HeadingPitchRoll;
  7355. /**
  7356. * Duplicates a HeadingPitchRoll instance.
  7357. * @param headingPitchRoll - The HeadingPitchRoll to duplicate.
  7358. * @param [result] - The object onto which to store the result.
  7359. * @returns The modified result parameter or a new HeadingPitchRoll instance if one was not provided. (Returns undefined if headingPitchRoll is undefined)
  7360. */
  7361. static clone(headingPitchRoll: HeadingPitchRoll, result?: HeadingPitchRoll): HeadingPitchRoll;
  7362. /**
  7363. * Compares the provided HeadingPitchRolls componentwise and returns
  7364. * <code>true</code> if they are equal, <code>false</code> otherwise.
  7365. * @param [left] - The first HeadingPitchRoll.
  7366. * @param [right] - The second HeadingPitchRoll.
  7367. * @returns <code>true</code> if left and right are equal, <code>false</code> otherwise.
  7368. */
  7369. static equals(left?: HeadingPitchRoll, right?: HeadingPitchRoll): boolean;
  7370. /**
  7371. * Compares the provided HeadingPitchRolls componentwise and returns
  7372. * <code>true</code> if they pass an absolute or relative tolerance test,
  7373. * <code>false</code> otherwise.
  7374. * @param [left] - The first HeadingPitchRoll.
  7375. * @param [right] - The second HeadingPitchRoll.
  7376. * @param [relativeEpsilon = 0] - The relative epsilon tolerance to use for equality testing.
  7377. * @param [absoluteEpsilon = relativeEpsilon] - The absolute epsilon tolerance to use for equality testing.
  7378. * @returns <code>true</code> if left and right are within the provided epsilon, <code>false</code> otherwise.
  7379. */
  7380. static equalsEpsilon(left?: HeadingPitchRoll, right?: HeadingPitchRoll, relativeEpsilon?: number, absoluteEpsilon?: number): boolean;
  7381. /**
  7382. * Duplicates this HeadingPitchRoll instance.
  7383. * @param [result] - The object onto which to store the result.
  7384. * @returns The modified result parameter or a new HeadingPitchRoll instance if one was not provided.
  7385. */
  7386. clone(result?: HeadingPitchRoll): HeadingPitchRoll;
  7387. /**
  7388. * Compares this HeadingPitchRoll against the provided HeadingPitchRoll componentwise and returns
  7389. * <code>true</code> if they are equal, <code>false</code> otherwise.
  7390. * @param [right] - The right hand side HeadingPitchRoll.
  7391. * @returns <code>true</code> if they are equal, <code>false</code> otherwise.
  7392. */
  7393. equals(right?: HeadingPitchRoll): boolean;
  7394. /**
  7395. * Compares this HeadingPitchRoll against the provided HeadingPitchRoll componentwise and returns
  7396. * <code>true</code> if they pass an absolute or relative tolerance test,
  7397. * <code>false</code> otherwise.
  7398. * @param [right] - The right hand side HeadingPitchRoll.
  7399. * @param [relativeEpsilon = 0] - The relative epsilon tolerance to use for equality testing.
  7400. * @param [absoluteEpsilon = relativeEpsilon] - The absolute epsilon tolerance to use for equality testing.
  7401. * @returns <code>true</code> if they are within the provided epsilon, <code>false</code> otherwise.
  7402. */
  7403. equalsEpsilon(right?: HeadingPitchRoll, relativeEpsilon?: number, absoluteEpsilon?: number): boolean;
  7404. /**
  7405. * Creates a string representing this HeadingPitchRoll in the format '(heading, pitch, roll)' in radians.
  7406. * @returns A string representing the provided HeadingPitchRoll in the format '(heading, pitch, roll)'.
  7407. */
  7408. toString(): string;
  7409. }
  7410. /**
  7411. * The encoding that is used for a heightmap
  7412. */
  7413. export enum HeightmapEncoding {
  7414. /**
  7415. * No encoding
  7416. */
  7417. NONE = 0,
  7418. /**
  7419. * LERC encoding
  7420. */
  7421. LERC = 1
  7422. }
  7423. /**
  7424. * Terrain data for a single tile where the terrain data is represented as a heightmap. A heightmap
  7425. * is a rectangular array of heights in row-major order from north to south and west to east.
  7426. * @example
  7427. * var buffer = ...
  7428. * var heightBuffer = new Uint16Array(buffer, 0, that._heightmapWidth * that._heightmapWidth);
  7429. * var childTileMask = new Uint8Array(buffer, heightBuffer.byteLength, 1)[0];
  7430. * var waterMask = new Uint8Array(buffer, heightBuffer.byteLength + 1, buffer.byteLength - heightBuffer.byteLength - 1);
  7431. * var terrainData = new Cesium.HeightmapTerrainData({
  7432. * buffer : heightBuffer,
  7433. * width : 65,
  7434. * height : 65,
  7435. * childTileMask : childTileMask,
  7436. * waterMask : waterMask
  7437. * });
  7438. * @param options - Object with the following properties:
  7439. * @param options.buffer - The buffer containing height data.
  7440. * @param options.width - The width (longitude direction) of the heightmap, in samples.
  7441. * @param options.height - The height (latitude direction) of the heightmap, in samples.
  7442. * @param [options.childTileMask = 15] - A bit mask indicating which of this tile's four children exist.
  7443. * If a child's bit is set, geometry will be requested for that tile as well when it
  7444. * is needed. If the bit is cleared, the child tile is not requested and geometry is
  7445. * instead upsampled from the parent. The bit values are as follows:
  7446. * <table>
  7447. * <tr><th>Bit Position</th><th>Bit Value</th><th>Child Tile</th></tr>
  7448. * <tr><td>0</td><td>1</td><td>Southwest</td></tr>
  7449. * <tr><td>1</td><td>2</td><td>Southeast</td></tr>
  7450. * <tr><td>2</td><td>4</td><td>Northwest</td></tr>
  7451. * <tr><td>3</td><td>8</td><td>Northeast</td></tr>
  7452. * </table>
  7453. * @param [options.waterMask] - The water mask included in this terrain data, if any. A water mask is a square
  7454. * Uint8Array or image where a value of 255 indicates water and a value of 0 indicates land.
  7455. * Values in between 0 and 255 are allowed as well to smoothly blend between land and water.
  7456. * @param [options.structure] - An object describing the structure of the height data.
  7457. * @param [options.structure.heightScale = 1.0] - The factor by which to multiply height samples in order to obtain
  7458. * the height above the heightOffset, in meters. The heightOffset is added to the resulting
  7459. * height after multiplying by the scale.
  7460. * @param [options.structure.heightOffset = 0.0] - The offset to add to the scaled height to obtain the final
  7461. * height in meters. The offset is added after the height sample is multiplied by the
  7462. * heightScale.
  7463. * @param [options.structure.elementsPerHeight = 1] - The number of elements in the buffer that make up a single height
  7464. * sample. This is usually 1, indicating that each element is a separate height sample. If
  7465. * it is greater than 1, that number of elements together form the height sample, which is
  7466. * computed according to the structure.elementMultiplier and structure.isBigEndian properties.
  7467. * @param [options.structure.stride = 1] - The number of elements to skip to get from the first element of
  7468. * one height to the first element of the next height.
  7469. * @param [options.structure.elementMultiplier = 256.0] - The multiplier used to compute the height value when the
  7470. * stride property is greater than 1. For example, if the stride is 4 and the strideMultiplier
  7471. * is 256, the height is computed as follows:
  7472. * `height = buffer[index] + buffer[index + 1] * 256 + buffer[index + 2] * 256 * 256 + buffer[index + 3] * 256 * 256 * 256`
  7473. * This is assuming that the isBigEndian property is false. If it is true, the order of the
  7474. * elements is reversed.
  7475. * @param [options.structure.isBigEndian = false] - Indicates endianness of the elements in the buffer when the
  7476. * stride property is greater than 1. If this property is false, the first element is the
  7477. * low-order element. If it is true, the first element is the high-order element.
  7478. * @param [options.structure.lowestEncodedHeight] - The lowest value that can be stored in the height buffer. Any heights that are lower
  7479. * than this value after encoding with the `heightScale` and `heightOffset` are clamped to this value. For example, if the height
  7480. * buffer is a `Uint16Array`, this value should be 0 because a `Uint16Array` cannot store negative numbers. If this parameter is
  7481. * not specified, no minimum value is enforced.
  7482. * @param [options.structure.highestEncodedHeight] - The highest value that can be stored in the height buffer. Any heights that are higher
  7483. * than this value after encoding with the `heightScale` and `heightOffset` are clamped to this value. For example, if the height
  7484. * buffer is a `Uint16Array`, this value should be `256 * 256 - 1` or 65535 because a `Uint16Array` cannot store numbers larger
  7485. * than 65535. If this parameter is not specified, no maximum value is enforced.
  7486. * @param [options.encoding = HeightmapEncoding.NONE] - The encoding that is used on the buffer.
  7487. * @param [options.createdByUpsampling = false] - True if this instance was created by upsampling another instance;
  7488. * otherwise, false.
  7489. */
  7490. export class HeightmapTerrainData {
  7491. constructor(options: {
  7492. buffer: Int8Array | Uint8Array | Int16Array | Uint16Array | Int32Array | Uint32Array | Float32Array | Float64Array;
  7493. width: number;
  7494. height: number;
  7495. childTileMask?: number;
  7496. waterMask?: Uint8Array;
  7497. structure?: {
  7498. heightScale?: number;
  7499. heightOffset?: number;
  7500. elementsPerHeight?: number;
  7501. stride?: number;
  7502. elementMultiplier?: number;
  7503. isBigEndian?: boolean;
  7504. lowestEncodedHeight?: number;
  7505. highestEncodedHeight?: number;
  7506. };
  7507. encoding?: HeightmapEncoding;
  7508. createdByUpsampling?: boolean;
  7509. });
  7510. /**
  7511. * An array of credits for this tile.
  7512. */
  7513. credits: Credit[];
  7514. /**
  7515. * The water mask included in this terrain data, if any. A water mask is a square
  7516. * Uint8Array or image where a value of 255 indicates water and a value of 0 indicates land.
  7517. * Values in between 0 and 255 are allowed as well to smoothly blend between land and water.
  7518. */
  7519. waterMask: Uint8Array | HTMLImageElement | HTMLCanvasElement;
  7520. /**
  7521. * Computes the terrain height at a specified longitude and latitude.
  7522. * @param rectangle - The rectangle covered by this terrain data.
  7523. * @param longitude - The longitude in radians.
  7524. * @param latitude - The latitude in radians.
  7525. * @returns The terrain height at the specified position. If the position
  7526. * is outside the rectangle, this method will extrapolate the height, which is likely to be wildly
  7527. * incorrect for positions far outside the rectangle.
  7528. */
  7529. interpolateHeight(rectangle: Rectangle, longitude: number, latitude: number): number;
  7530. /**
  7531. * Upsamples this terrain data for use by a descendant tile. The resulting instance will contain a subset of the
  7532. * height samples in this instance, interpolated if necessary.
  7533. * @param tilingScheme - The tiling scheme of this terrain data.
  7534. * @param thisX - The X coordinate of this tile in the tiling scheme.
  7535. * @param thisY - The Y coordinate of this tile in the tiling scheme.
  7536. * @param thisLevel - The level of this tile in the tiling scheme.
  7537. * @param descendantX - The X coordinate within the tiling scheme of the descendant tile for which we are upsampling.
  7538. * @param descendantY - The Y coordinate within the tiling scheme of the descendant tile for which we are upsampling.
  7539. * @param descendantLevel - The level within the tiling scheme of the descendant tile for which we are upsampling.
  7540. * @returns A promise for upsampled heightmap terrain data for the descendant tile,
  7541. * or undefined if too many asynchronous upsample operations are in progress and the request has been
  7542. * deferred.
  7543. */
  7544. upsample(tilingScheme: TilingScheme, thisX: number, thisY: number, thisLevel: number, descendantX: number, descendantY: number, descendantLevel: number): Promise<HeightmapTerrainData> | undefined;
  7545. /**
  7546. * Determines if a given child tile is available, based on the
  7547. * {@link HeightmapTerrainData.childTileMask}. The given child tile coordinates are assumed
  7548. * to be one of the four children of this tile. If non-child tile coordinates are
  7549. * given, the availability of the southeast child tile is returned.
  7550. * @param thisX - The tile X coordinate of this (the parent) tile.
  7551. * @param thisY - The tile Y coordinate of this (the parent) tile.
  7552. * @param childX - The tile X coordinate of the child tile to check for availability.
  7553. * @param childY - The tile Y coordinate of the child tile to check for availability.
  7554. * @returns True if the child tile is available; otherwise, false.
  7555. */
  7556. isChildAvailable(thisX: number, thisY: number, childX: number, childY: number): boolean;
  7557. /**
  7558. * Gets a value indicating whether or not this terrain data was created by upsampling lower resolution
  7559. * terrain data. If this value is false, the data was obtained from some other source, such
  7560. * as by downloading it from a remote server. This method should return true for instances
  7561. * returned from a call to {@link HeightmapTerrainData#upsample}.
  7562. * @returns True if this instance was created by upsampling; otherwise, false.
  7563. */
  7564. wasCreatedByUpsampling(): boolean;
  7565. }
  7566. /**
  7567. * An {@link InterpolationAlgorithm} for performing Hermite interpolation.
  7568. */
  7569. export namespace HermitePolynomialApproximation {
  7570. /**
  7571. * Given the desired degree, returns the number of data points required for interpolation.
  7572. * @param degree - The desired degree of interpolation.
  7573. * @param [inputOrder = 0] - The order of the inputs (0 means just the data, 1 means the data and its derivative, etc).
  7574. * @returns The number of required data points needed for the desired degree of interpolation.
  7575. */
  7576. function getRequiredDataPoints(degree: number, inputOrder?: number): number;
  7577. /**
  7578. * Interpolates values using Hermite Polynomial Approximation.
  7579. * @param x - The independent variable for which the dependent variables will be interpolated.
  7580. * @param xTable - The array of independent variables to use to interpolate. The values
  7581. * in this array must be in increasing order and the same value must not occur twice in the array.
  7582. * @param yTable - The array of dependent variables to use to interpolate. For a set of three
  7583. * dependent values (p,q,w) at time 1 and time 2 this should be as follows: {p1, q1, w1, p2, q2, w2}.
  7584. * @param yStride - The number of dependent variable values in yTable corresponding to
  7585. * each independent variable value in xTable.
  7586. * @param [result] - An existing array into which to store the result.
  7587. * @returns The array of interpolated values, or the result parameter if one was provided.
  7588. */
  7589. function interpolateOrderZero(x: number, xTable: number[], yTable: number[], yStride: number, result?: number[]): number[];
  7590. /**
  7591. * Interpolates values using Hermite Polynomial Approximation.
  7592. * @param x - The independent variable for which the dependent variables will be interpolated.
  7593. * @param xTable - The array of independent variables to use to interpolate. The values
  7594. * in this array must be in increasing order and the same value must not occur twice in the array.
  7595. * @param yTable - The array of dependent variables to use to interpolate. For a set of three
  7596. * dependent values (p,q,w) at time 1 and time 2 this should be as follows: {p1, q1, w1, p2, q2, w2}.
  7597. * @param yStride - The number of dependent variable values in yTable corresponding to
  7598. * each independent variable value in xTable.
  7599. * @param inputOrder - The number of derivatives supplied for input.
  7600. * @param outputOrder - The number of derivatives desired for output.
  7601. * @param [result] - An existing array into which to store the result.
  7602. * @returns The array of interpolated values, or the result parameter if one was provided.
  7603. */
  7604. function interpolate(x: number, xTable: number[], yTable: number[], yStride: number, inputOrder: number, outputOrder: number, result?: number[]): number[];
  7605. }
  7606. /**
  7607. * A Hermite spline is a cubic interpolating spline. Points, incoming tangents, outgoing tangents, and times
  7608. * must be defined for each control point. The outgoing tangents are defined for points [0, n - 2] and the incoming
  7609. * tangents are defined for points [1, n - 1]. For example, when interpolating a segment of the curve between <code>points[i]</code> and
  7610. * <code>points[i + 1]</code>, the tangents at the points will be <code>outTangents[i]</code> and <code>inTangents[i]</code>,
  7611. * respectively.
  7612. * @example
  7613. * // Create a G<sup>1</sup> continuous Hermite spline
  7614. * var times = [ 0.0, 1.5, 3.0, 4.5, 6.0 ];
  7615. * var spline = new Cesium.HermiteSpline({
  7616. * times : times,
  7617. * points : [
  7618. * new Cesium.Cartesian3(1235398.0, -4810983.0, 4146266.0),
  7619. * new Cesium.Cartesian3(1372574.0, -5345182.0, 4606657.0),
  7620. * new Cesium.Cartesian3(-757983.0, -5542796.0, 4514323.0),
  7621. * new Cesium.Cartesian3(-2821260.0, -5248423.0, 4021290.0),
  7622. * new Cesium.Cartesian3(-2539788.0, -4724797.0, 3620093.0)
  7623. * ],
  7624. * outTangents : [
  7625. * new Cesium.Cartesian3(1125196, -161816, 270551),
  7626. * new Cesium.Cartesian3(-996690.5, -365906.5, 184028.5),
  7627. * new Cesium.Cartesian3(-2096917, 48379.5, -292683.5),
  7628. * new Cesium.Cartesian3(-890902.5, 408999.5, -447115)
  7629. * ],
  7630. * inTangents : [
  7631. * new Cesium.Cartesian3(-1993381, -731813, 368057),
  7632. * new Cesium.Cartesian3(-4193834, 96759, -585367),
  7633. * new Cesium.Cartesian3(-1781805, 817999, -894230),
  7634. * new Cesium.Cartesian3(1165345, 112641, 47281)
  7635. * ]
  7636. * });
  7637. *
  7638. * var p0 = spline.evaluate(times[0]);
  7639. * @param options - Object with the following properties:
  7640. * @param options.times - An array of strictly increasing, unit-less, floating-point times at each point.
  7641. * The values are in no way connected to the clock time. They are the parameterization for the curve.
  7642. * @param options.points - The array of {@link Cartesian3} control points.
  7643. * @param options.inTangents - The array of {@link Cartesian3} incoming tangents at each control point.
  7644. * @param options.outTangents - The array of {@link Cartesian3} outgoing tangents at each control point.
  7645. */
  7646. export class HermiteSpline {
  7647. constructor(options: {
  7648. times: number[];
  7649. points: Cartesian3[];
  7650. inTangents: Cartesian3[];
  7651. outTangents: Cartesian3[];
  7652. });
  7653. /**
  7654. * An array of times for the control points.
  7655. */
  7656. readonly times: number[];
  7657. /**
  7658. * An array of {@link Cartesian3} control points.
  7659. */
  7660. readonly points: Cartesian3[];
  7661. /**
  7662. * An array of {@link Cartesian3} incoming tangents at each control point.
  7663. */
  7664. readonly inTangents: Cartesian3[];
  7665. /**
  7666. * An array of {@link Cartesian3} outgoing tangents at each control point.
  7667. */
  7668. readonly outTangents: Cartesian3[];
  7669. /**
  7670. * Creates a spline where the tangents at each control point are the same.
  7671. * The curves are guaranteed to be at least in the class C<sup>1</sup>.
  7672. * @example
  7673. * var points = [
  7674. * new Cesium.Cartesian3(1235398.0, -4810983.0, 4146266.0),
  7675. * new Cesium.Cartesian3(1372574.0, -5345182.0, 4606657.0),
  7676. * new Cesium.Cartesian3(-757983.0, -5542796.0, 4514323.0),
  7677. * new Cesium.Cartesian3(-2821260.0, -5248423.0, 4021290.0),
  7678. * new Cesium.Cartesian3(-2539788.0, -4724797.0, 3620093.0)
  7679. * ];
  7680. *
  7681. * // Add tangents
  7682. * var tangents = new Array(points.length);
  7683. * tangents[0] = new Cesium.Cartesian3(1125196, -161816, 270551);
  7684. * var temp = new Cesium.Cartesian3();
  7685. * for (var i = 1; i < tangents.length - 1; ++i) {
  7686. * tangents[i] = Cesium.Cartesian3.multiplyByScalar(Cesium.Cartesian3.subtract(points[i + 1], points[i - 1], temp), 0.5, new Cesium.Cartesian3());
  7687. * }
  7688. * tangents[tangents.length - 1] = new Cesium.Cartesian3(1165345, 112641, 47281);
  7689. *
  7690. * var spline = Cesium.HermiteSpline.createC1({
  7691. * times : times,
  7692. * points : points,
  7693. * tangents : tangents
  7694. * });
  7695. * @param options - Object with the following properties:
  7696. * @param options.times - The array of control point times.
  7697. * @param options.points - The array of control points.
  7698. * @param options.tangents - The array of tangents at the control points.
  7699. * @returns A hermite spline.
  7700. */
  7701. static createC1(options: {
  7702. times: number[];
  7703. points: Cartesian3[];
  7704. tangents: Cartesian3[];
  7705. }): HermiteSpline;
  7706. /**
  7707. * Creates a natural cubic spline. The tangents at the control points are generated
  7708. * to create a curve in the class C<sup>2</sup>.
  7709. * @example
  7710. * // Create a natural cubic spline above the earth from Philadelphia to Los Angeles.
  7711. * var spline = Cesium.HermiteSpline.createNaturalCubic({
  7712. * times : [ 0.0, 1.5, 3.0, 4.5, 6.0 ],
  7713. * points : [
  7714. * new Cesium.Cartesian3(1235398.0, -4810983.0, 4146266.0),
  7715. * new Cesium.Cartesian3(1372574.0, -5345182.0, 4606657.0),
  7716. * new Cesium.Cartesian3(-757983.0, -5542796.0, 4514323.0),
  7717. * new Cesium.Cartesian3(-2821260.0, -5248423.0, 4021290.0),
  7718. * new Cesium.Cartesian3(-2539788.0, -4724797.0, 3620093.0)
  7719. * ]
  7720. * });
  7721. * @param options - Object with the following properties:
  7722. * @param options.times - The array of control point times.
  7723. * @param options.points - The array of control points.
  7724. * @returns A hermite spline or a linear spline if less than 3 control points were given.
  7725. */
  7726. static createNaturalCubic(options: {
  7727. times: number[];
  7728. points: Cartesian3[];
  7729. }): HermiteSpline | LinearSpline;
  7730. /**
  7731. * Creates a clamped cubic spline. The tangents at the interior control points are generated
  7732. * to create a curve in the class C<sup>2</sup>.
  7733. * @example
  7734. * // Create a clamped cubic spline above the earth from Philadelphia to Los Angeles.
  7735. * var spline = Cesium.HermiteSpline.createClampedCubic({
  7736. * times : [ 0.0, 1.5, 3.0, 4.5, 6.0 ],
  7737. * points : [
  7738. * new Cesium.Cartesian3(1235398.0, -4810983.0, 4146266.0),
  7739. * new Cesium.Cartesian3(1372574.0, -5345182.0, 4606657.0),
  7740. * new Cesium.Cartesian3(-757983.0, -5542796.0, 4514323.0),
  7741. * new Cesium.Cartesian3(-2821260.0, -5248423.0, 4021290.0),
  7742. * new Cesium.Cartesian3(-2539788.0, -4724797.0, 3620093.0)
  7743. * ],
  7744. * firstTangent : new Cesium.Cartesian3(1125196, -161816, 270551),
  7745. * lastTangent : new Cesium.Cartesian3(1165345, 112641, 47281)
  7746. * });
  7747. * @param options - Object with the following properties:
  7748. * @param options.times - The array of control point times.
  7749. * @param options.points - The array of control points.
  7750. * @param options.firstTangent - The outgoing tangent of the first control point.
  7751. * @param options.lastTangent - The incoming tangent of the last control point.
  7752. * @returns A hermite spline or a linear spline if less than 3 control points were given.
  7753. */
  7754. static createClampedCubic(options: {
  7755. times: number[];
  7756. points: Cartesian3[];
  7757. firstTangent: Cartesian3;
  7758. lastTangent: Cartesian3;
  7759. }): HermiteSpline | LinearSpline;
  7760. /**
  7761. * Finds an index <code>i</code> in <code>times</code> such that the parameter
  7762. * <code>time</code> is in the interval <code>[times[i], times[i + 1]]</code>.
  7763. * @param time - The time.
  7764. * @returns The index for the element at the start of the interval.
  7765. */
  7766. findTimeInterval(time: number): number;
  7767. /**
  7768. * Wraps the given time to the period covered by the spline.
  7769. * @param time - The time.
  7770. * @returns The time, wrapped around to the updated animation.
  7771. */
  7772. wrapTime(time: number): number;
  7773. /**
  7774. * Clamps the given time to the period covered by the spline.
  7775. * @param time - The time.
  7776. * @returns The time, clamped to the animation period.
  7777. */
  7778. clampTime(time: number): number;
  7779. /**
  7780. * Evaluates the curve at a given time.
  7781. * @param time - The time at which to evaluate the curve.
  7782. * @param [result] - The object onto which to store the result.
  7783. * @returns The modified result parameter or a new instance of the point on the curve at the given time.
  7784. */
  7785. evaluate(time: number, result?: Cartesian3): Cartesian3;
  7786. }
  7787. /**
  7788. * Constants for WebGL index datatypes. These corresponds to the
  7789. * <code>type</code> parameter of {@link http://www.khronos.org/opengles/sdk/docs/man/xhtml/glDrawElements.xml|drawElements}.
  7790. */
  7791. export enum IndexDatatype {
  7792. /**
  7793. * 8-bit unsigned byte corresponding to <code>UNSIGNED_BYTE</code> and the type
  7794. * of an element in <code>Uint8Array</code>.
  7795. */
  7796. UNSIGNED_BYTE = WebGLConstants.UNSIGNED_BYTE,
  7797. /**
  7798. * 16-bit unsigned short corresponding to <code>UNSIGNED_SHORT</code> and the type
  7799. * of an element in <code>Uint16Array</code>.
  7800. */
  7801. UNSIGNED_SHORT = WebGLConstants.UNSIGNED_SHORT,
  7802. /**
  7803. * 32-bit unsigned int corresponding to <code>UNSIGNED_INT</code> and the type
  7804. * of an element in <code>Uint32Array</code>.
  7805. */
  7806. UNSIGNED_INT = WebGLConstants.UNSIGNED_INT
  7807. }
  7808. export namespace InterpolationAlgorithm {
  7809. /**
  7810. * Gets the name of this interpolation algorithm.
  7811. */
  7812. var type: string;
  7813. /**
  7814. * Given the desired degree, returns the number of data points required for interpolation.
  7815. * @param degree - The desired degree of interpolation.
  7816. * @returns The number of required data points needed for the desired degree of interpolation.
  7817. */
  7818. function getRequiredDataPoints(degree: number): number;
  7819. /**
  7820. * Performs zero order interpolation.
  7821. * @param x - The independent variable for which the dependent variables will be interpolated.
  7822. * @param xTable - The array of independent variables to use to interpolate. The values
  7823. * in this array must be in increasing order and the same value must not occur twice in the array.
  7824. * @param yTable - The array of dependent variables to use to interpolate. For a set of three
  7825. * dependent values (p,q,w) at time 1 and time 2 this should be as follows: {p1, q1, w1, p2, q2, w2}.
  7826. * @param yStride - The number of dependent variable values in yTable corresponding to
  7827. * each independent variable value in xTable.
  7828. * @param [result] - An existing array into which to store the result.
  7829. * @returns The array of interpolated values, or the result parameter if one was provided.
  7830. */
  7831. function interpolateOrderZero(x: number, xTable: number[], yTable: number[], yStride: number, result?: number[]): number[];
  7832. /**
  7833. * Performs higher order interpolation. Not all interpolators need to support high-order interpolation,
  7834. * if this function remains undefined on implementing objects, interpolateOrderZero will be used instead.
  7835. * @param x - The independent variable for which the dependent variables will be interpolated.
  7836. * @param xTable - The array of independent variables to use to interpolate. The values
  7837. * in this array must be in increasing order and the same value must not occur twice in the array.
  7838. * @param yTable - The array of dependent variables to use to interpolate. For a set of three
  7839. * dependent values (p,q,w) at time 1 and time 2 this should be as follows: {p1, q1, w1, p2, q2, w2}.
  7840. * @param yStride - The number of dependent variable values in yTable corresponding to
  7841. * each independent variable value in xTable.
  7842. * @param inputOrder - The number of derivatives supplied for input.
  7843. * @param outputOrder - The number of derivatives desired for output.
  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 interpolate(x: number, xTable: number[], yTable: number[], yStride: number, inputOrder: number, outputOrder: number, result?: number[]): number[];
  7848. }
  7849. /**
  7850. * The interface for interpolation algorithms.
  7851. */
  7852. export interface InterpolationAlgorithm {
  7853. }
  7854. /**
  7855. * This enumerated type is used in determining where, relative to the frustum, an
  7856. * object is located. The object can either be fully contained within the frustum (INSIDE),
  7857. * partially inside the frustum and partially outside (INTERSECTING), or somewhere entirely
  7858. * outside of the frustum's 6 planes (OUTSIDE).
  7859. */
  7860. export enum Intersect {
  7861. /**
  7862. * Represents that an object is not contained within the frustum.
  7863. */
  7864. OUTSIDE = -1,
  7865. /**
  7866. * Represents that an object intersects one of the frustum's planes.
  7867. */
  7868. INTERSECTING = 0,
  7869. /**
  7870. * Represents that an object is fully within the frustum.
  7871. */
  7872. INSIDE = 1
  7873. }
  7874. /**
  7875. * Functions for computing the intersection between geometries such as rays, planes, triangles, and ellipsoids.
  7876. */
  7877. export namespace IntersectionTests {
  7878. /**
  7879. * Computes the intersection of a ray and a plane.
  7880. * @param ray - The ray.
  7881. * @param plane - The plane.
  7882. * @param [result] - The object onto which to store the result.
  7883. * @returns The intersection point or undefined if there is no intersections.
  7884. */
  7885. function rayPlane(ray: Ray, plane: Plane, result?: Cartesian3): Cartesian3;
  7886. /**
  7887. * 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.
  7888. *
  7889. * Implements {@link https://cadxfem.org/inf/Fast%20MinimumStorage%20RayTriangle%20Intersection.pdf|
  7890. * Fast Minimum Storage Ray/Triangle Intersection} by Tomas Moller and Ben Trumbore.
  7891. * @param ray - The ray.
  7892. * @param p0 - The first vertex of the triangle.
  7893. * @param p1 - The second vertex of the triangle.
  7894. * @param p2 - The third vertex of the triangle.
  7895. * @param [cullBackFaces = false] - If <code>true</code>, will only compute an intersection with the front face of the triangle
  7896. * and return undefined for intersections with the back face.
  7897. * @returns The intersection as a parametric distance along the ray, or undefined if there is no intersection.
  7898. */
  7899. function rayTriangleParametric(ray: Ray, p0: Cartesian3, p1: Cartesian3, p2: Cartesian3, cullBackFaces?: boolean): number;
  7900. /**
  7901. * Computes the intersection of a ray and a triangle as a Cartesian3 coordinate.
  7902. *
  7903. * Implements {@link https://cadxfem.org/inf/Fast%20MinimumStorage%20RayTriangle%20Intersection.pdf|
  7904. * Fast Minimum Storage Ray/Triangle Intersection} by Tomas Moller and Ben Trumbore.
  7905. * @param ray - The ray.
  7906. * @param p0 - The first vertex of the triangle.
  7907. * @param p1 - The second vertex of the triangle.
  7908. * @param p2 - The third vertex of the triangle.
  7909. * @param [cullBackFaces = false] - If <code>true</code>, will only compute an intersection with the front face of the triangle
  7910. * and return undefined for intersections with the back face.
  7911. * @param [result] - The <code>Cartesian3</code> onto which to store the result.
  7912. * @returns The intersection point or undefined if there is no intersections.
  7913. */
  7914. function rayTriangle(ray: Ray, p0: Cartesian3, p1: Cartesian3, p2: Cartesian3, cullBackFaces?: boolean, result?: Cartesian3): Cartesian3;
  7915. /**
  7916. * Computes the intersection of a line segment and a triangle.
  7917. * @param v0 - The an end point of the line segment.
  7918. * @param v1 - The other end point of the line segment.
  7919. * @param p0 - The first vertex of the triangle.
  7920. * @param p1 - The second vertex of the triangle.
  7921. * @param p2 - The third vertex of the triangle.
  7922. * @param [cullBackFaces = false] - If <code>true</code>, will only compute an intersection with the front face of the triangle
  7923. * and return undefined for intersections with the back face.
  7924. * @param [result] - The <code>Cartesian3</code> onto which to store the result.
  7925. * @returns The intersection point or undefined if there is no intersections.
  7926. */
  7927. function lineSegmentTriangle(v0: Cartesian3, v1: Cartesian3, p0: Cartesian3, p1: Cartesian3, p2: Cartesian3, cullBackFaces?: boolean, result?: Cartesian3): Cartesian3;
  7928. /**
  7929. * Computes the intersection points of a ray with a sphere.
  7930. * @param ray - The ray.
  7931. * @param sphere - The sphere.
  7932. * @param [result] - The result onto which to store the result.
  7933. * @returns The interval containing scalar points along the ray or undefined if there are no intersections.
  7934. */
  7935. function raySphere(ray: Ray, sphere: BoundingSphere, result?: Interval): Interval;
  7936. /**
  7937. * Computes the intersection points of a line segment with a sphere.
  7938. * @param p0 - An end point of the line segment.
  7939. * @param p1 - The other end point of the line segment.
  7940. * @param sphere - The sphere.
  7941. * @param [result] - The result onto which to store the result.
  7942. * @returns The interval containing scalar points along the ray or undefined if there are no intersections.
  7943. */
  7944. function lineSegmentSphere(p0: Cartesian3, p1: Cartesian3, sphere: BoundingSphere, result?: Interval): Interval;
  7945. /**
  7946. * Computes the intersection points of a ray with an ellipsoid.
  7947. * @param ray - The ray.
  7948. * @param ellipsoid - The ellipsoid.
  7949. * @returns The interval containing scalar points along the ray or undefined if there are no intersections.
  7950. */
  7951. function rayEllipsoid(ray: Ray, ellipsoid: Ellipsoid): Interval;
  7952. /**
  7953. * Provides the point along the ray which is nearest to the ellipsoid.
  7954. * @param ray - The ray.
  7955. * @param ellipsoid - The ellipsoid.
  7956. * @returns The nearest planetodetic point on the ray.
  7957. */
  7958. function grazingAltitudeLocation(ray: Ray, ellipsoid: Ellipsoid): Cartesian3;
  7959. /**
  7960. * Computes the intersection of a line segment and a plane.
  7961. * @example
  7962. * var origin = Cesium.Cartesian3.fromDegrees(-75.59777, 40.03883);
  7963. * var normal = ellipsoid.geodeticSurfaceNormal(origin);
  7964. * var plane = Cesium.Plane.fromPointNormal(origin, normal);
  7965. *
  7966. * var p0 = new Cesium.Cartesian3(...);
  7967. * var p1 = new Cesium.Cartesian3(...);
  7968. *
  7969. * // find the intersection of the line segment from p0 to p1 and the tangent plane at origin.
  7970. * var intersection = Cesium.IntersectionTests.lineSegmentPlane(p0, p1, plane);
  7971. * @param endPoint0 - An end point of the line segment.
  7972. * @param endPoint1 - The other end point of the line segment.
  7973. * @param plane - The plane.
  7974. * @param [result] - The object onto which to store the result.
  7975. * @returns The intersection point or undefined if there is no intersection.
  7976. */
  7977. function lineSegmentPlane(endPoint0: Cartesian3, endPoint1: Cartesian3, plane: Plane, result?: Cartesian3): Cartesian3;
  7978. /**
  7979. * Computes the intersection of a triangle and a plane
  7980. * @example
  7981. * var origin = Cesium.Cartesian3.fromDegrees(-75.59777, 40.03883);
  7982. * var normal = ellipsoid.geodeticSurfaceNormal(origin);
  7983. * var plane = Cesium.Plane.fromPointNormal(origin, normal);
  7984. *
  7985. * var p0 = new Cesium.Cartesian3(...);
  7986. * var p1 = new Cesium.Cartesian3(...);
  7987. * var p2 = new Cesium.Cartesian3(...);
  7988. *
  7989. * // convert the triangle composed of points (p0, p1, p2) to three triangles that don't cross the plane
  7990. * var triangles = Cesium.IntersectionTests.trianglePlaneIntersection(p0, p1, p2, plane);
  7991. * @param p0 - First point of the triangle
  7992. * @param p1 - Second point of the triangle
  7993. * @param p2 - Third point of the triangle
  7994. * @param plane - Intersection plane
  7995. * @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)
  7996. */
  7997. function trianglePlaneIntersection(p0: Cartesian3, p1: Cartesian3, p2: Cartesian3, plane: Plane): any;
  7998. }
  7999. /**
  8000. * Contains functions for operating on 2D triangles.
  8001. */
  8002. export namespace Intersections2D {
  8003. /**
  8004. * Splits a 2D triangle at given axis-aligned threshold value and returns the resulting
  8005. * polygon on a given side of the threshold. The resulting polygon may have 0, 1, 2,
  8006. * 3, or 4 vertices.
  8007. * @example
  8008. * var result = Cesium.Intersections2D.clipTriangleAtAxisAlignedThreshold(0.5, false, 0.2, 0.6, 0.4);
  8009. * // result === [2, 0, -1, 1, 0, 0.25, -1, 1, 2, 0.5]
  8010. * @param threshold - The threshold coordinate value at which to clip the triangle.
  8011. * @param keepAbove - true to keep the portion of the triangle above the threshold, or false
  8012. * to keep the portion below.
  8013. * @param u0 - The coordinate of the first vertex in the triangle, in counter-clockwise order.
  8014. * @param u1 - The coordinate of the second vertex in the triangle, in counter-clockwise order.
  8015. * @param u2 - The coordinate of the third vertex in the triangle, in counter-clockwise order.
  8016. * @param [result] - The array into which to copy the result. If this parameter is not supplied,
  8017. * a new array is constructed and returned.
  8018. * @returns The polygon that results after the clip, specified as a list of
  8019. * vertices. The vertices are specified in counter-clockwise order.
  8020. * Each vertex is either an index from the existing list (identified as
  8021. * a 0, 1, or 2) or -1 indicating a new vertex not in the original triangle.
  8022. * For new vertices, the -1 is followed by three additional numbers: the
  8023. * index of each of the two original vertices forming the line segment that
  8024. * the new vertex lies on, and the fraction of the distance from the first
  8025. * vertex to the second one.
  8026. */
  8027. function clipTriangleAtAxisAlignedThreshold(threshold: number, keepAbove: boolean, u0: number, u1: number, u2: number, result?: number[]): number[];
  8028. /**
  8029. * Compute the barycentric coordinates of a 2D position within a 2D triangle.
  8030. * @example
  8031. * var result = Cesium.Intersections2D.computeBarycentricCoordinates(0.0, 0.0, 0.0, 1.0, -1, -0.5, 1, -0.5);
  8032. * // result === new Cesium.Cartesian3(1.0 / 3.0, 1.0 / 3.0, 1.0 / 3.0);
  8033. * @param x - The x coordinate of the position for which to find the barycentric coordinates.
  8034. * @param y - The y coordinate of the position for which to find the barycentric coordinates.
  8035. * @param x1 - The x coordinate of the triangle's first vertex.
  8036. * @param y1 - The y coordinate of the triangle's first vertex.
  8037. * @param x2 - The x coordinate of the triangle's second vertex.
  8038. * @param y2 - The y coordinate of the triangle's second vertex.
  8039. * @param x3 - The x coordinate of the triangle's third vertex.
  8040. * @param y3 - The y coordinate of the triangle's third vertex.
  8041. * @param [result] - The instance into to which to copy the result. If this parameter
  8042. * is undefined, a new instance is created and returned.
  8043. * @returns The barycentric coordinates of the position within the triangle.
  8044. */
  8045. function computeBarycentricCoordinates(x: number, y: number, x1: number, y1: number, x2: number, y2: number, x3: number, y3: number, result?: Cartesian3): Cartesian3;
  8046. /**
  8047. * Compute the intersection between 2 line segments
  8048. * @example
  8049. * var result = Cesium.Intersections2D.computeLineSegmentLineSegmentIntersection(0.0, 0.0, 0.0, 2.0, -1, 1, 1, 1);
  8050. * // result === new Cesium.Cartesian2(0.0, 1.0);
  8051. * @param x00 - The x coordinate of the first line's first vertex.
  8052. * @param y00 - The y coordinate of the first line's first vertex.
  8053. * @param x01 - The x coordinate of the first line's second vertex.
  8054. * @param y01 - The y coordinate of the first line's second vertex.
  8055. * @param x10 - The x coordinate of the second line's first vertex.
  8056. * @param y10 - The y coordinate of the second line's first vertex.
  8057. * @param x11 - The x coordinate of the second line's second vertex.
  8058. * @param y11 - The y coordinate of the second line's second vertex.
  8059. * @param [result] - The instance into to which to copy the result. If this parameter
  8060. * is undefined, a new instance is created and returned.
  8061. * @returns The intersection point, undefined if there is no intersection point or lines are coincident.
  8062. */
  8063. function computeLineSegmentLineSegmentIntersection(x00: number, y00: number, x01: number, y01: number, x10: number, y10: number, x11: number, y11: number, result?: Cartesian2): Cartesian2;
  8064. }
  8065. /**
  8066. * Represents the closed interval [start, stop].
  8067. * @param [start = 0.0] - The beginning of the interval.
  8068. * @param [stop = 0.0] - The end of the interval.
  8069. */
  8070. export class Interval {
  8071. constructor(start?: number, stop?: number);
  8072. /**
  8073. * The beginning of the interval.
  8074. */
  8075. start: number;
  8076. /**
  8077. * The end of the interval.
  8078. */
  8079. stop: number;
  8080. }
  8081. /**
  8082. * Default settings for accessing the Cesium ion API.
  8083. *
  8084. * An ion access token is only required if you are using any ion related APIs.
  8085. * A default access token is provided for evaluation purposes only.
  8086. * Sign up for a free ion account and get your own access token at {@link https://cesium.com}
  8087. */
  8088. export namespace Ion {
  8089. /**
  8090. * Gets or sets the default Cesium ion access token.
  8091. */
  8092. var defaultAccessToken: string;
  8093. /**
  8094. * Gets or sets the default Cesium ion server.
  8095. */
  8096. var defaultServer: string | Resource;
  8097. }
  8098. /**
  8099. * Provides geocoding through Cesium ion.
  8100. * @param options - Object with the following properties:
  8101. * @param options.scene - The scene
  8102. * @param [options.accessToken = Ion.defaultAccessToken] - The access token to use.
  8103. * @param [options.server = Ion.defaultServer] - The resource to the Cesium ion API server.
  8104. */
  8105. export class IonGeocoderService {
  8106. constructor(options: {
  8107. scene: Scene;
  8108. accessToken?: string;
  8109. server?: string | Resource;
  8110. });
  8111. /**
  8112. * @param query - The query to be sent to the geocoder service
  8113. * @param [type = GeocodeType.SEARCH] - The type of geocode to perform.
  8114. */
  8115. geocode(query: string, type?: GeocodeType): Promise<GeocoderService.Result[]>;
  8116. }
  8117. /**
  8118. * A {@link Resource} instance that encapsulates Cesium ion asset access.
  8119. * This object is normally not instantiated directly, use {@link IonResource.fromAssetId}.
  8120. * @param endpoint - The result of the Cesium ion asset endpoint service.
  8121. * @param endpointResource - The resource used to retreive the endpoint.
  8122. */
  8123. export class IonResource extends Resource {
  8124. constructor(endpoint: any, endpointResource: Resource);
  8125. /**
  8126. * Asynchronously creates an instance.
  8127. * @example
  8128. * //Load a Cesium3DTileset with asset ID of 124624234
  8129. * viewer.scene.primitives.add(new Cesium.Cesium3DTileset({ url: Cesium.IonResource.fromAssetId(124624234) }));
  8130. * @example
  8131. * //Load a CZML file with asset ID of 10890
  8132. * Cesium.IonResource.fromAssetId(10890)
  8133. * .then(function (resource) {
  8134. * viewer.dataSources.add(Cesium.CzmlDataSource.load(resource));
  8135. * });
  8136. * @param assetId - The Cesium ion asset id.
  8137. * @param [options] - An object with the following properties:
  8138. * @param [options.accessToken = Ion.defaultAccessToken] - The access token to use.
  8139. * @param [options.server = Ion.defaultServer] - The resource to the Cesium ion API server.
  8140. * @returns A Promise to am instance representing the Cesium ion Asset.
  8141. */
  8142. static fromAssetId(assetId: number, options?: {
  8143. accessToken?: string;
  8144. server?: string | Resource;
  8145. }): Promise<IonResource>;
  8146. /**
  8147. * Gets the credits required for attribution of the asset.
  8148. */
  8149. readonly credits: Credit[];
  8150. /**
  8151. * Duplicates a Resource instance.
  8152. * @param [result] - The object onto which to store the result.
  8153. * @returns The modified result parameter or a new Resource instance if one was not provided.
  8154. */
  8155. clone(result?: Resource): Resource;
  8156. /**
  8157. * Asynchronously loads the given image resource. Returns a promise that will resolve to
  8158. * 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
  8159. * {@link https://developer.mozilla.org/en-US/docs/Web/API/HTMLImageElement|Image} once loaded, or reject if the image failed to load.
  8160. * @example
  8161. * // load a single image asynchronously
  8162. * resource.fetchImage().then(function(image) {
  8163. * // use the loaded image
  8164. * }).otherwise(function(error) {
  8165. * // an error occurred
  8166. * });
  8167. *
  8168. * // load several images in parallel
  8169. * when.all([resource1.fetchImage(), resource2.fetchImage()]).then(function(images) {
  8170. * // images is an array containing all the loaded images
  8171. * });
  8172. * @param [options] - An object with the following properties.
  8173. * @param [options.preferBlob = false] - If true, we will load the image via a blob.
  8174. * @param [options.preferImageBitmap = false] - If true, image will be decoded during fetch and an <code>ImageBitmap</code> is returned.
  8175. * @param [options.flipY = false] - If true, image will be vertically flipped during decode. Only applies if the browser supports <code>createImageBitmap</code>.
  8176. * @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.
  8177. */
  8178. fetchImage(options?: {
  8179. preferBlob?: boolean;
  8180. preferImageBitmap?: boolean;
  8181. flipY?: boolean;
  8182. }): Promise<ImageBitmap> | Promise<HTMLImageElement> | undefined;
  8183. }
  8184. /**
  8185. * Constants related to ISO8601 support.
  8186. */
  8187. export namespace Iso8601 {
  8188. /**
  8189. * A {@link JulianDate} representing the earliest time representable by an ISO8601 date.
  8190. * This is equivalent to the date string '0000-01-01T00:00:00Z'
  8191. */
  8192. const MINIMUM_VALUE: JulianDate;
  8193. /**
  8194. * A {@link JulianDate} representing the latest time representable by an ISO8601 date.
  8195. * This is equivalent to the date string '9999-12-31T24:00:00Z'
  8196. */
  8197. const MAXIMUM_VALUE: JulianDate;
  8198. /**
  8199. * A {@link TimeInterval} representing the largest interval representable by an ISO8601 interval.
  8200. * This is equivalent to the interval string '0000-01-01T00:00:00Z/9999-12-31T24:00:00Z'
  8201. */
  8202. const MAXIMUM_INTERVAL: JulianDate;
  8203. }
  8204. /**
  8205. * Represents an astronomical Julian date, which is the number of days since noon on January 1, -4712 (4713 BC).
  8206. * For increased precision, this class stores the whole number part of the date and the seconds
  8207. * part of the date in separate components. In order to be safe for arithmetic and represent
  8208. * leap seconds, the date is always stored in the International Atomic Time standard
  8209. * {@link TimeStandard.TAI}.
  8210. * @param [julianDayNumber = 0.0] - The Julian Day Number representing the number of whole days. Fractional days will also be handled correctly.
  8211. * @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.
  8212. * @param [timeStandard = TimeStandard.UTC] - The time standard in which the first two parameters are defined.
  8213. */
  8214. export class JulianDate {
  8215. constructor(julianDayNumber?: number, secondsOfDay?: number, timeStandard?: TimeStandard);
  8216. /**
  8217. * Gets or sets the number of whole days.
  8218. */
  8219. dayNumber: number;
  8220. /**
  8221. * Gets or sets the number of seconds into the current day.
  8222. */
  8223. secondsOfDay: number;
  8224. /**
  8225. * Creates a new instance from a GregorianDate.
  8226. * @param date - A GregorianDate.
  8227. * @param [result] - An existing instance to use for the result.
  8228. * @returns The modified result parameter or a new instance if none was provided.
  8229. */
  8230. static fromGregorianDate(date: GregorianDate, result?: JulianDate): JulianDate;
  8231. /**
  8232. * Creates a new instance from a JavaScript Date.
  8233. * @param date - A JavaScript Date.
  8234. * @param [result] - An existing instance to use for the result.
  8235. * @returns The modified result parameter or a new instance if none was provided.
  8236. */
  8237. static fromDate(date: Date, result?: JulianDate): JulianDate;
  8238. /**
  8239. * Creates a new instance from a from an {@link http://en.wikipedia.org/wiki/ISO_8601|ISO 8601} date.
  8240. * This method is superior to <code>Date.parse</code> because it will handle all valid formats defined by the ISO 8601
  8241. * specification, including leap seconds and sub-millisecond times, which discarded by most JavaScript implementations.
  8242. * @param iso8601String - An ISO 8601 date.
  8243. * @param [result] - An existing instance to use for the result.
  8244. * @returns The modified result parameter or a new instance if none was provided.
  8245. */
  8246. static fromIso8601(iso8601String: string, result?: JulianDate): JulianDate;
  8247. /**
  8248. * Creates a new instance that represents the current system time.
  8249. * This is equivalent to calling <code>JulianDate.fromDate(new Date());</code>.
  8250. * @param [result] - An existing instance to use for the result.
  8251. * @returns The modified result parameter or a new instance if none was provided.
  8252. */
  8253. static now(result?: JulianDate): JulianDate;
  8254. /**
  8255. * Creates a {@link GregorianDate} from the provided instance.
  8256. * @param julianDate - The date to be converted.
  8257. * @param [result] - An existing instance to use for the result.
  8258. * @returns The modified result parameter or a new instance if none was provided.
  8259. */
  8260. static toGregorianDate(julianDate: JulianDate, result?: GregorianDate): GregorianDate;
  8261. /**
  8262. * Creates a JavaScript Date from the provided instance.
  8263. * Since JavaScript dates are only accurate to the nearest millisecond and
  8264. * cannot represent a leap second, consider using {@link JulianDate.toGregorianDate} instead.
  8265. * If the provided JulianDate is during a leap second, the previous second is used.
  8266. * @param julianDate - The date to be converted.
  8267. * @returns A new instance representing the provided date.
  8268. */
  8269. static toDate(julianDate: JulianDate): Date;
  8270. /**
  8271. * Creates an ISO8601 representation of the provided date.
  8272. * @param julianDate - The date to be converted.
  8273. * @param [precision] - The number of fractional digits used to represent the seconds component. By default, the most precise representation is used.
  8274. * @returns The ISO8601 representation of the provided date.
  8275. */
  8276. static toIso8601(julianDate: JulianDate, precision?: number): string;
  8277. /**
  8278. * Duplicates a JulianDate instance.
  8279. * @param julianDate - The date to duplicate.
  8280. * @param [result] - An existing instance to use for the result.
  8281. * @returns The modified result parameter or a new instance if none was provided. Returns undefined if julianDate is undefined.
  8282. */
  8283. static clone(julianDate: JulianDate, result?: JulianDate): JulianDate;
  8284. /**
  8285. * Compares two instances.
  8286. * @param left - The first instance.
  8287. * @param right - The second instance.
  8288. * @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.
  8289. */
  8290. static compare(left: JulianDate, right: JulianDate): number;
  8291. /**
  8292. * Compares two instances and returns <code>true</code> if they are equal, <code>false</code> otherwise.
  8293. * @param [left] - The first instance.
  8294. * @param [right] - The second instance.
  8295. * @returns <code>true</code> if the dates are equal; otherwise, <code>false</code>.
  8296. */
  8297. static equals(left?: JulianDate, right?: JulianDate): boolean;
  8298. /**
  8299. * Compares two instances and returns <code>true</code> if they are within <code>epsilon</code> seconds of
  8300. * each other. That is, in order for the dates to be considered equal (and for
  8301. * this function to return <code>true</code>), the absolute value of the difference between them, in
  8302. * seconds, must be less than <code>epsilon</code>.
  8303. * @param [left] - The first instance.
  8304. * @param [right] - The second instance.
  8305. * @param [epsilon = 0] - The maximum number of seconds that should separate the two instances.
  8306. * @returns <code>true</code> if the two dates are within <code>epsilon</code> seconds of each other; otherwise <code>false</code>.
  8307. */
  8308. static equalsEpsilon(left?: JulianDate, right?: JulianDate, epsilon?: number): boolean;
  8309. /**
  8310. * Computes the total number of whole and fractional days represented by the provided instance.
  8311. * @param julianDate - The date.
  8312. * @returns The Julian date as single floating point number.
  8313. */
  8314. static totalDays(julianDate: JulianDate): number;
  8315. /**
  8316. * Computes the difference in seconds between the provided instance.
  8317. * @param left - The first instance.
  8318. * @param right - The second instance.
  8319. * @returns The difference, in seconds, when subtracting <code>right</code> from <code>left</code>.
  8320. */
  8321. static secondsDifference(left: JulianDate, right: JulianDate): number;
  8322. /**
  8323. * Computes the difference in days between the provided instance.
  8324. * @param left - The first instance.
  8325. * @param right - The second instance.
  8326. * @returns The difference, in days, when subtracting <code>right</code> from <code>left</code>.
  8327. */
  8328. static daysDifference(left: JulianDate, right: JulianDate): number;
  8329. /**
  8330. * Computes the number of seconds the provided instance is ahead of UTC.
  8331. * @param julianDate - The date.
  8332. * @returns The number of seconds the provided instance is ahead of UTC
  8333. */
  8334. static computeTaiMinusUtc(julianDate: JulianDate): number;
  8335. /**
  8336. * Adds the provided number of seconds to the provided date instance.
  8337. * @param julianDate - The date.
  8338. * @param seconds - The number of seconds to add or subtract.
  8339. * @param result - An existing instance to use for the result.
  8340. * @returns The modified result parameter.
  8341. */
  8342. static addSeconds(julianDate: JulianDate, seconds: number, result: JulianDate): JulianDate;
  8343. /**
  8344. * Adds the provided number of minutes to the provided date instance.
  8345. * @param julianDate - The date.
  8346. * @param minutes - The number of minutes to add or subtract.
  8347. * @param result - An existing instance to use for the result.
  8348. * @returns The modified result parameter.
  8349. */
  8350. static addMinutes(julianDate: JulianDate, minutes: number, result: JulianDate): JulianDate;
  8351. /**
  8352. * Adds the provided number of hours to the provided date instance.
  8353. * @param julianDate - The date.
  8354. * @param hours - The number of hours to add or subtract.
  8355. * @param result - An existing instance to use for the result.
  8356. * @returns The modified result parameter.
  8357. */
  8358. static addHours(julianDate: JulianDate, hours: number, result: JulianDate): JulianDate;
  8359. /**
  8360. * Adds the provided number of days to the provided date instance.
  8361. * @param julianDate - The date.
  8362. * @param days - The number of days to add or subtract.
  8363. * @param result - An existing instance to use for the result.
  8364. * @returns The modified result parameter.
  8365. */
  8366. static addDays(julianDate: JulianDate, days: number, result: JulianDate): JulianDate;
  8367. /**
  8368. * Compares the provided instances and returns <code>true</code> if <code>left</code> is earlier than <code>right</code>, <code>false</code> otherwise.
  8369. * @param left - The first instance.
  8370. * @param right - The second instance.
  8371. * @returns <code>true</code> if <code>left</code> is earlier than <code>right</code>, <code>false</code> otherwise.
  8372. */
  8373. static lessThan(left: JulianDate, right: JulianDate): boolean;
  8374. /**
  8375. * 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.
  8376. * @param left - The first instance.
  8377. * @param right - The second instance.
  8378. * @returns <code>true</code> if <code>left</code> is earlier than or equal to <code>right</code>, <code>false</code> otherwise.
  8379. */
  8380. static lessThanOrEquals(left: JulianDate, right: JulianDate): boolean;
  8381. /**
  8382. * Compares the provided instances and returns <code>true</code> if <code>left</code> is later than <code>right</code>, <code>false</code> otherwise.
  8383. * @param left - The first instance.
  8384. * @param right - The second instance.
  8385. * @returns <code>true</code> if <code>left</code> is later than <code>right</code>, <code>false</code> otherwise.
  8386. */
  8387. static greaterThan(left: JulianDate, right: JulianDate): boolean;
  8388. /**
  8389. * 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.
  8390. * @param left - The first instance.
  8391. * @param right - The second instance.
  8392. * @returns <code>true</code> if <code>left</code> is later than or equal to <code>right</code>, <code>false</code> otherwise.
  8393. */
  8394. static greaterThanOrEquals(left: JulianDate, right: JulianDate): boolean;
  8395. /**
  8396. * Duplicates this instance.
  8397. * @param [result] - An existing instance to use for the result.
  8398. * @returns The modified result parameter or a new instance if none was provided.
  8399. */
  8400. clone(result?: JulianDate): JulianDate;
  8401. /**
  8402. * Compares this and the provided instance and returns <code>true</code> if they are equal, <code>false</code> otherwise.
  8403. * @param [right] - The second instance.
  8404. * @returns <code>true</code> if the dates are equal; otherwise, <code>false</code>.
  8405. */
  8406. equals(right?: JulianDate): boolean;
  8407. /**
  8408. * Compares this and the provided instance and returns <code>true</code> if they are within <code>epsilon</code> seconds of
  8409. * each other. That is, in order for the dates to be considered equal (and for
  8410. * this function to return <code>true</code>), the absolute value of the difference between them, in
  8411. * seconds, must be less than <code>epsilon</code>.
  8412. * @param [right] - The second instance.
  8413. * @param [epsilon = 0] - The maximum number of seconds that should separate the two instances.
  8414. * @returns <code>true</code> if the two dates are within <code>epsilon</code> seconds of each other; otherwise <code>false</code>.
  8415. */
  8416. equalsEpsilon(right?: JulianDate, epsilon?: number): boolean;
  8417. /**
  8418. * Creates a string representing this date in ISO8601 format.
  8419. * @returns A string representing this date in ISO8601 format.
  8420. */
  8421. toString(): string;
  8422. /**
  8423. * Gets or sets the list of leap seconds used throughout Cesium.
  8424. */
  8425. static leapSeconds: LeapSecond[];
  8426. }
  8427. /**
  8428. * This enumerated type is for representing keyboard modifiers. These are keys
  8429. * that are held down in addition to other event types.
  8430. */
  8431. export enum KeyboardEventModifier {
  8432. /**
  8433. * Represents the shift key being held down.
  8434. */
  8435. SHIFT = 0,
  8436. /**
  8437. * Represents the control key being held down.
  8438. */
  8439. CTRL = 1,
  8440. /**
  8441. * Represents the alt key being held down.
  8442. */
  8443. ALT = 2
  8444. }
  8445. /**
  8446. * An {@link InterpolationAlgorithm} for performing Lagrange interpolation.
  8447. */
  8448. export namespace LagrangePolynomialApproximation {
  8449. /**
  8450. * Given the desired degree, returns the number of data points required for interpolation.
  8451. * @param degree - The desired degree of interpolation.
  8452. * @returns The number of required data points needed for the desired degree of interpolation.
  8453. */
  8454. function getRequiredDataPoints(degree: number): number;
  8455. /**
  8456. * Interpolates values using Lagrange Polynomial Approximation.
  8457. * @param x - The independent variable for which the dependent variables will be interpolated.
  8458. * @param xTable - The array of independent variables to use to interpolate. The values
  8459. * in this array must be in increasing order and the same value must not occur twice in the array.
  8460. * @param yTable - The array of dependent variables to use to interpolate. For a set of three
  8461. * dependent values (p,q,w) at time 1 and time 2 this should be as follows: {p1, q1, w1, p2, q2, w2}.
  8462. * @param yStride - The number of dependent variable values in yTable corresponding to
  8463. * each independent variable value in xTable.
  8464. * @param [result] - An existing array into which to store the result.
  8465. * @returns The array of interpolated values, or the result parameter if one was provided.
  8466. */
  8467. function interpolateOrderZero(x: number, xTable: number[], yTable: number[], yStride: number, result?: number[]): number[];
  8468. }
  8469. /**
  8470. * Describes a single leap second, which is constructed from a {@link JulianDate} and a
  8471. * numerical offset representing the number of seconds TAI is ahead of the UTC time standard.
  8472. * @param [date] - A Julian date representing the time of the leap second.
  8473. * @param [offset] - The cumulative number of seconds that TAI is ahead of UTC at the provided date.
  8474. */
  8475. export class LeapSecond {
  8476. constructor(date?: JulianDate, offset?: number);
  8477. /**
  8478. * Gets or sets the date at which this leap second occurs.
  8479. */
  8480. julianDate: JulianDate;
  8481. /**
  8482. * Gets or sets the cumulative number of seconds between the UTC and TAI time standards at the time
  8483. * of this leap second.
  8484. */
  8485. offset: number;
  8486. }
  8487. /**
  8488. * An {@link InterpolationAlgorithm} for performing linear interpolation.
  8489. */
  8490. export namespace LinearApproximation {
  8491. /**
  8492. * Given the desired degree, returns the number of data points required for interpolation.
  8493. * Since linear interpolation can only generate a first degree polynomial, this function
  8494. * always returns 2.
  8495. * @param degree - The desired degree of interpolation.
  8496. * @returns This function always returns 2.
  8497. */
  8498. function getRequiredDataPoints(degree: number): number;
  8499. /**
  8500. * Interpolates values using linear approximation.
  8501. * @param x - The independent variable for which the dependent variables will be interpolated.
  8502. * @param xTable - The array of independent variables to use to interpolate. The values
  8503. * in this array must be in increasing order and the same value must not occur twice in the array.
  8504. * @param yTable - The array of dependent variables to use to interpolate. For a set of three
  8505. * dependent values (p,q,w) at time 1 and time 2 this should be as follows: {p1, q1, w1, p2, q2, w2}.
  8506. * @param yStride - The number of dependent variable values in yTable corresponding to
  8507. * each independent variable value in xTable.
  8508. * @param [result] - An existing array into which to store the result.
  8509. * @returns The array of interpolated values, or the result parameter if one was provided.
  8510. */
  8511. function interpolateOrderZero(x: number, xTable: number[], yTable: number[], yStride: number, result?: number[]): number[];
  8512. }
  8513. /**
  8514. * A spline that uses piecewise linear interpolation to create a curve.
  8515. * @example
  8516. * var times = [ 0.0, 1.5, 3.0, 4.5, 6.0 ];
  8517. * var spline = new Cesium.LinearSpline({
  8518. * times : times,
  8519. * points : [
  8520. * new Cesium.Cartesian3(1235398.0, -4810983.0, 4146266.0),
  8521. * new Cesium.Cartesian3(1372574.0, -5345182.0, 4606657.0),
  8522. * new Cesium.Cartesian3(-757983.0, -5542796.0, 4514323.0),
  8523. * new Cesium.Cartesian3(-2821260.0, -5248423.0, 4021290.0),
  8524. * new Cesium.Cartesian3(-2539788.0, -4724797.0, 3620093.0)
  8525. * ]
  8526. * });
  8527. *
  8528. * var p0 = spline.evaluate(times[0]);
  8529. * @param options - Object with the following properties:
  8530. * @param options.times - An array of strictly increasing, unit-less, floating-point times at each point.
  8531. * The values are in no way connected to the clock time. They are the parameterization for the curve.
  8532. * @param options.points - The array of {@link Cartesian3} control points.
  8533. */
  8534. export class LinearSpline {
  8535. constructor(options: {
  8536. times: number[];
  8537. points: Cartesian3[];
  8538. });
  8539. /**
  8540. * An array of times for the control points.
  8541. */
  8542. readonly times: number[];
  8543. /**
  8544. * An array of {@link Cartesian3} control points.
  8545. */
  8546. readonly points: Cartesian3[];
  8547. /**
  8548. * Finds an index <code>i</code> in <code>times</code> such that the parameter
  8549. * <code>time</code> is in the interval <code>[times[i], times[i + 1]]</code>.
  8550. * @param time - The time.
  8551. * @returns The index for the element at the start of the interval.
  8552. */
  8553. findTimeInterval(time: number): number;
  8554. /**
  8555. * Wraps the given time to the period covered by the spline.
  8556. * @param time - The time.
  8557. * @returns The time, wrapped around to the updated animation.
  8558. */
  8559. wrapTime(time: number): number;
  8560. /**
  8561. * Clamps the given time to the period covered by the spline.
  8562. * @param time - The time.
  8563. * @returns The time, clamped to the animation period.
  8564. */
  8565. clampTime(time: number): number;
  8566. /**
  8567. * Evaluates the curve at a given time.
  8568. * @param time - The time at which to evaluate the curve.
  8569. * @param [result] - The object onto which to store the result.
  8570. * @returns The modified result parameter or a new instance of the point on the curve at the given time.
  8571. */
  8572. evaluate(time: number, result?: Cartesian3): Cartesian3;
  8573. }
  8574. /**
  8575. * Defines how geodetic ellipsoid coordinates ({@link Cartographic}) project to a
  8576. * flat map like Cesium's 2D and Columbus View modes.
  8577. */
  8578. export class MapProjection {
  8579. constructor();
  8580. /**
  8581. * Gets the {@link Ellipsoid}.
  8582. */
  8583. readonly ellipsoid: Ellipsoid;
  8584. /**
  8585. * Projects {@link Cartographic} coordinates, in radians, to projection-specific map coordinates, in meters.
  8586. * @param cartographic - The coordinates to project.
  8587. * @param [result] - An instance into which to copy the result. If this parameter is
  8588. * undefined, a new instance is created and returned.
  8589. * @returns The projected coordinates. If the result parameter is not undefined, the
  8590. * coordinates are copied there and that instance is returned. Otherwise, a new instance is
  8591. * created and returned.
  8592. */
  8593. project(cartographic: Cartographic, result?: Cartesian3): Cartesian3;
  8594. /**
  8595. * Unprojects projection-specific map {@link Cartesian3} coordinates, in meters, to {@link Cartographic}
  8596. * coordinates, in radians.
  8597. * @param cartesian - The Cartesian position to unproject with height (z) in meters.
  8598. * @param [result] - An instance into which to copy the result. If this parameter is
  8599. * undefined, a new instance is created and returned.
  8600. * @returns The unprojected coordinates. If the result parameter is not undefined, the
  8601. * coordinates are copied there and that instance is returned. Otherwise, a new instance is
  8602. * created and returned.
  8603. */
  8604. unproject(cartesian: Cartesian3, result?: Cartographic): Cartographic;
  8605. }
  8606. export namespace MapboxApi {
  8607. /**
  8608. * The default Mapbox API access token to use if one is not provided to the
  8609. * constructor of an object that uses the Mapbox API. If this property is undefined,
  8610. * Cesium's default access token is used, which is only suitable for use early in development.
  8611. * Please supply your own access token as soon as possible and prior to deployment.
  8612. * Visit {@link https://www.mapbox.com/help/create-api-access-token/} for details.
  8613. * When Cesium's default access token is used, a message is printed to the console the first
  8614. * time the Mapbox API is used.
  8615. */
  8616. var defaultAccessToken: string;
  8617. }
  8618. /**
  8619. * Math functions.
  8620. */
  8621. export namespace Math {
  8622. /**
  8623. * 0.1
  8624. */
  8625. const EPSILON1 = 0.1;
  8626. /**
  8627. * 0.01
  8628. */
  8629. const EPSILON2 = 0.01;
  8630. /**
  8631. * 0.001
  8632. */
  8633. const EPSILON3 = 0.001;
  8634. /**
  8635. * 0.0001
  8636. */
  8637. const EPSILON4 = 0.0001;
  8638. /**
  8639. * 0.00001
  8640. */
  8641. const EPSILON5 = 0.00001;
  8642. /**
  8643. * 0.000001
  8644. */
  8645. const EPSILON6 = 0.000001;
  8646. /**
  8647. * 0.0000001
  8648. */
  8649. const EPSILON7 = 1e-7;
  8650. /**
  8651. * 0.00000001
  8652. */
  8653. const EPSILON8 = 1e-8;
  8654. /**
  8655. * 0.000000001
  8656. */
  8657. const EPSILON9 = 1e-9;
  8658. /**
  8659. * 0.0000000001
  8660. */
  8661. const EPSILON10 = 1e-10;
  8662. /**
  8663. * 0.00000000001
  8664. */
  8665. const EPSILON11 = 1e-11;
  8666. /**
  8667. * 0.000000000001
  8668. */
  8669. const EPSILON12 = 1e-12;
  8670. /**
  8671. * 0.0000000000001
  8672. */
  8673. const EPSILON13 = 1e-13;
  8674. /**
  8675. * 0.00000000000001
  8676. */
  8677. const EPSILON14 = 1e-14;
  8678. /**
  8679. * 0.000000000000001
  8680. */
  8681. const EPSILON15 = 1e-15;
  8682. /**
  8683. * 0.0000000000000001
  8684. */
  8685. const EPSILON16 = 1e-16;
  8686. /**
  8687. * 0.00000000000000001
  8688. */
  8689. const EPSILON17 = 1e-17;
  8690. /**
  8691. * 0.000000000000000001
  8692. */
  8693. const EPSILON18 = 1e-18;
  8694. /**
  8695. * 0.0000000000000000001
  8696. */
  8697. const EPSILON19 = 1e-19;
  8698. /**
  8699. * 0.00000000000000000001
  8700. */
  8701. const EPSILON20 = 1e-20;
  8702. /**
  8703. * 0.000000000000000000001
  8704. */
  8705. const EPSILON21 = 1e-21;
  8706. /**
  8707. * The gravitational parameter of the Earth in meters cubed
  8708. * per second squared as defined by the WGS84 model: 3.986004418e14
  8709. */
  8710. const GRAVITATIONALPARAMETER = 398600441800000;
  8711. /**
  8712. * Radius of the sun in meters: 6.955e8
  8713. */
  8714. const SOLAR_RADIUS = 695500000;
  8715. /**
  8716. * The mean radius of the moon, according to the "Report of the IAU/IAG Working Group on
  8717. * Cartographic Coordinates and Rotational Elements of the Planets and satellites: 2000",
  8718. * Celestial Mechanics 82: 83-110, 2002.
  8719. */
  8720. const LUNAR_RADIUS = 1737400;
  8721. /**
  8722. * 64 * 1024
  8723. */
  8724. const SIXTY_FOUR_KILOBYTES: number;
  8725. /**
  8726. * 4 * 1024 * 1024 * 1024
  8727. */
  8728. const FOUR_GIGABYTES: number;
  8729. /**
  8730. * Returns the sign of the value; 1 if the value is positive, -1 if the value is
  8731. * negative, or 0 if the value is 0.
  8732. * @param value - The value to return the sign of.
  8733. * @returns The sign of value.
  8734. */
  8735. function sign(value: number): number;
  8736. /**
  8737. * Returns 1.0 if the given value is positive or zero, and -1.0 if it is negative.
  8738. * This is similar to {@link Math#sign} except that returns 1.0 instead of
  8739. * 0.0 when the input value is 0.0.
  8740. * @param value - The value to return the sign of.
  8741. * @returns The sign of value.
  8742. */
  8743. function signNotZero(value: number): number;
  8744. /**
  8745. * Converts a scalar value in the range [-1.0, 1.0] to a SNORM in the range [0, rangeMaximum]
  8746. * @param value - The scalar value in the range [-1.0, 1.0]
  8747. * @param [rangeMaximum = 255] - The maximum value in the mapped range, 255 by default.
  8748. * @returns A SNORM value, where 0 maps to -1.0 and rangeMaximum maps to 1.0.
  8749. */
  8750. function toSNorm(value: number, rangeMaximum?: number): number;
  8751. /**
  8752. * Converts a SNORM value in the range [0, rangeMaximum] to a scalar in the range [-1.0, 1.0].
  8753. * @param value - SNORM value in the range [0, rangeMaximum]
  8754. * @param [rangeMaximum = 255] - The maximum value in the SNORM range, 255 by default.
  8755. * @returns Scalar in the range [-1.0, 1.0].
  8756. */
  8757. function fromSNorm(value: number, rangeMaximum?: number): number;
  8758. /**
  8759. * Converts a scalar value in the range [rangeMinimum, rangeMaximum] to a scalar in the range [0.0, 1.0]
  8760. * @param value - The scalar value in the range [rangeMinimum, rangeMaximum]
  8761. * @param rangeMinimum - The minimum value in the mapped range.
  8762. * @param rangeMaximum - The maximum value in the mapped range.
  8763. * @returns A scalar value, where rangeMinimum maps to 0.0 and rangeMaximum maps to 1.0.
  8764. */
  8765. function normalize(value: number, rangeMinimum: number, rangeMaximum: number): number;
  8766. /**
  8767. * Returns the hyperbolic sine of a number.
  8768. * The hyperbolic sine of <em>value</em> is defined to be
  8769. * (<em>e<sup>x</sup>&nbsp;-&nbsp;e<sup>-x</sup></em>)/2.0
  8770. * where <i>e</i> is Euler's number, approximately 2.71828183.
  8771. *
  8772. * <p>Special cases:
  8773. * <ul>
  8774. * <li>If the argument is NaN, then the result is NaN.</li>
  8775. *
  8776. * <li>If the argument is infinite, then the result is an infinity
  8777. * with the same sign as the argument.</li>
  8778. *
  8779. * <li>If the argument is zero, then the result is a zero with the
  8780. * same sign as the argument.</li>
  8781. * </ul>
  8782. * </p>
  8783. * @param value - The number whose hyperbolic sine is to be returned.
  8784. * @returns The hyperbolic sine of <code>value</code>.
  8785. */
  8786. function sinh(value: number): number;
  8787. /**
  8788. * Returns the hyperbolic cosine of a number.
  8789. * The hyperbolic cosine of <strong>value</strong> is defined to be
  8790. * (<em>e<sup>x</sup>&nbsp;+&nbsp;e<sup>-x</sup></em>)/2.0
  8791. * where <i>e</i> is Euler's number, approximately 2.71828183.
  8792. *
  8793. * <p>Special cases:
  8794. * <ul>
  8795. * <li>If the argument is NaN, then the result is NaN.</li>
  8796. *
  8797. * <li>If the argument is infinite, then the result is positive infinity.</li>
  8798. *
  8799. * <li>If the argument is zero, then the result is 1.0.</li>
  8800. * </ul>
  8801. * </p>
  8802. * @param value - The number whose hyperbolic cosine is to be returned.
  8803. * @returns The hyperbolic cosine of <code>value</code>.
  8804. */
  8805. function cosh(value: number): number;
  8806. /**
  8807. * Computes the linear interpolation of two values.
  8808. * @example
  8809. * var n = Cesium.Math.lerp(0.0, 2.0, 0.5); // returns 1.0
  8810. * @param p - The start value to interpolate.
  8811. * @param q - The end value to interpolate.
  8812. * @param time - The time of interpolation generally in the range <code>[0.0, 1.0]</code>.
  8813. * @returns The linearly interpolated value.
  8814. */
  8815. function lerp(p: number, q: number, time: number): number;
  8816. /**
  8817. * pi
  8818. */
  8819. const PI: number;
  8820. /**
  8821. * 1/pi
  8822. */
  8823. const ONE_OVER_PI: number;
  8824. /**
  8825. * pi/2
  8826. */
  8827. const PI_OVER_TWO: number;
  8828. /**
  8829. * pi/3
  8830. */
  8831. const PI_OVER_THREE: number;
  8832. /**
  8833. * pi/4
  8834. */
  8835. const PI_OVER_FOUR: number;
  8836. /**
  8837. * pi/6
  8838. */
  8839. const PI_OVER_SIX: number;
  8840. /**
  8841. * 3pi/2
  8842. */
  8843. const THREE_PI_OVER_TWO: number;
  8844. /**
  8845. * 2pi
  8846. */
  8847. const TWO_PI: number;
  8848. /**
  8849. * 1/2pi
  8850. */
  8851. const ONE_OVER_TWO_PI: number;
  8852. /**
  8853. * The number of radians in a degree.
  8854. */
  8855. const RADIANS_PER_DEGREE: number;
  8856. /**
  8857. * The number of degrees in a radian.
  8858. */
  8859. const DEGREES_PER_RADIAN: number;
  8860. /**
  8861. * The number of radians in an arc second.
  8862. */
  8863. const RADIANS_PER_ARCSECOND: number;
  8864. /**
  8865. * Converts degrees to radians.
  8866. * @param degrees - The angle to convert in degrees.
  8867. * @returns The corresponding angle in radians.
  8868. */
  8869. function toRadians(degrees: number): number;
  8870. /**
  8871. * Converts radians to degrees.
  8872. * @param radians - The angle to convert in radians.
  8873. * @returns The corresponding angle in degrees.
  8874. */
  8875. function toDegrees(radians: number): number;
  8876. /**
  8877. * Converts a longitude value, in radians, to the range [<code>-Math.PI</code>, <code>Math.PI</code>).
  8878. * @example
  8879. * // Convert 270 degrees to -90 degrees longitude
  8880. * var longitude = Cesium.Math.convertLongitudeRange(Cesium.Math.toRadians(270.0));
  8881. * @param angle - The longitude value, in radians, to convert to the range [<code>-Math.PI</code>, <code>Math.PI</code>).
  8882. * @returns The equivalent longitude value in the range [<code>-Math.PI</code>, <code>Math.PI</code>).
  8883. */
  8884. function convertLongitudeRange(angle: number): number;
  8885. /**
  8886. * Convenience function that clamps a latitude value, in radians, to the range [<code>-Math.PI/2</code>, <code>Math.PI/2</code>).
  8887. * Useful for sanitizing data before use in objects requiring correct range.
  8888. * @example
  8889. * // Clamp 108 degrees latitude to 90 degrees latitude
  8890. * var latitude = Cesium.Math.clampToLatitudeRange(Cesium.Math.toRadians(108.0));
  8891. * @param angle - The latitude value, in radians, to clamp to the range [<code>-Math.PI/2</code>, <code>Math.PI/2</code>).
  8892. * @returns The latitude value clamped to the range [<code>-Math.PI/2</code>, <code>Math.PI/2</code>).
  8893. */
  8894. function clampToLatitudeRange(angle: number): number;
  8895. /**
  8896. * Produces an angle in the range -Pi <= angle <= Pi which is equivalent to the provided angle.
  8897. * @param angle - in radians
  8898. * @returns The angle in the range [<code>-Math.PI</code>, <code>Math.PI</code>].
  8899. */
  8900. function negativePiToPi(angle: number): number;
  8901. /**
  8902. * Produces an angle in the range 0 <= angle <= 2Pi which is equivalent to the provided angle.
  8903. * @param angle - in radians
  8904. * @returns The angle in the range [0, <code>Math.TWO_PI</code>].
  8905. */
  8906. function zeroToTwoPi(angle: number): number;
  8907. /**
  8908. * The modulo operation that also works for negative dividends.
  8909. * @param m - The dividend.
  8910. * @param n - The divisor.
  8911. * @returns The remainder.
  8912. */
  8913. function mod(m: number, n: number): number;
  8914. /**
  8915. * Determines if two values are equal using an absolute or relative tolerance test. This is useful
  8916. * to avoid problems due to roundoff error when comparing floating-point values directly. The values are
  8917. * first compared using an absolute tolerance test. If that fails, a relative tolerance test is performed.
  8918. * Use this test if you are unsure of the magnitudes of left and right.
  8919. * @example
  8920. * var a = Cesium.Math.equalsEpsilon(0.0, 0.01, Cesium.Math.EPSILON2); // true
  8921. * var b = Cesium.Math.equalsEpsilon(0.0, 0.1, Cesium.Math.EPSILON2); // false
  8922. * var c = Cesium.Math.equalsEpsilon(3699175.1634344, 3699175.2, Cesium.Math.EPSILON7); // true
  8923. * var d = Cesium.Math.equalsEpsilon(3699175.1634344, 3699175.2, Cesium.Math.EPSILON9); // false
  8924. * @param left - The first value to compare.
  8925. * @param right - The other value to compare.
  8926. * @param [relativeEpsilon = 0] - The maximum inclusive delta between <code>left</code> and <code>right</code> for the relative tolerance test.
  8927. * @param [absoluteEpsilon = relativeEpsilon] - The maximum inclusive delta between <code>left</code> and <code>right</code> for the absolute tolerance test.
  8928. * @returns <code>true</code> if the values are equal within the epsilon; otherwise, <code>false</code>.
  8929. */
  8930. function equalsEpsilon(left: number, right: number, relativeEpsilon?: number, absoluteEpsilon?: number): boolean;
  8931. /**
  8932. * Determines if the left value is less than the right value. If the two values are within
  8933. * <code>absoluteEpsilon</code> of each other, they are considered equal and this function returns false.
  8934. * @param left - The first number to compare.
  8935. * @param right - The second number to compare.
  8936. * @param absoluteEpsilon - The absolute epsilon to use in comparison.
  8937. * @returns <code>true</code> if <code>left</code> is less than <code>right</code> by more than
  8938. * <code>absoluteEpsilon<code>. <code>false</code> if <code>left</code> is greater or if the two
  8939. * values are nearly equal.
  8940. */
  8941. function lessThan(left: number, right: number, absoluteEpsilon: number): boolean;
  8942. /**
  8943. * Determines if the left value is less than or equal to the right value. If the two values are within
  8944. * <code>absoluteEpsilon</code> of each other, they are considered equal and this function returns true.
  8945. * @param left - The first number to compare.
  8946. * @param right - The second number to compare.
  8947. * @param absoluteEpsilon - The absolute epsilon to use in comparison.
  8948. * @returns <code>true</code> if <code>left</code> is less than <code>right</code> or if the
  8949. * the values are nearly equal.
  8950. */
  8951. function lessThanOrEquals(left: number, right: number, absoluteEpsilon: number): boolean;
  8952. /**
  8953. * Determines if the left value is greater the right value. If the two values are within
  8954. * <code>absoluteEpsilon</code> of each other, they are considered equal and this function returns false.
  8955. * @param left - The first number to compare.
  8956. * @param right - The second number to compare.
  8957. * @param absoluteEpsilon - The absolute epsilon to use in comparison.
  8958. * @returns <code>true</code> if <code>left</code> is greater than <code>right</code> by more than
  8959. * <code>absoluteEpsilon<code>. <code>false</code> if <code>left</code> is less or if the two
  8960. * values are nearly equal.
  8961. */
  8962. function greaterThan(left: number, right: number, absoluteEpsilon: number): boolean;
  8963. /**
  8964. * Determines if the left value is greater than or equal to the right value. If the two values are within
  8965. * <code>absoluteEpsilon</code> of each other, they are considered equal and this function returns true.
  8966. * @param left - The first number to compare.
  8967. * @param right - The second number to compare.
  8968. * @param absoluteEpsilon - The absolute epsilon to use in comparison.
  8969. * @returns <code>true</code> if <code>left</code> is greater than <code>right</code> or if the
  8970. * the values are nearly equal.
  8971. */
  8972. function greaterThanOrEquals(left: number, right: number, absoluteEpsilon: number): boolean;
  8973. /**
  8974. * Computes the factorial of the provided number.
  8975. * @example
  8976. * //Compute 7!, which is equal to 5040
  8977. * var computedFactorial = Cesium.Math.factorial(7);
  8978. * @param n - The number whose factorial is to be computed.
  8979. * @returns The factorial of the provided number or undefined if the number is less than 0.
  8980. */
  8981. function factorial(n: number): number;
  8982. /**
  8983. * Increments a number with a wrapping to a minimum value if the number exceeds the maximum value.
  8984. * @example
  8985. * var n = Cesium.Math.incrementWrap(5, 10, 0); // returns 6
  8986. * var n = Cesium.Math.incrementWrap(10, 10, 0); // returns 0
  8987. * @param [n] - The number to be incremented.
  8988. * @param [maximumValue] - The maximum incremented value before rolling over to the minimum value.
  8989. * @param [minimumValue = 0.0] - The number reset to after the maximum value has been exceeded.
  8990. * @returns The incremented number.
  8991. */
  8992. function incrementWrap(n?: number, maximumValue?: number, minimumValue?: number): number;
  8993. /**
  8994. * Determines if a positive integer is a power of two.
  8995. * @example
  8996. * var t = Cesium.Math.isPowerOfTwo(16); // true
  8997. * var f = Cesium.Math.isPowerOfTwo(20); // false
  8998. * @param n - The positive integer to test.
  8999. * @returns <code>true</code> if the number if a power of two; otherwise, <code>false</code>.
  9000. */
  9001. function isPowerOfTwo(n: number): boolean;
  9002. /**
  9003. * Computes the next power-of-two integer greater than or equal to the provided positive integer.
  9004. * @example
  9005. * var n = Cesium.Math.nextPowerOfTwo(29); // 32
  9006. * var m = Cesium.Math.nextPowerOfTwo(32); // 32
  9007. * @param n - The positive integer to test.
  9008. * @returns The next power-of-two integer.
  9009. */
  9010. function nextPowerOfTwo(n: number): number;
  9011. /**
  9012. * Constraint a value to lie between two values.
  9013. * @param value - The value to constrain.
  9014. * @param min - The minimum value.
  9015. * @param max - The maximum value.
  9016. * @returns The value clamped so that min <= value <= max.
  9017. */
  9018. function clamp(value: number, min: number, max: number): number;
  9019. /**
  9020. * Sets the seed used by the random number generator
  9021. * in {@link Math#nextRandomNumber}.
  9022. * @param seed - An integer used as the seed.
  9023. */
  9024. function setRandomNumberSeed(seed: number): void;
  9025. /**
  9026. * Generates a random floating point number in the range of [0.0, 1.0)
  9027. * using a Mersenne twister.
  9028. * @returns A random number in the range of [0.0, 1.0).
  9029. */
  9030. function nextRandomNumber(): number;
  9031. /**
  9032. * Generates a random number between two numbers.
  9033. * @param min - The minimum value.
  9034. * @param max - The maximum value.
  9035. * @returns A random number between the min and max.
  9036. */
  9037. function randomBetween(min: number, max: number): number;
  9038. /**
  9039. * Computes <code>Math.acos(value)</code>, but first clamps <code>value</code> to the range [-1.0, 1.0]
  9040. * so that the function will never return NaN.
  9041. * @param value - The value for which to compute acos.
  9042. * @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,
  9043. * whichever is closer, if the value is outside the range.
  9044. */
  9045. function acosClamped(value: number): number;
  9046. /**
  9047. * Computes <code>Math.asin(value)</code>, but first clamps <code>value</code> to the range [-1.0, 1.0]
  9048. * so that the function will never return NaN.
  9049. * @param value - The value for which to compute asin.
  9050. * @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,
  9051. * whichever is closer, if the value is outside the range.
  9052. */
  9053. function asinClamped(value: number): number;
  9054. /**
  9055. * Finds the chord length between two points given the circle's radius and the angle between the points.
  9056. * @param angle - The angle between the two points.
  9057. * @param radius - The radius of the circle.
  9058. * @returns The chord length.
  9059. */
  9060. function chordLength(angle: number, radius: number): number;
  9061. /**
  9062. * Finds the logarithm of a number to a base.
  9063. * @param number - The number.
  9064. * @param base - The base.
  9065. * @returns The result.
  9066. */
  9067. function logBase(number: number, base: number): number;
  9068. /**
  9069. * Finds the cube root of a number.
  9070. * Returns NaN if <code>number</code> is not provided.
  9071. * @param [number] - The number.
  9072. * @returns The result.
  9073. */
  9074. function cbrt(number?: number): number;
  9075. /**
  9076. * Finds the base 2 logarithm of a number.
  9077. * @param number - The number.
  9078. * @returns The result.
  9079. */
  9080. function log2(number: number): number;
  9081. /**
  9082. * Computes a fast approximation of Atan for input in the range [-1, 1].
  9083. *
  9084. * Based on Michal Drobot's approximation from ShaderFastLibs,
  9085. * which in turn is based on "Efficient approximations for the arctangent function,"
  9086. * Rajan, S. Sichun Wang Inkol, R. Joyal, A., May 2006.
  9087. * Adapted from ShaderFastLibs under MIT License.
  9088. * @param x - An input number in the range [-1, 1]
  9089. * @returns An approximation of atan(x)
  9090. */
  9091. function fastApproximateAtan(x: number): number;
  9092. /**
  9093. * Computes a fast approximation of Atan2(x, y) for arbitrary input scalars.
  9094. *
  9095. * Range reduction math based on nvidia's cg reference implementation: http://developer.download.nvidia.com/cg/atan2.html
  9096. * @param x - An input number that isn't zero if y is zero.
  9097. * @param y - An input number that isn't zero if x is zero.
  9098. * @returns An approximation of atan2(x, y)
  9099. */
  9100. function fastApproximateAtan2(x: number, y: number): number;
  9101. }
  9102. export interface Matrix2 extends ArrayLike<number> {
  9103. }
  9104. /**
  9105. * A 2x2 matrix, indexable as a column-major order array.
  9106. * Constructor parameters are in row-major order for code readability.
  9107. * @param [column0Row0 = 0.0] - The value for column 0, row 0.
  9108. * @param [column1Row0 = 0.0] - The value for column 1, row 0.
  9109. * @param [column0Row1 = 0.0] - The value for column 0, row 1.
  9110. * @param [column1Row1 = 0.0] - The value for column 1, row 1.
  9111. */
  9112. export class Matrix2 implements ArrayLike<number> {
  9113. constructor(column0Row0?: number, column1Row0?: number, column0Row1?: number, column1Row1?: number);
  9114. /**
  9115. * The number of elements used to pack the object into an array.
  9116. */
  9117. static packedLength: number;
  9118. /**
  9119. * Stores the provided instance into the provided array.
  9120. * @param value - The value to pack.
  9121. * @param array - The array to pack into.
  9122. * @param [startingIndex = 0] - The index into the array at which to start packing the elements.
  9123. * @returns The array that was packed into
  9124. */
  9125. static pack(value: Matrix2, array: number[], startingIndex?: number): number[];
  9126. /**
  9127. * Retrieves an instance from a packed array.
  9128. * @param array - The packed array.
  9129. * @param [startingIndex = 0] - The starting index of the element to be unpacked.
  9130. * @param [result] - The object into which to store the result.
  9131. * @returns The modified result parameter or a new Matrix2 instance if one was not provided.
  9132. */
  9133. static unpack(array: number[], startingIndex?: number, result?: Matrix2): Matrix2;
  9134. /**
  9135. * Duplicates a Matrix2 instance.
  9136. * @param matrix - The matrix to duplicate.
  9137. * @param [result] - The object onto which to store the result.
  9138. * @returns The modified result parameter or a new Matrix2 instance if one was not provided. (Returns undefined if matrix is undefined)
  9139. */
  9140. static clone(matrix: Matrix2, result?: Matrix2): Matrix2;
  9141. /**
  9142. * Creates a Matrix2 from 4 consecutive elements in an array.
  9143. * @example
  9144. * // Create the Matrix2:
  9145. * // [1.0, 2.0]
  9146. * // [1.0, 2.0]
  9147. *
  9148. * var v = [1.0, 1.0, 2.0, 2.0];
  9149. * var m = Cesium.Matrix2.fromArray(v);
  9150. *
  9151. * // Create same Matrix2 with using an offset into an array
  9152. * var v2 = [0.0, 0.0, 1.0, 1.0, 2.0, 2.0];
  9153. * var m2 = Cesium.Matrix2.fromArray(v2, 2);
  9154. * @param array - The array whose 4 consecutive elements correspond to the positions of the matrix. Assumes column-major order.
  9155. * @param [startingIndex = 0] - The offset into the array of the first element, which corresponds to first column first row position in the matrix.
  9156. * @param [result] - The object onto which to store the result.
  9157. * @returns The modified result parameter or a new Matrix2 instance if one was not provided.
  9158. */
  9159. static fromArray(array: number[], startingIndex?: number, result?: Matrix2): Matrix2;
  9160. /**
  9161. * Creates a Matrix2 instance from a column-major order array.
  9162. * @param values - The column-major order array.
  9163. * @param [result] - The object in which the result will be stored, if undefined a new instance will be created.
  9164. * @returns The modified result parameter, or a new Matrix2 instance if one was not provided.
  9165. */
  9166. static fromColumnMajorArray(values: number[], result?: Matrix2): Matrix2;
  9167. /**
  9168. * Creates a Matrix2 instance from a row-major order array.
  9169. * The resulting matrix will be in column-major order.
  9170. * @param values - The row-major order array.
  9171. * @param [result] - The object in which the result will be stored, if undefined a new instance will be created.
  9172. * @returns The modified result parameter, or a new Matrix2 instance if one was not provided.
  9173. */
  9174. static fromRowMajorArray(values: number[], result?: Matrix2): Matrix2;
  9175. /**
  9176. * Computes a Matrix2 instance representing a non-uniform scale.
  9177. * @example
  9178. * // Creates
  9179. * // [7.0, 0.0]
  9180. * // [0.0, 8.0]
  9181. * var m = Cesium.Matrix2.fromScale(new Cesium.Cartesian2(7.0, 8.0));
  9182. * @param scale - The x and y scale factors.
  9183. * @param [result] - The object in which the result will be stored, if undefined a new instance will be created.
  9184. * @returns The modified result parameter, or a new Matrix2 instance if one was not provided.
  9185. */
  9186. static fromScale(scale: Cartesian2, result?: Matrix2): Matrix2;
  9187. /**
  9188. * Computes a Matrix2 instance representing a uniform scale.
  9189. * @example
  9190. * // Creates
  9191. * // [2.0, 0.0]
  9192. * // [0.0, 2.0]
  9193. * var m = Cesium.Matrix2.fromUniformScale(2.0);
  9194. * @param scale - The uniform scale factor.
  9195. * @param [result] - The object in which the result will be stored, if undefined a new instance will be created.
  9196. * @returns The modified result parameter, or a new Matrix2 instance if one was not provided.
  9197. */
  9198. static fromUniformScale(scale: number, result?: Matrix2): Matrix2;
  9199. /**
  9200. * Creates a rotation matrix.
  9201. * @example
  9202. * // Rotate a point 45 degrees counterclockwise.
  9203. * var p = new Cesium.Cartesian2(5, 6);
  9204. * var m = Cesium.Matrix2.fromRotation(Cesium.Math.toRadians(45.0));
  9205. * var rotated = Cesium.Matrix2.multiplyByVector(m, p, new Cesium.Cartesian2());
  9206. * @param angle - The angle, in radians, of the rotation. Positive angles are counterclockwise.
  9207. * @param [result] - The object in which the result will be stored, if undefined a new instance will be created.
  9208. * @returns The modified result parameter, or a new Matrix2 instance if one was not provided.
  9209. */
  9210. static fromRotation(angle: number, result?: Matrix2): Matrix2;
  9211. /**
  9212. * Creates an Array from the provided Matrix2 instance.
  9213. * The array will be in column-major order.
  9214. * @param matrix - The matrix to use..
  9215. * @param [result] - The Array onto which to store the result.
  9216. * @returns The modified Array parameter or a new Array instance if one was not provided.
  9217. */
  9218. static toArray(matrix: Matrix2, result?: number[]): number[];
  9219. /**
  9220. * Computes the array index of the element at the provided row and column.
  9221. * @example
  9222. * var myMatrix = new Cesium.Matrix2();
  9223. * var column1Row0Index = Cesium.Matrix2.getElementIndex(1, 0);
  9224. * var column1Row0 = myMatrix[column1Row0Index]
  9225. * myMatrix[column1Row0Index] = 10.0;
  9226. * @param row - The zero-based index of the row.
  9227. * @param column - The zero-based index of the column.
  9228. * @returns The index of the element at the provided row and column.
  9229. */
  9230. static getElementIndex(row: number, column: number): number;
  9231. /**
  9232. * Retrieves a copy of the matrix column at the provided index as a Cartesian2 instance.
  9233. * @param matrix - The matrix to use.
  9234. * @param index - The zero-based index of the column to retrieve.
  9235. * @param result - The object onto which to store the result.
  9236. * @returns The modified result parameter.
  9237. */
  9238. static getColumn(matrix: Matrix2, index: number, result: Cartesian2): Cartesian2;
  9239. /**
  9240. * Computes a new matrix that replaces the specified column in the provided matrix with the provided Cartesian2 instance.
  9241. * @param matrix - The matrix to use.
  9242. * @param index - The zero-based index of the column to set.
  9243. * @param cartesian - The Cartesian whose values will be assigned to the specified column.
  9244. * @param result - The object onto which to store the result.
  9245. * @returns The modified result parameter.
  9246. */
  9247. static setColumn(matrix: Matrix2, index: number, cartesian: Cartesian2, result: Cartesian2): Matrix2;
  9248. /**
  9249. * Retrieves a copy of the matrix row at the provided index as a Cartesian2 instance.
  9250. * @param matrix - The matrix to use.
  9251. * @param index - The zero-based index of the row to retrieve.
  9252. * @param result - The object onto which to store the result.
  9253. * @returns The modified result parameter.
  9254. */
  9255. static getRow(matrix: Matrix2, index: number, result: Cartesian2): Cartesian2;
  9256. /**
  9257. * Computes a new matrix that replaces the specified row in the provided matrix with the provided Cartesian2 instance.
  9258. * @param matrix - The matrix to use.
  9259. * @param index - The zero-based index of the row to set.
  9260. * @param cartesian - The Cartesian whose values will be assigned to the specified row.
  9261. * @param result - The object onto which to store the result.
  9262. * @returns The modified result parameter.
  9263. */
  9264. static setRow(matrix: Matrix2, index: number, cartesian: Cartesian2, result: Matrix2): Matrix2;
  9265. /**
  9266. * Extracts the non-uniform scale assuming the matrix is an affine transformation.
  9267. * @param matrix - The matrix.
  9268. * @param result - The object onto which to store the result.
  9269. * @returns The modified result parameter.
  9270. */
  9271. static getScale(matrix: Matrix2, result: Cartesian2): Cartesian2;
  9272. /**
  9273. * Computes the maximum scale assuming the matrix is an affine transformation.
  9274. * The maximum scale is the maximum length of the column vectors.
  9275. * @param matrix - The matrix.
  9276. * @returns The maximum scale.
  9277. */
  9278. static getMaximumScale(matrix: Matrix2): number;
  9279. /**
  9280. * Computes the product of two matrices.
  9281. * @param left - The first matrix.
  9282. * @param right - The second matrix.
  9283. * @param result - The object onto which to store the result.
  9284. * @returns The modified result parameter.
  9285. */
  9286. static multiply(left: Matrix2, right: Matrix2, result: Matrix2): Matrix2;
  9287. /**
  9288. * Computes the sum of two matrices.
  9289. * @param left - The first matrix.
  9290. * @param right - The second matrix.
  9291. * @param result - The object onto which to store the result.
  9292. * @returns The modified result parameter.
  9293. */
  9294. static add(left: Matrix2, right: Matrix2, result: Matrix2): Matrix2;
  9295. /**
  9296. * Computes the difference of two matrices.
  9297. * @param left - The first matrix.
  9298. * @param right - The second matrix.
  9299. * @param result - The object onto which to store the result.
  9300. * @returns The modified result parameter.
  9301. */
  9302. static subtract(left: Matrix2, right: Matrix2, result: Matrix2): Matrix2;
  9303. /**
  9304. * Computes the product of a matrix and a column vector.
  9305. * @param matrix - The matrix.
  9306. * @param cartesian - The column.
  9307. * @param result - The object onto which to store the result.
  9308. * @returns The modified result parameter.
  9309. */
  9310. static multiplyByVector(matrix: Matrix2, cartesian: Cartesian2, result: Cartesian2): Cartesian2;
  9311. /**
  9312. * Computes the product of a matrix and a scalar.
  9313. * @param matrix - The matrix.
  9314. * @param scalar - The number to multiply by.
  9315. * @param result - The object onto which to store the result.
  9316. * @returns The modified result parameter.
  9317. */
  9318. static multiplyByScalar(matrix: Matrix2, scalar: number, result: Matrix2): Matrix2;
  9319. /**
  9320. * Computes the product of a matrix times a (non-uniform) scale, as if the scale were a scale matrix.
  9321. * @example
  9322. * // Instead of Cesium.Matrix2.multiply(m, Cesium.Matrix2.fromScale(scale), m);
  9323. * Cesium.Matrix2.multiplyByScale(m, scale, m);
  9324. * @param matrix - The matrix on the left-hand side.
  9325. * @param scale - The non-uniform scale on the right-hand side.
  9326. * @param result - The object onto which to store the result.
  9327. * @returns The modified result parameter.
  9328. */
  9329. static multiplyByScale(matrix: Matrix2, scale: Cartesian2, result: Matrix2): Matrix2;
  9330. /**
  9331. * Creates a negated copy of the provided matrix.
  9332. * @param matrix - The matrix to negate.
  9333. * @param result - The object onto which to store the result.
  9334. * @returns The modified result parameter.
  9335. */
  9336. static negate(matrix: Matrix2, result: Matrix2): Matrix2;
  9337. /**
  9338. * Computes the transpose of the provided matrix.
  9339. * @param matrix - The matrix to transpose.
  9340. * @param result - The object onto which to store the result.
  9341. * @returns The modified result parameter.
  9342. */
  9343. static transpose(matrix: Matrix2, result: Matrix2): Matrix2;
  9344. /**
  9345. * Computes a matrix, which contains the absolute (unsigned) values of the provided matrix's elements.
  9346. * @param matrix - The matrix with signed elements.
  9347. * @param result - The object onto which to store the result.
  9348. * @returns The modified result parameter.
  9349. */
  9350. static abs(matrix: Matrix2, result: Matrix2): Matrix2;
  9351. /**
  9352. * Compares the provided matrices componentwise and returns
  9353. * <code>true</code> if they are equal, <code>false</code> otherwise.
  9354. * @param [left] - The first matrix.
  9355. * @param [right] - The second matrix.
  9356. * @returns <code>true</code> if left and right are equal, <code>false</code> otherwise.
  9357. */
  9358. static equals(left?: Matrix2, right?: Matrix2): boolean;
  9359. /**
  9360. * Compares the provided matrices componentwise and returns
  9361. * <code>true</code> if they are within the provided epsilon,
  9362. * <code>false</code> otherwise.
  9363. * @param [left] - The first matrix.
  9364. * @param [right] - The second matrix.
  9365. * @param [epsilon = 0] - The epsilon to use for equality testing.
  9366. * @returns <code>true</code> if left and right are within the provided epsilon, <code>false</code> otherwise.
  9367. */
  9368. static equalsEpsilon(left?: Matrix2, right?: Matrix2, epsilon?: number): boolean;
  9369. /**
  9370. * An immutable Matrix2 instance initialized to the identity matrix.
  9371. */
  9372. static readonly IDENTITY: Matrix2;
  9373. /**
  9374. * An immutable Matrix2 instance initialized to the zero matrix.
  9375. */
  9376. static readonly ZERO: Matrix2;
  9377. /**
  9378. * The index into Matrix2 for column 0, row 0.
  9379. * @example
  9380. * var matrix = new Cesium.Matrix2();
  9381. * matrix[Cesium.Matrix2.COLUMN0ROW0] = 5.0; // set column 0, row 0 to 5.0
  9382. */
  9383. static readonly COLUMN0ROW0: number;
  9384. /**
  9385. * The index into Matrix2 for column 0, row 1.
  9386. * @example
  9387. * var matrix = new Cesium.Matrix2();
  9388. * matrix[Cesium.Matrix2.COLUMN0ROW1] = 5.0; // set column 0, row 1 to 5.0
  9389. */
  9390. static readonly COLUMN0ROW1: number;
  9391. /**
  9392. * The index into Matrix2 for column 1, row 0.
  9393. * @example
  9394. * var matrix = new Cesium.Matrix2();
  9395. * matrix[Cesium.Matrix2.COLUMN1ROW0] = 5.0; // set column 1, row 0 to 5.0
  9396. */
  9397. static readonly COLUMN1ROW0: number;
  9398. /**
  9399. * The index into Matrix2 for column 1, row 1.
  9400. * @example
  9401. * var matrix = new Cesium.Matrix2();
  9402. * matrix[Cesium.Matrix2.COLUMN1ROW1] = 5.0; // set column 1, row 1 to 5.0
  9403. */
  9404. static readonly COLUMN1ROW1: number;
  9405. /**
  9406. * Gets the number of items in the collection.
  9407. */
  9408. length: number;
  9409. /**
  9410. * Duplicates the provided Matrix2 instance.
  9411. * @param [result] - The object onto which to store the result.
  9412. * @returns The modified result parameter or a new Matrix2 instance if one was not provided.
  9413. */
  9414. clone(result?: Matrix2): Matrix2;
  9415. /**
  9416. * Compares this matrix to the provided matrix componentwise and returns
  9417. * <code>true</code> if they are equal, <code>false</code> otherwise.
  9418. * @param [right] - The right hand side matrix.
  9419. * @returns <code>true</code> if they are equal, <code>false</code> otherwise.
  9420. */
  9421. equals(right?: Matrix2): boolean;
  9422. /**
  9423. * Compares this matrix to the provided matrix componentwise and returns
  9424. * <code>true</code> if they are within the provided epsilon,
  9425. * <code>false</code> otherwise.
  9426. * @param [right] - The right hand side matrix.
  9427. * @param [epsilon = 0] - The epsilon to use for equality testing.
  9428. * @returns <code>true</code> if they are within the provided epsilon, <code>false</code> otherwise.
  9429. */
  9430. equalsEpsilon(right?: Matrix2, epsilon?: number): boolean;
  9431. /**
  9432. * Creates a string representing this Matrix with each row being
  9433. * on a separate line and in the format '(column0, column1)'.
  9434. * @returns A string representing the provided Matrix with each row being on a separate line and in the format '(column0, column1)'.
  9435. */
  9436. toString(): string;
  9437. }
  9438. export interface Matrix3 extends ArrayLike<number> {
  9439. }
  9440. /**
  9441. * A 3x3 matrix, indexable as a column-major order array.
  9442. * Constructor parameters are in row-major order for code readability.
  9443. * @param [column0Row0 = 0.0] - The value for column 0, row 0.
  9444. * @param [column1Row0 = 0.0] - The value for column 1, row 0.
  9445. * @param [column2Row0 = 0.0] - The value for column 2, row 0.
  9446. * @param [column0Row1 = 0.0] - The value for column 0, row 1.
  9447. * @param [column1Row1 = 0.0] - The value for column 1, row 1.
  9448. * @param [column2Row1 = 0.0] - The value for column 2, row 1.
  9449. * @param [column0Row2 = 0.0] - The value for column 0, row 2.
  9450. * @param [column1Row2 = 0.0] - The value for column 1, row 2.
  9451. * @param [column2Row2 = 0.0] - The value for column 2, row 2.
  9452. */
  9453. export class Matrix3 implements ArrayLike<number> {
  9454. constructor(column0Row0?: number, column1Row0?: number, column2Row0?: number, column0Row1?: number, column1Row1?: number, column2Row1?: number, column0Row2?: number, column1Row2?: number, column2Row2?: number);
  9455. /**
  9456. * The number of elements used to pack the object into an array.
  9457. */
  9458. static packedLength: number;
  9459. /**
  9460. * Stores the provided instance into the provided array.
  9461. * @param value - The value to pack.
  9462. * @param array - The array to pack into.
  9463. * @param [startingIndex = 0] - The index into the array at which to start packing the elements.
  9464. * @returns The array that was packed into
  9465. */
  9466. static pack(value: Matrix3, array: number[], startingIndex?: number): number[];
  9467. /**
  9468. * Retrieves an instance from a packed array.
  9469. * @param array - The packed array.
  9470. * @param [startingIndex = 0] - The starting index of the element to be unpacked.
  9471. * @param [result] - The object into which to store the result.
  9472. * @returns The modified result parameter or a new Matrix3 instance if one was not provided.
  9473. */
  9474. static unpack(array: number[], startingIndex?: number, result?: Matrix3): Matrix3;
  9475. /**
  9476. * Duplicates a Matrix3 instance.
  9477. * @param matrix - The matrix to duplicate.
  9478. * @param [result] - The object onto which to store the result.
  9479. * @returns The modified result parameter or a new Matrix3 instance if one was not provided. (Returns undefined if matrix is undefined)
  9480. */
  9481. static clone(matrix: Matrix3, result?: Matrix3): Matrix3;
  9482. /**
  9483. * Creates a Matrix3 from 9 consecutive elements in an array.
  9484. * @example
  9485. * // Create the Matrix3:
  9486. * // [1.0, 2.0, 3.0]
  9487. * // [1.0, 2.0, 3.0]
  9488. * // [1.0, 2.0, 3.0]
  9489. *
  9490. * var v = [1.0, 1.0, 1.0, 2.0, 2.0, 2.0, 3.0, 3.0, 3.0];
  9491. * var m = Cesium.Matrix3.fromArray(v);
  9492. *
  9493. * // Create same Matrix3 with using an offset into an array
  9494. * var v2 = [0.0, 0.0, 1.0, 1.0, 1.0, 2.0, 2.0, 2.0, 3.0, 3.0, 3.0];
  9495. * var m2 = Cesium.Matrix3.fromArray(v2, 2);
  9496. * @param array - The array whose 9 consecutive elements correspond to the positions of the matrix. Assumes column-major order.
  9497. * @param [startingIndex = 0] - The offset into the array of the first element, which corresponds to first column first row position in the matrix.
  9498. * @param [result] - The object onto which to store the result.
  9499. * @returns The modified result parameter or a new Matrix3 instance if one was not provided.
  9500. */
  9501. static fromArray(array: number[], startingIndex?: number, result?: Matrix3): Matrix3;
  9502. /**
  9503. * Creates a Matrix3 instance from a column-major order array.
  9504. * @param values - The column-major order array.
  9505. * @param [result] - The object in which the result will be stored, if undefined a new instance will be created.
  9506. * @returns The modified result parameter, or a new Matrix3 instance if one was not provided.
  9507. */
  9508. static fromColumnMajorArray(values: number[], result?: Matrix3): Matrix3;
  9509. /**
  9510. * Creates a Matrix3 instance from a row-major order array.
  9511. * The resulting matrix will be in column-major order.
  9512. * @param values - The row-major order array.
  9513. * @param [result] - The object in which the result will be stored, if undefined a new instance will be created.
  9514. * @returns The modified result parameter, or a new Matrix3 instance if one was not provided.
  9515. */
  9516. static fromRowMajorArray(values: number[], result?: Matrix3): Matrix3;
  9517. /**
  9518. * Computes a 3x3 rotation matrix from the provided quaternion.
  9519. * @param quaternion - the quaternion to use.
  9520. * @param [result] - The object in which the result will be stored, if undefined a new instance will be created.
  9521. * @returns The 3x3 rotation matrix from this quaternion.
  9522. */
  9523. static fromQuaternion(quaternion: Quaternion, result?: Matrix3): Matrix3;
  9524. /**
  9525. * Computes a 3x3 rotation matrix from the provided headingPitchRoll. (see http://en.wikipedia.org/wiki/Conversion_between_quaternions_and_Euler_angles )
  9526. * @param headingPitchRoll - the headingPitchRoll to use.
  9527. * @param [result] - The object in which the result will be stored, if undefined a new instance will be created.
  9528. * @returns The 3x3 rotation matrix from this headingPitchRoll.
  9529. */
  9530. static fromHeadingPitchRoll(headingPitchRoll: HeadingPitchRoll, result?: Matrix3): Matrix3;
  9531. /**
  9532. * Computes a Matrix3 instance representing a non-uniform scale.
  9533. * @example
  9534. * // Creates
  9535. * // [7.0, 0.0, 0.0]
  9536. * // [0.0, 8.0, 0.0]
  9537. * // [0.0, 0.0, 9.0]
  9538. * var m = Cesium.Matrix3.fromScale(new Cesium.Cartesian3(7.0, 8.0, 9.0));
  9539. * @param scale - The x, y, and z scale factors.
  9540. * @param [result] - The object in which the result will be stored, if undefined a new instance will be created.
  9541. * @returns The modified result parameter, or a new Matrix3 instance if one was not provided.
  9542. */
  9543. static fromScale(scale: Cartesian3, result?: Matrix3): Matrix3;
  9544. /**
  9545. * Computes a Matrix3 instance representing a uniform scale.
  9546. * @example
  9547. * // Creates
  9548. * // [2.0, 0.0, 0.0]
  9549. * // [0.0, 2.0, 0.0]
  9550. * // [0.0, 0.0, 2.0]
  9551. * var m = Cesium.Matrix3.fromUniformScale(2.0);
  9552. * @param scale - The uniform scale factor.
  9553. * @param [result] - The object in which the result will be stored, if undefined a new instance will be created.
  9554. * @returns The modified result parameter, or a new Matrix3 instance if one was not provided.
  9555. */
  9556. static fromUniformScale(scale: number, result?: Matrix3): Matrix3;
  9557. /**
  9558. * Computes a Matrix3 instance representing the cross product equivalent matrix of a Cartesian3 vector.
  9559. * @example
  9560. * // Creates
  9561. * // [0.0, -9.0, 8.0]
  9562. * // [9.0, 0.0, -7.0]
  9563. * // [-8.0, 7.0, 0.0]
  9564. * var m = Cesium.Matrix3.fromCrossProduct(new Cesium.Cartesian3(7.0, 8.0, 9.0));
  9565. * @param vector - the vector on the left hand side of the cross product operation.
  9566. * @param [result] - The object in which the result will be stored, if undefined a new instance will be created.
  9567. * @returns The modified result parameter, or a new Matrix3 instance if one was not provided.
  9568. */
  9569. static fromCrossProduct(vector: Cartesian3, result?: Matrix3): Matrix3;
  9570. /**
  9571. * Creates a rotation matrix around the x-axis.
  9572. * @example
  9573. * // Rotate a point 45 degrees counterclockwise around the x-axis.
  9574. * var p = new Cesium.Cartesian3(5, 6, 7);
  9575. * var m = Cesium.Matrix3.fromRotationX(Cesium.Math.toRadians(45.0));
  9576. * var rotated = Cesium.Matrix3.multiplyByVector(m, p, new Cesium.Cartesian3());
  9577. * @param angle - The angle, in radians, of the rotation. Positive angles are counterclockwise.
  9578. * @param [result] - The object in which the result will be stored, if undefined a new instance will be created.
  9579. * @returns The modified result parameter, or a new Matrix3 instance if one was not provided.
  9580. */
  9581. static fromRotationX(angle: number, result?: Matrix3): Matrix3;
  9582. /**
  9583. * Creates a rotation matrix around the y-axis.
  9584. * @example
  9585. * // Rotate a point 45 degrees counterclockwise around the y-axis.
  9586. * var p = new Cesium.Cartesian3(5, 6, 7);
  9587. * var m = Cesium.Matrix3.fromRotationY(Cesium.Math.toRadians(45.0));
  9588. * var rotated = Cesium.Matrix3.multiplyByVector(m, p, new Cesium.Cartesian3());
  9589. * @param angle - The angle, in radians, of the rotation. Positive angles are counterclockwise.
  9590. * @param [result] - The object in which the result will be stored, if undefined a new instance will be created.
  9591. * @returns The modified result parameter, or a new Matrix3 instance if one was not provided.
  9592. */
  9593. static fromRotationY(angle: number, result?: Matrix3): Matrix3;
  9594. /**
  9595. * Creates a rotation matrix around the z-axis.
  9596. * @example
  9597. * // Rotate a point 45 degrees counterclockwise around the z-axis.
  9598. * var p = new Cesium.Cartesian3(5, 6, 7);
  9599. * var m = Cesium.Matrix3.fromRotationZ(Cesium.Math.toRadians(45.0));
  9600. * var rotated = Cesium.Matrix3.multiplyByVector(m, p, new Cesium.Cartesian3());
  9601. * @param angle - The angle, in radians, of the rotation. Positive angles are counterclockwise.
  9602. * @param [result] - The object in which the result will be stored, if undefined a new instance will be created.
  9603. * @returns The modified result parameter, or a new Matrix3 instance if one was not provided.
  9604. */
  9605. static fromRotationZ(angle: number, result?: Matrix3): Matrix3;
  9606. /**
  9607. * Creates an Array from the provided Matrix3 instance.
  9608. * The array will be in column-major order.
  9609. * @param matrix - The matrix to use..
  9610. * @param [result] - The Array onto which to store the result.
  9611. * @returns The modified Array parameter or a new Array instance if one was not provided.
  9612. */
  9613. static toArray(matrix: Matrix3, result?: number[]): number[];
  9614. /**
  9615. * Computes the array index of the element at the provided row and column.
  9616. * @example
  9617. * var myMatrix = new Cesium.Matrix3();
  9618. * var column1Row0Index = Cesium.Matrix3.getElementIndex(1, 0);
  9619. * var column1Row0 = myMatrix[column1Row0Index]
  9620. * myMatrix[column1Row0Index] = 10.0;
  9621. * @param row - The zero-based index of the row.
  9622. * @param column - The zero-based index of the column.
  9623. * @returns The index of the element at the provided row and column.
  9624. */
  9625. static getElementIndex(row: number, column: number): number;
  9626. /**
  9627. * Retrieves a copy of the matrix column at the provided index as a Cartesian3 instance.
  9628. * @param matrix - The matrix to use.
  9629. * @param index - The zero-based index of the column to retrieve.
  9630. * @param result - The object onto which to store the result.
  9631. * @returns The modified result parameter.
  9632. */
  9633. static getColumn(matrix: Matrix3, index: number, result: Cartesian3): Cartesian3;
  9634. /**
  9635. * Computes a new matrix that replaces the specified column in the provided matrix with the provided Cartesian3 instance.
  9636. * @param matrix - The matrix to use.
  9637. * @param index - The zero-based index of the column to set.
  9638. * @param cartesian - The Cartesian whose values will be assigned to the specified column.
  9639. * @param result - The object onto which to store the result.
  9640. * @returns The modified result parameter.
  9641. */
  9642. static setColumn(matrix: Matrix3, index: number, cartesian: Cartesian3, result: Matrix3): Matrix3;
  9643. /**
  9644. * Retrieves a copy of the matrix row at the provided index as a Cartesian3 instance.
  9645. * @param matrix - The matrix to use.
  9646. * @param index - The zero-based index of the row to retrieve.
  9647. * @param result - The object onto which to store the result.
  9648. * @returns The modified result parameter.
  9649. */
  9650. static getRow(matrix: Matrix3, index: number, result: Cartesian3): Cartesian3;
  9651. /**
  9652. * Computes a new matrix that replaces the specified row in the provided matrix with the provided Cartesian3 instance.
  9653. * @param matrix - The matrix to use.
  9654. * @param index - The zero-based index of the row to set.
  9655. * @param cartesian - The Cartesian whose values will be assigned to the specified row.
  9656. * @param result - The object onto which to store the result.
  9657. * @returns The modified result parameter.
  9658. */
  9659. static setRow(matrix: Matrix3, index: number, cartesian: Cartesian3, result: Matrix3): Matrix3;
  9660. /**
  9661. * Extracts the non-uniform scale assuming the matrix is an affine transformation.
  9662. * @param matrix - The matrix.
  9663. * @param result - The object onto which to store the result.
  9664. * @returns The modified result parameter.
  9665. */
  9666. static getScale(matrix: Matrix3, result: Cartesian3): Cartesian3;
  9667. /**
  9668. * Computes the maximum scale assuming the matrix is an affine transformation.
  9669. * The maximum scale is the maximum length of the column vectors.
  9670. * @param matrix - The matrix.
  9671. * @returns The maximum scale.
  9672. */
  9673. static getMaximumScale(matrix: Matrix3): number;
  9674. /**
  9675. * Computes the product of two matrices.
  9676. * @param left - The first matrix.
  9677. * @param right - The second matrix.
  9678. * @param result - The object onto which to store the result.
  9679. * @returns The modified result parameter.
  9680. */
  9681. static multiply(left: Matrix3, right: Matrix3, result: Matrix3): Matrix3;
  9682. /**
  9683. * Computes the sum of two matrices.
  9684. * @param left - The first matrix.
  9685. * @param right - The second matrix.
  9686. * @param result - The object onto which to store the result.
  9687. * @returns The modified result parameter.
  9688. */
  9689. static add(left: Matrix3, right: Matrix3, result: Matrix3): Matrix3;
  9690. /**
  9691. * Computes the difference of two matrices.
  9692. * @param left - The first matrix.
  9693. * @param right - The second matrix.
  9694. * @param result - The object onto which to store the result.
  9695. * @returns The modified result parameter.
  9696. */
  9697. static subtract(left: Matrix3, right: Matrix3, result: Matrix3): Matrix3;
  9698. /**
  9699. * Computes the product of a matrix and a column vector.
  9700. * @param matrix - The matrix.
  9701. * @param cartesian - The column.
  9702. * @param result - The object onto which to store the result.
  9703. * @returns The modified result parameter.
  9704. */
  9705. static multiplyByVector(matrix: Matrix3, cartesian: Cartesian3, result: Cartesian3): Cartesian3;
  9706. /**
  9707. * Computes the product of a matrix and a scalar.
  9708. * @param matrix - The matrix.
  9709. * @param scalar - The number to multiply by.
  9710. * @param result - The object onto which to store the result.
  9711. * @returns The modified result parameter.
  9712. */
  9713. static multiplyByScalar(matrix: Matrix3, scalar: number, result: Matrix3): Matrix3;
  9714. /**
  9715. * Computes the product of a matrix times a (non-uniform) scale, as if the scale were a scale matrix.
  9716. * @example
  9717. * // Instead of Cesium.Matrix3.multiply(m, Cesium.Matrix3.fromScale(scale), m);
  9718. * Cesium.Matrix3.multiplyByScale(m, scale, m);
  9719. * @param matrix - The matrix on the left-hand side.
  9720. * @param scale - The non-uniform scale on the right-hand side.
  9721. * @param result - The object onto which to store the result.
  9722. * @returns The modified result parameter.
  9723. */
  9724. static multiplyByScale(matrix: Matrix3, scale: Cartesian3, result: Matrix3): Matrix3;
  9725. /**
  9726. * Creates a negated copy of the provided matrix.
  9727. * @param matrix - The matrix to negate.
  9728. * @param result - The object onto which to store the result.
  9729. * @returns The modified result parameter.
  9730. */
  9731. static negate(matrix: Matrix3, result: Matrix3): Matrix3;
  9732. /**
  9733. * Computes the transpose of the provided matrix.
  9734. * @param matrix - The matrix to transpose.
  9735. * @param result - The object onto which to store the result.
  9736. * @returns The modified result parameter.
  9737. */
  9738. static transpose(matrix: Matrix3, result: Matrix3): Matrix3;
  9739. /**
  9740. * Extracts the rotation assuming the matrix is an affine transformation.
  9741. * @param matrix - The matrix.
  9742. * @param result - The object onto which to store the result.
  9743. * @returns The modified result parameter
  9744. */
  9745. static getRotation(matrix: Matrix3, result: Matrix3): Matrix3;
  9746. /**
  9747. * Computes the eigenvectors and eigenvalues of a symmetric matrix.
  9748. * <p>
  9749. * Returns a diagonal matrix and unitary matrix such that:
  9750. * <code>matrix = unitary matrix * diagonal matrix * transpose(unitary matrix)</code>
  9751. * </p>
  9752. * <p>
  9753. * The values along the diagonal of the diagonal matrix are the eigenvalues. The columns
  9754. * of the unitary matrix are the corresponding eigenvectors.
  9755. * </p>
  9756. * @example
  9757. * var a = //... symetric matrix
  9758. * var result = {
  9759. * unitary : new Cesium.Matrix3(),
  9760. * diagonal : new Cesium.Matrix3()
  9761. * };
  9762. * Cesium.Matrix3.computeEigenDecomposition(a, result);
  9763. *
  9764. * var unitaryTranspose = Cesium.Matrix3.transpose(result.unitary, new Cesium.Matrix3());
  9765. * var b = Cesium.Matrix3.multiply(result.unitary, result.diagonal, new Cesium.Matrix3());
  9766. * Cesium.Matrix3.multiply(b, unitaryTranspose, b); // b is now equal to a
  9767. *
  9768. * var lambda = Cesium.Matrix3.getColumn(result.diagonal, 0, new Cesium.Cartesian3()).x; // first eigenvalue
  9769. * var v = Cesium.Matrix3.getColumn(result.unitary, 0, new Cesium.Cartesian3()); // first eigenvector
  9770. * var c = Cesium.Cartesian3.multiplyByScalar(v, lambda, new Cesium.Cartesian3()); // equal to Cesium.Matrix3.multiplyByVector(a, v)
  9771. * @param matrix - The matrix to decompose into diagonal and unitary matrix. Expected to be symmetric.
  9772. * @param [result] - An object with unitary and diagonal properties which are matrices onto which to store the result.
  9773. * @returns An object with unitary and diagonal properties which are the unitary and diagonal matrices, respectively.
  9774. */
  9775. static computeEigenDecomposition(matrix: Matrix3, result?: any): any;
  9776. /**
  9777. * Computes a matrix, which contains the absolute (unsigned) values of the provided matrix's elements.
  9778. * @param matrix - The matrix with signed elements.
  9779. * @param result - The object onto which to store the result.
  9780. * @returns The modified result parameter.
  9781. */
  9782. static abs(matrix: Matrix3, result: Matrix3): Matrix3;
  9783. /**
  9784. * Computes the determinant of the provided matrix.
  9785. * @param matrix - The matrix to use.
  9786. * @returns The value of the determinant of the matrix.
  9787. */
  9788. static determinant(matrix: Matrix3): number;
  9789. /**
  9790. * Computes the inverse of the provided matrix.
  9791. * @param matrix - The matrix to invert.
  9792. * @param result - The object onto which to store the result.
  9793. * @returns The modified result parameter.
  9794. */
  9795. static inverse(matrix: Matrix3, result: Matrix3): Matrix3;
  9796. /**
  9797. * Compares the provided matrices componentwise and returns
  9798. * <code>true</code> if they are equal, <code>false</code> otherwise.
  9799. * @param [left] - The first matrix.
  9800. * @param [right] - The second matrix.
  9801. * @returns <code>true</code> if left and right are equal, <code>false</code> otherwise.
  9802. */
  9803. static equals(left?: Matrix3, right?: Matrix3): boolean;
  9804. /**
  9805. * Compares the provided matrices componentwise and returns
  9806. * <code>true</code> if they are within the provided epsilon,
  9807. * <code>false</code> otherwise.
  9808. * @param [left] - The first matrix.
  9809. * @param [right] - The second matrix.
  9810. * @param [epsilon = 0] - The epsilon to use for equality testing.
  9811. * @returns <code>true</code> if left and right are within the provided epsilon, <code>false</code> otherwise.
  9812. */
  9813. static equalsEpsilon(left?: Matrix3, right?: Matrix3, epsilon?: number): boolean;
  9814. /**
  9815. * An immutable Matrix3 instance initialized to the identity matrix.
  9816. */
  9817. static readonly IDENTITY: Matrix3;
  9818. /**
  9819. * An immutable Matrix3 instance initialized to the zero matrix.
  9820. */
  9821. static readonly ZERO: Matrix3;
  9822. /**
  9823. * The index into Matrix3 for column 0, row 0.
  9824. */
  9825. static readonly COLUMN0ROW0: number;
  9826. /**
  9827. * The index into Matrix3 for column 0, row 1.
  9828. */
  9829. static readonly COLUMN0ROW1: number;
  9830. /**
  9831. * The index into Matrix3 for column 0, row 2.
  9832. */
  9833. static readonly COLUMN0ROW2: number;
  9834. /**
  9835. * The index into Matrix3 for column 1, row 0.
  9836. */
  9837. static readonly COLUMN1ROW0: number;
  9838. /**
  9839. * The index into Matrix3 for column 1, row 1.
  9840. */
  9841. static readonly COLUMN1ROW1: number;
  9842. /**
  9843. * The index into Matrix3 for column 1, row 2.
  9844. */
  9845. static readonly COLUMN1ROW2: number;
  9846. /**
  9847. * The index into Matrix3 for column 2, row 0.
  9848. */
  9849. static readonly COLUMN2ROW0: number;
  9850. /**
  9851. * The index into Matrix3 for column 2, row 1.
  9852. */
  9853. static readonly COLUMN2ROW1: number;
  9854. /**
  9855. * The index into Matrix3 for column 2, row 2.
  9856. */
  9857. static readonly COLUMN2ROW2: number;
  9858. /**
  9859. * Gets the number of items in the collection.
  9860. */
  9861. length: number;
  9862. /**
  9863. * Duplicates the provided Matrix3 instance.
  9864. * @param [result] - The object onto which to store the result.
  9865. * @returns The modified result parameter or a new Matrix3 instance if one was not provided.
  9866. */
  9867. clone(result?: Matrix3): Matrix3;
  9868. /**
  9869. * Compares this matrix to the provided matrix componentwise and returns
  9870. * <code>true</code> if they are equal, <code>false</code> otherwise.
  9871. * @param [right] - The right hand side matrix.
  9872. * @returns <code>true</code> if they are equal, <code>false</code> otherwise.
  9873. */
  9874. equals(right?: Matrix3): boolean;
  9875. /**
  9876. * Compares this matrix to the provided matrix componentwise and returns
  9877. * <code>true</code> if they are within the provided epsilon,
  9878. * <code>false</code> otherwise.
  9879. * @param [right] - The right hand side matrix.
  9880. * @param [epsilon = 0] - The epsilon to use for equality testing.
  9881. * @returns <code>true</code> if they are within the provided epsilon, <code>false</code> otherwise.
  9882. */
  9883. equalsEpsilon(right?: Matrix3, epsilon?: number): boolean;
  9884. /**
  9885. * Creates a string representing this Matrix with each row being
  9886. * on a separate line and in the format '(column0, column1, column2)'.
  9887. * @returns A string representing the provided Matrix with each row being on a separate line and in the format '(column0, column1, column2)'.
  9888. */
  9889. toString(): string;
  9890. }
  9891. export interface Matrix4 extends ArrayLike<number> {
  9892. }
  9893. /**
  9894. * A 4x4 matrix, indexable as a column-major order array.
  9895. * Constructor parameters are in row-major order for code readability.
  9896. * @param [column0Row0 = 0.0] - The value for column 0, row 0.
  9897. * @param [column1Row0 = 0.0] - The value for column 1, row 0.
  9898. * @param [column2Row0 = 0.0] - The value for column 2, row 0.
  9899. * @param [column3Row0 = 0.0] - The value for column 3, row 0.
  9900. * @param [column0Row1 = 0.0] - The value for column 0, row 1.
  9901. * @param [column1Row1 = 0.0] - The value for column 1, row 1.
  9902. * @param [column2Row1 = 0.0] - The value for column 2, row 1.
  9903. * @param [column3Row1 = 0.0] - The value for column 3, row 1.
  9904. * @param [column0Row2 = 0.0] - The value for column 0, row 2.
  9905. * @param [column1Row2 = 0.0] - The value for column 1, row 2.
  9906. * @param [column2Row2 = 0.0] - The value for column 2, row 2.
  9907. * @param [column3Row2 = 0.0] - The value for column 3, row 2.
  9908. * @param [column0Row3 = 0.0] - The value for column 0, row 3.
  9909. * @param [column1Row3 = 0.0] - The value for column 1, row 3.
  9910. * @param [column2Row3 = 0.0] - The value for column 2, row 3.
  9911. * @param [column3Row3 = 0.0] - The value for column 3, row 3.
  9912. */
  9913. export class Matrix4 implements ArrayLike<number> {
  9914. 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);
  9915. /**
  9916. * The number of elements used to pack the object into an array.
  9917. */
  9918. static packedLength: number;
  9919. /**
  9920. * Stores the provided instance into the provided array.
  9921. * @param value - The value to pack.
  9922. * @param array - The array to pack into.
  9923. * @param [startingIndex = 0] - The index into the array at which to start packing the elements.
  9924. * @returns The array that was packed into
  9925. */
  9926. static pack(value: Matrix4, array: number[], startingIndex?: number): number[];
  9927. /**
  9928. * Retrieves an instance from a packed array.
  9929. * @param array - The packed array.
  9930. * @param [startingIndex = 0] - The starting index of the element to be unpacked.
  9931. * @param [result] - The object into which to store the result.
  9932. * @returns The modified result parameter or a new Matrix4 instance if one was not provided.
  9933. */
  9934. static unpack(array: number[], startingIndex?: number, result?: Matrix4): Matrix4;
  9935. /**
  9936. * Duplicates a Matrix4 instance.
  9937. * @param matrix - The matrix to duplicate.
  9938. * @param [result] - The object onto which to store the result.
  9939. * @returns The modified result parameter or a new Matrix4 instance if one was not provided. (Returns undefined if matrix is undefined)
  9940. */
  9941. static clone(matrix: Matrix4, result?: Matrix4): Matrix4;
  9942. /**
  9943. * Creates a Matrix4 from 16 consecutive elements in an array.
  9944. * @example
  9945. * // Create the Matrix4:
  9946. * // [1.0, 2.0, 3.0, 4.0]
  9947. * // [1.0, 2.0, 3.0, 4.0]
  9948. * // [1.0, 2.0, 3.0, 4.0]
  9949. * // [1.0, 2.0, 3.0, 4.0]
  9950. *
  9951. * var v = [1.0, 1.0, 1.0, 1.0, 2.0, 2.0, 2.0, 2.0, 3.0, 3.0, 3.0, 3.0, 4.0, 4.0, 4.0, 4.0];
  9952. * var m = Cesium.Matrix4.fromArray(v);
  9953. *
  9954. * // Create same Matrix4 with using an offset into an array
  9955. * var v2 = [0.0, 0.0, 1.0, 1.0, 1.0, 1.0, 2.0, 2.0, 2.0, 2.0, 3.0, 3.0, 3.0, 3.0, 4.0, 4.0, 4.0, 4.0];
  9956. * var m2 = Cesium.Matrix4.fromArray(v2, 2);
  9957. * @param array - The array whose 16 consecutive elements correspond to the positions of the matrix. Assumes column-major order.
  9958. * @param [startingIndex = 0] - The offset into the array of the first element, which corresponds to first column first row position in the matrix.
  9959. * @param [result] - The object onto which to store the result.
  9960. * @returns The modified result parameter or a new Matrix4 instance if one was not provided.
  9961. */
  9962. static fromArray(array: number[], startingIndex?: number, result?: Matrix4): Matrix4;
  9963. /**
  9964. * Computes a Matrix4 instance from a column-major order array.
  9965. * @param values - The column-major order array.
  9966. * @param [result] - The object in which the result will be stored, if undefined a new instance will be created.
  9967. * @returns The modified result parameter, or a new Matrix4 instance if one was not provided.
  9968. */
  9969. static fromColumnMajorArray(values: number[], result?: Matrix4): Matrix4;
  9970. /**
  9971. * Computes a Matrix4 instance from a row-major order array.
  9972. * The resulting matrix will be in column-major order.
  9973. * @param values - The row-major order array.
  9974. * @param [result] - The object in which the result will be stored, if undefined a new instance will be created.
  9975. * @returns The modified result parameter, or a new Matrix4 instance if one was not provided.
  9976. */
  9977. static fromRowMajorArray(values: number[], result?: Matrix4): Matrix4;
  9978. /**
  9979. * Computes a Matrix4 instance from a Matrix3 representing the rotation
  9980. * and a Cartesian3 representing the translation.
  9981. * @param rotation - The upper left portion of the matrix representing the rotation.
  9982. * @param [translation = Cartesian3.ZERO] - The upper right portion of the matrix representing the translation.
  9983. * @param [result] - The object in which the result will be stored, if undefined a new instance will be created.
  9984. * @returns The modified result parameter, or a new Matrix4 instance if one was not provided.
  9985. */
  9986. static fromRotationTranslation(rotation: Matrix3, translation?: Cartesian3, result?: Matrix4): Matrix4;
  9987. /**
  9988. * Computes a Matrix4 instance from a translation, rotation, and scale (TRS)
  9989. * representation with the rotation represented as a quaternion.
  9990. * @example
  9991. * var result = Cesium.Matrix4.fromTranslationQuaternionRotationScale(
  9992. * new Cesium.Cartesian3(1.0, 2.0, 3.0), // translation
  9993. * Cesium.Quaternion.IDENTITY, // rotation
  9994. * new Cesium.Cartesian3(7.0, 8.0, 9.0), // scale
  9995. * result);
  9996. * @param translation - The translation transformation.
  9997. * @param rotation - The rotation transformation.
  9998. * @param scale - The non-uniform scale transformation.
  9999. * @param [result] - The object in which the result will be stored, if undefined a new instance will be created.
  10000. * @returns The modified result parameter, or a new Matrix4 instance if one was not provided.
  10001. */
  10002. static fromTranslationQuaternionRotationScale(translation: Cartesian3, rotation: Quaternion, scale: Cartesian3, result?: Matrix4): Matrix4;
  10003. /**
  10004. * Creates a Matrix4 instance from a {@link TranslationRotationScale} instance.
  10005. * @param translationRotationScale - The instance.
  10006. * @param [result] - The object in which the result will be stored, if undefined a new instance will be created.
  10007. * @returns The modified result parameter, or a new Matrix4 instance if one was not provided.
  10008. */
  10009. static fromTranslationRotationScale(translationRotationScale: TranslationRotationScale, result?: Matrix4): Matrix4;
  10010. /**
  10011. * Creates a Matrix4 instance from a Cartesian3 representing the translation.
  10012. * @param translation - The upper right portion of the matrix representing the translation.
  10013. * @param [result] - The object in which the result will be stored, if undefined a new instance will be created.
  10014. * @returns The modified result parameter, or a new Matrix4 instance if one was not provided.
  10015. */
  10016. static fromTranslation(translation: Cartesian3, result?: Matrix4): Matrix4;
  10017. /**
  10018. * Computes a Matrix4 instance representing a non-uniform scale.
  10019. * @example
  10020. * // Creates
  10021. * // [7.0, 0.0, 0.0, 0.0]
  10022. * // [0.0, 8.0, 0.0, 0.0]
  10023. * // [0.0, 0.0, 9.0, 0.0]
  10024. * // [0.0, 0.0, 0.0, 1.0]
  10025. * var m = Cesium.Matrix4.fromScale(new Cesium.Cartesian3(7.0, 8.0, 9.0));
  10026. * @param scale - The x, y, and z scale factors.
  10027. * @param [result] - The object in which the result will be stored, if undefined a new instance will be created.
  10028. * @returns The modified result parameter, or a new Matrix4 instance if one was not provided.
  10029. */
  10030. static fromScale(scale: Cartesian3, result?: Matrix4): Matrix4;
  10031. /**
  10032. * Computes a Matrix4 instance representing a uniform scale.
  10033. * @example
  10034. * // Creates
  10035. * // [2.0, 0.0, 0.0, 0.0]
  10036. * // [0.0, 2.0, 0.0, 0.0]
  10037. * // [0.0, 0.0, 2.0, 0.0]
  10038. * // [0.0, 0.0, 0.0, 1.0]
  10039. * var m = Cesium.Matrix4.fromUniformScale(2.0);
  10040. * @param scale - The uniform scale factor.
  10041. * @param [result] - The object in which the result will be stored, if undefined a new instance will be created.
  10042. * @returns The modified result parameter, or a new Matrix4 instance if one was not provided.
  10043. */
  10044. static fromUniformScale(scale: number, result?: Matrix4): Matrix4;
  10045. /**
  10046. * Computes a Matrix4 instance from a Camera.
  10047. * @param camera - The camera to use.
  10048. * @param [result] - The object in which the result will be stored, if undefined a new instance will be created.
  10049. * @returns The modified result parameter, or a new Matrix4 instance if one was not provided.
  10050. */
  10051. static fromCamera(camera: Camera, result?: Matrix4): Matrix4;
  10052. /**
  10053. * Computes a Matrix4 instance representing a perspective transformation matrix.
  10054. * @param fovY - The field of view along the Y axis in radians.
  10055. * @param aspectRatio - The aspect ratio.
  10056. * @param near - The distance to the near plane in meters.
  10057. * @param far - The distance to the far plane in meters.
  10058. * @param result - The object in which the result will be stored.
  10059. * @returns The modified result parameter.
  10060. */
  10061. static computePerspectiveFieldOfView(fovY: number, aspectRatio: number, near: number, far: number, result: Matrix4): Matrix4;
  10062. /**
  10063. * Computes a Matrix4 instance representing an orthographic transformation matrix.
  10064. * @param left - The number of meters to the left of the camera that will be in view.
  10065. * @param right - The number of meters to the right of the camera that will be in view.
  10066. * @param bottom - The number of meters below of the camera that will be in view.
  10067. * @param top - The number of meters above of the camera that will be in view.
  10068. * @param near - The distance to the near plane in meters.
  10069. * @param far - The distance to the far plane in meters.
  10070. * @param result - The object in which the result will be stored.
  10071. * @returns The modified result parameter.
  10072. */
  10073. static computeOrthographicOffCenter(left: number, right: number, bottom: number, top: number, near: number, far: number, result: Matrix4): Matrix4;
  10074. /**
  10075. * Computes a Matrix4 instance representing an off center perspective transformation.
  10076. * @param left - The number of meters to the left of the camera that will be in view.
  10077. * @param right - The number of meters to the right of the camera that will be in view.
  10078. * @param bottom - The number of meters below of the camera that will be in view.
  10079. * @param top - The number of meters above of the camera that will be in view.
  10080. * @param near - The distance to the near plane in meters.
  10081. * @param far - The distance to the far plane in meters.
  10082. * @param result - The object in which the result will be stored.
  10083. * @returns The modified result parameter.
  10084. */
  10085. static computePerspectiveOffCenter(left: number, right: number, bottom: number, top: number, near: number, far: number, result: Matrix4): Matrix4;
  10086. /**
  10087. * Computes a Matrix4 instance representing an infinite off center perspective transformation.
  10088. * @param left - The number of meters to the left of the camera that will be in view.
  10089. * @param right - The number of meters to the right of the camera that will be in view.
  10090. * @param bottom - The number of meters below of the camera that will be in view.
  10091. * @param top - The number of meters above of the camera that will be in view.
  10092. * @param near - The distance to the near plane in meters.
  10093. * @param result - The object in which the result will be stored.
  10094. * @returns The modified result parameter.
  10095. */
  10096. static computeInfinitePerspectiveOffCenter(left: number, right: number, bottom: number, top: number, near: number, result: Matrix4): Matrix4;
  10097. /**
  10098. * Computes a Matrix4 instance that transforms from normalized device coordinates to window coordinates.
  10099. * @example
  10100. * // Create viewport transformation using an explicit viewport and depth range.
  10101. * var m = Cesium.Matrix4.computeViewportTransformation({
  10102. * x : 0.0,
  10103. * y : 0.0,
  10104. * width : 1024.0,
  10105. * height : 768.0
  10106. * }, 0.0, 1.0, new Cesium.Matrix4());
  10107. * @param [viewport = { x : 0.0, y : 0.0, width : 0.0, height : 0.0 }] - The viewport's corners as shown in Example 1.
  10108. * @param [nearDepthRange = 0.0] - The near plane distance in window coordinates.
  10109. * @param [farDepthRange = 1.0] - The far plane distance in window coordinates.
  10110. * @param [result] - The object in which the result will be stored.
  10111. * @returns The modified result parameter.
  10112. */
  10113. static computeViewportTransformation(viewport?: any, nearDepthRange?: number, farDepthRange?: number, result?: Matrix4): Matrix4;
  10114. /**
  10115. * Computes a Matrix4 instance that transforms from world space to view space.
  10116. * @param position - The position of the camera.
  10117. * @param direction - The forward direction.
  10118. * @param up - The up direction.
  10119. * @param right - The right direction.
  10120. * @param result - The object in which the result will be stored.
  10121. * @returns The modified result parameter.
  10122. */
  10123. static computeView(position: Cartesian3, direction: Cartesian3, up: Cartesian3, right: Cartesian3, result: Matrix4): Matrix4;
  10124. /**
  10125. * Computes an Array from the provided Matrix4 instance.
  10126. * The array will be in column-major order.
  10127. * @example
  10128. * //create an array from an instance of Matrix4
  10129. * // m = [10.0, 14.0, 18.0, 22.0]
  10130. * // [11.0, 15.0, 19.0, 23.0]
  10131. * // [12.0, 16.0, 20.0, 24.0]
  10132. * // [13.0, 17.0, 21.0, 25.0]
  10133. * var a = Cesium.Matrix4.toArray(m);
  10134. *
  10135. * // m remains the same
  10136. * //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]
  10137. * @param matrix - The matrix to use..
  10138. * @param [result] - The Array onto which to store the result.
  10139. * @returns The modified Array parameter or a new Array instance if one was not provided.
  10140. */
  10141. static toArray(matrix: Matrix4, result?: number[]): number[];
  10142. /**
  10143. * Computes the array index of the element at the provided row and column.
  10144. * @example
  10145. * var myMatrix = new Cesium.Matrix4();
  10146. * var column1Row0Index = Cesium.Matrix4.getElementIndex(1, 0);
  10147. * var column1Row0 = myMatrix[column1Row0Index];
  10148. * myMatrix[column1Row0Index] = 10.0;
  10149. * @param row - The zero-based index of the row.
  10150. * @param column - The zero-based index of the column.
  10151. * @returns The index of the element at the provided row and column.
  10152. */
  10153. static getElementIndex(row: number, column: number): number;
  10154. /**
  10155. * Retrieves a copy of the matrix column at the provided index as a Cartesian4 instance.
  10156. * @example
  10157. * //returns a Cartesian4 instance with values from the specified column
  10158. * // m = [10.0, 11.0, 12.0, 13.0]
  10159. * // [14.0, 15.0, 16.0, 17.0]
  10160. * // [18.0, 19.0, 20.0, 21.0]
  10161. * // [22.0, 23.0, 24.0, 25.0]
  10162. *
  10163. * //Example 1: Creates an instance of Cartesian
  10164. * var a = Cesium.Matrix4.getColumn(m, 2, new Cesium.Cartesian4());
  10165. * @example
  10166. * //Example 2: Sets values for Cartesian instance
  10167. * var a = new Cesium.Cartesian4();
  10168. * Cesium.Matrix4.getColumn(m, 2, a);
  10169. *
  10170. * // a.x = 12.0; a.y = 16.0; a.z = 20.0; a.w = 24.0;
  10171. * @param matrix - The matrix to use.
  10172. * @param index - The zero-based index of the column to retrieve.
  10173. * @param result - The object onto which to store the result.
  10174. * @returns The modified result parameter.
  10175. */
  10176. static getColumn(matrix: Matrix4, index: number, result: Cartesian4): Cartesian4;
  10177. /**
  10178. * Computes a new matrix that replaces the specified column in the provided matrix with the provided Cartesian4 instance.
  10179. * @example
  10180. * //creates a new Matrix4 instance with new column values from the Cartesian4 instance
  10181. * // m = [10.0, 11.0, 12.0, 13.0]
  10182. * // [14.0, 15.0, 16.0, 17.0]
  10183. * // [18.0, 19.0, 20.0, 21.0]
  10184. * // [22.0, 23.0, 24.0, 25.0]
  10185. *
  10186. * var a = Cesium.Matrix4.setColumn(m, 2, new Cesium.Cartesian4(99.0, 98.0, 97.0, 96.0), new Cesium.Matrix4());
  10187. *
  10188. * // m remains the same
  10189. * // a = [10.0, 11.0, 99.0, 13.0]
  10190. * // [14.0, 15.0, 98.0, 17.0]
  10191. * // [18.0, 19.0, 97.0, 21.0]
  10192. * // [22.0, 23.0, 96.0, 25.0]
  10193. * @param matrix - The matrix to use.
  10194. * @param index - The zero-based index of the column to set.
  10195. * @param cartesian - The Cartesian whose values will be assigned to the specified column.
  10196. * @param result - The object onto which to store the result.
  10197. * @returns The modified result parameter.
  10198. */
  10199. static setColumn(matrix: Matrix4, index: number, cartesian: Cartesian4, result: Matrix4): Matrix4;
  10200. /**
  10201. * Computes a new matrix that replaces the translation in the rightmost column of the provided
  10202. * matrix with the provided translation. This assumes the matrix is an affine transformation
  10203. * @param matrix - The matrix to use.
  10204. * @param translation - The translation that replaces the translation of the provided matrix.
  10205. * @param result - The object onto which to store the result.
  10206. * @returns The modified result parameter.
  10207. */
  10208. static setTranslation(matrix: Matrix4, translation: Cartesian3, result: Matrix4): Matrix4;
  10209. /**
  10210. * Computes a new matrix that replaces the scale with the provided scale. This assumes the matrix is an affine transformation
  10211. * @param matrix - The matrix to use.
  10212. * @param scale - The scale that replaces the scale of the provided matrix.
  10213. * @param result - The object onto which to store the result.
  10214. * @returns The modified result parameter.
  10215. */
  10216. static setScale(matrix: Matrix4, scale: Cartesian3, result: Matrix4): Matrix4;
  10217. /**
  10218. * Retrieves a copy of the matrix row at the provided index as a Cartesian4 instance.
  10219. * @example
  10220. * //returns a Cartesian4 instance with values from the specified column
  10221. * // m = [10.0, 11.0, 12.0, 13.0]
  10222. * // [14.0, 15.0, 16.0, 17.0]
  10223. * // [18.0, 19.0, 20.0, 21.0]
  10224. * // [22.0, 23.0, 24.0, 25.0]
  10225. *
  10226. * //Example 1: Returns an instance of Cartesian
  10227. * var a = Cesium.Matrix4.getRow(m, 2, new Cesium.Cartesian4());
  10228. * @example
  10229. * //Example 2: Sets values for a Cartesian instance
  10230. * var a = new Cesium.Cartesian4();
  10231. * Cesium.Matrix4.getRow(m, 2, a);
  10232. *
  10233. * // a.x = 18.0; a.y = 19.0; a.z = 20.0; a.w = 21.0;
  10234. * @param matrix - The matrix to use.
  10235. * @param index - The zero-based index of the row to retrieve.
  10236. * @param result - The object onto which to store the result.
  10237. * @returns The modified result parameter.
  10238. */
  10239. static getRow(matrix: Matrix4, index: number, result: Cartesian4): Cartesian4;
  10240. /**
  10241. * Computes a new matrix that replaces the specified row in the provided matrix with the provided Cartesian4 instance.
  10242. * @example
  10243. * //create a new Matrix4 instance with new row values from the Cartesian4 instance
  10244. * // m = [10.0, 11.0, 12.0, 13.0]
  10245. * // [14.0, 15.0, 16.0, 17.0]
  10246. * // [18.0, 19.0, 20.0, 21.0]
  10247. * // [22.0, 23.0, 24.0, 25.0]
  10248. *
  10249. * var a = Cesium.Matrix4.setRow(m, 2, new Cesium.Cartesian4(99.0, 98.0, 97.0, 96.0), new Cesium.Matrix4());
  10250. *
  10251. * // m remains the same
  10252. * // a = [10.0, 11.0, 12.0, 13.0]
  10253. * // [14.0, 15.0, 16.0, 17.0]
  10254. * // [99.0, 98.0, 97.0, 96.0]
  10255. * // [22.0, 23.0, 24.0, 25.0]
  10256. * @param matrix - The matrix to use.
  10257. * @param index - The zero-based index of the row to set.
  10258. * @param cartesian - The Cartesian whose values will be assigned to the specified row.
  10259. * @param result - The object onto which to store the result.
  10260. * @returns The modified result parameter.
  10261. */
  10262. static setRow(matrix: Matrix4, index: number, cartesian: Cartesian4, result: Matrix4): Matrix4;
  10263. /**
  10264. * Extracts the non-uniform scale assuming the matrix is an affine transformation.
  10265. * @param matrix - The matrix.
  10266. * @param result - The object onto which to store the result.
  10267. * @returns The modified result parameter
  10268. */
  10269. static getScale(matrix: Matrix4, result: Cartesian3): Cartesian3;
  10270. /**
  10271. * Computes the maximum scale assuming the matrix is an affine transformation.
  10272. * The maximum scale is the maximum length of the column vectors in the upper-left
  10273. * 3x3 matrix.
  10274. * @param matrix - The matrix.
  10275. * @returns The maximum scale.
  10276. */
  10277. static getMaximumScale(matrix: Matrix4): number;
  10278. /**
  10279. * Computes the product of two matrices.
  10280. * @param left - The first matrix.
  10281. * @param right - The second matrix.
  10282. * @param result - The object onto which to store the result.
  10283. * @returns The modified result parameter.
  10284. */
  10285. static multiply(left: Matrix4, right: Matrix4, result: Matrix4): Matrix4;
  10286. /**
  10287. * Computes the sum of two matrices.
  10288. * @param left - The first matrix.
  10289. * @param right - The second matrix.
  10290. * @param result - The object onto which to store the result.
  10291. * @returns The modified result parameter.
  10292. */
  10293. static add(left: Matrix4, right: Matrix4, result: Matrix4): Matrix4;
  10294. /**
  10295. * Computes the difference of two matrices.
  10296. * @param left - The first matrix.
  10297. * @param right - The second matrix.
  10298. * @param result - The object onto which to store the result.
  10299. * @returns The modified result parameter.
  10300. */
  10301. static subtract(left: Matrix4, right: Matrix4, result: Matrix4): Matrix4;
  10302. /**
  10303. * Computes the product of two matrices assuming the matrices are
  10304. * affine transformation matrices, where the upper left 3x3 elements
  10305. * are a rotation matrix, and the upper three elements in the fourth
  10306. * column are the translation. The bottom row is assumed to be [0, 0, 0, 1].
  10307. * The matrix is not verified to be in the proper form.
  10308. * This method is faster than computing the product for general 4x4
  10309. * matrices using {@link Matrix4.multiply}.
  10310. * @example
  10311. * var m1 = new Cesium.Matrix4(1.0, 6.0, 7.0, 0.0, 2.0, 5.0, 8.0, 0.0, 3.0, 4.0, 9.0, 0.0, 0.0, 0.0, 0.0, 1.0);
  10312. * var m2 = Cesium.Transforms.eastNorthUpToFixedFrame(new Cesium.Cartesian3(1.0, 1.0, 1.0));
  10313. * var m3 = Cesium.Matrix4.multiplyTransformation(m1, m2, new Cesium.Matrix4());
  10314. * @param left - The first matrix.
  10315. * @param right - The second matrix.
  10316. * @param result - The object onto which to store the result.
  10317. * @returns The modified result parameter.
  10318. */
  10319. static multiplyTransformation(left: Matrix4, right: Matrix4, result: Matrix4): Matrix4;
  10320. /**
  10321. * Multiplies a transformation matrix (with a bottom row of <code>[0.0, 0.0, 0.0, 1.0]</code>)
  10322. * by a 3x3 rotation matrix. This is an optimization
  10323. * for <code>Matrix4.multiply(m, Matrix4.fromRotationTranslation(rotation), m);</code> with less allocations and arithmetic operations.
  10324. * @example
  10325. * // Instead of Cesium.Matrix4.multiply(m, Cesium.Matrix4.fromRotationTranslation(rotation), m);
  10326. * Cesium.Matrix4.multiplyByMatrix3(m, rotation, m);
  10327. * @param matrix - The matrix on the left-hand side.
  10328. * @param rotation - The 3x3 rotation matrix on the right-hand side.
  10329. * @param result - The object onto which to store the result.
  10330. * @returns The modified result parameter.
  10331. */
  10332. static multiplyByMatrix3(matrix: Matrix4, rotation: Matrix3, result: Matrix4): Matrix4;
  10333. /**
  10334. * Multiplies a transformation matrix (with a bottom row of <code>[0.0, 0.0, 0.0, 1.0]</code>)
  10335. * by an implicit translation matrix defined by a {@link Cartesian3}. This is an optimization
  10336. * for <code>Matrix4.multiply(m, Matrix4.fromTranslation(position), m);</code> with less allocations and arithmetic operations.
  10337. * @example
  10338. * // Instead of Cesium.Matrix4.multiply(m, Cesium.Matrix4.fromTranslation(position), m);
  10339. * Cesium.Matrix4.multiplyByTranslation(m, position, m);
  10340. * @param matrix - The matrix on the left-hand side.
  10341. * @param translation - The translation on the right-hand side.
  10342. * @param result - The object onto which to store the result.
  10343. * @returns The modified result parameter.
  10344. */
  10345. static multiplyByTranslation(matrix: Matrix4, translation: Cartesian3, result: Matrix4): Matrix4;
  10346. /**
  10347. * Multiplies an affine transformation matrix (with a bottom row of <code>[0.0, 0.0, 0.0, 1.0]</code>)
  10348. * by an implicit uniform scale matrix. This is an optimization
  10349. * for <code>Matrix4.multiply(m, Matrix4.fromUniformScale(scale), m);</code>, where
  10350. * <code>m</code> must be an affine matrix.
  10351. * This function performs fewer allocations and arithmetic operations.
  10352. * @example
  10353. * // Instead of Cesium.Matrix4.multiply(m, Cesium.Matrix4.fromUniformScale(scale), m);
  10354. * Cesium.Matrix4.multiplyByUniformScale(m, scale, m);
  10355. * @param matrix - The affine matrix on the left-hand side.
  10356. * @param scale - The uniform scale on the right-hand side.
  10357. * @param result - The object onto which to store the result.
  10358. * @returns The modified result parameter.
  10359. */
  10360. static multiplyByUniformScale(matrix: Matrix4, scale: number, result: Matrix4): Matrix4;
  10361. /**
  10362. * Multiplies an affine transformation matrix (with a bottom row of <code>[0.0, 0.0, 0.0, 1.0]</code>)
  10363. * by an implicit non-uniform scale matrix. This is an optimization
  10364. * for <code>Matrix4.multiply(m, Matrix4.fromUniformScale(scale), m);</code>, where
  10365. * <code>m</code> must be an affine matrix.
  10366. * This function performs fewer allocations and arithmetic operations.
  10367. * @example
  10368. * // Instead of Cesium.Matrix4.multiply(m, Cesium.Matrix4.fromScale(scale), m);
  10369. * Cesium.Matrix4.multiplyByScale(m, scale, m);
  10370. * @param matrix - The affine matrix on the left-hand side.
  10371. * @param scale - The non-uniform scale on the right-hand side.
  10372. * @param result - The object onto which to store the result.
  10373. * @returns The modified result parameter.
  10374. */
  10375. static multiplyByScale(matrix: Matrix4, scale: Cartesian3, result: Matrix4): Matrix4;
  10376. /**
  10377. * Computes the product of a matrix and a column vector.
  10378. * @param matrix - The matrix.
  10379. * @param cartesian - The vector.
  10380. * @param result - The object onto which to store the result.
  10381. * @returns The modified result parameter.
  10382. */
  10383. static multiplyByVector(matrix: Matrix4, cartesian: Cartesian4, result: Cartesian4): Cartesian4;
  10384. /**
  10385. * Computes the product of a matrix and a {@link Cartesian3}. This is equivalent to calling {@link Matrix4.multiplyByVector}
  10386. * with a {@link Cartesian4} with a <code>w</code> component of zero.
  10387. * @example
  10388. * var p = new Cesium.Cartesian3(1.0, 2.0, 3.0);
  10389. * var result = Cesium.Matrix4.multiplyByPointAsVector(matrix, p, new Cesium.Cartesian3());
  10390. * // A shortcut for
  10391. * // Cartesian3 p = ...
  10392. * // Cesium.Matrix4.multiplyByVector(matrix, new Cesium.Cartesian4(p.x, p.y, p.z, 0.0), result);
  10393. * @param matrix - The matrix.
  10394. * @param cartesian - The point.
  10395. * @param result - The object onto which to store the result.
  10396. * @returns The modified result parameter.
  10397. */
  10398. static multiplyByPointAsVector(matrix: Matrix4, cartesian: Cartesian3, result: Cartesian3): Cartesian3;
  10399. /**
  10400. * Computes the product of a matrix and a {@link Cartesian3}. This is equivalent to calling {@link Matrix4.multiplyByVector}
  10401. * with a {@link Cartesian4} with a <code>w</code> component of 1, but returns a {@link Cartesian3} instead of a {@link Cartesian4}.
  10402. * @example
  10403. * var p = new Cesium.Cartesian3(1.0, 2.0, 3.0);
  10404. * var result = Cesium.Matrix4.multiplyByPoint(matrix, p, new Cesium.Cartesian3());
  10405. * @param matrix - The matrix.
  10406. * @param cartesian - The point.
  10407. * @param result - The object onto which to store the result.
  10408. * @returns The modified result parameter.
  10409. */
  10410. static multiplyByPoint(matrix: Matrix4, cartesian: Cartesian3, result: Cartesian3): Cartesian3;
  10411. /**
  10412. * Computes the product of a matrix and a scalar.
  10413. * @example
  10414. * //create a Matrix4 instance which is a scaled version of the supplied Matrix4
  10415. * // m = [10.0, 11.0, 12.0, 13.0]
  10416. * // [14.0, 15.0, 16.0, 17.0]
  10417. * // [18.0, 19.0, 20.0, 21.0]
  10418. * // [22.0, 23.0, 24.0, 25.0]
  10419. *
  10420. * var a = Cesium.Matrix4.multiplyByScalar(m, -2, new Cesium.Matrix4());
  10421. *
  10422. * // m remains the same
  10423. * // a = [-20.0, -22.0, -24.0, -26.0]
  10424. * // [-28.0, -30.0, -32.0, -34.0]
  10425. * // [-36.0, -38.0, -40.0, -42.0]
  10426. * // [-44.0, -46.0, -48.0, -50.0]
  10427. * @param matrix - The matrix.
  10428. * @param scalar - The number to multiply by.
  10429. * @param result - The object onto which to store the result.
  10430. * @returns The modified result parameter.
  10431. */
  10432. static multiplyByScalar(matrix: Matrix4, scalar: number, result: Matrix4): Matrix4;
  10433. /**
  10434. * Computes a negated copy of the provided matrix.
  10435. * @example
  10436. * //create a new Matrix4 instance which is a negation of a Matrix4
  10437. * // m = [10.0, 11.0, 12.0, 13.0]
  10438. * // [14.0, 15.0, 16.0, 17.0]
  10439. * // [18.0, 19.0, 20.0, 21.0]
  10440. * // [22.0, 23.0, 24.0, 25.0]
  10441. *
  10442. * var a = Cesium.Matrix4.negate(m, new Cesium.Matrix4());
  10443. *
  10444. * // m remains the same
  10445. * // a = [-10.0, -11.0, -12.0, -13.0]
  10446. * // [-14.0, -15.0, -16.0, -17.0]
  10447. * // [-18.0, -19.0, -20.0, -21.0]
  10448. * // [-22.0, -23.0, -24.0, -25.0]
  10449. * @param matrix - The matrix to negate.
  10450. * @param result - The object onto which to store the result.
  10451. * @returns The modified result parameter.
  10452. */
  10453. static negate(matrix: Matrix4, result: Matrix4): Matrix4;
  10454. /**
  10455. * Computes the transpose of the provided matrix.
  10456. * @example
  10457. * //returns transpose of a Matrix4
  10458. * // m = [10.0, 11.0, 12.0, 13.0]
  10459. * // [14.0, 15.0, 16.0, 17.0]
  10460. * // [18.0, 19.0, 20.0, 21.0]
  10461. * // [22.0, 23.0, 24.0, 25.0]
  10462. *
  10463. * var a = Cesium.Matrix4.transpose(m, new Cesium.Matrix4());
  10464. *
  10465. * // m remains the same
  10466. * // a = [10.0, 14.0, 18.0, 22.0]
  10467. * // [11.0, 15.0, 19.0, 23.0]
  10468. * // [12.0, 16.0, 20.0, 24.0]
  10469. * // [13.0, 17.0, 21.0, 25.0]
  10470. * @param matrix - The matrix to transpose.
  10471. * @param result - The object onto which to store the result.
  10472. * @returns The modified result parameter.
  10473. */
  10474. static transpose(matrix: Matrix4, result: Matrix4): Matrix4;
  10475. /**
  10476. * Computes a matrix, which contains the absolute (unsigned) values of the provided matrix's elements.
  10477. * @param matrix - The matrix with signed elements.
  10478. * @param result - The object onto which to store the result.
  10479. * @returns The modified result parameter.
  10480. */
  10481. static abs(matrix: Matrix4, result: Matrix4): Matrix4;
  10482. /**
  10483. * Compares the provided matrices componentwise and returns
  10484. * <code>true</code> if they are equal, <code>false</code> otherwise.
  10485. * @example
  10486. * //compares two Matrix4 instances
  10487. *
  10488. * // a = [10.0, 14.0, 18.0, 22.0]
  10489. * // [11.0, 15.0, 19.0, 23.0]
  10490. * // [12.0, 16.0, 20.0, 24.0]
  10491. * // [13.0, 17.0, 21.0, 25.0]
  10492. *
  10493. * // b = [10.0, 14.0, 18.0, 22.0]
  10494. * // [11.0, 15.0, 19.0, 23.0]
  10495. * // [12.0, 16.0, 20.0, 24.0]
  10496. * // [13.0, 17.0, 21.0, 25.0]
  10497. *
  10498. * if(Cesium.Matrix4.equals(a,b)) {
  10499. * console.log("Both matrices are equal");
  10500. * } else {
  10501. * console.log("They are not equal");
  10502. * }
  10503. *
  10504. * //Prints "Both matrices are equal" on the console
  10505. * @param [left] - The first matrix.
  10506. * @param [right] - The second matrix.
  10507. * @returns <code>true</code> if left and right are equal, <code>false</code> otherwise.
  10508. */
  10509. static equals(left?: Matrix4, right?: Matrix4): boolean;
  10510. /**
  10511. * Compares the provided matrices componentwise and returns
  10512. * <code>true</code> if they are within the provided epsilon,
  10513. * <code>false</code> otherwise.
  10514. * @example
  10515. * //compares two Matrix4 instances
  10516. *
  10517. * // a = [10.5, 14.5, 18.5, 22.5]
  10518. * // [11.5, 15.5, 19.5, 23.5]
  10519. * // [12.5, 16.5, 20.5, 24.5]
  10520. * // [13.5, 17.5, 21.5, 25.5]
  10521. *
  10522. * // b = [10.0, 14.0, 18.0, 22.0]
  10523. * // [11.0, 15.0, 19.0, 23.0]
  10524. * // [12.0, 16.0, 20.0, 24.0]
  10525. * // [13.0, 17.0, 21.0, 25.0]
  10526. *
  10527. * if(Cesium.Matrix4.equalsEpsilon(a,b,0.1)){
  10528. * console.log("Difference between both the matrices is less than 0.1");
  10529. * } else {
  10530. * console.log("Difference between both the matrices is not less than 0.1");
  10531. * }
  10532. *
  10533. * //Prints "Difference between both the matrices is not less than 0.1" on the console
  10534. * @param [left] - The first matrix.
  10535. * @param [right] - The second matrix.
  10536. * @param [epsilon = 0] - The epsilon to use for equality testing.
  10537. * @returns <code>true</code> if left and right are within the provided epsilon, <code>false</code> otherwise.
  10538. */
  10539. static equalsEpsilon(left?: Matrix4, right?: Matrix4, epsilon?: number): boolean;
  10540. /**
  10541. * Gets the translation portion of the provided matrix, assuming the matrix is a affine transformation matrix.
  10542. * @param matrix - The matrix to use.
  10543. * @param result - The object onto which to store the result.
  10544. * @returns The modified result parameter.
  10545. */
  10546. static getTranslation(matrix: Matrix4, result: Cartesian3): Cartesian3;
  10547. /**
  10548. * Gets the upper left 3x3 rotation matrix of the provided matrix, assuming the matrix is an affine transformation matrix.
  10549. * @example
  10550. * // returns a Matrix3 instance from a Matrix4 instance
  10551. *
  10552. * // m = [10.0, 14.0, 18.0, 22.0]
  10553. * // [11.0, 15.0, 19.0, 23.0]
  10554. * // [12.0, 16.0, 20.0, 24.0]
  10555. * // [13.0, 17.0, 21.0, 25.0]
  10556. *
  10557. * var b = new Cesium.Matrix3();
  10558. * Cesium.Matrix4.getMatrix3(m,b);
  10559. *
  10560. * // b = [10.0, 14.0, 18.0]
  10561. * // [11.0, 15.0, 19.0]
  10562. * // [12.0, 16.0, 20.0]
  10563. * @param matrix - The matrix to use.
  10564. * @param result - The object onto which to store the result.
  10565. * @returns The modified result parameter.
  10566. */
  10567. static getMatrix3(matrix: Matrix4, result: Matrix3): Matrix3;
  10568. /**
  10569. * Computes the inverse of the provided matrix using Cramers Rule.
  10570. * If the determinant is zero, the matrix can not be inverted, and an exception is thrown.
  10571. * If the matrix is an affine transformation matrix, it is more efficient
  10572. * to invert it with {@link Matrix4.inverseTransformation}.
  10573. * @param matrix - The matrix to invert.
  10574. * @param result - The object onto which to store the result.
  10575. * @returns The modified result parameter.
  10576. */
  10577. static inverse(matrix: Matrix4, result: Matrix4): Matrix4;
  10578. /**
  10579. * Computes the inverse of the provided matrix assuming it is
  10580. * an affine transformation matrix, where the upper left 3x3 elements
  10581. * are a rotation matrix, and the upper three elements in the fourth
  10582. * column are the translation. The bottom row is assumed to be [0, 0, 0, 1].
  10583. * The matrix is not verified to be in the proper form.
  10584. * This method is faster than computing the inverse for a general 4x4
  10585. * matrix using {@link Matrix4.inverse}.
  10586. * @param matrix - The matrix to invert.
  10587. * @param result - The object onto which to store the result.
  10588. * @returns The modified result parameter.
  10589. */
  10590. static inverseTransformation(matrix: Matrix4, result: Matrix4): Matrix4;
  10591. /**
  10592. * An immutable Matrix4 instance initialized to the identity matrix.
  10593. */
  10594. static readonly IDENTITY: Matrix4;
  10595. /**
  10596. * An immutable Matrix4 instance initialized to the zero matrix.
  10597. */
  10598. static readonly ZERO: Matrix4;
  10599. /**
  10600. * The index into Matrix4 for column 0, row 0.
  10601. */
  10602. static readonly COLUMN0ROW0: number;
  10603. /**
  10604. * The index into Matrix4 for column 0, row 1.
  10605. */
  10606. static readonly COLUMN0ROW1: number;
  10607. /**
  10608. * The index into Matrix4 for column 0, row 2.
  10609. */
  10610. static readonly COLUMN0ROW2: number;
  10611. /**
  10612. * The index into Matrix4 for column 0, row 3.
  10613. */
  10614. static readonly COLUMN0ROW3: number;
  10615. /**
  10616. * The index into Matrix4 for column 1, row 0.
  10617. */
  10618. static readonly COLUMN1ROW0: number;
  10619. /**
  10620. * The index into Matrix4 for column 1, row 1.
  10621. */
  10622. static readonly COLUMN1ROW1: number;
  10623. /**
  10624. * The index into Matrix4 for column 1, row 2.
  10625. */
  10626. static readonly COLUMN1ROW2: number;
  10627. /**
  10628. * The index into Matrix4 for column 1, row 3.
  10629. */
  10630. static readonly COLUMN1ROW3: number;
  10631. /**
  10632. * The index into Matrix4 for column 2, row 0.
  10633. */
  10634. static readonly COLUMN2ROW0: number;
  10635. /**
  10636. * The index into Matrix4 for column 2, row 1.
  10637. */
  10638. static readonly COLUMN2ROW1: number;
  10639. /**
  10640. * The index into Matrix4 for column 2, row 2.
  10641. */
  10642. static readonly COLUMN2ROW2: number;
  10643. /**
  10644. * The index into Matrix4 for column 2, row 3.
  10645. */
  10646. static readonly COLUMN2ROW3: number;
  10647. /**
  10648. * The index into Matrix4 for column 3, row 0.
  10649. */
  10650. static readonly COLUMN3ROW0: number;
  10651. /**
  10652. * The index into Matrix4 for column 3, row 1.
  10653. */
  10654. static readonly COLUMN3ROW1: number;
  10655. /**
  10656. * The index into Matrix4 for column 3, row 2.
  10657. */
  10658. static readonly COLUMN3ROW2: number;
  10659. /**
  10660. * The index into Matrix4 for column 3, row 3.
  10661. */
  10662. static readonly COLUMN3ROW3: number;
  10663. /**
  10664. * Gets the number of items in the collection.
  10665. */
  10666. length: number;
  10667. /**
  10668. * Duplicates the provided Matrix4 instance.
  10669. * @param [result] - The object onto which to store the result.
  10670. * @returns The modified result parameter or a new Matrix4 instance if one was not provided.
  10671. */
  10672. clone(result?: Matrix4): Matrix4;
  10673. /**
  10674. * Compares this matrix to the provided matrix componentwise and returns
  10675. * <code>true</code> if they are equal, <code>false</code> otherwise.
  10676. * @param [right] - The right hand side matrix.
  10677. * @returns <code>true</code> if they are equal, <code>false</code> otherwise.
  10678. */
  10679. equals(right?: Matrix4): boolean;
  10680. /**
  10681. * Compares this matrix to the provided matrix componentwise and returns
  10682. * <code>true</code> if they are within the provided epsilon,
  10683. * <code>false</code> otherwise.
  10684. * @param [right] - The right hand side matrix.
  10685. * @param [epsilon = 0] - The epsilon to use for equality testing.
  10686. * @returns <code>true</code> if they are within the provided epsilon, <code>false</code> otherwise.
  10687. */
  10688. equalsEpsilon(right?: Matrix4, epsilon?: number): boolean;
  10689. /**
  10690. * Computes a string representing this Matrix with each row being
  10691. * on a separate line and in the format '(column0, column1, column2, column3)'.
  10692. * @returns A string representing the provided Matrix with each row being on a separate line and in the format '(column0, column1, column2, column3)'.
  10693. */
  10694. toString(): string;
  10695. }
  10696. /**
  10697. * Represents a scalar value's lower and upper bound at a near distance and far distance in eye space.
  10698. * @param [near = 0.0] - The lower bound of the camera range.
  10699. * @param [nearValue = 0.0] - The value at the lower bound of the camera range.
  10700. * @param [far = 1.0] - The upper bound of the camera range.
  10701. * @param [farValue = 0.0] - The value at the upper bound of the camera range.
  10702. */
  10703. export class NearFarScalar {
  10704. constructor(near?: number, nearValue?: number, far?: number, farValue?: number);
  10705. /**
  10706. * The lower bound of the camera range.
  10707. */
  10708. near: number;
  10709. /**
  10710. * The value at the lower bound of the camera range.
  10711. */
  10712. nearValue: number;
  10713. /**
  10714. * The upper bound of the camera range.
  10715. */
  10716. far: number;
  10717. /**
  10718. * The value at the upper bound of the camera range.
  10719. */
  10720. farValue: number;
  10721. /**
  10722. * Duplicates a NearFarScalar instance.
  10723. * @param nearFarScalar - The NearFarScalar to duplicate.
  10724. * @param [result] - The object onto which to store the result.
  10725. * @returns The modified result parameter or a new NearFarScalar instance if one was not provided. (Returns undefined if nearFarScalar is undefined)
  10726. */
  10727. static clone(nearFarScalar: NearFarScalar, result?: NearFarScalar): NearFarScalar;
  10728. /**
  10729. * The number of elements used to pack the object into an array.
  10730. */
  10731. static packedLength: number;
  10732. /**
  10733. * Stores the provided instance into the provided array.
  10734. * @param value - The value to pack.
  10735. * @param array - The array to pack into.
  10736. * @param [startingIndex = 0] - The index into the array at which to start packing the elements.
  10737. * @returns The array that was packed into
  10738. */
  10739. static pack(value: NearFarScalar, array: number[], startingIndex?: number): number[];
  10740. /**
  10741. * Retrieves an instance from a packed array.
  10742. * @param array - The packed array.
  10743. * @param [startingIndex = 0] - The starting index of the element to be unpacked.
  10744. * @param [result] - The object into which to store the result.
  10745. * @returns The modified result parameter or a new NearFarScalar instance if one was not provided.
  10746. */
  10747. static unpack(array: number[], startingIndex?: number, result?: NearFarScalar): NearFarScalar;
  10748. /**
  10749. * Compares the provided NearFarScalar and returns <code>true</code> if they are equal,
  10750. * <code>false</code> otherwise.
  10751. * @param [left] - The first NearFarScalar.
  10752. * @param [right] - The second NearFarScalar.
  10753. * @returns <code>true</code> if left and right are equal; otherwise <code>false</code>.
  10754. */
  10755. static equals(left?: NearFarScalar, right?: NearFarScalar): boolean;
  10756. /**
  10757. * Duplicates this instance.
  10758. * @param [result] - The object onto which to store the result.
  10759. * @returns The modified result parameter or a new NearFarScalar instance if one was not provided.
  10760. */
  10761. clone(result?: NearFarScalar): NearFarScalar;
  10762. /**
  10763. * Compares this instance to the provided NearFarScalar and returns <code>true</code> if they are equal,
  10764. * <code>false</code> otherwise.
  10765. * @param [right] - The right hand side NearFarScalar.
  10766. * @returns <code>true</code> if left and right are equal; otherwise <code>false</code>.
  10767. */
  10768. equals(right?: NearFarScalar): boolean;
  10769. }
  10770. /**
  10771. * Creates an Occluder derived from an object's position and radius, as well as the camera position.
  10772. * The occluder can be used to determine whether or not other objects are visible or hidden behind the
  10773. * visible horizon defined by the occluder and camera position.
  10774. * @example
  10775. * // Construct an occluder one unit away from the origin with a radius of one.
  10776. * var cameraPosition = Cesium.Cartesian3.ZERO;
  10777. * var occluderBoundingSphere = new Cesium.BoundingSphere(new Cesium.Cartesian3(0, 0, -1), 1);
  10778. * var occluder = new Cesium.Occluder(occluderBoundingSphere, cameraPosition);
  10779. * @param occluderBoundingSphere - The bounding sphere surrounding the occluder.
  10780. * @param cameraPosition - The coordinate of the viewer/camera.
  10781. */
  10782. export class Occluder {
  10783. constructor(occluderBoundingSphere: BoundingSphere, cameraPosition: Cartesian3);
  10784. /**
  10785. * The position of the occluder.
  10786. */
  10787. position: Cartesian3;
  10788. /**
  10789. * The radius of the occluder.
  10790. */
  10791. radius: number;
  10792. /**
  10793. * The position of the camera.
  10794. */
  10795. cameraPosition: Cartesian3;
  10796. /**
  10797. * Creates an occluder from a bounding sphere and the camera position.
  10798. * @param occluderBoundingSphere - The bounding sphere surrounding the occluder.
  10799. * @param cameraPosition - The coordinate of the viewer/camera.
  10800. * @param [result] - The object onto which to store the result.
  10801. * @returns The occluder derived from an object's position and radius, as well as the camera position.
  10802. */
  10803. static fromBoundingSphere(occluderBoundingSphere: BoundingSphere, cameraPosition: Cartesian3, result?: Occluder): Occluder;
  10804. /**
  10805. * Determines whether or not a point, the <code>occludee</code>, is hidden from view by the occluder.
  10806. * @example
  10807. * var cameraPosition = new Cesium.Cartesian3(0, 0, 0);
  10808. * var littleSphere = new Cesium.BoundingSphere(new Cesium.Cartesian3(0, 0, -1), 0.25);
  10809. * var occluder = new Cesium.Occluder(littleSphere, cameraPosition);
  10810. * var point = new Cesium.Cartesian3(0, 0, -3);
  10811. * occluder.isPointVisible(point); //returns true
  10812. * @param occludee - The point surrounding the occludee object.
  10813. * @returns <code>true</code> if the occludee is visible; otherwise <code>false</code>.
  10814. */
  10815. isPointVisible(occludee: Cartesian3): boolean;
  10816. /**
  10817. * Determines whether or not a sphere, the <code>occludee</code>, is hidden from view by the occluder.
  10818. * @example
  10819. * var cameraPosition = new Cesium.Cartesian3(0, 0, 0);
  10820. * var littleSphere = new Cesium.BoundingSphere(new Cesium.Cartesian3(0, 0, -1), 0.25);
  10821. * var occluder = new Cesium.Occluder(littleSphere, cameraPosition);
  10822. * var bigSphere = new Cesium.BoundingSphere(new Cesium.Cartesian3(0, 0, -3), 1);
  10823. * occluder.isBoundingSphereVisible(bigSphere); //returns true
  10824. * @param occludee - The bounding sphere surrounding the occludee object.
  10825. * @returns <code>true</code> if the occludee is visible; otherwise <code>false</code>.
  10826. */
  10827. isBoundingSphereVisible(occludee: BoundingSphere): boolean;
  10828. /**
  10829. * Determine to what extent an occludee is visible (not visible, partially visible, or fully visible).
  10830. * @example
  10831. * var sphere1 = new Cesium.BoundingSphere(new Cesium.Cartesian3(0, 0, -1.5), 0.5);
  10832. * var sphere2 = new Cesium.BoundingSphere(new Cesium.Cartesian3(0, 0, -2.5), 0.5);
  10833. * var cameraPosition = new Cesium.Cartesian3(0, 0, 0);
  10834. * var occluder = new Cesium.Occluder(sphere1, cameraPosition);
  10835. * occluder.computeVisibility(sphere2); //returns Visibility.NONE
  10836. * @param occludeeBS - The bounding sphere of the occludee.
  10837. * @returns Visibility.NONE if the occludee is not visible,
  10838. * Visibility.PARTIAL if the occludee is partially visible, or
  10839. * Visibility.FULL if the occludee is fully visible.
  10840. */
  10841. computeVisibility(occludeeBS: BoundingSphere): Visibility;
  10842. /**
  10843. * Computes a point that can be used as the occludee position to the visibility functions.
  10844. * Use a radius of zero for the occludee radius. Typically, a user computes a bounding sphere around
  10845. * an object that is used for visibility; however it is also possible to compute a point that if
  10846. * seen/not seen would also indicate if an object is visible/not visible. This function is better
  10847. * called for objects that do not move relative to the occluder and is large, such as a chunk of
  10848. * terrain. You are better off not calling this and using the object's bounding sphere for objects
  10849. * such as a satellite or ground vehicle.
  10850. * @example
  10851. * var cameraPosition = new Cesium.Cartesian3(0, 0, 0);
  10852. * var occluderBoundingSphere = new Cesium.BoundingSphere(new Cesium.Cartesian3(0, 0, -8), 2);
  10853. * var occluder = new Cesium.Occluder(occluderBoundingSphere, cameraPosition);
  10854. * var positions = [new Cesium.Cartesian3(-0.25, 0, -5.3), new Cesium.Cartesian3(0.25, 0, -5.3)];
  10855. * var tileOccluderSphere = Cesium.BoundingSphere.fromPoints(positions);
  10856. * var occludeePosition = tileOccluderSphere.center;
  10857. * var occludeePt = Cesium.Occluder.computeOccludeePoint(occluderBoundingSphere, occludeePosition, positions);
  10858. * @param occluderBoundingSphere - The bounding sphere surrounding the occluder.
  10859. * @param occludeePosition - The point where the occludee (bounding sphere of radius 0) is located.
  10860. * @param positions - List of altitude points on the horizon near the surface of the occluder.
  10861. * @returns An object containing two attributes: <code>occludeePoint</code> and <code>valid</code>
  10862. * which is a boolean value.
  10863. */
  10864. static computeOccludeePoint(occluderBoundingSphere: BoundingSphere, occludeePosition: Cartesian3, positions: Cartesian3[]): any;
  10865. /**
  10866. * Computes a point that can be used as the occludee position to the visibility functions from a rectangle.
  10867. * @param rectangle - The rectangle used to create a bounding sphere.
  10868. * @param [ellipsoid = Ellipsoid.WGS84] - The ellipsoid used to determine positions of the rectangle.
  10869. * @returns An object containing two attributes: <code>occludeePoint</code> and <code>valid</code>
  10870. * which is a boolean value.
  10871. */
  10872. static computeOccludeePointFromRectangle(rectangle: Rectangle, ellipsoid?: Ellipsoid): any;
  10873. }
  10874. /**
  10875. * Provides geocoding via a {@link https://opencagedata.com/|OpenCage} server.
  10876. * @example
  10877. * // Configure a Viewer to use the OpenCage Geocoder
  10878. * var viewer = new Cesium.Viewer('cesiumContainer', {
  10879. * geocoder: new Cesium.OpenCageGeocoderService('https://api.opencagedata.com/geocode/v1/', '<API key>')
  10880. * });
  10881. * @param url - The endpoint to the OpenCage server.
  10882. * @param apiKey - The OpenCage API Key.
  10883. * @param [params] - An object with the following properties (See https://opencagedata.com/api#forward-opt):
  10884. * @param [params.abbrv] - When set to 1 we attempt to abbreviate and shorten the formatted string we return.
  10885. * @param [options.add_request] - When set to 1 the various request parameters are added to the response for ease of debugging.
  10886. * @param [options.bounds] - Provides the geocoder with a hint to the region that the query resides in.
  10887. * @param [options.countrycode] - Restricts the results to the specified country or countries (as defined by the ISO 3166-1 Alpha 2 standard).
  10888. * @param [options.jsonp] - Wraps the returned JSON with a function name.
  10889. * @param [options.language] - An IETF format language code.
  10890. * @param [options.limit] - The maximum number of results we should return.
  10891. * @param [options.min_confidence] - An integer from 1-10. Only results with at least this confidence will be returned.
  10892. * @param [options.no_annotations] - When set to 1 results will not contain annotations.
  10893. * @param [options.no_dedupe] - When set to 1 results will not be deduplicated.
  10894. * @param [options.no_record] - When set to 1 the query contents are not logged.
  10895. * @param [options.pretty] - When set to 1 results are 'pretty' printed for easier reading. Useful for debugging.
  10896. * @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).
  10897. */
  10898. export class OpenCageGeocoderService {
  10899. constructor(url: Resource | string, apiKey: string, params?: {
  10900. abbrv?: number;
  10901. });
  10902. /**
  10903. * The Resource used to access the OpenCage endpoint.
  10904. */
  10905. readonly url: Resource;
  10906. /**
  10907. * Optional params passed to OpenCage in order to customize geocoding
  10908. */
  10909. readonly params: any;
  10910. /**
  10911. * @param query - The query to be sent to the geocoder service
  10912. */
  10913. geocode(query: string): Promise<GeocoderService.Result[]>;
  10914. }
  10915. /**
  10916. * Creates an instance of an OrientedBoundingBox.
  10917. * 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.
  10918. * @example
  10919. * // Create an OrientedBoundingBox using a transformation matrix, a position where the box will be translated, and a scale.
  10920. * var center = new Cesium.Cartesian3(1.0, 0.0, 0.0);
  10921. * var halfAxes = Cesium.Matrix3.fromScale(new Cesium.Cartesian3(1.0, 3.0, 2.0), new Cesium.Matrix3());
  10922. *
  10923. * var obb = new Cesium.OrientedBoundingBox(center, halfAxes);
  10924. * @param [center = Cartesian3.ZERO] - The center of the box.
  10925. * @param [halfAxes = Matrix3.ZERO] - The three orthogonal half-axes of the bounding box.
  10926. * Equivalently, the transformation matrix, to rotate and scale a 0x0x0
  10927. * cube centered at the origin.
  10928. */
  10929. export class OrientedBoundingBox {
  10930. constructor(center?: Cartesian3, halfAxes?: Matrix3);
  10931. /**
  10932. * The center of the box.
  10933. */
  10934. center: Cartesian3;
  10935. /**
  10936. * The transformation matrix, to rotate the box to the right position.
  10937. */
  10938. halfAxes: Matrix3;
  10939. /**
  10940. * The number of elements used to pack the object into an array.
  10941. */
  10942. static packedLength: number;
  10943. /**
  10944. * Stores the provided instance into the provided array.
  10945. * @param value - The value to pack.
  10946. * @param array - The array to pack into.
  10947. * @param [startingIndex = 0] - The index into the array at which to start packing the elements.
  10948. * @returns The array that was packed into
  10949. */
  10950. static pack(value: OrientedBoundingBox, array: number[], startingIndex?: number): number[];
  10951. /**
  10952. * Retrieves an instance from a packed array.
  10953. * @param array - The packed array.
  10954. * @param [startingIndex = 0] - The starting index of the element to be unpacked.
  10955. * @param [result] - The object into which to store the result.
  10956. * @returns The modified result parameter or a new OrientedBoundingBox instance if one was not provided.
  10957. */
  10958. static unpack(array: number[], startingIndex?: number, result?: OrientedBoundingBox): OrientedBoundingBox;
  10959. /**
  10960. * Computes an instance of an OrientedBoundingBox of the given positions.
  10961. * This is an implementation of Stefan Gottschalk's Collision Queries using Oriented Bounding Boxes solution (PHD thesis).
  10962. * Reference: http://gamma.cs.unc.edu/users/gottschalk/main.pdf
  10963. * @example
  10964. * // Compute an object oriented bounding box enclosing two points.
  10965. * var box = Cesium.OrientedBoundingBox.fromPoints([new Cesium.Cartesian3(2, 0, 0), new Cesium.Cartesian3(-2, 0, 0)]);
  10966. * @param [positions] - List of {@link Cartesian3} points that the bounding box will enclose.
  10967. * @param [result] - The object onto which to store the result.
  10968. * @returns The modified result parameter or a new OrientedBoundingBox instance if one was not provided.
  10969. */
  10970. static fromPoints(positions?: Cartesian3[], result?: OrientedBoundingBox): OrientedBoundingBox;
  10971. /**
  10972. * Computes an OrientedBoundingBox that bounds a {@link Rectangle} on the surface of an {@link Ellipsoid}.
  10973. * There are no guarantees about the orientation of the bounding box.
  10974. * @param rectangle - The cartographic rectangle on the surface of the ellipsoid.
  10975. * @param [minimumHeight = 0.0] - The minimum height (elevation) within the tile.
  10976. * @param [maximumHeight = 0.0] - The maximum height (elevation) within the tile.
  10977. * @param [ellipsoid = Ellipsoid.WGS84] - The ellipsoid on which the rectangle is defined.
  10978. * @param [result] - The object onto which to store the result.
  10979. * @returns The modified result parameter or a new OrientedBoundingBox instance if none was provided.
  10980. */
  10981. static fromRectangle(rectangle: Rectangle, minimumHeight?: number, maximumHeight?: number, ellipsoid?: Ellipsoid, result?: OrientedBoundingBox): OrientedBoundingBox;
  10982. /**
  10983. * Duplicates a OrientedBoundingBox instance.
  10984. * @param box - The bounding box to duplicate.
  10985. * @param [result] - The object onto which to store the result.
  10986. * @returns The modified result parameter or a new OrientedBoundingBox instance if none was provided. (Returns undefined if box is undefined)
  10987. */
  10988. static clone(box: OrientedBoundingBox, result?: OrientedBoundingBox): OrientedBoundingBox;
  10989. /**
  10990. * Determines which side of a plane the oriented bounding box is located.
  10991. * @param box - The oriented bounding box to test.
  10992. * @param plane - The plane to test against.
  10993. * @returns {@link Intersect.INSIDE} if the entire box is on the side of the plane
  10994. * the normal is pointing, {@link Intersect.OUTSIDE} if the entire box is
  10995. * on the opposite side, and {@link Intersect.INTERSECTING} if the box
  10996. * intersects the plane.
  10997. */
  10998. static intersectPlane(box: OrientedBoundingBox, plane: Plane): Intersect;
  10999. /**
  11000. * Computes the estimated distance squared from the closest point on a bounding box to a point.
  11001. * @example
  11002. * // Sort bounding boxes from back to front
  11003. * boxes.sort(function(a, b) {
  11004. * return Cesium.OrientedBoundingBox.distanceSquaredTo(b, camera.positionWC) - Cesium.OrientedBoundingBox.distanceSquaredTo(a, camera.positionWC);
  11005. * });
  11006. * @param box - The box.
  11007. * @param cartesian - The point
  11008. * @returns The estimated distance squared from the bounding sphere to the point.
  11009. */
  11010. static distanceSquaredTo(box: OrientedBoundingBox, cartesian: Cartesian3): number;
  11011. /**
  11012. * The distances calculated by the vector from the center of the bounding box to position projected onto direction.
  11013. * <br>
  11014. * If you imagine the infinite number of planes with normal direction, this computes the smallest distance to the
  11015. * closest and farthest planes from position that intersect the bounding box.
  11016. * @param box - The bounding box to calculate the distance to.
  11017. * @param position - The position to calculate the distance from.
  11018. * @param direction - The direction from position.
  11019. * @param [result] - A Interval to store the nearest and farthest distances.
  11020. * @returns The nearest and farthest distances on the bounding box from position in direction.
  11021. */
  11022. static computePlaneDistances(box: OrientedBoundingBox, position: Cartesian3, direction: Cartesian3, result?: Interval): Interval;
  11023. /**
  11024. * Determines whether or not a bounding box is hidden from view by the occluder.
  11025. * @param box - The bounding box surrounding the occludee object.
  11026. * @param occluder - The occluder.
  11027. * @returns <code>true</code> if the box is not visible; otherwise <code>false</code>.
  11028. */
  11029. static isOccluded(box: OrientedBoundingBox, occluder: Occluder): boolean;
  11030. /**
  11031. * Determines which side of a plane the oriented bounding box is located.
  11032. * @param plane - The plane to test against.
  11033. * @returns {@link Intersect.INSIDE} if the entire box is on the side of the plane
  11034. * the normal is pointing, {@link Intersect.OUTSIDE} if the entire box is
  11035. * on the opposite side, and {@link Intersect.INTERSECTING} if the box
  11036. * intersects the plane.
  11037. */
  11038. intersectPlane(plane: Plane): Intersect;
  11039. /**
  11040. * Computes the estimated distance squared from the closest point on a bounding box to a point.
  11041. * @example
  11042. * // Sort bounding boxes from back to front
  11043. * boxes.sort(function(a, b) {
  11044. * return b.distanceSquaredTo(camera.positionWC) - a.distanceSquaredTo(camera.positionWC);
  11045. * });
  11046. * @param cartesian - The point
  11047. * @returns The estimated distance squared from the bounding sphere to the point.
  11048. */
  11049. distanceSquaredTo(cartesian: Cartesian3): number;
  11050. /**
  11051. * The distances calculated by the vector from the center of the bounding box to position projected onto direction.
  11052. * <br>
  11053. * If you imagine the infinite number of planes with normal direction, this computes the smallest distance to the
  11054. * closest and farthest planes from position that intersect the bounding box.
  11055. * @param position - The position to calculate the distance from.
  11056. * @param direction - The direction from position.
  11057. * @param [result] - A Interval to store the nearest and farthest distances.
  11058. * @returns The nearest and farthest distances on the bounding box from position in direction.
  11059. */
  11060. computePlaneDistances(position: Cartesian3, direction: Cartesian3, result?: Interval): Interval;
  11061. /**
  11062. * Determines whether or not a bounding box is hidden from view by the occluder.
  11063. * @param occluder - The occluder.
  11064. * @returns <code>true</code> if the sphere is not visible; otherwise <code>false</code>.
  11065. */
  11066. isOccluded(occluder: Occluder): boolean;
  11067. /**
  11068. * Compares the provided OrientedBoundingBox componentwise and returns
  11069. * <code>true</code> if they are equal, <code>false</code> otherwise.
  11070. * @param left - The first OrientedBoundingBox.
  11071. * @param right - The second OrientedBoundingBox.
  11072. * @returns <code>true</code> if left and right are equal, <code>false</code> otherwise.
  11073. */
  11074. static equals(left: OrientedBoundingBox, right: OrientedBoundingBox): boolean;
  11075. /**
  11076. * Duplicates this OrientedBoundingBox instance.
  11077. * @param [result] - The object onto which to store the result.
  11078. * @returns The modified result parameter or a new OrientedBoundingBox instance if one was not provided.
  11079. */
  11080. clone(result?: OrientedBoundingBox): OrientedBoundingBox;
  11081. /**
  11082. * Compares this OrientedBoundingBox against the provided OrientedBoundingBox componentwise and returns
  11083. * <code>true</code> if they are equal, <code>false</code> otherwise.
  11084. * @param [right] - The right hand side OrientedBoundingBox.
  11085. * @returns <code>true</code> if they are equal, <code>false</code> otherwise.
  11086. */
  11087. equals(right?: OrientedBoundingBox): boolean;
  11088. }
  11089. /**
  11090. * The viewing frustum is defined by 6 planes.
  11091. * Each plane is represented by a {@link Cartesian4} object, where the x, y, and z components
  11092. * define the unit vector normal to the plane, and the w component is the distance of the
  11093. * plane from the origin/camera position.
  11094. * @example
  11095. * var maxRadii = ellipsoid.maximumRadius;
  11096. *
  11097. * var frustum = new Cesium.OrthographicFrustum();
  11098. * frustum.near = 0.01 * maxRadii;
  11099. * frustum.far = 50.0 * maxRadii;
  11100. * @param [options] - An object with the following properties:
  11101. * @param [options.width] - The width of the frustum in meters.
  11102. * @param [options.aspectRatio] - The aspect ratio of the frustum's width to it's height.
  11103. * @param [options.near = 1.0] - The distance of the near plane.
  11104. * @param [options.far = 500000000.0] - The distance of the far plane.
  11105. */
  11106. export class OrthographicFrustum {
  11107. constructor(options?: {
  11108. width?: number;
  11109. aspectRatio?: number;
  11110. near?: number;
  11111. far?: number;
  11112. });
  11113. /**
  11114. * The horizontal width of the frustum in meters.
  11115. */
  11116. width: number;
  11117. /**
  11118. * The aspect ratio of the frustum's width to it's height.
  11119. */
  11120. aspectRatio: number;
  11121. /**
  11122. * The distance of the near plane.
  11123. */
  11124. near: number;
  11125. /**
  11126. * The distance of the far plane.
  11127. */
  11128. far: number;
  11129. /**
  11130. * The number of elements used to pack the object into an array.
  11131. */
  11132. static packedLength: number;
  11133. /**
  11134. * Stores the provided instance into the provided array.
  11135. * @param value - The value to pack.
  11136. * @param array - The array to pack into.
  11137. * @param [startingIndex = 0] - The index into the array at which to start packing the elements.
  11138. * @returns The array that was packed into
  11139. */
  11140. static pack(value: OrthographicFrustum, array: number[], startingIndex?: number): number[];
  11141. /**
  11142. * Retrieves an instance from a packed array.
  11143. * @param array - The packed array.
  11144. * @param [startingIndex = 0] - The starting index of the element to be unpacked.
  11145. * @param [result] - The object into which to store the result.
  11146. * @returns The modified result parameter or a new OrthographicFrustum instance if one was not provided.
  11147. */
  11148. static unpack(array: number[], startingIndex?: number, result?: OrthographicFrustum): OrthographicFrustum;
  11149. /**
  11150. * Gets the orthographic projection matrix computed from the view frustum.
  11151. */
  11152. readonly projectionMatrix: Matrix4;
  11153. /**
  11154. * Creates a culling volume for this frustum.
  11155. * @example
  11156. * // Check if a bounding volume intersects the frustum.
  11157. * var cullingVolume = frustum.computeCullingVolume(cameraPosition, cameraDirection, cameraUp);
  11158. * var intersect = cullingVolume.computeVisibility(boundingVolume);
  11159. * @param position - The eye position.
  11160. * @param direction - The view direction.
  11161. * @param up - The up direction.
  11162. * @returns A culling volume at the given position and orientation.
  11163. */
  11164. computeCullingVolume(position: Cartesian3, direction: Cartesian3, up: Cartesian3): CullingVolume;
  11165. /**
  11166. * Returns the pixel's width and height in meters.
  11167. * @example
  11168. * // Example 1
  11169. * // Get the width and height of a pixel.
  11170. * var pixelSize = camera.frustum.getPixelDimensions(scene.drawingBufferWidth, scene.drawingBufferHeight, 0.0, scene.pixelRatio, new Cesium.Cartesian2());
  11171. * @param drawingBufferWidth - The width of the drawing buffer.
  11172. * @param drawingBufferHeight - The height of the drawing buffer.
  11173. * @param distance - The distance to the near plane in meters.
  11174. * @param pixelRatio - The scaling factor from pixel space to coordinate space.
  11175. * @param result - The object onto which to store the result.
  11176. * @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.
  11177. */
  11178. getPixelDimensions(drawingBufferWidth: number, drawingBufferHeight: number, distance: number, pixelRatio: number, result: Cartesian2): Cartesian2;
  11179. /**
  11180. * Returns a duplicate of a OrthographicFrustum instance.
  11181. * @param [result] - The object onto which to store the result.
  11182. * @returns The modified result parameter or a new OrthographicFrustum instance if one was not provided.
  11183. */
  11184. clone(result?: OrthographicFrustum): OrthographicFrustum;
  11185. /**
  11186. * Compares the provided OrthographicFrustum componentwise and returns
  11187. * <code>true</code> if they are equal, <code>false</code> otherwise.
  11188. * @param [other] - The right hand side OrthographicFrustum.
  11189. * @returns <code>true</code> if they are equal, <code>false</code> otherwise.
  11190. */
  11191. equals(other?: OrthographicFrustum): boolean;
  11192. /**
  11193. * Compares the provided OrthographicFrustum componentwise and returns
  11194. * <code>true</code> if they pass an absolute or relative tolerance test,
  11195. * <code>false</code> otherwise.
  11196. * @param other - The right hand side OrthographicFrustum.
  11197. * @param relativeEpsilon - The relative epsilon tolerance to use for equality testing.
  11198. * @param [absoluteEpsilon = relativeEpsilon] - The absolute epsilon tolerance to use for equality testing.
  11199. * @returns <code>true</code> if this and other are within the provided epsilon, <code>false</code> otherwise.
  11200. */
  11201. equalsEpsilon(other: OrthographicFrustum, relativeEpsilon: number, absoluteEpsilon?: number): boolean;
  11202. }
  11203. /**
  11204. * The viewing frustum is defined by 6 planes.
  11205. * Each plane is represented by a {@link Cartesian4} object, where the x, y, and z components
  11206. * define the unit vector normal to the plane, and the w component is the distance of the
  11207. * plane from the origin/camera position.
  11208. * @example
  11209. * var maxRadii = ellipsoid.maximumRadius;
  11210. *
  11211. * var frustum = new Cesium.OrthographicOffCenterFrustum();
  11212. * frustum.right = maxRadii * Cesium.Math.PI;
  11213. * frustum.left = -c.frustum.right;
  11214. * frustum.top = c.frustum.right * (canvas.clientHeight / canvas.clientWidth);
  11215. * frustum.bottom = -c.frustum.top;
  11216. * frustum.near = 0.01 * maxRadii;
  11217. * frustum.far = 50.0 * maxRadii;
  11218. * @param [options] - An object with the following properties:
  11219. * @param [options.left] - The left clipping plane distance.
  11220. * @param [options.right] - The right clipping plane distance.
  11221. * @param [options.top] - The top clipping plane distance.
  11222. * @param [options.bottom] - The bottom clipping plane distance.
  11223. * @param [options.near = 1.0] - The near clipping plane distance.
  11224. * @param [options.far = 500000000.0] - The far clipping plane distance.
  11225. */
  11226. export class OrthographicOffCenterFrustum {
  11227. constructor(options?: {
  11228. left?: number;
  11229. right?: number;
  11230. top?: number;
  11231. bottom?: number;
  11232. near?: number;
  11233. far?: number;
  11234. });
  11235. /**
  11236. * The left clipping plane.
  11237. */
  11238. left: number;
  11239. /**
  11240. * The right clipping plane.
  11241. */
  11242. right: number;
  11243. /**
  11244. * The top clipping plane.
  11245. */
  11246. top: number;
  11247. /**
  11248. * The bottom clipping plane.
  11249. */
  11250. bottom: number;
  11251. /**
  11252. * The distance of the near plane.
  11253. */
  11254. near: number;
  11255. /**
  11256. * The distance of the far plane.
  11257. */
  11258. far: number;
  11259. /**
  11260. * Gets the orthographic projection matrix computed from the view frustum.
  11261. */
  11262. readonly projectionMatrix: Matrix4;
  11263. /**
  11264. * Creates a culling volume for this frustum.
  11265. * @example
  11266. * // Check if a bounding volume intersects the frustum.
  11267. * var cullingVolume = frustum.computeCullingVolume(cameraPosition, cameraDirection, cameraUp);
  11268. * var intersect = cullingVolume.computeVisibility(boundingVolume);
  11269. * @param position - The eye position.
  11270. * @param direction - The view direction.
  11271. * @param up - The up direction.
  11272. * @returns A culling volume at the given position and orientation.
  11273. */
  11274. computeCullingVolume(position: Cartesian3, direction: Cartesian3, up: Cartesian3): CullingVolume;
  11275. /**
  11276. * Returns the pixel's width and height in meters.
  11277. * @example
  11278. * // Example 1
  11279. * // Get the width and height of a pixel.
  11280. * var pixelSize = camera.frustum.getPixelDimensions(scene.drawingBufferWidth, scene.drawingBufferHeight, 0.0, scene.pixelRatio, new Cesium.Cartesian2());
  11281. * @param drawingBufferWidth - The width of the drawing buffer.
  11282. * @param drawingBufferHeight - The height of the drawing buffer.
  11283. * @param distance - The distance to the near plane in meters.
  11284. * @param pixelRatio - The scaling factor from pixel space to coordinate space.
  11285. * @param result - The object onto which to store the result.
  11286. * @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.
  11287. */
  11288. getPixelDimensions(drawingBufferWidth: number, drawingBufferHeight: number, distance: number, pixelRatio: number, result: Cartesian2): Cartesian2;
  11289. /**
  11290. * Returns a duplicate of a OrthographicOffCenterFrustum instance.
  11291. * @param [result] - The object onto which to store the result.
  11292. * @returns The modified result parameter or a new OrthographicOffCenterFrustum instance if one was not provided.
  11293. */
  11294. clone(result?: OrthographicOffCenterFrustum): OrthographicOffCenterFrustum;
  11295. /**
  11296. * Compares the provided OrthographicOffCenterFrustum componentwise and returns
  11297. * <code>true</code> if they are equal, <code>false</code> otherwise.
  11298. * @param [other] - The right hand side OrthographicOffCenterFrustum.
  11299. * @returns <code>true</code> if they are equal, <code>false</code> otherwise.
  11300. */
  11301. equals(other?: OrthographicOffCenterFrustum): boolean;
  11302. /**
  11303. * Compares the provided OrthographicOffCenterFrustum componentwise and returns
  11304. * <code>true</code> if they pass an absolute or relative tolerance test,
  11305. * <code>false</code> otherwise.
  11306. * @param other - The right hand side OrthographicOffCenterFrustum.
  11307. * @param relativeEpsilon - The relative epsilon tolerance to use for equality testing.
  11308. * @param [absoluteEpsilon = relativeEpsilon] - The absolute epsilon tolerance to use for equality testing.
  11309. * @returns <code>true</code> if this and other are within the provided epsilon, <code>false</code> otherwise.
  11310. */
  11311. equalsEpsilon(other: OrthographicOffCenterFrustum, relativeEpsilon: number, absoluteEpsilon?: number): boolean;
  11312. }
  11313. export namespace Packable {
  11314. /**
  11315. * The number of elements used to pack the object into an array.
  11316. */
  11317. var packedLength: number;
  11318. /**
  11319. * Stores the provided instance into the provided array.
  11320. * @param value - The value to pack.
  11321. * @param array - The array to pack into.
  11322. * @param [startingIndex = 0] - The index into the array at which to start packing the elements.
  11323. */
  11324. function pack(value: any, array: number[], startingIndex?: number): void;
  11325. /**
  11326. * Retrieves an instance from a packed array.
  11327. * @param array - The packed array.
  11328. * @param [startingIndex = 0] - The starting index of the element to be unpacked.
  11329. * @param [result] - The object into which to store the result.
  11330. * @returns The modified result parameter or a new Object instance if one was not provided.
  11331. */
  11332. function unpack(array: number[], startingIndex?: number, result?: any): any;
  11333. }
  11334. /**
  11335. * Static interface for types which can store their values as packed
  11336. * elements in an array. These methods and properties are expected to be
  11337. * defined on a constructor function.
  11338. */
  11339. export interface Packable {
  11340. }
  11341. /**
  11342. * Static interface for {@link Packable} types which are interpolated in a
  11343. * different representation than their packed value. These methods and
  11344. * properties are expected to be defined on a constructor function.
  11345. */
  11346. export namespace PackableForInterpolation {
  11347. /**
  11348. * The number of elements used to store the object into an array in its interpolatable form.
  11349. */
  11350. var packedInterpolationLength: number;
  11351. /**
  11352. * Converts a packed array into a form suitable for interpolation.
  11353. * @param packedArray - The packed array.
  11354. * @param [startingIndex = 0] - The index of the first element to be converted.
  11355. * @param [lastIndex = packedArray.length] - The index of the last element to be converted.
  11356. * @param [result] - The object into which to store the result.
  11357. */
  11358. function convertPackedArrayForInterpolation(packedArray: number[], startingIndex?: number, lastIndex?: number, result?: number[]): void;
  11359. /**
  11360. * Retrieves an instance from a packed array converted with {@link PackableForInterpolation.convertPackedArrayForInterpolation}.
  11361. * @param array - The array previously packed for interpolation.
  11362. * @param sourceArray - The original packed array.
  11363. * @param [startingIndex = 0] - The startingIndex used to convert the array.
  11364. * @param [lastIndex = packedArray.length] - The lastIndex used to convert the array.
  11365. * @param [result] - The object into which to store the result.
  11366. * @returns The modified result parameter or a new Object instance if one was not provided.
  11367. */
  11368. function unpackInterpolationResult(array: number[], sourceArray: number[], startingIndex?: number, lastIndex?: number, result?: any): any;
  11369. }
  11370. /**
  11371. * Provides geocoding via a {@link https://pelias.io/|Pelias} server.
  11372. * @example
  11373. * // Configure a Viewer to use the Pelias server hosted by https://geocode.earth/
  11374. * var viewer = new Cesium.Viewer('cesiumContainer', {
  11375. * geocoder: new Cesium.PeliasGeocoderService(new Cesium.Resource({
  11376. * url: 'https://api.geocode.earth/v1/',
  11377. * queryParameters: {
  11378. * api_key: '<Your geocode.earth API key>'
  11379. * }
  11380. * }))
  11381. * });
  11382. * @param url - The endpoint to the Pelias server.
  11383. */
  11384. export class PeliasGeocoderService {
  11385. constructor(url: Resource | string);
  11386. /**
  11387. * The Resource used to access the Pelias endpoint.
  11388. */
  11389. readonly url: Resource;
  11390. /**
  11391. * @param query - The query to be sent to the geocoder service
  11392. * @param [type = GeocodeType.SEARCH] - The type of geocode to perform.
  11393. */
  11394. geocode(query: string, type?: GeocodeType): Promise<GeocoderService.Result[]>;
  11395. }
  11396. /**
  11397. * The viewing frustum is defined by 6 planes.
  11398. * Each plane is represented by a {@link Cartesian4} object, where the x, y, and z components
  11399. * define the unit vector normal to the plane, and the w component is the distance of the
  11400. * plane from the origin/camera position.
  11401. * @example
  11402. * var frustum = new Cesium.PerspectiveFrustum({
  11403. * fov : Cesium.Math.PI_OVER_THREE,
  11404. * aspectRatio : canvas.clientWidth / canvas.clientHeight
  11405. * near : 1.0,
  11406. * far : 1000.0
  11407. * });
  11408. * @param [options] - An object with the following properties:
  11409. * @param [options.fov] - The angle of the field of view (FOV), in radians.
  11410. * @param [options.aspectRatio] - The aspect ratio of the frustum's width to it's height.
  11411. * @param [options.near = 1.0] - The distance of the near plane.
  11412. * @param [options.far = 500000000.0] - The distance of the far plane.
  11413. * @param [options.xOffset = 0.0] - The offset in the x direction.
  11414. * @param [options.yOffset = 0.0] - The offset in the y direction.
  11415. */
  11416. export class PerspectiveFrustum {
  11417. constructor(options?: {
  11418. fov?: number;
  11419. aspectRatio?: number;
  11420. near?: number;
  11421. far?: number;
  11422. xOffset?: number;
  11423. yOffset?: number;
  11424. });
  11425. /**
  11426. * The angle of the field of view (FOV), in radians. This angle will be used
  11427. * as the horizontal FOV if the width is greater than the height, otherwise
  11428. * it will be the vertical FOV.
  11429. */
  11430. fov: number;
  11431. /**
  11432. * The aspect ratio of the frustum's width to it's height.
  11433. */
  11434. aspectRatio: number;
  11435. /**
  11436. * The distance of the near plane.
  11437. */
  11438. near: number;
  11439. /**
  11440. * The distance of the far plane.
  11441. */
  11442. far: number;
  11443. /**
  11444. * Offsets the frustum in the x direction.
  11445. */
  11446. xOffset: number;
  11447. /**
  11448. * Offsets the frustum in the y direction.
  11449. */
  11450. yOffset: number;
  11451. /**
  11452. * The number of elements used to pack the object into an array.
  11453. */
  11454. static packedLength: number;
  11455. /**
  11456. * Stores the provided instance into the provided array.
  11457. * @param value - The value to pack.
  11458. * @param array - The array to pack into.
  11459. * @param [startingIndex = 0] - The index into the array at which to start packing the elements.
  11460. * @returns The array that was packed into
  11461. */
  11462. static pack(value: PerspectiveFrustum, array: number[], startingIndex?: number): number[];
  11463. /**
  11464. * Retrieves an instance from a packed array.
  11465. * @param array - The packed array.
  11466. * @param [startingIndex = 0] - The starting index of the element to be unpacked.
  11467. * @param [result] - The object into which to store the result.
  11468. * @returns The modified result parameter or a new PerspectiveFrustum instance if one was not provided.
  11469. */
  11470. static unpack(array: number[], startingIndex?: number, result?: PerspectiveFrustum): PerspectiveFrustum;
  11471. /**
  11472. * Gets the perspective projection matrix computed from the view frustum.
  11473. */
  11474. readonly projectionMatrix: Matrix4;
  11475. /**
  11476. * The perspective projection matrix computed from the view frustum with an infinite far plane.
  11477. */
  11478. readonly infiniteProjectionMatrix: Matrix4;
  11479. /**
  11480. * Gets the angle of the vertical field of view, in radians.
  11481. */
  11482. readonly fovy: number;
  11483. /**
  11484. * Creates a culling volume for this frustum.
  11485. * @example
  11486. * // Check if a bounding volume intersects the frustum.
  11487. * var cullingVolume = frustum.computeCullingVolume(cameraPosition, cameraDirection, cameraUp);
  11488. * var intersect = cullingVolume.computeVisibility(boundingVolume);
  11489. * @param position - The eye position.
  11490. * @param direction - The view direction.
  11491. * @param up - The up direction.
  11492. * @returns A culling volume at the given position and orientation.
  11493. */
  11494. computeCullingVolume(position: Cartesian3, direction: Cartesian3, up: Cartesian3): CullingVolume;
  11495. /**
  11496. * Returns the pixel's width and height in meters.
  11497. * @example
  11498. * // Example 1
  11499. * // Get the width and height of a pixel.
  11500. * var pixelSize = camera.frustum.getPixelDimensions(scene.drawingBufferWidth, scene.drawingBufferHeight, 1.0, scene.pixelRatio, new Cesium.Cartesian2());
  11501. * @example
  11502. * // Example 2
  11503. * // Get the width and height of a pixel if the near plane was set to 'distance'.
  11504. * // For example, get the size of a pixel of an image on a billboard.
  11505. * var position = camera.position;
  11506. * var direction = camera.direction;
  11507. * var toCenter = Cesium.Cartesian3.subtract(primitive.boundingVolume.center, position, new Cesium.Cartesian3()); // vector from camera to a primitive
  11508. * var toCenterProj = Cesium.Cartesian3.multiplyByScalar(direction, Cesium.Cartesian3.dot(direction, toCenter), new Cesium.Cartesian3()); // project vector onto camera direction vector
  11509. * var distance = Cesium.Cartesian3.magnitude(toCenterProj);
  11510. * var pixelSize = camera.frustum.getPixelDimensions(scene.drawingBufferWidth, scene.drawingBufferHeight, distance, scene.pixelRatio, new Cesium.Cartesian2());
  11511. * @param drawingBufferWidth - The width of the drawing buffer.
  11512. * @param drawingBufferHeight - The height of the drawing buffer.
  11513. * @param distance - The distance to the near plane in meters.
  11514. * @param pixelRatio - The scaling factor from pixel space to coordinate space.
  11515. * @param result - The object onto which to store the result.
  11516. * @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.
  11517. */
  11518. getPixelDimensions(drawingBufferWidth: number, drawingBufferHeight: number, distance: number, pixelRatio: number, result: Cartesian2): Cartesian2;
  11519. /**
  11520. * Returns a duplicate of a PerspectiveFrustum instance.
  11521. * @param [result] - The object onto which to store the result.
  11522. * @returns The modified result parameter or a new PerspectiveFrustum instance if one was not provided.
  11523. */
  11524. clone(result?: PerspectiveFrustum): PerspectiveFrustum;
  11525. /**
  11526. * Compares the provided PerspectiveFrustum componentwise and returns
  11527. * <code>true</code> if they are equal, <code>false</code> otherwise.
  11528. * @param [other] - The right hand side PerspectiveFrustum.
  11529. * @returns <code>true</code> if they are equal, <code>false</code> otherwise.
  11530. */
  11531. equals(other?: PerspectiveFrustum): boolean;
  11532. /**
  11533. * Compares the provided PerspectiveFrustum componentwise and returns
  11534. * <code>true</code> if they pass an absolute or relative tolerance test,
  11535. * <code>false</code> otherwise.
  11536. * @param other - The right hand side PerspectiveFrustum.
  11537. * @param relativeEpsilon - The relative epsilon tolerance to use for equality testing.
  11538. * @param [absoluteEpsilon = relativeEpsilon] - The absolute epsilon tolerance to use for equality testing.
  11539. * @returns <code>true</code> if this and other are within the provided epsilon, <code>false</code> otherwise.
  11540. */
  11541. equalsEpsilon(other: PerspectiveFrustum, relativeEpsilon: number, absoluteEpsilon?: number): boolean;
  11542. }
  11543. /**
  11544. * The viewing frustum is defined by 6 planes.
  11545. * Each plane is represented by a {@link Cartesian4} object, where the x, y, and z components
  11546. * define the unit vector normal to the plane, and the w component is the distance of the
  11547. * plane from the origin/camera position.
  11548. * @example
  11549. * var frustum = new Cesium.PerspectiveOffCenterFrustum({
  11550. * left : -1.0,
  11551. * right : 1.0,
  11552. * top : 1.0,
  11553. * bottom : -1.0,
  11554. * near : 1.0,
  11555. * far : 100.0
  11556. * });
  11557. * @param [options] - An object with the following properties:
  11558. * @param [options.left] - The left clipping plane distance.
  11559. * @param [options.right] - The right clipping plane distance.
  11560. * @param [options.top] - The top clipping plane distance.
  11561. * @param [options.bottom] - The bottom clipping plane distance.
  11562. * @param [options.near = 1.0] - The near clipping plane distance.
  11563. * @param [options.far = 500000000.0] - The far clipping plane distance.
  11564. */
  11565. export class PerspectiveOffCenterFrustum {
  11566. constructor(options?: {
  11567. left?: number;
  11568. right?: number;
  11569. top?: number;
  11570. bottom?: number;
  11571. near?: number;
  11572. far?: number;
  11573. });
  11574. /**
  11575. * Defines the left clipping plane.
  11576. */
  11577. left: number;
  11578. /**
  11579. * Defines the right clipping plane.
  11580. */
  11581. right: number;
  11582. /**
  11583. * Defines the top clipping plane.
  11584. */
  11585. top: number;
  11586. /**
  11587. * Defines the bottom clipping plane.
  11588. */
  11589. bottom: number;
  11590. /**
  11591. * The distance of the near plane.
  11592. */
  11593. near: number;
  11594. /**
  11595. * The distance of the far plane.
  11596. */
  11597. far: number;
  11598. /**
  11599. * Gets the perspective projection matrix computed from the view frustum.
  11600. */
  11601. readonly projectionMatrix: Matrix4;
  11602. /**
  11603. * Gets the perspective projection matrix computed from the view frustum with an infinite far plane.
  11604. */
  11605. readonly infiniteProjectionMatrix: Matrix4;
  11606. /**
  11607. * Creates a culling volume for this frustum.
  11608. * @example
  11609. * // Check if a bounding volume intersects the frustum.
  11610. * var cullingVolume = frustum.computeCullingVolume(cameraPosition, cameraDirection, cameraUp);
  11611. * var intersect = cullingVolume.computeVisibility(boundingVolume);
  11612. * @param position - The eye position.
  11613. * @param direction - The view direction.
  11614. * @param up - The up direction.
  11615. * @returns A culling volume at the given position and orientation.
  11616. */
  11617. computeCullingVolume(position: Cartesian3, direction: Cartesian3, up: Cartesian3): CullingVolume;
  11618. /**
  11619. * Returns the pixel's width and height in meters.
  11620. * @example
  11621. * // Example 1
  11622. * // Get the width and height of a pixel.
  11623. * var pixelSize = camera.frustum.getPixelDimensions(scene.drawingBufferWidth, scene.drawingBufferHeight, 1.0, scene.pixelRatio, new Cesium.Cartesian2());
  11624. * @example
  11625. * // Example 2
  11626. * // Get the width and height of a pixel if the near plane was set to 'distance'.
  11627. * // For example, get the size of a pixel of an image on a billboard.
  11628. * var position = camera.position;
  11629. * var direction = camera.direction;
  11630. * var toCenter = Cesium.Cartesian3.subtract(primitive.boundingVolume.center, position, new Cesium.Cartesian3()); // vector from camera to a primitive
  11631. * var toCenterProj = Cesium.Cartesian3.multiplyByScalar(direction, Cesium.Cartesian3.dot(direction, toCenter), new Cesium.Cartesian3()); // project vector onto camera direction vector
  11632. * var distance = Cesium.Cartesian3.magnitude(toCenterProj);
  11633. * var pixelSize = camera.frustum.getPixelDimensions(scene.drawingBufferWidth, scene.drawingBufferHeight, distance, scene.pixelRatio, new Cesium.Cartesian2());
  11634. * @param drawingBufferWidth - The width of the drawing buffer.
  11635. * @param drawingBufferHeight - The height of the drawing buffer.
  11636. * @param distance - The distance to the near plane in meters.
  11637. * @param pixelRatio - The scaling factor from pixel space to coordinate space.
  11638. * @param result - The object onto which to store the result.
  11639. * @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.
  11640. */
  11641. getPixelDimensions(drawingBufferWidth: number, drawingBufferHeight: number, distance: number, pixelRatio: number, result: Cartesian2): Cartesian2;
  11642. /**
  11643. * Returns a duplicate of a PerspectiveOffCenterFrustum instance.
  11644. * @param [result] - The object onto which to store the result.
  11645. * @returns The modified result parameter or a new PerspectiveFrustum instance if one was not provided.
  11646. */
  11647. clone(result?: PerspectiveOffCenterFrustum): PerspectiveOffCenterFrustum;
  11648. /**
  11649. * Compares the provided PerspectiveOffCenterFrustum componentwise and returns
  11650. * <code>true</code> if they are equal, <code>false</code> otherwise.
  11651. * @param [other] - The right hand side PerspectiveOffCenterFrustum.
  11652. * @returns <code>true</code> if they are equal, <code>false</code> otherwise.
  11653. */
  11654. equals(other?: PerspectiveOffCenterFrustum): boolean;
  11655. /**
  11656. * Compares the provided PerspectiveOffCenterFrustum componentwise and returns
  11657. * <code>true</code> if they pass an absolute or relative tolerance test,
  11658. * <code>false</code> otherwise.
  11659. * @param other - The right hand side PerspectiveOffCenterFrustum.
  11660. * @param relativeEpsilon - The relative epsilon tolerance to use for equality testing.
  11661. * @param [absoluteEpsilon = relativeEpsilon] - The absolute epsilon tolerance to use for equality testing.
  11662. * @returns <code>true</code> if this and other are within the provided epsilon, <code>false</code> otherwise.
  11663. */
  11664. equalsEpsilon(other: PerspectiveOffCenterFrustum, relativeEpsilon: number, absoluteEpsilon?: number): boolean;
  11665. }
  11666. /**
  11667. * A utility class for generating custom map pins as canvas elements.
  11668. * <br /><br />
  11669. * <div align='center'>
  11670. * <img src='Images/PinBuilder.png' width='500'/><br />
  11671. * Example pins generated using both the maki icon set, which ships with Cesium, and single character text.
  11672. * </div>
  11673. */
  11674. export class PinBuilder {
  11675. constructor();
  11676. /**
  11677. * Creates an empty pin of the specified color and size.
  11678. * @param color - The color of the pin.
  11679. * @param size - The size of the pin, in pixels.
  11680. * @returns The canvas element that represents the generated pin.
  11681. */
  11682. fromColor(color: Color, size: number): HTMLCanvasElement;
  11683. /**
  11684. * Creates a pin with the specified icon, color, and size.
  11685. * @param url - The url of the image to be stamped onto the pin.
  11686. * @param color - The color of the pin.
  11687. * @param size - The size of the pin, in pixels.
  11688. * @returns The canvas element or a Promise to the canvas element that represents the generated pin.
  11689. */
  11690. fromUrl(url: Resource | string, color: Color, size: number): HTMLCanvasElement | Promise<HTMLCanvasElement>;
  11691. /**
  11692. * Creates a pin with the specified {@link https://www.mapbox.com/maki/|maki} icon identifier, color, and size.
  11693. * @param id - The id of the maki icon to be stamped onto the pin.
  11694. * @param color - The color of the pin.
  11695. * @param size - The size of the pin, in pixels.
  11696. * @returns The canvas element or a Promise to the canvas element that represents the generated pin.
  11697. */
  11698. fromMakiIconId(id: string, color: Color, size: number): HTMLCanvasElement | Promise<HTMLCanvasElement>;
  11699. /**
  11700. * Creates a pin with the specified text, color, and size. The text will be sized to be as large as possible
  11701. * while still being contained completely within the pin.
  11702. * @param text - The text to be stamped onto the pin.
  11703. * @param color - The color of the pin.
  11704. * @param size - The size of the pin, in pixels.
  11705. * @returns The canvas element that represents the generated pin.
  11706. */
  11707. fromText(text: string, color: Color, size: number): HTMLCanvasElement;
  11708. }
  11709. /**
  11710. * The format of a pixel, i.e., the number of components it has and what they represent.
  11711. */
  11712. export enum PixelFormat {
  11713. /**
  11714. * A pixel format containing a depth value.
  11715. */
  11716. DEPTH_COMPONENT = WebGLConstants.DEPTH_COMPONENT,
  11717. /**
  11718. * A pixel format containing a depth and stencil value, most often used with {@link PixelDatatype.UNSIGNED_INT_24_8}.
  11719. */
  11720. DEPTH_STENCIL = WebGLConstants.DEPTH_STENCIL,
  11721. /**
  11722. * A pixel format containing an alpha channel.
  11723. */
  11724. ALPHA = WebGLConstants.ALPHA,
  11725. /**
  11726. * A pixel format containing red, green, and blue channels.
  11727. */
  11728. RGB = WebGLConstants.RGB,
  11729. /**
  11730. * A pixel format containing red, green, blue, and alpha channels.
  11731. */
  11732. RGBA = WebGLConstants.RGBA,
  11733. /**
  11734. * A pixel format containing a luminance (intensity) channel.
  11735. */
  11736. LUMINANCE = WebGLConstants.LUMINANCE,
  11737. /**
  11738. * A pixel format containing luminance (intensity) and alpha channels.
  11739. */
  11740. LUMINANCE_ALPHA = WebGLConstants.LUMINANCE_ALPHA,
  11741. /**
  11742. * A pixel format containing red, green, and blue channels that is DXT1 compressed.
  11743. */
  11744. RGB_DXT1 = WebGLConstants.COMPRESSED_RGB_S3TC_DXT1_EXT,
  11745. /**
  11746. * A pixel format containing red, green, blue, and alpha channels that is DXT1 compressed.
  11747. */
  11748. RGBA_DXT1 = WebGLConstants.COMPRESSED_RGBA_S3TC_DXT1_EXT,
  11749. /**
  11750. * A pixel format containing red, green, blue, and alpha channels that is DXT3 compressed.
  11751. */
  11752. RGBA_DXT3 = WebGLConstants.COMPRESSED_RGBA_S3TC_DXT3_EXT,
  11753. /**
  11754. * A pixel format containing red, green, blue, and alpha channels that is DXT5 compressed.
  11755. */
  11756. RGBA_DXT5 = WebGLConstants.COMPRESSED_RGBA_S3TC_DXT5_EXT,
  11757. /**
  11758. * A pixel format containing red, green, and blue channels that is PVR 4bpp compressed.
  11759. */
  11760. RGB_PVRTC_4BPPV1 = WebGLConstants.COMPRESSED_RGB_PVRTC_4BPPV1_IMG,
  11761. /**
  11762. * A pixel format containing red, green, and blue channels that is PVR 2bpp compressed.
  11763. */
  11764. RGB_PVRTC_2BPPV1 = WebGLConstants.COMPRESSED_RGB_PVRTC_2BPPV1_IMG,
  11765. /**
  11766. * A pixel format containing red, green, blue, and alpha channels that is PVR 4bpp compressed.
  11767. */
  11768. RGBA_PVRTC_4BPPV1 = WebGLConstants.COMPRESSED_RGBA_PVRTC_4BPPV1_IMG,
  11769. /**
  11770. * A pixel format containing red, green, blue, and alpha channels that is PVR 2bpp compressed.
  11771. */
  11772. RGBA_PVRTC_2BPPV1 = WebGLConstants.COMPRESSED_RGBA_PVRTC_2BPPV1_IMG,
  11773. /**
  11774. * A pixel format containing red, green, and blue channels that is ETC1 compressed.
  11775. */
  11776. RGB_ETC1 = WebGLConstants.COMPRESSED_RGB_ETC1_WEBGL
  11777. }
  11778. /**
  11779. * A plane in Hessian Normal Form defined by
  11780. * <pre>
  11781. * ax + by + cz + d = 0
  11782. * </pre>
  11783. * where (a, b, c) is the plane's <code>normal</code>, d is the signed
  11784. * <code>distance</code> to the plane, and (x, y, z) is any point on
  11785. * the plane.
  11786. * @example
  11787. * // The plane x=0
  11788. * var plane = new Cesium.Plane(Cesium.Cartesian3.UNIT_X, 0.0);
  11789. * @param normal - The plane's normal (normalized).
  11790. * @param distance - The shortest distance from the origin to the plane. The sign of
  11791. * <code>distance</code> determines which side of the plane the origin
  11792. * is on. If <code>distance</code> is positive, the origin is in the half-space
  11793. * in the direction of the normal; if negative, the origin is in the half-space
  11794. * opposite to the normal; if zero, the plane passes through the origin.
  11795. */
  11796. export class Plane {
  11797. constructor(normal: Cartesian3, distance: number);
  11798. /**
  11799. * The plane's normal.
  11800. */
  11801. normal: Cartesian3;
  11802. /**
  11803. * The shortest distance from the origin to the plane. The sign of
  11804. * <code>distance</code> determines which side of the plane the origin
  11805. * is on. If <code>distance</code> is positive, the origin is in the half-space
  11806. * in the direction of the normal; if negative, the origin is in the half-space
  11807. * opposite to the normal; if zero, the plane passes through the origin.
  11808. */
  11809. distance: number;
  11810. /**
  11811. * Creates a plane from a normal and a point on the plane.
  11812. * @example
  11813. * var point = Cesium.Cartesian3.fromDegrees(-72.0, 40.0);
  11814. * var normal = ellipsoid.geodeticSurfaceNormal(point);
  11815. * var tangentPlane = Cesium.Plane.fromPointNormal(point, normal);
  11816. * @param point - The point on the plane.
  11817. * @param normal - The plane's normal (normalized).
  11818. * @param [result] - The object onto which to store the result.
  11819. * @returns A new plane instance or the modified result parameter.
  11820. */
  11821. static fromPointNormal(point: Cartesian3, normal: Cartesian3, result?: Plane): Plane;
  11822. /**
  11823. * Creates a plane from the general equation
  11824. * @param coefficients - The plane's normal (normalized).
  11825. * @param [result] - The object onto which to store the result.
  11826. * @returns A new plane instance or the modified result parameter.
  11827. */
  11828. static fromCartesian4(coefficients: Cartesian4, result?: Plane): Plane;
  11829. /**
  11830. * Computes the signed shortest distance of a point to a plane.
  11831. * The sign of the distance determines which side of the plane the point
  11832. * is on. If the distance is positive, the point is in the half-space
  11833. * in the direction of the normal; if negative, the point is in the half-space
  11834. * opposite to the normal; if zero, the plane passes through the point.
  11835. * @param plane - The plane.
  11836. * @param point - The point.
  11837. * @returns The signed shortest distance of the point to the plane.
  11838. */
  11839. static getPointDistance(plane: Plane, point: Cartesian3): number;
  11840. /**
  11841. * Projects a point onto the plane.
  11842. * @param plane - The plane to project the point onto
  11843. * @param point - The point to project onto the plane
  11844. * @param [result] - The result point. If undefined, a new Cartesian3 will be created.
  11845. * @returns The modified result parameter or a new Cartesian3 instance if one was not provided.
  11846. */
  11847. static projectPointOntoPlane(plane: Plane, point: Cartesian3, result?: Cartesian3): Cartesian3;
  11848. /**
  11849. * Transforms the plane by the given transformation matrix.
  11850. * @param plane - The plane.
  11851. * @param transform - The transformation matrix.
  11852. * @param [result] - The object into which to store the result.
  11853. * @returns The plane transformed by the given transformation matrix.
  11854. */
  11855. static transform(plane: Plane, transform: Matrix4, result?: Plane): Plane;
  11856. /**
  11857. * Duplicates a Plane instance.
  11858. * @param plane - The plane to duplicate.
  11859. * @param [result] - The object onto which to store the result.
  11860. * @returns The modified result parameter or a new Plane instance if one was not provided.
  11861. */
  11862. static clone(plane: Plane, result?: Plane): Plane;
  11863. /**
  11864. * Compares the provided Planes by normal and distance and returns
  11865. * <code>true</code> if they are equal, <code>false</code> otherwise.
  11866. * @param left - The first plane.
  11867. * @param right - The second plane.
  11868. * @returns <code>true</code> if left and right are equal, <code>false</code> otherwise.
  11869. */
  11870. static equals(left: Plane, right: Plane): boolean;
  11871. /**
  11872. * A constant initialized to the XY plane passing through the origin, with normal in positive Z.
  11873. */
  11874. static readonly ORIGIN_XY_PLANE: Plane;
  11875. /**
  11876. * A constant initialized to the YZ plane passing through the origin, with normal in positive X.
  11877. */
  11878. static readonly ORIGIN_YZ_PLANE: Plane;
  11879. /**
  11880. * A constant initialized to the ZX plane passing through the origin, with normal in positive Y.
  11881. */
  11882. static readonly ORIGIN_ZX_PLANE: Plane;
  11883. }
  11884. /**
  11885. * Describes geometry representing a plane centered at the origin, with a unit width and length.
  11886. * @example
  11887. * var planeGeometry = new Cesium.PlaneGeometry({
  11888. * vertexFormat : Cesium.VertexFormat.POSITION_ONLY
  11889. * });
  11890. * @param [options] - Object with the following properties:
  11891. * @param [options.vertexFormat = VertexFormat.DEFAULT] - The vertex attributes to be computed.
  11892. */
  11893. export class PlaneGeometry {
  11894. constructor(options?: {
  11895. vertexFormat?: VertexFormat;
  11896. });
  11897. /**
  11898. * The number of elements used to pack the object into an array.
  11899. */
  11900. static packedLength: number;
  11901. /**
  11902. * Stores the provided instance into the provided array.
  11903. * @param value - The value to pack.
  11904. * @param array - The array to pack into.
  11905. * @param [startingIndex = 0] - The index into the array at which to start packing the elements.
  11906. * @returns The array that was packed into
  11907. */
  11908. static pack(value: PlaneGeometry, array: number[], startingIndex?: number): number[];
  11909. /**
  11910. * Retrieves an instance from a packed array.
  11911. * @param array - The packed array.
  11912. * @param [startingIndex = 0] - The starting index of the element to be unpacked.
  11913. * @param [result] - The object into which to store the result.
  11914. * @returns The modified result parameter or a new PlaneGeometry instance if one was not provided.
  11915. */
  11916. static unpack(array: number[], startingIndex?: number, result?: PlaneGeometry): PlaneGeometry;
  11917. /**
  11918. * Computes the geometric representation of a plane, including its vertices, indices, and a bounding sphere.
  11919. * @param planeGeometry - A description of the plane.
  11920. * @returns The computed vertices and indices.
  11921. */
  11922. static createGeometry(planeGeometry: PlaneGeometry): Geometry | undefined;
  11923. }
  11924. /**
  11925. * Describes geometry representing the outline of a plane centered at the origin, with a unit width and length.
  11926. */
  11927. export class PlaneOutlineGeometry {
  11928. constructor();
  11929. /**
  11930. * The number of elements used to pack the object into an array.
  11931. */
  11932. static packedLength: number;
  11933. /**
  11934. * Stores the provided instance into the provided array.
  11935. * @param value - The value to pack.
  11936. * @param array - The array to pack into.
  11937. * @returns The array that was packed into
  11938. */
  11939. static pack(value: PlaneOutlineGeometry, array: number[]): number[];
  11940. /**
  11941. * Retrieves an instance from a packed array.
  11942. * @param array - The packed array.
  11943. * @param [startingIndex = 0] - The starting index of the element to be unpacked.
  11944. * @param [result] - The object into which to store the result.
  11945. * @returns The modified result parameter or a new PlaneOutlineGeometry instance if one was not provided.
  11946. */
  11947. static unpack(array: number[], startingIndex?: number, result?: PlaneOutlineGeometry): PlaneOutlineGeometry;
  11948. /**
  11949. * Computes the geometric representation of an outline of a plane, including its vertices, indices, and a bounding sphere.
  11950. * @returns The computed vertices and indices.
  11951. */
  11952. static createGeometry(): Geometry | undefined;
  11953. }
  11954. /**
  11955. * 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}.
  11956. * @example
  11957. * // 1. create a polygon from points
  11958. * var polygon = new Cesium.PolygonGeometry({
  11959. * polygonHierarchy : new Cesium.PolygonHierarchy(
  11960. * Cesium.Cartesian3.fromDegreesArray([
  11961. * -72.0, 40.0,
  11962. * -70.0, 35.0,
  11963. * -75.0, 30.0,
  11964. * -70.0, 30.0,
  11965. * -68.0, 40.0
  11966. * ])
  11967. * )
  11968. * });
  11969. * var geometry = Cesium.PolygonGeometry.createGeometry(polygon);
  11970. *
  11971. * // 2. create a nested polygon with holes
  11972. * var polygonWithHole = new Cesium.PolygonGeometry({
  11973. * polygonHierarchy : new Cesium.PolygonHierarchy(
  11974. * Cesium.Cartesian3.fromDegreesArray([
  11975. * -109.0, 30.0,
  11976. * -95.0, 30.0,
  11977. * -95.0, 40.0,
  11978. * -109.0, 40.0
  11979. * ]),
  11980. * [new Cesium.PolygonHierarchy(
  11981. * Cesium.Cartesian3.fromDegreesArray([
  11982. * -107.0, 31.0,
  11983. * -107.0, 39.0,
  11984. * -97.0, 39.0,
  11985. * -97.0, 31.0
  11986. * ]),
  11987. * [new Cesium.PolygonHierarchy(
  11988. * Cesium.Cartesian3.fromDegreesArray([
  11989. * -105.0, 33.0,
  11990. * -99.0, 33.0,
  11991. * -99.0, 37.0,
  11992. * -105.0, 37.0
  11993. * ]),
  11994. * [new Cesium.PolygonHierarchy(
  11995. * Cesium.Cartesian3.fromDegreesArray([
  11996. * -103.0, 34.0,
  11997. * -101.0, 34.0,
  11998. * -101.0, 36.0,
  11999. * -103.0, 36.0
  12000. * ])
  12001. * )]
  12002. * )]
  12003. * )]
  12004. * )
  12005. * });
  12006. * var geometry = Cesium.PolygonGeometry.createGeometry(polygonWithHole);
  12007. *
  12008. * // 3. create extruded polygon
  12009. * var extrudedPolygon = new Cesium.PolygonGeometry({
  12010. * polygonHierarchy : new Cesium.PolygonHierarchy(
  12011. * Cesium.Cartesian3.fromDegreesArray([
  12012. * -72.0, 40.0,
  12013. * -70.0, 35.0,
  12014. * -75.0, 30.0,
  12015. * -70.0, 30.0,
  12016. * -68.0, 40.0
  12017. * ])
  12018. * ),
  12019. * extrudedHeight: 300000
  12020. * });
  12021. * var geometry = Cesium.PolygonGeometry.createGeometry(extrudedPolygon);
  12022. * @param options - Object with the following properties:
  12023. * @param options.polygonHierarchy - A polygon hierarchy that can include holes.
  12024. * @param [options.height = 0.0] - The distance in meters between the polygon and the ellipsoid surface.
  12025. * @param [options.extrudedHeight] - The distance in meters between the polygon's extruded face and the ellipsoid surface.
  12026. * @param [options.vertexFormat = VertexFormat.DEFAULT] - The vertex attributes to be computed.
  12027. * @param [options.stRotation = 0.0] - The rotation of the texture coordinates, in radians. A positive rotation is counter-clockwise.
  12028. * @param [options.ellipsoid = Ellipsoid.WGS84] - The ellipsoid to be used as a reference.
  12029. * @param [options.granularity = Math.RADIANS_PER_DEGREE] - The distance, in radians, between each latitude and longitude. Determines the number of positions in the buffer.
  12030. * @param [options.perPositionHeight = false] - Use the height of options.positions for each position instead of using options.height to determine the height.
  12031. * @param [options.closeTop = true] - When false, leaves off the top of an extruded polygon open.
  12032. * @param [options.closeBottom = true] - When false, leaves off the bottom of an extruded polygon open.
  12033. * @param [options.arcType = ArcType.GEODESIC] - The type of line the polygon edges must follow. Valid options are {@link ArcType.GEODESIC} and {@link ArcType.RHUMB}.
  12034. */
  12035. export class PolygonGeometry {
  12036. constructor(options: {
  12037. polygonHierarchy: PolygonHierarchy;
  12038. height?: number;
  12039. extrudedHeight?: number;
  12040. vertexFormat?: VertexFormat;
  12041. stRotation?: number;
  12042. ellipsoid?: Ellipsoid;
  12043. granularity?: number;
  12044. perPositionHeight?: boolean;
  12045. closeTop?: boolean;
  12046. closeBottom?: boolean;
  12047. arcType?: ArcType;
  12048. });
  12049. /**
  12050. * The number of elements used to pack the object into an array.
  12051. */
  12052. packedLength: number;
  12053. /**
  12054. * A description of a polygon from an array of positions. Polygon geometry can be rendered with both {@link Primitive} and {@link GroundPrimitive}.
  12055. * @example
  12056. * // create a polygon from points
  12057. * var polygon = Cesium.PolygonGeometry.fromPositions({
  12058. * positions : Cesium.Cartesian3.fromDegreesArray([
  12059. * -72.0, 40.0,
  12060. * -70.0, 35.0,
  12061. * -75.0, 30.0,
  12062. * -70.0, 30.0,
  12063. * -68.0, 40.0
  12064. * ])
  12065. * });
  12066. * var geometry = Cesium.PolygonGeometry.createGeometry(polygon);
  12067. * @param options - Object with the following properties:
  12068. * @param options.positions - An array of positions that defined the corner points of the polygon.
  12069. * @param [options.height = 0.0] - The height of the polygon.
  12070. * @param [options.extrudedHeight] - The height of the polygon extrusion.
  12071. * @param [options.vertexFormat = VertexFormat.DEFAULT] - The vertex attributes to be computed.
  12072. * @param [options.stRotation = 0.0] - The rotation of the texture coordinates, in radians. A positive rotation is counter-clockwise.
  12073. * @param [options.ellipsoid = Ellipsoid.WGS84] - The ellipsoid to be used as a reference.
  12074. * @param [options.granularity = Math.RADIANS_PER_DEGREE] - The distance, in radians, between each latitude and longitude. Determines the number of positions in the buffer.
  12075. * @param [options.perPositionHeight = false] - Use the height of options.positions for each position instead of using options.height to determine the height.
  12076. * @param [options.closeTop = true] - When false, leaves off the top of an extruded polygon open.
  12077. * @param [options.closeBottom = true] - When false, leaves off the bottom of an extruded polygon open.
  12078. * @param [options.arcType = ArcType.GEODESIC] - The type of line the polygon edges must follow. Valid options are {@link ArcType.GEODESIC} and {@link ArcType.RHUMB}.
  12079. */
  12080. static fromPositions(options: {
  12081. positions: Cartesian3[];
  12082. height?: number;
  12083. extrudedHeight?: number;
  12084. vertexFormat?: VertexFormat;
  12085. stRotation?: number;
  12086. ellipsoid?: Ellipsoid;
  12087. granularity?: number;
  12088. perPositionHeight?: boolean;
  12089. closeTop?: boolean;
  12090. closeBottom?: boolean;
  12091. arcType?: ArcType;
  12092. }): PolygonGeometry;
  12093. /**
  12094. * Stores the provided instance into the provided array.
  12095. * @param value - The value to pack.
  12096. * @param array - The array to pack into.
  12097. * @param [startingIndex = 0] - The index into the array at which to start packing the elements.
  12098. * @returns The array that was packed into
  12099. */
  12100. static pack(value: PolygonGeometry, array: number[], startingIndex?: number): number[];
  12101. /**
  12102. * Retrieves an instance from a packed array.
  12103. * @param array - The packed array.
  12104. * @param [startingIndex = 0] - The starting index of the element to be unpacked.
  12105. * @param [result] - The object into which to store the result.
  12106. */
  12107. static unpack(array: number[], startingIndex?: number, result?: PolygonGeometry): void;
  12108. /**
  12109. * Returns the bounding rectangle given the provided options
  12110. * @param options - Object with the following properties:
  12111. * @param options.polygonHierarchy - A polygon hierarchy that can include holes.
  12112. * @param [options.granularity = Math.RADIANS_PER_DEGREE] - The distance, in radians, between each latitude and longitude. Determines the number of positions sampled.
  12113. * @param [options.arcType = ArcType.GEODESIC] - The type of line the polygon edges must follow. Valid options are {@link ArcType.GEODESIC} and {@link ArcType.RHUMB}.
  12114. * @param [options.ellipsoid = Ellipsoid.WGS84] - The ellipsoid to be used as a reference.
  12115. * @param [result] - An object in which to store the result.
  12116. * @returns The result rectangle
  12117. */
  12118. static computeRectangle(options: {
  12119. polygonHierarchy: PolygonHierarchy;
  12120. granularity?: number;
  12121. arcType?: ArcType;
  12122. ellipsoid?: Ellipsoid;
  12123. }, result?: Rectangle): Rectangle;
  12124. /**
  12125. * Computes the geometric representation of a polygon, including its vertices, indices, and a bounding sphere.
  12126. * @param polygonGeometry - A description of the polygon.
  12127. * @returns The computed vertices and indices.
  12128. */
  12129. static createGeometry(polygonGeometry: PolygonGeometry): Geometry | undefined;
  12130. }
  12131. /**
  12132. * An hierarchy of linear rings which define a polygon and its holes.
  12133. * The holes themselves may also have holes which nest inner polygons.
  12134. * @param [positions] - A linear ring defining the outer boundary of the polygon or hole.
  12135. * @param [holes] - An array of polygon hierarchies defining holes in the polygon.
  12136. */
  12137. export class PolygonHierarchy {
  12138. constructor(positions?: Cartesian3[], holes?: PolygonHierarchy[]);
  12139. /**
  12140. * A linear ring defining the outer boundary of the polygon or hole.
  12141. */
  12142. positions: Cartesian3[];
  12143. /**
  12144. * An array of polygon hierarchies defining holes in the polygon.
  12145. */
  12146. holes: PolygonHierarchy[];
  12147. }
  12148. /**
  12149. * A description of the outline of a polygon on the ellipsoid. The polygon is defined by a polygon hierarchy.
  12150. * @example
  12151. * // 1. create a polygon outline from points
  12152. * var polygon = new Cesium.PolygonOutlineGeometry({
  12153. * polygonHierarchy : new Cesium.PolygonHierarchy(
  12154. * Cesium.Cartesian3.fromDegreesArray([
  12155. * -72.0, 40.0,
  12156. * -70.0, 35.0,
  12157. * -75.0, 30.0,
  12158. * -70.0, 30.0,
  12159. * -68.0, 40.0
  12160. * ])
  12161. * )
  12162. * });
  12163. * var geometry = Cesium.PolygonOutlineGeometry.createGeometry(polygon);
  12164. *
  12165. * // 2. create a nested polygon with holes outline
  12166. * var polygonWithHole = new Cesium.PolygonOutlineGeometry({
  12167. * polygonHierarchy : new Cesium.PolygonHierarchy(
  12168. * Cesium.Cartesian3.fromDegreesArray([
  12169. * -109.0, 30.0,
  12170. * -95.0, 30.0,
  12171. * -95.0, 40.0,
  12172. * -109.0, 40.0
  12173. * ]),
  12174. * [new Cesium.PolygonHierarchy(
  12175. * Cesium.Cartesian3.fromDegreesArray([
  12176. * -107.0, 31.0,
  12177. * -107.0, 39.0,
  12178. * -97.0, 39.0,
  12179. * -97.0, 31.0
  12180. * ]),
  12181. * [new Cesium.PolygonHierarchy(
  12182. * Cesium.Cartesian3.fromDegreesArray([
  12183. * -105.0, 33.0,
  12184. * -99.0, 33.0,
  12185. * -99.0, 37.0,
  12186. * -105.0, 37.0
  12187. * ]),
  12188. * [new Cesium.PolygonHierarchy(
  12189. * Cesium.Cartesian3.fromDegreesArray([
  12190. * -103.0, 34.0,
  12191. * -101.0, 34.0,
  12192. * -101.0, 36.0,
  12193. * -103.0, 36.0
  12194. * ])
  12195. * )]
  12196. * )]
  12197. * )]
  12198. * )
  12199. * });
  12200. * var geometry = Cesium.PolygonOutlineGeometry.createGeometry(polygonWithHole);
  12201. *
  12202. * // 3. create extruded polygon outline
  12203. * var extrudedPolygon = new Cesium.PolygonOutlineGeometry({
  12204. * polygonHierarchy : new Cesium.PolygonHierarchy(
  12205. * Cesium.Cartesian3.fromDegreesArray([
  12206. * -72.0, 40.0,
  12207. * -70.0, 35.0,
  12208. * -75.0, 30.0,
  12209. * -70.0, 30.0,
  12210. * -68.0, 40.0
  12211. * ])
  12212. * ),
  12213. * extrudedHeight: 300000
  12214. * });
  12215. * var geometry = Cesium.PolygonOutlineGeometry.createGeometry(extrudedPolygon);
  12216. * @param options - Object with the following properties:
  12217. * @param options.polygonHierarchy - A polygon hierarchy that can include holes.
  12218. * @param [options.height = 0.0] - The distance in meters between the polygon and the ellipsoid surface.
  12219. * @param [options.extrudedHeight] - The distance in meters between the polygon's extruded face and the ellipsoid surface.
  12220. * @param [options.vertexFormat = VertexFormat.DEFAULT] - The vertex attributes to be computed.
  12221. * @param [options.ellipsoid = Ellipsoid.WGS84] - The ellipsoid to be used as a reference.
  12222. * @param [options.granularity = Math.RADIANS_PER_DEGREE] - The distance, in radians, between each latitude and longitude. Determines the number of positions in the buffer.
  12223. * @param [options.perPositionHeight = false] - Use the height of options.positions for each position instead of using options.height to determine the height.
  12224. * @param [options.arcType = ArcType.GEODESIC] - The type of path the outline must follow. Valid options are {@link ArcType.GEODESIC} and {@link ArcType.RHUMB}.
  12225. */
  12226. export class PolygonOutlineGeometry {
  12227. constructor(options: {
  12228. polygonHierarchy: PolygonHierarchy;
  12229. height?: number;
  12230. extrudedHeight?: number;
  12231. vertexFormat?: VertexFormat;
  12232. ellipsoid?: Ellipsoid;
  12233. granularity?: number;
  12234. perPositionHeight?: boolean;
  12235. arcType?: ArcType;
  12236. });
  12237. /**
  12238. * The number of elements used to pack the object into an array.
  12239. */
  12240. packedLength: number;
  12241. /**
  12242. * Stores the provided instance into the provided array.
  12243. * @param value - The value to pack.
  12244. * @param array - The array to pack into.
  12245. * @param [startingIndex = 0] - The index into the array at which to start packing the elements.
  12246. * @returns The array that was packed into
  12247. */
  12248. static pack(value: PolygonOutlineGeometry, array: number[], startingIndex?: number): number[];
  12249. /**
  12250. * Retrieves an instance from a packed array.
  12251. * @param array - The packed array.
  12252. * @param [startingIndex = 0] - The starting index of the element to be unpacked.
  12253. * @param [result] - The object into which to store the result.
  12254. * @returns The modified result parameter or a new PolygonOutlineGeometry instance if one was not provided.
  12255. */
  12256. static unpack(array: number[], startingIndex?: number, result?: PolygonOutlineGeometry): PolygonOutlineGeometry;
  12257. /**
  12258. * A description of a polygon outline from an array of positions.
  12259. * @example
  12260. * // create a polygon from points
  12261. * var polygon = Cesium.PolygonOutlineGeometry.fromPositions({
  12262. * positions : Cesium.Cartesian3.fromDegreesArray([
  12263. * -72.0, 40.0,
  12264. * -70.0, 35.0,
  12265. * -75.0, 30.0,
  12266. * -70.0, 30.0,
  12267. * -68.0, 40.0
  12268. * ])
  12269. * });
  12270. * var geometry = Cesium.PolygonOutlineGeometry.createGeometry(polygon);
  12271. * @param options - Object with the following properties:
  12272. * @param options.positions - An array of positions that defined the corner points of the polygon.
  12273. * @param [options.height = 0.0] - The height of the polygon.
  12274. * @param [options.extrudedHeight] - The height of the polygon extrusion.
  12275. * @param [options.ellipsoid = Ellipsoid.WGS84] - The ellipsoid to be used as a reference.
  12276. * @param [options.granularity = Math.RADIANS_PER_DEGREE] - The distance, in radians, between each latitude and longitude. Determines the number of positions in the buffer.
  12277. * @param [options.perPositionHeight = false] - Use the height of options.positions for each position instead of using options.height to determine the height.
  12278. * @param [options.arcType = ArcType.GEODESIC] - The type of path the outline must follow. Valid options are {@link LinkType.GEODESIC} and {@link ArcType.RHUMB}.
  12279. */
  12280. static fromPositions(options: {
  12281. positions: Cartesian3[];
  12282. height?: number;
  12283. extrudedHeight?: number;
  12284. ellipsoid?: Ellipsoid;
  12285. granularity?: number;
  12286. perPositionHeight?: boolean;
  12287. arcType?: ArcType;
  12288. }): PolygonOutlineGeometry;
  12289. /**
  12290. * Computes the geometric representation of a polygon outline, including its vertices, indices, and a bounding sphere.
  12291. * @param polygonGeometry - A description of the polygon outline.
  12292. * @returns The computed vertices and indices.
  12293. */
  12294. static createGeometry(polygonGeometry: PolygonOutlineGeometry): Geometry | undefined;
  12295. }
  12296. /**
  12297. * A description of a polyline modeled as a line strip; the first two positions define a line segment,
  12298. * and each additional position defines a line segment from the previous position. The polyline is capable of
  12299. * displaying with a material.
  12300. * @example
  12301. * // A polyline with two connected line segments
  12302. * var polyline = new Cesium.PolylineGeometry({
  12303. * positions : Cesium.Cartesian3.fromDegreesArray([
  12304. * 0.0, 0.0,
  12305. * 5.0, 0.0,
  12306. * 5.0, 5.0
  12307. * ]),
  12308. * width : 10.0
  12309. * });
  12310. * var geometry = Cesium.PolylineGeometry.createGeometry(polyline);
  12311. * @param options - Object with the following properties:
  12312. * @param options.positions - An array of {@link Cartesian3} defining the positions in the polyline as a line strip.
  12313. * @param [options.width = 1.0] - The width in pixels.
  12314. * @param [options.colors] - An Array of {@link Color} defining the per vertex or per segment colors.
  12315. * @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.
  12316. * @param [options.arcType = ArcType.GEODESIC] - The type of line the polyline segments must follow.
  12317. * @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.
  12318. * @param [options.vertexFormat = VertexFormat.DEFAULT] - The vertex attributes to be computed.
  12319. * @param [options.ellipsoid = Ellipsoid.WGS84] - The ellipsoid to be used as a reference.
  12320. */
  12321. export class PolylineGeometry {
  12322. constructor(options: {
  12323. positions: Cartesian3[];
  12324. width?: number;
  12325. colors?: Color[];
  12326. colorsPerVertex?: boolean;
  12327. arcType?: ArcType;
  12328. granularity?: number;
  12329. vertexFormat?: VertexFormat;
  12330. ellipsoid?: Ellipsoid;
  12331. });
  12332. /**
  12333. * The number of elements used to pack the object into an array.
  12334. */
  12335. packedLength: number;
  12336. /**
  12337. * Stores the provided instance into the provided array.
  12338. * @param value - The value to pack.
  12339. * @param array - The array to pack into.
  12340. * @param [startingIndex = 0] - The index into the array at which to start packing the elements.
  12341. * @returns The array that was packed into
  12342. */
  12343. static pack(value: PolylineGeometry, array: number[], startingIndex?: number): number[];
  12344. /**
  12345. * Retrieves an instance from a packed array.
  12346. * @param array - The packed array.
  12347. * @param [startingIndex = 0] - The starting index of the element to be unpacked.
  12348. * @param [result] - The object into which to store the result.
  12349. * @returns The modified result parameter or a new PolylineGeometry instance if one was not provided.
  12350. */
  12351. static unpack(array: number[], startingIndex?: number, result?: PolylineGeometry): PolylineGeometry;
  12352. /**
  12353. * Computes the geometric representation of a polyline, including its vertices, indices, and a bounding sphere.
  12354. * @param polylineGeometry - A description of the polyline.
  12355. * @returns The computed vertices and indices.
  12356. */
  12357. static createGeometry(polylineGeometry: PolylineGeometry): Geometry | undefined;
  12358. }
  12359. /**
  12360. * A description of a polyline with a volume (a 2D shape extruded along a polyline).
  12361. * @example
  12362. * function computeCircle(radius) {
  12363. * var positions = [];
  12364. * for (var i = 0; i < 360; i++) {
  12365. * var radians = Cesium.Math.toRadians(i);
  12366. * positions.push(new Cesium.Cartesian2(radius * Math.cos(radians), radius * Math.sin(radians)));
  12367. * }
  12368. * return positions;
  12369. * }
  12370. *
  12371. * var volume = new Cesium.PolylineVolumeGeometry({
  12372. * vertexFormat : Cesium.VertexFormat.POSITION_ONLY,
  12373. * polylinePositions : Cesium.Cartesian3.fromDegreesArray([
  12374. * -72.0, 40.0,
  12375. * -70.0, 35.0
  12376. * ]),
  12377. * shapePositions : computeCircle(100000.0)
  12378. * });
  12379. * @param options - Object with the following properties:
  12380. * @param options.polylinePositions - An array of {@link Cartesain3} positions that define the center of the polyline volume.
  12381. * @param options.shapePositions - An array of {@link Cartesian2} positions that define the shape to be extruded along the polyline
  12382. * @param [options.ellipsoid = Ellipsoid.WGS84] - The ellipsoid to be used as a reference.
  12383. * @param [options.granularity = Math.RADIANS_PER_DEGREE] - The distance, in radians, between each latitude and longitude. Determines the number of positions in the buffer.
  12384. * @param [options.vertexFormat = VertexFormat.DEFAULT] - The vertex attributes to be computed.
  12385. * @param [options.cornerType = CornerType.ROUNDED] - Determines the style of the corners.
  12386. */
  12387. export class PolylineVolumeGeometry {
  12388. constructor(options: {
  12389. polylinePositions: Cartesian3[];
  12390. shapePositions: Cartesian2[];
  12391. ellipsoid?: Ellipsoid;
  12392. granularity?: number;
  12393. vertexFormat?: VertexFormat;
  12394. cornerType?: CornerType;
  12395. });
  12396. /**
  12397. * The number of elements used to pack the object into an array.
  12398. */
  12399. packedLength: number;
  12400. /**
  12401. * Stores the provided instance into the provided array.
  12402. * @param value - The value to pack.
  12403. * @param array - The array to pack into.
  12404. * @param [startingIndex = 0] - The index into the array at which to start packing the elements.
  12405. * @returns The array that was packed into
  12406. */
  12407. static pack(value: PolylineVolumeGeometry, array: number[], startingIndex?: number): number[];
  12408. /**
  12409. * Retrieves an instance from a packed array.
  12410. * @param array - The packed array.
  12411. * @param [startingIndex = 0] - The starting index of the element to be unpacked.
  12412. * @param [result] - The object into which to store the result.
  12413. * @returns The modified result parameter or a new PolylineVolumeGeometry instance if one was not provided.
  12414. */
  12415. static unpack(array: number[], startingIndex?: number, result?: PolylineVolumeGeometry): PolylineVolumeGeometry;
  12416. /**
  12417. * Computes the geometric representation of a polyline with a volume, including its vertices, indices, and a bounding sphere.
  12418. * @param polylineVolumeGeometry - A description of the polyline volume.
  12419. * @returns The computed vertices and indices.
  12420. */
  12421. static createGeometry(polylineVolumeGeometry: PolylineVolumeGeometry): Geometry | undefined;
  12422. }
  12423. /**
  12424. * A description of a polyline with a volume (a 2D shape extruded along a polyline).
  12425. * @example
  12426. * function computeCircle(radius) {
  12427. * var positions = [];
  12428. * for (var i = 0; i < 360; i++) {
  12429. * var radians = Cesium.Math.toRadians(i);
  12430. * positions.push(new Cesium.Cartesian2(radius * Math.cos(radians), radius * Math.sin(radians)));
  12431. * }
  12432. * return positions;
  12433. * }
  12434. *
  12435. * var volumeOutline = new Cesium.PolylineVolumeOutlineGeometry({
  12436. * polylinePositions : Cesium.Cartesian3.fromDegreesArray([
  12437. * -72.0, 40.0,
  12438. * -70.0, 35.0
  12439. * ]),
  12440. * shapePositions : computeCircle(100000.0)
  12441. * });
  12442. * @param options - Object with the following properties:
  12443. * @param options.polylinePositions - An array of positions that define the center of the polyline volume.
  12444. * @param options.shapePositions - An array of positions that define the shape to be extruded along the polyline
  12445. * @param [options.ellipsoid = Ellipsoid.WGS84] - The ellipsoid to be used as a reference.
  12446. * @param [options.granularity = Math.RADIANS_PER_DEGREE] - The distance, in radians, between each latitude and longitude. Determines the number of positions in the buffer.
  12447. * @param [options.cornerType = CornerType.ROUNDED] - Determines the style of the corners.
  12448. */
  12449. export class PolylineVolumeOutlineGeometry {
  12450. constructor(options: {
  12451. polylinePositions: Cartesian3[];
  12452. shapePositions: Cartesian2[];
  12453. ellipsoid?: Ellipsoid;
  12454. granularity?: number;
  12455. cornerType?: CornerType;
  12456. });
  12457. /**
  12458. * The number of elements used to pack the object into an array.
  12459. */
  12460. packedLength: number;
  12461. /**
  12462. * Stores the provided instance into the provided array.
  12463. * @param value - The value to pack.
  12464. * @param array - The array to pack into.
  12465. * @param [startingIndex = 0] - The index into the array at which to start packing the elements.
  12466. * @returns The array that was packed into
  12467. */
  12468. static pack(value: PolylineVolumeOutlineGeometry, array: number[], startingIndex?: 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 PolylineVolumeOutlineGeometry instance if one was not provided.
  12475. */
  12476. static unpack(array: number[], startingIndex?: number, result?: PolylineVolumeOutlineGeometry): PolylineVolumeOutlineGeometry;
  12477. /**
  12478. * Computes the geometric representation of the outline of a polyline with a volume, including its vertices, indices, and a bounding sphere.
  12479. * @param polylineVolumeOutlineGeometry - A description of the polyline volume outline.
  12480. * @returns The computed vertices and indices.
  12481. */
  12482. static createGeometry(polylineVolumeOutlineGeometry: PolylineVolumeOutlineGeometry): Geometry | undefined;
  12483. }
  12484. /**
  12485. * The type of a geometric primitive, i.e., points, lines, and triangles.
  12486. */
  12487. export enum PrimitiveType {
  12488. /**
  12489. * Points primitive where each vertex (or index) is a separate point.
  12490. */
  12491. POINTS = WebGLConstants.POINTS,
  12492. /**
  12493. * Lines primitive where each two vertices (or indices) is a line segment. Line segments are not necessarily connected.
  12494. */
  12495. LINES = WebGLConstants.LINES,
  12496. /**
  12497. * Line loop primitive where each vertex (or index) after the first connects a line to
  12498. * the previous vertex, and the last vertex implicitly connects to the first.
  12499. */
  12500. LINE_LOOP = WebGLConstants.LINE_LOOP,
  12501. /**
  12502. * Line strip primitive where each vertex (or index) after the first connects a line to the previous vertex.
  12503. */
  12504. LINE_STRIP = WebGLConstants.LINE_STRIP,
  12505. /**
  12506. * Triangles primitive where each three vertices (or indices) is a triangle. Triangles do not necessarily share edges.
  12507. */
  12508. TRIANGLES = WebGLConstants.TRIANGLES,
  12509. /**
  12510. * Triangle strip primitive where each vertex (or index) after the first two connect to
  12511. * the previous two vertices forming a triangle. For example, this can be used to model a wall.
  12512. */
  12513. TRIANGLE_STRIP = WebGLConstants.TRIANGLE_STRIP,
  12514. /**
  12515. * Triangle fan primitive where each vertex (or index) after the first two connect to
  12516. * the previous vertex and the first vertex forming a triangle. For example, this can be used
  12517. * to model a cone or circle.
  12518. */
  12519. TRIANGLE_FAN = WebGLConstants.TRIANGLE_FAN
  12520. }
  12521. /**
  12522. * Base class for proxying requested made by {@link Resource}.
  12523. */
  12524. export class Proxy {
  12525. constructor();
  12526. /**
  12527. * Get the final URL to use to request a given resource.
  12528. * @param resource - The resource to request.
  12529. * @returns proxied resource
  12530. */
  12531. getURL(resource: string): string;
  12532. }
  12533. /**
  12534. * Defines functions for 2nd order polynomial functions of one variable with only real coefficients.
  12535. */
  12536. export namespace QuadraticRealPolynomial {
  12537. /**
  12538. * Provides the discriminant of the quadratic equation from the supplied coefficients.
  12539. * @param a - The coefficient of the 2nd order monomial.
  12540. * @param b - The coefficient of the 1st order monomial.
  12541. * @param c - The coefficient of the 0th order monomial.
  12542. * @returns The value of the discriminant.
  12543. */
  12544. function computeDiscriminant(a: number, b: number, c: number): number;
  12545. /**
  12546. * Provides the real valued roots of the quadratic polynomial with the provided coefficients.
  12547. * @param a - The coefficient of the 2nd order monomial.
  12548. * @param b - The coefficient of the 1st order monomial.
  12549. * @param c - The coefficient of the 0th order monomial.
  12550. * @returns The real valued roots.
  12551. */
  12552. function computeRealRoots(a: number, b: number, c: number): number[];
  12553. }
  12554. /**
  12555. * Terrain data for a single tile where the terrain data is represented as a quantized mesh. A quantized
  12556. * mesh consists of three vertex attributes, longitude, latitude, and height. All attributes are expressed
  12557. * as 16-bit values in the range 0 to 32767. Longitude and latitude are zero at the southwest corner
  12558. * of the tile and 32767 at the northeast corner. Height is zero at the minimum height in the tile
  12559. * and 32767 at the maximum height in the tile.
  12560. * @example
  12561. * var data = new Cesium.QuantizedMeshTerrainData({
  12562. * minimumHeight : -100,
  12563. * maximumHeight : 2101,
  12564. * quantizedVertices : new Uint16Array([// order is SW NW SE NE
  12565. * // longitude
  12566. * 0, 0, 32767, 32767,
  12567. * // latitude
  12568. * 0, 32767, 0, 32767,
  12569. * // heights
  12570. * 16384, 0, 32767, 16384]),
  12571. * indices : new Uint16Array([0, 3, 1,
  12572. * 0, 2, 3]),
  12573. * boundingSphere : new Cesium.BoundingSphere(new Cesium.Cartesian3(1.0, 2.0, 3.0), 10000),
  12574. * orientedBoundingBox : new Cesium.OrientedBoundingBox(new Cesium.Cartesian3(1.0, 2.0, 3.0), Cesium.Matrix3.fromRotationX(Cesium.Math.PI, new Cesium.Matrix3())),
  12575. * horizonOcclusionPoint : new Cesium.Cartesian3(3.0, 2.0, 1.0),
  12576. * westIndices : [0, 1],
  12577. * southIndices : [0, 1],
  12578. * eastIndices : [2, 3],
  12579. * northIndices : [1, 3],
  12580. * westSkirtHeight : 1.0,
  12581. * southSkirtHeight : 1.0,
  12582. * eastSkirtHeight : 1.0,
  12583. * northSkirtHeight : 1.0
  12584. * });
  12585. * @param options - Object with the following properties:
  12586. * @param options.quantizedVertices - The buffer containing the quantized mesh.
  12587. * @param options.indices - The indices specifying how the quantized vertices are linked
  12588. * together into triangles. Each three indices specifies one triangle.
  12589. * @param options.minimumHeight - The minimum terrain height within the tile, in meters above the ellipsoid.
  12590. * @param options.maximumHeight - The maximum terrain height within the tile, in meters above the ellipsoid.
  12591. * @param options.boundingSphere - A sphere bounding all of the vertices in the mesh.
  12592. * @param [options.orientedBoundingBox] - An OrientedBoundingBox bounding all of the vertices in the mesh.
  12593. * @param options.horizonOcclusionPoint - The horizon occlusion point of the mesh. If this point
  12594. * is below the horizon, the entire tile is assumed to be below the horizon as well.
  12595. * The point is expressed in ellipsoid-scaled coordinates.
  12596. * @param options.westIndices - The indices of the vertices on the western edge of the tile.
  12597. * @param options.southIndices - The indices of the vertices on the southern edge of the tile.
  12598. * @param options.eastIndices - The indices of the vertices on the eastern edge of the tile.
  12599. * @param options.northIndices - The indices of the vertices on the northern edge of the tile.
  12600. * @param options.westSkirtHeight - The height of the skirt to add on the western edge of the tile.
  12601. * @param options.southSkirtHeight - The height of the skirt to add on the southern edge of the tile.
  12602. * @param options.eastSkirtHeight - The height of the skirt to add on the eastern edge of the tile.
  12603. * @param options.northSkirtHeight - The height of the skirt to add on the northern edge of the tile.
  12604. * @param [options.childTileMask = 15] - A bit mask indicating which of this tile's four children exist.
  12605. * If a child's bit is set, geometry will be requested for that tile as well when it
  12606. * is needed. If the bit is cleared, the child tile is not requested and geometry is
  12607. * instead upsampled from the parent. The bit values are as follows:
  12608. * <table>
  12609. * <tr><th>Bit Position</th><th>Bit Value</th><th>Child Tile</th></tr>
  12610. * <tr><td>0</td><td>1</td><td>Southwest</td></tr>
  12611. * <tr><td>1</td><td>2</td><td>Southeast</td></tr>
  12612. * <tr><td>2</td><td>4</td><td>Northwest</td></tr>
  12613. * <tr><td>3</td><td>8</td><td>Northeast</td></tr>
  12614. * </table>
  12615. * @param [options.createdByUpsampling = false] - True if this instance was created by upsampling another instance;
  12616. * otherwise, false.
  12617. * @param [options.encodedNormals] - The buffer containing per vertex normals, encoded using 'oct' encoding
  12618. * @param [options.waterMask] - The buffer containing the watermask.
  12619. * @param [options.credits] - Array of credits for this tile.
  12620. */
  12621. export class QuantizedMeshTerrainData {
  12622. constructor(options: {
  12623. quantizedVertices: Uint16Array;
  12624. indices: Uint16Array | Uint32Array;
  12625. minimumHeight: number;
  12626. maximumHeight: number;
  12627. boundingSphere: BoundingSphere;
  12628. orientedBoundingBox?: OrientedBoundingBox;
  12629. horizonOcclusionPoint: Cartesian3;
  12630. westIndices: number[];
  12631. southIndices: number[];
  12632. eastIndices: number[];
  12633. northIndices: number[];
  12634. westSkirtHeight: number;
  12635. southSkirtHeight: number;
  12636. eastSkirtHeight: number;
  12637. northSkirtHeight: number;
  12638. childTileMask?: number;
  12639. createdByUpsampling?: boolean;
  12640. encodedNormals?: Uint8Array;
  12641. waterMask?: Uint8Array;
  12642. credits?: Credit[];
  12643. });
  12644. /**
  12645. * An array of credits for this tile.
  12646. */
  12647. credits: Credit[];
  12648. /**
  12649. * The water mask included in this terrain data, if any. A water mask is a rectangular
  12650. * Uint8Array or image where a value of 255 indicates water and a value of 0 indicates land.
  12651. * Values in between 0 and 255 are allowed as well to smoothly blend between land and water.
  12652. */
  12653. waterMask: Uint8Array | HTMLImageElement | HTMLCanvasElement;
  12654. /**
  12655. * Upsamples this terrain data for use by a descendant tile. The resulting instance will contain a subset of the
  12656. * vertices in this instance, interpolated if necessary.
  12657. * @param tilingScheme - The tiling scheme of this terrain data.
  12658. * @param thisX - The X coordinate of this tile in the tiling scheme.
  12659. * @param thisY - The Y coordinate of this tile in the tiling scheme.
  12660. * @param thisLevel - The level of this tile in the tiling scheme.
  12661. * @param descendantX - The X coordinate within the tiling scheme of the descendant tile for which we are upsampling.
  12662. * @param descendantY - The Y coordinate within the tiling scheme of the descendant tile for which we are upsampling.
  12663. * @param descendantLevel - The level within the tiling scheme of the descendant tile for which we are upsampling.
  12664. * @returns A promise for upsampled heightmap terrain data for the descendant tile,
  12665. * or undefined if too many asynchronous upsample operations are in progress and the request has been
  12666. * deferred.
  12667. */
  12668. upsample(tilingScheme: TilingScheme, thisX: number, thisY: number, thisLevel: number, descendantX: number, descendantY: number, descendantLevel: number): Promise<QuantizedMeshTerrainData> | undefined;
  12669. /**
  12670. * Computes the terrain height at a specified longitude and latitude.
  12671. * @param rectangle - The rectangle covered by this terrain data.
  12672. * @param longitude - The longitude in radians.
  12673. * @param latitude - The latitude in radians.
  12674. * @returns The terrain height at the specified position. The position is clamped to
  12675. * the rectangle, so expect incorrect results for positions far outside the rectangle.
  12676. */
  12677. interpolateHeight(rectangle: Rectangle, longitude: number, latitude: number): number;
  12678. /**
  12679. * Determines if a given child tile is available, based on the
  12680. * {@link HeightmapTerrainData.childTileMask}. The given child tile coordinates are assumed
  12681. * to be one of the four children of this tile. If non-child tile coordinates are
  12682. * given, the availability of the southeast child tile is returned.
  12683. * @param thisX - The tile X coordinate of this (the parent) tile.
  12684. * @param thisY - The tile Y coordinate of this (the parent) tile.
  12685. * @param childX - The tile X coordinate of the child tile to check for availability.
  12686. * @param childY - The tile Y coordinate of the child tile to check for availability.
  12687. * @returns True if the child tile is available; otherwise, false.
  12688. */
  12689. isChildAvailable(thisX: number, thisY: number, childX: number, childY: number): boolean;
  12690. /**
  12691. * Gets a value indicating whether or not this terrain data was created by upsampling lower resolution
  12692. * terrain data. If this value is false, the data was obtained from some other source, such
  12693. * as by downloading it from a remote server. This method should return true for instances
  12694. * returned from a call to {@link HeightmapTerrainData#upsample}.
  12695. * @returns True if this instance was created by upsampling; otherwise, false.
  12696. */
  12697. wasCreatedByUpsampling(): boolean;
  12698. }
  12699. /**
  12700. * Defines functions for 4th order polynomial functions of one variable with only real coefficients.
  12701. */
  12702. export namespace QuarticRealPolynomial {
  12703. /**
  12704. * Provides the discriminant of the quartic equation from the supplied coefficients.
  12705. * @param a - The coefficient of the 4th order monomial.
  12706. * @param b - The coefficient of the 3rd order monomial.
  12707. * @param c - The coefficient of the 2nd order monomial.
  12708. * @param d - The coefficient of the 1st order monomial.
  12709. * @param e - The coefficient of the 0th order monomial.
  12710. * @returns The value of the discriminant.
  12711. */
  12712. function computeDiscriminant(a: number, b: number, c: number, d: number, e: number): number;
  12713. /**
  12714. * Provides the real valued roots of the quartic polynomial with the provided coefficients.
  12715. * @param a - The coefficient of the 4th order monomial.
  12716. * @param b - The coefficient of the 3rd order monomial.
  12717. * @param c - The coefficient of the 2nd order monomial.
  12718. * @param d - The coefficient of the 1st order monomial.
  12719. * @param e - The coefficient of the 0th order monomial.
  12720. * @returns The real valued roots.
  12721. */
  12722. function computeRealRoots(a: number, b: number, c: number, d: number, e: number): number[];
  12723. }
  12724. /**
  12725. * A set of 4-dimensional coordinates used to represent rotation in 3-dimensional space.
  12726. * @param [x = 0.0] - The X component.
  12727. * @param [y = 0.0] - The Y component.
  12728. * @param [z = 0.0] - The Z component.
  12729. * @param [w = 0.0] - The W component.
  12730. */
  12731. export class Quaternion {
  12732. constructor(x?: number, y?: number, z?: number, w?: number);
  12733. /**
  12734. * The X component.
  12735. */
  12736. x: number;
  12737. /**
  12738. * The Y component.
  12739. */
  12740. y: number;
  12741. /**
  12742. * The Z component.
  12743. */
  12744. z: number;
  12745. /**
  12746. * The W component.
  12747. */
  12748. w: number;
  12749. /**
  12750. * Computes a quaternion representing a rotation around an axis.
  12751. * @param axis - The axis of rotation.
  12752. * @param angle - The angle in radians to rotate around the axis.
  12753. * @param [result] - The object onto which to store the result.
  12754. * @returns The modified result parameter or a new Quaternion instance if one was not provided.
  12755. */
  12756. static fromAxisAngle(axis: Cartesian3, angle: number, result?: Quaternion): Quaternion;
  12757. /**
  12758. * Computes a Quaternion from the provided Matrix3 instance.
  12759. * @param matrix - The rotation matrix.
  12760. * @param [result] - The object onto which to store the result.
  12761. * @returns The modified result parameter or a new Quaternion instance if one was not provided.
  12762. */
  12763. static fromRotationMatrix(matrix: Matrix3, result?: Quaternion): Quaternion;
  12764. /**
  12765. * Computes a rotation from the given heading, pitch and roll angles. Heading is the rotation about the
  12766. * negative z axis. Pitch is the rotation about the negative y axis. Roll is the rotation about
  12767. * the positive x axis.
  12768. * @param headingPitchRoll - The rotation expressed as a heading, pitch and roll.
  12769. * @param [result] - The object onto which to store the result.
  12770. * @returns The modified result parameter or a new Quaternion instance if none was provided.
  12771. */
  12772. static fromHeadingPitchRoll(headingPitchRoll: HeadingPitchRoll, result?: Quaternion): Quaternion;
  12773. /**
  12774. * The number of elements used to pack the object into an array.
  12775. */
  12776. static packedLength: number;
  12777. /**
  12778. * Stores the provided instance into the provided array.
  12779. * @param value - The value to pack.
  12780. * @param array - The array to pack into.
  12781. * @param [startingIndex = 0] - The index into the array at which to start packing the elements.
  12782. * @returns The array that was packed into
  12783. */
  12784. static pack(value: Quaternion, array: number[], startingIndex?: number): number[];
  12785. /**
  12786. * Retrieves an instance from a packed array.
  12787. * @param array - The packed array.
  12788. * @param [startingIndex = 0] - The starting index of the element to be unpacked.
  12789. * @param [result] - The object into which to store the result.
  12790. * @returns The modified result parameter or a new Quaternion instance if one was not provided.
  12791. */
  12792. static unpack(array: number[], startingIndex?: number, result?: Quaternion): Quaternion;
  12793. /**
  12794. * The number of elements used to store the object into an array in its interpolatable form.
  12795. */
  12796. static packedInterpolationLength: number;
  12797. /**
  12798. * Converts a packed array into a form suitable for interpolation.
  12799. * @param packedArray - The packed array.
  12800. * @param [startingIndex = 0] - The index of the first element to be converted.
  12801. * @param [lastIndex = packedArray.length] - The index of the last element to be converted.
  12802. * @param [result] - The object into which to store the result.
  12803. */
  12804. static convertPackedArrayForInterpolation(packedArray: number[], startingIndex?: number, lastIndex?: number, result?: number[]): void;
  12805. /**
  12806. * Retrieves an instance from a packed array converted with {@link convertPackedArrayForInterpolation}.
  12807. * @param array - The array previously packed for interpolation.
  12808. * @param sourceArray - The original packed array.
  12809. * @param [firstIndex = 0] - The firstIndex used to convert the array.
  12810. * @param [lastIndex = packedArray.length] - The lastIndex used to convert the array.
  12811. * @param [result] - The object into which to store the result.
  12812. * @returns The modified result parameter or a new Quaternion instance if one was not provided.
  12813. */
  12814. static unpackInterpolationResult(array: number[], sourceArray: number[], firstIndex?: number, lastIndex?: number, result?: Quaternion): Quaternion;
  12815. /**
  12816. * Duplicates a Quaternion instance.
  12817. * @param quaternion - The quaternion to duplicate.
  12818. * @param [result] - The object onto which to store the result.
  12819. * @returns The modified result parameter or a new Quaternion instance if one was not provided. (Returns undefined if quaternion is undefined)
  12820. */
  12821. static clone(quaternion: Quaternion, result?: Quaternion): Quaternion;
  12822. /**
  12823. * Computes the conjugate of the provided quaternion.
  12824. * @param quaternion - The quaternion to conjugate.
  12825. * @param result - The object onto which to store the result.
  12826. * @returns The modified result parameter.
  12827. */
  12828. static conjugate(quaternion: Quaternion, result: Quaternion): Quaternion;
  12829. /**
  12830. * Computes magnitude squared for the provided quaternion.
  12831. * @param quaternion - The quaternion to conjugate.
  12832. * @returns The magnitude squared.
  12833. */
  12834. static magnitudeSquared(quaternion: Quaternion): number;
  12835. /**
  12836. * Computes magnitude for the provided quaternion.
  12837. * @param quaternion - The quaternion to conjugate.
  12838. * @returns The magnitude.
  12839. */
  12840. static magnitude(quaternion: Quaternion): number;
  12841. /**
  12842. * Computes the normalized form of the provided quaternion.
  12843. * @param quaternion - The quaternion to normalize.
  12844. * @param result - The object onto which to store the result.
  12845. * @returns The modified result parameter.
  12846. */
  12847. static normalize(quaternion: Quaternion, result: Quaternion): Quaternion;
  12848. /**
  12849. * Computes the inverse of the provided quaternion.
  12850. * @param quaternion - The quaternion to normalize.
  12851. * @param result - The object onto which to store the result.
  12852. * @returns The modified result parameter.
  12853. */
  12854. static inverse(quaternion: Quaternion, result: Quaternion): Quaternion;
  12855. /**
  12856. * Computes the componentwise sum of two quaternions.
  12857. * @param left - The first quaternion.
  12858. * @param right - The second quaternion.
  12859. * @param result - The object onto which to store the result.
  12860. * @returns The modified result parameter.
  12861. */
  12862. static add(left: Quaternion, right: Quaternion, result: Quaternion): Quaternion;
  12863. /**
  12864. * Computes the componentwise difference of two quaternions.
  12865. * @param left - The first quaternion.
  12866. * @param right - The second quaternion.
  12867. * @param result - The object onto which to store the result.
  12868. * @returns The modified result parameter.
  12869. */
  12870. static subtract(left: Quaternion, right: Quaternion, result: Quaternion): Quaternion;
  12871. /**
  12872. * Negates the provided quaternion.
  12873. * @param quaternion - The quaternion to be negated.
  12874. * @param result - The object onto which to store the result.
  12875. * @returns The modified result parameter.
  12876. */
  12877. static negate(quaternion: Quaternion, result: Quaternion): Quaternion;
  12878. /**
  12879. * Computes the dot (scalar) product of two quaternions.
  12880. * @param left - The first quaternion.
  12881. * @param right - The second quaternion.
  12882. * @returns The dot product.
  12883. */
  12884. static dot(left: Quaternion, right: Quaternion): number;
  12885. /**
  12886. * Computes the product of two quaternions.
  12887. * @param left - The first quaternion.
  12888. * @param right - The second quaternion.
  12889. * @param result - The object onto which to store the result.
  12890. * @returns The modified result parameter.
  12891. */
  12892. static multiply(left: Quaternion, right: Quaternion, result: Quaternion): Quaternion;
  12893. /**
  12894. * Multiplies the provided quaternion componentwise by the provided scalar.
  12895. * @param quaternion - The quaternion to be scaled.
  12896. * @param scalar - The scalar to multiply with.
  12897. * @param result - The object onto which to store the result.
  12898. * @returns The modified result parameter.
  12899. */
  12900. static multiplyByScalar(quaternion: Quaternion, scalar: number, result: Quaternion): Quaternion;
  12901. /**
  12902. * Divides the provided quaternion componentwise by the provided scalar.
  12903. * @param quaternion - The quaternion to be divided.
  12904. * @param scalar - The scalar to divide by.
  12905. * @param result - The object onto which to store the result.
  12906. * @returns The modified result parameter.
  12907. */
  12908. static divideByScalar(quaternion: Quaternion, scalar: number, result: Quaternion): Quaternion;
  12909. /**
  12910. * Computes the axis of rotation of the provided quaternion.
  12911. * @param quaternion - The quaternion to use.
  12912. * @param result - The object onto which to store the result.
  12913. * @returns The modified result parameter.
  12914. */
  12915. static computeAxis(quaternion: Quaternion, result: Cartesian3): Cartesian3;
  12916. /**
  12917. * Computes the angle of rotation of the provided quaternion.
  12918. * @param quaternion - The quaternion to use.
  12919. * @returns The angle of rotation.
  12920. */
  12921. static computeAngle(quaternion: Quaternion): number;
  12922. /**
  12923. * Computes the linear interpolation or extrapolation at t using the provided quaternions.
  12924. * @param start - The value corresponding to t at 0.0.
  12925. * @param end - The value corresponding to t at 1.0.
  12926. * @param t - The point along t at which to interpolate.
  12927. * @param result - The object onto which to store the result.
  12928. * @returns The modified result parameter.
  12929. */
  12930. static lerp(start: Quaternion, end: Quaternion, t: number, result: Quaternion): Quaternion;
  12931. /**
  12932. * Computes the spherical linear interpolation or extrapolation at t using the provided quaternions.
  12933. * @param start - The value corresponding to t at 0.0.
  12934. * @param end - The value corresponding to t at 1.0.
  12935. * @param t - The point along t at which to interpolate.
  12936. * @param result - The object onto which to store the result.
  12937. * @returns The modified result parameter.
  12938. */
  12939. static slerp(start: Quaternion, end: Quaternion, t: number, result: Quaternion): Quaternion;
  12940. /**
  12941. * The logarithmic quaternion function.
  12942. * @param quaternion - The unit quaternion.
  12943. * @param result - The object onto which to store the result.
  12944. * @returns The modified result parameter.
  12945. */
  12946. static log(quaternion: Quaternion, result: Cartesian3): Cartesian3;
  12947. /**
  12948. * The exponential quaternion function.
  12949. * @param cartesian - The cartesian.
  12950. * @param result - The object onto which to store the result.
  12951. * @returns The modified result parameter.
  12952. */
  12953. static exp(cartesian: Cartesian3, result: Quaternion): Quaternion;
  12954. /**
  12955. * Computes an inner quadrangle point.
  12956. * <p>This will compute quaternions that ensure a squad curve is C<sup>1</sup>.</p>
  12957. * @param q0 - The first quaternion.
  12958. * @param q1 - The second quaternion.
  12959. * @param q2 - The third quaternion.
  12960. * @param result - The object onto which to store the result.
  12961. * @returns The modified result parameter.
  12962. */
  12963. static computeInnerQuadrangle(q0: Quaternion, q1: Quaternion, q2: Quaternion, result: Quaternion): Quaternion;
  12964. /**
  12965. * Computes the spherical quadrangle interpolation between quaternions.
  12966. * @example
  12967. * // 1. compute the squad interpolation between two quaternions on a curve
  12968. * var s0 = Cesium.Quaternion.computeInnerQuadrangle(quaternions[i - 1], quaternions[i], quaternions[i + 1], new Cesium.Quaternion());
  12969. * var s1 = Cesium.Quaternion.computeInnerQuadrangle(quaternions[i], quaternions[i + 1], quaternions[i + 2], new Cesium.Quaternion());
  12970. * var q = Cesium.Quaternion.squad(quaternions[i], quaternions[i + 1], s0, s1, t, new Cesium.Quaternion());
  12971. *
  12972. * // 2. compute the squad interpolation as above but where the first quaternion is a end point.
  12973. * var s1 = Cesium.Quaternion.computeInnerQuadrangle(quaternions[0], quaternions[1], quaternions[2], new Cesium.Quaternion());
  12974. * var q = Cesium.Quaternion.squad(quaternions[0], quaternions[1], quaternions[0], s1, t, new Cesium.Quaternion());
  12975. * @param q0 - The first quaternion.
  12976. * @param q1 - The second quaternion.
  12977. * @param s0 - The first inner quadrangle.
  12978. * @param s1 - The second inner quadrangle.
  12979. * @param t - The time in [0,1] used to interpolate.
  12980. * @param result - The object onto which to store the result.
  12981. * @returns The modified result parameter.
  12982. */
  12983. static squad(q0: Quaternion, q1: Quaternion, s0: Quaternion, s1: Quaternion, t: number, result: Quaternion): Quaternion;
  12984. /**
  12985. * Computes the spherical linear interpolation or extrapolation at t using the provided quaternions.
  12986. * This implementation is faster than {@link Quaternion#slerp}, but is only accurate up to 10<sup>-6</sup>.
  12987. * @param start - The value corresponding to t at 0.0.
  12988. * @param end - The value corresponding to t at 1.0.
  12989. * @param t - The point along t at which to interpolate.
  12990. * @param result - The object onto which to store the result.
  12991. * @returns The modified result parameter.
  12992. */
  12993. static fastSlerp(start: Quaternion, end: Quaternion, t: number, result: Quaternion): Quaternion;
  12994. /**
  12995. * Computes the spherical quadrangle interpolation between quaternions.
  12996. * An implementation that is faster than {@link Quaternion#squad}, but less accurate.
  12997. * @param q0 - The first quaternion.
  12998. * @param q1 - The second quaternion.
  12999. * @param s0 - The first inner quadrangle.
  13000. * @param s1 - The second inner quadrangle.
  13001. * @param t - The time in [0,1] used to interpolate.
  13002. * @param result - The object onto which to store the result.
  13003. * @returns The modified result parameter or a new instance if none was provided.
  13004. */
  13005. static fastSquad(q0: Quaternion, q1: Quaternion, s0: Quaternion, s1: Quaternion, t: number, result: Quaternion): Quaternion;
  13006. /**
  13007. * Compares the provided quaternions componentwise and returns
  13008. * <code>true</code> if they are equal, <code>false</code> otherwise.
  13009. * @param [left] - The first quaternion.
  13010. * @param [right] - The second quaternion.
  13011. * @returns <code>true</code> if left and right are equal, <code>false</code> otherwise.
  13012. */
  13013. static equals(left?: Quaternion, right?: Quaternion): boolean;
  13014. /**
  13015. * Compares the provided quaternions componentwise and returns
  13016. * <code>true</code> if they are within the provided epsilon,
  13017. * <code>false</code> otherwise.
  13018. * @param [left] - The first quaternion.
  13019. * @param [right] - The second quaternion.
  13020. * @param [epsilon = 0] - The epsilon to use for equality testing.
  13021. * @returns <code>true</code> if left and right are within the provided epsilon, <code>false</code> otherwise.
  13022. */
  13023. static equalsEpsilon(left?: Quaternion, right?: Quaternion, epsilon?: number): boolean;
  13024. /**
  13025. * An immutable Quaternion instance initialized to (0.0, 0.0, 0.0, 0.0).
  13026. */
  13027. static readonly ZERO: Quaternion;
  13028. /**
  13029. * An immutable Quaternion instance initialized to (0.0, 0.0, 0.0, 1.0).
  13030. */
  13031. static readonly IDENTITY: Quaternion;
  13032. /**
  13033. * Duplicates this Quaternion instance.
  13034. * @param [result] - The object onto which to store the result.
  13035. * @returns The modified result parameter or a new Quaternion instance if one was not provided.
  13036. */
  13037. clone(result?: Quaternion): Quaternion;
  13038. /**
  13039. * Compares this and the provided quaternion componentwise and returns
  13040. * <code>true</code> if they are equal, <code>false</code> otherwise.
  13041. * @param [right] - The right hand side quaternion.
  13042. * @returns <code>true</code> if left and right are equal, <code>false</code> otherwise.
  13043. */
  13044. equals(right?: Quaternion): boolean;
  13045. /**
  13046. * Compares this and the provided quaternion componentwise and returns
  13047. * <code>true</code> if they are within the provided epsilon,
  13048. * <code>false</code> otherwise.
  13049. * @param [right] - The right hand side quaternion.
  13050. * @param [epsilon = 0] - The epsilon to use for equality testing.
  13051. * @returns <code>true</code> if left and right are within the provided epsilon, <code>false</code> otherwise.
  13052. */
  13053. equalsEpsilon(right?: Quaternion, epsilon?: number): boolean;
  13054. /**
  13055. * Returns a string representing this quaternion in the format (x, y, z, w).
  13056. * @returns A string representing this Quaternion.
  13057. */
  13058. toString(): string;
  13059. }
  13060. /**
  13061. * A spline that uses spherical linear (slerp) interpolation to create a quaternion curve.
  13062. * The generated curve is in the class C<sup>1</sup>.
  13063. * @param options - Object with the following properties:
  13064. * @param options.times - An array of strictly increasing, unit-less, floating-point times at each point.
  13065. * The values are in no way connected to the clock time. They are the parameterization for the curve.
  13066. * @param options.points - The array of {@link Quaternion} control points.
  13067. */
  13068. export class QuaternionSpline {
  13069. constructor(options: {
  13070. times: number[];
  13071. points: Quaternion[];
  13072. });
  13073. /**
  13074. * An array of times for the control points.
  13075. */
  13076. readonly times: number[];
  13077. /**
  13078. * An array of {@link Quaternion} control points.
  13079. */
  13080. readonly points: Quaternion[];
  13081. /**
  13082. * Finds an index <code>i</code> in <code>times</code> such that the parameter
  13083. * <code>time</code> is in the interval <code>[times[i], times[i + 1]]</code>.
  13084. * @param time - The time.
  13085. * @returns The index for the element at the start of the interval.
  13086. */
  13087. findTimeInterval(time: number): number;
  13088. /**
  13089. * Wraps the given time to the period covered by the spline.
  13090. * @param time - The time.
  13091. * @returns The time, wrapped around to the updated animation.
  13092. */
  13093. wrapTime(time: number): number;
  13094. /**
  13095. * Clamps the given time to the period covered by the spline.
  13096. * @param time - The time.
  13097. * @returns The time, clamped to the animation period.
  13098. */
  13099. clampTime(time: number): number;
  13100. /**
  13101. * Evaluates the curve at a given time.
  13102. * @param time - The time at which to evaluate the curve.
  13103. * @param [result] - The object onto which to store the result.
  13104. * @returns The modified result parameter or a new instance of the point on the curve at the given time.
  13105. */
  13106. evaluate(time: number, result?: Quaternion): Quaternion;
  13107. }
  13108. /**
  13109. * A queue that can enqueue items at the end, and dequeue items from the front.
  13110. */
  13111. export class Queue {
  13112. constructor();
  13113. /**
  13114. * The length of the queue.
  13115. */
  13116. readonly length: number;
  13117. /**
  13118. * Enqueues the specified item.
  13119. * @param item - The item to enqueue.
  13120. */
  13121. enqueue(item: any): void;
  13122. /**
  13123. * Dequeues an item. Returns undefined if the queue is empty.
  13124. * @returns The the dequeued item.
  13125. */
  13126. dequeue(): any;
  13127. /**
  13128. * Returns the item at the front of the queue. Returns undefined if the queue is empty.
  13129. * @returns The item at the front of the queue.
  13130. */
  13131. peek(): any;
  13132. /**
  13133. * Check whether this queue contains the specified item.
  13134. * @param item - The item to search for.
  13135. */
  13136. contains(item: any): void;
  13137. /**
  13138. * Remove all items from the queue.
  13139. */
  13140. clear(): void;
  13141. /**
  13142. * Sort the items in the queue in-place.
  13143. * @param compareFunction - A function that defines the sort order.
  13144. */
  13145. sort(compareFunction: Queue.Comparator): void;
  13146. }
  13147. export namespace Queue {
  13148. /**
  13149. * A function used to compare two items while sorting a queue.
  13150. * @example
  13151. * function compareNumbers(a, b) {
  13152. * return a - b;
  13153. * }
  13154. * @param a - An item in the array.
  13155. * @param b - An item in the array.
  13156. */
  13157. type Comparator = (a: any, b: any) => number;
  13158. }
  13159. /**
  13160. * Represents a ray that extends infinitely from the provided origin in the provided direction.
  13161. * @param [origin = Cartesian3.ZERO] - The origin of the ray.
  13162. * @param [direction = Cartesian3.ZERO] - The direction of the ray.
  13163. */
  13164. export class Ray {
  13165. constructor(origin?: Cartesian3, direction?: Cartesian3);
  13166. /**
  13167. * The origin of the ray.
  13168. */
  13169. origin: Cartesian3;
  13170. /**
  13171. * The direction of the ray.
  13172. */
  13173. direction: Cartesian3;
  13174. /**
  13175. * Duplicates a Ray instance.
  13176. * @param ray - The ray to duplicate.
  13177. * @param [result] - The object onto which to store the result.
  13178. * @returns The modified result parameter or a new Ray instance if one was not provided. (Returns undefined if ray is undefined)
  13179. */
  13180. static clone(ray: Ray, result?: Ray): Ray;
  13181. /**
  13182. * Computes the point along the ray given by r(t) = o + t*d,
  13183. * where o is the origin of the ray and d is the direction.
  13184. * @example
  13185. * //Get the first intersection point of a ray and an ellipsoid.
  13186. * var intersection = Cesium.IntersectionTests.rayEllipsoid(ray, ellipsoid);
  13187. * var point = Cesium.Ray.getPoint(ray, intersection.start);
  13188. * @param ray - The ray.
  13189. * @param t - A scalar value.
  13190. * @param [result] - The object in which the result will be stored.
  13191. * @returns The modified result parameter, or a new instance if none was provided.
  13192. */
  13193. static getPoint(ray: Ray, t: number, result?: Cartesian3): Cartesian3;
  13194. }
  13195. /**
  13196. * A two dimensional region specified as longitude and latitude coordinates.
  13197. * @param [west = 0.0] - The westernmost longitude, in radians, in the range [-Pi, Pi].
  13198. * @param [south = 0.0] - The southernmost latitude, in radians, in the range [-Pi/2, Pi/2].
  13199. * @param [east = 0.0] - The easternmost longitude, in radians, in the range [-Pi, Pi].
  13200. * @param [north = 0.0] - The northernmost latitude, in radians, in the range [-Pi/2, Pi/2].
  13201. */
  13202. export class Rectangle {
  13203. constructor(west?: number, south?: number, east?: number, north?: number);
  13204. /**
  13205. * The westernmost longitude in radians in the range [-Pi, Pi].
  13206. */
  13207. west: number;
  13208. /**
  13209. * The southernmost latitude in radians in the range [-Pi/2, Pi/2].
  13210. */
  13211. south: number;
  13212. /**
  13213. * The easternmost longitude in radians in the range [-Pi, Pi].
  13214. */
  13215. east: number;
  13216. /**
  13217. * The northernmost latitude in radians in the range [-Pi/2, Pi/2].
  13218. */
  13219. north: number;
  13220. /**
  13221. * Gets the width of the rectangle in radians.
  13222. */
  13223. readonly width: number;
  13224. /**
  13225. * Gets the height of the rectangle in radians.
  13226. */
  13227. readonly height: number;
  13228. /**
  13229. * The number of elements used to pack the object into an array.
  13230. */
  13231. static packedLength: number;
  13232. /**
  13233. * Stores the provided instance into the provided array.
  13234. * @param value - The value to pack.
  13235. * @param array - The array to pack into.
  13236. * @param [startingIndex = 0] - The index into the array at which to start packing the elements.
  13237. * @returns The array that was packed into
  13238. */
  13239. static pack(value: Rectangle, array: number[], startingIndex?: number): number[];
  13240. /**
  13241. * Retrieves an instance from a packed array.
  13242. * @param array - The packed array.
  13243. * @param [startingIndex = 0] - The starting index of the element to be unpacked.
  13244. * @param [result] - The object into which to store the result.
  13245. * @returns The modified result parameter or a new Rectangle instance if one was not provided.
  13246. */
  13247. static unpack(array: number[], startingIndex?: number, result?: Rectangle): Rectangle;
  13248. /**
  13249. * Computes the width of a rectangle in radians.
  13250. * @param rectangle - The rectangle to compute the width of.
  13251. * @returns The width.
  13252. */
  13253. static computeWidth(rectangle: Rectangle): number;
  13254. /**
  13255. * Computes the height of a rectangle in radians.
  13256. * @param rectangle - The rectangle to compute the height of.
  13257. * @returns The height.
  13258. */
  13259. static computeHeight(rectangle: Rectangle): number;
  13260. /**
  13261. * Creates a rectangle given the boundary longitude and latitude in degrees.
  13262. * @example
  13263. * var rectangle = Cesium.Rectangle.fromDegrees(0.0, 20.0, 10.0, 30.0);
  13264. * @param [west = 0.0] - The westernmost longitude in degrees in the range [-180.0, 180.0].
  13265. * @param [south = 0.0] - The southernmost latitude in degrees in the range [-90.0, 90.0].
  13266. * @param [east = 0.0] - The easternmost longitude in degrees in the range [-180.0, 180.0].
  13267. * @param [north = 0.0] - The northernmost latitude in degrees in the range [-90.0, 90.0].
  13268. * @param [result] - The object onto which to store the result, or undefined if a new instance should be created.
  13269. * @returns The modified result parameter or a new Rectangle instance if none was provided.
  13270. */
  13271. static fromDegrees(west?: number, south?: number, east?: number, north?: number, result?: Rectangle): Rectangle;
  13272. /**
  13273. * Creates a rectangle given the boundary longitude and latitude in radians.
  13274. * @example
  13275. * var rectangle = Cesium.Rectangle.fromRadians(0.0, Math.PI/4, Math.PI/8, 3*Math.PI/4);
  13276. * @param [west = 0.0] - The westernmost longitude in radians in the range [-Math.PI, Math.PI].
  13277. * @param [south = 0.0] - The southernmost latitude in radians in the range [-Math.PI/2, Math.PI/2].
  13278. * @param [east = 0.0] - The easternmost longitude in radians in the range [-Math.PI, Math.PI].
  13279. * @param [north = 0.0] - The northernmost latitude in radians in the range [-Math.PI/2, Math.PI/2].
  13280. * @param [result] - The object onto which to store the result, or undefined if a new instance should be created.
  13281. * @returns The modified result parameter or a new Rectangle instance if none was provided.
  13282. */
  13283. static fromRadians(west?: number, south?: number, east?: number, north?: number, result?: Rectangle): Rectangle;
  13284. /**
  13285. * Creates the smallest possible Rectangle that encloses all positions in the provided array.
  13286. * @param cartographics - The list of Cartographic instances.
  13287. * @param [result] - The object onto which to store the result, or undefined if a new instance should be created.
  13288. * @returns The modified result parameter or a new Rectangle instance if none was provided.
  13289. */
  13290. static fromCartographicArray(cartographics: Cartographic[], result?: Rectangle): Rectangle;
  13291. /**
  13292. * Creates the smallest possible Rectangle that encloses all positions in the provided array.
  13293. * @param cartesians - The list of Cartesian instances.
  13294. * @param [ellipsoid = Ellipsoid.WGS84] - The ellipsoid the cartesians are on.
  13295. * @param [result] - The object onto which to store the result, or undefined if a new instance should be created.
  13296. * @returns The modified result parameter or a new Rectangle instance if none was provided.
  13297. */
  13298. static fromCartesianArray(cartesians: Cartesian3[], ellipsoid?: Ellipsoid, result?: Rectangle): Rectangle;
  13299. /**
  13300. * Duplicates a Rectangle.
  13301. * @param rectangle - The rectangle to clone.
  13302. * @param [result] - The object onto which to store the result, or undefined if a new instance should be created.
  13303. * @returns The modified result parameter or a new Rectangle instance if none was provided. (Returns undefined if rectangle is undefined)
  13304. */
  13305. static clone(rectangle: Rectangle, result?: Rectangle): Rectangle;
  13306. /**
  13307. * Compares the provided Rectangles componentwise and returns
  13308. * <code>true</code> if they pass an absolute or relative tolerance test,
  13309. * <code>false</code> otherwise.
  13310. * @param [left] - The first Rectangle.
  13311. * @param [right] - The second Rectangle.
  13312. * @param [absoluteEpsilon = 0] - The absolute epsilon tolerance to use for equality testing.
  13313. * @returns <code>true</code> if left and right are within the provided epsilon, <code>false</code> otherwise.
  13314. */
  13315. static equalsEpsilon(left?: Rectangle, right?: Rectangle, absoluteEpsilon?: number): boolean;
  13316. /**
  13317. * Duplicates this Rectangle.
  13318. * @param [result] - The object onto which to store the result.
  13319. * @returns The modified result parameter or a new Rectangle instance if none was provided.
  13320. */
  13321. clone(result?: Rectangle): Rectangle;
  13322. /**
  13323. * Compares the provided Rectangle with this Rectangle componentwise and returns
  13324. * <code>true</code> if they are equal, <code>false</code> otherwise.
  13325. * @param [other] - The Rectangle to compare.
  13326. * @returns <code>true</code> if the Rectangles are equal, <code>false</code> otherwise.
  13327. */
  13328. equals(other?: Rectangle): boolean;
  13329. /**
  13330. * Compares the provided rectangles and returns <code>true</code> if they are equal,
  13331. * <code>false</code> otherwise.
  13332. * @param [left] - The first Rectangle.
  13333. * @param [right] - The second Rectangle.
  13334. * @returns <code>true</code> if left and right are equal; otherwise <code>false</code>.
  13335. */
  13336. static equals(left?: Rectangle, right?: Rectangle): boolean;
  13337. /**
  13338. * Compares the provided Rectangle with this Rectangle componentwise and returns
  13339. * <code>true</code> if they are within the provided epsilon,
  13340. * <code>false</code> otherwise.
  13341. * @param [other] - The Rectangle to compare.
  13342. * @param [epsilon = 0] - The epsilon to use for equality testing.
  13343. * @returns <code>true</code> if the Rectangles are within the provided epsilon, <code>false</code> otherwise.
  13344. */
  13345. equalsEpsilon(other?: Rectangle, epsilon?: number): boolean;
  13346. /**
  13347. * Checks a Rectangle's properties and throws if they are not in valid ranges.
  13348. * @param rectangle - The rectangle to validate
  13349. */
  13350. static validate(rectangle: Rectangle): void;
  13351. /**
  13352. * Computes the southwest corner of a rectangle.
  13353. * @param rectangle - The rectangle for which to find the corner
  13354. * @param [result] - The object onto which to store the result.
  13355. * @returns The modified result parameter or a new Cartographic instance if none was provided.
  13356. */
  13357. static southwest(rectangle: Rectangle, result?: Cartographic): Cartographic;
  13358. /**
  13359. * Computes the northwest corner of a rectangle.
  13360. * @param rectangle - The rectangle for which to find the corner
  13361. * @param [result] - The object onto which to store the result.
  13362. * @returns The modified result parameter or a new Cartographic instance if none was provided.
  13363. */
  13364. static northwest(rectangle: Rectangle, result?: Cartographic): Cartographic;
  13365. /**
  13366. * Computes the northeast corner of a rectangle.
  13367. * @param rectangle - The rectangle for which to find the corner
  13368. * @param [result] - The object onto which to store the result.
  13369. * @returns The modified result parameter or a new Cartographic instance if none was provided.
  13370. */
  13371. static northeast(rectangle: Rectangle, result?: Cartographic): Cartographic;
  13372. /**
  13373. * Computes the southeast corner of a rectangle.
  13374. * @param rectangle - The rectangle for which to find the corner
  13375. * @param [result] - The object onto which to store the result.
  13376. * @returns The modified result parameter or a new Cartographic instance if none was provided.
  13377. */
  13378. static southeast(rectangle: Rectangle, result?: Cartographic): Cartographic;
  13379. /**
  13380. * Computes the center of a rectangle.
  13381. * @param rectangle - The rectangle for which to find the center
  13382. * @param [result] - The object onto which to store the result.
  13383. * @returns The modified result parameter or a new Cartographic instance if none was provided.
  13384. */
  13385. static center(rectangle: Rectangle, result?: Cartographic): Cartographic;
  13386. /**
  13387. * Computes the intersection of two rectangles. This function assumes that the rectangle's coordinates are
  13388. * latitude and longitude in radians and produces a correct intersection, taking into account the fact that
  13389. * the same angle can be represented with multiple values as well as the wrapping of longitude at the
  13390. * anti-meridian. For a simple intersection that ignores these factors and can be used with projected
  13391. * coordinates, see {@link Rectangle.simpleIntersection}.
  13392. * @param rectangle - On rectangle to find an intersection
  13393. * @param otherRectangle - Another rectangle to find an intersection
  13394. * @param [result] - The object onto which to store the result.
  13395. * @returns The modified result parameter, a new Rectangle instance if none was provided or undefined if there is no intersection.
  13396. */
  13397. static intersection(rectangle: Rectangle, otherRectangle: Rectangle, result?: Rectangle): Rectangle | undefined;
  13398. /**
  13399. * Computes a simple intersection of two rectangles. Unlike {@link Rectangle.intersection}, this function
  13400. * does not attempt to put the angular coordinates into a consistent range or to account for crossing the
  13401. * anti-meridian. As such, it can be used for rectangles where the coordinates are not simply latitude
  13402. * and longitude (i.e. projected coordinates).
  13403. * @param rectangle - On rectangle to find an intersection
  13404. * @param otherRectangle - Another rectangle to find an intersection
  13405. * @param [result] - The object onto which to store the result.
  13406. * @returns The modified result parameter, a new Rectangle instance if none was provided or undefined if there is no intersection.
  13407. */
  13408. static simpleIntersection(rectangle: Rectangle, otherRectangle: Rectangle, result?: Rectangle): Rectangle | undefined;
  13409. /**
  13410. * Computes a rectangle that is the union of two rectangles.
  13411. * @param rectangle - A rectangle to enclose in rectangle.
  13412. * @param otherRectangle - A rectangle to enclose in a rectangle.
  13413. * @param [result] - The object onto which to store the result.
  13414. * @returns The modified result parameter or a new Rectangle instance if none was provided.
  13415. */
  13416. static union(rectangle: Rectangle, otherRectangle: Rectangle, result?: Rectangle): Rectangle;
  13417. /**
  13418. * Computes a rectangle by enlarging the provided rectangle until it contains the provided cartographic.
  13419. * @param rectangle - A rectangle to expand.
  13420. * @param cartographic - A cartographic to enclose in a rectangle.
  13421. * @param [result] - The object onto which to store the result.
  13422. * @returns The modified result parameter or a new Rectangle instance if one was not provided.
  13423. */
  13424. static expand(rectangle: Rectangle, cartographic: Cartographic, result?: Rectangle): Rectangle;
  13425. /**
  13426. * Returns true if the cartographic is on or inside the rectangle, false otherwise.
  13427. * @param rectangle - The rectangle
  13428. * @param cartographic - The cartographic to test.
  13429. * @returns true if the provided cartographic is inside the rectangle, false otherwise.
  13430. */
  13431. static contains(rectangle: Rectangle, cartographic: Cartographic): boolean;
  13432. /**
  13433. * Samples a rectangle so that it includes a list of Cartesian points suitable for passing to
  13434. * {@link BoundingSphere#fromPoints}. Sampling is necessary to account
  13435. * for rectangles that cover the poles or cross the equator.
  13436. * @param rectangle - The rectangle to subsample.
  13437. * @param [ellipsoid = Ellipsoid.WGS84] - The ellipsoid to use.
  13438. * @param [surfaceHeight = 0.0] - The height of the rectangle above the ellipsoid.
  13439. * @param [result] - The array of Cartesians onto which to store the result.
  13440. * @returns The modified result parameter or a new Array of Cartesians instances if none was provided.
  13441. */
  13442. static subsample(rectangle: Rectangle, ellipsoid?: Ellipsoid, surfaceHeight?: number, result?: Cartesian3[]): Cartesian3[];
  13443. /**
  13444. * The largest possible rectangle.
  13445. */
  13446. static readonly MAX_VALUE: Rectangle;
  13447. }
  13448. /**
  13449. * 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}.
  13450. * @example
  13451. * // 1. create a rectangle
  13452. * var rectangle = new Cesium.RectangleGeometry({
  13453. * ellipsoid : Cesium.Ellipsoid.WGS84,
  13454. * rectangle : Cesium.Rectangle.fromDegrees(-80.0, 39.0, -74.0, 42.0),
  13455. * height : 10000.0
  13456. * });
  13457. * var geometry = Cesium.RectangleGeometry.createGeometry(rectangle);
  13458. *
  13459. * // 2. create an extruded rectangle without a top
  13460. * var rectangle = new Cesium.RectangleGeometry({
  13461. * ellipsoid : Cesium.Ellipsoid.WGS84,
  13462. * rectangle : Cesium.Rectangle.fromDegrees(-80.0, 39.0, -74.0, 42.0),
  13463. * height : 10000.0,
  13464. * extrudedHeight: 300000
  13465. * });
  13466. * var geometry = Cesium.RectangleGeometry.createGeometry(rectangle);
  13467. * @param options - Object with the following properties:
  13468. * @param options.rectangle - A cartographic rectangle with north, south, east and west properties in radians.
  13469. * @param [options.vertexFormat = VertexFormat.DEFAULT] - The vertex attributes to be computed.
  13470. * @param [options.ellipsoid = Ellipsoid.WGS84] - The ellipsoid on which the rectangle lies.
  13471. * @param [options.granularity = Math.RADIANS_PER_DEGREE] - The distance, in radians, between each latitude and longitude. Determines the number of positions in the buffer.
  13472. * @param [options.height = 0.0] - The distance in meters between the rectangle and the ellipsoid surface.
  13473. * @param [options.rotation = 0.0] - The rotation of the rectangle, in radians. A positive rotation is counter-clockwise.
  13474. * @param [options.stRotation = 0.0] - The rotation of the texture coordinates, in radians. A positive rotation is counter-clockwise.
  13475. * @param [options.extrudedHeight] - The distance in meters between the rectangle's extruded face and the ellipsoid surface.
  13476. */
  13477. export class RectangleGeometry {
  13478. constructor(options: {
  13479. rectangle: Rectangle;
  13480. vertexFormat?: VertexFormat;
  13481. ellipsoid?: Ellipsoid;
  13482. granularity?: number;
  13483. height?: number;
  13484. rotation?: number;
  13485. stRotation?: number;
  13486. extrudedHeight?: number;
  13487. });
  13488. /**
  13489. * The number of elements used to pack the object into an array.
  13490. */
  13491. static packedLength: number;
  13492. /**
  13493. * Stores the provided instance into the provided array.
  13494. * @param value - The value to pack.
  13495. * @param array - The array to pack into.
  13496. * @param [startingIndex = 0] - The index into the array at which to start packing the elements.
  13497. * @returns The array that was packed into
  13498. */
  13499. static pack(value: RectangleGeometry, array: number[], startingIndex?: number): number[];
  13500. /**
  13501. * Retrieves an instance from a packed array.
  13502. * @param array - The packed array.
  13503. * @param [startingIndex = 0] - The starting index of the element to be unpacked.
  13504. * @param [result] - The object into which to store the result.
  13505. * @returns The modified result parameter or a new RectangleGeometry instance if one was not provided.
  13506. */
  13507. static unpack(array: number[], startingIndex?: number, result?: RectangleGeometry): RectangleGeometry;
  13508. /**
  13509. * Computes the bounding rectangle based on the provided options
  13510. * @param options - Object with the following properties:
  13511. * @param options.rectangle - A cartographic rectangle with north, south, east and west properties in radians.
  13512. * @param [options.ellipsoid = Ellipsoid.WGS84] - The ellipsoid on which the rectangle lies.
  13513. * @param [options.granularity = Math.RADIANS_PER_DEGREE] - The distance, in radians, between each latitude and longitude. Determines the number of positions in the buffer.
  13514. * @param [options.rotation = 0.0] - The rotation of the rectangle, in radians. A positive rotation is counter-clockwise.
  13515. * @param [result] - An object in which to store the result.
  13516. * @returns The result rectangle
  13517. */
  13518. static computeRectangle(options: {
  13519. rectangle: Rectangle;
  13520. ellipsoid?: Ellipsoid;
  13521. granularity?: number;
  13522. rotation?: number;
  13523. }, result?: Rectangle): Rectangle;
  13524. /**
  13525. * Computes the geometric representation of a rectangle, including its vertices, indices, and a bounding sphere.
  13526. * @param rectangleGeometry - A description of the rectangle.
  13527. * @returns The computed vertices and indices.
  13528. */
  13529. static createGeometry(rectangleGeometry: RectangleGeometry): Geometry | undefined;
  13530. }
  13531. /**
  13532. * A description of the outline of a a cartographic rectangle on an ellipsoid centered at the origin.
  13533. * @example
  13534. * var rectangle = new Cesium.RectangleOutlineGeometry({
  13535. * ellipsoid : Cesium.Ellipsoid.WGS84,
  13536. * rectangle : Cesium.Rectangle.fromDegrees(-80.0, 39.0, -74.0, 42.0),
  13537. * height : 10000.0
  13538. * });
  13539. * var geometry = Cesium.RectangleOutlineGeometry.createGeometry(rectangle);
  13540. * @param options - Object with the following properties:
  13541. * @param options.rectangle - A cartographic rectangle with north, south, east and west properties in radians.
  13542. * @param [options.ellipsoid = Ellipsoid.WGS84] - The ellipsoid on which the rectangle lies.
  13543. * @param [options.granularity = Math.RADIANS_PER_DEGREE] - The distance, in radians, between each latitude and longitude. Determines the number of positions in the buffer.
  13544. * @param [options.height = 0.0] - The distance in meters between the rectangle and the ellipsoid surface.
  13545. * @param [options.rotation = 0.0] - The rotation of the rectangle, in radians. A positive rotation is counter-clockwise.
  13546. * @param [options.extrudedHeight] - The distance in meters between the rectangle's extruded face and the ellipsoid surface.
  13547. */
  13548. export class RectangleOutlineGeometry {
  13549. constructor(options: {
  13550. rectangle: Rectangle;
  13551. ellipsoid?: Ellipsoid;
  13552. granularity?: number;
  13553. height?: number;
  13554. rotation?: number;
  13555. extrudedHeight?: number;
  13556. });
  13557. /**
  13558. * The number of elements used to pack the object into an array.
  13559. */
  13560. static packedLength: number;
  13561. /**
  13562. * Stores the provided instance into the provided array.
  13563. * @param value - The value to pack.
  13564. * @param array - The array to pack into.
  13565. * @param [startingIndex = 0] - The index into the array at which to start packing the elements.
  13566. * @returns The array that was packed into
  13567. */
  13568. static pack(value: RectangleOutlineGeometry, array: number[], startingIndex?: number): number[];
  13569. /**
  13570. * Retrieves an instance from a packed array.
  13571. * @param array - The packed array.
  13572. * @param [startingIndex = 0] - The starting index of the element to be unpacked.
  13573. * @param [result] - The object into which to store the result.
  13574. * @returns The modified result parameter or a new Quaternion instance if one was not provided.
  13575. */
  13576. static unpack(array: number[], startingIndex?: number, result?: RectangleOutlineGeometry): RectangleOutlineGeometry;
  13577. /**
  13578. * Computes the geometric representation of an outline of a rectangle, including its vertices, indices, and a bounding sphere.
  13579. * @param rectangleGeometry - A description of the rectangle outline.
  13580. * @returns The computed vertices and indices.
  13581. */
  13582. static createGeometry(rectangleGeometry: RectangleOutlineGeometry): Geometry | undefined;
  13583. }
  13584. /**
  13585. * Constants for identifying well-known reference frames.
  13586. */
  13587. export enum ReferenceFrame {
  13588. /**
  13589. * The fixed frame.
  13590. */
  13591. FIXED = 0,
  13592. /**
  13593. * The inertial frame.
  13594. */
  13595. INERTIAL = 1
  13596. }
  13597. /**
  13598. * Stores information for making a request. In general this does not need to be constructed directly.
  13599. * @param [options] - An object with the following properties:
  13600. * @param [options.url] - The url to request.
  13601. * @param [options.requestFunction] - The function that makes the actual data request.
  13602. * @param [options.cancelFunction] - The function that is called when the request is cancelled.
  13603. * @param [options.priorityFunction] - The function that is called to update the request's priority, which occurs once per frame.
  13604. * @param [options.priority = 0.0] - The initial priority of the request.
  13605. * @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.
  13606. * @param [options.throttleByServer = false] - Whether to throttle the request by server.
  13607. * @param [options.type = RequestType.OTHER] - The type of request.
  13608. */
  13609. export class Request {
  13610. constructor(options?: {
  13611. url?: string;
  13612. requestFunction?: Request.RequestCallback;
  13613. cancelFunction?: Request.CancelCallback;
  13614. priorityFunction?: Request.PriorityCallback;
  13615. priority?: number;
  13616. throttle?: boolean;
  13617. throttleByServer?: boolean;
  13618. type?: RequestType;
  13619. });
  13620. /**
  13621. * The URL to request.
  13622. */
  13623. url: string;
  13624. /**
  13625. * The function that makes the actual data request.
  13626. */
  13627. requestFunction: Request.RequestCallback;
  13628. /**
  13629. * The function that is called when the request is cancelled.
  13630. */
  13631. cancelFunction: Request.CancelCallback;
  13632. /**
  13633. * The function that is called to update the request's priority, which occurs once per frame.
  13634. */
  13635. priorityFunction: Request.PriorityCallback;
  13636. /**
  13637. * Priority is a unit-less value where lower values represent higher priority.
  13638. * For world-based objects, this is usually the distance from the camera.
  13639. * A request that does not have a priority function defaults to a priority of 0.
  13640. *
  13641. * If priorityFunction is defined, this value is updated every frame with the result of that call.
  13642. */
  13643. priority: number;
  13644. /**
  13645. * Whether to throttle and prioritize the request. If false, the request will be sent immediately. If true, the
  13646. * request will be throttled and sent based on priority.
  13647. */
  13648. readonly throttle: boolean;
  13649. /**
  13650. * Whether to throttle the request by server. Browsers typically support about 6-8 parallel connections
  13651. * for HTTP/1 servers, and an unlimited amount of connections for HTTP/2 servers. Setting this value
  13652. * to <code>true</code> is preferable for requests going through HTTP/1 servers.
  13653. */
  13654. readonly throttleByServer: boolean;
  13655. /**
  13656. * Type of request.
  13657. */
  13658. readonly type: RequestType;
  13659. /**
  13660. * The current state of the request.
  13661. */
  13662. readonly state: RequestState;
  13663. /**
  13664. * Duplicates a Request instance.
  13665. * @param [result] - The object onto which to store the result.
  13666. * @returns The modified result parameter or a new Resource instance if one was not provided.
  13667. */
  13668. clone(result?: Request): Request;
  13669. }
  13670. export namespace Request {
  13671. /**
  13672. * The function that makes the actual data request.
  13673. */
  13674. type RequestCallback = () => Promise<void>;
  13675. /**
  13676. * The function that is called when the request is cancelled.
  13677. */
  13678. type CancelCallback = () => void;
  13679. /**
  13680. * The function that is called to update the request's priority, which occurs once per frame.
  13681. */
  13682. type PriorityCallback = () => number;
  13683. }
  13684. /**
  13685. * An event that is raised when a request encounters an error.
  13686. * @param [statusCode] - The HTTP error status code, such as 404.
  13687. * @param [response] - The response included along with the error.
  13688. * @param [responseHeaders] - The response headers, represented either as an object literal or as a
  13689. * string in the format returned by XMLHttpRequest's getAllResponseHeaders() function.
  13690. */
  13691. export class RequestErrorEvent {
  13692. constructor(statusCode?: number, response?: any, responseHeaders?: string | any);
  13693. /**
  13694. * The HTTP error status code, such as 404. If the error does not have a particular
  13695. * HTTP code, this property will be undefined.
  13696. */
  13697. statusCode: number;
  13698. /**
  13699. * The response included along with the error. If the error does not include a response,
  13700. * this property will be undefined.
  13701. */
  13702. response: any;
  13703. /**
  13704. * The headers included in the response, represented as an object literal of key/value pairs.
  13705. * If the error does not include any headers, this property will be undefined.
  13706. */
  13707. responseHeaders: any;
  13708. /**
  13709. * Creates a string representing this RequestErrorEvent.
  13710. * @returns A string representing the provided RequestErrorEvent.
  13711. */
  13712. toString(): string;
  13713. }
  13714. /**
  13715. * The request scheduler is used to track and constrain the number of active requests in order to prioritize incoming requests. The ability
  13716. * to retain control over the number of requests in CesiumJS is important because due to events such as changes in the camera position,
  13717. * a lot of new requests may be generated and a lot of in-flight requests may become redundant. The request scheduler manually constrains the
  13718. * 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.
  13719. */
  13720. export namespace RequestScheduler {
  13721. /**
  13722. * The maximum number of simultaneous active requests. Un-throttled requests do not observe this limit.
  13723. */
  13724. var maximumRequests: number;
  13725. /**
  13726. * The maximum number of simultaneous active requests per server. Un-throttled requests or servers specifically
  13727. * listed in {@link requestsByServer} do not observe this limit.
  13728. */
  13729. var maximumRequestsPerServer: number;
  13730. /**
  13731. * A per server key list of overrides to use for throttling instead of <code>maximumRequestsPerServer</code>
  13732. * @example
  13733. * RequestScheduler.requestsByServer = {
  13734. * 'api.cesium.com:443': 18,
  13735. * 'assets.cesium.com:443': 18
  13736. * };
  13737. */
  13738. var requestsByServer: any;
  13739. /**
  13740. * Specifies if the request scheduler should throttle incoming requests, or let the browser queue requests under its control.
  13741. */
  13742. var throttleRequests: boolean;
  13743. }
  13744. /**
  13745. * State of the request.
  13746. */
  13747. export enum RequestState {
  13748. /**
  13749. * Initial unissued state.
  13750. */
  13751. UNISSUED = 0,
  13752. /**
  13753. * Issued but not yet active. Will become active when open slots are available.
  13754. */
  13755. ISSUED = 1,
  13756. /**
  13757. * Actual http request has been sent.
  13758. */
  13759. ACTIVE = 2,
  13760. /**
  13761. * Request completed successfully.
  13762. */
  13763. RECEIVED = 3,
  13764. /**
  13765. * Request was cancelled, either explicitly or automatically because of low priority.
  13766. */
  13767. CANCELLED = 4,
  13768. /**
  13769. * Request failed.
  13770. */
  13771. FAILED = 5
  13772. }
  13773. /**
  13774. * An enum identifying the type of request. Used for finer grained logging and priority sorting.
  13775. */
  13776. export enum RequestType {
  13777. /**
  13778. * Terrain request.
  13779. */
  13780. TERRAIN = 0,
  13781. /**
  13782. * Imagery request.
  13783. */
  13784. IMAGERY = 1,
  13785. /**
  13786. * 3D Tiles request.
  13787. */
  13788. TILES3D = 2,
  13789. /**
  13790. * Other request.
  13791. */
  13792. OTHER = 3
  13793. }
  13794. /**
  13795. * 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.
  13796. * @example
  13797. * function refreshTokenRetryCallback(resource, error) {
  13798. * if (error.statusCode === 403) {
  13799. * // 403 status code means a new token should be generated
  13800. * return getNewAccessToken()
  13801. * .then(function(token) {
  13802. * resource.queryParameters.access_token = token;
  13803. * return true;
  13804. * })
  13805. * .otherwise(function() {
  13806. * return false;
  13807. * });
  13808. * }
  13809. *
  13810. * return false;
  13811. * }
  13812. *
  13813. * var resource = new Resource({
  13814. * url: 'http://server.com/path/to/resource.json',
  13815. * proxy: new DefaultProxy('/proxy/'),
  13816. * headers: {
  13817. * 'X-My-Header': 'valueOfHeader'
  13818. * },
  13819. * queryParameters: {
  13820. * 'access_token': '123-435-456-000'
  13821. * },
  13822. * retryCallback: refreshTokenRetryCallback,
  13823. * retryAttempts: 1
  13824. * });
  13825. * @param options - A url or an object with the following properties
  13826. * @param options.url - The url of the resource.
  13827. * @param [options.queryParameters] - An object containing query parameters that will be sent when retrieving the resource.
  13828. * @param [options.templateValues] - Key/Value pairs that are used to replace template values (eg. {x}).
  13829. * @param [options.headers = {}] - Additional HTTP headers that will be sent.
  13830. * @param [options.proxy] - A proxy to be used when loading the resource.
  13831. * @param [options.retryCallback] - The Function to call when a request for this resource fails. If it returns true, the request will be retried.
  13832. * @param [options.retryAttempts = 0] - The number of times the retryCallback should be called before giving up.
  13833. * @param [options.request] - A Request object that will be used. Intended for internal use only.
  13834. */
  13835. export class Resource {
  13836. constructor(options: {
  13837. url: string;
  13838. queryParameters?: any;
  13839. templateValues?: any;
  13840. headers?: any;
  13841. proxy?: Proxy;
  13842. retryCallback?: Resource.RetryCallback;
  13843. retryAttempts?: number;
  13844. request?: Request;
  13845. });
  13846. /**
  13847. * Additional HTTP headers that will be sent with the request.
  13848. */
  13849. headers: any;
  13850. /**
  13851. * A Request object that will be used. Intended for internal use only.
  13852. */
  13853. request: Request;
  13854. /**
  13855. * A proxy to be used when loading the resource.
  13856. */
  13857. proxy: Proxy;
  13858. /**
  13859. * 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.
  13860. */
  13861. retryCallback: (...params: any[]) => any;
  13862. /**
  13863. * The number of times the retryCallback should be called before giving up.
  13864. */
  13865. retryAttempts: number;
  13866. /**
  13867. * Returns true if blobs are supported.
  13868. */
  13869. static readonly isBlobSupported: boolean;
  13870. /**
  13871. * Query parameters appended to the url.
  13872. */
  13873. readonly queryParameters: any;
  13874. /**
  13875. * The key/value pairs used to replace template parameters in the url.
  13876. */
  13877. readonly templateValues: any;
  13878. /**
  13879. * The url to the resource with template values replaced, query string appended and encoded by proxy if one was set.
  13880. */
  13881. url: string;
  13882. /**
  13883. * The file extension of the resource.
  13884. */
  13885. readonly extension: string;
  13886. /**
  13887. * True if the Resource refers to a data URI.
  13888. */
  13889. isDataUri: boolean;
  13890. /**
  13891. * True if the Resource refers to a blob URI.
  13892. */
  13893. isBlobUri: boolean;
  13894. /**
  13895. * True if the Resource refers to a cross origin URL.
  13896. */
  13897. isCrossOriginUrl: boolean;
  13898. /**
  13899. * True if the Resource has request headers. This is equivalent to checking if the headers property has any keys.
  13900. */
  13901. hasHeaders: boolean;
  13902. /**
  13903. * Override Object#toString so that implicit string conversion gives the
  13904. * complete URL represented by this Resource.
  13905. * @returns The URL represented by this Resource
  13906. */
  13907. toString(): string;
  13908. /**
  13909. * Returns the url, optional with the query string and processed by a proxy.
  13910. * @param [query = false] - If true, the query string is included.
  13911. * @param [proxy = false] - If true, the url is processed by the proxy object, if defined.
  13912. * @returns The url with all the requested components.
  13913. */
  13914. getUrlComponent(query?: boolean, proxy?: boolean): string;
  13915. /**
  13916. * Combines the specified object and the existing query parameters. This allows you to add many parameters at once,
  13917. * 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.
  13918. * @param params - The query parameters
  13919. * @param [useAsDefault = false] - If true the params will be used as the default values, so they will only be set if they are undefined.
  13920. */
  13921. setQueryParameters(params: any, useAsDefault?: boolean): void;
  13922. /**
  13923. * Combines the specified object and the existing query parameters. This allows you to add many parameters at once,
  13924. * as opposed to adding them one at a time to the queryParameters property.
  13925. * @param params - The query parameters
  13926. */
  13927. appendQueryParameters(params: any): void;
  13928. /**
  13929. * Combines the specified object and the existing template values. This allows you to add many values at once,
  13930. * 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.
  13931. * @param template - The template values
  13932. * @param [useAsDefault = false] - If true the values will be used as the default values, so they will only be set if they are undefined.
  13933. */
  13934. setTemplateValues(template: any, useAsDefault?: boolean): void;
  13935. /**
  13936. * Returns a resource relative to the current instance. All properties remain the same as the current instance unless overridden in options.
  13937. * @param options - An object with the following properties
  13938. * @param [options.url] - The url that will be resolved relative to the url of the current instance.
  13939. * @param [options.queryParameters] - An object containing query parameters that will be combined with those of the current instance.
  13940. * @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.
  13941. * @param [options.headers = {}] - Additional HTTP headers that will be sent.
  13942. * @param [options.proxy] - A proxy to be used when loading the resource.
  13943. * @param [options.retryCallback] - The function to call when loading the resource fails.
  13944. * @param [options.retryAttempts] - The number of times the retryCallback should be called before giving up.
  13945. * @param [options.request] - A Request object that will be used. Intended for internal use only.
  13946. * @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.
  13947. * @returns The resource derived from the current one.
  13948. */
  13949. getDerivedResource(options: {
  13950. url?: string;
  13951. queryParameters?: any;
  13952. templateValues?: any;
  13953. headers?: any;
  13954. proxy?: Proxy;
  13955. retryCallback?: Resource.RetryCallback;
  13956. retryAttempts?: number;
  13957. request?: Request;
  13958. preserveQueryParameters?: boolean;
  13959. }): Resource;
  13960. /**
  13961. * Duplicates a Resource instance.
  13962. * @param [result] - The object onto which to store the result.
  13963. * @returns The modified result parameter or a new Resource instance if one was not provided.
  13964. */
  13965. clone(result?: Resource): Resource;
  13966. /**
  13967. * Returns the base path of the Resource.
  13968. * @param [includeQuery = false] - Whether or not to include the query string and fragment form the uri
  13969. * @returns The base URI of the resource
  13970. */
  13971. getBaseUri(includeQuery?: boolean): string;
  13972. /**
  13973. * Appends a forward slash to the URL.
  13974. */
  13975. appendForwardSlash(): void;
  13976. /**
  13977. * Asynchronously loads the resource as raw binary data. Returns a promise that will resolve to
  13978. * an ArrayBuffer once loaded, or reject if the resource failed to load. The data is loaded
  13979. * using XMLHttpRequest, which means that in order to make requests to another origin,
  13980. * the server must have Cross-Origin Resource Sharing (CORS) headers enabled.
  13981. * @example
  13982. * // load a single URL asynchronously
  13983. * resource.fetchArrayBuffer().then(function(arrayBuffer) {
  13984. * // use the data
  13985. * }).otherwise(function(error) {
  13986. * // an error occurred
  13987. * });
  13988. * @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.
  13989. */
  13990. fetchArrayBuffer(): Promise<ArrayBuffer> | undefined;
  13991. /**
  13992. * Creates a Resource and calls fetchArrayBuffer() on it.
  13993. * @param options - A url or an object with the following properties
  13994. * @param options.url - The url of the resource.
  13995. * @param [options.queryParameters] - An object containing query parameters that will be sent when retrieving the resource.
  13996. * @param [options.templateValues] - Key/Value pairs that are used to replace template values (eg. {x}).
  13997. * @param [options.headers = {}] - Additional HTTP headers that will be sent.
  13998. * @param [options.proxy] - A proxy to be used when loading the resource.
  13999. * @param [options.retryCallback] - The Function to call when a request for this resource fails. If it returns true, the request will be retried.
  14000. * @param [options.retryAttempts = 0] - The number of times the retryCallback should be called before giving up.
  14001. * @param [options.request] - A Request object that will be used. Intended for internal use only.
  14002. * @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.
  14003. */
  14004. static fetchArrayBuffer(options: {
  14005. url: string;
  14006. queryParameters?: any;
  14007. templateValues?: any;
  14008. headers?: any;
  14009. proxy?: Proxy;
  14010. retryCallback?: Resource.RetryCallback;
  14011. retryAttempts?: number;
  14012. request?: Request;
  14013. }): Promise<ArrayBuffer> | undefined;
  14014. /**
  14015. * Asynchronously loads the given resource as a blob. Returns a promise that will resolve to
  14016. * a Blob once loaded, or reject if the resource failed to load. The data is loaded
  14017. * using XMLHttpRequest, which means that in order to make requests to another origin,
  14018. * the server must have Cross-Origin Resource Sharing (CORS) headers enabled.
  14019. * @example
  14020. * // load a single URL asynchronously
  14021. * resource.fetchBlob().then(function(blob) {
  14022. * // use the data
  14023. * }).otherwise(function(error) {
  14024. * // an error occurred
  14025. * });
  14026. * @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.
  14027. */
  14028. fetchBlob(): Promise<Blob> | undefined;
  14029. /**
  14030. * Creates a Resource and calls fetchBlob() on it.
  14031. * @param options - A url or an object with the following properties
  14032. * @param options.url - The url of the resource.
  14033. * @param [options.queryParameters] - An object containing query parameters that will be sent when retrieving the resource.
  14034. * @param [options.templateValues] - Key/Value pairs that are used to replace template values (eg. {x}).
  14035. * @param [options.headers = {}] - Additional HTTP headers that will be sent.
  14036. * @param [options.proxy] - A proxy to be used when loading the resource.
  14037. * @param [options.retryCallback] - The Function to call when a request for this resource fails. If it returns true, the request will be retried.
  14038. * @param [options.retryAttempts = 0] - The number of times the retryCallback should be called before giving up.
  14039. * @param [options.request] - A Request object that will be used. Intended for internal use only.
  14040. * @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.
  14041. */
  14042. static fetchBlob(options: {
  14043. url: string;
  14044. queryParameters?: any;
  14045. templateValues?: any;
  14046. headers?: any;
  14047. proxy?: Proxy;
  14048. retryCallback?: Resource.RetryCallback;
  14049. retryAttempts?: number;
  14050. request?: Request;
  14051. }): Promise<Blob> | undefined;
  14052. /**
  14053. * Asynchronously loads the given image resource. Returns a promise that will resolve to
  14054. * 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
  14055. * {@link https://developer.mozilla.org/en-US/docs/Web/API/HTMLImageElement|Image} once loaded, or reject if the image failed to load.
  14056. * @example
  14057. * // load a single image asynchronously
  14058. * resource.fetchImage().then(function(image) {
  14059. * // use the loaded image
  14060. * }).otherwise(function(error) {
  14061. * // an error occurred
  14062. * });
  14063. *
  14064. * // load several images in parallel
  14065. * when.all([resource1.fetchImage(), resource2.fetchImage()]).then(function(images) {
  14066. * // images is an array containing all the loaded images
  14067. * });
  14068. * @param [options] - An object with the following properties.
  14069. * @param [options.preferBlob = false] - If true, we will load the image via a blob.
  14070. * @param [options.preferImageBitmap = false] - If true, image will be decoded during fetch and an <code>ImageBitmap</code> is returned.
  14071. * @param [options.flipY = false] - If true, image will be vertically flipped during decode. Only applies if the browser supports <code>createImageBitmap</code>.
  14072. * @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.
  14073. */
  14074. fetchImage(options?: {
  14075. preferBlob?: boolean;
  14076. preferImageBitmap?: boolean;
  14077. flipY?: boolean;
  14078. }): Promise<ImageBitmap> | Promise<HTMLImageElement> | undefined;
  14079. /**
  14080. * Creates a Resource and calls fetchImage() on it.
  14081. * @param options - A url or an object with the following properties
  14082. * @param options.url - The url of the resource.
  14083. * @param [options.queryParameters] - An object containing query parameters that will be sent when retrieving the resource.
  14084. * @param [options.templateValues] - Key/Value pairs that are used to replace template values (eg. {x}).
  14085. * @param [options.headers = {}] - Additional HTTP headers that will be sent.
  14086. * @param [options.proxy] - A proxy to be used when loading the resource.
  14087. * @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>.
  14088. * @param [options.retryCallback] - The Function to call when a request for this resource fails. If it returns true, the request will be retried.
  14089. * @param [options.retryAttempts = 0] - The number of times the retryCallback should be called before giving up.
  14090. * @param [options.request] - A Request object that will be used. Intended for internal use only.
  14091. * @param [options.preferBlob = false] - If true, we will load the image via a blob.
  14092. * @param [options.preferImageBitmap = false] - If true, image will be decoded during fetch and an <code>ImageBitmap</code> is returned.
  14093. * @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.
  14094. */
  14095. static fetchImage(options: {
  14096. url: string;
  14097. queryParameters?: any;
  14098. templateValues?: any;
  14099. headers?: any;
  14100. proxy?: Proxy;
  14101. flipY?: boolean;
  14102. retryCallback?: Resource.RetryCallback;
  14103. retryAttempts?: number;
  14104. request?: Request;
  14105. preferBlob?: boolean;
  14106. preferImageBitmap?: boolean;
  14107. }): Promise<ImageBitmap> | Promise<HTMLImageElement> | undefined;
  14108. /**
  14109. * Asynchronously loads the given resource as text. Returns a promise that will resolve to
  14110. * a String once loaded, or reject if the resource failed to load. The data is loaded
  14111. * using XMLHttpRequest, which means that in order to make requests to another origin,
  14112. * the server must have Cross-Origin Resource Sharing (CORS) headers enabled.
  14113. * @example
  14114. * // load text from a URL, setting a custom header
  14115. * var resource = new Resource({
  14116. * url: 'http://someUrl.com/someJson.txt',
  14117. * headers: {
  14118. * 'X-Custom-Header' : 'some value'
  14119. * }
  14120. * });
  14121. * resource.fetchText().then(function(text) {
  14122. * // Do something with the text
  14123. * }).otherwise(function(error) {
  14124. * // an error occurred
  14125. * });
  14126. * @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.
  14127. */
  14128. fetchText(): Promise<string> | undefined;
  14129. /**
  14130. * Creates a Resource and calls fetchText() on it.
  14131. * @param options - A url or an object with the following properties
  14132. * @param options.url - The url of the resource.
  14133. * @param [options.queryParameters] - An object containing query parameters that will be sent when retrieving the resource.
  14134. * @param [options.templateValues] - Key/Value pairs that are used to replace template values (eg. {x}).
  14135. * @param [options.headers = {}] - Additional HTTP headers that will be sent.
  14136. * @param [options.proxy] - A proxy to be used when loading the resource.
  14137. * @param [options.retryCallback] - The Function to call when a request for this resource fails. If it returns true, the request will be retried.
  14138. * @param [options.retryAttempts = 0] - The number of times the retryCallback should be called before giving up.
  14139. * @param [options.request] - A Request object that will be used. Intended for internal use only.
  14140. * @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.
  14141. */
  14142. static fetchText(options: {
  14143. url: string;
  14144. queryParameters?: any;
  14145. templateValues?: any;
  14146. headers?: any;
  14147. proxy?: Proxy;
  14148. retryCallback?: Resource.RetryCallback;
  14149. retryAttempts?: number;
  14150. request?: Request;
  14151. }): Promise<string> | undefined;
  14152. /**
  14153. * Asynchronously loads the given resource as JSON. Returns a promise that will resolve to
  14154. * a JSON object once loaded, or reject if the resource failed to load. The data is loaded
  14155. * using XMLHttpRequest, which means that in order to make requests to another origin,
  14156. * the server must have Cross-Origin Resource Sharing (CORS) headers enabled. This function
  14157. * adds 'Accept: application/json,&#42;&#47;&#42;;q=0.01' to the request headers, if not
  14158. * already specified.
  14159. * @example
  14160. * resource.fetchJson().then(function(jsonData) {
  14161. * // Do something with the JSON object
  14162. * }).otherwise(function(error) {
  14163. * // an error occurred
  14164. * });
  14165. * @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.
  14166. */
  14167. fetchJson(): Promise<any> | undefined;
  14168. /**
  14169. * Creates a Resource and calls fetchJson() on it.
  14170. * @param options - A url or an object with the following properties
  14171. * @param options.url - The url of the resource.
  14172. * @param [options.queryParameters] - An object containing query parameters that will be sent when retrieving the resource.
  14173. * @param [options.templateValues] - Key/Value pairs that are used to replace template values (eg. {x}).
  14174. * @param [options.headers = {}] - Additional HTTP headers that will be sent.
  14175. * @param [options.proxy] - A proxy to be used when loading the resource.
  14176. * @param [options.retryCallback] - The Function to call when a request for this resource fails. If it returns true, the request will be retried.
  14177. * @param [options.retryAttempts = 0] - The number of times the retryCallback should be called before giving up.
  14178. * @param [options.request] - A Request object that will be used. Intended for internal use only.
  14179. * @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.
  14180. */
  14181. static fetchJson(options: {
  14182. url: string;
  14183. queryParameters?: any;
  14184. templateValues?: any;
  14185. headers?: any;
  14186. proxy?: Proxy;
  14187. retryCallback?: Resource.RetryCallback;
  14188. retryAttempts?: number;
  14189. request?: Request;
  14190. }): Promise<any> | undefined;
  14191. /**
  14192. * Asynchronously loads the given resource as XML. Returns a promise that will resolve to
  14193. * an XML Document once loaded, or reject if the resource failed to load. The data is loaded
  14194. * using XMLHttpRequest, which means that in order to make requests to another origin,
  14195. * the server must have Cross-Origin Resource Sharing (CORS) headers enabled.
  14196. * @example
  14197. * // load XML from a URL, setting a custom header
  14198. * Cesium.loadXML('http://someUrl.com/someXML.xml', {
  14199. * 'X-Custom-Header' : 'some value'
  14200. * }).then(function(document) {
  14201. * // Do something with the document
  14202. * }).otherwise(function(error) {
  14203. * // an error occurred
  14204. * });
  14205. * @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.
  14206. */
  14207. fetchXML(): Promise<XMLDocument> | undefined;
  14208. /**
  14209. * Creates a Resource and calls fetchXML() on it.
  14210. * @param options - A url or an object with the following properties
  14211. * @param options.url - The url of the resource.
  14212. * @param [options.queryParameters] - An object containing query parameters that will be sent when retrieving the resource.
  14213. * @param [options.templateValues] - Key/Value pairs that are used to replace template values (eg. {x}).
  14214. * @param [options.headers = {}] - Additional HTTP headers that will be sent.
  14215. * @param [options.proxy] - A proxy to be used when loading the resource.
  14216. * @param [options.retryCallback] - The Function to call when a request for this resource fails. If it returns true, the request will be retried.
  14217. * @param [options.retryAttempts = 0] - The number of times the retryCallback should be called before giving up.
  14218. * @param [options.request] - A Request object that will be used. Intended for internal use only.
  14219. * @returns a promise that will resolve to the requested data when loaded. Returns undefined if <code>request.throttle</code> is true and the request does not have high enough priority.
  14220. */
  14221. static fetchXML(options: {
  14222. url: string;
  14223. queryParameters?: any;
  14224. templateValues?: any;
  14225. headers?: any;
  14226. proxy?: Proxy;
  14227. retryCallback?: Resource.RetryCallback;
  14228. retryAttempts?: number;
  14229. request?: Request;
  14230. }): Promise<XMLDocument> | undefined;
  14231. /**
  14232. * Requests a resource using JSONP.
  14233. * @example
  14234. * // load a data asynchronously
  14235. * resource.fetchJsonp().then(function(data) {
  14236. * // use the loaded data
  14237. * }).otherwise(function(error) {
  14238. * // an error occurred
  14239. * });
  14240. * @param [callbackParameterName = 'callback'] - The callback parameter name that the server expects.
  14241. * @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.
  14242. */
  14243. fetchJsonp(callbackParameterName?: string): Promise<any> | undefined;
  14244. /**
  14245. * Creates a Resource from a URL and calls fetchJsonp() on it.
  14246. * @param options - A url or an object with the following properties
  14247. * @param options.url - The url of the resource.
  14248. * @param [options.queryParameters] - An object containing query parameters that will be sent when retrieving the resource.
  14249. * @param [options.templateValues] - Key/Value pairs that are used to replace template values (eg. {x}).
  14250. * @param [options.headers = {}] - Additional HTTP headers that will be sent.
  14251. * @param [options.proxy] - A proxy to be used when loading the resource.
  14252. * @param [options.retryCallback] - The Function to call when a request for this resource fails. If it returns true, the request will be retried.
  14253. * @param [options.retryAttempts = 0] - The number of times the retryCallback should be called before giving up.
  14254. * @param [options.request] - A Request object that will be used. Intended for internal use only.
  14255. * @param [options.callbackParameterName = 'callback'] - The callback parameter name that the server expects.
  14256. * @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.
  14257. */
  14258. static fetchJsonp(options: {
  14259. url: string;
  14260. queryParameters?: any;
  14261. templateValues?: any;
  14262. headers?: any;
  14263. proxy?: Proxy;
  14264. retryCallback?: Resource.RetryCallback;
  14265. retryAttempts?: number;
  14266. request?: Request;
  14267. callbackParameterName?: string;
  14268. }): Promise<any> | undefined;
  14269. /**
  14270. * Asynchronously loads the given resource. Returns a promise that will resolve to
  14271. * the result once loaded, or reject if the resource failed to load. The data is loaded
  14272. * using XMLHttpRequest, which means that in order to make requests to another origin,
  14273. * the server must have Cross-Origin Resource Sharing (CORS) headers enabled. It's recommended that you use
  14274. * the more specific functions eg. fetchJson, fetchBlob, etc.
  14275. * @example
  14276. * resource.fetch()
  14277. * .then(function(body) {
  14278. * // use the data
  14279. * }).otherwise(function(error) {
  14280. * // an error occurred
  14281. * });
  14282. * @param [options] - Object with the following properties:
  14283. * @param [options.responseType] - The type of response. This controls the type of item returned.
  14284. * @param [options.headers] - Additional HTTP headers to send with the request, if any.
  14285. * @param [options.overrideMimeType] - Overrides the MIME type returned by the server.
  14286. * @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.
  14287. */
  14288. fetch(options?: {
  14289. responseType?: string;
  14290. headers?: any;
  14291. overrideMimeType?: string;
  14292. }): Promise<any> | undefined;
  14293. /**
  14294. * Creates a Resource from a URL and calls fetch() on it.
  14295. * @param options - A url or an object with the following properties
  14296. * @param options.url - The url of the resource.
  14297. * @param [options.queryParameters] - An object containing query parameters that will be sent when retrieving the resource.
  14298. * @param [options.templateValues] - Key/Value pairs that are used to replace template values (eg. {x}).
  14299. * @param [options.headers = {}] - Additional HTTP headers that will be sent.
  14300. * @param [options.proxy] - A proxy to be used when loading the resource.
  14301. * @param [options.retryCallback] - The Function to call when a request for this resource fails. If it returns true, the request will be retried.
  14302. * @param [options.retryAttempts = 0] - The number of times the retryCallback should be called before giving up.
  14303. * @param [options.request] - A Request object that will be used. Intended for internal use only.
  14304. * @param [options.responseType] - The type of response. This controls the type of item returned.
  14305. * @param [options.overrideMimeType] - Overrides the MIME type returned by the server.
  14306. * @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.
  14307. */
  14308. static fetch(options: {
  14309. url: string;
  14310. queryParameters?: any;
  14311. templateValues?: any;
  14312. headers?: any;
  14313. proxy?: Proxy;
  14314. retryCallback?: Resource.RetryCallback;
  14315. retryAttempts?: number;
  14316. request?: Request;
  14317. responseType?: string;
  14318. overrideMimeType?: string;
  14319. }): Promise<any> | undefined;
  14320. /**
  14321. * Asynchronously deletes the given resource. Returns a promise that will resolve to
  14322. * the result once loaded, or reject if the resource failed to load. The data is loaded
  14323. * using XMLHttpRequest, which means that in order to make requests to another origin,
  14324. * the server must have Cross-Origin Resource Sharing (CORS) headers enabled.
  14325. * @example
  14326. * resource.delete()
  14327. * .then(function(body) {
  14328. * // use the data
  14329. * }).otherwise(function(error) {
  14330. * // an error occurred
  14331. * });
  14332. * @param [options] - Object with the following properties:
  14333. * @param [options.responseType] - The type of response. This controls the type of item returned.
  14334. * @param [options.headers] - Additional HTTP headers to send with the request, if any.
  14335. * @param [options.overrideMimeType] - Overrides the MIME type returned by the server.
  14336. * @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.
  14337. */
  14338. delete(options?: {
  14339. responseType?: string;
  14340. headers?: any;
  14341. overrideMimeType?: string;
  14342. }): Promise<any> | undefined;
  14343. /**
  14344. * Creates a Resource from a URL and calls delete() on it.
  14345. * @param options - A url or an object with the following properties
  14346. * @param options.url - The url of the resource.
  14347. * @param [options.data] - Data that is posted with the resource.
  14348. * @param [options.queryParameters] - An object containing query parameters that will be sent when retrieving the resource.
  14349. * @param [options.templateValues] - Key/Value pairs that are used to replace template values (eg. {x}).
  14350. * @param [options.headers = {}] - Additional HTTP headers that will be sent.
  14351. * @param [options.proxy] - A proxy to be used when loading the resource.
  14352. * @param [options.retryCallback] - The Function to call when a request for this resource fails. If it returns true, the request will be retried.
  14353. * @param [options.retryAttempts = 0] - The number of times the retryCallback should be called before giving up.
  14354. * @param [options.request] - A Request object that will be used. Intended for internal use only.
  14355. * @param [options.responseType] - The type of response. This controls the type of item returned.
  14356. * @param [options.overrideMimeType] - Overrides the MIME type returned by the server.
  14357. * @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.
  14358. */
  14359. static delete(options: {
  14360. url: string;
  14361. data?: any;
  14362. queryParameters?: any;
  14363. templateValues?: any;
  14364. headers?: any;
  14365. proxy?: Proxy;
  14366. retryCallback?: Resource.RetryCallback;
  14367. retryAttempts?: number;
  14368. request?: Request;
  14369. responseType?: string;
  14370. overrideMimeType?: string;
  14371. }): Promise<any> | undefined;
  14372. /**
  14373. * Asynchronously gets headers the given resource. Returns a promise that will resolve to
  14374. * the result once loaded, or reject if the resource failed to load. The data is loaded
  14375. * using XMLHttpRequest, which means that in order to make requests to another origin,
  14376. * the server must have Cross-Origin Resource Sharing (CORS) headers enabled.
  14377. * @example
  14378. * resource.head()
  14379. * .then(function(headers) {
  14380. * // use the data
  14381. * }).otherwise(function(error) {
  14382. * // an error occurred
  14383. * });
  14384. * @param [options] - Object with the following properties:
  14385. * @param [options.responseType] - The type of response. This controls the type of item returned.
  14386. * @param [options.headers] - Additional HTTP headers to send with the request, if any.
  14387. * @param [options.overrideMimeType] - Overrides the MIME type returned by the server.
  14388. * @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.
  14389. */
  14390. head(options?: {
  14391. responseType?: string;
  14392. headers?: any;
  14393. overrideMimeType?: string;
  14394. }): Promise<any> | undefined;
  14395. /**
  14396. * Creates a Resource from a URL and calls head() on it.
  14397. * @param options - A url or an object with the following properties
  14398. * @param options.url - The url of the resource.
  14399. * @param [options.queryParameters] - An object containing query parameters that will be sent when retrieving the resource.
  14400. * @param [options.templateValues] - Key/Value pairs that are used to replace template values (eg. {x}).
  14401. * @param [options.headers = {}] - Additional HTTP headers that will be sent.
  14402. * @param [options.proxy] - A proxy to be used when loading the resource.
  14403. * @param [options.retryCallback] - The Function to call when a request for this resource fails. If it returns true, the request will be retried.
  14404. * @param [options.retryAttempts = 0] - The number of times the retryCallback should be called before giving up.
  14405. * @param [options.request] - A Request object that will be used. Intended for internal use only.
  14406. * @param [options.responseType] - The type of response. This controls the type of item returned.
  14407. * @param [options.overrideMimeType] - Overrides the MIME type returned by the server.
  14408. * @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.
  14409. */
  14410. static head(options: {
  14411. url: string;
  14412. queryParameters?: any;
  14413. templateValues?: any;
  14414. headers?: any;
  14415. proxy?: Proxy;
  14416. retryCallback?: Resource.RetryCallback;
  14417. retryAttempts?: number;
  14418. request?: Request;
  14419. responseType?: string;
  14420. overrideMimeType?: string;
  14421. }): Promise<any> | undefined;
  14422. /**
  14423. * Asynchronously gets options the given resource. Returns a promise that will resolve to
  14424. * the result once loaded, or reject if the resource failed to load. The data is loaded
  14425. * using XMLHttpRequest, which means that in order to make requests to another origin,
  14426. * the server must have Cross-Origin Resource Sharing (CORS) headers enabled.
  14427. * @example
  14428. * resource.options()
  14429. * .then(function(headers) {
  14430. * // use the data
  14431. * }).otherwise(function(error) {
  14432. * // an error occurred
  14433. * });
  14434. * @param [options] - Object with the following properties:
  14435. * @param [options.responseType] - The type of response. This controls the type of item returned.
  14436. * @param [options.headers] - Additional HTTP headers to send with the request, if any.
  14437. * @param [options.overrideMimeType] - Overrides the MIME type returned by the server.
  14438. * @returns a promise that will resolve to the requested data when loaded. Returns undefined if <code>request.throttle</code> is true and the request does not have high enough priority.
  14439. */
  14440. options(options?: {
  14441. responseType?: string;
  14442. headers?: any;
  14443. overrideMimeType?: string;
  14444. }): Promise<any> | undefined;
  14445. /**
  14446. * Creates a Resource from a URL and calls options() on it.
  14447. * @param options - A url or an object with the following properties
  14448. * @param options.url - The url of the resource.
  14449. * @param [options.queryParameters] - An object containing query parameters that will be sent when retrieving the resource.
  14450. * @param [options.templateValues] - Key/Value pairs that are used to replace template values (eg. {x}).
  14451. * @param [options.headers = {}] - Additional HTTP headers that will be sent.
  14452. * @param [options.proxy] - A proxy to be used when loading the resource.
  14453. * @param [options.retryCallback] - The Function to call when a request for this resource fails. If it returns true, the request will be retried.
  14454. * @param [options.retryAttempts = 0] - The number of times the retryCallback should be called before giving up.
  14455. * @param [options.request] - A Request object that will be used. Intended for internal use only.
  14456. * @param [options.responseType] - The type of response. This controls the type of item returned.
  14457. * @param [options.overrideMimeType] - Overrides the MIME type returned by the server.
  14458. * @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.
  14459. */
  14460. static options(options: {
  14461. url: string;
  14462. queryParameters?: any;
  14463. templateValues?: any;
  14464. headers?: any;
  14465. proxy?: Proxy;
  14466. retryCallback?: Resource.RetryCallback;
  14467. retryAttempts?: number;
  14468. request?: Request;
  14469. responseType?: string;
  14470. overrideMimeType?: string;
  14471. }): Promise<any> | undefined;
  14472. /**
  14473. * Asynchronously posts data to the given resource. Returns a promise that will resolve to
  14474. * the result once loaded, or reject if the resource failed to load. The data is loaded
  14475. * using XMLHttpRequest, which means that in order to make requests to another origin,
  14476. * the server must have Cross-Origin Resource Sharing (CORS) headers enabled.
  14477. * @example
  14478. * resource.post(data)
  14479. * .then(function(result) {
  14480. * // use the result
  14481. * }).otherwise(function(error) {
  14482. * // an error occurred
  14483. * });
  14484. * @param data - Data that is posted with the resource.
  14485. * @param [options] - Object with the following properties:
  14486. * @param [options.data] - Data that is posted with the resource.
  14487. * @param [options.responseType] - The type of response. This controls the type of item returned.
  14488. * @param [options.headers] - Additional HTTP headers to send with the request, if any.
  14489. * @param [options.overrideMimeType] - Overrides the MIME type returned by the server.
  14490. * @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.
  14491. */
  14492. post(data: any, options?: {
  14493. data?: any;
  14494. responseType?: string;
  14495. headers?: any;
  14496. overrideMimeType?: string;
  14497. }): Promise<any> | undefined;
  14498. /**
  14499. * Creates a Resource from a URL and calls post() on it.
  14500. * @param options - A url or an object with the following properties
  14501. * @param options.url - The url of the resource.
  14502. * @param options.data - Data that is posted with the resource.
  14503. * @param [options.queryParameters] - An object containing query parameters that will be sent when retrieving the resource.
  14504. * @param [options.templateValues] - Key/Value pairs that are used to replace template values (eg. {x}).
  14505. * @param [options.headers = {}] - Additional HTTP headers that will be sent.
  14506. * @param [options.proxy] - A proxy to be used when loading the resource.
  14507. * @param [options.retryCallback] - The Function to call when a request for this resource fails. If it returns true, the request will be retried.
  14508. * @param [options.retryAttempts = 0] - The number of times the retryCallback should be called before giving up.
  14509. * @param [options.request] - A Request object that will be used. Intended for internal use only.
  14510. * @param [options.responseType] - The type of response. This controls the type of item returned.
  14511. * @param [options.overrideMimeType] - Overrides the MIME type returned by the server.
  14512. * @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.
  14513. */
  14514. static post(options: {
  14515. url: string;
  14516. data: any;
  14517. queryParameters?: any;
  14518. templateValues?: any;
  14519. headers?: any;
  14520. proxy?: Proxy;
  14521. retryCallback?: Resource.RetryCallback;
  14522. retryAttempts?: number;
  14523. request?: Request;
  14524. responseType?: string;
  14525. overrideMimeType?: string;
  14526. }): Promise<any> | undefined;
  14527. /**
  14528. * Asynchronously puts data to the given resource. Returns a promise that will resolve to
  14529. * the result once loaded, or reject if the resource failed to load. The data is loaded
  14530. * using XMLHttpRequest, which means that in order to make requests to another origin,
  14531. * the server must have Cross-Origin Resource Sharing (CORS) headers enabled.
  14532. * @example
  14533. * resource.put(data)
  14534. * .then(function(result) {
  14535. * // use the result
  14536. * }).otherwise(function(error) {
  14537. * // an error occurred
  14538. * });
  14539. * @param data - Data that is posted with the resource.
  14540. * @param [options] - Object with the following properties:
  14541. * @param [options.responseType] - The type of response. This controls the type of item returned.
  14542. * @param [options.headers] - Additional HTTP headers to send with the request, if any.
  14543. * @param [options.overrideMimeType] - Overrides the MIME type returned by the server.
  14544. * @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.
  14545. */
  14546. put(data: any, options?: {
  14547. responseType?: string;
  14548. headers?: any;
  14549. overrideMimeType?: string;
  14550. }): Promise<any> | undefined;
  14551. /**
  14552. * Creates a Resource from a URL and calls put() on it.
  14553. * @param options - A url or an object with the following properties
  14554. * @param options.url - The url of the resource.
  14555. * @param options.data - Data that is posted with the resource.
  14556. * @param [options.queryParameters] - An object containing query parameters that will be sent when retrieving the resource.
  14557. * @param [options.templateValues] - Key/Value pairs that are used to replace template values (eg. {x}).
  14558. * @param [options.headers = {}] - Additional HTTP headers that will be sent.
  14559. * @param [options.proxy] - A proxy to be used when loading the resource.
  14560. * @param [options.retryCallback] - The Function to call when a request for this resource fails. If it returns true, the request will be retried.
  14561. * @param [options.retryAttempts = 0] - The number of times the retryCallback should be called before giving up.
  14562. * @param [options.request] - A Request object that will be used. Intended for internal use only.
  14563. * @param [options.responseType] - The type of response. This controls the type of item returned.
  14564. * @param [options.overrideMimeType] - Overrides the MIME type returned by the server.
  14565. * @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.
  14566. */
  14567. static put(options: {
  14568. url: string;
  14569. data: any;
  14570. queryParameters?: any;
  14571. templateValues?: any;
  14572. headers?: any;
  14573. proxy?: Proxy;
  14574. retryCallback?: Resource.RetryCallback;
  14575. retryAttempts?: number;
  14576. request?: Request;
  14577. responseType?: string;
  14578. overrideMimeType?: string;
  14579. }): Promise<any> | undefined;
  14580. /**
  14581. * Asynchronously patches data to the given resource. Returns a promise that will resolve to
  14582. * the result once loaded, or reject if the resource failed to load. The data is loaded
  14583. * using XMLHttpRequest, which means that in order to make requests to another origin,
  14584. * the server must have Cross-Origin Resource Sharing (CORS) headers enabled.
  14585. * @example
  14586. * resource.patch(data)
  14587. * .then(function(result) {
  14588. * // use the result
  14589. * }).otherwise(function(error) {
  14590. * // an error occurred
  14591. * });
  14592. * @param data - Data that is posted with the resource.
  14593. * @param [options] - Object with the following properties:
  14594. * @param [options.responseType] - The type of response. This controls the type of item returned.
  14595. * @param [options.headers] - Additional HTTP headers to send with the request, if any.
  14596. * @param [options.overrideMimeType] - Overrides the MIME type returned by the server.
  14597. * @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.
  14598. */
  14599. patch(data: any, options?: {
  14600. responseType?: string;
  14601. headers?: any;
  14602. overrideMimeType?: string;
  14603. }): Promise<any> | undefined;
  14604. /**
  14605. * Creates a Resource from a URL and calls patch() on it.
  14606. * @param options - A url or an object with the following properties
  14607. * @param options.url - The url of the resource.
  14608. * @param options.data - Data that is posted with the resource.
  14609. * @param [options.queryParameters] - An object containing query parameters that will be sent when retrieving the resource.
  14610. * @param [options.templateValues] - Key/Value pairs that are used to replace template values (eg. {x}).
  14611. * @param [options.headers = {}] - Additional HTTP headers that will be sent.
  14612. * @param [options.proxy] - A proxy to be used when loading the resource.
  14613. * @param [options.retryCallback] - The Function to call when a request for this resource fails. If it returns true, the request will be retried.
  14614. * @param [options.retryAttempts = 0] - The number of times the retryCallback should be called before giving up.
  14615. * @param [options.request] - A Request object that will be used. Intended for internal use only.
  14616. * @param [options.responseType] - The type of response. This controls the type of item returned.
  14617. * @param [options.overrideMimeType] - Overrides the MIME type returned by the server.
  14618. * @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.
  14619. */
  14620. static patch(options: {
  14621. url: string;
  14622. data: any;
  14623. queryParameters?: any;
  14624. templateValues?: any;
  14625. headers?: any;
  14626. proxy?: Proxy;
  14627. retryCallback?: Resource.RetryCallback;
  14628. retryAttempts?: number;
  14629. request?: Request;
  14630. responseType?: string;
  14631. overrideMimeType?: string;
  14632. }): Promise<any> | undefined;
  14633. /**
  14634. * A resource instance initialized to the current browser location
  14635. */
  14636. static readonly DEFAULT: Resource;
  14637. }
  14638. export namespace Resource {
  14639. /**
  14640. * A function that returns the value of the property.
  14641. * @param [resource] - The resource that failed to load.
  14642. * @param [error] - The error that occurred during the loading of the resource.
  14643. */
  14644. type RetryCallback = (resource?: Resource, error?: Error) => boolean | Promise<boolean>;
  14645. }
  14646. /**
  14647. * Constructs an exception object that is thrown due to an error that can occur at runtime, e.g.,
  14648. * out of memory, could not compile shader, etc. If a function may throw this
  14649. * exception, the calling code should be prepared to catch it.
  14650. * <br /><br />
  14651. * On the other hand, a {@link DeveloperError} indicates an exception due
  14652. * to a developer error, e.g., invalid argument, that usually indicates a bug in the
  14653. * calling code.
  14654. * @param [message] - The error message for this exception.
  14655. */
  14656. export class RuntimeError extends Error {
  14657. constructor(message?: string);
  14658. /**
  14659. * 'RuntimeError' indicating that this exception was thrown due to a runtime error.
  14660. */
  14661. readonly name: string;
  14662. /**
  14663. * The explanation for why this exception was thrown.
  14664. */
  14665. readonly message: string;
  14666. /**
  14667. * The stack trace of this exception, if available.
  14668. */
  14669. readonly stack: string;
  14670. }
  14671. /**
  14672. * Handles user input events. Custom functions can be added to be executed on
  14673. * when the user enters input.
  14674. * @param [element = document] - The element to add events to.
  14675. */
  14676. export class ScreenSpaceEventHandler {
  14677. constructor(element?: HTMLCanvasElement);
  14678. /**
  14679. * Set a function to be executed on an input event.
  14680. * @param action - Function to be executed when the input event occurs.
  14681. * @param type - The ScreenSpaceEventType of input event.
  14682. * @param [modifier] - A KeyboardEventModifier key that is held when a <code>type</code>
  14683. * event occurs.
  14684. */
  14685. setInputAction(action: (...params: any[]) => any, type: number, modifier?: number): void;
  14686. /**
  14687. * Returns the function to be executed on an input event.
  14688. * @param type - The ScreenSpaceEventType of input event.
  14689. * @param [modifier] - A KeyboardEventModifier key that is held when a <code>type</code>
  14690. * event occurs.
  14691. * @returns The function to be executed on an input event.
  14692. */
  14693. getInputAction(type: number, modifier?: number): (...params: any[]) => any;
  14694. /**
  14695. * Removes the function to be executed on an input event.
  14696. * @param type - The ScreenSpaceEventType of input event.
  14697. * @param [modifier] - A KeyboardEventModifier key that is held when a <code>type</code>
  14698. * event occurs.
  14699. */
  14700. removeInputAction(type: number, modifier?: number): void;
  14701. /**
  14702. * Returns true if this object was destroyed; otherwise, false.
  14703. * <br /><br />
  14704. * If this object was destroyed, it should not be used; calling any function other than
  14705. * <code>isDestroyed</code> will result in a {@link DeveloperError} exception.
  14706. * @returns <code>true</code> if this object was destroyed; otherwise, <code>false</code>.
  14707. */
  14708. isDestroyed(): boolean;
  14709. /**
  14710. * Removes listeners held by this object.
  14711. * <br /><br />
  14712. * Once an object is destroyed, it should not be used; calling any function other than
  14713. * <code>isDestroyed</code> will result in a {@link DeveloperError} exception. Therefore,
  14714. * assign the return value (<code>undefined</code>) to the object as done in the example.
  14715. * @example
  14716. * handler = handler && handler.destroy();
  14717. */
  14718. destroy(): void;
  14719. /**
  14720. * The amount of time, in milliseconds, that mouse events will be disabled after
  14721. * receiving any touch events, such that any emulated mouse events will be ignored.
  14722. */
  14723. static mouseEmulationIgnoreMilliseconds: number;
  14724. /**
  14725. * The amount of time, in milliseconds, before a touch on the screen becomes a
  14726. * touch and hold.
  14727. */
  14728. static touchHoldDelayMilliseconds: number;
  14729. }
  14730. /**
  14731. * This enumerated type is for classifying mouse events: down, up, click, double click, move and move while a button is held down.
  14732. */
  14733. export enum ScreenSpaceEventType {
  14734. /**
  14735. * Represents a mouse left button down event.
  14736. */
  14737. LEFT_DOWN = 0,
  14738. /**
  14739. * Represents a mouse left button up event.
  14740. */
  14741. LEFT_UP = 1,
  14742. /**
  14743. * Represents a mouse left click event.
  14744. */
  14745. LEFT_CLICK = 2,
  14746. /**
  14747. * Represents a mouse left double click event.
  14748. */
  14749. LEFT_DOUBLE_CLICK = 3,
  14750. /**
  14751. * Represents a mouse left button down event.
  14752. */
  14753. RIGHT_DOWN = 5,
  14754. /**
  14755. * Represents a mouse right button up event.
  14756. */
  14757. RIGHT_UP = 6,
  14758. /**
  14759. * Represents a mouse right click event.
  14760. */
  14761. RIGHT_CLICK = 7,
  14762. /**
  14763. * Represents a mouse middle button down event.
  14764. */
  14765. MIDDLE_DOWN = 10,
  14766. /**
  14767. * Represents a mouse middle button up event.
  14768. */
  14769. MIDDLE_UP = 11,
  14770. /**
  14771. * Represents a mouse middle click event.
  14772. */
  14773. MIDDLE_CLICK = 12,
  14774. /**
  14775. * Represents a mouse move event.
  14776. */
  14777. MOUSE_MOVE = 15,
  14778. /**
  14779. * Represents a mouse wheel event.
  14780. */
  14781. WHEEL = 16,
  14782. /**
  14783. * Represents the start of a two-finger event on a touch surface.
  14784. */
  14785. PINCH_START = 17,
  14786. /**
  14787. * Represents the end of a two-finger event on a touch surface.
  14788. */
  14789. PINCH_END = 18,
  14790. /**
  14791. * Represents a change of a two-finger event on a touch surface.
  14792. */
  14793. PINCH_MOVE = 19
  14794. }
  14795. /**
  14796. * Value and type information for per-instance geometry attribute that determines if the geometry instance will be shown.
  14797. * @example
  14798. * var instance = new Cesium.GeometryInstance({
  14799. * geometry : new Cesium.BoxGeometry({
  14800. * vertexFormat : Cesium.VertexFormat.POSITION_AND_NORMAL,
  14801. * minimum : new Cesium.Cartesian3(-250000.0, -250000.0, -250000.0),
  14802. * maximum : new Cesium.Cartesian3(250000.0, 250000.0, 250000.0)
  14803. * }),
  14804. * modelMatrix : Cesium.Matrix4.multiplyByTranslation(Cesium.Transforms.eastNorthUpToFixedFrame(
  14805. * Cesium.Cartesian3.fromDegrees(-75.59777, 40.03883)), new Cesium.Cartesian3(0.0, 0.0, 1000000.0), new Cesium.Matrix4()),
  14806. * id : 'box',
  14807. * attributes : {
  14808. * show : new Cesium.ShowGeometryInstanceAttribute(false)
  14809. * }
  14810. * });
  14811. * @param [show = true] - Determines if the geometry instance will be shown.
  14812. */
  14813. export class ShowGeometryInstanceAttribute {
  14814. constructor(show?: boolean);
  14815. /**
  14816. * The values for the attributes stored in a typed array.
  14817. */
  14818. value: Uint8Array;
  14819. /**
  14820. * The datatype of each component in the attribute, e.g., individual elements in
  14821. * {@link ColorGeometryInstanceAttribute#value}.
  14822. */
  14823. readonly componentDatatype: ComponentDatatype;
  14824. /**
  14825. * The number of components in the attributes, i.e., {@link ColorGeometryInstanceAttribute#value}.
  14826. */
  14827. readonly componentsPerAttribute: number;
  14828. /**
  14829. * When <code>true</code> and <code>componentDatatype</code> is an integer format,
  14830. * indicate that the components should be mapped to the range [0, 1] (unsigned)
  14831. * or [-1, 1] (signed) when they are accessed as floating-point for rendering.
  14832. */
  14833. readonly normalize: boolean;
  14834. /**
  14835. * Converts a boolean show to a typed array that can be used to assign a show attribute.
  14836. * @example
  14837. * var attributes = primitive.getGeometryInstanceAttributes('an id');
  14838. * attributes.show = Cesium.ShowGeometryInstanceAttribute.toValue(true, attributes.show);
  14839. * @param show - The show value.
  14840. * @param [result] - The array to store the result in, if undefined a new instance will be created.
  14841. * @returns The modified result parameter or a new instance if result was undefined.
  14842. */
  14843. static toValue(show: boolean, result?: Uint8Array): Uint8Array;
  14844. }
  14845. /**
  14846. * Contains functions for finding the Cartesian coordinates of the sun and the moon in the
  14847. * Earth-centered inertial frame.
  14848. */
  14849. export namespace Simon1994PlanetaryPositions {
  14850. /**
  14851. * Computes the position of the Sun in the Earth-centered inertial frame
  14852. * @param [julianDate] - The time at which to compute the Sun's position, if not provided the current system time is used.
  14853. * @param [result] - The object onto which to store the result.
  14854. * @returns Calculated sun position
  14855. */
  14856. function computeSunPositionInEarthInertialFrame(julianDate?: JulianDate, result?: Cartesian3): Cartesian3;
  14857. /**
  14858. * Computes the position of the Moon in the Earth-centered inertial frame
  14859. * @param [julianDate] - The time at which to compute the Sun's position, if not provided the current system time is used.
  14860. * @param [result] - The object onto which to store the result.
  14861. * @returns Calculated moon position
  14862. */
  14863. function computeMoonPositionInEarthInertialFrame(julianDate?: JulianDate, result?: Cartesian3): Cartesian3;
  14864. }
  14865. /**
  14866. * A description of a polyline modeled as a line strip; the first two positions define a line segment,
  14867. * and each additional position defines a line segment from the previous position.
  14868. * @example
  14869. * // A polyline with two connected line segments
  14870. * var polyline = new Cesium.SimplePolylineGeometry({
  14871. * positions : Cesium.Cartesian3.fromDegreesArray([
  14872. * 0.0, 0.0,
  14873. * 5.0, 0.0,
  14874. * 5.0, 5.0
  14875. * ])
  14876. * });
  14877. * var geometry = Cesium.SimplePolylineGeometry.createGeometry(polyline);
  14878. * @param options - Object with the following properties:
  14879. * @param options.positions - An array of {@link Cartesian3} defining the positions in the polyline as a line strip.
  14880. * @param [options.colors] - An Array of {@link Color} defining the per vertex or per segment colors.
  14881. * @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.
  14882. * @param [options.arcType = ArcType.GEODESIC] - The type of line the polyline segments must follow.
  14883. * @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.
  14884. * @param [options.ellipsoid = Ellipsoid.WGS84] - The ellipsoid to be used as a reference.
  14885. */
  14886. export class SimplePolylineGeometry {
  14887. constructor(options: {
  14888. positions: Cartesian3[];
  14889. colors?: Color[];
  14890. colorsPerVertex?: boolean;
  14891. arcType?: ArcType;
  14892. granularity?: number;
  14893. ellipsoid?: Ellipsoid;
  14894. });
  14895. /**
  14896. * The number of elements used to pack the object into an array.
  14897. */
  14898. packedLength: number;
  14899. /**
  14900. * Stores the provided instance into the provided array.
  14901. * @param value - The value to pack.
  14902. * @param array - The array to pack into.
  14903. * @param [startingIndex = 0] - The index into the array at which to start packing the elements.
  14904. * @returns The array that was packed into
  14905. */
  14906. static pack(value: SimplePolylineGeometry, array: number[], startingIndex?: number): number[];
  14907. /**
  14908. * Retrieves an instance from a packed array.
  14909. * @param array - The packed array.
  14910. * @param [startingIndex = 0] - The starting index of the element to be unpacked.
  14911. * @param [result] - The object into which to store the result.
  14912. * @returns The modified result parameter or a new SimplePolylineGeometry instance if one was not provided.
  14913. */
  14914. static unpack(array: number[], startingIndex?: number, result?: SimplePolylineGeometry): SimplePolylineGeometry;
  14915. /**
  14916. * Computes the geometric representation of a simple polyline, including its vertices, indices, and a bounding sphere.
  14917. * @param simplePolylineGeometry - A description of the polyline.
  14918. * @returns The computed vertices and indices.
  14919. */
  14920. static createGeometry(simplePolylineGeometry: SimplePolylineGeometry): Geometry | undefined;
  14921. }
  14922. /**
  14923. * A description of a sphere centered at the origin.
  14924. * @example
  14925. * var sphere = new Cesium.SphereGeometry({
  14926. * radius : 100.0,
  14927. * vertexFormat : Cesium.VertexFormat.POSITION_ONLY
  14928. * });
  14929. * var geometry = Cesium.SphereGeometry.createGeometry(sphere);
  14930. * @param [options] - Object with the following properties:
  14931. * @param [options.radius = 1.0] - The radius of the sphere.
  14932. * @param [options.stackPartitions = 64] - The number of times to partition the ellipsoid into stacks.
  14933. * @param [options.slicePartitions = 64] - The number of times to partition the ellipsoid into radial slices.
  14934. * @param [options.vertexFormat = VertexFormat.DEFAULT] - The vertex attributes to be computed.
  14935. */
  14936. export class SphereGeometry {
  14937. constructor(options?: {
  14938. radius?: number;
  14939. stackPartitions?: number;
  14940. slicePartitions?: number;
  14941. vertexFormat?: VertexFormat;
  14942. });
  14943. /**
  14944. * The number of elements used to pack the object into an array.
  14945. */
  14946. static packedLength: number;
  14947. /**
  14948. * Stores the provided instance into the provided array.
  14949. * @param value - The value to pack.
  14950. * @param array - The array to pack into.
  14951. * @param [startingIndex = 0] - The index into the array at which to start packing the elements.
  14952. * @returns The array that was packed into
  14953. */
  14954. static pack(value: SphereGeometry, array: number[], startingIndex?: number): number[];
  14955. /**
  14956. * Retrieves an instance from a packed array.
  14957. * @param array - The packed array.
  14958. * @param [startingIndex = 0] - The starting index of the element to be unpacked.
  14959. * @param [result] - The object into which to store the result.
  14960. * @returns The modified result parameter or a new SphereGeometry instance if one was not provided.
  14961. */
  14962. static unpack(array: number[], startingIndex?: number, result?: SphereGeometry): SphereGeometry;
  14963. /**
  14964. * Computes the geometric representation of a sphere, including its vertices, indices, and a bounding sphere.
  14965. * @param sphereGeometry - A description of the sphere.
  14966. * @returns The computed vertices and indices.
  14967. */
  14968. static createGeometry(sphereGeometry: SphereGeometry): Geometry | undefined;
  14969. }
  14970. /**
  14971. * A description of the outline of a sphere.
  14972. * @example
  14973. * var sphere = new Cesium.SphereOutlineGeometry({
  14974. * radius : 100.0,
  14975. * stackPartitions : 6,
  14976. * slicePartitions: 5
  14977. * });
  14978. * var geometry = Cesium.SphereOutlineGeometry.createGeometry(sphere);
  14979. * @param [options] - Object with the following properties:
  14980. * @param [options.radius = 1.0] - The radius of the sphere.
  14981. * @param [options.stackPartitions = 10] - The count of stacks for the sphere (1 greater than the number of parallel lines).
  14982. * @param [options.slicePartitions = 8] - The count of slices for the sphere (Equal to the number of radial lines).
  14983. * @param [options.subdivisions = 200] - The number of points per line, determining the granularity of the curvature .
  14984. */
  14985. export class SphereOutlineGeometry {
  14986. constructor(options?: {
  14987. radius?: number;
  14988. stackPartitions?: number;
  14989. slicePartitions?: number;
  14990. subdivisions?: number;
  14991. });
  14992. /**
  14993. * The number of elements used to pack the object into an array.
  14994. */
  14995. static packedLength: number;
  14996. /**
  14997. * Stores the provided instance into the provided array.
  14998. * @param value - The value to pack.
  14999. * @param array - The array to pack into.
  15000. * @param [startingIndex = 0] - The index into the array at which to start packing the elements.
  15001. * @returns The array that was packed into
  15002. */
  15003. static pack(value: SphereOutlineGeometry, array: number[], startingIndex?: number): number[];
  15004. /**
  15005. * Retrieves an instance from a packed array.
  15006. * @param array - The packed array.
  15007. * @param [startingIndex = 0] - The starting index of the element to be unpacked.
  15008. * @param [result] - The object into which to store the result.
  15009. * @returns The modified result parameter or a new SphereOutlineGeometry instance if one was not provided.
  15010. */
  15011. static unpack(array: number[], startingIndex?: number, result?: SphereOutlineGeometry): SphereOutlineGeometry;
  15012. /**
  15013. * Computes the geometric representation of an outline of a sphere, including its vertices, indices, and a bounding sphere.
  15014. * @param sphereGeometry - A description of the sphere outline.
  15015. * @returns The computed vertices and indices.
  15016. */
  15017. static createGeometry(sphereGeometry: SphereOutlineGeometry): Geometry | undefined;
  15018. }
  15019. /**
  15020. * A set of curvilinear 3-dimensional coordinates.
  15021. * @param [clock = 0.0] - The angular coordinate lying in the xy-plane measured from the positive x-axis and toward the positive y-axis.
  15022. * @param [cone = 0.0] - The angular coordinate measured from the positive z-axis and toward the negative z-axis.
  15023. * @param [magnitude = 1.0] - The linear coordinate measured from the origin.
  15024. */
  15025. export class Spherical {
  15026. constructor(clock?: number, cone?: number, magnitude?: number);
  15027. /**
  15028. * The clock component.
  15029. */
  15030. clock: number;
  15031. /**
  15032. * The cone component.
  15033. */
  15034. cone: number;
  15035. /**
  15036. * The magnitude component.
  15037. */
  15038. magnitude: number;
  15039. /**
  15040. * Converts the provided Cartesian3 into Spherical coordinates.
  15041. * @param cartesian3 - The Cartesian3 to be converted to Spherical.
  15042. * @param [result] - The object in which the result will be stored, if undefined a new instance will be created.
  15043. * @returns The modified result parameter, or a new instance if one was not provided.
  15044. */
  15045. static fromCartesian3(cartesian3: Cartesian3, result?: Spherical): Spherical;
  15046. /**
  15047. * Creates a duplicate of a Spherical.
  15048. * @param spherical - The spherical to clone.
  15049. * @param [result] - The object to store the result into, if undefined a new instance will be created.
  15050. * @returns The modified result parameter or a new instance if result was undefined. (Returns undefined if spherical is undefined)
  15051. */
  15052. static clone(spherical: Spherical, result?: Spherical): Spherical;
  15053. /**
  15054. * Computes the normalized version of the provided spherical.
  15055. * @param spherical - The spherical to be normalized.
  15056. * @param [result] - The object to store the result into, if undefined a new instance will be created.
  15057. * @returns The modified result parameter or a new instance if result was undefined.
  15058. */
  15059. static normalize(spherical: Spherical, result?: Spherical): Spherical;
  15060. /**
  15061. * Returns true if the first spherical is equal to the second spherical, false otherwise.
  15062. * @param left - The first Spherical to be compared.
  15063. * @param right - The second Spherical to be compared.
  15064. * @returns true if the first spherical is equal to the second spherical, false otherwise.
  15065. */
  15066. static equals(left: Spherical, right: Spherical): boolean;
  15067. /**
  15068. * Returns true if the first spherical is within the provided epsilon of the second spherical, false otherwise.
  15069. * @param left - The first Spherical to be compared.
  15070. * @param right - The second Spherical to be compared.
  15071. * @param [epsilon = 0.0] - The epsilon to compare against.
  15072. * @returns true if the first spherical is within the provided epsilon of the second spherical, false otherwise.
  15073. */
  15074. static equalsEpsilon(left: Spherical, right: Spherical, epsilon?: number): boolean;
  15075. /**
  15076. * Returns true if this spherical is equal to the provided spherical, false otherwise.
  15077. * @param other - The Spherical to be compared.
  15078. * @returns true if this spherical is equal to the provided spherical, false otherwise.
  15079. */
  15080. equals(other: Spherical): boolean;
  15081. /**
  15082. * Creates a duplicate of this Spherical.
  15083. * @param [result] - The object to store the result into, if undefined a new instance will be created.
  15084. * @returns The modified result parameter or a new instance if result was undefined.
  15085. */
  15086. clone(result?: Spherical): Spherical;
  15087. /**
  15088. * Returns true if this spherical is within the provided epsilon of the provided spherical, false otherwise.
  15089. * @param other - The Spherical to be compared.
  15090. * @param epsilon - The epsilon to compare against.
  15091. * @returns true if this spherical is within the provided epsilon of the provided spherical, false otherwise.
  15092. */
  15093. equalsEpsilon(other: Spherical, epsilon: number): boolean;
  15094. /**
  15095. * Returns a string representing this instance in the format (clock, cone, magnitude).
  15096. * @returns A string representing this instance.
  15097. */
  15098. toString(): string;
  15099. }
  15100. /**
  15101. * Creates a curve parameterized and evaluated by time. This type describes an interface
  15102. * and is not intended to be instantiated directly.
  15103. */
  15104. export class Spline {
  15105. constructor();
  15106. /**
  15107. * An array of times for the control points.
  15108. */
  15109. times: number[];
  15110. /**
  15111. * An array of control points.
  15112. */
  15113. points: Cartesian3[] | Quaternion[];
  15114. /**
  15115. * Evaluates the curve at a given time.
  15116. * @param time - The time at which to evaluate the curve.
  15117. * @param [result] - The object onto which to store the result.
  15118. * @returns The modified result parameter or a new instance of the point on the curve at the given time.
  15119. */
  15120. evaluate(time: number, result?: Cartesian3 | Quaternion | number[]): Cartesian3 | Quaternion | number[];
  15121. /**
  15122. * Finds an index <code>i</code> in <code>times</code> such that the parameter
  15123. * <code>time</code> is in the interval <code>[times[i], times[i + 1]]</code>.
  15124. * @param time - The time.
  15125. * @param startIndex - The index from which to start the search.
  15126. * @returns The index for the element at the start of the interval.
  15127. */
  15128. findTimeInterval(time: number, startIndex: number): number;
  15129. /**
  15130. * Wraps the given time to the period covered by the spline.
  15131. * @param time - The time.
  15132. * @returns The time, wrapped around the animation period.
  15133. */
  15134. wrapTime(time: number): number;
  15135. /**
  15136. * Clamps the given time to the period covered by the spline.
  15137. * @param time - The time.
  15138. * @returns The time, clamped to the animation period.
  15139. */
  15140. clampTime(time: number): number;
  15141. }
  15142. /**
  15143. * A wrapper around a web worker that allows scheduling tasks for a given worker,
  15144. * returning results asynchronously via a promise.
  15145. *
  15146. * The Worker is not constructed until a task is scheduled.
  15147. * @param workerName - The name of the worker. This is expected to be a script
  15148. * in the Workers folder.
  15149. * @param [maximumActiveTasks = 5] - The maximum number of active tasks. Once exceeded,
  15150. * scheduleTask will not queue any more tasks, allowing
  15151. * work to be rescheduled in future frames.
  15152. */
  15153. export class TaskProcessor {
  15154. constructor(workerName: string, maximumActiveTasks?: number);
  15155. /**
  15156. * Schedule a task to be processed by the web worker asynchronously. If there are currently more
  15157. * tasks active than the maximum set by the constructor, will immediately return undefined.
  15158. * Otherwise, returns a promise that will resolve to the result posted back by the worker when
  15159. * finished.
  15160. * @example
  15161. * var taskProcessor = new Cesium.TaskProcessor('myWorkerName');
  15162. * var promise = taskProcessor.scheduleTask({
  15163. * someParameter : true,
  15164. * another : 'hello'
  15165. * });
  15166. * if (!Cesium.defined(promise)) {
  15167. * // too many active tasks - try again later
  15168. * } else {
  15169. * Cesium.when(promise, function(result) {
  15170. * // use the result of the task
  15171. * });
  15172. * }
  15173. * @param parameters - Any input data that will be posted to the worker.
  15174. * @param [transferableObjects] - An array of objects contained in parameters that should be
  15175. * transferred to the worker instead of copied.
  15176. * @returns Either a promise that will resolve to the result when available, or undefined
  15177. * if there are too many active tasks,
  15178. */
  15179. scheduleTask(parameters: any, transferableObjects?: object[]): Promise<object> | undefined;
  15180. /**
  15181. * Posts a message to a web worker with configuration to initialize loading
  15182. * and compiling a web assembly module asychronously, as well as an optional
  15183. * fallback JavaScript module to use if Web Assembly is not supported.
  15184. * @param [webAssemblyOptions] - An object with the following properties:
  15185. * @param [webAssemblyOptions.modulePath] - The path of the web assembly JavaScript wrapper module.
  15186. * @param [webAssemblyOptions.wasmBinaryFile] - The path of the web assembly binary file.
  15187. * @param [webAssemblyOptions.fallbackModulePath] - The path of the fallback JavaScript module to use if web assembly is not supported.
  15188. * @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.
  15189. */
  15190. initWebAssemblyModule(webAssemblyOptions?: {
  15191. modulePath?: string;
  15192. wasmBinaryFile?: string;
  15193. fallbackModulePath?: string;
  15194. }): Promise<object>;
  15195. /**
  15196. * Returns true if this object was destroyed; otherwise, false.
  15197. * <br /><br />
  15198. * If this object was destroyed, it should not be used; calling any function other than
  15199. * <code>isDestroyed</code> will result in a {@link DeveloperError} exception.
  15200. * @returns True if this object was destroyed; otherwise, false.
  15201. */
  15202. isDestroyed(): boolean;
  15203. /**
  15204. * Destroys this object. This will immediately terminate the Worker.
  15205. * <br /><br />
  15206. * Once an object is destroyed, it should not be used; calling any function other than
  15207. * <code>isDestroyed</code> will result in a {@link DeveloperError} exception.
  15208. */
  15209. destroy(): void;
  15210. }
  15211. /**
  15212. * Terrain data for a single tile. This type describes an
  15213. * interface and is not intended to be instantiated directly.
  15214. */
  15215. export class TerrainData {
  15216. constructor();
  15217. /**
  15218. * An array of credits for this tile.
  15219. */
  15220. credits: Credit[];
  15221. /**
  15222. * The water mask included in this terrain data, if any. A water mask is a rectangular
  15223. * Uint8Array or image where a value of 255 indicates water and a value of 0 indicates land.
  15224. * Values in between 0 and 255 are allowed as well to smoothly blend between land and water.
  15225. */
  15226. waterMask: Uint8Array | HTMLImageElement | HTMLCanvasElement;
  15227. /**
  15228. * Computes the terrain height at a specified longitude and latitude.
  15229. * @param rectangle - The rectangle covered by this terrain data.
  15230. * @param longitude - The longitude in radians.
  15231. * @param latitude - The latitude in radians.
  15232. * @returns The terrain height at the specified position. If the position
  15233. * is outside the rectangle, this method will extrapolate the height, which is likely to be wildly
  15234. * incorrect for positions far outside the rectangle.
  15235. */
  15236. interpolateHeight(rectangle: Rectangle, longitude: number, latitude: number): number;
  15237. /**
  15238. * Determines if a given child tile is available, based on the
  15239. * {@link TerrainData#childTileMask}. The given child tile coordinates are assumed
  15240. * to be one of the four children of this tile. If non-child tile coordinates are
  15241. * given, the availability of the southeast child tile is returned.
  15242. * @param thisX - The tile X coordinate of this (the parent) tile.
  15243. * @param thisY - The tile Y coordinate of this (the parent) tile.
  15244. * @param childX - The tile X coordinate of the child tile to check for availability.
  15245. * @param childY - The tile Y coordinate of the child tile to check for availability.
  15246. * @returns True if the child tile is available; otherwise, false.
  15247. */
  15248. isChildAvailable(thisX: number, thisY: number, childX: number, childY: number): boolean;
  15249. /**
  15250. * Upsamples this terrain data for use by a descendant tile.
  15251. * @param tilingScheme - The tiling scheme of this terrain data.
  15252. * @param thisX - The X coordinate of this tile in the tiling scheme.
  15253. * @param thisY - The Y coordinate of this tile in the tiling scheme.
  15254. * @param thisLevel - The level of this tile in the tiling scheme.
  15255. * @param descendantX - The X coordinate within the tiling scheme of the descendant tile for which we are upsampling.
  15256. * @param descendantY - The Y coordinate within the tiling scheme of the descendant tile for which we are upsampling.
  15257. * @param descendantLevel - The level within the tiling scheme of the descendant tile for which we are upsampling.
  15258. * @returns A promise for upsampled terrain data for the descendant tile,
  15259. * or undefined if too many asynchronous upsample operations are in progress and the request has been
  15260. * deferred.
  15261. */
  15262. upsample(tilingScheme: TilingScheme, thisX: number, thisY: number, thisLevel: number, descendantX: number, descendantY: number, descendantLevel: number): Promise<TerrainData> | undefined;
  15263. /**
  15264. * Gets a value indicating whether or not this terrain data was created by upsampling lower resolution
  15265. * terrain data. If this value is false, the data was obtained from some other source, such
  15266. * as by downloading it from a remote server. This method should return true for instances
  15267. * returned from a call to {@link TerrainData#upsample}.
  15268. * @returns True if this instance was created by upsampling; otherwise, false.
  15269. */
  15270. wasCreatedByUpsampling(): boolean;
  15271. }
  15272. /**
  15273. * Provides terrain or other geometry for the surface of an ellipsoid. The surface geometry is
  15274. * organized into a pyramid of tiles according to a {@link TilingScheme}. This type describes an
  15275. * interface and is not intended to be instantiated directly.
  15276. */
  15277. export class TerrainProvider {
  15278. constructor();
  15279. /**
  15280. * Gets an event that is raised when the terrain provider encounters an asynchronous error.. By subscribing
  15281. * to the event, you will be notified of the error and can potentially recover from it. Event listeners
  15282. * are passed an instance of {@link TileProviderError}.
  15283. */
  15284. errorEvent: Event;
  15285. /**
  15286. * Gets the credit to display when this terrain provider is active. Typically this is used to credit
  15287. * the source of the terrain. This function should
  15288. * not be called before {@link TerrainProvider#ready} returns true.
  15289. */
  15290. credit: Credit;
  15291. /**
  15292. * Gets the tiling scheme used by the provider. This function should
  15293. * not be called before {@link TerrainProvider#ready} returns true.
  15294. */
  15295. tilingScheme: TilingScheme;
  15296. /**
  15297. * Gets a value indicating whether or not the provider is ready for use.
  15298. */
  15299. ready: boolean;
  15300. /**
  15301. * Gets a promise that resolves to true when the provider is ready for use.
  15302. */
  15303. readonly readyPromise: Promise<boolean>;
  15304. /**
  15305. * Gets a value indicating whether or not the provider includes a water mask. The water mask
  15306. * indicates which areas of the globe are water rather than land, so they can be rendered
  15307. * as a reflective surface with animated waves. This function should not be
  15308. * called before {@link TerrainProvider#ready} returns true.
  15309. */
  15310. hasWaterMask: boolean;
  15311. /**
  15312. * Gets a value indicating whether or not the requested tiles include vertex normals.
  15313. * This function should not be called before {@link TerrainProvider#ready} returns true.
  15314. */
  15315. hasVertexNormals: boolean;
  15316. /**
  15317. * Gets an object that can be used to determine availability of terrain from this provider, such as
  15318. * at points and in rectangles. This function should not be called before
  15319. * {@link TerrainProvider#ready} returns true. This property may be undefined if availability
  15320. * information is not available.
  15321. */
  15322. availability: TileAvailability;
  15323. /**
  15324. * Gets a list of indices for a triangle mesh representing a regular grid. Calling
  15325. * this function multiple times with the same grid width and height returns the
  15326. * same list of indices. The total number of vertices must be less than or equal
  15327. * to 65536.
  15328. * @param width - The number of vertices in the regular grid in the horizontal direction.
  15329. * @param height - The number of vertices in the regular grid in the vertical direction.
  15330. * @returns The list of indices. Uint16Array gets returned for 64KB or less and Uint32Array for 4GB or less.
  15331. */
  15332. static getRegularGridIndices(width: number, height: number): Uint16Array | Uint32Array;
  15333. /**
  15334. * Specifies the quality of terrain created from heightmaps. A value of 1.0 will
  15335. * ensure that adjacent heightmap vertices are separated by no more than
  15336. * {@link Globe.maximumScreenSpaceError} screen pixels and will probably go very slowly.
  15337. * A value of 0.5 will cut the estimated level zero geometric error in half, allowing twice the
  15338. * screen pixels between adjacent heightmap vertices and thus rendering more quickly.
  15339. */
  15340. static heightmapTerrainQuality: number;
  15341. /**
  15342. * Determines an appropriate geometric error estimate when the geometry comes from a heightmap.
  15343. * @param ellipsoid - The ellipsoid to which the terrain is attached.
  15344. * @param tileImageWidth - The width, in pixels, of the heightmap associated with a single tile.
  15345. * @param numberOfTilesAtLevelZero - The number of tiles in the horizontal direction at tile level zero.
  15346. * @returns An estimated geometric error.
  15347. */
  15348. static getEstimatedLevelZeroGeometricErrorForAHeightmap(ellipsoid: Ellipsoid, tileImageWidth: number, numberOfTilesAtLevelZero: number): number;
  15349. /**
  15350. * Requests the geometry for a given tile. This function should not be called before
  15351. * {@link TerrainProvider#ready} returns true. The result must include terrain data and
  15352. * may optionally include a water mask and an indication of which child tiles are available.
  15353. * @param x - The X coordinate of the tile for which to request geometry.
  15354. * @param y - The Y coordinate of the tile for which to request geometry.
  15355. * @param level - The level of the tile for which to request geometry.
  15356. * @param [request] - The request object. Intended for internal use only.
  15357. * @returns A promise for the requested geometry. If this method
  15358. * returns undefined instead of a promise, it is an indication that too many requests are already
  15359. * pending and the request will be retried later.
  15360. */
  15361. requestTileGeometry(x: number, y: number, level: number, request?: Request): Promise<TerrainData> | undefined;
  15362. /**
  15363. * Gets the maximum geometric error allowed in a tile at a given level. This function should not be
  15364. * called before {@link TerrainProvider#ready} returns true.
  15365. * @param level - The tile level for which to get the maximum geometric error.
  15366. * @returns The maximum geometric error.
  15367. */
  15368. getLevelMaximumGeometricError(level: number): number;
  15369. /**
  15370. * Determines whether data for a tile is available to be loaded.
  15371. * @param x - The X coordinate of the tile for which to request geometry.
  15372. * @param y - The Y coordinate of the tile for which to request geometry.
  15373. * @param level - The level of the tile for which to request geometry.
  15374. * @returns Undefined if not supported by the terrain provider, otherwise true or false.
  15375. */
  15376. getTileDataAvailable(x: number, y: number, level: number): boolean;
  15377. /**
  15378. * Makes sure we load availability data for a tile
  15379. * @param x - The X coordinate of the tile for which to request geometry.
  15380. * @param y - The Y coordinate of the tile for which to request geometry.
  15381. * @param level - The level of the tile for which to request geometry.
  15382. * @returns Undefined if nothing need to be loaded or a Promise that resolves when all required tiles are loaded
  15383. */
  15384. loadTileDataAvailability(x: number, y: number, level: number): undefined | Promise<void>;
  15385. }
  15386. /**
  15387. * Reports the availability of tiles in a {@link TilingScheme}.
  15388. * @param tilingScheme - The tiling scheme in which to report availability.
  15389. * @param maximumLevel - The maximum tile level that is potentially available.
  15390. */
  15391. export class TileAvailability {
  15392. constructor(tilingScheme: TilingScheme, maximumLevel: number);
  15393. /**
  15394. * Marks a rectangular range of tiles in a particular level as being available. For best performance,
  15395. * add your ranges in order of increasing level.
  15396. * @param level - The level.
  15397. * @param startX - The X coordinate of the first available tiles at the level.
  15398. * @param startY - The Y coordinate of the first available tiles at the level.
  15399. * @param endX - The X coordinate of the last available tiles at the level.
  15400. * @param endY - The Y coordinate of the last available tiles at the level.
  15401. */
  15402. addAvailableTileRange(level: number, startX: number, startY: number, endX: number, endY: number): void;
  15403. /**
  15404. * Determines the level of the most detailed tile covering the position. This function
  15405. * usually completes in time logarithmic to the number of rectangles added with
  15406. * {@link TileAvailability#addAvailableTileRange}.
  15407. * @param position - The position for which to determine the maximum available level. The height component is ignored.
  15408. * @returns The level of the most detailed tile covering the position.
  15409. */
  15410. computeMaximumLevelAtPosition(position: Cartographic): number;
  15411. /**
  15412. * Finds the most detailed level that is available _everywhere_ within a given rectangle. More detailed
  15413. * tiles may be available in parts of the rectangle, but not the whole thing. The return value of this
  15414. * function may be safely passed to {@link sampleTerrain} for any position within the rectangle. This function
  15415. * usually completes in time logarithmic to the number of rectangles added with
  15416. * {@link TileAvailability#addAvailableTileRange}.
  15417. * @param rectangle - The rectangle.
  15418. * @returns The best available level for the entire rectangle.
  15419. */
  15420. computeBestAvailableLevelOverRectangle(rectangle: Rectangle): number;
  15421. /**
  15422. * Determines if a particular tile is available.
  15423. * @param level - The tile level to check.
  15424. * @param x - The X coordinate of the tile to check.
  15425. * @param y - The Y coordinate of the tile to check.
  15426. * @returns True if the tile is available; otherwise, false.
  15427. */
  15428. isTileAvailable(level: number, x: number, y: number): boolean;
  15429. /**
  15430. * Computes a bit mask indicating which of a tile's four children exist.
  15431. * If a child's bit is set, a tile is available for that child. If it is cleared,
  15432. * the tile is not available. The bit values are as follows:
  15433. * <table>
  15434. * <tr><th>Bit Position</th><th>Bit Value</th><th>Child Tile</th></tr>
  15435. * <tr><td>0</td><td>1</td><td>Southwest</td></tr>
  15436. * <tr><td>1</td><td>2</td><td>Southeast</td></tr>
  15437. * <tr><td>2</td><td>4</td><td>Northwest</td></tr>
  15438. * <tr><td>3</td><td>8</td><td>Northeast</td></tr>
  15439. * </table>
  15440. * @param level - The level of the parent tile.
  15441. * @param x - The X coordinate of the parent tile.
  15442. * @param y - The Y coordinate of the parent tile.
  15443. * @returns The bit mask indicating child availability.
  15444. */
  15445. computeChildMaskForTile(level: number, x: number, y: number): number;
  15446. }
  15447. /**
  15448. * Provides details about an error that occurred in an {@link ImageryProvider} or a {@link TerrainProvider}.
  15449. * @param provider - The imagery or terrain provider that experienced the error.
  15450. * @param message - A message describing the error.
  15451. * @param [x] - The X coordinate of the tile that experienced the error, or undefined if the error
  15452. * is not specific to a particular tile.
  15453. * @param [y] - The Y coordinate of the tile that experienced the error, or undefined if the error
  15454. * is not specific to a particular tile.
  15455. * @param [level] - The level of the tile that experienced the error, or undefined if the error
  15456. * is not specific to a particular tile.
  15457. * @param [timesRetried = 0] - The number of times this operation has been retried.
  15458. * @param [error] - The error or exception that occurred, if any.
  15459. */
  15460. export class TileProviderError {
  15461. constructor(provider: ImageryProvider | TerrainProvider, message: string, x?: number, y?: number, level?: number, timesRetried?: number, error?: Error);
  15462. /**
  15463. * The {@link ImageryProvider} or {@link TerrainProvider} that experienced the error.
  15464. */
  15465. provider: ImageryProvider | TerrainProvider;
  15466. /**
  15467. * The message describing the error.
  15468. */
  15469. message: string;
  15470. /**
  15471. * The X coordinate of the tile that experienced the error. If the error is not specific
  15472. * to a particular tile, this property will be undefined.
  15473. */
  15474. x: number;
  15475. /**
  15476. * The Y coordinate of the tile that experienced the error. If the error is not specific
  15477. * to a particular tile, this property will be undefined.
  15478. */
  15479. y: number;
  15480. /**
  15481. * The level-of-detail of the tile that experienced the error. If the error is not specific
  15482. * to a particular tile, this property will be undefined.
  15483. */
  15484. level: number;
  15485. /**
  15486. * The number of times this operation has been retried.
  15487. */
  15488. timesRetried: number;
  15489. /**
  15490. * True if the failed operation should be retried; otherwise, false. The imagery or terrain provider
  15491. * will set the initial value of this property before raising the event, but any listeners
  15492. * can change it. The value after the last listener is invoked will be acted upon.
  15493. */
  15494. retry: boolean;
  15495. /**
  15496. * The error or exception that occurred, if any.
  15497. */
  15498. error: Error;
  15499. /**
  15500. * Handles an error in an {@link ImageryProvider} or {@link TerrainProvider} by raising an event if it has any listeners, or by
  15501. * logging the error to the console if the event has no listeners. This method also tracks the number
  15502. * of times the operation has been retried and will automatically retry if requested to do so by the
  15503. * event listeners.
  15504. * @param previousError - The error instance returned by this function the last
  15505. * time it was called for this error, or undefined if this is the first time this error has
  15506. * occurred.
  15507. * @param provider - The imagery or terrain provider that encountered the error.
  15508. * @param event - The event to raise to inform listeners of the error.
  15509. * @param message - The message describing the error.
  15510. * @param x - The X coordinate of the tile that experienced the error, or undefined if the
  15511. * error is not specific to a particular tile.
  15512. * @param y - The Y coordinate of the tile that experienced the error, or undefined if the
  15513. * error is not specific to a particular tile.
  15514. * @param level - The level-of-detail of the tile that experienced the error, or undefined if the
  15515. * error is not specific to a particular tile.
  15516. * @param retryFunction - The function to call to retry the operation. If undefined, the
  15517. * operation will not be retried.
  15518. * @param [errorDetails] - The error or exception that occurred, if any.
  15519. * @returns The error instance that was passed to the event listeners and that
  15520. * should be passed to this function the next time it is called for the same error in order
  15521. * to track retry counts.
  15522. */
  15523. static handleError(previousError: TileProviderError, provider: ImageryProvider | TerrainProvider, event: Event, message: string, x: number, y: number, level: number, retryFunction: TileProviderError.RetryFunction, errorDetails?: Error): TileProviderError;
  15524. /**
  15525. * Handles success of an operation by resetting the retry count of a previous error, if any. This way,
  15526. * if the error occurs again in the future, the listeners will be informed that it has not yet been retried.
  15527. * @param previousError - The previous error, or undefined if this operation has
  15528. * not previously resulted in an error.
  15529. */
  15530. static handleSuccess(previousError: TileProviderError): void;
  15531. }
  15532. export namespace TileProviderError {
  15533. /**
  15534. * A function that will be called to retry the operation.
  15535. */
  15536. type RetryFunction = () => void;
  15537. }
  15538. /**
  15539. * A tiling scheme for geometry or imagery on the surface of an ellipsoid. At level-of-detail zero,
  15540. * the coarsest, least-detailed level, the number of tiles is configurable.
  15541. * At level of detail one, each of the level zero tiles has four children, two in each direction.
  15542. * At level of detail two, each of the level one tiles has four children, two in each direction.
  15543. * This continues for as many levels as are present in the geometry or imagery source.
  15544. */
  15545. export class TilingScheme {
  15546. constructor();
  15547. /**
  15548. * Gets the ellipsoid that is tiled by the tiling scheme.
  15549. */
  15550. ellipsoid: Ellipsoid;
  15551. /**
  15552. * Gets the rectangle, in radians, covered by this tiling scheme.
  15553. */
  15554. rectangle: Rectangle;
  15555. /**
  15556. * Gets the map projection used by the tiling scheme.
  15557. */
  15558. projection: MapProjection;
  15559. /**
  15560. * Gets the total number of tiles in the X direction at a specified level-of-detail.
  15561. * @param level - The level-of-detail.
  15562. * @returns The number of tiles in the X direction at the given level.
  15563. */
  15564. getNumberOfXTilesAtLevel(level: number): number;
  15565. /**
  15566. * Gets the total number of tiles in the Y direction at a specified level-of-detail.
  15567. * @param level - The level-of-detail.
  15568. * @returns The number of tiles in the Y direction at the given level.
  15569. */
  15570. getNumberOfYTilesAtLevel(level: number): number;
  15571. /**
  15572. * Transforms a rectangle specified in geodetic radians to the native coordinate system
  15573. * of this tiling scheme.
  15574. * @param rectangle - The rectangle to transform.
  15575. * @param [result] - The instance to which to copy the result, or undefined if a new instance
  15576. * should be created.
  15577. * @returns The specified 'result', or a new object containing the native rectangle if 'result'
  15578. * is undefined.
  15579. */
  15580. rectangleToNativeRectangle(rectangle: Rectangle, result?: Rectangle): Rectangle;
  15581. /**
  15582. * Converts tile x, y coordinates and level to a rectangle expressed in the native coordinates
  15583. * of the tiling scheme.
  15584. * @param x - The integer x coordinate of the tile.
  15585. * @param y - The integer y coordinate of the tile.
  15586. * @param level - The tile level-of-detail. Zero is the least detailed.
  15587. * @param [result] - The instance to which to copy the result, or undefined if a new instance
  15588. * should be created.
  15589. * @returns The specified 'result', or a new object containing the rectangle
  15590. * if 'result' is undefined.
  15591. */
  15592. tileXYToNativeRectangle(x: number, y: number, level: number, result?: any): Rectangle;
  15593. /**
  15594. * Converts tile x, y coordinates and level to a cartographic rectangle in radians.
  15595. * @param x - The integer x coordinate of the tile.
  15596. * @param y - The integer y coordinate of the tile.
  15597. * @param level - The tile level-of-detail. Zero is the least detailed.
  15598. * @param [result] - The instance to which to copy the result, or undefined if a new instance
  15599. * should be created.
  15600. * @returns The specified 'result', or a new object containing the rectangle
  15601. * if 'result' is undefined.
  15602. */
  15603. tileXYToRectangle(x: number, y: number, level: number, result?: any): Rectangle;
  15604. /**
  15605. * Calculates the tile x, y coordinates of the tile containing
  15606. * a given cartographic position.
  15607. * @param position - The position.
  15608. * @param level - The tile level-of-detail. Zero is the least detailed.
  15609. * @param [result] - The instance to which to copy the result, or undefined if a new instance
  15610. * should be created.
  15611. * @returns The specified 'result', or a new object containing the tile x, y coordinates
  15612. * if 'result' is undefined.
  15613. */
  15614. positionToTileXY(position: Cartographic, level: number, result?: Cartesian2): Cartesian2;
  15615. }
  15616. /**
  15617. * An interval defined by a start and a stop time; optionally including those times as part of the interval.
  15618. * Arbitrary data can optionally be associated with each instance for used with {@link TimeIntervalCollection}.
  15619. * @example
  15620. * // Create an instance that spans August 1st, 1980 and is associated
  15621. * // with a Cartesian position.
  15622. * var timeInterval = new Cesium.TimeInterval({
  15623. * start : Cesium.JulianDate.fromIso8601('1980-08-01T00:00:00Z'),
  15624. * stop : Cesium.JulianDate.fromIso8601('1980-08-02T00:00:00Z'),
  15625. * isStartIncluded : true,
  15626. * isStopIncluded : false,
  15627. * data : Cesium.Cartesian3.fromDegrees(39.921037, -75.170082)
  15628. * });
  15629. * @example
  15630. * // Create two instances from ISO 8601 intervals with associated numeric data
  15631. * // then compute their intersection, summing the data they contain.
  15632. * var left = Cesium.TimeInterval.fromIso8601({
  15633. * iso8601 : '2000/2010',
  15634. * data : 2
  15635. * });
  15636. *
  15637. * var right = Cesium.TimeInterval.fromIso8601({
  15638. * iso8601 : '1995/2005',
  15639. * data : 3
  15640. * });
  15641. *
  15642. * //The result of the below intersection will be an interval equivalent to
  15643. * //var intersection = Cesium.TimeInterval.fromIso8601({
  15644. * // iso8601 : '2000/2005',
  15645. * // data : 5
  15646. * //});
  15647. * var intersection = new Cesium.TimeInterval();
  15648. * Cesium.TimeInterval.intersect(left, right, intersection, function(leftData, rightData) {
  15649. * return leftData + rightData;
  15650. * });
  15651. * @example
  15652. * // Check if an interval contains a specific time.
  15653. * var dateToCheck = Cesium.JulianDate.fromIso8601('1982-09-08T11:30:00Z');
  15654. * var containsDate = Cesium.TimeInterval.contains(timeInterval, dateToCheck);
  15655. * @param [options] - Object with the following properties:
  15656. * @param [options.start = new JulianDate()] - The start time of the interval.
  15657. * @param [options.stop = new JulianDate()] - The stop time of the interval.
  15658. * @param [options.isStartIncluded = true] - <code>true</code> if <code>options.start</code> is included in the interval, <code>false</code> otherwise.
  15659. * @param [options.isStopIncluded = true] - <code>true</code> if <code>options.stop</code> is included in the interval, <code>false</code> otherwise.
  15660. * @param [options.data] - Arbitrary data associated with this interval.
  15661. */
  15662. export class TimeInterval {
  15663. constructor(options?: {
  15664. start?: JulianDate;
  15665. stop?: JulianDate;
  15666. isStartIncluded?: boolean;
  15667. isStopIncluded?: boolean;
  15668. data?: any;
  15669. });
  15670. /**
  15671. * Gets or sets the start time of this interval.
  15672. */
  15673. start: JulianDate;
  15674. /**
  15675. * Gets or sets the stop time of this interval.
  15676. */
  15677. stop: JulianDate;
  15678. /**
  15679. * Gets or sets the data associated with this interval.
  15680. */
  15681. data: any;
  15682. /**
  15683. * Gets or sets whether or not the start time is included in this interval.
  15684. */
  15685. isStartIncluded: boolean;
  15686. /**
  15687. * Gets or sets whether or not the stop time is included in this interval.
  15688. */
  15689. isStopIncluded: boolean;
  15690. /**
  15691. * Gets whether or not this interval is empty.
  15692. */
  15693. readonly isEmpty: boolean;
  15694. /**
  15695. * Creates a new instance from a {@link http://en.wikipedia.org/wiki/ISO_8601|ISO 8601} interval.
  15696. * @param options - Object with the following properties:
  15697. * @param options.iso8601 - An ISO 8601 interval.
  15698. * @param [options.isStartIncluded = true] - <code>true</code> if <code>options.start</code> is included in the interval, <code>false</code> otherwise.
  15699. * @param [options.isStopIncluded = true] - <code>true</code> if <code>options.stop</code> is included in the interval, <code>false</code> otherwise.
  15700. * @param [options.data] - Arbitrary data associated with this interval.
  15701. * @param [result] - An existing instance to use for the result.
  15702. * @returns The modified result parameter or a new instance if none was provided.
  15703. */
  15704. static fromIso8601(options: {
  15705. iso8601: string;
  15706. isStartIncluded?: boolean;
  15707. isStopIncluded?: boolean;
  15708. data?: any;
  15709. }, result?: TimeInterval): TimeInterval;
  15710. /**
  15711. * Creates an ISO8601 representation of the provided interval.
  15712. * @param timeInterval - The interval to be converted.
  15713. * @param [precision] - The number of fractional digits used to represent the seconds component. By default, the most precise representation is used.
  15714. * @returns The ISO8601 representation of the provided interval.
  15715. */
  15716. static toIso8601(timeInterval: TimeInterval, precision?: number): string;
  15717. /**
  15718. * Duplicates the provided instance.
  15719. * @param [timeInterval] - The instance to clone.
  15720. * @param [result] - An existing instance to use for the result.
  15721. * @returns The modified result parameter or a new instance if none was provided.
  15722. */
  15723. static clone(timeInterval?: TimeInterval, result?: TimeInterval): TimeInterval;
  15724. /**
  15725. * Compares two instances and returns <code>true</code> if they are equal, <code>false</code> otherwise.
  15726. * @param [left] - The first instance.
  15727. * @param [right] - The second instance.
  15728. * @param [dataComparer] - A function which compares the data of the two intervals. If omitted, reference equality is used.
  15729. * @returns <code>true</code> if the dates are equal; otherwise, <code>false</code>.
  15730. */
  15731. static equals(left?: TimeInterval, right?: TimeInterval, dataComparer?: TimeInterval.DataComparer): boolean;
  15732. /**
  15733. * Compares two instances and returns <code>true</code> if they are within <code>epsilon</code> seconds of
  15734. * each other. That is, in order for the dates to be considered equal (and for
  15735. * this function to return <code>true</code>), the absolute value of the difference between them, in
  15736. * seconds, must be less than <code>epsilon</code>.
  15737. * @param [left] - The first instance.
  15738. * @param [right] - The second instance.
  15739. * @param [epsilon = 0] - The maximum number of seconds that should separate the two instances.
  15740. * @param [dataComparer] - A function which compares the data of the two intervals. If omitted, reference equality is used.
  15741. * @returns <code>true</code> if the two dates are within <code>epsilon</code> seconds of each other; otherwise <code>false</code>.
  15742. */
  15743. static equalsEpsilon(left?: TimeInterval, right?: TimeInterval, epsilon?: number, dataComparer?: TimeInterval.DataComparer): boolean;
  15744. /**
  15745. * Computes the intersection of two intervals, optionally merging their data.
  15746. * @param left - The first interval.
  15747. * @param [right] - The second interval.
  15748. * @param [result] - An existing instance to use for the result.
  15749. * @param [mergeCallback] - A function which merges the data of the two intervals. If omitted, the data from the left interval will be used.
  15750. * @returns The modified result parameter.
  15751. */
  15752. static intersect(left: TimeInterval, right?: TimeInterval, result?: TimeInterval, mergeCallback?: TimeInterval.MergeCallback): TimeInterval;
  15753. /**
  15754. * Checks if the specified date is inside the provided interval.
  15755. * @param timeInterval - The interval.
  15756. * @param julianDate - The date to check.
  15757. * @returns <code>true</code> if the interval contains the specified date, <code>false</code> otherwise.
  15758. */
  15759. static contains(timeInterval: TimeInterval, julianDate: JulianDate): boolean;
  15760. /**
  15761. * Duplicates this instance.
  15762. * @param [result] - An existing instance to use for the result.
  15763. * @returns The modified result parameter or a new instance if none was provided.
  15764. */
  15765. clone(result?: TimeInterval): TimeInterval;
  15766. /**
  15767. * Compares this instance against the provided instance componentwise and returns
  15768. * <code>true</code> if they are equal, <code>false</code> otherwise.
  15769. * @param [right] - The right hand side interval.
  15770. * @param [dataComparer] - A function which compares the data of the two intervals. If omitted, reference equality is used.
  15771. * @returns <code>true</code> if they are equal, <code>false</code> otherwise.
  15772. */
  15773. equals(right?: TimeInterval, dataComparer?: TimeInterval.DataComparer): boolean;
  15774. /**
  15775. * Compares this instance against the provided instance componentwise and returns
  15776. * <code>true</code> if they are within the provided epsilon,
  15777. * <code>false</code> otherwise.
  15778. * @param [right] - The right hand side interval.
  15779. * @param [epsilon = 0] - The epsilon to use for equality testing.
  15780. * @param [dataComparer] - A function which compares the data of the two intervals. If omitted, reference equality is used.
  15781. * @returns <code>true</code> if they are within the provided epsilon, <code>false</code> otherwise.
  15782. */
  15783. equalsEpsilon(right?: TimeInterval, epsilon?: number, dataComparer?: TimeInterval.DataComparer): boolean;
  15784. /**
  15785. * Creates a string representing this TimeInterval in ISO8601 format.
  15786. * @returns A string representing this TimeInterval in ISO8601 format.
  15787. */
  15788. toString(): string;
  15789. /**
  15790. * An immutable empty interval.
  15791. */
  15792. static readonly EMPTY: TimeInterval;
  15793. }
  15794. export namespace TimeInterval {
  15795. /**
  15796. * Function interface for merging interval data.
  15797. * @param leftData - The first data instance.
  15798. * @param rightData - The second data instance.
  15799. */
  15800. type MergeCallback = (leftData: any, rightData: any) => any;
  15801. /**
  15802. * Function interface for comparing interval data.
  15803. * @param leftData - The first data instance.
  15804. * @param rightData - The second data instance.
  15805. */
  15806. type DataComparer = (leftData: any, rightData: any) => boolean;
  15807. }
  15808. /**
  15809. * A non-overlapping collection of {@link TimeInterval} instances sorted by start time.
  15810. * @param [intervals] - An array of intervals to add to the collection.
  15811. */
  15812. export class TimeIntervalCollection {
  15813. constructor(intervals?: TimeInterval[]);
  15814. /**
  15815. * Gets an event that is raised whenever the collection of intervals change.
  15816. */
  15817. readonly changedEvent: Event;
  15818. /**
  15819. * Gets the start time of the collection.
  15820. */
  15821. readonly start: JulianDate;
  15822. /**
  15823. * Gets whether or not the start time is included in the collection.
  15824. */
  15825. readonly isStartIncluded: boolean;
  15826. /**
  15827. * Gets the stop time of the collection.
  15828. */
  15829. readonly stop: JulianDate;
  15830. /**
  15831. * Gets whether or not the stop time is included in the collection.
  15832. */
  15833. readonly isStopIncluded: boolean;
  15834. /**
  15835. * Gets the number of intervals in the collection.
  15836. */
  15837. readonly length: number;
  15838. /**
  15839. * Gets whether or not the collection is empty.
  15840. */
  15841. readonly isEmpty: boolean;
  15842. /**
  15843. * Compares this instance against the provided instance componentwise and returns
  15844. * <code>true</code> if they are equal, <code>false</code> otherwise.
  15845. * @param [right] - The right hand side collection.
  15846. * @param [dataComparer] - A function which compares the data of the two intervals. If omitted, reference equality is used.
  15847. * @returns <code>true</code> if they are equal, <code>false</code> otherwise.
  15848. */
  15849. equals(right?: TimeIntervalCollection, dataComparer?: TimeInterval.DataComparer): boolean;
  15850. /**
  15851. * Gets the interval at the specified index.
  15852. * @param index - The index of the interval to retrieve.
  15853. * @returns The interval at the specified index, or <code>undefined</code> if no interval exists as that index.
  15854. */
  15855. get(index: number): TimeInterval | undefined;
  15856. /**
  15857. * Removes all intervals from the collection.
  15858. */
  15859. removeAll(): void;
  15860. /**
  15861. * Finds and returns the interval that contains the specified date.
  15862. * @param date - The date to search for.
  15863. * @returns The interval containing the specified date, <code>undefined</code> if no such interval exists.
  15864. */
  15865. findIntervalContainingDate(date: JulianDate): TimeInterval | undefined;
  15866. /**
  15867. * Finds and returns the data for the interval that contains the specified date.
  15868. * @param date - The date to search for.
  15869. * @returns The data for the interval containing the specified date, or <code>undefined</code> if no such interval exists.
  15870. */
  15871. findDataForIntervalContainingDate(date: JulianDate): any;
  15872. /**
  15873. * Checks if the specified date is inside this collection.
  15874. * @param julianDate - The date to check.
  15875. * @returns <code>true</code> if the collection contains the specified date, <code>false</code> otherwise.
  15876. */
  15877. contains(julianDate: JulianDate): boolean;
  15878. /**
  15879. * Finds and returns the index of the interval in the collection that contains the specified date.
  15880. * @param date - The date to search for.
  15881. * @returns The index of the interval that contains the specified date, if no such interval exists,
  15882. * it returns a negative number which is the bitwise complement of the index of the next interval that
  15883. * starts after the date, or if no interval starts after the specified date, the bitwise complement of
  15884. * the length of the collection.
  15885. */
  15886. indexOf(date: JulianDate): number;
  15887. /**
  15888. * Returns the first interval in the collection that matches the specified parameters.
  15889. * All parameters are optional and <code>undefined</code> parameters are treated as a don't care condition.
  15890. * @param [options] - Object with the following properties:
  15891. * @param [options.start] - The start time of the interval.
  15892. * @param [options.stop] - The stop time of the interval.
  15893. * @param [options.isStartIncluded] - <code>true</code> if <code>options.start</code> is included in the interval, <code>false</code> otherwise.
  15894. * @param [options.isStopIncluded] - <code>true</code> if <code>options.stop</code> is included in the interval, <code>false</code> otherwise.
  15895. * @returns The first interval in the collection that matches the specified parameters.
  15896. */
  15897. findInterval(options?: {
  15898. start?: JulianDate;
  15899. stop?: JulianDate;
  15900. isStartIncluded?: boolean;
  15901. isStopIncluded?: boolean;
  15902. }): TimeInterval | undefined;
  15903. /**
  15904. * Adds an interval to the collection, merging intervals that contain the same data and
  15905. * splitting intervals of different data as needed in order to maintain a non-overlapping collection.
  15906. * The data in the new interval takes precedence over any existing intervals in the collection.
  15907. * @param interval - The interval to add.
  15908. * @param [dataComparer] - A function which compares the data of the two intervals. If omitted, reference equality is used.
  15909. */
  15910. addInterval(interval: TimeInterval, dataComparer?: TimeInterval.DataComparer): void;
  15911. /**
  15912. * Removes the specified interval from this interval collection, creating a hole over the specified interval.
  15913. * The data property of the input interval is ignored.
  15914. * @param interval - The interval to remove.
  15915. * @returns <code>true</code> if the interval was removed, <code>false</code> if no part of the interval was in the collection.
  15916. */
  15917. removeInterval(interval: TimeInterval): boolean;
  15918. /**
  15919. * Creates a new instance that is the intersection of this collection and the provided collection.
  15920. * @param other - The collection to intersect with.
  15921. * @param [dataComparer] - A function which compares the data of the two intervals. If omitted, reference equality is used.
  15922. * @param [mergeCallback] - A function which merges the data of the two intervals. If omitted, the data from the left interval will be used.
  15923. * @returns A new TimeIntervalCollection which is the intersection of this collection and the provided collection.
  15924. */
  15925. intersect(other: TimeIntervalCollection, dataComparer?: TimeInterval.DataComparer, mergeCallback?: TimeInterval.MergeCallback): TimeIntervalCollection;
  15926. /**
  15927. * Creates a new instance from a JulianDate array.
  15928. * @param options - Object with the following properties:
  15929. * @param options.julianDates - An array of ISO 8601 dates.
  15930. * @param [options.isStartIncluded = true] - <code>true</code> if start time is included in the interval, <code>false</code> otherwise.
  15931. * @param [options.isStopIncluded = true] - <code>true</code> if stop time is included in the interval, <code>false</code> otherwise.
  15932. * @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.
  15933. * @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.
  15934. * @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.
  15935. * @param [result] - An existing instance to use for the result.
  15936. * @returns The modified result parameter or a new instance if none was provided.
  15937. */
  15938. static fromJulianDateArray(options: {
  15939. julianDates: JulianDate[];
  15940. isStartIncluded?: boolean;
  15941. isStopIncluded?: boolean;
  15942. leadingInterval?: boolean;
  15943. trailingInterval?: boolean;
  15944. dataCallback?: (...params: any[]) => any;
  15945. }, result?: TimeIntervalCollection): TimeIntervalCollection;
  15946. /**
  15947. * Creates a new instance from an {@link http://en.wikipedia.org/wiki/ISO_8601|ISO 8601} time interval (start/end/duration).
  15948. * @param options - Object with the following properties:
  15949. * @param options.iso8601 - An ISO 8601 interval.
  15950. * @param [options.isStartIncluded = true] - <code>true</code> if start time is included in the interval, <code>false</code> otherwise.
  15951. * @param [options.isStopIncluded = true] - <code>true</code> if stop time is included in the interval, <code>false</code> otherwise.
  15952. * @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.
  15953. * @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.
  15954. * @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.
  15955. * @param [result] - An existing instance to use for the result.
  15956. * @returns The modified result parameter or a new instance if none was provided.
  15957. */
  15958. static fromIso8601(options: {
  15959. iso8601: string;
  15960. isStartIncluded?: boolean;
  15961. isStopIncluded?: boolean;
  15962. leadingInterval?: boolean;
  15963. trailingInterval?: boolean;
  15964. dataCallback?: (...params: any[]) => any;
  15965. }, result?: TimeIntervalCollection): TimeIntervalCollection;
  15966. /**
  15967. * Creates a new instance from a {@link http://en.wikipedia.org/wiki/ISO_8601|ISO 8601} date array.
  15968. * @param options - Object with the following properties:
  15969. * @param options.iso8601Dates - An array of ISO 8601 dates.
  15970. * @param [options.isStartIncluded = true] - <code>true</code> if start time is included in the interval, <code>false</code> otherwise.
  15971. * @param [options.isStopIncluded = true] - <code>true</code> if stop time is included in the interval, <code>false</code> otherwise.
  15972. * @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.
  15973. * @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.
  15974. * @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.
  15975. * @param [result] - An existing instance to use for the result.
  15976. * @returns The modified result parameter or a new instance if none was provided.
  15977. */
  15978. static fromIso8601DateArray(options: {
  15979. iso8601Dates: string[];
  15980. isStartIncluded?: boolean;
  15981. isStopIncluded?: boolean;
  15982. leadingInterval?: boolean;
  15983. trailingInterval?: boolean;
  15984. dataCallback?: (...params: any[]) => any;
  15985. }, result?: TimeIntervalCollection): TimeIntervalCollection;
  15986. /**
  15987. * Creates a new instance from a {@link http://en.wikipedia.org/wiki/ISO_8601|ISO 8601} duration array.
  15988. * @param options - Object with the following properties:
  15989. * @param options.epoch - An date that the durations are relative to.
  15990. * @param options.iso8601Durations - An array of ISO 8601 durations.
  15991. * @param [options.relativeToPrevious = false] - <code>true</code> if durations are relative to previous date, <code>false</code> if always relative to the epoch.
  15992. * @param [options.isStartIncluded = true] - <code>true</code> if start time is included in the interval, <code>false</code> otherwise.
  15993. * @param [options.isStopIncluded = true] - <code>true</code> if stop time is included in the interval, <code>false</code> otherwise.
  15994. * @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.
  15995. * @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.
  15996. * @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.
  15997. * @param [result] - An existing instance to use for the result.
  15998. * @returns The modified result parameter or a new instance if none was provided.
  15999. */
  16000. static fromIso8601DurationArray(options: {
  16001. epoch: JulianDate;
  16002. iso8601Durations: string;
  16003. relativeToPrevious?: boolean;
  16004. isStartIncluded?: boolean;
  16005. isStopIncluded?: boolean;
  16006. leadingInterval?: boolean;
  16007. trailingInterval?: boolean;
  16008. dataCallback?: (...params: any[]) => any;
  16009. }, result?: TimeIntervalCollection): TimeIntervalCollection;
  16010. }
  16011. /**
  16012. * Provides the type of time standards which JulianDate can take as input.
  16013. */
  16014. export enum TimeStandard {
  16015. /**
  16016. * Represents the coordinated Universal Time (UTC) time standard.
  16017. *
  16018. * UTC is related to TAI according to the relationship
  16019. * <code>UTC = TAI - deltaT</code> where <code>deltaT</code> is the number of leap
  16020. * seconds which have been introduced as of the time in TAI.
  16021. */
  16022. UTC = 0,
  16023. /**
  16024. * Represents the International Atomic Time (TAI) time standard.
  16025. * TAI is the principal time standard to which the other time standards are related.
  16026. */
  16027. TAI = 1
  16028. }
  16029. /**
  16030. * Contains functions for transforming positions to various reference frames.
  16031. */
  16032. export namespace Transforms {
  16033. /**
  16034. * Generates a function that computes a 4x4 transformation matrix from a reference frame
  16035. * centered at the provided origin to the provided ellipsoid's fixed reference frame.
  16036. * @param firstAxis - name of the first axis of the local reference frame. Must be
  16037. * 'east', 'north', 'up', 'west', 'south' or 'down'.
  16038. * @param secondAxis - name of the second axis of the local reference frame. Must be
  16039. * 'east', 'north', 'up', 'west', 'south' or 'down'.
  16040. * @returns The function that will computes a
  16041. * 4x4 transformation matrix from a reference frame, with first axis and second axis compliant with the parameters,
  16042. */
  16043. function localFrameToFixedFrameGenerator(firstAxis: string, secondAxis: string): Transforms.LocalFrameToFixedFrame;
  16044. /**
  16045. * Computes a 4x4 transformation matrix from a reference frame
  16046. * centered at the provided origin to the provided ellipsoid's fixed reference frame.
  16047. * @param origin - The center point of the local reference frame.
  16048. * @param [ellipsoid = Ellipsoid.WGS84] - The ellipsoid whose fixed frame is used in the transformation.
  16049. * @param [result] - The object onto which to store the result.
  16050. */
  16051. type LocalFrameToFixedFrame = (origin: Cartesian3, ellipsoid?: Ellipsoid, result?: Matrix4) => Matrix4;
  16052. /**
  16053. * Computes a 4x4 transformation matrix from a reference frame with an east-north-up axes
  16054. * centered at the provided origin to the provided ellipsoid's fixed reference frame.
  16055. * The local axes are defined as:
  16056. * <ul>
  16057. * <li>The <code>x</code> axis points in the local east direction.</li>
  16058. * <li>The <code>y</code> axis points in the local north direction.</li>
  16059. * <li>The <code>z</code> axis points in the direction of the ellipsoid surface normal which passes through the position.</li>
  16060. * </ul>
  16061. * @example
  16062. * // Get the transform from local east-north-up at cartographic (0.0, 0.0) to Earth's fixed frame.
  16063. * var center = Cesium.Cartesian3.fromDegrees(0.0, 0.0);
  16064. * var transform = Cesium.Transforms.eastNorthUpToFixedFrame(center);
  16065. * @param origin - The center point of the local reference frame.
  16066. * @param [ellipsoid = Ellipsoid.WGS84] - The ellipsoid whose fixed frame is used in the transformation.
  16067. * @param [result] - The object onto which to store the result.
  16068. * @returns The modified result parameter or a new Matrix4 instance if none was provided.
  16069. */
  16070. function eastNorthUpToFixedFrame(origin: Cartesian3, ellipsoid?: Ellipsoid, result?: Matrix4): Matrix4;
  16071. /**
  16072. * Computes a 4x4 transformation matrix from a reference frame with an north-east-down axes
  16073. * centered at the provided origin to the provided ellipsoid's fixed reference frame.
  16074. * The local axes are defined as:
  16075. * <ul>
  16076. * <li>The <code>x</code> axis points in the local north direction.</li>
  16077. * <li>The <code>y</code> axis points in the local east direction.</li>
  16078. * <li>The <code>z</code> axis points in the opposite direction of the ellipsoid surface normal which passes through the position.</li>
  16079. * </ul>
  16080. * @example
  16081. * // Get the transform from local north-east-down at cartographic (0.0, 0.0) to Earth's fixed frame.
  16082. * var center = Cesium.Cartesian3.fromDegrees(0.0, 0.0);
  16083. * var transform = Cesium.Transforms.northEastDownToFixedFrame(center);
  16084. * @param origin - The center point of the local reference frame.
  16085. * @param [ellipsoid = Ellipsoid.WGS84] - The ellipsoid whose fixed frame is used in the transformation.
  16086. * @param [result] - The object onto which to store the result.
  16087. * @returns The modified result parameter or a new Matrix4 instance if none was provided.
  16088. */
  16089. function northEastDownToFixedFrame(origin: Cartesian3, ellipsoid?: Ellipsoid, result?: Matrix4): Matrix4;
  16090. /**
  16091. * Computes a 4x4 transformation matrix from a reference frame with an north-up-east axes
  16092. * centered at the provided origin to the provided ellipsoid's fixed reference frame.
  16093. * The local axes are defined as:
  16094. * <ul>
  16095. * <li>The <code>x</code> axis points in the local north direction.</li>
  16096. * <li>The <code>y</code> axis points in the direction of the ellipsoid surface normal which passes through the position.</li>
  16097. * <li>The <code>z</code> axis points in the local east direction.</li>
  16098. * </ul>
  16099. * @example
  16100. * // Get the transform from local north-up-east at cartographic (0.0, 0.0) to Earth's fixed frame.
  16101. * var center = Cesium.Cartesian3.fromDegrees(0.0, 0.0);
  16102. * var transform = Cesium.Transforms.northUpEastToFixedFrame(center);
  16103. * @param origin - The center point of the local reference frame.
  16104. * @param [ellipsoid = Ellipsoid.WGS84] - The ellipsoid whose fixed frame is used in the transformation.
  16105. * @param [result] - The object onto which to store the result.
  16106. * @returns The modified result parameter or a new Matrix4 instance if none was provided.
  16107. */
  16108. function northUpEastToFixedFrame(origin: Cartesian3, ellipsoid?: Ellipsoid, result?: Matrix4): Matrix4;
  16109. /**
  16110. * Computes a 4x4 transformation matrix from a reference frame with an north-west-up axes
  16111. * centered at the provided origin to the provided ellipsoid's fixed reference frame.
  16112. * The local axes are defined as:
  16113. * <ul>
  16114. * <li>The <code>x</code> axis points in the local north direction.</li>
  16115. * <li>The <code>y</code> axis points in the local west direction.</li>
  16116. * <li>The <code>z</code> axis points in the direction of the ellipsoid surface normal which passes through the position.</li>
  16117. * </ul>
  16118. * @example
  16119. * // Get the transform from local north-West-Up at cartographic (0.0, 0.0) to Earth's fixed frame.
  16120. * var center = Cesium.Cartesian3.fromDegrees(0.0, 0.0);
  16121. * var transform = Cesium.Transforms.northWestUpToFixedFrame(center);
  16122. * @param origin - The center point of the local reference frame.
  16123. * @param [ellipsoid = Ellipsoid.WGS84] - The ellipsoid whose fixed frame is used in the transformation.
  16124. * @param [result] - The object onto which to store the result.
  16125. * @returns The modified result parameter or a new Matrix4 instance if none was provided.
  16126. */
  16127. function northWestUpToFixedFrame(origin: Cartesian3, ellipsoid?: Ellipsoid, result?: Matrix4): Matrix4;
  16128. /**
  16129. * Computes a 4x4 transformation matrix from a reference frame with axes computed from the heading-pitch-roll angles
  16130. * centered at the provided origin to the provided ellipsoid's fixed reference frame. Heading is the rotation from the local north
  16131. * direction where a positive angle is increasing eastward. Pitch is the rotation from the local east-north plane. Positive pitch angles
  16132. * are above the plane. Negative pitch angles are below the plane. Roll is the first rotation applied about the local east axis.
  16133. * @example
  16134. * // Get the transform from local heading-pitch-roll at cartographic (0.0, 0.0) to Earth's fixed frame.
  16135. * var center = Cesium.Cartesian3.fromDegrees(0.0, 0.0);
  16136. * var heading = -Cesium.Math.PI_OVER_TWO;
  16137. * var pitch = Cesium.Math.PI_OVER_FOUR;
  16138. * var roll = 0.0;
  16139. * var hpr = new Cesium.HeadingPitchRoll(heading, pitch, roll);
  16140. * var transform = Cesium.Transforms.headingPitchRollToFixedFrame(center, hpr);
  16141. * @param origin - The center point of the local reference frame.
  16142. * @param headingPitchRoll - The heading, pitch, and roll.
  16143. * @param [ellipsoid = Ellipsoid.WGS84] - The ellipsoid whose fixed frame is used in the transformation.
  16144. * @param [fixedFrameTransform = Transforms.eastNorthUpToFixedFrame] - A 4x4 transformation
  16145. * matrix from a reference frame to the provided ellipsoid's fixed reference frame
  16146. * @param [result] - The object onto which to store the result.
  16147. * @returns The modified result parameter or a new Matrix4 instance if none was provided.
  16148. */
  16149. function headingPitchRollToFixedFrame(origin: Cartesian3, headingPitchRoll: HeadingPitchRoll, ellipsoid?: Ellipsoid, fixedFrameTransform?: Transforms.LocalFrameToFixedFrame, result?: Matrix4): Matrix4;
  16150. /**
  16151. * Computes a quaternion from a reference frame with axes computed from the heading-pitch-roll angles
  16152. * centered at the provided origin. Heading is the rotation from the local north
  16153. * direction where a positive angle is increasing eastward. Pitch is the rotation from the local east-north plane. Positive pitch angles
  16154. * are above the plane. Negative pitch angles are below the plane. Roll is the first rotation applied about the local east axis.
  16155. * @example
  16156. * // Get the quaternion from local heading-pitch-roll at cartographic (0.0, 0.0) to Earth's fixed frame.
  16157. * var center = Cesium.Cartesian3.fromDegrees(0.0, 0.0);
  16158. * var heading = -Cesium.Math.PI_OVER_TWO;
  16159. * var pitch = Cesium.Math.PI_OVER_FOUR;
  16160. * var roll = 0.0;
  16161. * var hpr = new HeadingPitchRoll(heading, pitch, roll);
  16162. * var quaternion = Cesium.Transforms.headingPitchRollQuaternion(center, hpr);
  16163. * @param origin - The center point of the local reference frame.
  16164. * @param headingPitchRoll - The heading, pitch, and roll.
  16165. * @param [ellipsoid = Ellipsoid.WGS84] - The ellipsoid whose fixed frame is used in the transformation.
  16166. * @param [fixedFrameTransform = Transforms.eastNorthUpToFixedFrame] - A 4x4 transformation
  16167. * matrix from a reference frame to the provided ellipsoid's fixed reference frame
  16168. * @param [result] - The object onto which to store the result.
  16169. * @returns The modified result parameter or a new Quaternion instance if none was provided.
  16170. */
  16171. function headingPitchRollQuaternion(origin: Cartesian3, headingPitchRoll: HeadingPitchRoll, ellipsoid?: Ellipsoid, fixedFrameTransform?: Transforms.LocalFrameToFixedFrame, result?: Quaternion): Quaternion;
  16172. /**
  16173. * Computes heading-pitch-roll angles from a transform in a particular reference frame. Heading is the rotation from the local north
  16174. * direction where a positive angle is increasing eastward. Pitch is the rotation from the local east-north plane. Positive pitch angles
  16175. * are above the plane. Negative pitch angles are below the plane. Roll is the first rotation applied about the local east axis.
  16176. * @param transform - The transform
  16177. * @param [ellipsoid = Ellipsoid.WGS84] - The ellipsoid whose fixed frame is used in the transformation.
  16178. * @param [fixedFrameTransform = Transforms.eastNorthUpToFixedFrame] - A 4x4 transformation
  16179. * matrix from a reference frame to the provided ellipsoid's fixed reference frame
  16180. * @param [result] - The object onto which to store the result.
  16181. * @returns The modified result parameter or a new HeadingPitchRoll instance if none was provided.
  16182. */
  16183. function fixedFrameToHeadingPitchRoll(transform: Matrix4, ellipsoid?: Ellipsoid, fixedFrameTransform?: Transforms.LocalFrameToFixedFrame, result?: HeadingPitchRoll): HeadingPitchRoll;
  16184. /**
  16185. * Computes a rotation matrix to transform a point or vector from True Equator Mean Equinox (TEME) axes to the
  16186. * pseudo-fixed axes at a given time. This method treats the UT1 time standard as equivalent to UTC.
  16187. * @example
  16188. * //Set the view to the inertial frame.
  16189. * scene.postUpdate.addEventListener(function(scene, time) {
  16190. * var now = Cesium.JulianDate.now();
  16191. * var offset = Cesium.Matrix4.multiplyByPoint(camera.transform, camera.position, new Cesium.Cartesian3());
  16192. * var transform = Cesium.Matrix4.fromRotationTranslation(Cesium.Transforms.computeTemeToPseudoFixedMatrix(now));
  16193. * var inverseTransform = Cesium.Matrix4.inverseTransformation(transform, new Cesium.Matrix4());
  16194. * Cesium.Matrix4.multiplyByPoint(inverseTransform, offset, offset);
  16195. * camera.lookAtTransform(transform, offset);
  16196. * });
  16197. * @param date - The time at which to compute the rotation matrix.
  16198. * @param [result] - The object onto which to store the result.
  16199. * @returns The modified result parameter or a new Matrix3 instance if none was provided.
  16200. */
  16201. function computeTemeToPseudoFixedMatrix(date: JulianDate, result?: Matrix3): Matrix3;
  16202. /**
  16203. * Preloads the data necessary to transform between the ICRF and Fixed axes, in either
  16204. * direction, over a given interval. This function returns a promise that, when resolved,
  16205. * indicates that the preload has completed.
  16206. * @example
  16207. * var interval = new Cesium.TimeInterval(...);
  16208. * when(Cesium.Transforms.preloadIcrfFixed(interval), function() {
  16209. * // the data is now loaded
  16210. * });
  16211. * @param timeInterval - The interval to preload.
  16212. * @returns A promise that, when resolved, indicates that the preload has completed
  16213. * and evaluation of the transformation between the fixed and ICRF axes will
  16214. * no longer return undefined for a time inside the interval.
  16215. */
  16216. function preloadIcrfFixed(timeInterval: TimeInterval): Promise<void>;
  16217. /**
  16218. * Computes a rotation matrix to transform a point or vector from the International Celestial
  16219. * Reference Frame (GCRF/ICRF) inertial frame axes to the Earth-Fixed frame axes (ITRF)
  16220. * at a given time. This function may return undefined if the data necessary to
  16221. * do the transformation is not yet loaded.
  16222. * @example
  16223. * scene.postUpdate.addEventListener(function(scene, time) {
  16224. * // View in ICRF.
  16225. * var icrfToFixed = Cesium.Transforms.computeIcrfToFixedMatrix(time);
  16226. * if (Cesium.defined(icrfToFixed)) {
  16227. * var offset = Cesium.Cartesian3.clone(camera.position);
  16228. * var transform = Cesium.Matrix4.fromRotationTranslation(icrfToFixed);
  16229. * camera.lookAtTransform(transform, offset);
  16230. * }
  16231. * });
  16232. * @param date - The time at which to compute the rotation matrix.
  16233. * @param [result] - The object onto which to store the result. If this parameter is
  16234. * not specified, a new instance is created and returned.
  16235. * @returns The rotation matrix, or undefined if the data necessary to do the
  16236. * transformation is not yet loaded.
  16237. */
  16238. function computeIcrfToFixedMatrix(date: JulianDate, result?: Matrix3): Matrix3;
  16239. /**
  16240. * Computes a rotation matrix to transform a point or vector from the Earth-Fixed frame axes (ITRF)
  16241. * to the International Celestial Reference Frame (GCRF/ICRF) inertial frame axes
  16242. * at a given time. This function may return undefined if the data necessary to
  16243. * do the transformation is not yet loaded.
  16244. * @example
  16245. * // Transform a point from the ICRF axes to the Fixed axes.
  16246. * var now = Cesium.JulianDate.now();
  16247. * var pointInFixed = Cesium.Cartesian3.fromDegrees(0.0, 0.0);
  16248. * var fixedToIcrf = Cesium.Transforms.computeIcrfToFixedMatrix(now);
  16249. * var pointInInertial = new Cesium.Cartesian3();
  16250. * if (Cesium.defined(fixedToIcrf)) {
  16251. * pointInInertial = Cesium.Matrix3.multiplyByVector(fixedToIcrf, pointInFixed, pointInInertial);
  16252. * }
  16253. * @param date - The time at which to compute the rotation matrix.
  16254. * @param [result] - The object onto which to store the result. If this parameter is
  16255. * not specified, a new instance is created and returned.
  16256. * @returns The rotation matrix, or undefined if the data necessary to do the
  16257. * transformation is not yet loaded.
  16258. */
  16259. function computeFixedToIcrfMatrix(date: JulianDate, result?: Matrix3): Matrix3;
  16260. /**
  16261. * Transform a point from model coordinates to window coordinates.
  16262. * @param modelViewProjectionMatrix - The 4x4 model-view-projection matrix.
  16263. * @param viewportTransformation - The 4x4 viewport transformation.
  16264. * @param point - The point to transform.
  16265. * @param [result] - The object onto which to store the result.
  16266. * @returns The modified result parameter or a new Cartesian2 instance if none was provided.
  16267. */
  16268. function pointToWindowCoordinates(modelViewProjectionMatrix: Matrix4, viewportTransformation: Matrix4, point: Cartesian3, result?: Cartesian2): Cartesian2;
  16269. /**
  16270. * Transform a position and velocity to a rotation matrix.
  16271. * @param position - The position to transform.
  16272. * @param velocity - The velocity vector to transform.
  16273. * @param [ellipsoid = Ellipsoid.WGS84] - The ellipsoid whose fixed frame is used in the transformation.
  16274. * @param [result] - The object onto which to store the result.
  16275. * @returns The modified result parameter or a new Matrix3 instance if none was provided.
  16276. */
  16277. function rotationMatrixFromPositionVelocity(position: Cartesian3, velocity: Cartesian3, ellipsoid?: Ellipsoid, result?: Matrix3): Matrix3;
  16278. }
  16279. /**
  16280. * An affine transformation defined by a translation, rotation, and scale.
  16281. * @param [translation = Cartesian3.ZERO] - A {@link Cartesian3} specifying the (x, y, z) translation to apply to the node.
  16282. * @param [rotation = Quaternion.IDENTITY] - A {@link Quaternion} specifying the (x, y, z, w) rotation to apply to the node.
  16283. * @param [scale = new Cartesian3(1.0, 1.0, 1.0)] - A {@link Cartesian3} specifying the (x, y, z) scaling to apply to the node.
  16284. */
  16285. export class TranslationRotationScale {
  16286. constructor(translation?: Cartesian3, rotation?: Quaternion, scale?: Cartesian3);
  16287. /**
  16288. * Gets or sets the (x, y, z) translation to apply to the node.
  16289. */
  16290. translation: Cartesian3;
  16291. /**
  16292. * Gets or sets the (x, y, z, w) rotation to apply to the node.
  16293. */
  16294. rotation: Quaternion;
  16295. /**
  16296. * Gets or sets the (x, y, z) scaling to apply to the node.
  16297. */
  16298. scale: Cartesian3;
  16299. /**
  16300. * Compares this instance against the provided instance and returns
  16301. * <code>true</code> if they are equal, <code>false</code> otherwise.
  16302. * @param [right] - The right hand side TranslationRotationScale.
  16303. * @returns <code>true</code> if they are equal, <code>false</code> otherwise.
  16304. */
  16305. equals(right?: TranslationRotationScale): boolean;
  16306. }
  16307. /**
  16308. * Uses the Tridiagonal Matrix Algorithm, also known as the Thomas Algorithm, to solve
  16309. * a system of linear equations where the coefficient matrix is a tridiagonal matrix.
  16310. */
  16311. export namespace TridiagonalSystemSolver {
  16312. /**
  16313. * Solves a tridiagonal system of linear equations.
  16314. * @example
  16315. * var lowerDiagonal = [1.0, 1.0, 1.0, 1.0];
  16316. * var diagonal = [2.0, 4.0, 4.0, 4.0, 2.0];
  16317. * var upperDiagonal = [1.0, 1.0, 1.0, 1.0];
  16318. * var rightHandSide = [
  16319. * new Cesium.Cartesian3(410757.0, -1595711.0, 1375302.0),
  16320. * new Cesium.Cartesian3(-5986705.0, -2190640.0, 1099600.0),
  16321. * new Cesium.Cartesian3(-12593180.0, 288588.0, -1755549.0),
  16322. * new Cesium.Cartesian3(-5349898.0, 2457005.0, -2685438.0),
  16323. * new Cesium.Cartesian3(845820.0, 1573488.0, -1205591.0)
  16324. * ];
  16325. *
  16326. * var solution = Cesium.TridiagonalSystemSolver.solve(lowerDiagonal, diagonal, upperDiagonal, rightHandSide);
  16327. * @param diagonal - An array with length <code>n</code> that contains the diagonal of the coefficient matrix.
  16328. * @param lower - An array with length <code>n - 1</code> that contains the lower diagonal of the coefficient matrix.
  16329. * @param upper - An array with length <code>n - 1</code> that contains the upper diagonal of the coefficient matrix.
  16330. * @param right - An array of Cartesians with length <code>n</code> that is the right side of the system of equations.
  16331. * @returns An array of Cartesians with length <code>n</code> that is the solution to the tridiagonal system of equations.
  16332. */
  16333. function solve(diagonal: number[], lower: number[], upper: number[], right: Cartesian3[]): Cartesian3[];
  16334. }
  16335. /**
  16336. * A singleton that contains all of the servers that are trusted. Credentials will be sent with
  16337. * any requests to these servers.
  16338. */
  16339. export namespace TrustedServers {
  16340. /**
  16341. * Adds a trusted server to the registry
  16342. * @example
  16343. * // Add a trusted server
  16344. * TrustedServers.add('my.server.com', 80);
  16345. * @param host - The host to be added.
  16346. * @param port - The port used to access the host.
  16347. */
  16348. function add(host: string, port: number): void;
  16349. /**
  16350. * Removes a trusted server from the registry
  16351. * @example
  16352. * // Remove a trusted server
  16353. * TrustedServers.remove('my.server.com', 80);
  16354. * @param host - The host to be removed.
  16355. * @param port - The port used to access the host.
  16356. */
  16357. function remove(host: string, port: number): void;
  16358. /**
  16359. * Tests whether a server is trusted or not. The server must have been added with the port if it is included in the url.
  16360. * @example
  16361. * // Add server
  16362. * TrustedServers.add('my.server.com', 81);
  16363. *
  16364. * // Check if server is trusted
  16365. * if (TrustedServers.contains('https://my.server.com:81/path/to/file.png')) {
  16366. * // my.server.com:81 is trusted
  16367. * }
  16368. * if (TrustedServers.contains('https://my.server.com/path/to/file.png')) {
  16369. * // my.server.com isn't trusted
  16370. * }
  16371. * @param url - The url to be tested against the trusted list
  16372. * @returns Returns true if url is trusted, false otherwise.
  16373. */
  16374. function contains(url: string): boolean;
  16375. /**
  16376. * Clears the registry
  16377. * @example
  16378. * // Remove a trusted server
  16379. * TrustedServers.clear();
  16380. */
  16381. function clear(): void;
  16382. }
  16383. /**
  16384. * A {@link TerrainProvider} that produces terrain geometry by tessellating height maps
  16385. * retrieved from a {@link http://vr-theworld.com/|VT MÄK VR-TheWorld server}.
  16386. * @example
  16387. * var terrainProvider = new Cesium.VRTheWorldTerrainProvider({
  16388. * url : 'https://www.vr-theworld.com/vr-theworld/tiles1.0.0/73/'
  16389. * });
  16390. * viewer.terrainProvider = terrainProvider;
  16391. * @param options - Object with the following properties:
  16392. * @param options.url - The URL of the VR-TheWorld TileMap.
  16393. * @param [options.ellipsoid = Ellipsoid.WGS84] - The ellipsoid. If this parameter is not
  16394. * specified, the WGS84 ellipsoid is used.
  16395. * @param [options.credit] - A credit for the data source, which is displayed on the canvas.
  16396. */
  16397. export class VRTheWorldTerrainProvider {
  16398. constructor(options: {
  16399. url: Resource | string;
  16400. ellipsoid?: Ellipsoid;
  16401. credit?: Credit | string;
  16402. });
  16403. /**
  16404. * Gets an event that is raised when the terrain provider encounters an asynchronous error. By subscribing
  16405. * to the event, you will be notified of the error and can potentially recover from it. Event listeners
  16406. * are passed an instance of {@link TileProviderError}.
  16407. */
  16408. errorEvent: Event;
  16409. /**
  16410. * Gets the credit to display when this terrain provider is active. Typically this is used to credit
  16411. * the source of the terrain. This function should not be called before {@link VRTheWorldTerrainProvider#ready} returns true.
  16412. */
  16413. credit: Credit;
  16414. /**
  16415. * Gets the tiling scheme used by this provider. This function should
  16416. * not be called before {@link VRTheWorldTerrainProvider#ready} returns true.
  16417. */
  16418. tilingScheme: GeographicTilingScheme;
  16419. /**
  16420. * Gets a value indicating whether or not the provider is ready for use.
  16421. */
  16422. ready: boolean;
  16423. /**
  16424. * Gets a promise that resolves to true when the provider is ready for use.
  16425. */
  16426. readonly readyPromise: Promise<boolean>;
  16427. /**
  16428. * Gets a value indicating whether or not the provider includes a water mask. The water mask
  16429. * indicates which areas of the globe are water rather than land, so they can be rendered
  16430. * as a reflective surface with animated waves. This function should not be
  16431. * called before {@link VRTheWorldTerrainProvider#ready} returns true.
  16432. */
  16433. hasWaterMask: boolean;
  16434. /**
  16435. * Gets a value indicating whether or not the requested tiles include vertex normals.
  16436. * This function should not be called before {@link VRTheWorldTerrainProvider#ready} returns true.
  16437. */
  16438. hasVertexNormals: boolean;
  16439. /**
  16440. * Gets an object that can be used to determine availability of terrain from this provider, such as
  16441. * at points and in rectangles. This function should not be called before
  16442. * {@link TerrainProvider#ready} returns true. This property may be undefined if availability
  16443. * information is not available.
  16444. */
  16445. availability: TileAvailability;
  16446. /**
  16447. * Requests the geometry for a given tile. This function should not be called before
  16448. * {@link VRTheWorldTerrainProvider#ready} returns true. The result includes terrain
  16449. * data and indicates that all child tiles are available.
  16450. * @param x - The X coordinate of the tile for which to request geometry.
  16451. * @param y - The Y coordinate of the tile for which to request geometry.
  16452. * @param level - The level of the tile for which to request geometry.
  16453. * @param [request] - The request object. Intended for internal use only.
  16454. * @returns A promise for the requested geometry. If this method
  16455. * returns undefined instead of a promise, it is an indication that too many requests are already
  16456. * pending and the request will be retried later.
  16457. */
  16458. requestTileGeometry(x: number, y: number, level: number, request?: Request): Promise<TerrainData> | undefined;
  16459. /**
  16460. * Gets the maximum geometric error allowed in a tile at a given level.
  16461. * @param level - The tile level for which to get the maximum geometric error.
  16462. * @returns The maximum geometric error.
  16463. */
  16464. getLevelMaximumGeometricError(level: number): number;
  16465. /**
  16466. * Determines whether data for a tile is available to be loaded.
  16467. * @param x - The X coordinate of the tile for which to request geometry.
  16468. * @param y - The Y coordinate of the tile for which to request geometry.
  16469. * @param level - The level of the tile for which to request geometry.
  16470. * @returns Undefined if not supported, otherwise true or false.
  16471. */
  16472. getTileDataAvailable(x: number, y: number, level: number): boolean;
  16473. /**
  16474. * Makes sure we load availability data for a tile
  16475. * @param x - The X coordinate of the tile for which to request geometry.
  16476. * @param y - The Y coordinate of the tile for which to request geometry.
  16477. * @param level - The level of the tile for which to request geometry.
  16478. * @returns Undefined if nothing need to be loaded or a Promise that resolves when all required tiles are loaded
  16479. */
  16480. loadTileDataAvailability(x: number, y: number, level: number): undefined | Promise<void>;
  16481. }
  16482. /**
  16483. * A vertex format defines what attributes make up a vertex. A VertexFormat can be provided
  16484. * to a {@link Geometry} to request that certain properties be computed, e.g., just position,
  16485. * position and normal, etc.
  16486. * @example
  16487. * // Create a vertex format with position and 2D texture coordinate attributes.
  16488. * var format = new Cesium.VertexFormat({
  16489. * position : true,
  16490. * st : true
  16491. * });
  16492. * @param [options] - An object with boolean properties corresponding to VertexFormat properties as shown in the code example.
  16493. */
  16494. export class VertexFormat {
  16495. constructor(options?: any);
  16496. /**
  16497. * When <code>true</code>, the vertex has a 3D position attribute.
  16498. * <p>
  16499. * 64-bit floating-point (for precision). 3 components per attribute.
  16500. * </p>
  16501. */
  16502. position: boolean;
  16503. /**
  16504. * When <code>true</code>, the vertex has a normal attribute (normalized), which is commonly used for lighting.
  16505. * <p>
  16506. * 32-bit floating-point. 3 components per attribute.
  16507. * </p>
  16508. */
  16509. normal: boolean;
  16510. /**
  16511. * When <code>true</code>, the vertex has a 2D texture coordinate attribute.
  16512. * <p>
  16513. * 32-bit floating-point. 2 components per attribute
  16514. * </p>
  16515. */
  16516. st: boolean;
  16517. /**
  16518. * When <code>true</code>, the vertex has a bitangent attribute (normalized), which is used for tangent-space effects like bump mapping.
  16519. * <p>
  16520. * 32-bit floating-point. 3 components per attribute.
  16521. * </p>
  16522. */
  16523. bitangent: boolean;
  16524. /**
  16525. * When <code>true</code>, the vertex has a tangent attribute (normalized), which is used for tangent-space effects like bump mapping.
  16526. * <p>
  16527. * 32-bit floating-point. 3 components per attribute.
  16528. * </p>
  16529. */
  16530. tangent: boolean;
  16531. /**
  16532. * When <code>true</code>, the vertex has an RGB color attribute.
  16533. * <p>
  16534. * 8-bit unsigned byte. 3 components per attribute.
  16535. * </p>
  16536. */
  16537. color: boolean;
  16538. /**
  16539. * An immutable vertex format with only a position attribute.
  16540. */
  16541. static readonly POSITION_ONLY: VertexFormat;
  16542. /**
  16543. * An immutable vertex format with position and normal attributes.
  16544. * This is compatible with per-instance color appearances like {@link PerInstanceColorAppearance}.
  16545. */
  16546. static readonly POSITION_AND_NORMAL: VertexFormat;
  16547. /**
  16548. * An immutable vertex format with position, normal, and st attributes.
  16549. * This is compatible with {@link MaterialAppearance} when {@link MaterialAppearance#materialSupport}
  16550. * is <code>TEXTURED/code>.
  16551. */
  16552. static readonly POSITION_NORMAL_AND_ST: VertexFormat;
  16553. /**
  16554. * An immutable vertex format with position and st attributes.
  16555. * This is compatible with {@link EllipsoidSurfaceAppearance}.
  16556. */
  16557. static readonly POSITION_AND_ST: VertexFormat;
  16558. /**
  16559. * An immutable vertex format with position and color attributes.
  16560. */
  16561. static readonly POSITION_AND_COLOR: VertexFormat;
  16562. /**
  16563. * An immutable vertex format with well-known attributes: position, normal, st, tangent, and bitangent.
  16564. */
  16565. static readonly ALL: VertexFormat;
  16566. /**
  16567. * An immutable vertex format with position, normal, and st attributes.
  16568. * This is compatible with most appearances and materials; however
  16569. * normal and st attributes are not always required. When this is
  16570. * known in advance, another <code>VertexFormat</code> should be used.
  16571. */
  16572. static readonly DEFAULT: VertexFormat;
  16573. /**
  16574. * The number of elements used to pack the object into an array.
  16575. */
  16576. static packedLength: number;
  16577. /**
  16578. * Stores the provided instance into the provided array.
  16579. * @param value - The value to pack.
  16580. * @param array - The array to pack into.
  16581. * @param [startingIndex = 0] - The index into the array at which to start packing the elements.
  16582. * @returns The array that was packed into
  16583. */
  16584. static pack(value: VertexFormat, array: number[], startingIndex?: number): number[];
  16585. /**
  16586. * Retrieves an instance from a packed array.
  16587. * @param array - The packed array.
  16588. * @param [startingIndex = 0] - The starting index of the element to be unpacked.
  16589. * @param [result] - The object into which to store the result.
  16590. * @returns The modified result parameter or a new VertexFormat instance if one was not provided.
  16591. */
  16592. static unpack(array: number[], startingIndex?: number, result?: VertexFormat): VertexFormat;
  16593. /**
  16594. * Duplicates a VertexFormat instance.
  16595. * @param vertexFormat - The vertex format to duplicate.
  16596. * @param [result] - The object onto which to store the result.
  16597. * @returns The modified result parameter or a new VertexFormat instance if one was not provided. (Returns undefined if vertexFormat is undefined)
  16598. */
  16599. static clone(vertexFormat: VertexFormat, result?: VertexFormat): VertexFormat;
  16600. }
  16601. /**
  16602. * Synchronizes a video element with a simulation clock.
  16603. * @param [options] - Object with the following properties:
  16604. * @param [options.clock] - The clock instance used to drive the video.
  16605. * @param [options.element] - The video element to be synchronized.
  16606. * @param [options.epoch = Iso8601.MINIMUM_VALUE] - The simulation time that marks the start of the video.
  16607. * @param [options.tolerance = 1.0] - The maximum amount of time, in seconds, that the clock and video can diverge.
  16608. */
  16609. export class VideoSynchronizer {
  16610. constructor(options?: {
  16611. clock?: Clock;
  16612. element?: HTMLVideoElement;
  16613. epoch?: JulianDate;
  16614. tolerance?: number;
  16615. });
  16616. /**
  16617. * Gets or sets the simulation time that marks the start of the video.
  16618. */
  16619. epoch: JulianDate;
  16620. /**
  16621. * Gets or sets the amount of time in seconds the video's currentTime
  16622. * and the clock's currentTime can diverge before a video seek is performed.
  16623. * Lower values make the synchronization more accurate but video
  16624. * performance might suffer. Higher values provide better performance
  16625. * but at the cost of accuracy.
  16626. */
  16627. tolerance: number;
  16628. /**
  16629. * Gets or sets the clock used to drive the video element.
  16630. */
  16631. clock: Clock;
  16632. /**
  16633. * Gets or sets the video element to synchronize.
  16634. */
  16635. element: HTMLVideoElement;
  16636. /**
  16637. * Destroys and resources used by the object. Once an object is destroyed, it should not be used.
  16638. */
  16639. destroy(): void;
  16640. /**
  16641. * Returns true if this object was destroyed; otherwise, false.
  16642. * @returns True if this object was destroyed; otherwise, false.
  16643. */
  16644. isDestroyed(): boolean;
  16645. }
  16646. /**
  16647. * This enumerated type is used in determining to what extent an object, the occludee,
  16648. * is visible during horizon culling. An occluder may fully block an occludee, in which case
  16649. * it has no visibility, may partially block an occludee from view, or may not block it at all,
  16650. * leading to full visibility.
  16651. */
  16652. export enum Visibility {
  16653. /**
  16654. * Represents that no part of an object is visible.
  16655. */
  16656. NONE = -1,
  16657. /**
  16658. * Represents that part, but not all, of an object is visible
  16659. */
  16660. PARTIAL = 0,
  16661. /**
  16662. * Represents that an object is visible in its entirety.
  16663. */
  16664. FULL = 1
  16665. }
  16666. /**
  16667. * A description of a wall, which is similar to a KML line string. A wall is defined by a series of points,
  16668. * which extrude down to the ground. Optionally, they can extrude downwards to a specified height.
  16669. * @example
  16670. * // create a wall that spans from ground level to 10000 meters
  16671. * var wall = new Cesium.WallGeometry({
  16672. * positions : Cesium.Cartesian3.fromDegreesArrayHeights([
  16673. * 19.0, 47.0, 10000.0,
  16674. * 19.0, 48.0, 10000.0,
  16675. * 20.0, 48.0, 10000.0,
  16676. * 20.0, 47.0, 10000.0,
  16677. * 19.0, 47.0, 10000.0
  16678. * ])
  16679. * });
  16680. * var geometry = Cesium.WallGeometry.createGeometry(wall);
  16681. * @param options - Object with the following properties:
  16682. * @param options.positions - An array of Cartesian objects, which are the points of the wall.
  16683. * @param [options.granularity = Math.RADIANS_PER_DEGREE] - The distance, in radians, between each latitude and longitude. Determines the number of positions in the buffer.
  16684. * @param [options.maximumHeights] - An array parallel to <code>positions</code> that give the maximum height of the
  16685. * wall at <code>positions</code>. If undefined, the height of each position in used.
  16686. * @param [options.minimumHeights] - An array parallel to <code>positions</code> that give the minimum height of the
  16687. * wall at <code>positions</code>. If undefined, the height at each position is 0.0.
  16688. * @param [options.ellipsoid = Ellipsoid.WGS84] - The ellipsoid for coordinate manipulation
  16689. * @param [options.vertexFormat = VertexFormat.DEFAULT] - The vertex attributes to be computed.
  16690. */
  16691. export class WallGeometry {
  16692. constructor(options: {
  16693. positions: Cartesian3[];
  16694. granularity?: number;
  16695. maximumHeights?: number[];
  16696. minimumHeights?: number[];
  16697. ellipsoid?: Ellipsoid;
  16698. vertexFormat?: VertexFormat;
  16699. });
  16700. /**
  16701. * The number of elements used to pack the object into an array.
  16702. */
  16703. packedLength: number;
  16704. /**
  16705. * Stores the provided instance into the provided array.
  16706. * @param value - The value to pack.
  16707. * @param array - The array to pack into.
  16708. * @param [startingIndex = 0] - The index into the array at which to start packing the elements.
  16709. * @returns The array that was packed into
  16710. */
  16711. static pack(value: WallGeometry, array: number[], startingIndex?: number): number[];
  16712. /**
  16713. * Retrieves an instance from a packed array.
  16714. * @param array - The packed array.
  16715. * @param [startingIndex = 0] - The starting index of the element to be unpacked.
  16716. * @param [result] - The object into which to store the result.
  16717. * @returns The modified result parameter or a new WallGeometry instance if one was not provided.
  16718. */
  16719. static unpack(array: number[], startingIndex?: number, result?: WallGeometry): WallGeometry;
  16720. /**
  16721. * A description of a wall, which is similar to a KML line string. A wall is defined by a series of points,
  16722. * which extrude down to the ground. Optionally, they can extrude downwards to a specified height.
  16723. * @example
  16724. * // create a wall that spans from 10000 meters to 20000 meters
  16725. * var wall = Cesium.WallGeometry.fromConstantHeights({
  16726. * positions : Cesium.Cartesian3.fromDegreesArray([
  16727. * 19.0, 47.0,
  16728. * 19.0, 48.0,
  16729. * 20.0, 48.0,
  16730. * 20.0, 47.0,
  16731. * 19.0, 47.0,
  16732. * ]),
  16733. * minimumHeight : 20000.0,
  16734. * maximumHeight : 10000.0
  16735. * });
  16736. * var geometry = Cesium.WallGeometry.createGeometry(wall);
  16737. * @param options - Object with the following properties:
  16738. * @param options.positions - An array of Cartesian objects, which are the points of the wall.
  16739. * @param [options.maximumHeight] - A constant that defines the maximum height of the
  16740. * wall at <code>positions</code>. If undefined, the height of each position in used.
  16741. * @param [options.minimumHeight] - A constant that defines the minimum height of the
  16742. * wall at <code>positions</code>. If undefined, the height at each position is 0.0.
  16743. * @param [options.ellipsoid = Ellipsoid.WGS84] - The ellipsoid for coordinate manipulation
  16744. * @param [options.vertexFormat = VertexFormat.DEFAULT] - The vertex attributes to be computed.
  16745. */
  16746. static fromConstantHeights(options: {
  16747. positions: Cartesian3[];
  16748. maximumHeight?: number;
  16749. minimumHeight?: number;
  16750. ellipsoid?: Ellipsoid;
  16751. vertexFormat?: VertexFormat;
  16752. }): WallGeometry;
  16753. /**
  16754. * Computes the geometric representation of a wall, including its vertices, indices, and a bounding sphere.
  16755. * @param wallGeometry - A description of the wall.
  16756. * @returns The computed vertices and indices.
  16757. */
  16758. static createGeometry(wallGeometry: WallGeometry): Geometry | undefined;
  16759. }
  16760. /**
  16761. * A description of a wall outline. A wall is defined by a series of points,
  16762. * which extrude down to the ground. Optionally, they can extrude downwards to a specified height.
  16763. * @example
  16764. * // create a wall outline that spans from ground level to 10000 meters
  16765. * var wall = new Cesium.WallOutlineGeometry({
  16766. * positions : Cesium.Cartesian3.fromDegreesArrayHeights([
  16767. * 19.0, 47.0, 10000.0,
  16768. * 19.0, 48.0, 10000.0,
  16769. * 20.0, 48.0, 10000.0,
  16770. * 20.0, 47.0, 10000.0,
  16771. * 19.0, 47.0, 10000.0
  16772. * ])
  16773. * });
  16774. * var geometry = Cesium.WallOutlineGeometry.createGeometry(wall);
  16775. * @param options - Object with the following properties:
  16776. * @param options.positions - An array of Cartesian objects, which are the points of the wall.
  16777. * @param [options.granularity = Math.RADIANS_PER_DEGREE] - The distance, in radians, between each latitude and longitude. Determines the number of positions in the buffer.
  16778. * @param [options.maximumHeights] - An array parallel to <code>positions</code> that give the maximum height of the
  16779. * wall at <code>positions</code>. If undefined, the height of each position in used.
  16780. * @param [options.minimumHeights] - An array parallel to <code>positions</code> that give the minimum height of the
  16781. * wall at <code>positions</code>. If undefined, the height at each position is 0.0.
  16782. * @param [options.ellipsoid = Ellipsoid.WGS84] - The ellipsoid for coordinate manipulation
  16783. */
  16784. export class WallOutlineGeometry {
  16785. constructor(options: {
  16786. positions: Cartesian3[];
  16787. granularity?: number;
  16788. maximumHeights?: number[];
  16789. minimumHeights?: number[];
  16790. ellipsoid?: Ellipsoid;
  16791. });
  16792. /**
  16793. * The number of elements used to pack the object into an array.
  16794. */
  16795. packedLength: number;
  16796. /**
  16797. * Stores the provided instance into the provided array.
  16798. * @param value - The value to pack.
  16799. * @param array - The array to pack into.
  16800. * @param [startingIndex = 0] - The index into the array at which to start packing the elements.
  16801. * @returns The array that was packed into
  16802. */
  16803. static pack(value: WallOutlineGeometry, array: number[], startingIndex?: number): number[];
  16804. /**
  16805. * Retrieves an instance from a packed array.
  16806. * @param array - The packed array.
  16807. * @param [startingIndex = 0] - The starting index of the element to be unpacked.
  16808. * @param [result] - The object into which to store the result.
  16809. * @returns The modified result parameter or a new WallOutlineGeometry instance if one was not provided.
  16810. */
  16811. static unpack(array: number[], startingIndex?: number, result?: WallOutlineGeometry): WallOutlineGeometry;
  16812. /**
  16813. * A description of a walloutline. A wall is defined by a series of points,
  16814. * which extrude down to the ground. Optionally, they can extrude downwards to a specified height.
  16815. * @example
  16816. * // create a wall that spans from 10000 meters to 20000 meters
  16817. * var wall = Cesium.WallOutlineGeometry.fromConstantHeights({
  16818. * positions : Cesium.Cartesian3.fromDegreesArray([
  16819. * 19.0, 47.0,
  16820. * 19.0, 48.0,
  16821. * 20.0, 48.0,
  16822. * 20.0, 47.0,
  16823. * 19.0, 47.0,
  16824. * ]),
  16825. * minimumHeight : 20000.0,
  16826. * maximumHeight : 10000.0
  16827. * });
  16828. * var geometry = Cesium.WallOutlineGeometry.createGeometry(wall);
  16829. * @param options - Object with the following properties:
  16830. * @param options.positions - An array of Cartesian objects, which are the points of the wall.
  16831. * @param [options.maximumHeight] - A constant that defines the maximum height of the
  16832. * wall at <code>positions</code>. If undefined, the height of each position in used.
  16833. * @param [options.minimumHeight] - A constant that defines the minimum height of the
  16834. * wall at <code>positions</code>. If undefined, the height at each position is 0.0.
  16835. * @param [options.ellipsoid = Ellipsoid.WGS84] - The ellipsoid for coordinate manipulation
  16836. */
  16837. static fromConstantHeights(options: {
  16838. positions: Cartesian3[];
  16839. maximumHeight?: number;
  16840. minimumHeight?: number;
  16841. ellipsoid?: Ellipsoid;
  16842. }): WallOutlineGeometry;
  16843. /**
  16844. * Computes the geometric representation of a wall outline, including its vertices, indices, and a bounding sphere.
  16845. * @param wallGeometry - A description of the wall outline.
  16846. * @returns The computed vertices and indices.
  16847. */
  16848. static createGeometry(wallGeometry: WallOutlineGeometry): Geometry | undefined;
  16849. }
  16850. /**
  16851. * The map projection used by Google Maps, Bing Maps, and most of ArcGIS Online, EPSG:3857. This
  16852. * projection use longitude and latitude expressed with the WGS84 and transforms them to Mercator using
  16853. * the spherical (rather than ellipsoidal) equations.
  16854. * @param [ellipsoid = Ellipsoid.WGS84] - The ellipsoid.
  16855. */
  16856. export class WebMercatorProjection {
  16857. constructor(ellipsoid?: Ellipsoid);
  16858. /**
  16859. * Gets the {@link Ellipsoid}.
  16860. */
  16861. readonly ellipsoid: Ellipsoid;
  16862. /**
  16863. * Converts a Mercator angle, in the range -PI to PI, to a geodetic latitude
  16864. * in the range -PI/2 to PI/2.
  16865. * @param mercatorAngle - The angle to convert.
  16866. * @returns The geodetic latitude in radians.
  16867. */
  16868. static mercatorAngleToGeodeticLatitude(mercatorAngle: number): number;
  16869. /**
  16870. * Converts a geodetic latitude in radians, in the range -PI/2 to PI/2, to a Mercator
  16871. * angle in the range -PI to PI.
  16872. * @param latitude - The geodetic latitude in radians.
  16873. * @returns The Mercator angle.
  16874. */
  16875. static geodeticLatitudeToMercatorAngle(latitude: number): number;
  16876. /**
  16877. * The maximum latitude (both North and South) supported by a Web Mercator
  16878. * (EPSG:3857) projection. Technically, the Mercator projection is defined
  16879. * for any latitude up to (but not including) 90 degrees, but it makes sense
  16880. * to cut it off sooner because it grows exponentially with increasing latitude.
  16881. * The logic behind this particular cutoff value, which is the one used by
  16882. * Google Maps, Bing Maps, and Esri, is that it makes the projection
  16883. * square. That is, the rectangle is equal in the X and Y directions.
  16884. *
  16885. * The constant value is computed by calling:
  16886. * WebMercatorProjection.mercatorAngleToGeodeticLatitude(Math.PI)
  16887. */
  16888. static MaximumLatitude: number;
  16889. /**
  16890. * Converts geodetic ellipsoid coordinates, in radians, to the equivalent Web Mercator
  16891. * X, Y, Z coordinates expressed in meters and returned in a {@link Cartesian3}. The height
  16892. * is copied unmodified to the Z coordinate.
  16893. * @param cartographic - The cartographic coordinates in radians.
  16894. * @param [result] - The instance to which to copy the result, or undefined if a
  16895. * new instance should be created.
  16896. * @returns The equivalent web mercator X, Y, Z coordinates, in meters.
  16897. */
  16898. project(cartographic: Cartographic, result?: Cartesian3): Cartesian3;
  16899. /**
  16900. * Converts Web Mercator X, Y coordinates, expressed in meters, to a {@link Cartographic}
  16901. * containing geodetic ellipsoid coordinates. The Z coordinate is copied unmodified to the
  16902. * height.
  16903. * @param cartesian - The web mercator Cartesian position to unrproject with height (z) in meters.
  16904. * @param [result] - The instance to which to copy the result, or undefined if a
  16905. * new instance should be created.
  16906. * @returns The equivalent cartographic coordinates.
  16907. */
  16908. unproject(cartesian: Cartesian3, result?: Cartographic): Cartographic;
  16909. }
  16910. /**
  16911. * A tiling scheme for geometry referenced to a {@link WebMercatorProjection}, EPSG:3857. This is
  16912. * the tiling scheme used by Google Maps, Microsoft Bing Maps, and most of ESRI ArcGIS Online.
  16913. * @param [options] - Object with the following properties:
  16914. * @param [options.ellipsoid = Ellipsoid.WGS84] - The ellipsoid whose surface is being tiled. Defaults to
  16915. * the WGS84 ellipsoid.
  16916. * @param [options.numberOfLevelZeroTilesX = 1] - The number of tiles in the X direction at level zero of
  16917. * the tile tree.
  16918. * @param [options.numberOfLevelZeroTilesY = 1] - The number of tiles in the Y direction at level zero of
  16919. * the tile tree.
  16920. * @param [options.rectangleSouthwestInMeters] - The southwest corner of the rectangle covered by the
  16921. * tiling scheme, in meters. If this parameter or rectangleNortheastInMeters is not specified, the entire
  16922. * globe is covered in the longitude direction and an equal distance is covered in the latitude
  16923. * direction, resulting in a square projection.
  16924. * @param [options.rectangleNortheastInMeters] - The northeast corner of the rectangle covered by the
  16925. * tiling scheme, in meters. If this parameter or rectangleSouthwestInMeters is not specified, the entire
  16926. * globe is covered in the longitude direction and an equal distance is covered in the latitude
  16927. * direction, resulting in a square projection.
  16928. */
  16929. export class WebMercatorTilingScheme {
  16930. constructor(options?: {
  16931. ellipsoid?: Ellipsoid;
  16932. numberOfLevelZeroTilesX?: number;
  16933. numberOfLevelZeroTilesY?: number;
  16934. rectangleSouthwestInMeters?: Cartesian2;
  16935. rectangleNortheastInMeters?: Cartesian2;
  16936. });
  16937. /**
  16938. * Gets the ellipsoid that is tiled by this tiling scheme.
  16939. */
  16940. ellipsoid: Ellipsoid;
  16941. /**
  16942. * Gets the rectangle, in radians, covered by this tiling scheme.
  16943. */
  16944. rectangle: Rectangle;
  16945. /**
  16946. * Gets the map projection used by this tiling scheme.
  16947. */
  16948. projection: MapProjection;
  16949. /**
  16950. * Gets the total number of tiles in the X direction at a specified level-of-detail.
  16951. * @param level - The level-of-detail.
  16952. * @returns The number of tiles in the X direction at the given level.
  16953. */
  16954. getNumberOfXTilesAtLevel(level: number): number;
  16955. /**
  16956. * Gets the total number of tiles in the Y direction at a specified level-of-detail.
  16957. * @param level - The level-of-detail.
  16958. * @returns The number of tiles in the Y direction at the given level.
  16959. */
  16960. getNumberOfYTilesAtLevel(level: number): number;
  16961. /**
  16962. * Transforms a rectangle specified in geodetic radians to the native coordinate system
  16963. * of this tiling scheme.
  16964. * @param rectangle - The rectangle to transform.
  16965. * @param [result] - The instance to which to copy the result, or undefined if a new instance
  16966. * should be created.
  16967. * @returns The specified 'result', or a new object containing the native rectangle if 'result'
  16968. * is undefined.
  16969. */
  16970. rectangleToNativeRectangle(rectangle: Rectangle, result?: Rectangle): Rectangle;
  16971. /**
  16972. * Converts tile x, y coordinates and level to a rectangle expressed in the native coordinates
  16973. * of the tiling scheme.
  16974. * @param x - The integer x coordinate of the tile.
  16975. * @param y - The integer y coordinate of the tile.
  16976. * @param level - The tile level-of-detail. Zero is the least detailed.
  16977. * @param [result] - The instance to which to copy the result, or undefined if a new instance
  16978. * should be created.
  16979. * @returns The specified 'result', or a new object containing the rectangle
  16980. * if 'result' is undefined.
  16981. */
  16982. tileXYToNativeRectangle(x: number, y: number, level: number, result?: any): Rectangle;
  16983. /**
  16984. * Converts tile x, y coordinates and level to a cartographic rectangle in radians.
  16985. * @param x - The integer x coordinate of the tile.
  16986. * @param y - The integer y coordinate of the tile.
  16987. * @param level - The tile level-of-detail. Zero is the least detailed.
  16988. * @param [result] - The instance to which to copy the result, or undefined if a new instance
  16989. * should be created.
  16990. * @returns The specified 'result', or a new object containing the rectangle
  16991. * if 'result' is undefined.
  16992. */
  16993. tileXYToRectangle(x: number, y: number, level: number, result?: any): Rectangle;
  16994. /**
  16995. * Calculates the tile x, y coordinates of the tile containing
  16996. * a given cartographic position.
  16997. * @param position - The position.
  16998. * @param level - The tile level-of-detail. Zero is the least detailed.
  16999. * @param [result] - The instance to which to copy the result, or undefined if a new instance
  17000. * should be created.
  17001. * @returns The specified 'result', or a new object containing the tile x, y coordinates
  17002. * if 'result' is undefined.
  17003. */
  17004. positionToTileXY(position: Cartographic, level: number, result?: Cartesian2): Cartesian2;
  17005. }
  17006. /**
  17007. * A spline that linearly interpolates over an array of weight values used by morph targets.
  17008. * @example
  17009. * var times = [ 0.0, 1.5, 3.0, 4.5, 6.0 ];
  17010. * var weights = [0.0, 1.0, 0.25, 0.75, 0.5, 0.5, 0.75, 0.25, 1.0, 0.0]; //Two targets
  17011. * var spline = new Cesium.WeightSpline({
  17012. * times : times,
  17013. * weights : weights
  17014. * });
  17015. *
  17016. * var p0 = spline.evaluate(times[0]);
  17017. * @param options - Object with the following properties:
  17018. * @param options.times - An array of strictly increasing, unit-less, floating-point times at each point.
  17019. * The values are in no way connected to the clock time. They are the parameterization for the curve.
  17020. * @param options.weights - The array of floating-point control weights given. The weights are ordered such
  17021. * that all weights for the targets are given in chronological order and order in which they appear in
  17022. * 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) ...]
  17023. * where i and j in w(i,j) are the time indices and target indices, respectively.
  17024. */
  17025. export class WeightSpline {
  17026. constructor(options: {
  17027. times: number[];
  17028. weights: number[];
  17029. });
  17030. /**
  17031. * An array of times for the control weights.
  17032. */
  17033. readonly times: number[];
  17034. /**
  17035. * An array of floating-point array control weights.
  17036. */
  17037. readonly weights: number[];
  17038. /**
  17039. * Finds an index <code>i</code> in <code>times</code> such that the parameter
  17040. * <code>time</code> is in the interval <code>[times[i], times[i + 1]]</code>.
  17041. * @param time - The time.
  17042. * @returns The index for the element at the start of the interval.
  17043. */
  17044. findTimeInterval(time: number): number;
  17045. /**
  17046. * Wraps the given time to the period covered by the spline.
  17047. * @param time - The time.
  17048. * @returns The time, wrapped around to the updated animation.
  17049. */
  17050. wrapTime(time: number): number;
  17051. /**
  17052. * Clamps the given time to the period covered by the spline.
  17053. * @param time - The time.
  17054. * @returns The time, clamped to the animation period.
  17055. */
  17056. clampTime(time: number): number;
  17057. /**
  17058. * Evaluates the curve at a given time.
  17059. * @param time - The time at which to evaluate the curve.
  17060. * @param [result] - The object onto which to store the result.
  17061. * @returns The modified result parameter or a new instance of the point on the curve at the given time.
  17062. */
  17063. evaluate(time: number, result?: number[]): number[];
  17064. }
  17065. /**
  17066. * Winding order defines the order of vertices for a triangle to be considered front-facing.
  17067. */
  17068. export enum WindingOrder {
  17069. /**
  17070. * Vertices are in clockwise order.
  17071. */
  17072. CLOCKWISE = WebGLConstants.CW,
  17073. /**
  17074. * Vertices are in counter-clockwise order.
  17075. */
  17076. COUNTER_CLOCKWISE = WebGLConstants.CCW
  17077. }
  17078. /**
  17079. * Computes the barycentric coordinates for a point with respect to a triangle.
  17080. * @example
  17081. * // Returns Cartesian3.UNIT_X
  17082. * var p = new Cesium.Cartesian3(-1.0, 0.0, 0.0);
  17083. * var b = Cesium.barycentricCoordinates(p,
  17084. * new Cesium.Cartesian3(-1.0, 0.0, 0.0),
  17085. * new Cesium.Cartesian3( 1.0, 0.0, 0.0),
  17086. * new Cesium.Cartesian3( 0.0, 1.0, 1.0));
  17087. * @param point - The point to test.
  17088. * @param p0 - The first point of the triangle, corresponding to the barycentric x-axis.
  17089. * @param p1 - The second point of the triangle, corresponding to the barycentric y-axis.
  17090. * @param p2 - The third point of the triangle, corresponding to the barycentric z-axis.
  17091. * @param [result] - The object onto which to store the result.
  17092. * @returns The modified result parameter or a new Cartesian3 instance if one was not provided.
  17093. */
  17094. export function barycentricCoordinates(point: Cartesian2 | Cartesian3, p0: Cartesian2 | Cartesian3, p1: Cartesian2 | Cartesian3, p2: Cartesian2 | Cartesian3, result?: Cartesian3): Cartesian3;
  17095. /**
  17096. * Finds an item in a sorted array.
  17097. * @example
  17098. * // Create a comparator function to search through an array of numbers.
  17099. * function comparator(a, b) {
  17100. * return a - b;
  17101. * };
  17102. * var numbers = [0, 2, 4, 6, 8];
  17103. * var index = Cesium.binarySearch(numbers, 6, comparator); // 3
  17104. * @param array - The sorted array to search.
  17105. * @param itemToFind - The item to find in the array.
  17106. * @param comparator - The function to use to compare the item to
  17107. * elements in the array.
  17108. * @returns The index of <code>itemToFind</code> in the array, if it exists. If <code>itemToFind</code>
  17109. * does not exist, the return value is a negative number which is the bitwise complement (~)
  17110. * of the index before which the itemToFind should be inserted in order to maintain the
  17111. * sorted order of the array.
  17112. */
  17113. export function binarySearch(array: any[], itemToFind: any, comparator: binarySearchComparator): number;
  17114. /**
  17115. * A function used to compare two items while performing a binary search.
  17116. * @example
  17117. * function compareNumbers(a, b) {
  17118. * return a - b;
  17119. * }
  17120. * @param a - An item in the array.
  17121. * @param b - The item being searched for.
  17122. */
  17123. export type binarySearchComparator = (a: any, b: any) => number;
  17124. /**
  17125. * Given a relative URL under the Cesium base URL, returns an absolute URL.
  17126. * @example
  17127. * var viewer = new Cesium.Viewer("cesiumContainer", {
  17128. * imageryProvider: new Cesium.TileMapServiceImageryProvider({
  17129. * url: Cesium.buildModuleUrl("Assets/Textures/NaturalEarthII"),
  17130. * }),
  17131. * baseLayerPicker: false,
  17132. * });
  17133. * @param relativeUrl - The relative path.
  17134. * @returns The absolutely URL representation of the provided path.
  17135. */
  17136. export function buildModuleUrl(relativeUrl: string): string;
  17137. /**
  17138. * A browser-independent function to cancel an animation frame requested using {@link requestAnimationFrame}.
  17139. * @param requestID - The value returned by {@link requestAnimationFrame}.
  17140. */
  17141. export function cancelAnimationFrame(requestID: number): void;
  17142. /**
  17143. * Clones an object, returning a new object containing the same properties.
  17144. * @param object - The object to clone.
  17145. * @param [deep = false] - If true, all properties will be deep cloned recursively.
  17146. * @returns The cloned object.
  17147. */
  17148. export function clone(object: any, deep?: boolean): any;
  17149. /**
  17150. * Merges two objects, copying their properties onto a new combined object. When two objects have the same
  17151. * property, the value of the property on the first object is used. If either object is undefined,
  17152. * it will be treated as an empty object.
  17153. * @example
  17154. * var object1 = {
  17155. * propOne : 1,
  17156. * propTwo : {
  17157. * value1 : 10
  17158. * }
  17159. * }
  17160. * var object2 = {
  17161. * propTwo : 2
  17162. * }
  17163. * var final = Cesium.combine(object1, object2);
  17164. *
  17165. * // final === {
  17166. * // propOne : 1,
  17167. * // propTwo : {
  17168. * // value1 : 10
  17169. * // }
  17170. * // }
  17171. * @param [object1] - The first object to merge.
  17172. * @param [object2] - The second object to merge.
  17173. * @param [deep = false] - Perform a recursive merge.
  17174. * @returns The combined object containing all properties from both objects.
  17175. */
  17176. export function combine(object1?: any, object2?: any, deep?: boolean): any;
  17177. /**
  17178. * Creates a Globally unique identifier (GUID) string. A GUID is 128 bits long, and can guarantee uniqueness across space and time.
  17179. * @example
  17180. * this.guid = Cesium.createGuid();
  17181. */
  17182. export function createGuid(): string;
  17183. /**
  17184. * Creates a {@link CesiumTerrainProvider} instance for the {@link https://cesium.com/content/#cesium-world-terrain|Cesium World Terrain}.
  17185. * @example
  17186. * // Create Cesium World Terrain with default settings
  17187. * var viewer = new Cesium.Viewer('cesiumContainer', {
  17188. * terrainProvider : Cesium.createWorldTerrain();
  17189. * });
  17190. * @example
  17191. * // Create Cesium World Terrain with water and normals.
  17192. * var viewer = new Cesium.Viewer('cesiumContainer', {
  17193. * terrainProvider : Cesium.createWorldTerrain({
  17194. * requestWaterMask : true,
  17195. * requestVertexNormals : true
  17196. * });
  17197. * });
  17198. * @param [options] - Object with the following properties:
  17199. * @param [options.requestVertexNormals = false] - Flag that indicates if the client should request additional lighting information from the server if available.
  17200. * @param [options.requestWaterMask = false] - Flag that indicates if the client should request per tile water masks from the server if available.
  17201. */
  17202. export function createWorldTerrain(options?: {
  17203. requestVertexNormals?: boolean;
  17204. requestWaterMask?: boolean;
  17205. }): CesiumTerrainProvider;
  17206. /**
  17207. * Returns the first parameter if not undefined, otherwise the second parameter.
  17208. * Useful for setting a default value for a parameter.
  17209. * @example
  17210. * param = Cesium.defaultValue(param, 'default');
  17211. * @returns Returns the first parameter if not undefined, otherwise the second parameter.
  17212. */
  17213. export function defaultValue(a: any, b: any): any;
  17214. /**
  17215. * @example
  17216. * if (Cesium.defined(positions)) {
  17217. * doSomething();
  17218. * } else {
  17219. * doSomethingElse();
  17220. * }
  17221. * @param value - The object.
  17222. * @returns Returns true if the object is defined, returns false otherwise.
  17223. */
  17224. export function defined(value: any): boolean;
  17225. /**
  17226. * Destroys an object. Each of the object's functions, including functions in its prototype,
  17227. * is replaced with a function that throws a {@link DeveloperError}, except for the object's
  17228. * <code>isDestroyed</code> function, which is set to a function that returns <code>true</code>.
  17229. * The object's properties are removed with <code>delete</code>.
  17230. * <br /><br />
  17231. * This function is used by objects that hold native resources, e.g., WebGL resources, which
  17232. * need to be explicitly released. Client code calls an object's <code>destroy</code> function,
  17233. * which then releases the native resource and calls <code>destroyObject</code> to put itself
  17234. * in a destroyed state.
  17235. * @example
  17236. * // How a texture would destroy itself.
  17237. * this.destroy = function () {
  17238. * _gl.deleteTexture(_texture);
  17239. * return Cesium.destroyObject(this);
  17240. * };
  17241. * @param object - The object to destroy.
  17242. * @param [message] - The message to include in the exception that is thrown if
  17243. * a destroyed object's function is called.
  17244. */
  17245. export function destroyObject(object: any, message?: string): void;
  17246. /**
  17247. * Formats an error object into a String. If available, uses name, message, and stack
  17248. * properties, otherwise, falls back on toString().
  17249. * @param object - The item to find in the array.
  17250. * @returns A string containing the formatted error.
  17251. */
  17252. export function formatError(object: any): string;
  17253. /**
  17254. * Given a relative Uri and a base Uri, returns the absolute Uri of the relative Uri.
  17255. * @example
  17256. * //absolute Uri will be "https://test.com/awesome.png";
  17257. * var absoluteUri = Cesium.getAbsoluteUri('awesome.png', 'https://test.com');
  17258. * @param relative - The relative Uri.
  17259. * @param [base] - The base Uri.
  17260. * @returns The absolute Uri of the given relative Uri.
  17261. */
  17262. export function getAbsoluteUri(relative: string, base?: string): string;
  17263. /**
  17264. * Given a URI, returns the base path of the URI.
  17265. * @example
  17266. * // basePath will be "/Gallery/";
  17267. * var basePath = Cesium.getBaseUri('/Gallery/simple.czml?value=true&example=false');
  17268. *
  17269. * // basePath will be "/Gallery/?value=true&example=false";
  17270. * var basePath = Cesium.getBaseUri('/Gallery/simple.czml?value=true&example=false', true);
  17271. * @param uri - The Uri.
  17272. * @param [includeQuery = false] - Whether or not to include the query string and fragment form the uri
  17273. * @returns The base path of the Uri.
  17274. */
  17275. export function getBaseUri(uri: string, includeQuery?: boolean): string;
  17276. /**
  17277. * Given a URI, returns the extension of the URI.
  17278. * @example
  17279. * //extension will be "czml";
  17280. * var extension = Cesium.getExtensionFromUri('/Gallery/simple.czml?value=true&example=false');
  17281. * @param uri - The Uri.
  17282. * @returns The extension of the Uri.
  17283. */
  17284. export function getExtensionFromUri(uri: string): string;
  17285. /**
  17286. * Given a URI, returns the last segment of the URI, removing any path or query information.
  17287. * @example
  17288. * //fileName will be"simple.czml";
  17289. * var fileName = Cesium.getFilenameFromUri('/Gallery/simple.czml?value=true&example=false');
  17290. * @param uri - The Uri.
  17291. * @returns The last segment of the Uri.
  17292. */
  17293. export function getFilenameFromUri(uri: string): string;
  17294. /**
  17295. * Extract a pixel array from a loaded image. Draws the image
  17296. * into a canvas so it can read the pixels back.
  17297. * @param image - The image to extract pixels from.
  17298. * @param width - The width of the image. If not defined, then image.width is assigned.
  17299. * @param height - The height of the image. If not defined, then image.height is assigned.
  17300. * @returns The pixels of the image.
  17301. */
  17302. export function getImagePixels(image: HTMLImageElement, width: number, height: number): ImageData;
  17303. /**
  17304. * Gets a timestamp that can be used in measuring the time between events. Timestamps
  17305. * are expressed in milliseconds, but it is not specified what the milliseconds are
  17306. * measured from. This function uses performance.now() if it is available, or Date.now()
  17307. * otherwise.
  17308. * @returns The timestamp in milliseconds since some unspecified reference time.
  17309. */
  17310. export function getTimestamp(): number;
  17311. /**
  17312. * Determines if a given date is a leap year.
  17313. * @example
  17314. * var leapYear = Cesium.isLeapYear(2000); // true
  17315. * @param year - The year to be tested.
  17316. * @returns True if <code>year</code> is a leap year.
  17317. */
  17318. export function isLeapYear(year: number): boolean;
  17319. /**
  17320. * Asynchronously loads and parses the given URL to a CRN file or parses the raw binary data of a CRN file.
  17321. * Returns a promise that will resolve to an object containing the image buffer, width, height and format once loaded,
  17322. * or reject if the URL failed to load or failed to parse the data. The data is loaded
  17323. * using XMLHttpRequest, which means that in order to make requests to another origin,
  17324. * the server must have Cross-Origin Resource Sharing (CORS) headers enabled.
  17325. * @example
  17326. * // load a single URL asynchronously
  17327. * Cesium.loadCRN('some/url').then(function(textureData) {
  17328. * var width = textureData.width;
  17329. * var height = textureData.height;
  17330. * var format = textureData.internalFormat;
  17331. * var arrayBufferView = textureData.bufferView;
  17332. * // use the data to create a texture
  17333. * }).otherwise(function(error) {
  17334. * // an error occurred
  17335. * });
  17336. * @param resourceOrUrlOrBuffer - The URL of the binary data or an ArrayBuffer.
  17337. * @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.
  17338. */
  17339. export function loadCRN(resourceOrUrlOrBuffer: Resource | string | ArrayBuffer): Promise<CompressedTextureBuffer> | undefined;
  17340. /**
  17341. * Asynchronously loads and parses the given URL to a KTX file or parses the raw binary data of a KTX file.
  17342. * Returns a promise that will resolve to an object containing the image buffer, width, height and format once loaded,
  17343. * or reject if the URL failed to load or failed to parse the data. The data is loaded
  17344. * using XMLHttpRequest, which means that in order to make requests to another origin,
  17345. * the server must have Cross-Origin Resource Sharing (CORS) headers enabled.
  17346. * <p>
  17347. * The following are part of the KTX format specification but are not supported:
  17348. * <ul>
  17349. * <li>Big-endian files</li>
  17350. * <li>Metadata</li>
  17351. * <li>3D textures</li>
  17352. * <li>Texture Arrays</li>
  17353. * <li>Cubemaps</li>
  17354. * <li>Mipmaps</li>
  17355. * </ul>
  17356. * </p>
  17357. * @example
  17358. * // load a single URL asynchronously
  17359. * Cesium.loadKTX('some/url').then(function(ktxData) {
  17360. * var width = ktxData.width;
  17361. * var height = ktxData.height;
  17362. * var format = ktxData.internalFormat;
  17363. * var arrayBufferView = ktxData.bufferView;
  17364. * // use the data to create a texture
  17365. * }).otherwise(function(error) {
  17366. * // an error occurred
  17367. * });
  17368. * @param resourceOrUrlOrBuffer - The URL of the binary data or an ArrayBuffer.
  17369. * @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.
  17370. */
  17371. export function loadKTX(resourceOrUrlOrBuffer: Resource | string | ArrayBuffer): Promise<CompressedTextureBuffer> | undefined;
  17372. /**
  17373. * A stable merge sort.
  17374. * @example
  17375. * // Assume array contains BoundingSpheres in world coordinates.
  17376. * // Sort them in ascending order of distance from the camera.
  17377. * var position = camera.positionWC;
  17378. * Cesium.mergeSort(array, function(a, b, position) {
  17379. * return Cesium.BoundingSphere.distanceSquaredTo(b, position) - Cesium.BoundingSphere.distanceSquaredTo(a, position);
  17380. * }, position);
  17381. * @param array - The array to sort.
  17382. * @param comparator - The function to use to compare elements in the array.
  17383. * @param [userDefinedObject] - Any item to pass as the third parameter to <code>comparator</code>.
  17384. */
  17385. export function mergeSort(array: any[], comparator: mergeSortComparator, userDefinedObject?: any): void;
  17386. /**
  17387. * A function used to compare two items while performing a merge sort.
  17388. * @example
  17389. * function compareNumbers(a, b, userDefinedObject) {
  17390. * return a - b;
  17391. * }
  17392. * @param a - An item in the array.
  17393. * @param b - An item in the array.
  17394. * @param [userDefinedObject] - An object that was passed to {@link mergeSort}.
  17395. */
  17396. export type mergeSortComparator = (a: any, b: any, userDefinedObject?: any) => number;
  17397. /**
  17398. * Converts an object representing a set of name/value pairs into a query string,
  17399. * with names and values encoded properly for use in a URL. Values that are arrays
  17400. * will produce multiple values with the same name.
  17401. * @example
  17402. * var str = Cesium.objectToQuery({
  17403. * key1 : 'some value',
  17404. * key2 : 'a/b',
  17405. * key3 : ['x', 'y']
  17406. * });
  17407. * @param obj - The object containing data to encode.
  17408. * @returns An encoded query string.
  17409. */
  17410. export function objectToQuery(obj: any): string;
  17411. /**
  17412. * Determines if a point is inside a triangle.
  17413. * @example
  17414. * // Returns true
  17415. * var p = new Cesium.Cartesian2(0.25, 0.25);
  17416. * var b = Cesium.pointInsideTriangle(p,
  17417. * new Cesium.Cartesian2(0.0, 0.0),
  17418. * new Cesium.Cartesian2(1.0, 0.0),
  17419. * new Cesium.Cartesian2(0.0, 1.0));
  17420. * @param point - The point to test.
  17421. * @param p0 - The first point of the triangle.
  17422. * @param p1 - The second point of the triangle.
  17423. * @param p2 - The third point of the triangle.
  17424. * @returns <code>true</code> if the point is inside the triangle; otherwise, <code>false</code>.
  17425. */
  17426. export function pointInsideTriangle(point: Cartesian2 | Cartesian3, p0: Cartesian2 | Cartesian3, p1: Cartesian2 | Cartesian3, p2: Cartesian2 | Cartesian3): boolean;
  17427. /**
  17428. * Parses a query string into an object, where the keys and values of the object are the
  17429. * name/value pairs from the query string, decoded. If a name appears multiple times,
  17430. * the value in the object will be an array of values.
  17431. * @example
  17432. * var obj = Cesium.queryToObject('key1=some%20value&key2=a%2Fb&key3=x&key3=y');
  17433. * // obj will be:
  17434. * // {
  17435. * // key1 : 'some value',
  17436. * // key2 : 'a/b',
  17437. * // key3 : ['x', 'y']
  17438. * // }
  17439. * @param queryString - The query string.
  17440. * @returns An object containing the parameters parsed from the query string.
  17441. */
  17442. export function queryToObject(queryString: string): any;
  17443. /**
  17444. * A browser-independent function to request a new animation frame. This is used to create
  17445. * an application's draw loop as shown in the example below.
  17446. * @example
  17447. * // Create a draw loop using requestAnimationFrame. The
  17448. * // tick callback function is called for every animation frame.
  17449. * function tick() {
  17450. * scene.render();
  17451. * Cesium.requestAnimationFrame(tick);
  17452. * }
  17453. * tick();
  17454. * @param callback - The function to call when the next frame should be drawn.
  17455. * @returns An ID that can be passed to {@link cancelAnimationFrame} to cancel the request.
  17456. */
  17457. export function requestAnimationFrame(callback: requestAnimationFrameCallback): number;
  17458. /**
  17459. * A function that will be called when the next frame should be drawn.
  17460. * @param timestamp - A timestamp for the frame, in milliseconds.
  17461. */
  17462. export type requestAnimationFrameCallback = (timestamp: number) => void;
  17463. /**
  17464. * Initiates a terrain height query for an array of {@link Cartographic} positions by
  17465. * requesting tiles from a terrain provider, sampling, and interpolating. The interpolation
  17466. * matches the triangles used to render the terrain at the specified level. The query
  17467. * happens asynchronously, so this function returns a promise that is resolved when
  17468. * the query completes. Each point height is modified in place. If a height can not be
  17469. * determined because no terrain data is available for the specified level at that location,
  17470. * or another error occurs, the height is set to undefined. As is typical of the
  17471. * {@link Cartographic} type, the supplied height is a height above the reference ellipsoid
  17472. * (such as {@link Ellipsoid.WGS84}) rather than an altitude above mean sea level. In other
  17473. * words, it will not necessarily be 0.0 if sampled in the ocean. This function needs the
  17474. * terrain level of detail as input, if you need to get the altitude of the terrain as precisely
  17475. * as possible (i.e. with maximum level of detail) use {@link sampleTerrainMostDetailed}.
  17476. * @example
  17477. * // Query the terrain height of two Cartographic positions
  17478. * var terrainProvider = Cesium.createWorldTerrain();
  17479. * var positions = [
  17480. * Cesium.Cartographic.fromDegrees(86.925145, 27.988257),
  17481. * Cesium.Cartographic.fromDegrees(87.0, 28.0)
  17482. * ];
  17483. * var promise = Cesium.sampleTerrain(terrainProvider, 11, positions);
  17484. * Cesium.when(promise, function(updatedPositions) {
  17485. * // positions[0].height and positions[1].height have been updated.
  17486. * // updatedPositions is just a reference to positions.
  17487. * });
  17488. * @param terrainProvider - The terrain provider from which to query heights.
  17489. * @param level - The terrain level-of-detail from which to query terrain heights.
  17490. * @param positions - The positions to update with terrain heights.
  17491. * @returns A promise that resolves to the provided list of positions when terrain the query has completed.
  17492. */
  17493. export function sampleTerrain(terrainProvider: TerrainProvider, level: number, positions: Cartographic[]): Promise<Cartographic[]>;
  17494. /**
  17495. * Initiates a sampleTerrain() request at the maximum available tile level for a terrain dataset.
  17496. * @example
  17497. * // Query the terrain height of two Cartographic positions
  17498. * var terrainProvider = Cesium.createWorldTerrain();
  17499. * var positions = [
  17500. * Cesium.Cartographic.fromDegrees(86.925145, 27.988257),
  17501. * Cesium.Cartographic.fromDegrees(87.0, 28.0)
  17502. * ];
  17503. * var promise = Cesium.sampleTerrainMostDetailed(terrainProvider, positions);
  17504. * Cesium.when(promise, function(updatedPositions) {
  17505. * // positions[0].height and positions[1].height have been updated.
  17506. * // updatedPositions is just a reference to positions.
  17507. * });
  17508. * @param terrainProvider - The terrain provider from which to query heights.
  17509. * @param positions - The positions to update with terrain heights.
  17510. * @returns A promise that resolves to the provided list of positions when terrain the query has completed. This
  17511. * promise will reject if the terrain provider's `availability` property is undefined.
  17512. */
  17513. export function sampleTerrainMostDetailed(terrainProvider: TerrainProvider, positions: Cartographic[]): Promise<Cartographic[]>;
  17514. /**
  17515. * Subdivides an array into a number of smaller, equal sized arrays.
  17516. * @param array - The array to divide.
  17517. * @param numberOfArrays - The number of arrays to divide the provided array into.
  17518. */
  17519. export function subdivideArray(array: any[], numberOfArrays: number): void;
  17520. /**
  17521. * Writes the given text into a new canvas. The canvas will be sized to fit the text.
  17522. * If text is blank, returns undefined.
  17523. * @param text - The text to write.
  17524. * @param [options] - Object with the following properties:
  17525. * @param [options.font = '10px sans-serif'] - The CSS font to use.
  17526. * @param [options.textBaseline = 'bottom'] - The baseline of the text.
  17527. * @param [options.fill = true] - Whether to fill the text.
  17528. * @param [options.stroke = false] - Whether to stroke the text.
  17529. * @param [options.fillColor = Color.WHITE] - The fill color.
  17530. * @param [options.strokeColor = Color.BLACK] - The stroke color.
  17531. * @param [options.strokeWidth = 1] - The stroke width.
  17532. * @param [options.backgroundColor = Color.TRANSPARENT] - The background color of the canvas.
  17533. * @param [options.padding = 0] - The pixel size of the padding to add around the text.
  17534. * @returns A new canvas with the given text drawn into it. The dimensions object
  17535. * from measureText will also be added to the returned canvas. If text is
  17536. * blank, returns undefined.
  17537. */
  17538. export function writeTextToCanvas(text: string, options?: {
  17539. font?: string;
  17540. textBaseline?: string;
  17541. fill?: boolean;
  17542. stroke?: boolean;
  17543. fillColor?: Color;
  17544. strokeColor?: Color;
  17545. strokeWidth?: number;
  17546. backgroundColor?: Color;
  17547. padding?: number;
  17548. }): HTMLCanvasElement;
  17549. export namespace BillboardGraphics {
  17550. /**
  17551. * Initialization options for the BillboardGraphics constructor
  17552. * @property [show = true] - A boolean Property specifying the visibility of the billboard.
  17553. * @property [image] - A Property specifying the Image, URI, or Canvas to use for the billboard.
  17554. * @property [scale = 1.0] - A numeric Property specifying the scale to apply to the image size.
  17555. * @property [pixelOffset = Cartesian2.ZERO] - A {@link Cartesian2} Property specifying the pixel offset.
  17556. * @property [eyeOffset = Cartesian3.ZERO] - A {@link Cartesian3} Property specifying the eye offset.
  17557. * @property [horizontalOrigin = HorizontalOrigin.CENTER] - A Property specifying the {@link HorizontalOrigin}.
  17558. * @property [verticalOrigin = VerticalOrigin.CENTER] - A Property specifying the {@link VerticalOrigin}.
  17559. * @property [heightReference = HeightReference.NONE] - A Property specifying what the height is relative to.
  17560. * @property [color = Color.WHITE] - A Property specifying the tint {@link Color} of the image.
  17561. * @property [rotation = 0] - A numeric Property specifying the rotation about the alignedAxis.
  17562. * @property [alignedAxis = Cartesian3.ZERO] - A {@link Cartesian3} Property specifying the unit vector axis of rotation.
  17563. * @property [sizeInMeters] - A boolean Property specifying whether this billboard's size should be measured in meters.
  17564. * @property [width] - A numeric Property specifying the width of the billboard in pixels, overriding the native size.
  17565. * @property [height] - A numeric Property specifying the height of the billboard in pixels, overriding the native size.
  17566. * @property [scaleByDistance] - A {@link NearFarScalar} Property used to scale the point based on distance from the camera.
  17567. * @property [translucencyByDistance] - A {@link NearFarScalar} Property used to set translucency based on distance from the camera.
  17568. * @property [pixelOffsetScaleByDistance] - A {@link NearFarScalar} Property used to set pixelOffset based on distance from the camera.
  17569. * @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.
  17570. * @property [distanceDisplayCondition] - A Property specifying at what distance from the camera that this billboard will be displayed.
  17571. * @property [disableDepthTestDistance] - A Property specifying the distance from the camera at which to disable the depth test to.
  17572. */
  17573. type ConstructorOptions = {
  17574. show?: Property | boolean;
  17575. image?: Property | string | HTMLCanvasElement;
  17576. scale?: Property | number;
  17577. pixelOffset?: Property | Cartesian2;
  17578. eyeOffset?: Property | Cartesian3;
  17579. horizontalOrigin?: Property | HorizontalOrigin;
  17580. verticalOrigin?: Property | VerticalOrigin;
  17581. heightReference?: Property | HeightReference;
  17582. color?: Property | Color;
  17583. rotation?: Property | number;
  17584. alignedAxis?: Property | Cartesian3;
  17585. sizeInMeters?: Property | boolean;
  17586. width?: Property | number;
  17587. height?: Property | number;
  17588. scaleByDistance?: Property | NearFarScalar;
  17589. translucencyByDistance?: Property | NearFarScalar;
  17590. pixelOffsetScaleByDistance?: Property | NearFarScalar;
  17591. imageSubRegion?: Property | BoundingRectangle;
  17592. distanceDisplayCondition?: Property | DistanceDisplayCondition;
  17593. disableDepthTestDistance?: Property | number;
  17594. };
  17595. }
  17596. /**
  17597. * Describes a two dimensional icon located at the position of the containing {@link Entity}.
  17598. * <p>
  17599. * <div align='center'>
  17600. * <img src='Images/Billboard.png' width='400' height='300' /><br />
  17601. * Example billboards
  17602. * </div>
  17603. * </p>
  17604. * @param [options] - Object describing initialization options
  17605. */
  17606. export class BillboardGraphics {
  17607. constructor(options?: BillboardGraphics.ConstructorOptions);
  17608. /**
  17609. * Gets the event that is raised whenever a property or sub-property is changed or modified.
  17610. */
  17611. readonly definitionChanged: Event;
  17612. /**
  17613. * Gets or sets the boolean Property specifying the visibility of the billboard.
  17614. */
  17615. show: Property | undefined;
  17616. /**
  17617. * Gets or sets the Property specifying the Image, URI, or Canvas to use for the billboard.
  17618. */
  17619. image: Property | undefined;
  17620. /**
  17621. * Gets or sets the numeric Property specifying the uniform scale to apply to the image.
  17622. * A scale greater than <code>1.0</code> enlarges the billboard while a scale less than <code>1.0</code> shrinks it.
  17623. * <p>
  17624. * <div align='center'>
  17625. * <img src='Images/Billboard.setScale.png' width='400' height='300' /><br/>
  17626. * From left to right in the above image, the scales are <code>0.5</code>, <code>1.0</code>, and <code>2.0</code>.
  17627. * </div>
  17628. * </p>
  17629. */
  17630. scale: Property | undefined;
  17631. /**
  17632. * Gets or sets the {@link Cartesian2} Property specifying the billboard's pixel offset in screen space
  17633. * from the origin of this billboard. This is commonly used to align multiple billboards and labels at
  17634. * the same position, e.g., an image and text. The screen space origin is the top, left corner of the
  17635. * canvas; <code>x</code> increases from left to right, and <code>y</code> increases from top to bottom.
  17636. * <p>
  17637. * <div align='center'>
  17638. * <table border='0' cellpadding='5'><tr>
  17639. * <td align='center'><code>default</code><br/><img src='Images/Billboard.setPixelOffset.default.png' width='250' height='188' /></td>
  17640. * <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>
  17641. * </tr></table>
  17642. * The billboard's origin is indicated by the yellow point.
  17643. * </div>
  17644. * </p>
  17645. */
  17646. pixelOffset: Property | undefined;
  17647. /**
  17648. * Gets or sets the {@link Cartesian3} Property specifying the billboard's offset in eye coordinates.
  17649. * Eye coordinates is a left-handed coordinate system, where <code>x</code> points towards the viewer's
  17650. * right, <code>y</code> points up, and <code>z</code> points into the screen.
  17651. * <p>
  17652. * An eye offset is commonly used to arrange multiple billboards or objects at the same position, e.g., to
  17653. * arrange a billboard above its corresponding 3D model.
  17654. * </p>
  17655. * Below, the billboard is positioned at the center of the Earth but an eye offset makes it always
  17656. * appear on top of the Earth regardless of the viewer's or Earth's orientation.
  17657. * <p>
  17658. * <div align='center'>
  17659. * <table border='0' cellpadding='5'><tr>
  17660. * <td align='center'><img src='Images/Billboard.setEyeOffset.one.png' width='250' height='188' /></td>
  17661. * <td align='center'><img src='Images/Billboard.setEyeOffset.two.png' width='250' height='188' /></td>
  17662. * </tr></table>
  17663. * <code>b.eyeOffset = new Cartesian3(0.0, 8000000.0, 0.0);</code>
  17664. * </div>
  17665. * </p>
  17666. */
  17667. eyeOffset: Property | undefined;
  17668. /**
  17669. * Gets or sets the Property specifying the {@link HorizontalOrigin}.
  17670. */
  17671. horizontalOrigin: Property | undefined;
  17672. /**
  17673. * Gets or sets the Property specifying the {@link VerticalOrigin}.
  17674. */
  17675. verticalOrigin: Property | undefined;
  17676. /**
  17677. * Gets or sets the Property specifying the {@link HeightReference}.
  17678. */
  17679. heightReference: Property | undefined;
  17680. /**
  17681. * Gets or sets the Property specifying the {@link Color} that is multiplied with the <code>image</code>.
  17682. * This has two common use cases. First, the same white texture may be used by many different billboards,
  17683. * each with a different color, to create colored billboards. Second, the color's alpha component can be
  17684. * used to make the billboard translucent as shown below. An alpha of <code>0.0</code> makes the billboard
  17685. * transparent, and <code>1.0</code> makes the billboard opaque.
  17686. * <p>
  17687. * <div align='center'>
  17688. * <table border='0' cellpadding='5'><tr>
  17689. * <td align='center'><code>default</code><br/><img src='Images/Billboard.setColor.Alpha255.png' width='250' height='188' /></td>
  17690. * <td align='center'><code>alpha : 0.5</code><br/><img src='Images/Billboard.setColor.Alpha127.png' width='250' height='188' /></td>
  17691. * </tr></table>
  17692. * </div>
  17693. * </p>
  17694. */
  17695. color: Property | undefined;
  17696. /**
  17697. * Gets or sets the numeric Property specifying the rotation of the image
  17698. * counter clockwise from the <code>alignedAxis</code>.
  17699. */
  17700. rotation: Property | undefined;
  17701. /**
  17702. * Gets or sets the {@link Cartesian3} Property specifying the unit vector axis of rotation
  17703. * in the fixed frame. When set to Cartesian3.ZERO the rotation is from the top of the screen.
  17704. */
  17705. alignedAxis: Property | undefined;
  17706. /**
  17707. * Gets or sets the boolean Property specifying if this billboard's size will be measured in meters.
  17708. */
  17709. sizeInMeters: Property | undefined;
  17710. /**
  17711. * Gets or sets the numeric Property specifying the width of the billboard in pixels.
  17712. * When undefined, the native width is used.
  17713. */
  17714. width: Property | undefined;
  17715. /**
  17716. * Gets or sets the numeric Property specifying the height of the billboard in pixels.
  17717. * When undefined, the native height is used.
  17718. */
  17719. height: Property | undefined;
  17720. /**
  17721. * Gets or sets {@link NearFarScalar} Property specifying the scale of the billboard based on the distance from the camera.
  17722. * A billboard's scale will interpolate between the {@link NearFarScalar#nearValue} and
  17723. * {@link NearFarScalar#farValue} while the camera distance falls within the lower and upper bounds
  17724. * of the specified {@link NearFarScalar#near} and {@link NearFarScalar#far}.
  17725. * Outside of these ranges the billboard's scale remains clamped to the nearest bound.
  17726. */
  17727. scaleByDistance: Property | undefined;
  17728. /**
  17729. * Gets or sets {@link NearFarScalar} Property specifying the translucency of the billboard based on the distance from the camera.
  17730. * A billboard's translucency will interpolate between the {@link NearFarScalar#nearValue} and
  17731. * {@link NearFarScalar#farValue} while the camera distance falls within the lower and upper bounds
  17732. * of the specified {@link NearFarScalar#near} and {@link NearFarScalar#far}.
  17733. * Outside of these ranges the billboard's translucency remains clamped to the nearest bound.
  17734. */
  17735. translucencyByDistance: Property | undefined;
  17736. /**
  17737. * Gets or sets {@link NearFarScalar} Property specifying the pixel offset of the billboard based on the distance from the camera.
  17738. * A billboard's pixel offset will interpolate between the {@link NearFarScalar#nearValue} and
  17739. * {@link NearFarScalar#farValue} while the camera distance falls within the lower and upper bounds
  17740. * of the specified {@link NearFarScalar#near} and {@link NearFarScalar#far}.
  17741. * Outside of these ranges the billboard's pixel offset remains clamped to the nearest bound.
  17742. */
  17743. pixelOffsetScaleByDistance: Property | undefined;
  17744. /**
  17745. * Gets or sets the Property specifying a {@link BoundingRectangle} that defines a
  17746. * sub-region of the <code>image</code> to use for the billboard, rather than the entire image,
  17747. * measured in pixels from the bottom-left.
  17748. */
  17749. imageSubRegion: Property | undefined;
  17750. /**
  17751. * Gets or sets the {@link DistanceDisplayCondition} Property specifying at what distance from the camera that this billboard will be displayed.
  17752. */
  17753. distanceDisplayCondition: Property | undefined;
  17754. /**
  17755. * Gets or sets the distance from the camera at which to disable the depth test to, for example, prevent clipping against terrain.
  17756. * When set to zero, the depth test is always applied. When set to Number.POSITIVE_INFINITY, the depth test is never applied.
  17757. */
  17758. disableDepthTestDistance: Property | undefined;
  17759. /**
  17760. * Duplicates this instance.
  17761. * @param [result] - The object onto which to store the result.
  17762. * @returns The modified result parameter or a new instance if one was not provided.
  17763. */
  17764. clone(result?: BillboardGraphics): BillboardGraphics;
  17765. /**
  17766. * Assigns each unassigned property on this object to the value
  17767. * of the same property on the provided source object.
  17768. * @param source - The object to be merged into this object.
  17769. */
  17770. merge(source: BillboardGraphics): void;
  17771. }
  17772. /**
  17773. * A {@link Visualizer} which maps {@link Entity#billboard} to a {@link Billboard}.
  17774. * @param entityCluster - The entity cluster to manage the collection of billboards and optionally cluster with other entities.
  17775. * @param entityCollection - The entityCollection to visualize.
  17776. */
  17777. export class BillboardVisualizer {
  17778. constructor(entityCluster: EntityCluster, entityCollection: EntityCollection);
  17779. /**
  17780. * Updates the primitives created by this visualizer to match their
  17781. * Entity counterpart at the given time.
  17782. * @param time - The time to update to.
  17783. * @returns This function always returns true.
  17784. */
  17785. update(time: JulianDate): boolean;
  17786. /**
  17787. * Returns true if this object was destroyed; otherwise, false.
  17788. * @returns True if this object was destroyed; otherwise, false.
  17789. */
  17790. isDestroyed(): boolean;
  17791. /**
  17792. * Removes and destroys all primitives created by this instance.
  17793. */
  17794. destroy(): void;
  17795. }
  17796. /**
  17797. * A {@link GeometryUpdater} for boxes.
  17798. * Clients do not normally create this class directly, but instead rely on {@link DataSourceDisplay}.
  17799. * @param entity - The entity containing the geometry to be visualized.
  17800. * @param scene - The scene where visualization is taking place.
  17801. */
  17802. export class BoxGeometryUpdater {
  17803. constructor(entity: Entity, scene: Scene);
  17804. /**
  17805. * Creates the geometry instance which represents the fill of the geometry.
  17806. * @param time - The time to use when retrieving initial attribute values.
  17807. * @returns The geometry instance representing the filled portion of the geometry.
  17808. */
  17809. createFillGeometryInstance(time: JulianDate): GeometryInstance;
  17810. /**
  17811. * Creates the geometry instance which represents the outline of the geometry.
  17812. * @param time - The time to use when retrieving initial attribute values.
  17813. * @returns The geometry instance representing the outline portion of the geometry.
  17814. */
  17815. createOutlineGeometryInstance(time: JulianDate): GeometryInstance;
  17816. }
  17817. export namespace BoxGraphics {
  17818. /**
  17819. * Initialization options for the BoxGraphics constructor
  17820. * @property [show = true] - A boolean Property specifying the visibility of the box.
  17821. * @property [dimensions] - A {@link Cartesian3} Property specifying the length, width, and height of the box.
  17822. * @property [heightReference = HeightReference.NONE] - A Property specifying what the height from the entity position is relative to.
  17823. * @property [fill = true] - A boolean Property specifying whether the box is filled with the provided material.
  17824. * @property [material = Color.WHITE] - A Property specifying the material used to fill the box.
  17825. * @property [outline = false] - A boolean Property specifying whether the box is outlined.
  17826. * @property [outlineColor = Color.BLACK] - A Property specifying the {@link Color} of the outline.
  17827. * @property [outlineWidth = 1.0] - A numeric Property specifying the width of the outline.
  17828. * @property [shadows = ShadowMode.DISABLED] - An enum Property specifying whether the box casts or receives shadows from light sources.
  17829. * @property [distanceDisplayCondition] - A Property specifying at what distance from the camera that this box will be displayed.
  17830. */
  17831. type ConstructorOptions = {
  17832. show?: Property | boolean;
  17833. dimensions?: Property | Cartesian3;
  17834. heightReference?: Property | HeightReference;
  17835. fill?: Property | boolean;
  17836. material?: MaterialProperty | Color;
  17837. outline?: Property | boolean;
  17838. outlineColor?: Property | Color;
  17839. outlineWidth?: Property | number;
  17840. shadows?: Property | ShadowMode;
  17841. distanceDisplayCondition?: Property | DistanceDisplayCondition;
  17842. };
  17843. }
  17844. /**
  17845. * Describes a box. The center position and orientation are determined by the containing {@link Entity}.
  17846. * @param [options] - Object describing initialization options
  17847. */
  17848. export class BoxGraphics {
  17849. constructor(options?: BoxGraphics.ConstructorOptions);
  17850. /**
  17851. * Gets the event that is raised whenever a property or sub-property is changed or modified.
  17852. */
  17853. readonly definitionChanged: Event;
  17854. /**
  17855. * Gets or sets the boolean Property specifying the visibility of the box.
  17856. */
  17857. show: Property | undefined;
  17858. /**
  17859. * Gets or sets {@link Cartesian3} Property property specifying the length, width, and height of the box.
  17860. */
  17861. dimensions: Property | undefined;
  17862. /**
  17863. * Gets or sets the Property specifying the {@link HeightReference}.
  17864. */
  17865. heightReference: Property | undefined;
  17866. /**
  17867. * Gets or sets the boolean Property specifying whether the box is filled with the provided material.
  17868. */
  17869. fill: Property | undefined;
  17870. /**
  17871. * Gets or sets the material used to fill the box.
  17872. */
  17873. material: MaterialProperty | undefined;
  17874. /**
  17875. * Gets or sets the Property specifying whether the box is outlined.
  17876. */
  17877. outline: Property | undefined;
  17878. /**
  17879. * Gets or sets the Property specifying the {@link Color} of the outline.
  17880. */
  17881. outlineColor: Property | undefined;
  17882. /**
  17883. * Gets or sets the numeric Property specifying the width of the outline.
  17884. */
  17885. outlineWidth: Property | undefined;
  17886. /**
  17887. * Get or sets the enum Property specifying whether the box
  17888. * casts or receives shadows from light sources.
  17889. */
  17890. shadows: Property | undefined;
  17891. /**
  17892. * Gets or sets the {@link DistanceDisplayCondition} Property specifying at what distance from the camera that this box will be displayed.
  17893. */
  17894. distanceDisplayCondition: Property | undefined;
  17895. /**
  17896. * Duplicates this instance.
  17897. * @param [result] - The object onto which to store the result.
  17898. * @returns The modified result parameter or a new instance if one was not provided.
  17899. */
  17900. clone(result?: BoxGraphics): BoxGraphics;
  17901. /**
  17902. * Assigns each unassigned property on this object to the value
  17903. * of the same property on the provided source object.
  17904. * @param source - The object to be merged into this object.
  17905. */
  17906. merge(source: BoxGraphics): void;
  17907. }
  17908. /**
  17909. * A {@link Property} whose value is lazily evaluated by a callback function.
  17910. * @param callback - The function to be called when the property is evaluated.
  17911. * @param isConstant - <code>true</code> when the callback function returns the same value every time, <code>false</code> if the value will change.
  17912. */
  17913. export class CallbackProperty {
  17914. constructor(callback: CallbackProperty.Callback, isConstant: boolean);
  17915. /**
  17916. * Gets a value indicating if this property is constant.
  17917. */
  17918. readonly isConstant: boolean;
  17919. /**
  17920. * Gets the event that is raised whenever the definition of this property changes.
  17921. * The definition is changed whenever setCallback is called.
  17922. */
  17923. readonly definitionChanged: Event;
  17924. /**
  17925. * Gets the value of the property.
  17926. * @param [time] - The time for which to retrieve the value. This parameter is unused since the value does not change with respect to time.
  17927. * @param [result] - The object to store the value into, if omitted, a new instance is created and returned.
  17928. * @returns The modified result parameter or a new instance if the result parameter was not supplied or is unsupported.
  17929. */
  17930. getValue(time?: JulianDate, result?: any): any;
  17931. /**
  17932. * Sets the callback to be used.
  17933. * @param callback - The function to be called when the property is evaluated.
  17934. * @param isConstant - <code>true</code> when the callback function returns the same value every time, <code>false</code> if the value will change.
  17935. */
  17936. setCallback(callback: CallbackProperty.Callback, isConstant: boolean): void;
  17937. /**
  17938. * Compares this property to the provided property and returns
  17939. * <code>true</code> if they are equal, <code>false</code> otherwise.
  17940. * @param [other] - The other property.
  17941. * @returns <code>true</code> if left and right are equal, <code>false</code> otherwise.
  17942. */
  17943. equals(other?: Property): boolean;
  17944. }
  17945. export namespace CallbackProperty {
  17946. /**
  17947. * A function that returns the value of the property.
  17948. * @param [time] - The time for which to retrieve the value.
  17949. * @param [result] - The object to store the value into, if omitted, a new instance is created and returned.
  17950. */
  17951. type Callback = (time?: JulianDate, result?: any) => any;
  17952. }
  17953. export namespace Cesium3DTilesetGraphics {
  17954. /**
  17955. * Initialization options for the Cesium3DTilesetGraphics constructor
  17956. * @property [show = true] - A boolean Property specifying the visibility of the tileset.
  17957. * @property [uri] - A string or Resource Property specifying the URI of the tileset.
  17958. * @property [maximumScreenSpaceError] - A number or Property specifying the maximum screen space error used to drive level of detail refinement.
  17959. */
  17960. type ConstructorOptions = {
  17961. show?: Property | boolean;
  17962. uri?: Property | string | Resource;
  17963. maximumScreenSpaceError?: Property | number;
  17964. };
  17965. }
  17966. /**
  17967. * A 3D Tiles tileset represented by an {@link Entity}.
  17968. * The tileset modelMatrix is determined by the containing Entity position and orientation
  17969. * or is left unset if position is undefined.
  17970. * @param [options] - Object describing initialization options
  17971. */
  17972. export class Cesium3DTilesetGraphics {
  17973. constructor(options?: Cesium3DTilesetGraphics.ConstructorOptions);
  17974. /**
  17975. * Gets the event that is raised whenever a property or sub-property is changed or modified.
  17976. */
  17977. readonly definitionChanged: Event;
  17978. /**
  17979. * Gets or sets the boolean Property specifying the visibility of the model.
  17980. */
  17981. show: Property | undefined;
  17982. /**
  17983. * Gets or sets the string Property specifying the URI of the glTF asset.
  17984. */
  17985. uri: Property | undefined;
  17986. /**
  17987. * Gets or sets the maximum screen space error used to drive level of detail refinement.
  17988. */
  17989. maximumScreenSpaceError: Property | undefined;
  17990. /**
  17991. * Duplicates this instance.
  17992. * @param [result] - The object onto which to store the result.
  17993. * @returns The modified result parameter or a new instance if one was not provided.
  17994. */
  17995. clone(result?: Cesium3DTilesetGraphics): Cesium3DTilesetGraphics;
  17996. /**
  17997. * Assigns each unassigned property on this object to the value
  17998. * of the same property on the provided source object.
  17999. * @param source - The object to be merged into this object.
  18000. */
  18001. merge(source: Cesium3DTilesetGraphics): void;
  18002. }
  18003. /**
  18004. * A {@link Visualizer} which maps {@link Entity#tileset} to a {@link Cesium3DTileset}.
  18005. * @param scene - The scene the primitives will be rendered in.
  18006. * @param entityCollection - The entityCollection to visualize.
  18007. */
  18008. export class Cesium3DTilesetVisualizer {
  18009. constructor(scene: Scene, entityCollection: EntityCollection);
  18010. /**
  18011. * Updates models created this visualizer to match their
  18012. * Entity counterpart at the given time.
  18013. * @param time - The time to update to.
  18014. * @returns This function always returns true.
  18015. */
  18016. update(time: JulianDate): boolean;
  18017. /**
  18018. * Returns true if this object was destroyed; otherwise, false.
  18019. * @returns True if this object was destroyed; otherwise, false.
  18020. */
  18021. isDestroyed(): boolean;
  18022. /**
  18023. * Removes and destroys all primitives created by this instance.
  18024. */
  18025. destroy(): void;
  18026. }
  18027. /**
  18028. * A {@link MaterialProperty} that maps to checkerboard {@link Material} uniforms.
  18029. * @param [options] - Object with the following properties:
  18030. * @param [options.evenColor = Color.WHITE] - A Property specifying the first {@link Color}.
  18031. * @param [options.oddColor = Color.BLACK] - A Property specifying the second {@link Color}.
  18032. * @param [options.repeat = new Cartesian2(2.0, 2.0)] - A {@link Cartesian2} Property specifying how many times the tiles repeat in each direction.
  18033. */
  18034. export class CheckerboardMaterialProperty {
  18035. constructor(options?: {
  18036. evenColor?: Property | Color;
  18037. oddColor?: Property | Color;
  18038. repeat?: Property | Cartesian2;
  18039. });
  18040. /**
  18041. * Gets a value indicating if this property is constant. A property is considered
  18042. * constant if getValue always returns the same result for the current definition.
  18043. */
  18044. readonly isConstant: boolean;
  18045. /**
  18046. * Gets the event that is raised whenever the definition of this property changes.
  18047. * The definition is considered to have changed if a call to getValue would return
  18048. * a different result for the same time.
  18049. */
  18050. readonly definitionChanged: Event;
  18051. /**
  18052. * Gets or sets the Property specifying the first {@link Color}.
  18053. */
  18054. evenColor: Property | undefined;
  18055. /**
  18056. * Gets or sets the Property specifying the second {@link Color}.
  18057. */
  18058. oddColor: Property | undefined;
  18059. /**
  18060. * Gets or sets the {@link Cartesian2} Property specifying how many times the tiles repeat in each direction.
  18061. */
  18062. repeat: Property | undefined;
  18063. /**
  18064. * Gets the {@link Material} type at the provided time.
  18065. * @param time - The time for which to retrieve the type.
  18066. * @returns The type of material.
  18067. */
  18068. getType(time: JulianDate): string;
  18069. /**
  18070. * Gets the value of the property at the provided time.
  18071. * @param time - The time for which to retrieve the value.
  18072. * @param [result] - The object to store the value into, if omitted, a new instance is created and returned.
  18073. * @returns The modified result parameter or a new instance if the result parameter was not supplied.
  18074. */
  18075. getValue(time: JulianDate, result?: any): any;
  18076. /**
  18077. * Compares this property to the provided property and returns
  18078. * <code>true</code> if they are equal, <code>false</code> otherwise.
  18079. * @param [other] - The other property.
  18080. * @returns <code>true</code> if left and right are equal, <code>false</code> otherwise.
  18081. */
  18082. equals(other?: Property): boolean;
  18083. }
  18084. /**
  18085. * A {@link MaterialProperty} that maps to solid color {@link Material} uniforms.
  18086. * @param [color = Color.WHITE] - The {@link Color} Property to be used.
  18087. */
  18088. export class ColorMaterialProperty {
  18089. constructor(color?: Property | Color);
  18090. /**
  18091. * Gets a value indicating if this property is constant. A property is considered
  18092. * constant if getValue always returns the same result for the current definition.
  18093. */
  18094. readonly isConstant: boolean;
  18095. /**
  18096. * Gets the event that is raised whenever the definition of this property changes.
  18097. * The definition is considered to have changed if a call to getValue would return
  18098. * a different result for the same time.
  18099. */
  18100. readonly definitionChanged: Event;
  18101. /**
  18102. * Gets or sets the {@link Color} {@link Property}.
  18103. */
  18104. color: Property | undefined;
  18105. /**
  18106. * Gets the {@link Material} type at the provided time.
  18107. * @param time - The time for which to retrieve the type.
  18108. * @returns The type of material.
  18109. */
  18110. getType(time: JulianDate): string;
  18111. /**
  18112. * Gets the value of the property at the provided time.
  18113. * @param time - The time for which to retrieve the value.
  18114. * @param [result] - The object to store the value into, if omitted, a new instance is created and returned.
  18115. * @returns The modified result parameter or a new instance if the result parameter was not supplied.
  18116. */
  18117. getValue(time: JulianDate, result?: any): any;
  18118. /**
  18119. * Compares this property to the provided property and returns
  18120. * <code>true</code> if they are equal, <code>false</code> otherwise.
  18121. * @param [other] - The other property.
  18122. * @returns <code>true</code> if left and right are equal, <code>false</code> otherwise.
  18123. */
  18124. equals(other?: Property): boolean;
  18125. }
  18126. /**
  18127. * Non-destructively composites multiple {@link EntityCollection} instances into a single collection.
  18128. * If a Entity with the same ID exists in multiple collections, it is non-destructively
  18129. * merged into a single new entity instance. If an entity has the same property in multiple
  18130. * collections, the property of the Entity in the last collection of the list it
  18131. * belongs to is used. CompositeEntityCollection can be used almost anywhere that a
  18132. * EntityCollection is used.
  18133. * @param [collections] - The initial list of EntityCollection instances to merge.
  18134. * @param [owner] - The data source (or composite entity collection) which created this collection.
  18135. */
  18136. export class CompositeEntityCollection {
  18137. constructor(collections?: EntityCollection[], owner?: DataSource | CompositeEntityCollection);
  18138. /**
  18139. * Gets the event that is fired when entities are added or removed from the collection.
  18140. * The generated event is a {@link EntityCollection.collectionChangedEventCallback}.
  18141. */
  18142. readonly collectionChanged: Event;
  18143. /**
  18144. * Gets a globally unique identifier for this collection.
  18145. */
  18146. readonly id: string;
  18147. /**
  18148. * Gets the array of Entity instances in the collection.
  18149. * This array should not be modified directly.
  18150. */
  18151. readonly values: Entity[];
  18152. /**
  18153. * Gets the owner of this composite entity collection, ie. the data source or composite entity collection which created it.
  18154. */
  18155. readonly owner: DataSource | CompositeEntityCollection;
  18156. /**
  18157. * Adds a collection to the composite.
  18158. * @param collection - the collection to add.
  18159. * @param [index] - the index to add the collection at. If omitted, the collection will
  18160. * added on top of all existing collections.
  18161. */
  18162. addCollection(collection: EntityCollection, index?: number): void;
  18163. /**
  18164. * Removes a collection from this composite, if present.
  18165. * @param collection - The collection to remove.
  18166. * @returns true if the collection was in the composite and was removed,
  18167. * false if the collection was not in the composite.
  18168. */
  18169. removeCollection(collection: EntityCollection): boolean;
  18170. /**
  18171. * Removes all collections from this composite.
  18172. */
  18173. removeAllCollections(): void;
  18174. /**
  18175. * Checks to see if the composite contains a given collection.
  18176. * @param collection - the collection to check for.
  18177. * @returns true if the composite contains the collection, false otherwise.
  18178. */
  18179. containsCollection(collection: EntityCollection): boolean;
  18180. /**
  18181. * Returns true if the provided entity is in this collection, false otherwise.
  18182. * @param entity - The entity.
  18183. * @returns true if the provided entity is in this collection, false otherwise.
  18184. */
  18185. contains(entity: Entity): boolean;
  18186. /**
  18187. * Determines the index of a given collection in the composite.
  18188. * @param collection - The collection to find the index of.
  18189. * @returns The index of the collection in the composite, or -1 if the collection does not exist in the composite.
  18190. */
  18191. indexOfCollection(collection: EntityCollection): number;
  18192. /**
  18193. * Gets a collection by index from the composite.
  18194. * @param index - the index to retrieve.
  18195. */
  18196. getCollection(index: number): void;
  18197. /**
  18198. * Gets the number of collections in this composite.
  18199. */
  18200. getCollectionsLength(): void;
  18201. /**
  18202. * Raises a collection up one position in the composite.
  18203. * @param collection - the collection to move.
  18204. */
  18205. raiseCollection(collection: EntityCollection): void;
  18206. /**
  18207. * Lowers a collection down one position in the composite.
  18208. * @param collection - the collection to move.
  18209. */
  18210. lowerCollection(collection: EntityCollection): void;
  18211. /**
  18212. * Raises a collection to the top of the composite.
  18213. * @param collection - the collection to move.
  18214. */
  18215. raiseCollectionToTop(collection: EntityCollection): void;
  18216. /**
  18217. * Lowers a collection to the bottom of the composite.
  18218. * @param collection - the collection to move.
  18219. */
  18220. lowerCollectionToBottom(collection: EntityCollection): void;
  18221. /**
  18222. * Prevents {@link EntityCollection#collectionChanged} events from being raised
  18223. * until a corresponding call is made to {@link EntityCollection#resumeEvents}, at which
  18224. * point a single event will be raised that covers all suspended operations.
  18225. * This allows for many items to be added and removed efficiently.
  18226. * While events are suspended, recompositing of the collections will
  18227. * also be suspended, as this can be a costly operation.
  18228. * This function can be safely called multiple times as long as there
  18229. * are corresponding calls to {@link EntityCollection#resumeEvents}.
  18230. */
  18231. suspendEvents(): void;
  18232. /**
  18233. * Resumes raising {@link EntityCollection#collectionChanged} events immediately
  18234. * when an item is added or removed. Any modifications made while while events were suspended
  18235. * will be triggered as a single event when this function is called. This function also ensures
  18236. * the collection is recomposited if events are also resumed.
  18237. * This function is reference counted and can safely be called multiple times as long as there
  18238. * are corresponding calls to {@link EntityCollection#resumeEvents}.
  18239. */
  18240. resumeEvents(): void;
  18241. /**
  18242. * Computes the maximum availability of the entities in the collection.
  18243. * If the collection contains a mix of infinitely available data and non-infinite data,
  18244. * It will return the interval pertaining to the non-infinite data only. If all
  18245. * data is infinite, an infinite interval will be returned.
  18246. * @returns The availability of entities in the collection.
  18247. */
  18248. computeAvailability(): TimeInterval;
  18249. /**
  18250. * Gets an entity with the specified id.
  18251. * @param id - The id of the entity to retrieve.
  18252. * @returns The entity with the provided id or undefined if the id did not exist in the collection.
  18253. */
  18254. getById(id: string): Entity | undefined;
  18255. }
  18256. /**
  18257. * A {@link CompositeProperty} which is also a {@link MaterialProperty}.
  18258. */
  18259. export class CompositeMaterialProperty {
  18260. constructor();
  18261. /**
  18262. * Gets a value indicating if this property is constant. A property is considered
  18263. * constant if getValue always returns the same result for the current definition.
  18264. */
  18265. readonly isConstant: boolean;
  18266. /**
  18267. * Gets the event that is raised whenever the definition of this property changes.
  18268. * The definition is changed whenever setValue is called with data different
  18269. * than the current value.
  18270. */
  18271. readonly definitionChanged: Event;
  18272. /**
  18273. * Gets the interval collection.
  18274. */
  18275. intervals: TimeIntervalCollection;
  18276. /**
  18277. * Gets the {@link Material} type at the provided time.
  18278. * @param time - The time for which to retrieve the type.
  18279. * @returns The type of material.
  18280. */
  18281. getType(time: JulianDate): string;
  18282. /**
  18283. * Gets the value of the property at the provided time.
  18284. * @param time - The time for which to retrieve the value.
  18285. * @param [result] - The object to store the value into, if omitted, a new instance is created and returned.
  18286. * @returns The modified result parameter or a new instance if the result parameter was not supplied.
  18287. */
  18288. getValue(time: JulianDate, result?: any): any;
  18289. /**
  18290. * Compares this property to the provided property and returns
  18291. * <code>true</code> if they are equal, <code>false</code> otherwise.
  18292. * @param [other] - The other property.
  18293. * @returns <code>true</code> if left and right are equal, <code>false</code> otherwise.
  18294. */
  18295. equals(other?: Property): boolean;
  18296. }
  18297. /**
  18298. * A {@link CompositeProperty} which is also a {@link PositionProperty}.
  18299. * @param [referenceFrame = ReferenceFrame.FIXED] - The reference frame in which the position is defined.
  18300. */
  18301. export class CompositePositionProperty {
  18302. constructor(referenceFrame?: ReferenceFrame);
  18303. /**
  18304. * Gets a value indicating if this property is constant. A property is considered
  18305. * constant if getValue always returns the same result for the current definition.
  18306. */
  18307. readonly isConstant: boolean;
  18308. /**
  18309. * Gets the event that is raised whenever the definition of this property changes.
  18310. * The definition is changed whenever setValue is called with data different
  18311. * than the current value.
  18312. */
  18313. readonly definitionChanged: Event;
  18314. /**
  18315. * Gets the interval collection.
  18316. */
  18317. intervals: TimeIntervalCollection;
  18318. /**
  18319. * Gets or sets the reference frame which this position presents itself as.
  18320. * Each PositionProperty making up this object has it's own reference frame,
  18321. * so this property merely exposes a "preferred" reference frame for clients
  18322. * to use.
  18323. */
  18324. referenceFrame: ReferenceFrame;
  18325. /**
  18326. * Gets the value of the property at the provided time in the fixed frame.
  18327. * @param time - The time for which to retrieve the value.
  18328. * @param [result] - The object to store the value into, if omitted, a new instance is created and returned.
  18329. * @returns The modified result parameter or a new instance if the result parameter was not supplied.
  18330. */
  18331. getValue(time: JulianDate, result?: any): any;
  18332. /**
  18333. * Gets the value of the property at the provided time and in the provided reference frame.
  18334. * @param time - The time for which to retrieve the value.
  18335. * @param referenceFrame - The desired referenceFrame of the result.
  18336. * @param [result] - The object to store the value into, if omitted, a new instance is created and returned.
  18337. * @returns The modified result parameter or a new instance if the result parameter was not supplied.
  18338. */
  18339. getValueInReferenceFrame(time: JulianDate, referenceFrame: ReferenceFrame, result?: Cartesian3): Cartesian3;
  18340. /**
  18341. * Compares this property to the provided property and returns
  18342. * <code>true</code> if they are equal, <code>false</code> otherwise.
  18343. * @param [other] - The other property.
  18344. * @returns <code>true</code> if left and right are equal, <code>false</code> otherwise.
  18345. */
  18346. equals(other?: Property): boolean;
  18347. }
  18348. /**
  18349. * A {@link Property} which is defined by a {@link TimeIntervalCollection}, where the
  18350. * data property of each {@link TimeInterval} is another Property instance which is
  18351. * evaluated at the provided time.
  18352. * @example
  18353. * var constantProperty = ...;
  18354. * var sampledProperty = ...;
  18355. *
  18356. * //Create a composite property from two previously defined properties
  18357. * //where the property is valid on August 1st, 2012 and uses a constant
  18358. * //property for the first half of the day and a sampled property for the
  18359. * //remaining half.
  18360. * var composite = new Cesium.CompositeProperty();
  18361. * composite.intervals.addInterval(Cesium.TimeInterval.fromIso8601({
  18362. * iso8601 : '2012-08-01T00:00:00.00Z/2012-08-01T12:00:00.00Z',
  18363. * data : constantProperty
  18364. * }));
  18365. * composite.intervals.addInterval(Cesium.TimeInterval.fromIso8601({
  18366. * iso8601 : '2012-08-01T12:00:00.00Z/2012-08-02T00:00:00.00Z',
  18367. * isStartIncluded : false,
  18368. * isStopIncluded : false,
  18369. * data : sampledProperty
  18370. * }));
  18371. */
  18372. export class CompositeProperty {
  18373. constructor();
  18374. /**
  18375. * Gets a value indicating if this property is constant. A property is considered
  18376. * constant if getValue always returns the same result for the current definition.
  18377. */
  18378. readonly isConstant: boolean;
  18379. /**
  18380. * Gets the event that is raised whenever the definition of this property changes.
  18381. * The definition is changed whenever setValue is called with data different
  18382. * than the current value.
  18383. */
  18384. readonly definitionChanged: Event;
  18385. /**
  18386. * Gets the interval collection.
  18387. */
  18388. intervals: TimeIntervalCollection;
  18389. /**
  18390. * Gets the value of the property at the provided time.
  18391. * @param time - The time for which to retrieve the value.
  18392. * @param [result] - The object to store the value into, if omitted, a new instance is created and returned.
  18393. * @returns The modified result parameter or a new instance if the result parameter was not supplied.
  18394. */
  18395. getValue(time: JulianDate, result?: any): any;
  18396. /**
  18397. * Compares this property to the provided property and returns
  18398. * <code>true</code> if they are equal, <code>false</code> otherwise.
  18399. * @param [other] - The other property.
  18400. * @returns <code>true</code> if left and right are equal, <code>false</code> otherwise.
  18401. */
  18402. equals(other?: Property): boolean;
  18403. }
  18404. /**
  18405. * A {@link PositionProperty} whose value does not change in respect to the
  18406. * {@link ReferenceFrame} in which is it defined.
  18407. * @param [value] - The property value.
  18408. * @param [referenceFrame = ReferenceFrame.FIXED] - The reference frame in which the position is defined.
  18409. */
  18410. export class ConstantPositionProperty {
  18411. constructor(value?: Cartesian3, referenceFrame?: ReferenceFrame);
  18412. /**
  18413. * Gets a value indicating if this property is constant. A property is considered
  18414. * constant if getValue always returns the same result for the current definition.
  18415. */
  18416. readonly isConstant: boolean;
  18417. /**
  18418. * Gets the event that is raised whenever the definition of this property changes.
  18419. * The definition is considered to have changed if a call to getValue would return
  18420. * a different result for the same time.
  18421. */
  18422. readonly definitionChanged: Event;
  18423. /**
  18424. * Gets the reference frame in which the position is defined.
  18425. */
  18426. referenceFrame: ReferenceFrame;
  18427. /**
  18428. * Gets the value of the property at the provided time in the fixed frame.
  18429. * @param time - The time for which to retrieve the value.
  18430. * @param [result] - The object to store the value into, if omitted, a new instance is created and returned.
  18431. * @returns The modified result parameter or a new instance if the result parameter was not supplied.
  18432. */
  18433. getValue(time: JulianDate, result?: any): any;
  18434. /**
  18435. * Sets the value of the property.
  18436. * @param value - The property value.
  18437. * @param [referenceFrame = this.referenceFrame] - The reference frame in which the position is defined.
  18438. */
  18439. setValue(value: Cartesian3, referenceFrame?: ReferenceFrame): void;
  18440. /**
  18441. * Gets the value of the property at the provided time and in the provided reference frame.
  18442. * @param time - The time for which to retrieve the value.
  18443. * @param referenceFrame - The desired referenceFrame of the result.
  18444. * @param [result] - The object to store the value into, if omitted, a new instance is created and returned.
  18445. * @returns The modified result parameter or a new instance if the result parameter was not supplied.
  18446. */
  18447. getValueInReferenceFrame(time: JulianDate, referenceFrame: ReferenceFrame, result?: Cartesian3): Cartesian3;
  18448. /**
  18449. * Compares this property to the provided property and returns
  18450. * <code>true</code> if they are equal, <code>false</code> otherwise.
  18451. * @param [other] - The other property.
  18452. * @returns <code>true</code> if left and right are equal, <code>false</code> otherwise.
  18453. */
  18454. equals(other?: Property): boolean;
  18455. }
  18456. /**
  18457. * A {@link Property} whose value does not change with respect to simulation time.
  18458. * @param [value] - The property value.
  18459. */
  18460. export class ConstantProperty {
  18461. constructor(value?: any);
  18462. /**
  18463. * Gets a value indicating if this property is constant.
  18464. * This property always returns <code>true</code>.
  18465. */
  18466. readonly isConstant: boolean;
  18467. /**
  18468. * Gets the event that is raised whenever the definition of this property changes.
  18469. * The definition is changed whenever setValue is called with data different
  18470. * than the current value.
  18471. */
  18472. readonly definitionChanged: Event;
  18473. /**
  18474. * Gets the value of the property.
  18475. * @param [time] - The time for which to retrieve the value. This parameter is unused since the value does not change with respect to time.
  18476. * @param [result] - The object to store the value into, if omitted, a new instance is created and returned.
  18477. * @returns The modified result parameter or a new instance if the result parameter was not supplied.
  18478. */
  18479. getValue(time?: JulianDate, result?: any): any;
  18480. /**
  18481. * Sets the value of the property.
  18482. * @param value - The property value.
  18483. */
  18484. setValue(value: any): void;
  18485. /**
  18486. * Compares this property to the provided property and returns
  18487. * <code>true</code> if they are equal, <code>false</code> otherwise.
  18488. * @param [other] - The other property.
  18489. * @returns <code>true</code> if left and right are equal, <code>false</code> otherwise.
  18490. */
  18491. equals(other?: Property): boolean;
  18492. /**
  18493. * Gets this property's value.
  18494. * @returns This property's value.
  18495. */
  18496. valueOf(): any;
  18497. /**
  18498. * Creates a string representing this property's value.
  18499. * @returns A string representing the property's value.
  18500. */
  18501. toString(): string;
  18502. }
  18503. /**
  18504. * A {@link GeometryUpdater} for corridors.
  18505. * Clients do not normally create this class directly, but instead rely on {@link DataSourceDisplay}.
  18506. * @param entity - The entity containing the geometry to be visualized.
  18507. * @param scene - The scene where visualization is taking place.
  18508. */
  18509. export class CorridorGeometryUpdater {
  18510. constructor(entity: Entity, scene: Scene);
  18511. /**
  18512. * Creates the geometry instance which represents the fill of the geometry.
  18513. * @param time - The time to use when retrieving initial attribute values.
  18514. * @returns The geometry instance representing the filled portion of the geometry.
  18515. */
  18516. createFillGeometryInstance(time: JulianDate): GeometryInstance;
  18517. /**
  18518. * Creates the geometry instance which represents the outline of the geometry.
  18519. * @param time - The time to use when retrieving initial attribute values.
  18520. * @returns The geometry instance representing the outline portion of the geometry.
  18521. */
  18522. createOutlineGeometryInstance(time: JulianDate): GeometryInstance;
  18523. }
  18524. export namespace CorridorGraphics {
  18525. /**
  18526. * Initialization options for the CorridorGraphics constructor
  18527. * @property [show = true] - A boolean Property specifying the visibility of the corridor.
  18528. * @property [positions] - A Property specifying the array of {@link Cartesian3} positions that define the centerline of the corridor.
  18529. * @property [width] - A numeric Property specifying the distance between the edges of the corridor.
  18530. * @property [height = 0] - A numeric Property specifying the altitude of the corridor relative to the ellipsoid surface.
  18531. * @property [heightReference = HeightReference.NONE] - A Property specifying what the height is relative to.
  18532. * @property [extrudedHeight] - A numeric Property specifying the altitude of the corridor's extruded face relative to the ellipsoid surface.
  18533. * @property [extrudedHeightReference = HeightReference.NONE] - A Property specifying what the extrudedHeight is relative to.
  18534. * @property [cornerType = CornerType.ROUNDED] - A {@link CornerType} Property specifying the style of the corners.
  18535. * @property [granularity = Cesium.Math.RADIANS_PER_DEGREE] - A numeric Property specifying the distance between each latitude and longitude.
  18536. * @property [fill = true] - A boolean Property specifying whether the corridor is filled with the provided material.
  18537. * @property [material = Color.WHITE] - A Property specifying the material used to fill the corridor.
  18538. * @property [outline = false] - A boolean Property specifying whether the corridor is outlined.
  18539. * @property [outlineColor = Color.BLACK] - A Property specifying the {@link Color} of the outline.
  18540. * @property [outlineWidth = 1.0] - A numeric Property specifying the width of the outline.
  18541. * @property [shadows = ShadowMode.DISABLED] - An enum Property specifying whether the corridor casts or receives shadows from light sources.
  18542. * @property [distanceDisplayCondition] - A Property specifying at what distance from the camera that this corridor will be displayed.
  18543. * @property [classificationType = ClassificationType.BOTH] - An enum Property specifying whether this corridor will classify terrain, 3D Tiles, or both when on the ground.
  18544. * @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.
  18545. */
  18546. type ConstructorOptions = {
  18547. show?: Property | boolean;
  18548. positions?: Property | Cartesian3;
  18549. width?: Property | number;
  18550. height?: Property | number;
  18551. heightReference?: Property | HeightReference;
  18552. extrudedHeight?: Property | number;
  18553. extrudedHeightReference?: Property | HeightReference;
  18554. cornerType?: Property | CornerType;
  18555. granularity?: Property | number;
  18556. fill?: Property | boolean;
  18557. material?: MaterialProperty | Color;
  18558. outline?: Property | boolean;
  18559. outlineColor?: Property | Color;
  18560. outlineWidth?: Property | number;
  18561. shadows?: Property | ShadowMode;
  18562. distanceDisplayCondition?: Property | DistanceDisplayCondition;
  18563. classificationType?: Property | ClassificationType;
  18564. zIndex?: ConstantProperty | number;
  18565. };
  18566. }
  18567. /**
  18568. * Describes a corridor, which is a shape defined by a centerline and width that
  18569. * conforms to the curvature of the globe. It can be placed on the surface or at altitude
  18570. * and can optionally be extruded into a volume.
  18571. * @param [options] - Object describing initialization options
  18572. */
  18573. export class CorridorGraphics {
  18574. constructor(options?: CorridorGraphics.ConstructorOptions);
  18575. /**
  18576. * Gets the event that is raised whenever a property or sub-property is changed or modified.
  18577. */
  18578. readonly definitionChanged: Event;
  18579. /**
  18580. * Gets or sets the boolean Property specifying the visibility of the corridor.
  18581. */
  18582. show: Property | undefined;
  18583. /**
  18584. * Gets or sets a Property specifying the array of {@link Cartesian3} positions that define the centerline of the corridor.
  18585. */
  18586. positions: Property | undefined;
  18587. /**
  18588. * Gets or sets the numeric Property specifying the width of the corridor.
  18589. */
  18590. width: Property | undefined;
  18591. /**
  18592. * Gets or sets the numeric Property specifying the altitude of the corridor.
  18593. */
  18594. height: Property | undefined;
  18595. /**
  18596. * Gets or sets the Property specifying the {@link HeightReference}.
  18597. */
  18598. heightReference: Property | undefined;
  18599. /**
  18600. * Gets or sets the numeric Property specifying the altitude of the corridor extrusion.
  18601. * Setting this property creates a corridor shaped volume starting at height and ending
  18602. * at this altitude.
  18603. */
  18604. extrudedHeight: Property | undefined;
  18605. /**
  18606. * Gets or sets the Property specifying the extruded {@link HeightReference}.
  18607. */
  18608. extrudedHeightReference: Property | undefined;
  18609. /**
  18610. * Gets or sets the {@link CornerType} Property specifying how corners are styled.
  18611. */
  18612. cornerType: Property | undefined;
  18613. /**
  18614. * Gets or sets the numeric Property specifying the sampling distance between each latitude and longitude point.
  18615. */
  18616. granularity: Property | undefined;
  18617. /**
  18618. * Gets or sets the boolean Property specifying whether the corridor is filled with the provided material.
  18619. */
  18620. fill: Property | undefined;
  18621. /**
  18622. * Gets or sets the Property specifying the material used to fill the corridor.
  18623. */
  18624. material: MaterialProperty | undefined;
  18625. /**
  18626. * Gets or sets the Property specifying whether the corridor is outlined.
  18627. */
  18628. outline: Property | undefined;
  18629. /**
  18630. * Gets or sets the Property specifying the {@link Color} of the outline.
  18631. */
  18632. outlineColor: Property | undefined;
  18633. /**
  18634. * Gets or sets the numeric Property specifying the width of the outline.
  18635. */
  18636. outlineWidth: Property | undefined;
  18637. /**
  18638. * Get or sets the enum Property specifying whether the corridor
  18639. * casts or receives shadows from light sources.
  18640. */
  18641. shadows: Property | undefined;
  18642. /**
  18643. * Gets or sets the {@link DistanceDisplayCondition} Property specifying at what distance from the camera that this corridor will be displayed.
  18644. */
  18645. distanceDisplayCondition: Property | undefined;
  18646. /**
  18647. * Gets or sets the {@link ClassificationType} Property specifying whether this corridor will classify terrain, 3D Tiles, or both when on the ground.
  18648. */
  18649. classificationType: Property | undefined;
  18650. /**
  18651. * 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.
  18652. */
  18653. zIndex: ConstantProperty | undefined;
  18654. /**
  18655. * Duplicates this instance.
  18656. * @param [result] - The object onto which to store the result.
  18657. * @returns The modified result parameter or a new instance if one was not provided.
  18658. */
  18659. clone(result?: CorridorGraphics): CorridorGraphics;
  18660. /**
  18661. * Assigns each unassigned property on this object to the value
  18662. * of the same property on the provided source object.
  18663. * @param source - The object to be merged into this object.
  18664. */
  18665. merge(source: CorridorGraphics): void;
  18666. }
  18667. /**
  18668. * A {@link DataSource} implementation which can be used to manually manage a group of entities.
  18669. * @example
  18670. * var dataSource = new Cesium.CustomDataSource('myData');
  18671. *
  18672. * var entity = dataSource.entities.add({
  18673. * position : Cesium.Cartesian3.fromDegrees(1, 2, 0),
  18674. * billboard : {
  18675. * image : 'image.png'
  18676. * }
  18677. * });
  18678. *
  18679. * viewer.dataSources.add(dataSource);
  18680. * @param [name] - A human-readable name for this instance.
  18681. */
  18682. export class CustomDataSource {
  18683. constructor(name?: string);
  18684. /**
  18685. * Gets or sets a human-readable name for this instance.
  18686. */
  18687. name: string;
  18688. /**
  18689. * Gets or sets the clock for this instance.
  18690. */
  18691. clock: DataSourceClock;
  18692. /**
  18693. * Gets the collection of {@link Entity} instances.
  18694. */
  18695. entities: EntityCollection;
  18696. /**
  18697. * Gets or sets whether the data source is currently loading data.
  18698. */
  18699. isLoading: boolean;
  18700. /**
  18701. * Gets an event that will be raised when the underlying data changes.
  18702. */
  18703. changedEvent: Event;
  18704. /**
  18705. * Gets an event that will be raised if an error is encountered during processing.
  18706. */
  18707. errorEvent: Event;
  18708. /**
  18709. * Gets an event that will be raised when the data source either starts or stops loading.
  18710. */
  18711. loadingEvent: Event;
  18712. /**
  18713. * Gets whether or not this data source should be displayed.
  18714. */
  18715. show: boolean;
  18716. /**
  18717. * Gets or sets the clustering options for this data source. This object can be shared between multiple data sources.
  18718. */
  18719. clustering: EntityCluster;
  18720. /**
  18721. * Updates the data source to the provided time. This function is optional and
  18722. * is not required to be implemented. It is provided for data sources which
  18723. * retrieve data based on the current animation time or scene state.
  18724. * If implemented, update will be called by {@link DataSourceDisplay} once a frame.
  18725. * @param time - The simulation time.
  18726. * @returns True if this data source is ready to be displayed at the provided time, false otherwise.
  18727. */
  18728. update(time: JulianDate): boolean;
  18729. }
  18730. /**
  18731. * A {@link GeometryUpdater} for cylinders.
  18732. * Clients do not normally create this class directly, but instead rely on {@link DataSourceDisplay}.
  18733. * @param entity - The entity containing the geometry to be visualized.
  18734. * @param scene - The scene where visualization is taking place.
  18735. */
  18736. export class CylinderGeometryUpdater {
  18737. constructor(entity: Entity, scene: Scene);
  18738. /**
  18739. * Creates the geometry instance which represents the fill of the geometry.
  18740. * @param time - The time to use when retrieving initial attribute values.
  18741. * @returns The geometry instance representing the filled portion of the geometry.
  18742. */
  18743. createFillGeometryInstance(time: JulianDate): GeometryInstance;
  18744. /**
  18745. * Creates the geometry instance which represents the outline of the geometry.
  18746. * @param time - The time to use when retrieving initial attribute values.
  18747. * @returns The geometry instance representing the outline portion of the geometry.
  18748. */
  18749. createOutlineGeometryInstance(time: JulianDate): GeometryInstance;
  18750. }
  18751. export namespace CylinderGraphics {
  18752. /**
  18753. * Initialization options for the CylinderGraphics constructor
  18754. * @property [show = true] - A boolean Property specifying the visibility of the cylinder.
  18755. * @property [length] - A numeric Property specifying the length of the cylinder.
  18756. * @property [topRadius] - A numeric Property specifying the radius of the top of the cylinder.
  18757. * @property [bottomRadius] - A numeric Property specifying the radius of the bottom of the cylinder.
  18758. * @property [heightReference = HeightReference.NONE] - A Property specifying what the height from the entity position is relative to.
  18759. * @property [fill = true] - A boolean Property specifying whether the cylinder is filled with the provided material.
  18760. * @property [material = Color.WHITE] - A Property specifying the material used to fill the cylinder.
  18761. * @property [outline = false] - A boolean Property specifying whether the cylinder is outlined.
  18762. * @property [outlineColor = Color.BLACK] - A Property specifying the {@link Color} of the outline.
  18763. * @property [outlineWidth = 1.0] - A numeric Property specifying the width of the outline.
  18764. * @property [numberOfVerticalLines = 16] - A numeric Property specifying the number of vertical lines to draw along the perimeter for the outline.
  18765. * @property [slices = 128] - The number of edges around the perimeter of the cylinder.
  18766. * @property [shadows = ShadowMode.DISABLED] - An enum Property specifying whether the cylinder casts or receives shadows from light sources.
  18767. * @property [distanceDisplayCondition] - A Property specifying at what distance from the camera that this cylinder will be displayed.
  18768. */
  18769. type ConstructorOptions = {
  18770. show?: Property | boolean;
  18771. length?: Property | number;
  18772. topRadius?: Property | number;
  18773. bottomRadius?: Property | number;
  18774. heightReference?: Property | HeightReference;
  18775. fill?: Property | boolean;
  18776. material?: MaterialProperty | Color;
  18777. outline?: Property | boolean;
  18778. outlineColor?: Property | Color;
  18779. outlineWidth?: Property | number;
  18780. numberOfVerticalLines?: Property | number;
  18781. slices?: Property | number;
  18782. shadows?: Property | ShadowMode;
  18783. distanceDisplayCondition?: Property | DistanceDisplayCondition;
  18784. };
  18785. }
  18786. /**
  18787. * Describes a cylinder, truncated cone, or cone defined by a length, top radius, and bottom radius.
  18788. * The center position and orientation are determined by the containing {@link Entity}.
  18789. * @param [options] - Object describing initialization options
  18790. */
  18791. export class CylinderGraphics {
  18792. constructor(options?: CylinderGraphics.ConstructorOptions);
  18793. /**
  18794. * Gets the event that is raised whenever a property or sub-property is changed or modified.
  18795. */
  18796. readonly definitionChanged: Event;
  18797. /**
  18798. * Gets or sets the boolean Property specifying the visibility of the cylinder.
  18799. */
  18800. show: Property | undefined;
  18801. /**
  18802. * Gets or sets the numeric Property specifying the length of the cylinder.
  18803. */
  18804. length: Property | undefined;
  18805. /**
  18806. * Gets or sets the numeric Property specifying the radius of the top of the cylinder.
  18807. */
  18808. topRadius: Property | undefined;
  18809. /**
  18810. * Gets or sets the numeric Property specifying the radius of the bottom of the cylinder.
  18811. */
  18812. bottomRadius: Property | undefined;
  18813. /**
  18814. * Gets or sets the Property specifying the {@link HeightReference}.
  18815. */
  18816. heightReference: Property | undefined;
  18817. /**
  18818. * Gets or sets the boolean Property specifying whether the cylinder is filled with the provided material.
  18819. */
  18820. fill: Property | undefined;
  18821. /**
  18822. * Gets or sets the Property specifying the material used to fill the cylinder.
  18823. */
  18824. material: MaterialProperty | undefined;
  18825. /**
  18826. * Gets or sets the boolean Property specifying whether the cylinder is outlined.
  18827. */
  18828. outline: Property | undefined;
  18829. /**
  18830. * Gets or sets the Property specifying the {@link Color} of the outline.
  18831. */
  18832. outlineColor: Property | undefined;
  18833. /**
  18834. * Gets or sets the numeric Property specifying the width of the outline.
  18835. */
  18836. outlineWidth: Property | undefined;
  18837. /**
  18838. * Gets or sets the Property specifying the number of vertical lines to draw along the perimeter for the outline.
  18839. */
  18840. numberOfVerticalLines: Property | undefined;
  18841. /**
  18842. * Gets or sets the Property specifying the number of edges around the perimeter of the cylinder.
  18843. */
  18844. slices: Property | undefined;
  18845. /**
  18846. * Get or sets the enum Property specifying whether the cylinder
  18847. * casts or receives shadows from light sources.
  18848. */
  18849. shadows: Property | undefined;
  18850. /**
  18851. * Gets or sets the {@link DistanceDisplayCondition} Property specifying at what distance from the camera that this cylinder will be displayed.
  18852. */
  18853. distanceDisplayCondition: Property | undefined;
  18854. /**
  18855. * Duplicates this instance.
  18856. * @param [result] - The object onto which to store the result.
  18857. * @returns The modified result parameter or a new instance if one was not provided.
  18858. */
  18859. clone(result?: CylinderGraphics): CylinderGraphics;
  18860. /**
  18861. * Assigns each unassigned property on this object to the value
  18862. * of the same property on the provided source object.
  18863. * @param source - The object to be merged into this object.
  18864. */
  18865. merge(source: CylinderGraphics): void;
  18866. }
  18867. export namespace CzmlDataSource {
  18868. /**
  18869. * Initialization options for the `load` method.
  18870. * @property [sourceUri] - Overrides the url to use for resolving relative links.
  18871. * @property [credit] - A credit for the data source, which is displayed on the canvas.
  18872. */
  18873. type LoadOptions = {
  18874. sourceUri?: Resource | string;
  18875. credit?: Credit | string;
  18876. };
  18877. }
  18878. /**
  18879. * A {@link DataSource} which processes {@link https://github.com/AnalyticalGraphicsInc/czml-writer/wiki/CZML-Guide|CZML}.
  18880. * @param [name] - An optional name for the data source. This value will be overwritten if a loaded document contains a name.
  18881. */
  18882. export class CzmlDataSource {
  18883. constructor(name?: string);
  18884. /**
  18885. * Creates a Promise to a new instance loaded with the provided CZML data.
  18886. * @param czml - A url or CZML object to be processed.
  18887. * @param [options] - An object specifying configuration options
  18888. * @returns A promise that resolves to the new instance once the data is processed.
  18889. */
  18890. static load(czml: Resource | string | any, options?: CzmlDataSource.LoadOptions): Promise<CzmlDataSource>;
  18891. /**
  18892. * Gets a human-readable name for this instance.
  18893. */
  18894. name: string;
  18895. /**
  18896. * Gets the clock settings defined by the loaded CZML. If no clock is explicitly
  18897. * defined in the CZML, the combined availability of all objects is returned. If
  18898. * only static data exists, this value is undefined.
  18899. */
  18900. clock: DataSourceClock;
  18901. /**
  18902. * Gets the collection of {@link Entity} instances.
  18903. */
  18904. entities: EntityCollection;
  18905. /**
  18906. * Gets a value indicating if the data source is currently loading data.
  18907. */
  18908. isLoading: boolean;
  18909. /**
  18910. * Gets an event that will be raised when the underlying data changes.
  18911. */
  18912. changedEvent: Event;
  18913. /**
  18914. * Gets an event that will be raised if an error is encountered during processing.
  18915. */
  18916. errorEvent: Event;
  18917. /**
  18918. * Gets an event that will be raised when the data source either starts or stops loading.
  18919. */
  18920. loadingEvent: Event;
  18921. /**
  18922. * Gets whether or not this data source should be displayed.
  18923. */
  18924. show: boolean;
  18925. /**
  18926. * Gets or sets the clustering options for this data source. This object can be shared between multiple data sources.
  18927. */
  18928. clustering: EntityCluster;
  18929. /**
  18930. * Gets the credit that will be displayed for the data source
  18931. */
  18932. credit: Credit;
  18933. /**
  18934. * Gets the array of CZML processing functions.
  18935. */
  18936. static updaters: any[];
  18937. /**
  18938. * Processes the provided url or CZML object without clearing any existing data.
  18939. * @param czml - A url or CZML object to be processed.
  18940. * @param [options] - An object with the following properties:
  18941. * @param [options.sourceUri] - Overrides the url to use for resolving relative links.
  18942. * @returns A promise that resolves to this instances once the data is processed.
  18943. */
  18944. process(czml: Resource | string | any, options?: {
  18945. sourceUri?: string;
  18946. }): Promise<CzmlDataSource>;
  18947. /**
  18948. * Loads the provided url or CZML object, replacing any existing data.
  18949. * @param czml - A url or CZML object to be processed.
  18950. * @param [options] - An object specifying configuration options
  18951. * @returns A promise that resolves to this instances once the data is processed.
  18952. */
  18953. load(czml: Resource | string | any, options?: CzmlDataSource.LoadOptions): Promise<CzmlDataSource>;
  18954. /**
  18955. * Updates the data source to the provided time. This function is optional and
  18956. * is not required to be implemented. It is provided for data sources which
  18957. * retrieve data based on the current animation time or scene state.
  18958. * If implemented, update will be called by {@link DataSourceDisplay} once a frame.
  18959. * @param time - The simulation time.
  18960. * @returns True if this data source is ready to be displayed at the provided time, false otherwise.
  18961. */
  18962. update(time: JulianDate): boolean;
  18963. /**
  18964. * A helper function used by custom CZML updater functions
  18965. * which creates or updates a {@link Property} from a CZML packet.
  18966. * @param type - The constructor function for the property being processed.
  18967. * @param object - The object on which the property will be added or updated.
  18968. * @param propertyName - The name of the property on the object.
  18969. * @param packetData - The CZML packet being processed.
  18970. * @param interval - A constraining interval for which the data is valid.
  18971. * @param sourceUri - The originating uri of the data being processed.
  18972. * @param entityCollection - The collection being processsed.
  18973. */
  18974. static processPacketData(type: (...params: any[]) => any, object: any, propertyName: string, packetData: any, interval: TimeInterval, sourceUri: string, entityCollection: EntityCollection): void;
  18975. /**
  18976. * A helper function used by custom CZML updater functions
  18977. * which creates or updates a {@link PositionProperty} from a CZML packet.
  18978. * @param object - The object on which the property will be added or updated.
  18979. * @param propertyName - The name of the property on the object.
  18980. * @param packetData - The CZML packet being processed.
  18981. * @param interval - A constraining interval for which the data is valid.
  18982. * @param sourceUri - The originating uri of the data being processed.
  18983. * @param entityCollection - The collection being processsed.
  18984. */
  18985. static processPositionPacketData(object: any, propertyName: string, packetData: any, interval: TimeInterval, sourceUri: string, entityCollection: EntityCollection): void;
  18986. /**
  18987. * A helper function used by custom CZML updater functions
  18988. * which creates or updates a {@link MaterialProperty} from a CZML packet.
  18989. * @param object - The object on which the property will be added or updated.
  18990. * @param propertyName - The name of the property on the object.
  18991. * @param packetData - The CZML packet being processed.
  18992. * @param interval - A constraining interval for which the data is valid.
  18993. * @param sourceUri - The originating uri of the data being processed.
  18994. * @param entityCollection - The collection being processsed.
  18995. */
  18996. static processMaterialPacketData(object: any, propertyName: string, packetData: any, interval: TimeInterval, sourceUri: string, entityCollection: EntityCollection): void;
  18997. }
  18998. /**
  18999. * Defines the interface for data sources, which turn arbitrary data into a
  19000. * {@link EntityCollection} for generic consumption. This object is an interface
  19001. * for documentation purposes and is not intended to be instantiated directly.
  19002. */
  19003. export class DataSource {
  19004. constructor();
  19005. /**
  19006. * Gets a human-readable name for this instance.
  19007. */
  19008. name: string;
  19009. /**
  19010. * Gets the preferred clock settings for this data source.
  19011. */
  19012. clock: DataSourceClock;
  19013. /**
  19014. * Gets the collection of {@link Entity} instances.
  19015. */
  19016. entities: EntityCollection;
  19017. /**
  19018. * Gets a value indicating if the data source is currently loading data.
  19019. */
  19020. isLoading: boolean;
  19021. /**
  19022. * Gets an event that will be raised when the underlying data changes.
  19023. */
  19024. changedEvent: Event;
  19025. /**
  19026. * Gets an event that will be raised if an error is encountered during processing.
  19027. */
  19028. errorEvent: Event;
  19029. /**
  19030. * Gets an event that will be raised when the value of isLoading changes.
  19031. */
  19032. loadingEvent: Event;
  19033. /**
  19034. * Gets whether or not this data source should be displayed.
  19035. */
  19036. show: boolean;
  19037. /**
  19038. * Gets or sets the clustering options for this data source. This object can be shared between multiple data sources.
  19039. */
  19040. clustering: EntityCluster;
  19041. /**
  19042. * Updates the data source to the provided time. This function is optional and
  19043. * is not required to be implemented. It is provided for data sources which
  19044. * retrieve data based on the current animation time or scene state.
  19045. * If implemented, update will be called by {@link DataSourceDisplay} once a frame.
  19046. * @param time - The simulation time.
  19047. * @returns True if this data source is ready to be displayed at the provided time, false otherwise.
  19048. */
  19049. update(time: JulianDate): boolean;
  19050. }
  19051. /**
  19052. * Represents desired clock settings for a particular {@link DataSource}. These settings may be applied
  19053. * to the {@link Clock} when the DataSource is loaded.
  19054. */
  19055. export class DataSourceClock {
  19056. constructor();
  19057. /**
  19058. * Gets the event that is raised whenever a new property is assigned.
  19059. */
  19060. readonly definitionChanged: Event;
  19061. /**
  19062. * Gets or sets the desired start time of the clock.
  19063. * See {@link Clock#startTime}.
  19064. */
  19065. startTime: JulianDate;
  19066. /**
  19067. * Gets or sets the desired stop time of the clock.
  19068. * See {@link Clock#stopTime}.
  19069. */
  19070. stopTime: JulianDate;
  19071. /**
  19072. * Gets or sets the desired current time when this data source is loaded.
  19073. * See {@link Clock#currentTime}.
  19074. */
  19075. currentTime: JulianDate;
  19076. /**
  19077. * Gets or sets the desired clock range setting.
  19078. * See {@link Clock#clockRange}.
  19079. */
  19080. clockRange: ClockRange;
  19081. /**
  19082. * Gets or sets the desired clock step setting.
  19083. * See {@link Clock#clockStep}.
  19084. */
  19085. clockStep: ClockStep;
  19086. /**
  19087. * Gets or sets the desired clock multiplier.
  19088. * See {@link Clock#multiplier}.
  19089. */
  19090. multiplier: number;
  19091. /**
  19092. * Duplicates a DataSourceClock instance.
  19093. * @param [result] - The object onto which to store the result.
  19094. * @returns The modified result parameter or a new instance if one was not provided.
  19095. */
  19096. clone(result?: DataSourceClock): DataSourceClock;
  19097. /**
  19098. * Returns true if this DataSourceClock is equivalent to the other
  19099. * @param other - The other DataSourceClock to compare to.
  19100. * @returns <code>true</code> if the DataSourceClocks are equal; otherwise, <code>false</code>.
  19101. */
  19102. equals(other: DataSourceClock): boolean;
  19103. /**
  19104. * Assigns each unassigned property on this object to the value
  19105. * of the same property on the provided source object.
  19106. * @param source - The object to be merged into this object.
  19107. */
  19108. merge(source: DataSourceClock): void;
  19109. /**
  19110. * Gets the value of this clock instance as a {@link Clock} object.
  19111. * @returns The modified result parameter or a new instance if one was not provided.
  19112. */
  19113. getValue(): Clock;
  19114. }
  19115. /**
  19116. * A collection of {@link DataSource} instances.
  19117. */
  19118. export class DataSourceCollection {
  19119. constructor();
  19120. /**
  19121. * Gets the number of data sources in this collection.
  19122. */
  19123. readonly length: number;
  19124. /**
  19125. * An event that is raised when a data source is added to the collection.
  19126. * Event handlers are passed the data source that was added.
  19127. */
  19128. readonly dataSourceAdded: Event;
  19129. /**
  19130. * An event that is raised when a data source is removed from the collection.
  19131. * Event handlers are passed the data source that was removed.
  19132. */
  19133. readonly dataSourceRemoved: Event;
  19134. /**
  19135. * An event that is raised when a data source changes position in the collection. Event handlers are passed the data source
  19136. * that was moved, its new index after the move, and its old index prior to the move.
  19137. */
  19138. readonly dataSourceMoved: Event;
  19139. /**
  19140. * Adds a data source to the collection.
  19141. * @param dataSource - A data source or a promise to a data source to add to the collection.
  19142. * When passing a promise, the data source will not actually be added
  19143. * to the collection until the promise resolves successfully.
  19144. * @returns A Promise that resolves once the data source has been added to the collection.
  19145. */
  19146. add(dataSource: DataSource | Promise<DataSource>): Promise<DataSource>;
  19147. /**
  19148. * Removes a data source from this collection, if present.
  19149. * @param dataSource - The data source to remove.
  19150. * @param [destroy = false] - Whether to destroy the data source in addition to removing it.
  19151. * @returns true if the data source was in the collection and was removed,
  19152. * false if the data source was not in the collection.
  19153. */
  19154. remove(dataSource: DataSource, destroy?: boolean): boolean;
  19155. /**
  19156. * Removes all data sources from this collection.
  19157. * @param [destroy = false] - whether to destroy the data sources in addition to removing them.
  19158. */
  19159. removeAll(destroy?: boolean): void;
  19160. /**
  19161. * Checks to see if the collection contains a given data source.
  19162. * @param dataSource - The data source to check for.
  19163. * @returns true if the collection contains the data source, false otherwise.
  19164. */
  19165. contains(dataSource: DataSource): boolean;
  19166. /**
  19167. * Determines the index of a given data source in the collection.
  19168. * @param dataSource - The data source to find the index of.
  19169. * @returns The index of the data source in the collection, or -1 if the data source does not exist in the collection.
  19170. */
  19171. indexOf(dataSource: DataSource): number;
  19172. /**
  19173. * Gets a data source by index from the collection.
  19174. * @param index - the index to retrieve.
  19175. * @returns The data source at the specified index.
  19176. */
  19177. get(index: number): DataSource;
  19178. /**
  19179. * Gets a data source by name from the collection.
  19180. * @param name - The name to retrieve.
  19181. * @returns A list of all data sources matching the provided name.
  19182. */
  19183. getByName(name: string): DataSource[];
  19184. /**
  19185. * Raises a data source up one position in the collection.
  19186. * @param dataSource - The data source to move.
  19187. */
  19188. raise(dataSource: DataSource): void;
  19189. /**
  19190. * Lowers a data source down one position in the collection.
  19191. * @param dataSource - The data source to move.
  19192. */
  19193. lower(dataSource: DataSource): void;
  19194. /**
  19195. * Raises a data source to the top of the collection.
  19196. * @param dataSource - The data source to move.
  19197. */
  19198. raiseToTop(dataSource: DataSource): void;
  19199. /**
  19200. * Lowers a data source to the bottom of the collection.
  19201. * @param dataSource - The data source to move.
  19202. */
  19203. lowerToBottom(dataSource: DataSource): void;
  19204. /**
  19205. * Returns true if this object was destroyed; otherwise, false.
  19206. * If this object was destroyed, it should not be used; calling any function other than
  19207. * <code>isDestroyed</code> will result in a {@link DeveloperError} exception.
  19208. * @returns true if this object was destroyed; otherwise, false.
  19209. */
  19210. isDestroyed(): boolean;
  19211. /**
  19212. * Destroys the resources held by all data sources in this collection. Explicitly destroying this
  19213. * object allows for deterministic release of WebGL resources, instead of relying on the garbage
  19214. * collector. Once this object is destroyed, it should not be used; calling any function other than
  19215. * <code>isDestroyed</code> will result in a {@link DeveloperError} exception. Therefore,
  19216. * assign the return value (<code>undefined</code>) to the object as done in the example.
  19217. * @example
  19218. * dataSourceCollection = dataSourceCollection && dataSourceCollection.destroy();
  19219. */
  19220. destroy(): void;
  19221. }
  19222. /**
  19223. * Visualizes a collection of {@link DataSource} instances.
  19224. * @param options - Object with the following properties:
  19225. * @param options.scene - The scene in which to display the data.
  19226. * @param options.dataSourceCollection - The data sources to display.
  19227. * @param [options.visualizersCallback = DataSourceDisplay.defaultVisualizersCallback] - A function which creates an array of visualizers used for visualization.
  19228. * If undefined, all standard visualizers are used.
  19229. */
  19230. export class DataSourceDisplay {
  19231. constructor(options: {
  19232. scene: Scene;
  19233. dataSourceCollection: DataSourceCollection;
  19234. visualizersCallback?: DataSourceDisplay.VisualizersCallback;
  19235. });
  19236. /**
  19237. * Gets or sets the default function which creates an array of visualizers used for visualization.
  19238. * By default, this function uses all standard visualizers.
  19239. */
  19240. static defaultVisualizersCallback(): void;
  19241. /**
  19242. * Gets the scene associated with this display.
  19243. */
  19244. scene: Scene;
  19245. /**
  19246. * Gets the collection of data sources to display.
  19247. */
  19248. dataSources: DataSourceCollection;
  19249. /**
  19250. * Gets the default data source instance which can be used to
  19251. * manually create and visualize entities not tied to
  19252. * a specific data source. This instance is always available
  19253. * and does not appear in the list dataSources collection.
  19254. */
  19255. defaultDataSource: CustomDataSource;
  19256. /**
  19257. * Gets a value indicating whether or not all entities in the data source are ready
  19258. */
  19259. readonly ready: boolean;
  19260. /**
  19261. * Returns true if this object was destroyed; otherwise, false.
  19262. * <br /><br />
  19263. * If this object was destroyed, it should not be used; calling any function other than
  19264. * <code>isDestroyed</code> will result in a {@link DeveloperError} exception.
  19265. * @returns True if this object was destroyed; otherwise, false.
  19266. */
  19267. isDestroyed(): boolean;
  19268. /**
  19269. * Destroys the WebGL resources held by this object. Destroying an object allows for deterministic
  19270. * release of WebGL resources, instead of relying on the garbage collector to destroy this object.
  19271. * <br /><br />
  19272. * Once an object is destroyed, it should not be used; calling any function other than
  19273. * <code>isDestroyed</code> will result in a {@link DeveloperError} exception. Therefore,
  19274. * assign the return value (<code>undefined</code>) to the object as done in the example.
  19275. * @example
  19276. * dataSourceDisplay = dataSourceDisplay.destroy();
  19277. */
  19278. destroy(): void;
  19279. /**
  19280. * Updates the display to the provided time.
  19281. * @param time - The simulation time.
  19282. * @returns True if all data sources are ready to be displayed, false otherwise.
  19283. */
  19284. update(time: JulianDate): boolean;
  19285. }
  19286. export namespace DataSourceDisplay {
  19287. /**
  19288. * A function which creates an array of visualizers used for visualization.
  19289. * @example
  19290. * function createVisualizers(scene, dataSource) {
  19291. * return [new Cesium.BillboardVisualizer(scene, dataSource.entities)];
  19292. * }
  19293. * @param scene - The scene to create visualizers for.
  19294. * @param dataSource - The data source to create visualizers for.
  19295. */
  19296. type VisualizersCallback = (scene: Scene, dataSource: DataSource) => Visualizer[];
  19297. }
  19298. /**
  19299. * A {@link GeometryUpdater} for ellipses.
  19300. * Clients do not normally create this class directly, but instead rely on {@link DataSourceDisplay}.
  19301. * @param entity - The entity containing the geometry to be visualized.
  19302. * @param scene - The scene where visualization is taking place.
  19303. */
  19304. export class EllipseGeometryUpdater {
  19305. constructor(entity: Entity, scene: Scene);
  19306. /**
  19307. * Creates the geometry instance which represents the fill of the geometry.
  19308. * @param time - The time to use when retrieving initial attribute values.
  19309. * @returns The geometry instance representing the filled portion of the geometry.
  19310. */
  19311. createFillGeometryInstance(time: JulianDate): GeometryInstance;
  19312. /**
  19313. * Creates the geometry instance which represents the outline of the geometry.
  19314. * @param time - The time to use when retrieving initial attribute values.
  19315. * @returns The geometry instance representing the outline portion of the geometry.
  19316. */
  19317. createOutlineGeometryInstance(time: JulianDate): GeometryInstance;
  19318. /**
  19319. * Gets a value indicating if the geometry should be drawn on terrain.
  19320. */
  19321. readonly onTerrain: boolean;
  19322. }
  19323. export namespace EllipseGraphics {
  19324. /**
  19325. * Initialization options for the EllipseGraphics constructor
  19326. * @property [show = true] - A boolean Property specifying the visibility of the ellipse.
  19327. * @property [semiMajorAxis] - The numeric Property specifying the semi-major axis.
  19328. * @property [semiMinorAxis] - The numeric Property specifying the semi-minor axis.
  19329. * @property [height = 0] - A numeric Property specifying the altitude of the ellipse relative to the ellipsoid surface.
  19330. * @property [heightReference = HeightReference.NONE] - A Property specifying what the height is relative to.
  19331. * @property [extrudedHeight] - A numeric Property specifying the altitude of the ellipse's extruded face relative to the ellipsoid surface.
  19332. * @property [extrudedHeightReference = HeightReference.NONE] - A Property specifying what the extrudedHeight is relative to.
  19333. * @property [rotation = 0.0] - A numeric property specifying the rotation of the ellipse counter-clockwise from north.
  19334. * @property [stRotation = 0.0] - A numeric property specifying the rotation of the ellipse texture counter-clockwise from north.
  19335. * @property [granularity = Cesium.Math.RADIANS_PER_DEGREE] - A numeric Property specifying the angular distance between points on the ellipse.
  19336. * @property [fill = true] - A boolean Property specifying whether the ellipse is filled with the provided material.
  19337. * @property [material = Color.WHITE] - A Property specifying the material used to fill the ellipse.
  19338. * @property [outline = false] - A boolean Property specifying whether the ellipse is outlined.
  19339. * @property [outlineColor = Color.BLACK] - A Property specifying the {@link Color} of the outline.
  19340. * @property [outlineWidth = 1.0] - A numeric Property specifying the width of the outline.
  19341. * @property [numberOfVerticalLines = 16] - A numeric Property specifying the number of vertical lines to draw along the perimeter for the outline.
  19342. * @property [shadows = ShadowMode.DISABLED] - An enum Property specifying whether the ellipse casts or receives shadows from light sources.
  19343. * @property [distanceDisplayCondition] - A Property specifying at what distance from the camera that this ellipse will be displayed.
  19344. * @property [classificationType = ClassificationType.BOTH] - An enum Property specifying whether this ellipse will classify terrain, 3D Tiles, or both when on the ground.
  19345. * @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.
  19346. */
  19347. type ConstructorOptions = {
  19348. show?: Property | boolean;
  19349. semiMajorAxis?: Property | number;
  19350. semiMinorAxis?: Property | number;
  19351. height?: Property | number;
  19352. heightReference?: Property | HeightReference;
  19353. extrudedHeight?: Property | number;
  19354. extrudedHeightReference?: Property | HeightReference;
  19355. rotation?: Property | number;
  19356. stRotation?: Property | number;
  19357. granularity?: Property | number;
  19358. fill?: Property | boolean;
  19359. material?: MaterialProperty | Color;
  19360. outline?: Property | boolean;
  19361. outlineColor?: Property | Color;
  19362. outlineWidth?: Property | number;
  19363. numberOfVerticalLines?: Property | number;
  19364. shadows?: Property | ShadowMode;
  19365. distanceDisplayCondition?: Property | DistanceDisplayCondition;
  19366. classificationType?: Property | ClassificationType;
  19367. zIndex?: ConstantProperty | number;
  19368. };
  19369. }
  19370. /**
  19371. * Describes an ellipse defined by a center point and semi-major and semi-minor axes.
  19372. * The ellipse conforms to the curvature of the globe and can be placed on the surface or
  19373. * at altitude and can optionally be extruded into a volume.
  19374. * The center point is determined by the containing {@link Entity}.
  19375. * @param [options] - Object describing initialization options
  19376. */
  19377. export class EllipseGraphics {
  19378. constructor(options?: EllipseGraphics.ConstructorOptions);
  19379. /**
  19380. * Gets the event that is raised whenever a property or sub-property is changed or modified.
  19381. */
  19382. readonly definitionChanged: Event;
  19383. /**
  19384. * Gets or sets the boolean Property specifying the visibility of the ellipse.
  19385. */
  19386. show: Property | undefined;
  19387. /**
  19388. * Gets or sets the numeric Property specifying the semi-major axis.
  19389. */
  19390. semiMajorAxis: Property | undefined;
  19391. /**
  19392. * Gets or sets the numeric Property specifying the semi-minor axis.
  19393. */
  19394. semiMinorAxis: Property | undefined;
  19395. /**
  19396. * Gets or sets the numeric Property specifying the altitude of the ellipse.
  19397. */
  19398. height: Property | undefined;
  19399. /**
  19400. * Gets or sets the Property specifying the {@link HeightReference}.
  19401. */
  19402. heightReference: Property | undefined;
  19403. /**
  19404. * Gets or sets the numeric Property specifying the altitude of the ellipse extrusion.
  19405. * Setting this property creates volume starting at height and ending at this altitude.
  19406. */
  19407. extrudedHeight: Property | undefined;
  19408. /**
  19409. * Gets or sets the Property specifying the extruded {@link HeightReference}.
  19410. */
  19411. extrudedHeightReference: Property | undefined;
  19412. /**
  19413. * Gets or sets the numeric property specifying the rotation of the ellipse clockwise from north.
  19414. */
  19415. rotation: Property | undefined;
  19416. /**
  19417. * Gets or sets the numeric property specifying the rotation of the ellipse texture counter-clockwise from north.
  19418. */
  19419. stRotation: Property | undefined;
  19420. /**
  19421. * Gets or sets the numeric Property specifying the angular distance between points on the ellipse.
  19422. */
  19423. granularity: Property | undefined;
  19424. /**
  19425. * Gets or sets the boolean Property specifying whether the ellipse is filled with the provided material.
  19426. */
  19427. fill: Property | undefined;
  19428. /**
  19429. * Gets or sets the Property specifying the material used to fill the ellipse.
  19430. */
  19431. material: MaterialProperty | undefined;
  19432. /**
  19433. * Gets or sets the Property specifying whether the ellipse is outlined.
  19434. */
  19435. outline: Property | undefined;
  19436. /**
  19437. * Gets or sets the Property specifying the {@link Color} of the outline.
  19438. */
  19439. outlineColor: Property | undefined;
  19440. /**
  19441. * Gets or sets the numeric Property specifying the width of the outline.
  19442. */
  19443. outlineWidth: Property | undefined;
  19444. /**
  19445. * Gets or sets the numeric Property specifying the number of vertical lines to draw along the perimeter for the outline.
  19446. */
  19447. numberOfVerticalLines: Property | undefined;
  19448. /**
  19449. * Get or sets the enum Property specifying whether the ellipse
  19450. * casts or receives shadows from light sources.
  19451. */
  19452. shadows: Property | undefined;
  19453. /**
  19454. * Gets or sets the {@link DistanceDisplayCondition} Property specifying at what distance from the camera that this ellipse will be displayed.
  19455. */
  19456. distanceDisplayCondition: Property | undefined;
  19457. /**
  19458. * Gets or sets the {@link ClassificationType} Property specifying whether this ellipse will classify terrain, 3D Tiles, or both when on the ground.
  19459. */
  19460. classificationType: Property | undefined;
  19461. /**
  19462. * 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
  19463. */
  19464. zIndex: ConstantProperty | undefined;
  19465. /**
  19466. * Duplicates this instance.
  19467. * @param [result] - The object onto which to store the result.
  19468. * @returns The modified result parameter or a new instance if one was not provided.
  19469. */
  19470. clone(result?: EllipseGraphics): EllipseGraphics;
  19471. /**
  19472. * Assigns each unassigned property on this object to the value
  19473. * of the same property on the provided source object.
  19474. * @param source - The object to be merged into this object.
  19475. */
  19476. merge(source: EllipseGraphics): void;
  19477. }
  19478. /**
  19479. * A {@link GeometryUpdater} for ellipsoids.
  19480. * Clients do not normally create this class directly, but instead rely on {@link DataSourceDisplay}.
  19481. * @param entity - The entity containing the geometry to be visualized.
  19482. * @param scene - The scene where visualization is taking place.
  19483. */
  19484. export class EllipsoidGeometryUpdater {
  19485. constructor(entity: Entity, scene: Scene);
  19486. /**
  19487. * Creates the geometry instance which represents the fill of the geometry.
  19488. * @param time - The time to use when retrieving initial attribute values.
  19489. * @param [skipModelMatrix = false] - Whether to compute a model matrix for the geometry instance
  19490. * @param [modelMatrixResult] - Used to store the result of the model matrix calculation
  19491. * @returns The geometry instance representing the filled portion of the geometry.
  19492. */
  19493. createFillGeometryInstance(time: JulianDate, skipModelMatrix?: boolean, modelMatrixResult?: Matrix4): GeometryInstance;
  19494. /**
  19495. * Creates the geometry instance which represents the outline of the geometry.
  19496. * @param time - The time to use when retrieving initial attribute values.
  19497. * @param [skipModelMatrix = false] - Whether to compute a model matrix for the geometry instance
  19498. * @param [modelMatrixResult] - Used to store the result of the model matrix calculation
  19499. * @returns The geometry instance representing the outline portion of the geometry.
  19500. */
  19501. createOutlineGeometryInstance(time: JulianDate, skipModelMatrix?: boolean, modelMatrixResult?: Matrix4): GeometryInstance;
  19502. }
  19503. export namespace EllipsoidGraphics {
  19504. /**
  19505. * Initialization options for the EllipsoidGraphics constructor
  19506. * @property [show = true] - A boolean Property specifying the visibility of the ellipsoid.
  19507. * @property [radii] - A {@link Cartesian3} Property specifying the radii of the ellipsoid.
  19508. * @property [innerRadii] - A {@link Cartesian3} Property specifying the inner radii of the ellipsoid.
  19509. * @property [minimumClock = 0.0] - A Property specifying the minimum clock angle of the ellipsoid.
  19510. * @property [maximumClock = 2*PI] - A Property specifying the maximum clock angle of the ellipsoid.
  19511. * @property [minimumCone = 0.0] - A Property specifying the minimum cone angle of the ellipsoid.
  19512. * @property [maximumCone = PI] - A Property specifying the maximum cone angle of the ellipsoid.
  19513. * @property [heightReference = HeightReference.NONE] - A Property specifying what the height from the entity position is relative to.
  19514. * @property [fill = true] - A boolean Property specifying whether the ellipsoid is filled with the provided material.
  19515. * @property [material = Color.WHITE] - A Property specifying the material used to fill the ellipsoid.
  19516. * @property [outline = false] - A boolean Property specifying whether the ellipsoid is outlined.
  19517. * @property [outlineColor = Color.BLACK] - A Property specifying the {@link Color} of the outline.
  19518. * @property [outlineWidth = 1.0] - A numeric Property specifying the width of the outline.
  19519. * @property [stackPartitions = 64] - A Property specifying the number of stacks.
  19520. * @property [slicePartitions = 64] - A Property specifying the number of radial slices.
  19521. * @property [subdivisions = 128] - A Property specifying the number of samples per outline ring, determining the granularity of the curvature.
  19522. * @property [shadows = ShadowMode.DISABLED] - An enum Property specifying whether the ellipsoid casts or receives shadows from light sources.
  19523. * @property [distanceDisplayCondition] - A Property specifying at what distance from the camera that this ellipsoid will be displayed.
  19524. */
  19525. type ConstructorOptions = {
  19526. show?: Property | boolean;
  19527. radii?: Property | Cartesian3;
  19528. innerRadii?: Property | Cartesian3;
  19529. minimumClock?: Property | number;
  19530. maximumClock?: Property | number;
  19531. minimumCone?: Property | number;
  19532. maximumCone?: Property | number;
  19533. heightReference?: Property | HeightReference;
  19534. fill?: Property | boolean;
  19535. material?: MaterialProperty | Color;
  19536. outline?: Property | boolean;
  19537. outlineColor?: Property | Color;
  19538. outlineWidth?: Property | number;
  19539. stackPartitions?: Property | number;
  19540. slicePartitions?: Property | number;
  19541. subdivisions?: Property | number;
  19542. shadows?: Property | ShadowMode;
  19543. distanceDisplayCondition?: Property | DistanceDisplayCondition;
  19544. };
  19545. }
  19546. /**
  19547. * Describe an ellipsoid or sphere. The center position and orientation are determined by the containing {@link Entity}.
  19548. * @param [options] - Object describing initialization options
  19549. */
  19550. export class EllipsoidGraphics {
  19551. constructor(options?: EllipsoidGraphics.ConstructorOptions);
  19552. /**
  19553. * Gets the event that is raised whenever a property or sub-property is changed or modified.
  19554. */
  19555. readonly definitionChanged: Event;
  19556. /**
  19557. * Gets or sets the boolean Property specifying the visibility of the ellipsoid.
  19558. */
  19559. show: Property | undefined;
  19560. /**
  19561. * Gets or sets the {@link Cartesian3} {@link Property} specifying the radii of the ellipsoid.
  19562. */
  19563. radii: Property | undefined;
  19564. /**
  19565. * Gets or sets the {@link Cartesian3} {@link Property} specifying the inner radii of the ellipsoid.
  19566. */
  19567. innerRadii: Property | undefined;
  19568. /**
  19569. * Gets or sets the Property specifying the minimum clock angle of the ellipsoid.
  19570. */
  19571. minimumClock: Property | undefined;
  19572. /**
  19573. * Gets or sets the Property specifying the maximum clock angle of the ellipsoid.
  19574. */
  19575. maximumClock: Property | undefined;
  19576. /**
  19577. * Gets or sets the Property specifying the minimum cone angle of the ellipsoid.
  19578. */
  19579. minimumCone: Property | undefined;
  19580. /**
  19581. * Gets or sets the Property specifying the maximum cone angle of the ellipsoid.
  19582. */
  19583. maximumCone: Property | undefined;
  19584. /**
  19585. * Gets or sets the Property specifying the {@link HeightReference}.
  19586. */
  19587. heightReference: Property | undefined;
  19588. /**
  19589. * Gets or sets the boolean Property specifying whether the ellipsoid is filled with the provided material.
  19590. */
  19591. fill: Property | undefined;
  19592. /**
  19593. * Gets or sets the Property specifying the material used to fill the ellipsoid.
  19594. */
  19595. material: MaterialProperty;
  19596. /**
  19597. * Gets or sets the Property specifying whether the ellipsoid is outlined.
  19598. */
  19599. outline: Property | undefined;
  19600. /**
  19601. * Gets or sets the Property specifying the {@link Color} of the outline.
  19602. */
  19603. outlineColor: Property | undefined;
  19604. /**
  19605. * Gets or sets the numeric Property specifying the width of the outline.
  19606. */
  19607. outlineWidth: Property | undefined;
  19608. /**
  19609. * Gets or sets the Property specifying the number of stacks.
  19610. */
  19611. stackPartitions: Property | undefined;
  19612. /**
  19613. * Gets or sets the Property specifying the number of radial slices per 360 degrees.
  19614. */
  19615. slicePartitions: Property | undefined;
  19616. /**
  19617. * Gets or sets the Property specifying the number of samples per outline ring, determining the granularity of the curvature.
  19618. */
  19619. subdivisions: Property | undefined;
  19620. /**
  19621. * Get or sets the enum Property specifying whether the ellipsoid
  19622. * casts or receives shadows from light sources.
  19623. */
  19624. shadows: Property | undefined;
  19625. /**
  19626. * Gets or sets the {@link DistanceDisplayCondition} Property specifying at what distance from the camera that this ellipsoid will be displayed.
  19627. */
  19628. distanceDisplayCondition: Property | undefined;
  19629. /**
  19630. * Duplicates this instance.
  19631. * @param [result] - The object onto which to store the result.
  19632. * @returns The modified result parameter or a new instance if one was not provided.
  19633. */
  19634. clone(result?: EllipsoidGraphics): EllipsoidGraphics;
  19635. /**
  19636. * Assigns each unassigned property on this object to the value
  19637. * of the same property on the provided source object.
  19638. * @param source - The object to be merged into this object.
  19639. */
  19640. merge(source: EllipsoidGraphics): void;
  19641. }
  19642. export namespace Entity {
  19643. /**
  19644. * Initialization options for the Entity constructor
  19645. * @property [id] - A unique identifier for this object. If none is provided, a GUID is generated.
  19646. * @property [name] - A human readable name to display to users. It does not have to be unique.
  19647. * @property [availability] - The availability, if any, associated with this object.
  19648. * @property [show] - A boolean value indicating if the entity and its children are displayed.
  19649. * @property [description] - A string Property specifying an HTML description for this entity.
  19650. * @property [position] - A Property specifying the entity position.
  19651. * @property [orientation] - A Property specifying the entity orientation.
  19652. * @property [viewFrom] - A suggested initial offset for viewing this object.
  19653. * @property [parent] - A parent entity to associate with this entity.
  19654. * @property [billboard] - A billboard to associate with this entity.
  19655. * @property [box] - A box to associate with this entity.
  19656. * @property [corridor] - A corridor to associate with this entity.
  19657. * @property [cylinder] - A cylinder to associate with this entity.
  19658. * @property [ellipse] - A ellipse to associate with this entity.
  19659. * @property [ellipsoid] - A ellipsoid to associate with this entity.
  19660. * @property [label] - A options.label to associate with this entity.
  19661. * @property [model] - A model to associate with this entity.
  19662. * @property [tileset] - A 3D Tiles tileset to associate with this entity.
  19663. * @property [path] - A path to associate with this entity.
  19664. * @property [plane] - A plane to associate with this entity.
  19665. * @property [point] - A point to associate with this entity.
  19666. * @property [polygon] - A polygon to associate with this entity.
  19667. * @property [polyline] - A polyline to associate with this entity.
  19668. * @property [properties] - Arbitrary properties to associate with this entity.
  19669. * @property [polylineVolume] - A polylineVolume to associate with this entity.
  19670. * @property [rectangle] - A rectangle to associate with this entity.
  19671. * @property [wall] - A wall to associate with this entity.
  19672. */
  19673. type ConstructorOptions = {
  19674. id?: string;
  19675. name?: string;
  19676. availability?: TimeIntervalCollection;
  19677. show?: boolean;
  19678. description?: Property | string;
  19679. position?: PositionProperty | Cartesian3;
  19680. orientation?: Property;
  19681. viewFrom?: Property;
  19682. parent?: Entity;
  19683. billboard?: BillboardGraphics | BillboardGraphics.ConstructorOptions;
  19684. box?: BoxGraphics | BoxGraphics.ConstructorOptions;
  19685. corridor?: CorridorGraphics | CorridorGraphics.ConstructorOptions;
  19686. cylinder?: CylinderGraphics | CylinderGraphics.ConstructorOptions;
  19687. ellipse?: EllipseGraphics | EllipseGraphics.ConstructorOptions;
  19688. ellipsoid?: EllipsoidGraphics | EllipsoidGraphics.ConstructorOptions;
  19689. label?: LabelGraphics | LabelGraphics.ConstructorOptions;
  19690. model?: ModelGraphics | ModelGraphics.ConstructorOptions;
  19691. tileset?: Cesium3DTilesetGraphics | Cesium3DTilesetGraphics.ConstructorOptions;
  19692. path?: PathGraphics | PathGraphics.ConstructorOptions;
  19693. plane?: PlaneGraphics | PlaneGraphics.ConstructorOptions;
  19694. point?: PointGraphics | PointGraphics.ConstructorOptions;
  19695. polygon?: PolygonGraphics | PolygonGraphics.ConstructorOptions;
  19696. polyline?: PolylineGraphics | PolylineGraphics.ConstructorOptions;
  19697. properties?: PropertyBag | {
  19698. [key: string]: any;
  19699. };
  19700. polylineVolume?: PolylineVolumeGraphics | PolylineVolumeGraphics.ConstructorOptions;
  19701. rectangle?: RectangleGraphics | RectangleGraphics.ConstructorOptions;
  19702. wall?: WallGraphics | WallGraphics.ConstructorOptions;
  19703. };
  19704. }
  19705. /**
  19706. * Entity instances aggregate multiple forms of visualization into a single high-level object.
  19707. * They can be created manually and added to {@link Viewer#entities} or be produced by
  19708. * data sources, such as {@link CzmlDataSource} and {@link GeoJsonDataSource}.
  19709. * @param [options] - Object describing initialization options
  19710. */
  19711. export class Entity {
  19712. constructor(options?: Entity.ConstructorOptions);
  19713. /**
  19714. * Gets or sets the entity collection that this entity belongs to.
  19715. */
  19716. entityCollection: EntityCollection;
  19717. /**
  19718. * The availability, if any, associated with this object.
  19719. * If availability is undefined, it is assumed that this object's
  19720. * other properties will return valid data for any provided time.
  19721. * If availability exists, the objects other properties will only
  19722. * provide valid data if queried within the given interval.
  19723. */
  19724. availability: TimeIntervalCollection | undefined;
  19725. /**
  19726. * Gets the unique ID associated with this object.
  19727. */
  19728. id: string;
  19729. /**
  19730. * Gets the event that is raised whenever a property or sub-property is changed or modified.
  19731. */
  19732. readonly definitionChanged: Event;
  19733. /**
  19734. * Gets or sets the name of the object. The name is intended for end-user
  19735. * consumption and does not need to be unique.
  19736. */
  19737. name: string | undefined;
  19738. /**
  19739. * Gets or sets whether this entity should be displayed. When set to true,
  19740. * the entity is only displayed if the parent entity's show property is also true.
  19741. */
  19742. show: boolean;
  19743. /**
  19744. * Gets whether this entity is being displayed, taking into account
  19745. * the visibility of any ancestor entities.
  19746. */
  19747. isShowing: boolean;
  19748. /**
  19749. * Gets or sets the parent object.
  19750. */
  19751. parent: Entity | undefined;
  19752. /**
  19753. * Gets the names of all properties registered on this instance.
  19754. */
  19755. propertyNames: string[];
  19756. /**
  19757. * Gets or sets the billboard.
  19758. */
  19759. billboard: BillboardGraphics | undefined;
  19760. /**
  19761. * Gets or sets the box.
  19762. */
  19763. box: BoxGraphics | undefined;
  19764. /**
  19765. * Gets or sets the corridor.
  19766. */
  19767. corridor: CorridorGraphics | undefined;
  19768. /**
  19769. * Gets or sets the cylinder.
  19770. */
  19771. cylinder: CylinderGraphics | undefined;
  19772. /**
  19773. * Gets or sets the description.
  19774. */
  19775. description: Property | undefined;
  19776. /**
  19777. * Gets or sets the ellipse.
  19778. */
  19779. ellipse: EllipseGraphics | undefined;
  19780. /**
  19781. * Gets or sets the ellipsoid.
  19782. */
  19783. ellipsoid: EllipsoidGraphics | undefined;
  19784. /**
  19785. * Gets or sets the label.
  19786. */
  19787. label: LabelGraphics | undefined;
  19788. /**
  19789. * Gets or sets the model.
  19790. */
  19791. model: ModelGraphics | undefined;
  19792. /**
  19793. * Gets or sets the tileset.
  19794. */
  19795. tileset: Cesium3DTilesetGraphics | undefined;
  19796. /**
  19797. * Gets or sets the orientation.
  19798. */
  19799. orientation: Property | undefined;
  19800. /**
  19801. * Gets or sets the path.
  19802. */
  19803. path: PathGraphics | undefined;
  19804. /**
  19805. * Gets or sets the plane.
  19806. */
  19807. plane: PlaneGraphics | undefined;
  19808. /**
  19809. * Gets or sets the point graphic.
  19810. */
  19811. point: PointGraphics | undefined;
  19812. /**
  19813. * Gets or sets the polygon.
  19814. */
  19815. polygon: PolygonGraphics | undefined;
  19816. /**
  19817. * Gets or sets the polyline.
  19818. */
  19819. polyline: PolylineGraphics | undefined;
  19820. /**
  19821. * Gets or sets the polyline volume.
  19822. */
  19823. polylineVolume: PolylineVolumeGraphics | undefined;
  19824. /**
  19825. * Gets or sets the bag of arbitrary properties associated with this entity.
  19826. */
  19827. properties: PropertyBag | undefined;
  19828. /**
  19829. * Gets or sets the position.
  19830. */
  19831. position: PositionProperty | undefined;
  19832. /**
  19833. * Gets or sets the rectangle.
  19834. */
  19835. rectangle: RectangleGraphics | undefined;
  19836. /**
  19837. * Gets or sets the suggested initial offset when tracking this object.
  19838. * The offset is typically defined in the east-north-up reference frame,
  19839. * but may be another frame depending on the object's velocity.
  19840. */
  19841. viewFrom: Property | undefined;
  19842. /**
  19843. * Gets or sets the wall.
  19844. */
  19845. wall: WallGraphics | undefined;
  19846. /**
  19847. * Given a time, returns true if this object should have data during that time.
  19848. * @param time - The time to check availability for.
  19849. * @returns true if the object should have data during the provided time, false otherwise.
  19850. */
  19851. isAvailable(time: JulianDate): boolean;
  19852. /**
  19853. * Adds a property to this object. Once a property is added, it can be
  19854. * observed with {@link Entity#definitionChanged} and composited
  19855. * with {@link CompositeEntityCollection}
  19856. * @param propertyName - The name of the property to add.
  19857. */
  19858. addProperty(propertyName: string): void;
  19859. /**
  19860. * Removed a property previously added with addProperty.
  19861. * @param propertyName - The name of the property to remove.
  19862. */
  19863. removeProperty(propertyName: string): void;
  19864. /**
  19865. * Assigns each unassigned property on this object to the value
  19866. * of the same property on the provided source object.
  19867. * @param source - The object to be merged into this object.
  19868. */
  19869. merge(source: Entity): void;
  19870. /**
  19871. * Computes the model matrix for the entity's transform at specified time. Returns undefined if orientation or position
  19872. * are undefined.
  19873. * @param time - The time to retrieve model matrix for.
  19874. * @param [result] - The object onto which to store the result.
  19875. * @returns The modified result parameter or a new Matrix4 instance if one was not provided. Result is undefined if position or orientation are undefined.
  19876. */
  19877. computeModelMatrix(time: JulianDate, result?: Matrix4): Matrix4;
  19878. /**
  19879. * Checks if the given Scene supports materials besides Color on Entities draped on terrain or 3D Tiles.
  19880. * If this feature is not supported, Entities with non-color materials but no `height` will
  19881. * instead be rendered as if height is 0.
  19882. * @param scene - The current scene.
  19883. * @returns Whether or not the current scene supports materials for entities on terrain.
  19884. */
  19885. static supportsMaterialsforEntitiesOnTerrain(scene: Scene): boolean;
  19886. /**
  19887. * Checks if the given Scene supports polylines clamped to terrain or 3D Tiles.
  19888. * If this feature is not supported, Entities with PolylineGraphics will be rendered with vertices at
  19889. * the provided heights and using the `arcType` parameter instead of clamped to the ground.
  19890. * @param scene - The current scene.
  19891. * @returns Whether or not the current scene supports polylines on terrain or 3D TIles.
  19892. */
  19893. static supportsPolylinesOnTerrain(scene: Scene): boolean;
  19894. }
  19895. /**
  19896. * Defines how screen space objects (billboards, points, labels) are clustered.
  19897. * @param [options] - An object with the following properties:
  19898. * @param [options.enabled = false] - Whether or not to enable clustering.
  19899. * @param [options.pixelRange = 80] - The pixel range to extend the screen space bounding box.
  19900. * @param [options.minimumClusterSize = 2] - The minimum number of screen space objects that can be clustered.
  19901. * @param [options.clusterBillboards = true] - Whether or not to cluster the billboards of an entity.
  19902. * @param [options.clusterLabels = true] - Whether or not to cluster the labels of an entity.
  19903. * @param [options.clusterPoints = true] - Whether or not to cluster the points of an entity.
  19904. */
  19905. export class EntityCluster {
  19906. constructor(options?: {
  19907. enabled?: boolean;
  19908. pixelRange?: number;
  19909. minimumClusterSize?: number;
  19910. clusterBillboards?: boolean;
  19911. clusterLabels?: boolean;
  19912. clusterPoints?: boolean;
  19913. });
  19914. /**
  19915. * Gets or sets whether clustering is enabled.
  19916. */
  19917. enabled: boolean;
  19918. /**
  19919. * Gets or sets the pixel range to extend the screen space bounding box.
  19920. */
  19921. pixelRange: number;
  19922. /**
  19923. * Gets or sets the minimum number of screen space objects that can be clustered.
  19924. */
  19925. minimumClusterSize: number;
  19926. /**
  19927. * Gets the event that will be raised when a new cluster will be displayed. The signature of the event listener is {@link EntityCluster.newClusterCallback}.
  19928. */
  19929. clusterEvent: Event;
  19930. /**
  19931. * Gets or sets whether clustering billboard entities is enabled.
  19932. */
  19933. clusterBillboards: boolean;
  19934. /**
  19935. * Gets or sets whether clustering labels entities is enabled.
  19936. */
  19937. clusterLabels: boolean;
  19938. /**
  19939. * Gets or sets whether clustering point entities is enabled.
  19940. */
  19941. clusterPoints: boolean;
  19942. /**
  19943. * Destroys the WebGL resources held by this object. Destroying an object allows for deterministic
  19944. * release of WebGL resources, instead of relying on the garbage collector to destroy this object.
  19945. * <p>
  19946. * Unlike other objects that use WebGL resources, this object can be reused. For example, if a data source is removed
  19947. * from a data source collection and added to another.
  19948. * </p>
  19949. */
  19950. destroy(): void;
  19951. }
  19952. export namespace EntityCluster {
  19953. /**
  19954. * A event listener function used to style clusters.
  19955. * @example
  19956. * // The default cluster values.
  19957. * dataSource.clustering.clusterEvent.addEventListener(function(entities, cluster) {
  19958. * cluster.label.show = true;
  19959. * cluster.label.text = entities.length.toLocaleString();
  19960. * });
  19961. * @param clusteredEntities - An array of the entities contained in the cluster.
  19962. * @param cluster - An object containing billboard, label, and point properties. The values are the same as
  19963. * billboard, label and point entities, but must be the values of the ConstantProperty.
  19964. */
  19965. type newClusterCallback = (clusteredEntities: Entity[], cluster: any) => void;
  19966. }
  19967. /**
  19968. * An observable collection of {@link Entity} instances where each entity has a unique id.
  19969. * @param [owner] - The data source (or composite entity collection) which created this collection.
  19970. */
  19971. export class EntityCollection {
  19972. constructor(owner?: DataSource | CompositeEntityCollection);
  19973. /**
  19974. * Prevents {@link EntityCollection#collectionChanged} events from being raised
  19975. * until a corresponding call is made to {@link EntityCollection#resumeEvents}, at which
  19976. * point a single event will be raised that covers all suspended operations.
  19977. * This allows for many items to be added and removed efficiently.
  19978. * This function can be safely called multiple times as long as there
  19979. * are corresponding calls to {@link EntityCollection#resumeEvents}.
  19980. */
  19981. suspendEvents(): void;
  19982. /**
  19983. * Resumes raising {@link EntityCollection#collectionChanged} events immediately
  19984. * when an item is added or removed. Any modifications made while while events were suspended
  19985. * will be triggered as a single event when this function is called.
  19986. * This function is reference counted and can safely be called multiple times as long as there
  19987. * are corresponding calls to {@link EntityCollection#resumeEvents}.
  19988. */
  19989. resumeEvents(): void;
  19990. /**
  19991. * The signature of the event generated by {@link EntityCollection#collectionChanged}.
  19992. * @param collection - The collection that triggered the event.
  19993. * @param added - The array of {@link Entity} instances that have been added to the collection.
  19994. * @param removed - The array of {@link Entity} instances that have been removed from the collection.
  19995. * @param changed - The array of {@link Entity} instances that have been modified.
  19996. */
  19997. static collectionChangedEventCallback(collection: EntityCollection, added: Entity[], removed: Entity[], changed: Entity[]): void;
  19998. /**
  19999. * Gets the event that is fired when entities are added or removed from the collection.
  20000. * The generated event is a {@link EntityCollection.collectionChangedEventCallback}.
  20001. */
  20002. readonly collectionChanged: Event;
  20003. /**
  20004. * Gets a globally unique identifier for this collection.
  20005. */
  20006. readonly id: string;
  20007. /**
  20008. * Gets the array of Entity instances in the collection.
  20009. * This array should not be modified directly.
  20010. */
  20011. readonly values: Entity[];
  20012. /**
  20013. * Gets whether or not this entity collection should be
  20014. * displayed. When true, each entity is only displayed if
  20015. * its own show property is also true.
  20016. */
  20017. show: boolean;
  20018. /**
  20019. * Gets the owner of this entity collection, ie. the data source or composite entity collection which created it.
  20020. */
  20021. readonly owner: DataSource | CompositeEntityCollection;
  20022. /**
  20023. * Computes the maximum availability of the entities in the collection.
  20024. * If the collection contains a mix of infinitely available data and non-infinite data,
  20025. * it will return the interval pertaining to the non-infinite data only. If all
  20026. * data is infinite, an infinite interval will be returned.
  20027. * @returns The availability of entities in the collection.
  20028. */
  20029. computeAvailability(): TimeInterval;
  20030. /**
  20031. * Add an entity to the collection.
  20032. * @param entity - The entity to be added.
  20033. * @returns The entity that was added.
  20034. */
  20035. add(entity: Entity | Entity.ConstructorOptions): Entity;
  20036. /**
  20037. * Removes an entity from the collection.
  20038. * @param entity - The entity to be removed.
  20039. * @returns true if the item was removed, false if it did not exist in the collection.
  20040. */
  20041. remove(entity: Entity): boolean;
  20042. /**
  20043. * Returns true if the provided entity is in this collection, false otherwise.
  20044. * @param entity - The entity.
  20045. * @returns true if the provided entity is in this collection, false otherwise.
  20046. */
  20047. contains(entity: Entity): boolean;
  20048. /**
  20049. * Removes an entity with the provided id from the collection.
  20050. * @param id - The id of the entity to remove.
  20051. * @returns true if the item was removed, false if no item with the provided id existed in the collection.
  20052. */
  20053. removeById(id: string): boolean;
  20054. /**
  20055. * Removes all Entities from the collection.
  20056. */
  20057. removeAll(): void;
  20058. /**
  20059. * Gets an entity with the specified id.
  20060. * @param id - The id of the entity to retrieve.
  20061. * @returns The entity with the provided id or undefined if the id did not exist in the collection.
  20062. */
  20063. getById(id: string): Entity | undefined;
  20064. /**
  20065. * Gets an entity with the specified id or creates it and adds it to the collection if it does not exist.
  20066. * @param id - The id of the entity to retrieve or create.
  20067. * @returns The new or existing object.
  20068. */
  20069. getOrCreateEntity(id: string): Entity;
  20070. }
  20071. /**
  20072. * A utility object for tracking an entity with the camera.
  20073. * @param entity - The entity to track with the camera.
  20074. * @param scene - The scene to use.
  20075. * @param [ellipsoid = Ellipsoid.WGS84] - The ellipsoid to use for orienting the camera.
  20076. */
  20077. export class EntityView {
  20078. constructor(entity: Entity, scene: Scene, ellipsoid?: Ellipsoid);
  20079. /**
  20080. * The entity to track with the camera.
  20081. */
  20082. entity: Entity;
  20083. /**
  20084. * The scene in which to track the object.
  20085. */
  20086. scene: Scene;
  20087. /**
  20088. * The ellipsoid to use for orienting the camera.
  20089. */
  20090. ellipsoid: Ellipsoid;
  20091. /**
  20092. * The bounding sphere of the object.
  20093. */
  20094. boundingSphere: BoundingSphere;
  20095. /**
  20096. * Gets or sets a camera offset that will be used to
  20097. * initialize subsequent EntityViews.
  20098. */
  20099. static defaultOffset3D: Cartesian3;
  20100. /**
  20101. * Should be called each animation frame to update the camera
  20102. * to the latest settings.
  20103. * @param time - The current animation time.
  20104. * @param [boundingSphere] - bounding sphere of the object.
  20105. */
  20106. update(time: JulianDate, boundingSphere?: BoundingSphere): void;
  20107. }
  20108. export namespace GeoJsonDataSource {
  20109. /**
  20110. * Initialization options for the `load` method.
  20111. * @property [sourceUri] - Overrides the url to use for resolving relative links.
  20112. * @property [markerSize = GeoJsonDataSource.markerSize] - The default size of the map pin created for each point, in pixels.
  20113. * @property [markerSymbol = GeoJsonDataSource.markerSymbol] - The default symbol of the map pin created for each point.
  20114. * @property [markerColor = GeoJsonDataSource.markerColor] - The default color of the map pin created for each point.
  20115. * @property [stroke = GeoJsonDataSource.stroke] - The default color of polylines and polygon outlines.
  20116. * @property [strokeWidth = GeoJsonDataSource.strokeWidth] - The default width of polylines and polygon outlines.
  20117. * @property [fill = GeoJsonDataSource.fill] - The default color for polygon interiors.
  20118. * @property [clampToGround = GeoJsonDataSource.clampToGround] - true if we want the geometry features (polygons or linestrings) clamped to the ground.
  20119. * @property [credit] - A credit for the data source, which is displayed on the canvas.
  20120. */
  20121. type LoadOptions = {
  20122. sourceUri?: string;
  20123. markerSize?: number;
  20124. markerSymbol?: string;
  20125. markerColor?: Color;
  20126. stroke?: Color;
  20127. strokeWidth?: number;
  20128. fill?: Color;
  20129. clampToGround?: boolean;
  20130. credit?: Credit | string;
  20131. };
  20132. /**
  20133. * This callback is displayed as part of the GeoJsonDataSource class.
  20134. * @param properties - The properties of the feature.
  20135. * @param nameProperty - The property key that Cesium estimates to have the name of the feature.
  20136. */
  20137. type describe = (properties: any, nameProperty: string) => void;
  20138. }
  20139. /**
  20140. * A {@link DataSource} which processes both
  20141. * {@link http://www.geojson.org/|GeoJSON} and {@link https://github.com/mbostock/topojson|TopoJSON} data.
  20142. * {@link https://github.com/mapbox/simplestyle-spec|simplestyle-spec} properties will also be used if they
  20143. * are present.
  20144. * @example
  20145. * var viewer = new Cesium.Viewer('cesiumContainer');
  20146. * viewer.dataSources.add(Cesium.GeoJsonDataSource.load('../../SampleData/ne_10m_us_states.topojson', {
  20147. * stroke: Cesium.Color.HOTPINK,
  20148. * fill: Cesium.Color.PINK,
  20149. * strokeWidth: 3,
  20150. * markerSymbol: '?'
  20151. * }));
  20152. * @param [name] - The name of this data source. If undefined, a name will be taken from
  20153. * the name of the GeoJSON file.
  20154. */
  20155. export class GeoJsonDataSource {
  20156. constructor(name?: string);
  20157. /**
  20158. * Creates a Promise to a new instance loaded with the provided GeoJSON or TopoJSON data.
  20159. * @param data - A url, GeoJSON object, or TopoJSON object to be loaded.
  20160. * @param [options] - An object specifying configuration options
  20161. * @returns A promise that will resolve when the data is loaded.
  20162. */
  20163. static load(data: Resource | string | any, options?: GeoJsonDataSource.LoadOptions): Promise<GeoJsonDataSource>;
  20164. /**
  20165. * Gets or sets the default size of the map pin created for each point, in pixels.
  20166. */
  20167. static markerSize: number;
  20168. /**
  20169. * Gets or sets the default symbol of the map pin created for each point.
  20170. * This can be any valid {@link http://mapbox.com/maki/|Maki} identifier, any single character,
  20171. * or blank if no symbol is to be used.
  20172. */
  20173. static markerSymbol: string;
  20174. /**
  20175. * Gets or sets the default color of the map pin created for each point.
  20176. */
  20177. static markerColor: Color;
  20178. /**
  20179. * Gets or sets the default color of polylines and polygon outlines.
  20180. */
  20181. static stroke: Color;
  20182. /**
  20183. * Gets or sets the default width of polylines and polygon outlines.
  20184. */
  20185. static strokeWidth: number;
  20186. /**
  20187. * Gets or sets default color for polygon interiors.
  20188. */
  20189. static fill: Color;
  20190. /**
  20191. * Gets or sets default of whether to clamp to the ground.
  20192. */
  20193. static clampToGround: boolean;
  20194. /**
  20195. * Gets an object that maps the name of a crs to a callback function which takes a GeoJSON coordinate
  20196. * and transforms it into a WGS84 Earth-fixed Cartesian. Older versions of GeoJSON which
  20197. * supported the EPSG type can be added to this list as well, by specifying the complete EPSG name,
  20198. * for example 'EPSG:4326'.
  20199. */
  20200. static crsNames: any;
  20201. /**
  20202. * Gets an object that maps the href property of a crs link to a callback function
  20203. * which takes the crs properties object and returns a Promise that resolves
  20204. * to a function that takes a GeoJSON coordinate and transforms it into a WGS84 Earth-fixed Cartesian.
  20205. * Items in this object take precedence over those defined in <code>crsLinkHrefs</code>, assuming
  20206. * the link has a type specified.
  20207. */
  20208. static crsLinkHrefs: any;
  20209. /**
  20210. * Gets an object that maps the type property of a crs link to a callback function
  20211. * which takes the crs properties object and returns a Promise that resolves
  20212. * to a function that takes a GeoJSON coordinate and transforms it into a WGS84 Earth-fixed Cartesian.
  20213. * Items in <code>crsLinkHrefs</code> take precedence over this object.
  20214. */
  20215. static crsLinkTypes: any;
  20216. /**
  20217. * Gets or sets a human-readable name for this instance.
  20218. */
  20219. name: string;
  20220. /**
  20221. * This DataSource only defines static data, therefore this property is always undefined.
  20222. */
  20223. clock: DataSourceClock;
  20224. /**
  20225. * Gets the collection of {@link Entity} instances.
  20226. */
  20227. entities: EntityCollection;
  20228. /**
  20229. * Gets a value indicating if the data source is currently loading data.
  20230. */
  20231. isLoading: boolean;
  20232. /**
  20233. * Gets an event that will be raised when the underlying data changes.
  20234. */
  20235. changedEvent: Event;
  20236. /**
  20237. * Gets an event that will be raised if an error is encountered during processing.
  20238. */
  20239. errorEvent: Event;
  20240. /**
  20241. * Gets an event that will be raised when the data source either starts or stops loading.
  20242. */
  20243. loadingEvent: Event;
  20244. /**
  20245. * Gets whether or not this data source should be displayed.
  20246. */
  20247. show: boolean;
  20248. /**
  20249. * Gets or sets the clustering options for this data source. This object can be shared between multiple data sources.
  20250. */
  20251. clustering: EntityCluster;
  20252. /**
  20253. * Gets the credit that will be displayed for the data source
  20254. */
  20255. credit: Credit;
  20256. /**
  20257. * Asynchronously loads the provided GeoJSON or TopoJSON data, replacing any existing data.
  20258. * @param data - A url, GeoJSON object, or TopoJSON object to be loaded.
  20259. * @param [options] - An object with the following properties:
  20260. * @param [options.sourceUri] - Overrides the url to use for resolving relative links.
  20261. * @param [options.describe = GeoJsonDataSource.defaultDescribeProperty] - A function which returns a Property object (or just a string),
  20262. * which converts the properties into an html description.
  20263. * @param [options.markerSize = GeoJsonDataSource.markerSize] - The default size of the map pin created for each point, in pixels.
  20264. * @param [options.markerSymbol = GeoJsonDataSource.markerSymbol] - The default symbol of the map pin created for each point.
  20265. * @param [options.markerColor = GeoJsonDataSource.markerColor] - The default color of the map pin created for each point.
  20266. * @param [options.stroke = GeoJsonDataSource.stroke] - The default color of polylines and polygon outlines.
  20267. * @param [options.strokeWidth = GeoJsonDataSource.strokeWidth] - The default width of polylines and polygon outlines.
  20268. * @param [options.fill = GeoJsonDataSource.fill] - The default color for polygon interiors.
  20269. * @param [options.clampToGround = GeoJsonDataSource.clampToGround] - true if we want the features clamped to the ground.
  20270. * @param [options.credit] - A credit for the data source, which is displayed on the canvas.
  20271. * @returns a promise that will resolve when the GeoJSON is loaded.
  20272. */
  20273. load(data: Resource | string | any, options?: {
  20274. sourceUri?: string;
  20275. describe?: GeoJsonDataSource.describe;
  20276. markerSize?: number;
  20277. markerSymbol?: string;
  20278. markerColor?: Color;
  20279. stroke?: Color;
  20280. strokeWidth?: number;
  20281. fill?: Color;
  20282. clampToGround?: boolean;
  20283. credit?: Credit | string;
  20284. }): Promise<GeoJsonDataSource>;
  20285. /**
  20286. * Updates the data source to the provided time. This function is optional and
  20287. * is not required to be implemented. It is provided for data sources which
  20288. * retrieve data based on the current animation time or scene state.
  20289. * If implemented, update will be called by {@link DataSourceDisplay} once a frame.
  20290. * @param time - The simulation time.
  20291. * @returns True if this data source is ready to be displayed at the provided time, false otherwise.
  20292. */
  20293. update(time: JulianDate): boolean;
  20294. }
  20295. /**
  20296. * An abstract class for updating geometry entities.
  20297. * @param options - An object with the following properties:
  20298. * @param options.entity - The entity containing the geometry to be visualized.
  20299. * @param options.scene - The scene where visualization is taking place.
  20300. * @param options.geometryOptions - Options for the geometry
  20301. * @param options.geometryPropertyName - The geometry property name
  20302. * @param options.observedPropertyNames - The entity properties this geometry cares about
  20303. */
  20304. export class GeometryUpdater {
  20305. constructor(options: {
  20306. entity: Entity;
  20307. scene: Scene;
  20308. geometryOptions: any;
  20309. geometryPropertyName: string;
  20310. observedPropertyNames: string[];
  20311. });
  20312. /**
  20313. * Gets the unique ID associated with this updater
  20314. */
  20315. readonly id: string;
  20316. /**
  20317. * Gets the entity associated with this geometry.
  20318. */
  20319. readonly entity: Entity;
  20320. /**
  20321. * Gets a value indicating if the geometry has a fill component.
  20322. */
  20323. readonly fillEnabled: boolean;
  20324. /**
  20325. * Gets a value indicating if fill visibility varies with simulation time.
  20326. */
  20327. readonly hasConstantFill: boolean;
  20328. /**
  20329. * Gets the material property used to fill the geometry.
  20330. */
  20331. readonly fillMaterialProperty: MaterialProperty;
  20332. /**
  20333. * Gets a value indicating if the geometry has an outline component.
  20334. */
  20335. readonly outlineEnabled: boolean;
  20336. /**
  20337. * Gets a value indicating if the geometry has an outline component.
  20338. */
  20339. readonly hasConstantOutline: boolean;
  20340. /**
  20341. * Gets the {@link Color} property for the geometry outline.
  20342. */
  20343. readonly outlineColorProperty: Property;
  20344. /**
  20345. * Gets the constant with of the geometry outline, in pixels.
  20346. * This value is only valid if isDynamic is false.
  20347. */
  20348. readonly outlineWidth: number;
  20349. /**
  20350. * Gets the property specifying whether the geometry
  20351. * casts or receives shadows from light sources.
  20352. */
  20353. readonly shadowsProperty: Property;
  20354. /**
  20355. * Gets or sets the {@link DistanceDisplayCondition} Property specifying at what distance from the camera that this geometry will be displayed.
  20356. */
  20357. readonly distanceDisplayConditionProperty: Property;
  20358. /**
  20359. * Gets or sets the {@link ClassificationType} Property specifying if this geometry will classify terrain, 3D Tiles, or both when on the ground.
  20360. */
  20361. readonly classificationTypeProperty: Property;
  20362. /**
  20363. * Gets a value indicating if the geometry is time-varying.
  20364. * If true, all visualization is delegated to a DynamicGeometryUpdater
  20365. * returned by GeometryUpdater#createDynamicUpdater.
  20366. */
  20367. readonly isDynamic: boolean;
  20368. /**
  20369. * Gets a value indicating if the geometry is closed.
  20370. * This property is only valid for static geometry.
  20371. */
  20372. readonly isClosed: boolean;
  20373. /**
  20374. * Gets an event that is raised whenever the public properties
  20375. * of this updater change.
  20376. */
  20377. readonly geometryChanged: boolean;
  20378. /**
  20379. * Checks if the geometry is outlined at the provided time.
  20380. * @param time - The time for which to retrieve visibility.
  20381. * @returns true if geometry is outlined at the provided time, false otherwise.
  20382. */
  20383. isOutlineVisible(time: JulianDate): boolean;
  20384. /**
  20385. * Checks if the geometry is filled at the provided time.
  20386. * @param time - The time for which to retrieve visibility.
  20387. * @returns true if geometry is filled at the provided time, false otherwise.
  20388. */
  20389. isFilled(time: JulianDate): boolean;
  20390. /**
  20391. * Creates the geometry instance which represents the fill of the geometry.
  20392. * @param time - The time to use when retrieving initial attribute values.
  20393. * @returns The geometry instance representing the filled portion of the geometry.
  20394. */
  20395. createFillGeometryInstance(time: JulianDate): GeometryInstance;
  20396. /**
  20397. * Creates the geometry instance which represents the outline of the geometry.
  20398. * @param time - The time to use when retrieving initial attribute values.
  20399. * @returns The geometry instance representing the outline portion of the geometry.
  20400. */
  20401. createOutlineGeometryInstance(time: JulianDate): GeometryInstance;
  20402. /**
  20403. * Returns true if this object was destroyed; otherwise, false.
  20404. * @returns True if this object was destroyed; otherwise, false.
  20405. */
  20406. isDestroyed(): boolean;
  20407. /**
  20408. * Destroys and resources used by the object. Once an object is destroyed, it should not be used.
  20409. */
  20410. destroy(): void;
  20411. }
  20412. /**
  20413. * A general purpose visualizer for geometry represented by {@link Primitive} instances.
  20414. * @param scene - The scene the primitives will be rendered in.
  20415. * @param entityCollection - The entityCollection to visualize.
  20416. * @param [primitives = scene.primitives] - A collection to add primitives related to the entities
  20417. * @param [groundPrimitives = scene.groundPrimitives] - A collection to add ground primitives related to the entities
  20418. */
  20419. export class GeometryVisualizer {
  20420. constructor(scene: Scene, entityCollection: EntityCollection, primitives?: PrimitiveCollection, groundPrimitives?: PrimitiveCollection);
  20421. /**
  20422. * Updates all of the primitives created by this visualizer to match their
  20423. * Entity counterpart at the given time.
  20424. * @param time - The time to update to.
  20425. * @returns True if the visualizer successfully updated to the provided time,
  20426. * false if the visualizer is waiting for asynchronous primitives to be created.
  20427. */
  20428. update(time: JulianDate): boolean;
  20429. /**
  20430. * Returns true if this object was destroyed; otherwise, false.
  20431. * @returns True if this object was destroyed; otherwise, false.
  20432. */
  20433. isDestroyed(): boolean;
  20434. /**
  20435. * Removes and destroys all primitives created by this instance.
  20436. */
  20437. destroy(): void;
  20438. }
  20439. /**
  20440. * A {@link MaterialProperty} that maps to grid {@link Material} uniforms.
  20441. * @param [options] - Object with the following properties:
  20442. * @param [options.color = Color.WHITE] - A Property specifying the grid {@link Color}.
  20443. * @param [options.cellAlpha = 0.1] - A numeric Property specifying cell alpha values.
  20444. * @param [options.lineCount = new Cartesian2(8, 8)] - A {@link Cartesian2} Property specifying the number of grid lines along each axis.
  20445. * @param [options.lineThickness = new Cartesian2(1.0, 1.0)] - A {@link Cartesian2} Property specifying the thickness of grid lines along each axis.
  20446. * @param [options.lineOffset = new Cartesian2(0.0, 0.0)] - A {@link Cartesian2} Property specifying starting offset of grid lines along each axis.
  20447. */
  20448. export class GridMaterialProperty {
  20449. constructor(options?: {
  20450. color?: Property | Color;
  20451. cellAlpha?: Property | number;
  20452. lineCount?: Property | Cartesian2;
  20453. lineThickness?: Property | Cartesian2;
  20454. lineOffset?: Property | Cartesian2;
  20455. });
  20456. /**
  20457. * Gets a value indicating if this property is constant. A property is considered
  20458. * constant if getValue always returns the same result for the current definition.
  20459. */
  20460. readonly isConstant: boolean;
  20461. /**
  20462. * Gets the event that is raised whenever the definition of this property changes.
  20463. * The definition is considered to have changed if a call to getValue would return
  20464. * a different result for the same time.
  20465. */
  20466. readonly definitionChanged: Event;
  20467. /**
  20468. * Gets or sets the Property specifying the grid {@link Color}.
  20469. */
  20470. color: Property | undefined;
  20471. /**
  20472. * Gets or sets the numeric Property specifying cell alpha values.
  20473. */
  20474. cellAlpha: Property | undefined;
  20475. /**
  20476. * Gets or sets the {@link Cartesian2} Property specifying the number of grid lines along each axis.
  20477. */
  20478. lineCount: Property | undefined;
  20479. /**
  20480. * Gets or sets the {@link Cartesian2} Property specifying the thickness of grid lines along each axis.
  20481. */
  20482. lineThickness: Property | undefined;
  20483. /**
  20484. * Gets or sets the {@link Cartesian2} Property specifying the starting offset of grid lines along each axis.
  20485. */
  20486. lineOffset: Property | undefined;
  20487. /**
  20488. * Gets the {@link Material} type at the provided time.
  20489. * @param time - The time for which to retrieve the type.
  20490. * @returns The type of material.
  20491. */
  20492. getType(time: JulianDate): string;
  20493. /**
  20494. * Gets the value of the property at the provided time.
  20495. * @param time - The time for which to retrieve the value.
  20496. * @param [result] - The object to store the value into, if omitted, a new instance is created and returned.
  20497. * @returns The modified result parameter or a new instance if the result parameter was not supplied.
  20498. */
  20499. getValue(time: JulianDate, result?: any): any;
  20500. /**
  20501. * Compares this property to the provided property and returns
  20502. * <code>true</code> if they are equal, <code>false</code> otherwise.
  20503. * @param [other] - The other property.
  20504. * @returns <code>true</code> if left and right are equal, <code>false</code> otherwise.
  20505. */
  20506. equals(other?: Property): boolean;
  20507. }
  20508. /**
  20509. * An abstract class for updating ground geometry entities.
  20510. * @param options - An object with the following properties:
  20511. * @param options.entity - The entity containing the geometry to be visualized.
  20512. * @param options.scene - The scene where visualization is taking place.
  20513. * @param options.geometryOptions - Options for the geometry
  20514. * @param options.geometryPropertyName - The geometry property name
  20515. * @param options.observedPropertyNames - The entity properties this geometry cares about
  20516. */
  20517. export class GroundGeometryUpdater {
  20518. constructor(options: {
  20519. entity: Entity;
  20520. scene: Scene;
  20521. geometryOptions: any;
  20522. geometryPropertyName: string;
  20523. observedPropertyNames: string[];
  20524. });
  20525. /**
  20526. * Gets the zindex
  20527. */
  20528. readonly zIndex: number;
  20529. /**
  20530. * Destroys and resources used by the object. Once an object is destroyed, it should not be used.
  20531. */
  20532. destroy(): void;
  20533. }
  20534. /**
  20535. * A {@link MaterialProperty} that maps to image {@link Material} uniforms.
  20536. * @param [options] - Object with the following properties:
  20537. * @param [options.image] - A Property specifying the Image, URL, Canvas, or Video.
  20538. * @param [options.repeat = new Cartesian2(1.0, 1.0)] - A {@link Cartesian2} Property specifying the number of times the image repeats in each direction.
  20539. * @param [options.color = Color.WHITE] - The color applied to the image
  20540. * @param [options.transparent = false] - Set to true when the image has transparency (for example, when a png has transparent sections)
  20541. */
  20542. export class ImageMaterialProperty {
  20543. constructor(options?: {
  20544. image?: Property | string | HTMLImageElement | HTMLCanvasElement | HTMLVideoElement;
  20545. repeat?: Property | Cartesian2;
  20546. color?: Property | Color;
  20547. transparent?: Property | boolean;
  20548. });
  20549. /**
  20550. * Gets a value indicating if this property is constant. A property is considered
  20551. * constant if getValue always returns the same result for the current definition.
  20552. */
  20553. readonly isConstant: boolean;
  20554. /**
  20555. * Gets the event that is raised whenever the definition of this property changes.
  20556. * The definition is considered to have changed if a call to getValue would return
  20557. * a different result for the same time.
  20558. */
  20559. readonly definitionChanged: Event;
  20560. /**
  20561. * Gets or sets the Property specifying Image, URL, Canvas, or Video to use.
  20562. */
  20563. image: Property | undefined;
  20564. /**
  20565. * Gets or sets the {@link Cartesian2} Property specifying the number of times the image repeats in each direction.
  20566. */
  20567. repeat: Property | undefined;
  20568. /**
  20569. * Gets or sets the Color Property specifying the desired color applied to the image.
  20570. */
  20571. color: Property | undefined;
  20572. /**
  20573. * Gets or sets the Boolean Property specifying whether the image has transparency
  20574. */
  20575. transparent: Property | undefined;
  20576. /**
  20577. * Gets the {@link Material} type at the provided time.
  20578. * @param time - The time for which to retrieve the type.
  20579. * @returns The type of material.
  20580. */
  20581. getType(time: JulianDate): string;
  20582. /**
  20583. * Gets the value of the property at the provided time.
  20584. * @param time - The time for which to retrieve the value.
  20585. * @param [result] - The object to store the value into, if omitted, a new instance is created and returned.
  20586. * @returns The modified result parameter or a new instance if the result parameter was not supplied.
  20587. */
  20588. getValue(time: JulianDate, result?: any): any;
  20589. /**
  20590. * Compares this property to the provided property and returns
  20591. * <code>true</code> if they are equal, <code>false</code> otherwise.
  20592. * @param [other] - The other property.
  20593. * @returns <code>true</code> if left and right are equal, <code>false</code> otherwise.
  20594. */
  20595. equals(other?: Property): boolean;
  20596. }
  20597. /**
  20598. * Representation of <Camera> from KML
  20599. * @param position - camera position
  20600. * @param headingPitchRoll - camera orientation
  20601. */
  20602. export class KmlCamera {
  20603. constructor(position: Cartesian3, headingPitchRoll: HeadingPitchRoll);
  20604. }
  20605. export namespace KmlDataSource {
  20606. /**
  20607. * Initialization options for the `load` method.
  20608. * @property camera - The camera that is used for viewRefreshModes and sending camera properties to network links.
  20609. * @property canvas - The canvas that is used for sending viewer properties to network links.
  20610. * @property [sourceUri] - Overrides the url to use for resolving relative links and other KML network features.
  20611. * @property [clampToGround = false] - true if we want the geometry features (Polygons, LineStrings and LinearRings) clamped to the ground.
  20612. * @property [ellipsoid = Ellipsoid.WGS84] - The global ellipsoid used for geographical calculations.
  20613. * @property [credit] - A credit for the data source, which is displayed on the canvas.
  20614. */
  20615. type LoadOptions = {
  20616. camera: Camera;
  20617. canvas: HTMLCanvasElement;
  20618. sourceUri?: string;
  20619. clampToGround?: boolean;
  20620. ellipsoid?: Ellipsoid;
  20621. credit?: Credit | string;
  20622. };
  20623. }
  20624. /**
  20625. * A {@link DataSource} which processes Keyhole Markup Language 2.2 (KML).
  20626. * <p>
  20627. * KML support in Cesium is incomplete, but a large amount of the standard,
  20628. * as well as Google's <code>gx</code> extension namespace, is supported. See Github issue
  20629. * {@link https://github.com/CesiumGS/cesium/issues/873|#873} for a
  20630. * detailed list of what is and isn't support. Cesium will also write information to the
  20631. * console when it encounters most unsupported features.
  20632. * </p>
  20633. * <p>
  20634. * Non visual feature data, such as <code>atom:author</code> and <code>ExtendedData</code>
  20635. * is exposed via an instance of {@link KmlFeatureData}, which is added to each {@link Entity}
  20636. * under the <code>kml</code> property.
  20637. * </p>
  20638. * @example
  20639. * var viewer = new Cesium.Viewer('cesiumContainer');
  20640. * viewer.dataSources.add(Cesium.KmlDataSource.load('../../SampleData/facilities.kmz',
  20641. * {
  20642. * camera: viewer.scene.camera,
  20643. * canvas: viewer.scene.canvas
  20644. * })
  20645. * );
  20646. * @param options - An object with the following properties:
  20647. * @param options.camera - The camera that is used for viewRefreshModes and sending camera properties to network links.
  20648. * @param options.canvas - The canvas that is used for sending viewer properties to network links.
  20649. * @param [options.ellipsoid = Ellipsoid.WGS84] - The global ellipsoid used for geographical calculations.
  20650. * @param [options.credit] - A credit for the data source, which is displayed on the canvas.
  20651. */
  20652. export class KmlDataSource {
  20653. constructor(options: {
  20654. camera: Camera;
  20655. canvas: HTMLCanvasElement;
  20656. ellipsoid?: Ellipsoid;
  20657. credit?: Credit | string;
  20658. });
  20659. /**
  20660. * Creates a Promise to a new instance loaded with the provided KML data.
  20661. * @param data - A url, parsed KML document, or Blob containing binary KMZ data or a parsed KML document.
  20662. * @param [options] - An object specifying configuration options
  20663. * @returns A promise that will resolve to a new KmlDataSource instance once the KML is loaded.
  20664. */
  20665. static load(data: Resource | string | Document | Blob, options?: KmlDataSource.LoadOptions): Promise<KmlDataSource>;
  20666. /**
  20667. * Gets or sets a human-readable name for this instance.
  20668. * This will be automatically be set to the KML document name on load.
  20669. */
  20670. name: string;
  20671. /**
  20672. * Gets the clock settings defined by the loaded KML. This represents the total
  20673. * availability interval for all time-dynamic data. If the KML does not contain
  20674. * time-dynamic data, this value is undefined.
  20675. */
  20676. clock: DataSourceClock;
  20677. /**
  20678. * Gets the collection of {@link Entity} instances.
  20679. */
  20680. entities: EntityCollection;
  20681. /**
  20682. * Gets a value indicating if the data source is currently loading data.
  20683. */
  20684. isLoading: boolean;
  20685. /**
  20686. * Gets an event that will be raised when the underlying data changes.
  20687. */
  20688. changedEvent: Event;
  20689. /**
  20690. * Gets an event that will be raised if an error is encountered during processing.
  20691. */
  20692. errorEvent: Event;
  20693. /**
  20694. * Gets an event that will be raised when the data source either starts or stops loading.
  20695. */
  20696. loadingEvent: Event;
  20697. /**
  20698. * Gets an event that will be raised when the data source refreshes a network link.
  20699. */
  20700. refreshEvent: Event;
  20701. /**
  20702. * Gets an event that will be raised when the data source finds an unsupported node type.
  20703. */
  20704. unsupportedNodeEvent: Event;
  20705. /**
  20706. * Gets whether or not this data source should be displayed.
  20707. */
  20708. show: boolean;
  20709. /**
  20710. * Gets or sets the clustering options for this data source. This object can be shared between multiple data sources.
  20711. */
  20712. clustering: EntityCluster;
  20713. /**
  20714. * Gets the credit that will be displayed for the data source
  20715. */
  20716. credit: Credit;
  20717. /**
  20718. * Asynchronously loads the provided KML data, replacing any existing data.
  20719. * @param data - A url, parsed KML document, or Blob containing binary KMZ data or a parsed KML document.
  20720. * @param [options] - An object with the following properties:
  20721. * @param [options.sourceUri] - Overrides the url to use for resolving relative links and other KML network features.
  20722. * @param [options.clampToGround = false] - true if we want the geometry features (Polygons, LineStrings and LinearRings) clamped to the ground. If true, lines will use corridors so use Entity.corridor instead of Entity.polyline.
  20723. * @param [options.ellipsoid = Ellipsoid.WGS84] - The global ellipsoid used for geographical calculations.
  20724. * @returns A promise that will resolve to this instances once the KML is loaded.
  20725. */
  20726. load(data: Resource | string | Document | Blob, options?: {
  20727. sourceUri?: Resource | string;
  20728. clampToGround?: boolean;
  20729. ellipsoid?: Ellipsoid;
  20730. }): Promise<KmlDataSource>;
  20731. /**
  20732. * Updates any NetworkLink that require updating.
  20733. * @param time - The simulation time.
  20734. * @returns True if this data source is ready to be displayed at the provided time, false otherwise.
  20735. */
  20736. update(time: JulianDate): boolean;
  20737. }
  20738. /**
  20739. * Contains KML Feature data loaded into the <code>Entity.kml</code> property by {@link KmlDataSource}.
  20740. */
  20741. export class KmlFeatureData {
  20742. constructor();
  20743. /**
  20744. * Gets the atom syndication format author field.
  20745. */
  20746. author: KmlFeatureData.Author;
  20747. /**
  20748. * Gets the link.
  20749. */
  20750. link: KmlFeatureData.Link;
  20751. /**
  20752. * Gets the unstructured address field.
  20753. */
  20754. address: string;
  20755. /**
  20756. * Gets the phone number.
  20757. */
  20758. phoneNumber: string;
  20759. /**
  20760. * Gets the snippet.
  20761. */
  20762. snippet: string;
  20763. /**
  20764. * Gets the extended data, parsed into a JSON object.
  20765. * Currently only the <code>Data</code> property is supported.
  20766. * <code>SchemaData</code> and custom data are ignored.
  20767. */
  20768. extendedData: string;
  20769. }
  20770. export namespace KmlFeatureData {
  20771. /**
  20772. * @property name - Gets the name.
  20773. * @property uri - Gets the URI.
  20774. * @property age - Gets the email.
  20775. */
  20776. type Author = {
  20777. name: string;
  20778. uri: string;
  20779. age: number;
  20780. };
  20781. /**
  20782. * @property href - Gets the href.
  20783. * @property hreflang - Gets the language of the linked resource.
  20784. * @property rel - Gets the link relation.
  20785. * @property type - Gets the link type.
  20786. * @property title - Gets the link title.
  20787. * @property length - Gets the link length.
  20788. */
  20789. type Link = {
  20790. href: string;
  20791. hreflang: string;
  20792. rel: string;
  20793. type: string;
  20794. title: string;
  20795. length: string;
  20796. };
  20797. }
  20798. /**
  20799. * @param position - camera position
  20800. * @param headingPitchRange - camera orientation
  20801. */
  20802. export class KmlLookAt {
  20803. constructor(position: Cartesian3, headingPitchRange: HeadingPitchRange);
  20804. }
  20805. /**
  20806. * @param name - name parsed from KML
  20807. * @param id - id parsed from KML
  20808. * @param playlist - array with KMLTourFlyTos, KMLTourWaits and KMLTourSoundCues
  20809. */
  20810. export class KmlTour {
  20811. constructor(name: string, id: string, playlist: any[]);
  20812. /**
  20813. * Id of kml gx:Tour entry
  20814. */
  20815. id: string;
  20816. /**
  20817. * Tour name
  20818. */
  20819. name: string;
  20820. /**
  20821. * Index of current entry from playlist
  20822. */
  20823. playlistIndex: number;
  20824. /**
  20825. * Array of playlist entries
  20826. */
  20827. playlist: any[];
  20828. /**
  20829. * Event will be called when tour starts to play,
  20830. * before any playlist entry starts to play.
  20831. */
  20832. tourStart: Event;
  20833. /**
  20834. * Event will be called when all playlist entries are
  20835. * played, or tour playback being canceled.
  20836. *
  20837. * If tour playback was terminated, event callback will
  20838. * be called with terminated=true parameter.
  20839. */
  20840. tourEnd: Event;
  20841. /**
  20842. * Event will be called when entry from playlist starts to play.
  20843. *
  20844. * Event callback will be called with curent entry as first parameter.
  20845. */
  20846. entryStart: Event;
  20847. /**
  20848. * Event will be called when entry from playlist ends to play.
  20849. *
  20850. * Event callback will be called with following parameters:
  20851. * 1. entry - entry
  20852. * 2. terminated - true if playback was terminated by calling {@link KmlTour#stop}
  20853. */
  20854. entryEnd: Event;
  20855. /**
  20856. * Add entry to this tour playlist.
  20857. * @param entry - an entry to add to the playlist.
  20858. */
  20859. addPlaylistEntry(entry: KmlTourFlyTo | KmlTourWait): void;
  20860. /**
  20861. * Play this tour.
  20862. * @param viewer - viewer widget.
  20863. * @param [cameraOptions] - these options will be merged with {@link Camera#flyTo}
  20864. * options for FlyTo playlist entries.
  20865. */
  20866. play(viewer: Viewer, cameraOptions?: any): void;
  20867. /**
  20868. * Stop curently playing tour.
  20869. */
  20870. stop(): void;
  20871. }
  20872. /**
  20873. * @param duration - entry duration
  20874. * @param flyToMode - KML fly to mode: bounce, smooth, etc
  20875. * @param view - KmlCamera or KmlLookAt
  20876. */
  20877. export class KmlTourFlyTo {
  20878. constructor(duration: number, flyToMode: string, view: KmlCamera | KmlLookAt);
  20879. /**
  20880. * Play this playlist entry
  20881. * @param done - function which will be called when playback ends
  20882. * @param camera - Cesium camera
  20883. * @param [cameraOptions] - which will be merged with camera flyTo options. See {@link Camera#flyTo}
  20884. */
  20885. play(done: KmlTourFlyTo.DoneCallback, camera: Camera, cameraOptions?: any): void;
  20886. /**
  20887. * Stop execution of curent entry. Cancel camera flyTo
  20888. */
  20889. stop(): void;
  20890. /**
  20891. * Returns options for {@link Camera#flyTo} or {@link Camera#flyToBoundingSphere}
  20892. * depends on this.view type.
  20893. * @param cameraOptions - options to merge with generated. See {@link Camera#flyTo}
  20894. * @returns {@link Camera#flyTo} or {@link Camera#flyToBoundingSphere} options
  20895. */
  20896. getCameraOptions(cameraOptions: any): any;
  20897. }
  20898. export namespace KmlTourFlyTo {
  20899. /**
  20900. * A function that will be executed when the flight completes.
  20901. * @param terminated - true if {@link KmlTourFlyTo#stop} was
  20902. * called before entry done playback.
  20903. */
  20904. type DoneCallback = (terminated: boolean) => void;
  20905. }
  20906. /**
  20907. * @param duration - entry duration
  20908. */
  20909. export class KmlTourWait {
  20910. constructor(duration: number);
  20911. /**
  20912. * Play this playlist entry
  20913. * @param done - function which will be called when playback ends
  20914. */
  20915. play(done: KmlTourWait.DoneCallback): void;
  20916. /**
  20917. * Stop execution of curent entry, cancel curent timeout
  20918. */
  20919. stop(): void;
  20920. }
  20921. export namespace KmlTourWait {
  20922. /**
  20923. * A function which will be called when playback ends.
  20924. * @param terminated - true if {@link KmlTourWait#stop} was
  20925. * called before entry done playback.
  20926. */
  20927. type DoneCallback = (terminated: boolean) => void;
  20928. }
  20929. export namespace LabelGraphics {
  20930. /**
  20931. * Initialization options for the LabelGraphics constructor
  20932. * @property [show = true] - A boolean Property specifying the visibility of the label.
  20933. * @property [text] - A Property specifying the text. Explicit newlines '\n' are supported.
  20934. * @property [font = '30px sans-serif'] - A Property specifying the CSS font.
  20935. * @property [style = LabelStyle.FILL] - A Property specifying the {@link LabelStyle}.
  20936. * @property [scale = 1.0] - A numeric Property specifying the scale to apply to the text.
  20937. * @property [showBackground = false] - A boolean Property specifying the visibility of the background behind the label.
  20938. * @property [backgroundColor = new Color(0.165, 0.165, 0.165, 0.8)] - A Property specifying the background {@link Color}.
  20939. * @property [backgroundPadding = new Cartesian2(7, 5)] - A {@link Cartesian2} Property specifying the horizontal and vertical background padding in pixels.
  20940. * @property [pixelOffset = Cartesian2.ZERO] - A {@link Cartesian2} Property specifying the pixel offset.
  20941. * @property [eyeOffset = Cartesian3.ZERO] - A {@link Cartesian3} Property specifying the eye offset.
  20942. * @property [horizontalOrigin = HorizontalOrigin.CENTER] - A Property specifying the {@link HorizontalOrigin}.
  20943. * @property [verticalOrigin = VerticalOrigin.CENTER] - A Property specifying the {@link VerticalOrigin}.
  20944. * @property [heightReference = HeightReference.NONE] - A Property specifying what the height is relative to.
  20945. * @property [fillColor = Color.WHITE] - A Property specifying the fill {@link Color}.
  20946. * @property [outlineColor = Color.BLACK] - A Property specifying the outline {@link Color}.
  20947. * @property [outlineWidth = 1.0] - A numeric Property specifying the outline width.
  20948. * @property [translucencyByDistance] - A {@link NearFarScalar} Property used to set translucency based on distance from the camera.
  20949. * @property [pixelOffsetScaleByDistance] - A {@link NearFarScalar} Property used to set pixelOffset based on distance from the camera.
  20950. * @property [scaleByDistance] - A {@link NearFarScalar} Property used to set scale based on distance from the camera.
  20951. * @property [distanceDisplayCondition] - A Property specifying at what distance from the camera that this label will be displayed.
  20952. * @property [disableDepthTestDistance] - A Property specifying the distance from the camera at which to disable the depth test to.
  20953. */
  20954. type ConstructorOptions = {
  20955. show?: Property | boolean;
  20956. text?: Property | string;
  20957. font?: Property | string;
  20958. style?: Property | LabelStyle;
  20959. scale?: Property | number;
  20960. showBackground?: Property | boolean;
  20961. backgroundColor?: Property | Color;
  20962. backgroundPadding?: Property | Cartesian2;
  20963. pixelOffset?: Property | Cartesian2;
  20964. eyeOffset?: Property | Cartesian3;
  20965. horizontalOrigin?: Property | HorizontalOrigin;
  20966. verticalOrigin?: Property | VerticalOrigin;
  20967. heightReference?: Property | HeightReference;
  20968. fillColor?: Property | Color;
  20969. outlineColor?: Property | Color;
  20970. outlineWidth?: Property | number;
  20971. translucencyByDistance?: Property | NearFarScalar;
  20972. pixelOffsetScaleByDistance?: Property | NearFarScalar;
  20973. scaleByDistance?: Property | NearFarScalar;
  20974. distanceDisplayCondition?: Property | DistanceDisplayCondition;
  20975. disableDepthTestDistance?: Property | number;
  20976. };
  20977. }
  20978. /**
  20979. * Describes a two dimensional label located at the position of the containing {@link Entity}.
  20980. * <p>
  20981. * <div align='center'>
  20982. * <img src='Images/Label.png' width='400' height='300' /><br />
  20983. * Example labels
  20984. * </div>
  20985. * </p>
  20986. * @param [options] - Object describing initialization options
  20987. */
  20988. export class LabelGraphics {
  20989. constructor(options?: LabelGraphics.ConstructorOptions);
  20990. /**
  20991. * Gets the event that is raised whenever a property or sub-property is changed or modified.
  20992. */
  20993. readonly definitionChanged: Event;
  20994. /**
  20995. * Gets or sets the boolean Property specifying the visibility of the label.
  20996. */
  20997. show: Property | undefined;
  20998. /**
  20999. * Gets or sets the string Property specifying the text of the label.
  21000. * Explicit newlines '\n' are supported.
  21001. */
  21002. text: Property | undefined;
  21003. /**
  21004. * Gets or sets the string Property specifying the font in CSS syntax.
  21005. */
  21006. font: Property | undefined;
  21007. /**
  21008. * Gets or sets the Property specifying the {@link LabelStyle}.
  21009. */
  21010. style: Property | undefined;
  21011. /**
  21012. * Gets or sets the numeric Property specifying the uniform scale to apply to the image.
  21013. * A scale greater than <code>1.0</code> enlarges the label while a scale less than <code>1.0</code> shrinks it.
  21014. * <p>
  21015. * <div align='center'>
  21016. * <img src='Images/Label.setScale.png' width='400' height='300' /><br/>
  21017. * From left to right in the above image, the scales are <code>0.5</code>, <code>1.0</code>,
  21018. * and <code>2.0</code>.
  21019. * </div>
  21020. * </p>
  21021. */
  21022. scale: Property | undefined;
  21023. /**
  21024. * Gets or sets the boolean Property specifying the visibility of the background behind the label.
  21025. */
  21026. showBackground: Property | undefined;
  21027. /**
  21028. * Gets or sets the Property specifying the background {@link Color}.
  21029. */
  21030. backgroundColor: Property | undefined;
  21031. /**
  21032. * Gets or sets the {@link Cartesian2} Property specifying the label's horizontal and vertical
  21033. * background padding in pixels.
  21034. */
  21035. backgroundPadding: Property | undefined;
  21036. /**
  21037. * Gets or sets the {@link Cartesian2} Property specifying the label's pixel offset in screen space
  21038. * from the origin of this label. This is commonly used to align multiple labels and labels at
  21039. * the same position, e.g., an image and text. The screen space origin is the top, left corner of the
  21040. * canvas; <code>x</code> increases from left to right, and <code>y</code> increases from top to bottom.
  21041. * <p>
  21042. * <div align='center'>
  21043. * <table border='0' cellpadding='5'><tr>
  21044. * <td align='center'><code>default</code><br/><img src='Images/Label.setPixelOffset.default.png' width='250' height='188' /></td>
  21045. * <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>
  21046. * </tr></table>
  21047. * The label's origin is indicated by the yellow point.
  21048. * </div>
  21049. * </p>
  21050. */
  21051. pixelOffset: Property | undefined;
  21052. /**
  21053. * Gets or sets the {@link Cartesian3} Property specifying the label's offset in eye coordinates.
  21054. * Eye coordinates is a left-handed coordinate system, where <code>x</code> points towards the viewer's
  21055. * right, <code>y</code> points up, and <code>z</code> points into the screen.
  21056. * <p>
  21057. * An eye offset is commonly used to arrange multiple labels or objects at the same position, e.g., to
  21058. * arrange a label above its corresponding 3D model.
  21059. * </p>
  21060. * Below, the label is positioned at the center of the Earth but an eye offset makes it always
  21061. * appear on top of the Earth regardless of the viewer's or Earth's orientation.
  21062. * <p>
  21063. * <div align='center'>
  21064. * <table border='0' cellpadding='5'><tr>
  21065. * <td align='center'><img src='Images/Billboard.setEyeOffset.one.png' width='250' height='188' /></td>
  21066. * <td align='center'><img src='Images/Billboard.setEyeOffset.two.png' width='250' height='188' /></td>
  21067. * </tr></table>
  21068. * <code>l.eyeOffset = new Cartesian3(0.0, 8000000.0, 0.0);</code><br /><br />
  21069. * </div>
  21070. * </p>
  21071. */
  21072. eyeOffset: Property | undefined;
  21073. /**
  21074. * Gets or sets the Property specifying the {@link HorizontalOrigin}.
  21075. */
  21076. horizontalOrigin: Property | undefined;
  21077. /**
  21078. * Gets or sets the Property specifying the {@link VerticalOrigin}.
  21079. */
  21080. verticalOrigin: Property | undefined;
  21081. /**
  21082. * Gets or sets the Property specifying the {@link HeightReference}.
  21083. */
  21084. heightReference: Property | undefined;
  21085. /**
  21086. * Gets or sets the Property specifying the fill {@link Color}.
  21087. */
  21088. fillColor: Property | undefined;
  21089. /**
  21090. * Gets or sets the Property specifying the outline {@link Color}.
  21091. */
  21092. outlineColor: Property | undefined;
  21093. /**
  21094. * Gets or sets the numeric Property specifying the outline width.
  21095. */
  21096. outlineWidth: Property | undefined;
  21097. /**
  21098. * Gets or sets {@link NearFarScalar} Property specifying the translucency of the label based on the distance from the camera.
  21099. * A label's translucency will interpolate between the {@link NearFarScalar#nearValue} and
  21100. * {@link NearFarScalar#farValue} while the camera distance falls within the lower and upper bounds
  21101. * of the specified {@link NearFarScalar#near} and {@link NearFarScalar#far}.
  21102. * Outside of these ranges the label's translucency remains clamped to the nearest bound.
  21103. */
  21104. translucencyByDistance: Property | undefined;
  21105. /**
  21106. * Gets or sets {@link NearFarScalar} Property specifying the pixel offset of the label based on the distance from the camera.
  21107. * A label's pixel offset will interpolate between the {@link NearFarScalar#nearValue} and
  21108. * {@link NearFarScalar#farValue} while the camera distance falls within the lower and upper bounds
  21109. * of the specified {@link NearFarScalar#near} and {@link NearFarScalar#far}.
  21110. * Outside of these ranges the label's pixel offset remains clamped to the nearest bound.
  21111. */
  21112. pixelOffsetScaleByDistance: Property | undefined;
  21113. /**
  21114. * Gets or sets near and far scaling properties of a Label based on the label's distance from the camera.
  21115. * A label's scale will interpolate between the {@link NearFarScalar#nearValue} and
  21116. * {@link NearFarScalar#farValue} while the camera distance falls within the lower and upper bounds
  21117. * of the specified {@link NearFarScalar#near} and {@link NearFarScalar#far}.
  21118. * Outside of these ranges the label's scale remains clamped to the nearest bound. If undefined,
  21119. * scaleByDistance will be disabled.
  21120. */
  21121. scaleByDistance: Property | undefined;
  21122. /**
  21123. * Gets or sets the {@link DistanceDisplayCondition} Property specifying at what distance from the camera that this label will be displayed.
  21124. */
  21125. distanceDisplayCondition: Property | undefined;
  21126. /**
  21127. * Gets or sets the distance from the camera at which to disable the depth test to, for example, prevent clipping against terrain.
  21128. * When set to zero, the depth test is always applied. When set to Number.POSITIVE_INFINITY, the depth test is never applied.
  21129. */
  21130. disableDepthTestDistance: Property | undefined;
  21131. /**
  21132. * Duplicates this instance.
  21133. * @param [result] - The object onto which to store the result.
  21134. * @returns The modified result parameter or a new instance if one was not provided.
  21135. */
  21136. clone(result?: LabelGraphics): LabelGraphics;
  21137. /**
  21138. * Assigns each unassigned property on this object to the value
  21139. * of the same property on the provided source object.
  21140. * @param source - The object to be merged into this object.
  21141. */
  21142. merge(source: LabelGraphics): void;
  21143. }
  21144. /**
  21145. * A {@link Visualizer} which maps the {@link LabelGraphics} instance
  21146. * in {@link Entity#label} to a {@link Label}.
  21147. * @param entityCluster - The entity cluster to manage the collection of billboards and optionally cluster with other entities.
  21148. * @param entityCollection - The entityCollection to visualize.
  21149. */
  21150. export class LabelVisualizer {
  21151. constructor(entityCluster: EntityCluster, entityCollection: EntityCollection);
  21152. /**
  21153. * Updates the primitives created by this visualizer to match their
  21154. * Entity counterpart at the given time.
  21155. * @param time - The time to update to.
  21156. * @returns This function always returns true.
  21157. */
  21158. update(time: JulianDate): boolean;
  21159. /**
  21160. * Returns true if this object was destroyed; otherwise, false.
  21161. * @returns True if this object was destroyed; otherwise, false.
  21162. */
  21163. isDestroyed(): boolean;
  21164. /**
  21165. * Removes and destroys all primitives created by this instance.
  21166. */
  21167. destroy(): void;
  21168. }
  21169. /**
  21170. * The interface for all {@link Property} objects that represent {@link Material} uniforms.
  21171. * This type defines an interface and cannot be instantiated directly.
  21172. */
  21173. export class MaterialProperty {
  21174. constructor();
  21175. /**
  21176. * Gets a value indicating if this property is constant. A property is considered
  21177. * constant if getValue always returns the same result for the current definition.
  21178. */
  21179. readonly isConstant: boolean;
  21180. /**
  21181. * Gets the event that is raised whenever the definition of this property changes.
  21182. * The definition is considered to have changed if a call to getValue would return
  21183. * a different result for the same time.
  21184. */
  21185. readonly definitionChanged: Event;
  21186. /**
  21187. * Gets the {@link Material} type at the provided time.
  21188. * @param time - The time for which to retrieve the type.
  21189. * @returns The type of material.
  21190. */
  21191. getType(time: JulianDate): string;
  21192. /**
  21193. * Gets the value of the property at the provided time.
  21194. * @param time - The time for which to retrieve the value.
  21195. * @param [result] - The object to store the value into, if omitted, a new instance is created and returned.
  21196. * @returns The modified result parameter or a new instance if the result parameter was not supplied.
  21197. */
  21198. getValue(time: JulianDate, result?: any): any;
  21199. /**
  21200. * Compares this property to the provided property and returns
  21201. * <code>true</code> if they are equal, <code>false</code> otherwise.
  21202. * @param [other] - The other property.
  21203. * @returns <code>true</code> if left and right are equal, <code>false</code> otherwise.
  21204. */
  21205. equals(other?: Property): boolean;
  21206. }
  21207. export namespace ModelGraphics {
  21208. /**
  21209. * Initialization options for the ModelGraphics constructor
  21210. * @property [show = true] - A boolean Property specifying the visibility of the model.
  21211. * @property [uri] - A string or Resource Property specifying the URI of the glTF asset.
  21212. * @property [scale = 1.0] - A numeric Property specifying a uniform linear scale.
  21213. * @property [minimumPixelSize = 0.0] - A numeric Property specifying the approximate minimum pixel size of the model regardless of zoom.
  21214. * @property [maximumScale] - The maximum scale size of a model. An upper limit for minimumPixelSize.
  21215. * @property [incrementallyLoadTextures = true] - Determine if textures may continue to stream in after the model is loaded.
  21216. * @property [runAnimations = true] - A boolean Property specifying if glTF animations specified in the model should be started.
  21217. * @property [clampAnimations = true] - A boolean Property specifying if glTF animations should hold the last pose for time durations with no keyframes.
  21218. * @property [shadows = ShadowMode.ENABLED] - An enum Property specifying whether the model casts or receives shadows from light sources.
  21219. * @property [heightReference = HeightReference.NONE] - A Property specifying what the height is relative to.
  21220. * @property [silhouetteColor = Color.RED] - A Property specifying the {@link Color} of the silhouette.
  21221. * @property [silhouetteSize = 0.0] - A numeric Property specifying the size of the silhouette in pixels.
  21222. * @property [color = Color.WHITE] - A Property specifying the {@link Color} that blends with the model's rendered color.
  21223. * @property [colorBlendMode = ColorBlendMode.HIGHLIGHT] - An enum Property specifying how the color blends with the model.
  21224. * @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.
  21225. * @property [imageBasedLightingFactor = new Cartesian2(1.0, 1.0)] - A property specifying the contribution from diffuse and specular image-based lighting.
  21226. * @property [lightColor] - A property specifying the light color when shading the model. When <code>undefined</code> the scene's light color is used instead.
  21227. * @property [distanceDisplayCondition] - A Property specifying at what distance from the camera that this model will be displayed.
  21228. * @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.
  21229. * @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.
  21230. * @property [clippingPlanes] - A property specifying the {@link ClippingPlaneCollection} used to selectively disable rendering the model.
  21231. */
  21232. type ConstructorOptions = {
  21233. show?: Property | boolean;
  21234. uri?: Property | string | Resource;
  21235. scale?: Property | number;
  21236. minimumPixelSize?: Property | number;
  21237. maximumScale?: Property | number;
  21238. incrementallyLoadTextures?: Property | boolean;
  21239. runAnimations?: Property | boolean;
  21240. clampAnimations?: Property | boolean;
  21241. shadows?: Property | ShadowMode;
  21242. heightReference?: Property | HeightReference;
  21243. silhouetteColor?: Property | Color;
  21244. silhouetteSize?: Property | number;
  21245. color?: Property | Color;
  21246. colorBlendMode?: Property | ColorBlendMode;
  21247. colorBlendAmount?: Property | number;
  21248. imageBasedLightingFactor?: Property | Cartesian2;
  21249. lightColor?: Property | Color;
  21250. distanceDisplayCondition?: Property | DistanceDisplayCondition;
  21251. nodeTransformations?: PropertyBag | {
  21252. [key: string]: TranslationRotationScale;
  21253. };
  21254. articulations?: PropertyBag | {
  21255. [key: string]: number;
  21256. };
  21257. clippingPlanes?: Property | ClippingPlaneCollection;
  21258. };
  21259. }
  21260. /**
  21261. * A 3D model based on {@link https://github.com/KhronosGroup/glTF|glTF}, the runtime asset format for WebGL, OpenGL ES, and OpenGL.
  21262. * The position and orientation of the model is determined by the containing {@link Entity}.
  21263. * <p>
  21264. * Cesium includes support for glTF geometry, materials, animations, and skinning.
  21265. * Cameras and lights are not currently supported.
  21266. * </p>
  21267. * @param [options] - Object describing initialization options
  21268. */
  21269. export class ModelGraphics {
  21270. constructor(options?: ModelGraphics.ConstructorOptions);
  21271. /**
  21272. * Gets the event that is raised whenever a property or sub-property is changed or modified.
  21273. */
  21274. readonly definitionChanged: Event;
  21275. /**
  21276. * Gets or sets the boolean Property specifying the visibility of the model.
  21277. */
  21278. show: Property | undefined;
  21279. /**
  21280. * Gets or sets the string Property specifying the URI of the glTF asset.
  21281. */
  21282. uri: Property | undefined;
  21283. /**
  21284. * Gets or sets the numeric Property specifying a uniform linear scale
  21285. * for this model. Values greater than 1.0 increase the size of the model while
  21286. * values less than 1.0 decrease it.
  21287. */
  21288. scale: Property | undefined;
  21289. /**
  21290. * Gets or sets the numeric Property specifying the approximate minimum
  21291. * pixel size of the model regardless of zoom. This can be used to ensure that
  21292. * a model is visible even when the viewer zooms out. When <code>0.0</code>,
  21293. * no minimum size is enforced.
  21294. */
  21295. minimumPixelSize: Property | undefined;
  21296. /**
  21297. * Gets or sets the numeric Property specifying the maximum scale
  21298. * size of a model. This property is used as an upper limit for
  21299. * {@link ModelGraphics#minimumPixelSize}.
  21300. */
  21301. maximumScale: Property | undefined;
  21302. /**
  21303. * Get or sets the boolean Property specifying whether textures
  21304. * may continue to stream in after the model is loaded.
  21305. */
  21306. incrementallyLoadTextures: Property | undefined;
  21307. /**
  21308. * Gets or sets the boolean Property specifying if glTF animations should be run.
  21309. */
  21310. runAnimations: Property | undefined;
  21311. /**
  21312. * Gets or sets the boolean Property specifying if glTF animations should hold the last pose for time durations with no keyframes.
  21313. */
  21314. clampAnimations: Property | undefined;
  21315. /**
  21316. * Get or sets the enum Property specifying whether the model
  21317. * casts or receives shadows from light sources.
  21318. */
  21319. shadows: Property | undefined;
  21320. /**
  21321. * Gets or sets the Property specifying the {@link HeightReference}.
  21322. */
  21323. heightReference: Property | undefined;
  21324. /**
  21325. * Gets or sets the Property specifying the {@link Color} of the silhouette.
  21326. */
  21327. silhouetteColor: Property | undefined;
  21328. /**
  21329. * Gets or sets the numeric Property specifying the size of the silhouette in pixels.
  21330. */
  21331. silhouetteSize: Property | undefined;
  21332. /**
  21333. * Gets or sets the Property specifying the {@link Color} that blends with the model's rendered color.
  21334. */
  21335. color: Property | undefined;
  21336. /**
  21337. * Gets or sets the enum Property specifying how the color blends with the model.
  21338. */
  21339. colorBlendMode: Property | undefined;
  21340. /**
  21341. * A numeric Property specifying the color strength when the <code>colorBlendMode</code> is MIX.
  21342. * A value of 0.0 results in the model's rendered color while a value of 1.0 results in a solid color, with
  21343. * any value in-between resulting in a mix of the two.
  21344. */
  21345. colorBlendAmount: Property | undefined;
  21346. /**
  21347. * A property specifying the {@link Cartesian2} used to scale the diffuse and specular image-based lighting contribution to the final color.
  21348. */
  21349. imageBasedLightingFactor: Property | undefined;
  21350. /**
  21351. * A property specifying the {@link Cartesian3} light color when shading the model. When <code>undefined</code> the scene's light color is used instead.
  21352. */
  21353. lightColor: Property | undefined;
  21354. /**
  21355. * Gets or sets the {@link DistanceDisplayCondition} Property specifying at what distance from the camera that this model will be displayed.
  21356. */
  21357. distanceDisplayCondition: Property | undefined;
  21358. /**
  21359. * Gets or sets the set of node transformations to apply to this model. This is represented as an {@link PropertyBag}, where keys are
  21360. * names of nodes, and values are {@link TranslationRotationScale} Properties describing the transformation to apply to that node.
  21361. * The transformation is applied after the node's existing transformation as specified in the glTF, and does not replace the node's existing transformation.
  21362. */
  21363. nodeTransformations: PropertyBag;
  21364. /**
  21365. * Gets or sets the set of articulation values to apply to this model. This is represented as an {@link PropertyBag}, where keys are
  21366. * composed as the name of the articulation, a single space, and the name of the stage.
  21367. */
  21368. articulations: PropertyBag;
  21369. /**
  21370. * A property specifying the {@link ClippingPlaneCollection} used to selectively disable rendering the model.
  21371. */
  21372. clippingPlanes: Property | undefined;
  21373. /**
  21374. * Duplicates this instance.
  21375. * @param [result] - The object onto which to store the result.
  21376. * @returns The modified result parameter or a new instance if one was not provided.
  21377. */
  21378. clone(result?: ModelGraphics): ModelGraphics;
  21379. /**
  21380. * Assigns each unassigned property on this object to the value
  21381. * of the same property on the provided source object.
  21382. * @param source - The object to be merged into this object.
  21383. */
  21384. merge(source: ModelGraphics): void;
  21385. }
  21386. /**
  21387. * A {@link Visualizer} which maps {@link Entity#model} to a {@link Model}.
  21388. * @param scene - The scene the primitives will be rendered in.
  21389. * @param entityCollection - The entityCollection to visualize.
  21390. */
  21391. export class ModelVisualizer {
  21392. constructor(scene: Scene, entityCollection: EntityCollection);
  21393. /**
  21394. * Updates models created this visualizer to match their
  21395. * Entity counterpart at the given time.
  21396. * @param time - The time to update to.
  21397. * @returns This function always returns true.
  21398. */
  21399. update(time: JulianDate): boolean;
  21400. /**
  21401. * Returns true if this object was destroyed; otherwise, false.
  21402. * @returns True if this object was destroyed; otherwise, false.
  21403. */
  21404. isDestroyed(): boolean;
  21405. /**
  21406. * Removes and destroys all primitives created by this instance.
  21407. */
  21408. destroy(): void;
  21409. }
  21410. /**
  21411. * A {@link Property} that produces {@link TranslationRotationScale} data.
  21412. * @param [options] - Object with the following properties:
  21413. * @param [options.translation = Cartesian3.ZERO] - A {@link Cartesian3} Property specifying the (x, y, z) translation to apply to the node.
  21414. * @param [options.rotation = Quaternion.IDENTITY] - A {@link Quaternion} Property specifying the (x, y, z, w) rotation to apply to the node.
  21415. * @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.
  21416. */
  21417. export class NodeTransformationProperty {
  21418. constructor(options?: {
  21419. translation?: Property | Cartesian3;
  21420. rotation?: Property | Quaternion;
  21421. scale?: Property | Cartesian3;
  21422. });
  21423. /**
  21424. * Gets a value indicating if this property is constant. A property is considered
  21425. * constant if getValue always returns the same result for the current definition.
  21426. */
  21427. readonly isConstant: boolean;
  21428. /**
  21429. * Gets the event that is raised whenever the definition of this property changes.
  21430. * The definition is considered to have changed if a call to getValue would return
  21431. * a different result for the same time.
  21432. */
  21433. readonly definitionChanged: Event;
  21434. /**
  21435. * Gets or sets the {@link Cartesian3} Property specifying the (x, y, z) translation to apply to the node.
  21436. */
  21437. translation: Property | undefined;
  21438. /**
  21439. * Gets or sets the {@link Quaternion} Property specifying the (x, y, z, w) rotation to apply to the node.
  21440. */
  21441. rotation: Property | undefined;
  21442. /**
  21443. * Gets or sets the {@link Cartesian3} Property specifying the (x, y, z) scaling to apply to the node.
  21444. */
  21445. scale: Property | undefined;
  21446. /**
  21447. * Gets the value of the property at the provided time.
  21448. * @param time - The time for which to retrieve the value.
  21449. * @param [result] - The object to store the value into, if omitted, a new instance is created and returned.
  21450. * @returns The modified result parameter or a new instance if the result parameter was not supplied.
  21451. */
  21452. getValue(time: JulianDate, result?: TranslationRotationScale): TranslationRotationScale;
  21453. /**
  21454. * Compares this property to the provided property and returns
  21455. * <code>true</code> if they are equal, <code>false</code> otherwise.
  21456. * @param [other] - The other property.
  21457. * @returns <code>true</code> if left and right are equal, <code>false</code> otherwise.
  21458. */
  21459. equals(other?: Property): boolean;
  21460. }
  21461. export namespace PathGraphics {
  21462. /**
  21463. * Initialization options for the PathGraphics constructor
  21464. * @property [show = true] - A boolean Property specifying the visibility of the path.
  21465. * @property [leadTime] - A Property specifying the number of seconds in front the object to show.
  21466. * @property [trailTime] - A Property specifying the number of seconds behind of the object to show.
  21467. * @property [width = 1.0] - A numeric Property specifying the width in pixels.
  21468. * @property [resolution = 60] - A numeric Property specifying the maximum number of seconds to step when sampling the position.
  21469. * @property [material = Color.WHITE] - A Property specifying the material used to draw the path.
  21470. * @property [distanceDisplayCondition] - A Property specifying at what distance from the camera that this path will be displayed.
  21471. */
  21472. type ConstructorOptions = {
  21473. show?: Property | boolean;
  21474. leadTime?: Property | number;
  21475. trailTime?: Property | number;
  21476. width?: Property | number;
  21477. resolution?: Property | number;
  21478. material?: MaterialProperty | Color;
  21479. distanceDisplayCondition?: Property | DistanceDisplayCondition;
  21480. };
  21481. }
  21482. /**
  21483. * Describes a polyline defined as the path made by an {@link Entity} as it moves over time.
  21484. * @param [options] - Object describing initialization options
  21485. */
  21486. export class PathGraphics {
  21487. constructor(options?: PathGraphics.ConstructorOptions);
  21488. /**
  21489. * Gets the event that is raised whenever a property or sub-property is changed or modified.
  21490. */
  21491. readonly definitionChanged: Event;
  21492. /**
  21493. * Gets or sets the boolean Property specifying the visibility of the path.
  21494. */
  21495. show: Property | undefined;
  21496. /**
  21497. * Gets or sets the Property specifying the number of seconds in front of the object to show.
  21498. */
  21499. leadTime: Property | undefined;
  21500. /**
  21501. * Gets or sets the Property specifying the number of seconds behind the object to show.
  21502. */
  21503. trailTime: Property | undefined;
  21504. /**
  21505. * Gets or sets the numeric Property specifying the width in pixels.
  21506. */
  21507. width: Property | undefined;
  21508. /**
  21509. * Gets or sets the Property specifying the maximum number of seconds to step when sampling the position.
  21510. */
  21511. resolution: Property | undefined;
  21512. /**
  21513. * Gets or sets the Property specifying the material used to draw the path.
  21514. */
  21515. material: MaterialProperty;
  21516. /**
  21517. * Gets or sets the {@link DistanceDisplayCondition} Property specifying at what distance from the camera that this path will be displayed.
  21518. */
  21519. distanceDisplayCondition: Property | undefined;
  21520. /**
  21521. * Duplicates this instance.
  21522. * @param [result] - The object onto which to store the result.
  21523. * @returns The modified result parameter or a new instance if one was not provided.
  21524. */
  21525. clone(result?: PathGraphics): PathGraphics;
  21526. /**
  21527. * Assigns each unassigned property on this object to the value
  21528. * of the same property on the provided source object.
  21529. * @param source - The object to be merged into this object.
  21530. */
  21531. merge(source: PathGraphics): void;
  21532. }
  21533. /**
  21534. * A {@link Visualizer} which maps {@link Entity#path} to a {@link Polyline}.
  21535. * @param scene - The scene the primitives will be rendered in.
  21536. * @param entityCollection - The entityCollection to visualize.
  21537. */
  21538. export class PathVisualizer {
  21539. constructor(scene: Scene, entityCollection: EntityCollection);
  21540. /**
  21541. * Updates all of the primitives created by this visualizer to match their
  21542. * Entity counterpart at the given time.
  21543. * @param time - The time to update to.
  21544. * @returns This function always returns true.
  21545. */
  21546. update(time: JulianDate): boolean;
  21547. /**
  21548. * Returns true if this object was destroyed; otherwise, false.
  21549. * @returns True if this object was destroyed; otherwise, false.
  21550. */
  21551. isDestroyed(): boolean;
  21552. /**
  21553. * Removes and destroys all primitives created by this instance.
  21554. */
  21555. destroy(): void;
  21556. }
  21557. /**
  21558. * A {@link GeometryUpdater} for planes.
  21559. * Clients do not normally create this class directly, but instead rely on {@link DataSourceDisplay}.
  21560. * @param entity - The entity containing the geometry to be visualized.
  21561. * @param scene - The scene where visualization is taking place.
  21562. */
  21563. export class PlaneGeometryUpdater {
  21564. constructor(entity: Entity, scene: Scene);
  21565. /**
  21566. * Creates the geometry instance which represents the fill of the geometry.
  21567. * @param time - The time to use when retrieving initial attribute values.
  21568. * @returns The geometry instance representing the filled portion of the geometry.
  21569. */
  21570. createFillGeometryInstance(time: JulianDate): GeometryInstance;
  21571. /**
  21572. * Creates the geometry instance which represents the outline of the geometry.
  21573. * @param time - The time to use when retrieving initial attribute values.
  21574. * @returns The geometry instance representing the outline portion of the geometry.
  21575. */
  21576. createOutlineGeometryInstance(time: JulianDate): GeometryInstance;
  21577. }
  21578. export namespace PlaneGraphics {
  21579. /**
  21580. * Initialization options for the PlaneGraphics constructor
  21581. * @property [show = true] - A boolean Property specifying the visibility of the plane.
  21582. * @property [plane] - A {@link Plane} Property specifying the normal and distance for the plane.
  21583. * @property [dimensions] - A {@link Cartesian2} Property specifying the width and height of the plane.
  21584. * @property [fill = true] - A boolean Property specifying whether the plane is filled with the provided material.
  21585. * @property [material = Color.WHITE] - A Property specifying the material used to fill the plane.
  21586. * @property [outline = false] - A boolean Property specifying whether the plane is outlined.
  21587. * @property [outlineColor = Color.BLACK] - A Property specifying the {@link Color} of the outline.
  21588. * @property [outlineWidth = 1.0] - A numeric Property specifying the width of the outline.
  21589. * @property [shadows = ShadowMode.DISABLED] - An enum Property specifying whether the plane casts or receives shadows from light sources.
  21590. * @property [distanceDisplayCondition] - A Property specifying at what distance from the camera that this plane will be displayed.
  21591. */
  21592. type ConstructorOptions = {
  21593. show?: Property | boolean;
  21594. plane?: Property | Plane;
  21595. dimensions?: Property | Cartesian2;
  21596. fill?: Property | boolean;
  21597. material?: MaterialProperty | Color;
  21598. outline?: Property | boolean;
  21599. outlineColor?: Property | Color;
  21600. outlineWidth?: Property | number;
  21601. shadows?: Property | ShadowMode;
  21602. distanceDisplayCondition?: Property | DistanceDisplayCondition;
  21603. };
  21604. }
  21605. /**
  21606. * Describes a plane. The center position and orientation are determined by the containing {@link Entity}.
  21607. * @param [options] - Object describing initialization options
  21608. */
  21609. export class PlaneGraphics {
  21610. constructor(options?: PlaneGraphics.ConstructorOptions);
  21611. /**
  21612. * Gets the event that is raised whenever a property or sub-property is changed or modified.
  21613. */
  21614. readonly definitionChanged: Event;
  21615. /**
  21616. * Gets or sets the boolean Property specifying the visibility of the plane.
  21617. */
  21618. show: Property | undefined;
  21619. /**
  21620. * Gets or sets the {@link Plane} Property specifying the normal and distance of the plane.
  21621. */
  21622. plane: Property | undefined;
  21623. /**
  21624. * Gets or sets the {@link Cartesian2} Property specifying the width and height of the plane.
  21625. */
  21626. dimensions: Property | undefined;
  21627. /**
  21628. * Gets or sets the boolean Property specifying whether the plane is filled with the provided material.
  21629. */
  21630. fill: Property | undefined;
  21631. /**
  21632. * Gets or sets the material used to fill the plane.
  21633. */
  21634. material: MaterialProperty;
  21635. /**
  21636. * Gets or sets the Property specifying whether the plane is outlined.
  21637. */
  21638. outline: Property | undefined;
  21639. /**
  21640. * Gets or sets the Property specifying the {@link Color} of the outline.
  21641. */
  21642. outlineColor: Property | undefined;
  21643. /**
  21644. * Gets or sets the numeric Property specifying the width of the outline.
  21645. */
  21646. outlineWidth: Property | undefined;
  21647. /**
  21648. * Get or sets the enum Property specifying whether the plane
  21649. * casts or receives shadows from light sources.
  21650. */
  21651. shadows: Property | undefined;
  21652. /**
  21653. * Gets or sets the {@link DistanceDisplayCondition} Property specifying at what distance from the camera that this plane will be displayed.
  21654. */
  21655. distanceDisplayCondition: Property | undefined;
  21656. /**
  21657. * Duplicates this instance.
  21658. * @param [result] - The object onto which to store the result.
  21659. * @returns The modified result parameter or a new instance if one was not provided.
  21660. */
  21661. clone(result?: PlaneGraphics): PlaneGraphics;
  21662. /**
  21663. * Assigns each unassigned property on this object to the value
  21664. * of the same property on the provided source object.
  21665. * @param source - The object to be merged into this object.
  21666. */
  21667. merge(source: PlaneGraphics): void;
  21668. }
  21669. export namespace PointGraphics {
  21670. /**
  21671. * Initialization options for the PointGraphics constructor
  21672. * @property [show = true] - A boolean Property specifying the visibility of the point.
  21673. * @property [pixelSize = 1] - A numeric Property specifying the size in pixels.
  21674. * @property [heightReference = HeightReference.NONE] - A Property specifying what the height is relative to.
  21675. * @property [color = Color.WHITE] - A Property specifying the {@link Color} of the point.
  21676. * @property [outlineColor = Color.BLACK] - A Property specifying the {@link Color} of the outline.
  21677. * @property [outlineWidth = 0] - A numeric Property specifying the the outline width in pixels.
  21678. * @property [scaleByDistance] - A {@link NearFarScalar} Property used to scale the point based on distance.
  21679. * @property [translucencyByDistance] - A {@link NearFarScalar} Property used to set translucency based on distance from the camera.
  21680. * @property [distanceDisplayCondition] - A Property specifying at what distance from the camera that this point will be displayed.
  21681. * @property [disableDepthTestDistance] - A Property specifying the distance from the camera at which to disable the depth test to.
  21682. */
  21683. type ConstructorOptions = {
  21684. show?: Property | boolean;
  21685. pixelSize?: Property | number;
  21686. heightReference?: Property | HeightReference;
  21687. color?: Property | Color;
  21688. outlineColor?: Property | Color;
  21689. outlineWidth?: Property | number;
  21690. scaleByDistance?: Property | NearFarScalar;
  21691. translucencyByDistance?: Property | NearFarScalar;
  21692. distanceDisplayCondition?: Property | DistanceDisplayCondition;
  21693. disableDepthTestDistance?: Property | number;
  21694. };
  21695. }
  21696. /**
  21697. * Describes a graphical point located at the position of the containing {@link Entity}.
  21698. * @param [options] - Object describing initialization options
  21699. */
  21700. export class PointGraphics {
  21701. constructor(options?: PointGraphics.ConstructorOptions);
  21702. /**
  21703. * Gets the event that is raised whenever a property or sub-property is changed or modified.
  21704. */
  21705. readonly definitionChanged: Event;
  21706. /**
  21707. * Gets or sets the boolean Property specifying the visibility of the point.
  21708. */
  21709. show: Property | undefined;
  21710. /**
  21711. * Gets or sets the numeric Property specifying the size in pixels.
  21712. */
  21713. pixelSize: Property | undefined;
  21714. /**
  21715. * Gets or sets the Property specifying the {@link HeightReference}.
  21716. */
  21717. heightReference: Property | undefined;
  21718. /**
  21719. * Gets or sets the Property specifying the {@link Color} of the point.
  21720. */
  21721. color: Property | undefined;
  21722. /**
  21723. * Gets or sets the Property specifying the {@link Color} of the outline.
  21724. */
  21725. outlineColor: Property | undefined;
  21726. /**
  21727. * Gets or sets the numeric Property specifying the the outline width in pixels.
  21728. */
  21729. outlineWidth: Property | undefined;
  21730. /**
  21731. * Gets or sets the {@link NearFarScalar} Property used to scale the point based on distance.
  21732. * If undefined, a constant size is used.
  21733. */
  21734. scaleByDistance: Property | undefined;
  21735. /**
  21736. * Gets or sets {@link NearFarScalar} Property specifying the translucency of the point based on the distance from the camera.
  21737. * A point's translucency will interpolate between the {@link NearFarScalar#nearValue} and
  21738. * {@link NearFarScalar#farValue} while the camera distance falls within the lower and upper bounds
  21739. * of the specified {@link NearFarScalar#near} and {@link NearFarScalar#far}.
  21740. * Outside of these ranges the points's translucency remains clamped to the nearest bound.
  21741. */
  21742. translucencyByDistance: Property | undefined;
  21743. /**
  21744. * Gets or sets the {@link DistanceDisplayCondition} Property specifying at what distance from the camera that this point will be displayed.
  21745. */
  21746. distanceDisplayCondition: Property | undefined;
  21747. /**
  21748. * Gets or sets the distance from the camera at which to disable the depth test to, for example, prevent clipping against terrain.
  21749. * When set to zero, the depth test is always applied. When set to Number.POSITIVE_INFINITY, the depth test is never applied.
  21750. */
  21751. disableDepthTestDistance: Property | undefined;
  21752. /**
  21753. * Duplicates this instance.
  21754. * @param [result] - The object onto which to store the result.
  21755. * @returns The modified result parameter or a new instance if one was not provided.
  21756. */
  21757. clone(result?: PointGraphics): PointGraphics;
  21758. /**
  21759. * Assigns each unassigned property on this object to the value
  21760. * of the same property on the provided source object.
  21761. * @param source - The object to be merged into this object.
  21762. */
  21763. merge(source: PointGraphics): void;
  21764. }
  21765. /**
  21766. * A {@link Visualizer} which maps {@link Entity#point} to a {@link PointPrimitive}.
  21767. * @param entityCluster - The entity cluster to manage the collection of billboards and optionally cluster with other entities.
  21768. * @param entityCollection - The entityCollection to visualize.
  21769. */
  21770. export class PointVisualizer {
  21771. constructor(entityCluster: EntityCluster, entityCollection: EntityCollection);
  21772. /**
  21773. * Updates the primitives created by this visualizer to match their
  21774. * Entity counterpart at the given time.
  21775. * @param time - The time to update to.
  21776. * @returns This function always returns true.
  21777. */
  21778. update(time: JulianDate): boolean;
  21779. /**
  21780. * Returns true if this object was destroyed; otherwise, false.
  21781. * @returns True if this object was destroyed; otherwise, false.
  21782. */
  21783. isDestroyed(): boolean;
  21784. /**
  21785. * Removes and destroys all primitives created by this instance.
  21786. */
  21787. destroy(): void;
  21788. }
  21789. /**
  21790. * A {@link GeometryUpdater} for polygons.
  21791. * Clients do not normally create this class directly, but instead rely on {@link DataSourceDisplay}.
  21792. * @param entity - The entity containing the geometry to be visualized.
  21793. * @param scene - The scene where visualization is taking place.
  21794. */
  21795. export class PolygonGeometryUpdater {
  21796. constructor(entity: Entity, scene: Scene);
  21797. /**
  21798. * Creates the geometry instance which represents the fill of the geometry.
  21799. * @param time - The time to use when retrieving initial attribute values.
  21800. * @returns The geometry instance representing the filled portion of the geometry.
  21801. */
  21802. createFillGeometryInstance(time: JulianDate): GeometryInstance;
  21803. /**
  21804. * Creates the geometry instance which represents the outline of the geometry.
  21805. * @param time - The time to use when retrieving initial attribute values.
  21806. * @returns The geometry instance representing the outline portion of the geometry.
  21807. */
  21808. createOutlineGeometryInstance(time: JulianDate): GeometryInstance;
  21809. }
  21810. export namespace PolygonGraphics {
  21811. /**
  21812. * Initialization options for the PolygonGraphics constructor
  21813. * @property [show = true] - A boolean Property specifying the visibility of the polygon.
  21814. * @property [hierarchy] - A Property specifying the {@link PolygonHierarchy}.
  21815. * @property [height = 0] - A numeric Property specifying the altitude of the polygon relative to the ellipsoid surface.
  21816. * @property [heightReference = HeightReference.NONE] - A Property specifying what the height is relative to.
  21817. * @property [extrudedHeight] - A numeric Property specifying the altitude of the polygon's extruded face relative to the ellipsoid surface.
  21818. * @property [extrudedHeightReference = HeightReference.NONE] - A Property specifying what the extrudedHeight is relative to.
  21819. * @property [stRotation = 0.0] - A numeric property specifying the rotation of the polygon texture counter-clockwise from north.
  21820. * @property [granularity = Cesium.Math.RADIANS_PER_DEGREE] - A numeric Property specifying the angular distance between each latitude and longitude point.
  21821. * @property [fill = true] - A boolean Property specifying whether the polygon is filled with the provided material.
  21822. * @property [material = Color.WHITE] - A Property specifying the material used to fill the polygon.
  21823. * @property [outline = false] - A boolean Property specifying whether the polygon is outlined.
  21824. * @property [outlineColor = Color.BLACK] - A Property specifying the {@link Color} of the outline.
  21825. * @property [outlineWidth = 1.0] - A numeric Property specifying the width of the outline.
  21826. * @property [perPositionHeight = false] - A boolean specifying whether or not the height of each position is used.
  21827. * @property [closeTop = true] - When false, leaves off the top of an extruded polygon open.
  21828. * @property [closeBottom = true] - When false, leaves off the bottom of an extruded polygon open.
  21829. * @property [arcType = ArcType.GEODESIC] - The type of line the polygon edges must follow.
  21830. * @property [shadows = ShadowMode.DISABLED] - An enum Property specifying whether the polygon casts or receives shadows from light sources.
  21831. * @property [distanceDisplayCondition] - A Property specifying at what distance from the camera that this polygon will be displayed.
  21832. * @property [classificationType = ClassificationType.BOTH] - An enum Property specifying whether this polygon will classify terrain, 3D Tiles, or both when on the ground.
  21833. * @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.
  21834. */
  21835. type ConstructorOptions = {
  21836. show?: Property | boolean;
  21837. hierarchy?: Property | PolygonHierarchy;
  21838. height?: Property | number;
  21839. heightReference?: Property | HeightReference;
  21840. extrudedHeight?: Property | number;
  21841. extrudedHeightReference?: Property | HeightReference;
  21842. stRotation?: Property | number;
  21843. granularity?: Property | number;
  21844. fill?: Property | boolean;
  21845. material?: MaterialProperty | Color;
  21846. outline?: Property | boolean;
  21847. outlineColor?: Property | Color;
  21848. outlineWidth?: Property | number;
  21849. perPositionHeight?: Property | boolean;
  21850. closeTop?: boolean | boolean;
  21851. closeBottom?: boolean | boolean;
  21852. arcType?: Property | ArcType;
  21853. shadows?: Property | ShadowMode;
  21854. distanceDisplayCondition?: Property | DistanceDisplayCondition;
  21855. classificationType?: Property | ClassificationType;
  21856. zIndex?: ConstantProperty | number;
  21857. };
  21858. }
  21859. /**
  21860. * Describes a polygon defined by an hierarchy of linear rings which make up the outer shape and any nested holes.
  21861. * The polygon conforms to the curvature of the globe and can be placed on the surface or
  21862. * at altitude and can optionally be extruded into a volume.
  21863. * @param [options] - Object describing initialization options
  21864. */
  21865. export class PolygonGraphics {
  21866. constructor(options?: PolygonGraphics.ConstructorOptions);
  21867. /**
  21868. * Gets the event that is raised whenever a property or sub-property is changed or modified.
  21869. */
  21870. readonly definitionChanged: Event;
  21871. /**
  21872. * Gets or sets the boolean Property specifying the visibility of the polygon.
  21873. */
  21874. show: Property | undefined;
  21875. /**
  21876. * Gets or sets the Property specifying the {@link PolygonHierarchy}.
  21877. */
  21878. hierarchy: Property | undefined;
  21879. /**
  21880. * Gets or sets the numeric Property specifying the constant altitude of the polygon.
  21881. */
  21882. height: Property | undefined;
  21883. /**
  21884. * Gets or sets the Property specifying the {@link HeightReference}.
  21885. */
  21886. heightReference: Property | undefined;
  21887. /**
  21888. * Gets or sets the numeric Property specifying the altitude of the polygon extrusion.
  21889. * If {@link PolygonGraphics#perPositionHeight} is false, the volume starts at {@link PolygonGraphics#height} and ends at this altitude.
  21890. * If {@link PolygonGraphics#perPositionHeight} is true, the volume starts at the height of each {@link PolygonGraphics#hierarchy} position and ends at this altitude.
  21891. */
  21892. extrudedHeight: Property | undefined;
  21893. /**
  21894. * Gets or sets the Property specifying the extruded {@link HeightReference}.
  21895. */
  21896. extrudedHeightReference: Property | undefined;
  21897. /**
  21898. * Gets or sets the numeric property specifying the rotation of the polygon texture counter-clockwise from north.
  21899. */
  21900. stRotation: Property | undefined;
  21901. /**
  21902. * Gets or sets the numeric Property specifying the angular distance between points on the polygon.
  21903. */
  21904. granularity: Property | undefined;
  21905. /**
  21906. * Gets or sets the boolean Property specifying whether the polygon is filled with the provided material.
  21907. */
  21908. fill: Property | undefined;
  21909. /**
  21910. * Gets or sets the Property specifying the material used to fill the polygon.
  21911. */
  21912. material: MaterialProperty;
  21913. /**
  21914. * Gets or sets the Property specifying whether the polygon is outlined.
  21915. */
  21916. outline: Property | undefined;
  21917. /**
  21918. * Gets or sets the Property specifying the {@link Color} of the outline.
  21919. */
  21920. outlineColor: Property | undefined;
  21921. /**
  21922. * Gets or sets the numeric Property specifying the width of the outline.
  21923. */
  21924. outlineWidth: Property | undefined;
  21925. /**
  21926. * Gets or sets the boolean specifying whether or not the the height of each position is used.
  21927. * If true, the shape will have non-uniform altitude defined by the height of each {@link PolygonGraphics#hierarchy} position.
  21928. * If false, the shape will have a constant altitude as specified by {@link PolygonGraphics#height}.
  21929. */
  21930. perPositionHeight: Property | undefined;
  21931. /**
  21932. * Gets or sets a boolean specifying whether or not the top of an extruded polygon is included.
  21933. */
  21934. closeTop: Property | undefined;
  21935. /**
  21936. * Gets or sets a boolean specifying whether or not the bottom of an extruded polygon is included.
  21937. */
  21938. closeBottom: Property | undefined;
  21939. /**
  21940. * Gets or sets the {@link ArcType} Property specifying the type of lines the polygon edges use.
  21941. */
  21942. arcType: Property | undefined;
  21943. /**
  21944. * Get or sets the enum Property specifying whether the polygon
  21945. * casts or receives shadows from light sources.
  21946. */
  21947. shadows: Property | undefined;
  21948. /**
  21949. * Gets or sets the {@link DistanceDisplayCondition} Property specifying at what distance from the camera that this polygon will be displayed.
  21950. */
  21951. distanceDisplayCondition: Property | undefined;
  21952. /**
  21953. * Gets or sets the {@link ClassificationType} Property specifying whether this polygon will classify terrain, 3D Tiles, or both when on the ground.
  21954. */
  21955. classificationType: Property | undefined;
  21956. /**
  21957. * 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.
  21958. */
  21959. zIndex: ConstantProperty | undefined;
  21960. /**
  21961. * Duplicates this instance.
  21962. * @param [result] - The object onto which to store the result.
  21963. * @returns The modified result parameter or a new instance if one was not provided.
  21964. */
  21965. clone(result?: PolygonGraphics): PolygonGraphics;
  21966. /**
  21967. * Assigns each unassigned property on this object to the value
  21968. * of the same property on the provided source object.
  21969. * @param source - The object to be merged into this object.
  21970. */
  21971. merge(source: PolygonGraphics): void;
  21972. }
  21973. /**
  21974. * A {@link MaterialProperty} that maps to PolylineArrow {@link Material} uniforms.
  21975. * @param [color = Color.WHITE] - The {@link Color} Property to be used.
  21976. */
  21977. export class PolylineArrowMaterialProperty {
  21978. constructor(color?: Property | Color);
  21979. /**
  21980. * Gets a value indicating if this property is constant. A property is considered
  21981. * constant if getValue always returns the same result for the current definition.
  21982. */
  21983. readonly isConstant: boolean;
  21984. /**
  21985. * Gets the event that is raised whenever the definition of this property changes.
  21986. * The definition is considered to have changed if a call to getValue would return
  21987. * a different result for the same time.
  21988. */
  21989. readonly definitionChanged: Event;
  21990. /**
  21991. * Gets or sets the {@link Color} {@link Property}.
  21992. */
  21993. color: Property | undefined;
  21994. /**
  21995. * Gets the {@link Material} type at the provided time.
  21996. * @param time - The time for which to retrieve the type.
  21997. * @returns The type of material.
  21998. */
  21999. getType(time: JulianDate): string;
  22000. /**
  22001. * Gets the value of the property at the provided time.
  22002. * @param time - The time for which to retrieve the value.
  22003. * @param [result] - The object to store the value into, if omitted, a new instance is created and returned.
  22004. * @returns The modified result parameter or a new instance if the result parameter was not supplied.
  22005. */
  22006. getValue(time: JulianDate, result?: any): any;
  22007. /**
  22008. * Compares this property to the provided property and returns
  22009. * <code>true</code> if they are equal, <code>false</code> otherwise.
  22010. * @param [other] - The other property.
  22011. * @returns <code>true</code> if left and right are equal, <code>false</code> otherwise.
  22012. */
  22013. equals(other?: Property): boolean;
  22014. }
  22015. /**
  22016. * A {@link MaterialProperty} that maps to polyline dash {@link Material} uniforms.
  22017. * @param [options] - Object with the following properties:
  22018. * @param [options.color = Color.WHITE] - A Property specifying the {@link Color} of the line.
  22019. * @param [options.gapColor = Color.TRANSPARENT] - A Property specifying the {@link Color} of the gaps in the line.
  22020. * @param [options.dashLength = 16.0] - A numeric Property specifying the length of the dash pattern in pixels.
  22021. * @param [options.dashPattern = 255.0] - A numeric Property specifying a 16 bit pattern for the dash
  22022. */
  22023. export class PolylineDashMaterialProperty {
  22024. constructor(options?: {
  22025. color?: Property | Color;
  22026. gapColor?: Property | Color;
  22027. dashLength?: Property | number;
  22028. dashPattern?: Property | number;
  22029. });
  22030. /**
  22031. * Gets a value indicating if this property is constant. A property is considered
  22032. * constant if getValue always returns the same result for the current definition.
  22033. */
  22034. readonly isConstant: boolean;
  22035. /**
  22036. * Gets the event that is raised whenever the definition of this property changes.
  22037. * The definition is considered to have changed if a call to getValue would return
  22038. * a different result for the same time.
  22039. */
  22040. readonly definitionChanged: Event;
  22041. /**
  22042. * Gets or sets the Property specifying the {@link Color} of the line.
  22043. */
  22044. color: Property | undefined;
  22045. /**
  22046. * Gets or sets the Property specifying the {@link Color} of the gaps in the line.
  22047. */
  22048. gapColor: Property | undefined;
  22049. /**
  22050. * Gets or sets the numeric Property specifying the length of a dash cycle
  22051. */
  22052. dashLength: Property | undefined;
  22053. /**
  22054. * Gets or sets the numeric Property specifying a dash pattern
  22055. */
  22056. dashPattern: Property | undefined;
  22057. /**
  22058. * Gets the {@link Material} type at the provided time.
  22059. * @param time - The time for which to retrieve the type.
  22060. * @returns The type of material.
  22061. */
  22062. getType(time: JulianDate): string;
  22063. /**
  22064. * Gets the value of the property at the provided time.
  22065. * @param time - The time for which to retrieve the value.
  22066. * @param [result] - The object to store the value into, if omitted, a new instance is created and returned.
  22067. * @returns The modified result parameter or a new instance if the result parameter was not supplied.
  22068. */
  22069. getValue(time: JulianDate, result?: any): any;
  22070. /**
  22071. * Compares this property to the provided property and returns
  22072. * <code>true</code> if they are equal, <code>false</code> otherwise.
  22073. * @param [other] - The other property.
  22074. * @returns <code>true</code> if left and right are equal, <code>false</code> otherwise.
  22075. */
  22076. equals(other?: Property): boolean;
  22077. }
  22078. /**
  22079. * A {@link GeometryUpdater} for polylines.
  22080. * Clients do not normally create this class directly, but instead rely on {@link DataSourceDisplay}.
  22081. * @param entity - The entity containing the geometry to be visualized.
  22082. * @param scene - The scene where visualization is taking place.
  22083. */
  22084. export class PolylineGeometryUpdater {
  22085. constructor(entity: Entity, scene: Scene);
  22086. /**
  22087. * Gets the unique ID associated with this updater
  22088. */
  22089. readonly id: string;
  22090. /**
  22091. * Gets the entity associated with this geometry.
  22092. */
  22093. readonly entity: Entity;
  22094. /**
  22095. * Gets a value indicating if the geometry has a fill component.
  22096. */
  22097. readonly fillEnabled: boolean;
  22098. /**
  22099. * Gets a value indicating if fill visibility varies with simulation time.
  22100. */
  22101. readonly hasConstantFill: boolean;
  22102. /**
  22103. * Gets the material property used to fill the geometry.
  22104. */
  22105. readonly fillMaterialProperty: MaterialProperty;
  22106. /**
  22107. * Gets the material property used to fill the geometry when it fails the depth test.
  22108. */
  22109. readonly depthFailMaterialProperty: MaterialProperty;
  22110. /**
  22111. * Gets a value indicating if the geometry has an outline component.
  22112. */
  22113. readonly outlineEnabled: boolean;
  22114. /**
  22115. * Gets a value indicating if outline visibility varies with simulation time.
  22116. */
  22117. readonly hasConstantOutline: boolean;
  22118. /**
  22119. * Gets the {@link Color} property for the geometry outline.
  22120. */
  22121. readonly outlineColorProperty: Property;
  22122. /**
  22123. * Gets the property specifying whether the geometry
  22124. * casts or receives shadows from light sources.
  22125. */
  22126. readonly shadowsProperty: Property;
  22127. /**
  22128. * Gets or sets the {@link DistanceDisplayCondition} Property specifying at what distance from the camera that this geometry will be displayed.
  22129. */
  22130. readonly distanceDisplayConditionProperty: Property;
  22131. /**
  22132. * Gets or sets the {@link ClassificationType} Property specifying if this geometry will classify terrain, 3D Tiles, or both when on the ground.
  22133. */
  22134. readonly classificationTypeProperty: Property;
  22135. /**
  22136. * Gets a value indicating if the geometry is time-varying.
  22137. * If true, all visualization is delegated to the {@link DynamicGeometryUpdater}
  22138. * returned by GeometryUpdater#createDynamicUpdater.
  22139. */
  22140. readonly isDynamic: boolean;
  22141. /**
  22142. * Gets a value indicating if the geometry is closed.
  22143. * This property is only valid for static geometry.
  22144. */
  22145. readonly isClosed: boolean;
  22146. /**
  22147. * Gets an event that is raised whenever the public properties
  22148. * of this updater change.
  22149. */
  22150. readonly geometryChanged: boolean;
  22151. /**
  22152. * Gets a value indicating if the path of the line.
  22153. */
  22154. readonly arcType: ArcType;
  22155. /**
  22156. * Gets a value indicating if the geometry is clamped to the ground.
  22157. * Returns false if polylines on terrain is not supported.
  22158. */
  22159. readonly clampToGround: boolean;
  22160. /**
  22161. * Gets the zindex
  22162. */
  22163. readonly zIndex: number;
  22164. /**
  22165. * Checks if the geometry is outlined at the provided time.
  22166. * @param time - The time for which to retrieve visibility.
  22167. * @returns true if geometry is outlined at the provided time, false otherwise.
  22168. */
  22169. isOutlineVisible(time: JulianDate): boolean;
  22170. /**
  22171. * Checks if the geometry is filled at the provided time.
  22172. * @param time - The time for which to retrieve visibility.
  22173. * @returns true if geometry is filled at the provided time, false otherwise.
  22174. */
  22175. isFilled(time: JulianDate): boolean;
  22176. /**
  22177. * Creates the geometry instance which represents the fill of the geometry.
  22178. * @param time - The time to use when retrieving initial attribute values.
  22179. * @returns The geometry instance representing the filled portion of the geometry.
  22180. */
  22181. createFillGeometryInstance(time: JulianDate): GeometryInstance;
  22182. /**
  22183. * Creates the geometry instance which represents the outline of the geometry.
  22184. * @param time - The time to use when retrieving initial attribute values.
  22185. * @returns The geometry instance representing the outline portion of the geometry.
  22186. */
  22187. createOutlineGeometryInstance(time: JulianDate): GeometryInstance;
  22188. /**
  22189. * Returns true if this object was destroyed; otherwise, false.
  22190. * @returns True if this object was destroyed; otherwise, false.
  22191. */
  22192. isDestroyed(): boolean;
  22193. /**
  22194. * Destroys and resources used by the object. Once an object is destroyed, it should not be used.
  22195. */
  22196. destroy(): void;
  22197. }
  22198. /**
  22199. * A {@link MaterialProperty} that maps to polyline glow {@link Material} uniforms.
  22200. * @param [options] - Object with the following properties:
  22201. * @param [options.color = Color.WHITE] - A Property specifying the {@link Color} of the line.
  22202. * @param [options.glowPower = 0.25] - A numeric Property specifying the strength of the glow, as a percentage of the total line width.
  22203. * @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.
  22204. */
  22205. export class PolylineGlowMaterialProperty {
  22206. constructor(options?: {
  22207. color?: Property | Color;
  22208. glowPower?: Property | number;
  22209. taperPower?: Property | number;
  22210. });
  22211. /**
  22212. * Gets a value indicating if this property is constant. A property is considered
  22213. * constant if getValue always returns the same result for the current definition.
  22214. */
  22215. readonly isConstant: boolean;
  22216. /**
  22217. * Gets the event that is raised whenever the definition of this property changes.
  22218. * The definition is considered to have changed if a call to getValue would return
  22219. * a different result for the same time.
  22220. */
  22221. readonly definitionChanged: Event;
  22222. /**
  22223. * Gets or sets the Property specifying the {@link Color} of the line.
  22224. */
  22225. color: Property | undefined;
  22226. /**
  22227. * Gets or sets the numeric Property specifying the strength of the glow, as a percentage of the total line width (less than 1.0).
  22228. */
  22229. glowPower: Property | undefined;
  22230. /**
  22231. * 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.
  22232. */
  22233. taperPower: Property | undefined;
  22234. /**
  22235. * Gets the {@link Material} type at the provided time.
  22236. * @param time - The time for which to retrieve the type.
  22237. * @returns The type of material.
  22238. */
  22239. getType(time: JulianDate): string;
  22240. /**
  22241. * Gets the value of the property at the provided time.
  22242. * @param time - The time for which to retrieve the value.
  22243. * @param [result] - The object to store the value into, if omitted, a new instance is created and returned.
  22244. * @returns The modified result parameter or a new instance if the result parameter was not supplied.
  22245. */
  22246. getValue(time: JulianDate, result?: any): any;
  22247. /**
  22248. * Compares this property to the provided property and returns
  22249. * <code>true</code> if they are equal, <code>false</code> otherwise.
  22250. * @param [other] - The other property.
  22251. * @returns <code>true</code> if left and right are equal, <code>false</code> otherwise.
  22252. */
  22253. equals(other?: Property): boolean;
  22254. }
  22255. export namespace PolylineGraphics {
  22256. /**
  22257. * Initialization options for the PolylineGraphics constructor
  22258. * @property [show = true] - A boolean Property specifying the visibility of the polyline.
  22259. * @property [positions] - A Property specifying the array of {@link Cartesian3} positions that define the line strip.
  22260. * @property [width = 1.0] - A numeric Property specifying the width in pixels.
  22261. * @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.
  22262. * @property [material = Color.WHITE] - A Property specifying the material used to draw the polyline.
  22263. * @property [depthFailMaterial] - A property specifying the material used to draw the polyline when it is below the terrain.
  22264. * @property [arcType = ArcType.GEODESIC] - The type of line the polyline segments must follow.
  22265. * @property [clampToGround = false] - A boolean Property specifying whether the Polyline should be clamped to the ground.
  22266. * @property [shadows = ShadowMode.DISABLED] - An enum Property specifying whether the polyline casts or receives shadows from light sources.
  22267. * @property [distanceDisplayCondition] - A Property specifying at what distance from the camera that this polyline will be displayed.
  22268. * @property [classificationType = ClassificationType.BOTH] - An enum Property specifying whether this polyline will classify terrain, 3D Tiles, or both when on the ground.
  22269. * @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.
  22270. */
  22271. type ConstructorOptions = {
  22272. show?: Property | boolean;
  22273. positions?: Property | Cartesian3[];
  22274. width?: Property | number;
  22275. granularity?: Property | number;
  22276. material?: MaterialProperty | Color;
  22277. depthFailMaterial?: MaterialProperty | Color;
  22278. arcType?: Property | ArcType;
  22279. clampToGround?: Property | boolean;
  22280. shadows?: Property | ShadowMode;
  22281. distanceDisplayCondition?: Property | DistanceDisplayCondition;
  22282. classificationType?: Property | ClassificationType;
  22283. zIndex?: Property | number;
  22284. };
  22285. }
  22286. /**
  22287. * Describes a polyline. The first two positions define a line segment,
  22288. * and each additional position defines a line segment from the previous position. The segments
  22289. * can be linear connected points, great arcs, or clamped to terrain.
  22290. * @param [options] - Object describing initialization options
  22291. */
  22292. export class PolylineGraphics {
  22293. constructor(options?: PolylineGraphics.ConstructorOptions);
  22294. /**
  22295. * Gets the event that is raised whenever a property or sub-property is changed or modified.
  22296. */
  22297. readonly definitionChanged: Event;
  22298. /**
  22299. * Gets or sets the boolean Property specifying the visibility of the polyline.
  22300. */
  22301. show: Property | undefined;
  22302. /**
  22303. * Gets or sets the Property specifying the array of {@link Cartesian3}
  22304. * positions that define the line strip.
  22305. */
  22306. positions: Property | undefined;
  22307. /**
  22308. * Gets or sets the numeric Property specifying the width in pixels.
  22309. */
  22310. width: Property | undefined;
  22311. /**
  22312. * 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.
  22313. */
  22314. granularity: Property | undefined;
  22315. /**
  22316. * Gets or sets the Property specifying the material used to draw the polyline.
  22317. */
  22318. material: MaterialProperty;
  22319. /**
  22320. * Gets or sets the Property specifying the material used to draw the polyline when it fails the depth test.
  22321. * <p>
  22322. * Requires the EXT_frag_depth WebGL extension to render properly. If the extension is not supported,
  22323. * there may be artifacts.
  22324. * </p>
  22325. */
  22326. depthFailMaterial: MaterialProperty;
  22327. /**
  22328. * Gets or sets the {@link ArcType} Property specifying whether the line segments should be great arcs, rhumb lines or linearly connected.
  22329. */
  22330. arcType: Property | undefined;
  22331. /**
  22332. * Gets or sets the boolean Property specifying whether the polyline
  22333. * should be clamped to the ground.
  22334. */
  22335. clampToGround: Property | undefined;
  22336. /**
  22337. * Get or sets the enum Property specifying whether the polyline
  22338. * casts or receives shadows from light sources.
  22339. */
  22340. shadows: Property | undefined;
  22341. /**
  22342. * Gets or sets the {@link DistanceDisplayCondition} Property specifying at what distance from the camera that this polyline will be displayed.
  22343. */
  22344. distanceDisplayCondition: Property | undefined;
  22345. /**
  22346. * Gets or sets the {@link ClassificationType} Property specifying whether this polyline will classify terrain, 3D Tiles, or both when on the ground.
  22347. */
  22348. classificationType: Property | undefined;
  22349. /**
  22350. * 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.
  22351. */
  22352. zIndex: ConstantProperty | undefined;
  22353. /**
  22354. * Duplicates this instance.
  22355. * @param [result] - The object onto which to store the result.
  22356. * @returns The modified result parameter or a new instance if one was not provided.
  22357. */
  22358. clone(result?: PolylineGraphics): PolylineGraphics;
  22359. /**
  22360. * Assigns each unassigned property on this object to the value
  22361. * of the same property on the provided source object.
  22362. * @param source - The object to be merged into this object.
  22363. */
  22364. merge(source: PolylineGraphics): void;
  22365. }
  22366. /**
  22367. * A {@link MaterialProperty} that maps to polyline outline {@link Material} uniforms.
  22368. * @param [options] - Object with the following properties:
  22369. * @param [options.color = Color.WHITE] - A Property specifying the {@link Color} of the line.
  22370. * @param [options.outlineColor = Color.BLACK] - A Property specifying the {@link Color} of the outline.
  22371. * @param [options.outlineWidth = 1.0] - A numeric Property specifying the width of the outline, in pixels.
  22372. */
  22373. export class PolylineOutlineMaterialProperty {
  22374. constructor(options?: {
  22375. color?: Property | Color;
  22376. outlineColor?: Property | Color;
  22377. outlineWidth?: Property | number;
  22378. });
  22379. /**
  22380. * Gets a value indicating if this property is constant. A property is considered
  22381. * constant if getValue always returns the same result for the current definition.
  22382. */
  22383. readonly isConstant: boolean;
  22384. /**
  22385. * Gets the event that is raised whenever the definition of this property changes.
  22386. * The definition is considered to have changed if a call to getValue would return
  22387. * a different result for the same time.
  22388. */
  22389. readonly definitionChanged: Event;
  22390. /**
  22391. * Gets or sets the Property specifying the {@link Color} of the line.
  22392. */
  22393. color: Property | undefined;
  22394. /**
  22395. * Gets or sets the Property specifying the {@link Color} of the outline.
  22396. */
  22397. outlineColor: Property | undefined;
  22398. /**
  22399. * Gets or sets the numeric Property specifying the width of the outline.
  22400. */
  22401. outlineWidth: Property | undefined;
  22402. /**
  22403. * Gets the {@link Material} type at the provided time.
  22404. * @param time - The time for which to retrieve the type.
  22405. * @returns The type of material.
  22406. */
  22407. getType(time: JulianDate): string;
  22408. /**
  22409. * Gets the value of the property at the provided time.
  22410. * @param time - The time for which to retrieve the value.
  22411. * @param [result] - The object to store the value into, if omitted, a new instance is created and returned.
  22412. * @returns The modified result parameter or a new instance if the result parameter was not supplied.
  22413. */
  22414. getValue(time: JulianDate, result?: any): any;
  22415. /**
  22416. * Compares this property to the provided property and returns
  22417. * <code>true</code> if they are equal, <code>false</code> otherwise.
  22418. * @param [other] - The other property.
  22419. * @returns <code>true</code> if left and right are equal, <code>false</code> otherwise.
  22420. */
  22421. equals(other?: Property): boolean;
  22422. }
  22423. /**
  22424. * A visualizer for polylines represented by {@link Primitive} instances.
  22425. * @param scene - The scene the primitives will be rendered in.
  22426. * @param entityCollection - The entityCollection to visualize.
  22427. * @param [primitives = scene.primitives] - A collection to add primitives related to the entities
  22428. * @param [groundPrimitives = scene.groundPrimitives] - A collection to add ground primitives related to the entities
  22429. */
  22430. export class PolylineVisualizer {
  22431. constructor(scene: Scene, entityCollection: EntityCollection, primitives?: PrimitiveCollection, groundPrimitives?: PrimitiveCollection);
  22432. /**
  22433. * Updates all of the primitives created by this visualizer to match their
  22434. * Entity counterpart at the given time.
  22435. * @param time - The time to update to.
  22436. * @returns True if the visualizer successfully updated to the provided time,
  22437. * false if the visualizer is waiting for asynchronous primitives to be created.
  22438. */
  22439. update(time: JulianDate): boolean;
  22440. /**
  22441. * Returns true if this object was destroyed; otherwise, false.
  22442. * @returns True if this object was destroyed; otherwise, false.
  22443. */
  22444. isDestroyed(): boolean;
  22445. /**
  22446. * Removes and destroys all primitives created by this instance.
  22447. */
  22448. destroy(): void;
  22449. }
  22450. /**
  22451. * A {@link GeometryUpdater} for polyline volumes.
  22452. * Clients do not normally create this class directly, but instead rely on {@link DataSourceDisplay}.
  22453. * @param entity - The entity containing the geometry to be visualized.
  22454. * @param scene - The scene where visualization is taking place.
  22455. */
  22456. export class PolylineVolumeGeometryUpdater {
  22457. constructor(entity: Entity, scene: Scene);
  22458. /**
  22459. * Creates the geometry instance which represents the fill of the geometry.
  22460. * @param time - The time to use when retrieving initial attribute values.
  22461. * @returns The geometry instance representing the filled portion of the geometry.
  22462. */
  22463. createFillGeometryInstance(time: JulianDate): GeometryInstance;
  22464. /**
  22465. * Creates the geometry instance which represents the outline of the geometry.
  22466. * @param time - The time to use when retrieving initial attribute values.
  22467. * @returns The geometry instance representing the outline portion of the geometry.
  22468. */
  22469. createOutlineGeometryInstance(time: JulianDate): GeometryInstance;
  22470. }
  22471. export namespace PolylineVolumeGraphics {
  22472. /**
  22473. * Initialization options for the PolylineVolumeGraphics constructor
  22474. * @property [show = true] - A boolean Property specifying the visibility of the volume.
  22475. * @property [positions] - A Property specifying the array of {@link Cartesian3} positions which define the line strip.
  22476. * @property [shape] - A Property specifying the array of {@link Cartesian2} positions which define the shape to be extruded.
  22477. * @property [cornerType = CornerType.ROUNDED] - A {@link CornerType} Property specifying the style of the corners.
  22478. * @property [granularity = Cesium.Math.RADIANS_PER_DEGREE] - A numeric Property specifying the angular distance between each latitude and longitude point.
  22479. * @property [fill = true] - A boolean Property specifying whether the volume is filled with the provided material.
  22480. * @property [material = Color.WHITE] - A Property specifying the material used to fill the volume.
  22481. * @property [outline = false] - A boolean Property specifying whether the volume is outlined.
  22482. * @property [outlineColor = Color.BLACK] - A Property specifying the {@link Color} of the outline.
  22483. * @property [outlineWidth = 1.0] - A numeric Property specifying the width of the outline.
  22484. * @property [shadows = ShadowMode.DISABLED] - An enum Property specifying whether the volume casts or receives shadows from light sources.
  22485. * @property [distanceDisplayCondition] - A Property specifying at what distance from the camera that this volume will be displayed.
  22486. */
  22487. type ConstructorOptions = {
  22488. show?: Property | boolean;
  22489. positions?: Property | Cartesian3[];
  22490. shape?: Property | Cartesian2[];
  22491. cornerType?: Property | CornerType;
  22492. granularity?: Property | number;
  22493. fill?: Property | boolean;
  22494. material?: MaterialProperty | Color;
  22495. outline?: Property | boolean;
  22496. outlineColor?: Property | Color;
  22497. outlineWidth?: Property | number;
  22498. shadows?: Property | ShadowMode;
  22499. distanceDisplayCondition?: Property | DistanceDisplayCondition;
  22500. };
  22501. }
  22502. /**
  22503. * Describes a polyline volume defined as a line strip and corresponding two dimensional shape which is extruded along it.
  22504. * The resulting volume conforms to the curvature of the globe.
  22505. * @param [options] - Object describing initialization options
  22506. */
  22507. export class PolylineVolumeGraphics {
  22508. constructor(options?: PolylineVolumeGraphics.ConstructorOptions);
  22509. /**
  22510. * Gets the event that is raised whenever a property or sub-property is changed or modified.
  22511. */
  22512. readonly definitionChanged: Event;
  22513. /**
  22514. * Gets or sets the boolean Property specifying the visibility of the volume.
  22515. */
  22516. show: Property | undefined;
  22517. /**
  22518. * Gets or sets the Property specifying the array of {@link Cartesian3} positions which define the line strip.
  22519. */
  22520. positions: Property | undefined;
  22521. /**
  22522. * Gets or sets the Property specifying the array of {@link Cartesian2} positions which define the shape to be extruded.
  22523. */
  22524. shape: Property | undefined;
  22525. /**
  22526. * Gets or sets the {@link CornerType} Property specifying the style of the corners.
  22527. */
  22528. cornerType: Property | undefined;
  22529. /**
  22530. * Gets or sets the numeric Property specifying the angular distance between points on the volume.
  22531. */
  22532. granularity: Property | undefined;
  22533. /**
  22534. * Gets or sets the boolean Property specifying whether the volume is filled with the provided material.
  22535. */
  22536. fill: Property | undefined;
  22537. /**
  22538. * Gets or sets the Property specifying the material used to fill the volume.
  22539. */
  22540. material: MaterialProperty;
  22541. /**
  22542. * Gets or sets the Property specifying whether the volume is outlined.
  22543. */
  22544. outline: Property | undefined;
  22545. /**
  22546. * Gets or sets the Property specifying the {@link Color} of the outline.
  22547. */
  22548. outlineColor: Property | undefined;
  22549. /**
  22550. * Gets or sets the numeric Property specifying the width of the outline.
  22551. */
  22552. outlineWidth: Property | undefined;
  22553. /**
  22554. * Get or sets the enum Property specifying whether the volume
  22555. * casts or receives shadows from light sources.
  22556. */
  22557. shadows: Property | undefined;
  22558. /**
  22559. * Gets or sets the {@link DistanceDisplayCondition} Property specifying at what distance from the camera that this volume will be displayed.
  22560. */
  22561. distanceDisplayCondition: Property | undefined;
  22562. /**
  22563. * Duplicates this instance.
  22564. * @param [result] - The object onto which to store the result.
  22565. * @returns The modified result parameter or a new instance if one was not provided.
  22566. */
  22567. clone(result?: PolylineVolumeGraphics): PolylineVolumeGraphics;
  22568. /**
  22569. * Assigns each unassigned property on this object to the value
  22570. * of the same property on the provided source object.
  22571. * @param source - The object to be merged into this object.
  22572. */
  22573. merge(source: PolylineVolumeGraphics): void;
  22574. }
  22575. /**
  22576. * The interface for all {@link Property} objects that define a world
  22577. * location as a {@link Cartesian3} with an associated {@link ReferenceFrame}.
  22578. * This type defines an interface and cannot be instantiated directly.
  22579. */
  22580. export class PositionProperty {
  22581. constructor();
  22582. /**
  22583. * Gets a value indicating if this property is constant. A property is considered
  22584. * constant if getValue always returns the same result for the current definition.
  22585. */
  22586. readonly isConstant: boolean;
  22587. /**
  22588. * Gets the event that is raised whenever the definition of this property changes.
  22589. * The definition is considered to have changed if a call to getValue would return
  22590. * a different result for the same time.
  22591. */
  22592. readonly definitionChanged: Event;
  22593. /**
  22594. * Gets the reference frame that the position is defined in.
  22595. */
  22596. referenceFrame: ReferenceFrame;
  22597. /**
  22598. * Gets the value of the property at the provided time in the fixed frame.
  22599. * @param time - The time for which to retrieve the value.
  22600. * @param [result] - The object to store the value into, if omitted, a new instance is created and returned.
  22601. * @returns The modified result parameter or a new instance if the result parameter was not supplied.
  22602. */
  22603. getValue(time: JulianDate, result?: Cartesian3): Cartesian3;
  22604. /**
  22605. * Gets the value of the property at the provided time and in the provided reference frame.
  22606. * @param time - The time for which to retrieve the value.
  22607. * @param referenceFrame - The desired referenceFrame of the result.
  22608. * @param [result] - The object to store the value into, if omitted, a new instance is created and returned.
  22609. * @returns The modified result parameter or a new instance if the result parameter was not supplied.
  22610. */
  22611. getValueInReferenceFrame(time: JulianDate, referenceFrame: ReferenceFrame, result?: Cartesian3): Cartesian3;
  22612. /**
  22613. * Compares this property to the provided property and returns
  22614. * <code>true</code> if they are equal, <code>false</code> otherwise.
  22615. * @param [other] - The other property.
  22616. * @returns <code>true</code> if left and right are equal, <code>false</code> otherwise.
  22617. */
  22618. equals(other?: Property): boolean;
  22619. }
  22620. /**
  22621. * A {@link Property} whose value is an array whose items are the computed value
  22622. * of other PositionProperty instances.
  22623. * @param [value] - An array of Property instances.
  22624. * @param [referenceFrame = ReferenceFrame.FIXED] - The reference frame in which the position is defined.
  22625. */
  22626. export class PositionPropertyArray {
  22627. constructor(value?: Property[], referenceFrame?: ReferenceFrame);
  22628. /**
  22629. * Gets a value indicating if this property is constant. This property
  22630. * is considered constant if all property items in the array are constant.
  22631. */
  22632. readonly isConstant: boolean;
  22633. /**
  22634. * Gets the event that is raised whenever the definition of this property changes.
  22635. * The definition is changed whenever setValue is called with data different
  22636. * than the current value or one of the properties in the array also changes.
  22637. */
  22638. readonly definitionChanged: Event;
  22639. /**
  22640. * Gets the reference frame in which the position is defined.
  22641. */
  22642. referenceFrame: ReferenceFrame;
  22643. /**
  22644. * Gets the value of the property.
  22645. * @param time - The time for which to retrieve the value.
  22646. * @param [result] - The object to store the value into, if omitted, a new instance is created and returned.
  22647. * @returns The modified result parameter or a new instance if the result parameter was not supplied.
  22648. */
  22649. getValue(time: JulianDate, result?: Cartesian3[]): Cartesian3[];
  22650. /**
  22651. * Gets the value of the property at the provided time and in the provided reference frame.
  22652. * @param time - The time for which to retrieve the value.
  22653. * @param referenceFrame - The desired referenceFrame of the result.
  22654. * @param [result] - The object to store the value into, if omitted, a new instance is created and returned.
  22655. * @returns The modified result parameter or a new instance if the result parameter was not supplied.
  22656. */
  22657. getValueInReferenceFrame(time: JulianDate, referenceFrame: ReferenceFrame, result?: Cartesian3[]): Cartesian3[];
  22658. /**
  22659. * Sets the value of the property.
  22660. * @param value - An array of Property instances.
  22661. */
  22662. setValue(value: Property[]): void;
  22663. /**
  22664. * Compares this property to the provided property and returns
  22665. * <code>true</code> if they are equal, <code>false</code> otherwise.
  22666. * @param [other] - The other property.
  22667. * @returns <code>true</code> if left and right are equal, <code>false</code> otherwise.
  22668. */
  22669. equals(other?: Property): boolean;
  22670. }
  22671. /**
  22672. * The interface for all properties, which represent a value that can optionally vary over time.
  22673. * This type defines an interface and cannot be instantiated directly.
  22674. */
  22675. export class Property {
  22676. constructor();
  22677. /**
  22678. * Gets a value indicating if this property is constant. A property is considered
  22679. * constant if getValue always returns the same result for the current definition.
  22680. */
  22681. readonly isConstant: boolean;
  22682. /**
  22683. * Gets the event that is raised whenever the definition of this property changes.
  22684. * The definition is considered to have changed if a call to getValue would return
  22685. * a different result for the same time.
  22686. */
  22687. readonly definitionChanged: Event;
  22688. /**
  22689. * Gets the value of the property at the provided time.
  22690. * @param time - The time for which to retrieve the value.
  22691. * @param [result] - The object to store the value into, if omitted, a new instance is created and returned.
  22692. * @returns The modified result parameter or a new instance if the result parameter was not supplied.
  22693. */
  22694. getValue(time: JulianDate, result?: any): any;
  22695. /**
  22696. * Compares this property to the provided property and returns
  22697. * <code>true</code> if they are equal, <code>false</code> otherwise.
  22698. * @param [other] - The other property.
  22699. * @returns <code>true</code> if left and right are equal, <code>false</code> otherwise.
  22700. */
  22701. equals(other?: Property): boolean;
  22702. }
  22703. /**
  22704. * A {@link Property} whose value is an array whose items are the computed value
  22705. * of other property instances.
  22706. * @param [value] - An array of Property instances.
  22707. */
  22708. export class PropertyArray {
  22709. constructor(value?: Property[]);
  22710. /**
  22711. * Gets a value indicating if this property is constant. This property
  22712. * is considered constant if all property items in the array are constant.
  22713. */
  22714. readonly isConstant: boolean;
  22715. /**
  22716. * Gets the event that is raised whenever the definition of this property changes.
  22717. * The definition is changed whenever setValue is called with data different
  22718. * than the current value or one of the properties in the array also changes.
  22719. */
  22720. readonly definitionChanged: Event;
  22721. /**
  22722. * Gets the value of the property.
  22723. * @param time - The time for which to retrieve the value.
  22724. * @param [result] - The object to store the value into, if omitted, a new instance is created and returned.
  22725. * @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.
  22726. */
  22727. getValue(time: JulianDate, result?: object[]): object[];
  22728. /**
  22729. * Sets the value of the property.
  22730. * @param value - An array of Property instances.
  22731. */
  22732. setValue(value: Property[]): void;
  22733. /**
  22734. * Compares this property to the provided property and returns
  22735. * <code>true</code> if they are equal, <code>false</code> otherwise.
  22736. * @param [other] - The other property.
  22737. * @returns <code>true</code> if left and right are equal, <code>false</code> otherwise.
  22738. */
  22739. equals(other?: Property): boolean;
  22740. }
  22741. export interface PropertyBag extends DictionaryLike {
  22742. }
  22743. /**
  22744. * A {@link Property} whose value is a key-value mapping of property names to the computed value of other properties.
  22745. * @param [value] - An object, containing key-value mapping of property names to properties.
  22746. * @param [createPropertyCallback] - A function that will be called when the value of any of the properties in value are not a Property.
  22747. */
  22748. export class PropertyBag implements DictionaryLike {
  22749. constructor(value?: any, createPropertyCallback?: (...params: any[]) => any);
  22750. /**
  22751. * Gets the names of all properties registered on this instance.
  22752. */
  22753. propertyNames: any[];
  22754. /**
  22755. * Gets a value indicating if this property is constant. This property
  22756. * is considered constant if all property items in this object are constant.
  22757. */
  22758. readonly isConstant: boolean;
  22759. /**
  22760. * Gets the event that is raised whenever the set of properties contained in this
  22761. * object changes, or one of the properties itself changes.
  22762. */
  22763. readonly definitionChanged: Event;
  22764. /**
  22765. * Determines if this object has defined a property with the given name.
  22766. * @param propertyName - The name of the property to check for.
  22767. * @returns True if this object has defined a property with the given name, false otherwise.
  22768. */
  22769. hasProperty(propertyName: string): boolean;
  22770. /**
  22771. * Adds a property to this object.
  22772. * @param propertyName - The name of the property to add.
  22773. * @param [value] - The value of the new property, if provided.
  22774. * @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.
  22775. */
  22776. addProperty(propertyName: string, value?: any, createPropertyCallback?: (...params: any[]) => any): void;
  22777. /**
  22778. * Removed a property previously added with addProperty.
  22779. * @param propertyName - The name of the property to remove.
  22780. */
  22781. removeProperty(propertyName: string): void;
  22782. /**
  22783. * Gets the value of this property. Each contained property will be evaluated at the given time, and the overall
  22784. * result will be an object, mapping property names to those values.
  22785. * @param time - The time for which to retrieve the value.
  22786. * @param [result] - The object to store the value into, if omitted, a new instance is created and returned.
  22787. * Note that any properties in result which are not part of this PropertyBag will be left as-is.
  22788. * @returns The modified result parameter or a new instance if the result parameter was not supplied.
  22789. */
  22790. getValue(time: JulianDate, result?: any): any;
  22791. /**
  22792. * Assigns each unassigned property on this object to the value
  22793. * of the same property on the provided source object.
  22794. * @param source - The object to be merged into this object.
  22795. * @param [createPropertyCallback] - A function that will be called when the value of any of the properties in value are not a Property.
  22796. */
  22797. merge(source: any, createPropertyCallback?: (...params: any[]) => any): void;
  22798. /**
  22799. * Compares this property to the provided property and returns
  22800. * <code>true</code> if they are equal, <code>false</code> otherwise.
  22801. * @param [other] - The other property.
  22802. * @returns <code>true</code> if left and right are equal, <code>false</code> otherwise.
  22803. */
  22804. equals(other?: Property): boolean;
  22805. }
  22806. /**
  22807. * A {@link GeometryUpdater} for rectangles.
  22808. * Clients do not normally create this class directly, but instead rely on {@link DataSourceDisplay}.
  22809. * @param entity - The entity containing the geometry to be visualized.
  22810. * @param scene - The scene where visualization is taking place.
  22811. */
  22812. export class RectangleGeometryUpdater {
  22813. constructor(entity: Entity, scene: Scene);
  22814. /**
  22815. * Creates the geometry instance which represents the fill of the geometry.
  22816. * @param time - The time to use when retrieving initial attribute values.
  22817. * @returns The geometry instance representing the filled portion of the geometry.
  22818. */
  22819. createFillGeometryInstance(time: JulianDate): GeometryInstance;
  22820. /**
  22821. * Creates the geometry instance which represents the outline of the geometry.
  22822. * @param time - The time to use when retrieving initial attribute values.
  22823. * @returns The geometry instance representing the outline portion of the geometry.
  22824. */
  22825. createOutlineGeometryInstance(time: JulianDate): GeometryInstance;
  22826. }
  22827. export namespace RectangleGraphics {
  22828. /**
  22829. * Initialization options for the RectangleGraphics constructor
  22830. * @property [show = true] - A boolean Property specifying the visibility of the rectangle.
  22831. * @property [coordinates] - The Property specifying the {@link Rectangle}.
  22832. * @property [height = 0] - A numeric Property specifying the altitude of the rectangle relative to the ellipsoid surface.
  22833. * @property [heightReference = HeightReference.NONE] - A Property specifying what the height is relative to.
  22834. * @property [extrudedHeight] - A numeric Property specifying the altitude of the rectangle's extruded face relative to the ellipsoid surface.
  22835. * @property [extrudedHeightReference = HeightReference.NONE] - A Property specifying what the extrudedHeight is relative to.
  22836. * @property [rotation = 0.0] - A numeric property specifying the rotation of the rectangle clockwise from north.
  22837. * @property [stRotation = 0.0] - A numeric property specifying the rotation of the rectangle texture counter-clockwise from north.
  22838. * @property [granularity = Cesium.Math.RADIANS_PER_DEGREE] - A numeric Property specifying the angular distance between points on the rectangle.
  22839. * @property [fill = true] - A boolean Property specifying whether the rectangle is filled with the provided material.
  22840. * @property [material = Color.WHITE] - A Property specifying the material used to fill the rectangle.
  22841. * @property [outline = false] - A boolean Property specifying whether the rectangle is outlined.
  22842. * @property [outlineColor = Color.BLACK] - A Property specifying the {@link Color} of the outline.
  22843. * @property [outlineWidth = 1.0] - A numeric Property specifying the width of the outline.
  22844. * @property [shadows = ShadowMode.DISABLED] - An enum Property specifying whether the rectangle casts or receives shadows from light sources.
  22845. * @property [distanceDisplayCondition] - A Property specifying at what distance from the camera that this rectangle will be displayed.
  22846. * @property [classificationType = ClassificationType.BOTH] - An enum Property specifying whether this rectangle will classify terrain, 3D Tiles, or both when on the ground.
  22847. * @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.
  22848. */
  22849. type ConstructorOptions = {
  22850. show?: Property | boolean;
  22851. coordinates?: Property | Rectangle;
  22852. height?: Property | number;
  22853. heightReference?: Property | HeightReference;
  22854. extrudedHeight?: Property | number;
  22855. extrudedHeightReference?: Property | HeightReference;
  22856. rotation?: Property | number;
  22857. stRotation?: Property | number;
  22858. granularity?: Property | number;
  22859. fill?: Property | boolean;
  22860. material?: MaterialProperty | Color;
  22861. outline?: Property | boolean;
  22862. outlineColor?: Property | Color;
  22863. outlineWidth?: Property | number;
  22864. shadows?: Property | ShadowMode;
  22865. distanceDisplayCondition?: Property | DistanceDisplayCondition;
  22866. classificationType?: Property | ClassificationType;
  22867. zIndex?: Property | number;
  22868. };
  22869. }
  22870. /**
  22871. * Describes graphics for a {@link Rectangle}.
  22872. * The rectangle conforms to the curvature of the globe and can be placed on the surface or
  22873. * at altitude and can optionally be extruded into a volume.
  22874. * @param [options] - Object describing initialization options
  22875. */
  22876. export class RectangleGraphics {
  22877. constructor(options?: RectangleGraphics.ConstructorOptions);
  22878. /**
  22879. * Gets the event that is raised whenever a property or sub-property is changed or modified.
  22880. */
  22881. readonly definitionChanged: Event;
  22882. /**
  22883. * Gets or sets the boolean Property specifying the visibility of the rectangle.
  22884. */
  22885. show: Property | undefined;
  22886. /**
  22887. * Gets or sets the Property specifying the {@link Rectangle}.
  22888. */
  22889. coordinates: Property | undefined;
  22890. /**
  22891. * Gets or sets the numeric Property specifying the altitude of the rectangle.
  22892. */
  22893. height: Property | undefined;
  22894. /**
  22895. * Gets or sets the Property specifying the {@link HeightReference}.
  22896. */
  22897. heightReference: Property | undefined;
  22898. /**
  22899. * Gets or sets the numeric Property specifying the altitude of the rectangle extrusion.
  22900. * Setting this property creates volume starting at height and ending at this altitude.
  22901. */
  22902. extrudedHeight: Property | undefined;
  22903. /**
  22904. * Gets or sets the Property specifying the extruded {@link HeightReference}.
  22905. */
  22906. extrudedHeightReference: Property | undefined;
  22907. /**
  22908. * Gets or sets the numeric property specifying the rotation of the rectangle clockwise from north.
  22909. */
  22910. rotation: Property | undefined;
  22911. /**
  22912. * Gets or sets the numeric property specifying the rotation of the rectangle texture counter-clockwise from north.
  22913. */
  22914. stRotation: Property | undefined;
  22915. /**
  22916. * Gets or sets the numeric Property specifying the angular distance between points on the rectangle.
  22917. */
  22918. granularity: Property | undefined;
  22919. /**
  22920. * Gets or sets the boolean Property specifying whether the rectangle is filled with the provided material.
  22921. */
  22922. fill: Property | undefined;
  22923. /**
  22924. * Gets or sets the Property specifying the material used to fill the rectangle.
  22925. */
  22926. material: MaterialProperty;
  22927. /**
  22928. * Gets or sets the Property specifying whether the rectangle is outlined.
  22929. */
  22930. outline: Property | undefined;
  22931. /**
  22932. * Gets or sets the Property specifying the {@link Color} of the outline.
  22933. */
  22934. outlineColor: Property | undefined;
  22935. /**
  22936. * Gets or sets the numeric Property specifying the width of the outline.
  22937. */
  22938. outlineWidth: Property | undefined;
  22939. /**
  22940. * Get or sets the enum Property specifying whether the rectangle
  22941. * casts or receives shadows from light sources.
  22942. */
  22943. shadows: Property | undefined;
  22944. /**
  22945. * Gets or sets the {@link DistanceDisplayCondition} Property specifying at what distance from the camera that this rectangle will be displayed.
  22946. */
  22947. distanceDisplayCondition: Property | undefined;
  22948. /**
  22949. * Gets or sets the {@link ClassificationType} Property specifying whether this rectangle will classify terrain, 3D Tiles, or both when on the ground.
  22950. */
  22951. classificationType: Property | undefined;
  22952. /**
  22953. * 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.
  22954. */
  22955. zIndex: ConstantProperty | undefined;
  22956. /**
  22957. * Duplicates this instance.
  22958. * @param [result] - The object onto which to store the result.
  22959. * @returns The modified result parameter or a new instance if one was not provided.
  22960. */
  22961. clone(result?: RectangleGraphics): RectangleGraphics;
  22962. /**
  22963. * Assigns each unassigned property on this object to the value
  22964. * of the same property on the provided source object.
  22965. * @param source - The object to be merged into this object.
  22966. */
  22967. merge(source: RectangleGraphics): void;
  22968. }
  22969. /**
  22970. * A {@link Property} which transparently links to another property on a provided object.
  22971. * @example
  22972. * var collection = new Cesium.EntityCollection();
  22973. *
  22974. * //Create a new entity and assign a billboard scale.
  22975. * var object1 = new Cesium.Entity({id:'object1'});
  22976. * object1.billboard = new Cesium.BillboardGraphics();
  22977. * object1.billboard.scale = new Cesium.ConstantProperty(2.0);
  22978. * collection.add(object1);
  22979. *
  22980. * //Create a second entity and reference the scale from the first one.
  22981. * var object2 = new Cesium.Entity({id:'object2'});
  22982. * object2.model = new Cesium.ModelGraphics();
  22983. * object2.model.scale = new Cesium.ReferenceProperty(collection, 'object1', ['billboard', 'scale']);
  22984. * collection.add(object2);
  22985. *
  22986. * //Create a third object, but use the fromString helper function.
  22987. * var object3 = new Cesium.Entity({id:'object3'});
  22988. * object3.billboard = new Cesium.BillboardGraphics();
  22989. * object3.billboard.scale = Cesium.ReferenceProperty.fromString(collection, 'object1#billboard.scale');
  22990. * collection.add(object3);
  22991. *
  22992. * //You can refer to an entity with a # or . in id and property names by escaping them.
  22993. * var object4 = new Cesium.Entity({id:'#object.4'});
  22994. * object4.billboard = new Cesium.BillboardGraphics();
  22995. * object4.billboard.scale = new Cesium.ConstantProperty(2.0);
  22996. * collection.add(object4);
  22997. *
  22998. * var object5 = new Cesium.Entity({id:'object5'});
  22999. * object5.billboard = new Cesium.BillboardGraphics();
  23000. * object5.billboard.scale = Cesium.ReferenceProperty.fromString(collection, '\\#object\\.4#billboard.scale');
  23001. * collection.add(object5);
  23002. * @param targetCollection - The entity collection which will be used to resolve the reference.
  23003. * @param targetId - The id of the entity which is being referenced.
  23004. * @param targetPropertyNames - The names of the property on the target entity which we will use.
  23005. */
  23006. export class ReferenceProperty {
  23007. constructor(targetCollection: EntityCollection, targetId: string, targetPropertyNames: string[]);
  23008. /**
  23009. * Gets a value indicating if this property is constant.
  23010. */
  23011. readonly isConstant: boolean;
  23012. /**
  23013. * Gets the event that is raised whenever the definition of this property changes.
  23014. * The definition is changed whenever the referenced property's definition is changed.
  23015. */
  23016. readonly definitionChanged: Event;
  23017. /**
  23018. * Gets the reference frame that the position is defined in.
  23019. * This property is only valid if the referenced property is a {@link PositionProperty}.
  23020. */
  23021. readonly referenceFrame: ReferenceFrame;
  23022. /**
  23023. * Gets the id of the entity being referenced.
  23024. */
  23025. readonly targetId: string;
  23026. /**
  23027. * Gets the collection containing the entity being referenced.
  23028. */
  23029. readonly targetCollection: EntityCollection;
  23030. /**
  23031. * Gets the array of property names used to retrieve the referenced property.
  23032. */
  23033. readonly targetPropertyNames: string[];
  23034. /**
  23035. * Gets the resolved instance of the underlying referenced property.
  23036. */
  23037. readonly resolvedProperty: Property | undefined;
  23038. /**
  23039. * Creates a new instance given the entity collection that will
  23040. * be used to resolve it and a string indicating the target entity id and property.
  23041. * The format of the string is "objectId#foo.bar", where # separates the id from
  23042. * property path and . separates sub-properties. If the reference identifier or
  23043. * or any sub-properties contains a # . or \ they must be escaped.
  23044. * @returns A new instance of ReferenceProperty.
  23045. */
  23046. static fromString(targetCollection: EntityCollection, referenceString: string): ReferenceProperty;
  23047. /**
  23048. * Gets the value of the property at the provided time.
  23049. * @param time - The time for which to retrieve the value.
  23050. * @param [result] - The object to store the value into, if omitted, a new instance is created and returned.
  23051. * @returns The modified result parameter or a new instance if the result parameter was not supplied.
  23052. */
  23053. getValue(time: JulianDate, result?: any): any;
  23054. /**
  23055. * Gets the value of the property at the provided time and in the provided reference frame.
  23056. * This method is only valid if the property being referenced is a {@link PositionProperty}.
  23057. * @param time - The time for which to retrieve the value.
  23058. * @param referenceFrame - The desired referenceFrame of the result.
  23059. * @param [result] - The object to store the value into, if omitted, a new instance is created and returned.
  23060. * @returns The modified result parameter or a new instance if the result parameter was not supplied.
  23061. */
  23062. getValueInReferenceFrame(time: JulianDate, referenceFrame: ReferenceFrame, result?: Cartesian3): Cartesian3;
  23063. /**
  23064. * Gets the {@link Material} type at the provided time.
  23065. * This method is only valid if the property being referenced is a {@link MaterialProperty}.
  23066. * @param time - The time for which to retrieve the type.
  23067. * @returns The type of material.
  23068. */
  23069. getType(time: JulianDate): string;
  23070. /**
  23071. * Compares this property to the provided property and returns
  23072. * <code>true</code> if they are equal, <code>false</code> otherwise.
  23073. * @param [other] - The other property.
  23074. * @returns <code>true</code> if left and right are equal, <code>false</code> otherwise.
  23075. */
  23076. equals(other?: Property): boolean;
  23077. }
  23078. export namespace Rotation {
  23079. /**
  23080. * The number of elements used to pack the object into an array.
  23081. */
  23082. var packedLength: number;
  23083. /**
  23084. * Stores the provided instance into the provided array.
  23085. * @param value - The value to pack.
  23086. * @param array - The array to pack into.
  23087. * @param [startingIndex = 0] - The index into the array at which to start packing the elements.
  23088. * @returns The array that was packed into
  23089. */
  23090. function pack(value: Rotation, array: number[], startingIndex?: number): number[];
  23091. /**
  23092. * Retrieves an instance from a packed array.
  23093. * @param array - The packed array.
  23094. * @param [startingIndex = 0] - The starting index of the element to be unpacked.
  23095. * @param [result] - The object into which to store the result.
  23096. * @returns The modified result parameter or a new Rotation instance if one was not provided.
  23097. */
  23098. function unpack(array: number[], startingIndex?: number, result?: Rotation): Rotation;
  23099. /**
  23100. * Converts a packed array into a form suitable for interpolation.
  23101. * @param packedArray - The packed array.
  23102. * @param [startingIndex = 0] - The index of the first element to be converted.
  23103. * @param [lastIndex = packedArray.length] - The index of the last element to be converted.
  23104. * @param [result] - The object into which to store the result.
  23105. */
  23106. function convertPackedArrayForInterpolation(packedArray: number[], startingIndex?: number, lastIndex?: number, result?: number[]): void;
  23107. /**
  23108. * Retrieves an instance from a packed array converted with {@link Rotation.convertPackedArrayForInterpolation}.
  23109. * @param array - The array previously packed for interpolation.
  23110. * @param sourceArray - The original packed array.
  23111. * @param [firstIndex = 0] - The firstIndex used to convert the array.
  23112. * @param [lastIndex = packedArray.length] - The lastIndex used to convert the array.
  23113. * @param [result] - The object into which to store the result.
  23114. * @returns The modified result parameter or a new Rotation instance if one was not provided.
  23115. */
  23116. function unpackInterpolationResult(array: number[], sourceArray: number[], firstIndex?: number, lastIndex?: number, result?: Rotation): Rotation;
  23117. }
  23118. /**
  23119. * Represents a {@link Packable} number that always interpolates values
  23120. * towards the shortest angle of rotation. This object is never used directly
  23121. * but is instead passed to the constructor of {@link SampledProperty}
  23122. * in order to represent a two-dimensional angle of rotation.
  23123. * @example
  23124. * var time1 = Cesium.JulianDate.fromIso8601('2010-05-07T00:00:00');
  23125. * var time2 = Cesium.JulianDate.fromIso8601('2010-05-07T00:01:00');
  23126. * var time3 = Cesium.JulianDate.fromIso8601('2010-05-07T00:02:00');
  23127. *
  23128. * var property = new Cesium.SampledProperty(Cesium.Rotation);
  23129. * property.addSample(time1, 0);
  23130. * property.addSample(time3, Cesium.Math.toRadians(350));
  23131. *
  23132. * //Getting the value at time2 will equal 355 degrees instead
  23133. * //of 175 degrees (which is what you get if you construct
  23134. * //a SampledProperty(Number) instead. Note, the actual
  23135. * //return value is in radians, not degrees.
  23136. * property.getValue(time2);
  23137. */
  23138. export interface Rotation {
  23139. }
  23140. /**
  23141. * A {@link SampledProperty} which is also a {@link PositionProperty}.
  23142. * @param [referenceFrame = ReferenceFrame.FIXED] - The reference frame in which the position is defined.
  23143. * @param [numberOfDerivatives = 0] - The number of derivatives that accompany each position; i.e. velocity, acceleration, etc...
  23144. */
  23145. export class SampledPositionProperty {
  23146. constructor(referenceFrame?: ReferenceFrame, numberOfDerivatives?: number);
  23147. /**
  23148. * Gets a value indicating if this property is constant. A property is considered
  23149. * constant if getValue always returns the same result for the current definition.
  23150. */
  23151. readonly isConstant: boolean;
  23152. /**
  23153. * Gets the event that is raised whenever the definition of this property changes.
  23154. * The definition is considered to have changed if a call to getValue would return
  23155. * a different result for the same time.
  23156. */
  23157. readonly definitionChanged: Event;
  23158. /**
  23159. * Gets the reference frame in which the position is defined.
  23160. */
  23161. referenceFrame: ReferenceFrame;
  23162. /**
  23163. * Gets the degree of interpolation to perform when retrieving a value. Call <code>setInterpolationOptions</code> to set this.
  23164. */
  23165. readonly interpolationDegree: number;
  23166. /**
  23167. * Gets the interpolation algorithm to use when retrieving a value. Call <code>setInterpolationOptions</code> to set this.
  23168. */
  23169. readonly interpolationAlgorithm: InterpolationAlgorithm;
  23170. /**
  23171. * The number of derivatives contained by this property; i.e. 0 for just position, 1 for velocity, etc.
  23172. */
  23173. numberOfDerivatives: number;
  23174. /**
  23175. * Gets or sets the type of extrapolation to perform when a value
  23176. * is requested at a time after any available samples.
  23177. */
  23178. forwardExtrapolationType: ExtrapolationType;
  23179. /**
  23180. * Gets or sets the amount of time to extrapolate forward before
  23181. * the property becomes undefined. A value of 0 will extrapolate forever.
  23182. */
  23183. forwardExtrapolationDuration: number;
  23184. /**
  23185. * Gets or sets the type of extrapolation to perform when a value
  23186. * is requested at a time before any available samples.
  23187. */
  23188. backwardExtrapolationType: ExtrapolationType;
  23189. /**
  23190. * Gets or sets the amount of time to extrapolate backward
  23191. * before the property becomes undefined. A value of 0 will extrapolate forever.
  23192. */
  23193. backwardExtrapolationDuration: number;
  23194. /**
  23195. * Gets the position at the provided time.
  23196. * @param time - The time for which to retrieve the value.
  23197. * @param [result] - The object to store the value into, if omitted, a new instance is created and returned.
  23198. * @returns The modified result parameter or a new instance if the result parameter was not supplied.
  23199. */
  23200. getValue(time: JulianDate, result?: Cartesian3): Cartesian3;
  23201. /**
  23202. * Gets the position at the provided time and in the provided reference frame.
  23203. * @param time - The time for which to retrieve the value.
  23204. * @param referenceFrame - The desired referenceFrame of the result.
  23205. * @param [result] - The object to store the value into, if omitted, a new instance is created and returned.
  23206. * @returns The modified result parameter or a new instance if the result parameter was not supplied.
  23207. */
  23208. getValueInReferenceFrame(time: JulianDate, referenceFrame: ReferenceFrame, result?: Cartesian3): Cartesian3;
  23209. /**
  23210. * Sets the algorithm and degree to use when interpolating a position.
  23211. * @param [options] - Object with the following properties:
  23212. * @param [options.interpolationAlgorithm] - The new interpolation algorithm. If undefined, the existing property will be unchanged.
  23213. * @param [options.interpolationDegree] - The new interpolation degree. If undefined, the existing property will be unchanged.
  23214. */
  23215. setInterpolationOptions(options?: {
  23216. interpolationAlgorithm?: InterpolationAlgorithm;
  23217. interpolationDegree?: number;
  23218. }): void;
  23219. /**
  23220. * Adds a new sample.
  23221. * @param time - The sample time.
  23222. * @param position - The position at the provided time.
  23223. * @param [derivatives] - The array of derivative values at the provided time.
  23224. */
  23225. addSample(time: JulianDate, position: Cartesian3, derivatives?: Cartesian3[]): void;
  23226. /**
  23227. * Adds multiple samples via parallel arrays.
  23228. * @param times - An array of JulianDate instances where each index is a sample time.
  23229. * @param positions - An array of Cartesian3 position instances, where each value corresponds to the provided time index.
  23230. * @param [derivatives] - An array where each value is another array containing derivatives for the corresponding time index.
  23231. */
  23232. addSamples(times: JulianDate[], positions: Cartesian3[], derivatives?: any[][]): void;
  23233. /**
  23234. * Adds samples as a single packed array where each new sample is represented as a date,
  23235. * followed by the packed representation of the corresponding value and derivatives.
  23236. * @param packedSamples - The array of packed samples.
  23237. * @param [epoch] - If any of the dates in packedSamples are numbers, they are considered an offset from this epoch, in seconds.
  23238. */
  23239. addSamplesPackedArray(packedSamples: number[], epoch?: JulianDate): void;
  23240. /**
  23241. * Removes a sample at the given time, if present.
  23242. * @param time - The sample time.
  23243. * @returns <code>true</code> if a sample at time was removed, <code>false</code> otherwise.
  23244. */
  23245. removeSample(time: JulianDate): boolean;
  23246. /**
  23247. * Removes all samples for the given time interval.
  23248. * @param time - The time interval for which to remove all samples.
  23249. */
  23250. removeSamples(time: TimeInterval): void;
  23251. /**
  23252. * Compares this property to the provided property and returns
  23253. * <code>true</code> if they are equal, <code>false</code> otherwise.
  23254. * @param [other] - The other property.
  23255. * @returns <code>true</code> if left and right are equal, <code>false</code> otherwise.
  23256. */
  23257. equals(other?: Property): boolean;
  23258. }
  23259. /**
  23260. * A {@link Property} whose value is interpolated for a given time from the
  23261. * provided set of samples and specified interpolation algorithm and degree.
  23262. * @example
  23263. * //Create a linearly interpolated Cartesian2
  23264. * var property = new Cesium.SampledProperty(Cesium.Cartesian2);
  23265. *
  23266. * //Populate it with data
  23267. * property.addSample(Cesium.JulianDate.fromIso8601('2012-08-01T00:00:00.00Z'), new Cesium.Cartesian2(0, 0));
  23268. * property.addSample(Cesium.JulianDate.fromIso8601('2012-08-02T00:00:00.00Z'), new Cesium.Cartesian2(4, 7));
  23269. *
  23270. * //Retrieve an interpolated value
  23271. * var result = property.getValue(Cesium.JulianDate.fromIso8601('2012-08-01T12:00:00.00Z'));
  23272. * @example
  23273. * //Create a simple numeric SampledProperty that uses third degree Hermite Polynomial Approximation
  23274. * var property = new Cesium.SampledProperty(Number);
  23275. * property.setInterpolationOptions({
  23276. * interpolationDegree : 3,
  23277. * interpolationAlgorithm : Cesium.HermitePolynomialApproximation
  23278. * });
  23279. *
  23280. * //Populate it with data
  23281. * property.addSample(Cesium.JulianDate.fromIso8601('2012-08-01T00:00:00.00Z'), 1.0);
  23282. * property.addSample(Cesium.JulianDate.fromIso8601('2012-08-01T00:01:00.00Z'), 6.0);
  23283. * property.addSample(Cesium.JulianDate.fromIso8601('2012-08-01T00:02:00.00Z'), 12.0);
  23284. * property.addSample(Cesium.JulianDate.fromIso8601('2012-08-01T00:03:30.00Z'), 5.0);
  23285. * property.addSample(Cesium.JulianDate.fromIso8601('2012-08-01T00:06:30.00Z'), 2.0);
  23286. *
  23287. * //Samples can be added in any order.
  23288. * property.addSample(Cesium.JulianDate.fromIso8601('2012-08-01T00:00:30.00Z'), 6.2);
  23289. *
  23290. * //Retrieve an interpolated value
  23291. * var result = property.getValue(Cesium.JulianDate.fromIso8601('2012-08-01T00:02:34.00Z'));
  23292. * @param type - The type of property.
  23293. * @param [derivativeTypes] - When supplied, indicates that samples will contain derivative information of the specified types.
  23294. */
  23295. export class SampledProperty {
  23296. constructor(type: number | Packable, derivativeTypes?: Packable[]);
  23297. /**
  23298. * Gets a value indicating if this property is constant. A property is considered
  23299. * constant if getValue always returns the same result for the current definition.
  23300. */
  23301. readonly isConstant: boolean;
  23302. /**
  23303. * Gets the event that is raised whenever the definition of this property changes.
  23304. * The definition is considered to have changed if a call to getValue would return
  23305. * a different result for the same time.
  23306. */
  23307. readonly definitionChanged: Event;
  23308. /**
  23309. * Gets the type of property.
  23310. */
  23311. type: any;
  23312. /**
  23313. * Gets the derivative types used by this property.
  23314. */
  23315. derivativeTypes: Packable[];
  23316. /**
  23317. * Gets the degree of interpolation to perform when retrieving a value.
  23318. */
  23319. interpolationDegree: number;
  23320. /**
  23321. * Gets the interpolation algorithm to use when retrieving a value.
  23322. */
  23323. interpolationAlgorithm: InterpolationAlgorithm;
  23324. /**
  23325. * Gets or sets the type of extrapolation to perform when a value
  23326. * is requested at a time after any available samples.
  23327. */
  23328. forwardExtrapolationType: ExtrapolationType;
  23329. /**
  23330. * Gets or sets the amount of time to extrapolate forward before
  23331. * the property becomes undefined. A value of 0 will extrapolate forever.
  23332. */
  23333. forwardExtrapolationDuration: number;
  23334. /**
  23335. * Gets or sets the type of extrapolation to perform when a value
  23336. * is requested at a time before any available samples.
  23337. */
  23338. backwardExtrapolationType: ExtrapolationType;
  23339. /**
  23340. * Gets or sets the amount of time to extrapolate backward
  23341. * before the property becomes undefined. A value of 0 will extrapolate forever.
  23342. */
  23343. backwardExtrapolationDuration: number;
  23344. /**
  23345. * Gets the value of the property at the provided time.
  23346. * @param time - The time for which to retrieve the value.
  23347. * @param [result] - The object to store the value into, if omitted, a new instance is created and returned.
  23348. * @returns The modified result parameter or a new instance if the result parameter was not supplied.
  23349. */
  23350. getValue(time: JulianDate, result?: any): any;
  23351. /**
  23352. * Sets the algorithm and degree to use when interpolating a value.
  23353. * @param [options] - Object with the following properties:
  23354. * @param [options.interpolationAlgorithm] - The new interpolation algorithm. If undefined, the existing property will be unchanged.
  23355. * @param [options.interpolationDegree] - The new interpolation degree. If undefined, the existing property will be unchanged.
  23356. */
  23357. setInterpolationOptions(options?: {
  23358. interpolationAlgorithm?: InterpolationAlgorithm;
  23359. interpolationDegree?: number;
  23360. }): void;
  23361. /**
  23362. * Adds a new sample.
  23363. * @param time - The sample time.
  23364. * @param value - The value at the provided time.
  23365. * @param [derivatives] - The array of derivatives at the provided time.
  23366. */
  23367. addSample(time: JulianDate, value: Packable, derivatives?: Packable[]): void;
  23368. /**
  23369. * Adds an array of samples.
  23370. * @param times - An array of JulianDate instances where each index is a sample time.
  23371. * @param values - The array of values, where each value corresponds to the provided times index.
  23372. * @param [derivativeValues] - An array where each item is the array of derivatives at the equivalent time index.
  23373. */
  23374. addSamples(times: JulianDate[], values: Packable[], derivativeValues?: any[][]): void;
  23375. /**
  23376. * Adds samples as a single packed array where each new sample is represented as a date,
  23377. * followed by the packed representation of the corresponding value and derivatives.
  23378. * @param packedSamples - The array of packed samples.
  23379. * @param [epoch] - If any of the dates in packedSamples are numbers, they are considered an offset from this epoch, in seconds.
  23380. */
  23381. addSamplesPackedArray(packedSamples: number[], epoch?: JulianDate): void;
  23382. /**
  23383. * Removes a sample at the given time, if present.
  23384. * @param time - The sample time.
  23385. * @returns <code>true</code> if a sample at time was removed, <code>false</code> otherwise.
  23386. */
  23387. removeSample(time: JulianDate): boolean;
  23388. /**
  23389. * Removes all samples for the given time interval.
  23390. * @param time - The time interval for which to remove all samples.
  23391. */
  23392. removeSamples(time: TimeInterval): void;
  23393. /**
  23394. * Compares this property to the provided property and returns
  23395. * <code>true</code> if they are equal, <code>false</code> otherwise.
  23396. * @param [other] - The other property.
  23397. * @returns <code>true</code> if left and right are equal, <code>false</code> otherwise.
  23398. */
  23399. equals(other?: Property): boolean;
  23400. }
  23401. /**
  23402. * A {@link MaterialProperty} that maps to stripe {@link Material} uniforms.
  23403. * @param [options] - Object with the following properties:
  23404. * @param [options.orientation = StripeOrientation.HORIZONTAL] - A Property specifying the {@link StripeOrientation}.
  23405. * @param [options.evenColor = Color.WHITE] - A Property specifying the first {@link Color}.
  23406. * @param [options.oddColor = Color.BLACK] - A Property specifying the second {@link Color}.
  23407. * @param [options.offset = 0] - A numeric Property specifying how far into the pattern to start the material.
  23408. * @param [options.repeat = 1] - A numeric Property specifying how many times the stripes repeat.
  23409. */
  23410. export class StripeMaterialProperty {
  23411. constructor(options?: {
  23412. orientation?: Property | StripeOrientation;
  23413. evenColor?: Property | Color;
  23414. oddColor?: Property | Color;
  23415. offset?: Property | number;
  23416. repeat?: Property | number;
  23417. });
  23418. /**
  23419. * Gets a value indicating if this property is constant. A property is considered
  23420. * constant if getValue always returns the same result for the current definition.
  23421. */
  23422. readonly isConstant: boolean;
  23423. /**
  23424. * Gets the event that is raised whenever the definition of this property changes.
  23425. * The definition is considered to have changed if a call to getValue would return
  23426. * a different result for the same time.
  23427. */
  23428. readonly definitionChanged: Event;
  23429. /**
  23430. * Gets or sets the Property specifying the {@link StripeOrientation}/
  23431. */
  23432. orientation: Property | undefined;
  23433. /**
  23434. * Gets or sets the Property specifying the first {@link Color}.
  23435. */
  23436. evenColor: Property | undefined;
  23437. /**
  23438. * Gets or sets the Property specifying the second {@link Color}.
  23439. */
  23440. oddColor: Property | undefined;
  23441. /**
  23442. * Gets or sets the numeric Property specifying the point into the pattern
  23443. * to begin drawing; with 0.0 being the beginning of the even color, 1.0 the beginning
  23444. * of the odd color, 2.0 being the even color again, and any multiple or fractional values
  23445. * being in between.
  23446. */
  23447. offset: Property | undefined;
  23448. /**
  23449. * Gets or sets the numeric Property specifying how many times the stripes repeat.
  23450. */
  23451. repeat: Property | undefined;
  23452. /**
  23453. * Gets the {@link Material} type at the provided time.
  23454. * @param time - The time for which to retrieve the type.
  23455. * @returns The type of material.
  23456. */
  23457. getType(time: JulianDate): string;
  23458. /**
  23459. * Gets the value of the property at the provided time.
  23460. * @param time - The time for which to retrieve the value.
  23461. * @param [result] - The object to store the value into, if omitted, a new instance is created and returned.
  23462. * @returns The modified result parameter or a new instance if the result parameter was not supplied.
  23463. */
  23464. getValue(time: JulianDate, result?: any): any;
  23465. /**
  23466. * Compares this property to the provided property and returns
  23467. * <code>true</code> if they are equal, <code>false</code> otherwise.
  23468. * @param [other] - The other property.
  23469. * @returns <code>true</code> if left and right are equal, <code>false</code> otherwise.
  23470. */
  23471. equals(other?: Property): boolean;
  23472. }
  23473. /**
  23474. * Defined the orientation of stripes in {@link StripeMaterialProperty}.
  23475. */
  23476. export enum StripeOrientation {
  23477. /**
  23478. * Horizontal orientation.
  23479. */
  23480. HORIZONTAL = 0,
  23481. /**
  23482. * Vertical orientation.
  23483. */
  23484. VERTICAL = 1
  23485. }
  23486. /**
  23487. * A {@link TimeIntervalCollectionProperty} which is also a {@link PositionProperty}.
  23488. * @param [referenceFrame = ReferenceFrame.FIXED] - The reference frame in which the position is defined.
  23489. */
  23490. export class TimeIntervalCollectionPositionProperty {
  23491. constructor(referenceFrame?: ReferenceFrame);
  23492. /**
  23493. * Gets a value indicating if this property is constant. A property is considered
  23494. * constant if getValue always returns the same result for the current definition.
  23495. */
  23496. readonly isConstant: boolean;
  23497. /**
  23498. * Gets the event that is raised whenever the definition of this property changes.
  23499. * The definition is considered to have changed if a call to getValue would return
  23500. * a different result for the same time.
  23501. */
  23502. readonly definitionChanged: Event;
  23503. /**
  23504. * Gets the interval collection.
  23505. */
  23506. intervals: TimeIntervalCollection;
  23507. /**
  23508. * Gets the reference frame in which the position is defined.
  23509. */
  23510. referenceFrame: ReferenceFrame;
  23511. /**
  23512. * Gets the value of the property at the provided time in the fixed frame.
  23513. * @param time - The time for which to retrieve the value.
  23514. * @param [result] - The object to store the value into, if omitted, a new instance is created and returned.
  23515. * @returns The modified result parameter or a new instance if the result parameter was not supplied.
  23516. */
  23517. getValue(time: JulianDate, result?: any): any;
  23518. /**
  23519. * Gets the value of the property at the provided time and in the provided reference frame.
  23520. * @param time - The time for which to retrieve the value.
  23521. * @param referenceFrame - The desired referenceFrame of the result.
  23522. * @param [result] - The object to store the value into, if omitted, a new instance is created and returned.
  23523. * @returns The modified result parameter or a new instance if the result parameter was not supplied.
  23524. */
  23525. getValueInReferenceFrame(time: JulianDate, referenceFrame: ReferenceFrame, result?: Cartesian3): Cartesian3;
  23526. /**
  23527. * Compares this property to the provided property and returns
  23528. * <code>true</code> if they are equal, <code>false</code> otherwise.
  23529. * @param [other] - The other property.
  23530. * @returns <code>true</code> if left and right are equal, <code>false</code> otherwise.
  23531. */
  23532. equals(other?: Property): boolean;
  23533. }
  23534. /**
  23535. * A {@link Property} which is defined by a {@link TimeIntervalCollection}, where the
  23536. * data property of each {@link TimeInterval} represents the value at time.
  23537. * @example
  23538. * //Create a Cartesian2 interval property which contains data on August 1st, 2012
  23539. * //and uses a different value every 6 hours.
  23540. * var composite = new Cesium.TimeIntervalCollectionProperty();
  23541. * composite.intervals.addInterval(Cesium.TimeInterval.fromIso8601({
  23542. * iso8601 : '2012-08-01T00:00:00.00Z/2012-08-01T06:00:00.00Z',
  23543. * isStartIncluded : true,
  23544. * isStopIncluded : false,
  23545. * data : new Cesium.Cartesian2(2.0, 3.4)
  23546. * }));
  23547. * composite.intervals.addInterval(Cesium.TimeInterval.fromIso8601({
  23548. * iso8601 : '2012-08-01T06:00:00.00Z/2012-08-01T12:00:00.00Z',
  23549. * isStartIncluded : true,
  23550. * isStopIncluded : false,
  23551. * data : new Cesium.Cartesian2(12.0, 2.7)
  23552. * }));
  23553. * composite.intervals.addInterval(Cesium.TimeInterval.fromIso8601({
  23554. * iso8601 : '2012-08-01T12:00:00.00Z/2012-08-01T18:00:00.00Z',
  23555. * isStartIncluded : true,
  23556. * isStopIncluded : false,
  23557. * data : new Cesium.Cartesian2(5.0, 12.4)
  23558. * }));
  23559. * composite.intervals.addInterval(Cesium.TimeInterval.fromIso8601({
  23560. * iso8601 : '2012-08-01T18:00:00.00Z/2012-08-02T00:00:00.00Z',
  23561. * isStartIncluded : true,
  23562. * isStopIncluded : true,
  23563. * data : new Cesium.Cartesian2(85.0, 4.1)
  23564. * }));
  23565. */
  23566. export class TimeIntervalCollectionProperty {
  23567. constructor();
  23568. /**
  23569. * Gets a value indicating if this property is constant. A property is considered
  23570. * constant if getValue always returns the same result for the current definition.
  23571. */
  23572. readonly isConstant: boolean;
  23573. /**
  23574. * Gets the event that is raised whenever the definition of this property changes.
  23575. * The definition is changed whenever setValue is called with data different
  23576. * than the current value.
  23577. */
  23578. readonly definitionChanged: Event;
  23579. /**
  23580. * Gets the interval collection.
  23581. */
  23582. intervals: TimeIntervalCollection;
  23583. /**
  23584. * Gets the value of the property at the provided time.
  23585. * @param time - The time for which to retrieve the value.
  23586. * @param [result] - The object to store the value into, if omitted, a new instance is created and returned.
  23587. * @returns The modified result parameter or a new instance if the result parameter was not supplied.
  23588. */
  23589. getValue(time: JulianDate, result?: any): any;
  23590. /**
  23591. * Compares this property to the provided property and returns
  23592. * <code>true</code> if they are equal, <code>false</code> otherwise.
  23593. * @param [other] - The other property.
  23594. * @returns <code>true</code> if left and right are equal, <code>false</code> otherwise.
  23595. */
  23596. equals(other?: Property): boolean;
  23597. }
  23598. /**
  23599. * A {@link Property} which evaluates to a {@link Quaternion} rotation
  23600. * based on the velocity of the provided {@link PositionProperty}.
  23601. * @example
  23602. * //Create an entity with position and orientation.
  23603. * var position = new Cesium.SampledProperty();
  23604. * position.addSamples(...);
  23605. * var entity = viewer.entities.add({
  23606. * position : position,
  23607. * orientation : new Cesium.VelocityOrientationProperty(position)
  23608. * }));
  23609. * @param [position] - The position property used to compute the orientation.
  23610. * @param [ellipsoid = Ellipsoid.WGS84] - The ellipsoid used to determine which way is up.
  23611. */
  23612. export class VelocityOrientationProperty {
  23613. constructor(position?: PositionProperty, ellipsoid?: Ellipsoid);
  23614. /**
  23615. * Gets a value indicating if this property is constant.
  23616. */
  23617. readonly isConstant: boolean;
  23618. /**
  23619. * Gets the event that is raised whenever the definition of this property changes.
  23620. */
  23621. readonly definitionChanged: Event;
  23622. /**
  23623. * Gets or sets the position property used to compute orientation.
  23624. */
  23625. position: Property | undefined;
  23626. /**
  23627. * Gets or sets the ellipsoid used to determine which way is up.
  23628. */
  23629. ellipsoid: Property | undefined;
  23630. /**
  23631. * Gets the value of the property at the provided time.
  23632. * @param [time] - The time for which to retrieve the value.
  23633. * @param [result] - The object to store the value into, if omitted, a new instance is created and returned.
  23634. * @returns The modified result parameter or a new instance if the result parameter was not supplied.
  23635. */
  23636. getValue(time?: JulianDate, result?: Quaternion): Quaternion;
  23637. /**
  23638. * Compares this property to the provided property and returns
  23639. * <code>true</code> if they are equal, <code>false</code> otherwise.
  23640. * @param [other] - The other property.
  23641. * @returns <code>true</code> if left and right are equal, <code>false</code> otherwise.
  23642. */
  23643. equals(other?: Property): boolean;
  23644. }
  23645. /**
  23646. * A {@link Property} which evaluates to a {@link Cartesian3} vector
  23647. * based on the velocity of the provided {@link PositionProperty}.
  23648. * @example
  23649. * //Create an entity with a billboard rotated to match its velocity.
  23650. * var position = new Cesium.SampledProperty();
  23651. * position.addSamples(...);
  23652. * var entity = viewer.entities.add({
  23653. * position : position,
  23654. * billboard : {
  23655. * image : 'image.png',
  23656. * alignedAxis : new Cesium.VelocityVectorProperty(position, true) // alignedAxis must be a unit vector
  23657. * }
  23658. * }));
  23659. * @param [position] - The position property used to compute the velocity.
  23660. * @param [normalize = true] - Whether to normalize the computed velocity vector.
  23661. */
  23662. export class VelocityVectorProperty {
  23663. constructor(position?: PositionProperty, normalize?: boolean);
  23664. /**
  23665. * Gets a value indicating if this property is constant.
  23666. */
  23667. readonly isConstant: boolean;
  23668. /**
  23669. * Gets the event that is raised whenever the definition of this property changes.
  23670. */
  23671. readonly definitionChanged: Event;
  23672. /**
  23673. * Gets or sets the position property used to compute the velocity vector.
  23674. */
  23675. position: Property | undefined;
  23676. /**
  23677. * Gets or sets whether the vector produced by this property
  23678. * will be normalized or not.
  23679. */
  23680. normalize: boolean;
  23681. /**
  23682. * Gets the value of the property at the provided time.
  23683. * @param [time] - The time for which to retrieve the value.
  23684. * @param [result] - The object to store the value into, if omitted, a new instance is created and returned.
  23685. * @returns The modified result parameter or a new instance if the result parameter was not supplied.
  23686. */
  23687. getValue(time?: JulianDate, result?: Cartesian3): Cartesian3;
  23688. /**
  23689. * Compares this property to the provided property and returns
  23690. * <code>true</code> if they are equal, <code>false</code> otherwise.
  23691. * @param [other] - The other property.
  23692. * @returns <code>true</code> if left and right are equal, <code>false</code> otherwise.
  23693. */
  23694. equals(other?: Property): boolean;
  23695. }
  23696. /**
  23697. * Defines the interface for visualizers. Visualizers are plug-ins to
  23698. * {@link DataSourceDisplay} that render data associated with
  23699. * {@link DataSource} instances.
  23700. * This object is an interface for documentation purposes and is not intended
  23701. * to be instantiated directly.
  23702. */
  23703. export class Visualizer {
  23704. constructor();
  23705. /**
  23706. * Updates the visualization to the provided time.
  23707. * @param time - The time.
  23708. * @returns True if the display was updated to the provided time,
  23709. * false if the visualizer is waiting for an asynchronous operation to
  23710. * complete before data can be updated.
  23711. */
  23712. update(time: JulianDate): boolean;
  23713. /**
  23714. * Returns true if this object was destroyed; otherwise, false.
  23715. * @returns True if this object was destroyed; otherwise, false.
  23716. */
  23717. isDestroyed(): boolean;
  23718. /**
  23719. * Removes all visualization and cleans up any resources associated with this instance.
  23720. */
  23721. destroy(): void;
  23722. }
  23723. /**
  23724. * A {@link GeometryUpdater} for walls.
  23725. * Clients do not normally create this class directly, but instead rely on {@link DataSourceDisplay}.
  23726. * @param entity - The entity containing the geometry to be visualized.
  23727. * @param scene - The scene where visualization is taking place.
  23728. */
  23729. export class WallGeometryUpdater {
  23730. constructor(entity: Entity, scene: Scene);
  23731. /**
  23732. * Creates the geometry instance which represents the fill of the geometry.
  23733. * @param time - The time to use when retrieving initial attribute values.
  23734. * @returns The geometry instance representing the filled portion of the geometry.
  23735. */
  23736. createFillGeometryInstance(time: JulianDate): GeometryInstance;
  23737. /**
  23738. * Creates the geometry instance which represents the outline of the geometry.
  23739. * @param time - The time to use when retrieving initial attribute values.
  23740. * @returns The geometry instance representing the outline portion of the geometry.
  23741. */
  23742. createOutlineGeometryInstance(time: JulianDate): GeometryInstance;
  23743. }
  23744. export namespace WallGraphics {
  23745. /**
  23746. * Initialization options for the WallGraphics constructor
  23747. * @property [show = true] - A boolean Property specifying the visibility of the wall.
  23748. * @property [positions] - A Property specifying the array of {@link Cartesian3} positions which define the top of the wall.
  23749. * @property [minimumHeights] - A Property specifying an array of heights to be used for the bottom of the wall instead of the globe surface.
  23750. * @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.
  23751. * @property [granularity = Cesium.Math.RADIANS_PER_DEGREE] - A numeric Property specifying the angular distance between each latitude and longitude point.
  23752. * @property [fill = true] - A boolean Property specifying whether the wall is filled with the provided material.
  23753. * @property [material = Color.WHITE] - A Property specifying the material used to fill the wall.
  23754. * @property [outline = false] - A boolean Property specifying whether the wall is outlined.
  23755. * @property [outlineColor = Color.BLACK] - A Property specifying the {@link Color} of the outline.
  23756. * @property [outlineWidth = 1.0] - A numeric Property specifying the width of the outline.
  23757. * @property [shadows = ShadowMode.DISABLED] - An enum Property specifying whether the wall casts or receives shadows from light sources.
  23758. * @property [distanceDisplayCondition] - A Property specifying at what distance from the camera that this wall will be displayed.
  23759. */
  23760. type ConstructorOptions = {
  23761. show?: Property | boolean;
  23762. positions?: Property | Cartesian3[];
  23763. minimumHeights?: Property | number[];
  23764. maximumHeights?: Property | number[];
  23765. granularity?: Property | number;
  23766. fill?: Property | boolean;
  23767. material?: MaterialProperty | Color;
  23768. outline?: Property | boolean;
  23769. outlineColor?: Property | Color;
  23770. outlineWidth?: Property | number;
  23771. shadows?: Property | ShadowMode;
  23772. distanceDisplayCondition?: Property | DistanceDisplayCondition;
  23773. };
  23774. }
  23775. /**
  23776. * Describes a two dimensional wall defined as a line strip and optional maximum and minimum heights.
  23777. * The wall conforms to the curvature of the globe and can be placed along the surface or at altitude.
  23778. * @param [options] - Object describing initialization options
  23779. */
  23780. export class WallGraphics {
  23781. constructor(options?: WallGraphics.ConstructorOptions);
  23782. /**
  23783. * Gets the event that is raised whenever a property or sub-property is changed or modified.
  23784. */
  23785. readonly definitionChanged: Event;
  23786. /**
  23787. * Gets or sets the boolean Property specifying the visibility of the wall.
  23788. */
  23789. show: Property | undefined;
  23790. /**
  23791. * Gets or sets the Property specifying the array of {@link Cartesian3} positions which define the top of the wall.
  23792. */
  23793. positions: Property | undefined;
  23794. /**
  23795. * 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.
  23796. * If defined, the array must be the same length as {@link Wall#positions}.
  23797. */
  23798. minimumHeights: Property | undefined;
  23799. /**
  23800. * 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.
  23801. * If defined, the array must be the same length as {@link Wall#positions}.
  23802. */
  23803. maximumHeights: Property | undefined;
  23804. /**
  23805. * Gets or sets the numeric Property specifying the angular distance between points on the wall.
  23806. */
  23807. granularity: Property | undefined;
  23808. /**
  23809. * Gets or sets the boolean Property specifying whether the wall is filled with the provided material.
  23810. */
  23811. fill: Property | undefined;
  23812. /**
  23813. * Gets or sets the Property specifying the material used to fill the wall.
  23814. */
  23815. material: MaterialProperty;
  23816. /**
  23817. * Gets or sets the Property specifying whether the wall is outlined.
  23818. */
  23819. outline: Property | undefined;
  23820. /**
  23821. * Gets or sets the Property specifying the {@link Color} of the outline.
  23822. */
  23823. outlineColor: Property | undefined;
  23824. /**
  23825. * Gets or sets the numeric Property specifying the width of the outline.
  23826. */
  23827. outlineWidth: Property | undefined;
  23828. /**
  23829. * Get or sets the enum Property specifying whether the wall
  23830. * casts or receives shadows from light sources.
  23831. */
  23832. shadows: Property | undefined;
  23833. /**
  23834. * Gets or sets the {@link DistanceDisplayCondition} Property specifying at what distance from the camera that this wall will be displayed.
  23835. */
  23836. distanceDisplayCondition: Property | undefined;
  23837. /**
  23838. * Duplicates this instance.
  23839. * @param [result] - The object onto which to store the result.
  23840. * @returns The modified result parameter or a new instance if one was not provided.
  23841. */
  23842. clone(result?: WallGraphics): WallGraphics;
  23843. /**
  23844. * Assigns each unassigned property on this object to the value
  23845. * of the same property on the provided source object.
  23846. * @param source - The object to be merged into this object.
  23847. */
  23848. merge(source: WallGraphics): void;
  23849. }
  23850. /**
  23851. * @property kml - The generated KML.
  23852. * @property externalFiles - An object dictionary of external files
  23853. */
  23854. export type exportKmlResultKml = {
  23855. kml: string;
  23856. externalFiles: {
  23857. [key: string]: Blob;
  23858. };
  23859. };
  23860. /**
  23861. * @property kmz - The generated kmz file.
  23862. */
  23863. export type exportKmlResultKmz = {
  23864. kmz: Blob;
  23865. };
  23866. /**
  23867. * Exports an EntityCollection as a KML document. Only Point, Billboard, Model, Path, Polygon, Polyline geometries
  23868. * will be exported. Note that there is not a 1 to 1 mapping of Entity properties to KML Feature properties. For
  23869. * example, entity properties that are time dynamic but cannot be dynamic in KML are exported with their values at
  23870. * options.time or the beginning of the EntityCollection's time interval if not specified. For time-dynamic properties
  23871. * that are supported in KML, we use the samples if it is a {@link SampledProperty} otherwise we sample the value using
  23872. * the options.sampleDuration. Point, Billboard, Model and Path geometries with time-dynamic positions will be exported
  23873. * as gx:Track Features. Not all Materials are representable in KML, so for more advanced Materials just the primary
  23874. * color is used. Canvas objects are exported as PNG images.
  23875. * @example
  23876. * Cesium.exportKml({
  23877. * entities: entityCollection
  23878. * })
  23879. * .then(function(result) {
  23880. * // The XML string is in result.kml
  23881. *
  23882. * var externalFiles = result.externalFiles
  23883. * for(var file in externalFiles) {
  23884. * // file is the name of the file used in the KML document as the href
  23885. * // externalFiles[file] is a blob with the contents of the file
  23886. * }
  23887. * });
  23888. * @param options - An object with the following properties:
  23889. * @param options.entities - The EntityCollection to export as KML.
  23890. * @param [options.ellipsoid = Ellipsoid.WGS84] - The ellipsoid for the output file.
  23891. * @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.
  23892. * @param [options.time = entities.computeAvailability().start] - The time value to use to get properties that are not time varying in KML.
  23893. * @param [options.defaultAvailability = entities.computeAvailability()] - The interval that will be sampled if an entity doesn't have an availability.
  23894. * @param [options.sampleDuration = 60] - The number of seconds to sample properties that are varying in KML.
  23895. * @param [options.kmz = false] - If true KML and external files will be compressed into a kmz file.
  23896. * @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.
  23897. */
  23898. export function exportKml(options: {
  23899. entities: EntityCollection;
  23900. ellipsoid?: Ellipsoid;
  23901. modelCallback?: exportKmlModelCallback;
  23902. time?: JulianDate;
  23903. defaultAvailability?: TimeInterval;
  23904. sampleDuration?: number;
  23905. kmz?: boolean;
  23906. }): Promise<exportKmlResultKml | exportKmlResultKmz>;
  23907. /**
  23908. * Since KML does not support glTF models, this callback is required to specify what URL to use for the model in the KML document.
  23909. * 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,
  23910. * or otherwise returned with the KML string when exporting.
  23911. * @param model - The ModelGraphics instance for an Entity.
  23912. * @param time - The time that any properties should use to get the value.
  23913. * @param externalFiles - An object that maps a filename to a Blob or a Promise that resolves to a Blob.
  23914. */
  23915. export type exportKmlModelCallback = (model: ModelGraphics, time: JulianDate, externalFiles: any) => string;
  23916. /**
  23917. * The data type of a pixel.
  23918. */
  23919. export enum PixelDatatype {
  23920. UNSIGNED_BYTE = WebGLConstants.UNSIGNED_BYTE,
  23921. UNSIGNED_SHORT = WebGLConstants.UNSIGNED_SHORT,
  23922. UNSIGNED_INT = WebGLConstants.UNSIGNED_INT,
  23923. FLOAT = WebGLConstants.FLOAT,
  23924. HALF_FLOAT = WebGLConstants.HALF_FLOAT_OES,
  23925. UNSIGNED_INT_24_8 = WebGLConstants.UNSIGNED_INT_24_8,
  23926. UNSIGNED_SHORT_4_4_4_4 = WebGLConstants.UNSIGNED_SHORT_4_4_4_4,
  23927. UNSIGNED_SHORT_5_5_5_1 = WebGLConstants.UNSIGNED_SHORT_5_5_5_1,
  23928. UNSIGNED_SHORT_5_6_5 = WebGLConstants.UNSIGNED_SHORT_5_6_5
  23929. }
  23930. /**
  23931. * Enumerates all possible filters used when magnifying WebGL textures.
  23932. */
  23933. export enum TextureMagnificationFilter {
  23934. /**
  23935. * Samples the texture by returning the closest pixel.
  23936. */
  23937. NEAREST = WebGLConstants.NEAREST,
  23938. /**
  23939. * Samples the texture through bi-linear interpolation of the four nearest pixels. This produces smoother results than <code>NEAREST</code> filtering.
  23940. */
  23941. LINEAR = WebGLConstants.LINEAR
  23942. }
  23943. /**
  23944. * Enumerates all possible filters used when minifying WebGL textures.
  23945. */
  23946. export enum TextureMinificationFilter {
  23947. /**
  23948. * Samples the texture by returning the closest pixel.
  23949. */
  23950. NEAREST = WebGLConstants.NEAREST,
  23951. /**
  23952. * Samples the texture through bi-linear interpolation of the four nearest pixels. This produces smoother results than <code>NEAREST</code> filtering.
  23953. */
  23954. LINEAR = WebGLConstants.LINEAR,
  23955. /**
  23956. * Selects the nearest mip level and applies nearest sampling within that level.
  23957. * <p>
  23958. * Requires that the texture has a mipmap. The mip level is chosen by the view angle and screen-space size of the texture.
  23959. * </p>
  23960. */
  23961. NEAREST_MIPMAP_NEAREST = WebGLConstants.NEAREST_MIPMAP_NEAREST,
  23962. /**
  23963. * Selects the nearest mip level and applies linear sampling within that level.
  23964. * <p>
  23965. * Requires that the texture has a mipmap. The mip level is chosen by the view angle and screen-space size of the texture.
  23966. * </p>
  23967. */
  23968. LINEAR_MIPMAP_NEAREST = WebGLConstants.LINEAR_MIPMAP_NEAREST,
  23969. /**
  23970. * Read texture values with nearest sampling from two adjacent mip levels and linearly interpolate the results.
  23971. * <p>
  23972. * This option provides a good balance of visual quality and speed when sampling from a mipmapped texture.
  23973. * </p>
  23974. * <p>
  23975. * Requires that the texture has a mipmap. The mip level is chosen by the view angle and screen-space size of the texture.
  23976. * </p>
  23977. */
  23978. NEAREST_MIPMAP_LINEAR = WebGLConstants.NEAREST_MIPMAP_LINEAR,
  23979. /**
  23980. * Read texture values with linear sampling from two adjacent mip levels and linearly interpolate the results.
  23981. * <p>
  23982. * This option provides a good balance of visual quality and speed when sampling from a mipmapped texture.
  23983. * </p>
  23984. * <p>
  23985. * Requires that the texture has a mipmap. The mip level is chosen by the view angle and screen-space size of the texture.
  23986. * </p>
  23987. */
  23988. LINEAR_MIPMAP_LINEAR = WebGLConstants.LINEAR_MIPMAP_LINEAR
  23989. }
  23990. /**
  23991. * An appearance defines the full GLSL vertex and fragment shaders and the
  23992. * render state used to draw a {@link Primitive}. All appearances implement
  23993. * this base <code>Appearance</code> interface.
  23994. * @param [options] - Object with the following properties:
  23995. * @param [options.translucent = true] - When <code>true</code>, the geometry is expected to appear translucent so {@link Appearance#renderState} has alpha blending enabled.
  23996. * @param [options.closed = false] - When <code>true</code>, the geometry is expected to be closed so {@link Appearance#renderState} has backface culling enabled.
  23997. * @param [options.material = Material.ColorType] - The material used to determine the fragment color.
  23998. * @param [options.vertexShaderSource] - Optional GLSL vertex shader source to override the default vertex shader.
  23999. * @param [options.fragmentShaderSource] - Optional GLSL fragment shader source to override the default fragment shader.
  24000. * @param [options.renderState] - Optional render state to override the default render state.
  24001. */
  24002. export class Appearance {
  24003. constructor(options?: {
  24004. translucent?: boolean;
  24005. closed?: boolean;
  24006. material?: Material;
  24007. vertexShaderSource?: string;
  24008. fragmentShaderSource?: string;
  24009. renderState?: any;
  24010. });
  24011. /**
  24012. * The material used to determine the fragment color. Unlike other {@link Appearance}
  24013. * properties, this is not read-only, so an appearance's material can change on the fly.
  24014. */
  24015. material: Material;
  24016. /**
  24017. * When <code>true</code>, the geometry is expected to appear translucent.
  24018. */
  24019. translucent: boolean;
  24020. /**
  24021. * The GLSL source code for the vertex shader.
  24022. */
  24023. readonly vertexShaderSource: string;
  24024. /**
  24025. * The GLSL source code for the fragment shader. The full fragment shader
  24026. * source is built procedurally taking into account the {@link Appearance#material}.
  24027. * Use {@link Appearance#getFragmentShaderSource} to get the full source.
  24028. */
  24029. readonly fragmentShaderSource: string;
  24030. /**
  24031. * The WebGL fixed-function state to use when rendering the geometry.
  24032. */
  24033. readonly renderState: any;
  24034. /**
  24035. * When <code>true</code>, the geometry is expected to be closed.
  24036. */
  24037. readonly closed: boolean;
  24038. /**
  24039. * Procedurally creates the full GLSL fragment shader source for this appearance
  24040. * taking into account {@link Appearance#fragmentShaderSource} and {@link Appearance#material}.
  24041. * @returns The full GLSL fragment shader source.
  24042. */
  24043. getFragmentShaderSource(): string;
  24044. /**
  24045. * Determines if the geometry is translucent based on {@link Appearance#translucent} and {@link Material#isTranslucent}.
  24046. * @returns <code>true</code> if the appearance is translucent.
  24047. */
  24048. isTranslucent(): boolean;
  24049. /**
  24050. * Creates a render state. This is not the final render state instance; instead,
  24051. * it can contain a subset of render state properties identical to the render state
  24052. * created in the context.
  24053. * @returns The render state.
  24054. */
  24055. getRenderState(): any;
  24056. }
  24057. export namespace ArcGisMapServerImageryProvider {
  24058. /**
  24059. * Initialization options for the ArcGisMapServerImageryProvider constructor
  24060. * @property url - The URL of the ArcGIS MapServer service.
  24061. * @property [token] - The ArcGIS token used to authenticate with the ArcGIS MapServer service.
  24062. * @property [tileDiscardPolicy] - The policy that determines if a tile
  24063. * is invalid and should be discarded. If this value is not specified, a default
  24064. * {@link DiscardMissingTileImagePolicy} is used for tiled map servers, and a
  24065. * {@link NeverTileDiscardPolicy} is used for non-tiled map servers. In the former case,
  24066. * we request tile 0,0 at the maximum tile level and check pixels (0,0), (200,20), (20,200),
  24067. * (80,110), and (160, 130). If all of these pixels are transparent, the discard check is
  24068. * disabled and no tiles are discarded. If any of them have a non-transparent color, any
  24069. * tile that has the same values in these pixel locations is discarded. The end result of
  24070. * these defaults should be correct tile discarding for a standard ArcGIS Server. To ensure
  24071. * that no tiles are discarded, construct and pass a {@link NeverTileDiscardPolicy} for this
  24072. * parameter.
  24073. * @property [usePreCachedTilesIfAvailable = true] - If true, the server's pre-cached
  24074. * tiles are used if they are available. If false, any pre-cached tiles are ignored and the
  24075. * 'export' service is used.
  24076. * @property [layers] - A comma-separated list of the layers to show, or undefined if all layers should be shown.
  24077. * @property [enablePickFeatures = true] - If true, {@link ArcGisMapServerImageryProvider#pickFeatures} will invoke
  24078. * the Identify service on the MapServer and return the features included in the response. If false,
  24079. * {@link ArcGisMapServerImageryProvider#pickFeatures} will immediately return undefined (indicating no pickable features)
  24080. * without communicating with the server. Set this property to false if you don't want this provider's features to
  24081. * be pickable. Can be overridden by setting the {@link ArcGisMapServerImageryProvider#enablePickFeatures} property on the object.
  24082. * @property [rectangle = Rectangle.MAX_VALUE] - The rectangle of the layer. This parameter is ignored when accessing
  24083. * a tiled layer.
  24084. * @property [tilingScheme = new GeographicTilingScheme()] - The tiling scheme to use to divide the world into tiles.
  24085. * This parameter is ignored when accessing a tiled server.
  24086. * @property [ellipsoid] - The ellipsoid. If the tilingScheme is specified and used,
  24087. * this parameter is ignored and the tiling scheme's ellipsoid is used instead. If neither
  24088. * parameter is specified, the WGS84 ellipsoid is used.
  24089. * @property [credit] - A credit for the data source, which is displayed on the canvas. This parameter is ignored when accessing a tiled server.
  24090. * @property [tileWidth = 256] - The width of each tile in pixels. This parameter is ignored when accessing a tiled server.
  24091. * @property [tileHeight = 256] - The height of each tile in pixels. This parameter is ignored when accessing a tiled server.
  24092. * @property [maximumLevel] - The maximum tile level to request, or undefined if there is no maximum. This parameter is ignored when accessing
  24093. * a tiled server.
  24094. */
  24095. type ConstructorOptions = {
  24096. url: Resource | string;
  24097. token?: string;
  24098. tileDiscardPolicy?: TileDiscardPolicy;
  24099. usePreCachedTilesIfAvailable?: boolean;
  24100. layers?: string;
  24101. enablePickFeatures?: boolean;
  24102. rectangle?: Rectangle;
  24103. tilingScheme?: TilingScheme;
  24104. ellipsoid?: Ellipsoid;
  24105. credit?: Credit | string;
  24106. tileWidth?: number;
  24107. tileHeight?: number;
  24108. maximumLevel?: number;
  24109. };
  24110. }
  24111. /**
  24112. * Provides tiled imagery hosted by an ArcGIS MapServer. By default, the server's pre-cached tiles are
  24113. * used, if available.
  24114. * @example
  24115. * var esri = new Cesium.ArcGisMapServerImageryProvider({
  24116. * url : 'https://services.arcgisonline.com/ArcGIS/rest/services/World_Imagery/MapServer'
  24117. * });
  24118. * @param options - Object describing initialization options
  24119. */
  24120. export class ArcGisMapServerImageryProvider {
  24121. constructor(options: ArcGisMapServerImageryProvider.ConstructorOptions);
  24122. /**
  24123. * The default alpha blending value of this provider, with 0.0 representing fully transparent and
  24124. * 1.0 representing fully opaque.
  24125. */
  24126. defaultAlpha: number | undefined;
  24127. /**
  24128. * The default alpha blending value on the night side of the globe of this provider, with 0.0 representing fully transparent and
  24129. * 1.0 representing fully opaque.
  24130. */
  24131. defaultNightAlpha: number | undefined;
  24132. /**
  24133. * The default alpha blending value on the day side of the globe of this provider, with 0.0 representing fully transparent and
  24134. * 1.0 representing fully opaque.
  24135. */
  24136. defaultDayAlpha: number | undefined;
  24137. /**
  24138. * The default brightness of this provider. 1.0 uses the unmodified imagery color. Less than 1.0
  24139. * makes the imagery darker while greater than 1.0 makes it brighter.
  24140. */
  24141. defaultBrightness: number | undefined;
  24142. /**
  24143. * The default contrast of this provider. 1.0 uses the unmodified imagery color. Less than 1.0 reduces
  24144. * the contrast while greater than 1.0 increases it.
  24145. */
  24146. defaultContrast: number | undefined;
  24147. /**
  24148. * The default hue of this provider in radians. 0.0 uses the unmodified imagery color.
  24149. */
  24150. defaultHue: number | undefined;
  24151. /**
  24152. * The default saturation of this provider. 1.0 uses the unmodified imagery color. Less than 1.0 reduces the
  24153. * saturation while greater than 1.0 increases it.
  24154. */
  24155. defaultSaturation: number | undefined;
  24156. /**
  24157. * The default gamma correction to apply to this provider. 1.0 uses the unmodified imagery color.
  24158. */
  24159. defaultGamma: number | undefined;
  24160. /**
  24161. * The default texture minification filter to apply to this provider.
  24162. */
  24163. defaultMinificationFilter: TextureMinificationFilter;
  24164. /**
  24165. * The default texture magnification filter to apply to this provider.
  24166. */
  24167. defaultMagnificationFilter: TextureMagnificationFilter;
  24168. /**
  24169. * Gets or sets a value indicating whether feature picking is enabled. If true, {@link ArcGisMapServerImageryProvider#pickFeatures} will
  24170. * invoke the "identify" operation on the ArcGIS server and return the features included in the response. If false,
  24171. * {@link ArcGisMapServerImageryProvider#pickFeatures} will immediately return undefined (indicating no pickable features)
  24172. * without communicating with the server.
  24173. */
  24174. enablePickFeatures: boolean;
  24175. /**
  24176. * Gets the URL of the ArcGIS MapServer.
  24177. */
  24178. readonly url: string;
  24179. /**
  24180. * Gets the ArcGIS token used to authenticate with the ArcGis MapServer service.
  24181. */
  24182. readonly token: string;
  24183. /**
  24184. * Gets the proxy used by this provider.
  24185. */
  24186. readonly proxy: Proxy;
  24187. /**
  24188. * Gets the width of each tile, in pixels. This function should
  24189. * not be called before {@link ArcGisMapServerImageryProvider#ready} returns true.
  24190. */
  24191. readonly tileWidth: number;
  24192. /**
  24193. * Gets the height of each tile, in pixels. This function should
  24194. * not be called before {@link ArcGisMapServerImageryProvider#ready} returns true.
  24195. */
  24196. readonly tileHeight: number;
  24197. /**
  24198. * Gets the maximum level-of-detail that can be requested. This function should
  24199. * not be called before {@link ArcGisMapServerImageryProvider#ready} returns true.
  24200. */
  24201. readonly maximumLevel: number | undefined;
  24202. /**
  24203. * Gets the minimum level-of-detail that can be requested. This function should
  24204. * not be called before {@link ArcGisMapServerImageryProvider#ready} returns true.
  24205. */
  24206. readonly minimumLevel: number;
  24207. /**
  24208. * Gets the tiling scheme used by this provider. This function should
  24209. * not be called before {@link ArcGisMapServerImageryProvider#ready} returns true.
  24210. */
  24211. readonly tilingScheme: TilingScheme;
  24212. /**
  24213. * Gets the rectangle, in radians, of the imagery provided by this instance. This function should
  24214. * not be called before {@link ArcGisMapServerImageryProvider#ready} returns true.
  24215. */
  24216. readonly rectangle: Rectangle;
  24217. /**
  24218. * Gets the tile discard policy. If not undefined, the discard policy is responsible
  24219. * for filtering out "missing" tiles via its shouldDiscardImage function. If this function
  24220. * returns undefined, no tiles are filtered. This function should
  24221. * not be called before {@link ArcGisMapServerImageryProvider#ready} returns true.
  24222. */
  24223. readonly tileDiscardPolicy: TileDiscardPolicy;
  24224. /**
  24225. * Gets an event that is raised when the imagery provider encounters an asynchronous error. By subscribing
  24226. * to the event, you will be notified of the error and can potentially recover from it. Event listeners
  24227. * are passed an instance of {@link TileProviderError}.
  24228. */
  24229. readonly errorEvent: Event;
  24230. /**
  24231. * Gets a value indicating whether or not the provider is ready for use.
  24232. */
  24233. readonly ready: boolean;
  24234. /**
  24235. * Gets a promise that resolves to true when the provider is ready for use.
  24236. */
  24237. readonly readyPromise: Promise<boolean>;
  24238. /**
  24239. * Gets the credit to display when this imagery provider is active. Typically this is used to credit
  24240. * the source of the imagery. This function should not be called before {@link ArcGisMapServerImageryProvider#ready} returns true.
  24241. */
  24242. readonly credit: Credit;
  24243. /**
  24244. * Gets a value indicating whether this imagery provider is using pre-cached tiles from the
  24245. * ArcGIS MapServer. If the imagery provider is not yet ready ({@link ArcGisMapServerImageryProvider#ready}), this function
  24246. * will return the value of `options.usePreCachedTilesIfAvailable`, even if the MapServer does
  24247. * not have pre-cached tiles.
  24248. */
  24249. readonly usingPrecachedTiles: boolean;
  24250. /**
  24251. * Gets a value indicating whether or not the images provided by this imagery provider
  24252. * include an alpha channel. If this property is false, an alpha channel, if present, will
  24253. * be ignored. If this property is true, any images without an alpha channel will be treated
  24254. * as if their alpha is 1.0 everywhere. When this property is false, memory usage
  24255. * and texture upload time are reduced.
  24256. */
  24257. readonly hasAlphaChannel: boolean;
  24258. /**
  24259. * Gets the comma-separated list of layer IDs to show.
  24260. */
  24261. layers: string;
  24262. /**
  24263. * Gets the credits to be displayed when a given tile is displayed.
  24264. * @param x - The tile X coordinate.
  24265. * @param y - The tile Y coordinate.
  24266. * @param level - The tile level;
  24267. * @returns The credits to be displayed when the tile is displayed.
  24268. */
  24269. getTileCredits(x: number, y: number, level: number): Credit[];
  24270. /**
  24271. * Requests the image for a given tile. This function should
  24272. * not be called before {@link ArcGisMapServerImageryProvider#ready} returns true.
  24273. * @param x - The tile X coordinate.
  24274. * @param y - The tile Y coordinate.
  24275. * @param level - The tile level.
  24276. * @param [request] - The request object. Intended for internal use only.
  24277. * @returns A promise for the image that will resolve when the image is available, or
  24278. * undefined if there are too many active requests to the server, and the request
  24279. * should be retried later. The resolved image may be either an
  24280. * Image or a Canvas DOM object.
  24281. */
  24282. requestImage(x: number, y: number, level: number, request?: Request): Promise<HTMLImageElement | HTMLCanvasElement> | undefined;
  24283. /**
  24284. * /**
  24285. * Asynchronously determines what features, if any, are located at a given longitude and latitude within
  24286. * a tile. This function should not be called before {@link ImageryProvider#ready} returns true.
  24287. * @param x - The tile X coordinate.
  24288. * @param y - The tile Y coordinate.
  24289. * @param level - The tile level.
  24290. * @param longitude - The longitude at which to pick features.
  24291. * @param latitude - The latitude at which to pick features.
  24292. * @returns A promise for the picked features that will resolve when the asynchronous
  24293. * picking completes. The resolved value is an array of {@link ImageryLayerFeatureInfo}
  24294. * instances. The array may be empty if no features are found at the given location.
  24295. */
  24296. pickFeatures(x: number, y: number, level: number, longitude: number, latitude: number): Promise<ImageryLayerFeatureInfo[]> | undefined;
  24297. }
  24298. /**
  24299. * An enum describing the x, y, and z axes and helper conversion functions.
  24300. */
  24301. export enum Axis {
  24302. /**
  24303. * Denotes the x-axis.
  24304. */
  24305. X = 0,
  24306. /**
  24307. * Denotes the y-axis.
  24308. */
  24309. Y = 1,
  24310. /**
  24311. * Denotes the z-axis.
  24312. */
  24313. Z = 2
  24314. }
  24315. /**
  24316. * A viewport-aligned image positioned in the 3D scene, that is created
  24317. * and rendered using a {@link BillboardCollection}. A billboard is created and its initial
  24318. * properties are set by calling {@link BillboardCollection#add}.
  24319. * <br /><br />
  24320. * <div align='center'>
  24321. * <img src='Images/Billboard.png' width='400' height='300' /><br />
  24322. * Example billboards
  24323. * </div>
  24324. */
  24325. export class Billboard {
  24326. constructor();
  24327. /**
  24328. * Determines if this billboard will be shown. Use this to hide or show a billboard, instead
  24329. * of removing it and re-adding it to the collection.
  24330. */
  24331. show: boolean;
  24332. /**
  24333. * Gets or sets the Cartesian position of this billboard.
  24334. */
  24335. position: Cartesian3;
  24336. /**
  24337. * Gets or sets the height reference of this billboard.
  24338. */
  24339. heightReference: HeightReference;
  24340. /**
  24341. * Gets or sets the pixel offset in screen space from the origin of this billboard. This is commonly used
  24342. * to align multiple billboards and labels at the same position, e.g., an image and text. The
  24343. * screen space origin is the top, left corner of the canvas; <code>x</code> increases from
  24344. * left to right, and <code>y</code> increases from top to bottom.
  24345. * <br /><br />
  24346. * <div align='center'>
  24347. * <table border='0' cellpadding='5'><tr>
  24348. * <td align='center'><code>default</code><br/><img src='Images/Billboard.setPixelOffset.default.png' width='250' height='188' /></td>
  24349. * <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>
  24350. * </tr></table>
  24351. * The billboard's origin is indicated by the yellow point.
  24352. * </div>
  24353. */
  24354. pixelOffset: Cartesian2;
  24355. /**
  24356. * Gets or sets near and far scaling properties of a Billboard based on the billboard's distance from the camera.
  24357. * A billboard's scale will interpolate between the {@link NearFarScalar#nearValue} and
  24358. * {@link NearFarScalar#farValue} while the camera distance falls within the lower and upper bounds
  24359. * of the specified {@link NearFarScalar#near} and {@link NearFarScalar#far}.
  24360. * Outside of these ranges the billboard's scale remains clamped to the nearest bound. If undefined,
  24361. * scaleByDistance will be disabled.
  24362. * @example
  24363. * // Example 1.
  24364. * // Set a billboard's scaleByDistance to scale by 1.5 when the
  24365. * // camera is 1500 meters from the billboard and disappear as
  24366. * // the camera distance approaches 8.0e6 meters.
  24367. * b.scaleByDistance = new Cesium.NearFarScalar(1.5e2, 1.5, 8.0e6, 0.0);
  24368. * @example
  24369. * // Example 2.
  24370. * // disable scaling by distance
  24371. * b.scaleByDistance = undefined;
  24372. */
  24373. scaleByDistance: NearFarScalar;
  24374. /**
  24375. * Gets or sets near and far translucency properties of a Billboard based on the billboard's distance from the camera.
  24376. * A billboard's translucency will interpolate between the {@link NearFarScalar#nearValue} and
  24377. * {@link NearFarScalar#farValue} while the camera distance falls within the lower and upper bounds
  24378. * of the specified {@link NearFarScalar#near} and {@link NearFarScalar#far}.
  24379. * Outside of these ranges the billboard's translucency remains clamped to the nearest bound. If undefined,
  24380. * translucencyByDistance will be disabled.
  24381. * @example
  24382. * // Example 1.
  24383. * // Set a billboard's translucency to 1.0 when the
  24384. * // camera is 1500 meters from the billboard and disappear as
  24385. * // the camera distance approaches 8.0e6 meters.
  24386. * b.translucencyByDistance = new Cesium.NearFarScalar(1.5e2, 1.0, 8.0e6, 0.0);
  24387. * @example
  24388. * // Example 2.
  24389. * // disable translucency by distance
  24390. * b.translucencyByDistance = undefined;
  24391. */
  24392. translucencyByDistance: NearFarScalar;
  24393. /**
  24394. * Gets or sets near and far pixel offset scaling properties of a Billboard based on the billboard's distance from the camera.
  24395. * A billboard's pixel offset will be scaled between the {@link NearFarScalar#nearValue} and
  24396. * {@link NearFarScalar#farValue} while the camera distance falls within the lower and upper bounds
  24397. * of the specified {@link NearFarScalar#near} and {@link NearFarScalar#far}.
  24398. * Outside of these ranges the billboard's pixel offset scale remains clamped to the nearest bound. If undefined,
  24399. * pixelOffsetScaleByDistance will be disabled.
  24400. * @example
  24401. * // Example 1.
  24402. * // Set a billboard's pixel offset scale to 0.0 when the
  24403. * // camera is 1500 meters from the billboard and scale pixel offset to 10.0 pixels
  24404. * // in the y direction the camera distance approaches 8.0e6 meters.
  24405. * b.pixelOffset = new Cesium.Cartesian2(0.0, 1.0);
  24406. * b.pixelOffsetScaleByDistance = new Cesium.NearFarScalar(1.5e2, 0.0, 8.0e6, 10.0);
  24407. * @example
  24408. * // Example 2.
  24409. * // disable pixel offset by distance
  24410. * b.pixelOffsetScaleByDistance = undefined;
  24411. */
  24412. pixelOffsetScaleByDistance: NearFarScalar;
  24413. /**
  24414. * Gets or sets the 3D Cartesian offset applied to this billboard in eye coordinates. Eye coordinates is a left-handed
  24415. * coordinate system, where <code>x</code> points towards the viewer's right, <code>y</code> points up, and
  24416. * <code>z</code> points into the screen. Eye coordinates use the same scale as world and model coordinates,
  24417. * which is typically meters.
  24418. * <br /><br />
  24419. * An eye offset is commonly used to arrange multiple billboards or objects at the same position, e.g., to
  24420. * arrange a billboard above its corresponding 3D model.
  24421. * <br /><br />
  24422. * Below, the billboard is positioned at the center of the Earth but an eye offset makes it always
  24423. * appear on top of the Earth regardless of the viewer's or Earth's orientation.
  24424. * <br /><br />
  24425. * <div align='center'>
  24426. * <table border='0' cellpadding='5'><tr>
  24427. * <td align='center'><img src='Images/Billboard.setEyeOffset.one.png' width='250' height='188' /></td>
  24428. * <td align='center'><img src='Images/Billboard.setEyeOffset.two.png' width='250' height='188' /></td>
  24429. * </tr></table>
  24430. * <code>b.eyeOffset = new Cartesian3(0.0, 8000000.0, 0.0);</code><br /><br />
  24431. * </div>
  24432. */
  24433. eyeOffset: Cartesian3;
  24434. /**
  24435. * Gets or sets the horizontal origin of this billboard, which determines if the billboard is
  24436. * to the left, center, or right of its anchor position.
  24437. * <br /><br />
  24438. * <div align='center'>
  24439. * <img src='Images/Billboard.setHorizontalOrigin.png' width='648' height='196' /><br />
  24440. * </div>
  24441. * @example
  24442. * // Use a bottom, left origin
  24443. * b.horizontalOrigin = Cesium.HorizontalOrigin.LEFT;
  24444. * b.verticalOrigin = Cesium.VerticalOrigin.BOTTOM;
  24445. */
  24446. horizontalOrigin: HorizontalOrigin;
  24447. /**
  24448. * Gets or sets the vertical origin of this billboard, which determines if the billboard is
  24449. * to the above, below, or at the center of its anchor position.
  24450. * <br /><br />
  24451. * <div align='center'>
  24452. * <img src='Images/Billboard.setVerticalOrigin.png' width='695' height='175' /><br />
  24453. * </div>
  24454. * @example
  24455. * // Use a bottom, left origin
  24456. * b.horizontalOrigin = Cesium.HorizontalOrigin.LEFT;
  24457. * b.verticalOrigin = Cesium.VerticalOrigin.BOTTOM;
  24458. */
  24459. verticalOrigin: VerticalOrigin;
  24460. /**
  24461. * Gets or sets the uniform scale that is multiplied with the billboard's image size in pixels.
  24462. * A scale of <code>1.0</code> does not change the size of the billboard; a scale greater than
  24463. * <code>1.0</code> enlarges the billboard; a positive scale less than <code>1.0</code> shrinks
  24464. * the billboard.
  24465. * <br /><br />
  24466. * <div align='center'>
  24467. * <img src='Images/Billboard.setScale.png' width='400' height='300' /><br/>
  24468. * From left to right in the above image, the scales are <code>0.5</code>, <code>1.0</code>,
  24469. * and <code>2.0</code>.
  24470. * </div>
  24471. */
  24472. scale: number;
  24473. /**
  24474. * Gets or sets the color that is multiplied with the billboard's texture. This has two common use cases. First,
  24475. * the same white texture may be used by many different billboards, each with a different color, to create
  24476. * colored billboards. Second, the color's alpha component can be used to make the billboard translucent as shown below.
  24477. * An alpha of <code>0.0</code> makes the billboard transparent, and <code>1.0</code> makes the billboard opaque.
  24478. * <br /><br />
  24479. * <div align='center'>
  24480. * <table border='0' cellpadding='5'><tr>
  24481. * <td align='center'><code>default</code><br/><img src='Images/Billboard.setColor.Alpha255.png' width='250' height='188' /></td>
  24482. * <td align='center'><code>alpha : 0.5</code><br/><img src='Images/Billboard.setColor.Alpha127.png' width='250' height='188' /></td>
  24483. * </tr></table>
  24484. * </div>
  24485. * <br />
  24486. * The red, green, blue, and alpha values are indicated by <code>value</code>'s <code>red</code>, <code>green</code>,
  24487. * <code>blue</code>, and <code>alpha</code> properties as shown in Example 1. These components range from <code>0.0</code>
  24488. * (no intensity) to <code>1.0</code> (full intensity).
  24489. * @example
  24490. * // Example 1. Assign yellow.
  24491. * b.color = Cesium.Color.YELLOW;
  24492. * @example
  24493. * // Example 2. Make a billboard 50% translucent.
  24494. * b.color = new Cesium.Color(1.0, 1.0, 1.0, 0.5);
  24495. */
  24496. color: Color;
  24497. /**
  24498. * Gets or sets the rotation angle in radians.
  24499. */
  24500. rotation: number;
  24501. /**
  24502. * Gets or sets the aligned axis in world space. The aligned axis is the unit vector that the billboard up vector points towards.
  24503. * The default is the zero vector, which means the billboard is aligned to the screen up vector.
  24504. * @example
  24505. * // Example 1.
  24506. * // Have the billboard up vector point north
  24507. * billboard.alignedAxis = Cesium.Cartesian3.UNIT_Z;
  24508. * @example
  24509. * // Example 2.
  24510. * // Have the billboard point east.
  24511. * billboard.alignedAxis = Cesium.Cartesian3.UNIT_Z;
  24512. * billboard.rotation = -Cesium.Math.PI_OVER_TWO;
  24513. * @example
  24514. * // Example 3.
  24515. * // Reset the aligned axis
  24516. * billboard.alignedAxis = Cesium.Cartesian3.ZERO;
  24517. */
  24518. alignedAxis: Cartesian3;
  24519. /**
  24520. * Gets or sets a width for the billboard. If undefined, the image width will be used.
  24521. */
  24522. width: number;
  24523. /**
  24524. * Gets or sets a height for the billboard. If undefined, the image height will be used.
  24525. */
  24526. height: number;
  24527. /**
  24528. * Gets or sets if the billboard size is in meters or pixels. <code>true</code> to size the billboard in meters;
  24529. * otherwise, the size is in pixels.
  24530. */
  24531. sizeInMeters: boolean;
  24532. /**
  24533. * Gets or sets the condition specifying at what distance from the camera that this billboard will be displayed.
  24534. */
  24535. distanceDisplayCondition: DistanceDisplayCondition;
  24536. /**
  24537. * Gets or sets the distance from the camera at which to disable the depth test to, for example, prevent clipping against terrain.
  24538. * When set to zero, the depth test is always applied. When set to Number.POSITIVE_INFINITY, the depth test is never applied.
  24539. */
  24540. disableDepthTestDistance: number;
  24541. /**
  24542. * Gets or sets the user-defined object returned when the billboard is picked.
  24543. */
  24544. id: any;
  24545. /**
  24546. * <p>
  24547. * Gets or sets the image to be used for this billboard. If a texture has already been created for the
  24548. * given image, the existing texture is used.
  24549. * </p>
  24550. * <p>
  24551. * This property can be set to a loaded Image, a URL which will be loaded as an Image automatically,
  24552. * a canvas, or another billboard's image property (from the same billboard collection).
  24553. * </p>
  24554. * @example
  24555. * // load an image from a URL
  24556. * b.image = 'some/image/url.png';
  24557. *
  24558. * // assuming b1 and b2 are billboards in the same billboard collection,
  24559. * // use the same image for both billboards.
  24560. * b2.image = b1.image;
  24561. */
  24562. image: string;
  24563. /**
  24564. * When <code>true</code>, this billboard is ready to render, i.e., the image
  24565. * has been downloaded and the WebGL resources are created.
  24566. */
  24567. readonly ready: boolean;
  24568. /**
  24569. * <p>
  24570. * Sets the image to be used for this billboard. If a texture has already been created for the
  24571. * given id, the existing texture is used.
  24572. * </p>
  24573. * <p>
  24574. * This function is useful for dynamically creating textures that are shared across many billboards.
  24575. * Only the first billboard will actually call the function and create the texture, while subsequent
  24576. * billboards created with the same id will simply re-use the existing texture.
  24577. * </p>
  24578. * <p>
  24579. * To load an image from a URL, setting the {@link Billboard#image} property is more convenient.
  24580. * </p>
  24581. * @example
  24582. * // create a billboard image dynamically
  24583. * function drawImage(id) {
  24584. * // create and draw an image using a canvas
  24585. * var canvas = document.createElement('canvas');
  24586. * var context2D = canvas.getContext('2d');
  24587. * // ... draw image
  24588. * return canvas;
  24589. * }
  24590. * // drawImage will be called to create the texture
  24591. * b.setImage('myImage', drawImage);
  24592. *
  24593. * // subsequent billboards created in the same collection using the same id will use the existing
  24594. * // texture, without the need to create the canvas or draw the image
  24595. * b2.setImage('myImage', drawImage);
  24596. * @param id - The id of the image. This can be any string that uniquely identifies the image.
  24597. * @param image - The image to load. This parameter
  24598. * can either be a loaded Image or Canvas, a URL which will be loaded as an Image automatically,
  24599. * or a function which will be called to create the image if it hasn't been loaded already.
  24600. */
  24601. setImage(id: string, image: HTMLImageElement | HTMLCanvasElement | string | Resource | Billboard.CreateImageCallback): void;
  24602. /**
  24603. * Uses a sub-region of the image with the given id as the image for this billboard,
  24604. * measured in pixels from the bottom-left.
  24605. * @param id - The id of the image to use.
  24606. * @param subRegion - The sub-region of the image.
  24607. */
  24608. setImageSubRegion(id: string, subRegion: BoundingRectangle): void;
  24609. /**
  24610. * Computes the screen-space position of the billboard's origin, taking into account eye and pixel offsets.
  24611. * The screen space origin is the top, left corner of the canvas; <code>x</code> increases from
  24612. * left to right, and <code>y</code> increases from top to bottom.
  24613. * @example
  24614. * console.log(b.computeScreenSpacePosition(scene).toString());
  24615. * @param scene - The scene.
  24616. * @param [result] - The object onto which to store the result.
  24617. * @returns The screen-space position of the billboard.
  24618. */
  24619. computeScreenSpacePosition(scene: Scene, result?: Cartesian2): Cartesian2;
  24620. /**
  24621. * Determines if this billboard equals another billboard. Billboards are equal if all their properties
  24622. * are equal. Billboards in different collections can be equal.
  24623. * @param other - The billboard to compare for equality.
  24624. * @returns <code>true</code> if the billboards are equal; otherwise, <code>false</code>.
  24625. */
  24626. equals(other: Billboard): boolean;
  24627. }
  24628. export namespace Billboard {
  24629. /**
  24630. * A function that creates an image.
  24631. * @param id - The identifier of the image to load.
  24632. */
  24633. type CreateImageCallback = (id: string) => HTMLImageElement | HTMLCanvasElement | Promise<HTMLImageElement | HTMLCanvasElement>;
  24634. }
  24635. /**
  24636. * A renderable collection of billboards. Billboards are viewport-aligned
  24637. * images positioned in the 3D scene.
  24638. * <br /><br />
  24639. * <div align='center'>
  24640. * <img src='Images/Billboard.png' width='400' height='300' /><br />
  24641. * Example billboards
  24642. * </div>
  24643. * <br /><br />
  24644. * Billboards are added and removed from the collection using {@link BillboardCollection#add}
  24645. * and {@link BillboardCollection#remove}. Billboards in a collection automatically share textures
  24646. * for images with the same identifier.
  24647. * @example
  24648. * // Create a billboard collection with two billboards
  24649. * var billboards = scene.primitives.add(new Cesium.BillboardCollection());
  24650. * billboards.add({
  24651. * position : new Cesium.Cartesian3(1.0, 2.0, 3.0),
  24652. * image : 'url/to/image'
  24653. * });
  24654. * billboards.add({
  24655. * position : new Cesium.Cartesian3(4.0, 5.0, 6.0),
  24656. * image : 'url/to/another/image'
  24657. * });
  24658. * @param [options] - Object with the following properties:
  24659. * @param [options.modelMatrix = Matrix4.IDENTITY] - The 4x4 transformation matrix that transforms each billboard from model to world coordinates.
  24660. * @param [options.debugShowBoundingVolume = false] - For debugging only. Determines if this primitive's commands' bounding spheres are shown.
  24661. * @param [options.scene] - Must be passed in for billboards that use the height reference property or will be depth tested against the globe.
  24662. * @param [options.blendOption = BlendOption.OPAQUE_AND_TRANSLUCENT] - The billboard blending option. The default
  24663. * is used for rendering both opaque and translucent billboards. However, if either all of the billboards are completely opaque or all are completely translucent,
  24664. * setting the technique to BlendOption.OPAQUE or BlendOption.TRANSLUCENT can improve performance by up to 2x.
  24665. */
  24666. export class BillboardCollection {
  24667. constructor(options?: {
  24668. modelMatrix?: Matrix4;
  24669. debugShowBoundingVolume?: boolean;
  24670. scene?: Scene;
  24671. blendOption?: BlendOption;
  24672. });
  24673. /**
  24674. * The 4x4 transformation matrix that transforms each billboard in this collection from model to world coordinates.
  24675. * When this is the identity matrix, the billboards are drawn in world coordinates, i.e., Earth's WGS84 coordinates.
  24676. * Local reference frames can be used by providing a different transformation matrix, like that returned
  24677. * by {@link Transforms.eastNorthUpToFixedFrame}.
  24678. * @example
  24679. * var center = Cesium.Cartesian3.fromDegrees(-75.59777, 40.03883);
  24680. * billboards.modelMatrix = Cesium.Transforms.eastNorthUpToFixedFrame(center);
  24681. * billboards.add({
  24682. * image : 'url/to/image',
  24683. * position : new Cesium.Cartesian3(0.0, 0.0, 0.0) // center
  24684. * });
  24685. * billboards.add({
  24686. * image : 'url/to/image',
  24687. * position : new Cesium.Cartesian3(1000000.0, 0.0, 0.0) // east
  24688. * });
  24689. * billboards.add({
  24690. * image : 'url/to/image',
  24691. * position : new Cesium.Cartesian3(0.0, 1000000.0, 0.0) // north
  24692. * });
  24693. * billboards.add({
  24694. * image : 'url/to/image',
  24695. * position : new Cesium.Cartesian3(0.0, 0.0, 1000000.0) // up
  24696. * });
  24697. */
  24698. modelMatrix: Matrix4;
  24699. /**
  24700. * This property is for debugging only; it is not for production use nor is it optimized.
  24701. * <p>
  24702. * Draws the bounding sphere for each draw command in the primitive.
  24703. * </p>
  24704. */
  24705. debugShowBoundingVolume: boolean;
  24706. /**
  24707. * This property is for debugging only; it is not for production use nor is it optimized.
  24708. * <p>
  24709. * Draws the texture atlas for this BillboardCollection as a fullscreen quad.
  24710. * </p>
  24711. */
  24712. debugShowTextureAtlas: boolean;
  24713. /**
  24714. * The billboard blending option. The default is used for rendering both opaque and translucent billboards.
  24715. * However, if either all of the billboards are completely opaque or all are completely translucent,
  24716. * setting the technique to BlendOption.OPAQUE or BlendOption.TRANSLUCENT can improve
  24717. * performance by up to 2x.
  24718. */
  24719. blendOption: BlendOption;
  24720. /**
  24721. * Returns the number of billboards in this collection. This is commonly used with
  24722. * {@link BillboardCollection#get} to iterate over all the billboards
  24723. * in the collection.
  24724. */
  24725. length: number;
  24726. /**
  24727. * Creates and adds a billboard with the specified initial properties to the collection.
  24728. * The added billboard is returned so it can be modified or removed from the collection later.
  24729. * @example
  24730. * // Example 1: Add a billboard, specifying all the default values.
  24731. * var b = billboards.add({
  24732. * show : true,
  24733. * position : Cesium.Cartesian3.ZERO,
  24734. * pixelOffset : Cesium.Cartesian2.ZERO,
  24735. * eyeOffset : Cesium.Cartesian3.ZERO,
  24736. * heightReference : Cesium.HeightReference.NONE,
  24737. * horizontalOrigin : Cesium.HorizontalOrigin.CENTER,
  24738. * verticalOrigin : Cesium.VerticalOrigin.CENTER,
  24739. * scale : 1.0,
  24740. * image : 'url/to/image',
  24741. * imageSubRegion : undefined,
  24742. * color : Cesium.Color.WHITE,
  24743. * id : undefined,
  24744. * rotation : 0.0,
  24745. * alignedAxis : Cesium.Cartesian3.ZERO,
  24746. * width : undefined,
  24747. * height : undefined,
  24748. * scaleByDistance : undefined,
  24749. * translucencyByDistance : undefined,
  24750. * pixelOffsetScaleByDistance : undefined,
  24751. * sizeInMeters : false,
  24752. * distanceDisplayCondition : undefined
  24753. * });
  24754. * @example
  24755. * // Example 2: Specify only the billboard's cartographic position.
  24756. * var b = billboards.add({
  24757. * position : Cesium.Cartesian3.fromDegrees(longitude, latitude, height)
  24758. * });
  24759. * @param [options] - A template describing the billboard's properties as shown in Example 1.
  24760. * @returns The billboard that was added to the collection.
  24761. */
  24762. add(options?: any): Billboard;
  24763. /**
  24764. * Removes a billboard from the collection.
  24765. * @example
  24766. * var b = billboards.add(...);
  24767. * billboards.remove(b); // Returns true
  24768. * @param billboard - The billboard to remove.
  24769. * @returns <code>true</code> if the billboard was removed; <code>false</code> if the billboard was not found in the collection.
  24770. */
  24771. remove(billboard: Billboard): boolean;
  24772. /**
  24773. * Removes all billboards from the collection.
  24774. * @example
  24775. * billboards.add(...);
  24776. * billboards.add(...);
  24777. * billboards.removeAll();
  24778. */
  24779. removeAll(): void;
  24780. /**
  24781. * Check whether this collection contains a given billboard.
  24782. * @param [billboard] - The billboard to check for.
  24783. * @returns true if this collection contains the billboard, false otherwise.
  24784. */
  24785. contains(billboard?: Billboard): boolean;
  24786. /**
  24787. * Returns the billboard in the collection at the specified index. Indices are zero-based
  24788. * and increase as billboards are added. Removing a billboard shifts all billboards after
  24789. * it to the left, changing their indices. This function is commonly used with
  24790. * {@link BillboardCollection#length} to iterate over all the billboards
  24791. * in the collection.
  24792. * @example
  24793. * // Toggle the show property of every billboard in the collection
  24794. * var len = billboards.length;
  24795. * for (var i = 0; i < len; ++i) {
  24796. * var b = billboards.get(i);
  24797. * b.show = !b.show;
  24798. * }
  24799. * @param index - The zero-based index of the billboard.
  24800. * @returns The billboard at the specified index.
  24801. */
  24802. get(index: number): Billboard;
  24803. /**
  24804. * Called when {@link Viewer} or {@link CesiumWidget} render the scene to
  24805. * get the draw commands needed to render this primitive.
  24806. * <p>
  24807. * Do not call this function directly. This is documented just to
  24808. * list the exceptions that may be propagated when the scene is rendered:
  24809. * </p>
  24810. */
  24811. update(): void;
  24812. /**
  24813. * Returns true if this object was destroyed; otherwise, false.
  24814. * <br /><br />
  24815. * If this object was destroyed, it should not be used; calling any function other than
  24816. * <code>isDestroyed</code> will result in a {@link DeveloperError} exception.
  24817. * @returns <code>true</code> if this object was destroyed; otherwise, <code>false</code>.
  24818. */
  24819. isDestroyed(): boolean;
  24820. /**
  24821. * Destroys the WebGL resources held by this object. Destroying an object allows for deterministic
  24822. * release of WebGL resources, instead of relying on the garbage collector to destroy this object.
  24823. * <br /><br />
  24824. * Once an object is destroyed, it should not be used; calling any function other than
  24825. * <code>isDestroyed</code> will result in a {@link DeveloperError} exception. Therefore,
  24826. * assign the return value (<code>undefined</code>) to the object as done in the example.
  24827. * @example
  24828. * billboards = billboards && billboards.destroy();
  24829. */
  24830. destroy(): void;
  24831. }
  24832. export namespace BingMapsImageryProvider {
  24833. /**
  24834. * Initialization options for the BingMapsImageryProvider constructor
  24835. * @property url - The url of the Bing Maps server hosting the imagery.
  24836. * @property key - The Bing Maps key for your application, which can be
  24837. * created at {@link https://www.bingmapsportal.com/}.
  24838. * If this parameter is not provided, {@link BingMapsApi.defaultKey} is used, which is undefined by default.
  24839. * @property [tileProtocol] - The protocol to use when loading tiles, e.g. 'http' or 'https'.
  24840. * By default, tiles are loaded using the same protocol as the page.
  24841. * @property [mapStyle = BingMapsStyle.AERIAL] - The type of Bing Maps imagery to load.
  24842. * @property [culture = ''] - The culture to use when requesting Bing Maps imagery. Not
  24843. * all cultures are supported. See {@link http://msdn.microsoft.com/en-us/library/hh441729.aspx}
  24844. * for information on the supported cultures.
  24845. * @property [ellipsoid] - The ellipsoid. If not specified, the WGS84 ellipsoid is used.
  24846. * @property [tileDiscardPolicy] - The policy that determines if a tile
  24847. * is invalid and should be discarded. By default, a {@link DiscardEmptyTileImagePolicy}
  24848. * will be used, with the expectation that the Bing Maps server will send a zero-length response for missing tiles.
  24849. * To ensure that no tiles are discarded, construct and pass a {@link NeverTileDiscardPolicy} for this parameter.
  24850. */
  24851. type ConstructorOptions = {
  24852. url: Resource | string;
  24853. key: string;
  24854. tileProtocol?: string;
  24855. mapStyle?: BingMapsStyle;
  24856. culture?: string;
  24857. ellipsoid?: Ellipsoid;
  24858. tileDiscardPolicy?: TileDiscardPolicy;
  24859. };
  24860. }
  24861. /**
  24862. * Provides tiled imagery using the Bing Maps Imagery REST API.
  24863. * @example
  24864. * var bing = new Cesium.BingMapsImageryProvider({
  24865. * url : 'https://dev.virtualearth.net',
  24866. * key : 'get-yours-at-https://www.bingmapsportal.com/',
  24867. * mapStyle : Cesium.BingMapsStyle.AERIAL
  24868. * });
  24869. * @param options - Object describing initialization options
  24870. */
  24871. export class BingMapsImageryProvider {
  24872. constructor(options: BingMapsImageryProvider.ConstructorOptions);
  24873. /**
  24874. * The default alpha blending value of this provider, with 0.0 representing fully transparent and
  24875. * 1.0 representing fully opaque.
  24876. */
  24877. defaultAlpha: number | undefined;
  24878. /**
  24879. * The default alpha blending value on the night side of the globe of this provider, with 0.0 representing fully transparent and
  24880. * 1.0 representing fully opaque.
  24881. */
  24882. defaultNightAlpha: number | undefined;
  24883. /**
  24884. * The default alpha blending value on the day side of the globe of this provider, with 0.0 representing fully transparent and
  24885. * 1.0 representing fully opaque.
  24886. */
  24887. defaultDayAlpha: number | undefined;
  24888. /**
  24889. * The default brightness of this provider. 1.0 uses the unmodified imagery color. Less than 1.0
  24890. * makes the imagery darker while greater than 1.0 makes it brighter.
  24891. */
  24892. defaultBrightness: number | undefined;
  24893. /**
  24894. * The default contrast of this provider. 1.0 uses the unmodified imagery color. Less than 1.0 reduces
  24895. * the contrast while greater than 1.0 increases it.
  24896. */
  24897. defaultContrast: number | undefined;
  24898. /**
  24899. * The default hue of this provider in radians. 0.0 uses the unmodified imagery color.
  24900. */
  24901. defaultHue: number | undefined;
  24902. /**
  24903. * The default saturation of this provider. 1.0 uses the unmodified imagery color. Less than 1.0 reduces the
  24904. * saturation while greater than 1.0 increases it.
  24905. */
  24906. defaultSaturation: number | undefined;
  24907. /**
  24908. * The default gamma correction to apply to this provider. 1.0 uses the unmodified imagery color.
  24909. */
  24910. defaultGamma: number | undefined;
  24911. /**
  24912. * The default texture minification filter to apply to this provider.
  24913. */
  24914. defaultMinificationFilter: TextureMinificationFilter;
  24915. /**
  24916. * The default texture magnification filter to apply to this provider.
  24917. */
  24918. defaultMagnificationFilter: TextureMagnificationFilter;
  24919. /**
  24920. * Gets the name of the BingMaps server url hosting the imagery.
  24921. */
  24922. readonly url: string;
  24923. /**
  24924. * Gets the proxy used by this provider.
  24925. */
  24926. readonly proxy: Proxy;
  24927. /**
  24928. * Gets the Bing Maps key.
  24929. */
  24930. readonly key: string;
  24931. /**
  24932. * Gets the type of Bing Maps imagery to load.
  24933. */
  24934. readonly mapStyle: BingMapsStyle;
  24935. /**
  24936. * The culture to use when requesting Bing Maps imagery. Not
  24937. * all cultures are supported. See {@link http://msdn.microsoft.com/en-us/library/hh441729.aspx}
  24938. * for information on the supported cultures.
  24939. */
  24940. readonly culture: string;
  24941. /**
  24942. * Gets the width of each tile, in pixels. This function should
  24943. * not be called before {@link BingMapsImageryProvider#ready} returns true.
  24944. */
  24945. readonly tileWidth: number;
  24946. /**
  24947. * Gets the height of each tile, in pixels. This function should
  24948. * not be called before {@link BingMapsImageryProvider#ready} returns true.
  24949. */
  24950. readonly tileHeight: number;
  24951. /**
  24952. * Gets the maximum level-of-detail that can be requested. This function should
  24953. * not be called before {@link BingMapsImageryProvider#ready} returns true.
  24954. */
  24955. readonly maximumLevel: number | undefined;
  24956. /**
  24957. * Gets the minimum level-of-detail that can be requested. This function should
  24958. * not be called before {@link BingMapsImageryProvider#ready} returns true.
  24959. */
  24960. readonly minimumLevel: number;
  24961. /**
  24962. * Gets the tiling scheme used by this provider. This function should
  24963. * not be called before {@link BingMapsImageryProvider#ready} returns true.
  24964. */
  24965. readonly tilingScheme: TilingScheme;
  24966. /**
  24967. * Gets the rectangle, in radians, of the imagery provided by this instance. This function should
  24968. * not be called before {@link BingMapsImageryProvider#ready} returns true.
  24969. */
  24970. readonly rectangle: Rectangle;
  24971. /**
  24972. * Gets the tile discard policy. If not undefined, the discard policy is responsible
  24973. * for filtering out "missing" tiles via its shouldDiscardImage function. If this function
  24974. * returns undefined, no tiles are filtered. This function should
  24975. * not be called before {@link BingMapsImageryProvider#ready} returns true.
  24976. */
  24977. readonly tileDiscardPolicy: TileDiscardPolicy;
  24978. /**
  24979. * Gets an event that is raised when the imagery provider encounters an asynchronous error. By subscribing
  24980. * to the event, you will be notified of the error and can potentially recover from it. Event listeners
  24981. * are passed an instance of {@link TileProviderError}.
  24982. */
  24983. readonly errorEvent: Event;
  24984. /**
  24985. * Gets a value indicating whether or not the provider is ready for use.
  24986. */
  24987. readonly ready: boolean;
  24988. /**
  24989. * Gets a promise that resolves to true when the provider is ready for use.
  24990. */
  24991. readonly readyPromise: Promise<boolean>;
  24992. /**
  24993. * Gets the credit to display when this imagery provider is active. Typically this is used to credit
  24994. * the source of the imagery. This function should not be called before {@link BingMapsImageryProvider#ready} returns true.
  24995. */
  24996. readonly credit: Credit;
  24997. /**
  24998. * Gets a value indicating whether or not the images provided by this imagery provider
  24999. * include an alpha channel. If this property is false, an alpha channel, if present, will
  25000. * be ignored. If this property is true, any images without an alpha channel will be treated
  25001. * as if their alpha is 1.0 everywhere. Setting this property to false reduces memory usage
  25002. * and texture upload time.
  25003. */
  25004. readonly hasAlphaChannel: boolean;
  25005. /**
  25006. * Gets the credits to be displayed when a given tile is displayed.
  25007. * @param x - The tile X coordinate.
  25008. * @param y - The tile Y coordinate.
  25009. * @param level - The tile level;
  25010. * @returns The credits to be displayed when the tile is displayed.
  25011. */
  25012. getTileCredits(x: number, y: number, level: number): Credit[];
  25013. /**
  25014. * Requests the image for a given tile. This function should
  25015. * not be called before {@link BingMapsImageryProvider#ready} returns true.
  25016. * @param x - The tile X coordinate.
  25017. * @param y - The tile Y coordinate.
  25018. * @param level - The tile level.
  25019. * @param [request] - The request object. Intended for internal use only.
  25020. * @returns A promise for the image that will resolve when the image is available, or
  25021. * undefined if there are too many active requests to the server, and the request
  25022. * should be retried later. The resolved image may be either an
  25023. * Image or a Canvas DOM object.
  25024. */
  25025. requestImage(x: number, y: number, level: number, request?: Request): Promise<HTMLImageElement | HTMLCanvasElement> | undefined;
  25026. /**
  25027. * Picking features is not currently supported by this imagery provider, so this function simply returns
  25028. * undefined.
  25029. * @param x - The tile X coordinate.
  25030. * @param y - The tile Y coordinate.
  25031. * @param level - The tile level.
  25032. * @param longitude - The longitude at which to pick features.
  25033. * @param latitude - The latitude at which to pick features.
  25034. * @returns A promise for the picked features that will resolve when the asynchronous
  25035. * picking completes. The resolved value is an array of {@link ImageryLayerFeatureInfo}
  25036. * instances. The array may be empty if no features are found at the given location.
  25037. * It may also be undefined if picking is not supported.
  25038. */
  25039. pickFeatures(x: number, y: number, level: number, longitude: number, latitude: number): Promise<ImageryLayerFeatureInfo[]> | undefined;
  25040. /**
  25041. * Converts a tiles (x, y, level) position into a quadkey used to request an image
  25042. * from a Bing Maps server.
  25043. * @param x - The tile's x coordinate.
  25044. * @param y - The tile's y coordinate.
  25045. * @param level - The tile's zoom level.
  25046. */
  25047. static tileXYToQuadKey(x: number, y: number, level: number): void;
  25048. /**
  25049. * Converts a tile's quadkey used to request an image from a Bing Maps server into the
  25050. * (x, y, level) position.
  25051. * @param quadkey - The tile's quad key
  25052. */
  25053. static quadKeyToTileXY(quadkey: string): void;
  25054. /**
  25055. * Gets or sets the URL to the Bing logo for display in the credit.
  25056. */
  25057. static logoUrl: string;
  25058. }
  25059. /**
  25060. * The types of imagery provided by Bing Maps.
  25061. */
  25062. export enum BingMapsStyle {
  25063. /**
  25064. * Aerial imagery.
  25065. */
  25066. AERIAL = "Aerial",
  25067. /**
  25068. * Aerial imagery with a road overlay.
  25069. */
  25070. AERIAL_WITH_LABELS = "AerialWithLabels",
  25071. /**
  25072. * Aerial imagery with a road overlay.
  25073. */
  25074. AERIAL_WITH_LABELS_ON_DEMAND = "AerialWithLabelsOnDemand",
  25075. /**
  25076. * Roads without additional imagery.
  25077. */
  25078. ROAD = "Road",
  25079. /**
  25080. * Roads without additional imagery.
  25081. */
  25082. ROAD_ON_DEMAND = "RoadOnDemand",
  25083. /**
  25084. * A dark version of the road maps.
  25085. */
  25086. CANVAS_DARK = "CanvasDark",
  25087. /**
  25088. * A lighter version of the road maps.
  25089. */
  25090. CANVAS_LIGHT = "CanvasLight",
  25091. /**
  25092. * A grayscale version of the road maps.
  25093. */
  25094. CANVAS_GRAY = "CanvasGray",
  25095. /**
  25096. * Ordnance Survey imagery. This imagery is visible only for the London, UK area.
  25097. */
  25098. ORDNANCE_SURVEY = "OrdnanceSurvey",
  25099. /**
  25100. * Collins Bart imagery.
  25101. */
  25102. COLLINS_BART = "CollinsBart"
  25103. }
  25104. /**
  25105. * Determines how two pixels' values are combined.
  25106. */
  25107. export enum BlendEquation {
  25108. /**
  25109. * Pixel values are added componentwise. This is used in additive blending for translucency.
  25110. */
  25111. ADD = WebGLConstants.FUNC_ADD,
  25112. /**
  25113. * Pixel values are subtracted componentwise (source - destination). This is used in alpha blending for translucency.
  25114. */
  25115. SUBTRACT = WebGLConstants.FUNC_SUBTRACT,
  25116. /**
  25117. * Pixel values are subtracted componentwise (destination - source).
  25118. */
  25119. REVERSE_SUBTRACT = WebGLConstants.FUNC_REVERSE_SUBTRACT,
  25120. /**
  25121. * Pixel values are given to the minimum function (min(source, destination)).
  25122. *
  25123. * This equation operates on each pixel color component.
  25124. */
  25125. MIN = WebGLConstants.MIN,
  25126. /**
  25127. * Pixel values are given to the maximum function (max(source, destination)).
  25128. *
  25129. * This equation operates on each pixel color component.
  25130. */
  25131. MAX = WebGLConstants.MAX
  25132. }
  25133. /**
  25134. * Determines how blending factors are computed.
  25135. */
  25136. export enum BlendFunction {
  25137. /**
  25138. * The blend factor is zero.
  25139. */
  25140. ZERO = WebGLConstants.ZERO,
  25141. /**
  25142. * The blend factor is one.
  25143. */
  25144. ONE = WebGLConstants.ONE,
  25145. /**
  25146. * The blend factor is the source color.
  25147. */
  25148. SOURCE_COLOR = WebGLConstants.SRC_COLOR,
  25149. /**
  25150. * The blend factor is one minus the source color.
  25151. */
  25152. ONE_MINUS_SOURCE_COLOR = WebGLConstants.ONE_MINUS_SRC_COLOR,
  25153. /**
  25154. * The blend factor is the destination color.
  25155. */
  25156. DESTINATION_COLOR = WebGLConstants.DST_COLOR,
  25157. /**
  25158. * The blend factor is one minus the destination color.
  25159. */
  25160. ONE_MINUS_DESTINATION_COLOR = WebGLConstants.ONE_MINUS_DST_COLOR,
  25161. /**
  25162. * The blend factor is the source alpha.
  25163. */
  25164. SOURCE_ALPHA = WebGLConstants.SRC_ALPHA,
  25165. /**
  25166. * The blend factor is one minus the source alpha.
  25167. */
  25168. ONE_MINUS_SOURCE_ALPHA = WebGLConstants.ONE_MINUS_SRC_ALPHA,
  25169. /**
  25170. * The blend factor is the destination alpha.
  25171. */
  25172. DESTINATION_ALPHA = WebGLConstants.DST_ALPHA,
  25173. /**
  25174. * The blend factor is one minus the destination alpha.
  25175. */
  25176. ONE_MINUS_DESTINATION_ALPHA = WebGLConstants.ONE_MINUS_DST_ALPHA,
  25177. /**
  25178. * The blend factor is the constant color.
  25179. */
  25180. CONSTANT_COLOR = WebGLConstants.CONSTANT_COLOR,
  25181. /**
  25182. * The blend factor is one minus the constant color.
  25183. */
  25184. ONE_MINUS_CONSTANT_COLOR = WebGLConstants.ONE_MINUS_CONSTANT_COLOR,
  25185. /**
  25186. * The blend factor is the constant alpha.
  25187. */
  25188. CONSTANT_ALPHA = WebGLConstants.CONSTANT_ALPHA,
  25189. /**
  25190. * The blend factor is one minus the constant alpha.
  25191. */
  25192. ONE_MINUS_CONSTANT_ALPHA = WebGLConstants.ONE_MINUS_CONSTANT_ALPHA,
  25193. /**
  25194. * The blend factor is the saturated source alpha.
  25195. */
  25196. SOURCE_ALPHA_SATURATE = WebGLConstants.SRC_ALPHA_SATURATE
  25197. }
  25198. /**
  25199. * Determines how opaque and translucent parts of billboards, points, and labels are blended with the scene.
  25200. */
  25201. export enum BlendOption {
  25202. /**
  25203. * The billboards, points, or labels in the collection are completely opaque.
  25204. */
  25205. OPAQUE = 0,
  25206. /**
  25207. * The billboards, points, or labels in the collection are completely translucent.
  25208. */
  25209. TRANSLUCENT = 1,
  25210. /**
  25211. * The billboards, points, or labels in the collection are both opaque and translucent.
  25212. */
  25213. OPAQUE_AND_TRANSLUCENT = 2
  25214. }
  25215. /**
  25216. * The blending state combines {@link BlendEquation} and {@link BlendFunction} and the
  25217. * <code>enabled</code> flag to define the full blending state for combining source and
  25218. * destination fragments when rendering.
  25219. * <p>
  25220. * This is a helper when using custom render states with {@link Appearance#renderState}.
  25221. * </p>
  25222. */
  25223. export namespace BlendingState {
  25224. /**
  25225. * Blending is disabled.
  25226. */
  25227. const DISABLED: any;
  25228. /**
  25229. * Blending is enabled using alpha blending, <code>source(source.alpha) + destination(1 - source.alpha)</code>.
  25230. */
  25231. const ALPHA_BLEND: any;
  25232. /**
  25233. * Blending is enabled using alpha blending with premultiplied alpha, <code>source + destination(1 - source.alpha)</code>.
  25234. */
  25235. const PRE_MULTIPLIED_ALPHA_BLEND: any;
  25236. /**
  25237. * Blending is enabled using additive blending, <code>source(source.alpha) + destination</code>.
  25238. */
  25239. const ADDITIVE_BLEND: any;
  25240. }
  25241. /**
  25242. * A ParticleEmitter that emits particles within a box.
  25243. * Particles will be positioned randomly within the box and have initial velocities emanating from the center of the box.
  25244. * @param dimensions - The width, height and depth dimensions of the box.
  25245. */
  25246. export class BoxEmitter {
  25247. constructor(dimensions: Cartesian3);
  25248. /**
  25249. * The width, height and depth dimensions of the box in meters.
  25250. */
  25251. dimensions: Cartesian3;
  25252. }
  25253. /**
  25254. * The camera is defined by a position, orientation, and view frustum.
  25255. * <br /><br />
  25256. * The orientation forms an orthonormal basis with a view, up and right = view x up unit vectors.
  25257. * <br /><br />
  25258. * The viewing frustum is defined by 6 planes.
  25259. * Each plane is represented by a {@link Cartesian4} object, where the x, y, and z components
  25260. * define the unit vector normal to the plane, and the w component is the distance of the
  25261. * plane from the origin/camera position.
  25262. * @example
  25263. * // Create a camera looking down the negative z-axis, positioned at the origin,
  25264. * // with a field of view of 60 degrees, and 1:1 aspect ratio.
  25265. * var camera = new Cesium.Camera(scene);
  25266. * camera.position = new Cesium.Cartesian3();
  25267. * camera.direction = Cesium.Cartesian3.negate(Cesium.Cartesian3.UNIT_Z, new Cesium.Cartesian3());
  25268. * camera.up = Cesium.Cartesian3.clone(Cesium.Cartesian3.UNIT_Y);
  25269. * camera.frustum.fov = Cesium.Math.PI_OVER_THREE;
  25270. * camera.frustum.near = 1.0;
  25271. * camera.frustum.far = 2.0;
  25272. * @param scene - The scene.
  25273. */
  25274. export class Camera {
  25275. constructor(scene: Scene);
  25276. /**
  25277. * The position of the camera.
  25278. */
  25279. position: Cartesian3;
  25280. /**
  25281. * The view direction of the camera.
  25282. */
  25283. direction: Cartesian3;
  25284. /**
  25285. * The up direction of the camera.
  25286. */
  25287. up: Cartesian3;
  25288. /**
  25289. * The right direction of the camera.
  25290. */
  25291. right: Cartesian3;
  25292. /**
  25293. * The region of space in view.
  25294. */
  25295. frustum: PerspectiveFrustum | PerspectiveOffCenterFrustum | OrthographicFrustum;
  25296. /**
  25297. * The default amount to move the camera when an argument is not
  25298. * provided to the move methods.
  25299. */
  25300. defaultMoveAmount: number;
  25301. /**
  25302. * The default amount to rotate the camera when an argument is not
  25303. * provided to the look methods.
  25304. */
  25305. defaultLookAmount: number;
  25306. /**
  25307. * The default amount to rotate the camera when an argument is not
  25308. * provided to the rotate methods.
  25309. */
  25310. defaultRotateAmount: number;
  25311. /**
  25312. * The default amount to move the camera when an argument is not
  25313. * provided to the zoom methods.
  25314. */
  25315. defaultZoomAmount: number;
  25316. /**
  25317. * If set, the camera will not be able to rotate past this axis in either direction.
  25318. */
  25319. constrainedAxis: Cartesian3;
  25320. /**
  25321. * The factor multiplied by the the map size used to determine where to clamp the camera position
  25322. * when zooming out from the surface. The default is 1.5. Only valid for 2D and the map is rotatable.
  25323. */
  25324. maximumZoomFactor: number;
  25325. /**
  25326. * 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.
  25327. */
  25328. percentageChanged: number;
  25329. /**
  25330. * The default rectangle the camera will view on creation.
  25331. */
  25332. static DEFAULT_VIEW_RECTANGLE: Rectangle;
  25333. /**
  25334. * A scalar to multiply to the camera position and add it back after setting the camera to view the rectangle.
  25335. * A value of zero means the camera will view the entire {@link Camera#DEFAULT_VIEW_RECTANGLE}, a value greater than zero
  25336. * will move it further away from the extent, and a value less than zero will move it close to the extent.
  25337. */
  25338. static DEFAULT_VIEW_FACTOR: number;
  25339. /**
  25340. * The default heading/pitch/range that is used when the camera flies to a location that contains a bounding sphere.
  25341. */
  25342. static DEFAULT_OFFSET: HeadingPitchRange;
  25343. /**
  25344. * Gets the camera's reference frame. The inverse of this transformation is appended to the view matrix.
  25345. */
  25346. readonly transform: Matrix4;
  25347. /**
  25348. * Gets the inverse camera transform.
  25349. */
  25350. readonly inverseTransform: Matrix4;
  25351. /**
  25352. * Gets the view matrix.
  25353. */
  25354. readonly viewMatrix: Matrix4;
  25355. /**
  25356. * Gets the inverse view matrix.
  25357. */
  25358. readonly inverseViewMatrix: Matrix4;
  25359. /**
  25360. * Gets the {@link Cartographic} position of the camera, with longitude and latitude
  25361. * expressed in radians and height in meters. In 2D and Columbus View, it is possible
  25362. * for the returned longitude and latitude to be outside the range of valid longitudes
  25363. * and latitudes when the camera is outside the map.
  25364. */
  25365. readonly positionCartographic: Cartographic;
  25366. /**
  25367. * Gets the position of the camera in world coordinates.
  25368. */
  25369. readonly positionWC: Cartesian3;
  25370. /**
  25371. * Gets the view direction of the camera in world coordinates.
  25372. */
  25373. readonly directionWC: Cartesian3;
  25374. /**
  25375. * Gets the up direction of the camera in world coordinates.
  25376. */
  25377. readonly upWC: Cartesian3;
  25378. /**
  25379. * Gets the right direction of the camera in world coordinates.
  25380. */
  25381. readonly rightWC: Cartesian3;
  25382. /**
  25383. * Gets the camera heading in radians.
  25384. */
  25385. readonly heading: number;
  25386. /**
  25387. * Gets the camera pitch in radians.
  25388. */
  25389. readonly pitch: number;
  25390. /**
  25391. * Gets the camera roll in radians.
  25392. */
  25393. readonly roll: number;
  25394. /**
  25395. * Gets the event that will be raised at when the camera starts to move.
  25396. */
  25397. readonly moveStart: Event;
  25398. /**
  25399. * Gets the event that will be raised when the camera has stopped moving.
  25400. */
  25401. readonly moveEnd: Event;
  25402. /**
  25403. * Gets the event that will be raised when the camera has changed by <code>percentageChanged</code>.
  25404. */
  25405. readonly changed: Event;
  25406. /**
  25407. * Sets the camera position, orientation and transform.
  25408. * @example
  25409. * // 1. Set position with a top-down view
  25410. * viewer.camera.setView({
  25411. * destination : Cesium.Cartesian3.fromDegrees(-117.16, 32.71, 15000.0)
  25412. * });
  25413. *
  25414. * // 2 Set view with heading, pitch and roll
  25415. * viewer.camera.setView({
  25416. * destination : cartesianPosition,
  25417. * orientation: {
  25418. * heading : Cesium.Math.toRadians(90.0), // east, default value is 0.0 (north)
  25419. * pitch : Cesium.Math.toRadians(-90), // default value (looking down)
  25420. * roll : 0.0 // default value
  25421. * }
  25422. * });
  25423. *
  25424. * // 3. Change heading, pitch and roll with the camera position remaining the same.
  25425. * viewer.camera.setView({
  25426. * orientation: {
  25427. * heading : Cesium.Math.toRadians(90.0), // east, default value is 0.0 (north)
  25428. * pitch : Cesium.Math.toRadians(-90), // default value (looking down)
  25429. * roll : 0.0 // default value
  25430. * }
  25431. * });
  25432. *
  25433. *
  25434. * // 4. View rectangle with a top-down view
  25435. * viewer.camera.setView({
  25436. * destination : Cesium.Rectangle.fromDegrees(west, south, east, north)
  25437. * });
  25438. *
  25439. * // 5. Set position with an orientation using unit vectors.
  25440. * viewer.camera.setView({
  25441. * destination : Cesium.Cartesian3.fromDegrees(-122.19, 46.25, 5000.0),
  25442. * orientation : {
  25443. * direction : new Cesium.Cartesian3(-0.04231243104240401, -0.20123236049443421, -0.97862924300734),
  25444. * up : new Cesium.Cartesian3(-0.47934589305293746, -0.8553216253114552, 0.1966022179118339)
  25445. * }
  25446. * });
  25447. * @param options - Object with the following properties:
  25448. * @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.
  25449. * @param [options.orientation] - An object that contains either direction and up properties or heading, pitch and roll properties. By default, the direction will point
  25450. * 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
  25451. * y direction in Columbus view. Orientation is not used in 2D when in infinite scrolling mode.
  25452. * @param [options.endTransform] - Transform matrix representing the reference frame of the camera.
  25453. * @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>.
  25454. */
  25455. setView(options: {
  25456. destination?: Cartesian3 | Rectangle;
  25457. orientation?: any;
  25458. endTransform?: Matrix4;
  25459. convert?: boolean;
  25460. }): void;
  25461. /**
  25462. * Fly the camera to the home view. Use {@link Camera#.DEFAULT_VIEW_RECTANGLE} to set
  25463. * the default view for the 3D scene. The home view for 2D and columbus view shows the
  25464. * entire map.
  25465. * @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}
  25466. */
  25467. flyHome(duration?: number): void;
  25468. /**
  25469. * Transform a vector or point from world coordinates to the camera's reference frame.
  25470. * @param cartesian - The vector or point to transform.
  25471. * @param [result] - The object onto which to store the result.
  25472. * @returns The transformed vector or point.
  25473. */
  25474. worldToCameraCoordinates(cartesian: Cartesian4, result?: Cartesian4): Cartesian4;
  25475. /**
  25476. * Transform a point from world coordinates to the camera's reference frame.
  25477. * @param cartesian - The point to transform.
  25478. * @param [result] - The object onto which to store the result.
  25479. * @returns The transformed point.
  25480. */
  25481. worldToCameraCoordinatesPoint(cartesian: Cartesian3, result?: Cartesian3): Cartesian3;
  25482. /**
  25483. * Transform a vector from world coordinates to the camera's reference frame.
  25484. * @param cartesian - The vector to transform.
  25485. * @param [result] - The object onto which to store the result.
  25486. * @returns The transformed vector.
  25487. */
  25488. worldToCameraCoordinatesVector(cartesian: Cartesian3, result?: Cartesian3): Cartesian3;
  25489. /**
  25490. * Transform a vector or point from the camera's reference frame to world coordinates.
  25491. * @param cartesian - The vector or point to transform.
  25492. * @param [result] - The object onto which to store the result.
  25493. * @returns The transformed vector or point.
  25494. */
  25495. cameraToWorldCoordinates(cartesian: Cartesian4, result?: Cartesian4): Cartesian4;
  25496. /**
  25497. * Transform a point from the camera's reference frame to world coordinates.
  25498. * @param cartesian - The point to transform.
  25499. * @param [result] - The object onto which to store the result.
  25500. * @returns The transformed point.
  25501. */
  25502. cameraToWorldCoordinatesPoint(cartesian: Cartesian3, result?: Cartesian3): Cartesian3;
  25503. /**
  25504. * Transform a vector from the camera's reference frame to world coordinates.
  25505. * @param cartesian - The vector to transform.
  25506. * @param [result] - The object onto which to store the result.
  25507. * @returns The transformed vector.
  25508. */
  25509. cameraToWorldCoordinatesVector(cartesian: Cartesian3, result?: Cartesian3): Cartesian3;
  25510. /**
  25511. * Translates the camera's position by <code>amount</code> along <code>direction</code>.
  25512. * @param direction - The direction to move.
  25513. * @param [amount] - The amount, in meters, to move. Defaults to <code>defaultMoveAmount</code>.
  25514. */
  25515. move(direction: Cartesian3, amount?: number): void;
  25516. /**
  25517. * Translates the camera's position by <code>amount</code> along the camera's view vector.
  25518. * When in 2D mode, this will zoom in the camera instead of translating the camera's position.
  25519. * @param [amount] - The amount, in meters, to move. Defaults to <code>defaultMoveAmount</code>.
  25520. */
  25521. moveForward(amount?: number): void;
  25522. /**
  25523. * Translates the camera's position by <code>amount</code> along the opposite direction
  25524. * of the camera's view vector.
  25525. * When in 2D mode, this will zoom out the camera instead of translating the camera's position.
  25526. * @param [amount] - The amount, in meters, to move. Defaults to <code>defaultMoveAmount</code>.
  25527. */
  25528. moveBackward(amount?: number): void;
  25529. /**
  25530. * Translates the camera's position by <code>amount</code> along the camera's up vector.
  25531. * @param [amount] - The amount, in meters, to move. Defaults to <code>defaultMoveAmount</code>.
  25532. */
  25533. moveUp(amount?: number): void;
  25534. /**
  25535. * Translates the camera's position by <code>amount</code> along the opposite direction
  25536. * of the camera's up vector.
  25537. * @param [amount] - The amount, in meters, to move. Defaults to <code>defaultMoveAmount</code>.
  25538. */
  25539. moveDown(amount?: number): void;
  25540. /**
  25541. * Translates the camera's position by <code>amount</code> along the camera's right vector.
  25542. * @param [amount] - The amount, in meters, to move. Defaults to <code>defaultMoveAmount</code>.
  25543. */
  25544. moveRight(amount?: number): void;
  25545. /**
  25546. * Translates the camera's position by <code>amount</code> along the opposite direction
  25547. * of the camera's right vector.
  25548. * @param [amount] - The amount, in meters, to move. Defaults to <code>defaultMoveAmount</code>.
  25549. */
  25550. moveLeft(amount?: number): void;
  25551. /**
  25552. * Rotates the camera around its up vector by amount, in radians, in the opposite direction
  25553. * of its right vector if not in 2D mode.
  25554. * @param [amount] - The amount, in radians, to rotate by. Defaults to <code>defaultLookAmount</code>.
  25555. */
  25556. lookLeft(amount?: number): void;
  25557. /**
  25558. * Rotates the camera around its up vector by amount, in radians, in the direction
  25559. * of its right vector if not in 2D mode.
  25560. * @param [amount] - The amount, in radians, to rotate by. Defaults to <code>defaultLookAmount</code>.
  25561. */
  25562. lookRight(amount?: number): void;
  25563. /**
  25564. * Rotates the camera around its right vector by amount, in radians, in the direction
  25565. * of its up vector if not in 2D mode.
  25566. * @param [amount] - The amount, in radians, to rotate by. Defaults to <code>defaultLookAmount</code>.
  25567. */
  25568. lookUp(amount?: number): void;
  25569. /**
  25570. * Rotates the camera around its right vector by amount, in radians, in the opposite direction
  25571. * of its up vector if not in 2D mode.
  25572. * @param [amount] - The amount, in radians, to rotate by. Defaults to <code>defaultLookAmount</code>.
  25573. */
  25574. lookDown(amount?: number): void;
  25575. /**
  25576. * Rotate each of the camera's orientation vectors around <code>axis</code> by <code>angle</code>
  25577. * @param axis - The axis to rotate around.
  25578. * @param [angle] - The angle, in radians, to rotate by. Defaults to <code>defaultLookAmount</code>.
  25579. */
  25580. look(axis: Cartesian3, angle?: number): void;
  25581. /**
  25582. * Rotate the camera counter-clockwise around its direction vector by amount, in radians.
  25583. * @param [amount] - The amount, in radians, to rotate by. Defaults to <code>defaultLookAmount</code>.
  25584. */
  25585. twistLeft(amount?: number): void;
  25586. /**
  25587. * Rotate the camera clockwise around its direction vector by amount, in radians.
  25588. * @param [amount] - The amount, in radians, to rotate by. Defaults to <code>defaultLookAmount</code>.
  25589. */
  25590. twistRight(amount?: number): void;
  25591. /**
  25592. * Rotates the camera around <code>axis</code> by <code>angle</code>. The distance
  25593. * of the camera's position to the center of the camera's reference frame remains the same.
  25594. * @param axis - The axis to rotate around given in world coordinates.
  25595. * @param [angle] - The angle, in radians, to rotate by. Defaults to <code>defaultRotateAmount</code>.
  25596. */
  25597. rotate(axis: Cartesian3, angle?: number): void;
  25598. /**
  25599. * Rotates the camera around the center of the camera's reference frame by angle downwards.
  25600. * @param [angle] - The angle, in radians, to rotate by. Defaults to <code>defaultRotateAmount</code>.
  25601. */
  25602. rotateDown(angle?: number): void;
  25603. /**
  25604. * Rotates the camera around the center of the camera's reference frame by angle upwards.
  25605. * @param [angle] - The angle, in radians, to rotate by. Defaults to <code>defaultRotateAmount</code>.
  25606. */
  25607. rotateUp(angle?: number): void;
  25608. /**
  25609. * Rotates the camera around the center of the camera's reference frame by angle to the right.
  25610. * @param [angle] - The angle, in radians, to rotate by. Defaults to <code>defaultRotateAmount</code>.
  25611. */
  25612. rotateRight(angle?: number): void;
  25613. /**
  25614. * Rotates the camera around the center of the camera's reference frame by angle to the left.
  25615. * @param [angle] - The angle, in radians, to rotate by. Defaults to <code>defaultRotateAmount</code>.
  25616. */
  25617. rotateLeft(angle?: number): void;
  25618. /**
  25619. * Zooms <code>amount</code> along the camera's view vector.
  25620. * @param [amount] - The amount to move. Defaults to <code>defaultZoomAmount</code>.
  25621. */
  25622. zoomIn(amount?: number): void;
  25623. /**
  25624. * Zooms <code>amount</code> along the opposite direction of
  25625. * the camera's view vector.
  25626. * @param [amount] - The amount to move. Defaults to <code>defaultZoomAmount</code>.
  25627. */
  25628. zoomOut(amount?: number): void;
  25629. /**
  25630. * Gets the magnitude of the camera position. In 3D, this is the vector magnitude. In 2D and
  25631. * Columbus view, this is the distance to the map.
  25632. * @returns The magnitude of the position.
  25633. */
  25634. getMagnitude(): number;
  25635. /**
  25636. * Sets the camera position and orientation using a target and offset. The target must be given in
  25637. * 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.
  25638. * 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
  25639. * is heading/pitch/range, then the heading and the pitch angles are defined in the reference frame defined by the transformation matrix.
  25640. * The heading is the angle from y axis and increasing towards the x axis. Pitch is the rotation from the xy-plane. Positive pitch
  25641. * angles are below the plane. Negative pitch angles are above the plane. The range is the distance from the center.
  25642. *
  25643. * In 2D, there must be a top down view. The camera will be placed above the target looking down. The height above the
  25644. * target will be the magnitude of the offset. The heading will be determined from the offset. If the heading cannot be
  25645. * determined from the offset, the heading will be north.
  25646. * @example
  25647. * // 1. Using a cartesian offset
  25648. * var center = Cesium.Cartesian3.fromDegrees(-98.0, 40.0);
  25649. * viewer.camera.lookAt(center, new Cesium.Cartesian3(0.0, -4790000.0, 3930000.0));
  25650. *
  25651. * // 2. Using a HeadingPitchRange offset
  25652. * var center = Cesium.Cartesian3.fromDegrees(-72.0, 40.0);
  25653. * var heading = Cesium.Math.toRadians(50.0);
  25654. * var pitch = Cesium.Math.toRadians(-20.0);
  25655. * var range = 5000.0;
  25656. * viewer.camera.lookAt(center, new Cesium.HeadingPitchRange(heading, pitch, range));
  25657. * @param target - The target position in world coordinates.
  25658. * @param offset - The offset from the target in the local east-north-up reference frame centered at the target.
  25659. */
  25660. lookAt(target: Cartesian3, offset: Cartesian3 | HeadingPitchRange): void;
  25661. /**
  25662. * Sets the camera position and orientation using a target and transformation matrix. The offset can be either a cartesian or heading/pitch/range.
  25663. * 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
  25664. * is heading/pitch/range, then the heading and the pitch angles are defined in the reference frame defined by the transformation matrix.
  25665. * The heading is the angle from y axis and increasing towards the x axis. Pitch is the rotation from the xy-plane. Positive pitch
  25666. * angles are below the plane. Negative pitch angles are above the plane. The range is the distance from the center.
  25667. *
  25668. * 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
  25669. * target will be the magnitude of the offset. The heading will be determined from the offset. If the heading cannot be
  25670. * determined from the offset, the heading will be north.
  25671. * @example
  25672. * // 1. Using a cartesian offset
  25673. * var transform = Cesium.Transforms.eastNorthUpToFixedFrame(Cesium.Cartesian3.fromDegrees(-98.0, 40.0));
  25674. * viewer.camera.lookAtTransform(transform, new Cesium.Cartesian3(0.0, -4790000.0, 3930000.0));
  25675. *
  25676. * // 2. Using a HeadingPitchRange offset
  25677. * var transform = Cesium.Transforms.eastNorthUpToFixedFrame(Cesium.Cartesian3.fromDegrees(-72.0, 40.0));
  25678. * var heading = Cesium.Math.toRadians(50.0);
  25679. * var pitch = Cesium.Math.toRadians(-20.0);
  25680. * var range = 5000.0;
  25681. * viewer.camera.lookAtTransform(transform, new Cesium.HeadingPitchRange(heading, pitch, range));
  25682. * @param transform - The transformation matrix defining the reference frame.
  25683. * @param [offset] - The offset from the target in a reference frame centered at the target.
  25684. */
  25685. lookAtTransform(transform: Matrix4, offset?: Cartesian3 | HeadingPitchRange): void;
  25686. /**
  25687. * Get the camera position needed to view a rectangle on an ellipsoid or map
  25688. * @param rectangle - The rectangle to view.
  25689. * @param [result] - The camera position needed to view the rectangle
  25690. * @returns The camera position needed to view the rectangle
  25691. */
  25692. getRectangleCameraCoordinates(rectangle: Rectangle, result?: Cartesian3): Cartesian3;
  25693. /**
  25694. * Pick an ellipsoid or map.
  25695. * @example
  25696. * var canvas = viewer.scene.canvas;
  25697. * var center = new Cesium.Cartesian2(canvas.clientWidth / 2.0, canvas.clientHeight / 2.0);
  25698. * var ellipsoid = viewer.scene.globe.ellipsoid;
  25699. * var result = viewer.camera.pickEllipsoid(center, ellipsoid);
  25700. * @param windowPosition - The x and y coordinates of a pixel.
  25701. * @param [ellipsoid = Ellipsoid.WGS84] - The ellipsoid to pick.
  25702. * @param [result] - The object onto which to store the result.
  25703. * @returns If the ellipsoid or map was picked,
  25704. * returns the point on the surface of the ellipsoid or map in world
  25705. * coordinates. If the ellipsoid or map was not picked, returns undefined.
  25706. */
  25707. pickEllipsoid(windowPosition: Cartesian2, ellipsoid?: Ellipsoid, result?: Cartesian3): Cartesian3 | undefined;
  25708. /**
  25709. * Create a ray from the camera position through the pixel at <code>windowPosition</code>
  25710. * in world coordinates.
  25711. * @param windowPosition - The x and y coordinates of a pixel.
  25712. * @param [result] - The object onto which to store the result.
  25713. * @returns Returns the {@link Cartesian3} position and direction of the ray.
  25714. */
  25715. getPickRay(windowPosition: Cartesian2, result?: Ray): Ray;
  25716. /**
  25717. * Return the distance from the camera to the front of the bounding sphere.
  25718. * @param boundingSphere - The bounding sphere in world coordinates.
  25719. * @returns The distance to the bounding sphere.
  25720. */
  25721. distanceToBoundingSphere(boundingSphere: BoundingSphere): number;
  25722. /**
  25723. * Return the pixel size in meters.
  25724. * @param boundingSphere - The bounding sphere in world coordinates.
  25725. * @param drawingBufferWidth - The drawing buffer width.
  25726. * @param drawingBufferHeight - The drawing buffer height.
  25727. * @returns The pixel size in meters.
  25728. */
  25729. getPixelSize(boundingSphere: BoundingSphere, drawingBufferWidth: number, drawingBufferHeight: number): number;
  25730. /**
  25731. * Cancels the current camera flight and leaves the camera at its current location.
  25732. * If no flight is in progress, this this function does nothing.
  25733. */
  25734. cancelFlight(): void;
  25735. /**
  25736. * Completes the current camera flight and moves the camera immediately to its final destination.
  25737. * If no flight is in progress, this this function does nothing.
  25738. */
  25739. completeFlight(): void;
  25740. /**
  25741. * Flies the camera from its current position to a new position.
  25742. * @example
  25743. * // 1. Fly to a position with a top-down view
  25744. * viewer.camera.flyTo({
  25745. * destination : Cesium.Cartesian3.fromDegrees(-117.16, 32.71, 15000.0)
  25746. * });
  25747. *
  25748. * // 2. Fly to a Rectangle with a top-down view
  25749. * viewer.camera.flyTo({
  25750. * destination : Cesium.Rectangle.fromDegrees(west, south, east, north)
  25751. * });
  25752. *
  25753. * // 3. Fly to a position with an orientation using unit vectors.
  25754. * viewer.camera.flyTo({
  25755. * destination : Cesium.Cartesian3.fromDegrees(-122.19, 46.25, 5000.0),
  25756. * orientation : {
  25757. * direction : new Cesium.Cartesian3(-0.04231243104240401, -0.20123236049443421, -0.97862924300734),
  25758. * up : new Cesium.Cartesian3(-0.47934589305293746, -0.8553216253114552, 0.1966022179118339)
  25759. * }
  25760. * });
  25761. *
  25762. * // 4. Fly to a position with an orientation using heading, pitch and roll.
  25763. * viewer.camera.flyTo({
  25764. * destination : Cesium.Cartesian3.fromDegrees(-122.19, 46.25, 5000.0),
  25765. * orientation : {
  25766. * heading : Cesium.Math.toRadians(175.0),
  25767. * pitch : Cesium.Math.toRadians(-35.0),
  25768. * roll : 0.0
  25769. * }
  25770. * });
  25771. * @param options - Object with the following properties:
  25772. * @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.
  25773. * @param [options.orientation] - An object that contains either direction and up properties or heading, pitch and roll properties. By default, the direction will point
  25774. * 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
  25775. * y direction in Columbus view. Orientation is not used in 2D when in infinite scrolling mode.
  25776. * @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.
  25777. * @param [options.complete] - The function to execute when the flight is complete.
  25778. * @param [options.cancel] - The function to execute if the flight is cancelled.
  25779. * @param [options.endTransform] - Transform matrix representing the reference frame the camera will be in when the flight is completed.
  25780. * @param [options.maximumHeight] - The maximum height at the peak of the flight.
  25781. * @param [options.pitchAdjustHeight] - If camera flyes higher than that value, adjust pitch duiring the flight to look down, and keep Earth in viewport.
  25782. * @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.
  25783. * @param [options.flyOverLongitudeWeight] - Fly over the lon specifyed via flyOverLongitude only if that way is not longer than short way times flyOverLongitudeWeight.
  25784. * @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>.
  25785. * @param [options.easingFunction] - Controls how the time is interpolated over the duration of the flight.
  25786. */
  25787. flyTo(options: {
  25788. destination: Cartesian3 | Rectangle;
  25789. orientation?: any;
  25790. duration?: number;
  25791. complete?: Camera.FlightCompleteCallback;
  25792. cancel?: Camera.FlightCancelledCallback;
  25793. endTransform?: Matrix4;
  25794. maximumHeight?: number;
  25795. pitchAdjustHeight?: number;
  25796. flyOverLongitude?: number;
  25797. flyOverLongitudeWeight?: number;
  25798. convert?: boolean;
  25799. easingFunction?: EasingFunction.Callback;
  25800. }): void;
  25801. /**
  25802. * Sets the camera so that the current view contains the provided bounding sphere.
  25803. *
  25804. * <p>The offset is heading/pitch/range in the local east-north-up reference frame centered at the center of the bounding sphere.
  25805. * The heading and the pitch angles are defined in the local east-north-up reference frame.
  25806. * The heading is the angle from y axis and increasing towards the x axis. Pitch is the rotation from the xy-plane. Positive pitch
  25807. * angles are below the plane. Negative pitch angles are above the plane. The range is the distance from the center. If the range is
  25808. * zero, a range will be computed such that the whole bounding sphere is visible.</p>
  25809. *
  25810. * <p>In 2D, there must be a top down view. The camera will be placed above the target looking down. The height above the
  25811. * target will be the range. The heading will be determined from the offset. If the heading cannot be
  25812. * determined from the offset, the heading will be north.</p>
  25813. * @param boundingSphere - The bounding sphere to view, in world coordinates.
  25814. * @param [offset] - The offset from the target in the local east-north-up reference frame centered at the target.
  25815. */
  25816. viewBoundingSphere(boundingSphere: BoundingSphere, offset?: HeadingPitchRange): void;
  25817. /**
  25818. * Flies the camera to a location where the current view contains the provided bounding sphere.
  25819. *
  25820. * <p> The offset is heading/pitch/range in the local east-north-up reference frame centered at the center of the bounding sphere.
  25821. * The heading and the pitch angles are defined in the local east-north-up reference frame.
  25822. * The heading is the angle from y axis and increasing towards the x axis. Pitch is the rotation from the xy-plane. Positive pitch
  25823. * angles are below the plane. Negative pitch angles are above the plane. The range is the distance from the center. If the range is
  25824. * zero, a range will be computed such that the whole bounding sphere is visible.</p>
  25825. *
  25826. * <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
  25827. * target will be the range. The heading will be aligned to local north.</p>
  25828. * @param boundingSphere - The bounding sphere to view, in world coordinates.
  25829. * @param [options] - Object with the following properties:
  25830. * @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.
  25831. * @param [options.offset] - The offset from the target in the local east-north-up reference frame centered at the target.
  25832. * @param [options.complete] - The function to execute when the flight is complete.
  25833. * @param [options.cancel] - The function to execute if the flight is cancelled.
  25834. * @param [options.endTransform] - Transform matrix representing the reference frame the camera will be in when the flight is completed.
  25835. * @param [options.maximumHeight] - The maximum height at the peak of the flight.
  25836. * @param [options.pitchAdjustHeight] - If camera flyes higher than that value, adjust pitch duiring the flight to look down, and keep Earth in viewport.
  25837. * @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.
  25838. * @param [options.flyOverLongitudeWeight] - Fly over the lon specifyed via flyOverLongitude only if that way is not longer than short way times flyOverLongitudeWeight.
  25839. * @param [options.easingFunction] - Controls how the time is interpolated over the duration of the flight.
  25840. */
  25841. flyToBoundingSphere(boundingSphere: BoundingSphere, options?: {
  25842. duration?: number;
  25843. offset?: HeadingPitchRange;
  25844. complete?: Camera.FlightCompleteCallback;
  25845. cancel?: Camera.FlightCancelledCallback;
  25846. endTransform?: Matrix4;
  25847. maximumHeight?: number;
  25848. pitchAdjustHeight?: number;
  25849. flyOverLongitude?: number;
  25850. flyOverLongitudeWeight?: number;
  25851. easingFunction?: EasingFunction.Callback;
  25852. }): void;
  25853. /**
  25854. * Computes the approximate visible rectangle on the ellipsoid.
  25855. * @param [ellipsoid = Ellipsoid.WGS84] - The ellipsoid that you want to know the visible region.
  25856. * @param [result] - The rectangle in which to store the result
  25857. * @returns The visible rectangle or undefined if the ellipsoid isn't visible at all.
  25858. */
  25859. computeViewRectangle(ellipsoid?: Ellipsoid, result?: Rectangle): Rectangle | undefined;
  25860. /**
  25861. * Switches the frustum/projection to perspective.
  25862. *
  25863. * This function is a no-op in 2D which must always be orthographic.
  25864. */
  25865. switchToPerspectiveFrustum(): void;
  25866. /**
  25867. * Switches the frustum/projection to orthographic.
  25868. *
  25869. * This function is a no-op in 2D which will always be orthographic.
  25870. */
  25871. switchToOrthographicFrustum(): void;
  25872. }
  25873. export namespace Camera {
  25874. /**
  25875. * A function that will execute when a flight completes.
  25876. */
  25877. type FlightCompleteCallback = () => void;
  25878. /**
  25879. * A function that will execute when a flight is cancelled.
  25880. */
  25881. type FlightCancelledCallback = () => void;
  25882. }
  25883. /**
  25884. * Aggregates input events. For example, suppose the following inputs are received between frames:
  25885. * left mouse button down, mouse move, mouse move, left mouse button up. These events will be aggregated into
  25886. * one event with a start and end position of the mouse.
  25887. * @param [canvas = document] - The element to handle events for.
  25888. */
  25889. export class CameraEventAggregator {
  25890. constructor(canvas?: HTMLCanvasElement);
  25891. /**
  25892. * Gets the current mouse position.
  25893. */
  25894. currentMousePosition: Cartesian2;
  25895. /**
  25896. * Gets whether any mouse button is down, a touch has started, or the wheel has been moved.
  25897. */
  25898. anyButtonDown: boolean;
  25899. /**
  25900. * Gets if a mouse button down or touch has started and has been moved.
  25901. * @param type - The camera event type.
  25902. * @param [modifier] - The keyboard modifier.
  25903. * @returns Returns <code>true</code> if a mouse button down or touch has started and has been moved; otherwise, <code>false</code>
  25904. */
  25905. isMoving(type: CameraEventType, modifier?: KeyboardEventModifier): boolean;
  25906. /**
  25907. * Gets the aggregated start and end position of the current event.
  25908. * @param type - The camera event type.
  25909. * @param [modifier] - The keyboard modifier.
  25910. * @returns An object with two {@link Cartesian2} properties: <code>startPosition</code> and <code>endPosition</code>.
  25911. */
  25912. getMovement(type: CameraEventType, modifier?: KeyboardEventModifier): any;
  25913. /**
  25914. * Gets the start and end position of the last move event (not the aggregated event).
  25915. * @param type - The camera event type.
  25916. * @param [modifier] - The keyboard modifier.
  25917. * @returns An object with two {@link Cartesian2} properties: <code>startPosition</code> and <code>endPosition</code> or <code>undefined</code>.
  25918. */
  25919. getLastMovement(type: CameraEventType, modifier?: KeyboardEventModifier): any | undefined;
  25920. /**
  25921. * Gets whether the mouse button is down or a touch has started.
  25922. * @param type - The camera event type.
  25923. * @param [modifier] - The keyboard modifier.
  25924. * @returns Whether the mouse button is down or a touch has started.
  25925. */
  25926. isButtonDown(type: CameraEventType, modifier?: KeyboardEventModifier): boolean;
  25927. /**
  25928. * Gets the mouse position that started the aggregation.
  25929. * @param type - The camera event type.
  25930. * @param [modifier] - The keyboard modifier.
  25931. * @returns The mouse position.
  25932. */
  25933. getStartMousePosition(type: CameraEventType, modifier?: KeyboardEventModifier): Cartesian2;
  25934. /**
  25935. * Gets the time the button was pressed or the touch was started.
  25936. * @param type - The camera event type.
  25937. * @param [modifier] - The keyboard modifier.
  25938. * @returns The time the button was pressed or the touch was started.
  25939. */
  25940. getButtonPressTime(type: CameraEventType, modifier?: KeyboardEventModifier): Date;
  25941. /**
  25942. * Gets the time the button was released or the touch was ended.
  25943. * @param type - The camera event type.
  25944. * @param [modifier] - The keyboard modifier.
  25945. * @returns The time the button was released or the touch was ended.
  25946. */
  25947. getButtonReleaseTime(type: CameraEventType, modifier?: KeyboardEventModifier): Date;
  25948. /**
  25949. * Signals that all of the events have been handled and the aggregator should be reset to handle new events.
  25950. */
  25951. reset(): void;
  25952. /**
  25953. * Returns true if this object was destroyed; otherwise, false.
  25954. * <br /><br />
  25955. * If this object was destroyed, it should not be used; calling any function other than
  25956. * <code>isDestroyed</code> will result in a {@link DeveloperError} exception.
  25957. * @returns <code>true</code> if this object was destroyed; otherwise, <code>false</code>.
  25958. */
  25959. isDestroyed(): boolean;
  25960. /**
  25961. * Removes mouse listeners held by this object.
  25962. * <br /><br />
  25963. * Once an object is destroyed, it should not be used; calling any function other than
  25964. * <code>isDestroyed</code> will result in a {@link DeveloperError} exception. Therefore,
  25965. * assign the return value (<code>undefined</code>) to the object as done in the example.
  25966. * @example
  25967. * handler = handler && handler.destroy();
  25968. */
  25969. destroy(): void;
  25970. }
  25971. /**
  25972. * Enumerates the available input for interacting with the camera.
  25973. */
  25974. export enum CameraEventType {
  25975. /**
  25976. * A left mouse button press followed by moving the mouse and releasing the button.
  25977. */
  25978. LEFT_DRAG = 0,
  25979. /**
  25980. * A right mouse button press followed by moving the mouse and releasing the button.
  25981. */
  25982. RIGHT_DRAG = 1,
  25983. /**
  25984. * A middle mouse button press followed by moving the mouse and releasing the button.
  25985. */
  25986. MIDDLE_DRAG = 2,
  25987. /**
  25988. * Scrolling the middle mouse button.
  25989. */
  25990. WHEEL = 3,
  25991. /**
  25992. * A two-finger touch on a touch surface.
  25993. */
  25994. PINCH = 4
  25995. }
  25996. /**
  25997. * A tile in a {@link Cesium3DTileset}. When a tile is first created, its content is not loaded;
  25998. * the content is loaded on-demand when needed based on the view.
  25999. * <p>
  26000. * Do not construct this directly, instead access tiles through {@link Cesium3DTileset#tileVisible}.
  26001. * </p>
  26002. */
  26003. export class Cesium3DTile {
  26004. constructor();
  26005. /**
  26006. * The local transform of this tile.
  26007. */
  26008. transform: Matrix4;
  26009. /**
  26010. * The final computed transform of this tile.
  26011. */
  26012. readonly computedTransform: Matrix4;
  26013. /**
  26014. * The error, in meters, introduced if this tile is rendered and its children are not.
  26015. * This is used to compute screen space error, i.e., the error measured in pixels.
  26016. */
  26017. readonly geometricError: number;
  26018. /**
  26019. * Gets the tile's children.
  26020. */
  26021. readonly children: Cesium3DTile[];
  26022. /**
  26023. * This tile's parent or <code>undefined</code> if this tile is the root.
  26024. * <p>
  26025. * When a tile's content points to an external tileset JSON file, the external tileset's
  26026. * root tile's parent is not <code>undefined</code>; instead, the parent references
  26027. * the tile (with its content pointing to an external tileset JSON file) as if the two tilesets were merged.
  26028. * </p>
  26029. */
  26030. readonly parent: Cesium3DTile;
  26031. /**
  26032. * The time in seconds after the tile's content is ready when the content expires and new content is requested.
  26033. */
  26034. expireDuration: number;
  26035. /**
  26036. * The date when the content expires and new content is requested.
  26037. */
  26038. expireDate: JulianDate;
  26039. /**
  26040. * The tileset containing this tile.
  26041. */
  26042. readonly tileset: Cesium3DTileset;
  26043. /**
  26044. * The tile's content. This represents the actual tile's payload,
  26045. * not the content's metadata in the tileset JSON file.
  26046. */
  26047. readonly content: Cesium3DTileContent;
  26048. /**
  26049. * Get the bounding sphere derived from the tile's bounding volume.
  26050. */
  26051. readonly boundingSphere: BoundingSphere;
  26052. /**
  26053. * Returns the <code>extras</code> property in the tileset JSON for this tile, which contains application specific metadata.
  26054. * Returns <code>undefined</code> if <code>extras</code> does not exist.
  26055. */
  26056. readonly extras: any;
  26057. }
  26058. /**
  26059. * Defines how per-feature colors set from the Cesium API or declarative styling blend with the source colors from
  26060. * the original feature, e.g. glTF material or per-point color in the tile.
  26061. * <p>
  26062. * When <code>REPLACE</code> or <code>MIX</code> are used and the source color is a glTF material, the technique must assign the
  26063. * <code>_3DTILESDIFFUSE</code> semantic to the diffuse color parameter. Otherwise only <code>HIGHLIGHT</code> is supported.
  26064. * </p>
  26065. * <p>
  26066. * A feature whose color evaluates to white (1.0, 1.0, 1.0) is always rendered without color blending, regardless of the
  26067. * tileset's color blend mode.
  26068. * </p>
  26069. * <pre><code>
  26070. * "techniques": {
  26071. * "technique0": {
  26072. * "parameters": {
  26073. * "diffuse": {
  26074. * "semantic": "_3DTILESDIFFUSE",
  26075. * "type": 35666
  26076. * }
  26077. * }
  26078. * }
  26079. * }
  26080. * </code></pre>
  26081. */
  26082. export enum Cesium3DTileColorBlendMode {
  26083. /**
  26084. * Multiplies the source color by the feature color.
  26085. */
  26086. HIGHLIGHT = 0,
  26087. /**
  26088. * Replaces the source color with the feature color.
  26089. */
  26090. REPLACE = 1,
  26091. /**
  26092. * Blends the source color and feature color together.
  26093. */
  26094. MIX = 2
  26095. }
  26096. /**
  26097. * The content of a tile in a {@link Cesium3DTileset}.
  26098. * <p>
  26099. * Derived classes of this interface provide access to individual features in the tile.
  26100. * Access derived objects through {@link Cesium3DTile#content}.
  26101. * </p>
  26102. * <p>
  26103. * This type describes an interface and is not intended to be instantiated directly.
  26104. * </p>
  26105. */
  26106. export class Cesium3DTileContent {
  26107. constructor();
  26108. /**
  26109. * Gets the number of features in the tile.
  26110. */
  26111. readonly featuresLength: number;
  26112. /**
  26113. * Gets the number of points in the tile.
  26114. * <p>
  26115. * Only applicable for tiles with Point Cloud content. This is different than {@link Cesium3DTileContent#featuresLength} which
  26116. * equals the number of groups of points as distinguished by the <code>BATCH_ID</code> feature table semantic.
  26117. * </p>
  26118. */
  26119. readonly pointsLength: number;
  26120. /**
  26121. * Gets the number of triangles in the tile.
  26122. */
  26123. readonly trianglesLength: number;
  26124. /**
  26125. * Gets the tile's geometry memory in bytes.
  26126. */
  26127. readonly geometryByteLength: number;
  26128. /**
  26129. * Gets the tile's texture memory in bytes.
  26130. */
  26131. readonly texturesByteLength: number;
  26132. /**
  26133. * Gets the amount of memory used by the batch table textures, in bytes.
  26134. */
  26135. readonly batchTableByteLength: number;
  26136. /**
  26137. * Gets the array of {@link Cesium3DTileContent} objects that represent the
  26138. * content a composite's inner tiles, which can also be composites.
  26139. */
  26140. readonly innerContents: any[];
  26141. /**
  26142. * Gets the promise that will be resolved when the tile's content is ready to render.
  26143. */
  26144. readonly readyPromise: Promise<Cesium3DTileContent>;
  26145. /**
  26146. * Gets the tileset for this tile.
  26147. */
  26148. readonly tileset: Cesium3DTileset;
  26149. /**
  26150. * Gets the tile containing this content.
  26151. */
  26152. readonly tile: Cesium3DTile;
  26153. /**
  26154. * Gets the url of the tile's content.
  26155. */
  26156. readonly url: string;
  26157. /**
  26158. * Determines if the tile's batch table has a property. If it does, each feature in
  26159. * the tile will have the property.
  26160. * @param batchId - The batchId for the feature.
  26161. * @param name - The case-sensitive name of the property.
  26162. * @returns <code>true</code> if the property exists; otherwise, <code>false</code>.
  26163. */
  26164. hasProperty(batchId: number, name: string): boolean;
  26165. /**
  26166. * Returns the {@link Cesium3DTileFeature} object for the feature with the
  26167. * given <code>batchId</code>. This object is used to get and modify the
  26168. * feature's properties.
  26169. * <p>
  26170. * Features in a tile are ordered by <code>batchId</code>, an index used to retrieve their metadata from the batch table.
  26171. * </p>
  26172. * @param batchId - The batchId for the feature.
  26173. * @returns The corresponding {@link Cesium3DTileFeature} object.
  26174. */
  26175. getFeature(batchId: number): Cesium3DTileFeature;
  26176. }
  26177. /**
  26178. * A feature of a {@link Cesium3DTileset}.
  26179. * <p>
  26180. * Provides access to a feature's properties stored in the tile's batch table, as well
  26181. * as the ability to show/hide a feature and change its highlight color via
  26182. * {@link Cesium3DTileFeature#show} and {@link Cesium3DTileFeature#color}, respectively.
  26183. * </p>
  26184. * <p>
  26185. * Modifications to a <code>Cesium3DTileFeature</code> object have the lifetime of the tile's
  26186. * content. If the tile's content is unloaded, e.g., due to it going out of view and needing
  26187. * to free space in the cache for visible tiles, listen to the {@link Cesium3DTileset#tileUnload} event to save any
  26188. * modifications. Also listen to the {@link Cesium3DTileset#tileVisible} event to reapply any modifications.
  26189. * </p>
  26190. * <p>
  26191. * Do not construct this directly. Access it through {@link Cesium3DTileContent#getFeature}
  26192. * or picking using {@link Scene#pick} and {@link Scene#pickPosition}.
  26193. * </p>
  26194. * @example
  26195. * // On mouse over, display all the properties for a feature in the console log.
  26196. * handler.setInputAction(function(movement) {
  26197. * var feature = scene.pick(movement.endPosition);
  26198. * if (feature instanceof Cesium.Cesium3DTileFeature) {
  26199. * var propertyNames = feature.getPropertyNames();
  26200. * var length = propertyNames.length;
  26201. * for (var i = 0; i < length; ++i) {
  26202. * var propertyName = propertyNames[i];
  26203. * console.log(propertyName + ': ' + feature.getProperty(propertyName));
  26204. * }
  26205. * }
  26206. * }, Cesium.ScreenSpaceEventType.MOUSE_MOVE);
  26207. */
  26208. export class Cesium3DTileFeature {
  26209. constructor();
  26210. /**
  26211. * Gets or sets if the feature will be shown. This is set for all features
  26212. * when a style's show is evaluated.
  26213. */
  26214. show: boolean;
  26215. /**
  26216. * Gets or sets the highlight color multiplied with the feature's color. When
  26217. * this is white, the feature's color is not changed. This is set for all features
  26218. * when a style's color is evaluated.
  26219. */
  26220. color: Color;
  26221. /**
  26222. * Gets the tileset containing the feature.
  26223. */
  26224. readonly tileset: Cesium3DTileset;
  26225. /**
  26226. * All objects returned by {@link Scene#pick} have a <code>primitive</code> property. This returns
  26227. * the tileset containing the feature.
  26228. */
  26229. readonly primitive: Cesium3DTileset;
  26230. /**
  26231. * Returns whether the feature contains this property. This includes properties from this feature's
  26232. * class and inherited classes when using a batch table hierarchy.
  26233. * @param name - The case-sensitive name of the property.
  26234. * @returns Whether the feature contains this property.
  26235. */
  26236. hasProperty(name: string): boolean;
  26237. /**
  26238. * Returns an array of property names for the feature. This includes properties from this feature's
  26239. * class and inherited classes when using a batch table hierarchy.
  26240. * @param [results] - An array into which to store the results.
  26241. * @returns The names of the feature's properties.
  26242. */
  26243. getPropertyNames(results?: string[]): string[];
  26244. /**
  26245. * Returns a copy of the value of the feature's property with the given name. This includes properties from this feature's
  26246. * class and inherited classes when using a batch table hierarchy.
  26247. * @example
  26248. * // Display all the properties for a feature in the console log.
  26249. * var propertyNames = feature.getPropertyNames();
  26250. * var length = propertyNames.length;
  26251. * for (var i = 0; i < length; ++i) {
  26252. * var propertyName = propertyNames[i];
  26253. * console.log(propertyName + ': ' + feature.getProperty(propertyName));
  26254. * }
  26255. * @param name - The case-sensitive name of the property.
  26256. * @returns The value of the property or <code>undefined</code> if the property does not exist.
  26257. */
  26258. getProperty(name: string): any;
  26259. /**
  26260. * Sets the value of the feature's property with the given name.
  26261. * <p>
  26262. * If a property with the given name doesn't exist, it is created.
  26263. * </p>
  26264. * @example
  26265. * var height = feature.getProperty('Height'); // e.g., the height of a building
  26266. * @example
  26267. * var name = 'clicked';
  26268. * if (feature.getProperty(name)) {
  26269. * console.log('already clicked');
  26270. * } else {
  26271. * feature.setProperty(name, true);
  26272. * console.log('first click');
  26273. * }
  26274. * @param name - The case-sensitive name of the property.
  26275. * @param value - The value of the property that will be copied.
  26276. */
  26277. setProperty(name: string, value: any): void;
  26278. }
  26279. /**
  26280. * A point feature of a {@link Cesium3DTileset}.
  26281. * <p>
  26282. * Provides access to a feature's properties stored in the tile's batch table, as well
  26283. * as the ability to show/hide a feature and change its point properties
  26284. * </p>
  26285. * <p>
  26286. * Modifications to a <code>Cesium3DTilePointFeature</code> object have the lifetime of the tile's
  26287. * content. If the tile's content is unloaded, e.g., due to it going out of view and needing
  26288. * to free space in the cache for visible tiles, listen to the {@link Cesium3DTileset#tileUnload} event to save any
  26289. * modifications. Also listen to the {@link Cesium3DTileset#tileVisible} event to reapply any modifications.
  26290. * </p>
  26291. * <p>
  26292. * Do not construct this directly. Access it through {@link Cesium3DTileContent#getFeature}
  26293. * or picking using {@link Scene#pick} and {@link Scene#pickPosition}.
  26294. * </p>
  26295. * @example
  26296. * // On mouse over, display all the properties for a feature in the console log.
  26297. * handler.setInputAction(function(movement) {
  26298. * var feature = scene.pick(movement.endPosition);
  26299. * if (feature instanceof Cesium.Cesium3DTilePointFeature) {
  26300. * var propertyNames = feature.getPropertyNames();
  26301. * var length = propertyNames.length;
  26302. * for (var i = 0; i < length; ++i) {
  26303. * var propertyName = propertyNames[i];
  26304. * console.log(propertyName + ': ' + feature.getProperty(propertyName));
  26305. * }
  26306. * }
  26307. * }, Cesium.ScreenSpaceEventType.MOUSE_MOVE);
  26308. */
  26309. export class Cesium3DTilePointFeature {
  26310. constructor();
  26311. /**
  26312. * Gets or sets if the feature will be shown. This is set for all features
  26313. * when a style's show is evaluated.
  26314. */
  26315. show: boolean;
  26316. /**
  26317. * Gets or sets the color of the point of this feature.
  26318. * <p>
  26319. * Only applied when <code>image</code> is <code>undefined</code>.
  26320. * </p>
  26321. */
  26322. color: Color;
  26323. /**
  26324. * Gets or sets the point size of this feature.
  26325. * <p>
  26326. * Only applied when <code>image</code> is <code>undefined</code>.
  26327. * </p>
  26328. */
  26329. pointSize: number;
  26330. /**
  26331. * Gets or sets the point outline color of this feature.
  26332. * <p>
  26333. * Only applied when <code>image</code> is <code>undefined</code>.
  26334. * </p>
  26335. */
  26336. pointOutlineColor: Color;
  26337. /**
  26338. * Gets or sets the point outline width in pixels of this feature.
  26339. * <p>
  26340. * Only applied when <code>image</code> is <code>undefined</code>.
  26341. * </p>
  26342. */
  26343. pointOutlineWidth: number;
  26344. /**
  26345. * Gets or sets the label color of this feature.
  26346. * <p>
  26347. * The color will be applied to the label if <code>labelText</code> is defined.
  26348. * </p>
  26349. */
  26350. labelColor: Color;
  26351. /**
  26352. * Gets or sets the label outline color of this feature.
  26353. * <p>
  26354. * The outline color will be applied to the label if <code>labelText</code> is defined.
  26355. * </p>
  26356. */
  26357. labelOutlineColor: Color;
  26358. /**
  26359. * Gets or sets the outline width in pixels of this feature.
  26360. * <p>
  26361. * The outline width will be applied to the point if <code>labelText</code> is defined.
  26362. * </p>
  26363. */
  26364. labelOutlineWidth: number;
  26365. /**
  26366. * Gets or sets the font of this feature.
  26367. * <p>
  26368. * Only applied when the <code>labelText</code> is defined.
  26369. * </p>
  26370. */
  26371. font: string;
  26372. /**
  26373. * Gets or sets the fill and outline style of this feature.
  26374. * <p>
  26375. * Only applied when <code>labelText</code> is defined.
  26376. * </p>
  26377. */
  26378. labelStyle: LabelStyle;
  26379. /**
  26380. * Gets or sets the text for this feature.
  26381. */
  26382. labelText: string;
  26383. /**
  26384. * Gets or sets the background color of the text for this feature.
  26385. * <p>
  26386. * Only applied when <code>labelText</code> is defined.
  26387. * </p>
  26388. */
  26389. backgroundColor: Color;
  26390. /**
  26391. * Gets or sets the background padding of the text for this feature.
  26392. * <p>
  26393. * Only applied when <code>labelText</code> is defined.
  26394. * </p>
  26395. */
  26396. backgroundPadding: Cartesian2;
  26397. /**
  26398. * Gets or sets whether to display the background of the text for this feature.
  26399. * <p>
  26400. * Only applied when <code>labelText</code> is defined.
  26401. * </p>
  26402. */
  26403. backgroundEnabled: boolean;
  26404. /**
  26405. * Gets or sets the near and far scaling properties for this feature.
  26406. */
  26407. scaleByDistance: NearFarScalar;
  26408. /**
  26409. * Gets or sets the near and far translucency properties for this feature.
  26410. */
  26411. translucencyByDistance: NearFarScalar;
  26412. /**
  26413. * Gets or sets the condition specifying at what distance from the camera that this feature will be displayed.
  26414. */
  26415. distanceDisplayCondition: DistanceDisplayCondition;
  26416. /**
  26417. * Gets or sets the height offset in meters of this feature.
  26418. */
  26419. heightOffset: number;
  26420. /**
  26421. * Gets or sets whether the anchor line is displayed.
  26422. * <p>
  26423. * Only applied when <code>heightOffset</code> is defined.
  26424. * </p>
  26425. */
  26426. anchorLineEnabled: boolean;
  26427. /**
  26428. * Gets or sets the color for the anchor line.
  26429. * <p>
  26430. * Only applied when <code>heightOffset</code> is defined.
  26431. * </p>
  26432. */
  26433. anchorLineColor: Color;
  26434. /**
  26435. * Gets or sets the image of this feature.
  26436. */
  26437. image: string;
  26438. /**
  26439. * Gets or sets the distance where depth testing will be disabled.
  26440. */
  26441. disableDepthTestDistance: number;
  26442. /**
  26443. * Gets or sets the horizontal origin of this point, which determines if the point is
  26444. * to the left, center, or right of its anchor position.
  26445. */
  26446. horizontalOrigin: HorizontalOrigin;
  26447. /**
  26448. * Gets or sets the vertical origin of this point, which determines if the point is
  26449. * to the bottom, center, or top of its anchor position.
  26450. */
  26451. verticalOrigin: VerticalOrigin;
  26452. /**
  26453. * Gets or sets the horizontal origin of this point's text, which determines if the point's text is
  26454. * to the left, center, or right of its anchor position.
  26455. */
  26456. labelHorizontalOrigin: HorizontalOrigin;
  26457. /**
  26458. * Get or sets the vertical origin of this point's text, which determines if the point's text is
  26459. * to the bottom, center, top, or baseline of it's anchor point.
  26460. */
  26461. labelVerticalOrigin: VerticalOrigin;
  26462. /**
  26463. * Gets the tileset containing the feature.
  26464. */
  26465. readonly tileset: Cesium3DTileset;
  26466. /**
  26467. * All objects returned by {@link Scene#pick} have a <code>primitive</code> property. This returns
  26468. * the tileset containing the feature.
  26469. */
  26470. readonly primitive: Cesium3DTileset;
  26471. /**
  26472. * Returns whether the feature contains this property. This includes properties from this feature's
  26473. * class and inherited classes when using a batch table hierarchy.
  26474. * @param name - The case-sensitive name of the property.
  26475. * @returns Whether the feature contains this property.
  26476. */
  26477. hasProperty(name: string): boolean;
  26478. /**
  26479. * Returns an array of property names for the feature. This includes properties from this feature's
  26480. * class and inherited classes when using a batch table hierarchy.
  26481. * @param [results] - An array into which to store the results.
  26482. * @returns The names of the feature's properties.
  26483. */
  26484. getPropertyNames(results?: string[]): string[];
  26485. /**
  26486. * Returns a copy of the value of the feature's property with the given name. This includes properties from this feature's
  26487. * class and inherited classes when using a batch table hierarchy.
  26488. * @example
  26489. * // Display all the properties for a feature in the console log.
  26490. * var propertyNames = feature.getPropertyNames();
  26491. * var length = propertyNames.length;
  26492. * for (var i = 0; i < length; ++i) {
  26493. * var propertyName = propertyNames[i];
  26494. * console.log(propertyName + ': ' + feature.getProperty(propertyName));
  26495. * }
  26496. * @param name - The case-sensitive name of the property.
  26497. * @returns The value of the property or <code>undefined</code> if the property does not exist.
  26498. */
  26499. getProperty(name: string): any;
  26500. /**
  26501. * Sets the value of the feature's property with the given name.
  26502. * <p>
  26503. * If a property with the given name doesn't exist, it is created.
  26504. * </p>
  26505. * @example
  26506. * var height = feature.getProperty('Height'); // e.g., the height of a building
  26507. * @example
  26508. * var name = 'clicked';
  26509. * if (feature.getProperty(name)) {
  26510. * console.log('already clicked');
  26511. * } else {
  26512. * feature.setProperty(name, true);
  26513. * console.log('first click');
  26514. * }
  26515. * @param name - The case-sensitive name of the property.
  26516. * @param value - The value of the property that will be copied.
  26517. */
  26518. setProperty(name: string, value: any): void;
  26519. }
  26520. /**
  26521. * A style that is applied to a {@link Cesium3DTileset}.
  26522. * <p>
  26523. * Evaluates an expression defined using the
  26524. * {@link https://github.com/CesiumGS/3d-tiles/tree/master/specification/Styling|3D Tiles Styling language}.
  26525. * </p>
  26526. * @example
  26527. * tileset.style = new Cesium.Cesium3DTileStyle({
  26528. * color : {
  26529. * conditions : [
  26530. * ['${Height} >= 100', 'color("purple", 0.5)'],
  26531. * ['${Height} >= 50', 'color("red")'],
  26532. * ['true', 'color("blue")']
  26533. * ]
  26534. * },
  26535. * show : '${Height} > 0',
  26536. * meta : {
  26537. * description : '"Building id ${id} has height ${Height}."'
  26538. * }
  26539. * });
  26540. * @example
  26541. * tileset.style = new Cesium.Cesium3DTileStyle({
  26542. * color : 'vec4(${Temperature})',
  26543. * pointSize : '${Temperature} * 2.0'
  26544. * });
  26545. * @param [style] - The url of a style or an object defining a style.
  26546. */
  26547. export class Cesium3DTileStyle {
  26548. constructor(style?: Resource | string | any);
  26549. /**
  26550. * Gets the object defining the style using the
  26551. * {@link https://github.com/CesiumGS/3d-tiles/tree/master/specification/Styling|3D Tiles Styling language}.
  26552. */
  26553. readonly style: any;
  26554. /**
  26555. * When <code>true</code>, the style is ready and its expressions can be evaluated. When
  26556. * a style is constructed with an object, as opposed to a url, this is <code>true</code> immediately.
  26557. */
  26558. readonly ready: boolean;
  26559. /**
  26560. * Gets the promise that will be resolved when the the style is ready and its expressions can be evaluated.
  26561. */
  26562. readonly readyPromise: Promise<Cesium3DTileStyle>;
  26563. /**
  26564. * 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.
  26565. * The getter will return the internal {@link Expression} or {@link ConditionsExpression}, which may differ from the value provided to the setter.
  26566. * <p>
  26567. * The expression must return or convert to a <code>Boolean</code>.
  26568. * </p>
  26569. * <p>
  26570. * This expression is applicable to all tile formats.
  26571. * </p>
  26572. * @example
  26573. * var style = new Cesium3DTileStyle({
  26574. * show : '(regExp("^Chest").test(${County})) && (${YearBuilt} >= 1970)'
  26575. * });
  26576. * style.show.evaluate(feature); // returns true or false depending on the feature's properties
  26577. * @example
  26578. * var style = new Cesium.Cesium3DTileStyle();
  26579. * // Override show expression with a custom function
  26580. * style.show = {
  26581. * evaluate : function(feature) {
  26582. * return true;
  26583. * }
  26584. * };
  26585. * @example
  26586. * var style = new Cesium.Cesium3DTileStyle();
  26587. * // Override show expression with a boolean
  26588. * style.show = true;
  26589. * };
  26590. * @example
  26591. * var style = new Cesium.Cesium3DTileStyle();
  26592. * // Override show expression with a string
  26593. * style.show = '${Height} > 0';
  26594. * };
  26595. * @example
  26596. * var style = new Cesium.Cesium3DTileStyle();
  26597. * // Override show expression with a condition
  26598. * style.show = {
  26599. * conditions: [
  26600. * ['${height} > 2', 'false'],
  26601. * ['true', 'true']
  26602. * ];
  26603. * };
  26604. */
  26605. show: StyleExpression;
  26606. /**
  26607. * 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.
  26608. * The getter will return the internal {@link Expression} or {@link ConditionsExpression}, which may differ from the value provided to the setter.
  26609. * <p>
  26610. * The expression must return a <code>Color</code>.
  26611. * </p>
  26612. * <p>
  26613. * This expression is applicable to all tile formats.
  26614. * </p>
  26615. * @example
  26616. * var style = new Cesium3DTileStyle({
  26617. * color : '(${Temperature} > 90) ? color("red") : color("white")'
  26618. * });
  26619. * style.color.evaluateColor(feature, result); // returns a Cesium.Color object
  26620. * @example
  26621. * var style = new Cesium.Cesium3DTileStyle();
  26622. * // Override color expression with a custom function
  26623. * style.color = {
  26624. * evaluateColor : function(feature, result) {
  26625. * return Cesium.Color.clone(Cesium.Color.WHITE, result);
  26626. * }
  26627. * };
  26628. * @example
  26629. * var style = new Cesium.Cesium3DTileStyle();
  26630. * // Override color expression with a string
  26631. * style.color = 'color("blue")';
  26632. * @example
  26633. * var style = new Cesium.Cesium3DTileStyle();
  26634. * // Override color expression with a condition
  26635. * style.color = {
  26636. * conditions : [
  26637. * ['${height} > 2', 'color("cyan")'],
  26638. * ['true', 'color("blue")']
  26639. * ]
  26640. * };
  26641. */
  26642. color: StyleExpression;
  26643. /**
  26644. * 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.
  26645. * The getter will return the internal {@link Expression} or {@link ConditionsExpression}, which may differ from the value provided to the setter.
  26646. * <p>
  26647. * The expression must return a <code>Number</code>.
  26648. * </p>
  26649. * <p>
  26650. * This expression is only applicable to point features in a Vector tile or a Point Cloud tile.
  26651. * </p>
  26652. * @example
  26653. * var style = new Cesium3DTileStyle({
  26654. * pointSize : '(${Temperature} > 90) ? 2.0 : 1.0'
  26655. * });
  26656. * style.pointSize.evaluate(feature); // returns a Number
  26657. * @example
  26658. * var style = new Cesium.Cesium3DTileStyle();
  26659. * // Override pointSize expression with a custom function
  26660. * style.pointSize = {
  26661. * evaluate : function(feature) {
  26662. * return 1.0;
  26663. * }
  26664. * };
  26665. * @example
  26666. * var style = new Cesium.Cesium3DTileStyle();
  26667. * // Override pointSize expression with a number
  26668. * style.pointSize = 1.0;
  26669. * @example
  26670. * var style = new Cesium.Cesium3DTileStyle();
  26671. * // Override pointSize expression with a string
  26672. * style.pointSize = '${height} / 10';
  26673. * @example
  26674. * var style = new Cesium.Cesium3DTileStyle();
  26675. * // Override pointSize expression with a condition
  26676. * style.pointSize = {
  26677. * conditions : [
  26678. * ['${height} > 2', '1.0'],
  26679. * ['true', '2.0']
  26680. * ]
  26681. * };
  26682. */
  26683. pointSize: StyleExpression;
  26684. /**
  26685. * 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.
  26686. * The getter will return the internal {@link Expression} or {@link ConditionsExpression}, which may differ from the value provided to the setter.
  26687. * <p>
  26688. * The expression must return a <code>Color</code>.
  26689. * </p>
  26690. * <p>
  26691. * This expression is only applicable to point features in a Vector tile.
  26692. * </p>
  26693. * @example
  26694. * var style = new Cesium.Cesium3DTileStyle();
  26695. * // Override pointOutlineColor expression with a string
  26696. * style.pointOutlineColor = 'color("blue")';
  26697. * @example
  26698. * var style = new Cesium.Cesium3DTileStyle();
  26699. * // Override pointOutlineColor expression with a condition
  26700. * style.pointOutlineColor = {
  26701. * conditions : [
  26702. * ['${height} > 2', 'color("cyan")'],
  26703. * ['true', 'color("blue")']
  26704. * ]
  26705. * };
  26706. */
  26707. pointOutlineColor: StyleExpression;
  26708. /**
  26709. * 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.
  26710. * The getter will return the internal {@link Expression} or {@link ConditionsExpression}, which may differ from the value provided to the setter.
  26711. * <p>
  26712. * The expression must return a <code>Number</code>.
  26713. * </p>
  26714. * <p>
  26715. * This expression is only applicable to point features in a Vector tile.
  26716. * </p>
  26717. * @example
  26718. * var style = new Cesium.Cesium3DTileStyle();
  26719. * // Override pointOutlineWidth expression with a string
  26720. * style.pointOutlineWidth = '5';
  26721. * @example
  26722. * var style = new Cesium.Cesium3DTileStyle();
  26723. * // Override pointOutlineWidth expression with a condition
  26724. * style.pointOutlineWidth = {
  26725. * conditions : [
  26726. * ['${height} > 2', '5'],
  26727. * ['true', '0']
  26728. * ]
  26729. * };
  26730. */
  26731. pointOutlineWidth: StyleExpression;
  26732. /**
  26733. * 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.
  26734. * The getter will return the internal {@link Expression} or {@link ConditionsExpression}, which may differ from the value provided to the setter.
  26735. * <p>
  26736. * The expression must return a <code>Color</code>.
  26737. * </p>
  26738. * <p>
  26739. * This expression is only applicable to point features in a Vector tile.
  26740. * </p>
  26741. * @example
  26742. * var style = new Cesium.Cesium3DTileStyle();
  26743. * // Override labelColor expression with a string
  26744. * style.labelColor = 'color("blue")';
  26745. * @example
  26746. * var style = new Cesium.Cesium3DTileStyle();
  26747. * // Override labelColor expression with a condition
  26748. * style.labelColor = {
  26749. * conditions : [
  26750. * ['${height} > 2', 'color("cyan")'],
  26751. * ['true', 'color("blue")']
  26752. * ]
  26753. * };
  26754. */
  26755. labelColor: StyleExpression;
  26756. /**
  26757. * 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.
  26758. * The getter will return the internal {@link Expression} or {@link ConditionsExpression}, which may differ from the value provided to the setter.
  26759. * <p>
  26760. * The expression must return a <code>Color</code>.
  26761. * </p>
  26762. * <p>
  26763. * This expression is only applicable to point features in a Vector tile.
  26764. * </p>
  26765. * @example
  26766. * var style = new Cesium.Cesium3DTileStyle();
  26767. * // Override labelOutlineColor expression with a string
  26768. * style.labelOutlineColor = 'color("blue")';
  26769. * @example
  26770. * var style = new Cesium.Cesium3DTileStyle();
  26771. * // Override labelOutlineColor expression with a condition
  26772. * style.labelOutlineColor = {
  26773. * conditions : [
  26774. * ['${height} > 2', 'color("cyan")'],
  26775. * ['true', 'color("blue")']
  26776. * ]
  26777. * };
  26778. */
  26779. labelOutlineColor: StyleExpression;
  26780. /**
  26781. * 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.
  26782. * The getter will return the internal {@link Expression} or {@link ConditionsExpression}, which may differ from the value provided to the setter.
  26783. * <p>
  26784. * The expression must return a <code>Number</code>.
  26785. * </p>
  26786. * <p>
  26787. * This expression is only applicable to point features in a Vector tile.
  26788. * </p>
  26789. * @example
  26790. * var style = new Cesium.Cesium3DTileStyle();
  26791. * // Override labelOutlineWidth expression with a string
  26792. * style.labelOutlineWidth = '5';
  26793. * @example
  26794. * var style = new Cesium.Cesium3DTileStyle();
  26795. * // Override labelOutlineWidth expression with a condition
  26796. * style.labelOutlineWidth = {
  26797. * conditions : [
  26798. * ['${height} > 2', '5'],
  26799. * ['true', '0']
  26800. * ]
  26801. * };
  26802. */
  26803. labelOutlineWidth: StyleExpression;
  26804. /**
  26805. * 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.
  26806. * The getter will return the internal {@link Expression} or {@link ConditionsExpression}, which may differ from the value provided to the setter.
  26807. * <p>
  26808. * The expression must return a <code>String</code>.
  26809. * </p>
  26810. * <p>
  26811. * This expression is only applicable to point features in a Vector tile.
  26812. * </p>
  26813. * @example
  26814. * var style = new Cesium3DTileStyle({
  26815. * font : '(${Temperature} > 90) ? "30px Helvetica" : "24px Helvetica"'
  26816. * });
  26817. * style.font.evaluate(feature); // returns a String
  26818. * @example
  26819. * var style = new Cesium.Cesium3DTileStyle();
  26820. * // Override font expression with a custom function
  26821. * style.font = {
  26822. * evaluate : function(feature) {
  26823. * return '24px Helvetica';
  26824. * }
  26825. * };
  26826. */
  26827. font: StyleExpression;
  26828. /**
  26829. * 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.
  26830. * The getter will return the internal {@link Expression} or {@link ConditionsExpression}, which may differ from the value provided to the setter.
  26831. * <p>
  26832. * The expression must return a <code>LabelStyle</code>.
  26833. * </p>
  26834. * <p>
  26835. * This expression is only applicable to point features in a Vector tile.
  26836. * </p>
  26837. * @example
  26838. * var style = new Cesium3DTileStyle({
  26839. * labelStyle : '(${Temperature} > 90) ? ' + LabelStyle.FILL_AND_OUTLINE + ' : ' + LabelStyle.FILL
  26840. * });
  26841. * style.labelStyle.evaluate(feature); // returns a LabelStyle
  26842. * @example
  26843. * var style = new Cesium.Cesium3DTileStyle();
  26844. * // Override labelStyle expression with a custom function
  26845. * style.labelStyle = {
  26846. * evaluate : function(feature) {
  26847. * return LabelStyle.FILL;
  26848. * }
  26849. * };
  26850. */
  26851. labelStyle: StyleExpression;
  26852. /**
  26853. * 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.
  26854. * The getter will return the internal {@link Expression} or {@link ConditionsExpression}, which may differ from the value provided to the setter.
  26855. * <p>
  26856. * The expression must return a <code>String</code>.
  26857. * </p>
  26858. * <p>
  26859. * This expression is only applicable to point features in a Vector tile.
  26860. * </p>
  26861. * @example
  26862. * var style = new Cesium3DTileStyle({
  26863. * labelText : '(${Temperature} > 90) ? ">90" : "<=90"'
  26864. * });
  26865. * style.labelText.evaluate(feature); // returns a String
  26866. * @example
  26867. * var style = new Cesium.Cesium3DTileStyle();
  26868. * // Override labelText expression with a custom function
  26869. * style.labelText = {
  26870. * evaluate : function(feature) {
  26871. * return 'Example label text';
  26872. * }
  26873. * };
  26874. */
  26875. labelText: StyleExpression;
  26876. /**
  26877. * 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.
  26878. * The getter will return the internal {@link Expression} or {@link ConditionsExpression}, which may differ from the value provided to the setter.
  26879. * <p>
  26880. * The expression must return a <code>Color</code>.
  26881. * </p>
  26882. * <p>
  26883. * This expression is only applicable to point features in a Vector tile.
  26884. * </p>
  26885. * @example
  26886. * var style = new Cesium.Cesium3DTileStyle();
  26887. * // Override backgroundColor expression with a string
  26888. * style.backgroundColor = 'color("blue")';
  26889. * @example
  26890. * var style = new Cesium.Cesium3DTileStyle();
  26891. * // Override backgroundColor expression with a condition
  26892. * style.backgroundColor = {
  26893. * conditions : [
  26894. * ['${height} > 2', 'color("cyan")'],
  26895. * ['true', 'color("blue")']
  26896. * ]
  26897. * };
  26898. */
  26899. backgroundColor: StyleExpression;
  26900. /**
  26901. * 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.
  26902. * The getter will return the internal {@link Expression} or {@link ConditionsExpression}, which may differ from the value provided to the setter.
  26903. * <p>
  26904. * The expression must return a <code>Cartesian2</code>.
  26905. * </p>
  26906. * <p>
  26907. * This expression is only applicable to point features in a Vector tile.
  26908. * </p>
  26909. * @example
  26910. * var style = new Cesium.Cesium3DTileStyle();
  26911. * // Override backgroundPadding expression with a string
  26912. * style.backgroundPadding = 'vec2(5.0, 7.0)';
  26913. * style.backgroundPadding.evaluate(feature); // returns a Cartesian2
  26914. */
  26915. backgroundPadding: StyleExpression;
  26916. /**
  26917. * 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.
  26918. * The getter will return the internal {@link Expression} or {@link ConditionsExpression}, which may differ from the value provided to the setter.
  26919. * <p>
  26920. * The expression must return a <code>Boolean</code>.
  26921. * </p>
  26922. * <p>
  26923. * This expression is only applicable to point features in a Vector tile.
  26924. * </p>
  26925. * @example
  26926. * var style = new Cesium.Cesium3DTileStyle();
  26927. * // Override backgroundEnabled expression with a string
  26928. * style.backgroundEnabled = 'true';
  26929. * @example
  26930. * var style = new Cesium.Cesium3DTileStyle();
  26931. * // Override backgroundEnabled expression with a condition
  26932. * style.backgroundEnabled = {
  26933. * conditions : [
  26934. * ['${height} > 2', 'true'],
  26935. * ['true', 'false']
  26936. * ]
  26937. * };
  26938. */
  26939. backgroundEnabled: StyleExpression;
  26940. /**
  26941. * 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.
  26942. * The getter will return the internal {@link Expression} or {@link ConditionsExpression}, which may differ from the value provided to the setter.
  26943. * <p>
  26944. * The expression must return a <code>Cartesian4</code>.
  26945. * </p>
  26946. * <p>
  26947. * This expression is only applicable to point features in a Vector tile.
  26948. * </p>
  26949. * @example
  26950. * var style = new Cesium.Cesium3DTileStyle();
  26951. * // Override scaleByDistance expression with a string
  26952. * style.scaleByDistance = 'vec4(1.5e2, 2.0, 1.5e7, 0.5)';
  26953. * style.scaleByDistance.evaluate(feature); // returns a Cartesian4
  26954. */
  26955. scaleByDistance: StyleExpression;
  26956. /**
  26957. * 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.
  26958. * The getter will return the internal {@link Expression} or {@link ConditionsExpression}, which may differ from the value provided to the setter.
  26959. * <p>
  26960. * The expression must return a <code>Cartesian4</code>.
  26961. * </p>
  26962. * <p>
  26963. * This expression is only applicable to point features in a Vector tile.
  26964. * </p>
  26965. * @example
  26966. * var style = new Cesium.Cesium3DTileStyle();
  26967. * // Override translucencyByDistance expression with a string
  26968. * style.translucencyByDistance = 'vec4(1.5e2, 1.0, 1.5e7, 0.2)';
  26969. * style.translucencyByDistance.evaluate(feature); // returns a Cartesian4
  26970. */
  26971. translucencyByDistance: StyleExpression;
  26972. /**
  26973. * 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.
  26974. * The getter will return the internal {@link Expression} or {@link ConditionsExpression}, which may differ from the value provided to the setter.
  26975. * <p>
  26976. * The expression must return a <code>Cartesian2</code>.
  26977. * </p>
  26978. * <p>
  26979. * This expression is only applicable to point features in a Vector tile.
  26980. * </p>
  26981. * @example
  26982. * var style = new Cesium.Cesium3DTileStyle();
  26983. * // Override distanceDisplayCondition expression with a string
  26984. * style.distanceDisplayCondition = 'vec2(0.0, 5.5e6)';
  26985. * style.distanceDisplayCondition.evaluate(feature); // returns a Cartesian2
  26986. */
  26987. distanceDisplayCondition: StyleExpression;
  26988. /**
  26989. * 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.
  26990. * The getter will return the internal {@link Expression} or {@link ConditionsExpression}, which may differ from the value provided to the setter.
  26991. * <p>
  26992. * The expression must return a <code>Number</code>.
  26993. * </p>
  26994. * <p>
  26995. * This expression is only applicable to point features in a Vector tile.
  26996. * </p>
  26997. * @example
  26998. * var style = new Cesium.Cesium3DTileStyle();
  26999. * // Override heightOffset expression with a string
  27000. * style.heightOffset = '2.0';
  27001. * @example
  27002. * var style = new Cesium.Cesium3DTileStyle();
  27003. * // Override heightOffset expression with a condition
  27004. * style.heightOffset = {
  27005. * conditions : [
  27006. * ['${height} > 2', '4.0'],
  27007. * ['true', '2.0']
  27008. * ]
  27009. * };
  27010. */
  27011. heightOffset: StyleExpression;
  27012. /**
  27013. * 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.
  27014. * The getter will return the internal {@link Expression} or {@link ConditionsExpression}, which may differ from the value provided to the setter.
  27015. * <p>
  27016. * The expression must return a <code>Boolean</code>.
  27017. * </p>
  27018. * <p>
  27019. * This expression is only applicable to point features in a Vector tile.
  27020. * </p>
  27021. * @example
  27022. * var style = new Cesium.Cesium3DTileStyle();
  27023. * // Override anchorLineEnabled expression with a string
  27024. * style.anchorLineEnabled = 'true';
  27025. * @example
  27026. * var style = new Cesium.Cesium3DTileStyle();
  27027. * // Override anchorLineEnabled expression with a condition
  27028. * style.anchorLineEnabled = {
  27029. * conditions : [
  27030. * ['${height} > 2', 'true'],
  27031. * ['true', 'false']
  27032. * ]
  27033. * };
  27034. */
  27035. anchorLineEnabled: StyleExpression;
  27036. /**
  27037. * 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.
  27038. * The getter will return the internal {@link Expression} or {@link ConditionsExpression}, which may differ from the value provided to the setter.
  27039. * <p>
  27040. * The expression must return a <code>Color</code>.
  27041. * </p>
  27042. * <p>
  27043. * This expression is only applicable to point features in a Vector tile.
  27044. * </p>
  27045. * @example
  27046. * var style = new Cesium.Cesium3DTileStyle();
  27047. * // Override anchorLineColor expression with a string
  27048. * style.anchorLineColor = 'color("blue")';
  27049. * @example
  27050. * var style = new Cesium.Cesium3DTileStyle();
  27051. * // Override anchorLineColor expression with a condition
  27052. * style.anchorLineColor = {
  27053. * conditions : [
  27054. * ['${height} > 2', 'color("cyan")'],
  27055. * ['true', 'color("blue")']
  27056. * ]
  27057. * };
  27058. */
  27059. anchorLineColor: StyleExpression;
  27060. /**
  27061. * 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.
  27062. * The getter will return the internal {@link Expression} or {@link ConditionsExpression}, which may differ from the value provided to the setter.
  27063. * <p>
  27064. * The expression must return a <code>String</code>.
  27065. * </p>
  27066. * <p>
  27067. * This expression is only applicable to point features in a Vector tile.
  27068. * </p>
  27069. * @example
  27070. * var style = new Cesium3DTileStyle({
  27071. * image : '(${Temperature} > 90) ? "/url/to/image1" : "/url/to/image2"'
  27072. * });
  27073. * style.image.evaluate(feature); // returns a String
  27074. * @example
  27075. * var style = new Cesium.Cesium3DTileStyle();
  27076. * // Override image expression with a custom function
  27077. * style.image = {
  27078. * evaluate : function(feature) {
  27079. * return '/url/to/image';
  27080. * }
  27081. * };
  27082. */
  27083. image: StyleExpression;
  27084. /**
  27085. * 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.
  27086. * The getter will return the internal {@link Expression} or {@link ConditionsExpression}, which may differ from the value provided to the setter.
  27087. * <p>
  27088. * The expression must return a <code>Number</code>.
  27089. * </p>
  27090. * <p>
  27091. * This expression is only applicable to point features in a Vector tile.
  27092. * </p>
  27093. * @example
  27094. * var style = new Cesium.Cesium3DTileStyle();
  27095. * // Override disableDepthTestDistance expression with a string
  27096. * style.disableDepthTestDistance = '1000.0';
  27097. * style.disableDepthTestDistance.evaluate(feature); // returns a Number
  27098. */
  27099. disableDepthTestDistance: StyleExpression;
  27100. /**
  27101. * 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.
  27102. * The getter will return the internal {@link Expression} or {@link ConditionsExpression}, which may differ from the value provided to the setter.
  27103. * <p>
  27104. * The expression must return a <code>HorizontalOrigin</code>.
  27105. * </p>
  27106. * <p>
  27107. * This expression is only applicable to point features in a Vector tile.
  27108. * </p>
  27109. * @example
  27110. * var style = new Cesium3DTileStyle({
  27111. * horizontalOrigin : HorizontalOrigin.LEFT
  27112. * });
  27113. * style.horizontalOrigin.evaluate(feature); // returns a HorizontalOrigin
  27114. * @example
  27115. * var style = new Cesium.Cesium3DTileStyle();
  27116. * // Override horizontalOrigin expression with a custom function
  27117. * style.horizontalOrigin = {
  27118. * evaluate : function(feature) {
  27119. * return HorizontalOrigin.CENTER;
  27120. * }
  27121. * };
  27122. */
  27123. horizontalOrigin: StyleExpression;
  27124. /**
  27125. * 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.
  27126. * The getter will return the internal {@link Expression} or {@link ConditionsExpression}, which may differ from the value provided to the setter.
  27127. * <p>
  27128. * The expression must return a <code>VerticalOrigin</code>.
  27129. * </p>
  27130. * <p>
  27131. * This expression is only applicable to point features in a Vector tile.
  27132. * </p>
  27133. * @example
  27134. * var style = new Cesium3DTileStyle({
  27135. * verticalOrigin : VerticalOrigin.TOP
  27136. * });
  27137. * style.verticalOrigin.evaluate(feature); // returns a VerticalOrigin
  27138. * @example
  27139. * var style = new Cesium.Cesium3DTileStyle();
  27140. * // Override verticalOrigin expression with a custom function
  27141. * style.verticalOrigin = {
  27142. * evaluate : function(feature) {
  27143. * return VerticalOrigin.CENTER;
  27144. * }
  27145. * };
  27146. */
  27147. verticalOrigin: StyleExpression;
  27148. /**
  27149. * 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.
  27150. * The getter will return the internal {@link Expression} or {@link ConditionsExpression}, which may differ from the value provided to the setter.
  27151. * <p>
  27152. * The expression must return a <code>HorizontalOrigin</code>.
  27153. * </p>
  27154. * <p>
  27155. * This expression is only applicable to point features in a Vector tile.
  27156. * </p>
  27157. * @example
  27158. * var style = new Cesium3DTileStyle({
  27159. * labelHorizontalOrigin : HorizontalOrigin.LEFT
  27160. * });
  27161. * style.labelHorizontalOrigin.evaluate(feature); // returns a HorizontalOrigin
  27162. * @example
  27163. * var style = new Cesium.Cesium3DTileStyle();
  27164. * // Override labelHorizontalOrigin expression with a custom function
  27165. * style.labelHorizontalOrigin = {
  27166. * evaluate : function(feature) {
  27167. * return HorizontalOrigin.CENTER;
  27168. * }
  27169. * };
  27170. */
  27171. labelHorizontalOrigin: StyleExpression;
  27172. /**
  27173. * 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.
  27174. * The getter will return the internal {@link Expression} or {@link ConditionsExpression}, which may differ from the value provided to the setter.
  27175. * <p>
  27176. * The expression must return a <code>VerticalOrigin</code>.
  27177. * </p>
  27178. * <p>
  27179. * This expression is only applicable to point features in a Vector tile.
  27180. * </p>
  27181. * @example
  27182. * var style = new Cesium3DTileStyle({
  27183. * labelVerticalOrigin : VerticalOrigin.TOP
  27184. * });
  27185. * style.labelVerticalOrigin.evaluate(feature); // returns a VerticalOrigin
  27186. * @example
  27187. * var style = new Cesium.Cesium3DTileStyle();
  27188. * // Override labelVerticalOrigin expression with a custom function
  27189. * style.labelVerticalOrigin = {
  27190. * evaluate : function(feature) {
  27191. * return VerticalOrigin.CENTER;
  27192. * }
  27193. * };
  27194. */
  27195. labelVerticalOrigin: StyleExpression;
  27196. /**
  27197. * Gets or sets the object containing application-specific expression that can be explicitly
  27198. * evaluated, e.g., for display in a UI.
  27199. * @example
  27200. * var style = new Cesium3DTileStyle({
  27201. * meta : {
  27202. * description : '"Building id ${id} has height ${Height}."'
  27203. * }
  27204. * });
  27205. * style.meta.description.evaluate(feature); // returns a String with the substituted variables
  27206. */
  27207. meta: StyleExpression;
  27208. }
  27209. /**
  27210. * A {@link https://github.com/CesiumGS/3d-tiles/tree/master/specification|3D Tiles tileset},
  27211. * used for streaming massive heterogeneous 3D geospatial datasets.
  27212. * @example
  27213. * var tileset = scene.primitives.add(new Cesium.Cesium3DTileset({
  27214. * url : 'http://localhost:8002/tilesets/Seattle/tileset.json'
  27215. * }));
  27216. * @example
  27217. * // Common setting for the skipLevelOfDetail optimization
  27218. * var tileset = scene.primitives.add(new Cesium.Cesium3DTileset({
  27219. * url : 'http://localhost:8002/tilesets/Seattle/tileset.json',
  27220. * skipLevelOfDetail : true,
  27221. * baseScreenSpaceError : 1024,
  27222. * skipScreenSpaceErrorFactor : 16,
  27223. * skipLevels : 1,
  27224. * immediatelyLoadDesiredLevelOfDetail : false,
  27225. * loadSiblings : false,
  27226. * cullWithChildrenBounds : true
  27227. * }));
  27228. * @example
  27229. * // Common settings for the dynamicScreenSpaceError optimization
  27230. * var tileset = scene.primitives.add(new Cesium.Cesium3DTileset({
  27231. * url : 'http://localhost:8002/tilesets/Seattle/tileset.json',
  27232. * dynamicScreenSpaceError : true,
  27233. * dynamicScreenSpaceErrorDensity : 0.00278,
  27234. * dynamicScreenSpaceErrorFactor : 4.0,
  27235. * dynamicScreenSpaceErrorHeightFalloff : 0.25
  27236. * }));
  27237. * @param options - Object with the following properties:
  27238. * @param options.url - The url to a tileset JSON file.
  27239. * @param [options.show = true] - Determines if the tileset will be shown.
  27240. * @param [options.modelMatrix = Matrix4.IDENTITY] - A 4x4 transformation matrix that transforms the tileset's root tile.
  27241. * @param [options.shadows = ShadowMode.ENABLED] - Determines whether the tileset casts or receives shadows from light sources.
  27242. * @param [options.maximumScreenSpaceError = 16] - The maximum screen space error used to drive level of detail refinement.
  27243. * @param [options.maximumMemoryUsage = 512] - The maximum amount of memory in MB that can be used by the tileset.
  27244. * @param [options.cullWithChildrenBounds = true] - Optimization option. Whether to cull tiles using the union of their children bounding volumes.
  27245. * @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.
  27246. * @param [options.cullRequestsWhileMovingMultiplier = 60.0] - Optimization option. Multiplier used in culling requests while moving. Larger is more aggressive culling, smaller less aggressive culling.
  27247. * @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.
  27248. * @param [options.preloadFlightDestinations = true] - Optimization option. Preload tiles at the camera's flight destination while the camera is in flight.
  27249. * @param [options.preferLeaves = false] - Optimization option. Prefer loading of leaves first.
  27250. * @param [options.dynamicScreenSpaceError = false] - Optimization option. Reduce the screen space error for tiles that are further away from the camera.
  27251. * @param [options.dynamicScreenSpaceErrorDensity = 0.00278] - Density used to adjust the dynamic screen space error, similar to fog density.
  27252. * @param [options.dynamicScreenSpaceErrorFactor = 4.0] - A factor used to increase the computed dynamic screen space error.
  27253. * @param [options.dynamicScreenSpaceErrorHeightFalloff = 0.25] - A ratio of the tileset's height at which the density starts to falloff.
  27254. * @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.
  27255. * @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.
  27256. * @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.
  27257. * @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}.
  27258. * @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}
  27259. * @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.
  27260. * @param [options.skipLevelOfDetail = false] - Optimization option. Determines if level of detail skipping should be applied during the traversal.
  27261. * @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.
  27262. * @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.
  27263. * @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.
  27264. * @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.
  27265. * @param [options.loadSiblings = false] - When <code>skipLevelOfDetail</code> is <code>true</code>, determines whether siblings of visible tiles are always downloaded during traversal.
  27266. * @param [options.clippingPlanes] - The {@link ClippingPlaneCollection} used to selectively disable rendering the tileset.
  27267. * @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.
  27268. * @param [options.ellipsoid = Ellipsoid.WGS84] - The ellipsoid determining the size and shape of the globe.
  27269. * @param [options.pointCloudShading] - Options for constructing a {@link PointCloudShading} object to control point attenuation based on geometric error and lighting.
  27270. * @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.
  27271. * @param [options.lightColor] - The light color when shading models. When <code>undefined</code> the scene's light color is used instead.
  27272. * @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.
  27273. * @param [options.sphericalHarmonicCoefficients] - The third order spherical harmonic coefficients used for the diffuse color of image-based lighting.
  27274. * @param [options.specularEnvironmentMaps] - A URL to a KTX file that contains a cube map of the specular lighting and the convoluted specular mipmaps.
  27275. * @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.
  27276. * @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.
  27277. * @param [options.debugFreezeFrame = false] - For debugging only. Determines if only the tiles from last frame should be used for rendering.
  27278. * @param [options.debugColorizeTiles = false] - For debugging only. When true, assigns a random color to each tile.
  27279. * @param [options.debugWireframe = false] - For debugging only. When true, render's each tile's content as a wireframe.
  27280. * @param [options.debugShowBoundingVolume = false] - For debugging only. When true, renders the bounding volume for each tile.
  27281. * @param [options.debugShowContentBoundingVolume = false] - For debugging only. When true, renders the bounding volume for each tile's content.
  27282. * @param [options.debugShowViewerRequestVolume = false] - For debugging only. When true, renders the viewer request volume for each tile.
  27283. * @param [options.debugShowGeometricError = false] - For debugging only. When true, draws labels to indicate the geometric error of each tile.
  27284. * @param [options.debugShowRenderingStatistics = false] - For debugging only. When true, draws labels to indicate the number of commands, points, triangles and features for each tile.
  27285. * @param [options.debugShowMemoryUsage = false] - For debugging only. When true, draws labels to indicate the texture and geometry memory in megabytes used by each tile.
  27286. * @param [options.debugShowUrl = false] - For debugging only. When true, draws labels to indicate the url of each tile.
  27287. */
  27288. export class Cesium3DTileset {
  27289. constructor(options: {
  27290. url: Resource | string | Promise<Resource> | Promise<string>;
  27291. show?: boolean;
  27292. modelMatrix?: Matrix4;
  27293. shadows?: ShadowMode;
  27294. maximumScreenSpaceError?: number;
  27295. maximumMemoryUsage?: number;
  27296. cullWithChildrenBounds?: boolean;
  27297. cullRequestsWhileMoving?: boolean;
  27298. cullRequestsWhileMovingMultiplier?: number;
  27299. preloadWhenHidden?: boolean;
  27300. preloadFlightDestinations?: boolean;
  27301. preferLeaves?: boolean;
  27302. dynamicScreenSpaceError?: boolean;
  27303. dynamicScreenSpaceErrorDensity?: number;
  27304. dynamicScreenSpaceErrorFactor?: number;
  27305. dynamicScreenSpaceErrorHeightFalloff?: number;
  27306. progressiveResolutionHeightFraction?: number;
  27307. foveatedScreenSpaceError?: boolean;
  27308. foveatedConeSize?: number;
  27309. foveatedMinimumScreenSpaceErrorRelaxation?: number;
  27310. foveatedInterpolationCallback?: Cesium3DTileset.foveatedInterpolationCallback;
  27311. foveatedTimeDelay?: number;
  27312. skipLevelOfDetail?: boolean;
  27313. baseScreenSpaceError?: number;
  27314. skipScreenSpaceErrorFactor?: number;
  27315. skipLevels?: number;
  27316. immediatelyLoadDesiredLevelOfDetail?: boolean;
  27317. loadSiblings?: boolean;
  27318. clippingPlanes?: ClippingPlaneCollection;
  27319. classificationType?: ClassificationType;
  27320. ellipsoid?: Ellipsoid;
  27321. pointCloudShading?: any;
  27322. imageBasedLightingFactor?: Cartesian2;
  27323. lightColor?: Cartesian3;
  27324. luminanceAtZenith?: number;
  27325. sphericalHarmonicCoefficients?: Cartesian3[];
  27326. specularEnvironmentMaps?: string;
  27327. backFaceCulling?: boolean;
  27328. debugHeatmapTilePropertyName?: string;
  27329. debugFreezeFrame?: boolean;
  27330. debugColorizeTiles?: boolean;
  27331. debugWireframe?: boolean;
  27332. debugShowBoundingVolume?: boolean;
  27333. debugShowContentBoundingVolume?: boolean;
  27334. debugShowViewerRequestVolume?: boolean;
  27335. debugShowGeometricError?: boolean;
  27336. debugShowRenderingStatistics?: boolean;
  27337. debugShowMemoryUsage?: boolean;
  27338. debugShowUrl?: boolean;
  27339. });
  27340. /**
  27341. * 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.
  27342. */
  27343. cullRequestsWhileMoving: boolean;
  27344. /**
  27345. * Optimization option. Multiplier used in culling requests while moving. Larger is more aggressive culling, smaller less aggressive culling.
  27346. */
  27347. cullRequestsWhileMovingMultiplier: number;
  27348. /**
  27349. * 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.
  27350. */
  27351. progressiveResolutionHeightFraction: number;
  27352. /**
  27353. * Optimization option. Prefer loading of leaves first.
  27354. */
  27355. preferLeaves: boolean;
  27356. /**
  27357. * Preload tiles when <code>tileset.show</code> is <code>false</code>. Loads tiles as if the tileset is visible but does not render them.
  27358. */
  27359. preloadWhenHidden: boolean;
  27360. /**
  27361. * Optimization option. Fetch tiles at the camera's flight destination while the camera is in flight.
  27362. */
  27363. preloadFlightDestinations: boolean;
  27364. /**
  27365. * Optimization option. Whether the tileset should refine based on a dynamic screen space error. Tiles that are further
  27366. * away will be rendered with lower detail than closer tiles. This improves performance by rendering fewer
  27367. * tiles and making less requests, but may result in a slight drop in visual quality for tiles in the distance.
  27368. * The algorithm is biased towards "street views" where the camera is close to the ground plane of the tileset and looking
  27369. * at the horizon. In addition results are more accurate for tightly fitting bounding volumes like box and region.
  27370. */
  27371. dynamicScreenSpaceError: boolean;
  27372. /**
  27373. * Optimization option. Prioritize loading tiles in the center of the screen by temporarily raising the
  27374. * screen space error for tiles around the edge of the screen. Screen space error returns to normal once all
  27375. * the tiles in the center of the screen as determined by the {@link Cesium3DTileset#foveatedConeSize} are loaded.
  27376. */
  27377. foveatedScreenSpaceError: boolean;
  27378. /**
  27379. * Gets or sets a callback to control how much to raise the screen space error for tiles outside the foveated cone,
  27380. * interpolating between {@link Cesium3DTileset#foveatedMinimumScreenSpaceErrorRelaxation} and {@link Cesium3DTileset#maximumScreenSpaceError}.
  27381. */
  27382. foveatedInterpolationCallback: Cesium3DTileset.foveatedInterpolationCallback;
  27383. /**
  27384. * Optimization option. Used when {@link Cesium3DTileset#foveatedScreenSpaceError} is true to control
  27385. * how long in seconds to wait after the camera stops moving before deferred tiles start loading in.
  27386. * This time delay prevents requesting tiles around the edges of the screen when the camera is moving.
  27387. * Setting this to 0.0 will immediately request all tiles in any given view.
  27388. */
  27389. foveatedTimeDelay: number;
  27390. /**
  27391. * A scalar that determines the density used to adjust the dynamic screen space error, similar to {@link Fog}. Increasing this
  27392. * value has the effect of increasing the maximum screen space error for all tiles, but in a non-linear fashion.
  27393. * The error starts at 0.0 and increases exponentially until a midpoint is reached, and then approaches 1.0 asymptotically.
  27394. * This has the effect of keeping high detail in the closer tiles and lower detail in the further tiles, with all tiles
  27395. * beyond a certain distance all roughly having an error of 1.0.
  27396. * <p>
  27397. * The dynamic error is in the range [0.0, 1.0) and is multiplied by <code>dynamicScreenSpaceErrorFactor</code> to produce the
  27398. * final dynamic error. This dynamic error is then subtracted from the tile's actual screen space error.
  27399. * </p>
  27400. * <p>
  27401. * Increasing <code>dynamicScreenSpaceErrorDensity</code> has the effect of moving the error midpoint closer to the camera.
  27402. * It is analogous to moving fog closer to the camera.
  27403. * </p>
  27404. */
  27405. dynamicScreenSpaceErrorDensity: number;
  27406. /**
  27407. * A factor used to increase the screen space error of tiles for dynamic screen space error. As this value increases less tiles
  27408. * are requested for rendering and tiles in the distance will have lower detail. If set to zero, the feature will be disabled.
  27409. */
  27410. dynamicScreenSpaceErrorFactor: number;
  27411. /**
  27412. * A ratio of the tileset's height at which the density starts to falloff. If the camera is below this height the
  27413. * full computed density is applied, otherwise the density falls off. This has the effect of higher density at
  27414. * street level views.
  27415. * <p>
  27416. * Valid values are between 0.0 and 1.0.
  27417. * </p>
  27418. */
  27419. dynamicScreenSpaceErrorHeightFalloff: number;
  27420. /**
  27421. * Determines whether the tileset casts or receives shadows from light sources.
  27422. * <p>
  27423. * 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.
  27424. * </p>
  27425. * <p>
  27426. * Shadows are rendered only when {@link Viewer#shadows} is <code>true</code>.
  27427. * </p>
  27428. */
  27429. shadows: ShadowMode;
  27430. /**
  27431. * Determines if the tileset will be shown.
  27432. */
  27433. show: boolean;
  27434. /**
  27435. * Defines how per-feature colors set from the Cesium API or declarative styling blend with the source colors from
  27436. * the original feature, e.g. glTF material or per-point color in the tile.
  27437. */
  27438. colorBlendMode: Cesium3DTileColorBlendMode;
  27439. /**
  27440. * Defines the value used to linearly interpolate between the source color and feature color when the {@link Cesium3DTileset#colorBlendMode} is <code>MIX</code>.
  27441. * 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
  27442. * resulting in a mix of the source color and feature color.
  27443. */
  27444. colorBlendAmount: number;
  27445. /**
  27446. * Options for controlling point size based on geometric error and eye dome lighting.
  27447. */
  27448. pointCloudShading: PointCloudShading;
  27449. /**
  27450. * The event fired to indicate progress of loading new tiles. This event is fired when a new tile
  27451. * is requested, when a requested tile is finished downloading, and when a downloaded tile has been
  27452. * processed and is ready to render.
  27453. * <p>
  27454. * The number of pending tile requests, <code>numberOfPendingRequests</code>, and number of tiles
  27455. * processing, <code>numberOfTilesProcessing</code> are passed to the event listener.
  27456. * </p>
  27457. * <p>
  27458. * This event is fired at the end of the frame after the scene is rendered.
  27459. * </p>
  27460. * @example
  27461. * tileset.loadProgress.addEventListener(function(numberOfPendingRequests, numberOfTilesProcessing) {
  27462. * if ((numberOfPendingRequests === 0) && (numberOfTilesProcessing === 0)) {
  27463. * console.log('Stopped loading');
  27464. * return;
  27465. * }
  27466. *
  27467. * console.log('Loading: requests: ' + numberOfPendingRequests + ', processing: ' + numberOfTilesProcessing);
  27468. * });
  27469. */
  27470. loadProgress: Event;
  27471. /**
  27472. * The event fired to indicate that all tiles that meet the screen space error this frame are loaded. The tileset
  27473. * is completely loaded for this view.
  27474. * <p>
  27475. * This event is fired at the end of the frame after the scene is rendered.
  27476. * </p>
  27477. * @example
  27478. * tileset.allTilesLoaded.addEventListener(function() {
  27479. * console.log('All tiles are loaded');
  27480. * });
  27481. */
  27482. allTilesLoaded: Event;
  27483. /**
  27484. * The event fired to indicate that all tiles that meet the screen space error this frame are loaded. This event
  27485. * is fired once when all tiles in the initial view are loaded.
  27486. * <p>
  27487. * This event is fired at the end of the frame after the scene is rendered.
  27488. * </p>
  27489. * @example
  27490. * tileset.initialTilesLoaded.addEventListener(function() {
  27491. * console.log('Initial tiles are loaded');
  27492. * });
  27493. */
  27494. initialTilesLoaded: Event;
  27495. /**
  27496. * The event fired to indicate that a tile's content was loaded.
  27497. * <p>
  27498. * The loaded {@link Cesium3DTile} is passed to the event listener.
  27499. * </p>
  27500. * <p>
  27501. * This event is fired during the tileset traversal while the frame is being rendered
  27502. * so that updates to the tile take effect in the same frame. Do not create or modify
  27503. * Cesium entities or primitives during the event listener.
  27504. * </p>
  27505. * @example
  27506. * tileset.tileLoad.addEventListener(function(tile) {
  27507. * console.log('A tile was loaded.');
  27508. * });
  27509. */
  27510. tileLoad: Event;
  27511. /**
  27512. * The event fired to indicate that a tile's content was unloaded.
  27513. * <p>
  27514. * The unloaded {@link Cesium3DTile} is passed to the event listener.
  27515. * </p>
  27516. * <p>
  27517. * This event is fired immediately before the tile's content is unloaded while the frame is being
  27518. * rendered so that the event listener has access to the tile's content. Do not create
  27519. * or modify Cesium entities or primitives during the event listener.
  27520. * </p>
  27521. * @example
  27522. * tileset.tileUnload.addEventListener(function(tile) {
  27523. * console.log('A tile was unloaded from the cache.');
  27524. * });
  27525. */
  27526. tileUnload: Event;
  27527. /**
  27528. * The event fired to indicate that a tile's content failed to load.
  27529. * <p>
  27530. * If there are no event listeners, error messages will be logged to the console.
  27531. * </p>
  27532. * <p>
  27533. * The error object passed to the listener contains two properties:
  27534. * <ul>
  27535. * <li><code>url</code>: the url of the failed tile.</li>
  27536. * <li><code>message</code>: the error message.</li>
  27537. * </ul>
  27538. * @example
  27539. * tileset.tileFailed.addEventListener(function(error) {
  27540. * console.log('An error occurred loading tile: ' + error.url);
  27541. * console.log('Error: ' + error.message);
  27542. * });
  27543. */
  27544. tileFailed: Event;
  27545. /**
  27546. * This event fires once for each visible tile in a frame. This can be used to manually
  27547. * style a tileset.
  27548. * <p>
  27549. * The visible {@link Cesium3DTile} is passed to the event listener.
  27550. * </p>
  27551. * <p>
  27552. * This event is fired during the tileset traversal while the frame is being rendered
  27553. * so that updates to the tile take effect in the same frame. Do not create or modify
  27554. * Cesium entities or primitives during the event listener.
  27555. * </p>
  27556. * @example
  27557. * tileset.tileVisible.addEventListener(function(tile) {
  27558. * if (tile.content instanceof Cesium.Batched3DModel3DTileContent) {
  27559. * console.log('A Batched 3D Model tile is visible.');
  27560. * }
  27561. * });
  27562. * @example
  27563. * // Apply a red style and then manually set random colors for every other feature when the tile becomes visible.
  27564. * tileset.style = new Cesium.Cesium3DTileStyle({
  27565. * color : 'color("red")'
  27566. * });
  27567. * tileset.tileVisible.addEventListener(function(tile) {
  27568. * var content = tile.content;
  27569. * var featuresLength = content.featuresLength;
  27570. * for (var i = 0; i < featuresLength; i+=2) {
  27571. * content.getFeature(i).color = Cesium.Color.fromRandom();
  27572. * }
  27573. * });
  27574. */
  27575. tileVisible: Event;
  27576. /**
  27577. * Optimization option. Determines if level of detail skipping should be applied during the traversal.
  27578. * <p>
  27579. * The common strategy for replacement-refinement traversal is to store all levels of the tree in memory and require
  27580. * all children to be loaded before the parent can refine. With this optimization levels of the tree can be skipped
  27581. * entirely and children can be rendered alongside their parents. The tileset requires significantly less memory when
  27582. * using this optimization.
  27583. * </p>
  27584. */
  27585. skipLevelOfDetail: boolean;
  27586. /**
  27587. * The screen space error that must be reached before skipping levels of detail.
  27588. * <p>
  27589. * Only used when {@link Cesium3DTileset#skipLevelOfDetail} is <code>true</code>.
  27590. * </p>
  27591. */
  27592. baseScreenSpaceError: number;
  27593. /**
  27594. * Multiplier defining the minimum screen space error to skip.
  27595. * For example, if a tile has screen space error of 100, no tiles will be loaded unless they
  27596. * are leaves or have a screen space error <code><= 100 / skipScreenSpaceErrorFactor</code>.
  27597. * <p>
  27598. * Only used when {@link Cesium3DTileset#skipLevelOfDetail} is <code>true</code>.
  27599. * </p>
  27600. */
  27601. skipScreenSpaceErrorFactor: number;
  27602. /**
  27603. * Constant defining the minimum number of levels to skip when loading tiles. When it is 0, no levels are skipped.
  27604. * For example, if a tile is level 1, no tiles will be loaded unless they are at level greater than 2.
  27605. * <p>
  27606. * Only used when {@link Cesium3DTileset#skipLevelOfDetail} is <code>true</code>.
  27607. * </p>
  27608. */
  27609. skipLevels: number;
  27610. /**
  27611. * When true, only tiles that meet the maximum screen space error will ever be downloaded.
  27612. * Skipping factors are ignored and just the desired tiles are loaded.
  27613. * <p>
  27614. * Only used when {@link Cesium3DTileset#skipLevelOfDetail} is <code>true</code>.
  27615. * </p>
  27616. */
  27617. immediatelyLoadDesiredLevelOfDetail: boolean;
  27618. /**
  27619. * Determines whether siblings of visible tiles are always downloaded during traversal.
  27620. * This may be useful for ensuring that tiles are already available when the viewer turns left/right.
  27621. * <p>
  27622. * Only used when {@link Cesium3DTileset#skipLevelOfDetail} is <code>true</code>.
  27623. * </p>
  27624. */
  27625. loadSiblings: boolean;
  27626. /**
  27627. * The light color when shading models. When <code>undefined</code> the scene's light color is used instead.
  27628. * <p>
  27629. * For example, disabling additional light sources by setting <code>model.imageBasedLightingFactor = new Cartesian2(0.0, 0.0)</code> will make the
  27630. * model much darker. Here, increasing the intensity of the light source will make the model brighter.
  27631. * </p>
  27632. */
  27633. lightColor: Cartesian3;
  27634. /**
  27635. * The sun's luminance at the zenith in kilo candela per meter squared to use for this model's procedural environment map.
  27636. * This is used when {@link Cesium3DTileset#specularEnvironmentMaps} and {@link Cesium3DTileset#sphericalHarmonicCoefficients} are not defined.
  27637. */
  27638. luminanceAtZenith: number;
  27639. /**
  27640. * The third order spherical harmonic coefficients used for the diffuse color of image-based lighting. When <code>undefined</code>, a diffuse irradiance
  27641. * computed from the atmosphere color is used.
  27642. * <p>
  27643. * There are nine <code>Cartesian3</code> coefficients.
  27644. * The order of the coefficients is: L<sub>00</sub>, L<sub>1-1</sub>, L<sub>10</sub>, L<sub>11</sub>, L<sub>2-2</sub>, L<sub>2-1</sub>, L<sub>20</sub>, L<sub>21</sub>, L<sub>22</sub>
  27645. * </p>
  27646. *
  27647. * These values can be obtained by preprocessing the environment map using the <code>cmgen</code> tool of
  27648. * {@link https://github.com/google/filament/releases|Google's Filament project}. This will also generate a KTX file that can be
  27649. * supplied to {@link Cesium3DTileset#specularEnvironmentMaps}.
  27650. */
  27651. sphericalHarmonicCoefficients: Cartesian3[];
  27652. /**
  27653. * A URL to a KTX file that contains a cube map of the specular lighting and the convoluted specular mipmaps.
  27654. */
  27655. specularEnvironmentMaps: string;
  27656. /**
  27657. * Whether to cull back-facing geometry. When true, back face culling is determined
  27658. * by the glTF material's doubleSided property; when false, back face culling is disabled.
  27659. */
  27660. backFaceCulling: boolean;
  27661. /**
  27662. * This property is for debugging only; it is not optimized for production use.
  27663. * <p>
  27664. * Determines if only the tiles from last frame should be used for rendering. This
  27665. * effectively "freezes" the tileset to the previous frame so it is possible to zoom
  27666. * out and see what was rendered.
  27667. * </p>
  27668. */
  27669. debugFreezeFrame: boolean;
  27670. /**
  27671. * This property is for debugging only; it is not optimized for production use.
  27672. * <p>
  27673. * When true, assigns a random color to each tile. This is useful for visualizing
  27674. * what features belong to what tiles, especially with additive refinement where features
  27675. * from parent tiles may be interleaved with features from child tiles.
  27676. * </p>
  27677. */
  27678. debugColorizeTiles: boolean;
  27679. /**
  27680. * This property is for debugging only; it is not optimized for production use.
  27681. * <p>
  27682. * When true, renders each tile's content as a wireframe.
  27683. * </p>
  27684. */
  27685. debugWireframe: boolean;
  27686. /**
  27687. * This property is for debugging only; it is not optimized for production use.
  27688. * <p>
  27689. * When true, renders the bounding volume for each visible tile. The bounding volume is
  27690. * white if the tile has a content bounding volume or is empty; otherwise, it is red. Tiles that don't meet the
  27691. * screen space error and are still refining to their descendants are yellow.
  27692. * </p>
  27693. */
  27694. debugShowBoundingVolume: boolean;
  27695. /**
  27696. * This property is for debugging only; it is not optimized for production use.
  27697. * <p>
  27698. * When true, renders the bounding volume for each visible tile's content. The bounding volume is
  27699. * blue if the tile has a content bounding volume; otherwise it is red.
  27700. * </p>
  27701. */
  27702. debugShowContentBoundingVolume: boolean;
  27703. /**
  27704. * This property is for debugging only; it is not optimized for production use.
  27705. * <p>
  27706. * When true, renders the viewer request volume for each tile.
  27707. * </p>
  27708. */
  27709. debugShowViewerRequestVolume: boolean;
  27710. /**
  27711. * This property is for debugging only; it is not optimized for production use.
  27712. * <p>
  27713. * When true, draws labels to indicate the geometric error of each tile.
  27714. * </p>
  27715. */
  27716. debugShowGeometricError: boolean;
  27717. /**
  27718. * This property is for debugging only; it is not optimized for production use.
  27719. * <p>
  27720. * When true, draws labels to indicate the number of commands, points, triangles and features of each tile.
  27721. * </p>
  27722. */
  27723. debugShowRenderingStatistics: boolean;
  27724. /**
  27725. * This property is for debugging only; it is not optimized for production use.
  27726. * <p>
  27727. * When true, draws labels to indicate the geometry and texture memory usage of each tile.
  27728. * </p>
  27729. */
  27730. debugShowMemoryUsage: boolean;
  27731. /**
  27732. * This property is for debugging only; it is not optimized for production use.
  27733. * <p>
  27734. * When true, draws labels to indicate the url of each tile.
  27735. * </p>
  27736. */
  27737. debugShowUrl: boolean;
  27738. /**
  27739. * Gets the tileset's asset object property, which contains metadata about the tileset.
  27740. * <p>
  27741. * See the {@link https://github.com/CesiumGS/3d-tiles/tree/master/specification#reference-asset|asset schema reference}
  27742. * in the 3D Tiles spec for the full set of properties.
  27743. * </p>
  27744. */
  27745. readonly asset: any;
  27746. /**
  27747. * Gets the tileset's extensions object property.
  27748. */
  27749. readonly extensions: any;
  27750. /**
  27751. * The {@link ClippingPlaneCollection} used to selectively disable rendering the tileset.
  27752. */
  27753. clippingPlanes: ClippingPlaneCollection;
  27754. /**
  27755. * Gets the tileset's properties dictionary object, which contains metadata about per-feature properties.
  27756. * <p>
  27757. * See the {@link https://github.com/CesiumGS/3d-tiles/tree/master/specification#reference-properties|properties schema reference}
  27758. * in the 3D Tiles spec for the full set of properties.
  27759. * </p>
  27760. * @example
  27761. * console.log('Maximum building height: ' + tileset.properties.height.maximum);
  27762. * console.log('Minimum building height: ' + tileset.properties.height.minimum);
  27763. */
  27764. readonly properties: any;
  27765. /**
  27766. * When <code>true</code>, the tileset's root tile is loaded and the tileset is ready to render.
  27767. * This is set to <code>true</code> right before {@link Cesium3DTileset#readyPromise} is resolved.
  27768. */
  27769. readonly ready: boolean;
  27770. /**
  27771. * Gets the promise that will be resolved when the tileset's root tile is loaded and the tileset is ready to render.
  27772. * <p>
  27773. * This promise is resolved at the end of the frame before the first frame the tileset is rendered in.
  27774. * </p>
  27775. * @example
  27776. * tileset.readyPromise.then(function(tileset) {
  27777. * // tile.properties is not defined until readyPromise resolves.
  27778. * var properties = tileset.properties;
  27779. * if (Cesium.defined(properties)) {
  27780. * for (var name in properties) {
  27781. * console.log(properties[name]);
  27782. * }
  27783. * }
  27784. * });
  27785. */
  27786. readonly readyPromise: Promise<Cesium3DTileset>;
  27787. /**
  27788. * When <code>true</code>, all tiles that meet the screen space error this frame are loaded. The tileset is
  27789. * completely loaded for this view.
  27790. */
  27791. readonly tilesLoaded: boolean;
  27792. /**
  27793. * The url to a tileset JSON file.
  27794. */
  27795. readonly url: string;
  27796. /**
  27797. * The base path that non-absolute paths in tileset JSON file are relative to.
  27798. */
  27799. readonly basePath: string;
  27800. /**
  27801. * The style, defined using the
  27802. * {@link https://github.com/CesiumGS/3d-tiles/tree/master/specification/Styling|3D Tiles Styling language},
  27803. * applied to each feature in the tileset.
  27804. * <p>
  27805. * Assign <code>undefined</code> to remove the style, which will restore the visual
  27806. * appearance of the tileset to its default when no style was applied.
  27807. * </p>
  27808. * <p>
  27809. * The style is applied to a tile before the {@link Cesium3DTileset#tileVisible}
  27810. * event is raised, so code in <code>tileVisible</code> can manually set a feature's
  27811. * properties (e.g. color and show) after the style is applied. When
  27812. * a new style is assigned any manually set properties are overwritten.
  27813. * </p>
  27814. * @example
  27815. * tileset.style = new Cesium.Cesium3DTileStyle({
  27816. * color : {
  27817. * conditions : [
  27818. * ['${Height} >= 100', 'color("purple", 0.5)'],
  27819. * ['${Height} >= 50', 'color("red")'],
  27820. * ['true', 'color("blue")']
  27821. * ]
  27822. * },
  27823. * show : '${Height} > 0',
  27824. * meta : {
  27825. * description : '"Building id ${id} has height ${Height}."'
  27826. * }
  27827. * });
  27828. */
  27829. style: Cesium3DTileStyle | undefined;
  27830. /**
  27831. * The maximum screen space error used to drive level of detail refinement. This value helps determine when a tile
  27832. * refines to its descendants, and therefore plays a major role in balancing performance with visual quality.
  27833. * <p>
  27834. * A tile's screen space error is roughly equivalent to the number of pixels wide that would be drawn if a sphere with a
  27835. * radius equal to the tile's <b>geometric error</b> were rendered at the tile's position. If this value exceeds
  27836. * <code>maximumScreenSpaceError</code> the tile refines to its descendants.
  27837. * </p>
  27838. * <p>
  27839. * Depending on the tileset, <code>maximumScreenSpaceError</code> may need to be tweaked to achieve the right balance.
  27840. * Higher values provide better performance but lower visual quality.
  27841. * </p>
  27842. */
  27843. maximumScreenSpaceError: number;
  27844. /**
  27845. * The maximum amount of GPU memory (in MB) that may be used to cache tiles. This value is estimated from
  27846. * geometry, textures, and batch table textures of loaded tiles. For point clouds, this value also
  27847. * includes per-point metadata.
  27848. * <p>
  27849. * Tiles not in view are unloaded to enforce this.
  27850. * </p>
  27851. * <p>
  27852. * If decreasing this value results in unloading tiles, the tiles are unloaded the next frame.
  27853. * </p>
  27854. * <p>
  27855. * If tiles sized more than <code>maximumMemoryUsage</code> are needed
  27856. * to meet the desired screen space error, determined by {@link Cesium3DTileset#maximumScreenSpaceError},
  27857. * for the current view, then the memory usage of the tiles loaded will exceed
  27858. * <code>maximumMemoryUsage</code>. For example, if the maximum is 256 MB, but
  27859. * 300 MB of tiles are needed to meet the screen space error, then 300 MB of tiles may be loaded. When
  27860. * these tiles go out of view, they will be unloaded.
  27861. * </p>
  27862. */
  27863. maximumMemoryUsage: number;
  27864. /**
  27865. * The root tile.
  27866. */
  27867. readonly root: Cesium3DTile;
  27868. /**
  27869. * The tileset's bounding sphere.
  27870. * @example
  27871. * var tileset = viewer.scene.primitives.add(new Cesium.Cesium3DTileset({
  27872. * url : 'http://localhost:8002/tilesets/Seattle/tileset.json'
  27873. * }));
  27874. *
  27875. * tileset.readyPromise.then(function(tileset) {
  27876. * // Set the camera to view the newly added tileset
  27877. * viewer.camera.viewBoundingSphere(tileset.boundingSphere, new Cesium.HeadingPitchRange(0, -0.5, 0));
  27878. * });
  27879. */
  27880. readonly boundingSphere: BoundingSphere;
  27881. /**
  27882. * A 4x4 transformation matrix that transforms the entire tileset.
  27883. * @example
  27884. * // Adjust a tileset's height from the globe's surface.
  27885. * var heightOffset = 20.0;
  27886. * var boundingSphere = tileset.boundingSphere;
  27887. * var cartographic = Cesium.Cartographic.fromCartesian(boundingSphere.center);
  27888. * var surface = Cesium.Cartesian3.fromRadians(cartographic.longitude, cartographic.latitude, 0.0);
  27889. * var offset = Cesium.Cartesian3.fromRadians(cartographic.longitude, cartographic.latitude, heightOffset);
  27890. * var translation = Cesium.Cartesian3.subtract(offset, surface, new Cesium.Cartesian3());
  27891. * tileset.modelMatrix = Cesium.Matrix4.fromTranslation(translation);
  27892. */
  27893. modelMatrix: Matrix4;
  27894. /**
  27895. * Returns the time, in milliseconds, since the tileset was loaded and first updated.
  27896. */
  27897. readonly timeSinceLoad: number;
  27898. /**
  27899. * The total amount of GPU memory in bytes used by the tileset. This value is estimated from
  27900. * geometry, texture, and batch table textures of loaded tiles. For point clouds, this value also
  27901. * includes per-point metadata.
  27902. */
  27903. readonly totalMemoryUsageInBytes: number;
  27904. /**
  27905. * Determines whether terrain, 3D Tiles or both will be classified by this tileset.
  27906. * <p>
  27907. * This option is only applied to tilesets containing batched 3D models, geometry data, or vector data. Even when undefined, vector data and geometry data
  27908. * must render as classifications and will default to rendering on both terrain and other 3D Tiles tilesets.
  27909. * </p>
  27910. * <p>
  27911. * When enabled for batched 3D model tilesets, there are a few requirements/limitations on the glTF:
  27912. * <ul>
  27913. * <li>POSITION and _BATCHID semantics are required.</li>
  27914. * <li>All indices with the same batch id must occupy contiguous sections of the index buffer.</li>
  27915. * <li>All shaders and techniques are ignored. The generated shader simply multiplies the position by the model-view-projection matrix.</li>
  27916. * <li>The only supported extensions are CESIUM_RTC and WEB3D_quantized_attributes.</li>
  27917. * <li>Only one node is supported.</li>
  27918. * <li>Only one mesh per node is supported.</li>
  27919. * <li>Only one primitive per mesh is supported.</li>
  27920. * </ul>
  27921. * </p>
  27922. */
  27923. readonly classificationType: ClassificationType;
  27924. /**
  27925. * Gets an ellipsoid describing the shape of the globe.
  27926. */
  27927. readonly ellipsoid: Ellipsoid;
  27928. /**
  27929. * Optimization option. Used when {@link Cesium3DTileset#foveatedScreenSpaceError} is true to control the cone size that determines which tiles are deferred.
  27930. * 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}.
  27931. * 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.
  27932. */
  27933. foveatedConeSize: number;
  27934. /**
  27935. * Optimization option. Used when {@link Cesium3DTileset#foveatedScreenSpaceError} is true to control the starting screen space error relaxation for tiles outside the foveated cone.
  27936. * The screen space error will be raised starting with this value up to {@link Cesium3DTileset#maximumScreenSpaceError} based on the provided {@link Cesium3DTileset#foveatedInterpolationCallback}.
  27937. */
  27938. foveatedMinimumScreenSpaceErrorRelaxation: number;
  27939. /**
  27940. * Returns the <code>extras</code> property at the top-level of the tileset JSON, which contains application specific metadata.
  27941. * Returns <code>undefined</code> if <code>extras</code> does not exist.
  27942. */
  27943. readonly extras: any;
  27944. /**
  27945. * Cesium adds lighting from the earth, sky, atmosphere, and star skybox. This cartesian is used to scale the final
  27946. * diffuse and specular lighting contribution from those sources to the final color. A value of 0.0 will disable those light sources.
  27947. */
  27948. imageBasedLightingFactor: Cartesian2;
  27949. /**
  27950. * Provides a hook to override the method used to request the tileset json
  27951. * useful when fetching tilesets from remote servers
  27952. * @param tilesetUrl - The url of the json file to be fetched
  27953. * @returns A promise that resolves with the fetched json data
  27954. */
  27955. static loadJson(tilesetUrl: Resource | string): Promise<object>;
  27956. /**
  27957. * Marks the tileset's {@link Cesium3DTileset#style} as dirty, which forces all
  27958. * features to re-evaluate the style in the next frame each is visible.
  27959. */
  27960. makeStyleDirty(): void;
  27961. /**
  27962. * Unloads all tiles that weren't selected the previous frame. This can be used to
  27963. * explicitly manage the tile cache and reduce the total number of tiles loaded below
  27964. * {@link Cesium3DTileset#maximumMemoryUsage}.
  27965. * <p>
  27966. * Tile unloads occur at the next frame to keep all the WebGL delete calls
  27967. * within the render loop.
  27968. * </p>
  27969. */
  27970. trimLoadedTiles(): void;
  27971. /**
  27972. * <code>true</code> if the tileset JSON file lists the extension in extensionsUsed; otherwise, <code>false</code>.
  27973. * @param extensionName - The name of the extension to check.
  27974. * @returns <code>true</code> if the tileset JSON file lists the extension in extensionsUsed; otherwise, <code>false</code>.
  27975. */
  27976. hasExtension(extensionName: string): boolean;
  27977. /**
  27978. * Returns true if this object was destroyed; otherwise, false.
  27979. * <br /><br />
  27980. * If this object was destroyed, it should not be used; calling any function other than
  27981. * <code>isDestroyed</code> will result in a {@link DeveloperError} exception.
  27982. * @returns <code>true</code> if this object was destroyed; otherwise, <code>false</code>.
  27983. */
  27984. isDestroyed(): boolean;
  27985. /**
  27986. * Destroys the WebGL resources held by this object. Destroying an object allows for deterministic
  27987. * release of WebGL resources, instead of relying on the garbage collector to destroy this object.
  27988. * <br /><br />
  27989. * Once an object is destroyed, it should not be used; calling any function other than
  27990. * <code>isDestroyed</code> will result in a {@link DeveloperError} exception. Therefore,
  27991. * assign the return value (<code>undefined</code>) to the object as done in the example.
  27992. * @example
  27993. * tileset = tileset && tileset.destroy();
  27994. */
  27995. destroy(): void;
  27996. }
  27997. export namespace Cesium3DTileset {
  27998. /**
  27999. * 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,
  28000. * interpolating between {@link Cesium3DTileset#foveatedMinimumScreenSpaceErrorRelaxation} and {@link Cesium3DTileset#maximumScreenSpaceError}.
  28001. * @param p - The start value to interpolate.
  28002. * @param q - The end value to interpolate.
  28003. * @param time - The time of interpolation generally in the range <code>[0.0, 1.0]</code>.
  28004. */
  28005. type foveatedInterpolationCallback = (p: number, q: number, time: number) => number;
  28006. }
  28007. /**
  28008. * A ParticleEmitter that emits particles from a circle.
  28009. * Particles will be positioned within a circle and have initial velocities going along the z vector.
  28010. * @param [radius = 1.0] - The radius of the circle in meters.
  28011. */
  28012. export class CircleEmitter {
  28013. constructor(radius?: number);
  28014. /**
  28015. * The radius of the circle in meters.
  28016. */
  28017. radius: number;
  28018. /**
  28019. * The angle of the cone in radians.
  28020. */
  28021. angle: number;
  28022. }
  28023. /**
  28024. * A classification primitive represents a volume enclosing geometry in the {@link Scene} to be highlighted.
  28025. * <p>
  28026. * A primitive combines geometry instances with an {@link Appearance} that describes the full shading, including
  28027. * {@link Material} and {@link RenderState}. Roughly, the geometry instance defines the structure and placement,
  28028. * and the appearance defines the visual characteristics. Decoupling geometry and appearance allows us to mix
  28029. * and match most of them and add a new geometry or appearance independently of each other.
  28030. * Only {@link PerInstanceColorAppearance} with the same color across all instances is supported at this time when using
  28031. * ClassificationPrimitive directly.
  28032. * For full {@link Appearance} support when classifying terrain or 3D Tiles use {@link GroundPrimitive} instead.
  28033. * </p>
  28034. * <p>
  28035. * For correct rendering, this feature requires the EXT_frag_depth WebGL extension. For hardware that do not support this extension, there
  28036. * will be rendering artifacts for some viewing angles.
  28037. * </p>
  28038. * <p>
  28039. * Valid geometries are {@link BoxGeometry}, {@link CylinderGeometry}, {@link EllipsoidGeometry}, {@link PolylineVolumeGeometry}, and {@link SphereGeometry}.
  28040. * </p>
  28041. * <p>
  28042. * Geometries that follow the surface of the ellipsoid, such as {@link CircleGeometry}, {@link CorridorGeometry}, {@link EllipseGeometry}, {@link PolygonGeometry}, and {@link RectangleGeometry},
  28043. * are also valid if they are extruded volumes; otherwise, they will not be rendered.
  28044. * </p>
  28045. * @param [options] - Object with the following properties:
  28046. * @param [options.geometryInstances] - The geometry instances to render. This can either be a single instance or an array of length one.
  28047. * @param [options.appearance] - The appearance used to render the primitive. Defaults to PerInstanceColorAppearance when GeometryInstances have a color attribute.
  28048. * @param [options.show = true] - Determines if this primitive will be shown.
  28049. * @param [options.vertexCacheOptimize = false] - When <code>true</code>, geometry vertices are optimized for the pre and post-vertex-shader caches.
  28050. * @param [options.interleave = false] - When <code>true</code>, geometry vertex attributes are interleaved, which can slightly improve rendering performance but increases load time.
  28051. * @param [options.compressVertices = true] - When <code>true</code>, the geometry vertices are compressed, which will save memory.
  28052. * @param [options.releaseGeometryInstances = true] - When <code>true</code>, the primitive does not keep a reference to the input <code>geometryInstances</code> to save memory.
  28053. * @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.
  28054. * @param [options.asynchronous = true] - Determines if the primitive will be created asynchronously or block until ready. If false initializeTerrainHeights() must be called first.
  28055. * @param [options.classificationType = ClassificationType.BOTH] - Determines whether terrain, 3D Tiles or both will be classified.
  28056. * @param [options.debugShowBoundingVolume = false] - For debugging only. Determines if this primitive's commands' bounding spheres are shown.
  28057. * @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
  28058. * creation for the volumes to be created before the geometry is released or options.releaseGeometryInstance must be <code>false</code>.
  28059. */
  28060. export class ClassificationPrimitive {
  28061. constructor(options?: {
  28062. geometryInstances?: any[] | GeometryInstance;
  28063. appearance?: Appearance;
  28064. show?: boolean;
  28065. vertexCacheOptimize?: boolean;
  28066. interleave?: boolean;
  28067. compressVertices?: boolean;
  28068. releaseGeometryInstances?: boolean;
  28069. allowPicking?: boolean;
  28070. asynchronous?: boolean;
  28071. classificationType?: ClassificationType;
  28072. debugShowBoundingVolume?: boolean;
  28073. debugShowShadowVolume?: boolean;
  28074. });
  28075. /**
  28076. * The geometry instance rendered with this primitive. This may
  28077. * be <code>undefined</code> if <code>options.releaseGeometryInstances</code>
  28078. * is <code>true</code> when the primitive is constructed.
  28079. * <p>
  28080. * Changing this property after the primitive is rendered has no effect.
  28081. * </p>
  28082. * <p>
  28083. * Because of the rendering technique used, all geometry instances must be the same color.
  28084. * If there is an instance with a differing color, a <code>DeveloperError</code> will be thrown
  28085. * on the first attempt to render.
  28086. * </p>
  28087. */
  28088. readonly geometryInstances: any[] | GeometryInstance;
  28089. /**
  28090. * Determines if the primitive will be shown. This affects all geometry
  28091. * instances in the primitive.
  28092. */
  28093. show: boolean;
  28094. /**
  28095. * Determines whether terrain, 3D Tiles or both will be classified.
  28096. */
  28097. classificationType: ClassificationType;
  28098. /**
  28099. * This property is for debugging only; it is not for production use nor is it optimized.
  28100. * <p>
  28101. * Draws the bounding sphere for each draw command in the primitive.
  28102. * </p>
  28103. */
  28104. debugShowBoundingVolume: boolean;
  28105. /**
  28106. * This property is for debugging only; it is not for production use nor is it optimized.
  28107. * <p>
  28108. * Draws the shadow volume for each geometry in the primitive.
  28109. * </p>
  28110. */
  28111. debugShowShadowVolume: boolean;
  28112. /**
  28113. * When <code>true</code>, geometry vertices are optimized for the pre and post-vertex-shader caches.
  28114. */
  28115. readonly vertexCacheOptimize: boolean;
  28116. /**
  28117. * Determines if geometry vertex attributes are interleaved, which can slightly improve rendering performance.
  28118. */
  28119. readonly interleave: boolean;
  28120. /**
  28121. * When <code>true</code>, the primitive does not keep a reference to the input <code>geometryInstances</code> to save memory.
  28122. */
  28123. readonly releaseGeometryInstances: boolean;
  28124. /**
  28125. * When <code>true</code>, each geometry instance will only be pickable with {@link Scene#pick}. When <code>false</code>, GPU memory is saved.
  28126. */
  28127. readonly allowPicking: boolean;
  28128. /**
  28129. * Determines if the geometry instances will be created and batched on a web worker.
  28130. */
  28131. readonly asynchronous: boolean;
  28132. /**
  28133. * When <code>true</code>, geometry vertices are compressed, which will save memory.
  28134. */
  28135. readonly compressVertices: boolean;
  28136. /**
  28137. * Determines if the primitive is complete and ready to render. If this property is
  28138. * true, the primitive will be rendered the next time that {@link ClassificationPrimitive#update}
  28139. * is called.
  28140. */
  28141. readonly ready: boolean;
  28142. /**
  28143. * Gets a promise that resolves when the primitive is ready to render.
  28144. */
  28145. readonly readyPromise: Promise<ClassificationPrimitive>;
  28146. /**
  28147. * Determines if ClassificationPrimitive rendering is supported.
  28148. * @param scene - The scene.
  28149. * @returns <code>true</code> if ClassificationPrimitives are supported; otherwise, returns <code>false</code>
  28150. */
  28151. static isSupported(scene: Scene): boolean;
  28152. /**
  28153. * Called when {@link Viewer} or {@link CesiumWidget} render the scene to
  28154. * get the draw commands needed to render this primitive.
  28155. * <p>
  28156. * Do not call this function directly. This is documented just to
  28157. * list the exceptions that may be propagated when the scene is rendered:
  28158. * </p>
  28159. */
  28160. update(): void;
  28161. /**
  28162. * Returns the modifiable per-instance attributes for a {@link GeometryInstance}.
  28163. * @example
  28164. * var attributes = primitive.getGeometryInstanceAttributes('an id');
  28165. * attributes.color = Cesium.ColorGeometryInstanceAttribute.toValue(Cesium.Color.AQUA);
  28166. * attributes.show = Cesium.ShowGeometryInstanceAttribute.toValue(true);
  28167. * @param id - The id of the {@link GeometryInstance}.
  28168. * @returns The typed array in the attribute's format or undefined if the is no instance with id.
  28169. */
  28170. getGeometryInstanceAttributes(id: any): any;
  28171. /**
  28172. * Returns true if this object was destroyed; otherwise, false.
  28173. * <p>
  28174. * If this object was destroyed, it should not be used; calling any function other than
  28175. * <code>isDestroyed</code> will result in a {@link DeveloperError} exception.
  28176. * </p>
  28177. * @returns <code>true</code> if this object was destroyed; otherwise, <code>false</code>.
  28178. */
  28179. isDestroyed(): boolean;
  28180. /**
  28181. * Destroys the WebGL resources held by this object. Destroying an object allows for deterministic
  28182. * release of WebGL resources, instead of relying on the garbage collector to destroy this object.
  28183. * <p>
  28184. * Once an object is destroyed, it should not be used; calling any function other than
  28185. * <code>isDestroyed</code> will result in a {@link DeveloperError} exception. Therefore,
  28186. * assign the return value (<code>undefined</code>) to the object as done in the example.
  28187. * </p>
  28188. * @example
  28189. * e = e && e.destroy();
  28190. */
  28191. destroy(): void;
  28192. }
  28193. /**
  28194. * Whether a classification affects terrain, 3D Tiles or both.
  28195. */
  28196. export enum ClassificationType {
  28197. /**
  28198. * Only terrain will be classified.
  28199. */
  28200. TERRAIN = 0,
  28201. /**
  28202. * Only 3D Tiles will be classified.
  28203. */
  28204. CESIUM_3D_TILE = 1,
  28205. /**
  28206. * Both terrain and 3D Tiles will be classified.
  28207. */
  28208. BOTH = 2
  28209. }
  28210. /**
  28211. * A Plane in Hessian Normal form to be used with {@link ClippingPlaneCollection}.
  28212. * Compatible with mathematics functions in {@link Plane}
  28213. * @param normal - The plane's normal (normalized).
  28214. * @param distance - The shortest distance from the origin to the plane. The sign of
  28215. * <code>distance</code> determines which side of the plane the origin
  28216. * is on. If <code>distance</code> is positive, the origin is in the half-space
  28217. * in the direction of the normal; if negative, the origin is in the half-space
  28218. * opposite to the normal; if zero, the plane passes through the origin.
  28219. */
  28220. export class ClippingPlane {
  28221. constructor(normal: Cartesian3, distance: number);
  28222. /**
  28223. * The shortest distance from the origin to the plane. The sign of
  28224. * <code>distance</code> determines which side of the plane the origin
  28225. * is on. If <code>distance</code> is positive, the origin is in the half-space
  28226. * in the direction of the normal; if negative, the origin is in the half-space
  28227. * opposite to the normal; if zero, the plane passes through the origin.
  28228. */
  28229. distance: number;
  28230. /**
  28231. * The plane's normal.
  28232. */
  28233. normal: Cartesian3;
  28234. /**
  28235. * Create a ClippingPlane from a Plane object.
  28236. * @param plane - The plane containing parameters to copy
  28237. * @param [result] - The object on which to store the result
  28238. * @returns The ClippingPlane generated from the plane's parameters.
  28239. */
  28240. static fromPlane(plane: Plane, result?: ClippingPlane): ClippingPlane;
  28241. /**
  28242. * Clones the ClippingPlane without setting its ownership.
  28243. * @param clippingPlane - The ClippingPlane to be cloned
  28244. * @param [result] - The object on which to store the cloned parameters.
  28245. * @returns a clone of the input ClippingPlane
  28246. */
  28247. static clone(clippingPlane: ClippingPlane, result?: ClippingPlane): ClippingPlane;
  28248. }
  28249. /**
  28250. * Specifies a set of clipping planes. Clipping planes selectively disable rendering in a region on the
  28251. * outside of the specified list of {@link ClippingPlane} objects for a single gltf model, 3D Tileset, or the globe.
  28252. * <p>
  28253. * 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
  28254. * through the center of the object.
  28255. * </p>
  28256. * <p>
  28257. * 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.
  28258. * </p>
  28259. * @example
  28260. * // This clipping plane's distance is positive, which means its normal
  28261. * // is facing the origin. This will clip everything that is behind
  28262. * // the plane, which is anything with y coordinate < -5.
  28263. * var clippingPlanes = new Cesium.ClippingPlaneCollection({
  28264. * planes : [
  28265. * new Cesium.ClippingPlane(new Cesium.Cartesian3(0.0, 1.0, 0.0), 5.0)
  28266. * ],
  28267. * });
  28268. * // Create an entity and attach the ClippingPlaneCollection to the model.
  28269. * var entity = viewer.entities.add({
  28270. * position : Cesium.Cartesian3.fromDegrees(-123.0744619, 44.0503706, 10000),
  28271. * model : {
  28272. * uri : 'model.gltf',
  28273. * minimumPixelSize : 128,
  28274. * maximumScale : 20000,
  28275. * clippingPlanes : clippingPlanes
  28276. * }
  28277. * });
  28278. * viewer.zoomTo(entity);
  28279. * @param [options] - Object with the following properties:
  28280. * @param [options.planes = []] - An array of {@link ClippingPlane} objects used to selectively disable rendering on the outside of each plane.
  28281. * @param [options.enabled = true] - Determines whether the clipping planes are active.
  28282. * @param [options.modelMatrix = Matrix4.IDENTITY] - The 4x4 transformation matrix specifying an additional transform relative to the clipping planes original coordinate system.
  28283. * @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.
  28284. * @param [options.edgeColor = Color.WHITE] - The color applied to highlight the edge along which an object is clipped.
  28285. * @param [options.edgeWidth = 0.0] - The width, in pixels, of the highlight applied to the edge along which an object is clipped.
  28286. */
  28287. export class ClippingPlaneCollection {
  28288. constructor(options?: {
  28289. planes?: ClippingPlane[];
  28290. enabled?: boolean;
  28291. modelMatrix?: Matrix4;
  28292. unionClippingRegions?: boolean;
  28293. edgeColor?: Color;
  28294. edgeWidth?: number;
  28295. });
  28296. /**
  28297. * The 4x4 transformation matrix specifying an additional transform relative to the clipping planes
  28298. * original coordinate system.
  28299. */
  28300. modelMatrix: Matrix4;
  28301. /**
  28302. * The color applied to highlight the edge along which an object is clipped.
  28303. */
  28304. edgeColor: Color;
  28305. /**
  28306. * The width, in pixels, of the highlight applied to the edge along which an object is clipped.
  28307. */
  28308. edgeWidth: number;
  28309. /**
  28310. * An event triggered when a new clipping plane is added to the collection. Event handlers
  28311. * are passed the new plane and the index at which it was added.
  28312. */
  28313. planeAdded: Event;
  28314. /**
  28315. * An event triggered when a new clipping plane is removed from the collection. Event handlers
  28316. * are passed the new plane and the index from which it was removed.
  28317. */
  28318. planeRemoved: Event;
  28319. /**
  28320. * Returns the number of planes in this collection. This is commonly used with
  28321. * {@link ClippingPlaneCollection#get} to iterate over all the planes
  28322. * in the collection.
  28323. */
  28324. readonly length: number;
  28325. /**
  28326. * If true, a region will be clipped if it is on the outside of any plane in the
  28327. * collection. Otherwise, a region will only be clipped if it is on the
  28328. * outside of every plane.
  28329. */
  28330. unionClippingRegions: boolean;
  28331. /**
  28332. * If true, clipping will be enabled.
  28333. */
  28334. enabled: boolean;
  28335. /**
  28336. * Adds the specified {@link ClippingPlane} to the collection to be used to selectively disable rendering
  28337. * on the outside of each plane. Use {@link ClippingPlaneCollection#unionClippingRegions} to modify
  28338. * how modify the clipping behavior of multiple planes.
  28339. * @param plane - The ClippingPlane to add to the collection.
  28340. */
  28341. add(plane: ClippingPlane): void;
  28342. /**
  28343. * Returns the plane in the collection at the specified index. Indices are zero-based
  28344. * and increase as planes are added. Removing a plane shifts all planes after
  28345. * it to the left, changing their indices. This function is commonly used with
  28346. * {@link ClippingPlaneCollection#length} to iterate over all the planes
  28347. * in the collection.
  28348. * @param index - The zero-based index of the plane.
  28349. * @returns The ClippingPlane at the specified index.
  28350. */
  28351. get(index: number): ClippingPlane;
  28352. /**
  28353. * Checks whether this collection contains a ClippingPlane equal to the given ClippingPlane.
  28354. * @param [clippingPlane] - The ClippingPlane to check for.
  28355. * @returns true if this collection contains the ClippingPlane, false otherwise.
  28356. */
  28357. contains(clippingPlane?: ClippingPlane): boolean;
  28358. /**
  28359. * Removes the first occurrence of the given ClippingPlane from the collection.
  28360. * @returns <code>true</code> if the plane was removed; <code>false</code> if the plane was not found in the collection.
  28361. */
  28362. remove(clippingPlane: ClippingPlane): boolean;
  28363. /**
  28364. * Removes all planes from the collection.
  28365. */
  28366. removeAll(): void;
  28367. /**
  28368. * Called when {@link Viewer} or {@link CesiumWidget} render the scene to
  28369. * build the resources for clipping planes.
  28370. * <p>
  28371. * Do not call this function directly.
  28372. * </p>
  28373. */
  28374. update(): void;
  28375. /**
  28376. * Returns true if this object was destroyed; otherwise, false.
  28377. * <br /><br />
  28378. * If this object was destroyed, it should not be used; calling any function other than
  28379. * <code>isDestroyed</code> will result in a {@link DeveloperError} exception.
  28380. * @returns <code>true</code> if this object was destroyed; otherwise, <code>false</code>.
  28381. */
  28382. isDestroyed(): boolean;
  28383. /**
  28384. * Destroys the WebGL resources held by this object. Destroying an object allows for deterministic
  28385. * release of WebGL resources, instead of relying on the garbage collector to destroy this object.
  28386. * <br /><br />
  28387. * Once an object is destroyed, it should not be used; calling any function other than
  28388. * <code>isDestroyed</code> will result in a {@link DeveloperError} exception. Therefore,
  28389. * assign the return value (<code>undefined</code>) to the object as done in the example.
  28390. * @example
  28391. * clippingPlanes = clippingPlanes && clippingPlanes .destroy();
  28392. */
  28393. destroy(): void;
  28394. }
  28395. /**
  28396. * Defines different modes for blending between a target color and a primitive's source color.
  28397. *
  28398. * HIGHLIGHT multiplies the source color by the target color
  28399. * REPLACE replaces the source color with the target color
  28400. * MIX blends the source color and target color together
  28401. */
  28402. export enum ColorBlendMode {
  28403. HIGHLIGHT = 0,
  28404. REPLACE = 1,
  28405. MIX = 2
  28406. }
  28407. /**
  28408. * An expression for a style applied to a {@link Cesium3DTileset}.
  28409. * <p>
  28410. * Evaluates a conditions expression defined using the
  28411. * {@link https://github.com/CesiumGS/3d-tiles/tree/master/specification/Styling|3D Tiles Styling language}.
  28412. * </p>
  28413. * <p>
  28414. * Implements the {@link StyleExpression} interface.
  28415. * </p>
  28416. * @example
  28417. * var expression = new Cesium.ConditionsExpression({
  28418. * conditions : [
  28419. * ['${Area} > 10, 'color("#FF0000")'],
  28420. * ['${id} !== "1"', 'color("#00FF00")'],
  28421. * ['true', 'color("#FFFFFF")']
  28422. * ]
  28423. * });
  28424. * expression.evaluateColor(feature, result); // returns a Cesium.Color object
  28425. * @param [conditionsExpression] - The conditions expression defined using the 3D Tiles Styling language.
  28426. * @param [defines] - Defines in the style.
  28427. */
  28428. export class ConditionsExpression {
  28429. constructor(conditionsExpression?: any, defines?: any);
  28430. /**
  28431. * Gets the conditions expression defined in the 3D Tiles Styling language.
  28432. */
  28433. readonly conditionsExpression: any;
  28434. /**
  28435. * Evaluates the result of an expression, optionally using the provided feature's properties. If the result of
  28436. * the expression in the
  28437. * {@link https://github.com/CesiumGS/3d-tiles/tree/master/specification/Styling|3D Tiles Styling language}
  28438. * is of type <code>Boolean</code>, <code>Number</code>, or <code>String</code>, the corresponding JavaScript
  28439. * primitive type will be returned. If the result is a <code>RegExp</code>, a Javascript <code>RegExp</code>
  28440. * object will be returned. If the result is a <code>Cartesian2</code>, <code>Cartesian3</code>, or <code>Cartesian4</code>,
  28441. * a {@link Cartesian2}, {@link Cartesian3}, or {@link Cartesian4} object will be returned. If the <code>result</code> argument is
  28442. * a {@link Color}, the {@link Cartesian4} value is converted to a {@link Color} and then returned.
  28443. * @param feature - The feature whose properties may be used as variables in the expression.
  28444. * @param [result] - The object onto which to store the result.
  28445. * @returns The result of evaluating the expression.
  28446. */
  28447. evaluate(feature: Cesium3DTileFeature, result?: any): boolean | number | string | RegExp | Cartesian2 | Cartesian3 | Cartesian4 | Color;
  28448. /**
  28449. * Evaluates the result of a Color expression, using the values defined by a feature.
  28450. * <p>
  28451. * This is equivalent to {@link ConditionsExpression#evaluate} but always returns a {@link Color} object.
  28452. * </p>
  28453. * @param feature - The feature whose properties may be used as variables in the expression.
  28454. * @param [result] - The object in which to store the result
  28455. * @returns The modified result parameter or a new Color instance if one was not provided.
  28456. */
  28457. evaluateColor(feature: Cesium3DTileFeature, result?: Color): Color;
  28458. }
  28459. /**
  28460. * A ParticleEmitter that emits particles within a cone.
  28461. * Particles will be positioned at the tip of the cone and have initial velocities going towards the base.
  28462. * @param [angle = Cesium.Math.toRadians(30.0)] - The angle of the cone in radians.
  28463. */
  28464. export class ConeEmitter {
  28465. constructor(angle?: number);
  28466. }
  28467. /**
  28468. * The credit display is responsible for displaying credits on screen.
  28469. * @example
  28470. * var creditDisplay = new Cesium.CreditDisplay(creditContainer);
  28471. * @param container - The HTML element where credits will be displayed
  28472. * @param [delimiter = ' • '] - The string to separate text credits
  28473. * @param [viewport = document.body] - The HTML element that will contain the credits popup
  28474. */
  28475. export class CreditDisplay {
  28476. constructor(container: HTMLElement, delimiter?: string, viewport?: HTMLElement);
  28477. /**
  28478. * The HTML element where credits will be displayed.
  28479. */
  28480. container: HTMLElement;
  28481. /**
  28482. * Adds a credit to the list of current credits to be displayed in the credit container
  28483. * @param credit - The credit to display
  28484. */
  28485. addCredit(credit: Credit): void;
  28486. /**
  28487. * Adds credits that will persist until they are removed
  28488. * @param credit - The credit to added to defaults
  28489. */
  28490. addDefaultCredit(credit: Credit): void;
  28491. /**
  28492. * Removes a default credit
  28493. * @param credit - The credit to be removed from defaults
  28494. */
  28495. removeDefaultCredit(credit: Credit): void;
  28496. /**
  28497. * Updates the credit display before a new frame is rendered.
  28498. */
  28499. update(): void;
  28500. /**
  28501. * Resets the credit display to a beginning of frame state, clearing out current credits.
  28502. */
  28503. beginFrame(): void;
  28504. /**
  28505. * Sets the credit display to the end of frame state, displaying credits from the last frame in the credit container.
  28506. */
  28507. endFrame(): void;
  28508. /**
  28509. * Destroys the resources held by this object. Destroying an object allows for deterministic
  28510. * release of resources, instead of relying on the garbage collector to destroy this object.
  28511. * <br /><br />
  28512. * Once an object is destroyed, it should not be used; calling any function other than
  28513. * <code>isDestroyed</code> will result in a {@link DeveloperError} exception. Therefore,
  28514. * assign the return value (<code>undefined</code>) to the object as done in the example.
  28515. */
  28516. destroy(): void;
  28517. /**
  28518. * Returns true if this object was destroyed; otherwise, false.
  28519. * <br /><br />
  28520. * @returns <code>true</code> if this object was destroyed; otherwise, <code>false</code>.
  28521. */
  28522. isDestroyed(): boolean;
  28523. /**
  28524. * Gets or sets the Cesium logo credit.
  28525. */
  28526. static cesiumCredit: Credit;
  28527. }
  28528. /**
  28529. * Determines which triangles, if any, are culled.
  28530. */
  28531. export enum CullFace {
  28532. /**
  28533. * Front-facing triangles are culled.
  28534. */
  28535. FRONT = WebGLConstants.FRONT,
  28536. /**
  28537. * Back-facing triangles are culled.
  28538. */
  28539. BACK = WebGLConstants.BACK,
  28540. /**
  28541. * Both front-facing and back-facing triangles are culled.
  28542. */
  28543. FRONT_AND_BACK = WebGLConstants.FRONT_AND_BACK
  28544. }
  28545. /**
  28546. * Visualizes a vertex attribute by displaying it as a color for debugging.
  28547. * <p>
  28548. * Components for well-known unit-length vectors, i.e., <code>normal</code>,
  28549. * <code>tangent</code>, and <code>bitangent</code>, are scaled and biased
  28550. * from [-1.0, 1.0] to (-1.0, 1.0).
  28551. * </p>
  28552. * @example
  28553. * var primitive = new Cesium.Primitive({
  28554. * geometryInstances : // ...
  28555. * appearance : new Cesium.DebugAppearance({
  28556. * attributeName : 'normal'
  28557. * })
  28558. * });
  28559. * @param options - Object with the following properties:
  28560. * @param options.attributeName - The name of the attribute to visualize.
  28561. * @param [options.perInstanceAttribute = false] - Boolean that determines whether this attribute is a per-instance geometry attribute.
  28562. * @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>.
  28563. * @param [options.vertexShaderSource] - Optional GLSL vertex shader source to override the default vertex shader.
  28564. * @param [options.fragmentShaderSource] - Optional GLSL fragment shader source to override the default fragment shader.
  28565. * @param [options.renderState] - Optional render state to override the default render state.
  28566. */
  28567. export class DebugAppearance {
  28568. constructor(options: {
  28569. attributeName: string;
  28570. perInstanceAttribute?: boolean;
  28571. glslDatatype?: string;
  28572. vertexShaderSource?: string;
  28573. fragmentShaderSource?: string;
  28574. renderState?: any;
  28575. });
  28576. /**
  28577. * This property is part of the {@link Appearance} interface, but is not
  28578. * used by {@link DebugAppearance} since a fully custom fragment shader is used.
  28579. */
  28580. material: Material;
  28581. /**
  28582. * When <code>true</code>, the geometry is expected to appear translucent.
  28583. */
  28584. translucent: boolean;
  28585. /**
  28586. * The GLSL source code for the vertex shader.
  28587. */
  28588. readonly vertexShaderSource: string;
  28589. /**
  28590. * The GLSL source code for the fragment shader. The full fragment shader
  28591. * source is built procedurally taking into account the {@link DebugAppearance#material}.
  28592. * Use {@link DebugAppearance#getFragmentShaderSource} to get the full source.
  28593. */
  28594. readonly fragmentShaderSource: string;
  28595. /**
  28596. * The WebGL fixed-function state to use when rendering the geometry.
  28597. */
  28598. readonly renderState: any;
  28599. /**
  28600. * When <code>true</code>, the geometry is expected to be closed.
  28601. */
  28602. readonly closed: boolean;
  28603. /**
  28604. * The name of the attribute being visualized.
  28605. */
  28606. readonly attributeName: string;
  28607. /**
  28608. * The GLSL datatype of the attribute being visualized.
  28609. */
  28610. readonly glslDatatype: string;
  28611. /**
  28612. * Returns the full GLSL fragment shader source, which for {@link DebugAppearance} is just
  28613. * {@link DebugAppearance#fragmentShaderSource}.
  28614. * @returns The full GLSL fragment shader source.
  28615. */
  28616. getFragmentShaderSource(): string;
  28617. /**
  28618. * Determines if the geometry is translucent based on {@link DebugAppearance#translucent}.
  28619. * @returns <code>true</code> if the appearance is translucent.
  28620. */
  28621. isTranslucent(): boolean;
  28622. /**
  28623. * Creates a render state. This is not the final render state instance; instead,
  28624. * it can contain a subset of render state properties identical to the render state
  28625. * created in the context.
  28626. * @returns The render state.
  28627. */
  28628. getRenderState(): any;
  28629. }
  28630. /**
  28631. * Draws the outline of the camera's view frustum.
  28632. * @example
  28633. * primitives.add(new Cesium.DebugCameraPrimitive({
  28634. * camera : camera,
  28635. * color : Cesium.Color.YELLOW
  28636. * }));
  28637. * @param options - Object with the following properties:
  28638. * @param options.camera - The camera.
  28639. * @param [options.frustumSplits] - Distances to the near and far planes of the camera frustums. This overrides the camera's frustum near and far values.
  28640. * @param [options.color = Color.CYAN] - The color of the debug outline.
  28641. * @param [options.updateOnChange = true] - Whether the primitive updates when the underlying camera changes.
  28642. * @param [options.show = true] - Determines if this primitive will be shown.
  28643. * @param [options.id] - A user-defined object to return when the instance is picked with {@link Scene#pick}.
  28644. */
  28645. export class DebugCameraPrimitive {
  28646. constructor(options: {
  28647. camera: Camera;
  28648. frustumSplits?: number[];
  28649. color?: Color;
  28650. updateOnChange?: boolean;
  28651. show?: boolean;
  28652. id?: any;
  28653. });
  28654. /**
  28655. * Determines if this primitive will be shown.
  28656. */
  28657. show: boolean;
  28658. /**
  28659. * User-defined value returned when the primitive is picked.
  28660. */
  28661. id: any;
  28662. /**
  28663. * Returns true if this object was destroyed; otherwise, false.
  28664. * <p>
  28665. * If this object was destroyed, it should not be used; calling any function other than
  28666. * <code>isDestroyed</code> will result in a {@link DeveloperError} exception.
  28667. * </p>
  28668. * @returns <code>true</code> if this object was destroyed; otherwise, <code>false</code>.
  28669. */
  28670. isDestroyed(): boolean;
  28671. /**
  28672. * Destroys the WebGL resources held by this object. Destroying an object allows for deterministic
  28673. * release of WebGL resources, instead of relying on the garbage collector to destroy this object.
  28674. * <p>
  28675. * Once an object is destroyed, it should not be used; calling any function other than
  28676. * <code>isDestroyed</code> will result in a {@link DeveloperError} exception. Therefore,
  28677. * assign the return value (<code>undefined</code>) to the object as done in the example.
  28678. * </p>
  28679. * @example
  28680. * p = p && p.destroy();
  28681. */
  28682. destroy(): void;
  28683. }
  28684. /**
  28685. * Draws the axes of a reference frame defined by a matrix that transforms to world
  28686. * coordinates, i.e., Earth's WGS84 coordinates. The most prominent example is
  28687. * a primitives <code>modelMatrix</code>.
  28688. * <p>
  28689. * The X axis is red; Y is green; and Z is blue.
  28690. * </p>
  28691. * <p>
  28692. * This is for debugging only; it is not optimized for production use.
  28693. * </p>
  28694. * @example
  28695. * primitives.add(new Cesium.DebugModelMatrixPrimitive({
  28696. * modelMatrix : primitive.modelMatrix, // primitive to debug
  28697. * length : 100000.0,
  28698. * width : 10.0
  28699. * }));
  28700. * @param [options] - Object with the following properties:
  28701. * @param [options.length = 10000000.0] - The length of the axes in meters.
  28702. * @param [options.width = 2.0] - The width of the axes in pixels.
  28703. * @param [options.modelMatrix = Matrix4.IDENTITY] - The 4x4 matrix that defines the reference frame, i.e., origin plus axes, to visualize.
  28704. * @param [options.show = true] - Determines if this primitive will be shown.
  28705. * @param [options.id] - A user-defined object to return when the instance is picked with {@link Scene#pick}
  28706. */
  28707. export class DebugModelMatrixPrimitive {
  28708. constructor(options?: {
  28709. length?: number;
  28710. width?: number;
  28711. modelMatrix?: Matrix4;
  28712. show?: boolean;
  28713. id?: any;
  28714. });
  28715. /**
  28716. * The length of the axes in meters.
  28717. */
  28718. length: number;
  28719. /**
  28720. * The width of the axes in pixels.
  28721. */
  28722. width: number;
  28723. /**
  28724. * Determines if this primitive will be shown.
  28725. */
  28726. show: boolean;
  28727. /**
  28728. * The 4x4 matrix that defines the reference frame, i.e., origin plus axes, to visualize.
  28729. */
  28730. modelMatrix: Matrix4;
  28731. /**
  28732. * User-defined value returned when the primitive is picked.
  28733. */
  28734. id: any;
  28735. /**
  28736. * Returns true if this object was destroyed; otherwise, false.
  28737. * <p>
  28738. * If this object was destroyed, it should not be used; calling any function other than
  28739. * <code>isDestroyed</code> will result in a {@link DeveloperError} exception.
  28740. * </p>
  28741. * @returns <code>true</code> if this object was destroyed; otherwise, <code>false</code>.
  28742. */
  28743. isDestroyed(): boolean;
  28744. /**
  28745. * Destroys the WebGL resources held by this object. Destroying an object allows for deterministic
  28746. * release of WebGL resources, instead of relying on the garbage collector to destroy this object.
  28747. * <p>
  28748. * Once an object is destroyed, it should not be used; calling any function other than
  28749. * <code>isDestroyed</code> will result in a {@link DeveloperError} exception. Therefore,
  28750. * assign the return value (<code>undefined</code>) to the object as done in the example.
  28751. * </p>
  28752. * @example
  28753. * p = p && p.destroy();
  28754. */
  28755. destroy(): void;
  28756. }
  28757. /**
  28758. * Determines the function used to compare two depths for the depth test.
  28759. */
  28760. export enum DepthFunction {
  28761. /**
  28762. * The depth test never passes.
  28763. */
  28764. NEVER = WebGLConstants.NEVER,
  28765. /**
  28766. * The depth test passes if the incoming depth is less than the stored depth.
  28767. */
  28768. LESS = WebGLConstants.LESS,
  28769. /**
  28770. * The depth test passes if the incoming depth is equal to the stored depth.
  28771. */
  28772. EQUAL = WebGLConstants.EQUAL,
  28773. /**
  28774. * The depth test passes if the incoming depth is less than or equal to the stored depth.
  28775. */
  28776. LESS_OR_EQUAL = WebGLConstants.LEQUAL,
  28777. /**
  28778. * The depth test passes if the incoming depth is greater than the stored depth.
  28779. */
  28780. GREATER = WebGLConstants.GREATER,
  28781. /**
  28782. * The depth test passes if the incoming depth is not equal to the stored depth.
  28783. */
  28784. NOT_EQUAL = WebGLConstants.NOTEQUAL,
  28785. /**
  28786. * The depth test passes if the incoming depth is greater than or equal to the stored depth.
  28787. */
  28788. GREATER_OR_EQUAL = WebGLConstants.GEQUAL,
  28789. /**
  28790. * The depth test always passes.
  28791. */
  28792. ALWAYS = WebGLConstants.ALWAYS
  28793. }
  28794. /**
  28795. * A light that gets emitted in a single direction from infinitely far away.
  28796. * @param options - Object with the following properties:
  28797. * @param options.direction - The direction in which light gets emitted.
  28798. * @param [options.color = Color.WHITE] - The color of the light.
  28799. * @param [options.intensity = 1.0] - The intensity of the light.
  28800. */
  28801. export class DirectionalLight {
  28802. constructor(options: {
  28803. direction: Cartesian3;
  28804. color?: Color;
  28805. intensity?: number;
  28806. });
  28807. /**
  28808. * The direction in which light gets emitted.
  28809. */
  28810. direction: Cartesian3;
  28811. /**
  28812. * The color of the light.
  28813. */
  28814. color: Color;
  28815. /**
  28816. * The intensity of the light.
  28817. */
  28818. intensity: number;
  28819. }
  28820. /**
  28821. * A policy for discarding tile images that contain no data (and so aren't actually images).
  28822. * This policy discards {@link DiscardEmptyTileImagePolicy.EMPTY_IMAGE}, which is
  28823. * expected to be used in place of any empty tile images by the image loading code.
  28824. */
  28825. export class DiscardEmptyTileImagePolicy {
  28826. constructor();
  28827. /**
  28828. * Determines if the discard policy is ready to process images.
  28829. * @returns True if the discard policy is ready to process images; otherwise, false.
  28830. */
  28831. isReady(): boolean;
  28832. /**
  28833. * Given a tile image, decide whether to discard that image.
  28834. * @param image - An image to test.
  28835. * @returns True if the image should be discarded; otherwise, false.
  28836. */
  28837. shouldDiscardImage(image: HTMLImageElement): boolean;
  28838. /**
  28839. * Default value for representing an empty image.
  28840. */
  28841. static readonly EMPTY_IMAGE: HTMLImageElement;
  28842. }
  28843. /**
  28844. * A policy for discarding tile images that match a known image containing a
  28845. * "missing" image.
  28846. * @param options - Object with the following properties:
  28847. * @param options.missingImageUrl - The URL of the known missing image.
  28848. * @param options.pixelsToCheck - An array of {@link Cartesian2} pixel positions to
  28849. * compare against the missing image.
  28850. * @param [options.disableCheckIfAllPixelsAreTransparent = false] - If true, the discard check will be disabled
  28851. * if all of the pixelsToCheck in the missingImageUrl have an alpha value of 0. If false, the
  28852. * discard check will proceed no matter the values of the pixelsToCheck.
  28853. */
  28854. export class DiscardMissingTileImagePolicy {
  28855. constructor(options: {
  28856. missingImageUrl: Resource | string;
  28857. pixelsToCheck: Cartesian2[];
  28858. disableCheckIfAllPixelsAreTransparent?: boolean;
  28859. });
  28860. /**
  28861. * Determines if the discard policy is ready to process images.
  28862. * @returns True if the discard policy is ready to process images; otherwise, false.
  28863. */
  28864. isReady(): boolean;
  28865. /**
  28866. * Given a tile image, decide whether to discard that image.
  28867. * @param image - An image to test.
  28868. * @returns True if the image should be discarded; otherwise, false.
  28869. */
  28870. shouldDiscardImage(image: HTMLImageElement): boolean;
  28871. }
  28872. /**
  28873. * An appearance for geometry on the surface of the ellipsoid like {@link PolygonGeometry}
  28874. * and {@link RectangleGeometry}, which supports all materials like {@link MaterialAppearance}
  28875. * with {@link MaterialAppearance.MaterialSupport.ALL}. However, this appearance requires
  28876. * fewer vertex attributes since the fragment shader can procedurally compute <code>normal</code>,
  28877. * <code>tangent</code>, and <code>bitangent</code>.
  28878. * @example
  28879. * var primitive = new Cesium.Primitive({
  28880. * geometryInstances : new Cesium.GeometryInstance({
  28881. * geometry : new Cesium.PolygonGeometry({
  28882. * vertexFormat : Cesium.EllipsoidSurfaceAppearance.VERTEX_FORMAT,
  28883. * // ...
  28884. * })
  28885. * }),
  28886. * appearance : new Cesium.EllipsoidSurfaceAppearance({
  28887. * material : Cesium.Material.fromType('Stripe')
  28888. * })
  28889. * });
  28890. * @param [options] - Object with the following properties:
  28891. * @param [options.flat = false] - When <code>true</code>, flat shading is used in the fragment shader, which means lighting is not taking into account.
  28892. * @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}.
  28893. * @param [options.translucent = true] - When <code>true</code>, the geometry is expected to appear translucent so {@link EllipsoidSurfaceAppearance#renderState} has alpha blending enabled.
  28894. * @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.
  28895. * @param [options.material = Material.ColorType] - The material used to determine the fragment color.
  28896. * @param [options.vertexShaderSource] - Optional GLSL vertex shader source to override the default vertex shader.
  28897. * @param [options.fragmentShaderSource] - Optional GLSL fragment shader source to override the default fragment shader.
  28898. * @param [options.renderState] - Optional render state to override the default render state.
  28899. */
  28900. export class EllipsoidSurfaceAppearance {
  28901. constructor(options?: {
  28902. flat?: boolean;
  28903. faceForward?: boolean;
  28904. translucent?: boolean;
  28905. aboveGround?: boolean;
  28906. material?: Material;
  28907. vertexShaderSource?: string;
  28908. fragmentShaderSource?: string;
  28909. renderState?: any;
  28910. });
  28911. /**
  28912. * The material used to determine the fragment color. Unlike other {@link EllipsoidSurfaceAppearance}
  28913. * properties, this is not read-only, so an appearance's material can change on the fly.
  28914. */
  28915. material: Material;
  28916. /**
  28917. * When <code>true</code>, the geometry is expected to appear translucent.
  28918. */
  28919. translucent: boolean;
  28920. /**
  28921. * The GLSL source code for the vertex shader.
  28922. */
  28923. readonly vertexShaderSource: string;
  28924. /**
  28925. * The GLSL source code for the fragment shader. The full fragment shader
  28926. * source is built procedurally taking into account {@link EllipsoidSurfaceAppearance#material},
  28927. * {@link EllipsoidSurfaceAppearance#flat}, and {@link EllipsoidSurfaceAppearance#faceForward}.
  28928. * Use {@link EllipsoidSurfaceAppearance#getFragmentShaderSource} to get the full source.
  28929. */
  28930. readonly fragmentShaderSource: string;
  28931. /**
  28932. * The WebGL fixed-function state to use when rendering the geometry.
  28933. * <p>
  28934. * The render state can be explicitly defined when constructing a {@link EllipsoidSurfaceAppearance}
  28935. * instance, or it is set implicitly via {@link EllipsoidSurfaceAppearance#translucent}
  28936. * and {@link EllipsoidSurfaceAppearance#aboveGround}.
  28937. * </p>
  28938. */
  28939. readonly renderState: any;
  28940. /**
  28941. * When <code>true</code>, the geometry is expected to be closed so
  28942. * {@link EllipsoidSurfaceAppearance#renderState} has backface culling enabled.
  28943. * If the viewer enters the geometry, it will not be visible.
  28944. */
  28945. readonly closed: boolean;
  28946. /**
  28947. * The {@link VertexFormat} that this appearance instance is compatible with.
  28948. * A geometry can have more vertex attributes and still be compatible - at a
  28949. * potential performance cost - but it can't have less.
  28950. */
  28951. readonly vertexFormat: VertexFormat;
  28952. /**
  28953. * When <code>true</code>, flat shading is used in the fragment shader,
  28954. * which means lighting is not taking into account.
  28955. */
  28956. readonly flat: boolean;
  28957. /**
  28958. * When <code>true</code>, the fragment shader flips the surface normal
  28959. * as needed to ensure that the normal faces the viewer to avoid
  28960. * dark spots. This is useful when both sides of a geometry should be
  28961. * shaded like {@link WallGeometry}.
  28962. */
  28963. readonly faceForward: boolean;
  28964. /**
  28965. * When <code>true</code>, the geometry is expected to be on the ellipsoid's
  28966. * surface - not at a constant height above it - so {@link EllipsoidSurfaceAppearance#renderState}
  28967. * has backface culling enabled.
  28968. */
  28969. readonly aboveGround: boolean;
  28970. /**
  28971. * The {@link VertexFormat} that all {@link EllipsoidSurfaceAppearance} instances
  28972. * are compatible with, which requires only <code>position</code> and <code>st</code>
  28973. * attributes. Other attributes are procedurally computed in the fragment shader.
  28974. */
  28975. static readonly VERTEX_FORMAT: VertexFormat;
  28976. /**
  28977. * Procedurally creates the full GLSL fragment shader source. For {@link EllipsoidSurfaceAppearance},
  28978. * this is derived from {@link EllipsoidSurfaceAppearance#fragmentShaderSource}, {@link EllipsoidSurfaceAppearance#flat},
  28979. * and {@link EllipsoidSurfaceAppearance#faceForward}.
  28980. * @returns The full GLSL fragment shader source.
  28981. */
  28982. getFragmentShaderSource(): string;
  28983. /**
  28984. * Determines if the geometry is translucent based on {@link EllipsoidSurfaceAppearance#translucent} and {@link Material#isTranslucent}.
  28985. * @returns <code>true</code> if the appearance is translucent.
  28986. */
  28987. isTranslucent(): boolean;
  28988. /**
  28989. * Creates a render state. This is not the final render state instance; instead,
  28990. * it can contain a subset of render state properties identical to the render state
  28991. * created in the context.
  28992. * @returns The render state.
  28993. */
  28994. getRenderState(): any;
  28995. }
  28996. /**
  28997. * An expression for a style applied to a {@link Cesium3DTileset}.
  28998. * <p>
  28999. * Evaluates an expression defined using the
  29000. * {@link https://github.com/CesiumGS/3d-tiles/tree/master/specification/Styling|3D Tiles Styling language}.
  29001. * </p>
  29002. * <p>
  29003. * Implements the {@link StyleExpression} interface.
  29004. * </p>
  29005. * @example
  29006. * var expression = new Cesium.Expression('(regExp("^Chest").test(${County})) && (${YearBuilt} >= 1970)');
  29007. * expression.evaluate(feature); // returns true or false depending on the feature's properties
  29008. * @example
  29009. * var expression = new Cesium.Expression('(${Temperature} > 90) ? color("red") : color("white")');
  29010. * expression.evaluateColor(feature, result); // returns a Cesium.Color object
  29011. * @param [expression] - The expression defined using the 3D Tiles Styling language.
  29012. * @param [defines] - Defines in the style.
  29013. */
  29014. export class Expression {
  29015. constructor(expression?: string, defines?: any);
  29016. /**
  29017. * Gets the expression defined in the 3D Tiles Styling language.
  29018. */
  29019. readonly expression: string;
  29020. /**
  29021. * Evaluates the result of an expression, optionally using the provided feature's properties. If the result of
  29022. * the expression in the
  29023. * {@link https://github.com/CesiumGS/3d-tiles/tree/master/specification/Styling|3D Tiles Styling language}
  29024. * is of type <code>Boolean</code>, <code>Number</code>, or <code>String</code>, the corresponding JavaScript
  29025. * primitive type will be returned. If the result is a <code>RegExp</code>, a Javascript <code>RegExp</code>
  29026. * object will be returned. If the result is a <code>Cartesian2</code>, <code>Cartesian3</code>, or <code>Cartesian4</code>,
  29027. * a {@link Cartesian2}, {@link Cartesian3}, or {@link Cartesian4} object will be returned. If the <code>result</code> argument is
  29028. * a {@link Color}, the {@link Cartesian4} value is converted to a {@link Color} and then returned.
  29029. * @param feature - The feature whose properties may be used as variables in the expression.
  29030. * @param [result] - The object onto which to store the result.
  29031. * @returns The result of evaluating the expression.
  29032. */
  29033. evaluate(feature: Cesium3DTileFeature, result?: any): boolean | number | string | RegExp | Cartesian2 | Cartesian3 | Cartesian4 | Color;
  29034. /**
  29035. * Evaluates the result of a Color expression, optionally using the provided feature's properties.
  29036. * <p>
  29037. * This is equivalent to {@link Expression#evaluate} but always returns a {@link Color} object.
  29038. * </p>
  29039. * @param feature - The feature whose properties may be used as variables in the expression.
  29040. * @param [result] - The object in which to store the result
  29041. * @returns The modified result parameter or a new Color instance if one was not provided.
  29042. */
  29043. evaluateColor(feature: Cesium3DTileFeature, result?: Color): Color;
  29044. }
  29045. /**
  29046. * Blends the atmosphere to geometry far from the camera for horizon views. Allows for additional
  29047. * performance improvements by rendering less geometry and dispatching less terrain requests.
  29048. */
  29049. export class Fog {
  29050. constructor();
  29051. /**
  29052. * <code>true</code> if fog is enabled, <code>false</code> otherwise.
  29053. */
  29054. enabled: boolean;
  29055. /**
  29056. * A scalar that determines the density of the fog. Terrain that is in full fog are culled.
  29057. * The density of the fog increases as this number approaches 1.0 and becomes less dense as it approaches zero.
  29058. * The more dense the fog is, the more aggressively the terrain is culled. For example, if the camera is a height of
  29059. * 1000.0m above the ellipsoid, increasing the value to 3.0e-3 will cause many tiles close to the viewer be culled.
  29060. * Decreasing the value will push the fog further from the viewer, but decrease performance as more of the terrain is rendered.
  29061. */
  29062. density: number;
  29063. /**
  29064. * A factor used to increase the screen space error of terrain tiles when they are partially in fog. The effect is to reduce
  29065. * the number of terrain tiles requested for rendering. If set to zero, the feature will be disabled. If the value is increased
  29066. * for mountainous regions, less tiles will need to be requested, but the terrain meshes near the horizon may be a noticeably
  29067. * lower resolution. If the value is increased in a relatively flat area, there will be little noticeable change on the horizon.
  29068. */
  29069. screenSpaceErrorFactor: number;
  29070. /**
  29071. * 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
  29072. * the brightness at all.
  29073. */
  29074. minimumBrightness: number;
  29075. }
  29076. /**
  29077. * Monitors the frame rate (frames per second) in a {@link Scene} and raises an event if the frame rate is
  29078. * lower than a threshold. Later, if the frame rate returns to the required level, a separate event is raised.
  29079. * To avoid creating multiple FrameRateMonitors for a single {@link Scene}, use {@link FrameRateMonitor.fromScene}
  29080. * instead of constructing an instance explicitly.
  29081. * @param [options] - Object with the following properties:
  29082. * @param options.scene - The Scene instance for which to monitor performance.
  29083. * @param [options.samplingWindow = 5.0] - The length of the sliding window over which to compute the average frame rate, in seconds.
  29084. * @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
  29085. * switches back to the tab) before starting to measure performance, in seconds.
  29086. * @param [options.warmupPeriod = 5.0] - The length of the warmup period, in seconds. During the warmup period, a separate
  29087. * (usually lower) frame rate is required.
  29088. * @param [options.minimumFrameRateDuringWarmup = 4] - The minimum frames-per-second that are required for acceptable performance during
  29089. * the warmup period. If the frame rate averages less than this during any samplingWindow during the warmupPeriod, the
  29090. * lowFrameRate event will be raised and the page will redirect to the redirectOnLowFrameRateUrl, if any.
  29091. * @param [options.minimumFrameRateAfterWarmup = 8] - The minimum frames-per-second that are required for acceptable performance after
  29092. * the end of the warmup period. If the frame rate averages less than this during any samplingWindow after the warmupPeriod, the
  29093. * lowFrameRate event will be raised and the page will redirect to the redirectOnLowFrameRateUrl, if any.
  29094. */
  29095. export class FrameRateMonitor {
  29096. constructor(options?: {
  29097. scene: Scene;
  29098. samplingWindow?: number;
  29099. quietPeriod?: number;
  29100. warmupPeriod?: number;
  29101. minimumFrameRateDuringWarmup?: number;
  29102. minimumFrameRateAfterWarmup?: number;
  29103. });
  29104. /**
  29105. * Gets or sets the length of the sliding window over which to compute the average frame rate, in seconds.
  29106. */
  29107. samplingWindow: number;
  29108. /**
  29109. * Gets or sets the length of time to wait at startup and each time the page becomes visible (i.e. when the user
  29110. * switches back to the tab) before starting to measure performance, in seconds.
  29111. */
  29112. quietPeriod: number;
  29113. /**
  29114. * Gets or sets the length of the warmup period, in seconds. During the warmup period, a separate
  29115. * (usually lower) frame rate is required.
  29116. */
  29117. warmupPeriod: number;
  29118. /**
  29119. * Gets or sets the minimum frames-per-second that are required for acceptable performance during
  29120. * the warmup period. If the frame rate averages less than this during any <code>samplingWindow</code> during the <code>warmupPeriod</code>, the
  29121. * <code>lowFrameRate</code> event will be raised and the page will redirect to the <code>redirectOnLowFrameRateUrl</code>, if any.
  29122. */
  29123. minimumFrameRateDuringWarmup: number;
  29124. /**
  29125. * Gets or sets the minimum frames-per-second that are required for acceptable performance after
  29126. * 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
  29127. * <code>lowFrameRate</code> event will be raised and the page will redirect to the <code>redirectOnLowFrameRateUrl</code>, if any.
  29128. */
  29129. minimumFrameRateAfterWarmup: number;
  29130. /**
  29131. * The default frame rate monitoring settings. These settings are used when {@link FrameRateMonitor.fromScene}
  29132. * needs to create a new frame rate monitor, and for any settings that are not passed to the
  29133. * {@link FrameRateMonitor} constructor.
  29134. */
  29135. static defaultSettings: any;
  29136. /**
  29137. * Gets the {@link FrameRateMonitor} for a given scene. If the scene does not yet have
  29138. * a {@link FrameRateMonitor}, one is created with the {@link FrameRateMonitor.defaultSettings}.
  29139. * @param scene - The scene for which to get the {@link FrameRateMonitor}.
  29140. * @returns The scene's {@link FrameRateMonitor}.
  29141. */
  29142. static fromScene(scene: Scene): FrameRateMonitor;
  29143. /**
  29144. * Gets the {@link Scene} instance for which to monitor performance.
  29145. */
  29146. scene: Scene;
  29147. /**
  29148. * Gets the event that is raised when a low frame rate is detected. The function will be passed
  29149. * the {@link Scene} instance as its first parameter and the average number of frames per second
  29150. * over the sampling window as its second parameter.
  29151. */
  29152. lowFrameRate: Event;
  29153. /**
  29154. * Gets the event that is raised when the frame rate returns to a normal level after having been low.
  29155. * The function will be passed the {@link Scene} instance as its first parameter and the average
  29156. * number of frames per second over the sampling window as its second parameter.
  29157. */
  29158. nominalFrameRate: Event;
  29159. /**
  29160. * Gets the most recently computed average frames-per-second over the last <code>samplingWindow</code>.
  29161. * This property may be undefined if the frame rate has not been computed.
  29162. */
  29163. lastFramesPerSecond: number;
  29164. /**
  29165. * Pauses monitoring of the frame rate. To resume monitoring, {@link FrameRateMonitor#unpause}
  29166. * must be called once for each time this function is called.
  29167. */
  29168. pause(): void;
  29169. /**
  29170. * Resumes monitoring of the frame rate. If {@link FrameRateMonitor#pause} was called
  29171. * multiple times, this function must be called the same number of times in order to
  29172. * actually resume monitoring.
  29173. */
  29174. unpause(): void;
  29175. /**
  29176. * Returns true if this object was destroyed; otherwise, false.
  29177. * <br /><br />
  29178. * If this object was destroyed, it should not be used; calling any function other than
  29179. * <code>isDestroyed</code> will result in a {@link DeveloperError} exception.
  29180. * @returns True if this object was destroyed; otherwise, false.
  29181. */
  29182. isDestroyed(): boolean;
  29183. /**
  29184. * Unsubscribes this instance from all events it is listening to.
  29185. * Once an object is destroyed, it should not be used; calling any function other than
  29186. * <code>isDestroyed</code> will result in a {@link DeveloperError} exception. Therefore,
  29187. * assign the return value (<code>undefined</code>) to the object as done in the example.
  29188. */
  29189. destroy(): void;
  29190. }
  29191. /**
  29192. * Describes the format in which to request GetFeatureInfo from a Web Map Service (WMS) server.
  29193. * @param type - The type of response to expect from a GetFeatureInfo request. Valid
  29194. * values are 'json', 'xml', 'html', or 'text'.
  29195. * @param [format] - The info format to request from the WMS server. This is usually a
  29196. * MIME type such as 'application/json' or text/xml'. If this parameter is not specified, the provider will request 'json'
  29197. * using 'application/json', 'xml' using 'text/xml', 'html' using 'text/html', and 'text' using 'text/plain'.
  29198. * @param [callback] - A function to invoke with the GetFeatureInfo response from the WMS server
  29199. * in order to produce an array of picked {@link ImageryLayerFeatureInfo} instances. If this parameter is not specified,
  29200. * a default function for the type of response is used.
  29201. */
  29202. export class GetFeatureInfoFormat {
  29203. constructor(type: string, format?: string, callback?: (...params: any[]) => any);
  29204. }
  29205. /**
  29206. * The globe rendered in the scene, including its terrain ({@link Globe#terrainProvider})
  29207. * and imagery layers ({@link Globe#imageryLayers}). Access the globe using {@link Scene#globe}.
  29208. * @param [ellipsoid = Ellipsoid.WGS84] - Determines the size and shape of the
  29209. * globe.
  29210. */
  29211. export class Globe {
  29212. constructor(ellipsoid?: Ellipsoid);
  29213. /**
  29214. * Determines if the globe will be shown.
  29215. */
  29216. show: boolean;
  29217. /**
  29218. * The maximum screen-space error used to drive level-of-detail refinement. Higher
  29219. * values will provide better performance but lower visual quality.
  29220. */
  29221. maximumScreenSpaceError: number;
  29222. /**
  29223. * The size of the terrain tile cache, expressed as a number of tiles. Any additional
  29224. * tiles beyond this number will be freed, as long as they aren't needed for rendering
  29225. * this frame. A larger number will consume more memory but will show detail faster
  29226. * when, for example, zooming out and then back in.
  29227. */
  29228. tileCacheSize: number;
  29229. /**
  29230. * Gets or sets the number of loading descendant tiles that is considered "too many".
  29231. * If a tile has too many loading descendants, that tile will be loaded and rendered before any of
  29232. * its descendants are loaded and rendered. This means more feedback for the user that something
  29233. * is happening at the cost of a longer overall load time. Setting this to 0 will cause each
  29234. * tile level to be loaded successively, significantly increasing load time. Setting it to a large
  29235. * number (e.g. 1000) will minimize the number of tiles that are loaded but tend to make
  29236. * detail appear all at once after a long wait.
  29237. */
  29238. loadingDescendantLimit: number;
  29239. /**
  29240. * Gets or sets a value indicating whether the ancestors of rendered tiles should be preloaded.
  29241. * Setting this to true optimizes the zoom-out experience and provides more detail in
  29242. * newly-exposed areas when panning. The down side is that it requires loading more tiles.
  29243. */
  29244. preloadAncestors: boolean;
  29245. /**
  29246. * Gets or sets a value indicating whether the siblings of rendered tiles should be preloaded.
  29247. * Setting this to true causes tiles with the same parent as a rendered tile to be loaded, even
  29248. * if they are culled. Setting this to true may provide a better panning experience at the
  29249. * cost of loading more tiles.
  29250. */
  29251. preloadSiblings: boolean;
  29252. /**
  29253. * The color to use to highlight terrain fill tiles. If undefined, fill tiles are not
  29254. * highlighted at all. The alpha value is used to alpha blend with the tile's
  29255. * actual color. Because terrain fill tiles do not represent the actual terrain surface,
  29256. * it may be useful in some applications to indicate visually that they are not to be trusted.
  29257. */
  29258. fillHighlightColor: Color;
  29259. /**
  29260. * Enable lighting the globe with the scene's light source.
  29261. */
  29262. enableLighting: boolean;
  29263. /**
  29264. * Enable dynamic lighting effects on atmosphere and fog. This only takes effect
  29265. * when <code>enableLighting</code> is <code>true</code>.
  29266. */
  29267. dynamicAtmosphereLighting: boolean;
  29268. /**
  29269. * Whether dynamic atmosphere lighting uses the sun direction instead of the scene's
  29270. * light direction. This only takes effect when <code>enableLighting</code> and
  29271. * <code>dynamicAtmosphereLighting</code> are <code>true</code>.
  29272. */
  29273. dynamicAtmosphereLightingFromSun: boolean;
  29274. /**
  29275. * Enable the ground atmosphere, which is drawn over the globe when viewed from a distance between <code>lightingFadeInDistance</code> and <code>lightingFadeOutDistance</code>.
  29276. */
  29277. showGroundAtmosphere: boolean;
  29278. /**
  29279. * The distance where everything becomes lit. This only takes effect
  29280. * when <code>enableLighting</code> or <code>showGroundAtmosphere</code> is <code>true</code>.
  29281. */
  29282. lightingFadeOutDistance: number;
  29283. /**
  29284. * The distance where lighting resumes. This only takes effect
  29285. * when <code>enableLighting</code> or <code>showGroundAtmosphere</code> is <code>true</code>.
  29286. */
  29287. lightingFadeInDistance: number;
  29288. /**
  29289. * The distance where the darkness of night from the ground atmosphere fades out to a lit ground atmosphere.
  29290. * This only takes effect when <code>showGroundAtmosphere</code>, <code>enableLighting</code>, and
  29291. * <code>dynamicAtmosphereLighting</code> are <code>true</code>.
  29292. */
  29293. nightFadeOutDistance: number;
  29294. /**
  29295. * The distance where the darkness of night from the ground atmosphere fades in to an unlit ground atmosphere.
  29296. * This only takes effect when <code>showGroundAtmosphere</code>, <code>enableLighting</code>, and
  29297. * <code>dynamicAtmosphereLighting</code> are <code>true</code>.
  29298. */
  29299. nightFadeInDistance: number;
  29300. /**
  29301. * True if an animated wave effect should be shown in areas of the globe
  29302. * covered by water; otherwise, false. This property is ignored if the
  29303. * <code>terrainProvider</code> does not provide a water mask.
  29304. */
  29305. showWaterEffect: boolean;
  29306. /**
  29307. * True if primitives such as billboards, polylines, labels, etc. should be depth-tested
  29308. * against the terrain surface, or false if such primitives should always be drawn on top
  29309. * of terrain unless they're on the opposite side of the globe. The disadvantage of depth
  29310. * testing primitives against terrain is that slight numerical noise or terrain level-of-detail
  29311. * switched can sometimes make a primitive that should be on the surface disappear underneath it.
  29312. */
  29313. depthTestAgainstTerrain: boolean;
  29314. /**
  29315. * Determines whether the globe casts or receives shadows from light sources. Setting the globe
  29316. * to cast shadows may impact performance since the terrain is rendered again from the light's perspective.
  29317. * Currently only terrain that is in view casts shadows. By default the globe does not cast shadows.
  29318. */
  29319. shadows: ShadowMode;
  29320. /**
  29321. * The hue shift to apply to the atmosphere. Defaults to 0.0 (no shift).
  29322. * A hue shift of 1.0 indicates a complete rotation of the hues available.
  29323. */
  29324. atmosphereHueShift: number;
  29325. /**
  29326. * The saturation shift to apply to the atmosphere. Defaults to 0.0 (no shift).
  29327. * A saturation shift of -1.0 is monochrome.
  29328. */
  29329. atmosphereSaturationShift: number;
  29330. /**
  29331. * The brightness shift to apply to the atmosphere. Defaults to 0.0 (no shift).
  29332. * A brightness shift of -1.0 is complete darkness, which will let space show through.
  29333. */
  29334. atmosphereBrightnessShift: number;
  29335. /**
  29336. * Whether to show terrain skirts. Terrain skirts are geometry extending downwards from a tile's edges used to hide seams between neighboring tiles.
  29337. * Skirts are always hidden when the camera is underground or translucency is enabled.
  29338. */
  29339. showSkirts: boolean;
  29340. /**
  29341. * Whether to cull back-facing terrain. Back faces are not culled when the camera is underground or translucency is enabled.
  29342. */
  29343. backFaceCulling: boolean;
  29344. /**
  29345. * Gets an ellipsoid describing the shape of this globe.
  29346. */
  29347. ellipsoid: Ellipsoid;
  29348. /**
  29349. * Gets the collection of image layers that will be rendered on this globe.
  29350. */
  29351. imageryLayers: ImageryLayerCollection;
  29352. /**
  29353. * Gets an event that's raised when an imagery layer is added, shown, hidden, moved, or removed.
  29354. */
  29355. readonly imageryLayersUpdatedEvent: Event;
  29356. /**
  29357. * Returns <code>true</code> when the tile load queue is empty, <code>false</code> otherwise. When the load queue is empty,
  29358. * all terrain and imagery for the current view have been loaded.
  29359. */
  29360. readonly tilesLoaded: boolean;
  29361. /**
  29362. * Gets or sets the color of the globe when no imagery is available.
  29363. */
  29364. baseColor: Color;
  29365. /**
  29366. * A property specifying a {@link ClippingPlaneCollection} used to selectively disable rendering on the outside of each plane.
  29367. */
  29368. clippingPlanes: ClippingPlaneCollection;
  29369. /**
  29370. * A property specifying a {@link Rectangle} used to limit globe rendering to a cartographic area.
  29371. * Defaults to the maximum extent of cartographic coordinates.
  29372. */
  29373. cartographicLimitRectangle: Rectangle;
  29374. /**
  29375. * The normal map to use for rendering waves in the ocean. Setting this property will
  29376. * only have an effect if the configured terrain provider includes a water mask.
  29377. */
  29378. oceanNormalMapUrl: string;
  29379. /**
  29380. * The terrain provider providing surface geometry for this globe.
  29381. */
  29382. terrainProvider: TerrainProvider;
  29383. /**
  29384. * Gets an event that's raised when the terrain provider is changed
  29385. */
  29386. readonly terrainProviderChanged: Event;
  29387. /**
  29388. * 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,
  29389. * all terrain and imagery for the current view have been loaded. The event passes the new length of the tile load queue.
  29390. */
  29391. tileLoadProgressEvent: Event;
  29392. /**
  29393. * 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
  29394. * {@link https://github.com/CesiumGS/cesium/wiki/Fabric|Fabric}.
  29395. */
  29396. material: Material;
  29397. /**
  29398. * The color to render the back side of the globe when the camera is underground or the globe is translucent,
  29399. * blended with the globe color based on the camera's distance.
  29400. * <br /><br />
  29401. * To disable underground coloring, set <code>undergroundColor</code> to <code>undefined</code>.
  29402. */
  29403. undergroundColor: Color;
  29404. /**
  29405. * Gets or sets the near and far distance for blending {@link Globe#undergroundColor} with the globe color.
  29406. * The alpha will interpolate between the {@link NearFarScalar#nearValue} and
  29407. * {@link NearFarScalar#farValue} while the camera distance falls within the lower and upper bounds
  29408. * of the specified {@link NearFarScalar#near} and {@link NearFarScalar#far}.
  29409. * Outside of these ranges the alpha remains clamped to the nearest bound. If undefined,
  29410. * the underground color will not be blended with the globe color.
  29411. * <br /> <br />
  29412. * When the camera is above the ellipsoid the distance is computed from the nearest
  29413. * point on the ellipsoid instead of the camera's position.
  29414. */
  29415. undergroundColorAlphaByDistance: NearFarScalar;
  29416. /**
  29417. * Properties for controlling globe translucency.
  29418. */
  29419. translucency: GlobeTranslucency;
  29420. /**
  29421. * Find an intersection between a ray and the globe surface that was rendered. The ray must be given in world coordinates.
  29422. * @example
  29423. * // find intersection of ray through a pixel and the globe
  29424. * var ray = viewer.camera.getPickRay(windowCoordinates);
  29425. * var intersection = globe.pick(ray, scene);
  29426. * @param ray - The ray to test for intersection.
  29427. * @param scene - The scene.
  29428. * @param [result] - The object onto which to store the result.
  29429. * @returns The intersection or <code>undefined</code> if none was found.
  29430. */
  29431. pick(ray: Ray, scene: Scene, result?: Cartesian3): Cartesian3 | undefined;
  29432. /**
  29433. * Get the height of the surface at a given cartographic.
  29434. * @param cartographic - The cartographic for which to find the height.
  29435. * @returns The height of the cartographic or undefined if it could not be found.
  29436. */
  29437. getHeight(cartographic: Cartographic): number | undefined;
  29438. /**
  29439. * Returns true if this object was destroyed; otherwise, false.
  29440. * <br /><br />
  29441. * If this object was destroyed, it should not be used; calling any function other than
  29442. * <code>isDestroyed</code> will result in a {@link DeveloperError} exception.
  29443. * @returns True if this object was destroyed; otherwise, false.
  29444. */
  29445. isDestroyed(): boolean;
  29446. /**
  29447. * Destroys the WebGL resources held by this object. Destroying an object allows for deterministic
  29448. * release of WebGL resources, instead of relying on the garbage collector to destroy this object.
  29449. * <br /><br />
  29450. * Once an object is destroyed, it should not be used; calling any function other than
  29451. * <code>isDestroyed</code> will result in a {@link DeveloperError} exception. Therefore,
  29452. * assign the return value (<code>undefined</code>) to the object as done in the example.
  29453. * @example
  29454. * globe = globe && globe.destroy();
  29455. */
  29456. destroy(): void;
  29457. }
  29458. /**
  29459. * Properties for controlling globe translucency.
  29460. */
  29461. export class GlobeTranslucency {
  29462. constructor();
  29463. /**
  29464. * When true, the globe is rendered as a translucent surface.
  29465. * <br /><br />
  29466. * The alpha is computed by blending {@link Globe#material}, {@link Globe#imageryLayers},
  29467. * and {@link Globe#baseColor}, all of which may contain translucency, and then multiplying by
  29468. * {@link GlobeTranslucency#frontFaceAlpha} and {@link GlobeTranslucency#frontFaceAlphaByDistance} for front faces and
  29469. * {@link GlobeTranslucency#backFaceAlpha} and {@link GlobeTranslucency#backFaceAlphaByDistance} for back faces.
  29470. * When the camera is underground back faces and front faces are swapped, i.e. back-facing geometry
  29471. * is considered front facing.
  29472. * <br /><br />
  29473. * Translucency is disabled by default.
  29474. */
  29475. enabled: boolean;
  29476. /**
  29477. * A constant translucency to apply to front faces of the globe.
  29478. * <br /><br />
  29479. * {@link GlobeTranslucency#enabled} must be set to true for this option to take effect.
  29480. * @example
  29481. * // Set front face translucency to 0.5.
  29482. * globe.translucency.frontFaceAlpha = 0.5;
  29483. * globe.translucency.enabled = true;
  29484. */
  29485. frontFaceAlpha: number;
  29486. /**
  29487. * Gets or sets near and far translucency properties of front faces of the globe based on the distance to the camera.
  29488. * The translucency will interpolate between the {@link NearFarScalar#nearValue} and
  29489. * {@link NearFarScalar#farValue} while the camera distance falls within the lower and upper bounds
  29490. * of the specified {@link NearFarScalar#near} and {@link NearFarScalar#far}.
  29491. * Outside of these ranges the translucency remains clamped to the nearest bound. If undefined,
  29492. * frontFaceAlphaByDistance will be disabled.
  29493. * <br /><br />
  29494. * {@link GlobeTranslucency#enabled} must be set to true for this option to take effect.
  29495. * @example
  29496. * // Example 1.
  29497. * // Set front face translucency to 0.5 when the
  29498. * // camera is 1500 meters from the surface and 1.0
  29499. * // as the camera distance approaches 8.0e6 meters.
  29500. * globe.translucency.frontFaceAlphaByDistance = new Cesium.NearFarScalar(1.5e2, 0.5, 8.0e6, 1.0);
  29501. * globe.translucency.enabled = true;
  29502. * @example
  29503. * // Example 2.
  29504. * // Disable front face translucency by distance
  29505. * globe.translucency.frontFaceAlphaByDistance = undefined;
  29506. */
  29507. frontFaceAlphaByDistance: NearFarScalar;
  29508. /**
  29509. * A constant translucency to apply to back faces of the globe.
  29510. * <br /><br />
  29511. * {@link GlobeTranslucency#enabled} must be set to true for this option to take effect.
  29512. * @example
  29513. * // Set back face translucency to 0.5.
  29514. * globe.translucency.backFaceAlpha = 0.5;
  29515. * globe.translucency.enabled = true;
  29516. */
  29517. backFaceAlpha: number;
  29518. /**
  29519. * Gets or sets near and far translucency properties of back faces of the globe based on the distance to the camera.
  29520. * The translucency will interpolate between the {@link NearFarScalar#nearValue} and
  29521. * {@link NearFarScalar#farValue} while the camera distance falls within the lower and upper bounds
  29522. * of the specified {@link NearFarScalar#near} and {@link NearFarScalar#far}.
  29523. * Outside of these ranges the translucency remains clamped to the nearest bound. If undefined,
  29524. * backFaceAlphaByDistance will be disabled.
  29525. * <br /><br />
  29526. * {@link GlobeTranslucency#enabled} must be set to true for this option to take effect.
  29527. * @example
  29528. * // Example 1.
  29529. * // Set back face translucency to 0.5 when the
  29530. * // camera is 1500 meters from the surface and 1.0
  29531. * // as the camera distance approaches 8.0e6 meters.
  29532. * globe.translucency.backFaceAlphaByDistance = new Cesium.NearFarScalar(1.5e2, 0.5, 8.0e6, 1.0);
  29533. * globe.translucency.enabled = true;
  29534. * @example
  29535. * // Example 2.
  29536. * // Disable back face translucency by distance
  29537. * globe.translucency.backFaceAlphaByDistance = undefined;
  29538. */
  29539. backFaceAlphaByDistance: NearFarScalar;
  29540. /**
  29541. * A property specifying a {@link Rectangle} used to limit translucency to a cartographic area.
  29542. * Defaults to the maximum extent of cartographic coordinates.
  29543. */
  29544. rectangle: Rectangle;
  29545. }
  29546. export namespace GoogleEarthEnterpriseImageryProvider {
  29547. /**
  29548. * Initialization options for the GoogleEarthEnterpriseImageryProvider constructor
  29549. * @property url - The url of the Google Earth Enterprise server hosting the imagery.
  29550. * @property metadata - A metadata object that can be used to share metadata requests with a GoogleEarthEnterpriseTerrainProvider.
  29551. * @property [ellipsoid] - The ellipsoid. If not specified, the WGS84 ellipsoid is used.
  29552. * @property [tileDiscardPolicy] - The policy that determines if a tile
  29553. * is invalid and should be discarded. If this value is not specified, a default
  29554. * is to discard tiles that fail to download.
  29555. * @property [credit] - A credit for the data source, which is displayed on the canvas.
  29556. */
  29557. type ConstructorOptions = {
  29558. url: Resource | string;
  29559. metadata: GoogleEarthEnterpriseMetadata;
  29560. ellipsoid?: Ellipsoid;
  29561. tileDiscardPolicy?: TileDiscardPolicy;
  29562. credit?: Credit | string;
  29563. };
  29564. }
  29565. /**
  29566. * Provides tiled imagery using the Google Earth Enterprise REST API.
  29567. *
  29568. * Notes: This provider is for use with the 3D Earth API of Google Earth Enterprise,
  29569. * {@link GoogleEarthEnterpriseMapsProvider} should be used with 2D Maps API.
  29570. * @example
  29571. * var geeMetadata = new GoogleEarthEnterpriseMetadata('http://www.earthenterprise.org/3d');
  29572. * var gee = new Cesium.GoogleEarthEnterpriseImageryProvider({
  29573. * metadata : geeMetadata
  29574. * });
  29575. * @param options - Object describing initialization options
  29576. */
  29577. export class GoogleEarthEnterpriseImageryProvider {
  29578. constructor(options: GoogleEarthEnterpriseImageryProvider.ConstructorOptions);
  29579. /**
  29580. * The default alpha blending value of this provider, with 0.0 representing fully transparent and
  29581. * 1.0 representing fully opaque.
  29582. */
  29583. defaultAlpha: number | undefined;
  29584. /**
  29585. * The default alpha blending value on the night side of the globe of this provider, with 0.0 representing fully transparent and
  29586. * 1.0 representing fully opaque.
  29587. */
  29588. defaultNightAlpha: number | undefined;
  29589. /**
  29590. * The default alpha blending value on the day side of the globe of this provider, with 0.0 representing fully transparent and
  29591. * 1.0 representing fully opaque.
  29592. */
  29593. defaultDayAlpha: number | undefined;
  29594. /**
  29595. * The default brightness of this provider. 1.0 uses the unmodified imagery color. Less than 1.0
  29596. * makes the imagery darker while greater than 1.0 makes it brighter.
  29597. */
  29598. defaultBrightness: number | undefined;
  29599. /**
  29600. * The default contrast of this provider. 1.0 uses the unmodified imagery color. Less than 1.0 reduces
  29601. * the contrast while greater than 1.0 increases it.
  29602. */
  29603. defaultContrast: number | undefined;
  29604. /**
  29605. * The default hue of this provider in radians. 0.0 uses the unmodified imagery color.
  29606. */
  29607. defaultHue: number | undefined;
  29608. /**
  29609. * The default saturation of this provider. 1.0 uses the unmodified imagery color. Less than 1.0 reduces the
  29610. * saturation while greater than 1.0 increases it.
  29611. */
  29612. defaultSaturation: number | undefined;
  29613. /**
  29614. * The default gamma correction to apply to this provider. 1.0 uses the unmodified imagery color.
  29615. */
  29616. defaultGamma: number | undefined;
  29617. /**
  29618. * The default texture minification filter to apply to this provider.
  29619. */
  29620. defaultMinificationFilter: TextureMinificationFilter;
  29621. /**
  29622. * The default texture magnification filter to apply to this provider.
  29623. */
  29624. defaultMagnificationFilter: TextureMagnificationFilter;
  29625. /**
  29626. * Gets the name of the Google Earth Enterprise server url hosting the imagery.
  29627. */
  29628. readonly url: string;
  29629. /**
  29630. * Gets the proxy used by this provider.
  29631. */
  29632. readonly proxy: Proxy;
  29633. /**
  29634. * Gets the width of each tile, in pixels. This function should
  29635. * not be called before {@link GoogleEarthEnterpriseImageryProvider#ready} returns true.
  29636. */
  29637. readonly tileWidth: number;
  29638. /**
  29639. * Gets the height of each tile, in pixels. This function should
  29640. * not be called before {@link GoogleEarthEnterpriseImageryProvider#ready} returns true.
  29641. */
  29642. readonly tileHeight: number;
  29643. /**
  29644. * Gets the maximum level-of-detail that can be requested. This function should
  29645. * not be called before {@link GoogleEarthEnterpriseImageryProvider#ready} returns true.
  29646. */
  29647. readonly maximumLevel: number | undefined;
  29648. /**
  29649. * Gets the minimum level-of-detail that can be requested. This function should
  29650. * not be called before {@link GoogleEarthEnterpriseImageryProvider#ready} returns true.
  29651. */
  29652. readonly minimumLevel: number;
  29653. /**
  29654. * Gets the tiling scheme used by this provider. This function should
  29655. * not be called before {@link GoogleEarthEnterpriseImageryProvider#ready} returns true.
  29656. */
  29657. readonly tilingScheme: TilingScheme;
  29658. /**
  29659. * Gets the rectangle, in radians, of the imagery provided by this instance. This function should
  29660. * not be called before {@link GoogleEarthEnterpriseImageryProvider#ready} returns true.
  29661. */
  29662. readonly rectangle: Rectangle;
  29663. /**
  29664. * Gets the tile discard policy. If not undefined, the discard policy is responsible
  29665. * for filtering out "missing" tiles via its shouldDiscardImage function. If this function
  29666. * returns undefined, no tiles are filtered. This function should
  29667. * not be called before {@link GoogleEarthEnterpriseImageryProvider#ready} returns true.
  29668. */
  29669. readonly tileDiscardPolicy: TileDiscardPolicy;
  29670. /**
  29671. * Gets an event that is raised when the imagery provider encounters an asynchronous error. By subscribing
  29672. * to the event, you will be notified of the error and can potentially recover from it. Event listeners
  29673. * are passed an instance of {@link TileProviderError}.
  29674. */
  29675. readonly errorEvent: Event;
  29676. /**
  29677. * Gets a value indicating whether or not the provider is ready for use.
  29678. */
  29679. readonly ready: boolean;
  29680. /**
  29681. * Gets a promise that resolves to true when the provider is ready for use.
  29682. */
  29683. readonly readyPromise: Promise<boolean>;
  29684. /**
  29685. * Gets the credit to display when this imagery provider is active. Typically this is used to credit
  29686. * the source of the imagery. This function should not be called before {@link GoogleEarthEnterpriseImageryProvider#ready} returns true.
  29687. */
  29688. readonly credit: Credit;
  29689. /**
  29690. * Gets a value indicating whether or not the images provided by this imagery provider
  29691. * include an alpha channel. If this property is false, an alpha channel, if present, will
  29692. * be ignored. If this property is true, any images without an alpha channel will be treated
  29693. * as if their alpha is 1.0 everywhere. Setting this property to false reduces memory usage
  29694. * and texture upload time.
  29695. */
  29696. readonly hasAlphaChannel: boolean;
  29697. /**
  29698. * Gets the credits to be displayed when a given tile is displayed.
  29699. * @param x - The tile X coordinate.
  29700. * @param y - The tile Y coordinate.
  29701. * @param level - The tile level;
  29702. * @returns The credits to be displayed when the tile is displayed.
  29703. */
  29704. getTileCredits(x: number, y: number, level: number): Credit[];
  29705. /**
  29706. * Requests the image for a given tile. This function should
  29707. * not be called before {@link GoogleEarthEnterpriseImageryProvider#ready} returns true.
  29708. * @param x - The tile X coordinate.
  29709. * @param y - The tile Y coordinate.
  29710. * @param level - The tile level.
  29711. * @param [request] - The request object. Intended for internal use only.
  29712. * @returns A promise for the image that will resolve when the image is available, or
  29713. * undefined if there are too many active requests to the server, and the request
  29714. * should be retried later. The resolved image may be either an
  29715. * Image or a Canvas DOM object.
  29716. */
  29717. requestImage(x: number, y: number, level: number, request?: Request): Promise<HTMLImageElement | HTMLCanvasElement> | undefined;
  29718. /**
  29719. * Picking features is not currently supported by this imagery provider, so this function simply returns
  29720. * undefined.
  29721. * @param x - The tile X coordinate.
  29722. * @param y - The tile Y coordinate.
  29723. * @param level - The tile level.
  29724. * @param longitude - The longitude at which to pick features.
  29725. * @param latitude - The latitude at which to pick features.
  29726. * @returns A promise for the picked features that will resolve when the asynchronous
  29727. * picking completes. The resolved value is an array of {@link ImageryLayerFeatureInfo}
  29728. * instances. The array may be empty if no features are found at the given location.
  29729. * It may also be undefined if picking is not supported.
  29730. */
  29731. pickFeatures(x: number, y: number, level: number, longitude: number, latitude: number): Promise<ImageryLayerFeatureInfo[]> | undefined;
  29732. }
  29733. export namespace GoogleEarthEnterpriseMapsProvider {
  29734. /**
  29735. * Initialization options for the GoogleEarthEnterpriseMapsProvider constructor
  29736. * @property url - The url of the Google Earth server hosting the imagery.
  29737. * @property channel - The channel (id) to be used when requesting data from the server.
  29738. * The channel number can be found by looking at the json file located at:
  29739. * earth.localdomain/default_map/query?request=Json&vars=geeServerDefs The /default_map path may
  29740. * differ depending on your Google Earth Enterprise server configuration. Look for the "id" that
  29741. * is associated with a "ImageryMaps" requestType. There may be more than one id available.
  29742. * Example:
  29743. * {
  29744. * layers: [
  29745. * {
  29746. * id: 1002,
  29747. * requestType: "ImageryMaps"
  29748. * },
  29749. * {
  29750. * id: 1007,
  29751. * requestType: "VectorMapsRaster"
  29752. * }
  29753. * ]
  29754. * }
  29755. * @property [path = "/default_map"] - The path of the Google Earth server hosting the imagery.
  29756. * @property [maximumLevel] - The maximum level-of-detail supported by the Google Earth
  29757. * Enterprise server, or undefined if there is no limit.
  29758. * @property [tileDiscardPolicy] - The policy that determines if a tile
  29759. * is invalid and should be discarded. To ensure that no tiles are discarded, construct and pass
  29760. * a {@link NeverTileDiscardPolicy} for this parameter.
  29761. * @property [ellipsoid] - The ellipsoid. If not specified, the WGS84 ellipsoid is used.
  29762. */
  29763. type ConstructorOptions = {
  29764. url: Resource | string;
  29765. channel: number;
  29766. path?: string;
  29767. maximumLevel?: number;
  29768. tileDiscardPolicy?: TileDiscardPolicy;
  29769. ellipsoid?: Ellipsoid;
  29770. };
  29771. }
  29772. /**
  29773. * Provides tiled imagery using the Google Earth Imagery API.
  29774. *
  29775. * Notes: This imagery provider does not work with the public Google Earth servers. It works with the
  29776. * Google Earth Enterprise Server.
  29777. *
  29778. * By default the Google Earth Enterprise server does not set the
  29779. * {@link http://www.w3.org/TR/cors/|Cross-Origin Resource Sharing} headers. You can either
  29780. * use a proxy server which adds these headers, or in the /opt/google/gehttpd/conf/gehttpd.conf
  29781. * and add the 'Header set Access-Control-Allow-Origin "*"' option to the '&lt;Directory /&gt;' and
  29782. * '&lt;Directory "/opt/google/gehttpd/htdocs"&gt;' directives.
  29783. *
  29784. * This provider is for use with 2D Maps API as part of Google Earth Enterprise. For 3D Earth API uses, it
  29785. * is necessary to use {@link GoogleEarthEnterpriseImageryProvider}
  29786. * @example
  29787. * var google = new Cesium.GoogleEarthEnterpriseMapsProvider({
  29788. * url : 'https://earth.localdomain',
  29789. * channel : 1008
  29790. * });
  29791. * @param options - Object describing initialization options
  29792. */
  29793. export class GoogleEarthEnterpriseMapsProvider {
  29794. constructor(options: GoogleEarthEnterpriseMapsProvider.ConstructorOptions);
  29795. /**
  29796. * The default alpha blending value of this provider, with 0.0 representing fully transparent and
  29797. * 1.0 representing fully opaque.
  29798. */
  29799. defaultAlpha: number | undefined;
  29800. /**
  29801. * The default alpha blending value on the night side of the globe of this provider, with 0.0 representing fully transparent and
  29802. * 1.0 representing fully opaque.
  29803. */
  29804. defaultNightAlpha: number | undefined;
  29805. /**
  29806. * The default alpha blending value on the day side of the globe of this provider, with 0.0 representing fully transparent and
  29807. * 1.0 representing fully opaque.
  29808. */
  29809. defaultDayAlpha: number | undefined;
  29810. /**
  29811. * The default brightness of this provider. 1.0 uses the unmodified imagery color. Less than 1.0
  29812. * makes the imagery darker while greater than 1.0 makes it brighter.
  29813. */
  29814. defaultBrightness: number | undefined;
  29815. /**
  29816. * The default contrast of this provider. 1.0 uses the unmodified imagery color. Less than 1.0 reduces
  29817. * the contrast while greater than 1.0 increases it.
  29818. */
  29819. defaultContrast: number | undefined;
  29820. /**
  29821. * The default hue of this provider in radians. 0.0 uses the unmodified imagery color.
  29822. */
  29823. defaultHue: number | undefined;
  29824. /**
  29825. * The default saturation of this provider. 1.0 uses the unmodified imagery color. Less than 1.0 reduces the
  29826. * saturation while greater than 1.0 increases it.
  29827. */
  29828. defaultSaturation: number | undefined;
  29829. /**
  29830. * The default gamma correction to apply to this provider. 1.0 uses the unmodified imagery color.
  29831. */
  29832. defaultGamma: number | undefined;
  29833. /**
  29834. * The default texture minification filter to apply to this provider.
  29835. */
  29836. defaultMinificationFilter: TextureMinificationFilter;
  29837. /**
  29838. * The default texture magnification filter to apply to this provider.
  29839. */
  29840. defaultMagnificationFilter: TextureMagnificationFilter;
  29841. /**
  29842. * Gets the URL of the Google Earth MapServer.
  29843. */
  29844. readonly url: string;
  29845. /**
  29846. * Gets the url path of the data on the Google Earth server.
  29847. */
  29848. readonly path: string;
  29849. /**
  29850. * Gets the proxy used by this provider.
  29851. */
  29852. readonly proxy: Proxy;
  29853. /**
  29854. * Gets the imagery channel (id) currently being used.
  29855. */
  29856. readonly channel: number;
  29857. /**
  29858. * Gets the width of each tile, in pixels. This function should
  29859. * not be called before {@link GoogleEarthEnterpriseMapsProvider#ready} returns true.
  29860. */
  29861. readonly tileWidth: number;
  29862. /**
  29863. * Gets the height of each tile, in pixels. This function should
  29864. * not be called before {@link GoogleEarthEnterpriseMapsProvider#ready} returns true.
  29865. */
  29866. readonly tileHeight: number;
  29867. /**
  29868. * Gets the maximum level-of-detail that can be requested. This function should
  29869. * not be called before {@link GoogleEarthEnterpriseMapsProvider#ready} returns true.
  29870. */
  29871. readonly maximumLevel: number | undefined;
  29872. /**
  29873. * Gets the minimum level-of-detail that can be requested. This function should
  29874. * not be called before {@link GoogleEarthEnterpriseMapsProvider#ready} returns true.
  29875. */
  29876. readonly minimumLevel: number;
  29877. /**
  29878. * Gets the tiling scheme used by this provider. This function should
  29879. * not be called before {@link GoogleEarthEnterpriseMapsProvider#ready} returns true.
  29880. */
  29881. readonly tilingScheme: TilingScheme;
  29882. /**
  29883. * Gets the version of the data used by this provider. This function should
  29884. * not be called before {@link GoogleEarthEnterpriseMapsProvider#ready} returns true.
  29885. */
  29886. readonly version: number;
  29887. /**
  29888. * Gets the type of data that is being requested from the provider. This function should
  29889. * not be called before {@link GoogleEarthEnterpriseMapsProvider#ready} returns true.
  29890. */
  29891. readonly requestType: string;
  29892. /**
  29893. * Gets the rectangle, in radians, of the imagery provided by this instance. This function should
  29894. * not be called before {@link GoogleEarthEnterpriseMapsProvider#ready} returns true.
  29895. */
  29896. readonly rectangle: Rectangle;
  29897. /**
  29898. * Gets the tile discard policy. If not undefined, the discard policy is responsible
  29899. * for filtering out "missing" tiles via its shouldDiscardImage function. If this function
  29900. * returns undefined, no tiles are filtered. This function should
  29901. * not be called before {@link GoogleEarthEnterpriseMapsProvider#ready} returns true.
  29902. */
  29903. readonly tileDiscardPolicy: TileDiscardPolicy;
  29904. /**
  29905. * Gets an event that is raised when the imagery provider encounters an asynchronous error. By subscribing
  29906. * to the event, you will be notified of the error and can potentially recover from it. Event listeners
  29907. * are passed an instance of {@link TileProviderError}.
  29908. */
  29909. readonly errorEvent: Event;
  29910. /**
  29911. * Gets a value indicating whether or not the provider is ready for use.
  29912. */
  29913. readonly ready: boolean;
  29914. /**
  29915. * Gets a promise that resolves to true when the provider is ready for use.
  29916. */
  29917. readonly readyPromise: Promise<boolean>;
  29918. /**
  29919. * Gets the credit to display when this imagery provider is active. Typically this is used to credit
  29920. * the source of the imagery. This function should not be called before {@link GoogleEarthEnterpriseMapsProvider#ready} returns true.
  29921. */
  29922. readonly credit: Credit;
  29923. /**
  29924. * Gets a value indicating whether or not the images provided by this imagery provider
  29925. * include an alpha channel. If this property is false, an alpha channel, if present, will
  29926. * be ignored. If this property is true, any images without an alpha channel will be treated
  29927. * as if their alpha is 1.0 everywhere. When this property is false, memory usage
  29928. * and texture upload time are reduced.
  29929. */
  29930. readonly hasAlphaChannel: boolean;
  29931. /**
  29932. * Gets the credits to be displayed when a given tile is displayed.
  29933. * @param x - The tile X coordinate.
  29934. * @param y - The tile Y coordinate.
  29935. * @param level - The tile level;
  29936. * @returns The credits to be displayed when the tile is displayed.
  29937. */
  29938. getTileCredits(x: number, y: number, level: number): Credit[];
  29939. /**
  29940. * Requests the image for a given tile. This function should
  29941. * not be called before {@link GoogleEarthEnterpriseMapsProvider#ready} returns true.
  29942. * @param x - The tile X coordinate.
  29943. * @param y - The tile Y coordinate.
  29944. * @param level - The tile level.
  29945. * @param [request] - The request object. Intended for internal use only.
  29946. * @returns A promise for the image that will resolve when the image is available, or
  29947. * undefined if there are too many active requests to the server, and the request
  29948. * should be retried later. The resolved image may be either an
  29949. * Image or a Canvas DOM object.
  29950. */
  29951. requestImage(x: number, y: number, level: number, request?: Request): Promise<HTMLImageElement | HTMLCanvasElement> | undefined;
  29952. /**
  29953. * Picking features is not currently supported by this imagery provider, so this function simply returns
  29954. * undefined.
  29955. * @param x - The tile X coordinate.
  29956. * @param y - The tile Y coordinate.
  29957. * @param level - The tile level.
  29958. * @param longitude - The longitude at which to pick features.
  29959. * @param latitude - The latitude at which to pick features.
  29960. * @returns A promise for the picked features that will resolve when the asynchronous
  29961. * picking completes. The resolved value is an array of {@link ImageryLayerFeatureInfo}
  29962. * instances. The array may be empty if no features are found at the given location.
  29963. * It may also be undefined if picking is not supported.
  29964. */
  29965. pickFeatures(x: number, y: number, level: number, longitude: number, latitude: number): Promise<ImageryLayerFeatureInfo[]> | undefined;
  29966. /**
  29967. * Gets or sets the URL to the Google Earth logo for display in the credit.
  29968. */
  29969. static logoUrl: string;
  29970. }
  29971. export namespace GridImageryProvider {
  29972. /**
  29973. * Initialization options for the GridImageryProvider constructor
  29974. * @param [tilingScheme = new GeographicTilingScheme()] - The tiling scheme for which to draw tiles.
  29975. * @param [ellipsoid] - The ellipsoid. If the tilingScheme is specified,
  29976. * this parameter is ignored and the tiling scheme's ellipsoid is used instead. If neither
  29977. * parameter is specified, the WGS84 ellipsoid is used.
  29978. * @param [cells = 8] - The number of grids cells.
  29979. * @param [color = Color(1.0, 1.0, 1.0, 0.4)] - The color to draw grid lines.
  29980. * @param [glowColor = Color(0.0, 1.0, 0.0, 0.05)] - The color to draw glow for grid lines.
  29981. * @param [glowWidth = 6] - The width of lines used for rendering the line glow effect.
  29982. * @param [backgroundColor = Color(0.0, 0.5, 0.0, 0.2)] - Background fill color.
  29983. * @param [tileWidth = 256] - The width of the tile for level-of-detail selection purposes.
  29984. * @param [tileHeight = 256] - The height of the tile for level-of-detail selection purposes.
  29985. * @param [canvasSize = 256] - The size of the canvas used for rendering.
  29986. */
  29987. type ConstructorOptions = any;
  29988. }
  29989. /**
  29990. * An {@link ImageryProvider} that draws a wireframe grid on every tile with controllable background and glow.
  29991. * May be useful for custom rendering effects or debugging terrain.
  29992. * @param options - Object describing initialization options
  29993. */
  29994. export class GridImageryProvider {
  29995. constructor(options: GridImageryProvider.ConstructorOptions);
  29996. /**
  29997. * The default alpha blending value of this provider, with 0.0 representing fully transparent and
  29998. * 1.0 representing fully opaque.
  29999. */
  30000. defaultAlpha: number | undefined;
  30001. /**
  30002. * The default alpha blending value on the night side of the globe of this provider, with 0.0 representing fully transparent and
  30003. * 1.0 representing fully opaque.
  30004. */
  30005. defaultNightAlpha: number | undefined;
  30006. /**
  30007. * The default alpha blending value on the day side of the globe of this provider, with 0.0 representing fully transparent and
  30008. * 1.0 representing fully opaque.
  30009. */
  30010. defaultDayAlpha: number | undefined;
  30011. /**
  30012. * The default brightness of this provider. 1.0 uses the unmodified imagery color. Less than 1.0
  30013. * makes the imagery darker while greater than 1.0 makes it brighter.
  30014. */
  30015. defaultBrightness: number | undefined;
  30016. /**
  30017. * The default contrast of this provider. 1.0 uses the unmodified imagery color. Less than 1.0 reduces
  30018. * the contrast while greater than 1.0 increases it.
  30019. */
  30020. defaultContrast: number | undefined;
  30021. /**
  30022. * The default hue of this provider in radians. 0.0 uses the unmodified imagery color.
  30023. */
  30024. defaultHue: number | undefined;
  30025. /**
  30026. * The default saturation of this provider. 1.0 uses the unmodified imagery color. Less than 1.0 reduces the
  30027. * saturation while greater than 1.0 increases it.
  30028. */
  30029. defaultSaturation: number | undefined;
  30030. /**
  30031. * The default gamma correction to apply to this provider. 1.0 uses the unmodified imagery color.
  30032. */
  30033. defaultGamma: number | undefined;
  30034. /**
  30035. * The default texture minification filter to apply to this provider.
  30036. */
  30037. defaultMinificationFilter: TextureMinificationFilter;
  30038. /**
  30039. * The default texture magnification filter to apply to this provider.
  30040. */
  30041. defaultMagnificationFilter: TextureMagnificationFilter;
  30042. /**
  30043. * Gets the proxy used by this provider.
  30044. */
  30045. readonly proxy: Proxy;
  30046. /**
  30047. * Gets the width of each tile, in pixels. This function should
  30048. * not be called before {@link GridImageryProvider#ready} returns true.
  30049. */
  30050. readonly tileWidth: number;
  30051. /**
  30052. * Gets the height of each tile, in pixels. This function should
  30053. * not be called before {@link GridImageryProvider#ready} returns true.
  30054. */
  30055. readonly tileHeight: number;
  30056. /**
  30057. * Gets the maximum level-of-detail that can be requested. This function should
  30058. * not be called before {@link GridImageryProvider#ready} returns true.
  30059. */
  30060. readonly maximumLevel: number | undefined;
  30061. /**
  30062. * Gets the minimum level-of-detail that can be requested. This function should
  30063. * not be called before {@link GridImageryProvider#ready} returns true.
  30064. */
  30065. readonly minimumLevel: number;
  30066. /**
  30067. * Gets the tiling scheme used by this provider. This function should
  30068. * not be called before {@link GridImageryProvider#ready} returns true.
  30069. */
  30070. readonly tilingScheme: TilingScheme;
  30071. /**
  30072. * Gets the rectangle, in radians, of the imagery provided by this instance. This function should
  30073. * not be called before {@link GridImageryProvider#ready} returns true.
  30074. */
  30075. readonly rectangle: Rectangle;
  30076. /**
  30077. * Gets the tile discard policy. If not undefined, the discard policy is responsible
  30078. * for filtering out "missing" tiles via its shouldDiscardImage function. If this function
  30079. * returns undefined, no tiles are filtered. This function should
  30080. * not be called before {@link GridImageryProvider#ready} returns true.
  30081. */
  30082. readonly tileDiscardPolicy: TileDiscardPolicy;
  30083. /**
  30084. * Gets an event that is raised when the imagery provider encounters an asynchronous error. By subscribing
  30085. * to the event, you will be notified of the error and can potentially recover from it. Event listeners
  30086. * are passed an instance of {@link TileProviderError}.
  30087. */
  30088. readonly errorEvent: Event;
  30089. /**
  30090. * Gets a value indicating whether or not the provider is ready for use.
  30091. */
  30092. readonly ready: boolean;
  30093. /**
  30094. * Gets a promise that resolves to true when the provider is ready for use.
  30095. */
  30096. readonly readyPromise: Promise<boolean>;
  30097. /**
  30098. * Gets the credit to display when this imagery provider is active. Typically this is used to credit
  30099. * the source of the imagery. This function should not be called before {@link GridImageryProvider#ready} returns true.
  30100. */
  30101. readonly credit: Credit;
  30102. /**
  30103. * Gets a value indicating whether or not the images provided by this imagery provider
  30104. * include an alpha channel. If this property is false, an alpha channel, if present, will
  30105. * be ignored. If this property is true, any images without an alpha channel will be treated
  30106. * as if their alpha is 1.0 everywhere. When this property is false, memory usage
  30107. * and texture upload time are reduced.
  30108. */
  30109. readonly hasAlphaChannel: boolean;
  30110. /**
  30111. * Draws a grid of lines into a canvas.
  30112. */
  30113. _drawGrid(): void;
  30114. /**
  30115. * Render a grid into a canvas with background and glow
  30116. */
  30117. _createGridCanvas(): void;
  30118. /**
  30119. * Gets the credits to be displayed when a given tile is displayed.
  30120. * @param x - The tile X coordinate.
  30121. * @param y - The tile Y coordinate.
  30122. * @param level - The tile level;
  30123. * @returns The credits to be displayed when the tile is displayed.
  30124. */
  30125. getTileCredits(x: number, y: number, level: number): Credit[];
  30126. /**
  30127. * Requests the image for a given tile. This function should
  30128. * not be called before {@link GridImageryProvider#ready} returns true.
  30129. * @param x - The tile X coordinate.
  30130. * @param y - The tile Y coordinate.
  30131. * @param level - The tile level.
  30132. * @param [request] - The request object. Intended for internal use only.
  30133. * @returns A promise for the image that will resolve when the image is available, or
  30134. * undefined if there are too many active requests to the server, and the request
  30135. * should be retried later. The resolved image may be either an
  30136. * Image or a Canvas DOM object.
  30137. */
  30138. requestImage(x: number, y: number, level: number, request?: Request): Promise<HTMLImageElement | HTMLCanvasElement> | undefined;
  30139. /**
  30140. * Picking features is not currently supported by this imagery provider, so this function simply returns
  30141. * undefined.
  30142. * @param x - The tile X coordinate.
  30143. * @param y - The tile Y coordinate.
  30144. * @param level - The tile level.
  30145. * @param longitude - The longitude at which to pick features.
  30146. * @param latitude - The latitude at which to pick features.
  30147. * @returns A promise for the picked features that will resolve when the asynchronous
  30148. * picking completes. The resolved value is an array of {@link ImageryLayerFeatureInfo}
  30149. * instances. The array may be empty if no features are found at the given location.
  30150. * It may also be undefined if picking is not supported.
  30151. */
  30152. pickFeatures(x: number, y: number, level: number, longitude: number, latitude: number): Promise<ImageryLayerFeatureInfo[]> | undefined;
  30153. }
  30154. /**
  30155. * A GroundPolylinePrimitive represents a polyline draped over the terrain or 3D Tiles in the {@link Scene}.
  30156. * <p>
  30157. * Only to be used with GeometryInstances containing {@link GroundPolylineGeometry}.
  30158. * </p>
  30159. * @example
  30160. * // 1. Draw a polyline on terrain with a basic color material
  30161. *
  30162. * var instance = new Cesium.GeometryInstance({
  30163. * geometry : new Cesium.GroundPolylineGeometry({
  30164. * positions : Cesium.Cartesian3.fromDegreesArray([
  30165. * -112.1340164450331, 36.05494287836128,
  30166. * -112.08821010582645, 36.097804071380715
  30167. * ]),
  30168. * width : 4.0
  30169. * }),
  30170. * id : 'object returned when this instance is picked and to get/set per-instance attributes'
  30171. * });
  30172. *
  30173. * scene.groundPrimitives.add(new Cesium.GroundPolylinePrimitive({
  30174. * geometryInstances : instance,
  30175. * appearance : new Cesium.PolylineMaterialAppearance()
  30176. * }));
  30177. *
  30178. * // 2. Draw a looped polyline on terrain with per-instance color and a distance display condition.
  30179. * // Distance display conditions for polylines on terrain are based on an approximate terrain height
  30180. * // instead of true terrain height.
  30181. *
  30182. * var instance = new Cesium.GeometryInstance({
  30183. * geometry : new Cesium.GroundPolylineGeometry({
  30184. * positions : Cesium.Cartesian3.fromDegreesArray([
  30185. * -112.1340164450331, 36.05494287836128,
  30186. * -112.08821010582645, 36.097804071380715,
  30187. * -112.13296079730024, 36.168769146801104
  30188. * ]),
  30189. * loop : true,
  30190. * width : 4.0
  30191. * }),
  30192. * attributes : {
  30193. * color : Cesium.ColorGeometryInstanceAttribute.fromColor(Cesium.Color.fromCssColorString('green').withAlpha(0.7)),
  30194. * distanceDisplayCondition : new Cesium.DistanceDisplayConditionGeometryInstanceAttribute(1000, 30000)
  30195. * },
  30196. * id : 'object returned when this instance is picked and to get/set per-instance attributes'
  30197. * });
  30198. *
  30199. * scene.groundPrimitives.add(new Cesium.GroundPolylinePrimitive({
  30200. * geometryInstances : instance,
  30201. * appearance : new Cesium.PolylineColorAppearance()
  30202. * }));
  30203. * @param [options] - Object with the following properties:
  30204. * @param [options.geometryInstances] - GeometryInstances containing GroundPolylineGeometry
  30205. * @param [options.appearance] - The Appearance used to render the polyline. Defaults to a white color {@link Material} on a {@link PolylineMaterialAppearance}.
  30206. * @param [options.show = true] - Determines if this primitive will be shown.
  30207. * @param [options.interleave = false] - When <code>true</code>, geometry vertex attributes are interleaved, which can slightly improve rendering performance but increases load time.
  30208. * @param [options.releaseGeometryInstances = true] - When <code>true</code>, the primitive does not keep a reference to the input <code>geometryInstances</code> to save memory.
  30209. * @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.
  30210. * @param [options.asynchronous = true] - Determines if the primitive will be created asynchronously or block until ready. If false initializeTerrainHeights() must be called first.
  30211. * @param [options.classificationType = ClassificationType.BOTH] - Determines whether terrain, 3D Tiles or both will be classified.
  30212. * @param [options.debugShowBoundingVolume = false] - For debugging only. Determines if this primitive's commands' bounding spheres are shown.
  30213. * @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.
  30214. */
  30215. export class GroundPolylinePrimitive {
  30216. constructor(options?: {
  30217. geometryInstances?: any[] | GeometryInstance;
  30218. appearance?: Appearance;
  30219. show?: boolean;
  30220. interleave?: boolean;
  30221. releaseGeometryInstances?: boolean;
  30222. allowPicking?: boolean;
  30223. asynchronous?: boolean;
  30224. classificationType?: ClassificationType;
  30225. debugShowBoundingVolume?: boolean;
  30226. debugShowShadowVolume?: boolean;
  30227. });
  30228. /**
  30229. * The geometry instances rendered with this primitive. This may
  30230. * be <code>undefined</code> if <code>options.releaseGeometryInstances</code>
  30231. * is <code>true</code> when the primitive is constructed.
  30232. * <p>
  30233. * Changing this property after the primitive is rendered has no effect.
  30234. * </p>
  30235. */
  30236. readonly geometryInstances: any[] | GeometryInstance;
  30237. /**
  30238. * The {@link Appearance} used to shade this primitive. Each geometry
  30239. * instance is shaded with the same appearance. Some appearances, like
  30240. * {@link PolylineColorAppearance} allow giving each instance unique
  30241. * properties.
  30242. */
  30243. appearance: Appearance;
  30244. /**
  30245. * Determines if the primitive will be shown. This affects all geometry
  30246. * instances in the primitive.
  30247. */
  30248. show: boolean;
  30249. /**
  30250. * Determines whether terrain, 3D Tiles or both will be classified.
  30251. */
  30252. classificationType: ClassificationType;
  30253. /**
  30254. * This property is for debugging only; it is not for production use nor is it optimized.
  30255. * <p>
  30256. * Draws the bounding sphere for each draw command in the primitive.
  30257. * </p>
  30258. */
  30259. debugShowBoundingVolume: boolean;
  30260. /**
  30261. * Determines if geometry vertex attributes are interleaved, which can slightly improve rendering performance.
  30262. */
  30263. readonly interleave: boolean;
  30264. /**
  30265. * When <code>true</code>, the primitive does not keep a reference to the input <code>geometryInstances</code> to save memory.
  30266. */
  30267. readonly releaseGeometryInstances: boolean;
  30268. /**
  30269. * When <code>true</code>, each geometry instance will only be pickable with {@link Scene#pick}. When <code>false</code>, GPU memory is saved.
  30270. */
  30271. readonly allowPicking: boolean;
  30272. /**
  30273. * Determines if the geometry instances will be created and batched on a web worker.
  30274. */
  30275. readonly asynchronous: boolean;
  30276. /**
  30277. * Determines if the primitive is complete and ready to render. If this property is
  30278. * true, the primitive will be rendered the next time that {@link GroundPolylinePrimitive#update}
  30279. * is called.
  30280. */
  30281. readonly ready: boolean;
  30282. /**
  30283. * Gets a promise that resolves when the primitive is ready to render.
  30284. */
  30285. readonly readyPromise: Promise<GroundPolylinePrimitive>;
  30286. /**
  30287. * This property is for debugging only; it is not for production use nor is it optimized.
  30288. * <p>
  30289. * If true, draws the shadow volume for each geometry in the primitive.
  30290. * </p>
  30291. */
  30292. readonly debugShowShadowVolume: boolean;
  30293. /**
  30294. * Initializes the minimum and maximum terrain heights. This only needs to be called if you are creating the
  30295. * GroundPolylinePrimitive synchronously.
  30296. * @returns A promise that will resolve once the terrain heights have been loaded.
  30297. */
  30298. static initializeTerrainHeights(): Promise<void>;
  30299. /**
  30300. * Called when {@link Viewer} or {@link CesiumWidget} render the scene to
  30301. * get the draw commands needed to render this primitive.
  30302. * <p>
  30303. * Do not call this function directly. This is documented just to
  30304. * list the exceptions that may be propagated when the scene is rendered:
  30305. * </p>
  30306. */
  30307. update(): void;
  30308. /**
  30309. * Returns the modifiable per-instance attributes for a {@link GeometryInstance}.
  30310. * @example
  30311. * var attributes = primitive.getGeometryInstanceAttributes('an id');
  30312. * attributes.color = Cesium.ColorGeometryInstanceAttribute.toValue(Cesium.Color.AQUA);
  30313. * attributes.show = Cesium.ShowGeometryInstanceAttribute.toValue(true);
  30314. * @param id - The id of the {@link GeometryInstance}.
  30315. * @returns The typed array in the attribute's format or undefined if the is no instance with id.
  30316. */
  30317. getGeometryInstanceAttributes(id: any): any;
  30318. /**
  30319. * Checks if the given Scene supports GroundPolylinePrimitives.
  30320. * GroundPolylinePrimitives require support for the WEBGL_depth_texture extension.
  30321. * @param scene - The current scene.
  30322. * @returns Whether or not the current scene supports GroundPolylinePrimitives.
  30323. */
  30324. static isSupported(scene: Scene): boolean;
  30325. /**
  30326. * Returns true if this object was destroyed; otherwise, false.
  30327. * <p>
  30328. * If this object was destroyed, it should not be used; calling any function other than
  30329. * <code>isDestroyed</code> will result in a {@link DeveloperError} exception.
  30330. * </p>
  30331. * @returns <code>true</code> if this object was destroyed; otherwise, <code>false</code>.
  30332. */
  30333. isDestroyed(): boolean;
  30334. /**
  30335. * Destroys the WebGL resources held by this object. Destroying an object allows for deterministic
  30336. * release of WebGL resources, instead of relying on the garbage collector to destroy this object.
  30337. * <p>
  30338. * Once an object is destroyed, it should not be used; calling any function other than
  30339. * <code>isDestroyed</code> will result in a {@link DeveloperError} exception. Therefore,
  30340. * assign the return value (<code>undefined</code>) to the object as done in the example.
  30341. * </p>
  30342. * @example
  30343. * e = e && e.destroy();
  30344. */
  30345. destroy(): void;
  30346. }
  30347. /**
  30348. * A ground primitive represents geometry draped over terrain or 3D Tiles in the {@link Scene}.
  30349. * <p>
  30350. * A primitive combines geometry instances with an {@link Appearance} that describes the full shading, including
  30351. * {@link Material} and {@link RenderState}. Roughly, the geometry instance defines the structure and placement,
  30352. * and the appearance defines the visual characteristics. Decoupling geometry and appearance allows us to mix
  30353. * and match most of them and add a new geometry or appearance independently of each other.
  30354. * </p>
  30355. * <p>
  30356. * Support for the WEBGL_depth_texture extension is required to use GeometryInstances with different PerInstanceColors
  30357. * or materials besides PerInstanceColorAppearance.
  30358. * </p>
  30359. * <p>
  30360. * Textured GroundPrimitives were designed for notional patterns and are not meant for precisely mapping
  30361. * textures to terrain - for that use case, use {@link SingleTileImageryProvider}.
  30362. * </p>
  30363. * <p>
  30364. * For correct rendering, this feature requires the EXT_frag_depth WebGL extension. For hardware that do not support this extension, there
  30365. * will be rendering artifacts for some viewing angles.
  30366. * </p>
  30367. * <p>
  30368. * Valid geometries are {@link CircleGeometry}, {@link CorridorGeometry}, {@link EllipseGeometry}, {@link PolygonGeometry}, and {@link RectangleGeometry}.
  30369. * </p>
  30370. * @example
  30371. * // Example 1: Create primitive with a single instance
  30372. * var rectangleInstance = new Cesium.GeometryInstance({
  30373. * geometry : new Cesium.RectangleGeometry({
  30374. * rectangle : Cesium.Rectangle.fromDegrees(-140.0, 30.0, -100.0, 40.0)
  30375. * }),
  30376. * id : 'rectangle',
  30377. * attributes : {
  30378. * color : new Cesium.ColorGeometryInstanceAttribute(0.0, 1.0, 1.0, 0.5)
  30379. * }
  30380. * });
  30381. * scene.primitives.add(new Cesium.GroundPrimitive({
  30382. * geometryInstances : rectangleInstance
  30383. * }));
  30384. *
  30385. * // Example 2: Batch instances
  30386. * var color = new Cesium.ColorGeometryInstanceAttribute(0.0, 1.0, 1.0, 0.5); // Both instances must have the same color.
  30387. * var rectangleInstance = new Cesium.GeometryInstance({
  30388. * geometry : new Cesium.RectangleGeometry({
  30389. * rectangle : Cesium.Rectangle.fromDegrees(-140.0, 30.0, -100.0, 40.0)
  30390. * }),
  30391. * id : 'rectangle',
  30392. * attributes : {
  30393. * color : color
  30394. * }
  30395. * });
  30396. * var ellipseInstance = new Cesium.GeometryInstance({
  30397. * geometry : new Cesium.EllipseGeometry({
  30398. * center : Cesium.Cartesian3.fromDegrees(-105.0, 40.0),
  30399. * semiMinorAxis : 300000.0,
  30400. * semiMajorAxis : 400000.0
  30401. * }),
  30402. * id : 'ellipse',
  30403. * attributes : {
  30404. * color : color
  30405. * }
  30406. * });
  30407. * scene.primitives.add(new Cesium.GroundPrimitive({
  30408. * geometryInstances : [rectangleInstance, ellipseInstance]
  30409. * }));
  30410. * @param [options] - Object with the following properties:
  30411. * @param [options.geometryInstances] - The geometry instances to render.
  30412. * @param [options.appearance] - The appearance used to render the primitive. Defaults to a flat PerInstanceColorAppearance when GeometryInstances have a color attribute.
  30413. * @param [options.show = true] - Determines if this primitive will be shown.
  30414. * @param [options.vertexCacheOptimize = false] - When <code>true</code>, geometry vertices are optimized for the pre and post-vertex-shader caches.
  30415. * @param [options.interleave = false] - When <code>true</code>, geometry vertex attributes are interleaved, which can slightly improve rendering performance but increases load time.
  30416. * @param [options.compressVertices = true] - When <code>true</code>, the geometry vertices are compressed, which will save memory.
  30417. * @param [options.releaseGeometryInstances = true] - When <code>true</code>, the primitive does not keep a reference to the input <code>geometryInstances</code> to save memory.
  30418. * @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.
  30419. * @param [options.asynchronous = true] - Determines if the primitive will be created asynchronously or block until ready. If false initializeTerrainHeights() must be called first.
  30420. * @param [options.classificationType = ClassificationType.BOTH] - Determines whether terrain, 3D Tiles or both will be classified.
  30421. * @param [options.debugShowBoundingVolume = false] - For debugging only. Determines if this primitive's commands' bounding spheres are shown.
  30422. * @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
  30423. * creation for the volumes to be created before the geometry is released or options.releaseGeometryInstance must be <code>false</code>.
  30424. */
  30425. export class GroundPrimitive {
  30426. constructor(options?: {
  30427. geometryInstances?: any[] | GeometryInstance;
  30428. appearance?: Appearance;
  30429. show?: boolean;
  30430. vertexCacheOptimize?: boolean;
  30431. interleave?: boolean;
  30432. compressVertices?: boolean;
  30433. releaseGeometryInstances?: boolean;
  30434. allowPicking?: boolean;
  30435. asynchronous?: boolean;
  30436. classificationType?: ClassificationType;
  30437. debugShowBoundingVolume?: boolean;
  30438. debugShowShadowVolume?: boolean;
  30439. });
  30440. /**
  30441. * The {@link Appearance} used to shade this primitive. Each geometry
  30442. * instance is shaded with the same appearance. Some appearances, like
  30443. * {@link PerInstanceColorAppearance} allow giving each instance unique
  30444. * properties.
  30445. */
  30446. appearance: Appearance;
  30447. /**
  30448. * The geometry instances rendered with this primitive. This may
  30449. * be <code>undefined</code> if <code>options.releaseGeometryInstances</code>
  30450. * is <code>true</code> when the primitive is constructed.
  30451. * <p>
  30452. * Changing this property after the primitive is rendered has no effect.
  30453. * </p>
  30454. */
  30455. readonly geometryInstances: any[] | GeometryInstance;
  30456. /**
  30457. * Determines if the primitive will be shown. This affects all geometry
  30458. * instances in the primitive.
  30459. */
  30460. show: boolean;
  30461. /**
  30462. * Determines whether terrain, 3D Tiles or both will be classified.
  30463. */
  30464. classificationType: ClassificationType;
  30465. /**
  30466. * This property is for debugging only; it is not for production use nor is it optimized.
  30467. * <p>
  30468. * Draws the bounding sphere for each draw command in the primitive.
  30469. * </p>
  30470. */
  30471. debugShowBoundingVolume: boolean;
  30472. /**
  30473. * This property is for debugging only; it is not for production use nor is it optimized.
  30474. * <p>
  30475. * Draws the shadow volume for each geometry in the primitive.
  30476. * </p>
  30477. */
  30478. debugShowShadowVolume: boolean;
  30479. /**
  30480. * When <code>true</code>, geometry vertices are optimized for the pre and post-vertex-shader caches.
  30481. */
  30482. readonly vertexCacheOptimize: boolean;
  30483. /**
  30484. * Determines if geometry vertex attributes are interleaved, which can slightly improve rendering performance.
  30485. */
  30486. readonly interleave: boolean;
  30487. /**
  30488. * When <code>true</code>, the primitive does not keep a reference to the input <code>geometryInstances</code> to save memory.
  30489. */
  30490. readonly releaseGeometryInstances: boolean;
  30491. /**
  30492. * When <code>true</code>, each geometry instance will only be pickable with {@link Scene#pick}. When <code>false</code>, GPU memory is saved.
  30493. */
  30494. readonly allowPicking: boolean;
  30495. /**
  30496. * Determines if the geometry instances will be created and batched on a web worker.
  30497. */
  30498. readonly asynchronous: boolean;
  30499. /**
  30500. * When <code>true</code>, geometry vertices are compressed, which will save memory.
  30501. */
  30502. readonly compressVertices: boolean;
  30503. /**
  30504. * Determines if the primitive is complete and ready to render. If this property is
  30505. * true, the primitive will be rendered the next time that {@link GroundPrimitive#update}
  30506. * is called.
  30507. */
  30508. readonly ready: boolean;
  30509. /**
  30510. * Gets a promise that resolves when the primitive is ready to render.
  30511. */
  30512. readonly readyPromise: Promise<GroundPrimitive>;
  30513. /**
  30514. * Determines if GroundPrimitive rendering is supported.
  30515. * @param scene - The scene.
  30516. * @returns <code>true</code> if GroundPrimitives are supported; otherwise, returns <code>false</code>
  30517. */
  30518. static isSupported(scene: Scene): boolean;
  30519. /**
  30520. * Initializes the minimum and maximum terrain heights. This only needs to be called if you are creating the
  30521. * GroundPrimitive synchronously.
  30522. * @returns A promise that will resolve once the terrain heights have been loaded.
  30523. */
  30524. static initializeTerrainHeights(): Promise<void>;
  30525. /**
  30526. * Called when {@link Viewer} or {@link CesiumWidget} render the scene to
  30527. * get the draw commands needed to render this primitive.
  30528. * <p>
  30529. * Do not call this function directly. This is documented just to
  30530. * list the exceptions that may be propagated when the scene is rendered:
  30531. * </p>
  30532. */
  30533. update(): void;
  30534. /**
  30535. * Returns the modifiable per-instance attributes for a {@link GeometryInstance}.
  30536. * @example
  30537. * var attributes = primitive.getGeometryInstanceAttributes('an id');
  30538. * attributes.color = Cesium.ColorGeometryInstanceAttribute.toValue(Cesium.Color.AQUA);
  30539. * attributes.show = Cesium.ShowGeometryInstanceAttribute.toValue(true);
  30540. * @param id - The id of the {@link GeometryInstance}.
  30541. * @returns The typed array in the attribute's format or undefined if the is no instance with id.
  30542. */
  30543. getGeometryInstanceAttributes(id: any): any;
  30544. /**
  30545. * Returns true if this object was destroyed; otherwise, false.
  30546. * <p>
  30547. * If this object was destroyed, it should not be used; calling any function other than
  30548. * <code>isDestroyed</code> will result in a {@link DeveloperError} exception.
  30549. * </p>
  30550. * @returns <code>true</code> if this object was destroyed; otherwise, <code>false</code>.
  30551. */
  30552. isDestroyed(): boolean;
  30553. /**
  30554. * Destroys the WebGL resources held by this object. Destroying an object allows for deterministic
  30555. * release of WebGL resources, instead of relying on the garbage collector to destroy this object.
  30556. * <p>
  30557. * Once an object is destroyed, it should not be used; calling any function other than
  30558. * <code>isDestroyed</code> will result in a {@link DeveloperError} exception. Therefore,
  30559. * assign the return value (<code>undefined</code>) to the object as done in the example.
  30560. * </p>
  30561. * @example
  30562. * e = e && e.destroy();
  30563. */
  30564. destroy(): void;
  30565. /**
  30566. * Checks if the given Scene supports materials on GroundPrimitives.
  30567. * Materials on GroundPrimitives require support for the WEBGL_depth_texture extension.
  30568. * @param scene - The current scene.
  30569. * @returns Whether or not the current scene supports materials on GroundPrimitives.
  30570. */
  30571. static supportsMaterials(scene: Scene): boolean;
  30572. }
  30573. /**
  30574. * Represents the position relative to the terrain.
  30575. */
  30576. export enum HeightReference {
  30577. /**
  30578. * The position is absolute.
  30579. */
  30580. NONE = 0,
  30581. /**
  30582. * The position is clamped to the terrain.
  30583. */
  30584. CLAMP_TO_GROUND = 1,
  30585. /**
  30586. * The position height is the height above the terrain.
  30587. */
  30588. RELATIVE_TO_GROUND = 2
  30589. }
  30590. /**
  30591. * The horizontal location of an origin relative to an object, e.g., a {@link Billboard}
  30592. * or {@link Label}. For example, setting the horizontal origin to <code>LEFT</code>
  30593. * or <code>RIGHT</code> will display a billboard to the left or right (in screen space)
  30594. * of the anchor position.
  30595. * <br /><br />
  30596. * <div align='center'>
  30597. * <img src='Images/Billboard.setHorizontalOrigin.png' width='648' height='196' /><br />
  30598. * </div>
  30599. */
  30600. export enum HorizontalOrigin {
  30601. /**
  30602. * The origin is at the horizontal center of the object.
  30603. */
  30604. CENTER = 0,
  30605. /**
  30606. * The origin is on the left side of the object.
  30607. */
  30608. LEFT = 1,
  30609. /**
  30610. * The origin is on the right side of the object.
  30611. */
  30612. RIGHT = -1
  30613. }
  30614. /**
  30615. * An imagery layer that displays tiled image data from a single imagery provider
  30616. * on a {@link Globe}.
  30617. * @param imageryProvider - The imagery provider to use.
  30618. * @param [options] - Object with the following properties:
  30619. * @param [options.rectangle = imageryProvider.rectangle] - The rectangle of the layer. This rectangle
  30620. * can limit the visible portion of the imagery provider.
  30621. * @param [options.alpha = 1.0] - The alpha blending value of this layer, from 0.0 to 1.0.
  30622. * This can either be a simple number or a function with the signature
  30623. * <code>function(frameState, layer, x, y, level)</code>. The function is passed the
  30624. * current frame state, this layer, and the x, y, and level coordinates of the
  30625. * imagery tile for which the alpha is required, and it is expected to return
  30626. * the alpha value to use for the tile.
  30627. * @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.
  30628. * This can either be a simple number or a function with the signature
  30629. * <code>function(frameState, layer, x, y, level)</code>. The function is passed the
  30630. * current frame state, this layer, and the x, y, and level coordinates of the
  30631. * imagery tile for which the alpha is required, and it is expected to return
  30632. * the alpha value to use for the tile. This only takes effect when <code>enableLighting</code> is <code>true</code>.
  30633. * @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.
  30634. * This can either be a simple number or a function with the signature
  30635. * <code>function(frameState, layer, x, y, level)</code>. The function is passed the
  30636. * current frame state, this layer, and the x, y, and level coordinates of the
  30637. * imagery tile for which the alpha is required, and it is expected to return
  30638. * the alpha value to use for the tile. This only takes effect when <code>enableLighting</code> is <code>true</code>.
  30639. * @param [options.brightness = 1.0] - The brightness of this layer. 1.0 uses the unmodified imagery
  30640. * color. Less than 1.0 makes the imagery darker while greater than 1.0 makes it brighter.
  30641. * This can either be a simple number or a function with the signature
  30642. * <code>function(frameState, layer, x, y, level)</code>. The function is passed the
  30643. * current frame state, this layer, and the x, y, and level coordinates of the
  30644. * imagery tile for which the brightness is required, and it is expected to return
  30645. * the brightness value to use for the tile. The function is executed for every
  30646. * frame and for every tile, so it must be fast.
  30647. * @param [options.contrast = 1.0] - The contrast of this layer. 1.0 uses the unmodified imagery color.
  30648. * Less than 1.0 reduces the contrast while greater than 1.0 increases it.
  30649. * This can either be a simple number or a function with the signature
  30650. * <code>function(frameState, layer, x, y, level)</code>. The function is passed the
  30651. * current frame state, this layer, and the x, y, and level coordinates of the
  30652. * imagery tile for which the contrast is required, and it is expected to return
  30653. * the contrast value to use for the tile. The function is executed for every
  30654. * frame and for every tile, so it must be fast.
  30655. * @param [options.hue = 0.0] - The hue of this layer. 0.0 uses the unmodified imagery color.
  30656. * This can either be a simple number or a function with the signature
  30657. * <code>function(frameState, layer, x, y, level)</code>. The function is passed the
  30658. * current frame state, this layer, and the x, y, and level coordinates
  30659. * of the imagery tile for which the hue is required, and it is expected to return
  30660. * the contrast value to use for the tile. The function is executed for every
  30661. * frame and for every tile, so it must be fast.
  30662. * @param [options.saturation = 1.0] - The saturation of this layer. 1.0 uses the unmodified imagery color.
  30663. * Less than 1.0 reduces the saturation while greater than 1.0 increases it.
  30664. * This can either be a simple number or a function with the signature
  30665. * <code>function(frameState, layer, x, y, level)</code>. The function is passed the
  30666. * current frame state, this layer, and the x, y, and level coordinates
  30667. * of the imagery tile for which the saturation is required, and it is expected to return
  30668. * the contrast value to use for the tile. The function is executed for every
  30669. * frame and for every tile, so it must be fast.
  30670. * @param [options.gamma = 1.0] - The gamma correction to apply to this layer. 1.0 uses the unmodified imagery color.
  30671. * This can either be a simple number or a function with the signature
  30672. * <code>function(frameState, layer, x, y, level)</code>. The function is passed the
  30673. * current frame state, this layer, and the x, y, and level coordinates of the
  30674. * imagery tile for which the gamma is required, and it is expected to return
  30675. * the gamma value to use for the tile. The function is executed for every
  30676. * frame and for every tile, so it must be fast.
  30677. * @param [options.splitDirection = ImagerySplitDirection.NONE] - The {@link ImagerySplitDirection} split to apply to this layer.
  30678. * @param [options.minificationFilter = TextureMinificationFilter.LINEAR] - The
  30679. * texture minification filter to apply to this layer. Possible values
  30680. * are <code>TextureMinificationFilter.LINEAR</code> and
  30681. * <code>TextureMinificationFilter.NEAREST</code>.
  30682. * @param [options.magnificationFilter = TextureMagnificationFilter.LINEAR] - The
  30683. * texture minification filter to apply to this layer. Possible values
  30684. * are <code>TextureMagnificationFilter.LINEAR</code> and
  30685. * <code>TextureMagnificationFilter.NEAREST</code>.
  30686. * @param [options.show = true] - True if the layer is shown; otherwise, false.
  30687. * @param [options.maximumAnisotropy = maximum supported] - The maximum anisotropy level to use
  30688. * for texture filtering. If this parameter is not specified, the maximum anisotropy supported
  30689. * by the WebGL stack will be used. Larger values make the imagery look better in horizon
  30690. * views.
  30691. * @param [options.minimumTerrainLevel] - The minimum terrain level-of-detail at which to show this imagery layer,
  30692. * or undefined to show it at all levels. Level zero is the least-detailed level.
  30693. * @param [options.maximumTerrainLevel] - The maximum terrain level-of-detail at which to show this imagery layer,
  30694. * or undefined to show it at all levels. Level zero is the least-detailed level.
  30695. * @param [options.cutoutRectangle] - Cartographic rectangle for cutting out a portion of this ImageryLayer.
  30696. * @param [options.colorToAlpha] - Color to be used as alpha.
  30697. * @param [options.colorToAlphaThreshold = 0.004] - Threshold for color-to-alpha.
  30698. */
  30699. export class ImageryLayer {
  30700. constructor(imageryProvider: ImageryProvider, options?: {
  30701. rectangle?: Rectangle;
  30702. alpha?: number | ((...params: any[]) => any);
  30703. nightAlpha?: number | ((...params: any[]) => any);
  30704. dayAlpha?: number | ((...params: any[]) => any);
  30705. brightness?: number | ((...params: any[]) => any);
  30706. contrast?: number | ((...params: any[]) => any);
  30707. hue?: number | ((...params: any[]) => any);
  30708. saturation?: number | ((...params: any[]) => any);
  30709. gamma?: number | ((...params: any[]) => any);
  30710. splitDirection?: ImagerySplitDirection | ((...params: any[]) => any);
  30711. minificationFilter?: TextureMinificationFilter;
  30712. magnificationFilter?: TextureMagnificationFilter;
  30713. show?: boolean;
  30714. maximumAnisotropy?: number;
  30715. minimumTerrainLevel?: number;
  30716. maximumTerrainLevel?: number;
  30717. cutoutRectangle?: Rectangle;
  30718. colorToAlpha?: Color;
  30719. colorToAlphaThreshold?: number;
  30720. });
  30721. /**
  30722. * The alpha blending value of this layer, with 0.0 representing fully transparent and
  30723. * 1.0 representing fully opaque.
  30724. */
  30725. alpha: number;
  30726. /**
  30727. * The alpha blending value of this layer on the night side of the globe, with 0.0 representing fully transparent and
  30728. * 1.0 representing fully opaque. This only takes effect when {@link Globe#enableLighting} is <code>true</code>.
  30729. */
  30730. nightAlpha: number;
  30731. /**
  30732. * The alpha blending value of this layer on the day side of the globe, with 0.0 representing fully transparent and
  30733. * 1.0 representing fully opaque. This only takes effect when {@link Globe#enableLighting} is <code>true</code>.
  30734. */
  30735. dayAlpha: number;
  30736. /**
  30737. * The brightness of this layer. 1.0 uses the unmodified imagery color. Less than 1.0
  30738. * makes the imagery darker while greater than 1.0 makes it brighter.
  30739. */
  30740. brightness: number;
  30741. /**
  30742. * The contrast of this layer. 1.0 uses the unmodified imagery color. Less than 1.0 reduces
  30743. * the contrast while greater than 1.0 increases it.
  30744. */
  30745. contrast: number;
  30746. /**
  30747. * The hue of this layer in radians. 0.0 uses the unmodified imagery color.
  30748. */
  30749. hue: number;
  30750. /**
  30751. * The saturation of this layer. 1.0 uses the unmodified imagery color. Less than 1.0 reduces the
  30752. * saturation while greater than 1.0 increases it.
  30753. */
  30754. saturation: number;
  30755. /**
  30756. * The gamma correction to apply to this layer. 1.0 uses the unmodified imagery color.
  30757. */
  30758. gamma: number;
  30759. /**
  30760. * The {@link ImagerySplitDirection} to apply to this layer.
  30761. */
  30762. splitDirection: ImagerySplitDirection;
  30763. /**
  30764. * The {@link TextureMinificationFilter} to apply to this layer.
  30765. * Possible values are {@link TextureMinificationFilter.LINEAR} (the default)
  30766. * and {@link TextureMinificationFilter.NEAREST}.
  30767. *
  30768. * To take effect, this property must be set immediately after adding the imagery layer.
  30769. * Once a texture is loaded it won't be possible to change the texture filter used.
  30770. */
  30771. minificationFilter: TextureMinificationFilter;
  30772. /**
  30773. * The {@link TextureMagnificationFilter} to apply to this layer.
  30774. * Possible values are {@link TextureMagnificationFilter.LINEAR} (the default)
  30775. * and {@link TextureMagnificationFilter.NEAREST}.
  30776. *
  30777. * To take effect, this property must be set immediately after adding the imagery layer.
  30778. * Once a texture is loaded it won't be possible to change the texture filter used.
  30779. */
  30780. magnificationFilter: TextureMagnificationFilter;
  30781. /**
  30782. * Determines if this layer is shown.
  30783. */
  30784. show: boolean;
  30785. /**
  30786. * Rectangle cutout in this layer of imagery.
  30787. */
  30788. cutoutRectangle: Rectangle;
  30789. /**
  30790. * Color value that should be set to transparent.
  30791. */
  30792. colorToAlpha: Color;
  30793. /**
  30794. * Normalized (0-1) threshold for color-to-alpha.
  30795. */
  30796. colorToAlphaThreshold: number;
  30797. /**
  30798. * Gets the imagery provider for this layer.
  30799. */
  30800. readonly imageryProvider: ImageryProvider;
  30801. /**
  30802. * Gets the rectangle of this layer. If this rectangle is smaller than the rectangle of the
  30803. * {@link ImageryProvider}, only a portion of the imagery provider is shown.
  30804. */
  30805. readonly rectangle: Rectangle;
  30806. /**
  30807. * This value is used as the default brightness for the imagery layer if one is not provided during construction
  30808. * or by the imagery provider. This value does not modify the brightness of the imagery.
  30809. */
  30810. static DEFAULT_BRIGHTNESS: number;
  30811. /**
  30812. * This value is used as the default contrast for the imagery layer if one is not provided during construction
  30813. * or by the imagery provider. This value does not modify the contrast of the imagery.
  30814. */
  30815. static DEFAULT_CONTRAST: number;
  30816. /**
  30817. * This value is used as the default hue for the imagery layer if one is not provided during construction
  30818. * or by the imagery provider. This value does not modify the hue of the imagery.
  30819. */
  30820. static DEFAULT_HUE: number;
  30821. /**
  30822. * This value is used as the default saturation for the imagery layer if one is not provided during construction
  30823. * or by the imagery provider. This value does not modify the saturation of the imagery.
  30824. */
  30825. static DEFAULT_SATURATION: number;
  30826. /**
  30827. * This value is used as the default gamma for the imagery layer if one is not provided during construction
  30828. * or by the imagery provider. This value does not modify the gamma of the imagery.
  30829. */
  30830. static DEFAULT_GAMMA: number;
  30831. /**
  30832. * This value is used as the default split for the imagery layer if one is not provided during construction
  30833. * or by the imagery provider.
  30834. */
  30835. static DEFAULT_SPLIT: ImagerySplitDirection;
  30836. /**
  30837. * This value is used as the default texture minification filter for the imagery layer if one is not provided
  30838. * during construction or by the imagery provider.
  30839. */
  30840. static DEFAULT_MINIFICATION_FILTER: TextureMinificationFilter;
  30841. /**
  30842. * This value is used as the default texture magnification filter for the imagery layer if one is not provided
  30843. * during construction or by the imagery provider.
  30844. */
  30845. static DEFAULT_MAGNIFICATION_FILTER: TextureMagnificationFilter;
  30846. /**
  30847. * This value is used as the default threshold for color-to-alpha if one is not provided
  30848. * during construction or by the imagery provider.
  30849. */
  30850. static DEFAULT_APPLY_COLOR_TO_ALPHA_THRESHOLD: number;
  30851. /**
  30852. * Gets a value indicating whether this layer is the base layer in the
  30853. * {@link ImageryLayerCollection}. The base layer is the one that underlies all
  30854. * others. It is special in that it is treated as if it has global rectangle, even if
  30855. * it actually does not, by stretching the texels at the edges over the entire
  30856. * globe.
  30857. * @returns true if this is the base layer; otherwise, false.
  30858. */
  30859. isBaseLayer(): boolean;
  30860. /**
  30861. * Returns true if this object was destroyed; otherwise, false.
  30862. * <br /><br />
  30863. * If this object was destroyed, it should not be used; calling any function other than
  30864. * <code>isDestroyed</code> will result in a {@link DeveloperError} exception.
  30865. * @returns True if this object was destroyed; otherwise, false.
  30866. */
  30867. isDestroyed(): boolean;
  30868. /**
  30869. * Destroys the WebGL resources held by this object. Destroying an object allows for deterministic
  30870. * release of WebGL resources, instead of relying on the garbage collector to destroy this object.
  30871. * <br /><br />
  30872. * Once an object is destroyed, it should not be used; calling any function other than
  30873. * <code>isDestroyed</code> will result in a {@link DeveloperError} exception. Therefore,
  30874. * assign the return value (<code>undefined</code>) to the object as done in the example.
  30875. * @example
  30876. * imageryLayer = imageryLayer && imageryLayer.destroy();
  30877. */
  30878. destroy(): void;
  30879. /**
  30880. * Computes the intersection of this layer's rectangle with the imagery provider's availability rectangle,
  30881. * producing the overall bounds of imagery that can be produced by this layer.
  30882. * @example
  30883. * // Zoom to an imagery layer.
  30884. * imageryLayer.getViewableRectangle().then(function (rectangle) {
  30885. * return camera.flyTo({
  30886. * destination: rectangle
  30887. * });
  30888. * });
  30889. * @returns A promise to a rectangle which defines the overall bounds of imagery that can be produced by this layer.
  30890. */
  30891. getViewableRectangle(): Promise<Rectangle>;
  30892. }
  30893. /**
  30894. * An ordered collection of imagery layers.
  30895. */
  30896. export class ImageryLayerCollection {
  30897. constructor();
  30898. /**
  30899. * An event that is raised when a layer is added to the collection. Event handlers are passed the layer that
  30900. * was added and the index at which it was added.
  30901. */
  30902. layerAdded: Event;
  30903. /**
  30904. * An event that is raised when a layer is removed from the collection. Event handlers are passed the layer that
  30905. * was removed and the index from which it was removed.
  30906. */
  30907. layerRemoved: Event;
  30908. /**
  30909. * An event that is raised when a layer changes position in the collection. Event handlers are passed the layer that
  30910. * was moved, its new index after the move, and its old index prior to the move.
  30911. */
  30912. layerMoved: Event;
  30913. /**
  30914. * An event that is raised when a layer is shown or hidden by setting the
  30915. * {@link ImageryLayer#show} property. Event handlers are passed a reference to this layer,
  30916. * the index of the layer in the collection, and a flag that is true if the layer is now
  30917. * shown or false if it is now hidden.
  30918. */
  30919. layerShownOrHidden: Event;
  30920. /**
  30921. * Gets the number of layers in this collection.
  30922. */
  30923. length: number;
  30924. /**
  30925. * Adds a layer to the collection.
  30926. * @param layer - the layer to add.
  30927. * @param [index] - the index to add the layer at. If omitted, the layer will
  30928. * be added on top of all existing layers.
  30929. */
  30930. add(layer: ImageryLayer, index?: number): void;
  30931. /**
  30932. * Creates a new layer using the given ImageryProvider and adds it to the collection.
  30933. * @param imageryProvider - the imagery provider to create a new layer for.
  30934. * @param [index] - the index to add the layer at. If omitted, the layer will
  30935. * added on top of all existing layers.
  30936. * @returns The newly created layer.
  30937. */
  30938. addImageryProvider(imageryProvider: ImageryProvider, index?: number): ImageryLayer;
  30939. /**
  30940. * Removes a layer from this collection, if present.
  30941. * @param layer - The layer to remove.
  30942. * @param [destroy = true] - whether to destroy the layers in addition to removing them.
  30943. * @returns true if the layer was in the collection and was removed,
  30944. * false if the layer was not in the collection.
  30945. */
  30946. remove(layer: ImageryLayer, destroy?: boolean): boolean;
  30947. /**
  30948. * Removes all layers from this collection.
  30949. * @param [destroy = true] - whether to destroy the layers in addition to removing them.
  30950. */
  30951. removeAll(destroy?: boolean): void;
  30952. /**
  30953. * Checks to see if the collection contains a given layer.
  30954. * @param layer - the layer to check for.
  30955. * @returns true if the collection contains the layer, false otherwise.
  30956. */
  30957. contains(layer: ImageryLayer): boolean;
  30958. /**
  30959. * Determines the index of a given layer in the collection.
  30960. * @param layer - The layer to find the index of.
  30961. * @returns The index of the layer in the collection, or -1 if the layer does not exist in the collection.
  30962. */
  30963. indexOf(layer: ImageryLayer): number;
  30964. /**
  30965. * Gets a layer by index from the collection.
  30966. * @param index - the index to retrieve.
  30967. * @returns The imagery layer at the given index.
  30968. */
  30969. get(index: number): ImageryLayer;
  30970. /**
  30971. * Raises a layer up one position in the collection.
  30972. * @param layer - the layer to move.
  30973. */
  30974. raise(layer: ImageryLayer): void;
  30975. /**
  30976. * Lowers a layer down one position in the collection.
  30977. * @param layer - the layer to move.
  30978. */
  30979. lower(layer: ImageryLayer): void;
  30980. /**
  30981. * Raises a layer to the top of the collection.
  30982. * @param layer - the layer to move.
  30983. */
  30984. raiseToTop(layer: ImageryLayer): void;
  30985. /**
  30986. * Lowers a layer to the bottom of the collection.
  30987. * @param layer - the layer to move.
  30988. */
  30989. lowerToBottom(layer: ImageryLayer): void;
  30990. /**
  30991. * Asynchronously determines the imagery layer features that are intersected by a pick ray. The intersected imagery
  30992. * layer features are found by invoking {@link ImageryProvider#pickFeatures} for each imagery layer tile intersected
  30993. * by the pick ray. To compute a pick ray from a location on the screen, use {@link Camera.getPickRay}.
  30994. * @example
  30995. * var pickRay = viewer.camera.getPickRay(windowPosition);
  30996. * var featuresPromise = viewer.imageryLayers.pickImageryLayerFeatures(pickRay, viewer.scene);
  30997. * if (!Cesium.defined(featuresPromise)) {
  30998. * console.log('No features picked.');
  30999. * } else {
  31000. * Cesium.when(featuresPromise, function(features) {
  31001. * // This function is called asynchronously when the list if picked features is available.
  31002. * console.log('Number of features: ' + features.length);
  31003. * if (features.length > 0) {
  31004. * console.log('First feature name: ' + features[0].name);
  31005. * }
  31006. * });
  31007. * }
  31008. * @param ray - The ray to test for intersection.
  31009. * @param scene - The scene.
  31010. * @returns A promise that resolves to an array of features intersected by the pick ray.
  31011. * If it can be quickly determined that no features are intersected (for example,
  31012. * because no active imagery providers support {@link ImageryProvider#pickFeatures}
  31013. * or because the pick ray does not intersect the surface), this function will
  31014. * return undefined.
  31015. */
  31016. pickImageryLayerFeatures(ray: Ray, scene: Scene): Promise<ImageryLayerFeatureInfo[]> | undefined;
  31017. /**
  31018. * Returns true if this object was destroyed; otherwise, false.
  31019. * <br /><br />
  31020. * If this object was destroyed, it should not be used; calling any function other than
  31021. * <code>isDestroyed</code> will result in a {@link DeveloperError} exception.
  31022. * @returns true if this object was destroyed; otherwise, false.
  31023. */
  31024. isDestroyed(): boolean;
  31025. /**
  31026. * Destroys the WebGL resources held by all layers in this collection. Explicitly destroying this
  31027. * object allows for deterministic release of WebGL resources, instead of relying on the garbage
  31028. * collector.
  31029. * <br /><br />
  31030. * Once this object is destroyed, it should not be used; calling any function other than
  31031. * <code>isDestroyed</code> will result in a {@link DeveloperError} exception. Therefore,
  31032. * assign the return value (<code>undefined</code>) to the object as done in the example.
  31033. * @example
  31034. * layerCollection = layerCollection && layerCollection.destroy();
  31035. */
  31036. destroy(): void;
  31037. }
  31038. /**
  31039. * Describes a rasterized feature, such as a point, polygon, polyline, etc., in an imagery layer.
  31040. */
  31041. export class ImageryLayerFeatureInfo {
  31042. constructor();
  31043. /**
  31044. * Gets or sets the name of the feature.
  31045. */
  31046. name: string | undefined;
  31047. /**
  31048. * Gets or sets an HTML description of the feature. The HTML is not trusted and should
  31049. * be sanitized before display to the user.
  31050. */
  31051. description: string | undefined;
  31052. /**
  31053. * Gets or sets the position of the feature, or undefined if the position is not known.
  31054. */
  31055. position: Cartographic | undefined;
  31056. /**
  31057. * Gets or sets the raw data describing the feature. The raw data may be in any
  31058. * number of formats, such as GeoJSON, KML, etc.
  31059. */
  31060. data: any | undefined;
  31061. /**
  31062. * Gets or sets the image layer of the feature.
  31063. */
  31064. imageryLayer: any | undefined;
  31065. /**
  31066. * Configures the name of this feature by selecting an appropriate property. The name will be obtained from
  31067. * one of the following sources, in this order: 1) the property with the name 'name', 2) the property with the name 'title',
  31068. * 3) the first property containing the word 'name', 4) the first property containing the word 'title'. If
  31069. * the name cannot be obtained from any of these sources, the existing name will be left unchanged.
  31070. * @param properties - An object literal containing the properties of the feature.
  31071. */
  31072. configureNameFromProperties(properties: any): void;
  31073. /**
  31074. * Configures the description of this feature by creating an HTML table of properties and their values.
  31075. * @param properties - An object literal containing the properties of the feature.
  31076. */
  31077. configureDescriptionFromProperties(properties: any): void;
  31078. }
  31079. /**
  31080. * Provides imagery to be displayed on the surface of an ellipsoid. This type describes an
  31081. * interface and is not intended to be instantiated directly.
  31082. */
  31083. export class ImageryProvider {
  31084. constructor();
  31085. /**
  31086. * The default alpha blending value of this provider, with 0.0 representing fully transparent and
  31087. * 1.0 representing fully opaque.
  31088. */
  31089. defaultAlpha: number | undefined;
  31090. /**
  31091. * The default alpha blending value on the night side of the globe of this provider, with 0.0 representing fully transparent and
  31092. * 1.0 representing fully opaque.
  31093. */
  31094. defaultNightAlpha: number | undefined;
  31095. /**
  31096. * The default alpha blending value on the day side of the globe of this provider, with 0.0 representing fully transparent and
  31097. * 1.0 representing fully opaque.
  31098. */
  31099. defaultDayAlpha: number | undefined;
  31100. /**
  31101. * The default brightness of this provider. 1.0 uses the unmodified imagery color. Less than 1.0
  31102. * makes the imagery darker while greater than 1.0 makes it brighter.
  31103. */
  31104. defaultBrightness: number | undefined;
  31105. /**
  31106. * The default contrast of this provider. 1.0 uses the unmodified imagery color. Less than 1.0 reduces
  31107. * the contrast while greater than 1.0 increases it.
  31108. */
  31109. defaultContrast: number | undefined;
  31110. /**
  31111. * The default hue of this provider in radians. 0.0 uses the unmodified imagery color.
  31112. */
  31113. defaultHue: number | undefined;
  31114. /**
  31115. * The default saturation of this provider. 1.0 uses the unmodified imagery color. Less than 1.0 reduces the
  31116. * saturation while greater than 1.0 increases it.
  31117. */
  31118. defaultSaturation: number | undefined;
  31119. /**
  31120. * The default gamma correction to apply to this provider. 1.0 uses the unmodified imagery color.
  31121. */
  31122. defaultGamma: number | undefined;
  31123. /**
  31124. * The default texture minification filter to apply to this provider.
  31125. */
  31126. defaultMinificationFilter: TextureMinificationFilter;
  31127. /**
  31128. * The default texture magnification filter to apply to this provider.
  31129. */
  31130. defaultMagnificationFilter: TextureMagnificationFilter;
  31131. /**
  31132. * Gets a value indicating whether or not the provider is ready for use.
  31133. */
  31134. readonly ready: boolean;
  31135. /**
  31136. * Gets a promise that resolves to true when the provider is ready for use.
  31137. */
  31138. readonly readyPromise: Promise<boolean>;
  31139. /**
  31140. * Gets the rectangle, in radians, of the imagery provided by the instance. This function should
  31141. * not be called before {@link ImageryProvider#ready} returns true.
  31142. */
  31143. readonly rectangle: Rectangle;
  31144. /**
  31145. * Gets the width of each tile, in pixels. This function should
  31146. * not be called before {@link ImageryProvider#ready} returns true.
  31147. */
  31148. readonly tileWidth: number;
  31149. /**
  31150. * Gets the height of each tile, in pixels. This function should
  31151. * not be called before {@link ImageryProvider#ready} returns true.
  31152. */
  31153. readonly tileHeight: number;
  31154. /**
  31155. * Gets the maximum level-of-detail that can be requested. This function should
  31156. * not be called before {@link ImageryProvider#ready} returns true.
  31157. */
  31158. readonly maximumLevel: number | undefined;
  31159. /**
  31160. * Gets the minimum level-of-detail that can be requested. This function should
  31161. * not be called before {@link ImageryProvider#ready} returns true. Generally,
  31162. * a minimum level should only be used when the rectangle of the imagery is small
  31163. * enough that the number of tiles at the minimum level is small. An imagery
  31164. * provider with more than a few tiles at the minimum level will lead to
  31165. * rendering problems.
  31166. */
  31167. readonly minimumLevel: number;
  31168. /**
  31169. * Gets the tiling scheme used by the provider. This function should
  31170. * not be called before {@link ImageryProvider#ready} returns true.
  31171. */
  31172. readonly tilingScheme: TilingScheme;
  31173. /**
  31174. * Gets the tile discard policy. If not undefined, the discard policy is responsible
  31175. * for filtering out "missing" tiles via its shouldDiscardImage function. If this function
  31176. * returns undefined, no tiles are filtered. This function should
  31177. * not be called before {@link ImageryProvider#ready} returns true.
  31178. */
  31179. readonly tileDiscardPolicy: TileDiscardPolicy;
  31180. /**
  31181. * Gets an event that is raised when the imagery provider encounters an asynchronous error.. By subscribing
  31182. * to the event, you will be notified of the error and can potentially recover from it. Event listeners
  31183. * are passed an instance of {@link TileProviderError}.
  31184. */
  31185. readonly errorEvent: Event;
  31186. /**
  31187. * Gets the credit to display when this imagery provider is active. Typically this is used to credit
  31188. * the source of the imagery. This function should
  31189. * not be called before {@link ImageryProvider#ready} returns true.
  31190. */
  31191. readonly credit: Credit;
  31192. /**
  31193. * Gets the proxy used by this provider.
  31194. */
  31195. readonly proxy: Proxy;
  31196. /**
  31197. * Gets a value indicating whether or not the images provided by this imagery provider
  31198. * include an alpha channel. If this property is false, an alpha channel, if present, will
  31199. * be ignored. If this property is true, any images without an alpha channel will be treated
  31200. * as if their alpha is 1.0 everywhere. When this property is false, memory usage
  31201. * and texture upload time are reduced.
  31202. */
  31203. readonly hasAlphaChannel: boolean;
  31204. /**
  31205. * Gets the credits to be displayed when a given tile is displayed.
  31206. * @param x - The tile X coordinate.
  31207. * @param y - The tile Y coordinate.
  31208. * @param level - The tile level;
  31209. * @returns The credits to be displayed when the tile is displayed.
  31210. */
  31211. getTileCredits(x: number, y: number, level: number): Credit[];
  31212. /**
  31213. * Requests the image for a given tile. This function should
  31214. * not be called before {@link ImageryProvider#ready} returns true.
  31215. * @param x - The tile X coordinate.
  31216. * @param y - The tile Y coordinate.
  31217. * @param level - The tile level.
  31218. * @param [request] - The request object. Intended for internal use only.
  31219. * @returns A promise for the image that will resolve when the image is available, or
  31220. * undefined if there are too many active requests to the server, and the request
  31221. * should be retried later. The resolved image may be either an
  31222. * Image or a Canvas DOM object.
  31223. */
  31224. requestImage(x: number, y: number, level: number, request?: Request): Promise<HTMLImageElement | HTMLCanvasElement> | undefined;
  31225. /**
  31226. * Asynchronously determines what features, if any, are located at a given longitude and latitude within
  31227. * a tile. This function should not be called before {@link ImageryProvider#ready} returns true.
  31228. * This function is optional, so it may not exist on all ImageryProviders.
  31229. * @param x - The tile X coordinate.
  31230. * @param y - The tile Y coordinate.
  31231. * @param level - The tile level.
  31232. * @param longitude - The longitude at which to pick features.
  31233. * @param latitude - The latitude at which to pick features.
  31234. * @returns A promise for the picked features that will resolve when the asynchronous
  31235. * picking completes. The resolved value is an array of {@link ImageryLayerFeatureInfo}
  31236. * instances. The array may be empty if no features are found at the given location.
  31237. * It may also be undefined if picking is not supported.
  31238. */
  31239. pickFeatures(x: number, y: number, level: number, longitude: number, latitude: number): Promise<ImageryLayerFeatureInfo[]> | undefined;
  31240. /**
  31241. * Loads an image from a given URL. If the server referenced by the URL already has
  31242. * too many requests pending, this function will instead return undefined, indicating
  31243. * that the request should be retried later.
  31244. * @param imageryProvider - The imagery provider for the URL.
  31245. * @param url - The URL of the image.
  31246. * @returns A promise for the image that will resolve when the image is available, or
  31247. * undefined if there are too many active requests to the server, and the request
  31248. * should be retried later. The resolved image may be either an
  31249. * Image or a Canvas DOM object.
  31250. */
  31251. static loadImage(imageryProvider: ImageryProvider, url: Resource | string): Promise<HTMLImageElement | HTMLCanvasElement> | undefined;
  31252. }
  31253. /**
  31254. * The direction to display an ImageryLayer relative to the {@link Scene#imagerySplitPosition}.
  31255. */
  31256. export enum ImagerySplitDirection {
  31257. /**
  31258. * Display the ImageryLayer to the left of the {@link Scene#imagerySplitPosition}.
  31259. */
  31260. LEFT = -1,
  31261. /**
  31262. * Always display the ImageryLayer.
  31263. */
  31264. NONE = 0,
  31265. /**
  31266. * Display the ImageryLayer to the right of the {@link Scene#imagerySplitPosition}.
  31267. */
  31268. RIGHT = 1
  31269. }
  31270. export namespace IonImageryProvider {
  31271. /**
  31272. * Initialization options for the TileMapServiceImageryProvider constructor
  31273. * @property assetId - An ion imagery asset ID
  31274. * @property [accessToken = Ion.defaultAccessToken] - The access token to use.
  31275. * @property [server = Ion.defaultServer] - The resource to the Cesium ion API server.
  31276. */
  31277. type ConstructorOptions = {
  31278. assetId: number;
  31279. accessToken?: string;
  31280. server?: string | Resource;
  31281. };
  31282. }
  31283. /**
  31284. * Provides tiled imagery using the Cesium ion REST API.
  31285. * @example
  31286. * viewer.imageryLayers.addImageryProvider(new Cesium.IonImageryProvider({ assetId : 23489024 }));
  31287. * @param options - Object describing initialization options
  31288. */
  31289. export class IonImageryProvider {
  31290. constructor(options: IonImageryProvider.ConstructorOptions);
  31291. /**
  31292. * The default alpha blending value of this provider, with 0.0 representing fully transparent and
  31293. * 1.0 representing fully opaque.
  31294. */
  31295. defaultAlpha: number | undefined;
  31296. /**
  31297. * The default alpha blending value on the night side of the globe of this provider, with 0.0 representing fully transparent and
  31298. * 1.0 representing fully opaque.
  31299. */
  31300. defaultNightAlpha: number | undefined;
  31301. /**
  31302. * The default alpha blending value on the day side of the globe of this provider, with 0.0 representing fully transparent and
  31303. * 1.0 representing fully opaque.
  31304. */
  31305. defaultDayAlpha: number | undefined;
  31306. /**
  31307. * The default brightness of this provider. 1.0 uses the unmodified imagery color. Less than 1.0
  31308. * makes the imagery darker while greater than 1.0 makes it brighter.
  31309. */
  31310. defaultBrightness: number | undefined;
  31311. /**
  31312. * The default contrast of this provider. 1.0 uses the unmodified imagery color. Less than 1.0 reduces
  31313. * the contrast while greater than 1.0 increases it.
  31314. */
  31315. defaultContrast: number | undefined;
  31316. /**
  31317. * The default hue of this provider in radians. 0.0 uses the unmodified imagery color.
  31318. */
  31319. defaultHue: number | undefined;
  31320. /**
  31321. * The default saturation of this provider. 1.0 uses the unmodified imagery color. Less than 1.0 reduces the
  31322. * saturation while greater than 1.0 increases it.
  31323. */
  31324. defaultSaturation: number | undefined;
  31325. /**
  31326. * The default gamma correction to apply to this provider. 1.0 uses the unmodified imagery color.
  31327. */
  31328. defaultGamma: number | undefined;
  31329. /**
  31330. * The default texture minification filter to apply to this provider.
  31331. */
  31332. defaultMinificationFilter: TextureMinificationFilter;
  31333. /**
  31334. * The default texture magnification filter to apply to this provider.
  31335. */
  31336. defaultMagnificationFilter: TextureMagnificationFilter;
  31337. /**
  31338. * Gets a value indicating whether or not the provider is ready for use.
  31339. */
  31340. readonly ready: boolean;
  31341. /**
  31342. * Gets a promise that resolves to true when the provider is ready for use.
  31343. */
  31344. readonly readyPromise: Promise<boolean>;
  31345. /**
  31346. * Gets the rectangle, in radians, of the imagery provided by the instance. This function should
  31347. * not be called before {@link IonImageryProvider#ready} returns true.
  31348. */
  31349. readonly rectangle: Rectangle;
  31350. /**
  31351. * Gets the width of each tile, in pixels. This function should
  31352. * not be called before {@link IonImageryProvider#ready} returns true.
  31353. */
  31354. readonly tileWidth: number;
  31355. /**
  31356. * Gets the height of each tile, in pixels. This function should
  31357. * not be called before {@link IonImageryProvider#ready} returns true.
  31358. */
  31359. readonly tileHeight: number;
  31360. /**
  31361. * Gets the maximum level-of-detail that can be requested. This function should
  31362. * not be called before {@link IonImageryProvider#ready} returns true.
  31363. */
  31364. readonly maximumLevel: number | undefined;
  31365. /**
  31366. * Gets the minimum level-of-detail that can be requested. This function should
  31367. * not be called before {@link IonImageryProvider#ready} returns true. Generally,
  31368. * a minimum level should only be used when the rectangle of the imagery is small
  31369. * enough that the number of tiles at the minimum level is small. An imagery
  31370. * provider with more than a few tiles at the minimum level will lead to
  31371. * rendering problems.
  31372. */
  31373. readonly minimumLevel: number;
  31374. /**
  31375. * Gets the tiling scheme used by the provider. This function should
  31376. * not be called before {@link IonImageryProvider#ready} returns true.
  31377. */
  31378. readonly tilingScheme: TilingScheme;
  31379. /**
  31380. * Gets the tile discard policy. If not undefined, the discard policy is responsible
  31381. * for filtering out "missing" tiles via its shouldDiscardImage function. If this function
  31382. * returns undefined, no tiles are filtered. This function should
  31383. * not be called before {@link IonImageryProvider#ready} returns true.
  31384. */
  31385. readonly tileDiscardPolicy: TileDiscardPolicy;
  31386. /**
  31387. * Gets an event that is raised when the imagery provider encounters an asynchronous error. By subscribing
  31388. * to the event, you will be notified of the error and can potentially recover from it. Event listeners
  31389. * are passed an instance of {@link TileProviderError}.
  31390. */
  31391. readonly errorEvent: Event;
  31392. /**
  31393. * Gets the credit to display when this imagery provider is active. Typically this is used to credit
  31394. * the source of the imagery. This function should
  31395. * not be called before {@link IonImageryProvider#ready} returns true.
  31396. */
  31397. readonly credit: Credit;
  31398. /**
  31399. * Gets a value indicating whether or not the images provided by this imagery provider
  31400. * include an alpha channel. If this property is false, an alpha channel, if present, will
  31401. * be ignored. If this property is true, any images without an alpha channel will be treated
  31402. * as if their alpha is 1.0 everywhere. When this property is false, memory usage
  31403. * and texture upload time are reduced.
  31404. */
  31405. readonly hasAlphaChannel: boolean;
  31406. /**
  31407. * Gets the proxy used by this provider.
  31408. */
  31409. readonly proxy: Proxy;
  31410. /**
  31411. * Gets the credits to be displayed when a given tile is displayed.
  31412. * @param x - The tile X coordinate.
  31413. * @param y - The tile Y coordinate.
  31414. * @param level - The tile level;
  31415. * @returns The credits to be displayed when the tile is displayed.
  31416. */
  31417. getTileCredits(x: number, y: number, level: number): Credit[];
  31418. /**
  31419. * Requests the image for a given tile. This function should
  31420. * not be called before {@link IonImageryProvider#ready} returns true.
  31421. * @param x - The tile X coordinate.
  31422. * @param y - The tile Y coordinate.
  31423. * @param level - The tile level.
  31424. * @param [request] - The request object. Intended for internal use only.
  31425. * @returns A promise for the image that will resolve when the image is available, or
  31426. * undefined if there are too many active requests to the server, and the request
  31427. * should be retried later. The resolved image may be either an
  31428. * Image or a Canvas DOM object.
  31429. */
  31430. requestImage(x: number, y: number, level: number, request?: Request): Promise<HTMLImageElement | HTMLCanvasElement> | undefined;
  31431. /**
  31432. * Asynchronously determines what features, if any, are located at a given longitude and latitude within
  31433. * a tile. This function should not be called before {@link IonImageryProvider#ready} returns true.
  31434. * This function is optional, so it may not exist on all ImageryProviders.
  31435. * @param x - The tile X coordinate.
  31436. * @param y - The tile Y coordinate.
  31437. * @param level - The tile level.
  31438. * @param longitude - The longitude at which to pick features.
  31439. * @param latitude - The latitude at which to pick features.
  31440. * @returns A promise for the picked features that will resolve when the asynchronous
  31441. * picking completes. The resolved value is an array of {@link ImageryLayerFeatureInfo}
  31442. * instances. The array may be empty if no features are found at the given location.
  31443. * It may also be undefined if picking is not supported.
  31444. */
  31445. pickFeatures(x: number, y: number, level: number, longitude: number, latitude: number): Promise<ImageryLayerFeatureInfo[]> | undefined;
  31446. }
  31447. /**
  31448. * The types of imagery provided by {@link createWorldImagery}.
  31449. */
  31450. export enum IonWorldImageryStyle {
  31451. /**
  31452. * Aerial imagery.
  31453. */
  31454. AERIAL = 2,
  31455. /**
  31456. * Aerial imagery with a road overlay.
  31457. */
  31458. AERIAL_WITH_LABELS = 3,
  31459. /**
  31460. * Roads without additional imagery.
  31461. */
  31462. ROAD = 4
  31463. }
  31464. /**
  31465. * A Label draws viewport-aligned text positioned in the 3D scene. This constructor
  31466. * should not be used directly, instead create labels by calling {@link LabelCollection#add}.
  31467. */
  31468. export class Label {
  31469. constructor();
  31470. /**
  31471. * Determines if this label will be shown. Use this to hide or show a label, instead
  31472. * of removing it and re-adding it to the collection.
  31473. */
  31474. show: boolean;
  31475. /**
  31476. * Gets or sets the Cartesian position of this label.
  31477. */
  31478. position: Cartesian3;
  31479. /**
  31480. * Gets or sets the height reference of this billboard.
  31481. */
  31482. heightReference: HeightReference;
  31483. /**
  31484. * Gets or sets the text of this label.
  31485. */
  31486. text: string;
  31487. /**
  31488. * Gets or sets the font used to draw this label. Fonts are specified using the same syntax as the CSS 'font' property.
  31489. */
  31490. font: string;
  31491. /**
  31492. * Gets or sets the fill color of this label.
  31493. */
  31494. fillColor: Color;
  31495. /**
  31496. * Gets or sets the outline color of this label.
  31497. */
  31498. outlineColor: Color;
  31499. /**
  31500. * Gets or sets the outline width of this label.
  31501. */
  31502. outlineWidth: number;
  31503. /**
  31504. * Determines if a background behind this label will be shown.
  31505. */
  31506. showBackground: boolean;
  31507. /**
  31508. * Gets or sets the background color of this label.
  31509. */
  31510. backgroundColor: Color;
  31511. /**
  31512. * Gets or sets the background padding, in pixels, of this label. The <code>x</code> value
  31513. * controls horizontal padding, and the <code>y</code> value controls vertical padding.
  31514. */
  31515. backgroundPadding: Cartesian2;
  31516. /**
  31517. * Gets or sets the style of this label.
  31518. */
  31519. style: LabelStyle;
  31520. /**
  31521. * Gets or sets the pixel offset in screen space from the origin of this label. This is commonly used
  31522. * to align multiple labels and billboards at the same position, e.g., an image and text. The
  31523. * screen space origin is the top, left corner of the canvas; <code>x</code> increases from
  31524. * left to right, and <code>y</code> increases from top to bottom.
  31525. * <br /><br />
  31526. * <div align='center'>
  31527. * <table border='0' cellpadding='5'><tr>
  31528. * <td align='center'><code>default</code><br/><img src='Images/Label.setPixelOffset.default.png' width='250' height='188' /></td>
  31529. * <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>
  31530. * </tr></table>
  31531. * The label's origin is indicated by the yellow point.
  31532. * </div>
  31533. */
  31534. pixelOffset: Cartesian2;
  31535. /**
  31536. * Gets or sets near and far translucency properties of a Label based on the Label's distance from the camera.
  31537. * A label's translucency will interpolate between the {@link NearFarScalar#nearValue} and
  31538. * {@link NearFarScalar#farValue} while the camera distance falls within the lower and upper bounds
  31539. * of the specified {@link NearFarScalar#near} and {@link NearFarScalar#far}.
  31540. * Outside of these ranges the label's translucency remains clamped to the nearest bound. If undefined,
  31541. * translucencyByDistance will be disabled.
  31542. * @example
  31543. * // Example 1.
  31544. * // Set a label's translucencyByDistance to 1.0 when the
  31545. * // camera is 1500 meters from the label and disappear as
  31546. * // the camera distance approaches 8.0e6 meters.
  31547. * text.translucencyByDistance = new Cesium.NearFarScalar(1.5e2, 1.0, 8.0e6, 0.0);
  31548. * @example
  31549. * // Example 2.
  31550. * // disable translucency by distance
  31551. * text.translucencyByDistance = undefined;
  31552. */
  31553. translucencyByDistance: NearFarScalar;
  31554. /**
  31555. * Gets or sets near and far pixel offset scaling properties of a Label based on the Label's distance from the camera.
  31556. * A label's pixel offset will be scaled between the {@link NearFarScalar#nearValue} and
  31557. * {@link NearFarScalar#farValue} while the camera distance falls within the lower and upper bounds
  31558. * of the specified {@link NearFarScalar#near} and {@link NearFarScalar#far}.
  31559. * Outside of these ranges the label's pixel offset scaling remains clamped to the nearest bound. If undefined,
  31560. * pixelOffsetScaleByDistance will be disabled.
  31561. * @example
  31562. * // Example 1.
  31563. * // Set a label's pixel offset scale to 0.0 when the
  31564. * // camera is 1500 meters from the label and scale pixel offset to 10.0 pixels
  31565. * // in the y direction the camera distance approaches 8.0e6 meters.
  31566. * text.pixelOffset = new Cesium.Cartesian2(0.0, 1.0);
  31567. * text.pixelOffsetScaleByDistance = new Cesium.NearFarScalar(1.5e2, 0.0, 8.0e6, 10.0);
  31568. * @example
  31569. * // Example 2.
  31570. * // disable pixel offset by distance
  31571. * text.pixelOffsetScaleByDistance = undefined;
  31572. */
  31573. pixelOffsetScaleByDistance: NearFarScalar;
  31574. /**
  31575. * Gets or sets near and far scaling properties of a Label based on the label's distance from the camera.
  31576. * A label's scale will interpolate between the {@link NearFarScalar#nearValue} and
  31577. * {@link NearFarScalar#farValue} while the camera distance falls within the lower and upper bounds
  31578. * of the specified {@link NearFarScalar#near} and {@link NearFarScalar#far}.
  31579. * Outside of these ranges the label's scale remains clamped to the nearest bound. If undefined,
  31580. * scaleByDistance will be disabled.
  31581. * @example
  31582. * // Example 1.
  31583. * // Set a label's scaleByDistance to scale by 1.5 when the
  31584. * // camera is 1500 meters from the label and disappear as
  31585. * // the camera distance approaches 8.0e6 meters.
  31586. * label.scaleByDistance = new Cesium.NearFarScalar(1.5e2, 1.5, 8.0e6, 0.0);
  31587. * @example
  31588. * // Example 2.
  31589. * // disable scaling by distance
  31590. * label.scaleByDistance = undefined;
  31591. */
  31592. scaleByDistance: NearFarScalar;
  31593. /**
  31594. * Gets and sets the 3D Cartesian offset applied to this label in eye coordinates. Eye coordinates is a left-handed
  31595. * coordinate system, where <code>x</code> points towards the viewer's right, <code>y</code> points up, and
  31596. * <code>z</code> points into the screen. Eye coordinates use the same scale as world and model coordinates,
  31597. * which is typically meters.
  31598. * <br /><br />
  31599. * An eye offset is commonly used to arrange multiple label or objects at the same position, e.g., to
  31600. * arrange a label above its corresponding 3D model.
  31601. * <br /><br />
  31602. * Below, the label is positioned at the center of the Earth but an eye offset makes it always
  31603. * appear on top of the Earth regardless of the viewer's or Earth's orientation.
  31604. * <br /><br />
  31605. * <div align='center'>
  31606. * <table border='0' cellpadding='5'><tr>
  31607. * <td align='center'><img src='Images/Billboard.setEyeOffset.one.png' width='250' height='188' /></td>
  31608. * <td align='center'><img src='Images/Billboard.setEyeOffset.two.png' width='250' height='188' /></td>
  31609. * </tr></table>
  31610. * <code>l.eyeOffset = new Cartesian3(0.0, 8000000.0, 0.0);</code><br /><br />
  31611. * </div>
  31612. */
  31613. eyeOffset: Cartesian3;
  31614. /**
  31615. * Gets or sets the horizontal origin of this label, which determines if the label is drawn
  31616. * to the left, center, or right of its anchor position.
  31617. * <br /><br />
  31618. * <div align='center'>
  31619. * <img src='Images/Billboard.setHorizontalOrigin.png' width='648' height='196' /><br />
  31620. * </div>
  31621. * @example
  31622. * // Use a top, right origin
  31623. * l.horizontalOrigin = Cesium.HorizontalOrigin.RIGHT;
  31624. * l.verticalOrigin = Cesium.VerticalOrigin.TOP;
  31625. */
  31626. horizontalOrigin: HorizontalOrigin;
  31627. /**
  31628. * Gets or sets the vertical origin of this label, which determines if the label is
  31629. * to the above, below, or at the center of its anchor position.
  31630. * <br /><br />
  31631. * <div align='center'>
  31632. * <img src='Images/Billboard.setVerticalOrigin.png' width='695' height='175' /><br />
  31633. * </div>
  31634. * @example
  31635. * // Use a top, right origin
  31636. * l.horizontalOrigin = Cesium.HorizontalOrigin.RIGHT;
  31637. * l.verticalOrigin = Cesium.VerticalOrigin.TOP;
  31638. */
  31639. verticalOrigin: VerticalOrigin;
  31640. /**
  31641. * Gets or sets the uniform scale that is multiplied with the label's size in pixels.
  31642. * A scale of <code>1.0</code> does not change the size of the label; a scale greater than
  31643. * <code>1.0</code> enlarges the label; a positive scale less than <code>1.0</code> shrinks
  31644. * the label.
  31645. * <br /><br />
  31646. * Applying a large scale value may pixelate the label. To make text larger without pixelation,
  31647. * use a larger font size when calling {@link Label#font} instead.
  31648. * <br /><br />
  31649. * <div align='center'>
  31650. * <img src='Images/Label.setScale.png' width='400' height='300' /><br/>
  31651. * From left to right in the above image, the scales are <code>0.5</code>, <code>1.0</code>,
  31652. * and <code>2.0</code>.
  31653. * </div>
  31654. */
  31655. scale: number;
  31656. /**
  31657. * Gets the total scale of the label, which is the label's scale multiplied by the computed relative size
  31658. * of the desired font compared to the generated glyph size.
  31659. */
  31660. totalScale: number;
  31661. /**
  31662. * Gets or sets the condition specifying at what distance from the camera that this label will be displayed.
  31663. */
  31664. distanceDisplayCondition: DistanceDisplayCondition;
  31665. /**
  31666. * Gets or sets the distance from the camera at which to disable the depth test to, for example, prevent clipping against terrain.
  31667. * When set to zero, the depth test is always applied. When set to Number.POSITIVE_INFINITY, the depth test is never applied.
  31668. */
  31669. disableDepthTestDistance: number;
  31670. /**
  31671. * Gets or sets the user-defined value returned when the label is picked.
  31672. */
  31673. id: any;
  31674. /**
  31675. * Computes the screen-space position of the label's origin, taking into account eye and pixel offsets.
  31676. * The screen space origin is the top, left corner of the canvas; <code>x</code> increases from
  31677. * left to right, and <code>y</code> increases from top to bottom.
  31678. * @example
  31679. * console.log(l.computeScreenSpacePosition(scene).toString());
  31680. * @param scene - The scene the label is in.
  31681. * @param [result] - The object onto which to store the result.
  31682. * @returns The screen-space position of the label.
  31683. */
  31684. computeScreenSpacePosition(scene: Scene, result?: Cartesian2): Cartesian2;
  31685. /**
  31686. * Determines if this label equals another label. Labels are equal if all their properties
  31687. * are equal. Labels in different collections can be equal.
  31688. * @param other - The label to compare for equality.
  31689. * @returns <code>true</code> if the labels are equal; otherwise, <code>false</code>.
  31690. */
  31691. equals(other: Label): boolean;
  31692. /**
  31693. * Returns true if this object was destroyed; otherwise, false.
  31694. * <br /><br />
  31695. * If this object was destroyed, it should not be used; calling any function other than
  31696. * <code>isDestroyed</code> will result in a {@link DeveloperError} exception.
  31697. * @returns True if this object was destroyed; otherwise, false.
  31698. */
  31699. isDestroyed(): boolean;
  31700. /**
  31701. * Determines whether or not run the algorithm, that match the text of the label to right-to-left languages
  31702. * @example
  31703. * // Example 1.
  31704. * // Set a label's rightToLeft before init
  31705. * Cesium.Label.enableRightToLeftDetection = true;
  31706. * var myLabelEntity = viewer.entities.add({
  31707. * label: {
  31708. * id: 'my label',
  31709. * text: 'זה טקסט בעברית \n ועכשיו יורדים שורה',
  31710. * }
  31711. * });
  31712. * @example
  31713. * // Example 2.
  31714. * var myLabelEntity = viewer.entities.add({
  31715. * label: {
  31716. * id: 'my label',
  31717. * text: 'English text'
  31718. * }
  31719. * });
  31720. * // Set a label's rightToLeft after init
  31721. * Cesium.Label.enableRightToLeftDetection = true;
  31722. * myLabelEntity.text = 'טקסט חדש';
  31723. */
  31724. static enableRightToLeftDetection: boolean;
  31725. }
  31726. /**
  31727. * A renderable collection of labels. Labels are viewport-aligned text positioned in the 3D scene.
  31728. * Each label can have a different font, color, scale, etc.
  31729. * <br /><br />
  31730. * <div align='center'>
  31731. * <img src='Images/Label.png' width='400' height='300' /><br />
  31732. * Example labels
  31733. * </div>
  31734. * <br /><br />
  31735. * Labels are added and removed from the collection using {@link LabelCollection#add}
  31736. * and {@link LabelCollection#remove}.
  31737. * @example
  31738. * // Create a label collection with two labels
  31739. * var labels = scene.primitives.add(new Cesium.LabelCollection());
  31740. * labels.add({
  31741. * position : new Cesium.Cartesian3(1.0, 2.0, 3.0),
  31742. * text : 'A label'
  31743. * });
  31744. * labels.add({
  31745. * position : new Cesium.Cartesian3(4.0, 5.0, 6.0),
  31746. * text : 'Another label'
  31747. * });
  31748. * @param [options] - Object with the following properties:
  31749. * @param [options.modelMatrix = Matrix4.IDENTITY] - The 4x4 transformation matrix that transforms each label from model to world coordinates.
  31750. * @param [options.debugShowBoundingVolume = false] - For debugging only. Determines if this primitive's commands' bounding spheres are shown.
  31751. * @param [options.scene] - Must be passed in for labels that use the height reference property or will be depth tested against the globe.
  31752. * @param [options.blendOption = BlendOption.OPAQUE_AND_TRANSLUCENT] - The label blending option. The default
  31753. * is used for rendering both opaque and translucent labels. However, if either all of the labels are completely opaque or all are completely translucent,
  31754. * setting the technique to BlendOption.OPAQUE or BlendOption.TRANSLUCENT can improve performance by up to 2x.
  31755. */
  31756. export class LabelCollection {
  31757. constructor(options?: {
  31758. modelMatrix?: Matrix4;
  31759. debugShowBoundingVolume?: boolean;
  31760. scene?: Scene;
  31761. blendOption?: BlendOption;
  31762. });
  31763. /**
  31764. * The 4x4 transformation matrix that transforms each label in this collection from model to world coordinates.
  31765. * When this is the identity matrix, the labels are drawn in world coordinates, i.e., Earth's WGS84 coordinates.
  31766. * Local reference frames can be used by providing a different transformation matrix, like that returned
  31767. * by {@link Transforms.eastNorthUpToFixedFrame}.
  31768. * @example
  31769. * var center = Cesium.Cartesian3.fromDegrees(-75.59777, 40.03883);
  31770. * labels.modelMatrix = Cesium.Transforms.eastNorthUpToFixedFrame(center);
  31771. * labels.add({
  31772. * position : new Cesium.Cartesian3(0.0, 0.0, 0.0),
  31773. * text : 'Center'
  31774. * });
  31775. * labels.add({
  31776. * position : new Cesium.Cartesian3(1000000.0, 0.0, 0.0),
  31777. * text : 'East'
  31778. * });
  31779. * labels.add({
  31780. * position : new Cesium.Cartesian3(0.0, 1000000.0, 0.0),
  31781. * text : 'North'
  31782. * });
  31783. * labels.add({
  31784. * position : new Cesium.Cartesian3(0.0, 0.0, 1000000.0),
  31785. * text : 'Up'
  31786. * });
  31787. */
  31788. modelMatrix: Matrix4;
  31789. /**
  31790. * This property is for debugging only; it is not for production use nor is it optimized.
  31791. * <p>
  31792. * Draws the bounding sphere for each draw command in the primitive.
  31793. * </p>
  31794. */
  31795. debugShowBoundingVolume: boolean;
  31796. /**
  31797. * The label blending option. The default is used for rendering both opaque and translucent labels.
  31798. * However, if either all of the labels are completely opaque or all are completely translucent,
  31799. * setting the technique to BlendOption.OPAQUE or BlendOption.TRANSLUCENT can improve
  31800. * performance by up to 2x.
  31801. */
  31802. blendOption: BlendOption;
  31803. /**
  31804. * Returns the number of labels in this collection. This is commonly used with
  31805. * {@link LabelCollection#get} to iterate over all the labels
  31806. * in the collection.
  31807. */
  31808. length: number;
  31809. /**
  31810. * Creates and adds a label with the specified initial properties to the collection.
  31811. * The added label is returned so it can be modified or removed from the collection later.
  31812. * @example
  31813. * // Example 1: Add a label, specifying all the default values.
  31814. * var l = labels.add({
  31815. * show : true,
  31816. * position : Cesium.Cartesian3.ZERO,
  31817. * text : '',
  31818. * font : '30px sans-serif',
  31819. * fillColor : Cesium.Color.WHITE,
  31820. * outlineColor : Cesium.Color.BLACK,
  31821. * outlineWidth : 1.0,
  31822. * showBackground : false,
  31823. * backgroundColor : new Cesium.Color(0.165, 0.165, 0.165, 0.8),
  31824. * backgroundPadding : new Cesium.Cartesian2(7, 5),
  31825. * style : Cesium.LabelStyle.FILL,
  31826. * pixelOffset : Cesium.Cartesian2.ZERO,
  31827. * eyeOffset : Cesium.Cartesian3.ZERO,
  31828. * horizontalOrigin : Cesium.HorizontalOrigin.LEFT,
  31829. * verticalOrigin : Cesium.VerticalOrigin.BASELINE,
  31830. * scale : 1.0,
  31831. * translucencyByDistance : undefined,
  31832. * pixelOffsetScaleByDistance : undefined,
  31833. * heightReference : HeightReference.NONE,
  31834. * distanceDisplayCondition : undefined
  31835. * });
  31836. * @example
  31837. * // Example 2: Specify only the label's cartographic position,
  31838. * // text, and font.
  31839. * var l = labels.add({
  31840. * position : Cesium.Cartesian3.fromRadians(longitude, latitude, height),
  31841. * text : 'Hello World',
  31842. * font : '24px Helvetica',
  31843. * });
  31844. * @param [options] - A template describing the label's properties as shown in Example 1.
  31845. * @returns The label that was added to the collection.
  31846. */
  31847. add(options?: any): Label;
  31848. /**
  31849. * Removes a label from the collection. Once removed, a label is no longer usable.
  31850. * @example
  31851. * var l = labels.add(...);
  31852. * labels.remove(l); // Returns true
  31853. * @param label - The label to remove.
  31854. * @returns <code>true</code> if the label was removed; <code>false</code> if the label was not found in the collection.
  31855. */
  31856. remove(label: Label): boolean;
  31857. /**
  31858. * Removes all labels from the collection.
  31859. * @example
  31860. * labels.add(...);
  31861. * labels.add(...);
  31862. * labels.removeAll();
  31863. */
  31864. removeAll(): void;
  31865. /**
  31866. * Check whether this collection contains a given label.
  31867. * @param label - The label to check for.
  31868. * @returns true if this collection contains the label, false otherwise.
  31869. */
  31870. contains(label: Label): boolean;
  31871. /**
  31872. * Returns the label in the collection at the specified index. Indices are zero-based
  31873. * and increase as labels are added. Removing a label shifts all labels after
  31874. * it to the left, changing their indices. This function is commonly used with
  31875. * {@link LabelCollection#length} to iterate over all the labels
  31876. * in the collection.
  31877. * @example
  31878. * // Toggle the show property of every label in the collection
  31879. * var len = labels.length;
  31880. * for (var i = 0; i < len; ++i) {
  31881. * var l = billboards.get(i);
  31882. * l.show = !l.show;
  31883. * }
  31884. * @param index - The zero-based index of the billboard.
  31885. * @returns The label at the specified index.
  31886. */
  31887. get(index: number): Label;
  31888. /**
  31889. * Returns true if this object was destroyed; otherwise, false.
  31890. * <br /><br />
  31891. * If this object was destroyed, it should not be used; calling any function other than
  31892. * <code>isDestroyed</code> will result in a {@link DeveloperError} exception.
  31893. * @returns True if this object was destroyed; otherwise, false.
  31894. */
  31895. isDestroyed(): boolean;
  31896. /**
  31897. * Destroys the WebGL resources held by this object. Destroying an object allows for deterministic
  31898. * release of WebGL resources, instead of relying on the garbage collector to destroy this object.
  31899. * <br /><br />
  31900. * Once an object is destroyed, it should not be used; calling any function other than
  31901. * <code>isDestroyed</code> will result in a {@link DeveloperError} exception. Therefore,
  31902. * assign the return value (<code>undefined</code>) to the object as done in the example.
  31903. * @example
  31904. * labels = labels && labels.destroy();
  31905. */
  31906. destroy(): void;
  31907. }
  31908. /**
  31909. * Describes how to draw a label.
  31910. */
  31911. export enum LabelStyle {
  31912. /**
  31913. * Fill the text of the label, but do not outline.
  31914. */
  31915. FILL = 0,
  31916. /**
  31917. * Outline the text of the label, but do not fill.
  31918. */
  31919. OUTLINE = 1,
  31920. /**
  31921. * Fill and outline the text of the label.
  31922. */
  31923. FILL_AND_OUTLINE = 2
  31924. }
  31925. /**
  31926. * A light source. This type describes an interface and is not intended to be instantiated directly.
  31927. */
  31928. export class Light {
  31929. constructor();
  31930. /**
  31931. * The color of the light.
  31932. */
  31933. color: Color;
  31934. /**
  31935. * The intensity of the light.
  31936. */
  31937. intensity: number;
  31938. }
  31939. /**
  31940. * Describes how the map will operate in 2D.
  31941. */
  31942. export enum MapMode2D {
  31943. /**
  31944. * The 2D map can be rotated about the z axis.
  31945. */
  31946. ROTATE = 0,
  31947. /**
  31948. * The 2D map can be scrolled infinitely in the horizontal direction.
  31949. */
  31950. INFINITE_SCROLL = 1
  31951. }
  31952. export namespace MapboxImageryProvider {
  31953. /**
  31954. * Initialization options for the MapboxImageryProvider constructor
  31955. * @property [url = 'https://api.mapbox.com/v4/'] - The Mapbox server url.
  31956. * @property mapId - The Mapbox Map ID.
  31957. * @property accessToken - The public access token for the imagery.
  31958. * @property [format = 'png'] - The format of the image request.
  31959. * @property [ellipsoid] - The ellipsoid. If not specified, the WGS84 ellipsoid is used.
  31960. * @property [minimumLevel = 0] - The minimum level-of-detail supported by the imagery provider. Take care when specifying
  31961. * this that the number of tiles at the minimum level is small, such as four or less. A larger number is likely
  31962. * to result in rendering problems.
  31963. * @property [maximumLevel] - The maximum level-of-detail supported by the imagery provider, or undefined if there is no limit.
  31964. * @property [rectangle = Rectangle.MAX_VALUE] - The rectangle, in radians, covered by the image.
  31965. * @property [credit] - A credit for the data source, which is displayed on the canvas.
  31966. */
  31967. type ConstructorOptions = {
  31968. url?: string;
  31969. mapId: string;
  31970. accessToken: string;
  31971. format?: string;
  31972. ellipsoid?: Ellipsoid;
  31973. minimumLevel?: number;
  31974. maximumLevel?: number;
  31975. rectangle?: Rectangle;
  31976. credit?: Credit | string;
  31977. };
  31978. }
  31979. /**
  31980. * Provides tiled imagery hosted by Mapbox.
  31981. * @example
  31982. * // Mapbox tile provider
  31983. * var mapbox = new Cesium.MapboxImageryProvider({
  31984. * mapId: 'mapbox.streets',
  31985. * accessToken: 'thisIsMyAccessToken'
  31986. * });
  31987. * @param options - Object describing initialization options
  31988. */
  31989. export class MapboxImageryProvider {
  31990. constructor(options: MapboxImageryProvider.ConstructorOptions);
  31991. /**
  31992. * The default alpha blending value of this provider, with 0.0 representing fully transparent and
  31993. * 1.0 representing fully opaque.
  31994. */
  31995. defaultAlpha: number | undefined;
  31996. /**
  31997. * The default alpha blending value on the night side of the globe of this provider, with 0.0 representing fully transparent and
  31998. * 1.0 representing fully opaque.
  31999. */
  32000. defaultNightAlpha: number | undefined;
  32001. /**
  32002. * The default alpha blending value on the day side of the globe of this provider, with 0.0 representing fully transparent and
  32003. * 1.0 representing fully opaque.
  32004. */
  32005. defaultDayAlpha: number | undefined;
  32006. /**
  32007. * The default brightness of this provider. 1.0 uses the unmodified imagery color. Less than 1.0
  32008. * makes the imagery darker while greater than 1.0 makes it brighter.
  32009. */
  32010. defaultBrightness: number | undefined;
  32011. /**
  32012. * The default contrast of this provider. 1.0 uses the unmodified imagery color. Less than 1.0 reduces
  32013. * the contrast while greater than 1.0 increases it.
  32014. */
  32015. defaultContrast: number | undefined;
  32016. /**
  32017. * The default hue of this provider in radians. 0.0 uses the unmodified imagery color.
  32018. */
  32019. defaultHue: number | undefined;
  32020. /**
  32021. * The default saturation of this provider. 1.0 uses the unmodified imagery color. Less than 1.0 reduces the
  32022. * saturation while greater than 1.0 increases it.
  32023. */
  32024. defaultSaturation: number | undefined;
  32025. /**
  32026. * The default gamma correction to apply to this provider. 1.0 uses the unmodified imagery color.
  32027. */
  32028. defaultGamma: number | undefined;
  32029. /**
  32030. * The default texture minification filter to apply to this provider.
  32031. */
  32032. defaultMinificationFilter: TextureMinificationFilter;
  32033. /**
  32034. * The default texture magnification filter to apply to this provider.
  32035. */
  32036. defaultMagnificationFilter: TextureMagnificationFilter;
  32037. /**
  32038. * Gets the URL of the Mapbox server.
  32039. */
  32040. readonly url: string;
  32041. /**
  32042. * Gets a value indicating whether or not the provider is ready for use.
  32043. */
  32044. readonly ready: boolean;
  32045. /**
  32046. * Gets a promise that resolves to true when the provider is ready for use.
  32047. */
  32048. readonly readyPromise: Promise<boolean>;
  32049. /**
  32050. * Gets the rectangle, in radians, of the imagery provided by the instance. This function should
  32051. * not be called before {@link MapboxImageryProvider#ready} returns true.
  32052. */
  32053. readonly rectangle: Rectangle;
  32054. /**
  32055. * Gets the width of each tile, in pixels. This function should
  32056. * not be called before {@link MapboxImageryProvider#ready} returns true.
  32057. */
  32058. readonly tileWidth: number;
  32059. /**
  32060. * Gets the height of each tile, in pixels. This function should
  32061. * not be called before {@link MapboxImageryProvider#ready} returns true.
  32062. */
  32063. readonly tileHeight: number;
  32064. /**
  32065. * Gets the maximum level-of-detail that can be requested. This function should
  32066. * not be called before {@link MapboxImageryProvider#ready} returns true.
  32067. */
  32068. readonly maximumLevel: number | undefined;
  32069. /**
  32070. * Gets the minimum level-of-detail that can be requested. This function should
  32071. * not be called before {@link MapboxImageryProvider#ready} returns true. Generally,
  32072. * a minimum level should only be used when the rectangle of the imagery is small
  32073. * enough that the number of tiles at the minimum level is small. An imagery
  32074. * provider with more than a few tiles at the minimum level will lead to
  32075. * rendering problems.
  32076. */
  32077. readonly minimumLevel: number;
  32078. /**
  32079. * Gets the tiling scheme used by the provider. This function should
  32080. * not be called before {@link MapboxImageryProvider#ready} returns true.
  32081. */
  32082. readonly tilingScheme: TilingScheme;
  32083. /**
  32084. * Gets the tile discard policy. If not undefined, the discard policy is responsible
  32085. * for filtering out "missing" tiles via its shouldDiscardImage function. If this function
  32086. * returns undefined, no tiles are filtered. This function should
  32087. * not be called before {@link MapboxImageryProvider#ready} returns true.
  32088. */
  32089. readonly tileDiscardPolicy: TileDiscardPolicy;
  32090. /**
  32091. * Gets an event that is raised when the imagery provider encounters an asynchronous error.. By subscribing
  32092. * to the event, you will be notified of the error and can potentially recover from it. Event listeners
  32093. * are passed an instance of {@link TileProviderError}.
  32094. */
  32095. readonly errorEvent: Event;
  32096. /**
  32097. * Gets the credit to display when this imagery provider is active. Typically this is used to credit
  32098. * the source of the imagery. This function should
  32099. * not be called before {@link MapboxImageryProvider#ready} returns true.
  32100. */
  32101. readonly credit: Credit;
  32102. /**
  32103. * Gets the proxy used by this provider.
  32104. */
  32105. readonly proxy: Proxy;
  32106. /**
  32107. * Gets a value indicating whether or not the images provided by this imagery provider
  32108. * include an alpha channel. If this property is false, an alpha channel, if present, will
  32109. * be ignored. If this property is true, any images without an alpha channel will be treated
  32110. * as if their alpha is 1.0 everywhere. When this property is false, memory usage
  32111. * and texture upload time are reduced.
  32112. */
  32113. readonly hasAlphaChannel: boolean;
  32114. /**
  32115. * Gets the credits to be displayed when a given tile is displayed.
  32116. * @param x - The tile X coordinate.
  32117. * @param y - The tile Y coordinate.
  32118. * @param level - The tile level;
  32119. * @returns The credits to be displayed when the tile is displayed.
  32120. */
  32121. getTileCredits(x: number, y: number, level: number): Credit[];
  32122. /**
  32123. * Requests the image for a given tile. This function should
  32124. * not be called before {@link MapboxImageryProvider#ready} returns true.
  32125. * @param x - The tile X coordinate.
  32126. * @param y - The tile Y coordinate.
  32127. * @param level - The tile level.
  32128. * @param [request] - The request object. Intended for internal use only.
  32129. * @returns A promise for the image that will resolve when the image is available, or
  32130. * undefined if there are too many active requests to the server, and the request
  32131. * should be retried later. The resolved image may be either an
  32132. * Image or a Canvas DOM object.
  32133. */
  32134. requestImage(x: number, y: number, level: number, request?: Request): Promise<HTMLImageElement | HTMLCanvasElement> | undefined;
  32135. /**
  32136. * Asynchronously determines what features, if any, are located at a given longitude and latitude within
  32137. * a tile. This function should not be called before {@link MapboxImageryProvider#ready} returns true.
  32138. * This function is optional, so it may not exist on all ImageryProviders.
  32139. * @param x - The tile X coordinate.
  32140. * @param y - The tile Y coordinate.
  32141. * @param level - The tile level.
  32142. * @param longitude - The longitude at which to pick features.
  32143. * @param latitude - The latitude at which to pick features.
  32144. * @returns A promise for the picked features that will resolve when the asynchronous
  32145. * picking completes. The resolved value is an array of {@link ImageryLayerFeatureInfo}
  32146. * instances. The array may be empty if no features are found at the given location.
  32147. * It may also be undefined if picking is not supported.
  32148. */
  32149. pickFeatures(x: number, y: number, level: number, longitude: number, latitude: number): Promise<ImageryLayerFeatureInfo[]> | undefined;
  32150. }
  32151. export namespace MapboxStyleImageryProvider {
  32152. /**
  32153. * Initialization options for the MapboxStyleImageryProvider constructor
  32154. * @property [url = 'https://api.mapbox.com/styles/v1/'] - The Mapbox server url.
  32155. * @property [username = 'mapbox'] - The username of the map account.
  32156. * @property styleId - The Mapbox Style ID.
  32157. * @property accessToken - The public access token for the imagery.
  32158. * @property [tilesize = 512] - The size of the image tiles.
  32159. * @property [scaleFactor] - Determines if tiles are rendered at a @2x scale factor.
  32160. * @property [ellipsoid] - The ellipsoid. If not specified, the WGS84 ellipsoid is used.
  32161. * @property [minimumLevel = 0] - The minimum level-of-detail supported by the imagery provider. Take care when specifying
  32162. * this that the number of tiles at the minimum level is small, such as four or less. A larger number is likely
  32163. * to result in rendering problems.
  32164. * @property [maximumLevel] - The maximum level-of-detail supported by the imagery provider, or undefined if there is no limit.
  32165. * @property [rectangle = Rectangle.MAX_VALUE] - The rectangle, in radians, covered by the image.
  32166. * @property [credit] - A credit for the data source, which is displayed on the canvas.
  32167. */
  32168. type ConstructorOptions = {
  32169. url?: Resource | string;
  32170. username?: string;
  32171. styleId: string;
  32172. accessToken: string;
  32173. tilesize?: number;
  32174. scaleFactor?: boolean;
  32175. ellipsoid?: Ellipsoid;
  32176. minimumLevel?: number;
  32177. maximumLevel?: number;
  32178. rectangle?: Rectangle;
  32179. credit?: Credit | string;
  32180. };
  32181. }
  32182. /**
  32183. * Provides tiled imagery hosted by Mapbox.
  32184. * @example
  32185. * // Mapbox style provider
  32186. * var mapbox = new Cesium.MapboxStyleImageryProvider({
  32187. * styleId: 'streets-v11',
  32188. * accessToken: 'thisIsMyAccessToken'
  32189. * });
  32190. * @param options - Object describing initialization options
  32191. */
  32192. export class MapboxStyleImageryProvider {
  32193. constructor(options: MapboxStyleImageryProvider.ConstructorOptions);
  32194. /**
  32195. * The default alpha blending value of this provider, with 0.0 representing fully transparent and
  32196. * 1.0 representing fully opaque.
  32197. */
  32198. defaultAlpha: number | undefined;
  32199. /**
  32200. * The default alpha blending value on the night side of the globe of this provider, with 0.0 representing fully transparent and
  32201. * 1.0 representing fully opaque.
  32202. */
  32203. defaultNightAlpha: number | undefined;
  32204. /**
  32205. * The default alpha blending value on the day side of the globe of this provider, with 0.0 representing fully transparent and
  32206. * 1.0 representing fully opaque.
  32207. */
  32208. defaultDayAlpha: number | undefined;
  32209. /**
  32210. * The default brightness of this provider. 1.0 uses the unmodified imagery color. Less than 1.0
  32211. * makes the imagery darker while greater than 1.0 makes it brighter.
  32212. */
  32213. defaultBrightness: number | undefined;
  32214. /**
  32215. * The default contrast of this provider. 1.0 uses the unmodified imagery color. Less than 1.0 reduces
  32216. * the contrast while greater than 1.0 increases it.
  32217. */
  32218. defaultContrast: number | undefined;
  32219. /**
  32220. * The default hue of this provider in radians. 0.0 uses the unmodified imagery color.
  32221. */
  32222. defaultHue: number | undefined;
  32223. /**
  32224. * The default saturation of this provider. 1.0 uses the unmodified imagery color. Less than 1.0 reduces the
  32225. * saturation while greater than 1.0 increases it.
  32226. */
  32227. defaultSaturation: number | undefined;
  32228. /**
  32229. * The default gamma correction to apply to this provider. 1.0 uses the unmodified imagery color.
  32230. */
  32231. defaultGamma: number | undefined;
  32232. /**
  32233. * The default texture minification filter to apply to this provider.
  32234. */
  32235. defaultMinificationFilter: TextureMinificationFilter;
  32236. /**
  32237. * The default texture magnification filter to apply to this provider.
  32238. */
  32239. defaultMagnificationFilter: TextureMagnificationFilter;
  32240. /**
  32241. * Gets the URL of the Mapbox server.
  32242. */
  32243. readonly url: string;
  32244. /**
  32245. * Gets a value indicating whether or not the provider is ready for use.
  32246. */
  32247. readonly ready: boolean;
  32248. /**
  32249. * Gets a promise that resolves to true when the provider is ready for use.
  32250. */
  32251. readonly readyPromise: Promise<boolean>;
  32252. /**
  32253. * Gets the rectangle, in radians, of the imagery provided by the instance. This function should
  32254. * not be called before {@link MapboxStyleImageryProvider#ready} returns true.
  32255. */
  32256. readonly rectangle: Rectangle;
  32257. /**
  32258. * Gets the width of each tile, in pixels. This function should
  32259. * not be called before {@link MapboxStyleImageryProvider#ready} returns true.
  32260. */
  32261. readonly tileWidth: number;
  32262. /**
  32263. * Gets the height of each tile, in pixels. This function should
  32264. * not be called before {@link MapboxStyleImageryProvider#ready} returns true.
  32265. */
  32266. readonly tileHeight: number;
  32267. /**
  32268. * Gets the maximum level-of-detail that can be requested. This function should
  32269. * not be called before {@link MapboxStyleImageryProvider#ready} returns true.
  32270. */
  32271. readonly maximumLevel: number | undefined;
  32272. /**
  32273. * Gets the minimum level-of-detail that can be requested. This function should
  32274. * not be called before {@link MapboxStyleImageryProvider#ready} returns true. Generally,
  32275. * a minimum level should only be used when the rectangle of the imagery is small
  32276. * enough that the number of tiles at the minimum level is small. An imagery
  32277. * provider with more than a few tiles at the minimum level will lead to
  32278. * rendering problems.
  32279. */
  32280. readonly minimumLevel: number;
  32281. /**
  32282. * Gets the tiling scheme used by the provider. This function should
  32283. * not be called before {@link MapboxStyleImageryProvider#ready} returns true.
  32284. */
  32285. readonly tilingScheme: TilingScheme;
  32286. /**
  32287. * Gets the tile discard policy. If not undefined, the discard policy is responsible
  32288. * for filtering out "missing" tiles via its shouldDiscardImage function. If this function
  32289. * returns undefined, no tiles are filtered. This function should
  32290. * not be called before {@link MapboxStyleImageryProvider#ready} returns true.
  32291. */
  32292. readonly tileDiscardPolicy: TileDiscardPolicy;
  32293. /**
  32294. * Gets an event that is raised when the imagery provider encounters an asynchronous error.. By subscribing
  32295. * to the event, you will be notified of the error and can potentially recover from it. Event listeners
  32296. * are passed an instance of {@link TileProviderError}.
  32297. */
  32298. readonly errorEvent: Event;
  32299. /**
  32300. * Gets the credit to display when this imagery provider is active. Typically this is used to credit
  32301. * the source of the imagery. This function should
  32302. * not be called before {@link MapboxStyleImageryProvider#ready} returns true.
  32303. */
  32304. readonly credit: Credit;
  32305. /**
  32306. * Gets the proxy used by this provider.
  32307. */
  32308. readonly proxy: Proxy;
  32309. /**
  32310. * Gets a value indicating whether or not the images provided by this imagery provider
  32311. * include an alpha channel. If this property is false, an alpha channel, if present, will
  32312. * be ignored. If this property is true, any images without an alpha channel will be treated
  32313. * as if their alpha is 1.0 everywhere. When this property is false, memory usage
  32314. * and texture upload time are reduced.
  32315. */
  32316. readonly hasAlphaChannel: boolean;
  32317. /**
  32318. * Gets the credits to be displayed when a given tile is displayed.
  32319. * @param x - The tile X coordinate.
  32320. * @param y - The tile Y coordinate.
  32321. * @param level - The tile level;
  32322. * @returns The credits to be displayed when the tile is displayed.
  32323. */
  32324. getTileCredits(x: number, y: number, level: number): Credit[];
  32325. /**
  32326. * Requests the image for a given tile. This function should
  32327. * not be called before {@link MapboxStyleImageryProvider#ready} returns true.
  32328. * @param x - The tile X coordinate.
  32329. * @param y - The tile Y coordinate.
  32330. * @param level - The tile level.
  32331. * @param [request] - The request object. Intended for internal use only.
  32332. * @returns A promise for the image that will resolve when the image is available, or
  32333. * undefined if there are too many active requests to the server, and the request
  32334. * should be retried later. The resolved image may be either an
  32335. * Image or a Canvas DOM object.
  32336. */
  32337. requestImage(x: number, y: number, level: number, request?: Request): Promise<HTMLImageElement | HTMLCanvasElement> | undefined;
  32338. /**
  32339. * Asynchronously determines what features, if any, are located at a given longitude and latitude within
  32340. * a tile. This function should not be called before {@link MapboxStyleImageryProvider#ready} returns true.
  32341. * This function is optional, so it may not exist on all ImageryProviders.
  32342. * @param x - The tile X coordinate.
  32343. * @param y - The tile Y coordinate.
  32344. * @param level - The tile level.
  32345. * @param longitude - The longitude at which to pick features.
  32346. * @param latitude - The latitude at which to pick features.
  32347. * @returns A promise for the picked features that will resolve when the asynchronous
  32348. * picking completes. The resolved value is an array of {@link ImageryLayerFeatureInfo}
  32349. * instances. The array may be empty if no features are found at the given location.
  32350. * It may also be undefined if picking is not supported.
  32351. */
  32352. pickFeatures(x: number, y: number, level: number, longitude: number, latitude: number): Promise<ImageryLayerFeatureInfo[]> | undefined;
  32353. }
  32354. /**
  32355. * A Material defines surface appearance through a combination of diffuse, specular,
  32356. * normal, emission, and alpha components. These values are specified using a
  32357. * JSON schema called Fabric which gets parsed and assembled into glsl shader code
  32358. * behind-the-scenes. Check out the {@link https://github.com/CesiumGS/cesium/wiki/Fabric|wiki page}
  32359. * for more details on Fabric.
  32360. * <br /><br />
  32361. * <style type="text/css">
  32362. * #materialDescriptions code {
  32363. * font-weight: normal;
  32364. * font-family: Consolas, 'Lucida Console', Monaco, monospace;
  32365. * color: #A35A00;
  32366. * }
  32367. * #materialDescriptions ul, #materialDescriptions ul ul {
  32368. * list-style-type: none;
  32369. * }
  32370. * #materialDescriptions ul ul {
  32371. * margin-bottom: 10px;
  32372. * }
  32373. * #materialDescriptions ul ul li {
  32374. * font-weight: normal;
  32375. * color: #000000;
  32376. * text-indent: -2em;
  32377. * margin-left: 2em;
  32378. * }
  32379. * #materialDescriptions ul li {
  32380. * font-weight: bold;
  32381. * color: #0053CF;
  32382. * }
  32383. * </style>
  32384. *
  32385. * Base material types and their uniforms:
  32386. * <div id='materialDescriptions'>
  32387. * <ul>
  32388. * <li>Color</li>
  32389. * <ul>
  32390. * <li><code>color</code>: rgba color object.</li>
  32391. * </ul>
  32392. * <li>Image</li>
  32393. * <ul>
  32394. * <li><code>image</code>: path to image.</li>
  32395. * <li><code>repeat</code>: Object with x and y values specifying the number of times to repeat the image.</li>
  32396. * </ul>
  32397. * <li>DiffuseMap</li>
  32398. * <ul>
  32399. * <li><code>image</code>: path to image.</li>
  32400. * <li><code>channels</code>: Three character string containing any combination of r, g, b, and a for selecting the desired image channels.</li>
  32401. * <li><code>repeat</code>: Object with x and y values specifying the number of times to repeat the image.</li>
  32402. * </ul>
  32403. * <li>AlphaMap</li>
  32404. * <ul>
  32405. * <li><code>image</code>: path to image.</li>
  32406. * <li><code>channel</code>: One character string containing r, g, b, or a for selecting the desired image channel. </li>
  32407. * <li><code>repeat</code>: Object with x and y values specifying the number of times to repeat the image.</li>
  32408. * </ul>
  32409. * <li>SpecularMap</li>
  32410. * <ul>
  32411. * <li><code>image</code>: path to image.</li>
  32412. * <li><code>channel</code>: One character string containing r, g, b, or a for selecting the desired image channel. </li>
  32413. * <li><code>repeat</code>: Object with x and y values specifying the number of times to repeat the image.</li>
  32414. * </ul>
  32415. * <li>EmissionMap</li>
  32416. * <ul>
  32417. * <li><code>image</code>: path to image.</li>
  32418. * <li><code>channels</code>: Three character string containing any combination of r, g, b, and a for selecting the desired image channels. </li>
  32419. * <li><code>repeat</code>: Object with x and y values specifying the number of times to repeat the image.</li>
  32420. * </ul>
  32421. * <li>BumpMap</li>
  32422. * <ul>
  32423. * <li><code>image</code>: path to image.</li>
  32424. * <li><code>channel</code>: One character string containing r, g, b, or a for selecting the desired image channel. </li>
  32425. * <li><code>repeat</code>: Object with x and y values specifying the number of times to repeat the image.</li>
  32426. * <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>
  32427. * </ul>
  32428. * <li>NormalMap</li>
  32429. * <ul>
  32430. * <li><code>image</code>: path to image.</li>
  32431. * <li><code>channels</code>: Three character string containing any combination of r, g, b, and a for selecting the desired image channels. </li>
  32432. * <li><code>repeat</code>: Object with x and y values specifying the number of times to repeat the image.</li>
  32433. * <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>
  32434. * </ul>
  32435. * <li>Grid</li>
  32436. * <ul>
  32437. * <li><code>color</code>: rgba color object for the whole material.</li>
  32438. * <li><code>cellAlpha</code>: Alpha value for the cells between grid lines. This will be combined with color.alpha.</li>
  32439. * <li><code>lineCount</code>: Object with x and y values specifying the number of columns and rows respectively.</li>
  32440. * <li><code>lineThickness</code>: Object with x and y values specifying the thickness of grid lines (in pixels where available).</li>
  32441. * <li><code>lineOffset</code>: Object with x and y values specifying the offset of grid lines (range is 0 to 1).</li>
  32442. * </ul>
  32443. * <li>Stripe</li>
  32444. * <ul>
  32445. * <li><code>horizontal</code>: Boolean that determines if the stripes are horizontal or vertical.</li>
  32446. * <li><code>evenColor</code>: rgba color object for the stripe's first color.</li>
  32447. * <li><code>oddColor</code>: rgba color object for the stripe's second color.</li>
  32448. * <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>
  32449. * <li><code>repeat</code>: Number that controls the total number of stripes, half light and half dark.</li>
  32450. * </ul>
  32451. * <li>Checkerboard</li>
  32452. * <ul>
  32453. * <li><code>lightColor</code>: rgba color object for the checkerboard's light alternating color.</li>
  32454. * <li><code>darkColor</code>: rgba color object for the checkerboard's dark alternating color.</li>
  32455. * <li><code>repeat</code>: Object with x and y values specifying the number of columns and rows respectively.</li>
  32456. * </ul>
  32457. * <li>Dot</li>
  32458. * <ul>
  32459. * <li><code>lightColor</code>: rgba color object for the dot color.</li>
  32460. * <li><code>darkColor</code>: rgba color object for the background color.</li>
  32461. * <li><code>repeat</code>: Object with x and y values specifying the number of columns and rows of dots respectively.</li>
  32462. * </ul>
  32463. * <li>Water</li>
  32464. * <ul>
  32465. * <li><code>baseWaterColor</code>: rgba color object base color of the water.</li>
  32466. * <li><code>blendColor</code>: rgba color object used when blending from water to non-water areas.</li>
  32467. * <li><code>specularMap</code>: Single channel texture used to indicate areas of water.</li>
  32468. * <li><code>normalMap</code>: Normal map for water normal perturbation.</li>
  32469. * <li><code>frequency</code>: Number that controls the number of waves.</li>
  32470. * <li><code>normalMap</code>: Normal map for water normal perturbation.</li>
  32471. * <li><code>animationSpeed</code>: Number that controls the animations speed of the water.</li>
  32472. * <li><code>amplitude</code>: Number that controls the amplitude of water waves.</li>
  32473. * <li><code>specularIntensity</code>: Number that controls the intensity of specular reflections.</li>
  32474. * </ul>
  32475. * <li>RimLighting</li>
  32476. * <ul>
  32477. * <li><code>color</code>: diffuse color and alpha.</li>
  32478. * <li><code>rimColor</code>: diffuse color and alpha of the rim.</li>
  32479. * <li><code>width</code>: Number that determines the rim's width.</li>
  32480. * </ul>
  32481. * <li>Fade</li>
  32482. * <ul>
  32483. * <li><code>fadeInColor</code>: diffuse color and alpha at <code>time</code></li>
  32484. * <li><code>fadeOutColor</code>: diffuse color and alpha at <code>maximumDistance</code> from <code>time</code></li>
  32485. * <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>
  32486. * <li><code>repeat</code>: true if the fade should wrap around the texture coodinates.</li>
  32487. * <li><code>fadeDirection</code>: Object with x and y values specifying if the fade should be in the x and y directions.</li>
  32488. * <li><code>time</code>: Object with x and y values between 0.0 and 1.0 of the <code>fadeInColor</code> position</li>
  32489. * </ul>
  32490. * <li>PolylineArrow</li>
  32491. * <ul>
  32492. * <li><code>color</code>: diffuse color and alpha.</li>
  32493. * </ul>
  32494. * <li>PolylineDash</li>
  32495. * <ul>
  32496. * <li><code>color</code>: color for the line.</li>
  32497. * <li><code>gapColor</code>: color for the gaps in the line.</li>
  32498. * <li><code>dashLength</code>: Dash length in pixels.</li>
  32499. * <li><code>dashPattern</code>: The 16 bit stipple pattern for the line..</li>
  32500. * </ul>
  32501. * <li>PolylineGlow</li>
  32502. * <ul>
  32503. * <li><code>color</code>: color and maximum alpha for the glow on the line.</li>
  32504. * <li><code>glowPower</code>: strength of the glow, as a percentage of the total line width (less than 1.0).</li>
  32505. * <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>
  32506. * </ul>
  32507. * <li>PolylineOutline</li>
  32508. * <ul>
  32509. * <li><code>color</code>: diffuse color and alpha for the interior of the line.</li>
  32510. * <li><code>outlineColor</code>: diffuse color and alpha for the outline.</li>
  32511. * <li><code>outlineWidth</code>: width of the outline in pixels.</li>
  32512. * </ul>
  32513. * <li>ElevationContour</li>
  32514. * <ul>
  32515. * <li><code>color</code>: color and alpha for the contour line.</li>
  32516. * <li><code>spacing</code>: spacing for contour lines in meters.</li>
  32517. * <li><code>width</code>: Number specifying the width of the grid lines in pixels.</li>
  32518. * </ul>
  32519. * <li>ElevationRamp</li>
  32520. * <ul>
  32521. * <li><code>image</code>: color ramp image to use for coloring the terrain.</li>
  32522. * <li><code>minimumHeight</code>: minimum height for the ramp.</li>
  32523. * <li><code>maximumHeight</code>: maximum height for the ramp.</li>
  32524. * </ul>
  32525. * <li>SlopeRamp</li>
  32526. * <ul>
  32527. * <li><code>image</code>: color ramp image to use for coloring the terrain by slope.</li>
  32528. * </ul>
  32529. * <li>AspectRamp</li>
  32530. * <ul>
  32531. * <li><code>image</code>: color ramp image to use for color the terrain by aspect.</li>
  32532. * </ul>
  32533. * </ul>
  32534. * </ul>
  32535. * </div>
  32536. * @example
  32537. * // Create a color material with fromType:
  32538. * polygon.material = Cesium.Material.fromType('Color');
  32539. * polygon.material.uniforms.color = new Cesium.Color(1.0, 1.0, 0.0, 1.0);
  32540. *
  32541. * // Create the default material:
  32542. * polygon.material = new Cesium.Material();
  32543. *
  32544. * // Create a color material with full Fabric notation:
  32545. * polygon.material = new Cesium.Material({
  32546. * fabric : {
  32547. * type : 'Color',
  32548. * uniforms : {
  32549. * color : new Cesium.Color(1.0, 1.0, 0.0, 1.0)
  32550. * }
  32551. * }
  32552. * });
  32553. * @param [options] - Object with the following properties:
  32554. * @param [options.strict = false] - Throws errors for issues that would normally be ignored, including unused uniforms or materials.
  32555. * @param [options.translucent = true] - When <code>true</code> or a function that returns <code>true</code>, the geometry
  32556. * with this material is expected to appear translucent.
  32557. * @param [options.minificationFilter = TextureMinificationFilter.LINEAR] - The {@link TextureMinificationFilter} to apply to this material's textures.
  32558. * @param [options.magnificationFilter = TextureMagnificationFilter.LINEAR] - The {@link TextureMagnificationFilter} to apply to this material's textures.
  32559. * @param options.fabric - The fabric JSON used to generate the material.
  32560. */
  32561. export class Material {
  32562. constructor(options?: {
  32563. strict?: boolean;
  32564. translucent?: boolean | ((...params: any[]) => any);
  32565. minificationFilter?: TextureMinificationFilter;
  32566. magnificationFilter?: TextureMagnificationFilter;
  32567. fabric: any;
  32568. });
  32569. /**
  32570. * The material type. Can be an existing type or a new type. If no type is specified in fabric, type is a GUID.
  32571. */
  32572. type: string;
  32573. /**
  32574. * The glsl shader source for this material.
  32575. */
  32576. shaderSource: string;
  32577. /**
  32578. * Maps sub-material names to Material objects.
  32579. */
  32580. materials: any;
  32581. /**
  32582. * Maps uniform names to their values.
  32583. */
  32584. uniforms: any;
  32585. /**
  32586. * When <code>true</code> or a function that returns <code>true</code>,
  32587. * the geometry is expected to appear translucent.
  32588. */
  32589. translucent: boolean | ((...params: any[]) => any);
  32590. /**
  32591. * Creates a new material using an existing material type.
  32592. * <br /><br />
  32593. * Shorthand for: new Material({fabric : {type : type}});
  32594. * @example
  32595. * var material = Cesium.Material.fromType('Color', {
  32596. * color : new Cesium.Color(1.0, 0.0, 0.0, 1.0)
  32597. * });
  32598. * @param type - The base material type.
  32599. * @param [uniforms] - Overrides for the default uniforms.
  32600. * @returns New material object.
  32601. */
  32602. static fromType(type: string, uniforms?: any): Material;
  32603. /**
  32604. * Gets whether or not this material is translucent.
  32605. * @returns <code>true</code> if this material is translucent, <code>false</code> otherwise.
  32606. */
  32607. isTranslucent(): boolean;
  32608. /**
  32609. * Returns true if this object was destroyed; otherwise, false.
  32610. * <br /><br />
  32611. * If this object was destroyed, it should not be used; calling any function other than
  32612. * <code>isDestroyed</code> will result in a {@link DeveloperError} exception.
  32613. * @returns True if this object was destroyed; otherwise, false.
  32614. */
  32615. isDestroyed(): boolean;
  32616. /**
  32617. * Destroys the WebGL resources held by this object. Destroying an object allows for deterministic
  32618. * release of WebGL resources, instead of relying on the garbage collector to destroy this object.
  32619. * <br /><br />
  32620. * Once an object is destroyed, it should not be used; calling any function other than
  32621. * <code>isDestroyed</code> will result in a {@link DeveloperError} exception. Therefore,
  32622. * assign the return value (<code>undefined</code>) to the object as done in the example.
  32623. * @example
  32624. * material = material && material.destroy();
  32625. */
  32626. destroy(): void;
  32627. /**
  32628. * Gets or sets the default texture uniform value.
  32629. */
  32630. static DefaultImageId: string;
  32631. /**
  32632. * Gets or sets the default cube map texture uniform value.
  32633. */
  32634. static DefaultCubeMapId: string;
  32635. /**
  32636. * Gets the name of the color material.
  32637. */
  32638. static readonly ColorType: string;
  32639. /**
  32640. * Gets the name of the image material.
  32641. */
  32642. static readonly ImageType: string;
  32643. /**
  32644. * Gets the name of the diffuce map material.
  32645. */
  32646. static readonly DiffuseMapType: string;
  32647. /**
  32648. * Gets the name of the alpha map material.
  32649. */
  32650. static readonly AlphaMapType: string;
  32651. /**
  32652. * Gets the name of the specular map material.
  32653. */
  32654. static readonly SpecularMapType: string;
  32655. /**
  32656. * Gets the name of the emmision map material.
  32657. */
  32658. static readonly EmissionMapType: string;
  32659. /**
  32660. * Gets the name of the bump map material.
  32661. */
  32662. static readonly BumpMapType: string;
  32663. /**
  32664. * Gets the name of the normal map material.
  32665. */
  32666. static readonly NormalMapType: string;
  32667. /**
  32668. * Gets the name of the grid material.
  32669. */
  32670. static readonly GridType: string;
  32671. /**
  32672. * Gets the name of the stripe material.
  32673. */
  32674. static readonly StripeType: string;
  32675. /**
  32676. * Gets the name of the checkerboard material.
  32677. */
  32678. static readonly CheckerboardType: string;
  32679. /**
  32680. * Gets the name of the dot material.
  32681. */
  32682. static readonly DotType: string;
  32683. /**
  32684. * Gets the name of the water material.
  32685. */
  32686. static readonly WaterType: string;
  32687. /**
  32688. * Gets the name of the rim lighting material.
  32689. */
  32690. static readonly RimLightingType: string;
  32691. /**
  32692. * Gets the name of the fade material.
  32693. */
  32694. static readonly FadeType: string;
  32695. /**
  32696. * Gets the name of the polyline arrow material.
  32697. */
  32698. static readonly PolylineArrowType: string;
  32699. /**
  32700. * Gets the name of the polyline glow material.
  32701. */
  32702. static readonly PolylineDashType: string;
  32703. /**
  32704. * Gets the name of the polyline glow material.
  32705. */
  32706. static readonly PolylineGlowType: string;
  32707. /**
  32708. * Gets the name of the polyline outline material.
  32709. */
  32710. static readonly PolylineOutlineType: string;
  32711. /**
  32712. * Gets the name of the elevation contour material.
  32713. */
  32714. static readonly ElevationContourType: string;
  32715. /**
  32716. * Gets the name of the elevation contour material.
  32717. */
  32718. static readonly ElevationRampType: string;
  32719. /**
  32720. * Gets the name of the slope ramp material.
  32721. */
  32722. static readonly SlopeRampMaterialType: string;
  32723. /**
  32724. * Gets the name of the aspect ramp material.
  32725. */
  32726. static readonly AspectRampMaterialType: string;
  32727. }
  32728. /**
  32729. * An appearance for arbitrary geometry (as opposed to {@link EllipsoidSurfaceAppearance}, for example)
  32730. * that supports shading with materials.
  32731. * @example
  32732. * var primitive = new Cesium.Primitive({
  32733. * geometryInstances : new Cesium.GeometryInstance({
  32734. * geometry : new Cesium.WallGeometry({
  32735. * materialSupport : Cesium.MaterialAppearance.MaterialSupport.BASIC.vertexFormat,
  32736. * // ...
  32737. * })
  32738. * }),
  32739. * appearance : new Cesium.MaterialAppearance({
  32740. * material : Cesium.Material.fromType('Color'),
  32741. * faceForward : true
  32742. * })
  32743. *
  32744. * });
  32745. * @param [options] - Object with the following properties:
  32746. * @param [options.flat = false] - When <code>true</code>, flat shading is used in the fragment shader, which means lighting is not taking into account.
  32747. * @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}.
  32748. * @param [options.translucent = true] - When <code>true</code>, the geometry is expected to appear translucent so {@link MaterialAppearance#renderState} has alpha blending enabled.
  32749. * @param [options.closed = false] - When <code>true</code>, the geometry is expected to be closed so {@link MaterialAppearance#renderState} has backface culling enabled.
  32750. * @param [options.materialSupport = MaterialAppearance.MaterialSupport.TEXTURED] - The type of materials that will be supported.
  32751. * @param [options.material = Material.ColorType] - The material used to determine the fragment color.
  32752. * @param [options.vertexShaderSource] - Optional GLSL vertex shader source to override the default vertex shader.
  32753. * @param [options.fragmentShaderSource] - Optional GLSL fragment shader source to override the default fragment shader.
  32754. * @param [options.renderState] - Optional render state to override the default render state.
  32755. */
  32756. export class MaterialAppearance {
  32757. constructor(options?: {
  32758. flat?: boolean;
  32759. faceForward?: boolean;
  32760. translucent?: boolean;
  32761. closed?: boolean;
  32762. materialSupport?: MaterialAppearance.MaterialSupportType;
  32763. material?: Material;
  32764. vertexShaderSource?: string;
  32765. fragmentShaderSource?: string;
  32766. renderState?: any;
  32767. });
  32768. /**
  32769. * The material used to determine the fragment color. Unlike other {@link MaterialAppearance}
  32770. * properties, this is not read-only, so an appearance's material can change on the fly.
  32771. */
  32772. material: Material;
  32773. /**
  32774. * When <code>true</code>, the geometry is expected to appear translucent.
  32775. */
  32776. translucent: boolean;
  32777. /**
  32778. * The GLSL source code for the vertex shader.
  32779. */
  32780. readonly vertexShaderSource: string;
  32781. /**
  32782. * The GLSL source code for the fragment shader. The full fragment shader
  32783. * source is built procedurally taking into account {@link MaterialAppearance#material},
  32784. * {@link MaterialAppearance#flat}, and {@link MaterialAppearance#faceForward}.
  32785. * Use {@link MaterialAppearance#getFragmentShaderSource} to get the full source.
  32786. */
  32787. readonly fragmentShaderSource: string;
  32788. /**
  32789. * The WebGL fixed-function state to use when rendering the geometry.
  32790. * <p>
  32791. * The render state can be explicitly defined when constructing a {@link MaterialAppearance}
  32792. * instance, or it is set implicitly via {@link MaterialAppearance#translucent}
  32793. * and {@link MaterialAppearance#closed}.
  32794. * </p>
  32795. */
  32796. readonly renderState: any;
  32797. /**
  32798. * When <code>true</code>, the geometry is expected to be closed so
  32799. * {@link MaterialAppearance#renderState} has backface culling enabled.
  32800. * If the viewer enters the geometry, it will not be visible.
  32801. */
  32802. readonly closed: boolean;
  32803. /**
  32804. * The type of materials supported by this instance. This impacts the required
  32805. * {@link VertexFormat} and the complexity of the vertex and fragment shaders.
  32806. */
  32807. readonly materialSupport: MaterialAppearance.MaterialSupportType;
  32808. /**
  32809. * The {@link VertexFormat} that this appearance instance is compatible with.
  32810. * A geometry can have more vertex attributes and still be compatible - at a
  32811. * potential performance cost - but it can't have less.
  32812. */
  32813. readonly vertexFormat: VertexFormat;
  32814. /**
  32815. * When <code>true</code>, flat shading is used in the fragment shader,
  32816. * which means lighting is not taking into account.
  32817. */
  32818. readonly flat: boolean;
  32819. /**
  32820. * When <code>true</code>, the fragment shader flips the surface normal
  32821. * as needed to ensure that the normal faces the viewer to avoid
  32822. * dark spots. This is useful when both sides of a geometry should be
  32823. * shaded like {@link WallGeometry}.
  32824. */
  32825. readonly faceForward: boolean;
  32826. /**
  32827. * Procedurally creates the full GLSL fragment shader source. For {@link MaterialAppearance},
  32828. * this is derived from {@link MaterialAppearance#fragmentShaderSource}, {@link MaterialAppearance#material},
  32829. * {@link MaterialAppearance#flat}, and {@link MaterialAppearance#faceForward}.
  32830. * @returns The full GLSL fragment shader source.
  32831. */
  32832. getFragmentShaderSource(): string;
  32833. /**
  32834. * Determines if the geometry is translucent based on {@link MaterialAppearance#translucent} and {@link Material#isTranslucent}.
  32835. * @returns <code>true</code> if the appearance is translucent.
  32836. */
  32837. isTranslucent(): boolean;
  32838. /**
  32839. * Creates a render state. This is not the final render state instance; instead,
  32840. * it can contain a subset of render state properties identical to the render state
  32841. * created in the context.
  32842. * @returns The render state.
  32843. */
  32844. getRenderState(): any;
  32845. }
  32846. export namespace MaterialAppearance {
  32847. type MaterialSupportType = {
  32848. vertexFormat: VertexFormat;
  32849. vertexShaderSource: string;
  32850. fragmentShaderSource: string;
  32851. };
  32852. /**
  32853. * Determines the type of {@link Material} that is supported by a
  32854. * {@link MaterialAppearance} instance. This is a trade-off between
  32855. * flexibility (a wide array of materials) and memory/performance
  32856. * (required vertex format and GLSL shader complexity.
  32857. */
  32858. namespace MaterialSupport {
  32859. /**
  32860. * Only basic materials, which require just <code>position</code> and
  32861. * <code>normal</code> vertex attributes, are supported.
  32862. */
  32863. const BASIC: MaterialAppearance.MaterialSupportType;
  32864. /**
  32865. * Materials with textures, which require <code>position</code>,
  32866. * <code>normal</code>, and <code>st</code> vertex attributes,
  32867. * are supported. The vast majority of materials fall into this category.
  32868. */
  32869. const TEXTURED: MaterialAppearance.MaterialSupportType;
  32870. /**
  32871. * All materials, including those that work in tangent space, are supported.
  32872. * This requires <code>position</code>, <code>normal</code>, <code>st</code>,
  32873. * <code>tangent</code>, and <code>bitangent</code> vertex attributes.
  32874. */
  32875. const ALL: MaterialAppearance.MaterialSupportType;
  32876. }
  32877. }
  32878. /**
  32879. * A 3D model based on glTF, the runtime asset format for WebGL, OpenGL ES, and OpenGL.
  32880. * <p>
  32881. * Cesium includes support for geometry and materials, glTF animations, and glTF skinning.
  32882. * In addition, individual glTF nodes are pickable with {@link Scene#pick} and animatable
  32883. * with {@link Model#getNode}. glTF cameras and lights are not currently supported.
  32884. * </p>
  32885. * <p>
  32886. * An external glTF asset is created with {@link Model.fromGltf}. glTF JSON can also be
  32887. * created at runtime and passed to this constructor function. In either case, the
  32888. * {@link Model#readyPromise} is resolved when the model is ready to render, i.e.,
  32889. * when the external binary, image, and shader files are downloaded and the WebGL
  32890. * resources are created.
  32891. * </p>
  32892. * <p>
  32893. * Cesium supports glTF assets with the following extensions:
  32894. * <ul>
  32895. * <li>
  32896. * {@link https://github.com/KhronosGroup/glTF/blob/master/extensions/1.0/Khronos/KHR_binary_glTF/README.md|KHR_binary_glTF (glTF 1.0)}
  32897. * </li><li>
  32898. * {@link https://github.com/KhronosGroup/glTF/blob/master/extensions/1.0/Khronos/KHR_materials_common/README.md|KHR_materials_common (glTF 1.0)}
  32899. * </li><li>
  32900. * {@link https://github.com/KhronosGroup/glTF/blob/master/extensions/1.0/Vendor/WEB3D_quantized_attributes/README.md|WEB3D_quantized_attributes (glTF 1.0)}
  32901. * </li><li>
  32902. * {@link https://github.com/KhronosGroup/glTF/tree/master/extensions/2.0/Vendor/AGI_articulations/README.md|AGI_articulations}
  32903. * </li><li>
  32904. * {@link https://github.com/KhronosGroup/glTF/pull/1302|KHR_blend (draft)}
  32905. * </li><li>
  32906. * {@link https://github.com/KhronosGroup/glTF/blob/master/extensions/2.0/Khronos/KHR_draco_mesh_compression/README.md|KHR_draco_mesh_compression}
  32907. * </li><li>
  32908. * {@link https://github.com/KhronosGroup/glTF/tree/master/extensions/2.0/Khronos/KHR_materials_pbrSpecularGlossiness/README.md|KHR_materials_pbrSpecularGlossiness}
  32909. * </li><li>
  32910. * {@link https://github.com/KhronosGroup/glTF/tree/master/extensions/2.0/Khronos/KHR_materials_unlit/README.md|KHR_materials_unlit}
  32911. * </li><li>
  32912. * {@link https://github.com/KhronosGroup/glTF/blob/master/extensions/2.0/Khronos/KHR_techniques_webgl/README.md|KHR_techniques_webgl}
  32913. * </li><li>
  32914. * {@link https://github.com/KhronosGroup/glTF/blob/master/extensions/2.0/Khronos/KHR_texture_transform/README.md|KHR_texture_transform}
  32915. * </li>
  32916. * </ul>
  32917. * </p>
  32918. * <p>
  32919. * 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
  32920. * CESIUM_RTC_MODELVIEW parameter semantic that says the node is in WGS84 coordinates translated
  32921. * relative to a local origin.
  32922. * </p>
  32923. * @param [options] - Object with the following properties:
  32924. * @param [options.gltf] - A glTF JSON object, or a binary glTF buffer.
  32925. * @param [options.basePath = ''] - The base path that paths in the glTF JSON are relative to.
  32926. * @param [options.show = true] - Determines if the model primitive will be shown.
  32927. * @param [options.modelMatrix = Matrix4.IDENTITY] - The 4x4 transformation matrix that transforms the model from model to world coordinates.
  32928. * @param [options.scale = 1.0] - A uniform scale applied to this model.
  32929. * @param [options.minimumPixelSize = 0.0] - The approximate minimum pixel size of the model regardless of zoom.
  32930. * @param [options.maximumScale] - The maximum scale size of a model. An upper limit for minimumPixelSize.
  32931. * @param [options.id] - A user-defined object to return when the model is picked with {@link Scene#pick}.
  32932. * @param [options.allowPicking = true] - When <code>true</code>, each glTF mesh and primitive is pickable with {@link Scene#pick}.
  32933. * @param [options.incrementallyLoadTextures = true] - Determine if textures may continue to stream in after the model is loaded.
  32934. * @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.
  32935. * @param [options.clampAnimations = true] - Determines if the model's animations should hold a pose over frames where no keyframes are specified.
  32936. * @param [options.shadows = ShadowMode.ENABLED] - Determines whether the model casts or receives shadows from light sources.
  32937. * @param [options.debugShowBoundingVolume = false] - For debugging only. Draws the bounding sphere for each draw command in the model.
  32938. * @param [options.debugWireframe = false] - For debugging only. Draws the model in wireframe.
  32939. * @param [options.heightReference = HeightReference.NONE] - Determines how the model is drawn relative to terrain.
  32940. * @param [options.scene] - Must be passed in for models that use the height reference property.
  32941. * @param [options.distanceDisplayCondition] - The condition specifying at what distance from the camera that this model will be displayed.
  32942. * @param [options.color = Color.WHITE] - A color that blends with the model's rendered color.
  32943. * @param [options.colorBlendMode = ColorBlendMode.HIGHLIGHT] - Defines how the color blends with the model.
  32944. * @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.
  32945. * @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.
  32946. * @param [options.silhouetteSize = 0.0] - The size of the silhouette in pixels.
  32947. * @param [options.clippingPlanes] - The {@link ClippingPlaneCollection} used to selectively disable rendering the model.
  32948. * @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.
  32949. * @param [options.imageBasedLightingFactor = Cartesian2(1.0, 1.0)] - Scales diffuse and specular image-based lighting from the earth, sky, atmosphere and star skybox.
  32950. * @param [options.lightColor] - The light color when shading the model. When <code>undefined</code> the scene's light color is used instead.
  32951. * @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.
  32952. * @param [options.sphericalHarmonicCoefficients] - The third order spherical harmonic coefficients used for the diffuse color of image-based lighting.
  32953. * @param [options.specularEnvironmentMaps] - A URL to a KTX file that contains a cube map of the specular lighting and the convoluted specular mipmaps.
  32954. * @param [options.credit] - A credit for the data source, which is displayed on the canvas.
  32955. * @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.
  32956. */
  32957. export class Model {
  32958. constructor(options?: {
  32959. gltf?: any | ArrayBuffer | Uint8Array;
  32960. basePath?: Resource | string;
  32961. show?: boolean;
  32962. modelMatrix?: Matrix4;
  32963. scale?: number;
  32964. minimumPixelSize?: number;
  32965. maximumScale?: number;
  32966. id?: any;
  32967. allowPicking?: boolean;
  32968. incrementallyLoadTextures?: boolean;
  32969. asynchronous?: boolean;
  32970. clampAnimations?: boolean;
  32971. shadows?: ShadowMode;
  32972. debugShowBoundingVolume?: boolean;
  32973. debugWireframe?: boolean;
  32974. heightReference?: HeightReference;
  32975. scene?: Scene;
  32976. distanceDisplayCondition?: DistanceDisplayCondition;
  32977. color?: Color;
  32978. colorBlendMode?: ColorBlendMode;
  32979. colorBlendAmount?: number;
  32980. silhouetteColor?: Color;
  32981. silhouetteSize?: number;
  32982. clippingPlanes?: ClippingPlaneCollection;
  32983. dequantizeInShader?: boolean;
  32984. imageBasedLightingFactor?: Cartesian2;
  32985. lightColor?: Cartesian3;
  32986. luminanceAtZenith?: number;
  32987. sphericalHarmonicCoefficients?: Cartesian3[];
  32988. specularEnvironmentMaps?: string;
  32989. credit?: Credit | string;
  32990. backFaceCulling?: boolean;
  32991. });
  32992. /**
  32993. * Determines if the model primitive will be shown.
  32994. */
  32995. show: boolean;
  32996. /**
  32997. * The silhouette color.
  32998. */
  32999. silhouetteColor: Color;
  33000. /**
  33001. * The size of the silhouette in pixels.
  33002. */
  33003. silhouetteSize: number;
  33004. /**
  33005. * The 4x4 transformation matrix that transforms the model from model to world coordinates.
  33006. * When this is the identity matrix, the model is drawn in world coordinates, i.e., Earth's WGS84 coordinates.
  33007. * Local reference frames can be used by providing a different transformation matrix, like that returned
  33008. * by {@link Transforms.eastNorthUpToFixedFrame}.
  33009. * @example
  33010. * var origin = Cesium.Cartesian3.fromDegrees(-95.0, 40.0, 200000.0);
  33011. * m.modelMatrix = Cesium.Transforms.eastNorthUpToFixedFrame(origin);
  33012. */
  33013. modelMatrix: Matrix4;
  33014. /**
  33015. * A uniform scale applied to this model before the {@link Model#modelMatrix}.
  33016. * Values greater than <code>1.0</code> increase the size of the model; values
  33017. * less than <code>1.0</code> decrease.
  33018. */
  33019. scale: number;
  33020. /**
  33021. * The approximate minimum pixel size of the model regardless of zoom.
  33022. * This can be used to ensure that a model is visible even when the viewer
  33023. * zooms out. When <code>0.0</code>, no minimum size is enforced.
  33024. */
  33025. minimumPixelSize: number;
  33026. /**
  33027. * The maximum scale size for a model. This can be used to give
  33028. * an upper limit to the {@link Model#minimumPixelSize}, ensuring that the model
  33029. * is never an unreasonable scale.
  33030. */
  33031. maximumScale: number;
  33032. /**
  33033. * User-defined object returned when the model is picked.
  33034. */
  33035. id: any;
  33036. /**
  33037. * Returns the height reference of the model
  33038. */
  33039. heightReference: HeightReference;
  33040. /**
  33041. * The currently playing glTF animations.
  33042. */
  33043. activeAnimations: ModelAnimationCollection;
  33044. /**
  33045. * Determines if the model's animations should hold a pose over frames where no keyframes are specified.
  33046. */
  33047. clampAnimations: boolean;
  33048. /**
  33049. * Determines whether the model casts or receives shadows from light sources.
  33050. */
  33051. shadows: ShadowMode;
  33052. /**
  33053. * A color that blends with the model's rendered color.
  33054. */
  33055. color: Color;
  33056. /**
  33057. * Defines how the color blends with the model.
  33058. */
  33059. colorBlendMode: ColorBlendMode;
  33060. /**
  33061. * Value used to determine the color strength when the <code>colorBlendMode</code> is <code>MIX</code>.
  33062. * A value of 0.0 results in the model's rendered color while a value of 1.0 results in a solid color, with
  33063. * any value in-between resulting in a mix of the two.
  33064. */
  33065. colorBlendAmount: number;
  33066. /**
  33067. * Whether to cull back-facing geometry. When true, back face culling is
  33068. * determined by the material's doubleSided property; when false, back face
  33069. * culling is disabled. Back faces are not culled if {@link Model#color} is
  33070. * translucent or {@link Model#silhouetteSize} is greater than 0.0.
  33071. */
  33072. backFaceCulling: boolean;
  33073. /**
  33074. * This property is for debugging only; it is not for production use nor is it optimized.
  33075. * <p>
  33076. * Draws the bounding sphere for each draw command in the model. A glTF primitive corresponds
  33077. * to one draw command. A glTF mesh has an array of primitives, often of length one.
  33078. * </p>
  33079. */
  33080. debugShowBoundingVolume: boolean;
  33081. /**
  33082. * This property is for debugging only; it is not for production use nor is it optimized.
  33083. * <p>
  33084. * Draws the model in wireframe.
  33085. * </p>
  33086. */
  33087. debugWireframe: boolean;
  33088. /**
  33089. * The object for the glTF JSON, including properties with default values omitted
  33090. * from the JSON provided to this model.
  33091. */
  33092. readonly gltf: any;
  33093. /**
  33094. * The base path that paths in the glTF JSON are relative to. The base
  33095. * path is the same path as the path containing the .gltf file
  33096. * minus the .gltf file, when binary, image, and shader files are
  33097. * in the same directory as the .gltf. When this is <code>''</code>,
  33098. * the app's base path is used.
  33099. */
  33100. readonly basePath: string;
  33101. /**
  33102. * The model's bounding sphere in its local coordinate system. This does not take into
  33103. * account glTF animations and skins nor does it take into account {@link Model#minimumPixelSize}.
  33104. * @example
  33105. * // Center in WGS84 coordinates
  33106. * var center = Cesium.Matrix4.multiplyByPoint(model.modelMatrix, model.boundingSphere.center, new Cesium.Cartesian3());
  33107. */
  33108. readonly boundingSphere: BoundingSphere;
  33109. /**
  33110. * When <code>true</code>, this model is ready to render, i.e., the external binary, image,
  33111. * and shader files were downloaded and the WebGL resources were created. This is set to
  33112. * <code>true</code> right before {@link Model#readyPromise} is resolved.
  33113. */
  33114. readonly ready: boolean;
  33115. /**
  33116. * Gets the promise that will be resolved when this model is ready to render, i.e., when the external binary, image,
  33117. * and shader files were downloaded and the WebGL resources were created.
  33118. * <p>
  33119. * This promise is resolved at the end of the frame before the first frame the model is rendered in.
  33120. * </p>
  33121. * @example
  33122. * // Play all animations at half-speed when the model is ready to render
  33123. * Cesium.when(model.readyPromise).then(function(model) {
  33124. * model.activeAnimations.addAll({
  33125. * multiplier : 0.5
  33126. * });
  33127. * }).otherwise(function(error){
  33128. * window.alert(error);
  33129. * });
  33130. */
  33131. readonly readyPromise: Promise<Model>;
  33132. /**
  33133. * Determines if model WebGL resource creation will be spread out over several frames or
  33134. * block until completion once all glTF files are loaded.
  33135. */
  33136. readonly asynchronous: boolean;
  33137. /**
  33138. * When <code>true</code>, each glTF mesh and primitive is pickable with {@link Scene#pick}. When <code>false</code>, GPU memory is saved.
  33139. */
  33140. readonly allowPicking: boolean;
  33141. /**
  33142. * Determine if textures may continue to stream in after the model is loaded.
  33143. */
  33144. readonly incrementallyLoadTextures: boolean;
  33145. /**
  33146. * Return the number of pending texture loads.
  33147. */
  33148. readonly pendingTextureLoads: number;
  33149. /**
  33150. * Gets or sets the condition specifying at what distance from the camera that this model will be displayed.
  33151. */
  33152. distanceDisplayCondition: DistanceDisplayCondition;
  33153. /**
  33154. * The {@link ClippingPlaneCollection} used to selectively disable rendering the model.
  33155. */
  33156. clippingPlanes: ClippingPlaneCollection;
  33157. /**
  33158. * Cesium adds lighting from the earth, sky, atmosphere, and star skybox. This cartesian is used to scale the final
  33159. * diffuse and specular lighting contribution from those sources to the final color. A value of 0.0 will disable those light sources.
  33160. */
  33161. imageBasedLightingFactor: Cartesian2;
  33162. /**
  33163. * The light color when shading the model. When <code>undefined</code> the scene's light color is used instead.
  33164. * <p>
  33165. * For example, disabling additional light sources by setting <code>model.imageBasedLightingFactor = new Cesium.Cartesian2(0.0, 0.0)</code> will make the
  33166. * model much darker. Here, increasing the intensity of the light source will make the model brighter.
  33167. * </p>
  33168. */
  33169. lightColor: Cartesian3;
  33170. /**
  33171. * The sun's luminance at the zenith in kilo candela per meter squared to use for this model's procedural environment map.
  33172. * This is used when {@link Model#specularEnvironmentMaps} and {@link Model#sphericalHarmonicCoefficients} are not defined.
  33173. */
  33174. luminanceAtZenith: number;
  33175. /**
  33176. * The third order spherical harmonic coefficients used for the diffuse color of image-based lighting. When <code>undefined</code>, a diffuse irradiance
  33177. * computed from the atmosphere color is used.
  33178. * <p>
  33179. * There are nine <code>Cartesian3</code> coefficients.
  33180. * The order of the coefficients is: L<sub>00</sub>, L<sub>1-1</sub>, L<sub>10</sub>, L<sub>11</sub>, L<sub>2-2</sub>, L<sub>2-1</sub>, L<sub>20</sub>, L<sub>21</sub>, L<sub>22</sub>
  33181. * </p>
  33182. *
  33183. * These values can be obtained by preprocessing the environment map using the <code>cmgen</code> tool of
  33184. * {@link https://github.com/google/filament/releases|Google's Filament project}. This will also generate a KTX file that can be
  33185. * supplied to {@link Model#specularEnvironmentMaps}.
  33186. */
  33187. sphericalHarmonicCoefficients: Cartesian3[];
  33188. /**
  33189. * A URL to a KTX file that contains a cube map of the specular lighting and the convoluted specular mipmaps.
  33190. */
  33191. specularEnvironmentMaps: string;
  33192. /**
  33193. * Gets the credit that will be displayed for the model
  33194. */
  33195. credit: Credit;
  33196. /**
  33197. * Determines if silhouettes are supported.
  33198. * @param scene - The scene.
  33199. * @returns <code>true</code> if silhouettes are supported; otherwise, returns <code>false</code>
  33200. */
  33201. static silhouetteSupported(scene: Scene): boolean;
  33202. /**
  33203. * <p>
  33204. * Creates a model from a glTF asset. When the model is ready to render, i.e., when the external binary, image,
  33205. * and shader files are downloaded and the WebGL resources are created, the {@link Model#readyPromise} is resolved.
  33206. * </p>
  33207. * <p>
  33208. * The model can be a traditional glTF asset with a .gltf extension or a Binary glTF using the .glb extension.
  33209. * </p>
  33210. * <p>
  33211. * Cesium supports glTF assets with the following extensions:
  33212. * <ul>
  33213. * <li>
  33214. * {@link https://github.com/KhronosGroup/glTF/blob/master/extensions/1.0/Khronos/KHR_binary_glTF/README.md|KHR_binary_glTF (glTF 1.0)}
  33215. * </li><li>
  33216. * {@link https://github.com/KhronosGroup/glTF/blob/master/extensions/1.0/Khronos/KHR_materials_common/README.md|KHR_materials_common (glTF 1.0)}
  33217. * </li><li>
  33218. * {@link https://github.com/KhronosGroup/glTF/blob/master/extensions/1.0/Vendor/WEB3D_quantized_attributes/README.md|WEB3D_quantized_attributes (glTF 1.0)}
  33219. * </li><li>
  33220. * {@link https://github.com/KhronosGroup/glTF/tree/master/extensions/2.0/Vendor/AGI_articulations/README.md|AGI_articulations}
  33221. * </li><li>
  33222. * {@link https://github.com/KhronosGroup/glTF/pull/1302|KHR_blend (draft)}
  33223. * </li><li>
  33224. * {@link https://github.com/KhronosGroup/glTF/blob/master/extensions/2.0/Khronos/KHR_draco_mesh_compression/README.md|KHR_draco_mesh_compression}
  33225. * </li><li>
  33226. * {@link https://github.com/KhronosGroup/glTF/tree/master/extensions/2.0/Khronos/KHR_materials_pbrSpecularGlossiness/README.md|KHR_materials_pbrSpecularGlossiness}
  33227. * </li><li>
  33228. * {@link https://github.com/KhronosGroup/glTF/tree/master/extensions/2.0/Khronos/KHR_materials_unlit/README.md|KHR_materials_unlit}
  33229. * </li><li>
  33230. * {@link https://github.com/KhronosGroup/glTF/blob/master/extensions/2.0/Khronos/KHR_techniques_webgl/README.md|KHR_techniques_webgl}
  33231. * </li><li>
  33232. * {@link https://github.com/KhronosGroup/glTF/blob/master/extensions/2.0/Khronos/KHR_texture_transform/README.md|KHR_texture_transform}
  33233. * </li>
  33234. * </ul>
  33235. * </p>
  33236. * <p>
  33237. * 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
  33238. * CESIUM_RTC_MODELVIEW parameter semantic that says the node is in WGS84 coordinates translated
  33239. * relative to a local origin.
  33240. * </p>
  33241. * @example
  33242. * // Example 1. Create a model from a glTF asset
  33243. * var model = scene.primitives.add(Cesium.Model.fromGltf({
  33244. * url : './duck/duck.gltf'
  33245. * }));
  33246. * @example
  33247. * // Example 2. Create model and provide all properties and events
  33248. * var origin = Cesium.Cartesian3.fromDegrees(-95.0, 40.0, 200000.0);
  33249. * var modelMatrix = Cesium.Transforms.eastNorthUpToFixedFrame(origin);
  33250. *
  33251. * var model = scene.primitives.add(Cesium.Model.fromGltf({
  33252. * url : './duck/duck.gltf',
  33253. * show : true, // default
  33254. * modelMatrix : modelMatrix,
  33255. * scale : 2.0, // double size
  33256. * minimumPixelSize : 128, // never smaller than 128 pixels
  33257. * maximumScale: 20000, // never larger than 20000 * model size (overrides minimumPixelSize)
  33258. * allowPicking : false, // not pickable
  33259. * debugShowBoundingVolume : false, // default
  33260. * debugWireframe : false
  33261. * }));
  33262. *
  33263. * model.readyPromise.then(function(model) {
  33264. * // Play all animations when the model is ready to render
  33265. * model.activeAnimations.addAll();
  33266. * });
  33267. * @param options - Object with the following properties:
  33268. * @param options.url - The url to the .gltf file.
  33269. * @param [options.basePath] - The base path that paths in the glTF JSON are relative to.
  33270. * @param [options.show = true] - Determines if the model primitive will be shown.
  33271. * @param [options.modelMatrix = Matrix4.IDENTITY] - The 4x4 transformation matrix that transforms the model from model to world coordinates.
  33272. * @param [options.scale = 1.0] - A uniform scale applied to this model.
  33273. * @param [options.minimumPixelSize = 0.0] - The approximate minimum pixel size of the model regardless of zoom.
  33274. * @param [options.maximumScale] - The maximum scale for the model.
  33275. * @param [options.id] - A user-defined object to return when the model is picked with {@link Scene#pick}.
  33276. * @param [options.allowPicking = true] - When <code>true</code>, each glTF mesh and primitive is pickable with {@link Scene#pick}.
  33277. * @param [options.incrementallyLoadTextures = true] - Determine if textures may continue to stream in after the model is loaded.
  33278. * @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.
  33279. * @param [options.clampAnimations = true] - Determines if the model's animations should hold a pose over frames where no keyframes are specified.
  33280. * @param [options.shadows = ShadowMode.ENABLED] - Determines whether the model casts or receives shadows from light sources.
  33281. * @param [options.debugShowBoundingVolume = false] - For debugging only. Draws the bounding sphere for each draw command in the model.
  33282. * @param [options.debugWireframe = false] - For debugging only. Draws the model in wireframe.
  33283. * @param [options.heightReference = HeightReference.NONE] - Determines how the model is drawn relative to terrain.
  33284. * @param [options.scene] - Must be passed in for models that use the height reference property.
  33285. * @param [options.distanceDisplayCondition] - The condition specifying at what distance from the camera that this model will be displayed.
  33286. * @param [options.color = Color.WHITE] - A color that blends with the model's rendered color.
  33287. * @param [options.colorBlendMode = ColorBlendMode.HIGHLIGHT] - Defines how the color blends with the model.
  33288. * @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.
  33289. * @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.
  33290. * @param [options.silhouetteSize = 0.0] - The size of the silhouette in pixels.
  33291. * @param [options.clippingPlanes] - The {@link ClippingPlaneCollection} used to selectively disable rendering the model.
  33292. * @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.
  33293. * @param [options.credit] - A credit for the model, which is displayed on the canvas.
  33294. * @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.
  33295. * @returns The newly created model.
  33296. */
  33297. static fromGltf(options: {
  33298. url: Resource | string;
  33299. basePath?: Resource | string;
  33300. show?: boolean;
  33301. modelMatrix?: Matrix4;
  33302. scale?: number;
  33303. minimumPixelSize?: number;
  33304. maximumScale?: number;
  33305. id?: any;
  33306. allowPicking?: boolean;
  33307. incrementallyLoadTextures?: boolean;
  33308. asynchronous?: boolean;
  33309. clampAnimations?: boolean;
  33310. shadows?: ShadowMode;
  33311. debugShowBoundingVolume?: boolean;
  33312. debugWireframe?: boolean;
  33313. heightReference?: HeightReference;
  33314. scene?: Scene;
  33315. distanceDisplayCondition?: DistanceDisplayCondition;
  33316. color?: Color;
  33317. colorBlendMode?: ColorBlendMode;
  33318. colorBlendAmount?: number;
  33319. silhouetteColor?: Color;
  33320. silhouetteSize?: number;
  33321. clippingPlanes?: ClippingPlaneCollection;
  33322. dequantizeInShader?: boolean;
  33323. credit?: Credit | string;
  33324. backFaceCulling?: boolean;
  33325. }): Model;
  33326. /**
  33327. * Returns the glTF node with the given <code>name</code> property. This is used to
  33328. * modify a node's transform for animation outside of glTF animations.
  33329. * @example
  33330. * // Apply non-uniform scale to node LOD3sp
  33331. * var node = model.getNode('LOD3sp');
  33332. * node.matrix = Cesium.Matrix4.fromScale(new Cesium.Cartesian3(5.0, 1.0, 1.0), node.matrix);
  33333. * @param name - The glTF name of the node.
  33334. * @returns The node or <code>undefined</code> if no node with <code>name</code> exists.
  33335. */
  33336. getNode(name: string): ModelNode;
  33337. /**
  33338. * Returns the glTF mesh with the given <code>name</code> property.
  33339. * @param name - The glTF name of the mesh.
  33340. * @returns The mesh or <code>undefined</code> if no mesh with <code>name</code> exists.
  33341. */
  33342. getMesh(name: string): ModelMesh;
  33343. /**
  33344. * Returns the glTF material with the given <code>name</code> property.
  33345. * @param name - The glTF name of the material.
  33346. * @returns The material or <code>undefined</code> if no material with <code>name</code> exists.
  33347. */
  33348. getMaterial(name: string): ModelMaterial;
  33349. /**
  33350. * Sets the current value of an articulation stage. After setting one or multiple stage values, call
  33351. * Model.applyArticulations() to cause the node matrices to be recalculated.
  33352. * @param articulationStageKey - The name of the articulation, a space, and the name of the stage.
  33353. * @param value - The numeric value of this stage of the articulation.
  33354. */
  33355. setArticulationStage(articulationStageKey: string, value: number): void;
  33356. /**
  33357. * Applies any modified articulation stages to the matrix of each node that participates
  33358. * in any articulation. Note that this will overwrite any nodeTransformations on participating nodes.
  33359. */
  33360. applyArticulations(): void;
  33361. /**
  33362. * Called when {@link Viewer} or {@link CesiumWidget} render the scene to
  33363. * get the draw commands needed to render this primitive.
  33364. * <p>
  33365. * Do not call this function directly. This is documented just to
  33366. * list the exceptions that may be propagated when the scene is rendered:
  33367. * </p>
  33368. */
  33369. update(): void;
  33370. /**
  33371. * Returns true if this object was destroyed; otherwise, false.
  33372. * <br /><br />
  33373. * If this object was destroyed, it should not be used; calling any function other than
  33374. * <code>isDestroyed</code> will result in a {@link DeveloperError} exception.
  33375. * @returns <code>true</code> if this object was destroyed; otherwise, <code>false</code>.
  33376. */
  33377. isDestroyed(): boolean;
  33378. /**
  33379. * Destroys the WebGL resources held by this object. Destroying an object allows for deterministic
  33380. * release of WebGL resources, instead of relying on the garbage collector to destroy this object.
  33381. * <br /><br />
  33382. * Once an object is destroyed, it should not be used; calling any function other than
  33383. * <code>isDestroyed</code> will result in a {@link DeveloperError} exception. Therefore,
  33384. * assign the return value (<code>undefined</code>) to the object as done in the example.
  33385. * @example
  33386. * model = model && model.destroy();
  33387. */
  33388. destroy(): void;
  33389. }
  33390. /**
  33391. * An active glTF animation. A glTF asset can contain animations. An active animation
  33392. * is an animation that is currently playing or scheduled to be played because it was
  33393. * added to a model's {@link ModelAnimationCollection}. An active animation is an
  33394. * instance of an animation; for example, there can be multiple active animations
  33395. * for the same glTF animation, each with a different start time.
  33396. * <p>
  33397. * Create this by calling {@link ModelAnimationCollection#add}.
  33398. * </p>
  33399. */
  33400. export class ModelAnimation {
  33401. constructor();
  33402. /**
  33403. * When <code>true</code>, the animation is removed after it stops playing.
  33404. * This is slightly more efficient that not removing it, but if, for example,
  33405. * time is reversed, the animation is not played again.
  33406. */
  33407. removeOnStop: boolean;
  33408. /**
  33409. * The event fired when this animation is started. This can be used, for
  33410. * example, to play a sound or start a particle system, when the animation starts.
  33411. * <p>
  33412. * This event is fired at the end of the frame after the scene is rendered.
  33413. * </p>
  33414. * @example
  33415. * animation.start.addEventListener(function(model, animation) {
  33416. * console.log('Animation started: ' + animation.name);
  33417. * });
  33418. */
  33419. start: Event;
  33420. /**
  33421. * The event fired when on each frame when this animation is updated. The
  33422. * current time of the animation, relative to the glTF animation time span, is
  33423. * passed to the event, which allows, for example, starting new animations at a
  33424. * specific time relative to a playing animation.
  33425. * <p>
  33426. * This event is fired at the end of the frame after the scene is rendered.
  33427. * </p>
  33428. * @example
  33429. * animation.update.addEventListener(function(model, animation, time) {
  33430. * console.log('Animation updated: ' + animation.name + '. glTF animation time: ' + time);
  33431. * });
  33432. */
  33433. update: Event;
  33434. /**
  33435. * The event fired when this animation is stopped. This can be used, for
  33436. * example, to play a sound or start a particle system, when the animation stops.
  33437. * <p>
  33438. * This event is fired at the end of the frame after the scene is rendered.
  33439. * </p>
  33440. * @example
  33441. * animation.stop.addEventListener(function(model, animation) {
  33442. * console.log('Animation stopped: ' + animation.name);
  33443. * });
  33444. */
  33445. stop: Event;
  33446. /**
  33447. * The glTF animation name that identifies this animation.
  33448. */
  33449. readonly name: string;
  33450. /**
  33451. * The scene time to start playing this animation. When this is <code>undefined</code>,
  33452. * the animation starts at the next frame.
  33453. */
  33454. readonly startTime: JulianDate;
  33455. /**
  33456. * The delay, in seconds, from {@link ModelAnimation#startTime} to start playing.
  33457. */
  33458. readonly delay: number;
  33459. /**
  33460. * The scene time to stop playing this animation. When this is <code>undefined</code>,
  33461. * the animation is played for its full duration and perhaps repeated depending on
  33462. * {@link ModelAnimation#loop}.
  33463. */
  33464. readonly stopTime: JulianDate;
  33465. /**
  33466. * Values greater than <code>1.0</code> increase the speed that the animation is played relative
  33467. * to the scene clock speed; values less than <code>1.0</code> decrease the speed. A value of
  33468. * <code>1.0</code> plays the animation at the speed in the glTF animation mapped to the scene
  33469. * clock speed. For example, if the scene is played at 2x real-time, a two-second glTF animation
  33470. * will play in one second even if <code>multiplier</code> is <code>1.0</code>.
  33471. */
  33472. readonly multiplier: number;
  33473. /**
  33474. * When <code>true</code>, the animation is played in reverse.
  33475. */
  33476. readonly reverse: boolean;
  33477. /**
  33478. * Determines if and how the animation is looped.
  33479. */
  33480. readonly loop: ModelAnimationLoop;
  33481. }
  33482. /**
  33483. * A collection of active model animations. Access this using {@link Model#activeAnimations}.
  33484. */
  33485. export class ModelAnimationCollection {
  33486. constructor();
  33487. /**
  33488. * The event fired when an animation is added to the collection. This can be used, for
  33489. * example, to keep a UI in sync.
  33490. * @example
  33491. * model.activeAnimations.animationAdded.addEventListener(function(model, animation) {
  33492. * console.log('Animation added: ' + animation.name);
  33493. * });
  33494. */
  33495. animationAdded: Event;
  33496. /**
  33497. * The event fired when an animation is removed from the collection. This can be used, for
  33498. * example, to keep a UI in sync.
  33499. * @example
  33500. * model.activeAnimations.animationRemoved.addEventListener(function(model, animation) {
  33501. * console.log('Animation removed: ' + animation.name);
  33502. * });
  33503. */
  33504. animationRemoved: Event;
  33505. /**
  33506. * The number of animations in the collection.
  33507. */
  33508. readonly length: number;
  33509. /**
  33510. * Creates and adds an animation with the specified initial properties to the collection.
  33511. * <p>
  33512. * This raises the {@link ModelAnimationCollection#animationAdded} event so, for example, a UI can stay in sync.
  33513. * </p>
  33514. * @example
  33515. * // Example 1. Add an animation by name
  33516. * model.activeAnimations.add({
  33517. * name : 'animation name'
  33518. * });
  33519. *
  33520. * // Example 2. Add an animation by index
  33521. * model.activeAnimations.add({
  33522. * index : 0
  33523. * });
  33524. * @example
  33525. * // Example 3. Add an animation and provide all properties and events
  33526. * var startTime = Cesium.JulianDate.now();
  33527. *
  33528. * var animation = model.activeAnimations.add({
  33529. * name : 'another animation name',
  33530. * startTime : startTime,
  33531. * delay : 0.0, // Play at startTime (default)
  33532. * stopTime : Cesium.JulianDate.addSeconds(startTime, 4.0, new Cesium.JulianDate()),
  33533. * removeOnStop : false, // Do not remove when animation stops (default)
  33534. * multiplier : 2.0, // Play at double speed
  33535. * reverse : true, // Play in reverse
  33536. * loop : Cesium.ModelAnimationLoop.REPEAT // Loop the animation
  33537. * });
  33538. *
  33539. * animation.start.addEventListener(function(model, animation) {
  33540. * console.log('Animation started: ' + animation.name);
  33541. * });
  33542. * animation.update.addEventListener(function(model, animation, time) {
  33543. * console.log('Animation updated: ' + animation.name + '. glTF animation time: ' + time);
  33544. * });
  33545. * animation.stop.addEventListener(function(model, animation) {
  33546. * console.log('Animation stopped: ' + animation.name);
  33547. * });
  33548. * @param options - Object with the following properties:
  33549. * @param [options.name] - The glTF animation name that identifies the animation. Must be defined if <code>options.index</code> is <code>undefined</code>.
  33550. * @param [options.index] - The glTF animation index that identifies the animation. Must be defined if <code>options.name</code> is <code>undefined</code>.
  33551. * @param [options.startTime] - The scene time to start playing the animation. When this is <code>undefined</code>, the animation starts at the next frame.
  33552. * @param [options.delay = 0.0] - The delay, in seconds, from <code>startTime</code> to start playing.
  33553. * @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.
  33554. * @param [options.removeOnStop = false] - When <code>true</code>, the animation is removed after it stops playing.
  33555. * @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.
  33556. * @param [options.reverse = false] - When <code>true</code>, the animation is played in reverse.
  33557. * @param [options.loop = ModelAnimationLoop.NONE] - Determines if and how the animation is looped.
  33558. * @returns The animation that was added to the collection.
  33559. */
  33560. add(options: {
  33561. name?: string;
  33562. index?: number;
  33563. startTime?: JulianDate;
  33564. delay?: number;
  33565. stopTime?: JulianDate;
  33566. removeOnStop?: boolean;
  33567. multiplier?: number;
  33568. reverse?: boolean;
  33569. loop?: ModelAnimationLoop;
  33570. }): ModelAnimation;
  33571. /**
  33572. * Creates and adds an animation with the specified initial properties to the collection
  33573. * for each animation in the model.
  33574. * <p>
  33575. * This raises the {@link ModelAnimationCollection#animationAdded} event for each model so, for example, a UI can stay in sync.
  33576. * </p>
  33577. * @example
  33578. * model.activeAnimations.addAll({
  33579. * multiplier : 0.5, // Play at half-speed
  33580. * loop : Cesium.ModelAnimationLoop.REPEAT // Loop the animations
  33581. * });
  33582. * @param [options] - Object with the following properties:
  33583. * @param [options.startTime] - The scene time to start playing the animations. When this is <code>undefined</code>, the animations starts at the next frame.
  33584. * @param [options.delay = 0.0] - The delay, in seconds, from <code>startTime</code> to start playing.
  33585. * @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.
  33586. * @param [options.removeOnStop = false] - When <code>true</code>, the animations are removed after they stop playing.
  33587. * @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.
  33588. * @param [options.reverse = false] - When <code>true</code>, the animations are played in reverse.
  33589. * @param [options.loop = ModelAnimationLoop.NONE] - Determines if and how the animations are looped.
  33590. * @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.
  33591. */
  33592. addAll(options?: {
  33593. startTime?: JulianDate;
  33594. delay?: number;
  33595. stopTime?: JulianDate;
  33596. removeOnStop?: boolean;
  33597. multiplier?: number;
  33598. reverse?: boolean;
  33599. loop?: ModelAnimationLoop;
  33600. }): ModelAnimation[];
  33601. /**
  33602. * Removes an animation from the collection.
  33603. * <p>
  33604. * This raises the {@link ModelAnimationCollection#animationRemoved} event so, for example, a UI can stay in sync.
  33605. * </p>
  33606. * <p>
  33607. * An animation can also be implicitly removed from the collection by setting {@link ModelAnimation#removeOnStop} to
  33608. * <code>true</code>. The {@link ModelAnimationCollection#animationRemoved} event is still fired when the animation is removed.
  33609. * </p>
  33610. * @example
  33611. * var a = model.activeAnimations.add({
  33612. * name : 'animation name'
  33613. * });
  33614. * model.activeAnimations.remove(a); // Returns true
  33615. * @param animation - The animation to remove.
  33616. * @returns <code>true</code> if the animation was removed; <code>false</code> if the animation was not found in the collection.
  33617. */
  33618. remove(animation: ModelAnimation): boolean;
  33619. /**
  33620. * Removes all animations from the collection.
  33621. * <p>
  33622. * This raises the {@link ModelAnimationCollection#animationRemoved} event for each
  33623. * animation so, for example, a UI can stay in sync.
  33624. * </p>
  33625. */
  33626. removeAll(): void;
  33627. /**
  33628. * Determines whether this collection contains a given animation.
  33629. * @param animation - The animation to check for.
  33630. * @returns <code>true</code> if this collection contains the animation, <code>false</code> otherwise.
  33631. */
  33632. contains(animation: ModelAnimation): boolean;
  33633. /**
  33634. * Returns the animation in the collection at the specified index. Indices are zero-based
  33635. * and increase as animations are added. Removing an animation shifts all animations after
  33636. * it to the left, changing their indices. This function is commonly used to iterate over
  33637. * all the animations in the collection.
  33638. * @example
  33639. * // Output the names of all the animations in the collection.
  33640. * var animations = model.activeAnimations;
  33641. * var length = animations.length;
  33642. * for (var i = 0; i < length; ++i) {
  33643. * console.log(animations.get(i).name);
  33644. * }
  33645. * @param index - The zero-based index of the animation.
  33646. * @returns The animation at the specified index.
  33647. */
  33648. get(index: number): ModelAnimation;
  33649. }
  33650. /**
  33651. * Determines if and how a glTF animation is looped.
  33652. */
  33653. export enum ModelAnimationLoop {
  33654. /**
  33655. * Play the animation once; do not loop it.
  33656. */
  33657. NONE = 0,
  33658. /**
  33659. * Loop the animation playing it from the start immediately after it stops.
  33660. */
  33661. REPEAT = 1,
  33662. /**
  33663. * Loop the animation. First, playing it forward, then in reverse, then forward, and so on.
  33664. */
  33665. MIRRORED_REPEAT = 2
  33666. }
  33667. /**
  33668. * A model's material with modifiable parameters. A glTF material
  33669. * contains parameters defined by the material's technique with values
  33670. * defined by the technique and potentially overridden by the material.
  33671. * This class allows changing these values at runtime.
  33672. * <p>
  33673. * Use {@link Model#getMaterial} to create an instance.
  33674. * </p>
  33675. */
  33676. export class ModelMaterial {
  33677. constructor();
  33678. /**
  33679. * The value of the <code>name</code> property of this material.
  33680. */
  33681. readonly name: string;
  33682. /**
  33683. * The index of the material.
  33684. */
  33685. readonly id: string;
  33686. /**
  33687. * Assigns a value to a material parameter. The type for <code>value</code>
  33688. * depends on the glTF type of the parameter. It will be a floating-point
  33689. * number, Cartesian, or matrix.
  33690. * @example
  33691. * material.setValue('diffuse', new Cesium.Cartesian4(1.0, 0.0, 0.0, 1.0)); // vec4
  33692. * material.setValue('shininess', 256.0); // scalar
  33693. * @param name - The name of the parameter.
  33694. * @param [value] - The value to assign to the parameter.
  33695. */
  33696. setValue(name: string, value?: any): void;
  33697. /**
  33698. * Returns the value of the parameter with the given <code>name</code>. The type of the
  33699. * returned object depends on the glTF type of the parameter. It will be a floating-point
  33700. * number, Cartesian, or matrix.
  33701. * @param name - The name of the parameter.
  33702. * @returns The value of the parameter or <code>undefined</code> if the parameter does not exist.
  33703. */
  33704. getValue(name: string): any;
  33705. }
  33706. /**
  33707. * A model's mesh and its materials.
  33708. * <p>
  33709. * Use {@link Model#getMesh} to create an instance.
  33710. * </p>
  33711. */
  33712. export class ModelMesh {
  33713. constructor();
  33714. /**
  33715. * The value of the <code>name</code> property of this mesh.
  33716. */
  33717. readonly name: string;
  33718. /**
  33719. * The index of the mesh.
  33720. */
  33721. readonly id: string;
  33722. /**
  33723. * An array of {@link ModelMaterial} instances indexed by the mesh's
  33724. * primitive indices.
  33725. */
  33726. readonly materials: ModelMaterial[];
  33727. }
  33728. /**
  33729. * A model node with a transform for user-defined animations. A glTF asset can
  33730. * contain animations that target a node's transform. This class allows
  33731. * changing a node's transform externally so animation can be driven by another
  33732. * source, not just an animation in the glTF asset.
  33733. * <p>
  33734. * Use {@link Model#getNode} to create an instance.
  33735. * </p>
  33736. * @example
  33737. * var node = model.getNode('LOD3sp');
  33738. * node.matrix = Cesium.Matrix4.fromScale(new Cesium.Cartesian3(5.0, 1.0, 1.0), node.matrix);
  33739. */
  33740. export class ModelNode {
  33741. constructor();
  33742. /**
  33743. * The value of the <code>name</code> property of this node.
  33744. */
  33745. readonly name: string;
  33746. /**
  33747. * The index of the node.
  33748. */
  33749. readonly id: string;
  33750. /**
  33751. * Determines if this node and its children will be shown.
  33752. */
  33753. show: boolean;
  33754. /**
  33755. * The node's 4x4 matrix transform from its local coordinates to
  33756. * its parent's.
  33757. * <p>
  33758. * For changes to take effect, this property must be assigned to;
  33759. * setting individual elements of the matrix will not work.
  33760. * </p>
  33761. */
  33762. matrix: Matrix4;
  33763. /**
  33764. * Gets the node's original 4x4 matrix transform from its local coordinates to
  33765. * its parent's, without any node transformations or articulations applied.
  33766. */
  33767. originalMatrix: Matrix4;
  33768. }
  33769. /**
  33770. * Draws the Moon in 3D.
  33771. * @example
  33772. * scene.moon = new Cesium.Moon();
  33773. * @param [options] - Object with the following properties:
  33774. * @param [options.show = true] - Determines whether the moon will be rendered.
  33775. * @param [options.textureUrl = buildModuleUrl('Assets/Textures/moonSmall.jpg')] - The moon texture.
  33776. * @param [options.ellipsoid = Ellipsoid.MOON] - The moon ellipsoid.
  33777. * @param [options.onlySunLighting = true] - Use the sun as the only light source.
  33778. */
  33779. export class Moon {
  33780. constructor(options?: {
  33781. show?: boolean;
  33782. textureUrl?: string;
  33783. ellipsoid?: Ellipsoid;
  33784. onlySunLighting?: boolean;
  33785. });
  33786. /**
  33787. * Determines if the moon will be shown.
  33788. */
  33789. show: boolean;
  33790. /**
  33791. * The moon texture.
  33792. */
  33793. textureUrl: string;
  33794. /**
  33795. * Use the sun as the only light source.
  33796. */
  33797. onlySunLighting: boolean;
  33798. /**
  33799. * Get the ellipsoid that defines the shape of the moon.
  33800. */
  33801. readonly ellipsoid: Ellipsoid;
  33802. /**
  33803. * Returns true if this object was destroyed; otherwise, false.
  33804. * <br /><br />
  33805. * If this object was destroyed, it should not be used; calling any function other than
  33806. * <code>isDestroyed</code> will result in a {@link DeveloperError} exception.
  33807. * @returns <code>true</code> if this object was destroyed; otherwise, <code>false</code>.
  33808. */
  33809. isDestroyed(): boolean;
  33810. /**
  33811. * Destroys the WebGL resources held by this object. Destroying an object allows for deterministic
  33812. * release of WebGL resources, instead of relying on the garbage collector to destroy this object.
  33813. * <br /><br />
  33814. * Once an object is destroyed, it should not be used; calling any function other than
  33815. * <code>isDestroyed</code> will result in a {@link DeveloperError} exception. Therefore,
  33816. * assign the return value (<code>undefined</code>) to the object as done in the example.
  33817. * @example
  33818. * moon = moon && moon.destroy();
  33819. */
  33820. destroy(): void;
  33821. }
  33822. /**
  33823. * A {@link TileDiscardPolicy} specifying that tile images should never be discard.
  33824. */
  33825. export class NeverTileDiscardPolicy {
  33826. constructor();
  33827. /**
  33828. * Determines if the discard policy is ready to process images.
  33829. * @returns True if the discard policy is ready to process images; otherwise, false.
  33830. */
  33831. isReady(): boolean;
  33832. /**
  33833. * Given a tile image, decide whether to discard that image.
  33834. * @param image - An image to test.
  33835. * @returns True if the image should be discarded; otherwise, false.
  33836. */
  33837. shouldDiscardImage(image: HTMLImageElement): boolean;
  33838. }
  33839. export namespace OpenStreetMapImageryProvider {
  33840. /**
  33841. * Initialization options for the OpenStreetMapImageryProvider constructor
  33842. * @property [url = 'https://a.tile.openstreetmap.org'] - The OpenStreetMap server url.
  33843. * @property [fileExtension = 'png'] - The file extension for images on the server.
  33844. * @property [rectangle = Rectangle.MAX_VALUE] - The rectangle of the layer.
  33845. * @property [minimumLevel = 0] - The minimum level-of-detail supported by the imagery provider.
  33846. * @property [maximumLevel] - The maximum level-of-detail supported by the imagery provider, or undefined if there is no limit.
  33847. * @property [ellipsoid] - The ellipsoid. If not specified, the WGS84 ellipsoid is used.
  33848. * @property [credit = 'MapQuest, Open Street Map and contributors, CC-BY-SA'] - A credit for the data source, which is displayed on the canvas.
  33849. */
  33850. type ConstructorOptions = {
  33851. url?: string;
  33852. fileExtension?: string;
  33853. rectangle?: Rectangle;
  33854. minimumLevel?: number;
  33855. maximumLevel?: number;
  33856. ellipsoid?: Ellipsoid;
  33857. credit?: Credit | string;
  33858. };
  33859. }
  33860. /**
  33861. * An imagery provider that provides tiled imagery hosted by OpenStreetMap
  33862. * or another provider of Slippy tiles. The default url connects to OpenStreetMap's volunteer-run
  33863. * servers, so you must conform to their
  33864. * {@link http://wiki.openstreetmap.org/wiki/Tile_usage_policy|Tile Usage Policy}.
  33865. * @example
  33866. * var osm = new Cesium.OpenStreetMapImageryProvider({
  33867. * url : 'https://a.tile.openstreetmap.org/'
  33868. * });
  33869. * @param options - Object describing initialization options
  33870. */
  33871. export class OpenStreetMapImageryProvider extends UrlTemplateImageryProvider {
  33872. constructor(options: OpenStreetMapImageryProvider.ConstructorOptions);
  33873. }
  33874. /**
  33875. * A particle emitted by a {@link ParticleSystem}.
  33876. * @param options - An object with the following properties:
  33877. * @param [options.mass = 1.0] - The mass of the particle in kilograms.
  33878. * @param [options.position = Cartesian3.ZERO] - The initial position of the particle in world coordinates.
  33879. * @param [options.velocity = Cartesian3.ZERO] - The velocity vector of the particle in world coordinates.
  33880. * @param [options.life = Number.MAX_VALUE] - The life of the particle in seconds.
  33881. * @param [options.image] - The URI, HTMLImageElement, or HTMLCanvasElement to use for the billboard.
  33882. * @param [options.startColor = Color.WHITE] - The color of a particle when it is born.
  33883. * @param [options.endColor = Color.WHITE] - The color of a particle when it dies.
  33884. * @param [options.startScale = 1.0] - The scale of the particle when it is born.
  33885. * @param [options.endScale = 1.0] - The scale of the particle when it dies.
  33886. * @param [options.imageSize = new Cartesian2(1.0, 1.0)] - The dimensions, width by height, to scale the particle image in pixels.
  33887. */
  33888. export class Particle {
  33889. constructor(options: {
  33890. mass?: number;
  33891. position?: Cartesian3;
  33892. velocity?: Cartesian3;
  33893. life?: number;
  33894. image?: any;
  33895. startColor?: Color;
  33896. endColor?: Color;
  33897. startScale?: number;
  33898. endScale?: number;
  33899. imageSize?: Cartesian2;
  33900. });
  33901. /**
  33902. * The mass of the particle in kilograms.
  33903. */
  33904. mass: number;
  33905. /**
  33906. * The positon of the particle in world coordinates.
  33907. */
  33908. position: Cartesian3;
  33909. /**
  33910. * The velocity of the particle in world coordinates.
  33911. */
  33912. velocity: Cartesian3;
  33913. /**
  33914. * The life of the particle in seconds.
  33915. */
  33916. life: number;
  33917. /**
  33918. * The image to use for the particle.
  33919. */
  33920. image: any;
  33921. /**
  33922. * The color of the particle when it is born.
  33923. */
  33924. startColor: Color;
  33925. /**
  33926. * The color of the particle when it dies.
  33927. */
  33928. endColor: Color;
  33929. /**
  33930. * the scale of the particle when it is born.
  33931. */
  33932. startScale: number;
  33933. /**
  33934. * The scale of the particle when it dies.
  33935. */
  33936. endScale: number;
  33937. /**
  33938. * The dimensions, width by height, to scale the particle image in pixels.
  33939. */
  33940. imageSize: Cartesian2;
  33941. /**
  33942. * Gets the age of the particle in seconds.
  33943. */
  33944. age: number;
  33945. /**
  33946. * Gets the age normalized to a value in the range [0.0, 1.0].
  33947. */
  33948. normalizedAge: number;
  33949. }
  33950. /**
  33951. * Represents a burst of {@link Particle}s from a {@link ParticleSystem} at a given time in the systems lifetime.
  33952. * @param [options] - An object with the following properties:
  33953. * @param [options.time = 0.0] - The time in seconds after the beginning of the particle system's lifetime that the burst will occur.
  33954. * @param [options.minimum = 0.0] - The minimum number of particles emmitted in the burst.
  33955. * @param [options.maximum = 50.0] - The maximum number of particles emitted in the burst.
  33956. */
  33957. export class ParticleBurst {
  33958. constructor(options?: {
  33959. time?: number;
  33960. minimum?: number;
  33961. maximum?: number;
  33962. });
  33963. /**
  33964. * The time in seconds after the beginning of the particle system's lifetime that the burst will occur.
  33965. */
  33966. time: number;
  33967. /**
  33968. * The minimum number of particles emitted.
  33969. */
  33970. minimum: number;
  33971. /**
  33972. * The maximum number of particles emitted.
  33973. */
  33974. maximum: number;
  33975. /**
  33976. * <code>true</code> if the burst has been completed; <code>false</code> otherwise.
  33977. */
  33978. complete: boolean;
  33979. }
  33980. /**
  33981. * <p>
  33982. * An object that initializes a {@link Particle} from a {@link ParticleSystem}.
  33983. * </p>
  33984. * <p>
  33985. * This type describes an interface and is not intended to be instantiated directly.
  33986. * </p>
  33987. */
  33988. export class ParticleEmitter {
  33989. constructor();
  33990. }
  33991. /**
  33992. * A ParticleSystem manages the updating and display of a collection of particles.
  33993. * @param [options] - Object with the following properties:
  33994. * @param [options.show = true] - Whether to display the particle system.
  33995. * @param [options.updateCallback] - The callback function to be called each frame to update a particle.
  33996. * @param [options.emitter = new CircleEmitter(0.5)] - The particle emitter for this system.
  33997. * @param [options.modelMatrix = Matrix4.IDENTITY] - The 4x4 transformation matrix that transforms the particle system from model to world coordinates.
  33998. * @param [options.emitterModelMatrix = Matrix4.IDENTITY] - The 4x4 transformation matrix that transforms the particle system emitter within the particle systems local coordinate system.
  33999. * @param [options.emissionRate = 5] - The number of particles to emit per second.
  34000. * @param [options.bursts] - An array of {@link ParticleBurst}, emitting bursts of particles at periodic times.
  34001. * @param [options.loop = true] - Whether the particle system should loop its bursts when it is complete.
  34002. * @param [options.scale = 1.0] - Sets the scale to apply to the image of the particle for the duration of its particleLife.
  34003. * @param [options.startScale] - The initial scale to apply to the image of the particle at the beginning of its life.
  34004. * @param [options.endScale] - The final scale to apply to the image of the particle at the end of its life.
  34005. * @param [options.color = Color.WHITE] - Sets the color of a particle for the duration of its particleLife.
  34006. * @param [options.startColor] - The color of the particle at the beginning of its life.
  34007. * @param [options.endColor] - The color of the particle at the end of its life.
  34008. * @param [options.image] - The URI, HTMLImageElement, or HTMLCanvasElement to use for the billboard.
  34009. * @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.
  34010. * @param [options.minimumImageSize] - Sets the minimum bound, width by height, above which to randomly scale the particle image's dimensions in pixels.
  34011. * @param [options.maximumImageSize] - Sets the maximum bound, width by height, below which to randomly scale the particle image's dimensions in pixels.
  34012. * @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.
  34013. * @param [options.speed = 1.0] - If set, overrides the minimumSpeed and maximumSpeed inputs with this value.
  34014. * @param [options.minimumSpeed] - Sets the minimum bound in meters per second above which a particle's actual speed will be randomly chosen.
  34015. * @param [options.maximumSpeed] - Sets the maximum bound in meters per second below which a particle's actual speed will be randomly chosen.
  34016. * @param [options.lifetime = Number.MAX_VALUE] - How long the particle system will emit particles, in seconds.
  34017. * @param [options.particleLife = 5.0] - If set, overrides the minimumParticleLife and maximumParticleLife inputs with this value.
  34018. * @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.
  34019. * @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.
  34020. * @param [options.mass = 1.0] - Sets the minimum and maximum mass of particles in kilograms.
  34021. * @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.
  34022. * @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.
  34023. */
  34024. export class ParticleSystem {
  34025. constructor(options?: {
  34026. show?: boolean;
  34027. updateCallback?: ParticleSystem.updateCallback;
  34028. emitter?: ParticleEmitter;
  34029. modelMatrix?: Matrix4;
  34030. emitterModelMatrix?: Matrix4;
  34031. emissionRate?: number;
  34032. bursts?: ParticleBurst[];
  34033. loop?: boolean;
  34034. scale?: number;
  34035. startScale?: number;
  34036. endScale?: number;
  34037. color?: Color;
  34038. startColor?: Color;
  34039. endColor?: Color;
  34040. image?: any;
  34041. imageSize?: Cartesian2;
  34042. minimumImageSize?: Cartesian2;
  34043. maximumImageSize?: Cartesian2;
  34044. sizeInMeters?: boolean;
  34045. speed?: number;
  34046. minimumSpeed?: number;
  34047. maximumSpeed?: number;
  34048. lifetime?: number;
  34049. particleLife?: number;
  34050. minimumParticleLife?: number;
  34051. maximumParticleLife?: number;
  34052. mass?: number;
  34053. minimumMass?: number;
  34054. maximumMass?: number;
  34055. });
  34056. /**
  34057. * Whether to display the particle system.
  34058. */
  34059. show: boolean;
  34060. /**
  34061. * An array of force callbacks. The callback is passed a {@link Particle} and the difference from the last time
  34062. */
  34063. updateCallback: ParticleSystem.updateCallback;
  34064. /**
  34065. * Whether the particle system should loop it's bursts when it is complete.
  34066. */
  34067. loop: boolean;
  34068. /**
  34069. * The URI, HTMLImageElement, or HTMLCanvasElement to use for the billboard.
  34070. */
  34071. image: any;
  34072. /**
  34073. * The particle emitter for this
  34074. */
  34075. emitter: ParticleEmitter;
  34076. /**
  34077. * An array of {@link ParticleBurst}, emitting bursts of particles at periodic times.
  34078. */
  34079. bursts: ParticleBurst[];
  34080. /**
  34081. * The 4x4 transformation matrix that transforms the particle system from model to world coordinates.
  34082. */
  34083. modelMatrix: Matrix4;
  34084. /**
  34085. * The 4x4 transformation matrix that transforms the particle system emitter within the particle systems local coordinate system.
  34086. */
  34087. emitterModelMatrix: Matrix4;
  34088. /**
  34089. * The color of the particle at the beginning of its life.
  34090. */
  34091. startColor: Color;
  34092. /**
  34093. * The color of the particle at the end of its life.
  34094. */
  34095. endColor: Color;
  34096. /**
  34097. * The initial scale to apply to the image of the particle at the beginning of its life.
  34098. */
  34099. startScale: number;
  34100. /**
  34101. * The final scale to apply to the image of the particle at the end of its life.
  34102. */
  34103. endScale: number;
  34104. /**
  34105. * The number of particles to emit per second.
  34106. */
  34107. emissionRate: number;
  34108. /**
  34109. * Sets the minimum bound in meters per second above which a particle's actual speed will be randomly chosen.
  34110. */
  34111. minimumSpeed: number;
  34112. /**
  34113. * Sets the maximum bound in meters per second below which a particle's actual speed will be randomly chosen.
  34114. */
  34115. maximumSpeed: number;
  34116. /**
  34117. * 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.
  34118. */
  34119. minimumParticleLife: number;
  34120. /**
  34121. * 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.
  34122. */
  34123. maximumParticleLife: number;
  34124. /**
  34125. * Sets the minimum mass of particles in kilograms.
  34126. */
  34127. minimumMass: number;
  34128. /**
  34129. * Sets the maximum mass of particles in kilograms.
  34130. */
  34131. maximumMass: number;
  34132. /**
  34133. * Sets the minimum bound, width by height, above which to randomly scale the particle image's dimensions in pixels.
  34134. */
  34135. minimumImageSize: Cartesian2;
  34136. /**
  34137. * Sets the maximum bound, width by height, below which to randomly scale the particle image's dimensions in pixels.
  34138. */
  34139. maximumImageSize: Cartesian2;
  34140. /**
  34141. * 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.
  34142. */
  34143. sizeInMeters: boolean;
  34144. /**
  34145. * How long the particle system will emit particles, in seconds.
  34146. */
  34147. lifetime: number;
  34148. /**
  34149. * Fires an event when the particle system has reached the end of its lifetime.
  34150. */
  34151. complete: Event;
  34152. /**
  34153. * When <code>true</code>, the particle system has reached the end of its lifetime; <code>false</code> otherwise.
  34154. */
  34155. isComplete: boolean;
  34156. /**
  34157. * Returns true if this object was destroyed; otherwise, false.
  34158. * <br /><br />
  34159. * If this object was destroyed, it should not be used; calling any function other than
  34160. * <code>isDestroyed</code> will result in a {@link DeveloperError} exception.
  34161. * @returns <code>true</code> if this object was destroyed; otherwise, <code>false</code>.
  34162. */
  34163. isDestroyed(): boolean;
  34164. /**
  34165. * Destroys the WebGL resources held by this object. Destroying an object allows for deterministic
  34166. * release of WebGL resources, instead of relying on the garbage collector to destroy this object.
  34167. * <br /><br />
  34168. * Once an object is destroyed, it should not be used; calling any function other than
  34169. * <code>isDestroyed</code> will result in a {@link DeveloperError} exception. Therefore,
  34170. * assign the return value (<code>undefined</code>) to the object as done in the example.
  34171. */
  34172. destroy(): void;
  34173. }
  34174. export namespace ParticleSystem {
  34175. /**
  34176. * A function used to modify attributes of the particle at each time step. This can include force modifications,
  34177. * color, sizing, etc.
  34178. * @example
  34179. * function applyGravity(particle, dt) {
  34180. * var position = particle.position;
  34181. * var gravityVector = Cesium.Cartesian3.normalize(position, new Cesium.Cartesian3());
  34182. * Cesium.Cartesian3.multiplyByScalar(gravityVector, GRAVITATIONAL_CONSTANT * dt, gravityVector);
  34183. * particle.velocity = Cesium.Cartesian3.add(particle.velocity, gravityVector, particle.velocity);
  34184. * }
  34185. * @param particle - The particle being updated.
  34186. * @param dt - The time in seconds since the last update.
  34187. */
  34188. type updateCallback = (particle: Particle, dt: number) => void;
  34189. }
  34190. /**
  34191. * An appearance for {@link GeometryInstance} instances with color attributes.
  34192. * This allows several geometry instances, each with a different color, to
  34193. * be drawn with the same {@link Primitive} as shown in the second example below.
  34194. * @example
  34195. * // A solid white line segment
  34196. * var primitive = new Cesium.Primitive({
  34197. * geometryInstances : new Cesium.GeometryInstance({
  34198. * geometry : new Cesium.SimplePolylineGeometry({
  34199. * positions : Cesium.Cartesian3.fromDegreesArray([
  34200. * 0.0, 0.0,
  34201. * 5.0, 0.0
  34202. * ])
  34203. * }),
  34204. * attributes : {
  34205. * color : Cesium.ColorGeometryInstanceAttribute.fromColor(new Cesium.Color(1.0, 1.0, 1.0, 1.0))
  34206. * }
  34207. * }),
  34208. * appearance : new Cesium.PerInstanceColorAppearance({
  34209. * flat : true,
  34210. * translucent : false
  34211. * })
  34212. * });
  34213. *
  34214. * // Two rectangles in a primitive, each with a different color
  34215. * var instance = new Cesium.GeometryInstance({
  34216. * geometry : new Cesium.RectangleGeometry({
  34217. * rectangle : Cesium.Rectangle.fromDegrees(0.0, 20.0, 10.0, 30.0)
  34218. * }),
  34219. * attributes : {
  34220. * color : new Cesium.ColorGeometryInstanceAttribute(1.0, 0.0, 0.0, 0.5)
  34221. * }
  34222. * });
  34223. *
  34224. * var anotherInstance = new Cesium.GeometryInstance({
  34225. * geometry : new Cesium.RectangleGeometry({
  34226. * rectangle : Cesium.Rectangle.fromDegrees(0.0, 40.0, 10.0, 50.0)
  34227. * }),
  34228. * attributes : {
  34229. * color : new Cesium.ColorGeometryInstanceAttribute(0.0, 0.0, 1.0, 0.5)
  34230. * }
  34231. * });
  34232. *
  34233. * var rectanglePrimitive = new Cesium.Primitive({
  34234. * geometryInstances : [instance, anotherInstance],
  34235. * appearance : new Cesium.PerInstanceColorAppearance()
  34236. * });
  34237. * @param [options] - Object with the following properties:
  34238. * @param [options.flat = false] - When <code>true</code>, flat shading is used in the fragment shader, which means lighting is not taking into account.
  34239. * @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}.
  34240. * @param [options.translucent = true] - When <code>true</code>, the geometry is expected to appear translucent so {@link PerInstanceColorAppearance#renderState} has alpha blending enabled.
  34241. * @param [options.closed = false] - When <code>true</code>, the geometry is expected to be closed so {@link PerInstanceColorAppearance#renderState} has backface culling enabled.
  34242. * @param [options.vertexShaderSource] - Optional GLSL vertex shader source to override the default vertex shader.
  34243. * @param [options.fragmentShaderSource] - Optional GLSL fragment shader source to override the default fragment shader.
  34244. * @param [options.renderState] - Optional render state to override the default render state.
  34245. */
  34246. export class PerInstanceColorAppearance {
  34247. constructor(options?: {
  34248. flat?: boolean;
  34249. faceForward?: boolean;
  34250. translucent?: boolean;
  34251. closed?: boolean;
  34252. vertexShaderSource?: string;
  34253. fragmentShaderSource?: string;
  34254. renderState?: any;
  34255. });
  34256. /**
  34257. * This property is part of the {@link Appearance} interface, but is not
  34258. * used by {@link PerInstanceColorAppearance} since a fully custom fragment shader is used.
  34259. */
  34260. material: Material;
  34261. /**
  34262. * When <code>true</code>, the geometry is expected to appear translucent so
  34263. * {@link PerInstanceColorAppearance#renderState} has alpha blending enabled.
  34264. */
  34265. translucent: boolean;
  34266. /**
  34267. * The GLSL source code for the vertex shader.
  34268. */
  34269. readonly vertexShaderSource: string;
  34270. /**
  34271. * The GLSL source code for the fragment shader.
  34272. */
  34273. readonly fragmentShaderSource: string;
  34274. /**
  34275. * The WebGL fixed-function state to use when rendering the geometry.
  34276. * <p>
  34277. * The render state can be explicitly defined when constructing a {@link PerInstanceColorAppearance}
  34278. * instance, or it is set implicitly via {@link PerInstanceColorAppearance#translucent}
  34279. * and {@link PerInstanceColorAppearance#closed}.
  34280. * </p>
  34281. */
  34282. readonly renderState: any;
  34283. /**
  34284. * When <code>true</code>, the geometry is expected to be closed so
  34285. * {@link PerInstanceColorAppearance#renderState} has backface culling enabled.
  34286. * If the viewer enters the geometry, it will not be visible.
  34287. */
  34288. readonly closed: boolean;
  34289. /**
  34290. * The {@link VertexFormat} that this appearance instance is compatible with.
  34291. * A geometry can have more vertex attributes and still be compatible - at a
  34292. * potential performance cost - but it can't have less.
  34293. */
  34294. readonly vertexFormat: VertexFormat;
  34295. /**
  34296. * When <code>true</code>, flat shading is used in the fragment shader,
  34297. * which means lighting is not taking into account.
  34298. */
  34299. readonly flat: boolean;
  34300. /**
  34301. * When <code>true</code>, the fragment shader flips the surface normal
  34302. * as needed to ensure that the normal faces the viewer to avoid
  34303. * dark spots. This is useful when both sides of a geometry should be
  34304. * shaded like {@link WallGeometry}.
  34305. */
  34306. readonly faceForward: boolean;
  34307. /**
  34308. * The {@link VertexFormat} that all {@link PerInstanceColorAppearance} instances
  34309. * are compatible with. This requires only <code>position</code> and <code>normal</code>
  34310. * attributes.
  34311. */
  34312. static readonly VERTEX_FORMAT: VertexFormat;
  34313. /**
  34314. * The {@link VertexFormat} that all {@link PerInstanceColorAppearance} instances
  34315. * are compatible with when {@link PerInstanceColorAppearance#flat} is <code>true</code>.
  34316. * This requires only a <code>position</code> attribute.
  34317. */
  34318. static readonly FLAT_VERTEX_FORMAT: VertexFormat;
  34319. /**
  34320. * Procedurally creates the full GLSL fragment shader source. For {@link PerInstanceColorAppearance},
  34321. * this is derived from {@link PerInstanceColorAppearance#fragmentShaderSource}, {@link PerInstanceColorAppearance#flat},
  34322. * and {@link PerInstanceColorAppearance#faceForward}.
  34323. * @returns The full GLSL fragment shader source.
  34324. */
  34325. getFragmentShaderSource(): string;
  34326. /**
  34327. * Determines if the geometry is translucent based on {@link PerInstanceColorAppearance#translucent}.
  34328. * @returns <code>true</code> if the appearance is translucent.
  34329. */
  34330. isTranslucent(): boolean;
  34331. /**
  34332. * Creates a render state. This is not the final render state instance; instead,
  34333. * it can contain a subset of render state properties identical to the render state
  34334. * created in the context.
  34335. * @returns The render state.
  34336. */
  34337. getRenderState(): any;
  34338. }
  34339. /**
  34340. * Options for performing point attenuation based on geometric error when rendering
  34341. * point clouds using 3D Tiles.
  34342. * @param [options] - Object with the following properties:
  34343. * @param [options.attenuation = false] - Perform point attenuation based on geometric error.
  34344. * @param [options.geometricErrorScale = 1.0] - Scale to be applied to each tile's geometric error.
  34345. * @param [options.maximumAttenuation] - Maximum attenuation in pixels. Defaults to the Cesium3DTileset's maximumScreenSpaceError.
  34346. * @param [options.baseResolution] - Average base resolution for the dataset in meters. Substitute for Geometric Error when not available.
  34347. * @param [options.eyeDomeLighting = true] - When true, use eye dome lighting when drawing with point attenuation.
  34348. * @param [options.eyeDomeLightingStrength = 1.0] - Increasing this value increases contrast on slopes and edges.
  34349. * @param [options.eyeDomeLightingRadius = 1.0] - Increase the thickness of contours from eye dome lighting.
  34350. * @param [options.backFaceCulling = false] - Determines whether back-facing points are hidden. This option works only if data has normals included.
  34351. * @param [options.normalShading = true] - Determines whether a point cloud that contains normals is shaded by the scene's light source.
  34352. */
  34353. export class PointCloudShading {
  34354. constructor(options?: {
  34355. attenuation?: boolean;
  34356. geometricErrorScale?: number;
  34357. maximumAttenuation?: number;
  34358. baseResolution?: number;
  34359. eyeDomeLighting?: boolean;
  34360. eyeDomeLightingStrength?: number;
  34361. eyeDomeLightingRadius?: number;
  34362. backFaceCulling?: boolean;
  34363. normalShading?: boolean;
  34364. });
  34365. /**
  34366. * Perform point attenuation based on geometric error.
  34367. */
  34368. attenuation: boolean;
  34369. /**
  34370. * Scale to be applied to the geometric error before computing attenuation.
  34371. */
  34372. geometricErrorScale: number;
  34373. /**
  34374. * Maximum point attenuation in pixels. If undefined, the Cesium3DTileset's maximumScreenSpaceError will be used.
  34375. */
  34376. maximumAttenuation: number;
  34377. /**
  34378. * Average base resolution for the dataset in meters.
  34379. * Used in place of geometric error when geometric error is 0.
  34380. * If undefined, an approximation will be computed for each tile that has geometric error of 0.
  34381. */
  34382. baseResolution: number;
  34383. /**
  34384. * Use eye dome lighting when drawing with point attenuation
  34385. * Requires support for EXT_frag_depth, OES_texture_float, and WEBGL_draw_buffers extensions in WebGL 1.0,
  34386. * otherwise eye dome lighting is ignored.
  34387. */
  34388. eyeDomeLighting: boolean;
  34389. /**
  34390. * Eye dome lighting strength (apparent contrast)
  34391. */
  34392. eyeDomeLightingStrength: number;
  34393. /**
  34394. * Thickness of contours from eye dome lighting
  34395. */
  34396. eyeDomeLightingRadius: number;
  34397. /**
  34398. * Determines whether back-facing points are hidden.
  34399. * This option works only if data has normals included.
  34400. */
  34401. backFaceCulling: boolean;
  34402. /**
  34403. * Determines whether a point cloud that contains normals is shaded by the scene's light source.
  34404. */
  34405. normalShading: boolean;
  34406. /**
  34407. * Determines if point cloud shading is supported.
  34408. * @param scene - The scene.
  34409. * @returns <code>true</code> if point cloud shading is supported; otherwise, returns <code>false</code>
  34410. */
  34411. static isSupported(scene: Scene): boolean;
  34412. }
  34413. /**
  34414. * A graphical point positioned in the 3D scene, that is created
  34415. * and rendered using a {@link PointPrimitiveCollection}. A point is created and its initial
  34416. * properties are set by calling {@link PointPrimitiveCollection#add}.
  34417. */
  34418. export class PointPrimitive {
  34419. constructor();
  34420. /**
  34421. * Determines if this point will be shown. Use this to hide or show a point, instead
  34422. * of removing it and re-adding it to the collection.
  34423. */
  34424. show: boolean;
  34425. /**
  34426. * Gets or sets the Cartesian position of this point.
  34427. */
  34428. position: Cartesian3;
  34429. /**
  34430. * Gets or sets near and far scaling properties of a point based on the point's distance from the camera.
  34431. * A point's scale will interpolate between the {@link NearFarScalar#nearValue} and
  34432. * {@link NearFarScalar#farValue} while the camera distance falls within the lower and upper bounds
  34433. * of the specified {@link NearFarScalar#near} and {@link NearFarScalar#far}.
  34434. * Outside of these ranges the point's scale remains clamped to the nearest bound. This scale
  34435. * multiplies the pixelSize and outlineWidth to affect the total size of the point. If undefined,
  34436. * scaleByDistance will be disabled.
  34437. * @example
  34438. * // Example 1.
  34439. * // Set a pointPrimitive's scaleByDistance to scale to 15 when the
  34440. * // camera is 1500 meters from the pointPrimitive and disappear as
  34441. * // the camera distance approaches 8.0e6 meters.
  34442. * p.scaleByDistance = new Cesium.NearFarScalar(1.5e2, 15, 8.0e6, 0.0);
  34443. * @example
  34444. * // Example 2.
  34445. * // disable scaling by distance
  34446. * p.scaleByDistance = undefined;
  34447. */
  34448. scaleByDistance: NearFarScalar;
  34449. /**
  34450. * Gets or sets near and far translucency properties of a point based on the point's distance from the camera.
  34451. * A point's translucency will interpolate between the {@link NearFarScalar#nearValue} and
  34452. * {@link NearFarScalar#farValue} while the camera distance falls within the lower and upper bounds
  34453. * of the specified {@link NearFarScalar#near} and {@link NearFarScalar#far}.
  34454. * Outside of these ranges the point's translucency remains clamped to the nearest bound. If undefined,
  34455. * translucencyByDistance will be disabled.
  34456. * @example
  34457. * // Example 1.
  34458. * // Set a point's translucency to 1.0 when the
  34459. * // camera is 1500 meters from the point and disappear as
  34460. * // the camera distance approaches 8.0e6 meters.
  34461. * p.translucencyByDistance = new Cesium.NearFarScalar(1.5e2, 1.0, 8.0e6, 0.0);
  34462. * @example
  34463. * // Example 2.
  34464. * // disable translucency by distance
  34465. * p.translucencyByDistance = undefined;
  34466. */
  34467. translucencyByDistance: NearFarScalar;
  34468. /**
  34469. * Gets or sets the inner size of the point in pixels.
  34470. */
  34471. pixelSize: number;
  34472. /**
  34473. * Gets or sets the inner color of the point.
  34474. * The red, green, blue, and alpha values are indicated by <code>value</code>'s <code>red</code>, <code>green</code>,
  34475. * <code>blue</code>, and <code>alpha</code> properties as shown in Example 1. These components range from <code>0.0</code>
  34476. * (no intensity) to <code>1.0</code> (full intensity).
  34477. * @example
  34478. * // Example 1. Assign yellow.
  34479. * p.color = Cesium.Color.YELLOW;
  34480. * @example
  34481. * // Example 2. Make a pointPrimitive 50% translucent.
  34482. * p.color = new Cesium.Color(1.0, 1.0, 1.0, 0.5);
  34483. */
  34484. color: Color;
  34485. /**
  34486. * Gets or sets the outline color of the point.
  34487. */
  34488. outlineColor: Color;
  34489. /**
  34490. * Gets or sets the outline width in pixels. This width adds to pixelSize,
  34491. * increasing the total size of the point.
  34492. */
  34493. outlineWidth: number;
  34494. /**
  34495. * Gets or sets the condition specifying at what distance from the camera that this point will be displayed.
  34496. */
  34497. distanceDisplayCondition: DistanceDisplayCondition;
  34498. /**
  34499. * Gets or sets the distance from the camera at which to disable the depth test to, for example, prevent clipping against terrain.
  34500. * When set to zero, the depth test is always applied. When set to Number.POSITIVE_INFINITY, the depth test is never applied.
  34501. */
  34502. disableDepthTestDistance: number;
  34503. /**
  34504. * Gets or sets the user-defined value returned when the point is picked.
  34505. */
  34506. id: any;
  34507. /**
  34508. * Computes the screen-space position of the point's origin.
  34509. * The screen space origin is the top, left corner of the canvas; <code>x</code> increases from
  34510. * left to right, and <code>y</code> increases from top to bottom.
  34511. * @example
  34512. * console.log(p.computeScreenSpacePosition(scene).toString());
  34513. * @param scene - The scene.
  34514. * @param [result] - The object onto which to store the result.
  34515. * @returns The screen-space position of the point.
  34516. */
  34517. computeScreenSpacePosition(scene: Scene, result?: Cartesian2): Cartesian2;
  34518. /**
  34519. * Determines if this point equals another point. Points are equal if all their properties
  34520. * are equal. Points in different collections can be equal.
  34521. * @param other - The point to compare for equality.
  34522. * @returns <code>true</code> if the points are equal; otherwise, <code>false</code>.
  34523. */
  34524. equals(other: PointPrimitive): boolean;
  34525. }
  34526. /**
  34527. * A renderable collection of points.
  34528. * <br /><br />
  34529. * Points are added and removed from the collection using {@link PointPrimitiveCollection#add}
  34530. * and {@link PointPrimitiveCollection#remove}.
  34531. * @example
  34532. * // Create a pointPrimitive collection with two points
  34533. * var points = scene.primitives.add(new Cesium.PointPrimitiveCollection());
  34534. * points.add({
  34535. * position : new Cesium.Cartesian3(1.0, 2.0, 3.0),
  34536. * color : Cesium.Color.YELLOW
  34537. * });
  34538. * points.add({
  34539. * position : new Cesium.Cartesian3(4.0, 5.0, 6.0),
  34540. * color : Cesium.Color.CYAN
  34541. * });
  34542. * @param [options] - Object with the following properties:
  34543. * @param [options.modelMatrix = Matrix4.IDENTITY] - The 4x4 transformation matrix that transforms each point from model to world coordinates.
  34544. * @param [options.debugShowBoundingVolume = false] - For debugging only. Determines if this primitive's commands' bounding spheres are shown.
  34545. * @param [options.blendOption = BlendOption.OPAQUE_AND_TRANSLUCENT] - The point blending option. The default
  34546. * is used for rendering both opaque and translucent points. However, if either all of the points are completely opaque or all are completely translucent,
  34547. * setting the technique to BlendOption.OPAQUE or BlendOption.TRANSLUCENT can improve performance by up to 2x.
  34548. */
  34549. export class PointPrimitiveCollection {
  34550. constructor(options?: {
  34551. modelMatrix?: Matrix4;
  34552. debugShowBoundingVolume?: boolean;
  34553. blendOption?: BlendOption;
  34554. });
  34555. /**
  34556. * The 4x4 transformation matrix that transforms each point in this collection from model to world coordinates.
  34557. * When this is the identity matrix, the pointPrimitives are drawn in world coordinates, i.e., Earth's WGS84 coordinates.
  34558. * Local reference frames can be used by providing a different transformation matrix, like that returned
  34559. * by {@link Transforms.eastNorthUpToFixedFrame}.
  34560. * @example
  34561. * var center = Cesium.Cartesian3.fromDegrees(-75.59777, 40.03883);
  34562. * pointPrimitives.modelMatrix = Cesium.Transforms.eastNorthUpToFixedFrame(center);
  34563. * pointPrimitives.add({
  34564. * color : Cesium.Color.ORANGE,
  34565. * position : new Cesium.Cartesian3(0.0, 0.0, 0.0) // center
  34566. * });
  34567. * pointPrimitives.add({
  34568. * color : Cesium.Color.YELLOW,
  34569. * position : new Cesium.Cartesian3(1000000.0, 0.0, 0.0) // east
  34570. * });
  34571. * pointPrimitives.add({
  34572. * color : Cesium.Color.GREEN,
  34573. * position : new Cesium.Cartesian3(0.0, 1000000.0, 0.0) // north
  34574. * });
  34575. * pointPrimitives.add({
  34576. * color : Cesium.Color.CYAN,
  34577. * position : new Cesium.Cartesian3(0.0, 0.0, 1000000.0) // up
  34578. * });
  34579. */
  34580. modelMatrix: Matrix4;
  34581. /**
  34582. * This property is for debugging only; it is not for production use nor is it optimized.
  34583. * <p>
  34584. * Draws the bounding sphere for each draw command in the primitive.
  34585. * </p>
  34586. */
  34587. debugShowBoundingVolume: boolean;
  34588. /**
  34589. * The point blending option. The default is used for rendering both opaque and translucent points.
  34590. * However, if either all of the points are completely opaque or all are completely translucent,
  34591. * setting the technique to BlendOption.OPAQUE or BlendOption.TRANSLUCENT can improve
  34592. * performance by up to 2x.
  34593. */
  34594. blendOption: BlendOption;
  34595. /**
  34596. * Returns the number of points in this collection. This is commonly used with
  34597. * {@link PointPrimitiveCollection#get} to iterate over all the points
  34598. * in the collection.
  34599. */
  34600. length: number;
  34601. /**
  34602. * Creates and adds a point with the specified initial properties to the collection.
  34603. * The added point is returned so it can be modified or removed from the collection later.
  34604. * @example
  34605. * // Example 1: Add a point, specifying all the default values.
  34606. * var p = pointPrimitives.add({
  34607. * show : true,
  34608. * position : Cesium.Cartesian3.ZERO,
  34609. * pixelSize : 10.0,
  34610. * color : Cesium.Color.WHITE,
  34611. * outlineColor : Cesium.Color.TRANSPARENT,
  34612. * outlineWidth : 0.0,
  34613. * id : undefined
  34614. * });
  34615. * @example
  34616. * // Example 2: Specify only the point's cartographic position.
  34617. * var p = pointPrimitives.add({
  34618. * position : Cesium.Cartesian3.fromDegrees(longitude, latitude, height)
  34619. * });
  34620. * @param [options] - A template describing the point's properties as shown in Example 1.
  34621. * @returns The point that was added to the collection.
  34622. */
  34623. add(options?: any): PointPrimitive;
  34624. /**
  34625. * Removes a point from the collection.
  34626. * @example
  34627. * var p = pointPrimitives.add(...);
  34628. * pointPrimitives.remove(p); // Returns true
  34629. * @param pointPrimitive - The point to remove.
  34630. * @returns <code>true</code> if the point was removed; <code>false</code> if the point was not found in the collection.
  34631. */
  34632. remove(pointPrimitive: PointPrimitive): boolean;
  34633. /**
  34634. * Removes all points from the collection.
  34635. * @example
  34636. * pointPrimitives.add(...);
  34637. * pointPrimitives.add(...);
  34638. * pointPrimitives.removeAll();
  34639. */
  34640. removeAll(): void;
  34641. /**
  34642. * Check whether this collection contains a given point.
  34643. * @param [pointPrimitive] - The point to check for.
  34644. * @returns true if this collection contains the point, false otherwise.
  34645. */
  34646. contains(pointPrimitive?: PointPrimitive): boolean;
  34647. /**
  34648. * Returns the point in the collection at the specified index. Indices are zero-based
  34649. * and increase as points are added. Removing a point shifts all points after
  34650. * it to the left, changing their indices. This function is commonly used with
  34651. * {@link PointPrimitiveCollection#length} to iterate over all the points
  34652. * in the collection.
  34653. * @example
  34654. * // Toggle the show property of every point in the collection
  34655. * var len = pointPrimitives.length;
  34656. * for (var i = 0; i < len; ++i) {
  34657. * var p = pointPrimitives.get(i);
  34658. * p.show = !p.show;
  34659. * }
  34660. * @param index - The zero-based index of the point.
  34661. * @returns The point at the specified index.
  34662. */
  34663. get(index: number): PointPrimitive;
  34664. /**
  34665. * Returns true if this object was destroyed; otherwise, false.
  34666. * <br /><br />
  34667. * If this object was destroyed, it should not be used; calling any function other than
  34668. * <code>isDestroyed</code> will result in a {@link DeveloperError} exception.
  34669. * @returns <code>true</code> if this object was destroyed; otherwise, <code>false</code>.
  34670. */
  34671. isDestroyed(): boolean;
  34672. /**
  34673. * Destroys the WebGL resources held by this object. Destroying an object allows for deterministic
  34674. * release of WebGL resources, instead of relying on the garbage collector to destroy this object.
  34675. * <br /><br />
  34676. * Once an object is destroyed, it should not be used; calling any function other than
  34677. * <code>isDestroyed</code> will result in a {@link DeveloperError} exception. Therefore,
  34678. * assign the return value (<code>undefined</code>) to the object as done in the example.
  34679. * @example
  34680. * pointPrimitives = pointPrimitives && pointPrimitives.destroy();
  34681. */
  34682. destroy(): void;
  34683. }
  34684. /**
  34685. * A renderable polyline. Create this by calling {@link PolylineCollection#add}
  34686. * @param options - Object with the following properties:
  34687. * @param [options.show = true] - <code>true</code> if this polyline will be shown; otherwise, <code>false</code>.
  34688. * @param [options.width = 1.0] - The width of the polyline in pixels.
  34689. * @param [options.loop = false] - Whether a line segment will be added between the last and first line positions to make this line a loop.
  34690. * @param [options.material = Material.ColorType] - The material.
  34691. * @param [options.positions] - The positions.
  34692. * @param [options.id] - The user-defined object to be returned when this polyline is picked.
  34693. * @param [options.distanceDisplayCondition] - The condition specifying at what distance from the camera that this polyline will be displayed.
  34694. * @param polylineCollection - The renderable polyline collection.
  34695. */
  34696. export class Polyline {
  34697. constructor(options: {
  34698. show?: boolean;
  34699. width?: number;
  34700. loop?: boolean;
  34701. material?: Material;
  34702. positions?: Cartesian3[];
  34703. id?: any;
  34704. distanceDisplayCondition?: DistanceDisplayCondition;
  34705. }, polylineCollection: PolylineCollection);
  34706. /**
  34707. * Determines if this polyline will be shown. Use this to hide or show a polyline, instead
  34708. * of removing it and re-adding it to the collection.
  34709. */
  34710. show: boolean;
  34711. /**
  34712. * Gets or sets the positions of the polyline.
  34713. * @example
  34714. * polyline.positions = Cesium.Cartesian3.fromDegreesArray([
  34715. * 0.0, 0.0,
  34716. * 10.0, 0.0,
  34717. * 0.0, 20.0
  34718. * ]);
  34719. */
  34720. positions: Cartesian3[];
  34721. /**
  34722. * 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
  34723. * {@link https://github.com/CesiumGS/cesium/wiki/Fabric|Fabric}.
  34724. */
  34725. material: Material;
  34726. /**
  34727. * Gets or sets the width of the polyline.
  34728. */
  34729. width: number;
  34730. /**
  34731. * Gets or sets whether a line segment will be added between the first and last polyline positions.
  34732. */
  34733. loop: boolean;
  34734. /**
  34735. * Gets or sets the user-defined value returned when the polyline is picked.
  34736. */
  34737. id: any;
  34738. /**
  34739. * Gets or sets the condition specifying at what distance from the camera that this polyline will be displayed.
  34740. */
  34741. distanceDisplayCondition: DistanceDisplayCondition;
  34742. }
  34743. /**
  34744. * A renderable collection of polylines.
  34745. * <br /><br />
  34746. * <div align="center">
  34747. * <img src="Images/Polyline.png" width="400" height="300" /><br />
  34748. * Example polylines
  34749. * </div>
  34750. * <br /><br />
  34751. * Polylines are added and removed from the collection using {@link PolylineCollection#add}
  34752. * and {@link PolylineCollection#remove}.
  34753. * @example
  34754. * // Create a polyline collection with two polylines
  34755. * var polylines = new Cesium.PolylineCollection();
  34756. * polylines.add({
  34757. * positions : Cesium.Cartesian3.fromDegreesArray([
  34758. * -75.10, 39.57,
  34759. * -77.02, 38.53,
  34760. * -80.50, 35.14,
  34761. * -80.12, 25.46]),
  34762. * width : 2
  34763. * });
  34764. *
  34765. * polylines.add({
  34766. * positions : Cesium.Cartesian3.fromDegreesArray([
  34767. * -73.10, 37.57,
  34768. * -75.02, 36.53,
  34769. * -78.50, 33.14,
  34770. * -78.12, 23.46]),
  34771. * width : 4
  34772. * });
  34773. * @param [options] - Object with the following properties:
  34774. * @param [options.modelMatrix = Matrix4.IDENTITY] - The 4x4 transformation matrix that transforms each polyline from model to world coordinates.
  34775. * @param [options.debugShowBoundingVolume = false] - For debugging only. Determines if this primitive's commands' bounding spheres are shown.
  34776. */
  34777. export class PolylineCollection {
  34778. constructor(options?: {
  34779. modelMatrix?: Matrix4;
  34780. debugShowBoundingVolume?: boolean;
  34781. });
  34782. /**
  34783. * The 4x4 transformation matrix that transforms each polyline in this collection from model to world coordinates.
  34784. * When this is the identity matrix, the polylines are drawn in world coordinates, i.e., Earth's WGS84 coordinates.
  34785. * Local reference frames can be used by providing a different transformation matrix, like that returned
  34786. * by {@link Transforms.eastNorthUpToFixedFrame}.
  34787. */
  34788. modelMatrix: Matrix4;
  34789. /**
  34790. * This property is for debugging only; it is not for production use nor is it optimized.
  34791. * <p>
  34792. * Draws the bounding sphere for each draw command in the primitive.
  34793. * </p>
  34794. */
  34795. debugShowBoundingVolume: boolean;
  34796. /**
  34797. * Returns the number of polylines in this collection. This is commonly used with
  34798. * {@link PolylineCollection#get} to iterate over all the polylines
  34799. * in the collection.
  34800. */
  34801. length: number;
  34802. /**
  34803. * Creates and adds a polyline with the specified initial properties to the collection.
  34804. * The added polyline is returned so it can be modified or removed from the collection later.
  34805. * @example
  34806. * // Example 1: Add a polyline, specifying all the default values.
  34807. * var p = polylines.add({
  34808. * show : true,
  34809. * positions : ellipsoid.cartographicArrayToCartesianArray([
  34810. * Cesium.Cartographic.fromDegrees(-75.10, 39.57),
  34811. * Cesium.Cartographic.fromDegrees(-77.02, 38.53)]),
  34812. * width : 1
  34813. * });
  34814. * @param [options] - A template describing the polyline's properties as shown in Example 1.
  34815. * @returns The polyline that was added to the collection.
  34816. */
  34817. add(options?: any): Polyline;
  34818. /**
  34819. * Removes a polyline from the collection.
  34820. * @example
  34821. * var p = polylines.add(...);
  34822. * polylines.remove(p); // Returns true
  34823. * @param polyline - The polyline to remove.
  34824. * @returns <code>true</code> if the polyline was removed; <code>false</code> if the polyline was not found in the collection.
  34825. */
  34826. remove(polyline: Polyline): boolean;
  34827. /**
  34828. * Removes all polylines from the collection.
  34829. * @example
  34830. * polylines.add(...);
  34831. * polylines.add(...);
  34832. * polylines.removeAll();
  34833. */
  34834. removeAll(): void;
  34835. /**
  34836. * Determines if this collection contains the specified polyline.
  34837. * @param polyline - The polyline to check for.
  34838. * @returns true if this collection contains the polyline, false otherwise.
  34839. */
  34840. contains(polyline: Polyline): boolean;
  34841. /**
  34842. * Returns the polyline in the collection at the specified index. Indices are zero-based
  34843. * and increase as polylines are added. Removing a polyline shifts all polylines after
  34844. * it to the left, changing their indices. This function is commonly used with
  34845. * {@link PolylineCollection#length} to iterate over all the polylines
  34846. * in the collection.
  34847. * @example
  34848. * // Toggle the show property of every polyline in the collection
  34849. * var len = polylines.length;
  34850. * for (var i = 0; i < len; ++i) {
  34851. * var p = polylines.get(i);
  34852. * p.show = !p.show;
  34853. * }
  34854. * @param index - The zero-based index of the polyline.
  34855. * @returns The polyline at the specified index.
  34856. */
  34857. get(index: number): Polyline;
  34858. /**
  34859. * Called when {@link Viewer} or {@link CesiumWidget} render the scene to
  34860. * get the draw commands needed to render this primitive.
  34861. * <p>
  34862. * Do not call this function directly. This is documented just to
  34863. * list the exceptions that may be propagated when the scene is rendered:
  34864. * </p>
  34865. */
  34866. update(): void;
  34867. /**
  34868. * Returns true if this object was destroyed; otherwise, false.
  34869. * <br /><br />
  34870. * If this object was destroyed, it should not be used; calling any function other than
  34871. * <code>isDestroyed</code> will result in a {@link DeveloperError} exception.
  34872. * @returns <code>true</code> if this object was destroyed; otherwise, <code>false</code>.
  34873. */
  34874. isDestroyed(): boolean;
  34875. /**
  34876. * Destroys the WebGL resources held by this object. Destroying an object allows for deterministic
  34877. * release of WebGL resources, instead of relying on the garbage collector to destroy this object.
  34878. * <br /><br />
  34879. * Once an object is destroyed, it should not be used; calling any function other than
  34880. * <code>isDestroyed</code> will result in a {@link DeveloperError} exception. Therefore,
  34881. * assign the return value (<code>undefined</code>) to the object as done in the example.
  34882. * @example
  34883. * polylines = polylines && polylines.destroy();
  34884. */
  34885. destroy(): void;
  34886. }
  34887. /**
  34888. * An appearance for {@link GeometryInstance} instances with color attributes and
  34889. * {@link PolylineGeometry} or {@link GroundPolylineGeometry}.
  34890. * This allows several geometry instances, each with a different color, to
  34891. * be drawn with the same {@link Primitive}.
  34892. * @example
  34893. * // A solid white line segment
  34894. * var primitive = new Cesium.Primitive({
  34895. * geometryInstances : new Cesium.GeometryInstance({
  34896. * geometry : new Cesium.PolylineGeometry({
  34897. * positions : Cesium.Cartesian3.fromDegreesArray([
  34898. * 0.0, 0.0,
  34899. * 5.0, 0.0
  34900. * ]),
  34901. * width : 10.0,
  34902. * vertexFormat : Cesium.PolylineColorAppearance.VERTEX_FORMAT
  34903. * }),
  34904. * attributes : {
  34905. * color : Cesium.ColorGeometryInstanceAttribute.fromColor(new Cesium.Color(1.0, 1.0, 1.0, 1.0))
  34906. * }
  34907. * }),
  34908. * appearance : new Cesium.PolylineColorAppearance({
  34909. * translucent : false
  34910. * })
  34911. * });
  34912. * @param [options] - Object with the following properties:
  34913. * @param [options.translucent = true] - When <code>true</code>, the geometry is expected to appear translucent so {@link PolylineColorAppearance#renderState} has alpha blending enabled.
  34914. * @param [options.vertexShaderSource] - Optional GLSL vertex shader source to override the default vertex shader.
  34915. * @param [options.fragmentShaderSource] - Optional GLSL fragment shader source to override the default fragment shader.
  34916. * @param [options.renderState] - Optional render state to override the default render state.
  34917. */
  34918. export class PolylineColorAppearance {
  34919. constructor(options?: {
  34920. translucent?: boolean;
  34921. vertexShaderSource?: string;
  34922. fragmentShaderSource?: string;
  34923. renderState?: any;
  34924. });
  34925. /**
  34926. * This property is part of the {@link Appearance} interface, but is not
  34927. * used by {@link PolylineColorAppearance} since a fully custom fragment shader is used.
  34928. */
  34929. material: Material;
  34930. /**
  34931. * When <code>true</code>, the geometry is expected to appear translucent so
  34932. * {@link PolylineColorAppearance#renderState} has alpha blending enabled.
  34933. */
  34934. translucent: boolean;
  34935. /**
  34936. * The GLSL source code for the vertex shader.
  34937. */
  34938. readonly vertexShaderSource: string;
  34939. /**
  34940. * The GLSL source code for the fragment shader.
  34941. */
  34942. readonly fragmentShaderSource: string;
  34943. /**
  34944. * The WebGL fixed-function state to use when rendering the geometry.
  34945. * <p>
  34946. * The render state can be explicitly defined when constructing a {@link PolylineColorAppearance}
  34947. * instance, or it is set implicitly via {@link PolylineColorAppearance#translucent}.
  34948. * </p>
  34949. */
  34950. readonly renderState: any;
  34951. /**
  34952. * When <code>true</code>, the geometry is expected to be closed so
  34953. * {@link PolylineColorAppearance#renderState} has backface culling enabled.
  34954. * This is always <code>false</code> for <code>PolylineColorAppearance</code>.
  34955. */
  34956. readonly closed: boolean;
  34957. /**
  34958. * The {@link VertexFormat} that this appearance instance is compatible with.
  34959. * A geometry can have more vertex attributes and still be compatible - at a
  34960. * potential performance cost - but it can't have less.
  34961. */
  34962. readonly vertexFormat: VertexFormat;
  34963. /**
  34964. * The {@link VertexFormat} that all {@link PolylineColorAppearance} instances
  34965. * are compatible with. This requires only a <code>position</code> attribute.
  34966. */
  34967. static readonly VERTEX_FORMAT: VertexFormat;
  34968. /**
  34969. * Procedurally creates the full GLSL fragment shader source.
  34970. * @returns The full GLSL fragment shader source.
  34971. */
  34972. getFragmentShaderSource(): string;
  34973. /**
  34974. * Determines if the geometry is translucent based on {@link PolylineColorAppearance#translucent}.
  34975. * @returns <code>true</code> if the appearance is translucent.
  34976. */
  34977. isTranslucent(): boolean;
  34978. /**
  34979. * Creates a render state. This is not the final render state instance; instead,
  34980. * it can contain a subset of render state properties identical to the render state
  34981. * created in the context.
  34982. * @returns The render state.
  34983. */
  34984. getRenderState(): any;
  34985. }
  34986. /**
  34987. * An appearance for {@link PolylineGeometry} that supports shading with materials.
  34988. * @example
  34989. * var primitive = new Cesium.Primitive({
  34990. * geometryInstances : new Cesium.GeometryInstance({
  34991. * geometry : new Cesium.PolylineGeometry({
  34992. * positions : Cesium.Cartesian3.fromDegreesArray([
  34993. * 0.0, 0.0,
  34994. * 5.0, 0.0
  34995. * ]),
  34996. * width : 10.0,
  34997. * vertexFormat : Cesium.PolylineMaterialAppearance.VERTEX_FORMAT
  34998. * })
  34999. * }),
  35000. * appearance : new Cesium.PolylineMaterialAppearance({
  35001. * material : Cesium.Material.fromType('Color')
  35002. * })
  35003. * });
  35004. * @param [options] - Object with the following properties:
  35005. * @param [options.translucent = true] - When <code>true</code>, the geometry is expected to appear translucent so {@link PolylineMaterialAppearance#renderState} has alpha blending enabled.
  35006. * @param [options.material = Material.ColorType] - The material used to determine the fragment color.
  35007. * @param [options.vertexShaderSource] - Optional GLSL vertex shader source to override the default vertex shader.
  35008. * @param [options.fragmentShaderSource] - Optional GLSL fragment shader source to override the default fragment shader.
  35009. * @param [options.renderState] - Optional render state to override the default render state.
  35010. */
  35011. export class PolylineMaterialAppearance {
  35012. constructor(options?: {
  35013. translucent?: boolean;
  35014. material?: Material;
  35015. vertexShaderSource?: string;
  35016. fragmentShaderSource?: string;
  35017. renderState?: any;
  35018. });
  35019. /**
  35020. * The material used to determine the fragment color. Unlike other {@link PolylineMaterialAppearance}
  35021. * properties, this is not read-only, so an appearance's material can change on the fly.
  35022. */
  35023. material: Material;
  35024. /**
  35025. * When <code>true</code>, the geometry is expected to appear translucent so
  35026. * {@link PolylineMaterialAppearance#renderState} has alpha blending enabled.
  35027. */
  35028. translucent: boolean;
  35029. /**
  35030. * The GLSL source code for the vertex shader.
  35031. */
  35032. readonly vertexShaderSource: string;
  35033. /**
  35034. * The GLSL source code for the fragment shader.
  35035. */
  35036. readonly fragmentShaderSource: string;
  35037. /**
  35038. * The WebGL fixed-function state to use when rendering the geometry.
  35039. * <p>
  35040. * The render state can be explicitly defined when constructing a {@link PolylineMaterialAppearance}
  35041. * instance, or it is set implicitly via {@link PolylineMaterialAppearance#translucent}
  35042. * and {@link PolylineMaterialAppearance#closed}.
  35043. * </p>
  35044. */
  35045. readonly renderState: any;
  35046. /**
  35047. * When <code>true</code>, the geometry is expected to be closed so
  35048. * {@link PolylineMaterialAppearance#renderState} has backface culling enabled.
  35049. * This is always <code>false</code> for <code>PolylineMaterialAppearance</code>.
  35050. */
  35051. readonly closed: boolean;
  35052. /**
  35053. * The {@link VertexFormat} that this appearance instance is compatible with.
  35054. * A geometry can have more vertex attributes and still be compatible - at a
  35055. * potential performance cost - but it can't have less.
  35056. */
  35057. readonly vertexFormat: VertexFormat;
  35058. /**
  35059. * The {@link VertexFormat} that all {@link PolylineMaterialAppearance} instances
  35060. * are compatible with. This requires <code>position</code> and <code>st</code> attributes.
  35061. */
  35062. static readonly VERTEX_FORMAT: VertexFormat;
  35063. /**
  35064. * Procedurally creates the full GLSL fragment shader source. For {@link PolylineMaterialAppearance},
  35065. * this is derived from {@link PolylineMaterialAppearance#fragmentShaderSource} and {@link PolylineMaterialAppearance#material}.
  35066. * @returns The full GLSL fragment shader source.
  35067. */
  35068. getFragmentShaderSource(): string;
  35069. /**
  35070. * Determines if the geometry is translucent based on {@link PolylineMaterialAppearance#translucent} and {@link Material#isTranslucent}.
  35071. * @returns <code>true</code> if the appearance is translucent.
  35072. */
  35073. isTranslucent(): boolean;
  35074. /**
  35075. * Creates a render state. This is not the final render state instance; instead,
  35076. * it can contain a subset of render state properties identical to the render state
  35077. * created in the context.
  35078. * @returns The render state.
  35079. */
  35080. getRenderState(): any;
  35081. }
  35082. /**
  35083. * Runs a post-process stage on either the texture rendered by the scene or the output of a previous post-process stage.
  35084. * @example
  35085. * // Simple stage to change the color
  35086. * var fs =
  35087. * 'uniform sampler2D colorTexture;\n' +
  35088. * 'varying vec2 v_textureCoordinates;\n' +
  35089. * 'uniform float scale;\n' +
  35090. * 'uniform vec3 offset;\n' +
  35091. * 'void main() {\n' +
  35092. * ' vec4 color = texture2D(colorTexture, v_textureCoordinates);\n' +
  35093. * ' gl_FragColor = vec4(color.rgb * scale + offset, 1.0);\n' +
  35094. * '}\n';
  35095. * scene.postProcessStages.add(new Cesium.PostProcessStage({
  35096. * fragmentShader : fs,
  35097. * uniforms : {
  35098. * scale : 1.1,
  35099. * offset : function() {
  35100. * return new Cesium.Cartesian3(0.1, 0.2, 0.3);
  35101. * }
  35102. * }
  35103. * }));
  35104. * @example
  35105. * // Simple stage to change the color of what is selected.
  35106. * // If czm_selected returns true, the current fragment belongs to geometry in the selected array.
  35107. * var fs =
  35108. * 'uniform sampler2D colorTexture;\n' +
  35109. * 'varying vec2 v_textureCoordinates;\n' +
  35110. * 'uniform vec4 highlight;\n' +
  35111. * 'void main() {\n' +
  35112. * ' vec4 color = texture2D(colorTexture, v_textureCoordinates);\n' +
  35113. * ' if (czm_selected()) {\n' +
  35114. * ' vec3 highlighted = highlight.a * highlight.rgb + (1.0 - highlight.a) * color.rgb;\n' +
  35115. * ' gl_FragColor = vec4(highlighted, 1.0);\n' +
  35116. * ' } else { \n' +
  35117. * ' gl_FragColor = color;\n' +
  35118. * ' }\n' +
  35119. * '}\n';
  35120. * var stage = scene.postProcessStages.add(new Cesium.PostProcessStage({
  35121. * fragmentShader : fs,
  35122. * uniforms : {
  35123. * highlight : function() {
  35124. * return new Cesium.Color(1.0, 0.0, 0.0, 0.5);
  35125. * }
  35126. * }
  35127. * }));
  35128. * stage.selected = [cesium3DTileFeature];
  35129. * @param options - An object with the following properties:
  35130. * @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.
  35131. * @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.
  35132. * @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.
  35133. * @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.
  35134. * @param [options.sampleMode = PostProcessStageSampleMode.NEAREST] - How to sample the input color texture.
  35135. * @param [options.pixelFormat = PixelFormat.RGBA] - The color pixel format of the output texture.
  35136. * @param [options.pixelDatatype = PixelDatatype.UNSIGNED_BYTE] - The pixel data type of the output texture.
  35137. * @param [options.clearColor = Color.BLACK] - The color to clear the output texture to.
  35138. * @param [options.scissorRectangle] - The rectangle to use for the scissor test.
  35139. * @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.
  35140. */
  35141. export class PostProcessStage {
  35142. constructor(options: {
  35143. fragmentShader: string;
  35144. uniforms?: any;
  35145. textureScale?: number;
  35146. forcePowerOfTwo?: boolean;
  35147. sampleMode?: PostProcessStageSampleMode;
  35148. pixelFormat?: PixelFormat;
  35149. pixelDatatype?: PixelDatatype;
  35150. clearColor?: Color;
  35151. scissorRectangle?: BoundingRectangle;
  35152. name?: string;
  35153. });
  35154. /**
  35155. * Whether or not to execute this post-process stage when ready.
  35156. */
  35157. enabled: boolean;
  35158. /**
  35159. * Determines if this post-process stage is ready to be executed. A stage is only executed when both <code>ready</code>
  35160. * and {@link PostProcessStage#enabled} are <code>true</code>. A stage will not be ready while it is waiting on textures
  35161. * to load.
  35162. */
  35163. readonly ready: boolean;
  35164. /**
  35165. * The unique name of this post-process stage for reference by other stages in a {@link PostProcessStageComposite}.
  35166. */
  35167. readonly name: string;
  35168. /**
  35169. * The fragment shader to use when execute this post-process stage.
  35170. * <p>
  35171. * The shader must contain a sampler uniform declaration for <code>colorTexture</code>, <code>depthTexture</code>,
  35172. * or both.
  35173. * </p>
  35174. * <p>
  35175. * The shader must contain a <code>vec2</code> varying declaration for <code>v_textureCoordinates</code> for sampling
  35176. * the texture uniforms.
  35177. * </p>
  35178. */
  35179. readonly fragmentShader: string;
  35180. /**
  35181. * An object whose properties are used to set the uniforms of the fragment shader.
  35182. * <p>
  35183. * The object property values can be either a constant or a function. The function will be called
  35184. * each frame before the post-process stage is executed.
  35185. * </p>
  35186. * <p>
  35187. * 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.
  35188. * </p>
  35189. * <p>
  35190. * If this post-process stage is part of a {@link PostProcessStageComposite} that does not execute in series, the constant value can also be
  35191. * the name of another stage in a composite. This will set the uniform to the output texture the stage with that name.
  35192. * </p>
  35193. */
  35194. readonly uniforms: any;
  35195. /**
  35196. * 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.
  35197. */
  35198. readonly textureScale: number;
  35199. /**
  35200. * 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.
  35201. */
  35202. readonly forcePowerOfTwo: number;
  35203. /**
  35204. * How to sample the input color texture.
  35205. */
  35206. readonly sampleMode: PostProcessStageSampleMode;
  35207. /**
  35208. * The color pixel format of the output texture.
  35209. */
  35210. readonly pixelFormat: PixelFormat;
  35211. /**
  35212. * The pixel data type of the output texture.
  35213. */
  35214. readonly pixelDatatype: PixelDatatype;
  35215. /**
  35216. * The color to clear the output texture to.
  35217. */
  35218. readonly clearColor: Color;
  35219. /**
  35220. * The {@link BoundingRectangle} to use for the scissor test. A default bounding rectangle will disable the scissor test.
  35221. */
  35222. readonly scissorRectangle: BoundingRectangle;
  35223. /**
  35224. * The features selected for applying the post-process.
  35225. * <p>
  35226. * In the fragment shader, use <code>czm_selected</code> to determine whether or not to apply the post-process
  35227. * stage to that fragment. For example:
  35228. * <code>
  35229. * if (czm_selected(v_textureCoordinates)) {
  35230. * // apply post-process stage
  35231. * } else {
  35232. * gl_FragColor = texture2D(colorTexture, v_textureCordinates);
  35233. * }
  35234. * </code>
  35235. * </p>
  35236. */
  35237. selected: any[];
  35238. /**
  35239. * Returns true if this object was destroyed; otherwise, false.
  35240. * <p>
  35241. * If this object was destroyed, it should not be used; calling any function other than
  35242. * <code>isDestroyed</code> will result in a {@link DeveloperError} exception.
  35243. * </p>
  35244. * @returns <code>true</code> if this object was destroyed; otherwise, <code>false</code>.
  35245. */
  35246. isDestroyed(): boolean;
  35247. /**
  35248. * Destroys the WebGL resources held by this object. Destroying an object allows for deterministic
  35249. * release of WebGL resources, instead of relying on the garbage collector to destroy this object.
  35250. * <p>
  35251. * Once an object is destroyed, it should not be used; calling any function other than
  35252. * <code>isDestroyed</code> will result in a {@link DeveloperError} exception. Therefore,
  35253. * assign the return value (<code>undefined</code>) to the object as done in the example.
  35254. * </p>
  35255. */
  35256. destroy(): void;
  35257. }
  35258. /**
  35259. * A collection of {@link PostProcessStage}s and/or {@link PostProcessStageComposite}s.
  35260. * <p>
  35261. * The input texture for each post-process stage is the texture rendered to by the scene or the texture rendered
  35262. * to by the previous stage in the collection.
  35263. * </p>
  35264. * <p>
  35265. * If the ambient occlusion or bloom stages are enabled, they will execute before all other stages.
  35266. * </p>
  35267. * <p>
  35268. * If the FXAA stage is enabled, it will execute after all other stages.
  35269. * </p>
  35270. */
  35271. export class PostProcessStageCollection {
  35272. constructor();
  35273. /**
  35274. * Determines if all of the post-process stages in the collection are ready to be executed.
  35275. */
  35276. readonly ready: boolean;
  35277. /**
  35278. * A post-process stage for Fast Approximate Anti-aliasing.
  35279. * <p>
  35280. * When enabled, this stage will execute after all others.
  35281. * </p>
  35282. */
  35283. readonly fxaa: PostProcessStage;
  35284. /**
  35285. * A post-process stage that applies Horizon-based Ambient Occlusion (HBAO) to the input texture.
  35286. * <p>
  35287. * Ambient occlusion simulates shadows from ambient light. These shadows would always be present when the
  35288. * surface receives light and regardless of the light's position.
  35289. * </p>
  35290. * <p>
  35291. * The uniforms have the following properties: <code>intensity</code>, <code>bias</code>, <code>lengthCap</code>,
  35292. * <code>stepSize</code>, <code>frustumLength</code>, <code>ambientOcclusionOnly</code>,
  35293. * <code>delta</code>, <code>sigma</code>, and <code>blurStepSize</code>.
  35294. * </p>
  35295. * <ul>
  35296. * <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>
  35297. *
  35298. * <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,
  35299. * 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>
  35300. *
  35301. * <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,
  35302. * sampling stops in the current direction. The default value is <code>0.26</code>.</li>
  35303. *
  35304. * <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>
  35305. *
  35306. * <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.
  35307. * The default value is <code>1000.0</code>.</li>
  35308. *
  35309. * <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
  35310. * 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>
  35311. * </ul>
  35312. * <p>
  35313. * <code>delta</code>, <code>sigma</code>, and <code>blurStepSize</code> are the same properties as {@link PostProcessStageLibrary#createBlurStage}.
  35314. * The blur is applied to the shadows generated from the image to make them smoother.
  35315. * </p>
  35316. * <p>
  35317. * When enabled, this stage will execute before all others.
  35318. * </p>
  35319. */
  35320. readonly ambientOcclusion: PostProcessStageComposite;
  35321. /**
  35322. * A post-process stage for a bloom effect.
  35323. * <p>
  35324. * A bloom effect adds glow effect, makes bright areas brighter, and dark areas darker.
  35325. * </p>
  35326. * <p>
  35327. * This stage has the following uniforms: <code>contrast</code>, <code>brightness</code>, <code>glowOnly</code>,
  35328. * <code>delta</code>, <code>sigma</code>, and <code>stepSize</code>.
  35329. * </p>
  35330. * <ul>
  35331. * <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>
  35332. *
  35333. * <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
  35334. * added to the brightness. The default value is <code>-0.3</code>.</li>
  35335. *
  35336. * <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.
  35337. * The default value is <code>false</code>. This is a debug option for viewing the effects when changing the other uniform values.</li>
  35338. * </ul>
  35339. * <p>
  35340. * <code>delta</code>, <code>sigma</code>, and <code>stepSize</code> are the same properties as {@link PostProcessStageLibrary#createBlurStage}.
  35341. * The blur is applied to the shadows generated from the image to make them smoother.
  35342. * </p>
  35343. * <p>
  35344. * When enabled, this stage will execute before all others.
  35345. * </p>
  35346. */
  35347. readonly bloom: PostProcessStageComposite;
  35348. /**
  35349. * The number of post-process stages in this collection.
  35350. */
  35351. readonly length: number;
  35352. /**
  35353. * Adds the post-process stage to the collection.
  35354. * @param stage - The post-process stage to add to the collection.
  35355. * @returns The post-process stage that was added to the collection.
  35356. */
  35357. add(stage: PostProcessStage | PostProcessStageComposite): PostProcessStage | PostProcessStageComposite;
  35358. /**
  35359. * Removes a post-process stage from the collection and destroys it.
  35360. * @param stage - The post-process stage to remove from the collection.
  35361. * @returns Whether the post-process stage was removed.
  35362. */
  35363. remove(stage: PostProcessStage | PostProcessStageComposite): boolean;
  35364. /**
  35365. * Returns whether the collection contains a post-process stage.
  35366. * @param stage - The post-process stage.
  35367. * @returns Whether the collection contains the post-process stage.
  35368. */
  35369. contains(stage: PostProcessStage | PostProcessStageComposite): boolean;
  35370. /**
  35371. * Gets the post-process stage at <code>index</code>.
  35372. * @param index - The index of the post-process stage.
  35373. * @returns The post-process stage at index.
  35374. */
  35375. get(index: number): PostProcessStage | PostProcessStageComposite;
  35376. /**
  35377. * Removes all post-process stages from the collection and destroys them.
  35378. */
  35379. removeAll(): void;
  35380. /**
  35381. * Returns true if this object was destroyed; otherwise, false.
  35382. * <p>
  35383. * If this object was destroyed, it should not be used; calling any function other than
  35384. * <code>isDestroyed</code> will result in a {@link DeveloperError} exception.
  35385. * </p>
  35386. * @returns <code>true</code> if this object was destroyed; otherwise, <code>false</code>.
  35387. */
  35388. isDestroyed(): boolean;
  35389. /**
  35390. * Destroys the WebGL resources held by this object. Destroying an object allows for deterministic
  35391. * release of WebGL resources, instead of relying on the garbage collector to destroy this object.
  35392. * <p>
  35393. * Once an object is destroyed, it should not be used; calling any function other than
  35394. * <code>isDestroyed</code> will result in a {@link DeveloperError} exception. Therefore,
  35395. * assign the return value (<code>undefined</code>) to the object as done in the example.
  35396. * </p>
  35397. */
  35398. destroy(): void;
  35399. }
  35400. /**
  35401. * A collection of {@link PostProcessStage}s or other post-process composite stages that execute together logically.
  35402. * <p>
  35403. * All stages are executed in the order of the array. The input texture changes based on the value of <code>inputPreviousStageTexture</code>.
  35404. * 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.
  35405. * 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
  35406. * or the output texture of the previous stage.
  35407. * </p>
  35408. * @example
  35409. * // Example 1: separable blur filter
  35410. * // The input to blurXDirection is the texture rendered to by the scene or the output of the previous stage.
  35411. * // The input to blurYDirection is the texture rendered to by blurXDirection.
  35412. * scene.postProcessStages.add(new Cesium.PostProcessStageComposite({
  35413. * stages : [blurXDirection, blurYDirection]
  35414. * }));
  35415. * @example
  35416. * // Example 2: referencing the output of another post-process stage
  35417. * scene.postProcessStages.add(new Cesium.PostProcessStageComposite({
  35418. * inputPreviousStageTexture : false,
  35419. * stages : [
  35420. * // The same as Example 1.
  35421. * new Cesium.PostProcessStageComposite({
  35422. * inputPreviousStageTexture : true
  35423. * stages : [blurXDirection, blurYDirection],
  35424. * name : 'blur'
  35425. * }),
  35426. * // The input texture for this stage is the same input texture to blurXDirection since inputPreviousStageTexture is false
  35427. * new Cesium.PostProcessStage({
  35428. * fragmentShader : compositeShader,
  35429. * uniforms : {
  35430. * blurTexture : 'blur' // The output of the composite with name 'blur' (the texture that blurYDirection rendered to).
  35431. * }
  35432. * })
  35433. * ]
  35434. * });
  35435. * @example
  35436. * // Example 3: create a uniform alias
  35437. * var uniforms = {};
  35438. * Cesium.defineProperties(uniforms, {
  35439. * filterSize : {
  35440. * get : function() {
  35441. * return blurXDirection.uniforms.filterSize;
  35442. * },
  35443. * set : function(value) {
  35444. * blurXDirection.uniforms.filterSize = blurYDirection.uniforms.filterSize = value;
  35445. * }
  35446. * }
  35447. * });
  35448. * scene.postProcessStages.add(new Cesium.PostProcessStageComposite({
  35449. * stages : [blurXDirection, blurYDirection],
  35450. * uniforms : uniforms
  35451. * }));
  35452. * @param options - An object with the following properties:
  35453. * @param options.stages - An array of {@link PostProcessStage}s or composites to be executed in order.
  35454. * @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.
  35455. * @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.
  35456. * @param [options.uniforms] - An alias to the uniforms of post-process stages.
  35457. */
  35458. export class PostProcessStageComposite {
  35459. constructor(options: {
  35460. stages: any[];
  35461. inputPreviousStageTexture?: boolean;
  35462. name?: string;
  35463. uniforms?: any;
  35464. });
  35465. /**
  35466. * Determines if this post-process stage is ready to be executed.
  35467. */
  35468. readonly ready: boolean;
  35469. /**
  35470. * The unique name of this post-process stage for reference by other stages in a PostProcessStageComposite.
  35471. */
  35472. readonly name: string;
  35473. /**
  35474. * Whether or not to execute this post-process stage when ready.
  35475. */
  35476. enabled: boolean;
  35477. /**
  35478. * 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.
  35479. */
  35480. uniforms: any;
  35481. /**
  35482. * All post-process stages are executed in the order of the array. The input texture changes based on the value of <code>inputPreviousStageTexture</code>.
  35483. * 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.
  35484. * 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
  35485. * or the output texture of the previous stage.
  35486. */
  35487. readonly inputPreviousStageTexture: boolean;
  35488. /**
  35489. * The number of post-process stages in this composite.
  35490. */
  35491. readonly length: number;
  35492. /**
  35493. * The features selected for applying the post-process.
  35494. */
  35495. selected: any[];
  35496. /**
  35497. * Gets the post-process stage at <code>index</code>
  35498. * @param index - The index of the post-process stage or composite.
  35499. * @returns The post-process stage or composite at index.
  35500. */
  35501. get(index: number): PostProcessStage | PostProcessStageComposite;
  35502. /**
  35503. * Returns true if this object was destroyed; otherwise, false.
  35504. * <p>
  35505. * If this object was destroyed, it should not be used; calling any function other than
  35506. * <code>isDestroyed</code> will result in a {@link DeveloperError} exception.
  35507. * </p>
  35508. * @returns <code>true</code> if this object was destroyed; otherwise, <code>false</code>.
  35509. */
  35510. isDestroyed(): boolean;
  35511. /**
  35512. * Destroys the WebGL resources held by this object. Destroying an object allows for deterministic
  35513. * release of WebGL resources, instead of relying on the garbage collector to destroy this object.
  35514. * <p>
  35515. * Once an object is destroyed, it should not be used; calling any function other than
  35516. * <code>isDestroyed</code> will result in a {@link DeveloperError} exception. Therefore,
  35517. * assign the return value (<code>undefined</code>) to the object as done in the example.
  35518. * </p>
  35519. */
  35520. destroy(): void;
  35521. }
  35522. /**
  35523. * Contains functions for creating common post-process stages.
  35524. */
  35525. export namespace PostProcessStageLibrary {
  35526. /**
  35527. * Creates a post-process stage that applies a Gaussian blur to the input texture. This stage is usually applied in conjunction with another stage.
  35528. * <p>
  35529. * This stage has the following uniforms: <code>delta</code>, <code>sigma</code>, and <code>stepSize</code>.
  35530. * </p>
  35531. * <p>
  35532. * <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>.
  35533. * The default value for <code>delta</code> is <code>1.0</code>. The default value for <code>sigma</code> is <code>2.0</code>.
  35534. * <code>stepSize</code> is the distance to the next texel. The default is <code>1.0</code>.
  35535. * </p>
  35536. * @returns A post-process stage that applies a Gaussian blur to the input texture.
  35537. */
  35538. function createBlurStage(): PostProcessStageComposite;
  35539. /**
  35540. * Creates a post-process stage that applies a depth of field effect.
  35541. * <p>
  35542. * Depth of field simulates camera focus. Objects in the scene that are in focus
  35543. * will be clear whereas objects not in focus will be blurred.
  35544. * </p>
  35545. * <p>
  35546. * This stage has the following uniforms: <code>focalDistance</code>, <code>delta</code>, <code>sigma</code>, and <code>stepSize</code>.
  35547. * </p>
  35548. * <p>
  35549. * <code>focalDistance</code> is the distance in meters from the camera to set the camera focus.
  35550. * </p>
  35551. * <p>
  35552. * <code>delta</code>, <code>sigma</code>, and <code>stepSize</code> are the same properties as {@link PostProcessStageLibrary#createBlurStage}.
  35553. * The blur is applied to the areas out of focus.
  35554. * </p>
  35555. * @returns A post-process stage that applies a depth of field effect.
  35556. */
  35557. function createDepthOfFieldStage(): PostProcessStageComposite;
  35558. /**
  35559. * Whether or not a depth of field stage is supported.
  35560. * <p>
  35561. * This stage requires the WEBGL_depth_texture extension.
  35562. * </p>
  35563. * @param scene - The scene.
  35564. * @returns Whether this post process stage is supported.
  35565. */
  35566. function isDepthOfFieldSupported(scene: Scene): boolean;
  35567. /**
  35568. * Creates a post-process stage that detects edges.
  35569. * <p>
  35570. * Writes the color to the output texture with alpha set to 1.0 when it is on an edge.
  35571. * </p>
  35572. * <p>
  35573. * This stage has the following uniforms: <code>color</code> and <code>length</code>
  35574. * </p>
  35575. * <ul>
  35576. * <li><code>color</code> is the color of the highlighted edge. The default is {@link Color#BLACK}.</li>
  35577. * <li><code>length</code> is the length of the edges in pixels. The default is <code>0.5</code>.</li>
  35578. * </ul>
  35579. * <p>
  35580. * This stage is not supported in 2D.
  35581. * </p>
  35582. * @example
  35583. * // multiple silhouette effects
  35584. * var yellowEdge = Cesium.PostProcessLibrary.createEdgeDetectionStage();
  35585. * yellowEdge.uniforms.color = Cesium.Color.YELLOW;
  35586. * yellowEdge.selected = [feature0];
  35587. *
  35588. * var greenEdge = Cesium.PostProcessLibrary.createEdgeDetectionStage();
  35589. * greenEdge.uniforms.color = Cesium.Color.LIME;
  35590. * greenEdge.selected = [feature1];
  35591. *
  35592. * // draw edges around feature0 and feature1
  35593. * postProcessStages.add(Cesium.PostProcessLibrary.createSilhouetteStage([yellowEdge, greenEdge]);
  35594. * @returns A post-process stage that applies an edge detection effect.
  35595. */
  35596. function createEdgeDetectionStage(): PostProcessStageComposite;
  35597. /**
  35598. * Whether or not an edge detection stage is supported.
  35599. * <p>
  35600. * This stage requires the WEBGL_depth_texture extension.
  35601. * </p>
  35602. * @param scene - The scene.
  35603. * @returns Whether this post process stage is supported.
  35604. */
  35605. function isEdgeDetectionSupported(scene: Scene): boolean;
  35606. /**
  35607. * Creates a post-process stage that applies a silhouette effect.
  35608. * <p>
  35609. * A silhouette effect composites the color from the edge detection pass with input color texture.
  35610. * </p>
  35611. * <p>
  35612. * This stage has the following uniforms when <code>edgeDetectionStages</code> is <code>undefined</code>: <code>color</code> and <code>length</code>
  35613. * </p>
  35614. * <p>
  35615. * <code>color</code> is the color of the highlighted edge. The default is {@link Color#BLACK}.
  35616. * <code>length</code> is the length of the edges in pixels. The default is <code>0.5</code>.
  35617. * </p>
  35618. * @param [edgeDetectionStages] - An array of edge detection post process stages.
  35619. * @returns A post-process stage that applies a silhouette effect.
  35620. */
  35621. function createSilhouetteStage(edgeDetectionStages?: PostProcessStage[]): PostProcessStageComposite;
  35622. /**
  35623. * Whether or not a silhouette stage is supported.
  35624. * <p>
  35625. * This stage requires the WEBGL_depth_texture extension.
  35626. * </p>
  35627. * @param scene - The scene.
  35628. * @returns Whether this post process stage is supported.
  35629. */
  35630. function isSilhouetteSupported(scene: Scene): boolean;
  35631. /**
  35632. * Whether or not an ambient occlusion stage is supported.
  35633. * <p>
  35634. * This stage requires the WEBGL_depth_texture extension.
  35635. * </p>
  35636. * @param scene - The scene.
  35637. * @returns Whether this post process stage is supported.
  35638. */
  35639. function isAmbientOcclusionSupported(scene: Scene): boolean;
  35640. /**
  35641. * Creates a post-process stage that renders the input texture with black and white gradations.
  35642. * <p>
  35643. * This stage has one uniform value, <code>gradations</code>, which scales the luminance of each pixel.
  35644. * </p>
  35645. * @returns A post-process stage that renders the input texture with black and white gradations.
  35646. */
  35647. function createBlackAndWhiteStage(): PostProcessStage;
  35648. /**
  35649. * Creates a post-process stage that saturates the input texture.
  35650. * <p>
  35651. * This stage has one uniform value, <code>brightness</code>, which scales the saturation of each pixel.
  35652. * </p>
  35653. * @returns A post-process stage that saturates the input texture.
  35654. */
  35655. function createBrightnessStage(): PostProcessStage;
  35656. /**
  35657. * Creates a post-process stage that adds a night vision effect to the input texture.
  35658. * @returns A post-process stage that adds a night vision effect to the input texture.
  35659. */
  35660. function createNightVisionStage(): PostProcessStage;
  35661. /**
  35662. * Creates a post-process stage that applies an effect simulating light flaring a camera lens.
  35663. * <p>
  35664. * This stage has the following uniforms: <code>dirtTexture</code>, <code>starTexture</code>, <code>intensity</code>, <code>distortion</code>, <code>ghostDispersal</code>,
  35665. * <code>haloWidth</code>, <code>dirtAmount</code>, and <code>earthRadius</code>.
  35666. * <ul>
  35667. * <li><code>dirtTexture</code> is a texture sampled to simulate dirt on the lens.</li>
  35668. * <li><code>starTexture</code> is the texture sampled for the star pattern of the flare.</li>
  35669. * <li><code>intensity</code> is a scalar multiplied by the result of the lens flare. The default value is <code>2.0</code>.</li>
  35670. * <li><code>distortion</code> is a scalar value that affects the chromatic effect distortion. The default value is <code>10.0</code>.</li>
  35671. * <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>
  35672. * <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>
  35673. * <li><code>dirtAmount</code> is a scalar representing the amount of dirt on the lens. The default value is <code>0.4</code>.</li>
  35674. * <li><code>earthRadius</code> is the maximum radius of the earth. The default value is <code>Ellipsoid.WGS84.maximumRadius</code>.</li>
  35675. * </ul>
  35676. * </p>
  35677. * @returns A post-process stage for applying a lens flare effect.
  35678. */
  35679. function createLensFlareStage(): PostProcessStage;
  35680. }
  35681. /**
  35682. * Determines how input texture to a {@link PostProcessStage} is sampled.
  35683. */
  35684. export enum PostProcessStageSampleMode {
  35685. /**
  35686. * Samples the texture by returning the closest texel.
  35687. */
  35688. NEAREST = 0,
  35689. /**
  35690. * Samples the texture through bi-linear interpolation of the four nearest texels.
  35691. */
  35692. LINEAR = 1
  35693. }
  35694. /**
  35695. * A primitive represents geometry in the {@link Scene}. The geometry can be from a single {@link GeometryInstance}
  35696. * as shown in example 1 below, or from an array of instances, even if the geometry is from different
  35697. * geometry types, e.g., an {@link RectangleGeometry} and an {@link EllipsoidGeometry} as shown in Code Example 2.
  35698. * <p>
  35699. * A primitive combines geometry instances with an {@link Appearance} that describes the full shading, including
  35700. * {@link Material} and {@link RenderState}. Roughly, the geometry instance defines the structure and placement,
  35701. * and the appearance defines the visual characteristics. Decoupling geometry and appearance allows us to mix
  35702. * and match most of them and add a new geometry or appearance independently of each other.
  35703. * </p>
  35704. * <p>
  35705. * Combining multiple instances into one primitive is called batching, and significantly improves performance for static data.
  35706. * Instances can be individually picked; {@link Scene#pick} returns their {@link GeometryInstance#id}. Using
  35707. * per-instance appearances like {@link PerInstanceColorAppearance}, each instance can also have a unique color.
  35708. * </p>
  35709. * <p>
  35710. * {@link Geometry} can either be created and batched on a web worker or the main thread. The first two examples
  35711. * show geometry that will be created on a web worker by using the descriptions of the geometry. The third example
  35712. * shows how to create the geometry on the main thread by explicitly calling the <code>createGeometry</code> method.
  35713. * </p>
  35714. * @example
  35715. * // 1. Draw a translucent ellipse on the surface with a checkerboard pattern
  35716. * var instance = new Cesium.GeometryInstance({
  35717. * geometry : new Cesium.EllipseGeometry({
  35718. * center : Cesium.Cartesian3.fromDegrees(-100.0, 20.0),
  35719. * semiMinorAxis : 500000.0,
  35720. * semiMajorAxis : 1000000.0,
  35721. * rotation : Cesium.Math.PI_OVER_FOUR,
  35722. * vertexFormat : Cesium.VertexFormat.POSITION_AND_ST
  35723. * }),
  35724. * id : 'object returned when this instance is picked and to get/set per-instance attributes'
  35725. * });
  35726. * scene.primitives.add(new Cesium.Primitive({
  35727. * geometryInstances : instance,
  35728. * appearance : new Cesium.EllipsoidSurfaceAppearance({
  35729. * material : Cesium.Material.fromType('Checkerboard')
  35730. * })
  35731. * }));
  35732. * @example
  35733. * // 2. Draw different instances each with a unique color
  35734. * var rectangleInstance = new Cesium.GeometryInstance({
  35735. * geometry : new Cesium.RectangleGeometry({
  35736. * rectangle : Cesium.Rectangle.fromDegrees(-140.0, 30.0, -100.0, 40.0),
  35737. * vertexFormat : Cesium.PerInstanceColorAppearance.VERTEX_FORMAT
  35738. * }),
  35739. * id : 'rectangle',
  35740. * attributes : {
  35741. * color : new Cesium.ColorGeometryInstanceAttribute(0.0, 1.0, 1.0, 0.5)
  35742. * }
  35743. * });
  35744. * var ellipsoidInstance = new Cesium.GeometryInstance({
  35745. * geometry : new Cesium.EllipsoidGeometry({
  35746. * radii : new Cesium.Cartesian3(500000.0, 500000.0, 1000000.0),
  35747. * vertexFormat : Cesium.VertexFormat.POSITION_AND_NORMAL
  35748. * }),
  35749. * modelMatrix : Cesium.Matrix4.multiplyByTranslation(Cesium.Transforms.eastNorthUpToFixedFrame(
  35750. * Cesium.Cartesian3.fromDegrees(-95.59777, 40.03883)), new Cesium.Cartesian3(0.0, 0.0, 500000.0), new Cesium.Matrix4()),
  35751. * id : 'ellipsoid',
  35752. * attributes : {
  35753. * color : Cesium.ColorGeometryInstanceAttribute.fromColor(Cesium.Color.AQUA)
  35754. * }
  35755. * });
  35756. * scene.primitives.add(new Cesium.Primitive({
  35757. * geometryInstances : [rectangleInstance, ellipsoidInstance],
  35758. * appearance : new Cesium.PerInstanceColorAppearance()
  35759. * }));
  35760. * @example
  35761. * // 3. Create the geometry on the main thread.
  35762. * scene.primitives.add(new Cesium.Primitive({
  35763. * geometryInstances : new Cesium.GeometryInstance({
  35764. * geometry : Cesium.EllipsoidGeometry.createGeometry(new Cesium.EllipsoidGeometry({
  35765. * radii : new Cesium.Cartesian3(500000.0, 500000.0, 1000000.0),
  35766. * vertexFormat : Cesium.VertexFormat.POSITION_AND_NORMAL
  35767. * })),
  35768. * modelMatrix : Cesium.Matrix4.multiplyByTranslation(Cesium.Transforms.eastNorthUpToFixedFrame(
  35769. * Cesium.Cartesian3.fromDegrees(-95.59777, 40.03883)), new Cesium.Cartesian3(0.0, 0.0, 500000.0), new Cesium.Matrix4()),
  35770. * id : 'ellipsoid',
  35771. * attributes : {
  35772. * color : Cesium.ColorGeometryInstanceAttribute.fromColor(Cesium.Color.AQUA)
  35773. * }
  35774. * }),
  35775. * appearance : new Cesium.PerInstanceColorAppearance()
  35776. * }));
  35777. * @param [options] - Object with the following properties:
  35778. * @param [options.geometryInstances] - The geometry instances - or a single geometry instance - to render.
  35779. * @param [options.appearance] - The appearance used to render the primitive.
  35780. * @param [options.depthFailAppearance] - The appearance used to shade this primitive when it fails the depth test.
  35781. * @param [options.show = true] - Determines if this primitive will be shown.
  35782. * @param [options.modelMatrix = Matrix4.IDENTITY] - The 4x4 transformation matrix that transforms the primitive (all geometry instances) from model to world coordinates.
  35783. * @param [options.vertexCacheOptimize = false] - When <code>true</code>, geometry vertices are optimized for the pre and post-vertex-shader caches.
  35784. * @param [options.interleave = false] - When <code>true</code>, geometry vertex attributes are interleaved, which can slightly improve rendering performance but increases load time.
  35785. * @param [options.compressVertices = true] - When <code>true</code>, the geometry vertices are compressed, which will save memory.
  35786. * @param [options.releaseGeometryInstances = true] - When <code>true</code>, the primitive does not keep a reference to the input <code>geometryInstances</code> to save memory.
  35787. * @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.
  35788. * @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.
  35789. * @param [options.asynchronous = true] - Determines if the primitive will be created asynchronously or block until ready.
  35790. * @param [options.debugShowBoundingVolume = false] - For debugging only. Determines if this primitive's commands' bounding spheres are shown.
  35791. * @param [options.shadows = ShadowMode.DISABLED] - Determines whether this primitive casts or receives shadows from light sources.
  35792. */
  35793. export class Primitive {
  35794. constructor(options?: {
  35795. geometryInstances?: GeometryInstance[] | GeometryInstance;
  35796. appearance?: Appearance;
  35797. depthFailAppearance?: Appearance;
  35798. show?: boolean;
  35799. modelMatrix?: Matrix4;
  35800. vertexCacheOptimize?: boolean;
  35801. interleave?: boolean;
  35802. compressVertices?: boolean;
  35803. releaseGeometryInstances?: boolean;
  35804. allowPicking?: boolean;
  35805. cull?: boolean;
  35806. asynchronous?: boolean;
  35807. debugShowBoundingVolume?: boolean;
  35808. shadows?: ShadowMode;
  35809. });
  35810. /**
  35811. * The geometry instances rendered with this primitive. This may
  35812. * be <code>undefined</code> if <code>options.releaseGeometryInstances</code>
  35813. * is <code>true</code> when the primitive is constructed.
  35814. * <p>
  35815. * Changing this property after the primitive is rendered has no effect.
  35816. * </p>
  35817. */
  35818. readonly geometryInstances: GeometryInstance[] | GeometryInstance;
  35819. /**
  35820. * The {@link Appearance} used to shade this primitive. Each geometry
  35821. * instance is shaded with the same appearance. Some appearances, like
  35822. * {@link PerInstanceColorAppearance} allow giving each instance unique
  35823. * properties.
  35824. */
  35825. appearance: Appearance;
  35826. /**
  35827. * The {@link Appearance} used to shade this primitive when it fails the depth test. Each geometry
  35828. * instance is shaded with the same appearance. Some appearances, like
  35829. * {@link PerInstanceColorAppearance} allow giving each instance unique
  35830. * properties.
  35831. *
  35832. * <p>
  35833. * When using an appearance that requires a color attribute, like PerInstanceColorAppearance,
  35834. * add a depthFailColor per-instance attribute instead.
  35835. * </p>
  35836. *
  35837. * <p>
  35838. * Requires the EXT_frag_depth WebGL extension to render properly. If the extension is not supported,
  35839. * there may be artifacts.
  35840. * </p>
  35841. */
  35842. depthFailAppearance: Appearance;
  35843. /**
  35844. * The 4x4 transformation matrix that transforms the primitive (all geometry instances) from model to world coordinates.
  35845. * When this is the identity matrix, the primitive is drawn in world coordinates, i.e., Earth's WGS84 coordinates.
  35846. * Local reference frames can be used by providing a different transformation matrix, like that returned
  35847. * by {@link Transforms.eastNorthUpToFixedFrame}.
  35848. *
  35849. * <p>
  35850. * This property is only supported in 3D mode.
  35851. * </p>
  35852. * @example
  35853. * var origin = Cesium.Cartesian3.fromDegrees(-95.0, 40.0, 200000.0);
  35854. * p.modelMatrix = Cesium.Transforms.eastNorthUpToFixedFrame(origin);
  35855. */
  35856. modelMatrix: Matrix4;
  35857. /**
  35858. * Determines if the primitive will be shown. This affects all geometry
  35859. * instances in the primitive.
  35860. */
  35861. show: boolean;
  35862. /**
  35863. * When <code>true</code>, the renderer frustum culls and horizon culls the primitive's commands
  35864. * based on their bounding volume. Set this to <code>false</code> for a small performance gain
  35865. * if you are manually culling the primitive.
  35866. */
  35867. cull: boolean;
  35868. /**
  35869. * This property is for debugging only; it is not for production use nor is it optimized.
  35870. * <p>
  35871. * Draws the bounding sphere for each draw command in the primitive.
  35872. * </p>
  35873. */
  35874. debugShowBoundingVolume: boolean;
  35875. /**
  35876. * Determines whether this primitive casts or receives shadows from light sources.
  35877. */
  35878. shadows: ShadowMode;
  35879. /**
  35880. * When <code>true</code>, geometry vertices are optimized for the pre and post-vertex-shader caches.
  35881. */
  35882. readonly vertexCacheOptimize: boolean;
  35883. /**
  35884. * Determines if geometry vertex attributes are interleaved, which can slightly improve rendering performance.
  35885. */
  35886. readonly interleave: boolean;
  35887. /**
  35888. * When <code>true</code>, the primitive does not keep a reference to the input <code>geometryInstances</code> to save memory.
  35889. */
  35890. readonly releaseGeometryInstances: boolean;
  35891. /**
  35892. * When <code>true</code>, each geometry instance will only be pickable with {@link Scene#pick}. When <code>false</code>, GPU memory is saved. *
  35893. */
  35894. readonly allowPicking: boolean;
  35895. /**
  35896. * Determines if the geometry instances will be created and batched on a web worker.
  35897. */
  35898. readonly asynchronous: boolean;
  35899. /**
  35900. * When <code>true</code>, geometry vertices are compressed, which will save memory.
  35901. */
  35902. readonly compressVertices: boolean;
  35903. /**
  35904. * Determines if the primitive is complete and ready to render. If this property is
  35905. * true, the primitive will be rendered the next time that {@link Primitive#update}
  35906. * is called.
  35907. */
  35908. readonly ready: boolean;
  35909. /**
  35910. * Gets a promise that resolves when the primitive is ready to render.
  35911. */
  35912. readonly readyPromise: Promise<Primitive>;
  35913. /**
  35914. * Called when {@link Viewer} or {@link CesiumWidget} render the scene to
  35915. * get the draw commands needed to render this primitive.
  35916. * <p>
  35917. * Do not call this function directly. This is documented just to
  35918. * list the exceptions that may be propagated when the scene is rendered:
  35919. * </p>
  35920. */
  35921. update(): void;
  35922. /**
  35923. * Returns the modifiable per-instance attributes for a {@link GeometryInstance}.
  35924. * @example
  35925. * var attributes = primitive.getGeometryInstanceAttributes('an id');
  35926. * attributes.color = Cesium.ColorGeometryInstanceAttribute.toValue(Cesium.Color.AQUA);
  35927. * attributes.show = Cesium.ShowGeometryInstanceAttribute.toValue(true);
  35928. * attributes.distanceDisplayCondition = Cesium.DistanceDisplayConditionGeometryInstanceAttribute.toValue(100.0, 10000.0);
  35929. * attributes.offset = Cesium.OffsetGeometryInstanceAttribute.toValue(Cartesian3.IDENTITY);
  35930. * @param id - The id of the {@link GeometryInstance}.
  35931. * @returns The typed array in the attribute's format or undefined if the is no instance with id.
  35932. */
  35933. getGeometryInstanceAttributes(id: any): any;
  35934. /**
  35935. * Returns true if this object was destroyed; otherwise, false.
  35936. * <p>
  35937. * If this object was destroyed, it should not be used; calling any function other than
  35938. * <code>isDestroyed</code> will result in a {@link DeveloperError} exception.
  35939. * </p>
  35940. * @returns <code>true</code> if this object was destroyed; otherwise, <code>false</code>.
  35941. */
  35942. isDestroyed(): boolean;
  35943. /**
  35944. * Destroys the WebGL resources held by this object. Destroying an object allows for deterministic
  35945. * release of WebGL resources, instead of relying on the garbage collector to destroy this object.
  35946. * <p>
  35947. * Once an object is destroyed, it should not be used; calling any function other than
  35948. * <code>isDestroyed</code> will result in a {@link DeveloperError} exception. Therefore,
  35949. * assign the return value (<code>undefined</code>) to the object as done in the example.
  35950. * </p>
  35951. * @example
  35952. * e = e && e.destroy();
  35953. */
  35954. destroy(): void;
  35955. }
  35956. /**
  35957. * A collection of primitives. This is most often used with {@link Scene#primitives},
  35958. * but <code>PrimitiveCollection</code> is also a primitive itself so collections can
  35959. * be added to collections forming a hierarchy.
  35960. * @example
  35961. * var billboards = new Cesium.BillboardCollection();
  35962. * var labels = new Cesium.LabelCollection();
  35963. *
  35964. * var collection = new Cesium.PrimitiveCollection();
  35965. * collection.add(billboards);
  35966. *
  35967. * scene.primitives.add(collection); // Add collection
  35968. * scene.primitives.add(labels); // Add regular primitive
  35969. * @param [options] - Object with the following properties:
  35970. * @param [options.show = true] - Determines if the primitives in the collection will be shown.
  35971. * @param [options.destroyPrimitives = true] - Determines if primitives in the collection are destroyed when they are removed.
  35972. */
  35973. export class PrimitiveCollection {
  35974. constructor(options?: {
  35975. show?: boolean;
  35976. destroyPrimitives?: boolean;
  35977. });
  35978. /**
  35979. * Determines if primitives in this collection will be shown.
  35980. */
  35981. show: boolean;
  35982. /**
  35983. * Determines if primitives in the collection are destroyed when they are removed by
  35984. * {@link PrimitiveCollection#destroy} or {@link PrimitiveCollection#remove} or implicitly
  35985. * by {@link PrimitiveCollection#removeAll}.
  35986. * @example
  35987. * // Example 1. Primitives are destroyed by default.
  35988. * var primitives = new Cesium.PrimitiveCollection();
  35989. * var labels = primitives.add(new Cesium.LabelCollection());
  35990. * primitives = primitives.destroy();
  35991. * var b = labels.isDestroyed(); // true
  35992. * @example
  35993. * // Example 2. Do not destroy primitives in a collection.
  35994. * var primitives = new Cesium.PrimitiveCollection();
  35995. * primitives.destroyPrimitives = false;
  35996. * var labels = primitives.add(new Cesium.LabelCollection());
  35997. * primitives = primitives.destroy();
  35998. * var b = labels.isDestroyed(); // false
  35999. * labels = labels.destroy(); // explicitly destroy
  36000. */
  36001. destroyPrimitives: boolean;
  36002. /**
  36003. * Gets the number of primitives in the collection.
  36004. */
  36005. readonly length: number;
  36006. /**
  36007. * Adds a primitive to the collection.
  36008. * @example
  36009. * var billboards = scene.primitives.add(new Cesium.BillboardCollection());
  36010. * @param primitive - The primitive to add.
  36011. * @param [index] - the index to add the layer at. If omitted, the primitive will
  36012. * added at the bottom of all existing primitives.
  36013. * @returns The primitive added to the collection.
  36014. */
  36015. add(primitive: any, index?: number): any;
  36016. /**
  36017. * Removes a primitive from the collection.
  36018. * @example
  36019. * var billboards = scene.primitives.add(new Cesium.BillboardCollection());
  36020. * scene.primitives.remove(billboards); // Returns true
  36021. * @param [primitive] - The primitive to remove.
  36022. * @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.
  36023. */
  36024. remove(primitive?: any): boolean;
  36025. /**
  36026. * Removes all primitives in the collection.
  36027. */
  36028. removeAll(): void;
  36029. /**
  36030. * Determines if this collection contains a primitive.
  36031. * @param [primitive] - The primitive to check for.
  36032. * @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.
  36033. */
  36034. contains(primitive?: any): boolean;
  36035. /**
  36036. * Raises a primitive "up one" in the collection. If all primitives in the collection are drawn
  36037. * on the globe surface, this visually moves the primitive up one.
  36038. * @param [primitive] - The primitive to raise.
  36039. */
  36040. raise(primitive?: any): void;
  36041. /**
  36042. * Raises a primitive to the "top" of the collection. If all primitives in the collection are drawn
  36043. * on the globe surface, this visually moves the primitive to the top.
  36044. * @param [primitive] - The primitive to raise the top.
  36045. */
  36046. raiseToTop(primitive?: any): void;
  36047. /**
  36048. * Lowers a primitive "down one" in the collection. If all primitives in the collection are drawn
  36049. * on the globe surface, this visually moves the primitive down one.
  36050. * @param [primitive] - The primitive to lower.
  36051. */
  36052. lower(primitive?: any): void;
  36053. /**
  36054. * Lowers a primitive to the "bottom" of the collection. If all primitives in the collection are drawn
  36055. * on the globe surface, this visually moves the primitive to the bottom.
  36056. * @param [primitive] - The primitive to lower to the bottom.
  36057. */
  36058. lowerToBottom(primitive?: any): void;
  36059. /**
  36060. * Returns the primitive in the collection at the specified index.
  36061. * @example
  36062. * // Toggle the show property of every primitive in the collection.
  36063. * var primitives = scene.primitives;
  36064. * var length = primitives.length;
  36065. * for (var i = 0; i < length; ++i) {
  36066. * var p = primitives.get(i);
  36067. * p.show = !p.show;
  36068. * }
  36069. * @param index - The zero-based index of the primitive to return.
  36070. * @returns The primitive at the <code>index</code>.
  36071. */
  36072. get(index: number): any;
  36073. /**
  36074. * Returns true if this object was destroyed; otherwise, false.
  36075. * <br /><br />
  36076. * If this object was destroyed, it should not be used; calling any function other than
  36077. * <code>isDestroyed</code> will result in a {@link DeveloperError} exception.
  36078. * @returns True if this object was destroyed; otherwise, false.
  36079. */
  36080. isDestroyed(): boolean;
  36081. /**
  36082. * Destroys the WebGL resources held by each primitive in this collection. Explicitly destroying this
  36083. * collection allows for deterministic release of WebGL resources, instead of relying on the garbage
  36084. * collector to destroy this collection.
  36085. * <br /><br />
  36086. * Since destroying a collection destroys all the contained primitives, only destroy a collection
  36087. * when you are sure no other code is still using any of the contained primitives.
  36088. * <br /><br />
  36089. * Once this collection is destroyed, it should not be used; calling any function other than
  36090. * <code>isDestroyed</code> will result in a {@link DeveloperError} exception. Therefore,
  36091. * assign the return value (<code>undefined</code>) to the object as done in the example.
  36092. * @example
  36093. * primitives = primitives && primitives.destroy();
  36094. */
  36095. destroy(): void;
  36096. }
  36097. /**
  36098. * The container for all 3D graphical objects and state in a Cesium virtual scene. Generally,
  36099. * a scene is not created directly; instead, it is implicitly created by {@link CesiumWidget}.
  36100. * <p>
  36101. * <em><code>contextOptions</code> parameter details:</em>
  36102. * </p>
  36103. * <p>
  36104. * The default values are:
  36105. * <code>
  36106. * {
  36107. * webgl : {
  36108. * alpha : false,
  36109. * depth : true,
  36110. * stencil : false,
  36111. * antialias : true,
  36112. * powerPreference: 'high-performance',
  36113. * premultipliedAlpha : true,
  36114. * preserveDrawingBuffer : false,
  36115. * failIfMajorPerformanceCaveat : false
  36116. * },
  36117. * allowTextureFilterAnisotropic : true
  36118. * }
  36119. * </code>
  36120. * </p>
  36121. * <p>
  36122. * The <code>webgl</code> property corresponds to the {@link http://www.khronos.org/registry/webgl/specs/latest/#5.2|WebGLContextAttributes}
  36123. * object used to create the WebGL context.
  36124. * </p>
  36125. * <p>
  36126. * <code>webgl.alpha</code> defaults to false, which can improve performance compared to the standard WebGL default
  36127. * of true. If an application needs to composite Cesium above other HTML elements using alpha-blending, set
  36128. * <code>webgl.alpha</code> to true.
  36129. * </p>
  36130. * <p>
  36131. * The other <code>webgl</code> properties match the WebGL defaults for {@link http://www.khronos.org/registry/webgl/specs/latest/#5.2|WebGLContextAttributes}.
  36132. * </p>
  36133. * <p>
  36134. * <code>allowTextureFilterAnisotropic</code> defaults to true, which enables anisotropic texture filtering when the
  36135. * WebGL extension is supported. Setting this to false will improve performance, but hurt visual quality, especially for horizon views.
  36136. * </p>
  36137. * @example
  36138. * // Create scene without anisotropic texture filtering
  36139. * var scene = new Cesium.Scene({
  36140. * canvas : canvas,
  36141. * contextOptions : {
  36142. * allowTextureFilterAnisotropic : false
  36143. * }
  36144. * });
  36145. * @param [options] - Object with the following properties:
  36146. * @param options.canvas - The HTML canvas element to create the scene for.
  36147. * @param [options.contextOptions] - Context and WebGL creation properties. See details above.
  36148. * @param [options.creditContainer] - The HTML element in which the credits will be displayed.
  36149. * @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.
  36150. * @param [options.mapProjection = new GeographicProjection()] - The map projection to use in 2D and Columbus View modes.
  36151. * @param [options.orderIndependentTranslucency = true] - If true and the configuration supports it, use order independent translucency.
  36152. * @param [options.scene3DOnly = false] - If true, optimizes memory use and performance for 3D mode but disables the ability to use 2D or Columbus View.
  36153. * @param [options.terrainExaggeration = 1.0] - A scalar used to exaggerate the terrain. Note that terrain exaggeration will not modify any other primitive as they are positioned relative to the ellipsoid.
  36154. * @param [options.shadows = false] - Determines if shadows are cast by light sources.
  36155. * @param [options.mapMode2D = MapMode2D.INFINITE_SCROLL] - Determines if the 2D map is rotatable or can be scrolled infinitely in the horizontal direction.
  36156. * @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}.
  36157. * @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}.
  36158. */
  36159. export class Scene {
  36160. constructor(options?: {
  36161. canvas: HTMLCanvasElement;
  36162. contextOptions?: any;
  36163. creditContainer?: Element;
  36164. creditViewport?: Element;
  36165. mapProjection?: MapProjection;
  36166. orderIndependentTranslucency?: boolean;
  36167. scene3DOnly?: boolean;
  36168. terrainExaggeration?: number;
  36169. shadows?: boolean;
  36170. mapMode2D?: MapMode2D;
  36171. requestRenderMode?: boolean;
  36172. maximumRenderTimeChange?: number;
  36173. });
  36174. /**
  36175. * Exceptions occurring in <code>render</code> are always caught in order to raise the
  36176. * <code>renderError</code> event. If this property is true, the error is rethrown
  36177. * after the event is raised. If this property is false, the <code>render</code> function
  36178. * returns normally after raising the event.
  36179. */
  36180. rethrowRenderErrors: boolean;
  36181. /**
  36182. * Determines whether or not to instantly complete the
  36183. * scene transition animation on user input.
  36184. */
  36185. completeMorphOnUserInput: boolean;
  36186. /**
  36187. * The event fired at the beginning of a scene transition.
  36188. */
  36189. morphStart: Event;
  36190. /**
  36191. * The event fired at the completion of a scene transition.
  36192. */
  36193. morphComplete: Event;
  36194. /**
  36195. * The {@link SkyBox} used to draw the stars.
  36196. */
  36197. skyBox: SkyBox;
  36198. /**
  36199. * The sky atmosphere drawn around the globe.
  36200. */
  36201. skyAtmosphere: SkyAtmosphere;
  36202. /**
  36203. * The {@link Sun}.
  36204. */
  36205. sun: Sun;
  36206. /**
  36207. * Uses a bloom filter on the sun when enabled.
  36208. */
  36209. sunBloom: boolean;
  36210. /**
  36211. * The {@link Moon}
  36212. */
  36213. moon: Moon;
  36214. /**
  36215. * The background color, which is only visible if there is no sky box, i.e., {@link Scene#skyBox} is undefined.
  36216. */
  36217. backgroundColor: Color;
  36218. /**
  36219. * The current morph transition time between 2D/Columbus View and 3D,
  36220. * with 0.0 being 2D or Columbus View and 1.0 being 3D.
  36221. */
  36222. morphTime: number;
  36223. /**
  36224. * The far-to-near ratio of the multi-frustum when using a normal depth buffer.
  36225. * <p>
  36226. * This value is used to create the near and far values for each frustum of the multi-frustum. It is only used
  36227. * when {@link Scene#logarithmicDepthBuffer} is <code>false</code>. When <code>logarithmicDepthBuffer</code> is
  36228. * <code>true</code>, use {@link Scene#logarithmicDepthFarToNearRatio}.
  36229. * </p>
  36230. */
  36231. farToNearRatio: number;
  36232. /**
  36233. * The far-to-near ratio of the multi-frustum when using a logarithmic depth buffer.
  36234. * <p>
  36235. * This value is used to create the near and far values for each frustum of the multi-frustum. It is only used
  36236. * when {@link Scene#logarithmicDepthBuffer} is <code>true</code>. When <code>logarithmicDepthBuffer</code> is
  36237. * <code>false</code>, use {@link Scene#farToNearRatio}.
  36238. * </p>
  36239. */
  36240. logarithmicDepthFarToNearRatio: number;
  36241. /**
  36242. * Determines the uniform depth size in meters of each frustum of the multifrustum in 2D. If a primitive or model close
  36243. * to the surface shows z-fighting, decreasing this will eliminate the artifact, but decrease performance. On the
  36244. * other hand, increasing this will increase performance but may cause z-fighting among primitives close to the surface.
  36245. */
  36246. nearToFarDistance2D: number;
  36247. /**
  36248. * This property is for debugging only; it is not for production use.
  36249. * <p>
  36250. * A function that determines what commands are executed. As shown in the examples below,
  36251. * the function receives the command's <code>owner</code> as an argument, and returns a boolean indicating if the
  36252. * command should be executed.
  36253. * </p>
  36254. * <p>
  36255. * The default is <code>undefined</code>, indicating that all commands are executed.
  36256. * </p>
  36257. * @example
  36258. * // Do not execute any commands.
  36259. * scene.debugCommandFilter = function(command) {
  36260. * return false;
  36261. * };
  36262. *
  36263. * // Execute only the billboard's commands. That is, only draw the billboard.
  36264. * var billboards = new Cesium.BillboardCollection();
  36265. * scene.debugCommandFilter = function(command) {
  36266. * return command.owner === billboards;
  36267. * };
  36268. */
  36269. debugCommandFilter: (...params: any[]) => any;
  36270. /**
  36271. * This property is for debugging only; it is not for production use.
  36272. * <p>
  36273. * When <code>true</code>, commands are randomly shaded. This is useful
  36274. * for performance analysis to see what parts of a scene or model are
  36275. * command-dense and could benefit from batching.
  36276. * </p>
  36277. */
  36278. debugShowCommands: boolean;
  36279. /**
  36280. * This property is for debugging only; it is not for production use.
  36281. * <p>
  36282. * When <code>true</code>, commands are shaded based on the frustums they
  36283. * overlap. Commands in the closest frustum are tinted red, commands in
  36284. * the next closest are green, and commands in the farthest frustum are
  36285. * blue. If a command overlaps more than one frustum, the color components
  36286. * are combined, e.g., a command overlapping the first two frustums is tinted
  36287. * yellow.
  36288. * </p>
  36289. */
  36290. debugShowFrustums: boolean;
  36291. /**
  36292. * This property is for debugging only; it is not for production use.
  36293. * <p>
  36294. * Displays frames per second and time between frames.
  36295. * </p>
  36296. */
  36297. debugShowFramesPerSecond: boolean;
  36298. /**
  36299. * This property is for debugging only; it is not for production use.
  36300. * <p>
  36301. * Displays depth information for the indicated frustum.
  36302. * </p>
  36303. */
  36304. debugShowGlobeDepth: boolean;
  36305. /**
  36306. * This property is for debugging only; it is not for production use.
  36307. * <p>
  36308. * Indicates which frustum will have depth information displayed.
  36309. * </p>
  36310. */
  36311. debugShowDepthFrustum: number;
  36312. /**
  36313. * This property is for debugging only; it is not for production use.
  36314. * <p>
  36315. * When <code>true</code>, draws outlines to show the boundaries of the camera frustums
  36316. * </p>
  36317. */
  36318. debugShowFrustumPlanes: boolean;
  36319. /**
  36320. * When <code>true</code>, enables picking using the depth buffer.
  36321. */
  36322. useDepthPicking: boolean;
  36323. /**
  36324. * 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.
  36325. *
  36326. * <p>
  36327. * Render must be called between picks.
  36328. * <br>There is a decrease in performance when enabled. There are extra draw calls to write depth for
  36329. * translucent geometry.
  36330. * </p>
  36331. * @example
  36332. * // picking the position of a translucent primitive
  36333. * viewer.screenSpaceEventHandler.setInputAction(function onLeftClick(movement) {
  36334. * var pickedFeature = viewer.scene.pick(movement.position);
  36335. * if (!Cesium.defined(pickedFeature)) {
  36336. * // nothing picked
  36337. * return;
  36338. * }
  36339. * viewer.scene.render();
  36340. * var worldPosition = viewer.scene.pickPosition(movement.position);
  36341. * }, Cesium.ScreenSpaceEventType.LEFT_CLICK);
  36342. */
  36343. pickTranslucentDepth: boolean;
  36344. /**
  36345. * Blends the atmosphere to geometry far from the camera for horizon views. Allows for additional
  36346. * performance improvements by rendering less geometry and dispatching less terrain requests.
  36347. */
  36348. fog: Fog;
  36349. /**
  36350. * The shadow map for the scene's light source. When enabled, models, primitives, and the globe may cast and receive shadows.
  36351. */
  36352. shadowMap: ShadowMap;
  36353. /**
  36354. * When <code>false</code>, 3D Tiles will render normally. When <code>true</code>, classified 3D Tile geometry will render normally and
  36355. * unclassified 3D Tile geometry will render with the color multiplied by {@link Scene#invertClassificationColor}.
  36356. */
  36357. invertClassification: boolean;
  36358. /**
  36359. * The highlight color of unclassified 3D Tile geometry when {@link Scene#invertClassification} is <code>true</code>.
  36360. * <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>
  36361. * <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>
  36362. */
  36363. invertClassificationColor: Color;
  36364. /**
  36365. * The focal length for use when with cardboard or WebVR.
  36366. */
  36367. focalLength: number;
  36368. /**
  36369. * The eye separation distance in meters for use with cardboard or WebVR.
  36370. */
  36371. eyeSeparation: number;
  36372. /**
  36373. * Post processing effects applied to the final render.
  36374. */
  36375. postProcessStages: PostProcessStageCollection;
  36376. /**
  36377. * When <code>true</code>, rendering a frame will only occur when needed as determined by changes within the scene.
  36378. * Enabling improves performance of the application, but requires using {@link Scene#requestRender}
  36379. * to render a new frame explicitly in this mode. This will be necessary in many cases after making changes
  36380. * to the scene in other parts of the API.
  36381. */
  36382. requestRenderMode: boolean;
  36383. /**
  36384. * If {@link Scene#requestRenderMode} is <code>true</code>, this value defines the maximum change in
  36385. * simulation time allowed before a render is requested. Lower values increase the number of frames rendered
  36386. * and higher values decrease the number of frames rendered. If <code>undefined</code>, changes to
  36387. * the simulation time will never request a render.
  36388. * This value impacts the rate of rendering for changes in the scene like lighting, entity property updates,
  36389. * and animations.
  36390. */
  36391. maximumRenderTimeChange: number;
  36392. /**
  36393. * The spherical harmonic coefficients for image-based lighting of PBR models.
  36394. */
  36395. sphericalHarmonicCoefficients: Cartesian3[];
  36396. /**
  36397. * The url to the KTX file containing the specular environment map and convoluted mipmaps for image-based lighting of PBR models.
  36398. */
  36399. specularEnvironmentMaps: string;
  36400. /**
  36401. * The light source for shading. Defaults to a directional light from the Sun.
  36402. */
  36403. light: Light;
  36404. /**
  36405. * Gets the canvas element to which this scene is bound.
  36406. */
  36407. readonly canvas: HTMLCanvasElement;
  36408. /**
  36409. * The drawingBufferHeight of the underlying GL context.
  36410. */
  36411. readonly drawingBufferHeight: number;
  36412. /**
  36413. * The drawingBufferHeight of the underlying GL context.
  36414. */
  36415. readonly drawingBufferWidth: number;
  36416. /**
  36417. * The maximum aliased line width, in pixels, supported by this WebGL implementation. It will be at least one.
  36418. */
  36419. readonly maximumAliasedLineWidth: number;
  36420. /**
  36421. * The maximum length in pixels of one edge of a cube map, supported by this WebGL implementation. It will be at least 16.
  36422. */
  36423. readonly maximumCubeMapSize: number;
  36424. /**
  36425. * Returns <code>true</code> if the {@link Scene#pickPosition} function is supported.
  36426. */
  36427. readonly pickPositionSupported: boolean;
  36428. /**
  36429. * Returns <code>true</code> if the {@link Scene#sampleHeight} and {@link Scene#sampleHeightMostDetailed} functions are supported.
  36430. */
  36431. readonly sampleHeightSupported: boolean;
  36432. /**
  36433. * Returns <code>true</code> if the {@link Scene#clampToHeight} and {@link Scene#clampToHeightMostDetailed} functions are supported.
  36434. */
  36435. readonly clampToHeightSupported: boolean;
  36436. /**
  36437. * Returns <code>true</code> if the {@link Scene#invertClassification} is supported.
  36438. */
  36439. readonly invertClassificationSupported: boolean;
  36440. /**
  36441. * Returns <code>true</code> if specular environment maps are supported.
  36442. */
  36443. readonly specularEnvironmentMapsSupported: boolean;
  36444. /**
  36445. * Gets or sets the depth-test ellipsoid.
  36446. */
  36447. globe: Globe;
  36448. /**
  36449. * Gets the collection of primitives.
  36450. */
  36451. readonly primitives: PrimitiveCollection;
  36452. /**
  36453. * Gets the collection of ground primitives.
  36454. */
  36455. readonly groundPrimitives: PrimitiveCollection;
  36456. /**
  36457. * Gets or sets the camera.
  36458. */
  36459. readonly camera: Camera;
  36460. /**
  36461. * Gets the controller for camera input handling.
  36462. */
  36463. readonly screenSpaceCameraController: ScreenSpaceCameraController;
  36464. /**
  36465. * Get the map projection to use in 2D and Columbus View modes.
  36466. */
  36467. readonly mapProjection: MapProjection;
  36468. /**
  36469. * Gets the collection of image layers that will be rendered on the globe.
  36470. */
  36471. readonly imageryLayers: ImageryLayerCollection;
  36472. /**
  36473. * The terrain provider providing surface geometry for the globe.
  36474. */
  36475. terrainProvider: TerrainProvider;
  36476. /**
  36477. * Gets an event that's raised when the terrain provider is changed
  36478. */
  36479. readonly terrainProviderChanged: Event;
  36480. /**
  36481. * Gets the event that will be raised before the scene is updated or rendered. Subscribers to the event
  36482. * receive the Scene instance as the first parameter and the current time as the second parameter.
  36483. */
  36484. readonly preUpdate: Event;
  36485. /**
  36486. * Gets the event that will be raised immediately after the scene is updated and before the scene is rendered.
  36487. * Subscribers to the event receive the Scene instance as the first parameter and the current time as the second
  36488. * parameter.
  36489. */
  36490. readonly postUpdate: Event;
  36491. /**
  36492. * Gets the event that will be raised when an error is thrown inside the <code>render</code> function.
  36493. * The Scene instance and the thrown error are the only two parameters passed to the event handler.
  36494. * By default, errors are not rethrown after this event is raised, but that can be changed by setting
  36495. * the <code>rethrowRenderErrors</code> property.
  36496. */
  36497. readonly renderError: Event;
  36498. /**
  36499. * Gets the event that will be raised after the scene is updated and immediately before the scene is rendered.
  36500. * Subscribers to the event receive the Scene instance as the first parameter and the current time as the second
  36501. * parameter.
  36502. */
  36503. readonly preRender: Event;
  36504. /**
  36505. * Gets the event that will be raised immediately after the scene is rendered. Subscribers to the event
  36506. * receive the Scene instance as the first parameter and the current time as the second parameter.
  36507. */
  36508. readonly postRender: Event;
  36509. /**
  36510. * Gets the simulation time when the scene was last rendered. Returns undefined if the scene has not yet been
  36511. * rendered.
  36512. */
  36513. readonly lastRenderTime: JulianDate;
  36514. /**
  36515. * This property is for debugging only; it is not for production use.
  36516. * <p>
  36517. * When {@link Scene.debugShowFrustums} is <code>true</code>, this contains
  36518. * properties with statistics about the number of command execute per frustum.
  36519. * <code>totalCommands</code> is the total number of commands executed, ignoring
  36520. * overlap. <code>commandsInFrustums</code> is an array with the number of times
  36521. * commands are executed redundantly, e.g., how many commands overlap two or
  36522. * three frustums.
  36523. * </p>
  36524. */
  36525. readonly debugFrustumStatistics: any;
  36526. /**
  36527. * Gets whether or not the scene is optimized for 3D only viewing.
  36528. */
  36529. readonly scene3DOnly: boolean;
  36530. /**
  36531. * Gets whether or not the scene has order independent translucency enabled.
  36532. * Note that this only reflects the original construction option, and there are
  36533. * other factors that could prevent OIT from functioning on a given system configuration.
  36534. */
  36535. readonly orderIndependentTranslucency: boolean;
  36536. /**
  36537. * Gets the unique identifier for this scene.
  36538. */
  36539. readonly id: string;
  36540. /**
  36541. * Gets or sets the current mode of the scene.
  36542. */
  36543. mode: SceneMode;
  36544. /**
  36545. * Gets the scalar used to exaggerate the terrain.
  36546. */
  36547. readonly terrainExaggeration: number;
  36548. /**
  36549. * When <code>true</code>, splits the scene into two viewports with steroscopic views for the left and right eyes.
  36550. * Used for cardboard and WebVR.
  36551. */
  36552. useWebVR: boolean;
  36553. /**
  36554. * Determines if the 2D map is rotatable or can be scrolled infinitely in the horizontal direction.
  36555. */
  36556. readonly mapMode2D: MapMode2D;
  36557. /**
  36558. * Gets or sets the position of the Imagery splitter within the viewport. Valid values are between 0.0 and 1.0.
  36559. */
  36560. imagerySplitPosition: number;
  36561. /**
  36562. * The distance from the camera at which to disable the depth test of billboards, labels and points
  36563. * to, for example, prevent clipping against terrain. When set to zero, the depth test should always
  36564. * be applied. When less than zero, the depth test should never be applied. Setting the disableDepthTestDistance
  36565. * property of a billboard, label or point will override this value.
  36566. */
  36567. minimumDisableDepthTestDistance: number;
  36568. /**
  36569. * Whether or not to use a logarithmic depth buffer. Enabling this option will allow for less frustums in the multi-frustum,
  36570. * increasing performance. This property relies on fragmentDepth being supported.
  36571. */
  36572. logarithmicDepthBuffer: boolean;
  36573. /**
  36574. * The value used for gamma correction. This is only used when rendering with high dynamic range.
  36575. */
  36576. gamma: number;
  36577. /**
  36578. * Whether or not to use high dynamic range rendering.
  36579. */
  36580. highDynamicRange: boolean;
  36581. /**
  36582. * Whether or not high dynamic range rendering is supported.
  36583. */
  36584. readonly highDynamicRangeSupported: boolean;
  36585. /**
  36586. * Whether or not the camera is underneath the globe.
  36587. */
  36588. readonly cameraUnderground: boolean;
  36589. /**
  36590. * Determines if a compressed texture format is supported.
  36591. * @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.
  36592. * @returns Whether or not the format is supported.
  36593. */
  36594. getCompressedTextureFormatSupported(format: string): boolean;
  36595. /**
  36596. * Update and render the scene. It is usually not necessary to call this function
  36597. * directly because {@link CesiumWidget} or {@link Viewer} do it automatically.
  36598. * @param [time] - The simulation time at which to render.
  36599. */
  36600. render(time?: JulianDate): void;
  36601. /**
  36602. * Requests a new rendered frame when {@link Scene#requestRenderMode} is set to <code>true</code>.
  36603. * The render rate will not exceed the {@link CesiumWidget#targetFrameRate}.
  36604. */
  36605. requestRender(): void;
  36606. /**
  36607. * Returns an object with a `primitive` property that contains the first (top) primitive in the scene
  36608. * at a particular window coordinate or undefined if nothing is at the location. Other properties may
  36609. * potentially be set depending on the type of primitive and may be used to further identify the picked object.
  36610. * <p>
  36611. * When a feature of a 3D Tiles tileset is picked, <code>pick</code> returns a {@link Cesium3DTileFeature} object.
  36612. * </p>
  36613. * @example
  36614. * // On mouse over, color the feature yellow.
  36615. * handler.setInputAction(function(movement) {
  36616. * var feature = scene.pick(movement.endPosition);
  36617. * if (feature instanceof Cesium.Cesium3DTileFeature) {
  36618. * feature.color = Cesium.Color.YELLOW;
  36619. * }
  36620. * }, Cesium.ScreenSpaceEventType.MOUSE_MOVE);
  36621. * @param windowPosition - Window coordinates to perform picking on.
  36622. * @param [width = 3] - Width of the pick rectangle.
  36623. * @param [height = 3] - Height of the pick rectangle.
  36624. * @returns Object containing the picked primitive.
  36625. */
  36626. pick(windowPosition: Cartesian2, width?: number, height?: number): any;
  36627. /**
  36628. * Returns the cartesian position reconstructed from the depth buffer and window position.
  36629. * <p>
  36630. * The position reconstructed from the depth buffer in 2D may be slightly different from those
  36631. * reconstructed in 3D and Columbus view. This is caused by the difference in the distribution
  36632. * of depth values of perspective and orthographic projection.
  36633. * </p>
  36634. * <p>
  36635. * Set {@link Scene#pickTranslucentDepth} to <code>true</code> to include the depth of
  36636. * translucent primitives; otherwise, this essentially picks through translucent primitives.
  36637. * </p>
  36638. * @param windowPosition - Window coordinates to perform picking on.
  36639. * @param [result] - The object on which to restore the result.
  36640. * @returns The cartesian position.
  36641. */
  36642. pickPosition(windowPosition: Cartesian2, result?: Cartesian3): Cartesian3;
  36643. /**
  36644. * Returns a list of objects, each containing a `primitive` property, for all primitives at
  36645. * a particular window coordinate position. Other properties may also be set depending on the
  36646. * type of primitive and may be used to further identify the picked object. The primitives in
  36647. * the list are ordered by their visual order in the scene (front to back).
  36648. * @example
  36649. * var pickedObjects = scene.drillPick(new Cesium.Cartesian2(100.0, 200.0));
  36650. * @param windowPosition - Window coordinates to perform picking on.
  36651. * @param [limit] - If supplied, stop drilling after collecting this many picks.
  36652. * @param [width = 3] - Width of the pick rectangle.
  36653. * @param [height = 3] - Height of the pick rectangle.
  36654. * @returns Array of objects, each containing 1 picked primitives.
  36655. */
  36656. drillPick(windowPosition: Cartesian2, limit?: number, width?: number, height?: number): any[];
  36657. /**
  36658. * Returns the height of scene geometry at the given cartographic position or <code>undefined</code> if there was no
  36659. * scene geometry to sample height from. The height of the input position is ignored. May be used to clamp objects to
  36660. * the globe, 3D Tiles, or primitives in the scene.
  36661. * <p>
  36662. * This function only samples height from globe tiles and 3D Tiles that are rendered in the current view. Samples height
  36663. * from all other primitives regardless of their visibility.
  36664. * </p>
  36665. * @example
  36666. * var position = new Cesium.Cartographic(-1.31968, 0.698874);
  36667. * var height = viewer.scene.sampleHeight(position);
  36668. * console.log(height);
  36669. * @param position - The cartographic position to sample height from.
  36670. * @param [objectsToExclude] - A list of primitives, entities, or 3D Tiles features to not sample height from.
  36671. * @param [width = 0.1] - Width of the intersection volume in meters.
  36672. * @returns The height. This may be <code>undefined</code> if there was no scene geometry to sample height from.
  36673. */
  36674. sampleHeight(position: Cartographic, objectsToExclude?: object[], width?: number): number;
  36675. /**
  36676. * Clamps the given cartesian position to the scene geometry along the geodetic surface normal. Returns the
  36677. * clamped position or <code>undefined</code> if there was no scene geometry to clamp to. May be used to clamp
  36678. * objects to the globe, 3D Tiles, or primitives in the scene.
  36679. * <p>
  36680. * This function only clamps to globe tiles and 3D Tiles that are rendered in the current view. Clamps to
  36681. * all other primitives regardless of their visibility.
  36682. * </p>
  36683. * @example
  36684. * // Clamp an entity to the underlying scene geometry
  36685. * var position = entity.position.getValue(Cesium.JulianDate.now());
  36686. * entity.position = viewer.scene.clampToHeight(position);
  36687. * @param cartesian - The cartesian position.
  36688. * @param [objectsToExclude] - A list of primitives, entities, or 3D Tiles features to not clamp to.
  36689. * @param [width = 0.1] - Width of the intersection volume in meters.
  36690. * @param [result] - An optional object to return the clamped position.
  36691. * @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.
  36692. */
  36693. clampToHeight(cartesian: Cartesian3, objectsToExclude?: object[], width?: number, result?: Cartesian3): Cartesian3;
  36694. /**
  36695. * Initiates an asynchronous {@link Scene#sampleHeight} query for an array of {@link Cartographic} positions
  36696. * using the maximum level of detail for 3D Tilesets in the scene. The height of the input positions is ignored.
  36697. * Returns a promise that is resolved when the query completes. Each point height is modified in place.
  36698. * If a height cannot be determined because no geometry can be sampled at that location, or another error occurs,
  36699. * the height is set to undefined.
  36700. * @example
  36701. * var positions = [
  36702. * new Cesium.Cartographic(-1.31968, 0.69887),
  36703. * new Cesium.Cartographic(-1.10489, 0.83923)
  36704. * ];
  36705. * var promise = viewer.scene.sampleHeightMostDetailed(positions);
  36706. * promise.then(function(updatedPosition) {
  36707. * // positions[0].height and positions[1].height have been updated.
  36708. * // updatedPositions is just a reference to positions.
  36709. * }
  36710. * @param positions - The cartographic positions to update with sampled heights.
  36711. * @param [objectsToExclude] - A list of primitives, entities, or 3D Tiles features to not sample height from.
  36712. * @param [width = 0.1] - Width of the intersection volume in meters.
  36713. * @returns A promise that resolves to the provided list of positions when the query has completed.
  36714. */
  36715. sampleHeightMostDetailed(positions: Cartographic[], objectsToExclude?: object[], width?: number): Promise<Cartographic[]>;
  36716. /**
  36717. * Initiates an asynchronous {@link Scene#clampToHeight} query for an array of {@link Cartesian3} positions
  36718. * using the maximum level of detail for 3D Tilesets in the scene. Returns a promise that is resolved when
  36719. * the query completes. Each position is modified in place. If a position cannot be clamped because no geometry
  36720. * can be sampled at that location, or another error occurs, the element in the array is set to undefined.
  36721. * @example
  36722. * var cartesians = [
  36723. * entities[0].position.getValue(Cesium.JulianDate.now()),
  36724. * entities[1].position.getValue(Cesium.JulianDate.now())
  36725. * ];
  36726. * var promise = viewer.scene.clampToHeightMostDetailed(cartesians);
  36727. * promise.then(function(updatedCartesians) {
  36728. * entities[0].position = updatedCartesians[0];
  36729. * entities[1].position = updatedCartesians[1];
  36730. * }
  36731. * @param cartesians - The cartesian positions to update with clamped positions.
  36732. * @param [objectsToExclude] - A list of primitives, entities, or 3D Tiles features to not clamp to.
  36733. * @param [width = 0.1] - Width of the intersection volume in meters.
  36734. * @returns A promise that resolves to the provided list of positions when the query has completed.
  36735. */
  36736. clampToHeightMostDetailed(cartesians: Cartesian3[], objectsToExclude?: object[], width?: number): Promise<Cartesian3[]>;
  36737. /**
  36738. * Transforms a position in cartesian coordinates to canvas coordinates. This is commonly used to place an
  36739. * HTML element at the same screen position as an object in the scene.
  36740. * @example
  36741. * // Output the canvas position of longitude/latitude (0, 0) every time the mouse moves.
  36742. * var scene = widget.scene;
  36743. * var ellipsoid = scene.globe.ellipsoid;
  36744. * var position = Cesium.Cartesian3.fromDegrees(0.0, 0.0);
  36745. * var handler = new Cesium.ScreenSpaceEventHandler(scene.canvas);
  36746. * handler.setInputAction(function(movement) {
  36747. * console.log(scene.cartesianToCanvasCoordinates(position));
  36748. * }, Cesium.ScreenSpaceEventType.MOUSE_MOVE);
  36749. * @param position - The position in cartesian coordinates.
  36750. * @param [result] - An optional object to return the input position transformed to canvas coordinates.
  36751. * @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.
  36752. */
  36753. cartesianToCanvasCoordinates(position: Cartesian3, result?: Cartesian2): Cartesian2;
  36754. /**
  36755. * Instantly completes an active transition.
  36756. */
  36757. completeMorph(): void;
  36758. /**
  36759. * Asynchronously transitions the scene to 2D.
  36760. * @param [duration = 2.0] - The amount of time, in seconds, for transition animations to complete.
  36761. */
  36762. morphTo2D(duration?: number): void;
  36763. /**
  36764. * Asynchronously transitions the scene to Columbus View.
  36765. * @param [duration = 2.0] - The amount of time, in seconds, for transition animations to complete.
  36766. */
  36767. morphToColumbusView(duration?: number): void;
  36768. /**
  36769. * Asynchronously transitions the scene to 3D.
  36770. * @param [duration = 2.0] - The amount of time, in seconds, for transition animations to complete.
  36771. */
  36772. morphTo3D(duration?: number): void;
  36773. /**
  36774. * Returns true if this object was destroyed; otherwise, false.
  36775. * <br /><br />
  36776. * If this object was destroyed, it should not be used; calling any function other than
  36777. * <code>isDestroyed</code> will result in a {@link DeveloperError} exception.
  36778. * @returns <code>true</code> if this object was destroyed; otherwise, <code>false</code>.
  36779. */
  36780. isDestroyed(): boolean;
  36781. /**
  36782. * Destroys the WebGL resources held by this object. Destroying an object allows for deterministic
  36783. * release of WebGL resources, instead of relying on the garbage collector to destroy this object.
  36784. * <br /><br />
  36785. * Once an object is destroyed, it should not be used; calling any function other than
  36786. * <code>isDestroyed</code> will result in a {@link DeveloperError} exception. Therefore,
  36787. * assign the return value (<code>undefined</code>) to the object as done in the example.
  36788. * @example
  36789. * scene = scene && scene.destroy();
  36790. */
  36791. destroy(): void;
  36792. }
  36793. /**
  36794. * Indicates if the scene is viewed in 3D, 2D, or 2.5D Columbus view.
  36795. */
  36796. export enum SceneMode {
  36797. /**
  36798. * Morphing between mode, e.g., 3D to 2D.
  36799. */
  36800. MORPHING = 0,
  36801. /**
  36802. * Columbus View mode. A 2.5D perspective view where the map is laid out
  36803. * flat and objects with non-zero height are drawn above it.
  36804. */
  36805. COLUMBUS_VIEW = 1,
  36806. /**
  36807. * 2D mode. The map is viewed top-down with an orthographic projection.
  36808. */
  36809. SCENE2D = 2,
  36810. /**
  36811. * 3D mode. A traditional 3D perspective view of the globe.
  36812. */
  36813. SCENE3D = 3
  36814. }
  36815. /**
  36816. * Functions that do scene-dependent transforms between rendering-related coordinate systems.
  36817. */
  36818. export namespace SceneTransforms {
  36819. /**
  36820. * Transforms a position in WGS84 coordinates to window coordinates. This is commonly used to place an
  36821. * HTML element at the same screen position as an object in the scene.
  36822. * @example
  36823. * // Output the window position of longitude/latitude (0, 0) every time the mouse moves.
  36824. * var scene = widget.scene;
  36825. * var ellipsoid = scene.globe.ellipsoid;
  36826. * var position = Cesium.Cartesian3.fromDegrees(0.0, 0.0);
  36827. * var handler = new Cesium.ScreenSpaceEventHandler(scene.canvas);
  36828. * handler.setInputAction(function(movement) {
  36829. * console.log(Cesium.SceneTransforms.wgs84ToWindowCoordinates(scene, position));
  36830. * }, Cesium.ScreenSpaceEventType.MOUSE_MOVE);
  36831. * @param scene - The scene.
  36832. * @param position - The position in WGS84 (world) coordinates.
  36833. * @param [result] - An optional object to return the input position transformed to window coordinates.
  36834. * @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.
  36835. */
  36836. function wgs84ToWindowCoordinates(scene: Scene, position: Cartesian3, result?: Cartesian2): Cartesian2;
  36837. /**
  36838. * Transforms a position in WGS84 coordinates to drawing buffer coordinates. This may produce different
  36839. * results from SceneTransforms.wgs84ToWindowCoordinates when the browser zoom is not 100%, or on high-DPI displays.
  36840. * @example
  36841. * // Output the window position of longitude/latitude (0, 0) every time the mouse moves.
  36842. * var scene = widget.scene;
  36843. * var ellipsoid = scene.globe.ellipsoid;
  36844. * var position = Cesium.Cartesian3.fromDegrees(0.0, 0.0);
  36845. * var handler = new Cesium.ScreenSpaceEventHandler(scene.canvas);
  36846. * handler.setInputAction(function(movement) {
  36847. * console.log(Cesium.SceneTransforms.wgs84ToWindowCoordinates(scene, position));
  36848. * }, Cesium.ScreenSpaceEventType.MOUSE_MOVE);
  36849. * @param scene - The scene.
  36850. * @param position - The position in WGS84 (world) coordinates.
  36851. * @param [result] - An optional object to return the input position transformed to window coordinates.
  36852. * @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.
  36853. */
  36854. function wgs84ToDrawingBufferCoordinates(scene: Scene, position: Cartesian3, result?: Cartesian2): Cartesian2;
  36855. }
  36856. /**
  36857. * Modifies the camera position and orientation based on mouse input to a canvas.
  36858. * @param scene - The scene.
  36859. */
  36860. export class ScreenSpaceCameraController {
  36861. constructor(scene: Scene);
  36862. /**
  36863. * If true, inputs are allowed conditionally with the flags enableTranslate, enableZoom,
  36864. * enableRotate, enableTilt, and enableLook. If false, all inputs are disabled.
  36865. *
  36866. * NOTE: This setting is for temporary use cases, such as camera flights and
  36867. * drag-selection of regions (see Picking demo). It is typically set to false at the
  36868. * start of such events, and set true on completion. To keep inputs disabled
  36869. * past the end of camera flights, you must use the other booleans (enableTranslate,
  36870. * enableZoom, enableRotate, enableTilt, and enableLook).
  36871. */
  36872. enableInputs: boolean;
  36873. /**
  36874. * If true, allows the user to pan around the map. If false, the camera stays locked at the current position.
  36875. * This flag only applies in 2D and Columbus view modes.
  36876. */
  36877. enableTranslate: boolean;
  36878. /**
  36879. * If true, allows the user to zoom in and out. If false, the camera is locked to the current distance from the ellipsoid.
  36880. */
  36881. enableZoom: boolean;
  36882. /**
  36883. * If true, allows the user to rotate the world which translates the user's position.
  36884. * This flag only applies in 2D and 3D.
  36885. */
  36886. enableRotate: boolean;
  36887. /**
  36888. * If true, allows the user to tilt the camera. If false, the camera is locked to the current heading.
  36889. * This flag only applies in 3D and Columbus view.
  36890. */
  36891. enableTilt: boolean;
  36892. /**
  36893. * If true, allows the user to use free-look. If false, the camera view direction can only be changed through translating
  36894. * or rotating. This flag only applies in 3D and Columbus view modes.
  36895. */
  36896. enableLook: boolean;
  36897. /**
  36898. * A parameter in the range <code>[0, 1)</code> used to determine how long
  36899. * the camera will continue to spin because of inertia.
  36900. * With value of zero, the camera will have no inertia.
  36901. */
  36902. inertiaSpin: number;
  36903. /**
  36904. * A parameter in the range <code>[0, 1)</code> used to determine how long
  36905. * the camera will continue to translate because of inertia.
  36906. * With value of zero, the camera will have no inertia.
  36907. */
  36908. inertiaTranslate: number;
  36909. /**
  36910. * A parameter in the range <code>[0, 1)</code> used to determine how long
  36911. * the camera will continue to zoom because of inertia.
  36912. * With value of zero, the camera will have no inertia.
  36913. */
  36914. inertiaZoom: number;
  36915. /**
  36916. * A parameter in the range <code>[0, 1)</code> used to limit the range
  36917. * of various user inputs to a percentage of the window width/height per animation frame.
  36918. * This helps keep the camera under control in low-frame-rate situations.
  36919. */
  36920. maximumMovementRatio: number;
  36921. /**
  36922. * Sets the duration, in seconds, of the bounce back animations in 2D and Columbus view.
  36923. */
  36924. bounceAnimationTime: number;
  36925. /**
  36926. * The minimum magnitude, in meters, of the camera position when zooming. Defaults to 1.0.
  36927. */
  36928. minimumZoomDistance: number;
  36929. /**
  36930. * The maximum magnitude, in meters, of the camera position when zooming. Defaults to positive infinity.
  36931. */
  36932. maximumZoomDistance: number;
  36933. /**
  36934. * The input that allows the user to pan around the map. This only applies in 2D and Columbus view modes.
  36935. * <p>
  36936. * The type came be a {@link CameraEventType}, <code>undefined</code>, an object with <code>eventType</code>
  36937. * and <code>modifier</code> properties with types <code>CameraEventType</code> and {@link KeyboardEventModifier},
  36938. * or an array of any of the preceding.
  36939. * </p>
  36940. */
  36941. translateEventTypes: CameraEventType | any[] | undefined;
  36942. /**
  36943. * The input that allows the user to zoom in/out.
  36944. * <p>
  36945. * The type came be a {@link CameraEventType}, <code>undefined</code>, an object with <code>eventType</code>
  36946. * and <code>modifier</code> properties with types <code>CameraEventType</code> and {@link KeyboardEventModifier},
  36947. * or an array of any of the preceding.
  36948. * </p>
  36949. */
  36950. zoomEventTypes: CameraEventType | any[] | undefined;
  36951. /**
  36952. * The input that allows the user to rotate around the globe or another object. This only applies in 3D and Columbus view modes.
  36953. * <p>
  36954. * The type came be a {@link CameraEventType}, <code>undefined</code>, an object with <code>eventType</code>
  36955. * and <code>modifier</code> properties with types <code>CameraEventType</code> and {@link KeyboardEventModifier},
  36956. * or an array of any of the preceding.
  36957. * </p>
  36958. */
  36959. rotateEventTypes: CameraEventType | any[] | undefined;
  36960. /**
  36961. * The input that allows the user to tilt in 3D and Columbus view or twist in 2D.
  36962. * <p>
  36963. * The type came be a {@link CameraEventType}, <code>undefined</code>, an object with <code>eventType</code>
  36964. * and <code>modifier</code> properties with types <code>CameraEventType</code> and {@link KeyboardEventModifier},
  36965. * or an array of any of the preceding.
  36966. * </p>
  36967. */
  36968. tiltEventTypes: CameraEventType | any[] | undefined;
  36969. /**
  36970. * The input that allows the user to change the direction the camera is viewing. This only applies in 3D and Columbus view modes.
  36971. * <p>
  36972. * The type came be a {@link CameraEventType}, <code>undefined</code>, an object with <code>eventType</code>
  36973. * and <code>modifier</code> properties with types <code>CameraEventType</code> and {@link KeyboardEventModifier},
  36974. * or an array of any of the preceding.
  36975. * </p>
  36976. */
  36977. lookEventTypes: CameraEventType | any[] | undefined;
  36978. /**
  36979. * The minimum height the camera must be before picking the terrain instead of the ellipsoid.
  36980. */
  36981. minimumPickingTerrainHeight: number;
  36982. /**
  36983. * The minimum height the camera must be before testing for collision with terrain.
  36984. */
  36985. minimumCollisionTerrainHeight: number;
  36986. /**
  36987. * The minimum height the camera must be before switching from rotating a track ball to
  36988. * free look when clicks originate on the sky or in space.
  36989. */
  36990. minimumTrackBallHeight: number;
  36991. /**
  36992. * Enables or disables camera collision detection with terrain.
  36993. */
  36994. enableCollisionDetection: boolean;
  36995. /**
  36996. * Returns true if this object was destroyed; otherwise, false.
  36997. * <br /><br />
  36998. * If this object was destroyed, it should not be used; calling any function other than
  36999. * <code>isDestroyed</code> will result in a {@link DeveloperError} exception.
  37000. * @returns <code>true</code> if this object was destroyed; otherwise, <code>false</code>.
  37001. */
  37002. isDestroyed(): boolean;
  37003. /**
  37004. * Removes mouse listeners held by this object.
  37005. * <br /><br />
  37006. * Once an object is destroyed, it should not be used; calling any function other than
  37007. * <code>isDestroyed</code> will result in a {@link DeveloperError} exception. Therefore,
  37008. * assign the return value (<code>undefined</code>) to the object as done in the example.
  37009. * @example
  37010. * controller = controller && controller.destroy();
  37011. */
  37012. destroy(): void;
  37013. }
  37014. /**
  37015. * Use {@link Viewer#shadowMap} to get the scene's shadow map. Do not construct this directly.
  37016. *
  37017. * <p>
  37018. * The normalOffset bias pushes the shadows forward slightly, and may be disabled
  37019. * for applications that require ultra precise shadows.
  37020. * </p>
  37021. * @param options - An object containing the following properties:
  37022. * @param options.lightCamera - A camera representing the light source.
  37023. * @param [options.enabled = true] - Whether the shadow map is enabled.
  37024. * @param [options.isPointLight = false] - Whether the light source is a point light. Point light shadows do not use cascades.
  37025. * @param [options.pointLightRadius = 100.0] - Radius of the point light.
  37026. * @param [options.cascadesEnabled = true] - Use multiple shadow maps to cover different partitions of the view frustum.
  37027. * @param [options.numberOfCascades = 4] - The number of cascades to use for the shadow map. Supported values are one and four.
  37028. * @param [options.maximumDistance = 5000.0] - The maximum distance used for generating cascaded shadows. Lower values improve shadow quality.
  37029. * @param [options.size = 2048] - The width and height, in pixels, of each shadow map.
  37030. * @param [options.softShadows = false] - Whether percentage-closer-filtering is enabled for producing softer shadows.
  37031. * @param [options.darkness = 0.3] - The shadow darkness.
  37032. * @param [options.normalOffset = true] - Whether a normal bias is applied to shadows.
  37033. */
  37034. export class ShadowMap {
  37035. constructor(options: {
  37036. lightCamera: Camera;
  37037. enabled?: boolean;
  37038. isPointLight?: boolean;
  37039. pointLightRadius?: boolean;
  37040. cascadesEnabled?: boolean;
  37041. numberOfCascades?: number;
  37042. maximumDistance?: number;
  37043. size?: number;
  37044. softShadows?: boolean;
  37045. darkness?: number;
  37046. normalOffset?: boolean;
  37047. });
  37048. /**
  37049. * Determines the darkness of the shadows.
  37050. */
  37051. darkness: number;
  37052. /**
  37053. * Determines the maximum distance of the shadow map. Only applicable for cascaded shadows. Larger distances may result in lower quality shadows.
  37054. */
  37055. maximumDistance: number;
  37056. /**
  37057. * Determines if the shadow map will be shown.
  37058. */
  37059. enabled: boolean;
  37060. /**
  37061. * Determines if a normal bias will be applied to shadows.
  37062. */
  37063. normalOffset: boolean;
  37064. /**
  37065. * Determines if soft shadows are enabled. Uses pcf filtering which requires more texture reads and may hurt performance.
  37066. */
  37067. softShadows: boolean;
  37068. /**
  37069. * The width and height, in pixels, of each shadow map.
  37070. */
  37071. size: number;
  37072. }
  37073. /**
  37074. * Specifies whether the object casts or receives shadows from light sources when
  37075. * shadows are enabled.
  37076. */
  37077. export enum ShadowMode {
  37078. /**
  37079. * The object does not cast or receive shadows.
  37080. */
  37081. DISABLED = 0,
  37082. /**
  37083. * The object casts and receives shadows.
  37084. */
  37085. ENABLED = 1,
  37086. /**
  37087. * The object casts shadows only.
  37088. */
  37089. CAST_ONLY = 2,
  37090. /**
  37091. * The object receives shadows only.
  37092. */
  37093. RECEIVE_ONLY = 3
  37094. }
  37095. export namespace SingleTileImageryProvider {
  37096. /**
  37097. * Initialization options for the SingleTileImageryProvider constructor
  37098. * @property url - The url for the tile.
  37099. * @property [rectangle = Rectangle.MAX_VALUE] - The rectangle, in radians, covered by the image.
  37100. * @property [credit] - A credit for the data source, which is displayed on the canvas.
  37101. * @property [ellipsoid] - The ellipsoid. If not specified, the WGS84 ellipsoid is used.
  37102. */
  37103. type ConstructorOptions = {
  37104. url: Resource | string;
  37105. rectangle?: Rectangle;
  37106. credit?: Credit | string;
  37107. ellipsoid?: Ellipsoid;
  37108. };
  37109. }
  37110. /**
  37111. * Provides a single, top-level imagery tile. The single image is assumed to use a
  37112. * {@link GeographicTilingScheme}.
  37113. * @param options - Object describing initialization options
  37114. */
  37115. export class SingleTileImageryProvider {
  37116. constructor(options: SingleTileImageryProvider.ConstructorOptions);
  37117. /**
  37118. * The default alpha blending value of this provider, with 0.0 representing fully transparent and
  37119. * 1.0 representing fully opaque.
  37120. */
  37121. defaultAlpha: number | undefined;
  37122. /**
  37123. * The default alpha blending value on the night side of the globe of this provider, with 0.0 representing fully transparent and
  37124. * 1.0 representing fully opaque.
  37125. */
  37126. defaultNightAlpha: number | undefined;
  37127. /**
  37128. * The default alpha blending value on the day side of the globe of this provider, with 0.0 representing fully transparent and
  37129. * 1.0 representing fully opaque.
  37130. */
  37131. defaultDayAlpha: number | undefined;
  37132. /**
  37133. * The default brightness of this provider. 1.0 uses the unmodified imagery color. Less than 1.0
  37134. * makes the imagery darker while greater than 1.0 makes it brighter.
  37135. */
  37136. defaultBrightness: number | undefined;
  37137. /**
  37138. * The default contrast of this provider. 1.0 uses the unmodified imagery color. Less than 1.0 reduces
  37139. * the contrast while greater than 1.0 increases it.
  37140. */
  37141. defaultContrast: number | undefined;
  37142. /**
  37143. * The default hue of this provider in radians. 0.0 uses the unmodified imagery color.
  37144. */
  37145. defaultHue: number | undefined;
  37146. /**
  37147. * The default saturation of this provider. 1.0 uses the unmodified imagery color. Less than 1.0 reduces the
  37148. * saturation while greater than 1.0 increases it.
  37149. */
  37150. defaultSaturation: number | undefined;
  37151. /**
  37152. * The default gamma correction to apply to this provider. 1.0 uses the unmodified imagery color.
  37153. */
  37154. defaultGamma: number | undefined;
  37155. /**
  37156. * The default texture minification filter to apply to this provider.
  37157. */
  37158. defaultMinificationFilter: TextureMinificationFilter;
  37159. /**
  37160. * The default texture magnification filter to apply to this provider.
  37161. */
  37162. defaultMagnificationFilter: TextureMagnificationFilter;
  37163. /**
  37164. * Gets the URL of the single, top-level imagery tile.
  37165. */
  37166. readonly url: string;
  37167. /**
  37168. * Gets the proxy used by this provider.
  37169. */
  37170. readonly proxy: Proxy;
  37171. /**
  37172. * Gets the width of each tile, in pixels. This function should
  37173. * not be called before {@link SingleTileImageryProvider#ready} returns true.
  37174. */
  37175. readonly tileWidth: number;
  37176. /**
  37177. * Gets the height of each tile, in pixels. This function should
  37178. * not be called before {@link SingleTileImageryProvider#ready} returns true.
  37179. */
  37180. readonly tileHeight: number;
  37181. /**
  37182. * Gets the maximum level-of-detail that can be requested. This function should
  37183. * not be called before {@link SingleTileImageryProvider#ready} returns true.
  37184. */
  37185. readonly maximumLevel: number | undefined;
  37186. /**
  37187. * Gets the minimum level-of-detail that can be requested. This function should
  37188. * not be called before {@link SingleTileImageryProvider#ready} returns true.
  37189. */
  37190. readonly minimumLevel: number;
  37191. /**
  37192. * Gets the tiling scheme used by this provider. This function should
  37193. * not be called before {@link SingleTileImageryProvider#ready} returns true.
  37194. */
  37195. readonly tilingScheme: TilingScheme;
  37196. /**
  37197. * Gets the rectangle, in radians, of the imagery provided by this instance. This function should
  37198. * not be called before {@link SingleTileImageryProvider#ready} returns true.
  37199. */
  37200. readonly rectangle: Rectangle;
  37201. /**
  37202. * Gets the tile discard policy. If not undefined, the discard policy is responsible
  37203. * for filtering out "missing" tiles via its shouldDiscardImage function. If this function
  37204. * returns undefined, no tiles are filtered. This function should
  37205. * not be called before {@link SingleTileImageryProvider#ready} returns true.
  37206. */
  37207. readonly tileDiscardPolicy: TileDiscardPolicy;
  37208. /**
  37209. * Gets an event that is raised when the imagery provider encounters an asynchronous error. By subscribing
  37210. * to the event, you will be notified of the error and can potentially recover from it. Event listeners
  37211. * are passed an instance of {@link TileProviderError}.
  37212. */
  37213. readonly errorEvent: Event;
  37214. /**
  37215. * Gets a value indicating whether or not the provider is ready for use.
  37216. */
  37217. readonly ready: boolean;
  37218. /**
  37219. * Gets a promise that resolves to true when the provider is ready for use.
  37220. */
  37221. readonly readyPromise: Promise<boolean>;
  37222. /**
  37223. * Gets the credit to display when this imagery provider is active. Typically this is used to credit
  37224. * the source of the imagery. This function should not be called before {@link SingleTileImageryProvider#ready} returns true.
  37225. */
  37226. readonly credit: Credit;
  37227. /**
  37228. * Gets a value indicating whether or not the images provided by this imagery provider
  37229. * include an alpha channel. If this property is false, an alpha channel, if present, will
  37230. * be ignored. If this property is true, any images without an alpha channel will be treated
  37231. * as if their alpha is 1.0 everywhere. When this property is false, memory usage
  37232. * and texture upload time are reduced.
  37233. */
  37234. readonly hasAlphaChannel: boolean;
  37235. /**
  37236. * Gets the credits to be displayed when a given tile is displayed.
  37237. * @param x - The tile X coordinate.
  37238. * @param y - The tile Y coordinate.
  37239. * @param level - The tile level;
  37240. * @returns The credits to be displayed when the tile is displayed.
  37241. */
  37242. getTileCredits(x: number, y: number, level: number): Credit[];
  37243. /**
  37244. * Requests the image for a given tile. This function should
  37245. * not be called before {@link SingleTileImageryProvider#ready} returns true.
  37246. * @param x - The tile X coordinate.
  37247. * @param y - The tile Y coordinate.
  37248. * @param level - The tile level.
  37249. * @param [request] - The request object. Intended for internal use only.
  37250. * @returns A promise for the image that will resolve when the image is available, or
  37251. * undefined if there are too many active requests to the server, and the request
  37252. * should be retried later. The resolved image may be either an
  37253. * Image or a Canvas DOM object.
  37254. */
  37255. requestImage(x: number, y: number, level: number, request?: Request): Promise<HTMLImageElement | HTMLCanvasElement> | undefined;
  37256. /**
  37257. * Picking features is not currently supported by this imagery provider, so this function simply returns
  37258. * undefined.
  37259. * @param x - The tile X coordinate.
  37260. * @param y - The tile Y coordinate.
  37261. * @param level - The tile level.
  37262. * @param longitude - The longitude at which to pick features.
  37263. * @param latitude - The latitude at which to pick features.
  37264. * @returns A promise for the picked features that will resolve when the asynchronous
  37265. * picking completes. The resolved value is an array of {@link ImageryLayerFeatureInfo}
  37266. * instances. The array may be empty if no features are found at the given location.
  37267. * It may also be undefined if picking is not supported.
  37268. */
  37269. pickFeatures(x: number, y: number, level: number, longitude: number, latitude: number): Promise<ImageryLayerFeatureInfo[]> | undefined;
  37270. }
  37271. /**
  37272. * An atmosphere drawn around the limb of the provided ellipsoid. Based on
  37273. * {@link https://developer.nvidia.com/gpugems/GPUGems2/gpugems2_chapter16.html|Accurate Atmospheric Scattering}
  37274. * in GPU Gems 2.
  37275. * <p>
  37276. * This is only supported in 3D. Atmosphere is faded out when morphing to 2D or Columbus view.
  37277. * </p>
  37278. * @example
  37279. * scene.skyAtmosphere = new Cesium.SkyAtmosphere();
  37280. * @param [ellipsoid = Ellipsoid.WGS84] - The ellipsoid that the atmosphere is drawn around.
  37281. */
  37282. export class SkyAtmosphere {
  37283. constructor(ellipsoid?: Ellipsoid);
  37284. /**
  37285. * Determines if the atmosphere is shown.
  37286. */
  37287. show: boolean;
  37288. /**
  37289. * Compute atmosphere per-fragment instead of per-vertex.
  37290. * This produces better looking atmosphere with a slight performance penalty.
  37291. */
  37292. perFragmentAtmosphere: boolean;
  37293. /**
  37294. * The hue shift to apply to the atmosphere. Defaults to 0.0 (no shift).
  37295. * A hue shift of 1.0 indicates a complete rotation of the hues available.
  37296. */
  37297. hueShift: number;
  37298. /**
  37299. * The saturation shift to apply to the atmosphere. Defaults to 0.0 (no shift).
  37300. * A saturation shift of -1.0 is monochrome.
  37301. */
  37302. saturationShift: number;
  37303. /**
  37304. * The brightness shift to apply to the atmosphere. Defaults to 0.0 (no shift).
  37305. * A brightness shift of -1.0 is complete darkness, which will let space show through.
  37306. */
  37307. brightnessShift: number;
  37308. /**
  37309. * Gets the ellipsoid the atmosphere is drawn around.
  37310. */
  37311. readonly ellipsoid: Ellipsoid;
  37312. /**
  37313. * Returns true if this object was destroyed; otherwise, false.
  37314. * <br /><br />
  37315. * If this object was destroyed, it should not be used; calling any function other than
  37316. * <code>isDestroyed</code> will result in a {@link DeveloperError} exception.
  37317. * @returns <code>true</code> if this object was destroyed; otherwise, <code>false</code>.
  37318. */
  37319. isDestroyed(): boolean;
  37320. /**
  37321. * Destroys the WebGL resources held by this object. Destroying an object allows for deterministic
  37322. * release of WebGL resources, instead of relying on the garbage collector to destroy this object.
  37323. * <br /><br />
  37324. * Once an object is destroyed, it should not be used; calling any function other than
  37325. * <code>isDestroyed</code> will result in a {@link DeveloperError} exception. Therefore,
  37326. * assign the return value (<code>undefined</code>) to the object as done in the example.
  37327. * @example
  37328. * skyAtmosphere = skyAtmosphere && skyAtmosphere.destroy();
  37329. */
  37330. destroy(): void;
  37331. }
  37332. /**
  37333. * A sky box around the scene to draw stars. The sky box is defined using the True Equator Mean Equinox (TEME) axes.
  37334. * <p>
  37335. * This is only supported in 3D. The sky box is faded out when morphing to 2D or Columbus view. The size of
  37336. * the sky box must not exceed {@link Scene#maximumCubeMapSize}.
  37337. * </p>
  37338. * @example
  37339. * scene.skyBox = new Cesium.SkyBox({
  37340. * sources : {
  37341. * positiveX : 'skybox_px.png',
  37342. * negativeX : 'skybox_nx.png',
  37343. * positiveY : 'skybox_py.png',
  37344. * negativeY : 'skybox_ny.png',
  37345. * positiveZ : 'skybox_pz.png',
  37346. * negativeZ : 'skybox_nz.png'
  37347. * }
  37348. * });
  37349. * @param options - Object with the following properties:
  37350. * @param [options.sources] - The source URL or <code>Image</code> object for each of the six cube map faces. See the example below.
  37351. * @param [options.show = true] - Determines if this primitive will be shown.
  37352. */
  37353. export class SkyBox {
  37354. constructor(options: {
  37355. sources?: any;
  37356. show?: boolean;
  37357. });
  37358. /**
  37359. * The sources used to create the cube map faces: an object
  37360. * with <code>positiveX</code>, <code>negativeX</code>, <code>positiveY</code>,
  37361. * <code>negativeY</code>, <code>positiveZ</code>, and <code>negativeZ</code> properties.
  37362. * These can be either URLs or <code>Image</code> objects.
  37363. */
  37364. sources: any;
  37365. /**
  37366. * Determines if the sky box will be shown.
  37367. */
  37368. show: boolean;
  37369. /**
  37370. * Called when {@link Viewer} or {@link CesiumWidget} render the scene to
  37371. * get the draw commands needed to render this primitive.
  37372. * <p>
  37373. * Do not call this function directly. This is documented just to
  37374. * list the exceptions that may be propagated when the scene is rendered:
  37375. * </p>
  37376. */
  37377. update(): void;
  37378. /**
  37379. * Returns true if this object was destroyed; otherwise, false.
  37380. * <br /><br />
  37381. * If this object was destroyed, it should not be used; calling any function other than
  37382. * <code>isDestroyed</code> will result in a {@link DeveloperError} exception.
  37383. * @returns <code>true</code> if this object was destroyed; otherwise, <code>false</code>.
  37384. */
  37385. isDestroyed(): boolean;
  37386. /**
  37387. * Destroys the WebGL resources held by this object. Destroying an object allows for deterministic
  37388. * release of WebGL resources, instead of relying on the garbage collector to destroy this object.
  37389. * <br /><br />
  37390. * Once an object is destroyed, it should not be used; calling any function other than
  37391. * <code>isDestroyed</code> will result in a {@link DeveloperError} exception. Therefore,
  37392. * assign the return value (<code>undefined</code>) to the object as done in the example.
  37393. * @example
  37394. * skyBox = skyBox && skyBox.destroy();
  37395. */
  37396. destroy(): void;
  37397. }
  37398. /**
  37399. * A ParticleEmitter that emits particles within a sphere.
  37400. * Particles will be positioned randomly within the sphere and have initial velocities emanating from the center of the sphere.
  37401. * @param [radius = 1.0] - The radius of the sphere in meters.
  37402. */
  37403. export class SphereEmitter {
  37404. constructor(radius?: number);
  37405. /**
  37406. * The radius of the sphere in meters.
  37407. */
  37408. radius: number;
  37409. }
  37410. /**
  37411. * Determines the function used to compare stencil values for the stencil test.
  37412. */
  37413. export enum StencilFunction {
  37414. /**
  37415. * The stencil test never passes.
  37416. */
  37417. NEVER = WebGLConstants.NEVER,
  37418. /**
  37419. * The stencil test passes when the masked reference value is less than the masked stencil value.
  37420. */
  37421. LESS = WebGLConstants.LESS,
  37422. /**
  37423. * The stencil test passes when the masked reference value is equal to the masked stencil value.
  37424. */
  37425. EQUAL = WebGLConstants.EQUAL,
  37426. /**
  37427. * The stencil test passes when the masked reference value is less than or equal to the masked stencil value.
  37428. */
  37429. LESS_OR_EQUAL = WebGLConstants.LEQUAL,
  37430. /**
  37431. * The stencil test passes when the masked reference value is greater than the masked stencil value.
  37432. */
  37433. GREATER = WebGLConstants.GREATER,
  37434. /**
  37435. * The stencil test passes when the masked reference value is not equal to the masked stencil value.
  37436. */
  37437. NOT_EQUAL = WebGLConstants.NOTEQUAL,
  37438. /**
  37439. * The stencil test passes when the masked reference value is greater than or equal to the masked stencil value.
  37440. */
  37441. GREATER_OR_EQUAL = WebGLConstants.GEQUAL,
  37442. /**
  37443. * The stencil test always passes.
  37444. */
  37445. ALWAYS = WebGLConstants.ALWAYS
  37446. }
  37447. /**
  37448. * Determines the action taken based on the result of the stencil test.
  37449. */
  37450. export enum StencilOperation {
  37451. /**
  37452. * Sets the stencil buffer value to zero.
  37453. */
  37454. ZERO = WebGLConstants.ZERO,
  37455. /**
  37456. * Does not change the stencil buffer.
  37457. */
  37458. KEEP = WebGLConstants.KEEP,
  37459. /**
  37460. * Replaces the stencil buffer value with the reference value.
  37461. */
  37462. REPLACE = WebGLConstants.REPLACE,
  37463. /**
  37464. * Increments the stencil buffer value, clamping to unsigned byte.
  37465. */
  37466. INCREMENT = WebGLConstants.INCR,
  37467. /**
  37468. * Decrements the stencil buffer value, clamping to zero.
  37469. */
  37470. DECREMENT = WebGLConstants.DECR,
  37471. /**
  37472. * Bitwise inverts the existing stencil buffer value.
  37473. */
  37474. INVERT = WebGLConstants.INVERT,
  37475. /**
  37476. * Increments the stencil buffer value, wrapping to zero when exceeding the unsigned byte range.
  37477. */
  37478. INCREMENT_WRAP = WebGLConstants.INCR_WRAP,
  37479. /**
  37480. * Decrements the stencil buffer value, wrapping to the maximum unsigned byte instead of going below zero.
  37481. */
  37482. DECREMENT_WRAP = WebGLConstants.DECR_WRAP
  37483. }
  37484. /**
  37485. * An expression for a style applied to a {@link Cesium3DTileset}.
  37486. * <p>
  37487. * Derived classes of this interface evaluate expressions in the
  37488. * {@link https://github.com/CesiumGS/3d-tiles/tree/master/specification/Styling|3D Tiles Styling language}.
  37489. * </p>
  37490. * <p>
  37491. * This type describes an interface and is not intended to be instantiated directly.
  37492. * </p>
  37493. */
  37494. export class StyleExpression {
  37495. constructor();
  37496. /**
  37497. * Evaluates the result of an expression, optionally using the provided feature's properties. If the result of
  37498. * the expression in the
  37499. * {@link https://github.com/CesiumGS/3d-tiles/tree/master/specification/Styling|3D Tiles Styling language}
  37500. * is of type <code>Boolean</code>, <code>Number</code>, or <code>String</code>, the corresponding JavaScript
  37501. * primitive type will be returned. If the result is a <code>RegExp</code>, a Javascript <code>RegExp</code>
  37502. * object will be returned. If the result is a <code>Cartesian2</code>, <code>Cartesian3</code>, or <code>Cartesian4</code>,
  37503. * a {@link Cartesian2}, {@link Cartesian3}, or {@link Cartesian4} object will be returned. If the <code>result</code> argument is
  37504. * a {@link Color}, the {@link Cartesian4} value is converted to a {@link Color} and then returned.
  37505. * @param feature - The feature whose properties may be used as variables in the expression.
  37506. * @param [result] - The object onto which to store the result.
  37507. * @returns The result of evaluating the expression.
  37508. */
  37509. evaluate(feature: Cesium3DTileFeature, result?: any): boolean | number | string | RegExp | Cartesian2 | Cartesian3 | Cartesian4 | Color;
  37510. /**
  37511. * Evaluates the result of a Color expression, optionally using the provided feature's properties.
  37512. * <p>
  37513. * This is equivalent to {@link StyleExpression#evaluate} but always returns a {@link Color} object.
  37514. * </p>
  37515. * @param feature - The feature whose properties may be used as variables in the expression.
  37516. * @param [result] - The object in which to store the result.
  37517. * @returns The modified result parameter or a new Color instance if one was not provided.
  37518. */
  37519. evaluateColor(feature: Cesium3DTileFeature, result?: Color): Color;
  37520. }
  37521. /**
  37522. * Draws a sun billboard.
  37523. * <p>This is only supported in 3D and Columbus view.</p>
  37524. * @example
  37525. * scene.sun = new Cesium.Sun();
  37526. */
  37527. export class Sun {
  37528. constructor();
  37529. /**
  37530. * Determines if the sun will be shown.
  37531. */
  37532. show: boolean;
  37533. /**
  37534. * Gets or sets a number that controls how "bright" the Sun's lens flare appears
  37535. * to be. Zero shows just the Sun's disc without any flare.
  37536. * Use larger values for a more pronounced flare around the Sun.
  37537. */
  37538. glowFactor: number;
  37539. /**
  37540. * Returns true if this object was destroyed; otherwise, false.
  37541. * <br /><br />
  37542. * If this object was destroyed, it should not be used; calling any function other than
  37543. * <code>isDestroyed</code> will result in a {@link DeveloperError} exception.
  37544. * @returns <code>true</code> if this object was destroyed; otherwise, <code>false</code>.
  37545. */
  37546. isDestroyed(): boolean;
  37547. /**
  37548. * Destroys the WebGL resources held by this object. Destroying an object allows for deterministic
  37549. * release of WebGL resources, instead of relying on the garbage collector to destroy this object.
  37550. * <br /><br />
  37551. * Once an object is destroyed, it should not be used; calling any function other than
  37552. * <code>isDestroyed</code> will result in a {@link DeveloperError} exception. Therefore,
  37553. * assign the return value (<code>undefined</code>) to the object as done in the example.
  37554. * @example
  37555. * sun = sun && sun.destroy();
  37556. *
  37557. *
  37558. */
  37559. destroy(): void;
  37560. }
  37561. /**
  37562. * A directional light source that originates from the Sun.
  37563. * @param [options] - Object with the following properties:
  37564. * @param [options.color = Color.WHITE] - The light's color.
  37565. * @param [options.intensity = 2.0] - The light's intensity.
  37566. */
  37567. export class SunLight {
  37568. constructor(options?: {
  37569. color?: Color;
  37570. intensity?: number;
  37571. });
  37572. /**
  37573. * The color of the light.
  37574. */
  37575. color: Color;
  37576. /**
  37577. * The intensity of the light.
  37578. */
  37579. intensity: number;
  37580. }
  37581. export namespace TileCoordinatesImageryProvider {
  37582. /**
  37583. * Initialization options for the TileCoordinatesImageryProvider constructor
  37584. * @property [tilingScheme = new GeographicTilingScheme()] - The tiling scheme for which to draw tiles.
  37585. * @property [ellipsoid] - The ellipsoid. If the tilingScheme is specified,
  37586. * this parameter is ignored and the tiling scheme's ellipsoid is used instead. If neither
  37587. * parameter is specified, the WGS84 ellipsoid is used.
  37588. * @property [color = Color.YELLOW] - The color to draw the tile box and label.
  37589. * @property [tileWidth = 256] - The width of the tile for level-of-detail selection purposes.
  37590. * @property [tileHeight = 256] - The height of the tile for level-of-detail selection purposes.
  37591. */
  37592. type ConstructorOptions = {
  37593. tilingScheme?: TilingScheme;
  37594. ellipsoid?: Ellipsoid;
  37595. color?: Color;
  37596. tileWidth?: number;
  37597. tileHeight?: number;
  37598. };
  37599. }
  37600. /**
  37601. * An {@link ImageryProvider} that draws a box around every rendered tile in the tiling scheme, and draws
  37602. * a label inside it indicating the X, Y, Level coordinates of the tile. This is mostly useful for
  37603. * debugging terrain and imagery rendering problems.
  37604. * @param [options] - Object describing initialization options
  37605. */
  37606. export class TileCoordinatesImageryProvider {
  37607. constructor(options?: TileCoordinatesImageryProvider.ConstructorOptions);
  37608. /**
  37609. * The default alpha blending value of this provider, with 0.0 representing fully transparent and
  37610. * 1.0 representing fully opaque.
  37611. */
  37612. defaultAlpha: number | undefined;
  37613. /**
  37614. * The default alpha blending value on the night side of the globe of this provider, with 0.0 representing fully transparent and
  37615. * 1.0 representing fully opaque.
  37616. */
  37617. defaultNightAlpha: number | undefined;
  37618. /**
  37619. * The default alpha blending value on the day side of the globe of this provider, with 0.0 representing fully transparent and
  37620. * 1.0 representing fully opaque.
  37621. */
  37622. defaultDayAlpha: number | undefined;
  37623. /**
  37624. * The default brightness of this provider. 1.0 uses the unmodified imagery color. Less than 1.0
  37625. * makes the imagery darker while greater than 1.0 makes it brighter.
  37626. */
  37627. defaultBrightness: number | undefined;
  37628. /**
  37629. * The default contrast of this provider. 1.0 uses the unmodified imagery color. Less than 1.0 reduces
  37630. * the contrast while greater than 1.0 increases it.
  37631. */
  37632. defaultContrast: number | undefined;
  37633. /**
  37634. * The default hue of this provider in radians. 0.0 uses the unmodified imagery color.
  37635. */
  37636. defaultHue: number | undefined;
  37637. /**
  37638. * The default saturation of this provider. 1.0 uses the unmodified imagery color. Less than 1.0 reduces the
  37639. * saturation while greater than 1.0 increases it.
  37640. */
  37641. defaultSaturation: number | undefined;
  37642. /**
  37643. * The default gamma correction to apply to this provider. 1.0 uses the unmodified imagery color.
  37644. */
  37645. defaultGamma: number | undefined;
  37646. /**
  37647. * The default texture minification filter to apply to this provider.
  37648. */
  37649. defaultMinificationFilter: TextureMinificationFilter;
  37650. /**
  37651. * The default texture magnification filter to apply to this provider.
  37652. */
  37653. defaultMagnificationFilter: TextureMagnificationFilter;
  37654. /**
  37655. * Gets the proxy used by this provider.
  37656. */
  37657. readonly proxy: Proxy;
  37658. /**
  37659. * Gets the width of each tile, in pixels. This function should
  37660. * not be called before {@link TileCoordinatesImageryProvider#ready} returns true.
  37661. */
  37662. readonly tileWidth: number;
  37663. /**
  37664. * Gets the height of each tile, in pixels. This function should
  37665. * not be called before {@link TileCoordinatesImageryProvider#ready} returns true.
  37666. */
  37667. readonly tileHeight: number;
  37668. /**
  37669. * Gets the maximum level-of-detail that can be requested. This function should
  37670. * not be called before {@link TileCoordinatesImageryProvider#ready} returns true.
  37671. */
  37672. readonly maximumLevel: number | undefined;
  37673. /**
  37674. * Gets the minimum level-of-detail that can be requested. This function should
  37675. * not be called before {@link TileCoordinatesImageryProvider#ready} returns true.
  37676. */
  37677. readonly minimumLevel: number;
  37678. /**
  37679. * Gets the tiling scheme used by this provider. This function should
  37680. * not be called before {@link TileCoordinatesImageryProvider#ready} returns true.
  37681. */
  37682. readonly tilingScheme: TilingScheme;
  37683. /**
  37684. * Gets the rectangle, in radians, of the imagery provided by this instance. This function should
  37685. * not be called before {@link TileCoordinatesImageryProvider#ready} returns true.
  37686. */
  37687. readonly rectangle: Rectangle;
  37688. /**
  37689. * Gets the tile discard policy. If not undefined, the discard policy is responsible
  37690. * for filtering out "missing" tiles via its shouldDiscardImage function. If this function
  37691. * returns undefined, no tiles are filtered. This function should
  37692. * not be called before {@link TileCoordinatesImageryProvider#ready} returns true.
  37693. */
  37694. readonly tileDiscardPolicy: TileDiscardPolicy;
  37695. /**
  37696. * Gets an event that is raised when the imagery provider encounters an asynchronous error. By subscribing
  37697. * to the event, you will be notified of the error and can potentially recover from it. Event listeners
  37698. * are passed an instance of {@link TileProviderError}.
  37699. */
  37700. readonly errorEvent: Event;
  37701. /**
  37702. * Gets a value indicating whether or not the provider is ready for use.
  37703. */
  37704. readonly ready: boolean;
  37705. /**
  37706. * Gets a promise that resolves to true when the provider is ready for use.
  37707. */
  37708. readonly readyPromise: Promise<boolean>;
  37709. /**
  37710. * Gets the credit to display when this imagery provider is active. Typically this is used to credit
  37711. * the source of the imagery. This function should not be called before {@link TileCoordinatesImageryProvider#ready} returns true.
  37712. */
  37713. readonly credit: Credit;
  37714. /**
  37715. * Gets a value indicating whether or not the images provided by this imagery provider
  37716. * include an alpha channel. If this property is false, an alpha channel, if present, will
  37717. * be ignored. If this property is true, any images without an alpha channel will be treated
  37718. * as if their alpha is 1.0 everywhere. Setting this property to false reduces memory usage
  37719. * and texture upload time.
  37720. */
  37721. readonly hasAlphaChannel: boolean;
  37722. /**
  37723. * Gets the credits to be displayed when a given tile is displayed.
  37724. * @param x - The tile X coordinate.
  37725. * @param y - The tile Y coordinate.
  37726. * @param level - The tile level;
  37727. * @returns The credits to be displayed when the tile is displayed.
  37728. */
  37729. getTileCredits(x: number, y: number, level: number): Credit[];
  37730. /**
  37731. * Requests the image for a given tile. This function should
  37732. * not be called before {@link TileCoordinatesImageryProvider#ready} returns true.
  37733. * @param x - The tile X coordinate.
  37734. * @param y - The tile Y coordinate.
  37735. * @param level - The tile level.
  37736. * @param [request] - The request object. Intended for internal use only.
  37737. * @returns A promise for the image that will resolve when the image is available, or
  37738. * undefined if there are too many active requests to the server, and the request
  37739. * should be retried later. The resolved image may be either an
  37740. * Image or a Canvas DOM object.
  37741. */
  37742. requestImage(x: number, y: number, level: number, request?: Request): Promise<HTMLImageElement | HTMLCanvasElement> | undefined;
  37743. /**
  37744. * Picking features is not currently supported by this imagery provider, so this function simply returns
  37745. * undefined.
  37746. * @param x - The tile X coordinate.
  37747. * @param y - The tile Y coordinate.
  37748. * @param level - The tile level.
  37749. * @param longitude - The longitude at which to pick features.
  37750. * @param latitude - The latitude at which to pick features.
  37751. * @returns A promise for the picked features that will resolve when the asynchronous
  37752. * picking completes. The resolved value is an array of {@link ImageryLayerFeatureInfo}
  37753. * instances. The array may be empty if no features are found at the given location.
  37754. * It may also be undefined if picking is not supported.
  37755. */
  37756. pickFeatures(x: number, y: number, level: number, longitude: number, latitude: number): Promise<ImageryLayerFeatureInfo[]> | undefined;
  37757. }
  37758. /**
  37759. * A policy for discarding tile images according to some criteria. This type describes an
  37760. * interface and is not intended to be instantiated directly.
  37761. */
  37762. export class TileDiscardPolicy {
  37763. constructor();
  37764. /**
  37765. * Determines if the discard policy is ready to process images.
  37766. * @returns True if the discard policy is ready to process images; otherwise, false.
  37767. */
  37768. isReady(): boolean;
  37769. /**
  37770. * Given a tile image, decide whether to discard that image.
  37771. * @param image - An image to test.
  37772. * @returns True if the image should be discarded; otherwise, false.
  37773. */
  37774. shouldDiscardImage(image: HTMLImageElement): boolean;
  37775. }
  37776. export namespace TileMapServiceImageryProvider {
  37777. /**
  37778. * Initialization options for the TileMapServiceImageryProvider constructor
  37779. * @property [url = '.'] - Path to image tiles on server.
  37780. * @property [fileExtension = 'png'] - The file extension for images on the server.
  37781. * @property [credit = ''] - A credit for the data source, which is displayed on the canvas.
  37782. * @property [minimumLevel = 0] - The minimum level-of-detail supported by the imagery provider. Take care when specifying
  37783. * this that the number of tiles at the minimum level is small, such as four or less. A larger number is likely
  37784. * to result in rendering problems.
  37785. * @property [maximumLevel] - The maximum level-of-detail supported by the imagery provider, or undefined if there is no limit.
  37786. * @property [rectangle = Rectangle.MAX_VALUE] - The rectangle, in radians, covered by the image.
  37787. * @property [tilingScheme] - The tiling scheme specifying how the ellipsoidal
  37788. * surface is broken into tiles. If this parameter is not provided, a {@link WebMercatorTilingScheme}
  37789. * is used.
  37790. * @property [ellipsoid] - The ellipsoid. If the tilingScheme is specified,
  37791. * this parameter is ignored and the tiling scheme's ellipsoid is used instead. If neither
  37792. * parameter is specified, the WGS84 ellipsoid is used.
  37793. * @property [tileWidth = 256] - Pixel width of image tiles.
  37794. * @property [tileHeight = 256] - Pixel height of image tiles.
  37795. * @property [flipXY] - Older versions of gdal2tiles.py flipped X and Y values in tilemapresource.xml.
  37796. * Specifying this option will do the same, allowing for loading of these incorrect tilesets.
  37797. */
  37798. type ConstructorOptions = {
  37799. url?: Resource | string | Promise<Resource> | Promise<string>;
  37800. fileExtension?: string;
  37801. credit?: Credit | string;
  37802. minimumLevel?: number;
  37803. maximumLevel?: number;
  37804. rectangle?: Rectangle;
  37805. tilingScheme?: TilingScheme;
  37806. ellipsoid?: Ellipsoid;
  37807. tileWidth?: number;
  37808. tileHeight?: number;
  37809. flipXY?: boolean;
  37810. };
  37811. }
  37812. /**
  37813. * An imagery provider that provides tiled imagery as generated by
  37814. * {@link http://www.maptiler.org/|MapTiler}, {@link http://www.klokan.cz/projects/gdal2tiles/|GDAL2Tiles}, etc.
  37815. * @example
  37816. * var tms = new Cesium.TileMapServiceImageryProvider({
  37817. * url : '../images/cesium_maptiler/Cesium_Logo_Color',
  37818. * fileExtension: 'png',
  37819. * maximumLevel: 4,
  37820. * rectangle: new Cesium.Rectangle(
  37821. * Cesium.Math.toRadians(-120.0),
  37822. * Cesium.Math.toRadians(20.0),
  37823. * Cesium.Math.toRadians(-60.0),
  37824. * Cesium.Math.toRadians(40.0))
  37825. * });
  37826. * @param options - Object describing initialization options
  37827. */
  37828. export class TileMapServiceImageryProvider extends UrlTemplateImageryProvider {
  37829. constructor(options: TileMapServiceImageryProvider.ConstructorOptions);
  37830. }
  37831. /**
  37832. * Provides functionality for ImageryProviders that have time dynamic imagery
  37833. * @param options - Object with the following properties:
  37834. * @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.
  37835. * @param options.times - TimeIntervalCollection with its <code>data</code> property being an object containing time dynamic dimension and their values.
  37836. * @param options.requestImageFunction - A function that will request imagery tiles.
  37837. * @param options.reloadFunction - A function that will be called when all imagery tiles need to be reloaded.
  37838. */
  37839. export class TimeDynamicImagery {
  37840. constructor(options: {
  37841. clock: Clock;
  37842. times: TimeIntervalCollection;
  37843. requestImageFunction: (...params: any[]) => any;
  37844. reloadFunction: (...params: any[]) => any;
  37845. });
  37846. /**
  37847. * Gets or sets a clock that is used to get keep the time used for time dynamic parameters.
  37848. */
  37849. clock: Clock;
  37850. /**
  37851. * Gets or sets a time interval collection.
  37852. */
  37853. times: TimeIntervalCollection;
  37854. /**
  37855. * Gets the current interval.
  37856. */
  37857. currentInterval: TimeInterval;
  37858. /**
  37859. * Gets the tile from the cache if its available.
  37860. * @param x - The tile X coordinate.
  37861. * @param y - The tile Y coordinate.
  37862. * @param level - The tile level.
  37863. * @param [request] - The request object. Intended for internal use only.
  37864. * @returns A promise for the image that will resolve when the image is available, or
  37865. * undefined if the tile is not in the cache.
  37866. */
  37867. getFromCache(x: number, y: number, level: number, request?: Request): Promise<HTMLImageElement> | undefined;
  37868. /**
  37869. * Checks if the next interval is approaching and will start preload the tile if necessary. Otherwise it will
  37870. * just add the tile to a list to preload when we approach the next interval.
  37871. * @param x - The tile X coordinate.
  37872. * @param y - The tile Y coordinate.
  37873. * @param level - The tile level.
  37874. * @param [request] - The request object. Intended for internal use only.
  37875. */
  37876. checkApproachingInterval(x: number, y: number, level: number, request?: Request): void;
  37877. }
  37878. /**
  37879. * Provides playback of time-dynamic point cloud data.
  37880. * <p>
  37881. * Point cloud frames are prefetched in intervals determined by the average frame load time and the current clock speed.
  37882. * If intermediate frames cannot be loaded in time to meet playback speed, they will be skipped. If frames are sufficiently
  37883. * small or the clock is sufficiently slow then no frames will be skipped.
  37884. * </p>
  37885. * @param options - Object with the following properties:
  37886. * @param options.clock - A {@link Clock} instance that is used when determining the value for the time dimension.
  37887. * @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>.
  37888. * @param [options.show = true] - Determines if the point cloud will be shown.
  37889. * @param [options.modelMatrix = Matrix4.IDENTITY] - A 4x4 transformation matrix that transforms the point cloud.
  37890. * @param [options.shadows = ShadowMode.ENABLED] - Determines whether the point cloud casts or receives shadows from light sources.
  37891. * @param [options.maximumMemoryUsage = 256] - The maximum amount of memory in MB that can be used by the point cloud.
  37892. * @param [options.shading] - Options for constructing a {@link PointCloudShading} object to control point attenuation and eye dome lighting.
  37893. * @param [options.style] - The style, defined using the {@link https://github.com/CesiumGS/3d-tiles/tree/master/specification/Styling|3D Tiles Styling language}, applied to each point in the point cloud.
  37894. * @param [options.clippingPlanes] - The {@link ClippingPlaneCollection} used to selectively disable rendering the point cloud.
  37895. */
  37896. export class TimeDynamicPointCloud {
  37897. constructor(options: {
  37898. clock: Clock;
  37899. intervals: TimeIntervalCollection;
  37900. show?: boolean;
  37901. modelMatrix?: Matrix4;
  37902. shadows?: ShadowMode;
  37903. maximumMemoryUsage?: number;
  37904. shading?: any;
  37905. style?: Cesium3DTileStyle;
  37906. clippingPlanes?: ClippingPlaneCollection;
  37907. });
  37908. /**
  37909. * Determines if the point cloud will be shown.
  37910. */
  37911. show: boolean;
  37912. /**
  37913. * A 4x4 transformation matrix that transforms the point cloud.
  37914. */
  37915. modelMatrix: Matrix4;
  37916. /**
  37917. * Determines whether the point cloud casts or receives shadows from light sources.
  37918. * <p>
  37919. * 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.
  37920. * </p>
  37921. * <p>
  37922. * Shadows are rendered only when {@link Viewer#shadows} is <code>true</code>.
  37923. * </p>
  37924. */
  37925. shadows: ShadowMode;
  37926. /**
  37927. * The maximum amount of GPU memory (in MB) that may be used to cache point cloud frames.
  37928. * <p>
  37929. * Frames that are not being loaded or rendered are unloaded to enforce this.
  37930. * </p>
  37931. * <p>
  37932. * If decreasing this value results in unloading tiles, the tiles are unloaded the next frame.
  37933. * </p>
  37934. */
  37935. maximumMemoryUsage: number;
  37936. /**
  37937. * Options for controlling point size based on geometric error and eye dome lighting.
  37938. */
  37939. shading: PointCloudShading;
  37940. /**
  37941. * The style, defined using the
  37942. * {@link https://github.com/CesiumGS/3d-tiles/tree/master/specification/Styling|3D Tiles Styling language},
  37943. * applied to each point in the point cloud.
  37944. * <p>
  37945. * Assign <code>undefined</code> to remove the style, which will restore the visual
  37946. * appearance of the point cloud to its default when no style was applied.
  37947. * </p>
  37948. * @example
  37949. * pointCloud.style = new Cesium.Cesium3DTileStyle({
  37950. * color : {
  37951. * conditions : [
  37952. * ['${Classification} === 0', 'color("purple", 0.5)'],
  37953. * ['${Classification} === 1', 'color("red")'],
  37954. * ['true', '${COLOR}']
  37955. * ]
  37956. * },
  37957. * show : '${Classification} !== 2'
  37958. * });
  37959. */
  37960. style: Cesium3DTileStyle;
  37961. /**
  37962. * The event fired to indicate that a frame failed to load. A frame may fail to load if the
  37963. * request for its uri fails or processing fails due to invalid content.
  37964. * <p>
  37965. * If there are no event listeners, error messages will be logged to the console.
  37966. * </p>
  37967. * <p>
  37968. * The error object passed to the listener contains two properties:
  37969. * <ul>
  37970. * <li><code>uri</code>: the uri of the failed frame.</li>
  37971. * <li><code>message</code>: the error message.</li>
  37972. * </ul>
  37973. * @example
  37974. * pointCloud.frameFailed.addEventListener(function(error) {
  37975. * console.log('An error occurred loading frame: ' + error.uri);
  37976. * console.log('Error: ' + error.message);
  37977. * });
  37978. */
  37979. frameFailed: Event;
  37980. /**
  37981. * The event fired to indicate that a new frame was rendered.
  37982. * <p>
  37983. * The time dynamic point cloud {@link TimeDynamicPointCloud} is passed to the event listener.
  37984. * </p>
  37985. * @example
  37986. * pointCloud.frameChanged.addEventListener(function(timeDynamicPointCloud) {
  37987. * viewer.camera.viewBoundingSphere(timeDynamicPointCloud.boundingSphere);
  37988. * });
  37989. */
  37990. frameChanged: Event;
  37991. /**
  37992. * The {@link ClippingPlaneCollection} used to selectively disable rendering the point cloud.
  37993. */
  37994. clippingPlanes: ClippingPlaneCollection;
  37995. /**
  37996. * The total amount of GPU memory in bytes used by the point cloud.
  37997. */
  37998. readonly totalMemoryUsageInBytes: number;
  37999. /**
  38000. * The bounding sphere of the frame being rendered. Returns <code>undefined</code> if no frame is being rendered.
  38001. */
  38002. readonly boundingSphere: BoundingSphere;
  38003. /**
  38004. * Gets the promise that will be resolved when the point cloud renders a frame for the first time.
  38005. */
  38006. readonly readyPromise: Promise<TimeDynamicPointCloud>;
  38007. /**
  38008. * Marks the point cloud's {@link TimeDynamicPointCloud#style} as dirty, which forces all
  38009. * points to re-evaluate the style in the next frame.
  38010. */
  38011. makeStyleDirty(): void;
  38012. /**
  38013. * Returns true if this object was destroyed; otherwise, false.
  38014. * <br /><br />
  38015. * If this object was destroyed, it should not be used; calling any function other than
  38016. * <code>isDestroyed</code> will result in a {@link DeveloperError} exception.
  38017. * @returns <code>true</code> if this object was destroyed; otherwise, <code>false</code>.
  38018. */
  38019. isDestroyed(): boolean;
  38020. /**
  38021. * Destroys the WebGL resources held by this object. Destroying an object allows for deterministic
  38022. * release of WebGL resources, instead of relying on the garbage collector to destroy this object.
  38023. * <br /><br />
  38024. * Once an object is destroyed, it should not be used; calling any function other than
  38025. * <code>isDestroyed</code> will result in a {@link DeveloperError} exception. Therefore,
  38026. * assign the return value (<code>undefined</code>) to the object as done in the example.
  38027. * @example
  38028. * pointCloud = pointCloud && pointCloud.destroy();
  38029. */
  38030. destroy(): void;
  38031. }
  38032. export namespace UrlTemplateImageryProvider {
  38033. /**
  38034. * Initialization options for the UrlTemplateImageryProvider constructor
  38035. * @property [options] - Object with the following properties:
  38036. * @property url - The URL template to use to request tiles. It has the following keywords:
  38037. * <ul>
  38038. * <li><code>{z}</code>: The level of the tile in the tiling scheme. Level zero is the root of the quadtree pyramid.</li>
  38039. * <li><code>{x}</code>: The tile X coordinate in the tiling scheme, where 0 is the Westernmost tile.</li>
  38040. * <li><code>{y}</code>: The tile Y coordinate in the tiling scheme, where 0 is the Northernmost tile.</li>
  38041. * <li><code>{s}</code>: One of the available subdomains, used to overcome browser limits on the number of simultaneous requests per host.</li>
  38042. * <li><code>{reverseX}</code>: The tile X coordinate in the tiling scheme, where 0 is the Easternmost tile.</li>
  38043. * <li><code>{reverseY}</code>: The tile Y coordinate in the tiling scheme, where 0 is the Southernmost tile.</li>
  38044. * <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>
  38045. * <li><code>{westDegrees}</code>: The Western edge of the tile in geodetic degrees.</li>
  38046. * <li><code>{southDegrees}</code>: The Southern edge of the tile in geodetic degrees.</li>
  38047. * <li><code>{eastDegrees}</code>: The Eastern edge of the tile in geodetic degrees.</li>
  38048. * <li><code>{northDegrees}</code>: The Northern edge of the tile in geodetic degrees.</li>
  38049. * <li><code>{westProjected}</code>: The Western edge of the tile in projected coordinates of the tiling scheme.</li>
  38050. * <li><code>{southProjected}</code>: The Southern edge of the tile in projected coordinates of the tiling scheme.</li>
  38051. * <li><code>{eastProjected}</code>: The Eastern edge of the tile in projected coordinates of the tiling scheme.</li>
  38052. * <li><code>{northProjected}</code>: The Northern edge of the tile in projected coordinates of the tiling scheme.</li>
  38053. * <li><code>{width}</code>: The width of each tile in pixels.</li>
  38054. * <li><code>{height}</code>: The height of each tile in pixels.</li>
  38055. * </ul>
  38056. * @property [pickFeaturesUrl] - The URL template to use to pick features. If this property is not specified,
  38057. * {@link UrlTemplateImageryProvider#pickFeatures} will immediately returned undefined, indicating no
  38058. * features picked. The URL template supports all of the keywords supported by the <code>url</code>
  38059. * parameter, plus the following:
  38060. * <ul>
  38061. * <li><code>{i}</code>: The pixel column (horizontal coordinate) of the picked position, where the Westernmost pixel is 0.</li>
  38062. * <li><code>{j}</code>: The pixel row (vertical coordinate) of the picked position, where the Northernmost pixel is 0.</li>
  38063. * <li><code>{reverseI}</code>: The pixel column (horizontal coordinate) of the picked position, where the Easternmost pixel is 0.</li>
  38064. * <li><code>{reverseJ}</code>: The pixel row (vertical coordinate) of the picked position, where the Southernmost pixel is 0.</li>
  38065. * <li><code>{longitudeDegrees}</code>: The longitude of the picked position in degrees.</li>
  38066. * <li><code>{latitudeDegrees}</code>: The latitude of the picked position in degrees.</li>
  38067. * <li><code>{longitudeProjected}</code>: The longitude of the picked position in the projected coordinates of the tiling scheme.</li>
  38068. * <li><code>{latitudeProjected}</code>: The latitude of the picked position in the projected coordinates of the tiling scheme.</li>
  38069. * <li><code>{format}</code>: The format in which to get feature information, as specified in the {@link GetFeatureInfoFormat}.</li>
  38070. * </ul>
  38071. * @property [urlSchemeZeroPadding] - Gets the URL scheme zero padding for each tile coordinate. The format is '000' where
  38072. * each coordinate will be padded on the left with zeros to match the width of the passed string of zeros. e.g. Setting:
  38073. * urlSchemeZeroPadding : { '{x}' : '0000'}
  38074. * will cause an 'x' value of 12 to return the string '0012' for {x} in the generated URL.
  38075. * It the passed object has the following keywords:
  38076. * <ul>
  38077. * <li> <code>{z}</code>: The zero padding for the level of the tile in the tiling scheme.</li>
  38078. * <li> <code>{x}</code>: The zero padding for the tile X coordinate in the tiling scheme.</li>
  38079. * <li> <code>{y}</code>: The zero padding for the the tile Y coordinate in the tiling scheme.</li>
  38080. * <li> <code>{reverseX}</code>: The zero padding for the tile reverseX coordinate in the tiling scheme.</li>
  38081. * <li> <code>{reverseY}</code>: The zero padding for the tile reverseY coordinate in the tiling scheme.</li>
  38082. * <li> <code>{reverseZ}</code>: The zero padding for the reverseZ coordinate of the tile in the tiling scheme.</li>
  38083. * </ul>
  38084. * @property [subdomains = 'abc'] - The subdomains to use for the <code>{s}</code> placeholder in the URL template.
  38085. * If this parameter is a single string, each character in the string is a subdomain. If it is
  38086. * an array, each element in the array is a subdomain.
  38087. * @property [credit = ''] - A credit for the data source, which is displayed on the canvas.
  38088. * @property [minimumLevel = 0] - The minimum level-of-detail supported by the imagery provider. Take care when specifying
  38089. * this that the number of tiles at the minimum level is small, such as four or less. A larger number is likely
  38090. * to result in rendering problems.
  38091. * @property [maximumLevel] - The maximum level-of-detail supported by the imagery provider, or undefined if there is no limit.
  38092. * @property [rectangle = Rectangle.MAX_VALUE] - The rectangle, in radians, covered by the image.
  38093. * @property [tilingScheme = WebMercatorTilingScheme] - The tiling scheme specifying how the ellipsoidal
  38094. * surface is broken into tiles. If this parameter is not provided, a {@link WebMercatorTilingScheme}
  38095. * is used.
  38096. * @property [ellipsoid] - The ellipsoid. If the tilingScheme is specified,
  38097. * this parameter is ignored and the tiling scheme's ellipsoid is used instead. If neither
  38098. * parameter is specified, the WGS84 ellipsoid is used.
  38099. * @property [tileWidth = 256] - Pixel width of image tiles.
  38100. * @property [tileHeight = 256] - Pixel height of image tiles.
  38101. * @property [hasAlphaChannel = true] - true if the images provided by this imagery provider
  38102. * include an alpha channel; otherwise, false. If this property is false, an alpha channel, if
  38103. * present, will be ignored. If this property is true, any images without an alpha channel will
  38104. * be treated as if their alpha is 1.0 everywhere. When this property is false, memory usage
  38105. * and texture upload time are potentially reduced.
  38106. * @property [getFeatureInfoFormats] - The formats in which to get feature information at a
  38107. * specific location when {@link UrlTemplateImageryProvider#pickFeatures} is invoked. If this
  38108. * parameter is not specified, feature picking is disabled.
  38109. * @property [enablePickFeatures = true] - If true, {@link UrlTemplateImageryProvider#pickFeatures} will
  38110. * request the <code>pickFeaturesUrl</code> and attempt to interpret the features included in the response. If false,
  38111. * {@link UrlTemplateImageryProvider#pickFeatures} will immediately return undefined (indicating no pickable
  38112. * features) without communicating with the server. Set this property to false if you know your data
  38113. * source does not support picking features or if you don't want this provider's features to be pickable. Note
  38114. * that this can be dynamically overridden by modifying the {@link UriTemplateImageryProvider#enablePickFeatures}
  38115. * property.
  38116. * @property [customTags] - Allow to replace custom keywords in the URL template. The object must have strings as keys and functions as values.
  38117. */
  38118. type ConstructorOptions = {
  38119. options?: Promise<object> | any;
  38120. url: Resource | string;
  38121. pickFeaturesUrl?: Resource | string;
  38122. urlSchemeZeroPadding?: any;
  38123. subdomains?: string | string[];
  38124. credit?: Credit | string;
  38125. minimumLevel?: number;
  38126. maximumLevel?: number;
  38127. rectangle?: Rectangle;
  38128. tilingScheme?: TilingScheme;
  38129. ellipsoid?: Ellipsoid;
  38130. tileWidth?: number;
  38131. tileHeight?: number;
  38132. hasAlphaChannel?: boolean;
  38133. getFeatureInfoFormats?: GetFeatureInfoFormat[];
  38134. enablePickFeatures?: boolean;
  38135. customTags?: any;
  38136. };
  38137. }
  38138. /**
  38139. * Provides imagery by requesting tiles using a specified URL template.
  38140. * @example
  38141. * // Access Natural Earth II imagery, which uses a TMS tiling scheme and Geographic (EPSG:4326) project
  38142. * var tms = new Cesium.UrlTemplateImageryProvider({
  38143. * url : Cesium.buildModuleUrl('Assets/Textures/NaturalEarthII') + '/{z}/{x}/{reverseY}.jpg',
  38144. * credit : '© Analytical Graphics, Inc.',
  38145. * tilingScheme : new Cesium.GeographicTilingScheme(),
  38146. * maximumLevel : 5
  38147. * });
  38148. * // Access the CartoDB Positron basemap, which uses an OpenStreetMap-like tiling scheme.
  38149. * var positron = new Cesium.UrlTemplateImageryProvider({
  38150. * url : 'http://{s}.basemaps.cartocdn.com/light_all/{z}/{x}/{y}.png',
  38151. * credit : 'Map tiles by CartoDB, under CC BY 3.0. Data by OpenStreetMap, under ODbL.'
  38152. * });
  38153. * // Access a Web Map Service (WMS) server.
  38154. * var wms = new Cesium.UrlTemplateImageryProvider({
  38155. * url : 'https://programs.communications.gov.au/geoserver/ows?tiled=true&' +
  38156. * 'transparent=true&format=image%2Fpng&exceptions=application%2Fvnd.ogc.se_xml&' +
  38157. * 'styles=&service=WMS&version=1.1.1&request=GetMap&' +
  38158. * 'layers=public%3AMyBroadband_Availability&srs=EPSG%3A3857&' +
  38159. * 'bbox={westProjected}%2C{southProjected}%2C{eastProjected}%2C{northProjected}&' +
  38160. * 'width=256&height=256',
  38161. * rectangle : Cesium.Rectangle.fromDegrees(96.799393, -43.598214999057824, 153.63925700000001, -9.2159219997013)
  38162. * });
  38163. * // Using custom tags in your template url.
  38164. * var custom = new Cesium.UrlTemplateImageryProvider({
  38165. * url : 'https://yoururl/{Time}/{z}/{y}/{x}.png',
  38166. * customTags : {
  38167. * Time: function(imageryProvider, x, y, level) {
  38168. * return '20171231'
  38169. * }
  38170. * }
  38171. * });
  38172. * @param options - Object describing initialization options
  38173. */
  38174. export class UrlTemplateImageryProvider {
  38175. constructor(options: UrlTemplateImageryProvider.ConstructorOptions);
  38176. /**
  38177. * The default alpha blending value of this provider, with 0.0 representing fully transparent and
  38178. * 1.0 representing fully opaque.
  38179. */
  38180. defaultAlpha: number | undefined;
  38181. /**
  38182. * The default alpha blending value on the night side of the globe of this provider, with 0.0 representing fully transparent and
  38183. * 1.0 representing fully opaque.
  38184. */
  38185. defaultNightAlpha: number | undefined;
  38186. /**
  38187. * The default alpha blending value on the day side of the globe of this provider, with 0.0 representing fully transparent and
  38188. * 1.0 representing fully opaque.
  38189. */
  38190. defaultDayAlpha: number | undefined;
  38191. /**
  38192. * The default brightness of this provider. 1.0 uses the unmodified imagery color. Less than 1.0
  38193. * makes the imagery darker while greater than 1.0 makes it brighter.
  38194. */
  38195. defaultBrightness: number | undefined;
  38196. /**
  38197. * The default contrast of this provider. 1.0 uses the unmodified imagery color. Less than 1.0 reduces
  38198. * the contrast while greater than 1.0 increases it.
  38199. */
  38200. defaultContrast: number | undefined;
  38201. /**
  38202. * The default hue of this provider in radians. 0.0 uses the unmodified imagery color.
  38203. */
  38204. defaultHue: number | undefined;
  38205. /**
  38206. * The default saturation of this provider. 1.0 uses the unmodified imagery color. Less than 1.0 reduces the
  38207. * saturation while greater than 1.0 increases it.
  38208. */
  38209. defaultSaturation: number | undefined;
  38210. /**
  38211. * The default gamma correction to apply to this provider. 1.0 uses the unmodified imagery color.
  38212. */
  38213. defaultGamma: number | undefined;
  38214. /**
  38215. * The default texture minification filter to apply to this provider.
  38216. */
  38217. defaultMinificationFilter: TextureMinificationFilter;
  38218. /**
  38219. * The default texture magnification filter to apply to this provider.
  38220. */
  38221. defaultMagnificationFilter: TextureMagnificationFilter;
  38222. /**
  38223. * Gets or sets a value indicating whether feature picking is enabled. If true, {@link UrlTemplateImageryProvider#pickFeatures} will
  38224. * request the <code>options.pickFeaturesUrl</code> and attempt to interpret the features included in the response. If false,
  38225. * {@link UrlTemplateImageryProvider#pickFeatures} will immediately return undefined (indicating no pickable
  38226. * features) without communicating with the server. Set this property to false if you know your data
  38227. * source does not support picking features or if you don't want this provider's features to be pickable.
  38228. */
  38229. enablePickFeatures: boolean;
  38230. /**
  38231. * Gets the URL template to use to request tiles. It has the following keywords:
  38232. * <ul>
  38233. * <li> <code>{z}</code>: The level of the tile in the tiling scheme. Level zero is the root of the quadtree pyramid.</li>
  38234. * <li> <code>{x}</code>: The tile X coordinate in the tiling scheme, where 0 is the Westernmost tile.</li>
  38235. * <li> <code>{y}</code>: The tile Y coordinate in the tiling scheme, where 0 is the Northernmost tile.</li>
  38236. * <li> <code>{s}</code>: One of the available subdomains, used to overcome browser limits on the number of simultaneous requests per host.</li>
  38237. * <li> <code>{reverseX}</code>: The tile X coordinate in the tiling scheme, where 0 is the Easternmost tile.</li>
  38238. * <li> <code>{reverseY}</code>: The tile Y coordinate in the tiling scheme, where 0 is the Southernmost tile.</li>
  38239. * <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>
  38240. * <li> <code>{westDegrees}</code>: The Western edge of the tile in geodetic degrees.</li>
  38241. * <li> <code>{southDegrees}</code>: The Southern edge of the tile in geodetic degrees.</li>
  38242. * <li> <code>{eastDegrees}</code>: The Eastern edge of the tile in geodetic degrees.</li>
  38243. * <li> <code>{northDegrees}</code>: The Northern edge of the tile in geodetic degrees.</li>
  38244. * <li> <code>{westProjected}</code>: The Western edge of the tile in projected coordinates of the tiling scheme.</li>
  38245. * <li> <code>{southProjected}</code>: The Southern edge of the tile in projected coordinates of the tiling scheme.</li>
  38246. * <li> <code>{eastProjected}</code>: The Eastern edge of the tile in projected coordinates of the tiling scheme.</li>
  38247. * <li> <code>{northProjected}</code>: The Northern edge of the tile in projected coordinates of the tiling scheme.</li>
  38248. * <li> <code>{width}</code>: The width of each tile in pixels.</li>
  38249. * <li> <code>{height}</code>: The height of each tile in pixels.</li>
  38250. * </ul>
  38251. */
  38252. readonly url: string;
  38253. /**
  38254. * Gets the URL scheme zero padding for each tile coordinate. The format is '000' where each coordinate will be padded on
  38255. * the left with zeros to match the width of the passed string of zeros. e.g. Setting:
  38256. * urlSchemeZeroPadding : { '{x}' : '0000'}
  38257. * will cause an 'x' value of 12 to return the string '0012' for {x} in the generated URL.
  38258. * It has the following keywords:
  38259. * <ul>
  38260. * <li> <code>{z}</code>: The zero padding for the level of the tile in the tiling scheme.</li>
  38261. * <li> <code>{x}</code>: The zero padding for the tile X coordinate in the tiling scheme.</li>
  38262. * <li> <code>{y}</code>: The zero padding for the the tile Y coordinate in the tiling scheme.</li>
  38263. * <li> <code>{reverseX}</code>: The zero padding for the tile reverseX coordinate in the tiling scheme.</li>
  38264. * <li> <code>{reverseY}</code>: The zero padding for the tile reverseY coordinate in the tiling scheme.</li>
  38265. * <li> <code>{reverseZ}</code>: The zero padding for the reverseZ coordinate of the tile in the tiling scheme.</li>
  38266. * </ul>
  38267. */
  38268. readonly urlSchemeZeroPadding: any;
  38269. /**
  38270. * Gets the URL template to use to use to pick features. If this property is not specified,
  38271. * {@link UrlTemplateImageryProvider#pickFeatures} will immediately return undefined, indicating no
  38272. * features picked. The URL template supports all of the keywords supported by the
  38273. * {@link UrlTemplateImageryProvider#url} property, plus the following:
  38274. * <ul>
  38275. * <li><code>{i}</code>: The pixel column (horizontal coordinate) of the picked position, where the Westernmost pixel is 0.</li>
  38276. * <li><code>{j}</code>: The pixel row (vertical coordinate) of the picked position, where the Northernmost pixel is 0.</li>
  38277. * <li><code>{reverseI}</code>: The pixel column (horizontal coordinate) of the picked position, where the Easternmost pixel is 0.</li>
  38278. * <li><code>{reverseJ}</code>: The pixel row (vertical coordinate) of the picked position, where the Southernmost pixel is 0.</li>
  38279. * <li><code>{longitudeDegrees}</code>: The longitude of the picked position in degrees.</li>
  38280. * <li><code>{latitudeDegrees}</code>: The latitude of the picked position in degrees.</li>
  38281. * <li><code>{longitudeProjected}</code>: The longitude of the picked position in the projected coordinates of the tiling scheme.</li>
  38282. * <li><code>{latitudeProjected}</code>: The latitude of the picked position in the projected coordinates of the tiling scheme.</li>
  38283. * <li><code>{format}</code>: The format in which to get feature information, as specified in the {@link GetFeatureInfoFormat}.</li>
  38284. * </ul>
  38285. */
  38286. readonly pickFeaturesUrl: string;
  38287. /**
  38288. * Gets the proxy used by this provider.
  38289. */
  38290. readonly proxy: Proxy;
  38291. /**
  38292. * Gets the width of each tile, in pixels. This function should
  38293. * not be called before {@link UrlTemplateImageryProvider#ready} returns true.
  38294. */
  38295. readonly tileWidth: number;
  38296. /**
  38297. * Gets the height of each tile, in pixels. This function should
  38298. * not be called before {@link UrlTemplateImageryProvider#ready} returns true.
  38299. */
  38300. readonly tileHeight: number;
  38301. /**
  38302. * Gets the maximum level-of-detail that can be requested, or undefined if there is no limit.
  38303. * This function should not be called before {@link UrlTemplateImageryProvider#ready} returns true.
  38304. */
  38305. readonly maximumLevel: number | undefined;
  38306. /**
  38307. * Gets the minimum level-of-detail that can be requested. This function should
  38308. * not be called before {@link UrlTemplateImageryProvider#ready} returns true.
  38309. */
  38310. readonly minimumLevel: number;
  38311. /**
  38312. * Gets the tiling scheme used by this provider. This function should
  38313. * not be called before {@link UrlTemplateImageryProvider#ready} returns true.
  38314. */
  38315. readonly tilingScheme: TilingScheme;
  38316. /**
  38317. * Gets the rectangle, in radians, of the imagery provided by this instance. This function should
  38318. * not be called before {@link UrlTemplateImageryProvider#ready} returns true.
  38319. */
  38320. readonly rectangle: Rectangle;
  38321. /**
  38322. * Gets the tile discard policy. If not undefined, the discard policy is responsible
  38323. * for filtering out "missing" tiles via its shouldDiscardImage function. If this function
  38324. * returns undefined, no tiles are filtered. This function should
  38325. * not be called before {@link UrlTemplateImageryProvider#ready} returns true.
  38326. */
  38327. readonly tileDiscardPolicy: TileDiscardPolicy;
  38328. /**
  38329. * Gets an event that is raised when the imagery provider encounters an asynchronous error. By subscribing
  38330. * to the event, you will be notified of the error and can potentially recover from it. Event listeners
  38331. * are passed an instance of {@link TileProviderError}.
  38332. */
  38333. readonly errorEvent: Event;
  38334. /**
  38335. * Gets a value indicating whether or not the provider is ready for use.
  38336. */
  38337. readonly ready: boolean;
  38338. /**
  38339. * Gets a promise that resolves to true when the provider is ready for use.
  38340. */
  38341. readonly readyPromise: Promise<boolean>;
  38342. /**
  38343. * Gets the credit to display when this imagery provider is active. Typically this is used to credit
  38344. * the source of the imagery. This function should not be called before {@link UrlTemplateImageryProvider#ready} returns true.
  38345. */
  38346. readonly credit: Credit;
  38347. /**
  38348. * Gets a value indicating whether or not the images provided by this imagery provider
  38349. * include an alpha channel. If this property is false, an alpha channel, if present, will
  38350. * be ignored. If this property is true, any images without an alpha channel will be treated
  38351. * as if their alpha is 1.0 everywhere. When this property is false, memory usage
  38352. * and texture upload time are reduced. This function should
  38353. * not be called before {@link ImageryProvider#ready} returns true.
  38354. */
  38355. readonly hasAlphaChannel: boolean;
  38356. /**
  38357. * Reinitializes this instance. Reinitializing an instance already in use is supported, but it is not
  38358. * recommended because existing tiles provided by the imagery provider will not be updated.
  38359. * @param options - Any of the options that may be passed to the {@link UrlTemplateImageryProvider} constructor.
  38360. */
  38361. reinitialize(options: Promise<object> | any): void;
  38362. /**
  38363. * Gets the credits to be displayed when a given tile is displayed.
  38364. * @param x - The tile X coordinate.
  38365. * @param y - The tile Y coordinate.
  38366. * @param level - The tile level;
  38367. * @returns The credits to be displayed when the tile is displayed.
  38368. */
  38369. getTileCredits(x: number, y: number, level: number): Credit[];
  38370. /**
  38371. * Requests the image for a given tile. This function should
  38372. * not be called before {@link UrlTemplateImageryProvider#ready} returns true.
  38373. * @param x - The tile X coordinate.
  38374. * @param y - The tile Y coordinate.
  38375. * @param level - The tile level.
  38376. * @param [request] - The request object. Intended for internal use only.
  38377. * @returns A promise for the image that will resolve when the image is available, or
  38378. * undefined if there are too many active requests to the server, and the request
  38379. * should be retried later. The resolved image may be either an
  38380. * Image or a Canvas DOM object.
  38381. */
  38382. requestImage(x: number, y: number, level: number, request?: Request): Promise<HTMLImageElement | HTMLCanvasElement> | undefined;
  38383. /**
  38384. * Asynchronously determines what features, if any, are located at a given longitude and latitude within
  38385. * a tile. This function should not be called before {@link ImageryProvider#ready} returns true.
  38386. * @param x - The tile X coordinate.
  38387. * @param y - The tile Y coordinate.
  38388. * @param level - The tile level.
  38389. * @param longitude - The longitude at which to pick features.
  38390. * @param latitude - The latitude at which to pick features.
  38391. * @returns A promise for the picked features that will resolve when the asynchronous
  38392. * picking completes. The resolved value is an array of {@link ImageryLayerFeatureInfo}
  38393. * instances. The array may be empty if no features are found at the given location.
  38394. * It may also be undefined if picking is not supported.
  38395. */
  38396. pickFeatures(x: number, y: number, level: number, longitude: number, latitude: number): Promise<ImageryLayerFeatureInfo[]> | undefined;
  38397. }
  38398. /**
  38399. * The vertical location of an origin relative to an object, e.g., a {@link Billboard}
  38400. * or {@link Label}. For example, setting the vertical origin to <code>TOP</code>
  38401. * or <code>BOTTOM</code> will display a billboard above or below (in screen space)
  38402. * the anchor position.
  38403. * <br /><br />
  38404. * <div align='center'>
  38405. * <img src='Images/Billboard.setVerticalOrigin.png' width='695' height='175' /><br />
  38406. * </div>
  38407. */
  38408. export enum VerticalOrigin {
  38409. /**
  38410. * The origin is at the vertical center between <code>BASELINE</code> and <code>TOP</code>.
  38411. */
  38412. CENTER = 0,
  38413. /**
  38414. * The origin is at the bottom of the object.
  38415. */
  38416. BOTTOM = 1,
  38417. /**
  38418. * If the object contains text, the origin is at the baseline of the text, else the origin is at the bottom of the object.
  38419. */
  38420. BASELINE = 2,
  38421. /**
  38422. * The origin is at the top of the object.
  38423. */
  38424. TOP = -1
  38425. }
  38426. /**
  38427. * A viewport aligned quad.
  38428. * @example
  38429. * var viewportQuad = new Cesium.ViewportQuad(new Cesium.BoundingRectangle(0, 0, 80, 40));
  38430. * viewportQuad.material.uniforms.color = new Cesium.Color(1.0, 0.0, 0.0, 1.0);
  38431. * @param [rectangle] - The {@link BoundingRectangle} defining the quad's position within the viewport.
  38432. * @param [material] - The {@link Material} defining the surface appearance of the viewport quad.
  38433. */
  38434. export class ViewportQuad {
  38435. constructor(rectangle?: BoundingRectangle, material?: Material);
  38436. /**
  38437. * Determines if the viewport quad primitive will be shown.
  38438. */
  38439. show: boolean;
  38440. /**
  38441. * The BoundingRectangle defining the quad's position within the viewport.
  38442. * @example
  38443. * viewportQuad.rectangle = new Cesium.BoundingRectangle(0, 0, 80, 40);
  38444. */
  38445. rectangle: BoundingRectangle;
  38446. /**
  38447. * The surface appearance of the viewport quad. This can be one of several built-in {@link Material} objects or a custom material, scripted with
  38448. * {@link https://github.com/CesiumGS/cesium/wiki/Fabric|Fabric}.
  38449. * <p>
  38450. * The default material is <code>Material.ColorType</code>.
  38451. * </p>
  38452. * @example
  38453. * // 1. Change the color of the default material to yellow
  38454. * viewportQuad.material.uniforms.color = new Cesium.Color(1.0, 1.0, 0.0, 1.0);
  38455. *
  38456. * // 2. Change material to horizontal stripes
  38457. * viewportQuad.material = Cesium.Material.fromType(Cesium.Material.StripeType);
  38458. */
  38459. material: Material;
  38460. /**
  38461. * Called when {@link Viewer} or {@link CesiumWidget} render the scene to
  38462. * get the draw commands needed to render this primitive.
  38463. * <p>
  38464. * Do not call this function directly. This is documented just to
  38465. * list the exceptions that may be propagated when the scene is rendered:
  38466. * </p>
  38467. */
  38468. update(): void;
  38469. /**
  38470. * Returns true if this object was destroyed; otherwise, false.
  38471. * <br /><br />
  38472. * If this object was destroyed, it should not be used; calling any function other than
  38473. * <code>isDestroyed</code> will result in a {@link DeveloperError} exception.
  38474. * @returns True if this object was destroyed; otherwise, false.
  38475. */
  38476. isDestroyed(): boolean;
  38477. /**
  38478. * Destroys the WebGL resources held by this object. Destroying an object allows for deterministic
  38479. * release of WebGL resources, instead of relying on the garbage collector to destroy this object.
  38480. * <br /><br />
  38481. * Once an object is destroyed, it should not be used; calling any function other than
  38482. * <code>isDestroyed</code> will result in a {@link DeveloperError} exception. Therefore,
  38483. * assign the return value (<code>undefined</code>) to the object as done in the example.
  38484. * @example
  38485. * quad = quad && quad.destroy();
  38486. */
  38487. destroy(): void;
  38488. }
  38489. export namespace WebMapServiceImageryProvider {
  38490. /**
  38491. * Initialization options for the WebMapServiceImageryProvider constructor
  38492. * @property url - The URL of the WMS service. The URL supports the same keywords as the {@link UrlTemplateImageryProvider}.
  38493. * @property layers - The layers to include, separated by commas.
  38494. * @property [parameters = WebMapServiceImageryProvider.DefaultParameters] - Additional parameters to pass to the WMS server in the GetMap URL.
  38495. * @property [getFeatureInfoParameters = WebMapServiceImageryProvider.GetFeatureInfoDefaultParameters] - Additional parameters to pass to the WMS server in the GetFeatureInfo URL.
  38496. * @property [enablePickFeatures = true] - If true, {@link WebMapServiceImageryProvider#pickFeatures} will invoke
  38497. * the GetFeatureInfo operation on the WMS server and return the features included in the response. If false,
  38498. * {@link WebMapServiceImageryProvider#pickFeatures} will immediately return undefined (indicating no pickable features)
  38499. * without communicating with the server. Set this property to false if you know your WMS server does not support
  38500. * GetFeatureInfo or if you don't want this provider's features to be pickable. Note that this can be dynamically
  38501. * overridden by modifying the WebMapServiceImageryProvider#enablePickFeatures property.
  38502. * @property [getFeatureInfoFormats = WebMapServiceImageryProvider.DefaultGetFeatureInfoFormats] - The formats
  38503. * in which to try WMS GetFeatureInfo requests.
  38504. * @property [rectangle = Rectangle.MAX_VALUE] - The rectangle of the layer.
  38505. * @property [tilingScheme = new GeographicTilingScheme()] - The tiling scheme to use to divide the world into tiles.
  38506. * @property [ellipsoid] - The ellipsoid. If the tilingScheme is specified,
  38507. * this parameter is ignored and the tiling scheme's ellipsoid is used instead. If neither
  38508. * parameter is specified, the WGS84 ellipsoid is used.
  38509. * @property [tileWidth = 256] - The width of each tile in pixels.
  38510. * @property [tileHeight = 256] - The height of each tile in pixels.
  38511. * @property [minimumLevel = 0] - The minimum level-of-detail supported by the imagery provider. Take care when
  38512. * specifying this that the number of tiles at the minimum level is small, such as four or less. A larger number is
  38513. * likely to result in rendering problems.
  38514. * @property [maximumLevel] - The maximum level-of-detail supported by the imagery provider, or undefined if there is no limit.
  38515. * If not specified, there is no limit.
  38516. * @property [crs] - CRS specification, for use with WMS specification >= 1.3.0.
  38517. * @property [srs] - SRS specification, for use with WMS specification 1.1.0 or 1.1.1
  38518. * @property [credit] - A credit for the data source, which is displayed on the canvas.
  38519. * @property [subdomains = 'abc'] - The subdomains to use for the <code>{s}</code> placeholder in the URL template.
  38520. * If this parameter is a single string, each character in the string is a subdomain. If it is
  38521. * an array, each element in the array is a subdomain.
  38522. * @property [clock] - A Clock instance that is used when determining the value for the time dimension. Required when `times` is specified.
  38523. * @property [times] - TimeIntervalCollection with its data property being an object containing time dynamic dimension and their values.
  38524. */
  38525. type ConstructorOptions = {
  38526. url: Resource | string;
  38527. layers: string;
  38528. parameters?: any;
  38529. getFeatureInfoParameters?: any;
  38530. enablePickFeatures?: boolean;
  38531. getFeatureInfoFormats?: GetFeatureInfoFormat[];
  38532. rectangle?: Rectangle;
  38533. tilingScheme?: TilingScheme;
  38534. ellipsoid?: Ellipsoid;
  38535. tileWidth?: number;
  38536. tileHeight?: number;
  38537. minimumLevel?: number;
  38538. maximumLevel?: number;
  38539. crs?: string;
  38540. srs?: string;
  38541. credit?: Credit | string;
  38542. subdomains?: string | string[];
  38543. clock?: Clock;
  38544. times?: TimeIntervalCollection;
  38545. };
  38546. }
  38547. /**
  38548. * Provides tiled imagery hosted by a Web Map Service (WMS) server.
  38549. * @example
  38550. * var provider = new Cesium.WebMapServiceImageryProvider({
  38551. * url : 'https://sampleserver1.arcgisonline.com/ArcGIS/services/Specialty/ESRI_StatesCitiesRivers_USA/MapServer/WMSServer',
  38552. * layers : '0',
  38553. * proxy: new Cesium.DefaultProxy('/proxy/')
  38554. * });
  38555. *
  38556. * viewer.imageryLayers.addImageryProvider(provider);
  38557. * @param options - Object describing initialization options
  38558. */
  38559. export class WebMapServiceImageryProvider {
  38560. constructor(options: WebMapServiceImageryProvider.ConstructorOptions);
  38561. /**
  38562. * The default alpha blending value of this provider, with 0.0 representing fully transparent and
  38563. * 1.0 representing fully opaque.
  38564. */
  38565. defaultAlpha: number | undefined;
  38566. /**
  38567. * The default alpha blending value on the night side of the globe of this provider, with 0.0 representing fully transparent and
  38568. * 1.0 representing fully opaque.
  38569. */
  38570. defaultNightAlpha: number | undefined;
  38571. /**
  38572. * The default alpha blending value on the day side of the globe of this provider, with 0.0 representing fully transparent and
  38573. * 1.0 representing fully opaque.
  38574. */
  38575. defaultDayAlpha: number | undefined;
  38576. /**
  38577. * The default brightness of this provider. 1.0 uses the unmodified imagery color. Less than 1.0
  38578. * makes the imagery darker while greater than 1.0 makes it brighter.
  38579. */
  38580. defaultBrightness: number | undefined;
  38581. /**
  38582. * The default contrast of this provider. 1.0 uses the unmodified imagery color. Less than 1.0 reduces
  38583. * the contrast while greater than 1.0 increases it.
  38584. */
  38585. defaultContrast: number | undefined;
  38586. /**
  38587. * The default hue of this provider in radians. 0.0 uses the unmodified imagery color.
  38588. */
  38589. defaultHue: number | undefined;
  38590. /**
  38591. * The default saturation of this provider. 1.0 uses the unmodified imagery color. Less than 1.0 reduces the
  38592. * saturation while greater than 1.0 increases it.
  38593. */
  38594. defaultSaturation: number | undefined;
  38595. /**
  38596. * The default gamma correction to apply to this provider. 1.0 uses the unmodified imagery color.
  38597. */
  38598. defaultGamma: number | undefined;
  38599. /**
  38600. * The default texture minification filter to apply to this provider.
  38601. */
  38602. defaultMinificationFilter: TextureMinificationFilter;
  38603. /**
  38604. * The default texture magnification filter to apply to this provider.
  38605. */
  38606. defaultMagnificationFilter: TextureMagnificationFilter;
  38607. /**
  38608. * Gets the URL of the WMS server.
  38609. */
  38610. readonly url: string;
  38611. /**
  38612. * Gets the proxy used by this provider.
  38613. */
  38614. readonly proxy: Proxy;
  38615. /**
  38616. * Gets the names of the WMS layers, separated by commas.
  38617. */
  38618. readonly layers: string;
  38619. /**
  38620. * Gets the width of each tile, in pixels. This function should
  38621. * not be called before {@link WebMapServiceImageryProvider#ready} returns true.
  38622. */
  38623. readonly tileWidth: number;
  38624. /**
  38625. * Gets the height of each tile, in pixels. This function should
  38626. * not be called before {@link WebMapServiceImageryProvider#ready} returns true.
  38627. */
  38628. readonly tileHeight: number;
  38629. /**
  38630. * Gets the maximum level-of-detail that can be requested. This function should
  38631. * not be called before {@link WebMapServiceImageryProvider#ready} returns true.
  38632. */
  38633. readonly maximumLevel: number | undefined;
  38634. /**
  38635. * Gets the minimum level-of-detail that can be requested. This function should
  38636. * not be called before {@link WebMapServiceImageryProvider#ready} returns true.
  38637. */
  38638. readonly minimumLevel: number;
  38639. /**
  38640. * Gets the tiling scheme used by this provider. This function should
  38641. * not be called before {@link WebMapServiceImageryProvider#ready} returns true.
  38642. */
  38643. readonly tilingScheme: TilingScheme;
  38644. /**
  38645. * Gets the rectangle, in radians, of the imagery provided by this instance. This function should
  38646. * not be called before {@link WebMapServiceImageryProvider#ready} returns true.
  38647. */
  38648. readonly rectangle: Rectangle;
  38649. /**
  38650. * Gets the tile discard policy. If not undefined, the discard policy is responsible
  38651. * for filtering out "missing" tiles via its shouldDiscardImage function. If this function
  38652. * returns undefined, no tiles are filtered. This function should
  38653. * not be called before {@link WebMapServiceImageryProvider#ready} returns true.
  38654. */
  38655. readonly tileDiscardPolicy: TileDiscardPolicy;
  38656. /**
  38657. * Gets an event that is raised when the imagery provider encounters an asynchronous error. By subscribing
  38658. * to the event, you will be notified of the error and can potentially recover from it. Event listeners
  38659. * are passed an instance of {@link TileProviderError}.
  38660. */
  38661. readonly errorEvent: Event;
  38662. /**
  38663. * Gets a value indicating whether or not the provider is ready for use.
  38664. */
  38665. readonly ready: boolean;
  38666. /**
  38667. * Gets a promise that resolves to true when the provider is ready for use.
  38668. */
  38669. readonly readyPromise: Promise<boolean>;
  38670. /**
  38671. * Gets the credit to display when this imagery provider is active. Typically this is used to credit
  38672. * the source of the imagery. This function should not be called before {@link WebMapServiceImageryProvider#ready} returns true.
  38673. */
  38674. readonly credit: Credit;
  38675. /**
  38676. * Gets a value indicating whether or not the images provided by this imagery provider
  38677. * include an alpha channel. If this property is false, an alpha channel, if present, will
  38678. * be ignored. If this property is true, any images without an alpha channel will be treated
  38679. * as if their alpha is 1.0 everywhere. When this property is false, memory usage
  38680. * and texture upload time are reduced.
  38681. */
  38682. readonly hasAlphaChannel: boolean;
  38683. /**
  38684. * Gets or sets a value indicating whether feature picking is enabled. If true, {@link WebMapServiceImageryProvider#pickFeatures} will
  38685. * invoke the <code>GetFeatureInfo</code> service on the WMS server and attempt to interpret the features included in the response. If false,
  38686. * {@link WebMapServiceImageryProvider#pickFeatures} will immediately return undefined (indicating no pickable
  38687. * features) without communicating with the server. Set this property to false if you know your data
  38688. * source does not support picking features or if you don't want this provider's features to be pickable.
  38689. */
  38690. enablePickFeatures: boolean;
  38691. /**
  38692. * Gets or sets a clock that is used to get keep the time used for time dynamic parameters.
  38693. */
  38694. clock: Clock;
  38695. /**
  38696. * Gets or sets a time interval collection that is used to get time dynamic parameters. The data of each
  38697. * TimeInterval is an object containing the keys and values of the properties that are used during
  38698. * tile requests.
  38699. */
  38700. times: TimeIntervalCollection;
  38701. /**
  38702. * Gets the credits to be displayed when a given tile is displayed.
  38703. * @param x - The tile X coordinate.
  38704. * @param y - The tile Y coordinate.
  38705. * @param level - The tile level;
  38706. * @returns The credits to be displayed when the tile is displayed.
  38707. */
  38708. getTileCredits(x: number, y: number, level: number): Credit[];
  38709. /**
  38710. * Requests the image for a given tile. This function should
  38711. * not be called before {@link WebMapServiceImageryProvider#ready} returns true.
  38712. * @param x - The tile X coordinate.
  38713. * @param y - The tile Y coordinate.
  38714. * @param level - The tile level.
  38715. * @param [request] - The request object. Intended for internal use only.
  38716. * @returns A promise for the image that will resolve when the image is available, or
  38717. * undefined if there are too many active requests to the server, and the request
  38718. * should be retried later. The resolved image may be either an
  38719. * Image or a Canvas DOM object.
  38720. */
  38721. requestImage(x: number, y: number, level: number, request?: Request): Promise<HTMLImageElement | HTMLCanvasElement> | undefined;
  38722. /**
  38723. * Asynchronously determines what features, if any, are located at a given longitude and latitude within
  38724. * a tile. This function should not be called before {@link ImageryProvider#ready} returns true.
  38725. * @param x - The tile X coordinate.
  38726. * @param y - The tile Y coordinate.
  38727. * @param level - The tile level.
  38728. * @param longitude - The longitude at which to pick features.
  38729. * @param latitude - The latitude at which to pick features.
  38730. * @returns A promise for the picked features that will resolve when the asynchronous
  38731. * picking completes. The resolved value is an array of {@link ImageryLayerFeatureInfo}
  38732. * instances. The array may be empty if no features are found at the given location.
  38733. */
  38734. pickFeatures(x: number, y: number, level: number, longitude: number, latitude: number): Promise<ImageryLayerFeatureInfo[]> | undefined;
  38735. /**
  38736. * The default parameters to include in the WMS URL to obtain images. The values are as follows:
  38737. * service=WMS
  38738. * version=1.1.1
  38739. * request=GetMap
  38740. * styles=
  38741. * format=image/jpeg
  38742. */
  38743. static readonly DefaultParameters: any;
  38744. /**
  38745. * The default parameters to include in the WMS URL to get feature information. The values are as follows:
  38746. * service=WMS
  38747. * version=1.1.1
  38748. * request=GetFeatureInfo
  38749. */
  38750. static readonly GetFeatureInfoDefaultParameters: any;
  38751. }
  38752. export namespace WebMapTileServiceImageryProvider {
  38753. /**
  38754. * Initialization options for the WebMapTileServiceImageryProvider constructor
  38755. * @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.
  38756. * @property [format = 'image/jpeg'] - The MIME type for images to retrieve from the server.
  38757. * @property layer - The layer name for WMTS requests.
  38758. * @property style - The style name for WMTS requests.
  38759. * @property tileMatrixSetID - The identifier of the TileMatrixSet to use for WMTS requests.
  38760. * @property [tileMatrixLabels] - A list of identifiers in the TileMatrix to use for WMTS requests, one per TileMatrix level.
  38761. * @property [clock] - A Clock instance that is used when determining the value for the time dimension. Required when `times` is specified.
  38762. * @property [times] - TimeIntervalCollection with its <code>data</code> property being an object containing time dynamic dimension and their values.
  38763. * @property [dimensions] - A object containing static dimensions and their values.
  38764. * @property [tileWidth = 256] - The tile width in pixels.
  38765. * @property [tileHeight = 256] - The tile height in pixels.
  38766. * @property [tilingScheme] - The tiling scheme corresponding to the organization of the tiles in the TileMatrixSet.
  38767. * @property [rectangle = Rectangle.MAX_VALUE] - The rectangle covered by the layer.
  38768. * @property [minimumLevel = 0] - The minimum level-of-detail supported by the imagery provider.
  38769. * @property [maximumLevel] - The maximum level-of-detail supported by the imagery provider, or undefined if there is no limit.
  38770. * @property [ellipsoid] - The ellipsoid. If not specified, the WGS84 ellipsoid is used.
  38771. * @property [credit] - A credit for the data source, which is displayed on the canvas.
  38772. * @property [subdomains = 'abc'] - The subdomains to use for the <code>{s}</code> placeholder in the URL template.
  38773. * If this parameter is a single string, each character in the string is a subdomain. If it is
  38774. * an array, each element in the array is a subdomain.
  38775. */
  38776. type ConstructorOptions = {
  38777. url: Resource | string;
  38778. format?: string;
  38779. layer: string;
  38780. style: string;
  38781. tileMatrixSetID: string;
  38782. tileMatrixLabels?: any[];
  38783. clock?: Clock;
  38784. times?: TimeIntervalCollection;
  38785. dimensions?: any;
  38786. tileWidth?: number;
  38787. tileHeight?: number;
  38788. tilingScheme?: TilingScheme;
  38789. rectangle?: Rectangle;
  38790. minimumLevel?: number;
  38791. maximumLevel?: number;
  38792. ellipsoid?: Ellipsoid;
  38793. credit?: Credit | string;
  38794. subdomains?: string | string[];
  38795. };
  38796. }
  38797. /**
  38798. * Provides tiled imagery served by {@link http://www.opengeospatial.org/standards/wmts|WMTS 1.0.0} compliant servers.
  38799. * This provider supports HTTP KVP-encoded and RESTful GetTile requests, but does not yet support the SOAP encoding.
  38800. * @example
  38801. * // Example 1. USGS shaded relief tiles (KVP)
  38802. * var shadedRelief1 = new Cesium.WebMapTileServiceImageryProvider({
  38803. * url : 'http://basemap.nationalmap.gov/arcgis/rest/services/USGSShadedReliefOnly/MapServer/WMTS',
  38804. * layer : 'USGSShadedReliefOnly',
  38805. * style : 'default',
  38806. * format : 'image/jpeg',
  38807. * tileMatrixSetID : 'default028mm',
  38808. * // tileMatrixLabels : ['default028mm:0', 'default028mm:1', 'default028mm:2' ...],
  38809. * maximumLevel: 19,
  38810. * credit : new Cesium.Credit('U. S. Geological Survey')
  38811. * });
  38812. * viewer.imageryLayers.addImageryProvider(shadedRelief1);
  38813. * @example
  38814. * // Example 2. USGS shaded relief tiles (RESTful)
  38815. * var shadedRelief2 = new Cesium.WebMapTileServiceImageryProvider({
  38816. * url : 'http://basemap.nationalmap.gov/arcgis/rest/services/USGSShadedReliefOnly/MapServer/WMTS/tile/1.0.0/USGSShadedReliefOnly/{Style}/{TileMatrixSet}/{TileMatrix}/{TileRow}/{TileCol}.jpg',
  38817. * layer : 'USGSShadedReliefOnly',
  38818. * style : 'default',
  38819. * format : 'image/jpeg',
  38820. * tileMatrixSetID : 'default028mm',
  38821. * maximumLevel: 19,
  38822. * credit : new Cesium.Credit('U. S. Geological Survey')
  38823. * });
  38824. * viewer.imageryLayers.addImageryProvider(shadedRelief2);
  38825. * @example
  38826. * // Example 3. NASA time dynamic weather data (RESTful)
  38827. * var times = Cesium.TimeIntervalCollection.fromIso8601({
  38828. * iso8601: '2015-07-30/2017-06-16/P1D',
  38829. * dataCallback: function dataCallback(interval, index) {
  38830. * return {
  38831. * Time: Cesium.JulianDate.toIso8601(interval.start)
  38832. * };
  38833. * }
  38834. * });
  38835. * var weather = new Cesium.WebMapTileServiceImageryProvider({
  38836. * url : 'https://gibs.earthdata.nasa.gov/wmts/epsg4326/best/AMSR2_Snow_Water_Equivalent/default/{Time}/{TileMatrixSet}/{TileMatrix}/{TileRow}/{TileCol}.png',
  38837. * layer : 'AMSR2_Snow_Water_Equivalent',
  38838. * style : 'default',
  38839. * tileMatrixSetID : '2km',
  38840. * maximumLevel : 5,
  38841. * format : 'image/png',
  38842. * clock: clock,
  38843. * times: times,
  38844. * credit : new Cesium.Credit('NASA Global Imagery Browse Services for EOSDIS')
  38845. * });
  38846. * viewer.imageryLayers.addImageryProvider(weather);
  38847. * @param options - Object describing initialization options
  38848. */
  38849. export class WebMapTileServiceImageryProvider {
  38850. constructor(options: WebMapTileServiceImageryProvider.ConstructorOptions);
  38851. /**
  38852. * The default alpha blending value of this provider, with 0.0 representing fully transparent and
  38853. * 1.0 representing fully opaque.
  38854. */
  38855. defaultAlpha: number | undefined;
  38856. /**
  38857. * The default alpha blending value on the night side of the globe of this provider, with 0.0 representing fully transparent and
  38858. * 1.0 representing fully opaque.
  38859. */
  38860. defaultNightAlpha: number | undefined;
  38861. /**
  38862. * The default alpha blending value on the day side of the globe of this provider, with 0.0 representing fully transparent and
  38863. * 1.0 representing fully opaque.
  38864. */
  38865. defaultDayAlpha: number | undefined;
  38866. /**
  38867. * The default brightness of this provider. 1.0 uses the unmodified imagery color. Less than 1.0
  38868. * makes the imagery darker while greater than 1.0 makes it brighter.
  38869. */
  38870. defaultBrightness: number | undefined;
  38871. /**
  38872. * The default contrast of this provider. 1.0 uses the unmodified imagery color. Less than 1.0 reduces
  38873. * the contrast while greater than 1.0 increases it.
  38874. */
  38875. defaultContrast: number | undefined;
  38876. /**
  38877. * The default hue of this provider in radians. 0.0 uses the unmodified imagery color.
  38878. */
  38879. defaultHue: number | undefined;
  38880. /**
  38881. * The default saturation of this provider. 1.0 uses the unmodified imagery color. Less than 1.0 reduces the
  38882. * saturation while greater than 1.0 increases it.
  38883. */
  38884. defaultSaturation: number | undefined;
  38885. /**
  38886. * The default gamma correction to apply to this provider. 1.0 uses the unmodified imagery color.
  38887. */
  38888. defaultGamma: number | undefined;
  38889. /**
  38890. * The default texture minification filter to apply to this provider.
  38891. */
  38892. defaultMinificationFilter: TextureMinificationFilter;
  38893. /**
  38894. * The default texture magnification filter to apply to this provider.
  38895. */
  38896. defaultMagnificationFilter: TextureMagnificationFilter;
  38897. /**
  38898. * Gets the URL of the service hosting the imagery.
  38899. */
  38900. readonly url: string;
  38901. /**
  38902. * Gets the proxy used by this provider.
  38903. */
  38904. readonly proxy: Proxy;
  38905. /**
  38906. * Gets the width of each tile, in pixels. This function should
  38907. * not be called before {@link WebMapTileServiceImageryProvider#ready} returns true.
  38908. */
  38909. readonly tileWidth: number;
  38910. /**
  38911. * Gets the height of each tile, in pixels. This function should
  38912. * not be called before {@link WebMapTileServiceImageryProvider#ready} returns true.
  38913. */
  38914. readonly tileHeight: number;
  38915. /**
  38916. * Gets the maximum level-of-detail that can be requested. This function should
  38917. * not be called before {@link WebMapTileServiceImageryProvider#ready} returns true.
  38918. */
  38919. readonly maximumLevel: number | undefined;
  38920. /**
  38921. * Gets the minimum level-of-detail that can be requested. This function should
  38922. * not be called before {@link WebMapTileServiceImageryProvider#ready} returns true.
  38923. */
  38924. readonly minimumLevel: number;
  38925. /**
  38926. * Gets the tiling scheme used by this provider. This function should
  38927. * not be called before {@link WebMapTileServiceImageryProvider#ready} returns true.
  38928. */
  38929. readonly tilingScheme: TilingScheme;
  38930. /**
  38931. * Gets the rectangle, in radians, of the imagery provided by this instance. This function should
  38932. * not be called before {@link WebMapTileServiceImageryProvider#ready} returns true.
  38933. */
  38934. readonly rectangle: Rectangle;
  38935. /**
  38936. * Gets the tile discard policy. If not undefined, the discard policy is responsible
  38937. * for filtering out "missing" tiles via its shouldDiscardImage function. If this function
  38938. * returns undefined, no tiles are filtered. This function should
  38939. * not be called before {@link WebMapTileServiceImageryProvider#ready} returns true.
  38940. */
  38941. readonly tileDiscardPolicy: TileDiscardPolicy;
  38942. /**
  38943. * Gets an event that is raised when the imagery provider encounters an asynchronous error. By subscribing
  38944. * to the event, you will be notified of the error and can potentially recover from it. Event listeners
  38945. * are passed an instance of {@link TileProviderError}.
  38946. */
  38947. readonly errorEvent: Event;
  38948. /**
  38949. * Gets the mime type of images returned by this imagery provider.
  38950. */
  38951. readonly format: string;
  38952. /**
  38953. * Gets a value indicating whether or not the provider is ready for use.
  38954. */
  38955. readonly ready: boolean;
  38956. /**
  38957. * Gets a promise that resolves to true when the provider is ready for use.
  38958. */
  38959. readonly readyPromise: Promise<boolean>;
  38960. /**
  38961. * Gets the credit to display when this imagery provider is active. Typically this is used to credit
  38962. * the source of the imagery. This function should not be called before {@link WebMapTileServiceImageryProvider#ready} returns true.
  38963. */
  38964. readonly credit: Credit;
  38965. /**
  38966. * Gets a value indicating whether or not the images provided by this imagery provider
  38967. * include an alpha channel. If this property is false, an alpha channel, if present, will
  38968. * be ignored. If this property is true, any images without an alpha channel will be treated
  38969. * as if their alpha is 1.0 everywhere. When this property is false, memory usage
  38970. * and texture upload time are reduced.
  38971. */
  38972. readonly hasAlphaChannel: boolean;
  38973. /**
  38974. * Gets or sets a clock that is used to get keep the time used for time dynamic parameters.
  38975. */
  38976. clock: Clock;
  38977. /**
  38978. * Gets or sets a time interval collection that is used to get time dynamic parameters. The data of each
  38979. * TimeInterval is an object containing the keys and values of the properties that are used during
  38980. * tile requests.
  38981. */
  38982. times: TimeIntervalCollection;
  38983. /**
  38984. * Gets or sets an object that contains static dimensions and their values.
  38985. */
  38986. dimensions: any;
  38987. /**
  38988. * Gets the credits to be displayed when a given tile is displayed.
  38989. * @param x - The tile X coordinate.
  38990. * @param y - The tile Y coordinate.
  38991. * @param level - The tile level;
  38992. * @returns The credits to be displayed when the tile is displayed.
  38993. */
  38994. getTileCredits(x: number, y: number, level: number): Credit[];
  38995. /**
  38996. * Requests the image for a given tile. This function should
  38997. * not be called before {@link WebMapTileServiceImageryProvider#ready} returns true.
  38998. * @param x - The tile X coordinate.
  38999. * @param y - The tile Y coordinate.
  39000. * @param level - The tile level.
  39001. * @param [request] - The request object. Intended for internal use only.
  39002. * @returns A promise for the image that will resolve when the image is available, or
  39003. * undefined if there are too many active requests to the server, and the request
  39004. * should be retried later. The resolved image may be either an
  39005. * Image or a Canvas DOM object.
  39006. */
  39007. requestImage(x: number, y: number, level: number, request?: Request): Promise<HTMLImageElement | HTMLCanvasElement> | undefined;
  39008. /**
  39009. * Picking features is not currently supported by this imagery provider, so this function simply returns
  39010. * undefined.
  39011. * @param x - The tile X coordinate.
  39012. * @param y - The tile Y coordinate.
  39013. * @param level - The tile level.
  39014. * @param longitude - The longitude at which to pick features.
  39015. * @param latitude - The latitude at which to pick features.
  39016. * @returns A promise for the picked features that will resolve when the asynchronous
  39017. * picking completes. The resolved value is an array of {@link ImageryLayerFeatureInfo}
  39018. * instances. The array may be empty if no features are found at the given location.
  39019. * It may also be undefined if picking is not supported.
  39020. */
  39021. pickFeatures(x: number, y: number, level: number, longitude: number, latitude: number): Promise<ImageryLayerFeatureInfo[]> | undefined;
  39022. }
  39023. /**
  39024. * Creates a {@link Cesium3DTileset} instance for the
  39025. * {@link https://cesium.com/content/cesium-osm-buildings/|Cesium OSM Buildings}
  39026. * tileset.
  39027. * @example
  39028. * // Create Cesium OSM Buildings with default styling
  39029. * var viewer = new Cesium.Viewer('cesiumContainer');
  39030. * viewer.scene.primitives.add(Cesium.createOsmBuildings());
  39031. * @example
  39032. * // Create Cesium OSM Buildings with a custom style highlighting
  39033. * // schools and hospitals.
  39034. * viewer.scene.primitives.add(Cesium.createOsmBuildings({
  39035. * style: new Cesium.Cesium3DTileStyle({
  39036. * color: {
  39037. * conditions: [
  39038. * ["${feature['building']} === 'hospital'", "color('#0000FF')"],
  39039. * ["${feature['building']} === 'school'", "color('#00FF00')"],
  39040. * [true, "color('#ffffff')"]
  39041. * ]
  39042. * }
  39043. * })
  39044. * }));
  39045. * @param [options] - Construction options. Any options allowed by the {@link Cesium3DTileset} constructor
  39046. * may be specified here. In addition to those, the following properties are supported:
  39047. * @param [options.defaultColor = Color.WHITE] - The default color to use for buildings
  39048. * that do not have a color. This parameter is ignored if <code>options.style</code> is specified.
  39049. * @param [options.style] - The style to use with the tileset. If not
  39050. * specified, a default style is used which gives each building or building part a
  39051. * color inferred from its OpenStreetMap <code>tags</code>. If no color can be inferred,
  39052. * <code>options.defaultColor</code> is used.
  39053. */
  39054. export function createOsmBuildings(options?: {
  39055. defaultColor?: Color;
  39056. style?: Cesium3DTileStyle;
  39057. }): Cesium3DTileset;
  39058. /**
  39059. * Creates a {@link Primitive} to visualize well-known vector vertex attributes:
  39060. * <code>normal</code>, <code>tangent</code>, and <code>bitangent</code>. Normal
  39061. * is red; tangent is green; and bitangent is blue. If an attribute is not
  39062. * present, it is not drawn.
  39063. * @example
  39064. * scene.primitives.add(Cesium.createTangentSpaceDebugPrimitive({
  39065. * geometry : instance.geometry,
  39066. * length : 100000.0,
  39067. * modelMatrix : instance.modelMatrix
  39068. * }));
  39069. * @param options - Object with the following properties:
  39070. * @param options.geometry - The <code>Geometry</code> instance with the attribute.
  39071. * @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.
  39072. * @param [options.modelMatrix = Matrix4.IDENTITY] - The model matrix that transforms to transform the geometry from model to world coordinates.
  39073. * @returns A new <code>Primitive</code> instance with geometry for the vectors.
  39074. */
  39075. export function createTangentSpaceDebugPrimitive(options: {
  39076. geometry: Geometry;
  39077. length?: number;
  39078. modelMatrix?: Matrix4;
  39079. }): Primitive;
  39080. /**
  39081. * Creates an {@link IonImageryProvider} instance for ion's default global base imagery layer, currently Bing Maps.
  39082. * @example
  39083. * // Create Cesium World Terrain with default settings
  39084. * var viewer = new Cesium.Viewer('cesiumContainer', {
  39085. * imageryProvider : Cesium.createWorldImagery();
  39086. * });
  39087. * @example
  39088. * // Create Cesium World Terrain with water and normals.
  39089. * var viewer = new Cesium.Viewer('cesiumContainer', {
  39090. * imageryProvider : Cesium.createWorldImagery({
  39091. * style: Cesium.IonWorldImageryStyle.AERIAL_WITH_LABELS
  39092. * })
  39093. * });
  39094. * @param [options] - Object with the following properties:
  39095. * @param [options.style = IonWorldImageryStyle] - The style of base imagery, only AERIAL, AERIAL_WITH_LABELS, and ROAD are currently supported.
  39096. */
  39097. export function createWorldImagery(options?: {
  39098. style?: IonWorldImageryStyle;
  39099. }): IonImageryProvider;
  39100. /**
  39101. * <span style="display: block; text-align: center;">
  39102. * <img src="Images/AnimationWidget.png" width="211" height="142" alt="" />
  39103. * <br />Animation widget
  39104. * </span>
  39105. * <br /><br />
  39106. * The Animation widget provides buttons for play, pause, and reverse, along with the
  39107. * current time and date, surrounded by a "shuttle ring" for controlling the speed of animation.
  39108. * <br /><br />
  39109. * The "shuttle ring" concept is borrowed from video editing, where typically a
  39110. * "jog wheel" can be rotated to move past individual animation frames very slowly, and
  39111. * a surrounding shuttle ring can be twisted to control direction and speed of fast playback.
  39112. * Cesium typically treats time as continuous (not broken into pre-defined animation frames),
  39113. * so this widget offers no jog wheel. Instead, the shuttle ring is capable of both fast and
  39114. * very slow playback. Click and drag the shuttle ring pointer itself (shown above in green),
  39115. * or click in the rest of the ring area to nudge the pointer to the next preset speed in that direction.
  39116. * <br /><br />
  39117. * The Animation widget also provides a "realtime" button (in the upper-left) that keeps
  39118. * animation time in sync with the end user's system clock, typically displaying
  39119. * "today" or "right now." This mode is not available in {@link ClockRange.CLAMPED} or
  39120. * {@link ClockRange.LOOP_STOP} mode if the current time is outside of {@link Clock}'s startTime and endTime.
  39121. * @example
  39122. * // In HTML head, include a link to Animation.css stylesheet,
  39123. * // and in the body, include: <div id="animationContainer"></div>
  39124. *
  39125. * var clock = new Cesium.Clock();
  39126. * var clockViewModel = new Cesium.ClockViewModel(clock);
  39127. * var viewModel = new Cesium.AnimationViewModel(clockViewModel);
  39128. * var widget = new Cesium.Animation('animationContainer', viewModel);
  39129. *
  39130. * function tick() {
  39131. * clock.tick();
  39132. * Cesium.requestAnimationFrame(tick);
  39133. * }
  39134. * Cesium.requestAnimationFrame(tick);
  39135. * @param container - The DOM element or ID that will contain the widget.
  39136. * @param viewModel - The view model used by this widget.
  39137. */
  39138. export class Animation {
  39139. constructor(container: Element | string, viewModel: AnimationViewModel);
  39140. /**
  39141. * Gets the parent container.
  39142. */
  39143. readonly container: Element;
  39144. /**
  39145. * Gets the view model.
  39146. */
  39147. readonly viewModel: AnimationViewModel;
  39148. /**
  39149. * @returns true if the object has been destroyed, false otherwise.
  39150. */
  39151. isDestroyed(): boolean;
  39152. /**
  39153. * Destroys the animation widget. Should be called if permanently
  39154. * removing the widget from layout.
  39155. */
  39156. destroy(): void;
  39157. /**
  39158. * Resizes the widget to match the container size.
  39159. * This function should be called whenever the container size is changed.
  39160. */
  39161. resize(): void;
  39162. /**
  39163. * Updates the widget to reflect any modified CSS rules for theming.
  39164. * @example
  39165. * //Switch to the cesium-lighter theme.
  39166. * document.body.className = 'cesium-lighter';
  39167. * animation.applyThemeChanges();
  39168. */
  39169. applyThemeChanges(): void;
  39170. }
  39171. /**
  39172. * The view model for the {@link Animation} widget.
  39173. * @param clockViewModel - The ClockViewModel instance to use.
  39174. */
  39175. export class AnimationViewModel {
  39176. constructor(clockViewModel: ClockViewModel);
  39177. /**
  39178. * Gets or sets whether the shuttle ring is currently being dragged. This property is observable.
  39179. */
  39180. shuttleRingDragging: boolean;
  39181. /**
  39182. * Gets or sets whether dragging the shuttle ring should cause the multiplier
  39183. * to snap to the defined tick values rather than interpolating between them.
  39184. * This property is observable.
  39185. */
  39186. snapToTicks: boolean;
  39187. /**
  39188. * Gets the string representation of the current time. This property is observable.
  39189. */
  39190. timeLabel: string;
  39191. /**
  39192. * Gets the string representation of the current date. This property is observable.
  39193. */
  39194. dateLabel: string;
  39195. /**
  39196. * Gets the string representation of the current multiplier. This property is observable.
  39197. */
  39198. multiplierLabel: string;
  39199. /**
  39200. * Gets or sets the current shuttle ring angle. This property is observable.
  39201. */
  39202. shuttleRingAngle: number;
  39203. /**
  39204. * Gets or sets the default date formatter used by new instances.
  39205. */
  39206. static defaultDateFormatter: AnimationViewModel.DateFormatter;
  39207. /**
  39208. * Gets or sets the default array of known clock multipliers associated with new instances of the shuttle ring.
  39209. */
  39210. static defaultTicks: number[];
  39211. /**
  39212. * Gets or sets the default time formatter used by new instances.
  39213. */
  39214. static defaultTimeFormatter: AnimationViewModel.TimeFormatter;
  39215. /**
  39216. * Gets a copy of the array of positive known clock multipliers to associate with the shuttle ring.
  39217. * @returns The array of known clock multipliers associated with the shuttle ring.
  39218. */
  39219. getShuttleRingTicks(): number[];
  39220. /**
  39221. * Sets the array of positive known clock multipliers to associate with the shuttle ring.
  39222. * These values will have negative equivalents created for them and sets both the minimum
  39223. * and maximum range of values for the shuttle ring as well as the values that are snapped
  39224. * to when a single click is made. The values need not be in order, as they will be sorted
  39225. * automatically, and duplicate values will be removed.
  39226. * @param positiveTicks - The list of known positive clock multipliers to associate with the shuttle ring.
  39227. */
  39228. setShuttleRingTicks(positiveTicks: number[]): void;
  39229. /**
  39230. * Gets a command that decreases the speed of animation.
  39231. */
  39232. slower: Command;
  39233. /**
  39234. * Gets a command that increases the speed of animation.
  39235. */
  39236. faster: Command;
  39237. /**
  39238. * Gets the clock view model.
  39239. */
  39240. clockViewModel: ClockViewModel;
  39241. /**
  39242. * Gets the pause toggle button view model.
  39243. */
  39244. pauseViewModel: ToggleButtonViewModel;
  39245. /**
  39246. * Gets the reverse toggle button view model.
  39247. */
  39248. playReverseViewModel: ToggleButtonViewModel;
  39249. /**
  39250. * Gets the play toggle button view model.
  39251. */
  39252. playForwardViewModel: ToggleButtonViewModel;
  39253. /**
  39254. * Gets the realtime toggle button view model.
  39255. */
  39256. playRealtimeViewModel: ToggleButtonViewModel;
  39257. /**
  39258. * Gets or sets the function which formats a date for display.
  39259. */
  39260. dateFormatter: AnimationViewModel.DateFormatter;
  39261. /**
  39262. * Gets or sets the function which formats a time for display.
  39263. */
  39264. timeFormatter: AnimationViewModel.TimeFormatter;
  39265. }
  39266. export namespace AnimationViewModel {
  39267. /**
  39268. * A function that formats a date for display.
  39269. * @param date - The date to be formatted
  39270. * @param viewModel - The AnimationViewModel instance requesting formatting.
  39271. */
  39272. type DateFormatter = (date: JulianDate, viewModel: AnimationViewModel) => string;
  39273. /**
  39274. * A function that formats a time for display.
  39275. * @param date - The date to be formatted
  39276. * @param viewModel - The AnimationViewModel instance requesting formatting.
  39277. */
  39278. type TimeFormatter = (date: JulianDate, viewModel: AnimationViewModel) => string;
  39279. }
  39280. /**
  39281. * <span style="display: block; text-align: center;">
  39282. * <img src="Images/BaseLayerPicker.png" width="264" height="287" alt="" />
  39283. * <br />BaseLayerPicker with its drop-panel open.
  39284. * </span>
  39285. * <br /><br />
  39286. * The BaseLayerPicker is a single button widget that displays a panel of available imagery and
  39287. * terrain providers. When imagery is selected, the corresponding imagery layer is created and inserted
  39288. * as the base layer of the imagery collection; removing the existing base. When terrain is selected,
  39289. * it replaces the current terrain provider. Each item in the available providers list contains a name,
  39290. * a representative icon, and a tooltip to display more information when hovered. The list is initially
  39291. * empty, and must be configured before use, as illustrated in the below example.
  39292. * @example
  39293. * // In HTML head, include a link to the BaseLayerPicker.css stylesheet,
  39294. * // and in the body, include: <div id="baseLayerPickerContainer"
  39295. * // style="position:absolute;top:24px;right:24px;width:38px;height:38px;"></div>
  39296. *
  39297. * //Create the list of available providers we would like the user to select from.
  39298. * //This example uses 3, OpenStreetMap, The Black Marble, and a single, non-streaming world image.
  39299. * var imageryViewModels = [];
  39300. * imageryViewModels.push(new Cesium.ProviderViewModel({
  39301. * name : 'Open\u00adStreet\u00adMap',
  39302. * iconUrl : Cesium.buildModuleUrl('Widgets/Images/ImageryProviders/openStreetMap.png'),
  39303. * tooltip : 'OpenStreetMap (OSM) is a collaborative project to create a free editable \
  39304. * map of the world.\nhttp://www.openstreetmap.org',
  39305. * creationFunction : function() {
  39306. * return new Cesium.OpenStreetMapImageryProvider({
  39307. * url : 'https://a.tile.openstreetmap.org/'
  39308. * });
  39309. * }
  39310. * }));
  39311. *
  39312. * imageryViewModels.push(new Cesium.ProviderViewModel({
  39313. * name : 'Earth at Night',
  39314. * iconUrl : Cesium.buildModuleUrl('Widgets/Images/ImageryProviders/blackMarble.png'),
  39315. * tooltip : 'The lights of cities and villages trace the outlines of civilization \
  39316. * in this global view of the Earth at night as seen by NASA/NOAA\'s Suomi NPP satellite.',
  39317. * creationFunction : function() {
  39318. * return new Cesium.IonImageryProvider({ assetId: 3812 });
  39319. * }
  39320. * }));
  39321. *
  39322. * imageryViewModels.push(new Cesium.ProviderViewModel({
  39323. * name : 'Natural Earth\u00a0II',
  39324. * iconUrl : Cesium.buildModuleUrl('Widgets/Images/ImageryProviders/naturalEarthII.png'),
  39325. * tooltip : 'Natural Earth II, darkened for contrast.\nhttp://www.naturalearthdata.com/',
  39326. * creationFunction : function() {
  39327. * return new Cesium.TileMapServiceImageryProvider({
  39328. * url : Cesium.buildModuleUrl('Assets/Textures/NaturalEarthII')
  39329. * });
  39330. * }
  39331. * }));
  39332. *
  39333. * //Create a CesiumWidget without imagery, if you haven't already done so.
  39334. * var cesiumWidget = new Cesium.CesiumWidget('cesiumContainer', { imageryProvider: false });
  39335. *
  39336. * //Finally, create the baseLayerPicker widget using our view models.
  39337. * var layers = cesiumWidget.imageryLayers;
  39338. * var baseLayerPicker = new Cesium.BaseLayerPicker('baseLayerPickerContainer', {
  39339. * globe : cesiumWidget.scene.globe,
  39340. * imageryProviderViewModels : imageryViewModels
  39341. * });
  39342. * @param container - The parent HTML container node or ID for this widget.
  39343. * @param options - Object with the following properties:
  39344. * @param options.globe - The Globe to use.
  39345. * @param [options.imageryProviderViewModels = []] - The array of ProviderViewModel instances to use for imagery.
  39346. * @param [options.selectedImageryProviderViewModel] - The view model for the current base imagery layer, if not supplied the first available imagery layer is used.
  39347. * @param [options.terrainProviderViewModels = []] - The array of ProviderViewModel instances to use for terrain.
  39348. * @param [options.selectedTerrainProviderViewModel] - The view model for the current base terrain layer, if not supplied the first available terrain layer is used.
  39349. */
  39350. export class BaseLayerPicker {
  39351. constructor(container: Element | string, options: {
  39352. globe: Globe;
  39353. imageryProviderViewModels?: ProviderViewModel[];
  39354. selectedImageryProviderViewModel?: ProviderViewModel;
  39355. terrainProviderViewModels?: ProviderViewModel[];
  39356. selectedTerrainProviderViewModel?: ProviderViewModel;
  39357. });
  39358. /**
  39359. * Gets the parent container.
  39360. */
  39361. container: Element;
  39362. /**
  39363. * Gets the view model.
  39364. */
  39365. viewModel: BaseLayerPickerViewModel;
  39366. /**
  39367. * @returns true if the object has been destroyed, false otherwise.
  39368. */
  39369. isDestroyed(): boolean;
  39370. /**
  39371. * Destroys the widget. Should be called if permanently
  39372. * removing the widget from layout.
  39373. */
  39374. destroy(): void;
  39375. }
  39376. /**
  39377. * The view model for {@link BaseLayerPicker}.
  39378. * @param options - Object with the following properties:
  39379. * @param options.globe - The Globe to use.
  39380. * @param [options.imageryProviderViewModels = []] - The array of ProviderViewModel instances to use for imagery.
  39381. * @param [options.selectedImageryProviderViewModel] - The view model for the current base imagery layer, if not supplied the first available imagery layer is used.
  39382. * @param [options.terrainProviderViewModels = []] - The array of ProviderViewModel instances to use for terrain.
  39383. * @param [options.selectedTerrainProviderViewModel] - The view model for the current base terrain layer, if not supplied the first available terrain layer is used.
  39384. */
  39385. export class BaseLayerPickerViewModel {
  39386. constructor(options: {
  39387. globe: Globe;
  39388. imageryProviderViewModels?: ProviderViewModel[];
  39389. selectedImageryProviderViewModel?: ProviderViewModel;
  39390. terrainProviderViewModels?: ProviderViewModel[];
  39391. selectedTerrainProviderViewModel?: ProviderViewModel;
  39392. });
  39393. /**
  39394. * Gets or sets an array of ProviderViewModel instances available for imagery selection.
  39395. * This property is observable.
  39396. */
  39397. imageryProviderViewModels: ProviderViewModel[];
  39398. /**
  39399. * Gets or sets an array of ProviderViewModel instances available for terrain selection.
  39400. * This property is observable.
  39401. */
  39402. terrainProviderViewModels: ProviderViewModel[];
  39403. /**
  39404. * Gets or sets whether the imagery selection drop-down is currently visible.
  39405. */
  39406. dropDownVisible: boolean;
  39407. /**
  39408. * Gets the button tooltip. This property is observable.
  39409. */
  39410. buttonTooltip: string;
  39411. /**
  39412. * Gets the button background image. This property is observable.
  39413. */
  39414. buttonImageUrl: string;
  39415. /**
  39416. * Gets or sets the currently selected imagery. This property is observable.
  39417. */
  39418. selectedImagery: ProviderViewModel;
  39419. /**
  39420. * Gets or sets the currently selected terrain. This property is observable.
  39421. */
  39422. selectedTerrain: ProviderViewModel;
  39423. /**
  39424. * Gets the command to toggle the visibility of the drop down.
  39425. */
  39426. toggleDropDown: Command;
  39427. /**
  39428. * Gets the globe.
  39429. */
  39430. globe: Globe;
  39431. }
  39432. /**
  39433. * A view model that represents each item in the {@link BaseLayerPicker}.
  39434. * @param options - The object containing all parameters.
  39435. * @param options.name - The name of the layer.
  39436. * @param options.tooltip - The tooltip to show when the item is moused over.
  39437. * @param options.iconUrl - An icon representing the layer.
  39438. * @param [options.category] - A category for the layer.
  39439. * @param options.creationFunction - A function or Command
  39440. * that creates one or more providers which will be added to the globe when this item is selected.
  39441. */
  39442. export class ProviderViewModel {
  39443. constructor(options: {
  39444. name: string;
  39445. tooltip: string;
  39446. iconUrl: string;
  39447. category?: string;
  39448. creationFunction: ProviderViewModel.CreationFunction | Command;
  39449. });
  39450. /**
  39451. * Gets the display name. This property is observable.
  39452. */
  39453. name: string;
  39454. /**
  39455. * Gets the tooltip. This property is observable.
  39456. */
  39457. tooltip: string;
  39458. /**
  39459. * Gets the icon. This property is observable.
  39460. */
  39461. iconUrl: string;
  39462. /**
  39463. * Gets the Command that creates one or more providers which will be added to
  39464. * the globe when this item is selected.
  39465. */
  39466. readonly creationCommand: Command;
  39467. /**
  39468. * Gets the category
  39469. */
  39470. readonly category: string;
  39471. }
  39472. export namespace ProviderViewModel {
  39473. /**
  39474. * A function which creates one or more providers.
  39475. */
  39476. type CreationFunction = () => ImageryProvider | TerrainProvider | ImageryProvider[] | TerrainProvider[];
  39477. }
  39478. /**
  39479. * Inspector widget to aid in debugging 3D Tiles
  39480. * @param container - The DOM element or ID that will contain the widget.
  39481. * @param scene - the Scene instance to use.
  39482. */
  39483. export class Cesium3DTilesInspector {
  39484. constructor(container: Element | string, scene: Scene);
  39485. /**
  39486. * Gets the parent container.
  39487. */
  39488. container: Element;
  39489. /**
  39490. * Gets the view model.
  39491. */
  39492. viewModel: Cesium3DTilesInspectorViewModel;
  39493. /**
  39494. * @returns true if the object has been destroyed, false otherwise.
  39495. */
  39496. isDestroyed(): boolean;
  39497. /**
  39498. * Destroys the widget. Should be called if permanently
  39499. * removing the widget from layout.
  39500. */
  39501. destroy(): void;
  39502. }
  39503. /**
  39504. * The view model for {@link Cesium3DTilesInspector}.
  39505. * @param scene - The scene instance to use.
  39506. * @param performanceContainer - The container for the performance display
  39507. */
  39508. export class Cesium3DTilesInspectorViewModel {
  39509. constructor(scene: Scene, performanceContainer: HTMLElement);
  39510. /**
  39511. * Gets or sets the flag to enable performance display. This property is observable.
  39512. */
  39513. performance: boolean;
  39514. /**
  39515. * Gets or sets the flag to show statistics. This property is observable.
  39516. */
  39517. showStatistics: boolean;
  39518. /**
  39519. * Gets or sets the flag to show pick statistics. This property is observable.
  39520. */
  39521. showPickStatistics: boolean;
  39522. /**
  39523. * Gets or sets the flag to show the inspector. This property is observable.
  39524. */
  39525. inspectorVisible: boolean;
  39526. /**
  39527. * Gets or sets the flag to show the tileset section. This property is observable.
  39528. */
  39529. tilesetVisible: boolean;
  39530. /**
  39531. * Gets or sets the flag to show the display section. This property is observable.
  39532. */
  39533. displayVisible: boolean;
  39534. /**
  39535. * Gets or sets the flag to show the update section. This property is observable.
  39536. */
  39537. updateVisible: boolean;
  39538. /**
  39539. * Gets or sets the flag to show the logging section. This property is observable.
  39540. */
  39541. loggingVisible: boolean;
  39542. /**
  39543. * Gets or sets the flag to show the style section. This property is observable.
  39544. */
  39545. styleVisible: boolean;
  39546. /**
  39547. * Gets or sets the flag to show the tile info section. This property is observable.
  39548. */
  39549. tileDebugLabelsVisible: boolean;
  39550. /**
  39551. * Gets or sets the flag to show the optimization info section. This property is observable.
  39552. */
  39553. optimizationVisible: boolean;
  39554. /**
  39555. * Gets or sets the JSON for the tileset style. This property is observable.
  39556. */
  39557. styleString: string;
  39558. /**
  39559. * Gets the names of the properties in the tileset. This property is observable.
  39560. */
  39561. readonly properties: string[];
  39562. /**
  39563. * Gets or sets the flag to enable dynamic screen space error. This property is observable.
  39564. */
  39565. dynamicScreenSpaceError: boolean;
  39566. /**
  39567. * Gets or sets the color blend mode. This property is observable.
  39568. */
  39569. colorBlendMode: Cesium3DTileColorBlendMode;
  39570. /**
  39571. * Gets or sets the flag to enable picking. This property is observable.
  39572. */
  39573. picking: boolean;
  39574. /**
  39575. * Gets or sets the flag to colorize tiles. This property is observable.
  39576. */
  39577. colorize: boolean;
  39578. /**
  39579. * Gets or sets the flag to draw with wireframe. This property is observable.
  39580. */
  39581. wireframe: boolean;
  39582. /**
  39583. * Gets or sets the flag to show bounding volumes. This property is observable.
  39584. */
  39585. showBoundingVolumes: boolean;
  39586. /**
  39587. * Gets or sets the flag to show content volumes. This property is observable.
  39588. */
  39589. showContentBoundingVolumes: boolean;
  39590. /**
  39591. * Gets or sets the flag to show request volumes. This property is observable.
  39592. */
  39593. showRequestVolumes: boolean;
  39594. /**
  39595. * Gets or sets the flag to suspend updates. This property is observable.
  39596. */
  39597. freezeFrame: boolean;
  39598. /**
  39599. * Gets or sets the flag to show debug labels only for the currently picked tile. This property is observable.
  39600. */
  39601. showOnlyPickedTileDebugLabel: boolean;
  39602. /**
  39603. * Gets or sets the flag to show tile geometric error. This property is observable.
  39604. */
  39605. showGeometricError: boolean;
  39606. /**
  39607. * Displays the number of commands, points, triangles and features used per tile. This property is observable.
  39608. */
  39609. showRenderingStatistics: boolean;
  39610. /**
  39611. * Displays the memory used per tile. This property is observable.
  39612. */
  39613. showMemoryUsage: boolean;
  39614. /**
  39615. * Gets or sets the flag to show the tile url. This property is observable.
  39616. */
  39617. showUrl: boolean;
  39618. /**
  39619. * Gets or sets the maximum screen space error. This property is observable.
  39620. */
  39621. maximumScreenSpaceError: number;
  39622. /**
  39623. * Gets or sets the dynamic screen space error density. This property is observable.
  39624. */
  39625. dynamicScreenSpaceErrorDensity: number;
  39626. /**
  39627. * Gets or sets the dynamic screen space error density slider value.
  39628. * This allows the slider to be exponential because values tend to be closer to 0 than 1.
  39629. * This property is observable.
  39630. */
  39631. dynamicScreenSpaceErrorDensitySliderValue: number;
  39632. /**
  39633. * Gets or sets the dynamic screen space error factor. This property is observable.
  39634. */
  39635. dynamicScreenSpaceErrorFactor: number;
  39636. /**
  39637. * Gets or sets the flag to enable point cloud shading. This property is observable.
  39638. */
  39639. pointCloudShading: boolean;
  39640. /**
  39641. * Gets or sets the geometric error scale. This property is observable.
  39642. */
  39643. geometricErrorScale: number;
  39644. /**
  39645. * Gets or sets the maximum attenuation. This property is observable.
  39646. */
  39647. maximumAttenuation: number;
  39648. /**
  39649. * Gets or sets the base resolution. This property is observable.
  39650. */
  39651. baseResolution: number;
  39652. /**
  39653. * Gets or sets the flag to enable eye dome lighting. This property is observable.
  39654. */
  39655. eyeDomeLighting: boolean;
  39656. /**
  39657. * Gets or sets the eye dome lighting strength. This property is observable.
  39658. */
  39659. eyeDomeLightingStrength: number;
  39660. /**
  39661. * Gets or sets the eye dome lighting radius. This property is observable.
  39662. */
  39663. eyeDomeLightingRadius: number;
  39664. /**
  39665. * Gets or sets the pick state
  39666. */
  39667. pickActive: boolean;
  39668. /**
  39669. * Gets or sets the flag to determine if level of detail skipping should be applied during the traversal.
  39670. * This property is observable.
  39671. */
  39672. skipLevelOfDetail: boolean;
  39673. /**
  39674. * Gets or sets the multiplier defining the minimum screen space error to skip. This property is observable.
  39675. */
  39676. skipScreenSpaceErrorFactor: number;
  39677. /**
  39678. * Gets or sets the screen space error that must be reached before skipping levels of detail. This property is observable.
  39679. */
  39680. baseScreenSpaceError: number;
  39681. /**
  39682. * Gets or sets the constant defining the minimum number of levels to skip when loading tiles. This property is observable.
  39683. */
  39684. skipLevels: number;
  39685. /**
  39686. * Gets or sets the flag which, when true, only tiles that meet the maximum screen space error will ever be downloaded.
  39687. * This property is observable.
  39688. */
  39689. immediatelyLoadDesiredLevelOfDetail: boolean;
  39690. /**
  39691. * Gets or sets the flag which determines whether siblings of visible tiles are always downloaded during traversal.
  39692. * This property is observable
  39693. */
  39694. loadSiblings: boolean;
  39695. /**
  39696. * Gets the scene
  39697. */
  39698. readonly scene: Scene;
  39699. /**
  39700. * Gets the performance container
  39701. */
  39702. readonly performanceContainer: HTMLElement;
  39703. /**
  39704. * Gets the statistics text. This property is observable.
  39705. */
  39706. readonly statisticsText: string;
  39707. /**
  39708. * Gets the pick statistics text. This property is observable.
  39709. */
  39710. readonly pickStatisticsText: string;
  39711. /**
  39712. * Gets the available blend modes
  39713. */
  39714. readonly colorBlendModes: object[];
  39715. /**
  39716. * Gets the editor error message
  39717. */
  39718. readonly editorError: string;
  39719. /**
  39720. * Gets or sets the tileset of the view model.
  39721. */
  39722. tileset: Cesium3DTileset;
  39723. /**
  39724. * Gets the current feature of the view model.
  39725. */
  39726. feature: Cesium3DTileFeature;
  39727. /**
  39728. * Gets the current tile of the view model
  39729. */
  39730. tile: Cesium3DTile;
  39731. /**
  39732. * Toggles the pick tileset mode
  39733. */
  39734. togglePickTileset(): void;
  39735. /**
  39736. * Toggles the inspector visibility
  39737. */
  39738. toggleInspector(): void;
  39739. /**
  39740. * Toggles the visibility of the tileset section
  39741. */
  39742. toggleTileset(): void;
  39743. /**
  39744. * Toggles the visibility of the display section
  39745. */
  39746. toggleDisplay(): void;
  39747. /**
  39748. * Toggles the visibility of the update section
  39749. */
  39750. toggleUpdate(): void;
  39751. /**
  39752. * Toggles the visibility of the logging section
  39753. */
  39754. toggleLogging(): void;
  39755. /**
  39756. * Toggles the visibility of the style section
  39757. */
  39758. toggleStyle(): void;
  39759. /**
  39760. * Toggles the visibility of the tile Debug Info section
  39761. */
  39762. toggleTileDebugLabels(): void;
  39763. /**
  39764. * Toggles the visibility of the optimization section
  39765. */
  39766. toggleOptimization(): void;
  39767. /**
  39768. * Trims tile cache
  39769. */
  39770. trimTilesCache(): void;
  39771. /**
  39772. * Compiles the style in the style editor.
  39773. */
  39774. compileStyle(): void;
  39775. /**
  39776. * Handles key press events on the style editor.
  39777. */
  39778. styleEditorKeyPress(): void;
  39779. /**
  39780. * @returns true if the object has been destroyed, false otherwise.
  39781. */
  39782. isDestroyed(): boolean;
  39783. /**
  39784. * Destroys the widget. Should be called if permanently
  39785. * removing the widget from layout.
  39786. */
  39787. destroy(): void;
  39788. /**
  39789. * Generates an HTML string of the statistics
  39790. * @param tileset - The tileset
  39791. * @param isPick - Whether this is getting the statistics for the pick pass
  39792. * @returns The formatted statistics
  39793. */
  39794. static getStatistics(tileset: Cesium3DTileset, isPick: boolean): string;
  39795. }
  39796. /**
  39797. * Inspector widget to aid in debugging
  39798. * @param container - The DOM element or ID that will contain the widget.
  39799. * @param scene - The Scene instance to use.
  39800. */
  39801. export class CesiumInspector {
  39802. constructor(container: Element | string, scene: Scene);
  39803. /**
  39804. * Gets the parent container.
  39805. */
  39806. container: Element;
  39807. /**
  39808. * Gets the view model.
  39809. */
  39810. viewModel: CesiumInspectorViewModel;
  39811. /**
  39812. * @returns true if the object has been destroyed, false otherwise.
  39813. */
  39814. isDestroyed(): boolean;
  39815. /**
  39816. * Destroys the widget. Should be called if permanently
  39817. * removing the widget from layout.
  39818. */
  39819. destroy(): void;
  39820. }
  39821. /**
  39822. * The view model for {@link CesiumInspector}.
  39823. * @param scene - The scene instance to use.
  39824. * @param performanceContainer - The instance to use for performance container.
  39825. */
  39826. export class CesiumInspectorViewModel {
  39827. constructor(scene: Scene, performanceContainer: Element);
  39828. /**
  39829. * Gets or sets the show frustums state. This property is observable.
  39830. */
  39831. frustums: boolean;
  39832. /**
  39833. * Gets or sets the show frustum planes state. This property is observable.
  39834. */
  39835. frustumPlanes: boolean;
  39836. /**
  39837. * Gets or sets the show performance display state. This property is observable.
  39838. */
  39839. performance: boolean;
  39840. /**
  39841. * Gets or sets the shader cache text. This property is observable.
  39842. */
  39843. shaderCacheText: string;
  39844. /**
  39845. * Gets or sets the show primitive bounding sphere state. This property is observable.
  39846. */
  39847. primitiveBoundingSphere: boolean;
  39848. /**
  39849. * Gets or sets the show primitive reference frame state. This property is observable.
  39850. */
  39851. primitiveReferenceFrame: boolean;
  39852. /**
  39853. * Gets or sets the filter primitive state. This property is observable.
  39854. */
  39855. filterPrimitive: boolean;
  39856. /**
  39857. * Gets or sets the show tile bounding sphere state. This property is observable.
  39858. */
  39859. tileBoundingSphere: boolean;
  39860. /**
  39861. * Gets or sets the filter tile state. This property is observable.
  39862. */
  39863. filterTile: boolean;
  39864. /**
  39865. * Gets or sets the show wireframe state. This property is observable.
  39866. */
  39867. wireframe: boolean;
  39868. /**
  39869. * Gets or sets the show globe depth state. This property is observable.
  39870. */
  39871. globeDepth: boolean;
  39872. /**
  39873. * Gets or sets the show pick depth state. This property is observable.
  39874. */
  39875. pickDepth: boolean;
  39876. /**
  39877. * Gets or sets the index of the depth frustum to display. This property is observable.
  39878. */
  39879. depthFrustum: number;
  39880. /**
  39881. * Gets or sets the suspend updates state. This property is observable.
  39882. */
  39883. suspendUpdates: boolean;
  39884. /**
  39885. * Gets or sets the show tile coordinates state. This property is observable.
  39886. */
  39887. tileCoordinates: boolean;
  39888. /**
  39889. * Gets or sets the frustum statistic text. This property is observable.
  39890. */
  39891. frustumStatisticText: string;
  39892. /**
  39893. * Gets or sets the selected tile information text. This property is observable.
  39894. */
  39895. tileText: string;
  39896. /**
  39897. * Gets if a primitive has been selected. This property is observable.
  39898. */
  39899. hasPickedPrimitive: boolean;
  39900. /**
  39901. * Gets if a tile has been selected. This property is observable
  39902. */
  39903. hasPickedTile: boolean;
  39904. /**
  39905. * Gets if the picking primitive command is active. This property is observable.
  39906. */
  39907. pickPrimitiveActive: boolean;
  39908. /**
  39909. * Gets if the picking tile command is active. This property is observable.
  39910. */
  39911. pickTileActive: boolean;
  39912. /**
  39913. * Gets or sets if the cesium inspector drop down is visible. This property is observable.
  39914. */
  39915. dropDownVisible: boolean;
  39916. /**
  39917. * Gets or sets if the general section is visible. This property is observable.
  39918. */
  39919. generalVisible: boolean;
  39920. /**
  39921. * Gets or sets if the primitive section is visible. This property is observable.
  39922. */
  39923. primitivesVisible: boolean;
  39924. /**
  39925. * Gets or sets if the terrain section is visible. This property is observable.
  39926. */
  39927. terrainVisible: boolean;
  39928. /**
  39929. * Gets or sets the index of the depth frustum text. This property is observable.
  39930. */
  39931. depthFrustumText: string;
  39932. /**
  39933. * Gets the scene to control.
  39934. */
  39935. scene: Scene;
  39936. /**
  39937. * Gets the container of the PerformanceDisplay
  39938. */
  39939. performanceContainer: Element;
  39940. /**
  39941. * Gets the command to toggle the visibility of the drop down.
  39942. */
  39943. toggleDropDown: Command;
  39944. /**
  39945. * Gets the command to toggle the visibility of a BoundingSphere for a primitive
  39946. */
  39947. showPrimitiveBoundingSphere: Command;
  39948. /**
  39949. * Gets the command to toggle the visibility of a {@link DebugModelMatrixPrimitive} for the model matrix of a primitive
  39950. */
  39951. showPrimitiveReferenceFrame: Command;
  39952. /**
  39953. * Gets the command to toggle a filter that renders only a selected primitive
  39954. */
  39955. doFilterPrimitive: Command;
  39956. /**
  39957. * Gets the command to increment the depth frustum index to be shown
  39958. */
  39959. incrementDepthFrustum: Command;
  39960. /**
  39961. * Gets the command to decrement the depth frustum index to be shown
  39962. */
  39963. decrementDepthFrustum: Command;
  39964. /**
  39965. * Gets the command to toggle the visibility of tile coordinates
  39966. */
  39967. showTileCoordinates: Command;
  39968. /**
  39969. * Gets the command to toggle the visibility of a BoundingSphere for a selected tile
  39970. */
  39971. showTileBoundingSphere: Command;
  39972. /**
  39973. * Gets the command to toggle a filter that renders only a selected tile
  39974. */
  39975. doFilterTile: Command;
  39976. /**
  39977. * Gets the command to expand and collapse the general section
  39978. */
  39979. toggleGeneral: Command;
  39980. /**
  39981. * Gets the command to expand and collapse the primitives section
  39982. */
  39983. togglePrimitives: Command;
  39984. /**
  39985. * Gets the command to expand and collapse the terrain section
  39986. */
  39987. toggleTerrain: Command;
  39988. /**
  39989. * Gets the command to pick a primitive
  39990. */
  39991. pickPrimitive: Command;
  39992. /**
  39993. * Gets the command to pick a tile
  39994. */
  39995. pickTile: Command;
  39996. /**
  39997. * Gets the command to pick a tile
  39998. */
  39999. selectParent: Command;
  40000. /**
  40001. * Gets the command to pick a tile
  40002. */
  40003. selectNW: Command;
  40004. /**
  40005. * Gets the command to pick a tile
  40006. */
  40007. selectNE: Command;
  40008. /**
  40009. * Gets the command to pick a tile
  40010. */
  40011. selectSW: Command;
  40012. /**
  40013. * Gets the command to pick a tile
  40014. */
  40015. selectSE: Command;
  40016. /**
  40017. * Gets or sets the current selected primitive
  40018. */
  40019. primitive: Command;
  40020. /**
  40021. * Gets or sets the current selected tile
  40022. */
  40023. tile: Command;
  40024. /**
  40025. * @returns true if the object has been destroyed, false otherwise.
  40026. */
  40027. isDestroyed(): boolean;
  40028. /**
  40029. * Destroys the widget. Should be called if permanently
  40030. * removing the widget from layout.
  40031. */
  40032. destroy(): void;
  40033. }
  40034. /**
  40035. * A widget containing a Cesium scene.
  40036. * @example
  40037. * // For each example, include a link to CesiumWidget.css stylesheet in HTML head,
  40038. * // and in the body, include: <div id="cesiumContainer"></div>
  40039. *
  40040. * //Widget with no terrain and default Bing Maps imagery provider.
  40041. * var widget = new Cesium.CesiumWidget('cesiumContainer');
  40042. *
  40043. * //Widget with ion imagery and Cesium World Terrain.
  40044. * var widget = new Cesium.CesiumWidget('cesiumContainer', {
  40045. * imageryProvider : Cesium.createWorldImagery(),
  40046. * terrainProvider : Cesium.createWorldTerrain(),
  40047. * skyBox : new Cesium.SkyBox({
  40048. * sources : {
  40049. * positiveX : 'stars/TychoSkymapII.t3_08192x04096_80_px.jpg',
  40050. * negativeX : 'stars/TychoSkymapII.t3_08192x04096_80_mx.jpg',
  40051. * positiveY : 'stars/TychoSkymapII.t3_08192x04096_80_py.jpg',
  40052. * negativeY : 'stars/TychoSkymapII.t3_08192x04096_80_my.jpg',
  40053. * positiveZ : 'stars/TychoSkymapII.t3_08192x04096_80_pz.jpg',
  40054. * negativeZ : 'stars/TychoSkymapII.t3_08192x04096_80_mz.jpg'
  40055. * }
  40056. * }),
  40057. * // Show Columbus View map with Web Mercator projection
  40058. * sceneMode : Cesium.SceneMode.COLUMBUS_VIEW,
  40059. * mapProjection : new Cesium.WebMercatorProjection()
  40060. * });
  40061. * @param container - The DOM element or ID that will contain the widget.
  40062. * @param [options] - Object with the following properties:
  40063. * @param [options.clock = new Clock()] - The clock to use to control current time.
  40064. * @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.
  40065. * @param [options.terrainProvider = new EllipsoidTerrainProvider] - The terrain provider.
  40066. * @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.
  40067. * @param [options.skyAtmosphere] - Blue sky, and the glow around the Earth's limb. Set to <code>false</code> to turn it off.
  40068. * @param [options.sceneMode = SceneMode.SCENE3D] - The initial scene mode.
  40069. * @param [options.scene3DOnly = false] - When <code>true</code>, each geometry instance will only be rendered in 3D to save GPU memory.
  40070. * @param [options.orderIndependentTranslucency = true] - If true and the configuration supports it, use order independent translucency.
  40071. * @param [options.mapProjection = new GeographicProjection()] - The map projection to use in 2D and Columbus View modes.
  40072. * @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.
  40073. * @param [options.useDefaultRenderLoop = true] - True if this widget should control the render loop, false otherwise.
  40074. * @param [options.useBrowserRecommendedResolution = true] - If true, render at the browser's recommended resolution and ignore <code>window.devicePixelRatio</code>.
  40075. * @param [options.targetFrameRate] - The target frame rate when using the default render loop.
  40076. * @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.
  40077. * @param [options.contextOptions] - Context and WebGL creation properties corresponding to <code>options</code> passed to {@link Scene}.
  40078. * @param [options.creditContainer] - The DOM element or ID that will contain the {@link CreditDisplay}. If not specified, the credits are added
  40079. * to the bottom of the widget itself.
  40080. * @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.
  40081. * @param [options.terrainExaggeration = 1.0] - A scalar used to exaggerate the terrain. Note that terrain exaggeration will not modify any other primitive as they are positioned relative to the ellipsoid.
  40082. * @param [options.shadows = false] - Determines if shadows are cast by light sources.
  40083. * @param [options.terrainShadows = ShadowMode.RECEIVE_ONLY] - Determines if the terrain casts or receives shadows from light sources.
  40084. * @param [options.mapMode2D = MapMode2D.INFINITE_SCROLL] - Determines if the 2D map is rotatable or can be scrolled infinitely in the horizontal direction.
  40085. * @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}.
  40086. * @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}.
  40087. */
  40088. export class CesiumWidget {
  40089. constructor(container: Element | string, options?: {
  40090. clock?: Clock;
  40091. imageryProvider?: ImageryProvider | false;
  40092. terrainProvider?: TerrainProvider;
  40093. skyBox?: SkyBox | false;
  40094. skyAtmosphere?: SkyAtmosphere | false;
  40095. sceneMode?: SceneMode;
  40096. scene3DOnly?: boolean;
  40097. orderIndependentTranslucency?: boolean;
  40098. mapProjection?: MapProjection;
  40099. globe?: Globe | false;
  40100. useDefaultRenderLoop?: boolean;
  40101. useBrowserRecommendedResolution?: boolean;
  40102. targetFrameRate?: number;
  40103. showRenderLoopErrors?: boolean;
  40104. contextOptions?: any;
  40105. creditContainer?: Element | string;
  40106. creditViewport?: Element | string;
  40107. terrainExaggeration?: number;
  40108. shadows?: boolean;
  40109. terrainShadows?: ShadowMode;
  40110. mapMode2D?: MapMode2D;
  40111. requestRenderMode?: boolean;
  40112. maximumRenderTimeChange?: number;
  40113. });
  40114. /**
  40115. * Gets the parent container.
  40116. */
  40117. readonly container: Element;
  40118. /**
  40119. * Gets the canvas.
  40120. */
  40121. readonly canvas: HTMLCanvasElement;
  40122. /**
  40123. * Gets the credit container.
  40124. */
  40125. readonly creditContainer: Element;
  40126. /**
  40127. * Gets the credit viewport
  40128. */
  40129. readonly creditViewport: Element;
  40130. /**
  40131. * Gets the scene.
  40132. */
  40133. readonly scene: Scene;
  40134. /**
  40135. * Gets the collection of image layers that will be rendered on the globe.
  40136. */
  40137. readonly imageryLayers: ImageryLayerCollection;
  40138. /**
  40139. * The terrain provider providing surface geometry for the globe.
  40140. */
  40141. terrainProvider: TerrainProvider;
  40142. /**
  40143. * Gets the camera.
  40144. */
  40145. readonly camera: Camera;
  40146. /**
  40147. * Gets the clock.
  40148. */
  40149. readonly clock: Clock;
  40150. /**
  40151. * Gets the screen space event handler.
  40152. */
  40153. readonly screenSpaceEventHandler: ScreenSpaceEventHandler;
  40154. /**
  40155. * Gets or sets the target frame rate of the widget when <code>useDefaultRenderLoop</code>
  40156. * is true. If undefined, the browser's {@link requestAnimationFrame} implementation
  40157. * determines the frame rate. If defined, this value must be greater than 0. A value higher
  40158. * than the underlying requestAnimationFrame implementation will have no effect.
  40159. */
  40160. targetFrameRate: number;
  40161. /**
  40162. * Gets or sets whether or not this widget should control the render loop.
  40163. * If set to true the widget will use {@link requestAnimationFrame} to
  40164. * perform rendering and resizing of the widget, as well as drive the
  40165. * simulation clock. If set to false, you must manually call the
  40166. * <code>resize</code>, <code>render</code> methods as part of a custom
  40167. * render loop. If an error occurs during rendering, {@link Scene}'s
  40168. * <code>renderError</code> event will be raised and this property
  40169. * will be set to false. It must be set back to true to continue rendering
  40170. * after the error.
  40171. */
  40172. useDefaultRenderLoop: boolean;
  40173. /**
  40174. * Gets or sets a scaling factor for rendering resolution. Values less than 1.0 can improve
  40175. * performance on less powerful devices while values greater than 1.0 will render at a higher
  40176. * resolution and then scale down, resulting in improved visual fidelity.
  40177. * For example, if the widget is laid out at a size of 640x480, setting this value to 0.5
  40178. * will cause the scene to be rendered at 320x240 and then scaled up while setting
  40179. * it to 2.0 will cause the scene to be rendered at 1280x960 and then scaled down.
  40180. */
  40181. resolutionScale: number;
  40182. /**
  40183. * Boolean flag indicating if the browser's recommended resolution is used.
  40184. * If true, the browser's device pixel ratio is ignored and 1.0 is used instead,
  40185. * effectively rendering based on CSS pixels instead of device pixels. This can improve
  40186. * performance on less powerful devices that have high pixel density. When false, rendering
  40187. * will be in device pixels. {@link CesiumWidget#resolutionScale} will still take effect whether
  40188. * this flag is true or false.
  40189. */
  40190. useBrowserRecommendedResolution: boolean;
  40191. /**
  40192. * Show an error panel to the user containing a title and a longer error message,
  40193. * which can be dismissed using an OK button. This panel is displayed automatically
  40194. * when a render loop error occurs, if showRenderLoopErrors was not false when the
  40195. * widget was constructed.
  40196. * @param title - The title to be displayed on the error panel. This string is interpreted as text.
  40197. * @param [message] - A helpful, user-facing message to display prior to the detailed error information. This string is interpreted as HTML.
  40198. * @param [error] - The error to be displayed on the error panel. This string is formatted using {@link formatError} and then displayed as text.
  40199. */
  40200. showErrorPanel(title: string, message?: string, error?: string): void;
  40201. /**
  40202. * @returns true if the object has been destroyed, false otherwise.
  40203. */
  40204. isDestroyed(): boolean;
  40205. /**
  40206. * Destroys the widget. Should be called if permanently
  40207. * removing the widget from layout.
  40208. */
  40209. destroy(): void;
  40210. /**
  40211. * Updates the canvas size, camera aspect ratio, and viewport size.
  40212. * This function is called automatically as needed unless
  40213. * <code>useDefaultRenderLoop</code> is set to false.
  40214. */
  40215. resize(): void;
  40216. /**
  40217. * Renders the scene. This function is called automatically
  40218. * unless <code>useDefaultRenderLoop</code> is set to false;
  40219. */
  40220. render(): void;
  40221. }
  40222. /**
  40223. * A view model which exposes a {@link Clock} for user interfaces.
  40224. * @param [clock] - The clock object wrapped by this view model, if undefined a new instance will be created.
  40225. */
  40226. export class ClockViewModel {
  40227. constructor(clock?: Clock);
  40228. /**
  40229. * Gets the current system time.
  40230. * This property is observable.
  40231. */
  40232. systemTime: JulianDate;
  40233. /**
  40234. * Gets or sets the start time of the clock.
  40235. * See {@link Clock#startTime}.
  40236. * This property is observable.
  40237. */
  40238. startTime: JulianDate;
  40239. /**
  40240. * Gets or sets the stop time of the clock.
  40241. * See {@link Clock#stopTime}.
  40242. * This property is observable.
  40243. */
  40244. stopTime: JulianDate;
  40245. /**
  40246. * Gets or sets the current time.
  40247. * See {@link Clock#currentTime}.
  40248. * This property is observable.
  40249. */
  40250. currentTime: JulianDate;
  40251. /**
  40252. * Gets or sets the clock multiplier.
  40253. * See {@link Clock#multiplier}.
  40254. * This property is observable.
  40255. */
  40256. multiplier: number;
  40257. /**
  40258. * Gets or sets the clock step setting.
  40259. * See {@link Clock#clockStep}.
  40260. * This property is observable.
  40261. */
  40262. clockStep: ClockStep;
  40263. /**
  40264. * Gets or sets the clock range setting.
  40265. * See {@link Clock#clockRange}.
  40266. * This property is observable.
  40267. */
  40268. clockRange: ClockRange;
  40269. /**
  40270. * Gets or sets whether the clock can animate.
  40271. * See {@link Clock#canAnimate}.
  40272. * This property is observable.
  40273. */
  40274. canAnimate: boolean;
  40275. /**
  40276. * Gets or sets whether the clock should animate.
  40277. * See {@link Clock#shouldAnimate}.
  40278. * This property is observable.
  40279. */
  40280. shouldAnimate: boolean;
  40281. /**
  40282. * Gets the underlying Clock.
  40283. */
  40284. clock: Clock;
  40285. /**
  40286. * Updates the view model with the contents of the underlying clock.
  40287. * Can be called to force an update of the viewModel if the underlying
  40288. * clock has changed and <code>Clock.tick</code> has not yet been called.
  40289. */
  40290. synchronize(): void;
  40291. /**
  40292. * @returns true if the object has been destroyed, false otherwise.
  40293. */
  40294. isDestroyed(): boolean;
  40295. /**
  40296. * Destroys the view model. Should be called to
  40297. * properly clean up the view model when it is no longer needed.
  40298. */
  40299. destroy(): void;
  40300. }
  40301. /**
  40302. * A Command is a function with an extra <code>canExecute</code> observable property to determine
  40303. * whether the command can be executed. When executed, a Command function will check the
  40304. * value of <code>canExecute</code> and throw if false.
  40305. *
  40306. * This type describes an interface and is not intended to be instantiated directly.
  40307. * See {@link createCommand} to create a command from a function.
  40308. */
  40309. export class Command {
  40310. constructor();
  40311. /**
  40312. * Gets whether this command can currently be executed. This property is observable.
  40313. */
  40314. canExecute: boolean;
  40315. /**
  40316. * Gets an event which is raised before the command executes, the event
  40317. * is raised with an object containing two properties: a <code>cancel</code> property,
  40318. * which if set to false by the listener will prevent the command from being executed, and
  40319. * an <code>args</code> property, which is the array of arguments being passed to the command.
  40320. */
  40321. beforeExecute: Event;
  40322. /**
  40323. * Gets an event which is raised after the command executes, the event
  40324. * is raised with the return value of the command as its only parameter.
  40325. */
  40326. afterExecute: Event;
  40327. }
  40328. /**
  40329. * A single button widget for toggling fullscreen mode.
  40330. * @param container - The DOM element or ID that will contain the widget.
  40331. * @param [fullscreenElement = document.body] - The element or id to be placed into fullscreen mode.
  40332. */
  40333. export class FullscreenButton {
  40334. constructor(container: Element | string, fullscreenElement?: Element | string);
  40335. /**
  40336. * Gets the parent container.
  40337. */
  40338. container: Element;
  40339. /**
  40340. * Gets the view model.
  40341. */
  40342. viewModel: FullscreenButtonViewModel;
  40343. /**
  40344. * @returns true if the object has been destroyed, false otherwise.
  40345. */
  40346. isDestroyed(): boolean;
  40347. /**
  40348. * Destroys the widget. Should be called if permanently
  40349. * removing the widget from layout.
  40350. */
  40351. destroy(): void;
  40352. }
  40353. /**
  40354. * The view model for {@link FullscreenButton}.
  40355. * @param [fullscreenElement = document.body] - The element or id to be placed into fullscreen mode.
  40356. * @param [container] - The DOM element or ID that will contain the widget.
  40357. */
  40358. export class FullscreenButtonViewModel {
  40359. constructor(fullscreenElement?: Element | string, container?: Element | string);
  40360. /**
  40361. * Gets whether or not fullscreen mode is active. This property is observable.
  40362. */
  40363. isFullscreen: boolean;
  40364. /**
  40365. * Gets or sets whether or not fullscreen functionality should be enabled. This property is observable.
  40366. */
  40367. isFullscreenEnabled: boolean;
  40368. /**
  40369. * Gets the tooltip. This property is observable.
  40370. */
  40371. tooltip: string;
  40372. /**
  40373. * Gets or sets the HTML element to place into fullscreen mode when the
  40374. * corresponding button is pressed.
  40375. */
  40376. fullscreenElement: Element;
  40377. /**
  40378. * Gets the Command to toggle fullscreen mode.
  40379. */
  40380. command: Command;
  40381. /**
  40382. * @returns true if the object has been destroyed, false otherwise.
  40383. */
  40384. isDestroyed(): boolean;
  40385. /**
  40386. * Destroys the view model. Should be called to
  40387. * properly clean up the view model when it is no longer needed.
  40388. */
  40389. destroy(): void;
  40390. }
  40391. /**
  40392. * A widget for finding addresses and landmarks, and flying the camera to them. Geocoding is
  40393. * performed using {@link https://cesium.com/cesium-ion/|Cesium ion}.
  40394. * @param options - Object with the following properties:
  40395. * @param options.container - The DOM element or ID that will contain the widget.
  40396. * @param options.scene - The Scene instance to use.
  40397. * @param [options.geocoderServices] - The geocoder services to be used
  40398. * @param [options.autoComplete = true] - True if the geocoder should query as the user types to autocomplete
  40399. * @param [options.flightDuration = 1.5] - The duration of the camera flight to an entered location, in seconds.
  40400. * @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.
  40401. */
  40402. export class Geocoder {
  40403. constructor(options: {
  40404. container: Element | string;
  40405. scene: Scene;
  40406. geocoderServices?: GeocoderService[];
  40407. autoComplete?: boolean;
  40408. flightDuration?: number;
  40409. destinationFound?: Geocoder.DestinationFoundFunction;
  40410. });
  40411. /**
  40412. * Gets the parent container.
  40413. */
  40414. container: Element;
  40415. /**
  40416. * Gets the parent container.
  40417. */
  40418. searchSuggestionsContainer: Element;
  40419. /**
  40420. * Gets the view model.
  40421. */
  40422. viewModel: GeocoderViewModel;
  40423. /**
  40424. * @returns true if the object has been destroyed, false otherwise.
  40425. */
  40426. isDestroyed(): boolean;
  40427. /**
  40428. * Destroys the widget. Should be called if permanently
  40429. * removing the widget from layout.
  40430. */
  40431. destroy(): void;
  40432. }
  40433. export namespace Geocoder {
  40434. /**
  40435. * A function that handles the result of a successful geocode.
  40436. * @param viewModel - The view model.
  40437. * @param destination - The destination result of the geocode.
  40438. */
  40439. type DestinationFoundFunction = (viewModel: GeocoderViewModel, destination: Cartesian3 | Rectangle) => void;
  40440. }
  40441. /**
  40442. * The view model for the {@link Geocoder} widget.
  40443. * @param options - Object with the following properties:
  40444. * @param options.scene - The Scene instance to use.
  40445. * @param [options.geocoderServices] - Geocoder services to use for geocoding queries.
  40446. * If more than one are supplied, suggestions will be gathered for the geocoders that support it,
  40447. * and if no suggestion is selected the result from the first geocoder service wil be used.
  40448. * @param [options.flightDuration] - The duration of the camera flight to an entered location, in seconds.
  40449. * @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.
  40450. */
  40451. export class GeocoderViewModel {
  40452. constructor(options: {
  40453. scene: Scene;
  40454. geocoderServices?: GeocoderService[];
  40455. flightDuration?: number;
  40456. destinationFound?: Geocoder.DestinationFoundFunction;
  40457. });
  40458. /**
  40459. * Gets or sets a value indicating if this instance should always show its text input field.
  40460. */
  40461. keepExpanded: boolean;
  40462. /**
  40463. * True if the geocoder should query as the user types to autocomplete
  40464. */
  40465. autoComplete: boolean;
  40466. /**
  40467. * Gets and sets the command called when a geocode destination is found
  40468. */
  40469. destinationFound: Geocoder.DestinationFoundFunction;
  40470. /**
  40471. * Gets a value indicating whether a search is currently in progress. This property is observable.
  40472. */
  40473. isSearchInProgress: boolean;
  40474. /**
  40475. * Gets or sets the text to search for. The text can be an address, or longitude, latitude,
  40476. * and optional height, where longitude and latitude are in degrees and height is in meters.
  40477. */
  40478. searchText: string;
  40479. /**
  40480. * Gets or sets the the duration of the camera flight in seconds.
  40481. * A value of zero causes the camera to instantly switch to the geocoding location.
  40482. * The duration will be computed based on the distance when undefined.
  40483. */
  40484. flightDuration: number | undefined;
  40485. /**
  40486. * Gets the event triggered on flight completion.
  40487. */
  40488. complete: Event;
  40489. /**
  40490. * Gets the scene to control.
  40491. */
  40492. scene: Scene;
  40493. /**
  40494. * Gets the Command that is executed when the button is clicked.
  40495. */
  40496. search: Command;
  40497. /**
  40498. * Gets the currently selected geocoder search suggestion
  40499. */
  40500. selectedSuggestion: any;
  40501. /**
  40502. * Gets the list of geocoder search suggestions
  40503. */
  40504. suggestions: object[];
  40505. /**
  40506. * Destroys the widget. Should be called if permanently
  40507. * removing the widget from layout.
  40508. */
  40509. destroy(): void;
  40510. /**
  40511. * A function to fly to the destination found by a successful geocode.
  40512. */
  40513. static flyToDestination: Geocoder.DestinationFoundFunction;
  40514. }
  40515. /**
  40516. * A single button widget for returning to the default camera view of the current scene.
  40517. * @param container - The DOM element or ID that will contain the widget.
  40518. * @param scene - The Scene instance to use.
  40519. * @param [duration] - The time, in seconds, it takes to complete the camera flight home.
  40520. */
  40521. export class HomeButton {
  40522. constructor(container: Element | string, scene: Scene, duration?: number);
  40523. /**
  40524. * Gets the parent container.
  40525. */
  40526. container: Element;
  40527. /**
  40528. * Gets the view model.
  40529. */
  40530. viewModel: HomeButtonViewModel;
  40531. /**
  40532. * @returns true if the object has been destroyed, false otherwise.
  40533. */
  40534. isDestroyed(): boolean;
  40535. /**
  40536. * Destroys the widget. Should be called if permanently
  40537. * removing the widget from layout.
  40538. */
  40539. destroy(): void;
  40540. }
  40541. /**
  40542. * The view model for {@link HomeButton}.
  40543. * @param scene - The scene instance to use.
  40544. * @param [duration] - The duration of the camera flight in seconds.
  40545. */
  40546. export class HomeButtonViewModel {
  40547. constructor(scene: Scene, duration?: number);
  40548. /**
  40549. * Gets or sets the tooltip. This property is observable.
  40550. */
  40551. tooltip: string;
  40552. /**
  40553. * Gets the scene to control.
  40554. */
  40555. scene: Scene;
  40556. /**
  40557. * Gets the Command that is executed when the button is clicked.
  40558. */
  40559. command: Command;
  40560. /**
  40561. * Gets or sets the the duration of the camera flight in seconds.
  40562. * A value of zero causes the camera to instantly switch to home view.
  40563. * The duration will be computed based on the distance when undefined.
  40564. */
  40565. duration: number | undefined;
  40566. }
  40567. /**
  40568. * A widget for displaying information or a description.
  40569. * @param container - The DOM element or ID that will contain the widget.
  40570. */
  40571. export class InfoBox {
  40572. constructor(container: Element | string);
  40573. /**
  40574. * Gets the parent container.
  40575. */
  40576. container: Element;
  40577. /**
  40578. * Gets the view model.
  40579. */
  40580. viewModel: InfoBoxViewModel;
  40581. /**
  40582. * Gets the iframe used to display the description.
  40583. */
  40584. frame: HTMLIFrameElement;
  40585. /**
  40586. * @returns true if the object has been destroyed, false otherwise.
  40587. */
  40588. isDestroyed(): boolean;
  40589. /**
  40590. * Destroys the widget. Should be called if permanently
  40591. * removing the widget from layout.
  40592. */
  40593. destroy(): void;
  40594. }
  40595. /**
  40596. * The view model for {@link InfoBox}.
  40597. */
  40598. export class InfoBoxViewModel {
  40599. constructor();
  40600. /**
  40601. * Gets or sets the maximum height of the info box in pixels. This property is observable.
  40602. */
  40603. maxHeight: number;
  40604. /**
  40605. * Gets or sets whether the camera tracking icon is enabled.
  40606. */
  40607. enableCamera: boolean;
  40608. /**
  40609. * Gets or sets the status of current camera tracking of the selected object.
  40610. */
  40611. isCameraTracking: boolean;
  40612. /**
  40613. * Gets or sets the visibility of the info box.
  40614. */
  40615. showInfo: boolean;
  40616. /**
  40617. * Gets or sets the title text in the info box.
  40618. */
  40619. titleText: string;
  40620. /**
  40621. * Gets or sets the description HTML for the info box.
  40622. */
  40623. description: string;
  40624. /**
  40625. * Gets the SVG path of the camera icon, which can change to be "crossed out" or not.
  40626. */
  40627. cameraIconPath: string;
  40628. /**
  40629. * Gets the maximum height of sections within the info box, minus an offset, in CSS-ready form.
  40630. * @param offset - The offset in pixels.
  40631. */
  40632. maxHeightOffset(offset: number): string;
  40633. /**
  40634. * Gets an {@link Event} that is fired when the user clicks the camera icon.
  40635. */
  40636. cameraClicked: Event;
  40637. /**
  40638. * Gets an {@link Event} that is fired when the user closes the info box.
  40639. */
  40640. closeClicked: Event;
  40641. }
  40642. /**
  40643. * <p>The NavigationHelpButton is a single button widget for displaying instructions for
  40644. * navigating the globe with the mouse.</p><p style="clear: both;"></p><br/>
  40645. * @example
  40646. * // In HTML head, include a link to the NavigationHelpButton.css stylesheet,
  40647. * // and in the body, include: <div id="navigationHelpButtonContainer"></div>
  40648. *
  40649. * var navigationHelpButton = new Cesium.NavigationHelpButton({
  40650. * container : 'navigationHelpButtonContainer'
  40651. * });
  40652. * @param options - Object with the following properties:
  40653. * @param options.container - The DOM element or ID that will contain the widget.
  40654. * @param [options.instructionsInitiallyVisible = false] - True if the navigation instructions should initially be visible; otherwise, false.
  40655. */
  40656. export class NavigationHelpButton {
  40657. constructor(options: {
  40658. container: Element | string;
  40659. instructionsInitiallyVisible?: boolean;
  40660. });
  40661. /**
  40662. * Gets the parent container.
  40663. */
  40664. container: Element;
  40665. /**
  40666. * Gets the view model.
  40667. */
  40668. viewModel: NavigationHelpButtonViewModel;
  40669. /**
  40670. * @returns true if the object has been destroyed, false otherwise.
  40671. */
  40672. isDestroyed(): boolean;
  40673. /**
  40674. * Destroys the widget. Should be called if permanently
  40675. * removing the widget from layout.
  40676. */
  40677. destroy(): void;
  40678. }
  40679. /**
  40680. * The view model for {@link NavigationHelpButton}.
  40681. */
  40682. export class NavigationHelpButtonViewModel {
  40683. constructor();
  40684. /**
  40685. * Gets or sets whether the instructions are currently shown. This property is observable.
  40686. */
  40687. showInstructions: boolean;
  40688. /**
  40689. * Gets or sets the tooltip. This property is observable.
  40690. */
  40691. tooltip: string;
  40692. /**
  40693. * Gets the Command that is executed when the button is clicked.
  40694. */
  40695. command: Command;
  40696. /**
  40697. * Gets the Command that is executed when the mouse instructions should be shown.
  40698. */
  40699. showClick: Command;
  40700. /**
  40701. * Gets the Command that is executed when the touch instructions should be shown.
  40702. */
  40703. showTouch: Command;
  40704. }
  40705. /**
  40706. * Monitors performance of the application and displays a message if poor performance is detected.
  40707. * @param [options] - Object with the following properties:
  40708. * @param options.container - The DOM element or ID that will contain the widget.
  40709. * @param options.scene - The {@link Scene} for which to monitor performance.
  40710. * @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
  40711. * message to display when a low frame rate is detected. The message is interpeted as HTML, so make sure
  40712. * it comes from a trusted source so that your application is not vulnerable to cross-site scripting attacks.
  40713. */
  40714. export class PerformanceWatchdog {
  40715. constructor(options?: {
  40716. container: Element | string;
  40717. scene: Scene;
  40718. lowFrameRateMessage?: string;
  40719. });
  40720. /**
  40721. * Gets the parent container.
  40722. */
  40723. container: Element;
  40724. /**
  40725. * Gets the view model.
  40726. */
  40727. viewModel: PerformanceWatchdogViewModel;
  40728. /**
  40729. * @returns true if the object has been destroyed, false otherwise.
  40730. */
  40731. isDestroyed(): boolean;
  40732. /**
  40733. * Destroys the widget. Should be called if permanently
  40734. * removing the widget from layout.
  40735. */
  40736. destroy(): void;
  40737. }
  40738. /**
  40739. * The view model for {@link PerformanceWatchdog}.
  40740. * @param [options] - Object with the following properties:
  40741. * @param options.scene - The Scene instance for which to monitor performance.
  40742. * @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
  40743. * message to display when a low frame rate is detected. The message is interpeted as HTML, so make sure
  40744. * it comes from a trusted source so that your application is not vulnerable to cross-site scripting attacks.
  40745. */
  40746. export class PerformanceWatchdogViewModel {
  40747. constructor(options?: {
  40748. scene: Scene;
  40749. lowFrameRateMessage?: string;
  40750. });
  40751. /**
  40752. * Gets or sets the message to display when a low frame rate is detected. This string will be interpreted as HTML.
  40753. */
  40754. lowFrameRateMessage: string;
  40755. /**
  40756. * Gets or sets a value indicating whether the low frame rate message has previously been dismissed by the user. If it has
  40757. * been dismissed, the message will not be redisplayed, no matter the frame rate.
  40758. */
  40759. lowFrameRateMessageDismissed: boolean;
  40760. /**
  40761. * Gets or sets a value indicating whether the low frame rate message is currently being displayed.
  40762. */
  40763. showingLowFrameRateMessage: boolean;
  40764. /**
  40765. * Gets the {@link Scene} instance for which to monitor performance.
  40766. */
  40767. scene: Scene;
  40768. /**
  40769. * Gets a command that dismisses the low frame rate message. Once it is dismissed, the message
  40770. * will not be redisplayed.
  40771. */
  40772. dismissMessage: Command;
  40773. }
  40774. /**
  40775. * The ProjectionPicker is a single button widget for switching between perspective and orthographic projections.
  40776. * @example
  40777. * // In HTML head, include a link to the ProjectionPicker.css stylesheet,
  40778. * // and in the body, include: <div id="projectionPickerContainer"></div>
  40779. * // Note: This code assumes you already have a Scene instance.
  40780. *
  40781. * var projectionPicker = new Cesium.ProjectionPicker('projectionPickerContainer', scene);
  40782. * @param container - The DOM element or ID that will contain the widget.
  40783. * @param scene - The Scene instance to use.
  40784. */
  40785. export class ProjectionPicker {
  40786. constructor(container: Element | string, scene: Scene);
  40787. /**
  40788. * Gets the parent container.
  40789. */
  40790. container: Element;
  40791. /**
  40792. * Gets the view model.
  40793. */
  40794. viewModel: ProjectionPickerViewModel;
  40795. /**
  40796. * @returns true if the object has been destroyed, false otherwise.
  40797. */
  40798. isDestroyed(): boolean;
  40799. /**
  40800. * Destroys the widget. Should be called if permanently
  40801. * removing the widget from layout.
  40802. */
  40803. destroy(): void;
  40804. }
  40805. /**
  40806. * The view model for {@link ProjectionPicker}.
  40807. * @param scene - The Scene to switch projections.
  40808. */
  40809. export class ProjectionPickerViewModel {
  40810. constructor(scene: Scene);
  40811. /**
  40812. * Gets or sets whether the button drop-down is currently visible. This property is observable.
  40813. */
  40814. dropDownVisible: boolean;
  40815. /**
  40816. * Gets or sets the perspective projection tooltip. This property is observable.
  40817. */
  40818. tooltipPerspective: string;
  40819. /**
  40820. * Gets or sets the orthographic projection tooltip. This property is observable.
  40821. */
  40822. tooltipOrthographic: string;
  40823. /**
  40824. * Gets the currently active tooltip. This property is observable.
  40825. */
  40826. selectedTooltip: string;
  40827. /**
  40828. * Gets or sets the current SceneMode. This property is observable.
  40829. */
  40830. sceneMode: SceneMode;
  40831. /**
  40832. * Gets the scene
  40833. */
  40834. scene: Scene;
  40835. /**
  40836. * Gets the command to toggle the drop down box.
  40837. */
  40838. toggleDropDown: Command;
  40839. /**
  40840. * Gets the command to switch to a perspective projection.
  40841. */
  40842. switchToPerspective: Command;
  40843. /**
  40844. * Gets the command to switch to orthographic projection.
  40845. */
  40846. switchToOrthographic: Command;
  40847. /**
  40848. * Gets whether the scene is currently using an orthographic projection.
  40849. */
  40850. isOrthographicProjection: Command;
  40851. /**
  40852. * @returns true if the object has been destroyed, false otherwise.
  40853. */
  40854. isDestroyed(): boolean;
  40855. /**
  40856. * Destroys the view model.
  40857. */
  40858. destroy(): void;
  40859. }
  40860. /**
  40861. * <img src="Images/sceneModePicker.png" style="float: left; margin-right: 10px;" width="44" height="116" />
  40862. * <p>The SceneModePicker is a single button widget for switching between scene modes;
  40863. * shown to the left in its expanded state. Programatic switching of scene modes will
  40864. * be automatically reflected in the widget as long as the specified Scene
  40865. * is used to perform the change.</p><p style="clear: both;"></p><br/>
  40866. * @example
  40867. * // In HTML head, include a link to the SceneModePicker.css stylesheet,
  40868. * // and in the body, include: <div id="sceneModePickerContainer"></div>
  40869. * // Note: This code assumes you already have a Scene instance.
  40870. *
  40871. * var sceneModePicker = new Cesium.SceneModePicker('sceneModePickerContainer', scene);
  40872. * @param container - The DOM element or ID that will contain the widget.
  40873. * @param scene - The Scene instance to use.
  40874. * @param [duration = 2.0] - The time, in seconds, it takes for the scene to transition.
  40875. */
  40876. export class SceneModePicker {
  40877. constructor(container: Element | string, scene: Scene, duration?: number);
  40878. /**
  40879. * Gets the parent container.
  40880. */
  40881. container: Element;
  40882. /**
  40883. * Gets the view model.
  40884. */
  40885. viewModel: SceneModePickerViewModel;
  40886. /**
  40887. * @returns true if the object has been destroyed, false otherwise.
  40888. */
  40889. isDestroyed(): boolean;
  40890. /**
  40891. * Destroys the widget. Should be called if permanently
  40892. * removing the widget from layout.
  40893. */
  40894. destroy(): void;
  40895. }
  40896. /**
  40897. * The view model for {@link SceneModePicker}.
  40898. * @param scene - The Scene to morph
  40899. * @param [duration = 2.0] - The duration of scene morph animations, in seconds
  40900. */
  40901. export class SceneModePickerViewModel {
  40902. constructor(scene: Scene, duration?: number);
  40903. /**
  40904. * Gets or sets the current SceneMode. This property is observable.
  40905. */
  40906. sceneMode: SceneMode;
  40907. /**
  40908. * Gets or sets whether the button drop-down is currently visible. This property is observable.
  40909. */
  40910. dropDownVisible: boolean;
  40911. /**
  40912. * Gets or sets the 2D tooltip. This property is observable.
  40913. */
  40914. tooltip2D: string;
  40915. /**
  40916. * Gets or sets the 3D tooltip. This property is observable.
  40917. */
  40918. tooltip3D: string;
  40919. /**
  40920. * Gets or sets the Columbus View tooltip. This property is observable.
  40921. */
  40922. tooltipColumbusView: string;
  40923. /**
  40924. * Gets the currently active tooltip. This property is observable.
  40925. */
  40926. selectedTooltip: string;
  40927. /**
  40928. * Gets the scene
  40929. */
  40930. scene: Scene;
  40931. /**
  40932. * Gets or sets the the duration of scene mode transition animations in seconds.
  40933. * A value of zero causes the scene to instantly change modes.
  40934. */
  40935. duration: number;
  40936. /**
  40937. * Gets the command to toggle the drop down box.
  40938. */
  40939. toggleDropDown: Command;
  40940. /**
  40941. * Gets the command to morph to 2D.
  40942. */
  40943. morphTo2D: Command;
  40944. /**
  40945. * Gets the command to morph to 3D.
  40946. */
  40947. morphTo3D: Command;
  40948. /**
  40949. * Gets the command to morph to Columbus View.
  40950. */
  40951. morphToColumbusView: Command;
  40952. /**
  40953. * @returns true if the object has been destroyed, false otherwise.
  40954. */
  40955. isDestroyed(): boolean;
  40956. /**
  40957. * Destroys the view model.
  40958. */
  40959. destroy(): void;
  40960. }
  40961. /**
  40962. * A widget for displaying an indicator on a selected object.
  40963. * @param container - The DOM element or ID that will contain the widget.
  40964. * @param scene - The Scene instance to use.
  40965. */
  40966. export class SelectionIndicator {
  40967. constructor(container: Element | string, scene: Scene);
  40968. /**
  40969. * Gets the parent container.
  40970. */
  40971. container: Element;
  40972. /**
  40973. * Gets the view model.
  40974. */
  40975. viewModel: SelectionIndicatorViewModel;
  40976. /**
  40977. * @returns true if the object has been destroyed, false otherwise.
  40978. */
  40979. isDestroyed(): boolean;
  40980. /**
  40981. * Destroys the widget. Should be called if permanently
  40982. * removing the widget from layout.
  40983. */
  40984. destroy(): void;
  40985. }
  40986. /**
  40987. * The view model for {@link SelectionIndicator}.
  40988. * @param scene - The scene instance to use for screen-space coordinate conversion.
  40989. * @param selectionIndicatorElement - The element containing all elements that make up the selection indicator.
  40990. * @param container - The DOM element that contains the widget.
  40991. */
  40992. export class SelectionIndicatorViewModel {
  40993. constructor(scene: Scene, selectionIndicatorElement: Element, container: Element);
  40994. /**
  40995. * Gets or sets the world position of the object for which to display the selection indicator.
  40996. */
  40997. position: Cartesian3;
  40998. /**
  40999. * Gets or sets the visibility of the selection indicator.
  41000. */
  41001. showSelection: boolean;
  41002. /**
  41003. * Gets the visibility of the position indicator. This can be false even if an
  41004. * object is selected, when the selected object has no position.
  41005. */
  41006. isVisible: boolean;
  41007. /**
  41008. * Gets or sets the function for converting the world position of the object to the screen space position.
  41009. * @example
  41010. * selectionIndicatorViewModel.computeScreenSpacePosition = function(position, result) {
  41011. * return Cesium.SceneTransforms.wgs84ToWindowCoordinates(scene, position, result);
  41012. * };
  41013. */
  41014. computeScreenSpacePosition: SelectionIndicatorViewModel.ComputeScreenSpacePosition;
  41015. /**
  41016. * Updates the view of the selection indicator to match the position and content properties of the view model.
  41017. * This function should be called as part of the render loop.
  41018. */
  41019. update(): void;
  41020. /**
  41021. * Animate the indicator to draw attention to the selection.
  41022. */
  41023. animateAppear(): void;
  41024. /**
  41025. * Animate the indicator to release the selection.
  41026. */
  41027. animateDepart(): void;
  41028. /**
  41029. * Gets the HTML element containing the selection indicator.
  41030. */
  41031. container: Element;
  41032. /**
  41033. * Gets the HTML element that holds the selection indicator.
  41034. */
  41035. selectionIndicatorElement: Element;
  41036. /**
  41037. * Gets the scene being used.
  41038. */
  41039. scene: Scene;
  41040. }
  41041. export namespace SelectionIndicatorViewModel {
  41042. /**
  41043. * A function that converts the world position of an object to a screen space position.
  41044. * @param position - The position in WGS84 (world) coordinates.
  41045. * @param result - An object to return the input position transformed to window coordinates.
  41046. */
  41047. type ComputeScreenSpacePosition = (position: Cartesian3, result: Cartesian2) => Cartesian2;
  41048. }
  41049. /**
  41050. * A Knockout binding handler that creates a DOM element for a single SVG path.
  41051. * This binding handler will be registered as cesiumSvgPath.
  41052. *
  41053. * <p>
  41054. * The parameter to this binding is an object with the following properties:
  41055. * </p>
  41056. *
  41057. * <ul>
  41058. * <li>path: The SVG path as a string.</li>
  41059. * <li>width: The width of the SVG path with no transformations applied.</li>
  41060. * <li>height: The height of the SVG path with no transformations applied.</li>
  41061. * <li>css: Optional. A string containing additional CSS classes to apply to the SVG. 'cesium-svgPath-svg' is always applied.</li>
  41062. * </ul>
  41063. * @example
  41064. * // Create an SVG as a child of a div
  41065. * <div data-bind="cesiumSvgPath: { path: 'M 100 100 L 300 100 L 200 300 z', width: 28, height: 28 }"></div>
  41066. *
  41067. * // parameters can be observable from the view model
  41068. * <div data-bind="cesiumSvgPath: { path: currentPath, width: currentWidth, height: currentHeight }"></div>
  41069. *
  41070. * // or the whole object can be observable from the view model
  41071. * <div data-bind="cesiumSvgPath: svgPathOptions"></div>
  41072. */
  41073. export namespace SvgPathBindingHandler {
  41074. function register(): void;
  41075. }
  41076. /**
  41077. * The Timeline is a widget for displaying and controlling the current scene time.
  41078. * @param container - The parent HTML container node for this widget.
  41079. * @param clock - The clock to use.
  41080. */
  41081. export class Timeline {
  41082. constructor(container: Element, clock: Clock);
  41083. /**
  41084. * Gets the parent container.
  41085. */
  41086. container: Element;
  41087. /**
  41088. * @returns true if the object has been destroyed, false otherwise.
  41089. */
  41090. isDestroyed(): boolean;
  41091. /**
  41092. * Destroys the widget. Should be called if permanently
  41093. * removing the widget from layout.
  41094. */
  41095. destroy(): void;
  41096. /**
  41097. * Sets the view to the provided times.
  41098. * @param startTime - The start time.
  41099. * @param stopTime - The stop time.
  41100. */
  41101. zoomTo(startTime: JulianDate, stopTime: JulianDate): void;
  41102. /**
  41103. * Resizes the widget to match the container size.
  41104. */
  41105. resize(): void;
  41106. }
  41107. /**
  41108. * A view model which exposes the properties of a toggle button.
  41109. * @param command - The command which will be executed when the button is toggled.
  41110. * @param [options] - Object with the following properties:
  41111. * @param [options.toggled = false] - A boolean indicating whether the button should be initially toggled.
  41112. * @param [options.tooltip = ''] - A string containing the button's tooltip.
  41113. */
  41114. export class ToggleButtonViewModel {
  41115. constructor(command: Command, options?: {
  41116. toggled?: boolean;
  41117. tooltip?: string;
  41118. });
  41119. /**
  41120. * Gets or sets whether the button is currently toggled. This property is observable.
  41121. */
  41122. toggled: boolean;
  41123. /**
  41124. * Gets or sets the button's tooltip. This property is observable.
  41125. */
  41126. tooltip: string;
  41127. /**
  41128. * Gets the command which will be executed when the button is toggled.
  41129. */
  41130. command: Command;
  41131. }
  41132. /**
  41133. * A single button widget for toggling vr mode.
  41134. * @param container - The DOM element or ID that will contain the widget.
  41135. * @param scene - The scene.
  41136. * @param [vrElement = document.body] - The element or id to be placed into vr mode.
  41137. */
  41138. export class VRButton {
  41139. constructor(container: Element | string, scene: Scene, vrElement?: Element | string);
  41140. /**
  41141. * Gets the parent container.
  41142. */
  41143. container: Element;
  41144. /**
  41145. * Gets the view model.
  41146. */
  41147. viewModel: VRButtonViewModel;
  41148. /**
  41149. * @returns true if the object has been destroyed, false otherwise.
  41150. */
  41151. isDestroyed(): boolean;
  41152. /**
  41153. * Destroys the widget. Should be called if permanently
  41154. * removing the widget from layout.
  41155. */
  41156. destroy(): void;
  41157. }
  41158. /**
  41159. * The view model for {@link VRButton}.
  41160. * @param scene - The scene.
  41161. * @param [vrElement = document.body] - The element or id to be placed into VR mode.
  41162. */
  41163. export class VRButtonViewModel {
  41164. constructor(scene: Scene, vrElement?: Element | string);
  41165. /**
  41166. * Gets whether or not VR mode is active.
  41167. */
  41168. isVRMode: boolean;
  41169. /**
  41170. * Gets or sets whether or not VR functionality should be enabled.
  41171. */
  41172. isVREnabled: boolean;
  41173. /**
  41174. * Gets the tooltip. This property is observable.
  41175. */
  41176. tooltip: string;
  41177. /**
  41178. * Gets or sets the HTML element to place into VR mode when the
  41179. * corresponding button is pressed.
  41180. */
  41181. vrElement: Element;
  41182. /**
  41183. * Gets the Command to toggle VR mode.
  41184. */
  41185. command: Command;
  41186. /**
  41187. * @returns true if the object has been destroyed, false otherwise.
  41188. */
  41189. isDestroyed(): boolean;
  41190. /**
  41191. * Destroys the view model. Should be called to
  41192. * properly clean up the view model when it is no longer needed.
  41193. */
  41194. destroy(): void;
  41195. }
  41196. export namespace Viewer {
  41197. /**
  41198. * Initialization options for the Viewer constructor
  41199. * @property [animation = true] - If set to false, the Animation widget will not be created.
  41200. * @property [baseLayerPicker = true] - If set to false, the BaseLayerPicker widget will not be created.
  41201. * @property [fullscreenButton = true] - If set to false, the FullscreenButton widget will not be created.
  41202. * @property [vrButton = false] - If set to true, the VRButton widget will be created.
  41203. * @property [geocoder = true] - If set to false, the Geocoder widget will not be created.
  41204. * @property [homeButton = true] - If set to false, the HomeButton widget will not be created.
  41205. * @property [infoBox = true] - If set to false, the InfoBox widget will not be created.
  41206. * @property [sceneModePicker = true] - If set to false, the SceneModePicker widget will not be created.
  41207. * @property [selectionIndicator = true] - If set to false, the SelectionIndicator widget will not be created.
  41208. * @property [timeline = true] - If set to false, the Timeline widget will not be created.
  41209. * @property [navigationHelpButton = true] - If set to false, the navigation help button will not be created.
  41210. * @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.
  41211. * @property [scene3DOnly = false] - When <code>true</code>, each geometry instance will only be rendered in 3D to save GPU memory.
  41212. * @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}.
  41213. * @property [clockViewModel = new ClockViewModel(clock)] - The clock view model to use to control current time.
  41214. * @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.
  41215. * @property [imageryProviderViewModels = createDefaultImageryProviderViewModels()] - The array of ProviderViewModels to be selectable from the BaseLayerPicker. This value is only valid if `baseLayerPicker` is set to true.
  41216. * @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.
  41217. * @property [terrainProviderViewModels = createDefaultTerrainProviderViewModels()] - The array of ProviderViewModels to be selectable from the BaseLayerPicker. This value is only valid if `baseLayerPicker` is set to true.
  41218. * @property [imageryProvider = createWorldImagery()] - The imagery provider to use. This value is only valid if `baseLayerPicker` is set to false.
  41219. * @property [terrainProvider = new EllipsoidTerrainProvider()] - The terrain provider to use
  41220. * @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.
  41221. * @property [skyAtmosphere] - Blue sky, and the glow around the Earth's limb. Set to <code>false</code> to turn it off.
  41222. * @property [fullscreenElement = document.body] - The element or id to be placed into fullscreen mode when the full screen button is pressed.
  41223. * @property [useDefaultRenderLoop = true] - True if this widget should control the render loop, false otherwise.
  41224. * @property [targetFrameRate] - The target frame rate when using the default render loop.
  41225. * @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.
  41226. * @property [useBrowserRecommendedResolution = true] - If true, render at the browser's recommended resolution and ignore <code>window.devicePixelRatio</code>.
  41227. * @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.
  41228. * @property [contextOptions] - Context and WebGL creation properties corresponding to <code>options</code> passed to {@link Scene}.
  41229. * @property [sceneMode = SceneMode.SCENE3D] - The initial scene mode.
  41230. * @property [mapProjection = new GeographicProjection()] - The map projection to use in 2D and Columbus View modes.
  41231. * @property [globe = new Globe(mapProjection.ellipsoid)] - The globe to use in the scene. If set to <code>false</code>, no globe will be added.
  41232. * @property [orderIndependentTranslucency = true] - If true and the configuration supports it, use order independent translucency.
  41233. * @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.
  41234. * @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.
  41235. * @property [dataSources = new DataSourceCollection()] - The collection of data sources visualized by the widget. If this parameter is provided,
  41236. * the instance is assumed to be owned by the caller and will not be destroyed when the viewer is destroyed.
  41237. * @property [terrainExaggeration = 1.0] - A scalar used to exaggerate the terrain. Note that terrain exaggeration will not modify any other primitive as they are positioned relative to the ellipsoid.
  41238. * @property [shadows = false] - Determines if shadows are cast by light sources.
  41239. * @property [terrainShadows = ShadowMode.RECEIVE_ONLY] - Determines if the terrain casts or receives shadows from light sources.
  41240. * @property [mapMode2D = MapMode2D.INFINITE_SCROLL] - Determines if the 2D map is rotatable or can be scrolled infinitely in the horizontal direction.
  41241. * @property [projectionPicker = false] - If set to true, the ProjectionPicker widget will be created.
  41242. * @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}.
  41243. * @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}.
  41244. */
  41245. type ConstructorOptions = {
  41246. animation?: boolean;
  41247. baseLayerPicker?: boolean;
  41248. fullscreenButton?: boolean;
  41249. vrButton?: boolean;
  41250. geocoder?: boolean | GeocoderService[];
  41251. homeButton?: boolean;
  41252. infoBox?: boolean;
  41253. sceneModePicker?: boolean;
  41254. selectionIndicator?: boolean;
  41255. timeline?: boolean;
  41256. navigationHelpButton?: boolean;
  41257. navigationInstructionsInitiallyVisible?: boolean;
  41258. scene3DOnly?: boolean;
  41259. shouldAnimate?: boolean;
  41260. clockViewModel?: ClockViewModel;
  41261. selectedImageryProviderViewModel?: ProviderViewModel;
  41262. imageryProviderViewModels?: ProviderViewModel[];
  41263. selectedTerrainProviderViewModel?: ProviderViewModel;
  41264. terrainProviderViewModels?: ProviderViewModel[];
  41265. imageryProvider?: ImageryProvider;
  41266. terrainProvider?: TerrainProvider;
  41267. skyBox?: SkyBox | false;
  41268. skyAtmosphere?: SkyAtmosphere | false;
  41269. fullscreenElement?: Element | string;
  41270. useDefaultRenderLoop?: boolean;
  41271. targetFrameRate?: number;
  41272. showRenderLoopErrors?: boolean;
  41273. useBrowserRecommendedResolution?: boolean;
  41274. automaticallyTrackDataSourceClocks?: boolean;
  41275. contextOptions?: any;
  41276. sceneMode?: SceneMode;
  41277. mapProjection?: MapProjection;
  41278. globe?: Globe;
  41279. orderIndependentTranslucency?: boolean;
  41280. creditContainer?: Element | string;
  41281. creditViewport?: Element | string;
  41282. dataSources?: DataSourceCollection;
  41283. terrainExaggeration?: number;
  41284. shadows?: boolean;
  41285. terrainShadows?: ShadowMode;
  41286. mapMode2D?: MapMode2D;
  41287. projectionPicker?: boolean;
  41288. requestRenderMode?: boolean;
  41289. maximumRenderTimeChange?: number;
  41290. };
  41291. /**
  41292. * A function that augments a Viewer instance with additional functionality.
  41293. * @param viewer - The viewer instance.
  41294. * @param options - Options object to be passed to the mixin function.
  41295. */
  41296. type ViewerMixin = (viewer: Viewer, options: any) => void;
  41297. }
  41298. /**
  41299. * A base widget for building applications. It composites all of the standard Cesium widgets into one reusable package.
  41300. * The widget can always be extended by using mixins, which add functionality useful for a variety of applications.
  41301. * @example
  41302. * //Initialize the viewer widget with several custom options and mixins.
  41303. * var viewer = new Cesium.Viewer('cesiumContainer', {
  41304. * //Start in Columbus Viewer
  41305. * sceneMode : Cesium.SceneMode.COLUMBUS_VIEW,
  41306. * //Use Cesium World Terrain
  41307. * terrainProvider : Cesium.createWorldTerrain(),
  41308. * //Hide the base layer picker
  41309. * baseLayerPicker : false,
  41310. * //Use OpenStreetMaps
  41311. * imageryProvider : new Cesium.OpenStreetMapImageryProvider({
  41312. * url : 'https://a.tile.openstreetmap.org/'
  41313. * }),
  41314. * skyBox : new Cesium.SkyBox({
  41315. * sources : {
  41316. * positiveX : 'stars/TychoSkymapII.t3_08192x04096_80_px.jpg',
  41317. * negativeX : 'stars/TychoSkymapII.t3_08192x04096_80_mx.jpg',
  41318. * positiveY : 'stars/TychoSkymapII.t3_08192x04096_80_py.jpg',
  41319. * negativeY : 'stars/TychoSkymapII.t3_08192x04096_80_my.jpg',
  41320. * positiveZ : 'stars/TychoSkymapII.t3_08192x04096_80_pz.jpg',
  41321. * negativeZ : 'stars/TychoSkymapII.t3_08192x04096_80_mz.jpg'
  41322. * }
  41323. * }),
  41324. * // Show Columbus View map with Web Mercator projection
  41325. * mapProjection : new Cesium.WebMercatorProjection()
  41326. * });
  41327. *
  41328. * //Add basic drag and drop functionality
  41329. * viewer.extend(Cesium.viewerDragDropMixin);
  41330. *
  41331. * //Show a pop-up alert if we encounter an error when processing a dropped file
  41332. * viewer.dropError.addEventListener(function(dropHandler, name, error) {
  41333. * console.log(error);
  41334. * window.alert(error);
  41335. * });
  41336. * @param container - The DOM element or ID that will contain the widget.
  41337. * @param [options] - Object describing initialization options
  41338. */
  41339. export class Viewer {
  41340. constructor(container: Element | string, options?: Viewer.ConstructorOptions);
  41341. /**
  41342. * Gets the parent container.
  41343. */
  41344. readonly container: Element;
  41345. /**
  41346. * Gets the DOM element for the area at the bottom of the window containing the
  41347. * {@link CreditDisplay} and potentially other things.
  41348. */
  41349. readonly bottomContainer: Element;
  41350. /**
  41351. * Gets the CesiumWidget.
  41352. */
  41353. readonly cesiumWidget: CesiumWidget;
  41354. /**
  41355. * Gets the selection indicator.
  41356. */
  41357. readonly selectionIndicator: SelectionIndicator;
  41358. /**
  41359. * Gets the info box.
  41360. */
  41361. readonly infoBox: InfoBox;
  41362. /**
  41363. * Gets the Geocoder.
  41364. */
  41365. readonly geocoder: Geocoder;
  41366. /**
  41367. * Gets the HomeButton.
  41368. */
  41369. readonly homeButton: HomeButton;
  41370. /**
  41371. * Gets the SceneModePicker.
  41372. */
  41373. readonly sceneModePicker: SceneModePicker;
  41374. /**
  41375. * Gets the ProjectionPicker.
  41376. */
  41377. readonly projectionPicker: ProjectionPicker;
  41378. /**
  41379. * Gets the BaseLayerPicker.
  41380. */
  41381. readonly baseLayerPicker: BaseLayerPicker;
  41382. /**
  41383. * Gets the NavigationHelpButton.
  41384. */
  41385. readonly navigationHelpButton: NavigationHelpButton;
  41386. /**
  41387. * Gets the Animation widget.
  41388. */
  41389. readonly animation: Animation;
  41390. /**
  41391. * Gets the Timeline widget.
  41392. */
  41393. readonly timeline: Timeline;
  41394. /**
  41395. * Gets the FullscreenButton.
  41396. */
  41397. readonly fullscreenButton: FullscreenButton;
  41398. /**
  41399. * Gets the VRButton.
  41400. */
  41401. readonly vrButton: VRButton;
  41402. /**
  41403. * Gets the display used for {@link DataSource} visualization.
  41404. */
  41405. readonly dataSourceDisplay: DataSourceDisplay;
  41406. /**
  41407. * Gets the collection of entities not tied to a particular data source.
  41408. * This is a shortcut to [dataSourceDisplay.defaultDataSource.entities]{@link Viewer#dataSourceDisplay}.
  41409. */
  41410. readonly entities: EntityCollection;
  41411. /**
  41412. * Gets the set of {@link DataSource} instances to be visualized.
  41413. */
  41414. readonly dataSources: DataSourceCollection;
  41415. /**
  41416. * Gets the canvas.
  41417. */
  41418. readonly canvas: HTMLCanvasElement;
  41419. /**
  41420. * Gets the scene.
  41421. */
  41422. readonly scene: Scene;
  41423. /**
  41424. * Determines if shadows are cast by light sources.
  41425. */
  41426. shadows: boolean;
  41427. /**
  41428. * Determines if the terrain casts or shadows from light sources.
  41429. */
  41430. terrainShadows: ShadowMode;
  41431. /**
  41432. * Get the scene's shadow map
  41433. */
  41434. readonly shadowMap: ShadowMap;
  41435. /**
  41436. * Gets the collection of image layers that will be rendered on the globe.
  41437. */
  41438. readonly imageryLayers: ImageryLayerCollection;
  41439. /**
  41440. * The terrain provider providing surface geometry for the globe.
  41441. */
  41442. terrainProvider: TerrainProvider;
  41443. /**
  41444. * Gets the camera.
  41445. */
  41446. readonly camera: Camera;
  41447. /**
  41448. * Gets the post-process stages.
  41449. */
  41450. readonly postProcessStages: PostProcessStageCollection;
  41451. /**
  41452. * Gets the clock.
  41453. */
  41454. readonly clock: Clock;
  41455. /**
  41456. * Gets the clock view model.
  41457. */
  41458. readonly clockViewModel: ClockViewModel;
  41459. /**
  41460. * Gets the screen space event handler.
  41461. */
  41462. readonly screenSpaceEventHandler: ScreenSpaceEventHandler;
  41463. /**
  41464. * Gets or sets the target frame rate of the widget when <code>useDefaultRenderLoop</code>
  41465. * is true. If undefined, the browser's {@link requestAnimationFrame} implementation
  41466. * determines the frame rate. If defined, this value must be greater than 0. A value higher
  41467. * than the underlying requestAnimationFrame implementation will have no effect.
  41468. */
  41469. targetFrameRate: number;
  41470. /**
  41471. * Gets or sets whether or not this widget should control the render loop.
  41472. * If set to true the widget will use {@link requestAnimationFrame} to
  41473. * perform rendering and resizing of the widget, as well as drive the
  41474. * simulation clock. If set to false, you must manually call the
  41475. * <code>resize</code>, <code>render</code> methods
  41476. * as part of a custom render loop. If an error occurs during rendering, {@link Scene}'s
  41477. * <code>renderError</code> event will be raised and this property
  41478. * will be set to false. It must be set back to true to continue rendering
  41479. * after the error.
  41480. */
  41481. useDefaultRenderLoop: boolean;
  41482. /**
  41483. * Gets or sets a scaling factor for rendering resolution. Values less than 1.0 can improve
  41484. * performance on less powerful devices while values greater than 1.0 will render at a higher
  41485. * resolution and then scale down, resulting in improved visual fidelity.
  41486. * For example, if the widget is laid out at a size of 640x480, setting this value to 0.5
  41487. * will cause the scene to be rendered at 320x240 and then scaled up while setting
  41488. * it to 2.0 will cause the scene to be rendered at 1280x960 and then scaled down.
  41489. */
  41490. resolutionScale: number;
  41491. /**
  41492. * Boolean flag indicating if the browser's recommended resolution is used.
  41493. * If true, the browser's device pixel ratio is ignored and 1.0 is used instead,
  41494. * effectively rendering based on CSS pixels instead of device pixels. This can improve
  41495. * performance on less powerful devices that have high pixel density. When false, rendering
  41496. * will be in device pixels. {@link Viewer#resolutionScale} will still take effect whether
  41497. * this flag is true or false.
  41498. */
  41499. useBrowserRecommendedResolution: boolean;
  41500. /**
  41501. * Gets or sets whether or not data sources can temporarily pause
  41502. * animation in order to avoid showing an incomplete picture to the user.
  41503. * For example, if asynchronous primitives are being processed in the
  41504. * background, the clock will not advance until the geometry is ready.
  41505. */
  41506. allowDataSourcesToSuspendAnimation: boolean;
  41507. /**
  41508. * Gets or sets the Entity instance currently being tracked by the camera.
  41509. */
  41510. trackedEntity: Entity | undefined;
  41511. /**
  41512. * Gets or sets the object instance for which to display a selection indicator.
  41513. */
  41514. selectedEntity: Entity | undefined;
  41515. /**
  41516. * Gets the event that is raised when the selected entity changes.
  41517. */
  41518. readonly selectedEntityChanged: Event;
  41519. /**
  41520. * Gets the event that is raised when the tracked entity changes.
  41521. */
  41522. readonly trackedEntityChanged: Event;
  41523. /**
  41524. * Gets or sets the data source to track with the viewer's clock.
  41525. */
  41526. clockTrackedDataSource: DataSource;
  41527. /**
  41528. * Extends the base viewer functionality with the provided mixin.
  41529. * A mixin may add additional properties, functions, or other behavior
  41530. * to the provided viewer instance.
  41531. * @param mixin - The Viewer mixin to add to this instance.
  41532. * @param [options] - The options object to be passed to the mixin function.
  41533. */
  41534. extend(mixin: Viewer.ViewerMixin, options?: any): void;
  41535. /**
  41536. * Resizes the widget to match the container size.
  41537. * This function is called automatically as needed unless
  41538. * <code>useDefaultRenderLoop</code> is set to false.
  41539. */
  41540. resize(): void;
  41541. /**
  41542. * This forces the widget to re-think its layout, including
  41543. * widget sizes and credit placement.
  41544. */
  41545. forceResize(): void;
  41546. /**
  41547. * Renders the scene. This function is called automatically
  41548. * unless <code>useDefaultRenderLoop</code> is set to false;
  41549. */
  41550. render(): void;
  41551. /**
  41552. * @returns true if the object has been destroyed, false otherwise.
  41553. */
  41554. isDestroyed(): boolean;
  41555. /**
  41556. * Destroys the widget. Should be called if permanently
  41557. * removing the widget from layout.
  41558. */
  41559. destroy(): void;
  41560. /**
  41561. * Asynchronously sets the camera to view the provided entity, entities, or data source.
  41562. * If the data source is still in the process of loading or the visualization is otherwise still loading,
  41563. * this method waits for the data to be ready before performing the zoom.
  41564. *
  41565. * <p>The offset is heading/pitch/range in the local east-north-up reference frame centered at the center of the bounding sphere.
  41566. * The heading and the pitch angles are defined in the local east-north-up reference frame.
  41567. * The heading is the angle from y axis and increasing towards the x axis. Pitch is the rotation from the xy-plane. Positive pitch
  41568. * angles are above the plane. Negative pitch angles are below the plane. The range is the distance from the center. If the range is
  41569. * zero, a range will be computed such that the whole bounding sphere is visible.</p>
  41570. *
  41571. * <p>In 2D, there must be a top down view. The camera will be placed above the target looking down. The height above the
  41572. * target will be the range. The heading will be determined from the offset. If the heading cannot be
  41573. * determined from the offset, the heading will be north.</p>
  41574. * @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.
  41575. * @param [offset] - The offset from the center of the entity in the local east-north-up reference frame.
  41576. * @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.
  41577. */
  41578. zoomTo(target: Entity | Entity[] | EntityCollection | DataSource | ImageryLayer | Cesium3DTileset | TimeDynamicPointCloud | Promise<Entity | Entity[] | EntityCollection | DataSource | ImageryLayer | Cesium3DTileset | TimeDynamicPointCloud>, offset?: HeadingPitchRange): Promise<boolean>;
  41579. /**
  41580. * Flies the camera to the provided entity, entities, or data source.
  41581. * If the data source is still in the process of loading or the visualization is otherwise still loading,
  41582. * this method waits for the data to be ready before performing the flight.
  41583. *
  41584. * <p>The offset is heading/pitch/range in the local east-north-up reference frame centered at the center of the bounding sphere.
  41585. * The heading and the pitch angles are defined in the local east-north-up reference frame.
  41586. * The heading is the angle from y axis and increasing towards the x axis. Pitch is the rotation from the xy-plane. Positive pitch
  41587. * angles are above the plane. Negative pitch angles are below the plane. The range is the distance from the center. If the range is
  41588. * zero, a range will be computed such that the whole bounding sphere is visible.</p>
  41589. *
  41590. * <p>In 2D, there must be a top down view. The camera will be placed above the target looking down. The height above the
  41591. * target will be the range. The heading will be determined from the offset. If the heading cannot be
  41592. * determined from the offset, the heading will be north.</p>
  41593. * @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.
  41594. * @param [options] - Object with the following properties:
  41595. * @param [options.duration = 3.0] - The duration of the flight in seconds.
  41596. * @param [options.maximumHeight] - The maximum height at the peak of the flight.
  41597. * @param [options.offset] - The offset from the target in the local east-north-up reference frame centered at the target.
  41598. * @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
  41599. */
  41600. flyTo(target: Entity | Entity[] | EntityCollection | DataSource | ImageryLayer | Cesium3DTileset | TimeDynamicPointCloud | Promise<Entity | Entity[] | EntityCollection | DataSource | ImageryLayer | Cesium3DTileset | TimeDynamicPointCloud>, options?: {
  41601. duration?: number;
  41602. maximumHeight?: number;
  41603. offset?: HeadingPitchRange;
  41604. }): Promise<boolean>;
  41605. }
  41606. /**
  41607. * A mixin which adds the {@link Cesium3DTilesInspector} widget to the {@link Viewer} widget.
  41608. * Rather than being called directly, this function is normally passed as
  41609. * a parameter to {@link Viewer#extend}, as shown in the example below.
  41610. * @example
  41611. * var viewer = new Cesium.Viewer('cesiumContainer');
  41612. * viewer.extend(Cesium.viewerCesium3DTilesInspectorMixin);
  41613. * @param viewer - The viewer instance.
  41614. */
  41615. export function viewerCesium3DTilesInspectorMixin(viewer: Viewer): void;
  41616. /**
  41617. * A mixin which adds the CesiumInspector widget to the Viewer widget.
  41618. * Rather than being called directly, this function is normally passed as
  41619. * a parameter to {@link Viewer#extend}, as shown in the example below.
  41620. * @example
  41621. * var viewer = new Cesium.Viewer('cesiumContainer');
  41622. * viewer.extend(Cesium.viewerCesiumInspectorMixin);
  41623. * @param viewer - The viewer instance.
  41624. */
  41625. export function viewerCesiumInspectorMixin(viewer: Viewer): void;
  41626. /**
  41627. * A mixin which adds default drag and drop support for CZML files to the Viewer widget.
  41628. * Rather than being called directly, this function is normally passed as
  41629. * a parameter to {@link Viewer#extend}, as shown in the example below.
  41630. * @example
  41631. * // Add basic drag and drop support and pop up an alert window on error.
  41632. * var viewer = new Cesium.Viewer('cesiumContainer');
  41633. * viewer.extend(Cesium.viewerDragDropMixin);
  41634. * viewer.dropError.addEventListener(function(viewerArg, source, error) {
  41635. * window.alert('Error processing ' + source + ':' + error);
  41636. * });
  41637. * @param viewer - The viewer instance.
  41638. * @param [options] - Object with the following properties:
  41639. * @param [options.dropTarget = viewer.container] - The DOM element which will serve as the drop target.
  41640. * @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.
  41641. * @param [options.flyToOnDrop = true] - When true, dropping files will fly to the data source once it is loaded.
  41642. * @param [options.clampToGround = true] - When true, datasources are clamped to the ground.
  41643. * @param [options.proxy] - The proxy to be used for KML network links.
  41644. */
  41645. export function viewerDragDropMixin(viewer: Viewer, options?: {
  41646. dropTarget?: Element | string;
  41647. clearOnDrop?: boolean;
  41648. flyToOnDrop?: boolean;
  41649. clampToGround?: boolean;
  41650. proxy?: Proxy;
  41651. }): void;
  41652. /**
  41653. * A mixin which adds the {@link PerformanceWatchdog} widget to the {@link Viewer} widget.
  41654. * Rather than being called directly, this function is normally passed as
  41655. * a parameter to {@link Viewer#extend}, as shown in the example below.
  41656. * @example
  41657. * var viewer = new Cesium.Viewer('cesiumContainer');
  41658. * viewer.extend(Cesium.viewerPerformanceWatchdogMixin, {
  41659. * lowFrameRateMessage : 'Why is this going so <em>slowly</em>?'
  41660. * });
  41661. * @param viewer - The viewer instance.
  41662. * @param [options] - An object with properties.
  41663. * @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
  41664. * message to display when a low frame rate is detected. The message is interpeted as HTML, so make sure
  41665. * it comes from a trusted source so that your application is not vulnerable to cross-site scripting attacks.
  41666. */
  41667. export function viewerPerformanceWatchdogMixin(viewer: Viewer, options?: {
  41668. lowFrameRateMessage?: string;
  41669. }): void;
  41670. /**
  41671. * Create a Command from a given function, for use with ViewModels.
  41672. *
  41673. * A Command is a function with an extra <code>canExecute</code> observable property to determine
  41674. * whether the command can be executed. When executed, a Command function will check the
  41675. * value of <code>canExecute</code> and throw if false. It also provides events for when
  41676. * a command has been or is about to be executed.
  41677. * @param func - The function to execute.
  41678. * @param [canExecute = true] - A boolean indicating whether the function can currently be executed.
  41679. */
  41680. export function createCommand(func: (...params: any[]) => any, canExecute?: boolean): void;
  41681. }
  41682. declare module "cesium/Source/Core/ArcGISTiledElevationTerrainProvider" { import { ArcGISTiledElevationTerrainProvider } from 'cesium'; export default ArcGISTiledElevationTerrainProvider; }
  41683. declare module "cesium/Source/Core/ArcType" { import { ArcType } from 'cesium'; export default ArcType; }
  41684. declare module "cesium/Source/Core/AssociativeArray" { import { AssociativeArray } from 'cesium'; export default AssociativeArray; }
  41685. declare module "cesium/Source/Core/AxisAlignedBoundingBox" { import { AxisAlignedBoundingBox } from 'cesium'; export default AxisAlignedBoundingBox; }
  41686. declare module "cesium/Source/Core/BingMapsApi" { import { BingMapsApi } from 'cesium'; export default BingMapsApi; }
  41687. declare module "cesium/Source/Core/BingMapsGeocoderService" { import { BingMapsGeocoderService } from 'cesium'; export default BingMapsGeocoderService; }
  41688. declare module "cesium/Source/Core/BoundingRectangle" { import { BoundingRectangle } from 'cesium'; export default BoundingRectangle; }
  41689. declare module "cesium/Source/Core/BoundingSphere" { import { BoundingSphere } from 'cesium'; export default BoundingSphere; }
  41690. declare module "cesium/Source/Core/BoxGeometry" { import { BoxGeometry } from 'cesium'; export default BoxGeometry; }
  41691. declare module "cesium/Source/Core/BoxOutlineGeometry" { import { BoxOutlineGeometry } from 'cesium'; export default BoxOutlineGeometry; }
  41692. declare module "cesium/Source/Core/Cartesian2" { import { Cartesian2 } from 'cesium'; export default Cartesian2; }
  41693. declare module "cesium/Source/Core/Cartesian3" { import { Cartesian3 } from 'cesium'; export default Cartesian3; }
  41694. declare module "cesium/Source/Core/Cartesian4" { import { Cartesian4 } from 'cesium'; export default Cartesian4; }
  41695. declare module "cesium/Source/Core/Cartographic" { import { Cartographic } from 'cesium'; export default Cartographic; }
  41696. declare module "cesium/Source/Core/CartographicGeocoderService" { import { CartographicGeocoderService } from 'cesium'; export default CartographicGeocoderService; }
  41697. declare module "cesium/Source/Core/CatmullRomSpline" { import { CatmullRomSpline } from 'cesium'; export default CatmullRomSpline; }
  41698. declare module "cesium/Source/Core/CesiumTerrainProvider" { import { CesiumTerrainProvider } from 'cesium'; export default CesiumTerrainProvider; }
  41699. declare module "cesium/Source/Core/CircleGeometry" { import { CircleGeometry } from 'cesium'; export default CircleGeometry; }
  41700. declare module "cesium/Source/Core/CircleOutlineGeometry" { import { CircleOutlineGeometry } from 'cesium'; export default CircleOutlineGeometry; }
  41701. declare module "cesium/Source/Core/Clock" { import { Clock } from 'cesium'; export default Clock; }
  41702. declare module "cesium/Source/Core/ClockRange" { import { ClockRange } from 'cesium'; export default ClockRange; }
  41703. declare module "cesium/Source/Core/ClockStep" { import { ClockStep } from 'cesium'; export default ClockStep; }
  41704. declare module "cesium/Source/Core/Color" { import { Color } from 'cesium'; export default Color; }
  41705. declare module "cesium/Source/Core/ColorGeometryInstanceAttribute" { import { ColorGeometryInstanceAttribute } from 'cesium'; export default ColorGeometryInstanceAttribute; }
  41706. declare module "cesium/Source/Core/ComponentDatatype" { import { ComponentDatatype } from 'cesium'; export default ComponentDatatype; }
  41707. declare module "cesium/Source/Core/CompressedTextureBuffer" { import { CompressedTextureBuffer } from 'cesium'; export default CompressedTextureBuffer; }
  41708. declare module "cesium/Source/Core/CoplanarPolygonGeometry" { import { CoplanarPolygonGeometry } from 'cesium'; export default CoplanarPolygonGeometry; }
  41709. declare module "cesium/Source/Core/CoplanarPolygonOutlineGeometry" { import { CoplanarPolygonOutlineGeometry } from 'cesium'; export default CoplanarPolygonOutlineGeometry; }
  41710. declare module "cesium/Source/Core/CornerType" { import { CornerType } from 'cesium'; export default CornerType; }
  41711. declare module "cesium/Source/Core/CorridorGeometry" { import { CorridorGeometry } from 'cesium'; export default CorridorGeometry; }
  41712. declare module "cesium/Source/Core/CorridorOutlineGeometry" { import { CorridorOutlineGeometry } from 'cesium'; export default CorridorOutlineGeometry; }
  41713. declare module "cesium/Source/Core/Credit" { import { Credit } from 'cesium'; export default Credit; }
  41714. declare module "cesium/Source/Core/CubicRealPolynomial" { import { CubicRealPolynomial } from 'cesium'; export default CubicRealPolynomial; }
  41715. declare module "cesium/Source/Core/CullingVolume" { import { CullingVolume } from 'cesium'; export default CullingVolume; }
  41716. declare module "cesium/Source/Core/CylinderGeometry" { import { CylinderGeometry } from 'cesium'; export default CylinderGeometry; }
  41717. declare module "cesium/Source/Core/CylinderOutlineGeometry" { import { CylinderOutlineGeometry } from 'cesium'; export default CylinderOutlineGeometry; }
  41718. declare module "cesium/Source/Core/DefaultProxy" { import { DefaultProxy } from 'cesium'; export default DefaultProxy; }
  41719. declare module "cesium/Source/Core/DeveloperError" { import { DeveloperError } from 'cesium'; export default DeveloperError; }
  41720. declare module "cesium/Source/Core/DistanceDisplayCondition" { import { DistanceDisplayCondition } from 'cesium'; export default DistanceDisplayCondition; }
  41721. declare module "cesium/Source/Core/DistanceDisplayConditionGeometryInstanceAttribute" { import { DistanceDisplayConditionGeometryInstanceAttribute } from 'cesium'; export default DistanceDisplayConditionGeometryInstanceAttribute; }
  41722. declare module "cesium/Source/Core/EasingFunction" { import { EasingFunction } from 'cesium'; export default EasingFunction; }
  41723. declare module "cesium/Source/Core/EllipseGeometry" { import { EllipseGeometry } from 'cesium'; export default EllipseGeometry; }
  41724. declare module "cesium/Source/Core/EllipseOutlineGeometry" { import { EllipseOutlineGeometry } from 'cesium'; export default EllipseOutlineGeometry; }
  41725. declare module "cesium/Source/Core/Ellipsoid" { import { Ellipsoid } from 'cesium'; export default Ellipsoid; }
  41726. declare module "cesium/Source/Core/EllipsoidGeodesic" { import { EllipsoidGeodesic } from 'cesium'; export default EllipsoidGeodesic; }
  41727. declare module "cesium/Source/Core/EllipsoidGeometry" { import { EllipsoidGeometry } from 'cesium'; export default EllipsoidGeometry; }
  41728. declare module "cesium/Source/Core/EllipsoidOutlineGeometry" { import { EllipsoidOutlineGeometry } from 'cesium'; export default EllipsoidOutlineGeometry; }
  41729. declare module "cesium/Source/Core/EllipsoidRhumbLine" { import { EllipsoidRhumbLine } from 'cesium'; export default EllipsoidRhumbLine; }
  41730. declare module "cesium/Source/Core/EllipsoidTangentPlane" { import { EllipsoidTangentPlane } from 'cesium'; export default EllipsoidTangentPlane; }
  41731. declare module "cesium/Source/Core/EllipsoidTerrainProvider" { import { EllipsoidTerrainProvider } from 'cesium'; export default EllipsoidTerrainProvider; }
  41732. declare module "cesium/Source/Core/Event" { import { Event } from 'cesium'; export default Event; }
  41733. declare module "cesium/Source/Core/EventHelper" { import { EventHelper } from 'cesium'; export default EventHelper; }
  41734. declare module "cesium/Source/Core/ExtrapolationType" { import { ExtrapolationType } from 'cesium'; export default ExtrapolationType; }
  41735. declare module "cesium/Source/Core/FeatureDetection" { import { FeatureDetection } from 'cesium'; export default FeatureDetection; }
  41736. declare module "cesium/Source/Core/FrustumGeometry" { import { FrustumGeometry } from 'cesium'; export default FrustumGeometry; }
  41737. declare module "cesium/Source/Core/FrustumOutlineGeometry" { import { FrustumOutlineGeometry } from 'cesium'; export default FrustumOutlineGeometry; }
  41738. declare module "cesium/Source/Core/Fullscreen" { import { Fullscreen } from 'cesium'; export default Fullscreen; }
  41739. declare module "cesium/Source/Core/GeocodeType" { import { GeocodeType } from 'cesium'; export default GeocodeType; }
  41740. declare module "cesium/Source/Core/GeocoderService" { import { GeocoderService } from 'cesium'; export default GeocoderService; }
  41741. declare module "cesium/Source/Core/GeographicProjection" { import { GeographicProjection } from 'cesium'; export default GeographicProjection; }
  41742. declare module "cesium/Source/Core/GeographicTilingScheme" { import { GeographicTilingScheme } from 'cesium'; export default GeographicTilingScheme; }
  41743. declare module "cesium/Source/Core/Geometry" { import { Geometry } from 'cesium'; export default Geometry; }
  41744. declare module "cesium/Source/Core/GeometryAttribute" { import { GeometryAttribute } from 'cesium'; export default GeometryAttribute; }
  41745. declare module "cesium/Source/Core/GeometryAttributes" { import { GeometryAttributes } from 'cesium'; export default GeometryAttributes; }
  41746. declare module "cesium/Source/Core/GeometryFactory" { import { GeometryFactory } from 'cesium'; export default GeometryFactory; }
  41747. declare module "cesium/Source/Core/GeometryInstance" { import { GeometryInstance } from 'cesium'; export default GeometryInstance; }
  41748. declare module "cesium/Source/Core/GeometryInstanceAttribute" { import { GeometryInstanceAttribute } from 'cesium'; export default GeometryInstanceAttribute; }
  41749. declare module "cesium/Source/Core/GeometryPipeline" { import { GeometryPipeline } from 'cesium'; export default GeometryPipeline; }
  41750. declare module "cesium/Source/Core/GoogleEarthEnterpriseMetadata" { import { GoogleEarthEnterpriseMetadata } from 'cesium'; export default GoogleEarthEnterpriseMetadata; }
  41751. declare module "cesium/Source/Core/GoogleEarthEnterpriseTerrainData" { import { GoogleEarthEnterpriseTerrainData } from 'cesium'; export default GoogleEarthEnterpriseTerrainData; }
  41752. declare module "cesium/Source/Core/GoogleEarthEnterpriseTerrainProvider" { import { GoogleEarthEnterpriseTerrainProvider } from 'cesium'; export default GoogleEarthEnterpriseTerrainProvider; }
  41753. declare module "cesium/Source/Core/GregorianDate" { import { GregorianDate } from 'cesium'; export default GregorianDate; }
  41754. declare module "cesium/Source/Core/GroundPolylineGeometry" { import { GroundPolylineGeometry } from 'cesium'; export default GroundPolylineGeometry; }
  41755. declare module "cesium/Source/Core/HeadingPitchRange" { import { HeadingPitchRange } from 'cesium'; export default HeadingPitchRange; }
  41756. declare module "cesium/Source/Core/HeadingPitchRoll" { import { HeadingPitchRoll } from 'cesium'; export default HeadingPitchRoll; }
  41757. declare module "cesium/Source/Core/HeightmapEncoding" { import { HeightmapEncoding } from 'cesium'; export default HeightmapEncoding; }
  41758. declare module "cesium/Source/Core/HeightmapTerrainData" { import { HeightmapTerrainData } from 'cesium'; export default HeightmapTerrainData; }
  41759. declare module "cesium/Source/Core/HermitePolynomialApproximation" { import { HermitePolynomialApproximation } from 'cesium'; export default HermitePolynomialApproximation; }
  41760. declare module "cesium/Source/Core/HermiteSpline" { import { HermiteSpline } from 'cesium'; export default HermiteSpline; }
  41761. declare module "cesium/Source/Core/IndexDatatype" { import { IndexDatatype } from 'cesium'; export default IndexDatatype; }
  41762. declare module "cesium/Source/Core/InterpolationAlgorithm" { import { InterpolationAlgorithm } from 'cesium'; export default InterpolationAlgorithm; }
  41763. declare module "cesium/Source/Core/Intersect" { import { Intersect } from 'cesium'; export default Intersect; }
  41764. declare module "cesium/Source/Core/IntersectionTests" { import { IntersectionTests } from 'cesium'; export default IntersectionTests; }
  41765. declare module "cesium/Source/Core/Intersections2D" { import { Intersections2D } from 'cesium'; export default Intersections2D; }
  41766. declare module "cesium/Source/Core/Interval" { import { Interval } from 'cesium'; export default Interval; }
  41767. declare module "cesium/Source/Core/Ion" { import { Ion } from 'cesium'; export default Ion; }
  41768. declare module "cesium/Source/Core/IonGeocoderService" { import { IonGeocoderService } from 'cesium'; export default IonGeocoderService; }
  41769. declare module "cesium/Source/Core/IonResource" { import { IonResource } from 'cesium'; export default IonResource; }
  41770. declare module "cesium/Source/Core/Iso8601" { import { Iso8601 } from 'cesium'; export default Iso8601; }
  41771. declare module "cesium/Source/Core/JulianDate" { import { JulianDate } from 'cesium'; export default JulianDate; }
  41772. declare module "cesium/Source/Core/KeyboardEventModifier" { import { KeyboardEventModifier } from 'cesium'; export default KeyboardEventModifier; }
  41773. declare module "cesium/Source/Core/LagrangePolynomialApproximation" { import { LagrangePolynomialApproximation } from 'cesium'; export default LagrangePolynomialApproximation; }
  41774. declare module "cesium/Source/Core/LeapSecond" { import { LeapSecond } from 'cesium'; export default LeapSecond; }
  41775. declare module "cesium/Source/Core/LinearApproximation" { import { LinearApproximation } from 'cesium'; export default LinearApproximation; }
  41776. declare module "cesium/Source/Core/LinearSpline" { import { LinearSpline } from 'cesium'; export default LinearSpline; }
  41777. declare module "cesium/Source/Core/MapProjection" { import { MapProjection } from 'cesium'; export default MapProjection; }
  41778. declare module "cesium/Source/Core/MapboxApi" { import { MapboxApi } from 'cesium'; export default MapboxApi; }
  41779. declare module "cesium/Source/Core/Math" { import { Math } from 'cesium'; export default Math; }
  41780. declare module "cesium/Source/Core/Matrix2" { import { Matrix2 } from 'cesium'; export default Matrix2; }
  41781. declare module "cesium/Source/Core/Matrix3" { import { Matrix3 } from 'cesium'; export default Matrix3; }
  41782. declare module "cesium/Source/Core/Matrix4" { import { Matrix4 } from 'cesium'; export default Matrix4; }
  41783. declare module "cesium/Source/Core/NearFarScalar" { import { NearFarScalar } from 'cesium'; export default NearFarScalar; }
  41784. declare module "cesium/Source/Core/Occluder" { import { Occluder } from 'cesium'; export default Occluder; }
  41785. declare module "cesium/Source/Core/OpenCageGeocoderService" { import { OpenCageGeocoderService } from 'cesium'; export default OpenCageGeocoderService; }
  41786. declare module "cesium/Source/Core/OrientedBoundingBox" { import { OrientedBoundingBox } from 'cesium'; export default OrientedBoundingBox; }
  41787. declare module "cesium/Source/Core/OrthographicFrustum" { import { OrthographicFrustum } from 'cesium'; export default OrthographicFrustum; }
  41788. declare module "cesium/Source/Core/OrthographicOffCenterFrustum" { import { OrthographicOffCenterFrustum } from 'cesium'; export default OrthographicOffCenterFrustum; }
  41789. declare module "cesium/Source/Core/Packable" { import { Packable } from 'cesium'; export default Packable; }
  41790. declare module "cesium/Source/Core/PackableForInterpolation" { import { PackableForInterpolation } from 'cesium'; export default PackableForInterpolation; }
  41791. declare module "cesium/Source/Core/PeliasGeocoderService" { import { PeliasGeocoderService } from 'cesium'; export default PeliasGeocoderService; }
  41792. declare module "cesium/Source/Core/PerspectiveFrustum" { import { PerspectiveFrustum } from 'cesium'; export default PerspectiveFrustum; }
  41793. declare module "cesium/Source/Core/PerspectiveOffCenterFrustum" { import { PerspectiveOffCenterFrustum } from 'cesium'; export default PerspectiveOffCenterFrustum; }
  41794. declare module "cesium/Source/Core/PinBuilder" { import { PinBuilder } from 'cesium'; export default PinBuilder; }
  41795. declare module "cesium/Source/Core/PixelFormat" { import { PixelFormat } from 'cesium'; export default PixelFormat; }
  41796. declare module "cesium/Source/Core/Plane" { import { Plane } from 'cesium'; export default Plane; }
  41797. declare module "cesium/Source/Core/PlaneGeometry" { import { PlaneGeometry } from 'cesium'; export default PlaneGeometry; }
  41798. declare module "cesium/Source/Core/PlaneOutlineGeometry" { import { PlaneOutlineGeometry } from 'cesium'; export default PlaneOutlineGeometry; }
  41799. declare module "cesium/Source/Core/PolygonGeometry" { import { PolygonGeometry } from 'cesium'; export default PolygonGeometry; }
  41800. declare module "cesium/Source/Core/PolygonHierarchy" { import { PolygonHierarchy } from 'cesium'; export default PolygonHierarchy; }
  41801. declare module "cesium/Source/Core/PolygonOutlineGeometry" { import { PolygonOutlineGeometry } from 'cesium'; export default PolygonOutlineGeometry; }
  41802. declare module "cesium/Source/Core/PolylineGeometry" { import { PolylineGeometry } from 'cesium'; export default PolylineGeometry; }
  41803. declare module "cesium/Source/Core/PolylineVolumeGeometry" { import { PolylineVolumeGeometry } from 'cesium'; export default PolylineVolumeGeometry; }
  41804. declare module "cesium/Source/Core/PolylineVolumeOutlineGeometry" { import { PolylineVolumeOutlineGeometry } from 'cesium'; export default PolylineVolumeOutlineGeometry; }
  41805. declare module "cesium/Source/Core/PrimitiveType" { import { PrimitiveType } from 'cesium'; export default PrimitiveType; }
  41806. declare module "cesium/Source/Core/Proxy" { import { Proxy } from 'cesium'; export default Proxy; }
  41807. declare module "cesium/Source/Core/QuadraticRealPolynomial" { import { QuadraticRealPolynomial } from 'cesium'; export default QuadraticRealPolynomial; }
  41808. declare module "cesium/Source/Core/QuantizedMeshTerrainData" { import { QuantizedMeshTerrainData } from 'cesium'; export default QuantizedMeshTerrainData; }
  41809. declare module "cesium/Source/Core/QuarticRealPolynomial" { import { QuarticRealPolynomial } from 'cesium'; export default QuarticRealPolynomial; }
  41810. declare module "cesium/Source/Core/Quaternion" { import { Quaternion } from 'cesium'; export default Quaternion; }
  41811. declare module "cesium/Source/Core/QuaternionSpline" { import { QuaternionSpline } from 'cesium'; export default QuaternionSpline; }
  41812. declare module "cesium/Source/Core/Queue" { import { Queue } from 'cesium'; export default Queue; }
  41813. declare module "cesium/Source/Core/Ray" { import { Ray } from 'cesium'; export default Ray; }
  41814. declare module "cesium/Source/Core/Rectangle" { import { Rectangle } from 'cesium'; export default Rectangle; }
  41815. declare module "cesium/Source/Core/RectangleGeometry" { import { RectangleGeometry } from 'cesium'; export default RectangleGeometry; }
  41816. declare module "cesium/Source/Core/RectangleOutlineGeometry" { import { RectangleOutlineGeometry } from 'cesium'; export default RectangleOutlineGeometry; }
  41817. declare module "cesium/Source/Core/ReferenceFrame" { import { ReferenceFrame } from 'cesium'; export default ReferenceFrame; }
  41818. declare module "cesium/Source/Core/Request" { import { Request } from 'cesium'; export default Request; }
  41819. declare module "cesium/Source/Core/RequestErrorEvent" { import { RequestErrorEvent } from 'cesium'; export default RequestErrorEvent; }
  41820. declare module "cesium/Source/Core/RequestScheduler" { import { RequestScheduler } from 'cesium'; export default RequestScheduler; }
  41821. declare module "cesium/Source/Core/RequestState" { import { RequestState } from 'cesium'; export default RequestState; }
  41822. declare module "cesium/Source/Core/RequestType" { import { RequestType } from 'cesium'; export default RequestType; }
  41823. declare module "cesium/Source/Core/Resource" { import { Resource } from 'cesium'; export default Resource; }
  41824. declare module "cesium/Source/Core/RuntimeError" { import { RuntimeError } from 'cesium'; export default RuntimeError; }
  41825. declare module "cesium/Source/Core/ScreenSpaceEventHandler" { import { ScreenSpaceEventHandler } from 'cesium'; export default ScreenSpaceEventHandler; }
  41826. declare module "cesium/Source/Core/ScreenSpaceEventType" { import { ScreenSpaceEventType } from 'cesium'; export default ScreenSpaceEventType; }
  41827. declare module "cesium/Source/Core/ShowGeometryInstanceAttribute" { import { ShowGeometryInstanceAttribute } from 'cesium'; export default ShowGeometryInstanceAttribute; }
  41828. declare module "cesium/Source/Core/Simon1994PlanetaryPositions" { import { Simon1994PlanetaryPositions } from 'cesium'; export default Simon1994PlanetaryPositions; }
  41829. declare module "cesium/Source/Core/SimplePolylineGeometry" { import { SimplePolylineGeometry } from 'cesium'; export default SimplePolylineGeometry; }
  41830. declare module "cesium/Source/Core/SphereGeometry" { import { SphereGeometry } from 'cesium'; export default SphereGeometry; }
  41831. declare module "cesium/Source/Core/SphereOutlineGeometry" { import { SphereOutlineGeometry } from 'cesium'; export default SphereOutlineGeometry; }
  41832. declare module "cesium/Source/Core/Spherical" { import { Spherical } from 'cesium'; export default Spherical; }
  41833. declare module "cesium/Source/Core/Spline" { import { Spline } from 'cesium'; export default Spline; }
  41834. declare module "cesium/Source/Core/TaskProcessor" { import { TaskProcessor } from 'cesium'; export default TaskProcessor; }
  41835. declare module "cesium/Source/Core/TerrainData" { import { TerrainData } from 'cesium'; export default TerrainData; }
  41836. declare module "cesium/Source/Core/TerrainProvider" { import { TerrainProvider } from 'cesium'; export default TerrainProvider; }
  41837. declare module "cesium/Source/Core/TileAvailability" { import { TileAvailability } from 'cesium'; export default TileAvailability; }
  41838. declare module "cesium/Source/Core/TileProviderError" { import { TileProviderError } from 'cesium'; export default TileProviderError; }
  41839. declare module "cesium/Source/Core/TilingScheme" { import { TilingScheme } from 'cesium'; export default TilingScheme; }
  41840. declare module "cesium/Source/Core/TimeInterval" { import { TimeInterval } from 'cesium'; export default TimeInterval; }
  41841. declare module "cesium/Source/Core/TimeIntervalCollection" { import { TimeIntervalCollection } from 'cesium'; export default TimeIntervalCollection; }
  41842. declare module "cesium/Source/Core/TimeStandard" { import { TimeStandard } from 'cesium'; export default TimeStandard; }
  41843. declare module "cesium/Source/Core/Transforms" { import { Transforms } from 'cesium'; export default Transforms; }
  41844. declare module "cesium/Source/Core/TranslationRotationScale" { import { TranslationRotationScale } from 'cesium'; export default TranslationRotationScale; }
  41845. declare module "cesium/Source/Core/TridiagonalSystemSolver" { import { TridiagonalSystemSolver } from 'cesium'; export default TridiagonalSystemSolver; }
  41846. declare module "cesium/Source/Core/TrustedServers" { import { TrustedServers } from 'cesium'; export default TrustedServers; }
  41847. declare module "cesium/Source/Core/VRTheWorldTerrainProvider" { import { VRTheWorldTerrainProvider } from 'cesium'; export default VRTheWorldTerrainProvider; }
  41848. declare module "cesium/Source/Core/VertexFormat" { import { VertexFormat } from 'cesium'; export default VertexFormat; }
  41849. declare module "cesium/Source/Core/VideoSynchronizer" { import { VideoSynchronizer } from 'cesium'; export default VideoSynchronizer; }
  41850. declare module "cesium/Source/Core/Visibility" { import { Visibility } from 'cesium'; export default Visibility; }
  41851. declare module "cesium/Source/Core/WallGeometry" { import { WallGeometry } from 'cesium'; export default WallGeometry; }
  41852. declare module "cesium/Source/Core/WallOutlineGeometry" { import { WallOutlineGeometry } from 'cesium'; export default WallOutlineGeometry; }
  41853. declare module "cesium/Source/Core/WebGLConstants" { import { WebGLConstants } from 'cesium'; export default WebGLConstants; }
  41854. declare module "cesium/Source/Core/WebMercatorProjection" { import { WebMercatorProjection } from 'cesium'; export default WebMercatorProjection; }
  41855. declare module "cesium/Source/Core/WebMercatorTilingScheme" { import { WebMercatorTilingScheme } from 'cesium'; export default WebMercatorTilingScheme; }
  41856. declare module "cesium/Source/Core/WeightSpline" { import { WeightSpline } from 'cesium'; export default WeightSpline; }
  41857. declare module "cesium/Source/Core/WindingOrder" { import { WindingOrder } from 'cesium'; export default WindingOrder; }
  41858. declare module "cesium/Source/Core/barycentricCoordinates" { import { barycentricCoordinates } from 'cesium'; export default barycentricCoordinates; }
  41859. declare module "cesium/Source/Core/binarySearch" { import { binarySearch } from 'cesium'; export default binarySearch; }
  41860. declare module "cesium/Source/Core/buildModuleUrl" { import { buildModuleUrl } from 'cesium'; export default buildModuleUrl; }
  41861. declare module "cesium/Source/Core/cancelAnimationFrame" { import { cancelAnimationFrame } from 'cesium'; export default cancelAnimationFrame; }
  41862. declare module "cesium/Source/Core/clone" { import { clone } from 'cesium'; export default clone; }
  41863. declare module "cesium/Source/Core/combine" { import { combine } from 'cesium'; export default combine; }
  41864. declare module "cesium/Source/Core/createGuid" { import { createGuid } from 'cesium'; export default createGuid; }
  41865. declare module "cesium/Source/Core/createWorldTerrain" { import { createWorldTerrain } from 'cesium'; export default createWorldTerrain; }
  41866. declare module "cesium/Source/Core/defaultValue" { import { defaultValue } from 'cesium'; export default defaultValue; }
  41867. declare module "cesium/Source/Core/defined" { import { defined } from 'cesium'; export default defined; }
  41868. declare module "cesium/Source/Core/destroyObject" { import { destroyObject } from 'cesium'; export default destroyObject; }
  41869. declare module "cesium/Source/Core/formatError" { import { formatError } from 'cesium'; export default formatError; }
  41870. declare module "cesium/Source/Core/getAbsoluteUri" { import { getAbsoluteUri } from 'cesium'; export default getAbsoluteUri; }
  41871. declare module "cesium/Source/Core/getBaseUri" { import { getBaseUri } from 'cesium'; export default getBaseUri; }
  41872. declare module "cesium/Source/Core/getExtensionFromUri" { import { getExtensionFromUri } from 'cesium'; export default getExtensionFromUri; }
  41873. declare module "cesium/Source/Core/getFilenameFromUri" { import { getFilenameFromUri } from 'cesium'; export default getFilenameFromUri; }
  41874. declare module "cesium/Source/Core/getImagePixels" { import { getImagePixels } from 'cesium'; export default getImagePixels; }
  41875. declare module "cesium/Source/Core/getTimestamp" { import { getTimestamp } from 'cesium'; export default getTimestamp; }
  41876. declare module "cesium/Source/Core/isLeapYear" { import { isLeapYear } from 'cesium'; export default isLeapYear; }
  41877. declare module "cesium/Source/Core/loadCRN" { import { loadCRN } from 'cesium'; export default loadCRN; }
  41878. declare module "cesium/Source/Core/loadKTX" { import { loadKTX } from 'cesium'; export default loadKTX; }
  41879. declare module "cesium/Source/Core/mergeSort" { import { mergeSort } from 'cesium'; export default mergeSort; }
  41880. declare module "cesium/Source/Core/objectToQuery" { import { objectToQuery } from 'cesium'; export default objectToQuery; }
  41881. declare module "cesium/Source/Core/pointInsideTriangle" { import { pointInsideTriangle } from 'cesium'; export default pointInsideTriangle; }
  41882. declare module "cesium/Source/Core/queryToObject" { import { queryToObject } from 'cesium'; export default queryToObject; }
  41883. declare module "cesium/Source/Core/requestAnimationFrame" { import { requestAnimationFrame } from 'cesium'; export default requestAnimationFrame; }
  41884. declare module "cesium/Source/Core/sampleTerrain" { import { sampleTerrain } from 'cesium'; export default sampleTerrain; }
  41885. declare module "cesium/Source/Core/sampleTerrainMostDetailed" { import { sampleTerrainMostDetailed } from 'cesium'; export default sampleTerrainMostDetailed; }
  41886. declare module "cesium/Source/Core/subdivideArray" { import { subdivideArray } from 'cesium'; export default subdivideArray; }
  41887. declare module "cesium/Source/Core/writeTextToCanvas" { import { writeTextToCanvas } from 'cesium'; export default writeTextToCanvas; }
  41888. declare module "cesium/Source/DataSources/BillboardGraphics" { import { BillboardGraphics } from 'cesium'; export default BillboardGraphics; }
  41889. declare module "cesium/Source/DataSources/BillboardVisualizer" { import { BillboardVisualizer } from 'cesium'; export default BillboardVisualizer; }
  41890. declare module "cesium/Source/DataSources/BoxGeometryUpdater" { import { BoxGeometryUpdater } from 'cesium'; export default BoxGeometryUpdater; }
  41891. declare module "cesium/Source/DataSources/BoxGraphics" { import { BoxGraphics } from 'cesium'; export default BoxGraphics; }
  41892. declare module "cesium/Source/DataSources/CallbackProperty" { import { CallbackProperty } from 'cesium'; export default CallbackProperty; }
  41893. declare module "cesium/Source/DataSources/Cesium3DTilesetGraphics" { import { Cesium3DTilesetGraphics } from 'cesium'; export default Cesium3DTilesetGraphics; }
  41894. declare module "cesium/Source/DataSources/Cesium3DTilesetVisualizer" { import { Cesium3DTilesetVisualizer } from 'cesium'; export default Cesium3DTilesetVisualizer; }
  41895. declare module "cesium/Source/DataSources/CheckerboardMaterialProperty" { import { CheckerboardMaterialProperty } from 'cesium'; export default CheckerboardMaterialProperty; }
  41896. declare module "cesium/Source/DataSources/ColorMaterialProperty" { import { ColorMaterialProperty } from 'cesium'; export default ColorMaterialProperty; }
  41897. declare module "cesium/Source/DataSources/CompositeEntityCollection" { import { CompositeEntityCollection } from 'cesium'; export default CompositeEntityCollection; }
  41898. declare module "cesium/Source/DataSources/CompositeMaterialProperty" { import { CompositeMaterialProperty } from 'cesium'; export default CompositeMaterialProperty; }
  41899. declare module "cesium/Source/DataSources/CompositePositionProperty" { import { CompositePositionProperty } from 'cesium'; export default CompositePositionProperty; }
  41900. declare module "cesium/Source/DataSources/CompositeProperty" { import { CompositeProperty } from 'cesium'; export default CompositeProperty; }
  41901. declare module "cesium/Source/DataSources/ConstantPositionProperty" { import { ConstantPositionProperty } from 'cesium'; export default ConstantPositionProperty; }
  41902. declare module "cesium/Source/DataSources/ConstantProperty" { import { ConstantProperty } from 'cesium'; export default ConstantProperty; }
  41903. declare module "cesium/Source/DataSources/CorridorGeometryUpdater" { import { CorridorGeometryUpdater } from 'cesium'; export default CorridorGeometryUpdater; }
  41904. declare module "cesium/Source/DataSources/CorridorGraphics" { import { CorridorGraphics } from 'cesium'; export default CorridorGraphics; }
  41905. declare module "cesium/Source/DataSources/CustomDataSource" { import { CustomDataSource } from 'cesium'; export default CustomDataSource; }
  41906. declare module "cesium/Source/DataSources/CylinderGeometryUpdater" { import { CylinderGeometryUpdater } from 'cesium'; export default CylinderGeometryUpdater; }
  41907. declare module "cesium/Source/DataSources/CylinderGraphics" { import { CylinderGraphics } from 'cesium'; export default CylinderGraphics; }
  41908. declare module "cesium/Source/DataSources/CzmlDataSource" { import { CzmlDataSource } from 'cesium'; export default CzmlDataSource; }
  41909. declare module "cesium/Source/DataSources/DataSource" { import { DataSource } from 'cesium'; export default DataSource; }
  41910. declare module "cesium/Source/DataSources/DataSourceClock" { import { DataSourceClock } from 'cesium'; export default DataSourceClock; }
  41911. declare module "cesium/Source/DataSources/DataSourceCollection" { import { DataSourceCollection } from 'cesium'; export default DataSourceCollection; }
  41912. declare module "cesium/Source/DataSources/DataSourceDisplay" { import { DataSourceDisplay } from 'cesium'; export default DataSourceDisplay; }
  41913. declare module "cesium/Source/DataSources/EllipseGeometryUpdater" { import { EllipseGeometryUpdater } from 'cesium'; export default EllipseGeometryUpdater; }
  41914. declare module "cesium/Source/DataSources/EllipseGraphics" { import { EllipseGraphics } from 'cesium'; export default EllipseGraphics; }
  41915. declare module "cesium/Source/DataSources/EllipsoidGeometryUpdater" { import { EllipsoidGeometryUpdater } from 'cesium'; export default EllipsoidGeometryUpdater; }
  41916. declare module "cesium/Source/DataSources/EllipsoidGraphics" { import { EllipsoidGraphics } from 'cesium'; export default EllipsoidGraphics; }
  41917. declare module "cesium/Source/DataSources/Entity" { import { Entity } from 'cesium'; export default Entity; }
  41918. declare module "cesium/Source/DataSources/EntityCluster" { import { EntityCluster } from 'cesium'; export default EntityCluster; }
  41919. declare module "cesium/Source/DataSources/EntityCollection" { import { EntityCollection } from 'cesium'; export default EntityCollection; }
  41920. declare module "cesium/Source/DataSources/EntityView" { import { EntityView } from 'cesium'; export default EntityView; }
  41921. declare module "cesium/Source/DataSources/GeoJsonDataSource" { import { GeoJsonDataSource } from 'cesium'; export default GeoJsonDataSource; }
  41922. declare module "cesium/Source/DataSources/GeometryUpdater" { import { GeometryUpdater } from 'cesium'; export default GeometryUpdater; }
  41923. declare module "cesium/Source/DataSources/GeometryVisualizer" { import { GeometryVisualizer } from 'cesium'; export default GeometryVisualizer; }
  41924. declare module "cesium/Source/DataSources/GridMaterialProperty" { import { GridMaterialProperty } from 'cesium'; export default GridMaterialProperty; }
  41925. declare module "cesium/Source/DataSources/GroundGeometryUpdater" { import { GroundGeometryUpdater } from 'cesium'; export default GroundGeometryUpdater; }
  41926. declare module "cesium/Source/DataSources/ImageMaterialProperty" { import { ImageMaterialProperty } from 'cesium'; export default ImageMaterialProperty; }
  41927. declare module "cesium/Source/DataSources/KmlCamera" { import { KmlCamera } from 'cesium'; export default KmlCamera; }
  41928. declare module "cesium/Source/DataSources/KmlDataSource" { import { KmlDataSource } from 'cesium'; export default KmlDataSource; }
  41929. declare module "cesium/Source/DataSources/KmlLookAt" { import { KmlLookAt } from 'cesium'; export default KmlLookAt; }
  41930. declare module "cesium/Source/DataSources/KmlTour" { import { KmlTour } from 'cesium'; export default KmlTour; }
  41931. declare module "cesium/Source/DataSources/KmlTourFlyTo" { import { KmlTourFlyTo } from 'cesium'; export default KmlTourFlyTo; }
  41932. declare module "cesium/Source/DataSources/KmlTourWait" { import { KmlTourWait } from 'cesium'; export default KmlTourWait; }
  41933. declare module "cesium/Source/DataSources/LabelGraphics" { import { LabelGraphics } from 'cesium'; export default LabelGraphics; }
  41934. declare module "cesium/Source/DataSources/LabelVisualizer" { import { LabelVisualizer } from 'cesium'; export default LabelVisualizer; }
  41935. declare module "cesium/Source/DataSources/MaterialProperty" { import { MaterialProperty } from 'cesium'; export default MaterialProperty; }
  41936. declare module "cesium/Source/DataSources/ModelGraphics" { import { ModelGraphics } from 'cesium'; export default ModelGraphics; }
  41937. declare module "cesium/Source/DataSources/ModelVisualizer" { import { ModelVisualizer } from 'cesium'; export default ModelVisualizer; }
  41938. declare module "cesium/Source/DataSources/NodeTransformationProperty" { import { NodeTransformationProperty } from 'cesium'; export default NodeTransformationProperty; }
  41939. declare module "cesium/Source/DataSources/PathGraphics" { import { PathGraphics } from 'cesium'; export default PathGraphics; }
  41940. declare module "cesium/Source/DataSources/PathVisualizer" { import { PathVisualizer } from 'cesium'; export default PathVisualizer; }
  41941. declare module "cesium/Source/DataSources/PlaneGeometryUpdater" { import { PlaneGeometryUpdater } from 'cesium'; export default PlaneGeometryUpdater; }
  41942. declare module "cesium/Source/DataSources/PlaneGraphics" { import { PlaneGraphics } from 'cesium'; export default PlaneGraphics; }
  41943. declare module "cesium/Source/DataSources/PointGraphics" { import { PointGraphics } from 'cesium'; export default PointGraphics; }
  41944. declare module "cesium/Source/DataSources/PointVisualizer" { import { PointVisualizer } from 'cesium'; export default PointVisualizer; }
  41945. declare module "cesium/Source/DataSources/PolygonGeometryUpdater" { import { PolygonGeometryUpdater } from 'cesium'; export default PolygonGeometryUpdater; }
  41946. declare module "cesium/Source/DataSources/PolygonGraphics" { import { PolygonGraphics } from 'cesium'; export default PolygonGraphics; }
  41947. declare module "cesium/Source/DataSources/PolylineArrowMaterialProperty" { import { PolylineArrowMaterialProperty } from 'cesium'; export default PolylineArrowMaterialProperty; }
  41948. declare module "cesium/Source/DataSources/PolylineDashMaterialProperty" { import { PolylineDashMaterialProperty } from 'cesium'; export default PolylineDashMaterialProperty; }
  41949. declare module "cesium/Source/DataSources/PolylineGeometryUpdater" { import { PolylineGeometryUpdater } from 'cesium'; export default PolylineGeometryUpdater; }
  41950. declare module "cesium/Source/DataSources/PolylineGlowMaterialProperty" { import { PolylineGlowMaterialProperty } from 'cesium'; export default PolylineGlowMaterialProperty; }
  41951. declare module "cesium/Source/DataSources/PolylineGraphics" { import { PolylineGraphics } from 'cesium'; export default PolylineGraphics; }
  41952. declare module "cesium/Source/DataSources/PolylineOutlineMaterialProperty" { import { PolylineOutlineMaterialProperty } from 'cesium'; export default PolylineOutlineMaterialProperty; }
  41953. declare module "cesium/Source/DataSources/PolylineVisualizer" { import { PolylineVisualizer } from 'cesium'; export default PolylineVisualizer; }
  41954. declare module "cesium/Source/DataSources/PolylineVolumeGeometryUpdater" { import { PolylineVolumeGeometryUpdater } from 'cesium'; export default PolylineVolumeGeometryUpdater; }
  41955. declare module "cesium/Source/DataSources/PolylineVolumeGraphics" { import { PolylineVolumeGraphics } from 'cesium'; export default PolylineVolumeGraphics; }
  41956. declare module "cesium/Source/DataSources/PositionProperty" { import { PositionProperty } from 'cesium'; export default PositionProperty; }
  41957. declare module "cesium/Source/DataSources/PositionPropertyArray" { import { PositionPropertyArray } from 'cesium'; export default PositionPropertyArray; }
  41958. declare module "cesium/Source/DataSources/Property" { import { Property } from 'cesium'; export default Property; }
  41959. declare module "cesium/Source/DataSources/PropertyArray" { import { PropertyArray } from 'cesium'; export default PropertyArray; }
  41960. declare module "cesium/Source/DataSources/PropertyBag" { import { PropertyBag } from 'cesium'; export default PropertyBag; }
  41961. declare module "cesium/Source/DataSources/RectangleGeometryUpdater" { import { RectangleGeometryUpdater } from 'cesium'; export default RectangleGeometryUpdater; }
  41962. declare module "cesium/Source/DataSources/RectangleGraphics" { import { RectangleGraphics } from 'cesium'; export default RectangleGraphics; }
  41963. declare module "cesium/Source/DataSources/ReferenceProperty" { import { ReferenceProperty } from 'cesium'; export default ReferenceProperty; }
  41964. declare module "cesium/Source/DataSources/Rotation" { import { Rotation } from 'cesium'; export default Rotation; }
  41965. declare module "cesium/Source/DataSources/SampledPositionProperty" { import { SampledPositionProperty } from 'cesium'; export default SampledPositionProperty; }
  41966. declare module "cesium/Source/DataSources/SampledProperty" { import { SampledProperty } from 'cesium'; export default SampledProperty; }
  41967. declare module "cesium/Source/DataSources/StripeMaterialProperty" { import { StripeMaterialProperty } from 'cesium'; export default StripeMaterialProperty; }
  41968. declare module "cesium/Source/DataSources/StripeOrientation" { import { StripeOrientation } from 'cesium'; export default StripeOrientation; }
  41969. declare module "cesium/Source/DataSources/TimeIntervalCollectionPositionProperty" { import { TimeIntervalCollectionPositionProperty } from 'cesium'; export default TimeIntervalCollectionPositionProperty; }
  41970. declare module "cesium/Source/DataSources/TimeIntervalCollectionProperty" { import { TimeIntervalCollectionProperty } from 'cesium'; export default TimeIntervalCollectionProperty; }
  41971. declare module "cesium/Source/DataSources/VelocityOrientationProperty" { import { VelocityOrientationProperty } from 'cesium'; export default VelocityOrientationProperty; }
  41972. declare module "cesium/Source/DataSources/VelocityVectorProperty" { import { VelocityVectorProperty } from 'cesium'; export default VelocityVectorProperty; }
  41973. declare module "cesium/Source/DataSources/Visualizer" { import { Visualizer } from 'cesium'; export default Visualizer; }
  41974. declare module "cesium/Source/DataSources/WallGeometryUpdater" { import { WallGeometryUpdater } from 'cesium'; export default WallGeometryUpdater; }
  41975. declare module "cesium/Source/DataSources/WallGraphics" { import { WallGraphics } from 'cesium'; export default WallGraphics; }
  41976. declare module "cesium/Source/DataSources/exportKml" { import { exportKml } from 'cesium'; export default exportKml; }
  41977. declare module "cesium/Source/Renderer/PixelDatatype" { import { PixelDatatype } from 'cesium'; export default PixelDatatype; }
  41978. declare module "cesium/Source/Renderer/TextureMagnificationFilter" { import { TextureMagnificationFilter } from 'cesium'; export default TextureMagnificationFilter; }
  41979. declare module "cesium/Source/Renderer/TextureMinificationFilter" { import { TextureMinificationFilter } from 'cesium'; export default TextureMinificationFilter; }
  41980. declare module "cesium/Source/Scene/Appearance" { import { Appearance } from 'cesium'; export default Appearance; }
  41981. declare module "cesium/Source/Scene/ArcGisMapServerImageryProvider" { import { ArcGisMapServerImageryProvider } from 'cesium'; export default ArcGisMapServerImageryProvider; }
  41982. declare module "cesium/Source/Scene/Axis" { import { Axis } from 'cesium'; export default Axis; }
  41983. declare module "cesium/Source/Scene/Billboard" { import { Billboard } from 'cesium'; export default Billboard; }
  41984. declare module "cesium/Source/Scene/BillboardCollection" { import { BillboardCollection } from 'cesium'; export default BillboardCollection; }
  41985. declare module "cesium/Source/Scene/BingMapsImageryProvider" { import { BingMapsImageryProvider } from 'cesium'; export default BingMapsImageryProvider; }
  41986. declare module "cesium/Source/Scene/BingMapsStyle" { import { BingMapsStyle } from 'cesium'; export default BingMapsStyle; }
  41987. declare module "cesium/Source/Scene/BlendEquation" { import { BlendEquation } from 'cesium'; export default BlendEquation; }
  41988. declare module "cesium/Source/Scene/BlendFunction" { import { BlendFunction } from 'cesium'; export default BlendFunction; }
  41989. declare module "cesium/Source/Scene/BlendOption" { import { BlendOption } from 'cesium'; export default BlendOption; }
  41990. declare module "cesium/Source/Scene/BlendingState" { import { BlendingState } from 'cesium'; export default BlendingState; }
  41991. declare module "cesium/Source/Scene/BoxEmitter" { import { BoxEmitter } from 'cesium'; export default BoxEmitter; }
  41992. declare module "cesium/Source/Scene/Camera" { import { Camera } from 'cesium'; export default Camera; }
  41993. declare module "cesium/Source/Scene/CameraEventAggregator" { import { CameraEventAggregator } from 'cesium'; export default CameraEventAggregator; }
  41994. declare module "cesium/Source/Scene/CameraEventType" { import { CameraEventType } from 'cesium'; export default CameraEventType; }
  41995. declare module "cesium/Source/Scene/Cesium3DTile" { import { Cesium3DTile } from 'cesium'; export default Cesium3DTile; }
  41996. declare module "cesium/Source/Scene/Cesium3DTileColorBlendMode" { import { Cesium3DTileColorBlendMode } from 'cesium'; export default Cesium3DTileColorBlendMode; }
  41997. declare module "cesium/Source/Scene/Cesium3DTileContent" { import { Cesium3DTileContent } from 'cesium'; export default Cesium3DTileContent; }
  41998. declare module "cesium/Source/Scene/Cesium3DTileFeature" { import { Cesium3DTileFeature } from 'cesium'; export default Cesium3DTileFeature; }
  41999. declare module "cesium/Source/Scene/Cesium3DTilePointFeature" { import { Cesium3DTilePointFeature } from 'cesium'; export default Cesium3DTilePointFeature; }
  42000. declare module "cesium/Source/Scene/Cesium3DTileStyle" { import { Cesium3DTileStyle } from 'cesium'; export default Cesium3DTileStyle; }
  42001. declare module "cesium/Source/Scene/Cesium3DTileset" { import { Cesium3DTileset } from 'cesium'; export default Cesium3DTileset; }
  42002. declare module "cesium/Source/Scene/CircleEmitter" { import { CircleEmitter } from 'cesium'; export default CircleEmitter; }
  42003. declare module "cesium/Source/Scene/ClassificationPrimitive" { import { ClassificationPrimitive } from 'cesium'; export default ClassificationPrimitive; }
  42004. declare module "cesium/Source/Scene/ClassificationType" { import { ClassificationType } from 'cesium'; export default ClassificationType; }
  42005. declare module "cesium/Source/Scene/ClippingPlane" { import { ClippingPlane } from 'cesium'; export default ClippingPlane; }
  42006. declare module "cesium/Source/Scene/ClippingPlaneCollection" { import { ClippingPlaneCollection } from 'cesium'; export default ClippingPlaneCollection; }
  42007. declare module "cesium/Source/Scene/ColorBlendMode" { import { ColorBlendMode } from 'cesium'; export default ColorBlendMode; }
  42008. declare module "cesium/Source/Scene/ConditionsExpression" { import { ConditionsExpression } from 'cesium'; export default ConditionsExpression; }
  42009. declare module "cesium/Source/Scene/ConeEmitter" { import { ConeEmitter } from 'cesium'; export default ConeEmitter; }
  42010. declare module "cesium/Source/Scene/CreditDisplay" { import { CreditDisplay } from 'cesium'; export default CreditDisplay; }
  42011. declare module "cesium/Source/Scene/CullFace" { import { CullFace } from 'cesium'; export default CullFace; }
  42012. declare module "cesium/Source/Scene/DebugAppearance" { import { DebugAppearance } from 'cesium'; export default DebugAppearance; }
  42013. declare module "cesium/Source/Scene/DebugCameraPrimitive" { import { DebugCameraPrimitive } from 'cesium'; export default DebugCameraPrimitive; }
  42014. declare module "cesium/Source/Scene/DebugModelMatrixPrimitive" { import { DebugModelMatrixPrimitive } from 'cesium'; export default DebugModelMatrixPrimitive; }
  42015. declare module "cesium/Source/Scene/DepthFunction" { import { DepthFunction } from 'cesium'; export default DepthFunction; }
  42016. declare module "cesium/Source/Scene/DirectionalLight" { import { DirectionalLight } from 'cesium'; export default DirectionalLight; }
  42017. declare module "cesium/Source/Scene/DiscardEmptyTileImagePolicy" { import { DiscardEmptyTileImagePolicy } from 'cesium'; export default DiscardEmptyTileImagePolicy; }
  42018. declare module "cesium/Source/Scene/DiscardMissingTileImagePolicy" { import { DiscardMissingTileImagePolicy } from 'cesium'; export default DiscardMissingTileImagePolicy; }
  42019. declare module "cesium/Source/Scene/EllipsoidSurfaceAppearance" { import { EllipsoidSurfaceAppearance } from 'cesium'; export default EllipsoidSurfaceAppearance; }
  42020. declare module "cesium/Source/Scene/Expression" { import { Expression } from 'cesium'; export default Expression; }
  42021. declare module "cesium/Source/Scene/Fog" { import { Fog } from 'cesium'; export default Fog; }
  42022. declare module "cesium/Source/Scene/FrameRateMonitor" { import { FrameRateMonitor } from 'cesium'; export default FrameRateMonitor; }
  42023. declare module "cesium/Source/Scene/GetFeatureInfoFormat" { import { GetFeatureInfoFormat } from 'cesium'; export default GetFeatureInfoFormat; }
  42024. declare module "cesium/Source/Scene/Globe" { import { Globe } from 'cesium'; export default Globe; }
  42025. declare module "cesium/Source/Scene/GlobeTranslucency" { import { GlobeTranslucency } from 'cesium'; export default GlobeTranslucency; }
  42026. declare module "cesium/Source/Scene/GoogleEarthEnterpriseImageryProvider" { import { GoogleEarthEnterpriseImageryProvider } from 'cesium'; export default GoogleEarthEnterpriseImageryProvider; }
  42027. declare module "cesium/Source/Scene/GoogleEarthEnterpriseMapsProvider" { import { GoogleEarthEnterpriseMapsProvider } from 'cesium'; export default GoogleEarthEnterpriseMapsProvider; }
  42028. declare module "cesium/Source/Scene/GridImageryProvider" { import { GridImageryProvider } from 'cesium'; export default GridImageryProvider; }
  42029. declare module "cesium/Source/Scene/GroundPolylinePrimitive" { import { GroundPolylinePrimitive } from 'cesium'; export default GroundPolylinePrimitive; }
  42030. declare module "cesium/Source/Scene/GroundPrimitive" { import { GroundPrimitive } from 'cesium'; export default GroundPrimitive; }
  42031. declare module "cesium/Source/Scene/HeightReference" { import { HeightReference } from 'cesium'; export default HeightReference; }
  42032. declare module "cesium/Source/Scene/HorizontalOrigin" { import { HorizontalOrigin } from 'cesium'; export default HorizontalOrigin; }
  42033. declare module "cesium/Source/Scene/ImageryLayer" { import { ImageryLayer } from 'cesium'; export default ImageryLayer; }
  42034. declare module "cesium/Source/Scene/ImageryLayerCollection" { import { ImageryLayerCollection } from 'cesium'; export default ImageryLayerCollection; }
  42035. declare module "cesium/Source/Scene/ImageryLayerFeatureInfo" { import { ImageryLayerFeatureInfo } from 'cesium'; export default ImageryLayerFeatureInfo; }
  42036. declare module "cesium/Source/Scene/ImageryProvider" { import { ImageryProvider } from 'cesium'; export default ImageryProvider; }
  42037. declare module "cesium/Source/Scene/ImagerySplitDirection" { import { ImagerySplitDirection } from 'cesium'; export default ImagerySplitDirection; }
  42038. declare module "cesium/Source/Scene/IonImageryProvider" { import { IonImageryProvider } from 'cesium'; export default IonImageryProvider; }
  42039. declare module "cesium/Source/Scene/IonWorldImageryStyle" { import { IonWorldImageryStyle } from 'cesium'; export default IonWorldImageryStyle; }
  42040. declare module "cesium/Source/Scene/Label" { import { Label } from 'cesium'; export default Label; }
  42041. declare module "cesium/Source/Scene/LabelCollection" { import { LabelCollection } from 'cesium'; export default LabelCollection; }
  42042. declare module "cesium/Source/Scene/LabelStyle" { import { LabelStyle } from 'cesium'; export default LabelStyle; }
  42043. declare module "cesium/Source/Scene/Light" { import { Light } from 'cesium'; export default Light; }
  42044. declare module "cesium/Source/Scene/MapMode2D" { import { MapMode2D } from 'cesium'; export default MapMode2D; }
  42045. declare module "cesium/Source/Scene/MapboxImageryProvider" { import { MapboxImageryProvider } from 'cesium'; export default MapboxImageryProvider; }
  42046. declare module "cesium/Source/Scene/MapboxStyleImageryProvider" { import { MapboxStyleImageryProvider } from 'cesium'; export default MapboxStyleImageryProvider; }
  42047. declare module "cesium/Source/Scene/Material" { import { Material } from 'cesium'; export default Material; }
  42048. declare module "cesium/Source/Scene/MaterialAppearance" { import { MaterialAppearance } from 'cesium'; export default MaterialAppearance; }
  42049. declare module "cesium/Source/Scene/Model" { import { Model } from 'cesium'; export default Model; }
  42050. declare module "cesium/Source/Scene/ModelAnimation" { import { ModelAnimation } from 'cesium'; export default ModelAnimation; }
  42051. declare module "cesium/Source/Scene/ModelAnimationCollection" { import { ModelAnimationCollection } from 'cesium'; export default ModelAnimationCollection; }
  42052. declare module "cesium/Source/Scene/ModelAnimationLoop" { import { ModelAnimationLoop } from 'cesium'; export default ModelAnimationLoop; }
  42053. declare module "cesium/Source/Scene/ModelMaterial" { import { ModelMaterial } from 'cesium'; export default ModelMaterial; }
  42054. declare module "cesium/Source/Scene/ModelMesh" { import { ModelMesh } from 'cesium'; export default ModelMesh; }
  42055. declare module "cesium/Source/Scene/ModelNode" { import { ModelNode } from 'cesium'; export default ModelNode; }
  42056. declare module "cesium/Source/Scene/Moon" { import { Moon } from 'cesium'; export default Moon; }
  42057. declare module "cesium/Source/Scene/NeverTileDiscardPolicy" { import { NeverTileDiscardPolicy } from 'cesium'; export default NeverTileDiscardPolicy; }
  42058. declare module "cesium/Source/Scene/OpenStreetMapImageryProvider" { import { OpenStreetMapImageryProvider } from 'cesium'; export default OpenStreetMapImageryProvider; }
  42059. declare module "cesium/Source/Scene/Particle" { import { Particle } from 'cesium'; export default Particle; }
  42060. declare module "cesium/Source/Scene/ParticleBurst" { import { ParticleBurst } from 'cesium'; export default ParticleBurst; }
  42061. declare module "cesium/Source/Scene/ParticleEmitter" { import { ParticleEmitter } from 'cesium'; export default ParticleEmitter; }
  42062. declare module "cesium/Source/Scene/ParticleSystem" { import { ParticleSystem } from 'cesium'; export default ParticleSystem; }
  42063. declare module "cesium/Source/Scene/PerInstanceColorAppearance" { import { PerInstanceColorAppearance } from 'cesium'; export default PerInstanceColorAppearance; }
  42064. declare module "cesium/Source/Scene/PointCloudShading" { import { PointCloudShading } from 'cesium'; export default PointCloudShading; }
  42065. declare module "cesium/Source/Scene/PointPrimitive" { import { PointPrimitive } from 'cesium'; export default PointPrimitive; }
  42066. declare module "cesium/Source/Scene/PointPrimitiveCollection" { import { PointPrimitiveCollection } from 'cesium'; export default PointPrimitiveCollection; }
  42067. declare module "cesium/Source/Scene/Polyline" { import { Polyline } from 'cesium'; export default Polyline; }
  42068. declare module "cesium/Source/Scene/PolylineCollection" { import { PolylineCollection } from 'cesium'; export default PolylineCollection; }
  42069. declare module "cesium/Source/Scene/PolylineColorAppearance" { import { PolylineColorAppearance } from 'cesium'; export default PolylineColorAppearance; }
  42070. declare module "cesium/Source/Scene/PolylineMaterialAppearance" { import { PolylineMaterialAppearance } from 'cesium'; export default PolylineMaterialAppearance; }
  42071. declare module "cesium/Source/Scene/PostProcessStage" { import { PostProcessStage } from 'cesium'; export default PostProcessStage; }
  42072. declare module "cesium/Source/Scene/PostProcessStageCollection" { import { PostProcessStageCollection } from 'cesium'; export default PostProcessStageCollection; }
  42073. declare module "cesium/Source/Scene/PostProcessStageComposite" { import { PostProcessStageComposite } from 'cesium'; export default PostProcessStageComposite; }
  42074. declare module "cesium/Source/Scene/PostProcessStageLibrary" { import { PostProcessStageLibrary } from 'cesium'; export default PostProcessStageLibrary; }
  42075. declare module "cesium/Source/Scene/PostProcessStageSampleMode" { import { PostProcessStageSampleMode } from 'cesium'; export default PostProcessStageSampleMode; }
  42076. declare module "cesium/Source/Scene/Primitive" { import { Primitive } from 'cesium'; export default Primitive; }
  42077. declare module "cesium/Source/Scene/PrimitiveCollection" { import { PrimitiveCollection } from 'cesium'; export default PrimitiveCollection; }
  42078. declare module "cesium/Source/Scene/Scene" { import { Scene } from 'cesium'; export default Scene; }
  42079. declare module "cesium/Source/Scene/SceneMode" { import { SceneMode } from 'cesium'; export default SceneMode; }
  42080. declare module "cesium/Source/Scene/SceneTransforms" { import { SceneTransforms } from 'cesium'; export default SceneTransforms; }
  42081. declare module "cesium/Source/Scene/ScreenSpaceCameraController" { import { ScreenSpaceCameraController } from 'cesium'; export default ScreenSpaceCameraController; }
  42082. declare module "cesium/Source/Scene/ShadowMap" { import { ShadowMap } from 'cesium'; export default ShadowMap; }
  42083. declare module "cesium/Source/Scene/ShadowMode" { import { ShadowMode } from 'cesium'; export default ShadowMode; }
  42084. declare module "cesium/Source/Scene/SingleTileImageryProvider" { import { SingleTileImageryProvider } from 'cesium'; export default SingleTileImageryProvider; }
  42085. declare module "cesium/Source/Scene/SkyAtmosphere" { import { SkyAtmosphere } from 'cesium'; export default SkyAtmosphere; }
  42086. declare module "cesium/Source/Scene/SkyBox" { import { SkyBox } from 'cesium'; export default SkyBox; }
  42087. declare module "cesium/Source/Scene/SphereEmitter" { import { SphereEmitter } from 'cesium'; export default SphereEmitter; }
  42088. declare module "cesium/Source/Scene/StencilFunction" { import { StencilFunction } from 'cesium'; export default StencilFunction; }
  42089. declare module "cesium/Source/Scene/StencilOperation" { import { StencilOperation } from 'cesium'; export default StencilOperation; }
  42090. declare module "cesium/Source/Scene/StyleExpression" { import { StyleExpression } from 'cesium'; export default StyleExpression; }
  42091. declare module "cesium/Source/Scene/Sun" { import { Sun } from 'cesium'; export default Sun; }
  42092. declare module "cesium/Source/Scene/SunLight" { import { SunLight } from 'cesium'; export default SunLight; }
  42093. declare module "cesium/Source/Scene/TileCoordinatesImageryProvider" { import { TileCoordinatesImageryProvider } from 'cesium'; export default TileCoordinatesImageryProvider; }
  42094. declare module "cesium/Source/Scene/TileDiscardPolicy" { import { TileDiscardPolicy } from 'cesium'; export default TileDiscardPolicy; }
  42095. declare module "cesium/Source/Scene/TileMapServiceImageryProvider" { import { TileMapServiceImageryProvider } from 'cesium'; export default TileMapServiceImageryProvider; }
  42096. declare module "cesium/Source/Scene/TimeDynamicImagery" { import { TimeDynamicImagery } from 'cesium'; export default TimeDynamicImagery; }
  42097. declare module "cesium/Source/Scene/TimeDynamicPointCloud" { import { TimeDynamicPointCloud } from 'cesium'; export default TimeDynamicPointCloud; }
  42098. declare module "cesium/Source/Scene/UrlTemplateImageryProvider" { import { UrlTemplateImageryProvider } from 'cesium'; export default UrlTemplateImageryProvider; }
  42099. declare module "cesium/Source/Scene/VerticalOrigin" { import { VerticalOrigin } from 'cesium'; export default VerticalOrigin; }
  42100. declare module "cesium/Source/Scene/ViewportQuad" { import { ViewportQuad } from 'cesium'; export default ViewportQuad; }
  42101. declare module "cesium/Source/Scene/WebMapServiceImageryProvider" { import { WebMapServiceImageryProvider } from 'cesium'; export default WebMapServiceImageryProvider; }
  42102. declare module "cesium/Source/Scene/WebMapTileServiceImageryProvider" { import { WebMapTileServiceImageryProvider } from 'cesium'; export default WebMapTileServiceImageryProvider; }
  42103. declare module "cesium/Source/Scene/createOsmBuildings" { import { createOsmBuildings } from 'cesium'; export default createOsmBuildings; }
  42104. declare module "cesium/Source/Scene/createTangentSpaceDebugPrimitive" { import { createTangentSpaceDebugPrimitive } from 'cesium'; export default createTangentSpaceDebugPrimitive; }
  42105. declare module "cesium/Source/Scene/createWorldImagery" { import { createWorldImagery } from 'cesium'; export default createWorldImagery; }
  42106. declare module "cesium/Source/Widgets/ClockViewModel" { import { ClockViewModel } from 'cesium'; export default ClockViewModel; }
  42107. declare module "cesium/Source/Widgets/Command" { import { Command } from 'cesium'; export default Command; }
  42108. declare module "cesium/Source/Widgets/SvgPathBindingHandler" { import { SvgPathBindingHandler } from 'cesium'; export default SvgPathBindingHandler; }
  42109. declare module "cesium/Source/Widgets/ToggleButtonViewModel" { import { ToggleButtonViewModel } from 'cesium'; export default ToggleButtonViewModel; }
  42110. declare module "cesium/Source/Widgets/createCommand" { import { createCommand } from 'cesium'; export default createCommand; }
  42111. declare module "cesium/Source/Widgets/Animation/Animation" { import { Animation } from 'cesium'; export default Animation; }
  42112. declare module "cesium/Source/Widgets/Animation/AnimationViewModel" { import { AnimationViewModel } from 'cesium'; export default AnimationViewModel; }
  42113. declare module "cesium/Source/Widgets/BaseLayerPicker/BaseLayerPicker" { import { BaseLayerPicker } from 'cesium'; export default BaseLayerPicker; }
  42114. declare module "cesium/Source/Widgets/BaseLayerPicker/BaseLayerPickerViewModel" { import { BaseLayerPickerViewModel } from 'cesium'; export default BaseLayerPickerViewModel; }
  42115. declare module "cesium/Source/Widgets/BaseLayerPicker/ProviderViewModel" { import { ProviderViewModel } from 'cesium'; export default ProviderViewModel; }
  42116. declare module "cesium/Source/Widgets/Cesium3DTilesInspector/Cesium3DTilesInspector" { import { Cesium3DTilesInspector } from 'cesium'; export default Cesium3DTilesInspector; }
  42117. declare module "cesium/Source/Widgets/Cesium3DTilesInspector/Cesium3DTilesInspectorViewModel" { import { Cesium3DTilesInspectorViewModel } from 'cesium'; export default Cesium3DTilesInspectorViewModel; }
  42118. declare module "cesium/Source/Widgets/CesiumInspector/CesiumInspector" { import { CesiumInspector } from 'cesium'; export default CesiumInspector; }
  42119. declare module "cesium/Source/Widgets/CesiumInspector/CesiumInspectorViewModel" { import { CesiumInspectorViewModel } from 'cesium'; export default CesiumInspectorViewModel; }
  42120. declare module "cesium/Source/Widgets/CesiumWidget/CesiumWidget" { import { CesiumWidget } from 'cesium'; export default CesiumWidget; }
  42121. declare module "cesium/Source/Widgets/FullscreenButton/FullscreenButton" { import { FullscreenButton } from 'cesium'; export default FullscreenButton; }
  42122. declare module "cesium/Source/Widgets/FullscreenButton/FullscreenButtonViewModel" { import { FullscreenButtonViewModel } from 'cesium'; export default FullscreenButtonViewModel; }
  42123. declare module "cesium/Source/Widgets/Geocoder/Geocoder" { import { Geocoder } from 'cesium'; export default Geocoder; }
  42124. declare module "cesium/Source/Widgets/Geocoder/GeocoderViewModel" { import { GeocoderViewModel } from 'cesium'; export default GeocoderViewModel; }
  42125. declare module "cesium/Source/Widgets/HomeButton/HomeButton" { import { HomeButton } from 'cesium'; export default HomeButton; }
  42126. declare module "cesium/Source/Widgets/HomeButton/HomeButtonViewModel" { import { HomeButtonViewModel } from 'cesium'; export default HomeButtonViewModel; }
  42127. declare module "cesium/Source/Widgets/InfoBox/InfoBox" { import { InfoBox } from 'cesium'; export default InfoBox; }
  42128. declare module "cesium/Source/Widgets/InfoBox/InfoBoxViewModel" { import { InfoBoxViewModel } from 'cesium'; export default InfoBoxViewModel; }
  42129. declare module "cesium/Source/Widgets/NavigationHelpButton/NavigationHelpButton" { import { NavigationHelpButton } from 'cesium'; export default NavigationHelpButton; }
  42130. declare module "cesium/Source/Widgets/NavigationHelpButton/NavigationHelpButtonViewModel" { import { NavigationHelpButtonViewModel } from 'cesium'; export default NavigationHelpButtonViewModel; }
  42131. declare module "cesium/Source/Widgets/PerformanceWatchdog/PerformanceWatchdog" { import { PerformanceWatchdog } from 'cesium'; export default PerformanceWatchdog; }
  42132. declare module "cesium/Source/Widgets/PerformanceWatchdog/PerformanceWatchdogViewModel" { import { PerformanceWatchdogViewModel } from 'cesium'; export default PerformanceWatchdogViewModel; }
  42133. declare module "cesium/Source/Widgets/ProjectionPicker/ProjectionPicker" { import { ProjectionPicker } from 'cesium'; export default ProjectionPicker; }
  42134. declare module "cesium/Source/Widgets/ProjectionPicker/ProjectionPickerViewModel" { import { ProjectionPickerViewModel } from 'cesium'; export default ProjectionPickerViewModel; }
  42135. declare module "cesium/Source/Widgets/SceneModePicker/SceneModePicker" { import { SceneModePicker } from 'cesium'; export default SceneModePicker; }
  42136. declare module "cesium/Source/Widgets/SceneModePicker/SceneModePickerViewModel" { import { SceneModePickerViewModel } from 'cesium'; export default SceneModePickerViewModel; }
  42137. declare module "cesium/Source/Widgets/SelectionIndicator/SelectionIndicator" { import { SelectionIndicator } from 'cesium'; export default SelectionIndicator; }
  42138. declare module "cesium/Source/Widgets/SelectionIndicator/SelectionIndicatorViewModel" { import { SelectionIndicatorViewModel } from 'cesium'; export default SelectionIndicatorViewModel; }
  42139. declare module "cesium/Source/Widgets/Timeline/Timeline" { import { Timeline } from 'cesium'; export default Timeline; }
  42140. declare module "cesium/Source/Widgets/VRButton/VRButton" { import { VRButton } from 'cesium'; export default VRButton; }
  42141. declare module "cesium/Source/Widgets/VRButton/VRButtonViewModel" { import { VRButtonViewModel } from 'cesium'; export default VRButtonViewModel; }
  42142. declare module "cesium/Source/Widgets/Viewer/Viewer" { import { Viewer } from 'cesium'; export default Viewer; }
  42143. declare module "cesium/Source/Widgets/Viewer/viewerCesium3DTilesInspectorMixin" { import { viewerCesium3DTilesInspectorMixin } from 'cesium'; export default viewerCesium3DTilesInspectorMixin; }
  42144. declare module "cesium/Source/Widgets/Viewer/viewerCesiumInspectorMixin" { import { viewerCesiumInspectorMixin } from 'cesium'; export default viewerCesiumInspectorMixin; }
  42145. declare module "cesium/Source/Widgets/Viewer/viewerDragDropMixin" { import { viewerDragDropMixin } from 'cesium'; export default viewerDragDropMixin; }
  42146. declare module "cesium/Source/Widgets/Viewer/viewerPerformanceWatchdogMixin" { import { viewerPerformanceWatchdogMixin } from 'cesium'; export default viewerPerformanceWatchdogMixin; }