Cesium.d.ts 1.9 MB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666166716681669167016711672167316741675167616771678167916801681168216831684168516861687168816891690169116921693169416951696169716981699170017011702170317041705170617071708170917101711171217131714171517161717171817191720172117221723172417251726172717281729173017311732173317341735173617371738173917401741174217431744174517461747174817491750175117521753175417551756175717581759176017611762176317641765176617671768176917701771177217731774177517761777177817791780178117821783178417851786178717881789179017911792179317941795179617971798179918001801180218031804180518061807180818091810181118121813181418151816181718181819182018211822182318241825182618271828182918301831183218331834183518361837183818391840184118421843184418451846184718481849185018511852185318541855185618571858185918601861186218631864186518661867186818691870187118721873187418751876187718781879188018811882188318841885188618871888188918901891189218931894189518961897189818991900190119021903190419051906190719081909191019111912191319141915191619171918191919201921192219231924192519261927192819291930193119321933193419351936193719381939194019411942194319441945194619471948194919501951195219531954195519561957195819591960196119621963196419651966196719681969197019711972197319741975197619771978197919801981198219831984198519861987198819891990199119921993199419951996199719981999200020012002200320042005200620072008200920102011201220132014201520162017201820192020202120222023202420252026202720282029203020312032203320342035203620372038203920402041204220432044204520462047204820492050205120522053205420552056205720582059206020612062206320642065206620672068206920702071207220732074207520762077207820792080208120822083208420852086208720882089209020912092209320942095209620972098209921002101210221032104210521062107210821092110211121122113211421152116211721182119212021212122212321242125212621272128212921302131213221332134213521362137213821392140214121422143214421452146214721482149215021512152215321542155215621572158215921602161216221632164216521662167216821692170217121722173217421752176217721782179218021812182218321842185218621872188218921902191219221932194219521962197219821992200220122022203220422052206220722082209221022112212221322142215221622172218221922202221222222232224222522262227222822292230223122322233223422352236223722382239224022412242224322442245224622472248224922502251225222532254225522562257225822592260226122622263226422652266226722682269227022712272227322742275227622772278227922802281228222832284228522862287228822892290229122922293229422952296229722982299230023012302230323042305230623072308230923102311231223132314231523162317231823192320232123222323232423252326232723282329233023312332233323342335233623372338233923402341234223432344234523462347234823492350235123522353235423552356235723582359236023612362236323642365236623672368236923702371237223732374237523762377237823792380238123822383238423852386238723882389239023912392239323942395239623972398239924002401240224032404240524062407240824092410241124122413241424152416241724182419242024212422242324242425242624272428242924302431243224332434243524362437243824392440244124422443244424452446244724482449245024512452245324542455245624572458245924602461246224632464246524662467246824692470247124722473247424752476247724782479248024812482248324842485248624872488248924902491249224932494249524962497249824992500250125022503250425052506250725082509251025112512251325142515251625172518251925202521252225232524252525262527252825292530253125322533253425352536253725382539254025412542254325442545254625472548254925502551255225532554255525562557255825592560256125622563256425652566256725682569257025712572257325742575257625772578257925802581258225832584258525862587258825892590259125922593259425952596259725982599260026012602260326042605260626072608260926102611261226132614261526162617261826192620262126222623262426252626262726282629263026312632263326342635263626372638263926402641264226432644264526462647264826492650265126522653265426552656265726582659266026612662266326642665266626672668266926702671267226732674267526762677267826792680268126822683268426852686268726882689269026912692269326942695269626972698269927002701270227032704270527062707270827092710271127122713271427152716271727182719272027212722272327242725272627272728272927302731273227332734273527362737273827392740274127422743274427452746274727482749275027512752275327542755275627572758275927602761276227632764276527662767276827692770277127722773277427752776277727782779278027812782278327842785278627872788278927902791279227932794279527962797279827992800280128022803280428052806280728082809281028112812281328142815281628172818281928202821282228232824282528262827282828292830283128322833283428352836283728382839284028412842284328442845284628472848284928502851285228532854285528562857285828592860286128622863286428652866286728682869287028712872287328742875287628772878287928802881288228832884288528862887288828892890289128922893289428952896289728982899290029012902290329042905290629072908290929102911291229132914291529162917291829192920292129222923292429252926292729282929293029312932293329342935293629372938293929402941294229432944294529462947294829492950295129522953295429552956295729582959296029612962296329642965296629672968296929702971297229732974297529762977297829792980298129822983298429852986298729882989299029912992299329942995299629972998299930003001300230033004300530063007300830093010301130123013301430153016301730183019302030213022302330243025302630273028302930303031303230333034303530363037303830393040304130423043304430453046304730483049305030513052305330543055305630573058305930603061306230633064306530663067306830693070307130723073307430753076307730783079308030813082308330843085308630873088308930903091309230933094309530963097309830993100310131023103310431053106310731083109311031113112311331143115311631173118311931203121312231233124312531263127312831293130313131323133313431353136313731383139314031413142314331443145314631473148314931503151315231533154315531563157315831593160316131623163316431653166316731683169317031713172317331743175317631773178317931803181318231833184318531863187318831893190319131923193319431953196319731983199320032013202320332043205320632073208320932103211321232133214321532163217321832193220322132223223322432253226322732283229323032313232323332343235323632373238323932403241324232433244324532463247324832493250325132523253325432553256325732583259326032613262326332643265326632673268326932703271327232733274327532763277327832793280328132823283328432853286328732883289329032913292329332943295329632973298329933003301330233033304330533063307330833093310331133123313331433153316331733183319332033213322332333243325332633273328332933303331333233333334333533363337333833393340334133423343334433453346334733483349335033513352335333543355335633573358335933603361336233633364336533663367336833693370337133723373337433753376337733783379338033813382338333843385338633873388338933903391339233933394339533963397339833993400340134023403340434053406340734083409341034113412341334143415341634173418341934203421342234233424342534263427342834293430343134323433343434353436343734383439344034413442344334443445344634473448344934503451345234533454345534563457345834593460346134623463346434653466346734683469347034713472347334743475347634773478347934803481348234833484348534863487348834893490349134923493349434953496349734983499350035013502350335043505350635073508350935103511351235133514351535163517351835193520352135223523352435253526352735283529353035313532353335343535353635373538353935403541354235433544354535463547354835493550355135523553355435553556355735583559356035613562356335643565356635673568356935703571357235733574357535763577357835793580358135823583358435853586358735883589359035913592359335943595359635973598359936003601360236033604360536063607360836093610361136123613361436153616361736183619362036213622362336243625362636273628362936303631363236333634363536363637363836393640364136423643364436453646364736483649365036513652365336543655365636573658365936603661366236633664366536663667366836693670367136723673367436753676367736783679368036813682368336843685368636873688368936903691369236933694369536963697369836993700370137023703370437053706370737083709371037113712371337143715371637173718371937203721372237233724372537263727372837293730373137323733373437353736373737383739374037413742374337443745374637473748374937503751375237533754375537563757375837593760376137623763376437653766376737683769377037713772377337743775377637773778377937803781378237833784378537863787378837893790379137923793379437953796379737983799380038013802380338043805380638073808380938103811381238133814381538163817381838193820382138223823382438253826382738283829383038313832383338343835383638373838383938403841384238433844384538463847384838493850385138523853385438553856385738583859386038613862386338643865386638673868386938703871387238733874387538763877387838793880388138823883388438853886388738883889389038913892389338943895389638973898389939003901390239033904390539063907390839093910391139123913391439153916391739183919392039213922392339243925392639273928392939303931393239333934393539363937393839393940394139423943394439453946394739483949395039513952395339543955395639573958395939603961396239633964396539663967396839693970397139723973397439753976397739783979398039813982398339843985398639873988398939903991399239933994399539963997399839994000400140024003400440054006400740084009401040114012401340144015401640174018401940204021402240234024402540264027402840294030403140324033403440354036403740384039404040414042404340444045404640474048404940504051405240534054405540564057405840594060406140624063406440654066406740684069407040714072407340744075407640774078407940804081408240834084408540864087408840894090409140924093409440954096409740984099410041014102410341044105410641074108410941104111411241134114411541164117411841194120412141224123412441254126412741284129413041314132413341344135413641374138413941404141414241434144414541464147414841494150415141524153415441554156415741584159416041614162416341644165416641674168416941704171417241734174417541764177417841794180418141824183418441854186418741884189419041914192419341944195419641974198419942004201420242034204420542064207420842094210421142124213421442154216421742184219422042214222422342244225422642274228422942304231423242334234423542364237423842394240424142424243424442454246424742484249425042514252425342544255425642574258425942604261426242634264426542664267426842694270427142724273427442754276427742784279428042814282428342844285428642874288428942904291429242934294429542964297429842994300430143024303430443054306430743084309431043114312431343144315431643174318431943204321432243234324432543264327432843294330433143324333433443354336433743384339434043414342434343444345434643474348434943504351435243534354435543564357435843594360436143624363436443654366436743684369437043714372437343744375437643774378437943804381438243834384438543864387438843894390439143924393439443954396439743984399440044014402440344044405440644074408440944104411441244134414441544164417441844194420442144224423442444254426442744284429443044314432443344344435443644374438443944404441444244434444444544464447444844494450445144524453445444554456445744584459446044614462446344644465446644674468446944704471447244734474447544764477447844794480448144824483448444854486448744884489449044914492449344944495449644974498449945004501450245034504450545064507450845094510451145124513451445154516451745184519452045214522452345244525452645274528452945304531453245334534453545364537453845394540454145424543454445454546454745484549455045514552455345544555455645574558455945604561456245634564456545664567456845694570457145724573457445754576457745784579458045814582458345844585458645874588458945904591459245934594459545964597459845994600460146024603460446054606460746084609461046114612461346144615461646174618461946204621462246234624462546264627462846294630463146324633463446354636463746384639464046414642464346444645464646474648464946504651465246534654465546564657465846594660466146624663466446654666466746684669467046714672467346744675467646774678467946804681468246834684468546864687468846894690469146924693469446954696469746984699470047014702470347044705470647074708470947104711471247134714471547164717471847194720472147224723472447254726472747284729473047314732473347344735473647374738473947404741474247434744474547464747474847494750475147524753475447554756475747584759476047614762476347644765476647674768476947704771477247734774477547764777477847794780478147824783478447854786478747884789479047914792479347944795479647974798479948004801480248034804480548064807480848094810481148124813481448154816481748184819482048214822482348244825482648274828482948304831483248334834483548364837483848394840484148424843484448454846484748484849485048514852485348544855485648574858485948604861486248634864486548664867486848694870487148724873487448754876487748784879488048814882488348844885488648874888488948904891489248934894489548964897489848994900490149024903490449054906490749084909491049114912491349144915491649174918491949204921492249234924492549264927492849294930493149324933493449354936493749384939494049414942494349444945494649474948494949504951495249534954495549564957495849594960496149624963496449654966496749684969497049714972497349744975497649774978497949804981498249834984498549864987498849894990499149924993499449954996499749984999500050015002500350045005500650075008500950105011501250135014501550165017501850195020502150225023502450255026502750285029503050315032503350345035503650375038503950405041504250435044504550465047504850495050505150525053505450555056505750585059506050615062506350645065506650675068506950705071507250735074507550765077507850795080508150825083508450855086508750885089509050915092509350945095509650975098509951005101510251035104510551065107510851095110511151125113511451155116511751185119512051215122512351245125512651275128512951305131513251335134513551365137513851395140514151425143514451455146514751485149515051515152515351545155515651575158515951605161516251635164516551665167516851695170517151725173517451755176517751785179518051815182518351845185518651875188518951905191519251935194519551965197519851995200520152025203520452055206520752085209521052115212521352145215521652175218521952205221522252235224522552265227522852295230523152325233523452355236523752385239524052415242524352445245524652475248524952505251525252535254525552565257525852595260526152625263526452655266526752685269527052715272527352745275527652775278527952805281528252835284528552865287528852895290529152925293529452955296529752985299530053015302530353045305530653075308530953105311531253135314531553165317531853195320532153225323532453255326532753285329533053315332533353345335533653375338533953405341534253435344534553465347534853495350535153525353535453555356535753585359536053615362536353645365536653675368536953705371537253735374537553765377537853795380538153825383538453855386538753885389539053915392539353945395539653975398539954005401540254035404540554065407540854095410541154125413541454155416541754185419542054215422542354245425542654275428542954305431543254335434543554365437543854395440544154425443544454455446544754485449545054515452545354545455545654575458545954605461546254635464546554665467546854695470547154725473547454755476547754785479548054815482548354845485548654875488548954905491549254935494549554965497549854995500550155025503550455055506550755085509551055115512551355145515551655175518551955205521552255235524552555265527552855295530553155325533553455355536553755385539554055415542554355445545554655475548554955505551555255535554555555565557555855595560556155625563556455655566556755685569557055715572557355745575557655775578557955805581558255835584558555865587558855895590559155925593559455955596559755985599560056015602560356045605560656075608560956105611561256135614561556165617561856195620562156225623562456255626562756285629563056315632563356345635563656375638563956405641564256435644564556465647564856495650565156525653565456555656565756585659566056615662566356645665566656675668566956705671567256735674567556765677567856795680568156825683568456855686568756885689569056915692569356945695569656975698569957005701570257035704570557065707570857095710571157125713571457155716571757185719572057215722572357245725572657275728572957305731573257335734573557365737573857395740574157425743574457455746574757485749575057515752575357545755575657575758575957605761576257635764576557665767576857695770577157725773577457755776577757785779578057815782578357845785578657875788578957905791579257935794579557965797579857995800580158025803580458055806580758085809581058115812581358145815581658175818581958205821582258235824582558265827582858295830583158325833583458355836583758385839584058415842584358445845584658475848584958505851585258535854585558565857585858595860586158625863586458655866586758685869587058715872587358745875587658775878587958805881588258835884588558865887588858895890589158925893589458955896589758985899590059015902590359045905590659075908590959105911591259135914591559165917591859195920592159225923592459255926592759285929593059315932593359345935593659375938593959405941594259435944594559465947594859495950595159525953595459555956595759585959596059615962596359645965596659675968596959705971597259735974597559765977597859795980598159825983598459855986598759885989599059915992599359945995599659975998599960006001600260036004600560066007600860096010601160126013601460156016601760186019602060216022602360246025602660276028602960306031603260336034603560366037603860396040604160426043604460456046604760486049605060516052605360546055605660576058605960606061606260636064606560666067606860696070607160726073607460756076607760786079608060816082608360846085608660876088608960906091609260936094609560966097609860996100610161026103610461056106610761086109611061116112611361146115611661176118611961206121612261236124612561266127612861296130613161326133613461356136613761386139614061416142614361446145614661476148614961506151615261536154615561566157615861596160616161626163616461656166616761686169617061716172617361746175617661776178617961806181618261836184618561866187618861896190619161926193619461956196619761986199620062016202620362046205620662076208620962106211621262136214621562166217621862196220622162226223622462256226622762286229623062316232623362346235623662376238623962406241624262436244624562466247624862496250625162526253625462556256625762586259626062616262626362646265626662676268626962706271627262736274627562766277627862796280628162826283628462856286628762886289629062916292629362946295629662976298629963006301630263036304630563066307630863096310631163126313631463156316631763186319632063216322632363246325632663276328632963306331633263336334633563366337633863396340634163426343634463456346634763486349635063516352635363546355635663576358635963606361636263636364636563666367636863696370637163726373637463756376637763786379638063816382638363846385638663876388638963906391639263936394639563966397639863996400640164026403640464056406640764086409641064116412641364146415641664176418641964206421642264236424642564266427642864296430643164326433643464356436643764386439644064416442644364446445644664476448644964506451645264536454645564566457645864596460646164626463646464656466646764686469647064716472647364746475647664776478647964806481648264836484648564866487648864896490649164926493649464956496649764986499650065016502650365046505650665076508650965106511651265136514651565166517651865196520652165226523652465256526652765286529653065316532653365346535653665376538653965406541654265436544654565466547654865496550655165526553655465556556655765586559656065616562656365646565656665676568656965706571657265736574657565766577657865796580658165826583658465856586658765886589659065916592659365946595659665976598659966006601660266036604660566066607660866096610661166126613661466156616661766186619662066216622662366246625662666276628662966306631663266336634663566366637663866396640664166426643664466456646664766486649665066516652665366546655665666576658665966606661666266636664666566666667666866696670667166726673667466756676667766786679668066816682668366846685668666876688668966906691669266936694669566966697669866996700670167026703670467056706670767086709671067116712671367146715671667176718671967206721672267236724672567266727672867296730673167326733673467356736673767386739674067416742674367446745674667476748674967506751675267536754675567566757675867596760676167626763676467656766676767686769677067716772677367746775677667776778677967806781678267836784678567866787678867896790679167926793679467956796679767986799680068016802680368046805680668076808680968106811681268136814681568166817681868196820682168226823682468256826682768286829683068316832683368346835683668376838683968406841684268436844684568466847684868496850685168526853685468556856685768586859686068616862686368646865686668676868686968706871687268736874687568766877687868796880688168826883688468856886688768886889689068916892689368946895689668976898689969006901690269036904690569066907690869096910691169126913691469156916691769186919692069216922692369246925692669276928692969306931693269336934693569366937693869396940694169426943694469456946694769486949695069516952695369546955695669576958695969606961696269636964696569666967696869696970697169726973697469756976697769786979698069816982698369846985698669876988698969906991699269936994699569966997699869997000700170027003700470057006700770087009701070117012701370147015701670177018701970207021702270237024702570267027702870297030703170327033703470357036703770387039704070417042704370447045704670477048704970507051705270537054705570567057705870597060706170627063706470657066706770687069707070717072707370747075707670777078707970807081708270837084708570867087708870897090709170927093709470957096709770987099710071017102710371047105710671077108710971107111711271137114711571167117711871197120712171227123712471257126712771287129713071317132713371347135713671377138713971407141714271437144714571467147714871497150715171527153715471557156715771587159716071617162716371647165716671677168716971707171717271737174717571767177717871797180718171827183718471857186718771887189719071917192719371947195719671977198719972007201720272037204720572067207720872097210721172127213721472157216721772187219722072217222722372247225722672277228722972307231723272337234723572367237723872397240724172427243724472457246724772487249725072517252725372547255725672577258725972607261726272637264726572667267726872697270727172727273727472757276727772787279728072817282728372847285728672877288728972907291729272937294729572967297729872997300730173027303730473057306730773087309731073117312731373147315731673177318731973207321732273237324732573267327732873297330733173327333733473357336733773387339734073417342734373447345734673477348734973507351735273537354735573567357735873597360736173627363736473657366736773687369737073717372737373747375737673777378737973807381738273837384738573867387738873897390739173927393739473957396739773987399740074017402740374047405740674077408740974107411741274137414741574167417741874197420742174227423742474257426742774287429743074317432743374347435743674377438743974407441744274437444744574467447744874497450745174527453745474557456745774587459746074617462746374647465746674677468746974707471747274737474747574767477747874797480748174827483748474857486748774887489749074917492749374947495749674977498749975007501750275037504750575067507750875097510751175127513751475157516751775187519752075217522752375247525752675277528752975307531753275337534753575367537753875397540754175427543754475457546754775487549755075517552755375547555755675577558755975607561756275637564756575667567756875697570757175727573757475757576757775787579758075817582758375847585758675877588758975907591759275937594759575967597759875997600760176027603760476057606760776087609761076117612761376147615761676177618761976207621762276237624762576267627762876297630763176327633763476357636763776387639764076417642764376447645764676477648764976507651765276537654765576567657765876597660766176627663766476657666766776687669767076717672767376747675767676777678767976807681768276837684768576867687768876897690769176927693769476957696769776987699770077017702770377047705770677077708770977107711771277137714771577167717771877197720772177227723772477257726772777287729773077317732773377347735773677377738773977407741774277437744774577467747774877497750775177527753775477557756775777587759776077617762776377647765776677677768776977707771777277737774777577767777777877797780778177827783778477857786778777887789779077917792779377947795779677977798779978007801780278037804780578067807780878097810781178127813781478157816781778187819782078217822782378247825782678277828782978307831783278337834783578367837783878397840784178427843784478457846784778487849785078517852785378547855785678577858785978607861786278637864786578667867786878697870787178727873787478757876787778787879788078817882788378847885788678877888788978907891789278937894789578967897789878997900790179027903790479057906790779087909791079117912791379147915791679177918791979207921792279237924792579267927792879297930793179327933793479357936793779387939794079417942794379447945794679477948794979507951795279537954795579567957795879597960796179627963796479657966796779687969797079717972797379747975797679777978797979807981798279837984798579867987798879897990799179927993799479957996799779987999800080018002800380048005800680078008800980108011801280138014801580168017801880198020802180228023802480258026802780288029803080318032803380348035803680378038803980408041804280438044804580468047804880498050805180528053805480558056805780588059806080618062806380648065806680678068806980708071807280738074807580768077807880798080808180828083808480858086808780888089809080918092809380948095809680978098809981008101810281038104810581068107810881098110811181128113811481158116811781188119812081218122812381248125812681278128812981308131813281338134813581368137813881398140814181428143814481458146814781488149815081518152815381548155815681578158815981608161816281638164816581668167816881698170817181728173817481758176817781788179818081818182818381848185818681878188818981908191819281938194819581968197819881998200820182028203820482058206820782088209821082118212821382148215821682178218821982208221822282238224822582268227822882298230823182328233823482358236823782388239824082418242824382448245824682478248824982508251825282538254825582568257825882598260826182628263826482658266826782688269827082718272827382748275827682778278827982808281828282838284828582868287828882898290829182928293829482958296829782988299830083018302830383048305830683078308830983108311831283138314831583168317831883198320832183228323832483258326832783288329833083318332833383348335833683378338833983408341834283438344834583468347834883498350835183528353835483558356835783588359836083618362836383648365836683678368836983708371837283738374837583768377837883798380838183828383838483858386838783888389839083918392839383948395839683978398839984008401840284038404840584068407840884098410841184128413841484158416841784188419842084218422842384248425842684278428842984308431843284338434843584368437843884398440844184428443844484458446844784488449845084518452845384548455845684578458845984608461846284638464846584668467846884698470847184728473847484758476847784788479848084818482848384848485848684878488848984908491849284938494849584968497849884998500850185028503850485058506850785088509851085118512851385148515851685178518851985208521852285238524852585268527852885298530853185328533853485358536853785388539854085418542854385448545854685478548854985508551855285538554855585568557855885598560856185628563856485658566856785688569857085718572857385748575857685778578857985808581858285838584858585868587858885898590859185928593859485958596859785988599860086018602860386048605860686078608860986108611861286138614861586168617861886198620862186228623862486258626862786288629863086318632863386348635863686378638863986408641864286438644864586468647864886498650865186528653865486558656865786588659866086618662866386648665866686678668866986708671867286738674867586768677867886798680868186828683868486858686868786888689869086918692869386948695869686978698869987008701870287038704870587068707870887098710871187128713871487158716871787188719872087218722872387248725872687278728872987308731873287338734873587368737873887398740874187428743874487458746874787488749875087518752875387548755875687578758875987608761876287638764876587668767876887698770877187728773877487758776877787788779878087818782878387848785878687878788878987908791879287938794879587968797879887998800880188028803880488058806880788088809881088118812881388148815881688178818881988208821882288238824882588268827882888298830883188328833883488358836883788388839884088418842884388448845884688478848884988508851885288538854885588568857885888598860886188628863886488658866886788688869887088718872887388748875887688778878887988808881888288838884888588868887888888898890889188928893889488958896889788988899890089018902890389048905890689078908890989108911891289138914891589168917891889198920892189228923892489258926892789288929893089318932893389348935893689378938893989408941894289438944894589468947894889498950895189528953895489558956895789588959896089618962896389648965896689678968896989708971897289738974897589768977897889798980898189828983898489858986898789888989899089918992899389948995899689978998899990009001900290039004900590069007900890099010901190129013901490159016901790189019902090219022902390249025902690279028902990309031903290339034903590369037903890399040904190429043904490459046904790489049905090519052905390549055905690579058905990609061906290639064906590669067906890699070907190729073907490759076907790789079908090819082908390849085908690879088908990909091909290939094909590969097909890999100910191029103910491059106910791089109911091119112911391149115911691179118911991209121912291239124912591269127912891299130913191329133913491359136913791389139914091419142914391449145914691479148914991509151915291539154915591569157915891599160916191629163916491659166916791689169917091719172917391749175917691779178917991809181918291839184918591869187918891899190919191929193919491959196919791989199920092019202920392049205920692079208920992109211921292139214921592169217921892199220922192229223922492259226922792289229923092319232923392349235923692379238923992409241924292439244924592469247924892499250925192529253925492559256925792589259926092619262926392649265926692679268926992709271927292739274927592769277927892799280928192829283928492859286928792889289929092919292929392949295929692979298929993009301930293039304930593069307930893099310931193129313931493159316931793189319932093219322932393249325932693279328932993309331933293339334933593369337933893399340934193429343934493459346934793489349935093519352935393549355935693579358935993609361936293639364936593669367936893699370937193729373937493759376937793789379938093819382938393849385938693879388938993909391939293939394939593969397939893999400940194029403940494059406940794089409941094119412941394149415941694179418941994209421942294239424942594269427942894299430943194329433943494359436943794389439944094419442944394449445944694479448944994509451945294539454945594569457945894599460946194629463946494659466946794689469947094719472947394749475947694779478947994809481948294839484948594869487948894899490949194929493949494959496949794989499950095019502950395049505950695079508950995109511951295139514951595169517951895199520952195229523952495259526952795289529953095319532953395349535953695379538953995409541954295439544954595469547954895499550955195529553955495559556955795589559956095619562956395649565956695679568956995709571957295739574957595769577957895799580958195829583958495859586958795889589959095919592959395949595959695979598959996009601960296039604960596069607960896099610961196129613961496159616961796189619962096219622962396249625962696279628962996309631963296339634963596369637963896399640964196429643964496459646964796489649965096519652965396549655965696579658965996609661966296639664966596669667966896699670967196729673967496759676967796789679968096819682968396849685968696879688968996909691969296939694969596969697969896999700970197029703970497059706970797089709971097119712971397149715971697179718971997209721972297239724972597269727972897299730973197329733973497359736973797389739974097419742974397449745974697479748974997509751975297539754975597569757975897599760976197629763976497659766976797689769977097719772977397749775977697779778977997809781978297839784978597869787978897899790979197929793979497959796979797989799980098019802980398049805980698079808980998109811981298139814981598169817981898199820982198229823982498259826982798289829983098319832983398349835983698379838983998409841984298439844984598469847984898499850985198529853985498559856985798589859986098619862986398649865986698679868986998709871987298739874987598769877987898799880988198829883988498859886988798889889989098919892989398949895989698979898989999009901990299039904990599069907990899099910991199129913991499159916991799189919992099219922992399249925992699279928992999309931993299339934993599369937993899399940994199429943994499459946994799489949995099519952995399549955995699579958995999609961996299639964996599669967996899699970997199729973997499759976997799789979998099819982998399849985998699879988998999909991999299939994999599969997999899991000010001100021000310004100051000610007100081000910010100111001210013100141001510016100171001810019100201002110022100231002410025100261002710028100291003010031100321003310034100351003610037100381003910040100411004210043100441004510046100471004810049100501005110052100531005410055100561005710058100591006010061100621006310064100651006610067100681006910070100711007210073100741007510076100771007810079100801008110082100831008410085100861008710088100891009010091100921009310094100951009610097100981009910100101011010210103101041010510106101071010810109101101011110112101131011410115101161011710118101191012010121101221012310124101251012610127101281012910130101311013210133101341013510136101371013810139101401014110142101431014410145101461014710148101491015010151101521015310154101551015610157101581015910160101611016210163101641016510166101671016810169101701017110172101731017410175101761017710178101791018010181101821018310184101851018610187101881018910190101911019210193101941019510196101971019810199102001020110202102031020410205102061020710208102091021010211102121021310214102151021610217102181021910220102211022210223102241022510226102271022810229102301023110232102331023410235102361023710238102391024010241102421024310244102451024610247102481024910250102511025210253102541025510256102571025810259102601026110262102631026410265102661026710268102691027010271102721027310274102751027610277102781027910280102811028210283102841028510286102871028810289102901029110292102931029410295102961029710298102991030010301103021030310304103051030610307103081030910310103111031210313103141031510316103171031810319103201032110322103231032410325103261032710328103291033010331103321033310334103351033610337103381033910340103411034210343103441034510346103471034810349103501035110352103531035410355103561035710358103591036010361103621036310364103651036610367103681036910370103711037210373103741037510376103771037810379103801038110382103831038410385103861038710388103891039010391103921039310394103951039610397103981039910400104011040210403104041040510406104071040810409104101041110412104131041410415104161041710418104191042010421104221042310424104251042610427104281042910430104311043210433104341043510436104371043810439104401044110442104431044410445104461044710448104491045010451104521045310454104551045610457104581045910460104611046210463104641046510466104671046810469104701047110472104731047410475104761047710478104791048010481104821048310484104851048610487104881048910490104911049210493104941049510496104971049810499105001050110502105031050410505105061050710508105091051010511105121051310514105151051610517105181051910520105211052210523105241052510526105271052810529105301053110532105331053410535105361053710538105391054010541105421054310544105451054610547105481054910550105511055210553105541055510556105571055810559105601056110562105631056410565105661056710568105691057010571105721057310574105751057610577105781057910580105811058210583105841058510586105871058810589105901059110592105931059410595105961059710598105991060010601106021060310604106051060610607106081060910610106111061210613106141061510616106171061810619106201062110622106231062410625106261062710628106291063010631106321063310634106351063610637106381063910640106411064210643106441064510646106471064810649106501065110652106531065410655106561065710658106591066010661106621066310664106651066610667106681066910670106711067210673106741067510676106771067810679106801068110682106831068410685106861068710688106891069010691106921069310694106951069610697106981069910700107011070210703107041070510706107071070810709107101071110712107131071410715107161071710718107191072010721107221072310724107251072610727107281072910730107311073210733107341073510736107371073810739107401074110742107431074410745107461074710748107491075010751107521075310754107551075610757107581075910760107611076210763107641076510766107671076810769107701077110772107731077410775107761077710778107791078010781107821078310784107851078610787107881078910790107911079210793107941079510796107971079810799108001080110802108031080410805108061080710808108091081010811108121081310814108151081610817108181081910820108211082210823108241082510826108271082810829108301083110832108331083410835108361083710838108391084010841108421084310844108451084610847108481084910850108511085210853108541085510856108571085810859108601086110862108631086410865108661086710868108691087010871108721087310874108751087610877108781087910880108811088210883108841088510886108871088810889108901089110892108931089410895108961089710898108991090010901109021090310904109051090610907109081090910910109111091210913109141091510916109171091810919109201092110922109231092410925109261092710928109291093010931109321093310934109351093610937109381093910940109411094210943109441094510946109471094810949109501095110952109531095410955109561095710958109591096010961109621096310964109651096610967109681096910970109711097210973109741097510976109771097810979109801098110982109831098410985109861098710988109891099010991109921099310994109951099610997109981099911000110011100211003110041100511006110071100811009110101101111012110131101411015110161101711018110191102011021110221102311024110251102611027110281102911030110311103211033110341103511036110371103811039110401104111042110431104411045110461104711048110491105011051110521105311054110551105611057110581105911060110611106211063110641106511066110671106811069110701107111072110731107411075110761107711078110791108011081110821108311084110851108611087110881108911090110911109211093110941109511096110971109811099111001110111102111031110411105111061110711108111091111011111111121111311114111151111611117111181111911120111211112211123111241112511126111271112811129111301113111132111331113411135111361113711138111391114011141111421114311144111451114611147111481114911150111511115211153111541115511156111571115811159111601116111162111631116411165111661116711168111691117011171111721117311174111751117611177111781117911180111811118211183111841118511186111871118811189111901119111192111931119411195111961119711198111991120011201112021120311204112051120611207112081120911210112111121211213112141121511216112171121811219112201122111222112231122411225112261122711228112291123011231112321123311234112351123611237112381123911240112411124211243112441124511246112471124811249112501125111252112531125411255112561125711258112591126011261112621126311264112651126611267112681126911270112711127211273112741127511276112771127811279112801128111282112831128411285112861128711288112891129011291112921129311294112951129611297112981129911300113011130211303113041130511306113071130811309113101131111312113131131411315113161131711318113191132011321113221132311324113251132611327113281132911330113311133211333113341133511336113371133811339113401134111342113431134411345113461134711348113491135011351113521135311354113551135611357113581135911360113611136211363113641136511366113671136811369113701137111372113731137411375113761137711378113791138011381113821138311384113851138611387113881138911390113911139211393113941139511396113971139811399114001140111402114031140411405114061140711408114091141011411114121141311414114151141611417114181141911420114211142211423114241142511426114271142811429114301143111432114331143411435114361143711438114391144011441114421144311444114451144611447114481144911450114511145211453114541145511456114571145811459114601146111462114631146411465114661146711468114691147011471114721147311474114751147611477114781147911480114811148211483114841148511486114871148811489114901149111492114931149411495114961149711498114991150011501115021150311504115051150611507115081150911510115111151211513115141151511516115171151811519115201152111522115231152411525115261152711528115291153011531115321153311534115351153611537115381153911540115411154211543115441154511546115471154811549115501155111552115531155411555115561155711558115591156011561115621156311564115651156611567115681156911570115711157211573115741157511576115771157811579115801158111582115831158411585115861158711588115891159011591115921159311594115951159611597115981159911600116011160211603116041160511606116071160811609116101161111612116131161411615116161161711618116191162011621116221162311624116251162611627116281162911630116311163211633116341163511636116371163811639116401164111642116431164411645116461164711648116491165011651116521165311654116551165611657116581165911660116611166211663116641166511666116671166811669116701167111672116731167411675116761167711678116791168011681116821168311684116851168611687116881168911690116911169211693116941169511696116971169811699117001170111702117031170411705117061170711708117091171011711117121171311714117151171611717117181171911720117211172211723117241172511726117271172811729117301173111732117331173411735117361173711738117391174011741117421174311744117451174611747117481174911750117511175211753117541175511756117571175811759117601176111762117631176411765117661176711768117691177011771117721177311774117751177611777117781177911780117811178211783117841178511786117871178811789117901179111792117931179411795117961179711798117991180011801118021180311804118051180611807118081180911810118111181211813118141181511816118171181811819118201182111822118231182411825118261182711828118291183011831118321183311834118351183611837118381183911840118411184211843118441184511846118471184811849118501185111852118531185411855118561185711858118591186011861118621186311864118651186611867118681186911870118711187211873118741187511876118771187811879118801188111882118831188411885118861188711888118891189011891118921189311894118951189611897118981189911900119011190211903119041190511906119071190811909119101191111912119131191411915119161191711918119191192011921119221192311924119251192611927119281192911930119311193211933119341193511936119371193811939119401194111942119431194411945119461194711948119491195011951119521195311954119551195611957119581195911960119611196211963119641196511966119671196811969119701197111972119731197411975119761197711978119791198011981119821198311984119851198611987119881198911990119911199211993119941199511996119971199811999120001200112002120031200412005120061200712008120091201012011120121201312014120151201612017120181201912020120211202212023120241202512026120271202812029120301203112032120331203412035120361203712038120391204012041120421204312044120451204612047120481204912050120511205212053120541205512056120571205812059120601206112062120631206412065120661206712068120691207012071120721207312074120751207612077120781207912080120811208212083120841208512086120871208812089120901209112092120931209412095120961209712098120991210012101121021210312104121051210612107121081210912110121111211212113121141211512116121171211812119121201212112122121231212412125121261212712128121291213012131121321213312134121351213612137121381213912140121411214212143121441214512146121471214812149121501215112152121531215412155121561215712158121591216012161121621216312164121651216612167121681216912170121711217212173121741217512176121771217812179121801218112182121831218412185121861218712188121891219012191121921219312194121951219612197121981219912200122011220212203122041220512206122071220812209122101221112212122131221412215122161221712218122191222012221122221222312224122251222612227122281222912230122311223212233122341223512236122371223812239122401224112242122431224412245122461224712248122491225012251122521225312254122551225612257122581225912260122611226212263122641226512266122671226812269122701227112272122731227412275122761227712278122791228012281122821228312284122851228612287122881228912290122911229212293122941229512296122971229812299123001230112302123031230412305123061230712308123091231012311123121231312314123151231612317123181231912320123211232212323123241232512326123271232812329123301233112332123331233412335123361233712338123391234012341123421234312344123451234612347123481234912350123511235212353123541235512356123571235812359123601236112362123631236412365123661236712368123691237012371123721237312374123751237612377123781237912380123811238212383123841238512386123871238812389123901239112392123931239412395123961239712398123991240012401124021240312404124051240612407124081240912410124111241212413124141241512416124171241812419124201242112422124231242412425124261242712428124291243012431124321243312434124351243612437124381243912440124411244212443124441244512446124471244812449124501245112452124531245412455124561245712458124591246012461124621246312464124651246612467124681246912470124711247212473124741247512476124771247812479124801248112482124831248412485124861248712488124891249012491124921249312494124951249612497124981249912500125011250212503125041250512506125071250812509125101251112512125131251412515125161251712518125191252012521125221252312524125251252612527125281252912530125311253212533125341253512536125371253812539125401254112542125431254412545125461254712548125491255012551125521255312554125551255612557125581255912560125611256212563125641256512566125671256812569125701257112572125731257412575125761257712578125791258012581125821258312584125851258612587125881258912590125911259212593125941259512596125971259812599126001260112602126031260412605126061260712608126091261012611126121261312614126151261612617126181261912620126211262212623126241262512626126271262812629126301263112632126331263412635126361263712638126391264012641126421264312644126451264612647126481264912650126511265212653126541265512656126571265812659126601266112662126631266412665126661266712668126691267012671126721267312674126751267612677126781267912680126811268212683126841268512686126871268812689126901269112692126931269412695126961269712698126991270012701127021270312704127051270612707127081270912710127111271212713127141271512716127171271812719127201272112722127231272412725127261272712728127291273012731127321273312734127351273612737127381273912740127411274212743127441274512746127471274812749127501275112752127531275412755127561275712758127591276012761127621276312764127651276612767127681276912770127711277212773127741277512776127771277812779127801278112782127831278412785127861278712788127891279012791127921279312794127951279612797127981279912800128011280212803128041280512806128071280812809128101281112812128131281412815128161281712818128191282012821128221282312824128251282612827128281282912830128311283212833128341283512836128371283812839128401284112842128431284412845128461284712848128491285012851128521285312854128551285612857128581285912860128611286212863128641286512866128671286812869128701287112872128731287412875128761287712878128791288012881128821288312884128851288612887128881288912890128911289212893128941289512896128971289812899129001290112902129031290412905129061290712908129091291012911129121291312914129151291612917129181291912920129211292212923129241292512926129271292812929129301293112932129331293412935129361293712938129391294012941129421294312944129451294612947129481294912950129511295212953129541295512956129571295812959129601296112962129631296412965129661296712968129691297012971129721297312974129751297612977129781297912980129811298212983129841298512986129871298812989129901299112992129931299412995129961299712998129991300013001130021300313004130051300613007130081300913010130111301213013130141301513016130171301813019130201302113022130231302413025130261302713028130291303013031130321303313034130351303613037130381303913040130411304213043130441304513046130471304813049130501305113052130531305413055130561305713058130591306013061130621306313064130651306613067130681306913070130711307213073130741307513076130771307813079130801308113082130831308413085130861308713088130891309013091130921309313094130951309613097130981309913100131011310213103131041310513106131071310813109131101311113112131131311413115131161311713118131191312013121131221312313124131251312613127131281312913130131311313213133131341313513136131371313813139131401314113142131431314413145131461314713148131491315013151131521315313154131551315613157131581315913160131611316213163131641316513166131671316813169131701317113172131731317413175131761317713178131791318013181131821318313184131851318613187131881318913190131911319213193131941319513196131971319813199132001320113202132031320413205132061320713208132091321013211132121321313214132151321613217132181321913220132211322213223132241322513226132271322813229132301323113232132331323413235132361323713238132391324013241132421324313244132451324613247132481324913250132511325213253132541325513256132571325813259132601326113262132631326413265132661326713268132691327013271132721327313274132751327613277132781327913280132811328213283132841328513286132871328813289132901329113292132931329413295132961329713298132991330013301133021330313304133051330613307133081330913310133111331213313133141331513316133171331813319133201332113322133231332413325133261332713328133291333013331133321333313334133351333613337133381333913340133411334213343133441334513346133471334813349133501335113352133531335413355133561335713358133591336013361133621336313364133651336613367133681336913370133711337213373133741337513376133771337813379133801338113382133831338413385133861338713388133891339013391133921339313394133951339613397133981339913400134011340213403134041340513406134071340813409134101341113412134131341413415134161341713418134191342013421134221342313424134251342613427134281342913430134311343213433134341343513436134371343813439134401344113442134431344413445134461344713448134491345013451134521345313454134551345613457134581345913460134611346213463134641346513466134671346813469134701347113472134731347413475134761347713478134791348013481134821348313484134851348613487134881348913490134911349213493134941349513496134971349813499135001350113502135031350413505135061350713508135091351013511135121351313514135151351613517135181351913520135211352213523135241352513526135271352813529135301353113532135331353413535135361353713538135391354013541135421354313544135451354613547135481354913550135511355213553135541355513556135571355813559135601356113562135631356413565135661356713568135691357013571135721357313574135751357613577135781357913580135811358213583135841358513586135871358813589135901359113592135931359413595135961359713598135991360013601136021360313604136051360613607136081360913610136111361213613136141361513616136171361813619136201362113622136231362413625136261362713628136291363013631136321363313634136351363613637136381363913640136411364213643136441364513646136471364813649136501365113652136531365413655136561365713658136591366013661136621366313664136651366613667136681366913670136711367213673136741367513676136771367813679136801368113682136831368413685136861368713688136891369013691136921369313694136951369613697136981369913700137011370213703137041370513706137071370813709137101371113712137131371413715137161371713718137191372013721137221372313724137251372613727137281372913730137311373213733137341373513736137371373813739137401374113742137431374413745137461374713748137491375013751137521375313754137551375613757137581375913760137611376213763137641376513766137671376813769137701377113772137731377413775137761377713778137791378013781137821378313784137851378613787137881378913790137911379213793137941379513796137971379813799138001380113802138031380413805138061380713808138091381013811138121381313814138151381613817138181381913820138211382213823138241382513826138271382813829138301383113832138331383413835138361383713838138391384013841138421384313844138451384613847138481384913850138511385213853138541385513856138571385813859138601386113862138631386413865138661386713868138691387013871138721387313874138751387613877138781387913880138811388213883138841388513886138871388813889138901389113892138931389413895138961389713898138991390013901139021390313904139051390613907139081390913910139111391213913139141391513916139171391813919139201392113922139231392413925139261392713928139291393013931139321393313934139351393613937139381393913940139411394213943139441394513946139471394813949139501395113952139531395413955139561395713958139591396013961139621396313964139651396613967139681396913970139711397213973139741397513976139771397813979139801398113982139831398413985139861398713988139891399013991139921399313994139951399613997139981399914000140011400214003140041400514006140071400814009140101401114012140131401414015140161401714018140191402014021140221402314024140251402614027140281402914030140311403214033140341403514036140371403814039140401404114042140431404414045140461404714048140491405014051140521405314054140551405614057140581405914060140611406214063140641406514066140671406814069140701407114072140731407414075140761407714078140791408014081140821408314084140851408614087140881408914090140911409214093140941409514096140971409814099141001410114102141031410414105141061410714108141091411014111141121411314114141151411614117141181411914120141211412214123141241412514126141271412814129141301413114132141331413414135141361413714138141391414014141141421414314144141451414614147141481414914150141511415214153141541415514156141571415814159141601416114162141631416414165141661416714168141691417014171141721417314174141751417614177141781417914180141811418214183141841418514186141871418814189141901419114192141931419414195141961419714198141991420014201142021420314204142051420614207142081420914210142111421214213142141421514216142171421814219142201422114222142231422414225142261422714228142291423014231142321423314234142351423614237142381423914240142411424214243142441424514246142471424814249142501425114252142531425414255142561425714258142591426014261142621426314264142651426614267142681426914270142711427214273142741427514276142771427814279142801428114282142831428414285142861428714288142891429014291142921429314294142951429614297142981429914300143011430214303143041430514306143071430814309143101431114312143131431414315143161431714318143191432014321143221432314324143251432614327143281432914330143311433214333143341433514336143371433814339143401434114342143431434414345143461434714348143491435014351143521435314354143551435614357143581435914360143611436214363143641436514366143671436814369143701437114372143731437414375143761437714378143791438014381143821438314384143851438614387143881438914390143911439214393143941439514396143971439814399144001440114402144031440414405144061440714408144091441014411144121441314414144151441614417144181441914420144211442214423144241442514426144271442814429144301443114432144331443414435144361443714438144391444014441144421444314444144451444614447144481444914450144511445214453144541445514456144571445814459144601446114462144631446414465144661446714468144691447014471144721447314474144751447614477144781447914480144811448214483144841448514486144871448814489144901449114492144931449414495144961449714498144991450014501145021450314504145051450614507145081450914510145111451214513145141451514516145171451814519145201452114522145231452414525145261452714528145291453014531145321453314534145351453614537145381453914540145411454214543145441454514546145471454814549145501455114552145531455414555145561455714558145591456014561145621456314564145651456614567145681456914570145711457214573145741457514576145771457814579145801458114582145831458414585145861458714588145891459014591145921459314594145951459614597145981459914600146011460214603146041460514606146071460814609146101461114612146131461414615146161461714618146191462014621146221462314624146251462614627146281462914630146311463214633146341463514636146371463814639146401464114642146431464414645146461464714648146491465014651146521465314654146551465614657146581465914660146611466214663146641466514666146671466814669146701467114672146731467414675146761467714678146791468014681146821468314684146851468614687146881468914690146911469214693146941469514696146971469814699147001470114702147031470414705147061470714708147091471014711147121471314714147151471614717147181471914720147211472214723147241472514726147271472814729147301473114732147331473414735147361473714738147391474014741147421474314744147451474614747147481474914750147511475214753147541475514756147571475814759147601476114762147631476414765147661476714768147691477014771147721477314774147751477614777147781477914780147811478214783147841478514786147871478814789147901479114792147931479414795147961479714798147991480014801148021480314804148051480614807148081480914810148111481214813148141481514816148171481814819148201482114822148231482414825148261482714828148291483014831148321483314834148351483614837148381483914840148411484214843148441484514846148471484814849148501485114852148531485414855148561485714858148591486014861148621486314864148651486614867148681486914870148711487214873148741487514876148771487814879148801488114882148831488414885148861488714888148891489014891148921489314894148951489614897148981489914900149011490214903149041490514906149071490814909149101491114912149131491414915149161491714918149191492014921149221492314924149251492614927149281492914930149311493214933149341493514936149371493814939149401494114942149431494414945149461494714948149491495014951149521495314954149551495614957149581495914960149611496214963149641496514966149671496814969149701497114972149731497414975149761497714978149791498014981149821498314984149851498614987149881498914990149911499214993149941499514996149971499814999150001500115002150031500415005150061500715008150091501015011150121501315014150151501615017150181501915020150211502215023150241502515026150271502815029150301503115032150331503415035150361503715038150391504015041150421504315044150451504615047150481504915050150511505215053150541505515056150571505815059150601506115062150631506415065150661506715068150691507015071150721507315074150751507615077150781507915080150811508215083150841508515086150871508815089150901509115092150931509415095150961509715098150991510015101151021510315104151051510615107151081510915110151111511215113151141511515116151171511815119151201512115122151231512415125151261512715128151291513015131151321513315134151351513615137151381513915140151411514215143151441514515146151471514815149151501515115152151531515415155151561515715158151591516015161151621516315164151651516615167151681516915170151711517215173151741517515176151771517815179151801518115182151831518415185151861518715188151891519015191151921519315194151951519615197151981519915200152011520215203152041520515206152071520815209152101521115212152131521415215152161521715218152191522015221152221522315224152251522615227152281522915230152311523215233152341523515236152371523815239152401524115242152431524415245152461524715248152491525015251152521525315254152551525615257152581525915260152611526215263152641526515266152671526815269152701527115272152731527415275152761527715278152791528015281152821528315284152851528615287152881528915290152911529215293152941529515296152971529815299153001530115302153031530415305153061530715308153091531015311153121531315314153151531615317153181531915320153211532215323153241532515326153271532815329153301533115332153331533415335153361533715338153391534015341153421534315344153451534615347153481534915350153511535215353153541535515356153571535815359153601536115362153631536415365153661536715368153691537015371153721537315374153751537615377153781537915380153811538215383153841538515386153871538815389153901539115392153931539415395153961539715398153991540015401154021540315404154051540615407154081540915410154111541215413154141541515416154171541815419154201542115422154231542415425154261542715428154291543015431154321543315434154351543615437154381543915440154411544215443154441544515446154471544815449154501545115452154531545415455154561545715458154591546015461154621546315464154651546615467154681546915470154711547215473154741547515476154771547815479154801548115482154831548415485154861548715488154891549015491154921549315494154951549615497154981549915500155011550215503155041550515506155071550815509155101551115512155131551415515155161551715518155191552015521155221552315524155251552615527155281552915530155311553215533155341553515536155371553815539155401554115542155431554415545155461554715548155491555015551155521555315554155551555615557155581555915560155611556215563155641556515566155671556815569155701557115572155731557415575155761557715578155791558015581155821558315584155851558615587155881558915590155911559215593155941559515596155971559815599156001560115602156031560415605156061560715608156091561015611156121561315614156151561615617156181561915620156211562215623156241562515626156271562815629156301563115632156331563415635156361563715638156391564015641156421564315644156451564615647156481564915650156511565215653156541565515656156571565815659156601566115662156631566415665156661566715668156691567015671156721567315674156751567615677156781567915680156811568215683156841568515686156871568815689156901569115692156931569415695156961569715698156991570015701157021570315704157051570615707157081570915710157111571215713157141571515716157171571815719157201572115722157231572415725157261572715728157291573015731157321573315734157351573615737157381573915740157411574215743157441574515746157471574815749157501575115752157531575415755157561575715758157591576015761157621576315764157651576615767157681576915770157711577215773157741577515776157771577815779157801578115782157831578415785157861578715788157891579015791157921579315794157951579615797157981579915800158011580215803158041580515806158071580815809158101581115812158131581415815158161581715818158191582015821158221582315824158251582615827158281582915830158311583215833158341583515836158371583815839158401584115842158431584415845158461584715848158491585015851158521585315854158551585615857158581585915860158611586215863158641586515866158671586815869158701587115872158731587415875158761587715878158791588015881158821588315884158851588615887158881588915890158911589215893158941589515896158971589815899159001590115902159031590415905159061590715908159091591015911159121591315914159151591615917159181591915920159211592215923159241592515926159271592815929159301593115932159331593415935159361593715938159391594015941159421594315944159451594615947159481594915950159511595215953159541595515956159571595815959159601596115962159631596415965159661596715968159691597015971159721597315974159751597615977159781597915980159811598215983159841598515986159871598815989159901599115992159931599415995159961599715998159991600016001160021600316004160051600616007160081600916010160111601216013160141601516016160171601816019160201602116022160231602416025160261602716028160291603016031160321603316034160351603616037160381603916040160411604216043160441604516046160471604816049160501605116052160531605416055160561605716058160591606016061160621606316064160651606616067160681606916070160711607216073160741607516076160771607816079160801608116082160831608416085160861608716088160891609016091160921609316094160951609616097160981609916100161011610216103161041610516106161071610816109161101611116112161131611416115161161611716118161191612016121161221612316124161251612616127161281612916130161311613216133161341613516136161371613816139161401614116142161431614416145161461614716148161491615016151161521615316154161551615616157161581615916160161611616216163161641616516166161671616816169161701617116172161731617416175161761617716178161791618016181161821618316184161851618616187161881618916190161911619216193161941619516196161971619816199162001620116202162031620416205162061620716208162091621016211162121621316214162151621616217162181621916220162211622216223162241622516226162271622816229162301623116232162331623416235162361623716238162391624016241162421624316244162451624616247162481624916250162511625216253162541625516256162571625816259162601626116262162631626416265162661626716268162691627016271162721627316274162751627616277162781627916280162811628216283162841628516286162871628816289162901629116292162931629416295162961629716298162991630016301163021630316304163051630616307163081630916310163111631216313163141631516316163171631816319163201632116322163231632416325163261632716328163291633016331163321633316334163351633616337163381633916340163411634216343163441634516346163471634816349163501635116352163531635416355163561635716358163591636016361163621636316364163651636616367163681636916370163711637216373163741637516376163771637816379163801638116382163831638416385163861638716388163891639016391163921639316394163951639616397163981639916400164011640216403164041640516406164071640816409164101641116412164131641416415164161641716418164191642016421164221642316424164251642616427164281642916430164311643216433164341643516436164371643816439164401644116442164431644416445164461644716448164491645016451164521645316454164551645616457164581645916460164611646216463164641646516466164671646816469164701647116472164731647416475164761647716478164791648016481164821648316484164851648616487164881648916490164911649216493164941649516496164971649816499165001650116502165031650416505165061650716508165091651016511165121651316514165151651616517165181651916520165211652216523165241652516526165271652816529165301653116532165331653416535165361653716538165391654016541165421654316544165451654616547165481654916550165511655216553165541655516556165571655816559165601656116562165631656416565165661656716568165691657016571165721657316574165751657616577165781657916580165811658216583165841658516586165871658816589165901659116592165931659416595165961659716598165991660016601166021660316604166051660616607166081660916610166111661216613166141661516616166171661816619166201662116622166231662416625166261662716628166291663016631166321663316634166351663616637166381663916640166411664216643166441664516646166471664816649166501665116652166531665416655166561665716658166591666016661166621666316664166651666616667166681666916670166711667216673166741667516676166771667816679166801668116682166831668416685166861668716688166891669016691166921669316694166951669616697166981669916700167011670216703167041670516706167071670816709167101671116712167131671416715167161671716718167191672016721167221672316724167251672616727167281672916730167311673216733167341673516736167371673816739167401674116742167431674416745167461674716748167491675016751167521675316754167551675616757167581675916760167611676216763167641676516766167671676816769167701677116772167731677416775167761677716778167791678016781167821678316784167851678616787167881678916790167911679216793167941679516796167971679816799168001680116802168031680416805168061680716808168091681016811168121681316814168151681616817168181681916820168211682216823168241682516826168271682816829168301683116832168331683416835168361683716838168391684016841168421684316844168451684616847168481684916850168511685216853168541685516856168571685816859168601686116862168631686416865168661686716868168691687016871168721687316874168751687616877168781687916880168811688216883168841688516886168871688816889168901689116892168931689416895168961689716898168991690016901169021690316904169051690616907169081690916910169111691216913169141691516916169171691816919169201692116922169231692416925169261692716928169291693016931169321693316934169351693616937169381693916940169411694216943169441694516946169471694816949169501695116952169531695416955169561695716958169591696016961169621696316964169651696616967169681696916970169711697216973169741697516976169771697816979169801698116982169831698416985169861698716988169891699016991169921699316994169951699616997169981699917000170011700217003170041700517006170071700817009170101701117012170131701417015170161701717018170191702017021170221702317024170251702617027170281702917030170311703217033170341703517036170371703817039170401704117042170431704417045170461704717048170491705017051170521705317054170551705617057170581705917060170611706217063170641706517066170671706817069170701707117072170731707417075170761707717078170791708017081170821708317084170851708617087170881708917090170911709217093170941709517096170971709817099171001710117102171031710417105171061710717108171091711017111171121711317114171151711617117171181711917120171211712217123171241712517126171271712817129171301713117132171331713417135171361713717138171391714017141171421714317144171451714617147171481714917150171511715217153171541715517156171571715817159171601716117162171631716417165171661716717168171691717017171171721717317174171751717617177171781717917180171811718217183171841718517186171871718817189171901719117192171931719417195171961719717198171991720017201172021720317204172051720617207172081720917210172111721217213172141721517216172171721817219172201722117222172231722417225172261722717228172291723017231172321723317234172351723617237172381723917240172411724217243172441724517246172471724817249172501725117252172531725417255172561725717258172591726017261172621726317264172651726617267172681726917270172711727217273172741727517276172771727817279172801728117282172831728417285172861728717288172891729017291172921729317294172951729617297172981729917300173011730217303173041730517306173071730817309173101731117312173131731417315173161731717318173191732017321173221732317324173251732617327173281732917330173311733217333173341733517336173371733817339173401734117342173431734417345173461734717348173491735017351173521735317354173551735617357173581735917360173611736217363173641736517366173671736817369173701737117372173731737417375173761737717378173791738017381173821738317384173851738617387173881738917390173911739217393173941739517396173971739817399174001740117402174031740417405174061740717408174091741017411174121741317414174151741617417174181741917420174211742217423174241742517426174271742817429174301743117432174331743417435174361743717438174391744017441174421744317444174451744617447174481744917450174511745217453174541745517456174571745817459174601746117462174631746417465174661746717468174691747017471174721747317474174751747617477174781747917480174811748217483174841748517486174871748817489174901749117492174931749417495174961749717498174991750017501175021750317504175051750617507175081750917510175111751217513175141751517516175171751817519175201752117522175231752417525175261752717528175291753017531175321753317534175351753617537175381753917540175411754217543175441754517546175471754817549175501755117552175531755417555175561755717558175591756017561175621756317564175651756617567175681756917570175711757217573175741757517576175771757817579175801758117582175831758417585175861758717588175891759017591175921759317594175951759617597175981759917600176011760217603176041760517606176071760817609176101761117612176131761417615176161761717618176191762017621176221762317624176251762617627176281762917630176311763217633176341763517636176371763817639176401764117642176431764417645176461764717648176491765017651176521765317654176551765617657176581765917660176611766217663176641766517666176671766817669176701767117672176731767417675176761767717678176791768017681176821768317684176851768617687176881768917690176911769217693176941769517696176971769817699177001770117702177031770417705177061770717708177091771017711177121771317714177151771617717177181771917720177211772217723177241772517726177271772817729177301773117732177331773417735177361773717738177391774017741177421774317744177451774617747177481774917750177511775217753177541775517756177571775817759177601776117762177631776417765177661776717768177691777017771177721777317774177751777617777177781777917780177811778217783177841778517786177871778817789177901779117792177931779417795177961779717798177991780017801178021780317804178051780617807178081780917810178111781217813178141781517816178171781817819178201782117822178231782417825178261782717828178291783017831178321783317834178351783617837178381783917840178411784217843178441784517846178471784817849178501785117852178531785417855178561785717858178591786017861178621786317864178651786617867178681786917870178711787217873178741787517876178771787817879178801788117882178831788417885178861788717888178891789017891178921789317894178951789617897178981789917900179011790217903179041790517906179071790817909179101791117912179131791417915179161791717918179191792017921179221792317924179251792617927179281792917930179311793217933179341793517936179371793817939179401794117942179431794417945179461794717948179491795017951179521795317954179551795617957179581795917960179611796217963179641796517966179671796817969179701797117972179731797417975179761797717978179791798017981179821798317984179851798617987179881798917990179911799217993179941799517996179971799817999180001800118002180031800418005180061800718008180091801018011180121801318014180151801618017180181801918020180211802218023180241802518026180271802818029180301803118032180331803418035180361803718038180391804018041180421804318044180451804618047180481804918050180511805218053180541805518056180571805818059180601806118062180631806418065180661806718068180691807018071180721807318074180751807618077180781807918080180811808218083180841808518086180871808818089180901809118092180931809418095180961809718098180991810018101181021810318104181051810618107181081810918110181111811218113181141811518116181171811818119181201812118122181231812418125181261812718128181291813018131181321813318134181351813618137181381813918140181411814218143181441814518146181471814818149181501815118152181531815418155181561815718158181591816018161181621816318164181651816618167181681816918170181711817218173181741817518176181771817818179181801818118182181831818418185181861818718188181891819018191181921819318194181951819618197181981819918200182011820218203182041820518206182071820818209182101821118212182131821418215182161821718218182191822018221182221822318224182251822618227182281822918230182311823218233182341823518236182371823818239182401824118242182431824418245182461824718248182491825018251182521825318254182551825618257182581825918260182611826218263182641826518266182671826818269182701827118272182731827418275182761827718278182791828018281182821828318284182851828618287182881828918290182911829218293182941829518296182971829818299183001830118302183031830418305183061830718308183091831018311183121831318314183151831618317183181831918320183211832218323183241832518326183271832818329183301833118332183331833418335183361833718338183391834018341183421834318344183451834618347183481834918350183511835218353183541835518356183571835818359183601836118362183631836418365183661836718368183691837018371183721837318374183751837618377183781837918380183811838218383183841838518386183871838818389183901839118392183931839418395183961839718398183991840018401184021840318404184051840618407184081840918410184111841218413184141841518416184171841818419184201842118422184231842418425184261842718428184291843018431184321843318434184351843618437184381843918440184411844218443184441844518446184471844818449184501845118452184531845418455184561845718458184591846018461184621846318464184651846618467184681846918470184711847218473184741847518476184771847818479184801848118482184831848418485184861848718488184891849018491184921849318494184951849618497184981849918500185011850218503185041850518506185071850818509185101851118512185131851418515185161851718518185191852018521185221852318524185251852618527185281852918530185311853218533185341853518536185371853818539185401854118542185431854418545185461854718548185491855018551185521855318554185551855618557185581855918560185611856218563185641856518566185671856818569185701857118572185731857418575185761857718578185791858018581185821858318584185851858618587185881858918590185911859218593185941859518596185971859818599186001860118602186031860418605186061860718608186091861018611186121861318614186151861618617186181861918620186211862218623186241862518626186271862818629186301863118632186331863418635186361863718638186391864018641186421864318644186451864618647186481864918650186511865218653186541865518656186571865818659186601866118662186631866418665186661866718668186691867018671186721867318674186751867618677186781867918680186811868218683186841868518686186871868818689186901869118692186931869418695186961869718698186991870018701187021870318704187051870618707187081870918710187111871218713187141871518716187171871818719187201872118722187231872418725187261872718728187291873018731187321873318734187351873618737187381873918740187411874218743187441874518746187471874818749187501875118752187531875418755187561875718758187591876018761187621876318764187651876618767187681876918770187711877218773187741877518776187771877818779187801878118782187831878418785187861878718788187891879018791187921879318794187951879618797187981879918800188011880218803188041880518806188071880818809188101881118812188131881418815188161881718818188191882018821188221882318824188251882618827188281882918830188311883218833188341883518836188371883818839188401884118842188431884418845188461884718848188491885018851188521885318854188551885618857188581885918860188611886218863188641886518866188671886818869188701887118872188731887418875188761887718878188791888018881188821888318884188851888618887188881888918890188911889218893188941889518896188971889818899189001890118902189031890418905189061890718908189091891018911189121891318914189151891618917189181891918920189211892218923189241892518926189271892818929189301893118932189331893418935189361893718938189391894018941189421894318944189451894618947189481894918950189511895218953189541895518956189571895818959189601896118962189631896418965189661896718968189691897018971189721897318974189751897618977189781897918980189811898218983189841898518986189871898818989189901899118992189931899418995189961899718998189991900019001190021900319004190051900619007190081900919010190111901219013190141901519016190171901819019190201902119022190231902419025190261902719028190291903019031190321903319034190351903619037190381903919040190411904219043190441904519046190471904819049190501905119052190531905419055190561905719058190591906019061190621906319064190651906619067190681906919070190711907219073190741907519076190771907819079190801908119082190831908419085190861908719088190891909019091190921909319094190951909619097190981909919100191011910219103191041910519106191071910819109191101911119112191131911419115191161911719118191191912019121191221912319124191251912619127191281912919130191311913219133191341913519136191371913819139191401914119142191431914419145191461914719148191491915019151191521915319154191551915619157191581915919160191611916219163191641916519166191671916819169191701917119172191731917419175191761917719178191791918019181191821918319184191851918619187191881918919190191911919219193191941919519196191971919819199192001920119202192031920419205192061920719208192091921019211192121921319214192151921619217192181921919220192211922219223192241922519226192271922819229192301923119232192331923419235192361923719238192391924019241192421924319244192451924619247192481924919250192511925219253192541925519256192571925819259192601926119262192631926419265192661926719268192691927019271192721927319274192751927619277192781927919280192811928219283192841928519286192871928819289192901929119292192931929419295192961929719298192991930019301193021930319304193051930619307193081930919310193111931219313193141931519316193171931819319193201932119322193231932419325193261932719328193291933019331193321933319334193351933619337193381933919340193411934219343193441934519346193471934819349193501935119352193531935419355193561935719358193591936019361193621936319364193651936619367193681936919370193711937219373193741937519376193771937819379193801938119382193831938419385193861938719388193891939019391193921939319394193951939619397193981939919400194011940219403194041940519406194071940819409194101941119412194131941419415194161941719418194191942019421194221942319424194251942619427194281942919430194311943219433194341943519436194371943819439194401944119442194431944419445194461944719448194491945019451194521945319454194551945619457194581945919460194611946219463194641946519466194671946819469194701947119472194731947419475194761947719478194791948019481194821948319484194851948619487194881948919490194911949219493194941949519496194971949819499195001950119502195031950419505195061950719508195091951019511195121951319514195151951619517195181951919520195211952219523195241952519526195271952819529195301953119532195331953419535195361953719538195391954019541195421954319544195451954619547195481954919550195511955219553195541955519556195571955819559195601956119562195631956419565195661956719568195691957019571195721957319574195751957619577195781957919580195811958219583195841958519586195871958819589195901959119592195931959419595195961959719598195991960019601196021960319604196051960619607196081960919610196111961219613196141961519616196171961819619196201962119622196231962419625196261962719628196291963019631196321963319634196351963619637196381963919640196411964219643196441964519646196471964819649196501965119652196531965419655196561965719658196591966019661196621966319664196651966619667196681966919670196711967219673196741967519676196771967819679196801968119682196831968419685196861968719688196891969019691196921969319694196951969619697196981969919700197011970219703197041970519706197071970819709197101971119712197131971419715197161971719718197191972019721197221972319724197251972619727197281972919730197311973219733197341973519736197371973819739197401974119742197431974419745197461974719748197491975019751197521975319754197551975619757197581975919760197611976219763197641976519766197671976819769197701977119772197731977419775197761977719778197791978019781197821978319784197851978619787197881978919790197911979219793197941979519796197971979819799198001980119802198031980419805198061980719808198091981019811198121981319814198151981619817198181981919820198211982219823198241982519826198271982819829198301983119832198331983419835198361983719838198391984019841198421984319844198451984619847198481984919850198511985219853198541985519856198571985819859198601986119862198631986419865198661986719868198691987019871198721987319874198751987619877198781987919880198811988219883198841988519886198871988819889198901989119892198931989419895198961989719898198991990019901199021990319904199051990619907199081990919910199111991219913199141991519916199171991819919199201992119922199231992419925199261992719928199291993019931199321993319934199351993619937199381993919940199411994219943199441994519946199471994819949199501995119952199531995419955199561995719958199591996019961199621996319964199651996619967199681996919970199711997219973199741997519976199771997819979199801998119982199831998419985199861998719988199891999019991199921999319994199951999619997199981999920000200012000220003200042000520006200072000820009200102001120012200132001420015200162001720018200192002020021200222002320024200252002620027200282002920030200312003220033200342003520036200372003820039200402004120042200432004420045200462004720048200492005020051200522005320054200552005620057200582005920060200612006220063200642006520066200672006820069200702007120072200732007420075200762007720078200792008020081200822008320084200852008620087200882008920090200912009220093200942009520096200972009820099201002010120102201032010420105201062010720108201092011020111201122011320114201152011620117201182011920120201212012220123201242012520126201272012820129201302013120132201332013420135201362013720138201392014020141201422014320144201452014620147201482014920150201512015220153201542015520156201572015820159201602016120162201632016420165201662016720168201692017020171201722017320174201752017620177201782017920180201812018220183201842018520186201872018820189201902019120192201932019420195201962019720198201992020020201202022020320204202052020620207202082020920210202112021220213202142021520216202172021820219202202022120222202232022420225202262022720228202292023020231202322023320234202352023620237202382023920240202412024220243202442024520246202472024820249202502025120252202532025420255202562025720258202592026020261202622026320264202652026620267202682026920270202712027220273202742027520276202772027820279202802028120282202832028420285202862028720288202892029020291202922029320294202952029620297202982029920300203012030220303203042030520306203072030820309203102031120312203132031420315203162031720318203192032020321203222032320324203252032620327203282032920330203312033220333203342033520336203372033820339203402034120342203432034420345203462034720348203492035020351203522035320354203552035620357203582035920360203612036220363203642036520366203672036820369203702037120372203732037420375203762037720378203792038020381203822038320384203852038620387203882038920390203912039220393203942039520396203972039820399204002040120402204032040420405204062040720408204092041020411204122041320414204152041620417204182041920420204212042220423204242042520426204272042820429204302043120432204332043420435204362043720438204392044020441204422044320444204452044620447204482044920450204512045220453204542045520456204572045820459204602046120462204632046420465204662046720468204692047020471204722047320474204752047620477204782047920480204812048220483204842048520486204872048820489204902049120492204932049420495204962049720498204992050020501205022050320504205052050620507205082050920510205112051220513205142051520516205172051820519205202052120522205232052420525205262052720528205292053020531205322053320534205352053620537205382053920540205412054220543205442054520546205472054820549205502055120552205532055420555205562055720558205592056020561205622056320564205652056620567205682056920570205712057220573205742057520576205772057820579205802058120582205832058420585205862058720588205892059020591205922059320594205952059620597205982059920600206012060220603206042060520606206072060820609206102061120612206132061420615206162061720618206192062020621206222062320624206252062620627206282062920630206312063220633206342063520636206372063820639206402064120642206432064420645206462064720648206492065020651206522065320654206552065620657206582065920660206612066220663206642066520666206672066820669206702067120672206732067420675206762067720678206792068020681206822068320684206852068620687206882068920690206912069220693206942069520696206972069820699207002070120702207032070420705207062070720708207092071020711207122071320714207152071620717207182071920720207212072220723207242072520726207272072820729207302073120732207332073420735207362073720738207392074020741207422074320744207452074620747207482074920750207512075220753207542075520756207572075820759207602076120762207632076420765207662076720768207692077020771207722077320774207752077620777207782077920780207812078220783207842078520786207872078820789207902079120792207932079420795207962079720798207992080020801208022080320804208052080620807208082080920810208112081220813208142081520816208172081820819208202082120822208232082420825208262082720828208292083020831208322083320834208352083620837208382083920840208412084220843208442084520846208472084820849208502085120852208532085420855208562085720858208592086020861208622086320864208652086620867208682086920870208712087220873208742087520876208772087820879208802088120882208832088420885208862088720888208892089020891208922089320894208952089620897208982089920900209012090220903209042090520906209072090820909209102091120912209132091420915209162091720918209192092020921209222092320924209252092620927209282092920930209312093220933209342093520936209372093820939209402094120942209432094420945209462094720948209492095020951209522095320954209552095620957209582095920960209612096220963209642096520966209672096820969209702097120972209732097420975209762097720978209792098020981209822098320984209852098620987209882098920990209912099220993209942099520996209972099820999210002100121002210032100421005210062100721008210092101021011210122101321014210152101621017210182101921020210212102221023210242102521026210272102821029210302103121032210332103421035210362103721038210392104021041210422104321044210452104621047210482104921050210512105221053210542105521056210572105821059210602106121062210632106421065210662106721068210692107021071210722107321074210752107621077210782107921080210812108221083210842108521086210872108821089210902109121092210932109421095210962109721098210992110021101211022110321104211052110621107211082110921110211112111221113211142111521116211172111821119211202112121122211232112421125211262112721128211292113021131211322113321134211352113621137211382113921140211412114221143211442114521146211472114821149211502115121152211532115421155211562115721158211592116021161211622116321164211652116621167211682116921170211712117221173211742117521176211772117821179211802118121182211832118421185211862118721188211892119021191211922119321194211952119621197211982119921200212012120221203212042120521206212072120821209212102121121212212132121421215212162121721218212192122021221212222122321224212252122621227212282122921230212312123221233212342123521236212372123821239212402124121242212432124421245212462124721248212492125021251212522125321254212552125621257212582125921260212612126221263212642126521266212672126821269212702127121272212732127421275212762127721278212792128021281212822128321284212852128621287212882128921290212912129221293212942129521296212972129821299213002130121302213032130421305213062130721308213092131021311213122131321314213152131621317213182131921320213212132221323213242132521326213272132821329213302133121332213332133421335213362133721338213392134021341213422134321344213452134621347213482134921350213512135221353213542135521356213572135821359213602136121362213632136421365213662136721368213692137021371213722137321374213752137621377213782137921380213812138221383213842138521386213872138821389213902139121392213932139421395213962139721398213992140021401214022140321404214052140621407214082140921410214112141221413214142141521416214172141821419214202142121422214232142421425214262142721428214292143021431214322143321434214352143621437214382143921440214412144221443214442144521446214472144821449214502145121452214532145421455214562145721458214592146021461214622146321464214652146621467214682146921470214712147221473214742147521476214772147821479214802148121482214832148421485214862148721488214892149021491214922149321494214952149621497214982149921500215012150221503215042150521506215072150821509215102151121512215132151421515215162151721518215192152021521215222152321524215252152621527215282152921530215312153221533215342153521536215372153821539215402154121542215432154421545215462154721548215492155021551215522155321554215552155621557215582155921560215612156221563215642156521566215672156821569215702157121572215732157421575215762157721578215792158021581215822158321584215852158621587215882158921590215912159221593215942159521596215972159821599216002160121602216032160421605216062160721608216092161021611216122161321614216152161621617216182161921620216212162221623216242162521626216272162821629216302163121632216332163421635216362163721638216392164021641216422164321644216452164621647216482164921650216512165221653216542165521656216572165821659216602166121662216632166421665216662166721668216692167021671216722167321674216752167621677216782167921680216812168221683216842168521686216872168821689216902169121692216932169421695216962169721698216992170021701217022170321704217052170621707217082170921710217112171221713217142171521716217172171821719217202172121722217232172421725217262172721728217292173021731217322173321734217352173621737217382173921740217412174221743217442174521746217472174821749217502175121752217532175421755217562175721758217592176021761217622176321764217652176621767217682176921770217712177221773217742177521776217772177821779217802178121782217832178421785217862178721788217892179021791217922179321794217952179621797217982179921800218012180221803218042180521806218072180821809218102181121812218132181421815218162181721818218192182021821218222182321824218252182621827218282182921830218312183221833218342183521836218372183821839218402184121842218432184421845218462184721848218492185021851218522185321854218552185621857218582185921860218612186221863218642186521866218672186821869218702187121872218732187421875218762187721878218792188021881218822188321884218852188621887218882188921890218912189221893218942189521896218972189821899219002190121902219032190421905219062190721908219092191021911219122191321914219152191621917219182191921920219212192221923219242192521926219272192821929219302193121932219332193421935219362193721938219392194021941219422194321944219452194621947219482194921950219512195221953219542195521956219572195821959219602196121962219632196421965219662196721968219692197021971219722197321974219752197621977219782197921980219812198221983219842198521986219872198821989219902199121992219932199421995219962199721998219992200022001220022200322004220052200622007220082200922010220112201222013220142201522016220172201822019220202202122022220232202422025220262202722028220292203022031220322203322034220352203622037220382203922040220412204222043220442204522046220472204822049220502205122052220532205422055220562205722058220592206022061220622206322064220652206622067220682206922070220712207222073220742207522076220772207822079220802208122082220832208422085220862208722088220892209022091220922209322094220952209622097220982209922100221012210222103221042210522106221072210822109221102211122112221132211422115221162211722118221192212022121221222212322124221252212622127221282212922130221312213222133221342213522136221372213822139221402214122142221432214422145221462214722148221492215022151221522215322154221552215622157221582215922160221612216222163221642216522166221672216822169221702217122172221732217422175221762217722178221792218022181221822218322184221852218622187221882218922190221912219222193221942219522196221972219822199222002220122202222032220422205222062220722208222092221022211222122221322214222152221622217222182221922220222212222222223222242222522226222272222822229222302223122232222332223422235222362223722238222392224022241222422224322244222452224622247222482224922250222512225222253222542225522256222572225822259222602226122262222632226422265222662226722268222692227022271222722227322274222752227622277222782227922280222812228222283222842228522286222872228822289222902229122292222932229422295222962229722298222992230022301223022230322304223052230622307223082230922310223112231222313223142231522316223172231822319223202232122322223232232422325223262232722328223292233022331223322233322334223352233622337223382233922340223412234222343223442234522346223472234822349223502235122352223532235422355223562235722358223592236022361223622236322364223652236622367223682236922370223712237222373223742237522376223772237822379223802238122382223832238422385223862238722388223892239022391223922239322394223952239622397223982239922400224012240222403224042240522406224072240822409224102241122412224132241422415224162241722418224192242022421224222242322424224252242622427224282242922430224312243222433224342243522436224372243822439224402244122442224432244422445224462244722448224492245022451224522245322454224552245622457224582245922460224612246222463224642246522466224672246822469224702247122472224732247422475224762247722478224792248022481224822248322484224852248622487224882248922490224912249222493224942249522496224972249822499225002250122502225032250422505225062250722508225092251022511225122251322514225152251622517225182251922520225212252222523225242252522526225272252822529225302253122532225332253422535225362253722538225392254022541225422254322544225452254622547225482254922550225512255222553225542255522556225572255822559225602256122562225632256422565225662256722568225692257022571225722257322574225752257622577225782257922580225812258222583225842258522586225872258822589225902259122592225932259422595225962259722598225992260022601226022260322604226052260622607226082260922610226112261222613226142261522616226172261822619226202262122622226232262422625226262262722628226292263022631226322263322634226352263622637226382263922640226412264222643226442264522646226472264822649226502265122652226532265422655226562265722658226592266022661226622266322664226652266622667226682266922670226712267222673226742267522676226772267822679226802268122682226832268422685226862268722688226892269022691226922269322694226952269622697226982269922700227012270222703227042270522706227072270822709227102271122712227132271422715227162271722718227192272022721227222272322724227252272622727227282272922730227312273222733227342273522736227372273822739227402274122742227432274422745227462274722748227492275022751227522275322754227552275622757227582275922760227612276222763227642276522766227672276822769227702277122772227732277422775227762277722778227792278022781227822278322784227852278622787227882278922790227912279222793227942279522796227972279822799228002280122802228032280422805228062280722808228092281022811228122281322814228152281622817228182281922820228212282222823228242282522826228272282822829228302283122832228332283422835228362283722838228392284022841228422284322844228452284622847228482284922850228512285222853228542285522856228572285822859228602286122862228632286422865228662286722868228692287022871228722287322874228752287622877228782287922880228812288222883228842288522886228872288822889228902289122892228932289422895228962289722898228992290022901229022290322904229052290622907229082290922910229112291222913229142291522916229172291822919229202292122922229232292422925229262292722928229292293022931229322293322934229352293622937229382293922940229412294222943229442294522946229472294822949229502295122952229532295422955229562295722958229592296022961229622296322964229652296622967229682296922970229712297222973229742297522976229772297822979229802298122982229832298422985229862298722988229892299022991229922299322994229952299622997229982299923000230012300223003230042300523006230072300823009230102301123012230132301423015230162301723018230192302023021230222302323024230252302623027230282302923030230312303223033230342303523036230372303823039230402304123042230432304423045230462304723048230492305023051230522305323054230552305623057230582305923060230612306223063230642306523066230672306823069230702307123072230732307423075230762307723078230792308023081230822308323084230852308623087230882308923090230912309223093230942309523096230972309823099231002310123102231032310423105231062310723108231092311023111231122311323114231152311623117231182311923120231212312223123231242312523126231272312823129231302313123132231332313423135231362313723138231392314023141231422314323144231452314623147231482314923150231512315223153231542315523156231572315823159231602316123162231632316423165231662316723168231692317023171231722317323174231752317623177231782317923180231812318223183231842318523186231872318823189231902319123192231932319423195231962319723198231992320023201232022320323204232052320623207232082320923210232112321223213232142321523216232172321823219232202322123222232232322423225232262322723228232292323023231232322323323234232352323623237232382323923240232412324223243232442324523246232472324823249232502325123252232532325423255232562325723258232592326023261232622326323264232652326623267232682326923270232712327223273232742327523276232772327823279232802328123282232832328423285232862328723288232892329023291232922329323294232952329623297232982329923300233012330223303233042330523306233072330823309233102331123312233132331423315233162331723318233192332023321233222332323324233252332623327233282332923330233312333223333233342333523336233372333823339233402334123342233432334423345233462334723348233492335023351233522335323354233552335623357233582335923360233612336223363233642336523366233672336823369233702337123372233732337423375233762337723378233792338023381233822338323384233852338623387233882338923390233912339223393233942339523396233972339823399234002340123402234032340423405234062340723408234092341023411234122341323414234152341623417234182341923420234212342223423234242342523426234272342823429234302343123432234332343423435234362343723438234392344023441234422344323444234452344623447234482344923450234512345223453234542345523456234572345823459234602346123462234632346423465234662346723468234692347023471234722347323474234752347623477234782347923480234812348223483234842348523486234872348823489234902349123492234932349423495234962349723498234992350023501235022350323504235052350623507235082350923510235112351223513235142351523516235172351823519235202352123522235232352423525235262352723528235292353023531235322353323534235352353623537235382353923540235412354223543235442354523546235472354823549235502355123552235532355423555235562355723558235592356023561235622356323564235652356623567235682356923570235712357223573235742357523576235772357823579235802358123582235832358423585235862358723588235892359023591235922359323594235952359623597235982359923600236012360223603236042360523606236072360823609236102361123612236132361423615236162361723618236192362023621236222362323624236252362623627236282362923630236312363223633236342363523636236372363823639236402364123642236432364423645236462364723648236492365023651236522365323654236552365623657236582365923660236612366223663236642366523666236672366823669236702367123672236732367423675236762367723678236792368023681236822368323684236852368623687236882368923690236912369223693236942369523696236972369823699237002370123702237032370423705237062370723708237092371023711237122371323714237152371623717237182371923720237212372223723237242372523726237272372823729237302373123732237332373423735237362373723738237392374023741237422374323744237452374623747237482374923750237512375223753237542375523756237572375823759237602376123762237632376423765237662376723768237692377023771237722377323774237752377623777237782377923780237812378223783237842378523786237872378823789237902379123792237932379423795237962379723798237992380023801238022380323804238052380623807238082380923810238112381223813238142381523816238172381823819238202382123822238232382423825238262382723828238292383023831238322383323834238352383623837238382383923840238412384223843238442384523846238472384823849238502385123852238532385423855238562385723858238592386023861238622386323864238652386623867238682386923870238712387223873238742387523876238772387823879238802388123882238832388423885238862388723888238892389023891238922389323894238952389623897238982389923900239012390223903239042390523906239072390823909239102391123912239132391423915239162391723918239192392023921239222392323924239252392623927239282392923930239312393223933239342393523936239372393823939239402394123942239432394423945239462394723948239492395023951239522395323954239552395623957239582395923960239612396223963239642396523966239672396823969239702397123972239732397423975239762397723978239792398023981239822398323984239852398623987239882398923990239912399223993239942399523996239972399823999240002400124002240032400424005240062400724008240092401024011240122401324014240152401624017240182401924020240212402224023240242402524026240272402824029240302403124032240332403424035240362403724038240392404024041240422404324044240452404624047240482404924050240512405224053240542405524056240572405824059240602406124062240632406424065240662406724068240692407024071240722407324074240752407624077240782407924080240812408224083240842408524086240872408824089240902409124092240932409424095240962409724098240992410024101241022410324104241052410624107241082410924110241112411224113241142411524116241172411824119241202412124122241232412424125241262412724128241292413024131241322413324134241352413624137241382413924140241412414224143241442414524146241472414824149241502415124152241532415424155241562415724158241592416024161241622416324164241652416624167241682416924170241712417224173241742417524176241772417824179241802418124182241832418424185241862418724188241892419024191241922419324194241952419624197241982419924200242012420224203242042420524206242072420824209242102421124212242132421424215242162421724218242192422024221242222422324224242252422624227242282422924230242312423224233242342423524236242372423824239242402424124242242432424424245242462424724248242492425024251242522425324254242552425624257242582425924260242612426224263242642426524266242672426824269242702427124272242732427424275242762427724278242792428024281242822428324284242852428624287242882428924290242912429224293242942429524296242972429824299243002430124302243032430424305243062430724308243092431024311243122431324314243152431624317243182431924320243212432224323243242432524326243272432824329243302433124332243332433424335243362433724338243392434024341243422434324344243452434624347243482434924350243512435224353243542435524356243572435824359243602436124362243632436424365243662436724368243692437024371243722437324374243752437624377243782437924380243812438224383243842438524386243872438824389243902439124392243932439424395243962439724398243992440024401244022440324404244052440624407244082440924410244112441224413244142441524416244172441824419244202442124422244232442424425244262442724428244292443024431244322443324434244352443624437244382443924440244412444224443244442444524446244472444824449244502445124452244532445424455244562445724458244592446024461244622446324464244652446624467244682446924470244712447224473244742447524476244772447824479244802448124482244832448424485244862448724488244892449024491244922449324494244952449624497244982449924500245012450224503245042450524506245072450824509245102451124512245132451424515245162451724518245192452024521245222452324524245252452624527245282452924530245312453224533245342453524536245372453824539245402454124542245432454424545245462454724548245492455024551245522455324554245552455624557245582455924560245612456224563245642456524566245672456824569245702457124572245732457424575245762457724578245792458024581245822458324584245852458624587245882458924590245912459224593245942459524596245972459824599246002460124602246032460424605246062460724608246092461024611246122461324614246152461624617246182461924620246212462224623246242462524626246272462824629246302463124632246332463424635246362463724638246392464024641246422464324644246452464624647246482464924650246512465224653246542465524656246572465824659246602466124662246632466424665246662466724668246692467024671246722467324674246752467624677246782467924680246812468224683246842468524686246872468824689246902469124692246932469424695246962469724698246992470024701247022470324704247052470624707247082470924710247112471224713247142471524716247172471824719247202472124722247232472424725247262472724728247292473024731247322473324734247352473624737247382473924740247412474224743247442474524746247472474824749247502475124752247532475424755247562475724758247592476024761247622476324764247652476624767247682476924770247712477224773247742477524776247772477824779247802478124782247832478424785247862478724788247892479024791247922479324794247952479624797247982479924800248012480224803248042480524806248072480824809248102481124812248132481424815248162481724818248192482024821248222482324824248252482624827248282482924830248312483224833248342483524836248372483824839248402484124842248432484424845248462484724848248492485024851248522485324854248552485624857248582485924860248612486224863248642486524866248672486824869248702487124872248732487424875248762487724878248792488024881248822488324884248852488624887248882488924890248912489224893248942489524896248972489824899249002490124902249032490424905249062490724908249092491024911249122491324914249152491624917249182491924920249212492224923249242492524926249272492824929249302493124932249332493424935249362493724938249392494024941249422494324944249452494624947249482494924950249512495224953249542495524956249572495824959249602496124962249632496424965249662496724968249692497024971249722497324974249752497624977249782497924980249812498224983249842498524986249872498824989249902499124992249932499424995249962499724998249992500025001250022500325004250052500625007250082500925010250112501225013250142501525016250172501825019250202502125022250232502425025250262502725028250292503025031250322503325034250352503625037250382503925040250412504225043250442504525046250472504825049250502505125052250532505425055250562505725058250592506025061250622506325064250652506625067250682506925070250712507225073250742507525076250772507825079250802508125082250832508425085250862508725088250892509025091250922509325094250952509625097250982509925100251012510225103251042510525106251072510825109251102511125112251132511425115251162511725118251192512025121251222512325124251252512625127251282512925130251312513225133251342513525136251372513825139251402514125142251432514425145251462514725148251492515025151251522515325154251552515625157251582515925160251612516225163251642516525166251672516825169251702517125172251732517425175251762517725178251792518025181251822518325184251852518625187251882518925190251912519225193251942519525196251972519825199252002520125202252032520425205252062520725208252092521025211252122521325214252152521625217252182521925220252212522225223252242522525226252272522825229252302523125232252332523425235252362523725238252392524025241252422524325244252452524625247252482524925250252512525225253252542525525256252572525825259252602526125262252632526425265252662526725268252692527025271252722527325274252752527625277252782527925280252812528225283252842528525286252872528825289252902529125292252932529425295252962529725298252992530025301253022530325304253052530625307253082530925310253112531225313253142531525316253172531825319253202532125322253232532425325253262532725328253292533025331253322533325334253352533625337253382533925340253412534225343253442534525346253472534825349253502535125352253532535425355253562535725358253592536025361253622536325364253652536625367253682536925370253712537225373253742537525376253772537825379253802538125382253832538425385253862538725388253892539025391253922539325394253952539625397253982539925400254012540225403254042540525406254072540825409254102541125412254132541425415254162541725418254192542025421254222542325424254252542625427254282542925430254312543225433254342543525436254372543825439254402544125442254432544425445254462544725448254492545025451254522545325454254552545625457254582545925460254612546225463254642546525466254672546825469254702547125472254732547425475254762547725478254792548025481254822548325484254852548625487254882548925490254912549225493254942549525496254972549825499255002550125502255032550425505255062550725508255092551025511255122551325514255152551625517255182551925520255212552225523255242552525526255272552825529255302553125532255332553425535255362553725538255392554025541255422554325544255452554625547255482554925550255512555225553255542555525556255572555825559255602556125562255632556425565255662556725568255692557025571255722557325574255752557625577255782557925580255812558225583255842558525586255872558825589255902559125592255932559425595255962559725598255992560025601256022560325604256052560625607256082560925610256112561225613256142561525616256172561825619256202562125622256232562425625256262562725628256292563025631256322563325634256352563625637256382563925640256412564225643256442564525646256472564825649256502565125652256532565425655256562565725658256592566025661256622566325664256652566625667256682566925670256712567225673256742567525676256772567825679256802568125682256832568425685256862568725688256892569025691256922569325694256952569625697256982569925700257012570225703257042570525706257072570825709257102571125712257132571425715257162571725718257192572025721257222572325724257252572625727257282572925730257312573225733257342573525736257372573825739257402574125742257432574425745257462574725748257492575025751257522575325754257552575625757257582575925760257612576225763257642576525766257672576825769257702577125772257732577425775257762577725778257792578025781257822578325784257852578625787257882578925790257912579225793257942579525796257972579825799258002580125802258032580425805258062580725808258092581025811258122581325814258152581625817258182581925820258212582225823258242582525826258272582825829258302583125832258332583425835258362583725838258392584025841258422584325844258452584625847258482584925850258512585225853258542585525856258572585825859258602586125862258632586425865258662586725868258692587025871258722587325874258752587625877258782587925880258812588225883258842588525886258872588825889258902589125892258932589425895258962589725898258992590025901259022590325904259052590625907259082590925910259112591225913259142591525916259172591825919259202592125922259232592425925259262592725928259292593025931259322593325934259352593625937259382593925940259412594225943259442594525946259472594825949259502595125952259532595425955259562595725958259592596025961259622596325964259652596625967259682596925970259712597225973259742597525976259772597825979259802598125982259832598425985259862598725988259892599025991259922599325994259952599625997259982599926000260012600226003260042600526006260072600826009260102601126012260132601426015260162601726018260192602026021260222602326024260252602626027260282602926030260312603226033260342603526036260372603826039260402604126042260432604426045260462604726048260492605026051260522605326054260552605626057260582605926060260612606226063260642606526066260672606826069260702607126072260732607426075260762607726078260792608026081260822608326084260852608626087260882608926090260912609226093260942609526096260972609826099261002610126102261032610426105261062610726108261092611026111261122611326114261152611626117261182611926120261212612226123261242612526126261272612826129261302613126132261332613426135261362613726138261392614026141261422614326144261452614626147261482614926150261512615226153261542615526156261572615826159261602616126162261632616426165261662616726168261692617026171261722617326174261752617626177261782617926180261812618226183261842618526186261872618826189261902619126192261932619426195261962619726198261992620026201262022620326204262052620626207262082620926210262112621226213262142621526216262172621826219262202622126222262232622426225262262622726228262292623026231262322623326234262352623626237262382623926240262412624226243262442624526246262472624826249262502625126252262532625426255262562625726258262592626026261262622626326264262652626626267262682626926270262712627226273262742627526276262772627826279262802628126282262832628426285262862628726288262892629026291262922629326294262952629626297262982629926300263012630226303263042630526306263072630826309263102631126312263132631426315263162631726318263192632026321263222632326324263252632626327263282632926330263312633226333263342633526336263372633826339263402634126342263432634426345263462634726348263492635026351263522635326354263552635626357263582635926360263612636226363263642636526366263672636826369263702637126372263732637426375263762637726378263792638026381263822638326384263852638626387263882638926390263912639226393263942639526396263972639826399264002640126402264032640426405264062640726408264092641026411264122641326414264152641626417264182641926420264212642226423264242642526426264272642826429264302643126432264332643426435264362643726438264392644026441264422644326444264452644626447264482644926450264512645226453264542645526456264572645826459264602646126462264632646426465264662646726468264692647026471264722647326474264752647626477264782647926480264812648226483264842648526486264872648826489264902649126492264932649426495264962649726498264992650026501265022650326504265052650626507265082650926510265112651226513265142651526516265172651826519265202652126522265232652426525265262652726528265292653026531265322653326534265352653626537265382653926540265412654226543265442654526546265472654826549265502655126552265532655426555265562655726558265592656026561265622656326564265652656626567265682656926570265712657226573265742657526576265772657826579265802658126582265832658426585265862658726588265892659026591265922659326594265952659626597265982659926600266012660226603266042660526606266072660826609266102661126612266132661426615266162661726618266192662026621266222662326624266252662626627266282662926630266312663226633266342663526636266372663826639266402664126642266432664426645266462664726648266492665026651266522665326654266552665626657266582665926660266612666226663266642666526666266672666826669266702667126672266732667426675266762667726678266792668026681266822668326684266852668626687266882668926690266912669226693266942669526696266972669826699267002670126702267032670426705267062670726708267092671026711267122671326714267152671626717267182671926720267212672226723267242672526726267272672826729267302673126732267332673426735267362673726738267392674026741267422674326744267452674626747267482674926750267512675226753267542675526756267572675826759267602676126762267632676426765267662676726768267692677026771267722677326774267752677626777267782677926780267812678226783267842678526786267872678826789267902679126792267932679426795267962679726798267992680026801268022680326804268052680626807268082680926810268112681226813268142681526816268172681826819268202682126822268232682426825268262682726828268292683026831268322683326834268352683626837268382683926840268412684226843268442684526846268472684826849268502685126852268532685426855268562685726858268592686026861268622686326864268652686626867268682686926870268712687226873268742687526876268772687826879268802688126882268832688426885268862688726888268892689026891268922689326894268952689626897268982689926900269012690226903269042690526906269072690826909269102691126912269132691426915269162691726918269192692026921269222692326924269252692626927269282692926930269312693226933269342693526936269372693826939269402694126942269432694426945269462694726948269492695026951269522695326954269552695626957269582695926960269612696226963269642696526966269672696826969269702697126972269732697426975269762697726978269792698026981269822698326984269852698626987269882698926990269912699226993269942699526996269972699826999270002700127002270032700427005270062700727008270092701027011270122701327014270152701627017270182701927020270212702227023270242702527026270272702827029270302703127032270332703427035270362703727038270392704027041270422704327044270452704627047270482704927050270512705227053270542705527056270572705827059270602706127062270632706427065270662706727068270692707027071270722707327074270752707627077270782707927080270812708227083270842708527086270872708827089270902709127092270932709427095270962709727098270992710027101271022710327104271052710627107271082710927110271112711227113271142711527116271172711827119271202712127122271232712427125271262712727128271292713027131271322713327134271352713627137271382713927140271412714227143271442714527146271472714827149271502715127152271532715427155271562715727158271592716027161271622716327164271652716627167271682716927170271712717227173271742717527176271772717827179271802718127182271832718427185271862718727188271892719027191271922719327194271952719627197271982719927200272012720227203272042720527206272072720827209272102721127212272132721427215272162721727218272192722027221272222722327224272252722627227272282722927230272312723227233272342723527236272372723827239272402724127242272432724427245272462724727248272492725027251272522725327254272552725627257272582725927260272612726227263272642726527266272672726827269272702727127272272732727427275272762727727278272792728027281272822728327284272852728627287272882728927290272912729227293272942729527296272972729827299273002730127302273032730427305273062730727308273092731027311273122731327314273152731627317273182731927320273212732227323273242732527326273272732827329273302733127332273332733427335273362733727338273392734027341273422734327344273452734627347273482734927350273512735227353273542735527356273572735827359273602736127362273632736427365273662736727368273692737027371273722737327374273752737627377273782737927380273812738227383273842738527386273872738827389273902739127392273932739427395273962739727398273992740027401274022740327404274052740627407274082740927410274112741227413274142741527416274172741827419274202742127422274232742427425274262742727428274292743027431274322743327434274352743627437274382743927440274412744227443274442744527446274472744827449274502745127452274532745427455274562745727458274592746027461274622746327464274652746627467274682746927470274712747227473274742747527476274772747827479274802748127482274832748427485274862748727488274892749027491274922749327494274952749627497274982749927500275012750227503275042750527506275072750827509275102751127512275132751427515275162751727518275192752027521275222752327524275252752627527275282752927530275312753227533275342753527536275372753827539275402754127542275432754427545275462754727548275492755027551275522755327554275552755627557275582755927560275612756227563275642756527566275672756827569275702757127572275732757427575275762757727578275792758027581275822758327584275852758627587275882758927590275912759227593275942759527596275972759827599276002760127602276032760427605276062760727608276092761027611276122761327614276152761627617276182761927620276212762227623276242762527626276272762827629276302763127632276332763427635276362763727638276392764027641276422764327644276452764627647276482764927650276512765227653276542765527656276572765827659276602766127662276632766427665276662766727668276692767027671276722767327674276752767627677276782767927680276812768227683276842768527686276872768827689276902769127692276932769427695276962769727698276992770027701277022770327704277052770627707277082770927710277112771227713277142771527716277172771827719277202772127722277232772427725277262772727728277292773027731277322773327734277352773627737277382773927740277412774227743277442774527746277472774827749277502775127752277532775427755277562775727758277592776027761277622776327764277652776627767277682776927770277712777227773277742777527776277772777827779277802778127782277832778427785277862778727788277892779027791277922779327794277952779627797277982779927800278012780227803278042780527806278072780827809278102781127812278132781427815278162781727818278192782027821278222782327824278252782627827278282782927830278312783227833278342783527836278372783827839278402784127842278432784427845278462784727848278492785027851278522785327854278552785627857278582785927860278612786227863278642786527866278672786827869278702787127872278732787427875278762787727878278792788027881278822788327884278852788627887278882788927890278912789227893278942789527896278972789827899279002790127902279032790427905279062790727908279092791027911279122791327914279152791627917279182791927920279212792227923279242792527926279272792827929279302793127932279332793427935279362793727938279392794027941279422794327944279452794627947279482794927950279512795227953279542795527956279572795827959279602796127962279632796427965279662796727968279692797027971279722797327974279752797627977279782797927980279812798227983279842798527986279872798827989279902799127992279932799427995279962799727998279992800028001280022800328004280052800628007280082800928010280112801228013280142801528016280172801828019280202802128022280232802428025280262802728028280292803028031280322803328034280352803628037280382803928040280412804228043280442804528046280472804828049280502805128052280532805428055280562805728058280592806028061280622806328064280652806628067280682806928070280712807228073280742807528076280772807828079280802808128082280832808428085280862808728088280892809028091280922809328094280952809628097280982809928100281012810228103281042810528106281072810828109281102811128112281132811428115281162811728118281192812028121281222812328124281252812628127281282812928130281312813228133281342813528136281372813828139281402814128142281432814428145281462814728148281492815028151281522815328154281552815628157281582815928160281612816228163281642816528166281672816828169281702817128172281732817428175281762817728178281792818028181281822818328184281852818628187281882818928190281912819228193281942819528196281972819828199282002820128202282032820428205282062820728208282092821028211282122821328214282152821628217282182821928220282212822228223282242822528226282272822828229282302823128232282332823428235282362823728238282392824028241282422824328244282452824628247282482824928250282512825228253282542825528256282572825828259282602826128262282632826428265282662826728268282692827028271282722827328274282752827628277282782827928280282812828228283282842828528286282872828828289282902829128292282932829428295282962829728298282992830028301283022830328304283052830628307283082830928310283112831228313283142831528316283172831828319283202832128322283232832428325283262832728328283292833028331283322833328334283352833628337283382833928340283412834228343283442834528346283472834828349283502835128352283532835428355283562835728358283592836028361283622836328364283652836628367283682836928370283712837228373283742837528376283772837828379283802838128382283832838428385283862838728388283892839028391283922839328394283952839628397283982839928400284012840228403284042840528406284072840828409284102841128412284132841428415284162841728418284192842028421284222842328424284252842628427284282842928430284312843228433284342843528436284372843828439284402844128442284432844428445284462844728448284492845028451284522845328454284552845628457284582845928460284612846228463284642846528466284672846828469284702847128472284732847428475284762847728478284792848028481284822848328484284852848628487284882848928490284912849228493284942849528496284972849828499285002850128502285032850428505285062850728508285092851028511285122851328514285152851628517285182851928520285212852228523285242852528526285272852828529285302853128532285332853428535285362853728538285392854028541285422854328544285452854628547285482854928550285512855228553285542855528556285572855828559285602856128562285632856428565285662856728568285692857028571285722857328574285752857628577285782857928580285812858228583285842858528586285872858828589285902859128592285932859428595285962859728598285992860028601286022860328604286052860628607286082860928610286112861228613286142861528616286172861828619286202862128622286232862428625286262862728628286292863028631286322863328634286352863628637286382863928640286412864228643286442864528646286472864828649286502865128652286532865428655286562865728658286592866028661286622866328664286652866628667286682866928670286712867228673286742867528676286772867828679286802868128682286832868428685286862868728688286892869028691286922869328694286952869628697286982869928700287012870228703287042870528706287072870828709287102871128712287132871428715287162871728718287192872028721287222872328724287252872628727287282872928730287312873228733287342873528736287372873828739287402874128742287432874428745287462874728748287492875028751287522875328754287552875628757287582875928760287612876228763287642876528766287672876828769287702877128772287732877428775287762877728778287792878028781287822878328784287852878628787287882878928790287912879228793287942879528796287972879828799288002880128802288032880428805288062880728808288092881028811288122881328814288152881628817288182881928820288212882228823288242882528826288272882828829288302883128832288332883428835288362883728838288392884028841288422884328844288452884628847288482884928850288512885228853288542885528856288572885828859288602886128862288632886428865288662886728868288692887028871288722887328874288752887628877288782887928880288812888228883288842888528886288872888828889288902889128892288932889428895288962889728898288992890028901289022890328904289052890628907289082890928910289112891228913289142891528916289172891828919289202892128922289232892428925289262892728928289292893028931289322893328934289352893628937289382893928940289412894228943289442894528946289472894828949289502895128952289532895428955289562895728958289592896028961289622896328964289652896628967289682896928970289712897228973289742897528976289772897828979289802898128982289832898428985289862898728988289892899028991289922899328994289952899628997289982899929000290012900229003290042900529006290072900829009290102901129012290132901429015290162901729018290192902029021290222902329024290252902629027290282902929030290312903229033290342903529036290372903829039290402904129042290432904429045290462904729048290492905029051290522905329054290552905629057290582905929060290612906229063290642906529066290672906829069290702907129072290732907429075290762907729078290792908029081290822908329084290852908629087290882908929090290912909229093290942909529096290972909829099291002910129102291032910429105291062910729108291092911029111291122911329114291152911629117291182911929120291212912229123291242912529126291272912829129291302913129132291332913429135291362913729138291392914029141291422914329144291452914629147291482914929150291512915229153291542915529156291572915829159291602916129162291632916429165291662916729168291692917029171291722917329174291752917629177291782917929180291812918229183291842918529186291872918829189291902919129192291932919429195291962919729198291992920029201292022920329204292052920629207292082920929210292112921229213292142921529216292172921829219292202922129222292232922429225292262922729228292292923029231292322923329234292352923629237292382923929240292412924229243292442924529246292472924829249292502925129252292532925429255292562925729258292592926029261292622926329264292652926629267292682926929270292712927229273292742927529276292772927829279292802928129282292832928429285292862928729288292892929029291292922929329294292952929629297292982929929300293012930229303293042930529306293072930829309293102931129312293132931429315293162931729318293192932029321293222932329324293252932629327293282932929330293312933229333293342933529336293372933829339293402934129342293432934429345293462934729348293492935029351293522935329354293552935629357293582935929360293612936229363293642936529366293672936829369293702937129372293732937429375293762937729378293792938029381293822938329384293852938629387293882938929390293912939229393293942939529396293972939829399294002940129402294032940429405294062940729408294092941029411294122941329414294152941629417294182941929420294212942229423294242942529426294272942829429294302943129432294332943429435294362943729438294392944029441294422944329444294452944629447294482944929450294512945229453294542945529456294572945829459294602946129462294632946429465294662946729468294692947029471294722947329474294752947629477294782947929480294812948229483294842948529486294872948829489294902949129492294932949429495294962949729498294992950029501295022950329504295052950629507295082950929510295112951229513295142951529516295172951829519295202952129522295232952429525295262952729528295292953029531295322953329534295352953629537295382953929540295412954229543295442954529546295472954829549295502955129552295532955429555295562955729558295592956029561295622956329564295652956629567295682956929570295712957229573295742957529576295772957829579295802958129582295832958429585295862958729588295892959029591295922959329594295952959629597295982959929600296012960229603296042960529606296072960829609296102961129612296132961429615296162961729618296192962029621296222962329624296252962629627296282962929630296312963229633296342963529636296372963829639296402964129642296432964429645296462964729648296492965029651296522965329654296552965629657296582965929660296612966229663296642966529666296672966829669296702967129672296732967429675296762967729678296792968029681296822968329684296852968629687296882968929690296912969229693296942969529696296972969829699297002970129702297032970429705297062970729708297092971029711297122971329714297152971629717297182971929720297212972229723297242972529726297272972829729297302973129732297332973429735297362973729738297392974029741297422974329744297452974629747297482974929750297512975229753297542975529756297572975829759297602976129762297632976429765297662976729768297692977029771297722977329774297752977629777297782977929780297812978229783297842978529786297872978829789297902979129792297932979429795297962979729798297992980029801298022980329804298052980629807298082980929810298112981229813298142981529816298172981829819298202982129822298232982429825298262982729828298292983029831298322983329834298352983629837298382983929840298412984229843298442984529846298472984829849298502985129852298532985429855298562985729858298592986029861298622986329864298652986629867298682986929870298712987229873298742987529876298772987829879298802988129882298832988429885298862988729888298892989029891298922989329894298952989629897298982989929900299012990229903299042990529906299072990829909299102991129912299132991429915299162991729918299192992029921299222992329924299252992629927299282992929930299312993229933299342993529936299372993829939299402994129942299432994429945299462994729948299492995029951299522995329954299552995629957299582995929960299612996229963299642996529966299672996829969299702997129972299732997429975299762997729978299792998029981299822998329984299852998629987299882998929990299912999229993299942999529996299972999829999300003000130002300033000430005300063000730008300093001030011300123001330014300153001630017300183001930020300213002230023300243002530026300273002830029300303003130032300333003430035300363003730038300393004030041300423004330044300453004630047300483004930050300513005230053300543005530056300573005830059300603006130062300633006430065300663006730068300693007030071300723007330074300753007630077300783007930080300813008230083300843008530086300873008830089300903009130092300933009430095300963009730098300993010030101301023010330104301053010630107301083010930110301113011230113301143011530116301173011830119301203012130122301233012430125301263012730128301293013030131301323013330134301353013630137301383013930140301413014230143301443014530146301473014830149301503015130152301533015430155301563015730158301593016030161301623016330164301653016630167301683016930170301713017230173301743017530176301773017830179301803018130182301833018430185301863018730188301893019030191301923019330194301953019630197301983019930200302013020230203302043020530206302073020830209302103021130212302133021430215302163021730218302193022030221302223022330224302253022630227302283022930230302313023230233302343023530236302373023830239302403024130242302433024430245302463024730248302493025030251302523025330254302553025630257302583025930260302613026230263302643026530266302673026830269302703027130272302733027430275302763027730278302793028030281302823028330284302853028630287302883028930290302913029230293302943029530296302973029830299303003030130302303033030430305303063030730308303093031030311303123031330314303153031630317303183031930320303213032230323303243032530326303273032830329303303033130332303333033430335303363033730338303393034030341303423034330344303453034630347303483034930350303513035230353303543035530356303573035830359303603036130362303633036430365303663036730368303693037030371303723037330374303753037630377303783037930380303813038230383303843038530386303873038830389303903039130392303933039430395303963039730398303993040030401304023040330404304053040630407304083040930410304113041230413304143041530416304173041830419304203042130422304233042430425304263042730428304293043030431304323043330434304353043630437304383043930440304413044230443304443044530446304473044830449304503045130452304533045430455304563045730458304593046030461304623046330464304653046630467304683046930470304713047230473304743047530476304773047830479304803048130482304833048430485304863048730488304893049030491304923049330494304953049630497304983049930500305013050230503305043050530506305073050830509305103051130512305133051430515305163051730518305193052030521305223052330524305253052630527305283052930530305313053230533305343053530536305373053830539305403054130542305433054430545305463054730548305493055030551305523055330554305553055630557305583055930560305613056230563305643056530566305673056830569305703057130572305733057430575305763057730578305793058030581305823058330584305853058630587305883058930590305913059230593305943059530596305973059830599306003060130602306033060430605306063060730608306093061030611306123061330614306153061630617306183061930620306213062230623306243062530626306273062830629306303063130632306333063430635306363063730638306393064030641306423064330644306453064630647306483064930650306513065230653306543065530656306573065830659306603066130662306633066430665306663066730668306693067030671306723067330674306753067630677306783067930680306813068230683306843068530686306873068830689306903069130692306933069430695306963069730698306993070030701307023070330704307053070630707307083070930710307113071230713307143071530716307173071830719307203072130722307233072430725307263072730728307293073030731307323073330734307353073630737307383073930740307413074230743307443074530746307473074830749307503075130752307533075430755307563075730758307593076030761307623076330764307653076630767307683076930770307713077230773307743077530776307773077830779307803078130782307833078430785307863078730788307893079030791307923079330794307953079630797307983079930800308013080230803308043080530806308073080830809308103081130812308133081430815308163081730818308193082030821308223082330824308253082630827308283082930830308313083230833308343083530836308373083830839308403084130842308433084430845308463084730848308493085030851308523085330854308553085630857308583085930860308613086230863308643086530866308673086830869308703087130872308733087430875308763087730878308793088030881308823088330884308853088630887308883088930890308913089230893308943089530896308973089830899309003090130902309033090430905309063090730908309093091030911309123091330914309153091630917309183091930920309213092230923309243092530926309273092830929309303093130932309333093430935309363093730938309393094030941309423094330944309453094630947309483094930950309513095230953309543095530956309573095830959309603096130962309633096430965309663096730968309693097030971309723097330974309753097630977309783097930980309813098230983309843098530986309873098830989309903099130992309933099430995309963099730998309993100031001310023100331004310053100631007310083100931010310113101231013310143101531016310173101831019310203102131022310233102431025310263102731028310293103031031310323103331034310353103631037310383103931040310413104231043310443104531046310473104831049310503105131052310533105431055310563105731058310593106031061310623106331064310653106631067310683106931070310713107231073310743107531076310773107831079310803108131082310833108431085310863108731088310893109031091310923109331094310953109631097310983109931100311013110231103311043110531106311073110831109311103111131112311133111431115311163111731118311193112031121311223112331124311253112631127311283112931130311313113231133311343113531136311373113831139311403114131142311433114431145311463114731148311493115031151311523115331154311553115631157311583115931160311613116231163311643116531166311673116831169311703117131172311733117431175311763117731178311793118031181311823118331184311853118631187311883118931190311913119231193311943119531196311973119831199312003120131202312033120431205312063120731208312093121031211312123121331214312153121631217312183121931220312213122231223312243122531226312273122831229312303123131232312333123431235312363123731238312393124031241312423124331244312453124631247312483124931250312513125231253312543125531256312573125831259312603126131262312633126431265312663126731268312693127031271312723127331274312753127631277312783127931280312813128231283312843128531286312873128831289312903129131292312933129431295312963129731298312993130031301313023130331304313053130631307313083130931310313113131231313313143131531316313173131831319313203132131322313233132431325313263132731328313293133031331313323133331334313353133631337313383133931340313413134231343313443134531346313473134831349313503135131352313533135431355313563135731358313593136031361313623136331364313653136631367313683136931370313713137231373313743137531376313773137831379313803138131382313833138431385313863138731388313893139031391313923139331394313953139631397313983139931400314013140231403314043140531406314073140831409314103141131412314133141431415314163141731418314193142031421314223142331424314253142631427314283142931430314313143231433314343143531436314373143831439314403144131442314433144431445314463144731448314493145031451314523145331454314553145631457314583145931460314613146231463314643146531466314673146831469314703147131472314733147431475314763147731478314793148031481314823148331484314853148631487314883148931490314913149231493314943149531496314973149831499315003150131502315033150431505315063150731508315093151031511315123151331514315153151631517315183151931520315213152231523315243152531526315273152831529315303153131532315333153431535315363153731538315393154031541315423154331544315453154631547315483154931550315513155231553315543155531556315573155831559315603156131562315633156431565315663156731568315693157031571315723157331574315753157631577315783157931580315813158231583315843158531586315873158831589315903159131592315933159431595315963159731598315993160031601316023160331604316053160631607316083160931610316113161231613316143161531616316173161831619316203162131622316233162431625316263162731628316293163031631316323163331634316353163631637316383163931640316413164231643316443164531646316473164831649316503165131652316533165431655316563165731658316593166031661316623166331664316653166631667316683166931670316713167231673316743167531676316773167831679316803168131682316833168431685316863168731688316893169031691316923169331694316953169631697316983169931700317013170231703317043170531706317073170831709317103171131712317133171431715317163171731718317193172031721317223172331724317253172631727317283172931730317313173231733317343173531736317373173831739317403174131742317433174431745317463174731748317493175031751317523175331754317553175631757317583175931760317613176231763317643176531766317673176831769317703177131772317733177431775317763177731778317793178031781317823178331784317853178631787317883178931790317913179231793317943179531796317973179831799318003180131802318033180431805318063180731808318093181031811318123181331814318153181631817318183181931820318213182231823318243182531826318273182831829318303183131832318333183431835318363183731838318393184031841318423184331844318453184631847318483184931850318513185231853318543185531856318573185831859318603186131862318633186431865318663186731868318693187031871318723187331874318753187631877318783187931880318813188231883318843188531886318873188831889318903189131892318933189431895318963189731898318993190031901319023190331904319053190631907319083190931910319113191231913319143191531916319173191831919319203192131922319233192431925319263192731928319293193031931319323193331934319353193631937319383193931940319413194231943319443194531946319473194831949319503195131952319533195431955319563195731958319593196031961319623196331964319653196631967319683196931970319713197231973319743197531976319773197831979319803198131982319833198431985319863198731988319893199031991319923199331994319953199631997319983199932000320013200232003320043200532006320073200832009320103201132012320133201432015320163201732018320193202032021320223202332024320253202632027320283202932030320313203232033320343203532036320373203832039320403204132042320433204432045320463204732048320493205032051320523205332054320553205632057320583205932060320613206232063320643206532066320673206832069320703207132072320733207432075320763207732078320793208032081320823208332084320853208632087320883208932090320913209232093320943209532096320973209832099321003210132102321033210432105321063210732108321093211032111321123211332114321153211632117321183211932120321213212232123321243212532126321273212832129321303213132132321333213432135321363213732138321393214032141321423214332144321453214632147321483214932150321513215232153321543215532156321573215832159321603216132162321633216432165321663216732168321693217032171321723217332174321753217632177321783217932180321813218232183321843218532186321873218832189321903219132192321933219432195321963219732198321993220032201322023220332204322053220632207322083220932210322113221232213322143221532216322173221832219322203222132222322233222432225322263222732228322293223032231322323223332234322353223632237322383223932240322413224232243322443224532246322473224832249322503225132252322533225432255322563225732258322593226032261322623226332264322653226632267322683226932270322713227232273322743227532276322773227832279322803228132282322833228432285322863228732288322893229032291322923229332294322953229632297322983229932300323013230232303323043230532306323073230832309323103231132312323133231432315323163231732318323193232032321323223232332324323253232632327323283232932330323313233232333323343233532336323373233832339323403234132342323433234432345323463234732348323493235032351323523235332354323553235632357323583235932360323613236232363323643236532366323673236832369323703237132372323733237432375323763237732378323793238032381323823238332384323853238632387323883238932390323913239232393323943239532396323973239832399324003240132402324033240432405324063240732408324093241032411324123241332414324153241632417324183241932420324213242232423324243242532426324273242832429324303243132432324333243432435324363243732438324393244032441324423244332444324453244632447324483244932450324513245232453324543245532456324573245832459324603246132462324633246432465324663246732468324693247032471324723247332474324753247632477324783247932480324813248232483324843248532486324873248832489324903249132492324933249432495324963249732498324993250032501325023250332504325053250632507325083250932510325113251232513325143251532516325173251832519325203252132522325233252432525325263252732528325293253032531325323253332534325353253632537325383253932540325413254232543325443254532546325473254832549325503255132552325533255432555325563255732558325593256032561325623256332564325653256632567325683256932570325713257232573325743257532576325773257832579325803258132582325833258432585325863258732588325893259032591325923259332594325953259632597325983259932600326013260232603326043260532606326073260832609326103261132612326133261432615326163261732618326193262032621326223262332624326253262632627326283262932630326313263232633326343263532636326373263832639326403264132642326433264432645326463264732648326493265032651326523265332654326553265632657326583265932660326613266232663326643266532666326673266832669326703267132672326733267432675326763267732678326793268032681326823268332684326853268632687326883268932690326913269232693326943269532696326973269832699327003270132702327033270432705327063270732708327093271032711327123271332714327153271632717327183271932720327213272232723327243272532726327273272832729327303273132732327333273432735327363273732738327393274032741327423274332744327453274632747327483274932750327513275232753327543275532756327573275832759327603276132762327633276432765327663276732768327693277032771327723277332774327753277632777327783277932780327813278232783327843278532786327873278832789327903279132792327933279432795327963279732798327993280032801328023280332804328053280632807328083280932810328113281232813328143281532816328173281832819328203282132822328233282432825328263282732828328293283032831328323283332834328353283632837328383283932840328413284232843328443284532846328473284832849328503285132852328533285432855328563285732858328593286032861328623286332864328653286632867328683286932870328713287232873328743287532876328773287832879328803288132882328833288432885328863288732888328893289032891328923289332894328953289632897328983289932900329013290232903329043290532906329073290832909329103291132912329133291432915329163291732918329193292032921329223292332924329253292632927329283292932930329313293232933329343293532936329373293832939329403294132942329433294432945329463294732948329493295032951329523295332954329553295632957329583295932960329613296232963329643296532966329673296832969329703297132972329733297432975329763297732978329793298032981329823298332984329853298632987329883298932990329913299232993329943299532996329973299832999330003300133002330033300433005330063300733008330093301033011330123301333014330153301633017330183301933020330213302233023330243302533026330273302833029330303303133032330333303433035330363303733038330393304033041330423304333044330453304633047330483304933050330513305233053330543305533056330573305833059330603306133062330633306433065330663306733068330693307033071330723307333074330753307633077330783307933080330813308233083330843308533086330873308833089330903309133092330933309433095330963309733098330993310033101331023310333104331053310633107331083310933110331113311233113331143311533116331173311833119331203312133122331233312433125331263312733128331293313033131331323313333134331353313633137331383313933140331413314233143331443314533146331473314833149331503315133152331533315433155331563315733158331593316033161331623316333164331653316633167331683316933170331713317233173331743317533176331773317833179331803318133182331833318433185331863318733188331893319033191331923319333194331953319633197331983319933200332013320233203332043320533206332073320833209332103321133212332133321433215332163321733218332193322033221332223322333224332253322633227332283322933230332313323233233332343323533236332373323833239332403324133242332433324433245332463324733248332493325033251332523325333254332553325633257332583325933260332613326233263332643326533266332673326833269332703327133272332733327433275332763327733278332793328033281332823328333284332853328633287332883328933290332913329233293332943329533296332973329833299333003330133302333033330433305333063330733308333093331033311333123331333314333153331633317333183331933320333213332233323333243332533326333273332833329333303333133332333333333433335333363333733338333393334033341333423334333344333453334633347333483334933350333513335233353333543335533356333573335833359333603336133362333633336433365333663336733368333693337033371333723337333374333753337633377333783337933380333813338233383333843338533386333873338833389333903339133392333933339433395333963339733398333993340033401334023340333404334053340633407334083340933410334113341233413334143341533416334173341833419334203342133422334233342433425334263342733428334293343033431334323343333434334353343633437334383343933440334413344233443334443344533446334473344833449334503345133452334533345433455334563345733458334593346033461334623346333464334653346633467334683346933470334713347233473334743347533476334773347833479334803348133482334833348433485334863348733488334893349033491334923349333494334953349633497334983349933500335013350233503335043350533506335073350833509335103351133512335133351433515335163351733518335193352033521335223352333524335253352633527335283352933530335313353233533335343353533536335373353833539335403354133542335433354433545335463354733548335493355033551335523355333554335553355633557335583355933560335613356233563335643356533566335673356833569335703357133572335733357433575335763357733578335793358033581335823358333584335853358633587335883358933590335913359233593335943359533596335973359833599336003360133602336033360433605336063360733608336093361033611336123361333614336153361633617336183361933620336213362233623336243362533626336273362833629336303363133632336333363433635336363363733638336393364033641336423364333644336453364633647336483364933650336513365233653336543365533656336573365833659336603366133662336633366433665336663366733668336693367033671336723367333674336753367633677336783367933680336813368233683336843368533686336873368833689336903369133692336933369433695336963369733698336993370033701337023370333704337053370633707337083370933710337113371233713337143371533716337173371833719337203372133722337233372433725337263372733728337293373033731337323373333734337353373633737337383373933740337413374233743337443374533746337473374833749337503375133752337533375433755337563375733758337593376033761337623376333764337653376633767337683376933770337713377233773337743377533776337773377833779337803378133782337833378433785337863378733788337893379033791337923379333794337953379633797337983379933800338013380233803338043380533806338073380833809338103381133812338133381433815338163381733818338193382033821338223382333824338253382633827338283382933830338313383233833338343383533836338373383833839338403384133842338433384433845338463384733848338493385033851338523385333854338553385633857338583385933860338613386233863338643386533866338673386833869338703387133872338733387433875338763387733878338793388033881338823388333884338853388633887338883388933890338913389233893338943389533896338973389833899339003390133902339033390433905339063390733908339093391033911339123391333914339153391633917339183391933920339213392233923339243392533926339273392833929339303393133932339333393433935339363393733938339393394033941339423394333944339453394633947339483394933950339513395233953339543395533956339573395833959339603396133962339633396433965339663396733968339693397033971339723397333974339753397633977339783397933980339813398233983339843398533986339873398833989339903399133992339933399433995339963399733998339993400034001340023400334004340053400634007340083400934010340113401234013340143401534016340173401834019340203402134022340233402434025340263402734028340293403034031340323403334034340353403634037340383403934040340413404234043340443404534046340473404834049340503405134052340533405434055340563405734058340593406034061340623406334064340653406634067340683406934070340713407234073340743407534076340773407834079340803408134082340833408434085340863408734088340893409034091340923409334094340953409634097340983409934100341013410234103341043410534106341073410834109341103411134112341133411434115341163411734118341193412034121341223412334124341253412634127341283412934130341313413234133341343413534136341373413834139341403414134142341433414434145341463414734148341493415034151341523415334154341553415634157341583415934160341613416234163341643416534166341673416834169341703417134172341733417434175341763417734178341793418034181341823418334184341853418634187341883418934190341913419234193341943419534196341973419834199342003420134202342033420434205342063420734208342093421034211342123421334214342153421634217342183421934220342213422234223342243422534226342273422834229342303423134232342333423434235342363423734238342393424034241342423424334244342453424634247342483424934250342513425234253342543425534256342573425834259342603426134262342633426434265342663426734268342693427034271342723427334274342753427634277342783427934280342813428234283342843428534286342873428834289342903429134292342933429434295342963429734298342993430034301343023430334304343053430634307343083430934310343113431234313343143431534316343173431834319343203432134322343233432434325343263432734328343293433034331343323433334334343353433634337343383433934340343413434234343343443434534346343473434834349343503435134352343533435434355343563435734358343593436034361343623436334364343653436634367343683436934370343713437234373343743437534376343773437834379343803438134382343833438434385343863438734388343893439034391343923439334394343953439634397343983439934400344013440234403344043440534406344073440834409344103441134412344133441434415344163441734418344193442034421344223442334424344253442634427344283442934430344313443234433344343443534436344373443834439344403444134442344433444434445344463444734448344493445034451344523445334454344553445634457344583445934460344613446234463344643446534466344673446834469344703447134472344733447434475344763447734478344793448034481344823448334484344853448634487344883448934490344913449234493344943449534496344973449834499345003450134502345033450434505345063450734508345093451034511345123451334514345153451634517345183451934520345213452234523345243452534526345273452834529345303453134532345333453434535345363453734538345393454034541345423454334544345453454634547345483454934550345513455234553345543455534556345573455834559345603456134562345633456434565345663456734568345693457034571345723457334574345753457634577345783457934580345813458234583345843458534586345873458834589345903459134592345933459434595345963459734598345993460034601346023460334604346053460634607346083460934610346113461234613346143461534616346173461834619346203462134622346233462434625346263462734628346293463034631346323463334634346353463634637346383463934640346413464234643346443464534646346473464834649346503465134652346533465434655346563465734658346593466034661346623466334664346653466634667346683466934670346713467234673346743467534676346773467834679346803468134682346833468434685346863468734688346893469034691346923469334694346953469634697346983469934700347013470234703347043470534706347073470834709347103471134712347133471434715347163471734718347193472034721347223472334724347253472634727347283472934730347313473234733347343473534736347373473834739347403474134742347433474434745347463474734748347493475034751347523475334754347553475634757347583475934760347613476234763347643476534766347673476834769347703477134772347733477434775347763477734778347793478034781347823478334784347853478634787347883478934790347913479234793347943479534796347973479834799348003480134802348033480434805348063480734808348093481034811348123481334814348153481634817348183481934820348213482234823348243482534826348273482834829348303483134832348333483434835348363483734838348393484034841348423484334844348453484634847348483484934850348513485234853348543485534856348573485834859348603486134862348633486434865348663486734868348693487034871348723487334874348753487634877348783487934880348813488234883348843488534886348873488834889348903489134892348933489434895348963489734898348993490034901349023490334904349053490634907349083490934910349113491234913349143491534916349173491834919349203492134922349233492434925349263492734928349293493034931349323493334934349353493634937349383493934940349413494234943349443494534946349473494834949349503495134952349533495434955349563495734958349593496034961349623496334964349653496634967349683496934970349713497234973349743497534976349773497834979349803498134982349833498434985349863498734988349893499034991349923499334994349953499634997349983499935000350013500235003350043500535006350073500835009350103501135012350133501435015350163501735018350193502035021350223502335024350253502635027350283502935030350313503235033350343503535036350373503835039350403504135042350433504435045350463504735048350493505035051350523505335054350553505635057350583505935060350613506235063350643506535066350673506835069350703507135072350733507435075350763507735078350793508035081350823508335084350853508635087350883508935090350913509235093350943509535096350973509835099351003510135102351033510435105351063510735108351093511035111351123511335114351153511635117351183511935120351213512235123351243512535126351273512835129351303513135132351333513435135351363513735138351393514035141351423514335144351453514635147351483514935150351513515235153351543515535156351573515835159351603516135162351633516435165351663516735168351693517035171351723517335174351753517635177351783517935180351813518235183351843518535186351873518835189351903519135192351933519435195351963519735198351993520035201352023520335204352053520635207352083520935210352113521235213352143521535216352173521835219352203522135222352233522435225352263522735228352293523035231352323523335234352353523635237352383523935240352413524235243352443524535246352473524835249352503525135252352533525435255352563525735258352593526035261352623526335264352653526635267352683526935270352713527235273352743527535276352773527835279352803528135282352833528435285352863528735288352893529035291352923529335294352953529635297352983529935300353013530235303353043530535306353073530835309353103531135312353133531435315353163531735318353193532035321353223532335324353253532635327353283532935330353313533235333353343533535336353373533835339353403534135342353433534435345353463534735348353493535035351353523535335354353553535635357353583535935360353613536235363353643536535366353673536835369353703537135372353733537435375353763537735378353793538035381353823538335384353853538635387353883538935390353913539235393353943539535396353973539835399354003540135402354033540435405354063540735408354093541035411354123541335414354153541635417354183541935420354213542235423354243542535426354273542835429354303543135432354333543435435354363543735438354393544035441354423544335444354453544635447354483544935450354513545235453354543545535456354573545835459354603546135462354633546435465354663546735468354693547035471354723547335474354753547635477354783547935480354813548235483354843548535486354873548835489354903549135492354933549435495354963549735498354993550035501355023550335504355053550635507355083550935510355113551235513355143551535516355173551835519355203552135522355233552435525355263552735528355293553035531355323553335534355353553635537355383553935540355413554235543355443554535546355473554835549355503555135552355533555435555355563555735558355593556035561355623556335564355653556635567355683556935570355713557235573355743557535576355773557835579355803558135582355833558435585355863558735588355893559035591355923559335594355953559635597355983559935600356013560235603356043560535606356073560835609356103561135612356133561435615356163561735618356193562035621356223562335624356253562635627356283562935630356313563235633356343563535636356373563835639356403564135642356433564435645356463564735648356493565035651356523565335654356553565635657356583565935660356613566235663356643566535666356673566835669356703567135672356733567435675356763567735678356793568035681356823568335684356853568635687356883568935690356913569235693356943569535696356973569835699357003570135702357033570435705357063570735708357093571035711357123571335714357153571635717357183571935720357213572235723357243572535726357273572835729357303573135732357333573435735357363573735738357393574035741357423574335744357453574635747357483574935750357513575235753357543575535756357573575835759357603576135762357633576435765357663576735768357693577035771357723577335774357753577635777357783577935780357813578235783357843578535786357873578835789357903579135792357933579435795357963579735798357993580035801358023580335804358053580635807358083580935810358113581235813358143581535816358173581835819358203582135822358233582435825358263582735828358293583035831358323583335834358353583635837358383583935840358413584235843358443584535846358473584835849358503585135852358533585435855358563585735858358593586035861358623586335864358653586635867358683586935870358713587235873358743587535876358773587835879358803588135882358833588435885358863588735888358893589035891358923589335894358953589635897358983589935900359013590235903359043590535906359073590835909359103591135912359133591435915359163591735918359193592035921359223592335924359253592635927359283592935930359313593235933359343593535936359373593835939359403594135942359433594435945359463594735948359493595035951359523595335954359553595635957359583595935960359613596235963359643596535966359673596835969359703597135972359733597435975359763597735978359793598035981359823598335984359853598635987359883598935990359913599235993359943599535996359973599835999360003600136002360033600436005360063600736008360093601036011360123601336014360153601636017360183601936020360213602236023360243602536026360273602836029360303603136032360333603436035360363603736038360393604036041360423604336044360453604636047360483604936050360513605236053360543605536056360573605836059360603606136062360633606436065360663606736068360693607036071360723607336074360753607636077360783607936080360813608236083360843608536086360873608836089360903609136092360933609436095360963609736098360993610036101361023610336104361053610636107361083610936110361113611236113361143611536116361173611836119361203612136122361233612436125361263612736128361293613036131361323613336134361353613636137361383613936140361413614236143361443614536146361473614836149361503615136152361533615436155361563615736158361593616036161361623616336164361653616636167361683616936170361713617236173361743617536176361773617836179361803618136182361833618436185361863618736188361893619036191361923619336194361953619636197361983619936200362013620236203362043620536206362073620836209362103621136212362133621436215362163621736218362193622036221362223622336224362253622636227362283622936230362313623236233362343623536236362373623836239362403624136242362433624436245362463624736248362493625036251362523625336254362553625636257362583625936260362613626236263362643626536266362673626836269362703627136272362733627436275362763627736278362793628036281362823628336284362853628636287362883628936290362913629236293362943629536296362973629836299363003630136302363033630436305363063630736308363093631036311363123631336314363153631636317363183631936320363213632236323363243632536326363273632836329363303633136332363333633436335363363633736338363393634036341363423634336344363453634636347363483634936350363513635236353363543635536356363573635836359363603636136362363633636436365363663636736368363693637036371363723637336374363753637636377363783637936380363813638236383363843638536386363873638836389363903639136392363933639436395363963639736398363993640036401364023640336404364053640636407364083640936410364113641236413364143641536416364173641836419364203642136422364233642436425364263642736428364293643036431364323643336434364353643636437364383643936440364413644236443364443644536446364473644836449364503645136452364533645436455364563645736458364593646036461364623646336464364653646636467364683646936470364713647236473364743647536476364773647836479364803648136482364833648436485364863648736488364893649036491364923649336494364953649636497364983649936500365013650236503365043650536506365073650836509365103651136512365133651436515365163651736518365193652036521365223652336524365253652636527365283652936530365313653236533365343653536536365373653836539365403654136542365433654436545365463654736548365493655036551365523655336554365553655636557365583655936560365613656236563365643656536566365673656836569365703657136572365733657436575365763657736578365793658036581365823658336584365853658636587365883658936590365913659236593365943659536596365973659836599366003660136602366033660436605366063660736608366093661036611366123661336614366153661636617366183661936620366213662236623366243662536626366273662836629366303663136632366333663436635366363663736638366393664036641366423664336644366453664636647366483664936650366513665236653366543665536656366573665836659366603666136662366633666436665366663666736668366693667036671366723667336674366753667636677366783667936680366813668236683366843668536686366873668836689366903669136692366933669436695366963669736698366993670036701367023670336704367053670636707367083670936710367113671236713367143671536716367173671836719367203672136722367233672436725367263672736728367293673036731367323673336734367353673636737367383673936740367413674236743367443674536746367473674836749367503675136752367533675436755367563675736758367593676036761367623676336764367653676636767367683676936770367713677236773367743677536776367773677836779367803678136782367833678436785367863678736788367893679036791367923679336794367953679636797367983679936800368013680236803368043680536806368073680836809368103681136812368133681436815368163681736818368193682036821368223682336824368253682636827368283682936830368313683236833368343683536836368373683836839368403684136842368433684436845368463684736848368493685036851368523685336854368553685636857368583685936860368613686236863368643686536866368673686836869368703687136872368733687436875368763687736878368793688036881368823688336884368853688636887368883688936890368913689236893368943689536896368973689836899369003690136902369033690436905369063690736908369093691036911369123691336914369153691636917369183691936920369213692236923369243692536926369273692836929369303693136932369333693436935369363693736938369393694036941369423694336944369453694636947369483694936950369513695236953369543695536956369573695836959369603696136962369633696436965369663696736968369693697036971369723697336974369753697636977369783697936980369813698236983369843698536986369873698836989369903699136992369933699436995369963699736998369993700037001370023700337004370053700637007370083700937010370113701237013370143701537016370173701837019370203702137022370233702437025370263702737028370293703037031370323703337034370353703637037370383703937040370413704237043370443704537046370473704837049370503705137052370533705437055370563705737058370593706037061370623706337064370653706637067370683706937070370713707237073370743707537076370773707837079370803708137082370833708437085370863708737088370893709037091370923709337094370953709637097370983709937100371013710237103371043710537106371073710837109371103711137112371133711437115371163711737118371193712037121371223712337124371253712637127371283712937130371313713237133371343713537136371373713837139371403714137142371433714437145371463714737148371493715037151371523715337154371553715637157371583715937160371613716237163371643716537166371673716837169371703717137172371733717437175371763717737178371793718037181371823718337184371853718637187371883718937190371913719237193371943719537196371973719837199372003720137202372033720437205372063720737208372093721037211372123721337214372153721637217372183721937220372213722237223372243722537226372273722837229372303723137232372333723437235372363723737238372393724037241372423724337244372453724637247372483724937250372513725237253372543725537256372573725837259372603726137262372633726437265372663726737268372693727037271372723727337274372753727637277372783727937280372813728237283372843728537286372873728837289372903729137292372933729437295372963729737298372993730037301373023730337304373053730637307373083730937310373113731237313373143731537316373173731837319373203732137322373233732437325373263732737328373293733037331373323733337334373353733637337373383733937340373413734237343373443734537346373473734837349373503735137352373533735437355373563735737358373593736037361373623736337364373653736637367373683736937370373713737237373373743737537376373773737837379373803738137382373833738437385373863738737388373893739037391373923739337394373953739637397373983739937400374013740237403374043740537406374073740837409374103741137412374133741437415374163741737418374193742037421374223742337424374253742637427374283742937430374313743237433374343743537436374373743837439374403744137442374433744437445374463744737448374493745037451374523745337454374553745637457374583745937460374613746237463374643746537466374673746837469374703747137472374733747437475374763747737478374793748037481374823748337484374853748637487374883748937490374913749237493374943749537496374973749837499375003750137502375033750437505375063750737508375093751037511375123751337514375153751637517375183751937520375213752237523375243752537526375273752837529375303753137532375333753437535375363753737538375393754037541375423754337544375453754637547375483754937550375513755237553375543755537556375573755837559375603756137562375633756437565375663756737568375693757037571375723757337574375753757637577375783757937580375813758237583375843758537586375873758837589375903759137592375933759437595375963759737598375993760037601376023760337604376053760637607376083760937610376113761237613376143761537616376173761837619376203762137622376233762437625376263762737628376293763037631376323763337634376353763637637376383763937640376413764237643376443764537646376473764837649376503765137652376533765437655376563765737658376593766037661376623766337664376653766637667376683766937670376713767237673376743767537676376773767837679376803768137682376833768437685376863768737688376893769037691376923769337694376953769637697376983769937700377013770237703377043770537706377073770837709377103771137712377133771437715377163771737718377193772037721377223772337724377253772637727377283772937730377313773237733377343773537736377373773837739377403774137742377433774437745377463774737748377493775037751377523775337754377553775637757377583775937760377613776237763377643776537766377673776837769377703777137772377733777437775377763777737778377793778037781377823778337784377853778637787377883778937790377913779237793377943779537796377973779837799378003780137802378033780437805378063780737808378093781037811378123781337814378153781637817378183781937820378213782237823378243782537826378273782837829378303783137832378333783437835378363783737838378393784037841378423784337844378453784637847378483784937850378513785237853378543785537856378573785837859378603786137862378633786437865378663786737868378693787037871378723787337874378753787637877378783787937880378813788237883378843788537886378873788837889378903789137892378933789437895378963789737898378993790037901379023790337904379053790637907379083790937910379113791237913379143791537916379173791837919379203792137922379233792437925379263792737928379293793037931379323793337934379353793637937379383793937940379413794237943379443794537946379473794837949379503795137952379533795437955379563795737958379593796037961379623796337964379653796637967379683796937970379713797237973379743797537976379773797837979379803798137982379833798437985379863798737988379893799037991379923799337994379953799637997379983799938000380013800238003380043800538006380073800838009380103801138012380133801438015380163801738018380193802038021380223802338024380253802638027380283802938030380313803238033380343803538036380373803838039380403804138042380433804438045380463804738048380493805038051380523805338054380553805638057380583805938060380613806238063380643806538066380673806838069380703807138072380733807438075380763807738078380793808038081380823808338084380853808638087380883808938090380913809238093380943809538096380973809838099381003810138102381033810438105381063810738108381093811038111381123811338114381153811638117381183811938120381213812238123381243812538126381273812838129381303813138132381333813438135381363813738138381393814038141381423814338144381453814638147381483814938150381513815238153381543815538156381573815838159381603816138162381633816438165381663816738168381693817038171381723817338174381753817638177381783817938180381813818238183381843818538186381873818838189381903819138192381933819438195381963819738198381993820038201382023820338204382053820638207382083820938210382113821238213382143821538216382173821838219382203822138222382233822438225382263822738228382293823038231382323823338234382353823638237382383823938240382413824238243382443824538246382473824838249382503825138252382533825438255382563825738258382593826038261382623826338264382653826638267382683826938270382713827238273382743827538276382773827838279382803828138282382833828438285382863828738288382893829038291382923829338294382953829638297382983829938300383013830238303383043830538306383073830838309383103831138312383133831438315383163831738318383193832038321383223832338324383253832638327383283832938330383313833238333383343833538336383373833838339383403834138342383433834438345383463834738348383493835038351383523835338354383553835638357383583835938360383613836238363383643836538366383673836838369383703837138372383733837438375383763837738378383793838038381383823838338384383853838638387383883838938390383913839238393383943839538396383973839838399384003840138402384033840438405384063840738408384093841038411384123841338414384153841638417384183841938420384213842238423384243842538426384273842838429384303843138432384333843438435384363843738438384393844038441384423844338444384453844638447384483844938450384513845238453384543845538456384573845838459384603846138462384633846438465384663846738468384693847038471384723847338474384753847638477384783847938480384813848238483384843848538486384873848838489384903849138492384933849438495384963849738498384993850038501385023850338504385053850638507385083850938510385113851238513385143851538516385173851838519385203852138522385233852438525385263852738528385293853038531385323853338534385353853638537385383853938540385413854238543385443854538546385473854838549385503855138552385533855438555385563855738558385593856038561385623856338564385653856638567385683856938570385713857238573385743857538576385773857838579385803858138582385833858438585385863858738588385893859038591385923859338594385953859638597385983859938600386013860238603386043860538606386073860838609386103861138612386133861438615386163861738618386193862038621386223862338624386253862638627386283862938630386313863238633386343863538636386373863838639386403864138642386433864438645386463864738648386493865038651386523865338654386553865638657386583865938660386613866238663386643866538666386673866838669386703867138672386733867438675386763867738678386793868038681386823868338684386853868638687386883868938690386913869238693386943869538696386973869838699387003870138702387033870438705387063870738708387093871038711387123871338714387153871638717387183871938720387213872238723387243872538726387273872838729387303873138732387333873438735387363873738738387393874038741387423874338744387453874638747387483874938750387513875238753387543875538756387573875838759387603876138762387633876438765387663876738768387693877038771387723877338774387753877638777387783877938780387813878238783387843878538786387873878838789387903879138792387933879438795387963879738798387993880038801388023880338804388053880638807388083880938810388113881238813388143881538816388173881838819388203882138822388233882438825388263882738828388293883038831388323883338834388353883638837388383883938840388413884238843388443884538846388473884838849388503885138852388533885438855388563885738858388593886038861388623886338864388653886638867388683886938870388713887238873388743887538876388773887838879388803888138882388833888438885388863888738888388893889038891388923889338894388953889638897388983889938900389013890238903389043890538906389073890838909389103891138912389133891438915389163891738918389193892038921389223892338924389253892638927389283892938930389313893238933389343893538936389373893838939389403894138942389433894438945389463894738948389493895038951389523895338954389553895638957389583895938960389613896238963389643896538966389673896838969389703897138972389733897438975389763897738978389793898038981389823898338984389853898638987389883898938990389913899238993389943899538996389973899838999390003900139002390033900439005390063900739008390093901039011390123901339014390153901639017390183901939020390213902239023390243902539026390273902839029390303903139032390333903439035390363903739038390393904039041390423904339044390453904639047390483904939050390513905239053390543905539056390573905839059390603906139062390633906439065390663906739068390693907039071390723907339074390753907639077390783907939080390813908239083390843908539086390873908839089390903909139092390933909439095390963909739098390993910039101391023910339104391053910639107391083910939110391113911239113391143911539116391173911839119391203912139122391233912439125391263912739128391293913039131391323913339134391353913639137391383913939140391413914239143391443914539146391473914839149391503915139152391533915439155391563915739158391593916039161391623916339164391653916639167391683916939170391713917239173391743917539176391773917839179391803918139182391833918439185391863918739188391893919039191391923919339194391953919639197391983919939200392013920239203392043920539206392073920839209392103921139212392133921439215392163921739218392193922039221392223922339224392253922639227392283922939230392313923239233392343923539236392373923839239392403924139242392433924439245392463924739248392493925039251392523925339254392553925639257392583925939260392613926239263392643926539266392673926839269392703927139272392733927439275392763927739278392793928039281392823928339284392853928639287392883928939290392913929239293392943929539296392973929839299393003930139302393033930439305393063930739308393093931039311393123931339314393153931639317393183931939320393213932239323393243932539326393273932839329393303933139332393333933439335393363933739338393393934039341393423934339344393453934639347393483934939350393513935239353393543935539356393573935839359393603936139362393633936439365393663936739368393693937039371393723937339374393753937639377393783937939380393813938239383393843938539386393873938839389393903939139392393933939439395393963939739398393993940039401394023940339404394053940639407394083940939410394113941239413394143941539416394173941839419394203942139422394233942439425394263942739428394293943039431394323943339434394353943639437394383943939440394413944239443394443944539446394473944839449394503945139452394533945439455394563945739458394593946039461394623946339464394653946639467394683946939470394713947239473394743947539476394773947839479394803948139482394833948439485394863948739488394893949039491394923949339494394953949639497394983949939500395013950239503395043950539506395073950839509395103951139512395133951439515395163951739518395193952039521395223952339524395253952639527395283952939530395313953239533395343953539536395373953839539395403954139542395433954439545395463954739548395493955039551395523955339554395553955639557395583955939560395613956239563395643956539566395673956839569395703957139572395733957439575395763957739578395793958039581395823958339584395853958639587395883958939590395913959239593395943959539596395973959839599396003960139602396033960439605396063960739608396093961039611396123961339614396153961639617396183961939620396213962239623396243962539626396273962839629396303963139632396333963439635396363963739638396393964039641396423964339644396453964639647396483964939650396513965239653396543965539656396573965839659396603966139662396633966439665396663966739668396693967039671396723967339674396753967639677396783967939680396813968239683396843968539686396873968839689396903969139692396933969439695396963969739698396993970039701397023970339704397053970639707397083970939710397113971239713397143971539716397173971839719397203972139722397233972439725397263972739728397293973039731397323973339734397353973639737397383973939740397413974239743397443974539746397473974839749397503975139752397533975439755397563975739758397593976039761397623976339764397653976639767397683976939770397713977239773397743977539776397773977839779397803978139782397833978439785397863978739788397893979039791397923979339794397953979639797397983979939800398013980239803398043980539806398073980839809398103981139812398133981439815398163981739818398193982039821398223982339824398253982639827398283982939830398313983239833398343983539836398373983839839398403984139842398433984439845398463984739848398493985039851398523985339854398553985639857398583985939860398613986239863398643986539866398673986839869398703987139872398733987439875398763987739878398793988039881398823988339884398853988639887398883988939890398913989239893398943989539896398973989839899399003990139902399033990439905399063990739908399093991039911399123991339914399153991639917399183991939920399213992239923399243992539926399273992839929399303993139932399333993439935399363993739938399393994039941399423994339944399453994639947399483994939950399513995239953399543995539956399573995839959399603996139962399633996439965399663996739968399693997039971399723997339974399753997639977399783997939980399813998239983399843998539986399873998839989399903999139992399933999439995399963999739998399994000040001400024000340004400054000640007400084000940010400114001240013400144001540016400174001840019400204002140022400234002440025400264002740028400294003040031400324003340034400354003640037400384003940040400414004240043400444004540046400474004840049400504005140052400534005440055400564005740058400594006040061400624006340064400654006640067400684006940070400714007240073400744007540076400774007840079400804008140082400834008440085400864008740088400894009040091400924009340094400954009640097400984009940100401014010240103401044010540106401074010840109401104011140112401134011440115401164011740118401194012040121401224012340124401254012640127401284012940130401314013240133401344013540136401374013840139401404014140142401434014440145401464014740148401494015040151401524015340154401554015640157401584015940160401614016240163401644016540166401674016840169401704017140172401734017440175401764017740178401794018040181401824018340184401854018640187401884018940190401914019240193401944019540196401974019840199402004020140202402034020440205402064020740208402094021040211402124021340214402154021640217402184021940220402214022240223402244022540226402274022840229402304023140232402334023440235402364023740238402394024040241402424024340244402454024640247402484024940250402514025240253402544025540256402574025840259402604026140262402634026440265402664026740268402694027040271402724027340274402754027640277402784027940280402814028240283402844028540286402874028840289402904029140292402934029440295402964029740298402994030040301403024030340304403054030640307403084030940310403114031240313403144031540316403174031840319403204032140322403234032440325403264032740328403294033040331403324033340334403354033640337403384033940340403414034240343403444034540346403474034840349403504035140352403534035440355403564035740358403594036040361403624036340364403654036640367403684036940370403714037240373403744037540376403774037840379403804038140382403834038440385403864038740388403894039040391403924039340394403954039640397403984039940400404014040240403404044040540406404074040840409404104041140412404134041440415404164041740418404194042040421404224042340424404254042640427404284042940430404314043240433404344043540436404374043840439404404044140442404434044440445404464044740448404494045040451404524045340454404554045640457404584045940460404614046240463404644046540466404674046840469404704047140472404734047440475404764047740478404794048040481404824048340484404854048640487404884048940490404914049240493404944049540496404974049840499405004050140502405034050440505405064050740508405094051040511405124051340514405154051640517405184051940520405214052240523405244052540526405274052840529405304053140532405334053440535405364053740538405394054040541405424054340544405454054640547405484054940550405514055240553405544055540556405574055840559405604056140562405634056440565405664056740568405694057040571405724057340574405754057640577405784057940580405814058240583405844058540586405874058840589405904059140592405934059440595405964059740598405994060040601406024060340604406054060640607406084060940610406114061240613406144061540616406174061840619406204062140622406234062440625406264062740628406294063040631406324063340634406354063640637406384063940640406414064240643406444064540646406474064840649406504065140652406534065440655406564065740658406594066040661406624066340664406654066640667406684066940670406714067240673406744067540676406774067840679406804068140682406834068440685406864068740688406894069040691406924069340694406954069640697406984069940700407014070240703407044070540706407074070840709407104071140712407134071440715407164071740718407194072040721407224072340724407254072640727407284072940730407314073240733407344073540736407374073840739407404074140742407434074440745407464074740748407494075040751407524075340754407554075640757407584075940760407614076240763407644076540766407674076840769407704077140772407734077440775407764077740778407794078040781407824078340784407854078640787407884078940790407914079240793407944079540796407974079840799408004080140802408034080440805408064080740808408094081040811408124081340814408154081640817408184081940820408214082240823408244082540826408274082840829408304083140832408334083440835408364083740838408394084040841408424084340844408454084640847408484084940850408514085240853408544085540856408574085840859408604086140862408634086440865408664086740868408694087040871408724087340874408754087640877408784087940880408814088240883408844088540886408874088840889408904089140892408934089440895408964089740898408994090040901409024090340904409054090640907409084090940910409114091240913409144091540916409174091840919409204092140922409234092440925409264092740928409294093040931409324093340934409354093640937409384093940940409414094240943409444094540946409474094840949409504095140952409534095440955409564095740958409594096040961409624096340964409654096640967409684096940970409714097240973409744097540976409774097840979409804098140982409834098440985409864098740988409894099040991409924099340994409954099640997409984099941000410014100241003410044100541006410074100841009410104101141012410134101441015410164101741018410194102041021410224102341024410254102641027410284102941030410314103241033410344103541036410374103841039410404104141042410434104441045410464104741048410494105041051410524105341054410554105641057410584105941060410614106241063410644106541066410674106841069410704107141072410734107441075410764107741078410794108041081410824108341084410854108641087410884108941090410914109241093410944109541096410974109841099411004110141102411034110441105411064110741108411094111041111411124111341114411154111641117411184111941120411214112241123411244112541126411274112841129411304113141132411334113441135411364113741138411394114041141411424114341144411454114641147411484114941150411514115241153411544115541156411574115841159411604116141162411634116441165411664116741168411694117041171411724117341174411754117641177411784117941180411814118241183411844118541186411874118841189411904119141192411934119441195411964119741198411994120041201412024120341204412054120641207412084120941210412114121241213412144121541216412174121841219412204122141222412234122441225412264122741228412294123041231412324123341234412354123641237412384123941240412414124241243412444124541246412474124841249412504125141252412534125441255412564125741258412594126041261412624126341264412654126641267412684126941270412714127241273412744127541276412774127841279412804128141282412834128441285412864128741288412894129041291412924129341294412954129641297412984129941300413014130241303413044130541306413074130841309413104131141312413134131441315413164131741318413194132041321413224132341324413254132641327413284132941330413314133241333413344133541336413374133841339413404134141342413434134441345413464134741348413494135041351413524135341354413554135641357413584135941360413614136241363413644136541366413674136841369413704137141372413734137441375413764137741378413794138041381413824138341384413854138641387413884138941390413914139241393413944139541396413974139841399414004140141402414034140441405414064140741408414094141041411414124141341414414154141641417414184141941420414214142241423414244142541426414274142841429414304143141432414334143441435414364143741438414394144041441414424144341444414454144641447414484144941450414514145241453414544145541456414574145841459414604146141462414634146441465414664146741468414694147041471414724147341474414754147641477414784147941480414814148241483414844148541486414874148841489414904149141492414934149441495414964149741498414994150041501415024150341504415054150641507415084150941510415114151241513415144151541516415174151841519415204152141522415234152441525415264152741528415294153041531415324153341534415354153641537415384153941540415414154241543415444154541546415474154841549415504155141552415534155441555415564155741558415594156041561415624156341564415654156641567415684156941570415714157241573415744157541576415774157841579415804158141582415834158441585415864158741588415894159041591415924159341594415954159641597415984159941600416014160241603416044160541606416074160841609416104161141612416134161441615416164161741618416194162041621416224162341624416254162641627416284162941630416314163241633416344163541636416374163841639416404164141642416434164441645416464164741648416494165041651416524165341654416554165641657416584165941660416614166241663416644166541666416674166841669416704167141672416734167441675416764167741678416794168041681416824168341684416854168641687416884168941690416914169241693416944169541696416974169841699417004170141702417034170441705417064170741708417094171041711417124171341714417154171641717417184171941720417214172241723417244172541726417274172841729417304173141732417334173441735417364173741738417394174041741417424174341744417454174641747417484174941750417514175241753417544175541756417574175841759417604176141762417634176441765417664176741768417694177041771417724177341774417754177641777417784177941780417814178241783417844178541786417874178841789417904179141792417934179441795417964179741798417994180041801418024180341804418054180641807418084180941810418114181241813418144181541816418174181841819418204182141822418234182441825418264182741828418294183041831418324183341834418354183641837418384183941840418414184241843418444184541846418474184841849418504185141852418534185441855418564185741858418594186041861418624186341864418654186641867418684186941870418714187241873418744187541876418774187841879418804188141882418834188441885418864188741888418894189041891418924189341894418954189641897418984189941900419014190241903419044190541906419074190841909419104191141912419134191441915419164191741918419194192041921419224192341924419254192641927419284192941930419314193241933419344193541936419374193841939419404194141942419434194441945419464194741948419494195041951419524195341954419554195641957419584195941960419614196241963419644196541966419674196841969419704197141972419734197441975419764197741978419794198041981419824198341984419854198641987419884198941990419914199241993419944199541996419974199841999420004200142002420034200442005420064200742008420094201042011420124201342014420154201642017420184201942020420214202242023420244202542026420274202842029420304203142032420334203442035420364203742038420394204042041420424204342044420454204642047420484204942050420514205242053420544205542056420574205842059420604206142062420634206442065420664206742068420694207042071420724207342074420754207642077420784207942080420814208242083420844208542086420874208842089420904209142092420934209442095420964209742098420994210042101421024210342104421054210642107421084210942110421114211242113421144211542116421174211842119421204212142122421234212442125421264212742128421294213042131421324213342134421354213642137421384213942140421414214242143421444214542146421474214842149421504215142152421534215442155421564215742158421594216042161421624216342164421654216642167421684216942170421714217242173421744217542176421774217842179421804218142182421834218442185421864218742188421894219042191421924219342194421954219642197421984219942200422014220242203422044220542206422074220842209422104221142212422134221442215422164221742218422194222042221422224222342224422254222642227422284222942230422314223242233422344223542236422374223842239422404224142242422434224442245422464224742248422494225042251422524225342254422554225642257422584225942260422614226242263422644226542266422674226842269422704227142272422734227442275422764227742278422794228042281422824228342284422854228642287422884228942290422914229242293422944229542296422974229842299423004230142302423034230442305423064230742308423094231042311423124231342314423154231642317423184231942320423214232242323423244232542326423274232842329423304233142332423334233442335423364233742338423394234042341423424234342344423454234642347423484234942350423514235242353423544235542356423574235842359423604236142362423634236442365423664236742368423694237042371423724237342374423754237642377423784237942380423814238242383423844238542386423874238842389423904239142392423934239442395423964239742398423994240042401424024240342404424054240642407424084240942410424114241242413424144241542416424174241842419424204242142422424234242442425424264242742428424294243042431424324243342434424354243642437424384243942440424414244242443424444244542446424474244842449424504245142452424534245442455424564245742458424594246042461424624246342464424654246642467424684246942470424714247242473424744247542476424774247842479424804248142482424834248442485424864248742488424894249042491424924249342494424954249642497424984249942500425014250242503425044250542506425074250842509425104251142512425134251442515425164251742518425194252042521425224252342524425254252642527425284252942530425314253242533425344253542536425374253842539425404254142542425434254442545425464254742548425494255042551425524255342554425554255642557425584255942560425614256242563425644256542566425674256842569425704257142572425734257442575425764257742578425794258042581425824258342584425854258642587425884258942590425914259242593425944259542596425974259842599426004260142602426034260442605426064260742608426094261042611426124261342614426154261642617426184261942620426214262242623426244262542626426274262842629426304263142632426334263442635426364263742638426394264042641426424264342644426454264642647426484264942650426514265242653426544265542656426574265842659426604266142662426634266442665426664266742668426694267042671426724267342674426754267642677426784267942680426814268242683426844268542686426874268842689426904269142692426934269442695426964269742698426994270042701427024270342704
  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. These match the constants from the [WebGL 1.0]{@link https://www.khronos.org/registry/webgl/specs/latest/1.0/}
  13. and [WebGL 2.0]{@link https://www.khronos.org/registry/webgl/specs/latest/2.0/}
  14. specifications.
  15. */
  16. export enum WebGLConstants {
  17. DEPTH_BUFFER_BIT = 256,
  18. STENCIL_BUFFER_BIT = 1024,
  19. COLOR_BUFFER_BIT = 16384,
  20. POINTS = 0,
  21. LINES = 1,
  22. LINE_LOOP = 2,
  23. LINE_STRIP = 3,
  24. TRIANGLES = 4,
  25. TRIANGLE_STRIP = 5,
  26. TRIANGLE_FAN = 6,
  27. ZERO = 0,
  28. ONE = 1,
  29. SRC_COLOR = 768,
  30. ONE_MINUS_SRC_COLOR = 769,
  31. SRC_ALPHA = 770,
  32. ONE_MINUS_SRC_ALPHA = 771,
  33. DST_ALPHA = 772,
  34. ONE_MINUS_DST_ALPHA = 773,
  35. DST_COLOR = 774,
  36. ONE_MINUS_DST_COLOR = 775,
  37. SRC_ALPHA_SATURATE = 776,
  38. FUNC_ADD = 32774,
  39. BLEND_EQUATION = 32777,
  40. BLEND_EQUATION_RGB = 32777,
  41. BLEND_EQUATION_ALPHA = 34877,
  42. FUNC_SUBTRACT = 32778,
  43. FUNC_REVERSE_SUBTRACT = 32779,
  44. BLEND_DST_RGB = 32968,
  45. BLEND_SRC_RGB = 32969,
  46. BLEND_DST_ALPHA = 32970,
  47. BLEND_SRC_ALPHA = 32971,
  48. CONSTANT_COLOR = 32769,
  49. ONE_MINUS_CONSTANT_COLOR = 32770,
  50. CONSTANT_ALPHA = 32771,
  51. ONE_MINUS_CONSTANT_ALPHA = 32772,
  52. BLEND_COLOR = 32773,
  53. ARRAY_BUFFER = 34962,
  54. ELEMENT_ARRAY_BUFFER = 34963,
  55. ARRAY_BUFFER_BINDING = 34964,
  56. ELEMENT_ARRAY_BUFFER_BINDING = 34965,
  57. STREAM_DRAW = 35040,
  58. STATIC_DRAW = 35044,
  59. DYNAMIC_DRAW = 35048,
  60. BUFFER_SIZE = 34660,
  61. BUFFER_USAGE = 34661,
  62. CURRENT_VERTEX_ATTRIB = 34342,
  63. FRONT = 1028,
  64. BACK = 1029,
  65. FRONT_AND_BACK = 1032,
  66. CULL_FACE = 2884,
  67. BLEND = 3042,
  68. DITHER = 3024,
  69. STENCIL_TEST = 2960,
  70. DEPTH_TEST = 2929,
  71. SCISSOR_TEST = 3089,
  72. POLYGON_OFFSET_FILL = 32823,
  73. SAMPLE_ALPHA_TO_COVERAGE = 32926,
  74. SAMPLE_COVERAGE = 32928,
  75. NO_ERROR = 0,
  76. INVALID_ENUM = 1280,
  77. INVALID_VALUE = 1281,
  78. INVALID_OPERATION = 1282,
  79. OUT_OF_MEMORY = 1285,
  80. CW = 2304,
  81. CCW = 2305,
  82. LINE_WIDTH = 2849,
  83. ALIASED_POINT_SIZE_RANGE = 33901,
  84. ALIASED_LINE_WIDTH_RANGE = 33902,
  85. CULL_FACE_MODE = 2885,
  86. FRONT_FACE = 2886,
  87. DEPTH_RANGE = 2928,
  88. DEPTH_WRITEMASK = 2930,
  89. DEPTH_CLEAR_VALUE = 2931,
  90. DEPTH_FUNC = 2932,
  91. STENCIL_CLEAR_VALUE = 2961,
  92. STENCIL_FUNC = 2962,
  93. STENCIL_FAIL = 2964,
  94. STENCIL_PASS_DEPTH_FAIL = 2965,
  95. STENCIL_PASS_DEPTH_PASS = 2966,
  96. STENCIL_REF = 2967,
  97. STENCIL_VALUE_MASK = 2963,
  98. STENCIL_WRITEMASK = 2968,
  99. STENCIL_BACK_FUNC = 34816,
  100. STENCIL_BACK_FAIL = 34817,
  101. STENCIL_BACK_PASS_DEPTH_FAIL = 34818,
  102. STENCIL_BACK_PASS_DEPTH_PASS = 34819,
  103. STENCIL_BACK_REF = 36003,
  104. STENCIL_BACK_VALUE_MASK = 36004,
  105. STENCIL_BACK_WRITEMASK = 36005,
  106. VIEWPORT = 2978,
  107. SCISSOR_BOX = 3088,
  108. COLOR_CLEAR_VALUE = 3106,
  109. COLOR_WRITEMASK = 3107,
  110. UNPACK_ALIGNMENT = 3317,
  111. PACK_ALIGNMENT = 3333,
  112. MAX_TEXTURE_SIZE = 3379,
  113. MAX_VIEWPORT_DIMS = 3386,
  114. SUBPIXEL_BITS = 3408,
  115. RED_BITS = 3410,
  116. GREEN_BITS = 3411,
  117. BLUE_BITS = 3412,
  118. ALPHA_BITS = 3413,
  119. DEPTH_BITS = 3414,
  120. STENCIL_BITS = 3415,
  121. POLYGON_OFFSET_UNITS = 10752,
  122. POLYGON_OFFSET_FACTOR = 32824,
  123. TEXTURE_BINDING_2D = 32873,
  124. SAMPLE_BUFFERS = 32936,
  125. SAMPLES = 32937,
  126. SAMPLE_COVERAGE_VALUE = 32938,
  127. SAMPLE_COVERAGE_INVERT = 32939,
  128. COMPRESSED_TEXTURE_FORMATS = 34467,
  129. DONT_CARE = 4352,
  130. FASTEST = 4353,
  131. NICEST = 4354,
  132. GENERATE_MIPMAP_HINT = 33170,
  133. BYTE = 5120,
  134. UNSIGNED_BYTE = 5121,
  135. SHORT = 5122,
  136. UNSIGNED_SHORT = 5123,
  137. INT = 5124,
  138. UNSIGNED_INT = 5125,
  139. FLOAT = 5126,
  140. DEPTH_COMPONENT = 6402,
  141. ALPHA = 6406,
  142. RGB = 6407,
  143. RGBA = 6408,
  144. LUMINANCE = 6409,
  145. LUMINANCE_ALPHA = 6410,
  146. UNSIGNED_SHORT_4_4_4_4 = 32819,
  147. UNSIGNED_SHORT_5_5_5_1 = 32820,
  148. UNSIGNED_SHORT_5_6_5 = 33635,
  149. FRAGMENT_SHADER = 35632,
  150. VERTEX_SHADER = 35633,
  151. MAX_VERTEX_ATTRIBS = 34921,
  152. MAX_VERTEX_UNIFORM_VECTORS = 36347,
  153. MAX_VARYING_VECTORS = 36348,
  154. MAX_COMBINED_TEXTURE_IMAGE_UNITS = 35661,
  155. MAX_VERTEX_TEXTURE_IMAGE_UNITS = 35660,
  156. MAX_TEXTURE_IMAGE_UNITS = 34930,
  157. MAX_FRAGMENT_UNIFORM_VECTORS = 36349,
  158. SHADER_TYPE = 35663,
  159. DELETE_STATUS = 35712,
  160. LINK_STATUS = 35714,
  161. VALIDATE_STATUS = 35715,
  162. ATTACHED_SHADERS = 35717,
  163. ACTIVE_UNIFORMS = 35718,
  164. ACTIVE_ATTRIBUTES = 35721,
  165. SHADING_LANGUAGE_VERSION = 35724,
  166. CURRENT_PROGRAM = 35725,
  167. NEVER = 512,
  168. LESS = 513,
  169. EQUAL = 514,
  170. LEQUAL = 515,
  171. GREATER = 516,
  172. NOTEQUAL = 517,
  173. GEQUAL = 518,
  174. ALWAYS = 519,
  175. KEEP = 7680,
  176. REPLACE = 7681,
  177. INCR = 7682,
  178. DECR = 7683,
  179. INVERT = 5386,
  180. INCR_WRAP = 34055,
  181. DECR_WRAP = 34056,
  182. VENDOR = 7936,
  183. RENDERER = 7937,
  184. VERSION = 7938,
  185. NEAREST = 9728,
  186. LINEAR = 9729,
  187. NEAREST_MIPMAP_NEAREST = 9984,
  188. LINEAR_MIPMAP_NEAREST = 9985,
  189. NEAREST_MIPMAP_LINEAR = 9986,
  190. LINEAR_MIPMAP_LINEAR = 9987,
  191. TEXTURE_MAG_FILTER = 10240,
  192. TEXTURE_MIN_FILTER = 10241,
  193. TEXTURE_WRAP_S = 10242,
  194. TEXTURE_WRAP_T = 10243,
  195. TEXTURE_2D = 3553,
  196. TEXTURE = 5890,
  197. TEXTURE_CUBE_MAP = 34067,
  198. TEXTURE_BINDING_CUBE_MAP = 34068,
  199. TEXTURE_CUBE_MAP_POSITIVE_X = 34069,
  200. TEXTURE_CUBE_MAP_NEGATIVE_X = 34070,
  201. TEXTURE_CUBE_MAP_POSITIVE_Y = 34071,
  202. TEXTURE_CUBE_MAP_NEGATIVE_Y = 34072,
  203. TEXTURE_CUBE_MAP_POSITIVE_Z = 34073,
  204. TEXTURE_CUBE_MAP_NEGATIVE_Z = 34074,
  205. MAX_CUBE_MAP_TEXTURE_SIZE = 34076,
  206. TEXTURE0 = 33984,
  207. TEXTURE1 = 33985,
  208. TEXTURE2 = 33986,
  209. TEXTURE3 = 33987,
  210. TEXTURE4 = 33988,
  211. TEXTURE5 = 33989,
  212. TEXTURE6 = 33990,
  213. TEXTURE7 = 33991,
  214. TEXTURE8 = 33992,
  215. TEXTURE9 = 33993,
  216. TEXTURE10 = 33994,
  217. TEXTURE11 = 33995,
  218. TEXTURE12 = 33996,
  219. TEXTURE13 = 33997,
  220. TEXTURE14 = 33998,
  221. TEXTURE15 = 33999,
  222. TEXTURE16 = 34000,
  223. TEXTURE17 = 34001,
  224. TEXTURE18 = 34002,
  225. TEXTURE19 = 34003,
  226. TEXTURE20 = 34004,
  227. TEXTURE21 = 34005,
  228. TEXTURE22 = 34006,
  229. TEXTURE23 = 34007,
  230. TEXTURE24 = 34008,
  231. TEXTURE25 = 34009,
  232. TEXTURE26 = 34010,
  233. TEXTURE27 = 34011,
  234. TEXTURE28 = 34012,
  235. TEXTURE29 = 34013,
  236. TEXTURE30 = 34014,
  237. TEXTURE31 = 34015,
  238. ACTIVE_TEXTURE = 34016,
  239. REPEAT = 10497,
  240. CLAMP_TO_EDGE = 33071,
  241. MIRRORED_REPEAT = 33648,
  242. FLOAT_VEC2 = 35664,
  243. FLOAT_VEC3 = 35665,
  244. FLOAT_VEC4 = 35666,
  245. INT_VEC2 = 35667,
  246. INT_VEC3 = 35668,
  247. INT_VEC4 = 35669,
  248. BOOL = 35670,
  249. BOOL_VEC2 = 35671,
  250. BOOL_VEC3 = 35672,
  251. BOOL_VEC4 = 35673,
  252. FLOAT_MAT2 = 35674,
  253. FLOAT_MAT3 = 35675,
  254. FLOAT_MAT4 = 35676,
  255. SAMPLER_2D = 35678,
  256. SAMPLER_CUBE = 35680,
  257. VERTEX_ATTRIB_ARRAY_ENABLED = 34338,
  258. VERTEX_ATTRIB_ARRAY_SIZE = 34339,
  259. VERTEX_ATTRIB_ARRAY_STRIDE = 34340,
  260. VERTEX_ATTRIB_ARRAY_TYPE = 34341,
  261. VERTEX_ATTRIB_ARRAY_NORMALIZED = 34922,
  262. VERTEX_ATTRIB_ARRAY_POINTER = 34373,
  263. VERTEX_ATTRIB_ARRAY_BUFFER_BINDING = 34975,
  264. IMPLEMENTATION_COLOR_READ_TYPE = 35738,
  265. IMPLEMENTATION_COLOR_READ_FORMAT = 35739,
  266. COMPILE_STATUS = 35713,
  267. LOW_FLOAT = 36336,
  268. MEDIUM_FLOAT = 36337,
  269. HIGH_FLOAT = 36338,
  270. LOW_INT = 36339,
  271. MEDIUM_INT = 36340,
  272. HIGH_INT = 36341,
  273. FRAMEBUFFER = 36160,
  274. RENDERBUFFER = 36161,
  275. RGBA4 = 32854,
  276. RGB5_A1 = 32855,
  277. RGB565 = 36194,
  278. DEPTH_COMPONENT16 = 33189,
  279. STENCIL_INDEX = 6401,
  280. STENCIL_INDEX8 = 36168,
  281. DEPTH_STENCIL = 34041,
  282. RENDERBUFFER_WIDTH = 36162,
  283. RENDERBUFFER_HEIGHT = 36163,
  284. RENDERBUFFER_INTERNAL_FORMAT = 36164,
  285. RENDERBUFFER_RED_SIZE = 36176,
  286. RENDERBUFFER_GREEN_SIZE = 36177,
  287. RENDERBUFFER_BLUE_SIZE = 36178,
  288. RENDERBUFFER_ALPHA_SIZE = 36179,
  289. RENDERBUFFER_DEPTH_SIZE = 36180,
  290. RENDERBUFFER_STENCIL_SIZE = 36181,
  291. FRAMEBUFFER_ATTACHMENT_OBJECT_TYPE = 36048,
  292. FRAMEBUFFER_ATTACHMENT_OBJECT_NAME = 36049,
  293. FRAMEBUFFER_ATTACHMENT_TEXTURE_LEVEL = 36050,
  294. FRAMEBUFFER_ATTACHMENT_TEXTURE_CUBE_MAP_FACE = 36051,
  295. COLOR_ATTACHMENT0 = 36064,
  296. DEPTH_ATTACHMENT = 36096,
  297. STENCIL_ATTACHMENT = 36128,
  298. DEPTH_STENCIL_ATTACHMENT = 33306,
  299. NONE = 0,
  300. FRAMEBUFFER_COMPLETE = 36053,
  301. FRAMEBUFFER_INCOMPLETE_ATTACHMENT = 36054,
  302. FRAMEBUFFER_INCOMPLETE_MISSING_ATTACHMENT = 36055,
  303. FRAMEBUFFER_INCOMPLETE_DIMENSIONS = 36057,
  304. FRAMEBUFFER_UNSUPPORTED = 36061,
  305. FRAMEBUFFER_BINDING = 36006,
  306. RENDERBUFFER_BINDING = 36007,
  307. MAX_RENDERBUFFER_SIZE = 34024,
  308. INVALID_FRAMEBUFFER_OPERATION = 1286,
  309. UNPACK_FLIP_Y_WEBGL = 37440,
  310. UNPACK_PREMULTIPLY_ALPHA_WEBGL = 37441,
  311. CONTEXT_LOST_WEBGL = 37442,
  312. UNPACK_COLORSPACE_CONVERSION_WEBGL = 37443,
  313. BROWSER_DEFAULT_WEBGL = 37444,
  314. COMPRESSED_RGB_S3TC_DXT1_EXT = 33776,
  315. COMPRESSED_RGBA_S3TC_DXT1_EXT = 33777,
  316. COMPRESSED_RGBA_S3TC_DXT3_EXT = 33778,
  317. COMPRESSED_RGBA_S3TC_DXT5_EXT = 33779,
  318. COMPRESSED_RGB_PVRTC_4BPPV1_IMG = 35840,
  319. COMPRESSED_RGB_PVRTC_2BPPV1_IMG = 35841,
  320. COMPRESSED_RGBA_PVRTC_4BPPV1_IMG = 35842,
  321. COMPRESSED_RGBA_PVRTC_2BPPV1_IMG = 35843,
  322. COMPRESSED_RGB_ETC1_WEBGL = 36196,
  323. HALF_FLOAT_OES = 36193,
  324. DOUBLE = 5130,
  325. READ_BUFFER = 3074,
  326. UNPACK_ROW_LENGTH = 3314,
  327. UNPACK_SKIP_ROWS = 3315,
  328. UNPACK_SKIP_PIXELS = 3316,
  329. PACK_ROW_LENGTH = 3330,
  330. PACK_SKIP_ROWS = 3331,
  331. PACK_SKIP_PIXELS = 3332,
  332. COLOR = 6144,
  333. DEPTH = 6145,
  334. STENCIL = 6146,
  335. RED = 6403,
  336. RGB8 = 32849,
  337. RGBA8 = 32856,
  338. RGB10_A2 = 32857,
  339. TEXTURE_BINDING_3D = 32874,
  340. UNPACK_SKIP_IMAGES = 32877,
  341. UNPACK_IMAGE_HEIGHT = 32878,
  342. TEXTURE_3D = 32879,
  343. TEXTURE_WRAP_R = 32882,
  344. MAX_3D_TEXTURE_SIZE = 32883,
  345. UNSIGNED_INT_2_10_10_10_REV = 33640,
  346. MAX_ELEMENTS_VERTICES = 33000,
  347. MAX_ELEMENTS_INDICES = 33001,
  348. TEXTURE_MIN_LOD = 33082,
  349. TEXTURE_MAX_LOD = 33083,
  350. TEXTURE_BASE_LEVEL = 33084,
  351. TEXTURE_MAX_LEVEL = 33085,
  352. MIN = 32775,
  353. MAX = 32776,
  354. DEPTH_COMPONENT24 = 33190,
  355. MAX_TEXTURE_LOD_BIAS = 34045,
  356. TEXTURE_COMPARE_MODE = 34892,
  357. TEXTURE_COMPARE_FUNC = 34893,
  358. CURRENT_QUERY = 34917,
  359. QUERY_RESULT = 34918,
  360. QUERY_RESULT_AVAILABLE = 34919,
  361. STREAM_READ = 35041,
  362. STREAM_COPY = 35042,
  363. STATIC_READ = 35045,
  364. STATIC_COPY = 35046,
  365. DYNAMIC_READ = 35049,
  366. DYNAMIC_COPY = 35050,
  367. MAX_DRAW_BUFFERS = 34852,
  368. DRAW_BUFFER0 = 34853,
  369. DRAW_BUFFER1 = 34854,
  370. DRAW_BUFFER2 = 34855,
  371. DRAW_BUFFER3 = 34856,
  372. DRAW_BUFFER4 = 34857,
  373. DRAW_BUFFER5 = 34858,
  374. DRAW_BUFFER6 = 34859,
  375. DRAW_BUFFER7 = 34860,
  376. DRAW_BUFFER8 = 34861,
  377. DRAW_BUFFER9 = 34862,
  378. DRAW_BUFFER10 = 34863,
  379. DRAW_BUFFER11 = 34864,
  380. DRAW_BUFFER12 = 34865,
  381. DRAW_BUFFER13 = 34866,
  382. DRAW_BUFFER14 = 34867,
  383. DRAW_BUFFER15 = 34868,
  384. MAX_FRAGMENT_UNIFORM_COMPONENTS = 35657,
  385. MAX_VERTEX_UNIFORM_COMPONENTS = 35658,
  386. SAMPLER_3D = 35679,
  387. SAMPLER_2D_SHADOW = 35682,
  388. FRAGMENT_SHADER_DERIVATIVE_HINT = 35723,
  389. PIXEL_PACK_BUFFER = 35051,
  390. PIXEL_UNPACK_BUFFER = 35052,
  391. PIXEL_PACK_BUFFER_BINDING = 35053,
  392. PIXEL_UNPACK_BUFFER_BINDING = 35055,
  393. FLOAT_MAT2x3 = 35685,
  394. FLOAT_MAT2x4 = 35686,
  395. FLOAT_MAT3x2 = 35687,
  396. FLOAT_MAT3x4 = 35688,
  397. FLOAT_MAT4x2 = 35689,
  398. FLOAT_MAT4x3 = 35690,
  399. SRGB = 35904,
  400. SRGB8 = 35905,
  401. SRGB8_ALPHA8 = 35907,
  402. COMPARE_REF_TO_TEXTURE = 34894,
  403. RGBA32F = 34836,
  404. RGB32F = 34837,
  405. RGBA16F = 34842,
  406. RGB16F = 34843,
  407. VERTEX_ATTRIB_ARRAY_INTEGER = 35069,
  408. MAX_ARRAY_TEXTURE_LAYERS = 35071,
  409. MIN_PROGRAM_TEXEL_OFFSET = 35076,
  410. MAX_PROGRAM_TEXEL_OFFSET = 35077,
  411. MAX_VARYING_COMPONENTS = 35659,
  412. TEXTURE_2D_ARRAY = 35866,
  413. TEXTURE_BINDING_2D_ARRAY = 35869,
  414. R11F_G11F_B10F = 35898,
  415. UNSIGNED_INT_10F_11F_11F_REV = 35899,
  416. RGB9_E5 = 35901,
  417. UNSIGNED_INT_5_9_9_9_REV = 35902,
  418. TRANSFORM_FEEDBACK_BUFFER_MODE = 35967,
  419. MAX_TRANSFORM_FEEDBACK_SEPARATE_COMPONENTS = 35968,
  420. TRANSFORM_FEEDBACK_VARYINGS = 35971,
  421. TRANSFORM_FEEDBACK_BUFFER_START = 35972,
  422. TRANSFORM_FEEDBACK_BUFFER_SIZE = 35973,
  423. TRANSFORM_FEEDBACK_PRIMITIVES_WRITTEN = 35976,
  424. RASTERIZER_DISCARD = 35977,
  425. MAX_TRANSFORM_FEEDBACK_INTERLEAVED_COMPONENTS = 35978,
  426. MAX_TRANSFORM_FEEDBACK_SEPARATE_ATTRIBS = 35979,
  427. INTERLEAVED_ATTRIBS = 35980,
  428. SEPARATE_ATTRIBS = 35981,
  429. TRANSFORM_FEEDBACK_BUFFER = 35982,
  430. TRANSFORM_FEEDBACK_BUFFER_BINDING = 35983,
  431. RGBA32UI = 36208,
  432. RGB32UI = 36209,
  433. RGBA16UI = 36214,
  434. RGB16UI = 36215,
  435. RGBA8UI = 36220,
  436. RGB8UI = 36221,
  437. RGBA32I = 36226,
  438. RGB32I = 36227,
  439. RGBA16I = 36232,
  440. RGB16I = 36233,
  441. RGBA8I = 36238,
  442. RGB8I = 36239,
  443. RED_INTEGER = 36244,
  444. RGB_INTEGER = 36248,
  445. RGBA_INTEGER = 36249,
  446. SAMPLER_2D_ARRAY = 36289,
  447. SAMPLER_2D_ARRAY_SHADOW = 36292,
  448. SAMPLER_CUBE_SHADOW = 36293,
  449. UNSIGNED_INT_VEC2 = 36294,
  450. UNSIGNED_INT_VEC3 = 36295,
  451. UNSIGNED_INT_VEC4 = 36296,
  452. INT_SAMPLER_2D = 36298,
  453. INT_SAMPLER_3D = 36299,
  454. INT_SAMPLER_CUBE = 36300,
  455. INT_SAMPLER_2D_ARRAY = 36303,
  456. UNSIGNED_INT_SAMPLER_2D = 36306,
  457. UNSIGNED_INT_SAMPLER_3D = 36307,
  458. UNSIGNED_INT_SAMPLER_CUBE = 36308,
  459. UNSIGNED_INT_SAMPLER_2D_ARRAY = 36311,
  460. DEPTH_COMPONENT32F = 36012,
  461. DEPTH32F_STENCIL8 = 36013,
  462. FLOAT_32_UNSIGNED_INT_24_8_REV = 36269,
  463. FRAMEBUFFER_ATTACHMENT_COLOR_ENCODING = 33296,
  464. FRAMEBUFFER_ATTACHMENT_COMPONENT_TYPE = 33297,
  465. FRAMEBUFFER_ATTACHMENT_RED_SIZE = 33298,
  466. FRAMEBUFFER_ATTACHMENT_GREEN_SIZE = 33299,
  467. FRAMEBUFFER_ATTACHMENT_BLUE_SIZE = 33300,
  468. FRAMEBUFFER_ATTACHMENT_ALPHA_SIZE = 33301,
  469. FRAMEBUFFER_ATTACHMENT_DEPTH_SIZE = 33302,
  470. FRAMEBUFFER_ATTACHMENT_STENCIL_SIZE = 33303,
  471. FRAMEBUFFER_DEFAULT = 33304,
  472. UNSIGNED_INT_24_8 = 34042,
  473. DEPTH24_STENCIL8 = 35056,
  474. UNSIGNED_NORMALIZED = 35863,
  475. DRAW_FRAMEBUFFER_BINDING = 36006,
  476. READ_FRAMEBUFFER = 36008,
  477. DRAW_FRAMEBUFFER = 36009,
  478. READ_FRAMEBUFFER_BINDING = 36010,
  479. RENDERBUFFER_SAMPLES = 36011,
  480. FRAMEBUFFER_ATTACHMENT_TEXTURE_LAYER = 36052,
  481. MAX_COLOR_ATTACHMENTS = 36063,
  482. COLOR_ATTACHMENT1 = 36065,
  483. COLOR_ATTACHMENT2 = 36066,
  484. COLOR_ATTACHMENT3 = 36067,
  485. COLOR_ATTACHMENT4 = 36068,
  486. COLOR_ATTACHMENT5 = 36069,
  487. COLOR_ATTACHMENT6 = 36070,
  488. COLOR_ATTACHMENT7 = 36071,
  489. COLOR_ATTACHMENT8 = 36072,
  490. COLOR_ATTACHMENT9 = 36073,
  491. COLOR_ATTACHMENT10 = 36074,
  492. COLOR_ATTACHMENT11 = 36075,
  493. COLOR_ATTACHMENT12 = 36076,
  494. COLOR_ATTACHMENT13 = 36077,
  495. COLOR_ATTACHMENT14 = 36078,
  496. COLOR_ATTACHMENT15 = 36079,
  497. FRAMEBUFFER_INCOMPLETE_MULTISAMPLE = 36182,
  498. MAX_SAMPLES = 36183,
  499. HALF_FLOAT = 5131,
  500. RG = 33319,
  501. RG_INTEGER = 33320,
  502. R8 = 33321,
  503. RG8 = 33323,
  504. R16F = 33325,
  505. R32F = 33326,
  506. RG16F = 33327,
  507. RG32F = 33328,
  508. R8I = 33329,
  509. R8UI = 33330,
  510. R16I = 33331,
  511. R16UI = 33332,
  512. R32I = 33333,
  513. R32UI = 33334,
  514. RG8I = 33335,
  515. RG8UI = 33336,
  516. RG16I = 33337,
  517. RG16UI = 33338,
  518. RG32I = 33339,
  519. RG32UI = 33340,
  520. VERTEX_ARRAY_BINDING = 34229,
  521. R8_SNORM = 36756,
  522. RG8_SNORM = 36757,
  523. RGB8_SNORM = 36758,
  524. RGBA8_SNORM = 36759,
  525. SIGNED_NORMALIZED = 36764,
  526. COPY_READ_BUFFER = 36662,
  527. COPY_WRITE_BUFFER = 36663,
  528. COPY_READ_BUFFER_BINDING = 36662,
  529. COPY_WRITE_BUFFER_BINDING = 36663,
  530. UNIFORM_BUFFER = 35345,
  531. UNIFORM_BUFFER_BINDING = 35368,
  532. UNIFORM_BUFFER_START = 35369,
  533. UNIFORM_BUFFER_SIZE = 35370,
  534. MAX_VERTEX_UNIFORM_BLOCKS = 35371,
  535. MAX_FRAGMENT_UNIFORM_BLOCKS = 35373,
  536. MAX_COMBINED_UNIFORM_BLOCKS = 35374,
  537. MAX_UNIFORM_BUFFER_BINDINGS = 35375,
  538. MAX_UNIFORM_BLOCK_SIZE = 35376,
  539. MAX_COMBINED_VERTEX_UNIFORM_COMPONENTS = 35377,
  540. MAX_COMBINED_FRAGMENT_UNIFORM_COMPONENTS = 35379,
  541. UNIFORM_BUFFER_OFFSET_ALIGNMENT = 35380,
  542. ACTIVE_UNIFORM_BLOCKS = 35382,
  543. UNIFORM_TYPE = 35383,
  544. UNIFORM_SIZE = 35384,
  545. UNIFORM_BLOCK_INDEX = 35386,
  546. UNIFORM_OFFSET = 35387,
  547. UNIFORM_ARRAY_STRIDE = 35388,
  548. UNIFORM_MATRIX_STRIDE = 35389,
  549. UNIFORM_IS_ROW_MAJOR = 35390,
  550. UNIFORM_BLOCK_BINDING = 35391,
  551. UNIFORM_BLOCK_DATA_SIZE = 35392,
  552. UNIFORM_BLOCK_ACTIVE_UNIFORMS = 35394,
  553. UNIFORM_BLOCK_ACTIVE_UNIFORM_INDICES = 35395,
  554. UNIFORM_BLOCK_REFERENCED_BY_VERTEX_SHADER = 35396,
  555. UNIFORM_BLOCK_REFERENCED_BY_FRAGMENT_SHADER = 35398,
  556. INVALID_INDEX = 4294967295,
  557. MAX_VERTEX_OUTPUT_COMPONENTS = 37154,
  558. MAX_FRAGMENT_INPUT_COMPONENTS = 37157,
  559. MAX_SERVER_WAIT_TIMEOUT = 37137,
  560. OBJECT_TYPE = 37138,
  561. SYNC_CONDITION = 37139,
  562. SYNC_STATUS = 37140,
  563. SYNC_FLAGS = 37141,
  564. SYNC_FENCE = 37142,
  565. SYNC_GPU_COMMANDS_COMPLETE = 37143,
  566. UNSIGNALED = 37144,
  567. SIGNALED = 37145,
  568. ALREADY_SIGNALED = 37146,
  569. TIMEOUT_EXPIRED = 37147,
  570. CONDITION_SATISFIED = 37148,
  571. WAIT_FAILED = 37149,
  572. SYNC_FLUSH_COMMANDS_BIT = 1,
  573. VERTEX_ATTRIB_ARRAY_DIVISOR = 35070,
  574. ANY_SAMPLES_PASSED = 35887,
  575. ANY_SAMPLES_PASSED_CONSERVATIVE = 36202,
  576. SAMPLER_BINDING = 35097,
  577. RGB10_A2UI = 36975,
  578. INT_2_10_10_10_REV = 36255,
  579. TRANSFORM_FEEDBACK = 36386,
  580. TRANSFORM_FEEDBACK_PAUSED = 36387,
  581. TRANSFORM_FEEDBACK_ACTIVE = 36388,
  582. TRANSFORM_FEEDBACK_BINDING = 36389,
  583. COMPRESSED_R11_EAC = 37488,
  584. COMPRESSED_SIGNED_R11_EAC = 37489,
  585. COMPRESSED_RG11_EAC = 37490,
  586. COMPRESSED_SIGNED_RG11_EAC = 37491,
  587. COMPRESSED_RGB8_ETC2 = 37492,
  588. COMPRESSED_SRGB8_ETC2 = 37493,
  589. COMPRESSED_RGB8_PUNCHTHROUGH_ALPHA1_ETC2 = 37494,
  590. COMPRESSED_SRGB8_PUNCHTHROUGH_ALPHA1_ETC2 = 37495,
  591. COMPRESSED_RGBA8_ETC2_EAC = 37496,
  592. COMPRESSED_SRGB8_ALPHA8_ETC2_EAC = 37497,
  593. TEXTURE_IMMUTABLE_FORMAT = 37167,
  594. MAX_ELEMENT_INDEX = 36203,
  595. TEXTURE_IMMUTABLE_LEVELS = 33503,
  596. MAX_TEXTURE_MAX_ANISOTROPY_EXT = 34047
  597. }/**
  598. * A {@link TerrainProvider} that produces terrain geometry by tessellating height maps
  599. retrieved from Elevation Tiles of an an ArcGIS ImageService.
  600. * @example
  601. * var terrainProvider = new Cesium.ArcGISTiledElevationTerrainProvider({
  602. url : 'https://elevation3d.arcgis.com/arcgis/rest/services/WorldElevation3D/Terrain3D/ImageServer',
  603. token : 'KED1aF_I4UzXOHy3BnhwyBHU4l5oY6rO6walkmHoYqGp4XyIWUd5YZUC1ZrLAzvV40pR6gBXQayh0eFA8m6vPg..'
  604. });
  605. viewer.terrainProvider = terrainProvider;
  606. * @param options - Object with the following properties:
  607. * @param options.url - The URL of the ArcGIS ImageServer service.
  608. * @param [options.token] - The authorization token to use to connect to the service.
  609. * @param [options.ellipsoid] - The ellipsoid. If the tilingScheme is specified,
  610. this parameter is ignored and the tiling scheme's ellipsoid is used instead.
  611. If neither parameter is specified, the WGS84 ellipsoid is used.
  612. */
  613. export class ArcGISTiledElevationTerrainProvider {
  614. constructor(options: {
  615. url: Resource | string | Promise<Resource> | Promise<string>;
  616. token?: string;
  617. ellipsoid?: Ellipsoid;
  618. });
  619. /**
  620. * Gets an event that is raised when the terrain provider encounters an asynchronous error. By subscribing
  621. to the event, you will be notified of the error and can potentially recover from it. Event listeners
  622. are passed an instance of {@link TileProviderError}.
  623. */
  624. errorEvent: Event;
  625. /**
  626. * Gets the credit to display when this terrain provider is active. Typically this is used to credit
  627. the source of the terrain. This function should not be called before {@link ArcGISTiledElevationTerrainProvider#ready} returns true.
  628. */
  629. credit: Credit;
  630. /**
  631. * Gets the tiling scheme used by this provider. This function should
  632. not be called before {@link ArcGISTiledElevationTerrainProvider#ready} returns true.
  633. */
  634. tilingScheme: GeographicTilingScheme;
  635. /**
  636. * Gets a value indicating whether or not the provider is ready for use.
  637. */
  638. ready: boolean;
  639. /**
  640. * Gets a promise that resolves to true when the provider is ready for use.
  641. */
  642. readonly readyPromise: Promise<boolean>;
  643. /**
  644. * Gets a value indicating whether or not the provider includes a water mask. The water mask
  645. indicates which areas of the globe are water rather than land, so they can be rendered
  646. as a reflective surface with animated waves. This function should not be
  647. called before {@link ArcGISTiledElevationTerrainProvider#ready} returns true.
  648. */
  649. hasWaterMask: boolean;
  650. /**
  651. * Gets a value indicating whether or not the requested tiles include vertex normals.
  652. This function should not be called before {@link ArcGISTiledElevationTerrainProvider#ready} returns true.
  653. */
  654. hasVertexNormals: boolean;
  655. /**
  656. * Gets an object that can be used to determine availability of terrain from this provider, such as
  657. at points and in rectangles. This function should not be called before
  658. {@link TerrainProvider#ready} returns true. This property may be undefined if availability
  659. information is not available.
  660. */
  661. availability: TileAvailability;
  662. /**
  663. * Requests the geometry for a given tile. This function should not be called before
  664. {@link ArcGISTiledElevationTerrainProvider#ready} returns true. The result includes terrain
  665. data and indicates that all child tiles are available.
  666. * @param x - The X coordinate of the tile for which to request geometry.
  667. * @param y - The Y coordinate of the tile for which to request geometry.
  668. * @param level - The level of the tile for which to request geometry.
  669. * @param [request] - The request object. Intended for internal use only.
  670. * @returns A promise for the requested geometry. If this method
  671. returns undefined instead of a promise, it is an indication that too many requests are already
  672. pending and the request will be retried later.
  673. */
  674. requestTileGeometry(x: number, y: number, level: number, request?: Request): Promise<TerrainData> | undefined;
  675. /**
  676. * Gets the maximum geometric error allowed in a tile at a given level.
  677. * @param level - The tile level for which to get the maximum geometric error.
  678. * @returns The maximum geometric error.
  679. */
  680. getLevelMaximumGeometricError(level: number): number;
  681. /**
  682. * Determines whether data for a tile is available to be loaded.
  683. * @param x - The X coordinate of the tile for which to request geometry.
  684. * @param y - The Y coordinate of the tile for which to request geometry.
  685. * @param level - The level of the tile for which to request geometry.
  686. * @returns Undefined if not supported, otherwise true or false.
  687. */
  688. getTileDataAvailable(x: number, y: number, level: number): boolean;
  689. /**
  690. * Makes sure we load availability data for a tile
  691. * @param x - The X coordinate of the tile for which to request geometry.
  692. * @param y - The Y coordinate of the tile for which to request geometry.
  693. * @param level - The level of the tile for which to request geometry.
  694. * @returns Undefined if nothing need to be loaded or a Promise that resolves when all required tiles are loaded
  695. */
  696. loadTileDataAvailability(x: number, y: number, level: number): undefined | Promise<void>;
  697. }
  698. /**
  699. * ArcType defines the path that should be taken connecting vertices.
  700. */
  701. export enum ArcType {
  702. /**
  703. * Straight line that does not conform to the surface of the ellipsoid.
  704. */
  705. NONE = 0,
  706. /**
  707. * Follow geodesic path.
  708. */
  709. GEODESIC = 1,
  710. /**
  711. * Follow rhumb or loxodrome path.
  712. */
  713. RHUMB = 2
  714. }
  715. /**
  716. * A collection of key-value pairs that is stored as a hash for easy
  717. lookup but also provides an array for fast iteration.
  718. */
  719. export class AssociativeArray {
  720. constructor();
  721. /**
  722. * Gets the number of items in the collection.
  723. */
  724. length: number;
  725. /**
  726. * Gets an unordered array of all values in the collection.
  727. This is a live array that will automatically reflect the values in the collection,
  728. it should not be modified directly.
  729. */
  730. values: any[];
  731. /**
  732. * Determines if the provided key is in the array.
  733. * @param key - The key to check.
  734. * @returns <code>true</code> if the key is in the array, <code>false</code> otherwise.
  735. */
  736. contains(key: string | number): boolean;
  737. /**
  738. * Associates the provided key with the provided value. If the key already
  739. exists, it is overwritten with the new value.
  740. * @param key - A unique identifier.
  741. * @param value - The value to associate with the provided key.
  742. */
  743. set(key: string | number, value: any): void;
  744. /**
  745. * Retrieves the value associated with the provided key.
  746. * @param key - The key whose value is to be retrieved.
  747. * @returns The associated value, or undefined if the key does not exist in the collection.
  748. */
  749. get(key: string | number): any;
  750. /**
  751. * Removes a key-value pair from the collection.
  752. * @param key - The key to be removed.
  753. * @returns True if it was removed, false if the key was not in the collection.
  754. */
  755. remove(key: string | number): boolean;
  756. /**
  757. * Clears the collection.
  758. */
  759. removeAll(): void;
  760. }
  761. /**
  762. * Creates an instance of an AxisAlignedBoundingBox from the minimum and maximum points along the x, y, and z axes.
  763. * @param [minimum = Cartesian3.ZERO] - The minimum point along the x, y, and z axes.
  764. * @param [maximum = Cartesian3.ZERO] - The maximum point along the x, y, and z axes.
  765. * @param [center] - The center of the box; automatically computed if not supplied.
  766. */
  767. export class AxisAlignedBoundingBox {
  768. constructor(minimum?: Cartesian3, maximum?: Cartesian3, center?: Cartesian3);
  769. /**
  770. * The minimum point defining the bounding box.
  771. */
  772. minimum: Cartesian3;
  773. /**
  774. * The maximum point defining the bounding box.
  775. */
  776. maximum: Cartesian3;
  777. /**
  778. * The center point of the bounding box.
  779. */
  780. center: Cartesian3;
  781. /**
  782. * Computes an instance of an AxisAlignedBoundingBox. The box is determined by
  783. finding the points spaced the farthest apart on the x, y, and z axes.
  784. * @example
  785. * // Compute an axis aligned bounding box enclosing two points.
  786. var box = Cesium.AxisAlignedBoundingBox.fromPoints([new Cesium.Cartesian3(2, 0, 0), new Cesium.Cartesian3(-2, 0, 0)]);
  787. * @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.
  788. * @param [result] - The object onto which to store the result.
  789. * @returns The modified result parameter or a new AxisAlignedBoundingBox instance if one was not provided.
  790. */
  791. static fromPoints(positions: Cartesian3[], result?: AxisAlignedBoundingBox): AxisAlignedBoundingBox;
  792. /**
  793. * Duplicates a AxisAlignedBoundingBox instance.
  794. * @param box - The bounding box to duplicate.
  795. * @param [result] - The object onto which to store the result.
  796. * @returns The modified result parameter or a new AxisAlignedBoundingBox instance if none was provided. (Returns undefined if box is undefined)
  797. */
  798. static clone(box: AxisAlignedBoundingBox, result?: AxisAlignedBoundingBox): AxisAlignedBoundingBox;
  799. /**
  800. * Compares the provided AxisAlignedBoundingBox componentwise and returns
  801. <code>true</code> if they are equal, <code>false</code> otherwise.
  802. * @param [left] - The first AxisAlignedBoundingBox.
  803. * @param [right] - The second AxisAlignedBoundingBox.
  804. * @returns <code>true</code> if left and right are equal, <code>false</code> otherwise.
  805. */
  806. static equals(left?: AxisAlignedBoundingBox, right?: AxisAlignedBoundingBox): boolean;
  807. /**
  808. * Determines which side of a plane a box is located.
  809. * @param box - The bounding box to test.
  810. * @param plane - The plane to test against.
  811. * @returns {@link Intersect.INSIDE} if the entire box is on the side of the plane
  812. the normal is pointing, {@link Intersect.OUTSIDE} if the entire box is
  813. on the opposite side, and {@link Intersect.INTERSECTING} if the box
  814. intersects the plane.
  815. */
  816. static intersectPlane(box: AxisAlignedBoundingBox, plane: Plane): Intersect;
  817. /**
  818. * Duplicates this AxisAlignedBoundingBox instance.
  819. * @param [result] - The object onto which to store the result.
  820. * @returns The modified result parameter or a new AxisAlignedBoundingBox instance if one was not provided.
  821. */
  822. clone(result?: AxisAlignedBoundingBox): AxisAlignedBoundingBox;
  823. /**
  824. * Determines which side of a plane this box is located.
  825. * @param plane - The plane to test against.
  826. * @returns {@link Intersect.INSIDE} if the entire box is on the side of the plane
  827. the normal is pointing, {@link Intersect.OUTSIDE} if the entire box is
  828. on the opposite side, and {@link Intersect.INTERSECTING} if the box
  829. intersects the plane.
  830. */
  831. intersectPlane(plane: Plane): Intersect;
  832. /**
  833. * Compares this AxisAlignedBoundingBox against the provided AxisAlignedBoundingBox componentwise and returns
  834. <code>true</code> if they are equal, <code>false</code> otherwise.
  835. * @param [right] - The right hand side AxisAlignedBoundingBox.
  836. * @returns <code>true</code> if they are equal, <code>false</code> otherwise.
  837. */
  838. equals(right?: AxisAlignedBoundingBox): boolean;
  839. }
  840. /**
  841. * Computes the barycentric coordinates for a point with respect to a triangle.
  842. * @example
  843. * // Returns Cartesian3.UNIT_X
  844. var p = new Cesium.Cartesian3(-1.0, 0.0, 0.0);
  845. var b = Cesium.barycentricCoordinates(p,
  846. new Cesium.Cartesian3(-1.0, 0.0, 0.0),
  847. new Cesium.Cartesian3( 1.0, 0.0, 0.0),
  848. new Cesium.Cartesian3( 0.0, 1.0, 1.0));
  849. * @param point - The point to test.
  850. * @param p0 - The first point of the triangle, corresponding to the barycentric x-axis.
  851. * @param p1 - The second point of the triangle, corresponding to the barycentric y-axis.
  852. * @param p2 - The third point of the triangle, corresponding to the barycentric z-axis.
  853. * @param [result] - The object onto which to store the result.
  854. * @returns The modified result parameter or a new Cartesian3 instance if one was not provided.
  855. */
  856. export function barycentricCoordinates(point: Cartesian2 | Cartesian3, p0: Cartesian2 | Cartesian3, p1: Cartesian2 | Cartesian3, p2: Cartesian2 | Cartesian3, result?: Cartesian3): Cartesian3;
  857. /**
  858. * Finds an item in a sorted array.
  859. * @example
  860. * // Create a comparator function to search through an array of numbers.
  861. function comparator(a, b) {
  862. return a - b;
  863. };
  864. var numbers = [0, 2, 4, 6, 8];
  865. var index = Cesium.binarySearch(numbers, 6, comparator); // 3
  866. * @param array - The sorted array to search.
  867. * @param itemToFind - The item to find in the array.
  868. * @param comparator - The function to use to compare the item to
  869. elements in the array.
  870. * @returns The index of <code>itemToFind</code> in the array, if it exists. If <code>itemToFind</code>
  871. does not exist, the return value is a negative number which is the bitwise complement (~)
  872. of the index before which the itemToFind should be inserted in order to maintain the
  873. sorted order of the array.
  874. */
  875. export function binarySearch(array: any[], itemToFind: any, comparator: binarySearchComparator): number;
  876. /**
  877. * A function used to compare two items while performing a binary search.
  878. * @example
  879. * function compareNumbers(a, b) {
  880. return a - b;
  881. }
  882. * @param a - An item in the array.
  883. * @param b - The item being searched for.
  884. */
  885. export type binarySearchComparator = (a: any, b: any) => number;
  886. /**
  887. * Provides geocoding through Bing Maps.
  888. * @param options - Object with the following properties:
  889. * @param options.key - A key to use with the Bing Maps geocoding service
  890. */
  891. export class BingMapsGeocoderService {
  892. constructor(options: {
  893. key: string;
  894. });
  895. /**
  896. * The URL endpoint for the Bing geocoder service
  897. */
  898. readonly url: string;
  899. /**
  900. * The key for the Bing geocoder service
  901. */
  902. readonly key: string;
  903. /**
  904. * @param query - The query to be sent to the geocoder service
  905. */
  906. geocode(query: string): Promise<GeocoderService.Result[]>;
  907. }
  908. /**
  909. * A bounding rectangle given by a corner, width and height.
  910. * @param [x = 0.0] - The x coordinate of the rectangle.
  911. * @param [y = 0.0] - The y coordinate of the rectangle.
  912. * @param [width = 0.0] - The width of the rectangle.
  913. * @param [height = 0.0] - The height of the rectangle.
  914. */
  915. export class BoundingRectangle {
  916. constructor(x?: number, y?: number, width?: number, height?: number);
  917. /**
  918. * The x coordinate of the rectangle.
  919. */
  920. x: number;
  921. /**
  922. * The y coordinate of the rectangle.
  923. */
  924. y: number;
  925. /**
  926. * The width of the rectangle.
  927. */
  928. width: number;
  929. /**
  930. * The height of the rectangle.
  931. */
  932. height: number;
  933. /**
  934. * The number of elements used to pack the object into an array.
  935. */
  936. static packedLength: number;
  937. /**
  938. * Stores the provided instance into the provided array.
  939. * @param value - The value to pack.
  940. * @param array - The array to pack into.
  941. * @param [startingIndex = 0] - The index into the array at which to start packing the elements.
  942. * @returns The array that was packed into
  943. */
  944. static pack(value: BoundingRectangle, array: number[], startingIndex?: number): number[];
  945. /**
  946. * Retrieves an instance from a packed array.
  947. * @param array - The packed array.
  948. * @param [startingIndex = 0] - The starting index of the element to be unpacked.
  949. * @param [result] - The object into which to store the result.
  950. * @returns The modified result parameter or a new BoundingRectangle instance if one was not provided.
  951. */
  952. static unpack(array: number[], startingIndex?: number, result?: BoundingRectangle): BoundingRectangle;
  953. /**
  954. * Computes a bounding rectangle enclosing the list of 2D points.
  955. The rectangle is oriented with the corner at the bottom left.
  956. * @param positions - List of points that the bounding rectangle will enclose. Each point must have <code>x</code> and <code>y</code> properties.
  957. * @param [result] - The object onto which to store the result.
  958. * @returns The modified result parameter or a new BoundingRectangle instance if one was not provided.
  959. */
  960. static fromPoints(positions: Cartesian2[], result?: BoundingRectangle): BoundingRectangle;
  961. /**
  962. * Computes a bounding rectangle from a rectangle.
  963. * @param rectangle - The valid rectangle used to create a bounding rectangle.
  964. * @param [projection = GeographicProjection] - The projection used to project the rectangle into 2D.
  965. * @param [result] - The object onto which to store the result.
  966. * @returns The modified result parameter or a new BoundingRectangle instance if one was not provided.
  967. */
  968. static fromRectangle(rectangle: Rectangle, projection?: any, result?: BoundingRectangle): BoundingRectangle;
  969. /**
  970. * Duplicates a BoundingRectangle instance.
  971. * @param rectangle - The bounding rectangle to duplicate.
  972. * @param [result] - The object onto which to store the result.
  973. * @returns The modified result parameter or a new BoundingRectangle instance if one was not provided. (Returns undefined if rectangle is undefined)
  974. */
  975. static clone(rectangle: BoundingRectangle, result?: BoundingRectangle): BoundingRectangle;
  976. /**
  977. * Computes a bounding rectangle that is the union of the left and right bounding rectangles.
  978. * @param left - A rectangle to enclose in bounding rectangle.
  979. * @param right - A rectangle to enclose in a bounding rectangle.
  980. * @param [result] - The object onto which to store the result.
  981. * @returns The modified result parameter or a new BoundingRectangle instance if one was not provided.
  982. */
  983. static union(left: BoundingRectangle, right: BoundingRectangle, result?: BoundingRectangle): BoundingRectangle;
  984. /**
  985. * Computes a bounding rectangle by enlarging the provided rectangle until it contains the provided point.
  986. * @param rectangle - A rectangle to expand.
  987. * @param point - A point to enclose in a bounding rectangle.
  988. * @param [result] - The object onto which to store the result.
  989. * @returns The modified result parameter or a new BoundingRectangle instance if one was not provided.
  990. */
  991. static expand(rectangle: BoundingRectangle, point: Cartesian2, result?: BoundingRectangle): BoundingRectangle;
  992. /**
  993. * Determines if two rectangles intersect.
  994. * @param left - A rectangle to check for intersection.
  995. * @param right - The other rectangle to check for intersection.
  996. * @returns <code>Intersect.INTESECTING</code> if the rectangles intersect, <code>Intersect.OUTSIDE</code> otherwise.
  997. */
  998. static intersect(left: BoundingRectangle, right: BoundingRectangle): Intersect;
  999. /**
  1000. * Compares the provided BoundingRectangles componentwise and returns
  1001. <code>true</code> if they are equal, <code>false</code> otherwise.
  1002. * @param [left] - The first BoundingRectangle.
  1003. * @param [right] - The second BoundingRectangle.
  1004. * @returns <code>true</code> if left and right are equal, <code>false</code> otherwise.
  1005. */
  1006. static equals(left?: BoundingRectangle, right?: BoundingRectangle): boolean;
  1007. /**
  1008. * Duplicates this BoundingRectangle instance.
  1009. * @param [result] - The object onto which to store the result.
  1010. * @returns The modified result parameter or a new BoundingRectangle instance if one was not provided.
  1011. */
  1012. clone(result?: BoundingRectangle): BoundingRectangle;
  1013. /**
  1014. * Determines if this rectangle intersects with another.
  1015. * @param right - A rectangle to check for intersection.
  1016. * @returns <code>Intersect.INTESECTING</code> if the rectangles intersect, <code>Intersect.OUTSIDE</code> otherwise.
  1017. */
  1018. intersect(right: BoundingRectangle): Intersect;
  1019. /**
  1020. * Compares this BoundingRectangle against the provided BoundingRectangle componentwise and returns
  1021. <code>true</code> if they are equal, <code>false</code> otherwise.
  1022. * @param [right] - The right hand side BoundingRectangle.
  1023. * @returns <code>true</code> if they are equal, <code>false</code> otherwise.
  1024. */
  1025. equals(right?: BoundingRectangle): boolean;
  1026. }
  1027. /**
  1028. * A bounding sphere with a center and a radius.
  1029. * @param [center = Cartesian3.ZERO] - The center of the bounding sphere.
  1030. * @param [radius = 0.0] - The radius of the bounding sphere.
  1031. */
  1032. export class BoundingSphere {
  1033. constructor(center?: Cartesian3, radius?: number);
  1034. /**
  1035. * The center point of the sphere.
  1036. */
  1037. center: Cartesian3;
  1038. /**
  1039. * The radius of the sphere.
  1040. */
  1041. radius: number;
  1042. /**
  1043. * Computes a tight-fitting bounding sphere enclosing a list of 3D Cartesian points.
  1044. The bounding sphere is computed by running two algorithms, a naive algorithm and
  1045. Ritter's algorithm. The smaller of the two spheres is used to ensure a tight fit.
  1046. * @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.
  1047. * @param [result] - The object onto which to store the result.
  1048. * @returns The modified result parameter or a new BoundingSphere instance if one was not provided.
  1049. */
  1050. static fromPoints(positions?: Cartesian3[], result?: BoundingSphere): BoundingSphere;
  1051. /**
  1052. * Computes a bounding sphere from a rectangle projected in 2D.
  1053. * @param [rectangle] - The rectangle around which to create a bounding sphere.
  1054. * @param [projection = GeographicProjection] - The projection used to project the rectangle into 2D.
  1055. * @param [result] - The object onto which to store the result.
  1056. * @returns The modified result parameter or a new BoundingSphere instance if none was provided.
  1057. */
  1058. static fromRectangle2D(rectangle?: Rectangle, projection?: any, result?: BoundingSphere): BoundingSphere;
  1059. /**
  1060. * Computes a bounding sphere from a rectangle projected in 2D. The bounding sphere accounts for the
  1061. object's minimum and maximum heights over the rectangle.
  1062. * @param [rectangle] - The rectangle around which to create a bounding sphere.
  1063. * @param [projection = GeographicProjection] - The projection used to project the rectangle into 2D.
  1064. * @param [minimumHeight = 0.0] - The minimum height over the rectangle.
  1065. * @param [maximumHeight = 0.0] - The maximum height over the rectangle.
  1066. * @param [result] - The object onto which to store the result.
  1067. * @returns The modified result parameter or a new BoundingSphere instance if none was provided.
  1068. */
  1069. static fromRectangleWithHeights2D(rectangle?: Rectangle, projection?: any, minimumHeight?: number, maximumHeight?: number, result?: BoundingSphere): BoundingSphere;
  1070. /**
  1071. * Computes a bounding sphere from a rectangle in 3D. The bounding sphere is created using a subsample of points
  1072. on the ellipsoid and contained in the rectangle. It may not be accurate for all rectangles on all types of ellipsoids.
  1073. * @param [rectangle] - The valid rectangle used to create a bounding sphere.
  1074. * @param [ellipsoid = Ellipsoid.WGS84] - The ellipsoid used to determine positions of the rectangle.
  1075. * @param [surfaceHeight = 0.0] - The height above the surface of the ellipsoid.
  1076. * @param [result] - The object onto which to store the result.
  1077. * @returns The modified result parameter or a new BoundingSphere instance if none was provided.
  1078. */
  1079. static fromRectangle3D(rectangle?: Rectangle, ellipsoid?: Ellipsoid, surfaceHeight?: number, result?: BoundingSphere): BoundingSphere;
  1080. /**
  1081. * Computes a tight-fitting bounding sphere enclosing a list of 3D points, where the points are
  1082. stored in a flat array in X, Y, Z, order. The bounding sphere is computed by running two
  1083. algorithms, a naive algorithm and Ritter's algorithm. The smaller of the two spheres is used to
  1084. ensure a tight fit.
  1085. * @example
  1086. * // Compute the bounding sphere from 3 positions, each specified relative to a center.
  1087. // In addition to the X, Y, and Z coordinates, the points array contains two additional
  1088. // elements per point which are ignored for the purpose of computing the bounding sphere.
  1089. var center = new Cesium.Cartesian3(1.0, 2.0, 3.0);
  1090. var points = [1.0, 2.0, 3.0, 0.1, 0.2,
  1091. 4.0, 5.0, 6.0, 0.1, 0.2,
  1092. 7.0, 8.0, 9.0, 0.1, 0.2];
  1093. var sphere = Cesium.BoundingSphere.fromVertices(points, center, 5);
  1094. * @param [positions] - An array of points 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 [center = Cartesian3.ZERO] - The position to which the positions are relative, which need not be the
  1097. origin of the coordinate system. This is useful when the positions are to be used for
  1098. relative-to-center (RTC) rendering.
  1099. * @param [stride = 3] - The number of array elements per vertex. It must be at least 3, but it may
  1100. be higher. Regardless of the value of this parameter, the X coordinate of the first position
  1101. is at array index 0, the Y coordinate is at array index 1, and the Z coordinate is at array index
  1102. 2. When stride is 3, the X coordinate of the next position then begins at array index 3. If
  1103. the stride is 5, however, two array elements are skipped and the next position begins at array
  1104. index 5.
  1105. * @param [result] - The object onto which to store the result.
  1106. * @returns The modified result parameter or a new BoundingSphere instance if one was not provided.
  1107. */
  1108. static fromVertices(positions?: number[], center?: Cartesian3, stride?: number, result?: BoundingSphere): BoundingSphere;
  1109. /**
  1110. * Computes a tight-fitting bounding sphere enclosing a list of EncodedCartesian3s, where the points are
  1111. stored in parallel flat arrays in X, Y, Z, order. The bounding sphere is computed by running two
  1112. algorithms, a naive algorithm and Ritter's algorithm. The smaller of the two spheres is used to
  1113. ensure a tight fit.
  1114. * @param [positionsHigh] - An array of high bits of the encoded cartesians that the bounding sphere will enclose. Each point
  1115. is formed from three elements in the array in the order X, Y, Z.
  1116. * @param [positionsLow] - An array of low bits of the encoded cartesians that the bounding sphere will enclose. Each point
  1117. is formed from three elements in the array in the order X, Y, Z.
  1118. * @param [result] - The object onto which to store the result.
  1119. * @returns The modified result parameter or a new BoundingSphere instance if one was not provided.
  1120. */
  1121. static fromEncodedCartesianVertices(positionsHigh?: number[], positionsLow?: number[], result?: BoundingSphere): BoundingSphere;
  1122. /**
  1123. * Computes a bounding sphere from the corner points of an axis-aligned bounding box. The sphere
  1124. tighly and fully encompases the box.
  1125. * @example
  1126. * // Create a bounding sphere around the unit cube
  1127. var sphere = Cesium.BoundingSphere.fromCornerPoints(new Cesium.Cartesian3(-0.5, -0.5, -0.5), new Cesium.Cartesian3(0.5, 0.5, 0.5));
  1128. * @param [corner] - The minimum height over the rectangle.
  1129. * @param [oppositeCorner] - The maximum height over the rectangle.
  1130. * @param [result] - The object onto which to store the result.
  1131. * @returns The modified result parameter or a new BoundingSphere instance if none was provided.
  1132. */
  1133. static fromCornerPoints(corner?: Cartesian3, oppositeCorner?: Cartesian3, result?: BoundingSphere): BoundingSphere;
  1134. /**
  1135. * Creates a bounding sphere encompassing an ellipsoid.
  1136. * @example
  1137. * var boundingSphere = Cesium.BoundingSphere.fromEllipsoid(ellipsoid);
  1138. * @param ellipsoid - The ellipsoid around which to create a bounding sphere.
  1139. * @param [result] - The object onto which to store the result.
  1140. * @returns The modified result parameter or a new BoundingSphere instance if none was provided.
  1141. */
  1142. static fromEllipsoid(ellipsoid: Ellipsoid, result?: BoundingSphere): BoundingSphere;
  1143. /**
  1144. * Computes a tight-fitting bounding sphere enclosing the provided array of bounding spheres.
  1145. * @param [boundingSpheres] - The array of bounding spheres.
  1146. * @param [result] - The object onto which to store the result.
  1147. * @returns The modified result parameter or a new BoundingSphere instance if none was provided.
  1148. */
  1149. static fromBoundingSpheres(boundingSpheres?: BoundingSphere[], result?: BoundingSphere): BoundingSphere;
  1150. /**
  1151. * Computes a tight-fitting bounding sphere enclosing the provided oriented bounding box.
  1152. * @param orientedBoundingBox - The oriented bounding box.
  1153. * @param [result] - The object onto which to store the result.
  1154. * @returns The modified result parameter or a new BoundingSphere instance if none was provided.
  1155. */
  1156. static fromOrientedBoundingBox(orientedBoundingBox: OrientedBoundingBox, result?: BoundingSphere): BoundingSphere;
  1157. /**
  1158. * Duplicates a BoundingSphere instance.
  1159. * @param sphere - The bounding sphere to duplicate.
  1160. * @param [result] - The object onto which to store the result.
  1161. * @returns The modified result parameter or a new BoundingSphere instance if none was provided. (Returns undefined if sphere is undefined)
  1162. */
  1163. static clone(sphere: BoundingSphere, result?: BoundingSphere): BoundingSphere;
  1164. /**
  1165. * The number of elements used to pack the object into an array.
  1166. */
  1167. static packedLength: number;
  1168. /**
  1169. * Stores the provided instance into the provided array.
  1170. * @param value - The value to pack.
  1171. * @param array - The array to pack into.
  1172. * @param [startingIndex = 0] - The index into the array at which to start packing the elements.
  1173. * @returns The array that was packed into
  1174. */
  1175. static pack(value: BoundingSphere, array: number[], startingIndex?: number): number[];
  1176. /**
  1177. * Retrieves an instance from a packed array.
  1178. * @param array - The packed array.
  1179. * @param [startingIndex = 0] - The starting index of the element to be unpacked.
  1180. * @param [result] - The object into which to store the result.
  1181. * @returns The modified result parameter or a new BoundingSphere instance if one was not provided.
  1182. */
  1183. static unpack(array: number[], startingIndex?: number, result?: BoundingSphere): BoundingSphere;
  1184. /**
  1185. * Computes a bounding sphere that contains both the left and right bounding spheres.
  1186. * @param left - A sphere to enclose in a bounding sphere.
  1187. * @param right - A sphere to enclose in a bounding sphere.
  1188. * @param [result] - The object onto which to store the result.
  1189. * @returns The modified result parameter or a new BoundingSphere instance if none was provided.
  1190. */
  1191. static union(left: BoundingSphere, right: BoundingSphere, result?: BoundingSphere): BoundingSphere;
  1192. /**
  1193. * Computes a bounding sphere by enlarging the provided sphere to contain the provided point.
  1194. * @param sphere - A sphere to expand.
  1195. * @param point - A point to enclose in a bounding sphere.
  1196. * @param [result] - The object onto which to store the result.
  1197. * @returns The modified result parameter or a new BoundingSphere instance if none was provided.
  1198. */
  1199. static expand(sphere: BoundingSphere, point: Cartesian3, result?: BoundingSphere): BoundingSphere;
  1200. /**
  1201. * Determines which side of a plane a sphere is located.
  1202. * @param sphere - The bounding sphere to test.
  1203. * @param plane - The plane to test against.
  1204. * @returns {@link Intersect.INSIDE} if the entire sphere is on the side of the plane
  1205. the normal is pointing, {@link Intersect.OUTSIDE} if the entire sphere is
  1206. on the opposite side, and {@link Intersect.INTERSECTING} if the sphere
  1207. intersects the plane.
  1208. */
  1209. static intersectPlane(sphere: BoundingSphere, plane: Plane): Intersect;
  1210. /**
  1211. * Applies a 4x4 affine transformation matrix to a bounding sphere.
  1212. * @param sphere - The bounding sphere to apply the transformation to.
  1213. * @param transform - The transformation matrix to apply to the bounding sphere.
  1214. * @param [result] - The object onto which to store the result.
  1215. * @returns The modified result parameter or a new BoundingSphere instance if none was provided.
  1216. */
  1217. static transform(sphere: BoundingSphere, transform: Matrix4, result?: BoundingSphere): BoundingSphere;
  1218. /**
  1219. * Computes the estimated distance squared from the closest point on a bounding sphere to a point.
  1220. * @example
  1221. * // Sort bounding spheres from back to front
  1222. spheres.sort(function(a, b) {
  1223. return Cesium.BoundingSphere.distanceSquaredTo(b, camera.positionWC) - Cesium.BoundingSphere.distanceSquaredTo(a, camera.positionWC);
  1224. });
  1225. * @param sphere - The sphere.
  1226. * @param cartesian - The point
  1227. * @returns The estimated distance squared from the bounding sphere to the point.
  1228. */
  1229. static distanceSquaredTo(sphere: BoundingSphere, cartesian: Cartesian3): number;
  1230. /**
  1231. * Applies a 4x4 affine transformation matrix to a bounding sphere where there is no scale
  1232. The transformation matrix is not verified to have a uniform scale of 1.
  1233. This method is faster than computing the general bounding sphere transform using {@link BoundingSphere.transform}.
  1234. * @example
  1235. * var modelMatrix = Cesium.Transforms.eastNorthUpToFixedFrame(positionOnEllipsoid);
  1236. var boundingSphere = new Cesium.BoundingSphere();
  1237. var newBoundingSphere = Cesium.BoundingSphere.transformWithoutScale(boundingSphere, modelMatrix);
  1238. * @param sphere - The bounding sphere to apply the transformation to.
  1239. * @param transform - The transformation matrix to apply to the bounding sphere.
  1240. * @param [result] - The object onto which to store the result.
  1241. * @returns The modified result parameter or a new BoundingSphere instance if none was provided.
  1242. */
  1243. static transformWithoutScale(sphere: BoundingSphere, transform: Matrix4, result?: BoundingSphere): BoundingSphere;
  1244. /**
  1245. * The distances calculated by the vector from the center of the bounding sphere to position projected onto direction
  1246. plus/minus the radius of the bounding sphere.
  1247. <br>
  1248. If you imagine the infinite number of planes with normal direction, this computes the smallest distance to the
  1249. closest and farthest planes from position that intersect the bounding sphere.
  1250. * @param sphere - The bounding sphere to calculate the distance to.
  1251. * @param position - The position to calculate the distance from.
  1252. * @param direction - The direction from position.
  1253. * @param [result] - A Interval to store the nearest and farthest distances.
  1254. * @returns The nearest and farthest distances on the bounding sphere from position in direction.
  1255. */
  1256. static computePlaneDistances(sphere: BoundingSphere, position: Cartesian3, direction: Cartesian3, result?: Interval): Interval;
  1257. /**
  1258. * Creates a bounding sphere in 2D from a bounding sphere in 3D world coordinates.
  1259. * @param sphere - The bounding sphere to transform to 2D.
  1260. * @param [projection = GeographicProjection] - The projection to 2D.
  1261. * @param [result] - The object onto which to store the result.
  1262. * @returns The modified result parameter or a new BoundingSphere instance if none was provided.
  1263. */
  1264. static projectTo2D(sphere: BoundingSphere, projection?: any, result?: BoundingSphere): BoundingSphere;
  1265. /**
  1266. * Determines whether or not a sphere is hidden from view by the occluder.
  1267. * @param sphere - The bounding sphere surrounding the occludee object.
  1268. * @param occluder - The occluder.
  1269. * @returns <code>true</code> if the sphere is not visible; otherwise <code>false</code>.
  1270. */
  1271. static isOccluded(sphere: BoundingSphere, occluder: Occluder): boolean;
  1272. /**
  1273. * Compares the provided BoundingSphere componentwise and returns
  1274. <code>true</code> if they are equal, <code>false</code> otherwise.
  1275. * @param [left] - The first BoundingSphere.
  1276. * @param [right] - The second BoundingSphere.
  1277. * @returns <code>true</code> if left and right are equal, <code>false</code> otherwise.
  1278. */
  1279. static equals(left?: BoundingSphere, right?: BoundingSphere): boolean;
  1280. /**
  1281. * Determines which side of a plane the sphere is located.
  1282. * @param plane - The plane to test against.
  1283. * @returns {@link Intersect.INSIDE} if the entire sphere is on the side of the plane
  1284. the normal is pointing, {@link Intersect.OUTSIDE} if the entire sphere is
  1285. on the opposite side, and {@link Intersect.INTERSECTING} if the sphere
  1286. intersects the plane.
  1287. */
  1288. intersectPlane(plane: Plane): Intersect;
  1289. /**
  1290. * Computes the estimated distance squared from the closest point on a bounding sphere to a point.
  1291. * @example
  1292. * // Sort bounding spheres from back to front
  1293. spheres.sort(function(a, b) {
  1294. return b.distanceSquaredTo(camera.positionWC) - a.distanceSquaredTo(camera.positionWC);
  1295. });
  1296. * @param cartesian - The point
  1297. * @returns The estimated distance squared from the bounding sphere to the point.
  1298. */
  1299. distanceSquaredTo(cartesian: Cartesian3): number;
  1300. /**
  1301. * The distances calculated by the vector from the center of the bounding sphere to position projected onto direction
  1302. plus/minus the radius of the bounding sphere.
  1303. <br>
  1304. If you imagine the infinite number of planes with normal direction, this computes the smallest distance to the
  1305. closest and farthest planes from position that intersect the bounding sphere.
  1306. * @param position - The position to calculate the distance from.
  1307. * @param direction - The direction from position.
  1308. * @param [result] - A Interval to store the nearest and farthest distances.
  1309. * @returns The nearest and farthest distances on the bounding sphere from position in direction.
  1310. */
  1311. computePlaneDistances(position: Cartesian3, direction: Cartesian3, result?: Interval): Interval;
  1312. /**
  1313. * Determines whether or not a sphere is hidden from view by the occluder.
  1314. * @param occluder - The occluder.
  1315. * @returns <code>true</code> if the sphere is not visible; otherwise <code>false</code>.
  1316. */
  1317. isOccluded(occluder: Occluder): boolean;
  1318. /**
  1319. * Compares this BoundingSphere against the provided BoundingSphere componentwise and returns
  1320. <code>true</code> if they are equal, <code>false</code> otherwise.
  1321. * @param [right] - The right hand side BoundingSphere.
  1322. * @returns <code>true</code> if they are equal, <code>false</code> otherwise.
  1323. */
  1324. equals(right?: BoundingSphere): boolean;
  1325. /**
  1326. * Duplicates this BoundingSphere instance.
  1327. * @param [result] - The object onto which to store the result.
  1328. * @returns The modified result parameter or a new BoundingSphere instance if none was provided.
  1329. */
  1330. clone(result?: BoundingSphere): BoundingSphere;
  1331. /**
  1332. * Computes the radius of the BoundingSphere.
  1333. * @returns The radius of the BoundingSphere.
  1334. */
  1335. volume(): number;
  1336. }
  1337. /**
  1338. * Describes a cube centered at the origin.
  1339. * @example
  1340. * var box = new Cesium.BoxGeometry({
  1341. vertexFormat : Cesium.VertexFormat.POSITION_ONLY,
  1342. maximum : new Cesium.Cartesian3(250000.0, 250000.0, 250000.0),
  1343. minimum : new Cesium.Cartesian3(-250000.0, -250000.0, -250000.0)
  1344. });
  1345. var geometry = Cesium.BoxGeometry.createGeometry(box);
  1346. * @param options - Object with the following properties:
  1347. * @param options.minimum - The minimum x, y, and z coordinates of the box.
  1348. * @param options.maximum - The maximum x, y, and z coordinates of the box.
  1349. * @param [options.vertexFormat = VertexFormat.DEFAULT] - The vertex attributes to be computed.
  1350. */
  1351. export class BoxGeometry {
  1352. constructor(options: {
  1353. minimum: Cartesian3;
  1354. maximum: Cartesian3;
  1355. vertexFormat?: VertexFormat;
  1356. });
  1357. /**
  1358. * Creates a cube centered at the origin given its dimensions.
  1359. * @example
  1360. * var box = Cesium.BoxGeometry.fromDimensions({
  1361. vertexFormat : Cesium.VertexFormat.POSITION_ONLY,
  1362. dimensions : new Cesium.Cartesian3(500000.0, 500000.0, 500000.0)
  1363. });
  1364. var geometry = Cesium.BoxGeometry.createGeometry(box);
  1365. * @param options - Object with the following properties:
  1366. * @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.
  1367. * @param [options.vertexFormat = VertexFormat.DEFAULT] - The vertex attributes to be computed.
  1368. */
  1369. static fromDimensions(options: {
  1370. dimensions: Cartesian3;
  1371. vertexFormat?: VertexFormat;
  1372. }): BoxGeometry;
  1373. /**
  1374. * Creates a cube from the dimensions of an AxisAlignedBoundingBox.
  1375. * @example
  1376. * var aabb = Cesium.AxisAlignedBoundingBox.fromPoints(Cesium.Cartesian3.fromDegreesArray([
  1377. -72.0, 40.0,
  1378. -70.0, 35.0,
  1379. -75.0, 30.0,
  1380. -70.0, 30.0,
  1381. -68.0, 40.0
  1382. ]));
  1383. var box = Cesium.BoxGeometry.fromAxisAlignedBoundingBox(aabb);
  1384. * @param boundingBox - A description of the AxisAlignedBoundingBox.
  1385. */
  1386. static fromAxisAlignedBoundingBox(boundingBox: AxisAlignedBoundingBox): BoxGeometry;
  1387. /**
  1388. * The number of elements used to pack the object into an array.
  1389. */
  1390. static packedLength: number;
  1391. /**
  1392. * Stores the provided instance into the provided array.
  1393. * @param value - The value to pack.
  1394. * @param array - The array to pack into.
  1395. * @param [startingIndex = 0] - The index into the array at which to start packing the elements.
  1396. * @returns The array that was packed into
  1397. */
  1398. static pack(value: BoxGeometry, array: number[], startingIndex?: number): number[];
  1399. /**
  1400. * Retrieves an instance from a packed array.
  1401. * @param array - The packed array.
  1402. * @param [startingIndex = 0] - The starting index of the element to be unpacked.
  1403. * @param [result] - The object into which to store the result.
  1404. * @returns The modified result parameter or a new BoxGeometry instance if one was not provided.
  1405. */
  1406. static unpack(array: number[], startingIndex?: number, result?: BoxGeometry): BoxGeometry;
  1407. /**
  1408. * Computes the geometric representation of a box, including its vertices, indices, and a bounding sphere.
  1409. * @param boxGeometry - A description of the box.
  1410. * @returns The computed vertices and indices.
  1411. */
  1412. static createGeometry(boxGeometry: BoxGeometry): Geometry | undefined;
  1413. }
  1414. /**
  1415. * A description of the outline of a cube centered at the origin.
  1416. * @example
  1417. * var box = new Cesium.BoxOutlineGeometry({
  1418. maximum : new Cesium.Cartesian3(250000.0, 250000.0, 250000.0),
  1419. minimum : new Cesium.Cartesian3(-250000.0, -250000.0, -250000.0)
  1420. });
  1421. var geometry = Cesium.BoxOutlineGeometry.createGeometry(box);
  1422. * @param options - Object with the following properties:
  1423. * @param options.minimum - The minimum x, y, and z coordinates of the box.
  1424. * @param options.maximum - The maximum x, y, and z coordinates of the box.
  1425. */
  1426. export class BoxOutlineGeometry {
  1427. constructor(options: {
  1428. minimum: Cartesian3;
  1429. maximum: Cartesian3;
  1430. });
  1431. /**
  1432. * Creates an outline of a cube centered at the origin given its dimensions.
  1433. * @example
  1434. * var box = Cesium.BoxOutlineGeometry.fromDimensions({
  1435. dimensions : new Cesium.Cartesian3(500000.0, 500000.0, 500000.0)
  1436. });
  1437. var geometry = Cesium.BoxOutlineGeometry.createGeometry(box);
  1438. * @param options - Object with the following properties:
  1439. * @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.
  1440. */
  1441. static fromDimensions(options: {
  1442. dimensions: Cartesian3;
  1443. }): BoxOutlineGeometry;
  1444. /**
  1445. * Creates an outline of a cube from the dimensions of an AxisAlignedBoundingBox.
  1446. * @example
  1447. * var aabb = Cesium.AxisAlignedBoundingBox.fromPoints(Cesium.Cartesian3.fromDegreesArray([
  1448. -72.0, 40.0,
  1449. -70.0, 35.0,
  1450. -75.0, 30.0,
  1451. -70.0, 30.0,
  1452. -68.0, 40.0
  1453. ]));
  1454. var box = Cesium.BoxOutlineGeometry.fromAxisAlignedBoundingBox(aabb);
  1455. * @param boundingBox - A description of the AxisAlignedBoundingBox.
  1456. */
  1457. static fromAxisAlignedBoundingBox(boundingBox: AxisAlignedBoundingBox): BoxOutlineGeometry;
  1458. /**
  1459. * The number of elements used to pack the object into an array.
  1460. */
  1461. static packedLength: number;
  1462. /**
  1463. * Stores the provided instance into the provided array.
  1464. * @param value - The value to pack.
  1465. * @param array - The array to pack into.
  1466. * @param [startingIndex = 0] - The index into the array at which to start packing the elements.
  1467. * @returns The array that was packed into
  1468. */
  1469. static pack(value: BoxOutlineGeometry, array: number[], startingIndex?: number): number[];
  1470. /**
  1471. * Retrieves an instance from a packed array.
  1472. * @param array - The packed array.
  1473. * @param [startingIndex = 0] - The starting index of the element to be unpacked.
  1474. * @param [result] - The object into which to store the result.
  1475. * @returns The modified result parameter or a new BoxOutlineGeometry instance if one was not provided.
  1476. */
  1477. static unpack(array: number[], startingIndex?: number, result?: BoxOutlineGeometry): BoxOutlineGeometry;
  1478. /**
  1479. * Computes the geometric representation of an outline of a box, including its vertices, indices, and a bounding sphere.
  1480. * @param boxGeometry - A description of the box outline.
  1481. * @returns The computed vertices and indices.
  1482. */
  1483. static createGeometry(boxGeometry: BoxOutlineGeometry): Geometry | undefined;
  1484. }
  1485. /**
  1486. * Given a relative URL under the Cesium base URL, returns an absolute URL.
  1487. * @example
  1488. * var viewer = new Cesium.Viewer("cesiumContainer", {
  1489. imageryProvider: new Cesium.TileMapServiceImageryProvider({
  1490. url: Cesium.buildModuleUrl("Assets/Textures/NaturalEarthII"),
  1491. }),
  1492. baseLayerPicker: false,
  1493. });
  1494. * @param relativeUrl - The relative path.
  1495. * @returns The absolutely URL representation of the provided path.
  1496. */
  1497. export function buildModuleUrl(relativeUrl: string): string;
  1498. /**
  1499. * A browser-independent function to cancel an animation frame requested using {@link requestAnimationFrame}.
  1500. * @param requestID - The value returned by {@link requestAnimationFrame}.
  1501. */
  1502. export function cancelAnimationFrame(requestID: number): void;
  1503. /**
  1504. * A 2D Cartesian point.
  1505. * @param [x = 0.0] - The X component.
  1506. * @param [y = 0.0] - The Y component.
  1507. */
  1508. export class Cartesian2 {
  1509. constructor(x?: number, y?: number);
  1510. /**
  1511. * The X component.
  1512. */
  1513. x: number;
  1514. /**
  1515. * The Y component.
  1516. */
  1517. y: number;
  1518. /**
  1519. * Creates a Cartesian2 instance from x and y coordinates.
  1520. * @param x - The x coordinate.
  1521. * @param y - The y coordinate.
  1522. * @param [result] - The object onto which to store the result.
  1523. * @returns The modified result parameter or a new Cartesian2 instance if one was not provided.
  1524. */
  1525. static fromElements(x: number, y: number, result?: Cartesian2): Cartesian2;
  1526. /**
  1527. * Duplicates a Cartesian2 instance.
  1528. * @param cartesian - The Cartesian to duplicate.
  1529. * @param [result] - The object onto which to store the result.
  1530. * @returns The modified result parameter or a new Cartesian2 instance if one was not provided. (Returns undefined if cartesian is undefined)
  1531. */
  1532. static clone(cartesian: Cartesian2, result?: Cartesian2): Cartesian2;
  1533. /**
  1534. * Creates a Cartesian2 instance from an existing Cartesian3. This simply takes the
  1535. x and y properties of the Cartesian3 and drops z.
  1536. * @param cartesian - The Cartesian3 instance to create a Cartesian2 instance from.
  1537. * @param [result] - The object onto which to store the result.
  1538. * @returns The modified result parameter or a new Cartesian2 instance if one was not provided.
  1539. */
  1540. static fromCartesian3(cartesian: Cartesian3, result?: Cartesian2): Cartesian2;
  1541. /**
  1542. * Creates a Cartesian2 instance from an existing Cartesian4. This simply takes the
  1543. x and y properties of the Cartesian4 and drops z and w.
  1544. * @param cartesian - The Cartesian4 instance to create a Cartesian2 instance from.
  1545. * @param [result] - The object onto which to store the result.
  1546. * @returns The modified result parameter or a new Cartesian2 instance if one was not provided.
  1547. */
  1548. static fromCartesian4(cartesian: Cartesian4, result?: Cartesian2): Cartesian2;
  1549. /**
  1550. * The number of elements used to pack the object into an array.
  1551. */
  1552. static packedLength: number;
  1553. /**
  1554. * Stores the provided instance into the provided array.
  1555. * @param value - The value to pack.
  1556. * @param array - The array to pack into.
  1557. * @param [startingIndex = 0] - The index into the array at which to start packing the elements.
  1558. * @returns The array that was packed into
  1559. */
  1560. static pack(value: Cartesian2, array: number[], startingIndex?: number): number[];
  1561. /**
  1562. * Retrieves an instance from a packed array.
  1563. * @param array - The packed array.
  1564. * @param [startingIndex = 0] - The starting index of the element to be unpacked.
  1565. * @param [result] - The object into which to store the result.
  1566. * @returns The modified result parameter or a new Cartesian2 instance if one was not provided.
  1567. */
  1568. static unpack(array: number[], startingIndex?: number, result?: Cartesian2): Cartesian2;
  1569. /**
  1570. * Flattens an array of Cartesian2s into and array of components.
  1571. * @param array - The array of cartesians to pack.
  1572. * @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.
  1573. * @returns The packed array.
  1574. */
  1575. static packArray(array: Cartesian2[], result?: number[]): number[];
  1576. /**
  1577. * Unpacks an array of cartesian components into and array of Cartesian2s.
  1578. * @param array - The array of components to unpack.
  1579. * @param [result] - The array onto which to store the result.
  1580. * @returns The unpacked array.
  1581. */
  1582. static unpackArray(array: number[], result?: Cartesian2[]): Cartesian2[];
  1583. /**
  1584. * Creates a Cartesian2 from two consecutive elements in an array.
  1585. * @example
  1586. * // Create a Cartesian2 with (1.0, 2.0)
  1587. var v = [1.0, 2.0];
  1588. var p = Cesium.Cartesian2.fromArray(v);
  1589. // Create a Cartesian2 with (1.0, 2.0) using an offset into an array
  1590. var v2 = [0.0, 0.0, 1.0, 2.0];
  1591. var p2 = Cesium.Cartesian2.fromArray(v2, 2);
  1592. * @param array - The array whose two consecutive elements correspond to the x and y components, respectively.
  1593. * @param [startingIndex = 0] - The offset into the array of the first element, which corresponds to the x component.
  1594. * @param [result] - The object onto which to store the result.
  1595. * @returns The modified result parameter or a new Cartesian2 instance if one was not provided.
  1596. */
  1597. static fromArray(array: number[], startingIndex?: number, result?: Cartesian2): Cartesian2;
  1598. /**
  1599. * Computes the value of the maximum component for the supplied Cartesian.
  1600. * @param cartesian - The cartesian to use.
  1601. * @returns The value of the maximum component.
  1602. */
  1603. static maximumComponent(cartesian: Cartesian2): number;
  1604. /**
  1605. * Computes the value of the minimum component for the supplied Cartesian.
  1606. * @param cartesian - The cartesian to use.
  1607. * @returns The value of the minimum component.
  1608. */
  1609. static minimumComponent(cartesian: Cartesian2): number;
  1610. /**
  1611. * Compares two Cartesians and computes a Cartesian which contains the minimum components of the supplied Cartesians.
  1612. * @param first - A cartesian to compare.
  1613. * @param second - A cartesian to compare.
  1614. * @param result - The object into which to store the result.
  1615. * @returns A cartesian with the minimum components.
  1616. */
  1617. static minimumByComponent(first: Cartesian2, second: Cartesian2, result: Cartesian2): Cartesian2;
  1618. /**
  1619. * Compares two Cartesians and computes a Cartesian which contains the maximum components of the supplied Cartesians.
  1620. * @param first - A cartesian to compare.
  1621. * @param second - A cartesian to compare.
  1622. * @param result - The object into which to store the result.
  1623. * @returns A cartesian with the maximum components.
  1624. */
  1625. static maximumByComponent(first: Cartesian2, second: Cartesian2, result: Cartesian2): Cartesian2;
  1626. /**
  1627. * Computes the provided Cartesian's squared magnitude.
  1628. * @param cartesian - The Cartesian instance whose squared magnitude is to be computed.
  1629. * @returns The squared magnitude.
  1630. */
  1631. static magnitudeSquared(cartesian: Cartesian2): number;
  1632. /**
  1633. * Computes the Cartesian's magnitude (length).
  1634. * @param cartesian - The Cartesian instance whose magnitude is to be computed.
  1635. * @returns The magnitude.
  1636. */
  1637. static magnitude(cartesian: Cartesian2): number;
  1638. /**
  1639. * Computes the distance between two points.
  1640. * @example
  1641. * // Returns 1.0
  1642. var d = Cesium.Cartesian2.distance(new Cesium.Cartesian2(1.0, 0.0), new Cesium.Cartesian2(2.0, 0.0));
  1643. * @param left - The first point to compute the distance from.
  1644. * @param right - The second point to compute the distance to.
  1645. * @returns The distance between two points.
  1646. */
  1647. static distance(left: Cartesian2, right: Cartesian2): number;
  1648. /**
  1649. * Computes the squared distance between two points. Comparing squared distances
  1650. using this function is more efficient than comparing distances using {@link Cartesian2#distance}.
  1651. * @example
  1652. * // Returns 4.0, not 2.0
  1653. var d = Cesium.Cartesian2.distance(new Cesium.Cartesian2(1.0, 0.0), new Cesium.Cartesian2(3.0, 0.0));
  1654. * @param left - The first point to compute the distance from.
  1655. * @param right - The second point to compute the distance to.
  1656. * @returns The distance between two points.
  1657. */
  1658. static distanceSquared(left: Cartesian2, right: Cartesian2): number;
  1659. /**
  1660. * Computes the normalized form of the supplied Cartesian.
  1661. * @param cartesian - The Cartesian to be normalized.
  1662. * @param result - The object onto which to store the result.
  1663. * @returns The modified result parameter.
  1664. */
  1665. static normalize(cartesian: Cartesian2, result: Cartesian2): Cartesian2;
  1666. /**
  1667. * Computes the dot (scalar) product of two Cartesians.
  1668. * @param left - The first Cartesian.
  1669. * @param right - The second Cartesian.
  1670. * @returns The dot product.
  1671. */
  1672. static dot(left: Cartesian2, right: Cartesian2): number;
  1673. /**
  1674. * Computes the componentwise product of two Cartesians.
  1675. * @param left - The first Cartesian.
  1676. * @param right - The second Cartesian.
  1677. * @param result - The object onto which to store the result.
  1678. * @returns The modified result parameter.
  1679. */
  1680. static multiplyComponents(left: Cartesian2, right: Cartesian2, result: Cartesian2): Cartesian2;
  1681. /**
  1682. * Computes the componentwise quotient of two Cartesians.
  1683. * @param left - The first Cartesian.
  1684. * @param right - The second Cartesian.
  1685. * @param result - The object onto which to store the result.
  1686. * @returns The modified result parameter.
  1687. */
  1688. static divideComponents(left: Cartesian2, right: Cartesian2, result: Cartesian2): Cartesian2;
  1689. /**
  1690. * Computes the componentwise sum of two Cartesians.
  1691. * @param left - The first Cartesian.
  1692. * @param right - The second Cartesian.
  1693. * @param result - The object onto which to store the result.
  1694. * @returns The modified result parameter.
  1695. */
  1696. static add(left: Cartesian2, right: Cartesian2, result: Cartesian2): Cartesian2;
  1697. /**
  1698. * Computes the componentwise difference of two Cartesians.
  1699. * @param left - The first Cartesian.
  1700. * @param right - The second Cartesian.
  1701. * @param result - The object onto which to store the result.
  1702. * @returns The modified result parameter.
  1703. */
  1704. static subtract(left: Cartesian2, right: Cartesian2, result: Cartesian2): Cartesian2;
  1705. /**
  1706. * Multiplies the provided Cartesian componentwise by the provided scalar.
  1707. * @param cartesian - The Cartesian to be scaled.
  1708. * @param scalar - The scalar to multiply with.
  1709. * @param result - The object onto which to store the result.
  1710. * @returns The modified result parameter.
  1711. */
  1712. static multiplyByScalar(cartesian: Cartesian2, scalar: number, result: Cartesian2): Cartesian2;
  1713. /**
  1714. * Divides the provided Cartesian componentwise by the provided scalar.
  1715. * @param cartesian - The Cartesian to be divided.
  1716. * @param scalar - The scalar to divide by.
  1717. * @param result - The object onto which to store the result.
  1718. * @returns The modified result parameter.
  1719. */
  1720. static divideByScalar(cartesian: Cartesian2, scalar: number, result: Cartesian2): Cartesian2;
  1721. /**
  1722. * Negates the provided Cartesian.
  1723. * @param cartesian - The Cartesian to be negated.
  1724. * @param result - The object onto which to store the result.
  1725. * @returns The modified result parameter.
  1726. */
  1727. static negate(cartesian: Cartesian2, result: Cartesian2): Cartesian2;
  1728. /**
  1729. * Computes the absolute value of the provided Cartesian.
  1730. * @param cartesian - The Cartesian whose absolute value is to be computed.
  1731. * @param result - The object onto which to store the result.
  1732. * @returns The modified result parameter.
  1733. */
  1734. static abs(cartesian: Cartesian2, result: Cartesian2): Cartesian2;
  1735. /**
  1736. * Computes the linear interpolation or extrapolation at t using the provided cartesians.
  1737. * @param start - The value corresponding to t at 0.0.
  1738. * @param end - The value corresponding to t at 1.0.
  1739. * @param t - The point along t at which to interpolate.
  1740. * @param result - The object onto which to store the result.
  1741. * @returns The modified result parameter.
  1742. */
  1743. static lerp(start: Cartesian2, end: Cartesian2, t: number, result: Cartesian2): Cartesian2;
  1744. /**
  1745. * Returns the angle, in radians, between the provided Cartesians.
  1746. * @param left - The first Cartesian.
  1747. * @param right - The second Cartesian.
  1748. * @returns The angle between the Cartesians.
  1749. */
  1750. static angleBetween(left: Cartesian2, right: Cartesian2): number;
  1751. /**
  1752. * Returns the axis that is most orthogonal to the provided Cartesian.
  1753. * @param cartesian - The Cartesian on which to find the most orthogonal axis.
  1754. * @param result - The object onto which to store the result.
  1755. * @returns The most orthogonal axis.
  1756. */
  1757. static mostOrthogonalAxis(cartesian: Cartesian2, result: Cartesian2): Cartesian2;
  1758. /**
  1759. * Compares the provided Cartesians componentwise and returns
  1760. <code>true</code> if they are equal, <code>false</code> otherwise.
  1761. * @param [left] - The first Cartesian.
  1762. * @param [right] - The second Cartesian.
  1763. * @returns <code>true</code> if left and right are equal, <code>false</code> otherwise.
  1764. */
  1765. static equals(left?: Cartesian2, right?: Cartesian2): boolean;
  1766. /**
  1767. * Compares the provided Cartesians componentwise and returns
  1768. <code>true</code> if they pass an absolute or relative tolerance test,
  1769. <code>false</code> otherwise.
  1770. * @param [left] - The first Cartesian.
  1771. * @param [right] - The second Cartesian.
  1772. * @param [relativeEpsilon = 0] - The relative epsilon tolerance to use for equality testing.
  1773. * @param [absoluteEpsilon = relativeEpsilon] - The absolute epsilon tolerance to use for equality testing.
  1774. * @returns <code>true</code> if left and right are within the provided epsilon, <code>false</code> otherwise.
  1775. */
  1776. static equalsEpsilon(left?: Cartesian2, right?: Cartesian2, relativeEpsilon?: number, absoluteEpsilon?: number): boolean;
  1777. /**
  1778. * An immutable Cartesian2 instance initialized to (0.0, 0.0).
  1779. */
  1780. static readonly ZERO: Cartesian2;
  1781. /**
  1782. * An immutable Cartesian2 instance initialized to (1.0, 0.0).
  1783. */
  1784. static readonly UNIT_X: Cartesian2;
  1785. /**
  1786. * An immutable Cartesian2 instance initialized to (0.0, 1.0).
  1787. */
  1788. static readonly UNIT_Y: Cartesian2;
  1789. /**
  1790. * Duplicates this Cartesian2 instance.
  1791. * @param [result] - The object onto which to store the result.
  1792. * @returns The modified result parameter or a new Cartesian2 instance if one was not provided.
  1793. */
  1794. clone(result?: Cartesian2): Cartesian2;
  1795. /**
  1796. * Compares this Cartesian against the provided Cartesian componentwise and returns
  1797. <code>true</code> if they are equal, <code>false</code> otherwise.
  1798. * @param [right] - The right hand side Cartesian.
  1799. * @returns <code>true</code> if they are equal, <code>false</code> otherwise.
  1800. */
  1801. equals(right?: Cartesian2): boolean;
  1802. /**
  1803. * Compares this Cartesian against the provided Cartesian componentwise and returns
  1804. <code>true</code> if they pass an absolute or relative tolerance test,
  1805. <code>false</code> otherwise.
  1806. * @param [right] - The right hand side Cartesian.
  1807. * @param [relativeEpsilon = 0] - The relative epsilon tolerance to use for equality testing.
  1808. * @param [absoluteEpsilon = relativeEpsilon] - The absolute epsilon tolerance to use for equality testing.
  1809. * @returns <code>true</code> if they are within the provided epsilon, <code>false</code> otherwise.
  1810. */
  1811. equalsEpsilon(right?: Cartesian2, relativeEpsilon?: number, absoluteEpsilon?: number): boolean;
  1812. /**
  1813. * Creates a string representing this Cartesian in the format '(x, y)'.
  1814. * @returns A string representing the provided Cartesian in the format '(x, y)'.
  1815. */
  1816. toString(): string;
  1817. }
  1818. /**
  1819. * A 3D Cartesian point.
  1820. * @param [x = 0.0] - The X component.
  1821. * @param [y = 0.0] - The Y component.
  1822. * @param [z = 0.0] - The Z component.
  1823. */
  1824. export class Cartesian3 {
  1825. constructor(x?: number, y?: number, z?: number);
  1826. /**
  1827. * The X component.
  1828. */
  1829. x: number;
  1830. /**
  1831. * The Y component.
  1832. */
  1833. y: number;
  1834. /**
  1835. * The Z component.
  1836. */
  1837. z: number;
  1838. /**
  1839. * Converts the provided Spherical into Cartesian3 coordinates.
  1840. * @param spherical - The Spherical to be converted to Cartesian3.
  1841. * @param [result] - The object onto which to store the result.
  1842. * @returns The modified result parameter or a new Cartesian3 instance if one was not provided.
  1843. */
  1844. static fromSpherical(spherical: Spherical, result?: Cartesian3): Cartesian3;
  1845. /**
  1846. * Creates a Cartesian3 instance from x, y and z coordinates.
  1847. * @param x - The x coordinate.
  1848. * @param y - The y coordinate.
  1849. * @param z - The z coordinate.
  1850. * @param [result] - The object onto which to store the result.
  1851. * @returns The modified result parameter or a new Cartesian3 instance if one was not provided.
  1852. */
  1853. static fromElements(x: number, y: number, z: number, result?: Cartesian3): Cartesian3;
  1854. /**
  1855. * Duplicates a Cartesian3 instance.
  1856. * @param cartesian - The Cartesian to duplicate.
  1857. * @param [result] - The object onto which to store the result.
  1858. * @returns The modified result parameter or a new Cartesian3 instance if one was not provided. (Returns undefined if cartesian is undefined)
  1859. */
  1860. static clone(cartesian: Cartesian3, result?: Cartesian3): Cartesian3;
  1861. /**
  1862. * Creates a Cartesian3 instance from an existing Cartesian4. This simply takes the
  1863. x, y, and z properties of the Cartesian4 and drops w.
  1864. * @param cartesian - The Cartesian4 instance to create a Cartesian3 instance from.
  1865. * @param [result] - The object onto which to store the result.
  1866. * @returns The modified result parameter or a new Cartesian3 instance if one was not provided.
  1867. */
  1868. static fromCartesian4(cartesian: Cartesian4, result?: Cartesian3): Cartesian3;
  1869. /**
  1870. * The number of elements used to pack the object into an array.
  1871. */
  1872. static packedLength: number;
  1873. /**
  1874. * Stores the provided instance into the provided array.
  1875. * @param value - The value to pack.
  1876. * @param array - The array to pack into.
  1877. * @param [startingIndex = 0] - The index into the array at which to start packing the elements.
  1878. * @returns The array that was packed into
  1879. */
  1880. static pack(value: Cartesian3, array: number[], startingIndex?: number): number[];
  1881. /**
  1882. * Retrieves an instance from a packed array.
  1883. * @param array - The packed array.
  1884. * @param [startingIndex = 0] - The starting index of the element to be unpacked.
  1885. * @param [result] - The object into which to store the result.
  1886. * @returns The modified result parameter or a new Cartesian3 instance if one was not provided.
  1887. */
  1888. static unpack(array: number[], startingIndex?: number, result?: Cartesian3): Cartesian3;
  1889. /**
  1890. * Flattens an array of Cartesian3s into an array of components.
  1891. * @param array - The array of cartesians to pack.
  1892. * @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.
  1893. * @returns The packed array.
  1894. */
  1895. static packArray(array: Cartesian3[], result?: number[]): number[];
  1896. /**
  1897. * Unpacks an array of cartesian components into an array of Cartesian3s.
  1898. * @param array - The array of components to unpack.
  1899. * @param [result] - The array onto which to store the result.
  1900. * @returns The unpacked array.
  1901. */
  1902. static unpackArray(array: number[], result?: Cartesian3[]): Cartesian3[];
  1903. /**
  1904. * Creates a Cartesian3 from three consecutive elements in an array.
  1905. * @example
  1906. * // Create a Cartesian3 with (1.0, 2.0, 3.0)
  1907. var v = [1.0, 2.0, 3.0];
  1908. var p = Cesium.Cartesian3.fromArray(v);
  1909. // Create a Cartesian3 with (1.0, 2.0, 3.0) using an offset into an array
  1910. var v2 = [0.0, 0.0, 1.0, 2.0, 3.0];
  1911. var p2 = Cesium.Cartesian3.fromArray(v2, 2);
  1912. * @param array - The array whose three consecutive elements correspond to the x, y, and z components, respectively.
  1913. * @param [startingIndex = 0] - The offset into the array of the first element, which corresponds to the x component.
  1914. * @param [result] - The object onto which to store the result.
  1915. * @returns The modified result parameter or a new Cartesian3 instance if one was not provided.
  1916. */
  1917. static fromArray(array: number[], startingIndex?: number, result?: Cartesian3): Cartesian3;
  1918. /**
  1919. * Computes the value of the maximum component for the supplied Cartesian.
  1920. * @param cartesian - The cartesian to use.
  1921. * @returns The value of the maximum component.
  1922. */
  1923. static maximumComponent(cartesian: Cartesian3): number;
  1924. /**
  1925. * Computes the value of the minimum component for the supplied Cartesian.
  1926. * @param cartesian - The cartesian to use.
  1927. * @returns The value of the minimum component.
  1928. */
  1929. static minimumComponent(cartesian: Cartesian3): number;
  1930. /**
  1931. * Compares two Cartesians and computes a Cartesian which contains the minimum components of the supplied Cartesians.
  1932. * @param first - A cartesian to compare.
  1933. * @param second - A cartesian to compare.
  1934. * @param result - The object into which to store the result.
  1935. * @returns A cartesian with the minimum components.
  1936. */
  1937. static minimumByComponent(first: Cartesian3, second: Cartesian3, result: Cartesian3): Cartesian3;
  1938. /**
  1939. * Compares two Cartesians and computes a Cartesian which contains the maximum components of the supplied Cartesians.
  1940. * @param first - A cartesian to compare.
  1941. * @param second - A cartesian to compare.
  1942. * @param result - The object into which to store the result.
  1943. * @returns A cartesian with the maximum components.
  1944. */
  1945. static maximumByComponent(first: Cartesian3, second: Cartesian3, result: Cartesian3): Cartesian3;
  1946. /**
  1947. * Computes the provided Cartesian's squared magnitude.
  1948. * @param cartesian - The Cartesian instance whose squared magnitude is to be computed.
  1949. * @returns The squared magnitude.
  1950. */
  1951. static magnitudeSquared(cartesian: Cartesian3): number;
  1952. /**
  1953. * Computes the Cartesian's magnitude (length).
  1954. * @param cartesian - The Cartesian instance whose magnitude is to be computed.
  1955. * @returns The magnitude.
  1956. */
  1957. static magnitude(cartesian: Cartesian3): number;
  1958. /**
  1959. * Computes the distance between two points.
  1960. * @example
  1961. * // Returns 1.0
  1962. var d = Cesium.Cartesian3.distance(new Cesium.Cartesian3(1.0, 0.0, 0.0), new Cesium.Cartesian3(2.0, 0.0, 0.0));
  1963. * @param left - The first point to compute the distance from.
  1964. * @param right - The second point to compute the distance to.
  1965. * @returns The distance between two points.
  1966. */
  1967. static distance(left: Cartesian3, right: Cartesian3): number;
  1968. /**
  1969. * Computes the squared distance between two points. Comparing squared distances
  1970. using this function is more efficient than comparing distances using {@link Cartesian3#distance}.
  1971. * @example
  1972. * // Returns 4.0, not 2.0
  1973. var d = Cesium.Cartesian3.distanceSquared(new Cesium.Cartesian3(1.0, 0.0, 0.0), new Cesium.Cartesian3(3.0, 0.0, 0.0));
  1974. * @param left - The first point to compute the distance from.
  1975. * @param right - The second point to compute the distance to.
  1976. * @returns The distance between two points.
  1977. */
  1978. static distanceSquared(left: Cartesian3, right: Cartesian3): number;
  1979. /**
  1980. * Computes the normalized form of the supplied Cartesian.
  1981. * @param cartesian - The Cartesian to be normalized.
  1982. * @param result - The object onto which to store the result.
  1983. * @returns The modified result parameter.
  1984. */
  1985. static normalize(cartesian: Cartesian3, result: Cartesian3): Cartesian3;
  1986. /**
  1987. * Computes the dot (scalar) product of two Cartesians.
  1988. * @param left - The first Cartesian.
  1989. * @param right - The second Cartesian.
  1990. * @returns The dot product.
  1991. */
  1992. static dot(left: Cartesian3, right: Cartesian3): number;
  1993. /**
  1994. * Computes the componentwise product of two Cartesians.
  1995. * @param left - The first Cartesian.
  1996. * @param right - The second Cartesian.
  1997. * @param result - The object onto which to store the result.
  1998. * @returns The modified result parameter.
  1999. */
  2000. static multiplyComponents(left: Cartesian3, right: Cartesian3, result: Cartesian3): Cartesian3;
  2001. /**
  2002. * Computes the componentwise quotient of two Cartesians.
  2003. * @param left - The first Cartesian.
  2004. * @param right - The second Cartesian.
  2005. * @param result - The object onto which to store the result.
  2006. * @returns The modified result parameter.
  2007. */
  2008. static divideComponents(left: Cartesian3, right: Cartesian3, result: Cartesian3): Cartesian3;
  2009. /**
  2010. * Computes the componentwise sum of two Cartesians.
  2011. * @param left - The first Cartesian.
  2012. * @param right - The second Cartesian.
  2013. * @param result - The object onto which to store the result.
  2014. * @returns The modified result parameter.
  2015. */
  2016. static add(left: Cartesian3, right: Cartesian3, result: Cartesian3): Cartesian3;
  2017. /**
  2018. * Computes the componentwise difference of two Cartesians.
  2019. * @param left - The first Cartesian.
  2020. * @param right - The second Cartesian.
  2021. * @param result - The object onto which to store the result.
  2022. * @returns The modified result parameter.
  2023. */
  2024. static subtract(left: Cartesian3, right: Cartesian3, result: Cartesian3): Cartesian3;
  2025. /**
  2026. * Multiplies the provided Cartesian componentwise by the provided scalar.
  2027. * @param cartesian - The Cartesian to be scaled.
  2028. * @param scalar - The scalar to multiply with.
  2029. * @param result - The object onto which to store the result.
  2030. * @returns The modified result parameter.
  2031. */
  2032. static multiplyByScalar(cartesian: Cartesian3, scalar: number, result: Cartesian3): Cartesian3;
  2033. /**
  2034. * Divides the provided Cartesian componentwise by the provided scalar.
  2035. * @param cartesian - The Cartesian to be divided.
  2036. * @param scalar - The scalar to divide by.
  2037. * @param result - The object onto which to store the result.
  2038. * @returns The modified result parameter.
  2039. */
  2040. static divideByScalar(cartesian: Cartesian3, scalar: number, result: Cartesian3): Cartesian3;
  2041. /**
  2042. * Negates the provided Cartesian.
  2043. * @param cartesian - The Cartesian to be negated.
  2044. * @param result - The object onto which to store the result.
  2045. * @returns The modified result parameter.
  2046. */
  2047. static negate(cartesian: Cartesian3, result: Cartesian3): Cartesian3;
  2048. /**
  2049. * Computes the absolute value of the provided Cartesian.
  2050. * @param cartesian - The Cartesian whose absolute value is to be computed.
  2051. * @param result - The object onto which to store the result.
  2052. * @returns The modified result parameter.
  2053. */
  2054. static abs(cartesian: Cartesian3, result: Cartesian3): Cartesian3;
  2055. /**
  2056. * Computes the linear interpolation or extrapolation at t using the provided cartesians.
  2057. * @param start - The value corresponding to t at 0.0.
  2058. * @param end - The value corresponding to t at 1.0.
  2059. * @param t - The point along t at which to interpolate.
  2060. * @param result - The object onto which to store the result.
  2061. * @returns The modified result parameter.
  2062. */
  2063. static lerp(start: Cartesian3, end: Cartesian3, t: number, result: Cartesian3): Cartesian3;
  2064. /**
  2065. * Returns the angle, in radians, between the provided Cartesians.
  2066. * @param left - The first Cartesian.
  2067. * @param right - The second Cartesian.
  2068. * @returns The angle between the Cartesians.
  2069. */
  2070. static angleBetween(left: Cartesian3, right: Cartesian3): number;
  2071. /**
  2072. * Returns the axis that is most orthogonal to the provided Cartesian.
  2073. * @param cartesian - The Cartesian on which to find the most orthogonal axis.
  2074. * @param result - The object onto which to store the result.
  2075. * @returns The most orthogonal axis.
  2076. */
  2077. static mostOrthogonalAxis(cartesian: Cartesian3, result: Cartesian3): Cartesian3;
  2078. /**
  2079. * Projects vector a onto vector b
  2080. * @param a - The vector that needs projecting
  2081. * @param b - The vector to project onto
  2082. * @param result - The result cartesian
  2083. * @returns The modified result parameter
  2084. */
  2085. static projectVector(a: Cartesian3, b: Cartesian3, result: Cartesian3): Cartesian3;
  2086. /**
  2087. * Compares the provided Cartesians componentwise and returns
  2088. <code>true</code> if they are equal, <code>false</code> otherwise.
  2089. * @param [left] - The first Cartesian.
  2090. * @param [right] - The second Cartesian.
  2091. * @returns <code>true</code> if left and right are equal, <code>false</code> otherwise.
  2092. */
  2093. static equals(left?: Cartesian3, right?: Cartesian3): boolean;
  2094. /**
  2095. * Compares the provided Cartesians componentwise and returns
  2096. <code>true</code> if they pass an absolute or relative tolerance test,
  2097. <code>false</code> otherwise.
  2098. * @param [left] - The first Cartesian.
  2099. * @param [right] - The second Cartesian.
  2100. * @param [relativeEpsilon = 0] - The relative epsilon tolerance to use for equality testing.
  2101. * @param [absoluteEpsilon = relativeEpsilon] - The absolute epsilon tolerance to use for equality testing.
  2102. * @returns <code>true</code> if left and right are within the provided epsilon, <code>false</code> otherwise.
  2103. */
  2104. static equalsEpsilon(left?: Cartesian3, right?: Cartesian3, relativeEpsilon?: number, absoluteEpsilon?: number): boolean;
  2105. /**
  2106. * Computes the cross (outer) product of two Cartesians.
  2107. * @param left - The first Cartesian.
  2108. * @param right - The second Cartesian.
  2109. * @param result - The object onto which to store the result.
  2110. * @returns The cross product.
  2111. */
  2112. static cross(left: Cartesian3, right: Cartesian3, result: Cartesian3): Cartesian3;
  2113. /**
  2114. * Computes the midpoint between the right and left Cartesian.
  2115. * @param left - The first Cartesian.
  2116. * @param right - The second Cartesian.
  2117. * @param result - The object onto which to store the result.
  2118. * @returns The midpoint.
  2119. */
  2120. static midpoint(left: Cartesian3, right: Cartesian3, result: Cartesian3): Cartesian3;
  2121. /**
  2122. * Returns a Cartesian3 position from longitude and latitude values given in degrees.
  2123. * @example
  2124. * var position = Cesium.Cartesian3.fromDegrees(-115.0, 37.0);
  2125. * @param longitude - The longitude, in degrees
  2126. * @param latitude - The latitude, in degrees
  2127. * @param [height = 0.0] - The height, in meters, above the ellipsoid.
  2128. * @param [ellipsoid = Ellipsoid.WGS84] - The ellipsoid on which the position lies.
  2129. * @param [result] - The object onto which to store the result.
  2130. * @returns The position
  2131. */
  2132. static fromDegrees(longitude: number, latitude: number, height?: number, ellipsoid?: Ellipsoid, result?: Cartesian3): Cartesian3;
  2133. /**
  2134. * Returns a Cartesian3 position from longitude and latitude values given in radians.
  2135. * @example
  2136. * var position = Cesium.Cartesian3.fromRadians(-2.007, 0.645);
  2137. * @param longitude - The longitude, in radians
  2138. * @param latitude - The latitude, in radians
  2139. * @param [height = 0.0] - The height, in meters, above the ellipsoid.
  2140. * @param [ellipsoid = Ellipsoid.WGS84] - The ellipsoid on which the position lies.
  2141. * @param [result] - The object onto which to store the result.
  2142. * @returns The position
  2143. */
  2144. static fromRadians(longitude: number, latitude: number, height?: number, ellipsoid?: Ellipsoid, result?: Cartesian3): Cartesian3;
  2145. /**
  2146. * Returns an array of Cartesian3 positions given an array of longitude and latitude values given in degrees.
  2147. * @example
  2148. * var positions = Cesium.Cartesian3.fromDegreesArray([-115.0, 37.0, -107.0, 33.0]);
  2149. * @param coordinates - A list of longitude and latitude values. Values alternate [longitude, latitude, longitude, latitude...].
  2150. * @param [ellipsoid = Ellipsoid.WGS84] - The ellipsoid on which the coordinates lie.
  2151. * @param [result] - An array of Cartesian3 objects to store the result.
  2152. * @returns The array of positions.
  2153. */
  2154. static fromDegreesArray(coordinates: number[], ellipsoid?: Ellipsoid, result?: Cartesian3[]): Cartesian3[];
  2155. /**
  2156. * Returns an array of Cartesian3 positions given an array of longitude and latitude values given in radians.
  2157. * @example
  2158. * var positions = Cesium.Cartesian3.fromRadiansArray([-2.007, 0.645, -1.867, .575]);
  2159. * @param coordinates - A list of longitude and latitude values. Values alternate [longitude, latitude, longitude, latitude...].
  2160. * @param [ellipsoid = Ellipsoid.WGS84] - The ellipsoid on which the coordinates lie.
  2161. * @param [result] - An array of Cartesian3 objects to store the result.
  2162. * @returns The array of positions.
  2163. */
  2164. static fromRadiansArray(coordinates: number[], ellipsoid?: Ellipsoid, result?: Cartesian3[]): Cartesian3[];
  2165. /**
  2166. * Returns an array of Cartesian3 positions given an array of longitude, latitude and height values where longitude and latitude are given in degrees.
  2167. * @example
  2168. * var positions = Cesium.Cartesian3.fromDegreesArrayHeights([-115.0, 37.0, 100000.0, -107.0, 33.0, 150000.0]);
  2169. * @param coordinates - A list of longitude, latitude and height values. Values alternate [longitude, latitude, height, longitude, latitude, height...].
  2170. * @param [ellipsoid = Ellipsoid.WGS84] - The ellipsoid on which the position lies.
  2171. * @param [result] - An array of Cartesian3 objects to store the result.
  2172. * @returns The array of positions.
  2173. */
  2174. static fromDegreesArrayHeights(coordinates: number[], ellipsoid?: Ellipsoid, result?: Cartesian3[]): Cartesian3[];
  2175. /**
  2176. * Returns an array of Cartesian3 positions given an array of longitude, latitude and height values where longitude and latitude are given in radians.
  2177. * @example
  2178. * var positions = Cesium.Cartesian3.fromRadiansArrayHeights([-2.007, 0.645, 100000.0, -1.867, .575, 150000.0]);
  2179. * @param coordinates - A list of longitude, latitude and height values. Values alternate [longitude, latitude, height, longitude, latitude, height...].
  2180. * @param [ellipsoid = Ellipsoid.WGS84] - The ellipsoid on which the position lies.
  2181. * @param [result] - An array of Cartesian3 objects to store the result.
  2182. * @returns The array of positions.
  2183. */
  2184. static fromRadiansArrayHeights(coordinates: number[], ellipsoid?: Ellipsoid, result?: Cartesian3[]): Cartesian3[];
  2185. /**
  2186. * An immutable Cartesian3 instance initialized to (0.0, 0.0, 0.0).
  2187. */
  2188. static readonly ZERO: Cartesian3;
  2189. /**
  2190. * An immutable Cartesian3 instance initialized to (1.0, 0.0, 0.0).
  2191. */
  2192. static readonly UNIT_X: Cartesian3;
  2193. /**
  2194. * An immutable Cartesian3 instance initialized to (0.0, 1.0, 0.0).
  2195. */
  2196. static readonly UNIT_Y: Cartesian3;
  2197. /**
  2198. * An immutable Cartesian3 instance initialized to (0.0, 0.0, 1.0).
  2199. */
  2200. static readonly UNIT_Z: Cartesian3;
  2201. /**
  2202. * Duplicates this Cartesian3 instance.
  2203. * @param [result] - The object onto which to store the result.
  2204. * @returns The modified result parameter or a new Cartesian3 instance if one was not provided.
  2205. */
  2206. clone(result?: Cartesian3): Cartesian3;
  2207. /**
  2208. * Compares this Cartesian against the provided Cartesian componentwise and returns
  2209. <code>true</code> if they are equal, <code>false</code> otherwise.
  2210. * @param [right] - The right hand side Cartesian.
  2211. * @returns <code>true</code> if they are equal, <code>false</code> otherwise.
  2212. */
  2213. equals(right?: Cartesian3): boolean;
  2214. /**
  2215. * Compares this Cartesian against the provided Cartesian componentwise and returns
  2216. <code>true</code> if they pass an absolute or relative tolerance test,
  2217. <code>false</code> otherwise.
  2218. * @param [right] - The right hand side Cartesian.
  2219. * @param [relativeEpsilon = 0] - The relative epsilon tolerance to use for equality testing.
  2220. * @param [absoluteEpsilon = relativeEpsilon] - The absolute epsilon tolerance to use for equality testing.
  2221. * @returns <code>true</code> if they are within the provided epsilon, <code>false</code> otherwise.
  2222. */
  2223. equalsEpsilon(right?: Cartesian3, relativeEpsilon?: number, absoluteEpsilon?: number): boolean;
  2224. /**
  2225. * Creates a string representing this Cartesian in the format '(x, y, z)'.
  2226. * @returns A string representing this Cartesian in the format '(x, y, z)'.
  2227. */
  2228. toString(): string;
  2229. }
  2230. /**
  2231. * A 4D Cartesian point.
  2232. * @param [x = 0.0] - The X component.
  2233. * @param [y = 0.0] - The Y component.
  2234. * @param [z = 0.0] - The Z component.
  2235. * @param [w = 0.0] - The W component.
  2236. */
  2237. export class Cartesian4 {
  2238. constructor(x?: number, y?: number, z?: number, w?: number);
  2239. /**
  2240. * The X component.
  2241. */
  2242. x: number;
  2243. /**
  2244. * The Y component.
  2245. */
  2246. y: number;
  2247. /**
  2248. * The Z component.
  2249. */
  2250. z: number;
  2251. /**
  2252. * The W component.
  2253. */
  2254. w: number;
  2255. /**
  2256. * Creates a Cartesian4 instance from x, y, z and w coordinates.
  2257. * @param x - The x coordinate.
  2258. * @param y - The y coordinate.
  2259. * @param z - The z coordinate.
  2260. * @param w - The w coordinate.
  2261. * @param [result] - The object onto which to store the result.
  2262. * @returns The modified result parameter or a new Cartesian4 instance if one was not provided.
  2263. */
  2264. static fromElements(x: number, y: number, z: number, w: number, result?: Cartesian4): Cartesian4;
  2265. /**
  2266. * Creates a Cartesian4 instance from a {@link Color}. <code>red</code>, <code>green</code>, <code>blue</code>,
  2267. and <code>alpha</code> map to <code>x</code>, <code>y</code>, <code>z</code>, and <code>w</code>, respectively.
  2268. * @param color - The source color.
  2269. * @param [result] - The object onto which to store the result.
  2270. * @returns The modified result parameter or a new Cartesian4 instance if one was not provided.
  2271. */
  2272. static fromColor(color: Color, result?: Cartesian4): Cartesian4;
  2273. /**
  2274. * Duplicates a Cartesian4 instance.
  2275. * @param cartesian - The Cartesian to duplicate.
  2276. * @param [result] - The object onto which to store the result.
  2277. * @returns The modified result parameter or a new Cartesian4 instance if one was not provided. (Returns undefined if cartesian is undefined)
  2278. */
  2279. static clone(cartesian: Cartesian4, result?: Cartesian4): Cartesian4;
  2280. /**
  2281. * The number of elements used to pack the object into an array.
  2282. */
  2283. static packedLength: number;
  2284. /**
  2285. * Stores the provided instance into the provided array.
  2286. * @param value - The value to pack.
  2287. * @param array - The array to pack into.
  2288. * @param [startingIndex = 0] - The index into the array at which to start packing the elements.
  2289. * @returns The array that was packed into
  2290. */
  2291. static pack(value: Cartesian4, array: number[], startingIndex?: number): number[];
  2292. /**
  2293. * Retrieves an instance from a packed array.
  2294. * @param array - The packed array.
  2295. * @param [startingIndex = 0] - The starting index of the element to be unpacked.
  2296. * @param [result] - The object into which to store the result.
  2297. * @returns The modified result parameter or a new Cartesian4 instance if one was not provided.
  2298. */
  2299. static unpack(array: number[], startingIndex?: number, result?: Cartesian4): Cartesian4;
  2300. /**
  2301. * Flattens an array of Cartesian4s into and array of components.
  2302. * @param array - The array of cartesians to pack.
  2303. * @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.
  2304. * @returns The packed array.
  2305. */
  2306. static packArray(array: Cartesian4[], result?: number[]): number[];
  2307. /**
  2308. * Unpacks an array of cartesian components into and array of Cartesian4s.
  2309. * @param array - The array of components to unpack.
  2310. * @param [result] - The array onto which to store the result.
  2311. * @returns The unpacked array.
  2312. */
  2313. static unpackArray(array: number[], result?: Cartesian4[]): Cartesian4[];
  2314. /**
  2315. * Creates a Cartesian4 from four consecutive elements in an array.
  2316. * @example
  2317. * // Create a Cartesian4 with (1.0, 2.0, 3.0, 4.0)
  2318. var v = [1.0, 2.0, 3.0, 4.0];
  2319. var p = Cesium.Cartesian4.fromArray(v);
  2320. // Create a Cartesian4 with (1.0, 2.0, 3.0, 4.0) using an offset into an array
  2321. var v2 = [0.0, 0.0, 1.0, 2.0, 3.0, 4.0];
  2322. var p2 = Cesium.Cartesian4.fromArray(v2, 2);
  2323. * @param array - The array whose four consecutive elements correspond to the x, y, z, and w components, respectively.
  2324. * @param [startingIndex = 0] - The offset into the array of the first element, which corresponds to the x component.
  2325. * @param [result] - The object onto which to store the result.
  2326. * @returns The modified result parameter or a new Cartesian4 instance if one was not provided.
  2327. */
  2328. static fromArray(array: number[], startingIndex?: number, result?: Cartesian4): Cartesian4;
  2329. /**
  2330. * Computes the value of the maximum component for the supplied Cartesian.
  2331. * @param cartesian - The cartesian to use.
  2332. * @returns The value of the maximum component.
  2333. */
  2334. static maximumComponent(cartesian: Cartesian4): number;
  2335. /**
  2336. * Computes the value of the minimum component for the supplied Cartesian.
  2337. * @param cartesian - The cartesian to use.
  2338. * @returns The value of the minimum component.
  2339. */
  2340. static minimumComponent(cartesian: Cartesian4): number;
  2341. /**
  2342. * Compares two Cartesians and computes a Cartesian which contains the minimum components of the supplied Cartesians.
  2343. * @param first - A cartesian to compare.
  2344. * @param second - A cartesian to compare.
  2345. * @param result - The object into which to store the result.
  2346. * @returns A cartesian with the minimum components.
  2347. */
  2348. static minimumByComponent(first: Cartesian4, second: Cartesian4, result: Cartesian4): Cartesian4;
  2349. /**
  2350. * Compares two Cartesians and computes a Cartesian which contains the maximum components of the supplied Cartesians.
  2351. * @param first - A cartesian to compare.
  2352. * @param second - A cartesian to compare.
  2353. * @param result - The object into which to store the result.
  2354. * @returns A cartesian with the maximum components.
  2355. */
  2356. static maximumByComponent(first: Cartesian4, second: Cartesian4, result: Cartesian4): Cartesian4;
  2357. /**
  2358. * Computes the provided Cartesian's squared magnitude.
  2359. * @param cartesian - The Cartesian instance whose squared magnitude is to be computed.
  2360. * @returns The squared magnitude.
  2361. */
  2362. static magnitudeSquared(cartesian: Cartesian4): number;
  2363. /**
  2364. * Computes the Cartesian's magnitude (length).
  2365. * @param cartesian - The Cartesian instance whose magnitude is to be computed.
  2366. * @returns The magnitude.
  2367. */
  2368. static magnitude(cartesian: Cartesian4): number;
  2369. /**
  2370. * Computes the 4-space distance between two points.
  2371. * @example
  2372. * // Returns 1.0
  2373. var d = Cesium.Cartesian4.distance(
  2374. new Cesium.Cartesian4(1.0, 0.0, 0.0, 0.0),
  2375. new Cesium.Cartesian4(2.0, 0.0, 0.0, 0.0));
  2376. * @param left - The first point to compute the distance from.
  2377. * @param right - The second point to compute the distance to.
  2378. * @returns The distance between two points.
  2379. */
  2380. static distance(left: Cartesian4, right: Cartesian4): number;
  2381. /**
  2382. * Computes the squared distance between two points. Comparing squared distances
  2383. using this function is more efficient than comparing distances using {@link Cartesian4#distance}.
  2384. * @example
  2385. * // Returns 4.0, not 2.0
  2386. var d = Cesium.Cartesian4.distance(
  2387. new Cesium.Cartesian4(1.0, 0.0, 0.0, 0.0),
  2388. new Cesium.Cartesian4(3.0, 0.0, 0.0, 0.0));
  2389. * @param left - The first point to compute the distance from.
  2390. * @param right - The second point to compute the distance to.
  2391. * @returns The distance between two points.
  2392. */
  2393. static distanceSquared(left: Cartesian4, right: Cartesian4): number;
  2394. /**
  2395. * Computes the normalized form of the supplied Cartesian.
  2396. * @param cartesian - The Cartesian to be normalized.
  2397. * @param result - The object onto which to store the result.
  2398. * @returns The modified result parameter.
  2399. */
  2400. static normalize(cartesian: Cartesian4, result: Cartesian4): Cartesian4;
  2401. /**
  2402. * Computes the dot (scalar) product of two Cartesians.
  2403. * @param left - The first Cartesian.
  2404. * @param right - The second Cartesian.
  2405. * @returns The dot product.
  2406. */
  2407. static dot(left: Cartesian4, right: Cartesian4): number;
  2408. /**
  2409. * Computes the componentwise product of two Cartesians.
  2410. * @param left - The first Cartesian.
  2411. * @param right - The second Cartesian.
  2412. * @param result - The object onto which to store the result.
  2413. * @returns The modified result parameter.
  2414. */
  2415. static multiplyComponents(left: Cartesian4, right: Cartesian4, result: Cartesian4): Cartesian4;
  2416. /**
  2417. * Computes the componentwise quotient of two Cartesians.
  2418. * @param left - The first Cartesian.
  2419. * @param right - The second Cartesian.
  2420. * @param result - The object onto which to store the result.
  2421. * @returns The modified result parameter.
  2422. */
  2423. static divideComponents(left: Cartesian4, right: Cartesian4, result: Cartesian4): Cartesian4;
  2424. /**
  2425. * Computes the componentwise sum of two Cartesians.
  2426. * @param left - The first Cartesian.
  2427. * @param right - The second Cartesian.
  2428. * @param result - The object onto which to store the result.
  2429. * @returns The modified result parameter.
  2430. */
  2431. static add(left: Cartesian4, right: Cartesian4, result: Cartesian4): Cartesian4;
  2432. /**
  2433. * Computes the componentwise difference of two Cartesians.
  2434. * @param left - The first Cartesian.
  2435. * @param right - The second Cartesian.
  2436. * @param result - The object onto which to store the result.
  2437. * @returns The modified result parameter.
  2438. */
  2439. static subtract(left: Cartesian4, right: Cartesian4, result: Cartesian4): Cartesian4;
  2440. /**
  2441. * Multiplies the provided Cartesian componentwise by the provided scalar.
  2442. * @param cartesian - The Cartesian to be scaled.
  2443. * @param scalar - The scalar to multiply with.
  2444. * @param result - The object onto which to store the result.
  2445. * @returns The modified result parameter.
  2446. */
  2447. static multiplyByScalar(cartesian: Cartesian4, scalar: number, result: Cartesian4): Cartesian4;
  2448. /**
  2449. * Divides the provided Cartesian componentwise by the provided scalar.
  2450. * @param cartesian - The Cartesian to be divided.
  2451. * @param scalar - The scalar to divide by.
  2452. * @param result - The object onto which to store the result.
  2453. * @returns The modified result parameter.
  2454. */
  2455. static divideByScalar(cartesian: Cartesian4, scalar: number, result: Cartesian4): Cartesian4;
  2456. /**
  2457. * Negates the provided Cartesian.
  2458. * @param cartesian - The Cartesian to be negated.
  2459. * @param result - The object onto which to store the result.
  2460. * @returns The modified result parameter.
  2461. */
  2462. static negate(cartesian: Cartesian4, result: Cartesian4): Cartesian4;
  2463. /**
  2464. * Computes the absolute value of the provided Cartesian.
  2465. * @param cartesian - The Cartesian whose absolute value is to be computed.
  2466. * @param result - The object onto which to store the result.
  2467. * @returns The modified result parameter.
  2468. */
  2469. static abs(cartesian: Cartesian4, result: Cartesian4): Cartesian4;
  2470. /**
  2471. * Computes the linear interpolation or extrapolation at t using the provided cartesians.
  2472. * @param start - The value corresponding to t at 0.0.
  2473. * @param end - The value corresponding to t at 1.0.
  2474. * @param t - The point along t at which to interpolate.
  2475. * @param result - The object onto which to store the result.
  2476. * @returns The modified result parameter.
  2477. */
  2478. static lerp(start: Cartesian4, end: Cartesian4, t: number, result: Cartesian4): Cartesian4;
  2479. /**
  2480. * Returns the axis that is most orthogonal to the provided Cartesian.
  2481. * @param cartesian - The Cartesian on which to find the most orthogonal axis.
  2482. * @param result - The object onto which to store the result.
  2483. * @returns The most orthogonal axis.
  2484. */
  2485. static mostOrthogonalAxis(cartesian: Cartesian4, result: Cartesian4): Cartesian4;
  2486. /**
  2487. * Compares the provided Cartesians componentwise and returns
  2488. <code>true</code> if they are equal, <code>false</code> otherwise.
  2489. * @param [left] - The first Cartesian.
  2490. * @param [right] - The second Cartesian.
  2491. * @returns <code>true</code> if left and right are equal, <code>false</code> otherwise.
  2492. */
  2493. static equals(left?: Cartesian4, right?: Cartesian4): boolean;
  2494. /**
  2495. * Compares the provided Cartesians componentwise and returns
  2496. <code>true</code> if they pass an absolute or relative tolerance test,
  2497. <code>false</code> otherwise.
  2498. * @param [left] - The first Cartesian.
  2499. * @param [right] - The second Cartesian.
  2500. * @param [relativeEpsilon = 0] - The relative epsilon tolerance to use for equality testing.
  2501. * @param [absoluteEpsilon = relativeEpsilon] - The absolute epsilon tolerance to use for equality testing.
  2502. * @returns <code>true</code> if left and right are within the provided epsilon, <code>false</code> otherwise.
  2503. */
  2504. static equalsEpsilon(left?: Cartesian4, right?: Cartesian4, relativeEpsilon?: number, absoluteEpsilon?: number): boolean;
  2505. /**
  2506. * An immutable Cartesian4 instance initialized to (0.0, 0.0, 0.0, 0.0).
  2507. */
  2508. static readonly ZERO: Cartesian4;
  2509. /**
  2510. * An immutable Cartesian4 instance initialized to (1.0, 0.0, 0.0, 0.0).
  2511. */
  2512. static readonly UNIT_X: Cartesian4;
  2513. /**
  2514. * An immutable Cartesian4 instance initialized to (0.0, 1.0, 0.0, 0.0).
  2515. */
  2516. static readonly UNIT_Y: Cartesian4;
  2517. /**
  2518. * An immutable Cartesian4 instance initialized to (0.0, 0.0, 1.0, 0.0).
  2519. */
  2520. static readonly UNIT_Z: Cartesian4;
  2521. /**
  2522. * An immutable Cartesian4 instance initialized to (0.0, 0.0, 0.0, 1.0).
  2523. */
  2524. static readonly UNIT_W: Cartesian4;
  2525. /**
  2526. * Duplicates this Cartesian4 instance.
  2527. * @param [result] - The object onto which to store the result.
  2528. * @returns The modified result parameter or a new Cartesian4 instance if one was not provided.
  2529. */
  2530. clone(result?: Cartesian4): Cartesian4;
  2531. /**
  2532. * Compares this Cartesian against the provided Cartesian componentwise and returns
  2533. <code>true</code> if they are equal, <code>false</code> otherwise.
  2534. * @param [right] - The right hand side Cartesian.
  2535. * @returns <code>true</code> if they are equal, <code>false</code> otherwise.
  2536. */
  2537. equals(right?: Cartesian4): boolean;
  2538. /**
  2539. * Compares this Cartesian against the provided Cartesian componentwise and returns
  2540. <code>true</code> if they pass an absolute or relative tolerance test,
  2541. <code>false</code> otherwise.
  2542. * @param [right] - The right hand side Cartesian.
  2543. * @param [relativeEpsilon = 0] - The relative epsilon tolerance to use for equality testing.
  2544. * @param [absoluteEpsilon = relativeEpsilon] - The absolute epsilon tolerance to use for equality testing.
  2545. * @returns <code>true</code> if they are within the provided epsilon, <code>false</code> otherwise.
  2546. */
  2547. equalsEpsilon(right?: Cartesian4, relativeEpsilon?: number, absoluteEpsilon?: number): boolean;
  2548. /**
  2549. * Creates a string representing this Cartesian in the format '(x, y, z, w)'.
  2550. * @returns A string representing the provided Cartesian in the format '(x, y, z, w)'.
  2551. */
  2552. toString(): string;
  2553. /**
  2554. * Packs an arbitrary floating point value to 4 values representable using uint8.
  2555. * @param value - A floating point number
  2556. * @param [result] - The Cartesian4 that will contain the packed float.
  2557. * @returns A Cartesian4 representing the float packed to values in x, y, z, and w.
  2558. */
  2559. static packFloat(value: number, result?: Cartesian4): Cartesian4;
  2560. }
  2561. /**
  2562. * A position defined by longitude, latitude, and height.
  2563. * @param [longitude = 0.0] - The longitude, in radians.
  2564. * @param [latitude = 0.0] - The latitude, in radians.
  2565. * @param [height = 0.0] - The height, in meters, above the ellipsoid.
  2566. */
  2567. export class Cartographic {
  2568. constructor(longitude?: number, latitude?: number, height?: number);
  2569. /**
  2570. * The longitude, in radians.
  2571. */
  2572. longitude: number;
  2573. /**
  2574. * The latitude, in radians.
  2575. */
  2576. latitude: number;
  2577. /**
  2578. * The height, in meters, above the ellipsoid.
  2579. */
  2580. height: number;
  2581. /**
  2582. * Creates a new Cartographic instance from longitude and latitude
  2583. specified in radians.
  2584. * @param longitude - The longitude, in radians.
  2585. * @param latitude - The latitude, in radians.
  2586. * @param [height = 0.0] - The height, in meters, above the ellipsoid.
  2587. * @param [result] - The object onto which to store the result.
  2588. * @returns The modified result parameter or a new Cartographic instance if one was not provided.
  2589. */
  2590. static fromRadians(longitude: number, latitude: number, height?: number, result?: Cartographic): Cartographic;
  2591. /**
  2592. * Creates a new Cartographic instance from longitude and latitude
  2593. specified in degrees. The values in the resulting object will
  2594. be in radians.
  2595. * @param longitude - The longitude, in degrees.
  2596. * @param latitude - The latitude, in degrees.
  2597. * @param [height = 0.0] - The height, in meters, above the ellipsoid.
  2598. * @param [result] - The object onto which to store the result.
  2599. * @returns The modified result parameter or a new Cartographic instance if one was not provided.
  2600. */
  2601. static fromDegrees(longitude: number, latitude: number, height?: number, result?: Cartographic): Cartographic;
  2602. /**
  2603. * Creates a new Cartographic instance from a Cartesian position. The values in the
  2604. resulting object will be in radians.
  2605. * @param cartesian - The Cartesian position to convert to cartographic representation.
  2606. * @param [ellipsoid = Ellipsoid.WGS84] - The ellipsoid on which the position lies.
  2607. * @param [result] - The object onto which to store the result.
  2608. * @returns The modified result parameter, new Cartographic instance if none was provided, or undefined if the cartesian is at the center of the ellipsoid.
  2609. */
  2610. static fromCartesian(cartesian: Cartesian3, ellipsoid?: Ellipsoid, result?: Cartographic): Cartographic;
  2611. /**
  2612. * Creates a new Cartesian3 instance from a Cartographic input. The values in the inputted
  2613. object should be in radians.
  2614. * @param cartographic - Input to be converted into a Cartesian3 output.
  2615. * @param [ellipsoid = Ellipsoid.WGS84] - The ellipsoid on which the position lies.
  2616. * @param [result] - The object onto which to store the result.
  2617. * @returns The position
  2618. */
  2619. static toCartesian(cartographic: Cartographic, ellipsoid?: Ellipsoid, result?: Cartesian3): Cartesian3;
  2620. /**
  2621. * Duplicates a Cartographic instance.
  2622. * @param cartographic - The cartographic to duplicate.
  2623. * @param [result] - The object onto which to store the result.
  2624. * @returns The modified result parameter or a new Cartographic instance if one was not provided. (Returns undefined if cartographic is undefined)
  2625. */
  2626. static clone(cartographic: Cartographic, result?: Cartographic): Cartographic;
  2627. /**
  2628. * Compares the provided cartographics componentwise and returns
  2629. <code>true</code> if they are equal, <code>false</code> otherwise.
  2630. * @param [left] - The first cartographic.
  2631. * @param [right] - The second cartographic.
  2632. * @returns <code>true</code> if left and right are equal, <code>false</code> otherwise.
  2633. */
  2634. static equals(left?: Cartographic, right?: Cartographic): boolean;
  2635. /**
  2636. * Compares the provided cartographics componentwise and returns
  2637. <code>true</code> if they are within the provided epsilon,
  2638. <code>false</code> otherwise.
  2639. * @param [left] - The first cartographic.
  2640. * @param [right] - The second cartographic.
  2641. * @param [epsilon = 0] - The epsilon to use for equality testing.
  2642. * @returns <code>true</code> if left and right are within the provided epsilon, <code>false</code> otherwise.
  2643. */
  2644. static equalsEpsilon(left?: Cartographic, right?: Cartographic, epsilon?: number): boolean;
  2645. /**
  2646. * An immutable Cartographic instance initialized to (0.0, 0.0, 0.0).
  2647. */
  2648. static readonly ZERO: Cartographic;
  2649. /**
  2650. * Duplicates this instance.
  2651. * @param [result] - The object onto which to store the result.
  2652. * @returns The modified result parameter or a new Cartographic instance if one was not provided.
  2653. */
  2654. clone(result?: Cartographic): Cartographic;
  2655. /**
  2656. * Compares the provided against this cartographic componentwise and returns
  2657. <code>true</code> if they are equal, <code>false</code> otherwise.
  2658. * @param [right] - The second cartographic.
  2659. * @returns <code>true</code> if left and right are equal, <code>false</code> otherwise.
  2660. */
  2661. equals(right?: Cartographic): boolean;
  2662. /**
  2663. * Compares the provided against this cartographic componentwise and returns
  2664. <code>true</code> if they are within the provided epsilon,
  2665. <code>false</code> otherwise.
  2666. * @param [right] - The second cartographic.
  2667. * @param [epsilon = 0] - The epsilon to use for equality testing.
  2668. * @returns <code>true</code> if left and right are within the provided epsilon, <code>false</code> otherwise.
  2669. */
  2670. equalsEpsilon(right?: Cartographic, epsilon?: number): boolean;
  2671. /**
  2672. * Creates a string representing this cartographic in the format '(longitude, latitude, height)'.
  2673. * @returns A string representing the provided cartographic in the format '(longitude, latitude, height)'.
  2674. */
  2675. toString(): string;
  2676. }
  2677. /**
  2678. * Geocodes queries containing longitude and latitude coordinates and an optional height.
  2679. Query format: `longitude latitude (height)` with longitude/latitude in degrees and height in meters.
  2680. */
  2681. export class CartographicGeocoderService {
  2682. constructor();
  2683. /**
  2684. * @param query - The query to be sent to the geocoder service
  2685. */
  2686. geocode(query: string): Promise<GeocoderService.Result[]>;
  2687. }
  2688. /**
  2689. * A Catmull-Rom spline is a cubic spline where the tangent at control points,
  2690. except the first and last, are computed using the previous and next control points.
  2691. Catmull-Rom splines are in the class C<sup>1</sup>.
  2692. * @example
  2693. * // spline above the earth from Philadelphia to Los Angeles
  2694. var spline = new Cesium.CatmullRomSpline({
  2695. times : [ 0.0, 1.5, 3.0, 4.5, 6.0 ],
  2696. points : [
  2697. new Cesium.Cartesian3(1235398.0, -4810983.0, 4146266.0),
  2698. new Cesium.Cartesian3(1372574.0, -5345182.0, 4606657.0),
  2699. new Cesium.Cartesian3(-757983.0, -5542796.0, 4514323.0),
  2700. new Cesium.Cartesian3(-2821260.0, -5248423.0, 4021290.0),
  2701. new Cesium.Cartesian3(-2539788.0, -4724797.0, 3620093.0)
  2702. ]
  2703. });
  2704. var p0 = spline.evaluate(times[i]); // equal to positions[i]
  2705. var p1 = spline.evaluate(times[i] + delta); // interpolated value when delta < times[i + 1] - times[i]
  2706. * @param options - Object with the following properties:
  2707. * @param options.times - An array of strictly increasing, unit-less, floating-point times at each point.
  2708. The values are in no way connected to the clock time. They are the parameterization for the curve.
  2709. * @param options.points - The array of {@link Cartesian3} control points.
  2710. * @param [options.firstTangent] - The tangent of the curve at the first control point.
  2711. If the tangent is not given, it will be estimated.
  2712. * @param [options.lastTangent] - The tangent of the curve at the last control point.
  2713. If the tangent is not given, it will be estimated.
  2714. */
  2715. export class CatmullRomSpline {
  2716. constructor(options: {
  2717. times: number[];
  2718. points: Cartesian3[];
  2719. firstTangent?: Cartesian3;
  2720. lastTangent?: Cartesian3;
  2721. });
  2722. /**
  2723. * An array of times for the control points.
  2724. */
  2725. readonly times: number[];
  2726. /**
  2727. * An array of {@link Cartesian3} control points.
  2728. */
  2729. readonly points: Cartesian3[];
  2730. /**
  2731. * The tangent at the first control point.
  2732. */
  2733. readonly firstTangent: Cartesian3;
  2734. /**
  2735. * The tangent at the last control point.
  2736. */
  2737. readonly lastTangent: Cartesian3;
  2738. /**
  2739. * Finds an index <code>i</code> in <code>times</code> such that the parameter
  2740. <code>time</code> is in the interval <code>[times[i], times[i + 1]]</code>.
  2741. * @param time - The time.
  2742. * @returns The index for the element at the start of the interval.
  2743. */
  2744. findTimeInterval(time: number): number;
  2745. /**
  2746. * Wraps the given time to the period covered by the spline.
  2747. * @param time - The time.
  2748. * @returns The time, wrapped around to the updated animation.
  2749. */
  2750. wrapTime(time: number): number;
  2751. /**
  2752. * Clamps the given time to the period covered by the spline.
  2753. * @param time - The time.
  2754. * @returns The time, clamped to the animation period.
  2755. */
  2756. clampTime(time: number): number;
  2757. /**
  2758. * Evaluates the curve at a given time.
  2759. * @param time - The time at which to evaluate the curve.
  2760. * @param [result] - The object onto which to store the result.
  2761. * @returns The modified result parameter or a new instance of the point on the curve at the given time.
  2762. */
  2763. evaluate(time: number, result?: Cartesian3): Cartesian3;
  2764. }
  2765. /**
  2766. * A {@link TerrainProvider} that accesses terrain data in a Cesium terrain format.
  2767. * @example
  2768. * // Create Arctic DEM terrain with normals.
  2769. var viewer = new Cesium.Viewer('cesiumContainer', {
  2770. terrainProvider : new Cesium.CesiumTerrainProvider({
  2771. url : Cesium.IonResource.fromAssetId(3956),
  2772. requestVertexNormals : true
  2773. })
  2774. });
  2775. * @param options - Object with the following properties:
  2776. * @param options.url - The URL of the Cesium terrain server.
  2777. * @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.
  2778. * @param [options.requestWaterMask = false] - Flag that indicates if the client should request per tile water masks from the server, if available.
  2779. * @param [options.requestMetadata = true] - Flag that indicates if the client should request per tile metadata from the server, if available.
  2780. * @param [options.ellipsoid] - The ellipsoid. If not specified, the WGS84 ellipsoid is used.
  2781. * @param [options.credit] - A credit for the data source, which is displayed on the canvas.
  2782. */
  2783. export class CesiumTerrainProvider {
  2784. constructor(options: {
  2785. url: Resource | string | Promise<Resource> | Promise<string>;
  2786. requestVertexNormals?: boolean;
  2787. requestWaterMask?: boolean;
  2788. requestMetadata?: boolean;
  2789. ellipsoid?: Ellipsoid;
  2790. credit?: Credit | string;
  2791. });
  2792. /**
  2793. * Requests the geometry for a given tile. This function should not be called before
  2794. {@link CesiumTerrainProvider#ready} returns true. The result must include terrain data and
  2795. may optionally include a water mask and an indication of which child tiles are available.
  2796. * @param x - The X coordinate of the tile for which to request geometry.
  2797. * @param y - The Y coordinate of the tile for which to request geometry.
  2798. * @param level - The level of the tile for which to request geometry.
  2799. * @param [request] - The request object. Intended for internal use only.
  2800. * @returns A promise for the requested geometry. If this method
  2801. returns undefined instead of a promise, it is an indication that too many requests are already
  2802. pending and the request will be retried later.
  2803. */
  2804. requestTileGeometry(x: number, y: number, level: number, request?: Request): Promise<TerrainData> | undefined;
  2805. /**
  2806. * Gets an event that is raised when the terrain provider encounters an asynchronous error. By subscribing
  2807. to the event, you will be notified of the error and can potentially recover from it. Event listeners
  2808. are passed an instance of {@link TileProviderError}.
  2809. */
  2810. errorEvent: Event;
  2811. /**
  2812. * Gets the credit to display when this terrain provider is active. Typically this is used to credit
  2813. the source of the terrain. This function should not be called before {@link CesiumTerrainProvider#ready} returns true.
  2814. */
  2815. credit: Credit;
  2816. /**
  2817. * Gets the tiling scheme used by this provider. This function should
  2818. not be called before {@link CesiumTerrainProvider#ready} returns true.
  2819. */
  2820. tilingScheme: GeographicTilingScheme;
  2821. /**
  2822. * Gets a value indicating whether or not the provider is ready for use.
  2823. */
  2824. ready: boolean;
  2825. /**
  2826. * Gets a promise that resolves to true when the provider is ready for use.
  2827. */
  2828. readonly readyPromise: Promise<boolean>;
  2829. /**
  2830. * Gets a value indicating whether or not the provider includes a water mask. The water mask
  2831. indicates which areas of the globe are water rather than land, so they can be rendered
  2832. as a reflective surface with animated waves. This function should not be
  2833. called before {@link CesiumTerrainProvider#ready} returns true.
  2834. */
  2835. hasWaterMask: boolean;
  2836. /**
  2837. * Gets a value indicating whether or not the requested tiles include vertex normals.
  2838. This function should not be called before {@link CesiumTerrainProvider#ready} returns true.
  2839. */
  2840. hasVertexNormals: boolean;
  2841. /**
  2842. * Gets a value indicating whether or not the requested tiles include metadata.
  2843. This function should not be called before {@link CesiumTerrainProvider#ready} returns true.
  2844. */
  2845. hasMetadata: boolean;
  2846. /**
  2847. * Boolean flag that indicates if the client should request vertex normals from the server.
  2848. Vertex normals data is appended to the standard tile mesh data only if the client requests the vertex normals and
  2849. if the server provides vertex normals.
  2850. */
  2851. requestVertexNormals: boolean;
  2852. /**
  2853. * Boolean flag that indicates if the client should request a watermask from the server.
  2854. Watermask data is appended to the standard tile mesh data only if the client requests the watermask and
  2855. if the server provides a watermask.
  2856. */
  2857. requestWaterMask: boolean;
  2858. /**
  2859. * Boolean flag that indicates if the client should request metadata from the server.
  2860. Metadata is appended to the standard tile mesh data only if the client requests the metadata and
  2861. if the server provides a metadata.
  2862. */
  2863. requestMetadata: boolean;
  2864. /**
  2865. * Gets an object that can be used to determine availability of terrain from this provider, such as
  2866. at points and in rectangles. This function should not be called before
  2867. {@link CesiumTerrainProvider#ready} returns true. This property may be undefined if availability
  2868. information is not available. Note that this reflects tiles that are known to be available currently.
  2869. Additional tiles may be discovered to be available in the future, e.g. if availability information
  2870. exists deeper in the tree rather than it all being discoverable at the root. However, a tile that
  2871. is available now will not become unavailable in the future.
  2872. */
  2873. availability: TileAvailability;
  2874. /**
  2875. * Gets the maximum geometric error allowed in a tile at a given level.
  2876. * @param level - The tile level for which to get the maximum geometric error.
  2877. * @returns The maximum geometric error.
  2878. */
  2879. getLevelMaximumGeometricError(level: number): number;
  2880. /**
  2881. * Determines whether data for a tile is available to be loaded.
  2882. * @param x - The X coordinate of the tile for which to request geometry.
  2883. * @param y - The Y coordinate of the tile for which to request geometry.
  2884. * @param level - The level of the tile for which to request geometry.
  2885. * @returns Undefined if not supported or availability is unknown, otherwise true or false.
  2886. */
  2887. getTileDataAvailable(x: number, y: number, level: number): boolean;
  2888. /**
  2889. * Makes sure we load availability data for a tile
  2890. * @param x - The X coordinate of the tile for which to request geometry.
  2891. * @param y - The Y coordinate of the tile for which to request geometry.
  2892. * @param level - The level of the tile for which to request geometry.
  2893. * @returns Undefined if nothing need to be loaded or a Promise that resolves when all required tiles are loaded
  2894. */
  2895. loadTileDataAvailability(x: number, y: number, level: number): undefined | Promise<void>;
  2896. }
  2897. /**
  2898. * A description of a circle on the ellipsoid. Circle geometry can be rendered with both {@link Primitive} and {@link GroundPrimitive}.
  2899. * @example
  2900. * // Create a circle.
  2901. var circle = new Cesium.CircleGeometry({
  2902. center : Cesium.Cartesian3.fromDegrees(-75.59777, 40.03883),
  2903. radius : 100000.0
  2904. });
  2905. var geometry = Cesium.CircleGeometry.createGeometry(circle);
  2906. * @param options - Object with the following properties:
  2907. * @param options.center - The circle's center point in the fixed frame.
  2908. * @param options.radius - The radius in meters.
  2909. * @param [options.ellipsoid = Ellipsoid.WGS84] - The ellipsoid the circle will be on.
  2910. * @param [options.height = 0.0] - The distance in meters between the circle and the ellipsoid surface.
  2911. * @param [options.granularity = 0.02] - The angular distance between points on the circle in radians.
  2912. * @param [options.vertexFormat = VertexFormat.DEFAULT] - The vertex attributes to be computed.
  2913. * @param [options.extrudedHeight = 0.0] - The distance in meters between the circle's extruded face and the ellipsoid surface.
  2914. * @param [options.stRotation = 0.0] - The rotation of the texture coordinates, in radians. A positive rotation is counter-clockwise.
  2915. */
  2916. export class CircleGeometry {
  2917. constructor(options: {
  2918. center: Cartesian3;
  2919. radius: number;
  2920. ellipsoid?: Ellipsoid;
  2921. height?: number;
  2922. granularity?: number;
  2923. vertexFormat?: VertexFormat;
  2924. extrudedHeight?: number;
  2925. stRotation?: number;
  2926. });
  2927. /**
  2928. * The number of elements used to pack the object into an array.
  2929. */
  2930. static packedLength: number;
  2931. /**
  2932. * Stores the provided instance into the provided array.
  2933. * @param value - The value to pack.
  2934. * @param array - The array to pack into.
  2935. * @param [startingIndex = 0] - The index into the array at which to start packing the elements.
  2936. * @returns The array that was packed into
  2937. */
  2938. static pack(value: CircleGeometry, array: number[], startingIndex?: number): number[];
  2939. /**
  2940. * Retrieves an instance from a packed array.
  2941. * @param array - The packed array.
  2942. * @param [startingIndex = 0] - The starting index of the element to be unpacked.
  2943. * @param [result] - The object into which to store the result.
  2944. * @returns The modified result parameter or a new CircleGeometry instance if one was not provided.
  2945. */
  2946. static unpack(array: number[], startingIndex?: number, result?: CircleGeometry): CircleGeometry;
  2947. /**
  2948. * Computes the geometric representation of a circle on an ellipsoid, including its vertices, indices, and a bounding sphere.
  2949. * @param circleGeometry - A description of the circle.
  2950. * @returns The computed vertices and indices.
  2951. */
  2952. static createGeometry(circleGeometry: CircleGeometry): Geometry | undefined;
  2953. }
  2954. /**
  2955. * A description of the outline of a circle on the ellipsoid.
  2956. * @example
  2957. * // Create a circle.
  2958. var circle = new Cesium.CircleOutlineGeometry({
  2959. center : Cesium.Cartesian3.fromDegrees(-75.59777, 40.03883),
  2960. radius : 100000.0
  2961. });
  2962. var geometry = Cesium.CircleOutlineGeometry.createGeometry(circle);
  2963. * @param options - Object with the following properties:
  2964. * @param options.center - The circle's center point in the fixed frame.
  2965. * @param options.radius - The radius in meters.
  2966. * @param [options.ellipsoid = Ellipsoid.WGS84] - The ellipsoid the circle will be on.
  2967. * @param [options.height = 0.0] - The distance in meters between the circle and the ellipsoid surface.
  2968. * @param [options.granularity = 0.02] - The angular distance between points on the circle in radians.
  2969. * @param [options.extrudedHeight = 0.0] - The distance in meters between the circle's extruded face and the ellipsoid surface.
  2970. * @param [options.numberOfVerticalLines = 16] - Number of lines to draw between the top and bottom of an extruded circle.
  2971. */
  2972. export class CircleOutlineGeometry {
  2973. constructor(options: {
  2974. center: Cartesian3;
  2975. radius: number;
  2976. ellipsoid?: Ellipsoid;
  2977. height?: number;
  2978. granularity?: number;
  2979. extrudedHeight?: number;
  2980. numberOfVerticalLines?: number;
  2981. });
  2982. /**
  2983. * The number of elements used to pack the object into an array.
  2984. */
  2985. static packedLength: number;
  2986. /**
  2987. * Stores the provided instance into the provided array.
  2988. * @param value - The value to pack.
  2989. * @param array - The array to pack into.
  2990. * @param [startingIndex = 0] - The index into the array at which to start packing the elements.
  2991. * @returns The array that was packed into
  2992. */
  2993. static pack(value: CircleOutlineGeometry, array: number[], startingIndex?: number): number[];
  2994. /**
  2995. * Retrieves an instance from a packed array.
  2996. * @param array - The packed array.
  2997. * @param [startingIndex = 0] - The starting index of the element to be unpacked.
  2998. * @param [result] - The object into which to store the result.
  2999. * @returns The modified result parameter or a new CircleOutlineGeometry instance if one was not provided.
  3000. */
  3001. static unpack(array: number[], startingIndex?: number, result?: CircleOutlineGeometry): CircleOutlineGeometry;
  3002. /**
  3003. * Computes the geometric representation of an outline of a circle on an ellipsoid, including its vertices, indices, and a bounding sphere.
  3004. * @param circleGeometry - A description of the circle.
  3005. * @returns The computed vertices and indices.
  3006. */
  3007. static createGeometry(circleGeometry: CircleOutlineGeometry): Geometry | undefined;
  3008. }
  3009. /**
  3010. * A simple clock for keeping track of simulated time.
  3011. * @example
  3012. * // Create a clock that loops on Christmas day 2013 and runs in real-time.
  3013. var clock = new Cesium.Clock({
  3014. startTime : Cesium.JulianDate.fromIso8601("2013-12-25"),
  3015. currentTime : Cesium.JulianDate.fromIso8601("2013-12-25"),
  3016. stopTime : Cesium.JulianDate.fromIso8601("2013-12-26"),
  3017. clockRange : Cesium.ClockRange.LOOP_STOP,
  3018. clockStep : Cesium.ClockStep.SYSTEM_CLOCK_MULTIPLIER
  3019. });
  3020. * @param [options] - Object with the following properties:
  3021. * @param [options.startTime] - The start time of the clock.
  3022. * @param [options.stopTime] - The stop time of the clock.
  3023. * @param [options.currentTime] - The current time.
  3024. * @param [options.multiplier = 1.0] - Determines how much time advances when {@link Clock#tick} is called, negative values allow for advancing backwards.
  3025. * @param [options.clockStep = ClockStep.SYSTEM_CLOCK_MULTIPLIER] - Determines if calls to {@link Clock#tick} are frame dependent or system clock dependent.
  3026. * @param [options.clockRange = ClockRange.UNBOUNDED] - Determines how the clock should behave when {@link Clock#startTime} or {@link Clock#stopTime} is reached.
  3027. * @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.
  3028. * @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.
  3029. */
  3030. export class Clock {
  3031. constructor(options?: {
  3032. startTime?: JulianDate;
  3033. stopTime?: JulianDate;
  3034. currentTime?: JulianDate;
  3035. multiplier?: number;
  3036. clockStep?: ClockStep;
  3037. clockRange?: ClockRange;
  3038. canAnimate?: boolean;
  3039. shouldAnimate?: boolean;
  3040. });
  3041. /**
  3042. * The start time of the clock.
  3043. */
  3044. startTime: JulianDate;
  3045. /**
  3046. * The stop time of the clock.
  3047. */
  3048. stopTime: JulianDate;
  3049. /**
  3050. * Determines how the clock should behave when
  3051. {@link Clock#startTime} or {@link Clock#stopTime}
  3052. is reached.
  3053. */
  3054. clockRange: ClockRange;
  3055. /**
  3056. * Indicates whether {@link Clock#tick} can advance time. This could be false if data is being buffered,
  3057. for example. The clock will only advance time when both
  3058. {@link Clock#canAnimate} and {@link Clock#shouldAnimate} are true.
  3059. */
  3060. canAnimate: boolean;
  3061. /**
  3062. * An {@link Event} that is fired whenever {@link Clock#tick} is called.
  3063. */
  3064. onTick: Event;
  3065. /**
  3066. * An {@link Event} that is fired whenever {@link Clock#stopTime} is reached.
  3067. */
  3068. onStop: Event;
  3069. /**
  3070. * The current time.
  3071. Changing this property will change
  3072. {@link Clock#clockStep} from {@link ClockStep.SYSTEM_CLOCK} to
  3073. {@link ClockStep.SYSTEM_CLOCK_MULTIPLIER}.
  3074. */
  3075. currentTime: JulianDate;
  3076. /**
  3077. * Gets or sets how much time advances when {@link Clock#tick} is called. Negative values allow for advancing backwards.
  3078. If {@link Clock#clockStep} is set to {@link ClockStep.TICK_DEPENDENT}, this is the number of seconds to advance.
  3079. If {@link Clock#clockStep} is set to {@link ClockStep.SYSTEM_CLOCK_MULTIPLIER}, this value is multiplied by the
  3080. elapsed system time since the last call to {@link Clock#tick}.
  3081. Changing this property will change
  3082. {@link Clock#clockStep} from {@link ClockStep.SYSTEM_CLOCK} to
  3083. {@link ClockStep.SYSTEM_CLOCK_MULTIPLIER}.
  3084. */
  3085. multiplier: number;
  3086. /**
  3087. * Determines if calls to {@link Clock#tick} are frame dependent or system clock dependent.
  3088. Changing this property to {@link ClockStep.SYSTEM_CLOCK} will set
  3089. {@link Clock#multiplier} to 1.0, {@link Clock#shouldAnimate} to true, and
  3090. {@link Clock#currentTime} to the current system clock time.
  3091. */
  3092. clockStep: ClockStep;
  3093. /**
  3094. * Indicates whether {@link Clock#tick} should attempt to advance time.
  3095. The clock will only advance time when both
  3096. {@link Clock#canAnimate} and {@link Clock#shouldAnimate} are true.
  3097. Changing this property will change
  3098. {@link Clock#clockStep} from {@link ClockStep.SYSTEM_CLOCK} to
  3099. {@link ClockStep.SYSTEM_CLOCK_MULTIPLIER}.
  3100. */
  3101. shouldAnimate: boolean;
  3102. /**
  3103. * Advances the clock from the current time based on the current configuration options.
  3104. tick should be called every frame, regardless of whether animation is taking place
  3105. or not. To control animation, use the {@link Clock#shouldAnimate} property.
  3106. * @returns The new value of the {@link Clock#currentTime} property.
  3107. */
  3108. tick(): JulianDate;
  3109. }
  3110. /**
  3111. * Constants used by {@link Clock#tick} to determine behavior
  3112. when {@link Clock#startTime} or {@link Clock#stopTime} is reached.
  3113. */
  3114. export enum ClockRange {
  3115. /**
  3116. * {@link Clock#tick} will always advances the clock in its current direction.
  3117. */
  3118. UNBOUNDED = 0,
  3119. /**
  3120. * When {@link Clock#startTime} or {@link Clock#stopTime} is reached,
  3121. {@link Clock#tick} will not advance {@link Clock#currentTime} any further.
  3122. */
  3123. CLAMPED = 1,
  3124. /**
  3125. * When {@link Clock#stopTime} is reached, {@link Clock#tick} will advance
  3126. {@link Clock#currentTime} to the opposite end of the interval. When
  3127. time is moving backwards, {@link Clock#tick} will not advance past
  3128. {@link Clock#startTime}
  3129. */
  3130. LOOP_STOP = 2
  3131. }
  3132. /**
  3133. * Constants to determine how much time advances with each call
  3134. to {@link Clock#tick}.
  3135. */
  3136. export enum ClockStep {
  3137. /**
  3138. * {@link Clock#tick} advances the current time by a fixed step,
  3139. which is the number of seconds specified by {@link Clock#multiplier}.
  3140. */
  3141. TICK_DEPENDENT = 0,
  3142. /**
  3143. * {@link Clock#tick} advances the current time by the amount of system
  3144. time elapsed since the previous call multiplied by {@link Clock#multiplier}.
  3145. */
  3146. SYSTEM_CLOCK_MULTIPLIER = 1,
  3147. /**
  3148. * {@link Clock#tick} sets the clock to the current system time;
  3149. ignoring all other settings.
  3150. */
  3151. SYSTEM_CLOCK = 2
  3152. }
  3153. /**
  3154. * Clones an object, returning a new object containing the same properties.
  3155. * @param object - The object to clone.
  3156. * @param [deep = false] - If true, all properties will be deep cloned recursively.
  3157. * @returns The cloned object.
  3158. */
  3159. export function clone(object: any, deep?: boolean): any;
  3160. /**
  3161. * A color, specified using red, green, blue, and alpha values,
  3162. which range from <code>0</code> (no intensity) to <code>1.0</code> (full intensity).
  3163. * @param [red = 1.0] - The red component.
  3164. * @param [green = 1.0] - The green component.
  3165. * @param [blue = 1.0] - The blue component.
  3166. * @param [alpha = 1.0] - The alpha component.
  3167. */
  3168. export class Color {
  3169. constructor(red?: number, green?: number, blue?: number, alpha?: number);
  3170. /**
  3171. * The red component.
  3172. */
  3173. red: number;
  3174. /**
  3175. * The green component.
  3176. */
  3177. green: number;
  3178. /**
  3179. * The blue component.
  3180. */
  3181. blue: number;
  3182. /**
  3183. * The alpha component.
  3184. */
  3185. alpha: number;
  3186. /**
  3187. * Creates a Color instance from a {@link Cartesian4}. <code>x</code>, <code>y</code>, <code>z</code>,
  3188. and <code>w</code> map to <code>red</code>, <code>green</code>, <code>blue</code>, and <code>alpha</code>, respectively.
  3189. * @param cartesian - The source cartesian.
  3190. * @param [result] - The object onto which to store the result.
  3191. * @returns The modified result parameter or a new Color instance if one was not provided.
  3192. */
  3193. static fromCartesian4(cartesian: Cartesian4, result?: Color): Color;
  3194. /**
  3195. * Creates a new Color specified using red, green, blue, and alpha values
  3196. that are in the range of 0 to 255, converting them internally to a range of 0.0 to 1.0.
  3197. * @param [red = 255] - The red component.
  3198. * @param [green = 255] - The green component.
  3199. * @param [blue = 255] - The blue component.
  3200. * @param [alpha = 255] - The alpha component.
  3201. * @param [result] - The object onto which to store the result.
  3202. * @returns The modified result parameter or a new Color instance if one was not provided.
  3203. */
  3204. static fromBytes(red?: number, green?: number, blue?: number, alpha?: number, result?: Color): Color;
  3205. /**
  3206. * Creates a new Color that has the same red, green, and blue components
  3207. of the specified color, but with the specified alpha value.
  3208. * @example
  3209. * var translucentRed = Cesium.Color.fromAlpha(Cesium.Color.RED, 0.9);
  3210. * @param color - The base color
  3211. * @param alpha - The new alpha component.
  3212. * @param [result] - The object onto which to store the result.
  3213. * @returns The modified result parameter or a new Color instance if one was not provided.
  3214. */
  3215. static fromAlpha(color: Color, alpha: number, result?: Color): Color;
  3216. /**
  3217. * Creates a new Color from a single numeric unsigned 32-bit RGBA value, using the endianness
  3218. of the system.
  3219. * @example
  3220. * var color = Cesium.Color.fromRgba(0x67ADDFFF);
  3221. * @param rgba - A single numeric unsigned 32-bit RGBA value.
  3222. * @param [result] - The object to store the result in, if undefined a new instance will be created.
  3223. * @returns The color object.
  3224. */
  3225. static fromRgba(rgba: number, result?: Color): Color;
  3226. /**
  3227. * Creates a Color instance from hue, saturation, and lightness.
  3228. * @param [hue = 0] - The hue angle 0...1
  3229. * @param [saturation = 0] - The saturation value 0...1
  3230. * @param [lightness = 0] - The lightness value 0...1
  3231. * @param [alpha = 1.0] - The alpha component 0...1
  3232. * @param [result] - The object to store the result in, if undefined a new instance will be created.
  3233. * @returns The color object.
  3234. */
  3235. static fromHsl(hue?: number, saturation?: number, lightness?: number, alpha?: number, result?: Color): Color;
  3236. /**
  3237. * Creates a random color using the provided options. For reproducible random colors, you should
  3238. call {@link Math#setRandomNumberSeed} once at the beginning of your application.
  3239. * @example
  3240. * //Create a completely random color
  3241. var color = Cesium.Color.fromRandom();
  3242. //Create a random shade of yellow.
  3243. var color = Cesium.Color.fromRandom({
  3244. red : 1.0,
  3245. green : 1.0,
  3246. alpha : 1.0
  3247. });
  3248. //Create a random bright color.
  3249. var color = Cesium.Color.fromRandom({
  3250. minimumRed : 0.75,
  3251. minimumGreen : 0.75,
  3252. minimumBlue : 0.75,
  3253. alpha : 1.0
  3254. });
  3255. * @param [options] - Object with the following properties:
  3256. * @param [options.red] - If specified, the red component to use instead of a randomized value.
  3257. * @param [options.minimumRed = 0.0] - The maximum red value to generate if none was specified.
  3258. * @param [options.maximumRed = 1.0] - The minimum red value to generate if none was specified.
  3259. * @param [options.green] - If specified, the green component to use instead of a randomized value.
  3260. * @param [options.minimumGreen = 0.0] - The maximum green value to generate if none was specified.
  3261. * @param [options.maximumGreen = 1.0] - The minimum green value to generate if none was specified.
  3262. * @param [options.blue] - If specified, the blue component to use instead of a randomized value.
  3263. * @param [options.minimumBlue = 0.0] - The maximum blue value to generate if none was specified.
  3264. * @param [options.maximumBlue = 1.0] - The minimum blue value to generate if none was specified.
  3265. * @param [options.alpha] - If specified, the alpha component to use instead of a randomized value.
  3266. * @param [options.minimumAlpha = 0.0] - The maximum alpha value to generate if none was specified.
  3267. * @param [options.maximumAlpha = 1.0] - The minimum alpha value to generate if none was specified.
  3268. * @param [result] - The object to store the result in, if undefined a new instance will be created.
  3269. * @returns The modified result parameter or a new instance if result was undefined.
  3270. */
  3271. static fromRandom(options?: {
  3272. red?: number;
  3273. minimumRed?: number;
  3274. maximumRed?: number;
  3275. green?: number;
  3276. minimumGreen?: number;
  3277. maximumGreen?: number;
  3278. blue?: number;
  3279. minimumBlue?: number;
  3280. maximumBlue?: number;
  3281. alpha?: number;
  3282. minimumAlpha?: number;
  3283. maximumAlpha?: number;
  3284. }, result?: Color): Color;
  3285. /**
  3286. * Creates a Color instance from a CSS color value.
  3287. * @example
  3288. * var cesiumBlue = Cesium.Color.fromCssColorString('#67ADDF');
  3289. var green = Cesium.Color.fromCssColorString('green');
  3290. * @param color - The CSS color value in #rgb, #rgba, #rrggbb, #rrggbbaa, rgb(), rgba(), hsl(), or hsla() format.
  3291. * @param [result] - The object to store the result in, if undefined a new instance will be created.
  3292. * @returns The color object, or undefined if the string was not a valid CSS color.
  3293. */
  3294. static fromCssColorString(color: string, result?: Color): Color;
  3295. /**
  3296. * The number of elements used to pack the object into an array.
  3297. */
  3298. static packedLength: number;
  3299. /**
  3300. * Stores the provided instance into the provided array.
  3301. * @param value - The value to pack.
  3302. * @param array - The array to pack into.
  3303. * @param [startingIndex = 0] - The index into the array at which to start packing the elements.
  3304. * @returns The array that was packed into
  3305. */
  3306. static pack(value: Color, array: number[], startingIndex?: number): number[];
  3307. /**
  3308. * Retrieves an instance from a packed array.
  3309. * @param array - The packed array.
  3310. * @param [startingIndex = 0] - The starting index of the element to be unpacked.
  3311. * @param [result] - The object into which to store the result.
  3312. * @returns The modified result parameter or a new Color instance if one was not provided.
  3313. */
  3314. static unpack(array: number[], startingIndex?: number, result?: Color): Color;
  3315. /**
  3316. * Converts a 'byte' color component in the range of 0 to 255 into
  3317. a 'float' color component in the range of 0 to 1.0.
  3318. * @param number - The number to be converted.
  3319. * @returns The converted number.
  3320. */
  3321. static byteToFloat(number: number): number;
  3322. /**
  3323. * Converts a 'float' color component in the range of 0 to 1.0 into
  3324. a 'byte' color component in the range of 0 to 255.
  3325. * @param number - The number to be converted.
  3326. * @returns The converted number.
  3327. */
  3328. static floatToByte(number: number): number;
  3329. /**
  3330. * Duplicates a Color.
  3331. * @param color - The Color to duplicate.
  3332. * @param [result] - The object to store the result in, if undefined a new instance will be created.
  3333. * @returns The modified result parameter or a new instance if result was undefined. (Returns undefined if color is undefined)
  3334. */
  3335. static clone(color: Color, result?: Color): Color;
  3336. /**
  3337. * Returns true if the first Color equals the second color.
  3338. * @param left - The first Color to compare for equality.
  3339. * @param right - The second Color to compare for equality.
  3340. * @returns <code>true</code> if the Colors are equal; otherwise, <code>false</code>.
  3341. */
  3342. static equals(left: Color, right: Color): boolean;
  3343. /**
  3344. * Returns a duplicate of a Color instance.
  3345. * @param [result] - The object to store the result in, if undefined a new instance will be created.
  3346. * @returns The modified result parameter or a new instance if result was undefined.
  3347. */
  3348. clone(result?: Color): Color;
  3349. /**
  3350. * Returns true if this Color equals other.
  3351. * @param other - The Color to compare for equality.
  3352. * @returns <code>true</code> if the Colors are equal; otherwise, <code>false</code>.
  3353. */
  3354. equals(other: Color): boolean;
  3355. /**
  3356. * Returns <code>true</code> if this Color equals other componentwise within the specified epsilon.
  3357. * @param other - The Color to compare for equality.
  3358. * @param [epsilon = 0.0] - The epsilon to use for equality testing.
  3359. * @returns <code>true</code> if the Colors are equal within the specified epsilon; otherwise, <code>false</code>.
  3360. */
  3361. equalsEpsilon(other: Color, epsilon?: number): boolean;
  3362. /**
  3363. * Creates a string representing this Color in the format '(red, green, blue, alpha)'.
  3364. * @returns A string representing this Color in the format '(red, green, blue, alpha)'.
  3365. */
  3366. toString(): string;
  3367. /**
  3368. * Creates a string containing the CSS color value for this color.
  3369. * @returns The CSS equivalent of this color.
  3370. */
  3371. toCssColorString(): string;
  3372. /**
  3373. * Creates a string containing CSS hex string color value for this color.
  3374. * @returns The CSS hex string equivalent of this color.
  3375. */
  3376. toCssHexString(): string;
  3377. /**
  3378. * Converts this color to an array of red, green, blue, and alpha values
  3379. that are in the range of 0 to 255.
  3380. * @param [result] - The array to store the result in, if undefined a new instance will be created.
  3381. * @returns The modified result parameter or a new instance if result was undefined.
  3382. */
  3383. toBytes(result?: number[]): number[];
  3384. /**
  3385. * Converts this color to a single numeric unsigned 32-bit RGBA value, using the endianness
  3386. of the system.
  3387. * @example
  3388. * var rgba = Cesium.Color.BLUE.toRgba();
  3389. * @returns A single numeric unsigned 32-bit RGBA value.
  3390. */
  3391. toRgba(): number;
  3392. /**
  3393. * Brightens this color by the provided magnitude.
  3394. * @example
  3395. * var brightBlue = Cesium.Color.BLUE.brighten(0.5, new Cesium.Color());
  3396. * @param magnitude - A positive number indicating the amount to brighten.
  3397. * @param result - The object onto which to store the result.
  3398. * @returns The modified result parameter.
  3399. */
  3400. brighten(magnitude: number, result: Color): Color;
  3401. /**
  3402. * Darkens this color by the provided magnitude.
  3403. * @example
  3404. * var darkBlue = Cesium.Color.BLUE.darken(0.5, new Cesium.Color());
  3405. * @param magnitude - A positive number indicating the amount to darken.
  3406. * @param result - The object onto which to store the result.
  3407. * @returns The modified result parameter.
  3408. */
  3409. darken(magnitude: number, result: Color): Color;
  3410. /**
  3411. * Creates a new Color that has the same red, green, and blue components
  3412. as this Color, but with the specified alpha value.
  3413. * @example
  3414. * var translucentRed = Cesium.Color.RED.withAlpha(0.9);
  3415. * @param alpha - The new alpha component.
  3416. * @param [result] - The object onto which to store the result.
  3417. * @returns The modified result parameter or a new Color instance if one was not provided.
  3418. */
  3419. withAlpha(alpha: number, result?: Color): Color;
  3420. /**
  3421. * Computes the componentwise sum of two Colors.
  3422. * @param left - The first Color.
  3423. * @param right - The second Color.
  3424. * @param result - The object onto which to store the result.
  3425. * @returns The modified result parameter.
  3426. */
  3427. static add(left: Color, right: Color, result: Color): Color;
  3428. /**
  3429. * Computes the componentwise difference of two Colors.
  3430. * @param left - The first Color.
  3431. * @param right - The second Color.
  3432. * @param result - The object onto which to store the result.
  3433. * @returns The modified result parameter.
  3434. */
  3435. static subtract(left: Color, right: Color, result: Color): Color;
  3436. /**
  3437. * Computes the componentwise product of two Colors.
  3438. * @param left - The first Color.
  3439. * @param right - The second Color.
  3440. * @param result - The object onto which to store the result.
  3441. * @returns The modified result parameter.
  3442. */
  3443. static multiply(left: Color, right: Color, result: Color): Color;
  3444. /**
  3445. * Computes the componentwise quotient of two Colors.
  3446. * @param left - The first Color.
  3447. * @param right - The second Color.
  3448. * @param result - The object onto which to store the result.
  3449. * @returns The modified result parameter.
  3450. */
  3451. static divide(left: Color, right: Color, result: Color): Color;
  3452. /**
  3453. * Computes the componentwise modulus of two Colors.
  3454. * @param left - The first Color.
  3455. * @param right - The second Color.
  3456. * @param result - The object onto which to store the result.
  3457. * @returns The modified result parameter.
  3458. */
  3459. static mod(left: Color, right: Color, result: Color): Color;
  3460. /**
  3461. * Computes the linear interpolation or extrapolation at t between the provided colors.
  3462. * @param start - The color corresponding to t at 0.0.
  3463. * @param end - The color corresponding to t at 1.0.
  3464. * @param t - The point along t at which to interpolate.
  3465. * @param result - The object onto which to store the result.
  3466. * @returns The modified result parameter.
  3467. */
  3468. static lerp(start: Color, end: Color, t: number, result: Color): Color;
  3469. /**
  3470. * Multiplies the provided Color componentwise by the provided scalar.
  3471. * @param color - The Color to be scaled.
  3472. * @param scalar - The scalar to multiply with.
  3473. * @param result - The object onto which to store the result.
  3474. * @returns The modified result parameter.
  3475. */
  3476. static multiplyByScalar(color: Color, scalar: number, result: Color): Color;
  3477. /**
  3478. * Divides the provided Color componentwise by the provided scalar.
  3479. * @param color - The Color to be divided.
  3480. * @param scalar - The scalar to divide with.
  3481. * @param result - The object onto which to store the result.
  3482. * @returns The modified result parameter.
  3483. */
  3484. static divideByScalar(color: Color, scalar: number, result: Color): Color;
  3485. /**
  3486. * An immutable Color instance initialized to CSS color #F0F8FF
  3487. <span class="colorSwath" style="background: #F0F8FF;"></span>
  3488. */
  3489. static readonly ALICEBLUE: Color;
  3490. /**
  3491. * An immutable Color instance initialized to CSS color #FAEBD7
  3492. <span class="colorSwath" style="background: #FAEBD7;"></span>
  3493. */
  3494. static readonly ANTIQUEWHITE: Color;
  3495. /**
  3496. * An immutable Color instance initialized to CSS color #00FFFF
  3497. <span class="colorSwath" style="background: #00FFFF;"></span>
  3498. */
  3499. static readonly AQUA: Color;
  3500. /**
  3501. * An immutable Color instance initialized to CSS color #7FFFD4
  3502. <span class="colorSwath" style="background: #7FFFD4;"></span>
  3503. */
  3504. static readonly AQUAMARINE: Color;
  3505. /**
  3506. * An immutable Color instance initialized to CSS color #F0FFFF
  3507. <span class="colorSwath" style="background: #F0FFFF;"></span>
  3508. */
  3509. static readonly AZURE: Color;
  3510. /**
  3511. * An immutable Color instance initialized to CSS color #F5F5DC
  3512. <span class="colorSwath" style="background: #F5F5DC;"></span>
  3513. */
  3514. static readonly BEIGE: Color;
  3515. /**
  3516. * An immutable Color instance initialized to CSS color #FFE4C4
  3517. <span class="colorSwath" style="background: #FFE4C4;"></span>
  3518. */
  3519. static readonly BISQUE: Color;
  3520. /**
  3521. * An immutable Color instance initialized to CSS color #000000
  3522. <span class="colorSwath" style="background: #000000;"></span>
  3523. */
  3524. static readonly BLACK: Color;
  3525. /**
  3526. * An immutable Color instance initialized to CSS color #FFEBCD
  3527. <span class="colorSwath" style="background: #FFEBCD;"></span>
  3528. */
  3529. static readonly BLANCHEDALMOND: Color;
  3530. /**
  3531. * An immutable Color instance initialized to CSS color #0000FF
  3532. <span class="colorSwath" style="background: #0000FF;"></span>
  3533. */
  3534. static readonly BLUE: Color;
  3535. /**
  3536. * An immutable Color instance initialized to CSS color #8A2BE2
  3537. <span class="colorSwath" style="background: #8A2BE2;"></span>
  3538. */
  3539. static readonly BLUEVIOLET: Color;
  3540. /**
  3541. * An immutable Color instance initialized to CSS color #A52A2A
  3542. <span class="colorSwath" style="background: #A52A2A;"></span>
  3543. */
  3544. static readonly BROWN: Color;
  3545. /**
  3546. * An immutable Color instance initialized to CSS color #DEB887
  3547. <span class="colorSwath" style="background: #DEB887;"></span>
  3548. */
  3549. static readonly BURLYWOOD: Color;
  3550. /**
  3551. * An immutable Color instance initialized to CSS color #5F9EA0
  3552. <span class="colorSwath" style="background: #5F9EA0;"></span>
  3553. */
  3554. static readonly CADETBLUE: Color;
  3555. /**
  3556. * An immutable Color instance initialized to CSS color #7FFF00
  3557. <span class="colorSwath" style="background: #7FFF00;"></span>
  3558. */
  3559. static readonly CHARTREUSE: Color;
  3560. /**
  3561. * An immutable Color instance initialized to CSS color #D2691E
  3562. <span class="colorSwath" style="background: #D2691E;"></span>
  3563. */
  3564. static readonly CHOCOLATE: Color;
  3565. /**
  3566. * An immutable Color instance initialized to CSS color #FF7F50
  3567. <span class="colorSwath" style="background: #FF7F50;"></span>
  3568. */
  3569. static readonly CORAL: Color;
  3570. /**
  3571. * An immutable Color instance initialized to CSS color #6495ED
  3572. <span class="colorSwath" style="background: #6495ED;"></span>
  3573. */
  3574. static readonly CORNFLOWERBLUE: Color;
  3575. /**
  3576. * An immutable Color instance initialized to CSS color #FFF8DC
  3577. <span class="colorSwath" style="background: #FFF8DC;"></span>
  3578. */
  3579. static readonly CORNSILK: Color;
  3580. /**
  3581. * An immutable Color instance initialized to CSS color #DC143C
  3582. <span class="colorSwath" style="background: #DC143C;"></span>
  3583. */
  3584. static readonly CRIMSON: Color;
  3585. /**
  3586. * An immutable Color instance initialized to CSS color #00FFFF
  3587. <span class="colorSwath" style="background: #00FFFF;"></span>
  3588. */
  3589. static readonly CYAN: Color;
  3590. /**
  3591. * An immutable Color instance initialized to CSS color #00008B
  3592. <span class="colorSwath" style="background: #00008B;"></span>
  3593. */
  3594. static readonly DARKBLUE: Color;
  3595. /**
  3596. * An immutable Color instance initialized to CSS color #008B8B
  3597. <span class="colorSwath" style="background: #008B8B;"></span>
  3598. */
  3599. static readonly DARKCYAN: Color;
  3600. /**
  3601. * An immutable Color instance initialized to CSS color #B8860B
  3602. <span class="colorSwath" style="background: #B8860B;"></span>
  3603. */
  3604. static readonly DARKGOLDENROD: Color;
  3605. /**
  3606. * An immutable Color instance initialized to CSS color #A9A9A9
  3607. <span class="colorSwath" style="background: #A9A9A9;"></span>
  3608. */
  3609. static readonly DARKGRAY: Color;
  3610. /**
  3611. * An immutable Color instance initialized to CSS color #006400
  3612. <span class="colorSwath" style="background: #006400;"></span>
  3613. */
  3614. static readonly DARKGREEN: Color;
  3615. /**
  3616. * An immutable Color instance initialized to CSS color #A9A9A9
  3617. <span class="colorSwath" style="background: #A9A9A9;"></span>
  3618. */
  3619. static readonly DARKGREY: Color;
  3620. /**
  3621. * An immutable Color instance initialized to CSS color #BDB76B
  3622. <span class="colorSwath" style="background: #BDB76B;"></span>
  3623. */
  3624. static readonly DARKKHAKI: Color;
  3625. /**
  3626. * An immutable Color instance initialized to CSS color #8B008B
  3627. <span class="colorSwath" style="background: #8B008B;"></span>
  3628. */
  3629. static readonly DARKMAGENTA: Color;
  3630. /**
  3631. * An immutable Color instance initialized to CSS color #556B2F
  3632. <span class="colorSwath" style="background: #556B2F;"></span>
  3633. */
  3634. static readonly DARKOLIVEGREEN: Color;
  3635. /**
  3636. * An immutable Color instance initialized to CSS color #FF8C00
  3637. <span class="colorSwath" style="background: #FF8C00;"></span>
  3638. */
  3639. static readonly DARKORANGE: Color;
  3640. /**
  3641. * An immutable Color instance initialized to CSS color #9932CC
  3642. <span class="colorSwath" style="background: #9932CC;"></span>
  3643. */
  3644. static readonly DARKORCHID: Color;
  3645. /**
  3646. * An immutable Color instance initialized to CSS color #8B0000
  3647. <span class="colorSwath" style="background: #8B0000;"></span>
  3648. */
  3649. static readonly DARKRED: Color;
  3650. /**
  3651. * An immutable Color instance initialized to CSS color #E9967A
  3652. <span class="colorSwath" style="background: #E9967A;"></span>
  3653. */
  3654. static readonly DARKSALMON: Color;
  3655. /**
  3656. * An immutable Color instance initialized to CSS color #8FBC8F
  3657. <span class="colorSwath" style="background: #8FBC8F;"></span>
  3658. */
  3659. static readonly DARKSEAGREEN: Color;
  3660. /**
  3661. * An immutable Color instance initialized to CSS color #483D8B
  3662. <span class="colorSwath" style="background: #483D8B;"></span>
  3663. */
  3664. static readonly DARKSLATEBLUE: Color;
  3665. /**
  3666. * An immutable Color instance initialized to CSS color #2F4F4F
  3667. <span class="colorSwath" style="background: #2F4F4F;"></span>
  3668. */
  3669. static readonly DARKSLATEGRAY: Color;
  3670. /**
  3671. * An immutable Color instance initialized to CSS color #2F4F4F
  3672. <span class="colorSwath" style="background: #2F4F4F;"></span>
  3673. */
  3674. static readonly DARKSLATEGREY: Color;
  3675. /**
  3676. * An immutable Color instance initialized to CSS color #00CED1
  3677. <span class="colorSwath" style="background: #00CED1;"></span>
  3678. */
  3679. static readonly DARKTURQUOISE: Color;
  3680. /**
  3681. * An immutable Color instance initialized to CSS color #9400D3
  3682. <span class="colorSwath" style="background: #9400D3;"></span>
  3683. */
  3684. static readonly DARKVIOLET: Color;
  3685. /**
  3686. * An immutable Color instance initialized to CSS color #FF1493
  3687. <span class="colorSwath" style="background: #FF1493;"></span>
  3688. */
  3689. static readonly DEEPPINK: Color;
  3690. /**
  3691. * An immutable Color instance initialized to CSS color #00BFFF
  3692. <span class="colorSwath" style="background: #00BFFF;"></span>
  3693. */
  3694. static readonly DEEPSKYBLUE: Color;
  3695. /**
  3696. * An immutable Color instance initialized to CSS color #696969
  3697. <span class="colorSwath" style="background: #696969;"></span>
  3698. */
  3699. static readonly DIMGRAY: Color;
  3700. /**
  3701. * An immutable Color instance initialized to CSS color #696969
  3702. <span class="colorSwath" style="background: #696969;"></span>
  3703. */
  3704. static readonly DIMGREY: Color;
  3705. /**
  3706. * An immutable Color instance initialized to CSS color #1E90FF
  3707. <span class="colorSwath" style="background: #1E90FF;"></span>
  3708. */
  3709. static readonly DODGERBLUE: Color;
  3710. /**
  3711. * An immutable Color instance initialized to CSS color #B22222
  3712. <span class="colorSwath" style="background: #B22222;"></span>
  3713. */
  3714. static readonly FIREBRICK: Color;
  3715. /**
  3716. * An immutable Color instance initialized to CSS color #FFFAF0
  3717. <span class="colorSwath" style="background: #FFFAF0;"></span>
  3718. */
  3719. static readonly FLORALWHITE: Color;
  3720. /**
  3721. * An immutable Color instance initialized to CSS color #228B22
  3722. <span class="colorSwath" style="background: #228B22;"></span>
  3723. */
  3724. static readonly FORESTGREEN: Color;
  3725. /**
  3726. * An immutable Color instance initialized to CSS color #FF00FF
  3727. <span class="colorSwath" style="background: #FF00FF;"></span>
  3728. */
  3729. static readonly FUCHSIA: Color;
  3730. /**
  3731. * An immutable Color instance initialized to CSS color #DCDCDC
  3732. <span class="colorSwath" style="background: #DCDCDC;"></span>
  3733. */
  3734. static readonly GAINSBORO: Color;
  3735. /**
  3736. * An immutable Color instance initialized to CSS color #F8F8FF
  3737. <span class="colorSwath" style="background: #F8F8FF;"></span>
  3738. */
  3739. static readonly GHOSTWHITE: Color;
  3740. /**
  3741. * An immutable Color instance initialized to CSS color #FFD700
  3742. <span class="colorSwath" style="background: #FFD700;"></span>
  3743. */
  3744. static readonly GOLD: Color;
  3745. /**
  3746. * An immutable Color instance initialized to CSS color #DAA520
  3747. <span class="colorSwath" style="background: #DAA520;"></span>
  3748. */
  3749. static readonly GOLDENROD: Color;
  3750. /**
  3751. * An immutable Color instance initialized to CSS color #808080
  3752. <span class="colorSwath" style="background: #808080;"></span>
  3753. */
  3754. static readonly GRAY: Color;
  3755. /**
  3756. * An immutable Color instance initialized to CSS color #008000
  3757. <span class="colorSwath" style="background: #008000;"></span>
  3758. */
  3759. static readonly GREEN: Color;
  3760. /**
  3761. * An immutable Color instance initialized to CSS color #ADFF2F
  3762. <span class="colorSwath" style="background: #ADFF2F;"></span>
  3763. */
  3764. static readonly GREENYELLOW: Color;
  3765. /**
  3766. * An immutable Color instance initialized to CSS color #808080
  3767. <span class="colorSwath" style="background: #808080;"></span>
  3768. */
  3769. static readonly GREY: Color;
  3770. /**
  3771. * An immutable Color instance initialized to CSS color #F0FFF0
  3772. <span class="colorSwath" style="background: #F0FFF0;"></span>
  3773. */
  3774. static readonly HONEYDEW: Color;
  3775. /**
  3776. * An immutable Color instance initialized to CSS color #FF69B4
  3777. <span class="colorSwath" style="background: #FF69B4;"></span>
  3778. */
  3779. static readonly HOTPINK: Color;
  3780. /**
  3781. * An immutable Color instance initialized to CSS color #CD5C5C
  3782. <span class="colorSwath" style="background: #CD5C5C;"></span>
  3783. */
  3784. static readonly INDIANRED: Color;
  3785. /**
  3786. * An immutable Color instance initialized to CSS color #4B0082
  3787. <span class="colorSwath" style="background: #4B0082;"></span>
  3788. */
  3789. static readonly INDIGO: Color;
  3790. /**
  3791. * An immutable Color instance initialized to CSS color #FFFFF0
  3792. <span class="colorSwath" style="background: #FFFFF0;"></span>
  3793. */
  3794. static readonly IVORY: Color;
  3795. /**
  3796. * An immutable Color instance initialized to CSS color #F0E68C
  3797. <span class="colorSwath" style="background: #F0E68C;"></span>
  3798. */
  3799. static readonly KHAKI: Color;
  3800. /**
  3801. * An immutable Color instance initialized to CSS color #E6E6FA
  3802. <span class="colorSwath" style="background: #E6E6FA;"></span>
  3803. */
  3804. static readonly LAVENDER: Color;
  3805. /**
  3806. * An immutable Color instance initialized to CSS color #FFF0F5
  3807. <span class="colorSwath" style="background: #FFF0F5;"></span>
  3808. */
  3809. static readonly LAVENDAR_BLUSH: Color;
  3810. /**
  3811. * An immutable Color instance initialized to CSS color #7CFC00
  3812. <span class="colorSwath" style="background: #7CFC00;"></span>
  3813. */
  3814. static readonly LAWNGREEN: Color;
  3815. /**
  3816. * An immutable Color instance initialized to CSS color #FFFACD
  3817. <span class="colorSwath" style="background: #FFFACD;"></span>
  3818. */
  3819. static readonly LEMONCHIFFON: Color;
  3820. /**
  3821. * An immutable Color instance initialized to CSS color #ADD8E6
  3822. <span class="colorSwath" style="background: #ADD8E6;"></span>
  3823. */
  3824. static readonly LIGHTBLUE: Color;
  3825. /**
  3826. * An immutable Color instance initialized to CSS color #F08080
  3827. <span class="colorSwath" style="background: #F08080;"></span>
  3828. */
  3829. static readonly LIGHTCORAL: Color;
  3830. /**
  3831. * An immutable Color instance initialized to CSS color #E0FFFF
  3832. <span class="colorSwath" style="background: #E0FFFF;"></span>
  3833. */
  3834. static readonly LIGHTCYAN: Color;
  3835. /**
  3836. * An immutable Color instance initialized to CSS color #FAFAD2
  3837. <span class="colorSwath" style="background: #FAFAD2;"></span>
  3838. */
  3839. static readonly LIGHTGOLDENRODYELLOW: Color;
  3840. /**
  3841. * An immutable Color instance initialized to CSS color #D3D3D3
  3842. <span class="colorSwath" style="background: #D3D3D3;"></span>
  3843. */
  3844. static readonly LIGHTGRAY: Color;
  3845. /**
  3846. * An immutable Color instance initialized to CSS color #90EE90
  3847. <span class="colorSwath" style="background: #90EE90;"></span>
  3848. */
  3849. static readonly LIGHTGREEN: Color;
  3850. /**
  3851. * An immutable Color instance initialized to CSS color #D3D3D3
  3852. <span class="colorSwath" style="background: #D3D3D3;"></span>
  3853. */
  3854. static readonly LIGHTGREY: Color;
  3855. /**
  3856. * An immutable Color instance initialized to CSS color #FFB6C1
  3857. <span class="colorSwath" style="background: #FFB6C1;"></span>
  3858. */
  3859. static readonly LIGHTPINK: Color;
  3860. /**
  3861. * An immutable Color instance initialized to CSS color #20B2AA
  3862. <span class="colorSwath" style="background: #20B2AA;"></span>
  3863. */
  3864. static readonly LIGHTSEAGREEN: Color;
  3865. /**
  3866. * An immutable Color instance initialized to CSS color #87CEFA
  3867. <span class="colorSwath" style="background: #87CEFA;"></span>
  3868. */
  3869. static readonly LIGHTSKYBLUE: Color;
  3870. /**
  3871. * An immutable Color instance initialized to CSS color #778899
  3872. <span class="colorSwath" style="background: #778899;"></span>
  3873. */
  3874. static readonly LIGHTSLATEGRAY: Color;
  3875. /**
  3876. * An immutable Color instance initialized to CSS color #778899
  3877. <span class="colorSwath" style="background: #778899;"></span>
  3878. */
  3879. static readonly LIGHTSLATEGREY: Color;
  3880. /**
  3881. * An immutable Color instance initialized to CSS color #B0C4DE
  3882. <span class="colorSwath" style="background: #B0C4DE;"></span>
  3883. */
  3884. static readonly LIGHTSTEELBLUE: Color;
  3885. /**
  3886. * An immutable Color instance initialized to CSS color #FFFFE0
  3887. <span class="colorSwath" style="background: #FFFFE0;"></span>
  3888. */
  3889. static readonly LIGHTYELLOW: Color;
  3890. /**
  3891. * An immutable Color instance initialized to CSS color #00FF00
  3892. <span class="colorSwath" style="background: #00FF00;"></span>
  3893. */
  3894. static readonly LIME: Color;
  3895. /**
  3896. * An immutable Color instance initialized to CSS color #32CD32
  3897. <span class="colorSwath" style="background: #32CD32;"></span>
  3898. */
  3899. static readonly LIMEGREEN: Color;
  3900. /**
  3901. * An immutable Color instance initialized to CSS color #FAF0E6
  3902. <span class="colorSwath" style="background: #FAF0E6;"></span>
  3903. */
  3904. static readonly LINEN: Color;
  3905. /**
  3906. * An immutable Color instance initialized to CSS color #FF00FF
  3907. <span class="colorSwath" style="background: #FF00FF;"></span>
  3908. */
  3909. static readonly MAGENTA: Color;
  3910. /**
  3911. * An immutable Color instance initialized to CSS color #800000
  3912. <span class="colorSwath" style="background: #800000;"></span>
  3913. */
  3914. static readonly MAROON: Color;
  3915. /**
  3916. * An immutable Color instance initialized to CSS color #66CDAA
  3917. <span class="colorSwath" style="background: #66CDAA;"></span>
  3918. */
  3919. static readonly MEDIUMAQUAMARINE: Color;
  3920. /**
  3921. * An immutable Color instance initialized to CSS color #0000CD
  3922. <span class="colorSwath" style="background: #0000CD;"></span>
  3923. */
  3924. static readonly MEDIUMBLUE: Color;
  3925. /**
  3926. * An immutable Color instance initialized to CSS color #BA55D3
  3927. <span class="colorSwath" style="background: #BA55D3;"></span>
  3928. */
  3929. static readonly MEDIUMORCHID: Color;
  3930. /**
  3931. * An immutable Color instance initialized to CSS color #9370DB
  3932. <span class="colorSwath" style="background: #9370DB;"></span>
  3933. */
  3934. static readonly MEDIUMPURPLE: Color;
  3935. /**
  3936. * An immutable Color instance initialized to CSS color #3CB371
  3937. <span class="colorSwath" style="background: #3CB371;"></span>
  3938. */
  3939. static readonly MEDIUMSEAGREEN: Color;
  3940. /**
  3941. * An immutable Color instance initialized to CSS color #7B68EE
  3942. <span class="colorSwath" style="background: #7B68EE;"></span>
  3943. */
  3944. static readonly MEDIUMSLATEBLUE: Color;
  3945. /**
  3946. * An immutable Color instance initialized to CSS color #00FA9A
  3947. <span class="colorSwath" style="background: #00FA9A;"></span>
  3948. */
  3949. static readonly MEDIUMSPRINGGREEN: Color;
  3950. /**
  3951. * An immutable Color instance initialized to CSS color #48D1CC
  3952. <span class="colorSwath" style="background: #48D1CC;"></span>
  3953. */
  3954. static readonly MEDIUMTURQUOISE: Color;
  3955. /**
  3956. * An immutable Color instance initialized to CSS color #C71585
  3957. <span class="colorSwath" style="background: #C71585;"></span>
  3958. */
  3959. static readonly MEDIUMVIOLETRED: Color;
  3960. /**
  3961. * An immutable Color instance initialized to CSS color #191970
  3962. <span class="colorSwath" style="background: #191970;"></span>
  3963. */
  3964. static readonly MIDNIGHTBLUE: Color;
  3965. /**
  3966. * An immutable Color instance initialized to CSS color #F5FFFA
  3967. <span class="colorSwath" style="background: #F5FFFA;"></span>
  3968. */
  3969. static readonly MINTCREAM: Color;
  3970. /**
  3971. * An immutable Color instance initialized to CSS color #FFE4E1
  3972. <span class="colorSwath" style="background: #FFE4E1;"></span>
  3973. */
  3974. static readonly MISTYROSE: Color;
  3975. /**
  3976. * An immutable Color instance initialized to CSS color #FFE4B5
  3977. <span class="colorSwath" style="background: #FFE4B5;"></span>
  3978. */
  3979. static readonly MOCCASIN: Color;
  3980. /**
  3981. * An immutable Color instance initialized to CSS color #FFDEAD
  3982. <span class="colorSwath" style="background: #FFDEAD;"></span>
  3983. */
  3984. static readonly NAVAJOWHITE: Color;
  3985. /**
  3986. * An immutable Color instance initialized to CSS color #000080
  3987. <span class="colorSwath" style="background: #000080;"></span>
  3988. */
  3989. static readonly NAVY: Color;
  3990. /**
  3991. * An immutable Color instance initialized to CSS color #FDF5E6
  3992. <span class="colorSwath" style="background: #FDF5E6;"></span>
  3993. */
  3994. static readonly OLDLACE: Color;
  3995. /**
  3996. * An immutable Color instance initialized to CSS color #808000
  3997. <span class="colorSwath" style="background: #808000;"></span>
  3998. */
  3999. static readonly OLIVE: Color;
  4000. /**
  4001. * An immutable Color instance initialized to CSS color #6B8E23
  4002. <span class="colorSwath" style="background: #6B8E23;"></span>
  4003. */
  4004. static readonly OLIVEDRAB: Color;
  4005. /**
  4006. * An immutable Color instance initialized to CSS color #FFA500
  4007. <span class="colorSwath" style="background: #FFA500;"></span>
  4008. */
  4009. static readonly ORANGE: Color;
  4010. /**
  4011. * An immutable Color instance initialized to CSS color #FF4500
  4012. <span class="colorSwath" style="background: #FF4500;"></span>
  4013. */
  4014. static readonly ORANGERED: Color;
  4015. /**
  4016. * An immutable Color instance initialized to CSS color #DA70D6
  4017. <span class="colorSwath" style="background: #DA70D6;"></span>
  4018. */
  4019. static readonly ORCHID: Color;
  4020. /**
  4021. * An immutable Color instance initialized to CSS color #EEE8AA
  4022. <span class="colorSwath" style="background: #EEE8AA;"></span>
  4023. */
  4024. static readonly PALEGOLDENROD: Color;
  4025. /**
  4026. * An immutable Color instance initialized to CSS color #98FB98
  4027. <span class="colorSwath" style="background: #98FB98;"></span>
  4028. */
  4029. static readonly PALEGREEN: Color;
  4030. /**
  4031. * An immutable Color instance initialized to CSS color #AFEEEE
  4032. <span class="colorSwath" style="background: #AFEEEE;"></span>
  4033. */
  4034. static readonly PALETURQUOISE: Color;
  4035. /**
  4036. * An immutable Color instance initialized to CSS color #DB7093
  4037. <span class="colorSwath" style="background: #DB7093;"></span>
  4038. */
  4039. static readonly PALEVIOLETRED: Color;
  4040. /**
  4041. * An immutable Color instance initialized to CSS color #FFEFD5
  4042. <span class="colorSwath" style="background: #FFEFD5;"></span>
  4043. */
  4044. static readonly PAPAYAWHIP: Color;
  4045. /**
  4046. * An immutable Color instance initialized to CSS color #FFDAB9
  4047. <span class="colorSwath" style="background: #FFDAB9;"></span>
  4048. */
  4049. static readonly PEACHPUFF: Color;
  4050. /**
  4051. * An immutable Color instance initialized to CSS color #CD853F
  4052. <span class="colorSwath" style="background: #CD853F;"></span>
  4053. */
  4054. static readonly PERU: Color;
  4055. /**
  4056. * An immutable Color instance initialized to CSS color #FFC0CB
  4057. <span class="colorSwath" style="background: #FFC0CB;"></span>
  4058. */
  4059. static readonly PINK: Color;
  4060. /**
  4061. * An immutable Color instance initialized to CSS color #DDA0DD
  4062. <span class="colorSwath" style="background: #DDA0DD;"></span>
  4063. */
  4064. static readonly PLUM: Color;
  4065. /**
  4066. * An immutable Color instance initialized to CSS color #B0E0E6
  4067. <span class="colorSwath" style="background: #B0E0E6;"></span>
  4068. */
  4069. static readonly POWDERBLUE: Color;
  4070. /**
  4071. * An immutable Color instance initialized to CSS color #800080
  4072. <span class="colorSwath" style="background: #800080;"></span>
  4073. */
  4074. static readonly PURPLE: Color;
  4075. /**
  4076. * An immutable Color instance initialized to CSS color #FF0000
  4077. <span class="colorSwath" style="background: #FF0000;"></span>
  4078. */
  4079. static readonly RED: Color;
  4080. /**
  4081. * An immutable Color instance initialized to CSS color #BC8F8F
  4082. <span class="colorSwath" style="background: #BC8F8F;"></span>
  4083. */
  4084. static readonly ROSYBROWN: Color;
  4085. /**
  4086. * An immutable Color instance initialized to CSS color #4169E1
  4087. <span class="colorSwath" style="background: #4169E1;"></span>
  4088. */
  4089. static readonly ROYALBLUE: Color;
  4090. /**
  4091. * An immutable Color instance initialized to CSS color #8B4513
  4092. <span class="colorSwath" style="background: #8B4513;"></span>
  4093. */
  4094. static readonly SADDLEBROWN: Color;
  4095. /**
  4096. * An immutable Color instance initialized to CSS color #FA8072
  4097. <span class="colorSwath" style="background: #FA8072;"></span>
  4098. */
  4099. static readonly SALMON: Color;
  4100. /**
  4101. * An immutable Color instance initialized to CSS color #F4A460
  4102. <span class="colorSwath" style="background: #F4A460;"></span>
  4103. */
  4104. static readonly SANDYBROWN: Color;
  4105. /**
  4106. * An immutable Color instance initialized to CSS color #2E8B57
  4107. <span class="colorSwath" style="background: #2E8B57;"></span>
  4108. */
  4109. static readonly SEAGREEN: Color;
  4110. /**
  4111. * An immutable Color instance initialized to CSS color #FFF5EE
  4112. <span class="colorSwath" style="background: #FFF5EE;"></span>
  4113. */
  4114. static readonly SEASHELL: Color;
  4115. /**
  4116. * An immutable Color instance initialized to CSS color #A0522D
  4117. <span class="colorSwath" style="background: #A0522D;"></span>
  4118. */
  4119. static readonly SIENNA: Color;
  4120. /**
  4121. * An immutable Color instance initialized to CSS color #C0C0C0
  4122. <span class="colorSwath" style="background: #C0C0C0;"></span>
  4123. */
  4124. static readonly SILVER: Color;
  4125. /**
  4126. * An immutable Color instance initialized to CSS color #87CEEB
  4127. <span class="colorSwath" style="background: #87CEEB;"></span>
  4128. */
  4129. static readonly SKYBLUE: Color;
  4130. /**
  4131. * An immutable Color instance initialized to CSS color #6A5ACD
  4132. <span class="colorSwath" style="background: #6A5ACD;"></span>
  4133. */
  4134. static readonly SLATEBLUE: Color;
  4135. /**
  4136. * An immutable Color instance initialized to CSS color #708090
  4137. <span class="colorSwath" style="background: #708090;"></span>
  4138. */
  4139. static readonly SLATEGRAY: Color;
  4140. /**
  4141. * An immutable Color instance initialized to CSS color #708090
  4142. <span class="colorSwath" style="background: #708090;"></span>
  4143. */
  4144. static readonly SLATEGREY: Color;
  4145. /**
  4146. * An immutable Color instance initialized to CSS color #FFFAFA
  4147. <span class="colorSwath" style="background: #FFFAFA;"></span>
  4148. */
  4149. static readonly SNOW: Color;
  4150. /**
  4151. * An immutable Color instance initialized to CSS color #00FF7F
  4152. <span class="colorSwath" style="background: #00FF7F;"></span>
  4153. */
  4154. static readonly SPRINGGREEN: Color;
  4155. /**
  4156. * An immutable Color instance initialized to CSS color #4682B4
  4157. <span class="colorSwath" style="background: #4682B4;"></span>
  4158. */
  4159. static readonly STEELBLUE: Color;
  4160. /**
  4161. * An immutable Color instance initialized to CSS color #D2B48C
  4162. <span class="colorSwath" style="background: #D2B48C;"></span>
  4163. */
  4164. static readonly TAN: Color;
  4165. /**
  4166. * An immutable Color instance initialized to CSS color #008080
  4167. <span class="colorSwath" style="background: #008080;"></span>
  4168. */
  4169. static readonly TEAL: Color;
  4170. /**
  4171. * An immutable Color instance initialized to CSS color #D8BFD8
  4172. <span class="colorSwath" style="background: #D8BFD8;"></span>
  4173. */
  4174. static readonly THISTLE: Color;
  4175. /**
  4176. * An immutable Color instance initialized to CSS color #FF6347
  4177. <span class="colorSwath" style="background: #FF6347;"></span>
  4178. */
  4179. static readonly TOMATO: Color;
  4180. /**
  4181. * An immutable Color instance initialized to CSS color #40E0D0
  4182. <span class="colorSwath" style="background: #40E0D0;"></span>
  4183. */
  4184. static readonly TURQUOISE: Color;
  4185. /**
  4186. * An immutable Color instance initialized to CSS color #EE82EE
  4187. <span class="colorSwath" style="background: #EE82EE;"></span>
  4188. */
  4189. static readonly VIOLET: Color;
  4190. /**
  4191. * An immutable Color instance initialized to CSS color #F5DEB3
  4192. <span class="colorSwath" style="background: #F5DEB3;"></span>
  4193. */
  4194. static readonly WHEAT: Color;
  4195. /**
  4196. * An immutable Color instance initialized to CSS color #FFFFFF
  4197. <span class="colorSwath" style="background: #FFFFFF;"></span>
  4198. */
  4199. static readonly WHITE: Color;
  4200. /**
  4201. * An immutable Color instance initialized to CSS color #F5F5F5
  4202. <span class="colorSwath" style="background: #F5F5F5;"></span>
  4203. */
  4204. static readonly WHITESMOKE: Color;
  4205. /**
  4206. * An immutable Color instance initialized to CSS color #FFFF00
  4207. <span class="colorSwath" style="background: #FFFF00;"></span>
  4208. */
  4209. static readonly YELLOW: Color;
  4210. /**
  4211. * An immutable Color instance initialized to CSS color #9ACD32
  4212. <span class="colorSwath" style="background: #9ACD32;"></span>
  4213. */
  4214. static readonly YELLOWGREEN: Color;
  4215. /**
  4216. * An immutable Color instance initialized to CSS transparent.
  4217. <span class="colorSwath" style="background: transparent;"></span>
  4218. */
  4219. static readonly TRANSPARENT: Color;
  4220. }
  4221. /**
  4222. * Value and type information for per-instance geometry color.
  4223. * @example
  4224. * var instance = new Cesium.GeometryInstance({
  4225. geometry : Cesium.BoxGeometry.fromDimensions({
  4226. dimensions : new Cesium.Cartesian3(1000000.0, 1000000.0, 500000.0)
  4227. }),
  4228. modelMatrix : Cesium.Matrix4.multiplyByTranslation(Cesium.Transforms.eastNorthUpToFixedFrame(
  4229. Cesium.Cartesian3.fromDegrees(0.0, 0.0)), new Cesium.Cartesian3(0.0, 0.0, 1000000.0), new Cesium.Matrix4()),
  4230. id : 'box',
  4231. attributes : {
  4232. color : new Cesium.ColorGeometryInstanceAttribute(red, green, blue, alpha)
  4233. }
  4234. });
  4235. * @param [red = 1.0] - The red component.
  4236. * @param [green = 1.0] - The green component.
  4237. * @param [blue = 1.0] - The blue component.
  4238. * @param [alpha = 1.0] - The alpha component.
  4239. */
  4240. export class ColorGeometryInstanceAttribute {
  4241. constructor(red?: number, green?: number, blue?: number, alpha?: number);
  4242. /**
  4243. * The values for the attributes stored in a typed array.
  4244. */
  4245. value: Uint8Array;
  4246. /**
  4247. * The datatype of each component in the attribute, e.g., individual elements in
  4248. {@link ColorGeometryInstanceAttribute#value}.
  4249. */
  4250. readonly componentDatatype: ComponentDatatype;
  4251. /**
  4252. * The number of components in the attributes, i.e., {@link ColorGeometryInstanceAttribute#value}.
  4253. */
  4254. readonly componentsPerAttribute: number;
  4255. /**
  4256. * When <code>true</code> and <code>componentDatatype</code> is an integer format,
  4257. indicate that the components should be mapped to the range [0, 1] (unsigned)
  4258. or [-1, 1] (signed) when they are accessed as floating-point for rendering.
  4259. */
  4260. readonly normalize: boolean;
  4261. /**
  4262. * Creates a new {@link ColorGeometryInstanceAttribute} instance given the provided {@link Color}.
  4263. * @example
  4264. * var instance = new Cesium.GeometryInstance({
  4265. geometry : geometry,
  4266. attributes : {
  4267. color : Cesium.ColorGeometryInstanceAttribute.fromColor(Cesium.Color.CORNFLOWERBLUE),
  4268. }
  4269. });
  4270. * @param color - The color.
  4271. * @returns The new {@link ColorGeometryInstanceAttribute} instance.
  4272. */
  4273. static fromColor(color: Color): ColorGeometryInstanceAttribute;
  4274. /**
  4275. * Converts a color to a typed array that can be used to assign a color attribute.
  4276. * @example
  4277. * var attributes = primitive.getGeometryInstanceAttributes('an id');
  4278. attributes.color = Cesium.ColorGeometryInstanceAttribute.toValue(Cesium.Color.AQUA, attributes.color);
  4279. * @param color - The color.
  4280. * @param [result] - The array to store the result in, if undefined a new instance will be created.
  4281. * @returns The modified result parameter or a new instance if result was undefined.
  4282. */
  4283. static toValue(color: Color, result?: Uint8Array): Uint8Array;
  4284. /**
  4285. * Compares the provided ColorGeometryInstanceAttributes and returns
  4286. <code>true</code> if they are equal, <code>false</code> otherwise.
  4287. * @param [left] - The first ColorGeometryInstanceAttribute.
  4288. * @param [right] - The second ColorGeometryInstanceAttribute.
  4289. * @returns <code>true</code> if left and right are equal, <code>false</code> otherwise.
  4290. */
  4291. static equals(left?: ColorGeometryInstanceAttribute, right?: ColorGeometryInstanceAttribute): boolean;
  4292. }
  4293. /**
  4294. * Merges two objects, copying their properties onto a new combined object. When two objects have the same
  4295. property, the value of the property on the first object is used. If either object is undefined,
  4296. it will be treated as an empty object.
  4297. * @example
  4298. * var object1 = {
  4299. propOne : 1,
  4300. propTwo : {
  4301. value1 : 10
  4302. }
  4303. }
  4304. var object2 = {
  4305. propTwo : 2
  4306. }
  4307. var final = Cesium.combine(object1, object2);
  4308. // final === {
  4309. // propOne : 1,
  4310. // propTwo : {
  4311. // value1 : 10
  4312. // }
  4313. // }
  4314. * @param [object1] - The first object to merge.
  4315. * @param [object2] - The second object to merge.
  4316. * @param [deep = false] - Perform a recursive merge.
  4317. * @returns The combined object containing all properties from both objects.
  4318. */
  4319. export function combine(object1?: any, object2?: any, deep?: boolean): any;
  4320. /**
  4321. * WebGL component datatypes. Components are intrinsics,
  4322. which form attributes, which form vertices.
  4323. */
  4324. export enum ComponentDatatype {
  4325. /**
  4326. * 8-bit signed byte corresponding to <code>gl.BYTE</code> and the type
  4327. of an element in <code>Int8Array</code>.
  4328. */
  4329. BYTE = WebGLConstants.BYTE,
  4330. /**
  4331. * 8-bit unsigned byte corresponding to <code>UNSIGNED_BYTE</code> and the type
  4332. of an element in <code>Uint8Array</code>.
  4333. */
  4334. UNSIGNED_BYTE = WebGLConstants.UNSIGNED_BYTE,
  4335. /**
  4336. * 16-bit signed short corresponding to <code>SHORT</code> and the type
  4337. of an element in <code>Int16Array</code>.
  4338. */
  4339. SHORT = WebGLConstants.SHORT,
  4340. /**
  4341. * 16-bit unsigned short corresponding to <code>UNSIGNED_SHORT</code> and the type
  4342. of an element in <code>Uint16Array</code>.
  4343. */
  4344. UNSIGNED_SHORT = WebGLConstants.UNSIGNED_SHORT,
  4345. /**
  4346. * 32-bit signed int corresponding to <code>INT</code> and the type
  4347. of an element in <code>Int32Array</code>.
  4348. */
  4349. INT = WebGLConstants.INT,
  4350. /**
  4351. * 32-bit unsigned int corresponding to <code>UNSIGNED_INT</code> and the type
  4352. of an element in <code>Uint32Array</code>.
  4353. */
  4354. UNSIGNED_INT = WebGLConstants.UNSIGNED_INT,
  4355. /**
  4356. * 32-bit floating-point corresponding to <code>FLOAT</code> and the type
  4357. of an element in <code>Float32Array</code>.
  4358. */
  4359. FLOAT = WebGLConstants.FLOAT,
  4360. /**
  4361. * 64-bit floating-point corresponding to <code>gl.DOUBLE</code> (in Desktop OpenGL;
  4362. this is not supported in WebGL, and is emulated in Cesium via {@link GeometryPipeline.encodeAttribute})
  4363. and the type of an element in <code>Float64Array</code>.
  4364. */
  4365. DOUBLE = WebGLConstants.DOUBLE
  4366. }
  4367. /**
  4368. * Describes a compressed texture and contains a compressed texture buffer.
  4369. * @param internalFormat - The pixel format of the compressed texture.
  4370. * @param width - The width of the texture.
  4371. * @param height - The height of the texture.
  4372. * @param buffer - The compressed texture buffer.
  4373. */
  4374. export class CompressedTextureBuffer {
  4375. constructor(internalFormat: PixelFormat, width: number, height: number, buffer: Uint8Array);
  4376. /**
  4377. * The format of the compressed texture.
  4378. */
  4379. readonly internalFormat: PixelFormat;
  4380. /**
  4381. * The width of the texture.
  4382. */
  4383. readonly width: number;
  4384. /**
  4385. * The height of the texture.
  4386. */
  4387. readonly height: number;
  4388. /**
  4389. * The compressed texture buffer.
  4390. */
  4391. readonly bufferView: Uint8Array;
  4392. /**
  4393. * Creates a shallow clone of a compressed texture buffer.
  4394. * @param object - The compressed texture buffer to be cloned.
  4395. * @returns A shallow clone of the compressed texture buffer.
  4396. */
  4397. static clone(object: CompressedTextureBuffer): CompressedTextureBuffer;
  4398. /**
  4399. * Creates a shallow clone of this compressed texture buffer.
  4400. * @returns A shallow clone of the compressed texture buffer.
  4401. */
  4402. clone(): CompressedTextureBuffer;
  4403. }
  4404. /**
  4405. * A description of a polygon composed of arbitrary coplanar positions.
  4406. * @example
  4407. * var polygonGeometry = new Cesium.CoplanarPolygonGeometry({
  4408. polygonHierarchy: new Cesium.PolygonHierarchy(
  4409. Cesium.Cartesian3.fromDegreesArrayHeights([
  4410. -90.0, 30.0, 0.0,
  4411. -90.0, 30.0, 300000.0,
  4412. -80.0, 30.0, 300000.0,
  4413. -80.0, 30.0, 0.0
  4414. ]))
  4415. });
  4416. * @param options - Object with the following properties:
  4417. * @param options.polygonHierarchy - A polygon hierarchy that can include holes.
  4418. * @param [options.stRotation = 0.0] - The rotation of the texture coordinates, in radians. A positive rotation is counter-clockwise.
  4419. * @param [options.vertexFormat = VertexFormat.DEFAULT] - The vertex attributes to be computed.
  4420. * @param [options.ellipsoid = Ellipsoid.WGS84] - The ellipsoid to be used as a reference.
  4421. */
  4422. export class CoplanarPolygonGeometry {
  4423. constructor(options: {
  4424. polygonHierarchy: PolygonHierarchy;
  4425. stRotation?: number;
  4426. vertexFormat?: VertexFormat;
  4427. ellipsoid?: Ellipsoid;
  4428. });
  4429. /**
  4430. * The number of elements used to pack the object into an array.
  4431. */
  4432. packedLength: number;
  4433. /**
  4434. * A description of a coplanar polygon from an array of positions.
  4435. * @example
  4436. * // create a polygon from points
  4437. var polygon = Cesium.CoplanarPolygonGeometry.fromPositions({
  4438. positions : Cesium.Cartesian3.fromDegreesArray([
  4439. -72.0, 40.0,
  4440. -70.0, 35.0,
  4441. -75.0, 30.0,
  4442. -70.0, 30.0,
  4443. -68.0, 40.0
  4444. ])
  4445. });
  4446. var geometry = Cesium.PolygonGeometry.createGeometry(polygon);
  4447. * @param options - Object with the following properties:
  4448. * @param options.positions - An array of positions that defined the corner points of the polygon.
  4449. * @param [options.vertexFormat = VertexFormat.DEFAULT] - The vertex attributes to be computed.
  4450. * @param [options.stRotation = 0.0] - The rotation of the texture coordinates, in radians. A positive rotation is counter-clockwise.
  4451. * @param [options.ellipsoid = Ellipsoid.WGS84] - The ellipsoid to be used as a reference.
  4452. */
  4453. static fromPositions(options: {
  4454. positions: Cartesian3[];
  4455. vertexFormat?: VertexFormat;
  4456. stRotation?: number;
  4457. ellipsoid?: Ellipsoid;
  4458. }): CoplanarPolygonGeometry;
  4459. /**
  4460. * Stores the provided instance into the provided array.
  4461. * @param value - The value to pack.
  4462. * @param array - The array to pack into.
  4463. * @param [startingIndex = 0] - The index into the array at which to start packing the elements.
  4464. * @returns The array that was packed into
  4465. */
  4466. static pack(value: CoplanarPolygonGeometry, array: number[], startingIndex?: number): number[];
  4467. /**
  4468. * Retrieves an instance from a packed array.
  4469. * @param array - The packed array.
  4470. * @param [startingIndex = 0] - The starting index of the element to be unpacked.
  4471. * @param [result] - The object into which to store the result.
  4472. * @returns The modified result parameter or a new CoplanarPolygonGeometry instance if one was not provided.
  4473. */
  4474. static unpack(array: number[], startingIndex?: number, result?: CoplanarPolygonGeometry): CoplanarPolygonGeometry;
  4475. /**
  4476. * Computes the geometric representation of an arbitrary coplanar polygon, including its vertices, indices, and a bounding sphere.
  4477. * @param polygonGeometry - A description of the polygon.
  4478. * @returns The computed vertices and indices.
  4479. */
  4480. static createGeometry(polygonGeometry: CoplanarPolygonGeometry): Geometry | undefined;
  4481. }
  4482. /**
  4483. * A description of the outline of a polygon composed of arbitrary coplanar positions.
  4484. * @example
  4485. * var polygonOutline = new Cesium.CoplanarPolygonOutlineGeometry({
  4486. positions : Cesium.Cartesian3.fromDegreesArrayHeights([
  4487. -90.0, 30.0, 0.0,
  4488. -90.0, 30.0, 1000.0,
  4489. -80.0, 30.0, 1000.0,
  4490. -80.0, 30.0, 0.0
  4491. ])
  4492. });
  4493. var geometry = Cesium.CoplanarPolygonOutlineGeometry.createGeometry(polygonOutline);
  4494. * @param options - Object with the following properties:
  4495. * @param options.polygonHierarchy - A polygon hierarchy that can include holes.
  4496. */
  4497. export class CoplanarPolygonOutlineGeometry {
  4498. constructor(options: {
  4499. polygonHierarchy: PolygonHierarchy;
  4500. });
  4501. /**
  4502. * The number of elements used to pack the object into an array.
  4503. */
  4504. packedLength: number;
  4505. /**
  4506. * A description of a coplanar polygon outline from an array of positions.
  4507. * @param options - Object with the following properties:
  4508. * @param options.positions - An array of positions that defined the corner points of the polygon.
  4509. */
  4510. static fromPositions(options: {
  4511. positions: Cartesian3[];
  4512. }): CoplanarPolygonOutlineGeometry;
  4513. /**
  4514. * Stores the provided instance into the provided array.
  4515. * @param value - The value to pack.
  4516. * @param array - The array to pack into.
  4517. * @param [startingIndex = 0] - The index into the array at which to start packing the elements.
  4518. * @returns The array that was packed into
  4519. */
  4520. static pack(value: CoplanarPolygonOutlineGeometry, array: number[], startingIndex?: number): number[];
  4521. /**
  4522. * Retrieves an instance from a packed array.
  4523. * @param array - The packed array.
  4524. * @param [startingIndex = 0] - The starting index of the element to be unpacked.
  4525. * @param [result] - The object into which to store the result.
  4526. * @returns The modified result parameter or a new CoplanarPolygonOutlineGeometry instance if one was not provided.
  4527. */
  4528. static unpack(array: number[], startingIndex?: number, result?: CoplanarPolygonOutlineGeometry): CoplanarPolygonOutlineGeometry;
  4529. /**
  4530. * Computes the geometric representation of an arbitrary coplanar polygon, including its vertices, indices, and a bounding sphere.
  4531. * @param polygonGeometry - A description of the polygon.
  4532. * @returns The computed vertices and indices.
  4533. */
  4534. static createGeometry(polygonGeometry: CoplanarPolygonOutlineGeometry): Geometry | undefined;
  4535. }
  4536. /**
  4537. * Style options for corners.
  4538. */
  4539. export enum CornerType {
  4540. /**
  4541. * <img src="Images/CornerTypeRounded.png" style="vertical-align: middle;" width="186" height="189" />
  4542. Corner has a smooth edge.
  4543. */
  4544. ROUNDED = 0,
  4545. /**
  4546. * <img src="Images/CornerTypeMitered.png" style="vertical-align: middle;" width="186" height="189" />
  4547. Corner point is the intersection of adjacent edges.
  4548. */
  4549. MITERED = 1,
  4550. /**
  4551. * <img src="Images/CornerTypeBeveled.png" style="vertical-align: middle;" width="186" height="189" />
  4552. Corner is clipped.
  4553. */
  4554. BEVELED = 2
  4555. }
  4556. /**
  4557. * A description of a corridor. Corridor geometry can be rendered with both {@link Primitive} and {@link GroundPrimitive}.
  4558. * @example
  4559. * var corridor = new Cesium.CorridorGeometry({
  4560. vertexFormat : Cesium.VertexFormat.POSITION_ONLY,
  4561. positions : Cesium.Cartesian3.fromDegreesArray([-72.0, 40.0, -70.0, 35.0]),
  4562. width : 100000
  4563. });
  4564. * @param options - Object with the following properties:
  4565. * @param options.positions - An array of positions that define the center of the corridor.
  4566. * @param options.width - The distance between the edges of the corridor in meters.
  4567. * @param [options.ellipsoid = Ellipsoid.WGS84] - The ellipsoid to be used as a reference.
  4568. * @param [options.granularity = Math.RADIANS_PER_DEGREE] - The distance, in radians, between each latitude and longitude. Determines the number of positions in the buffer.
  4569. * @param [options.height = 0] - The distance in meters between the ellipsoid surface and the positions.
  4570. * @param [options.extrudedHeight] - The distance in meters between the ellipsoid surface and the extruded face.
  4571. * @param [options.vertexFormat = VertexFormat.DEFAULT] - The vertex attributes to be computed.
  4572. * @param [options.cornerType = CornerType.ROUNDED] - Determines the style of the corners.
  4573. */
  4574. export class CorridorGeometry {
  4575. constructor(options: {
  4576. positions: Cartesian3[];
  4577. width: number;
  4578. ellipsoid?: Ellipsoid;
  4579. granularity?: number;
  4580. height?: number;
  4581. extrudedHeight?: number;
  4582. vertexFormat?: VertexFormat;
  4583. cornerType?: CornerType;
  4584. });
  4585. /**
  4586. * The number of elements used to pack the object into an array.
  4587. */
  4588. packedLength: number;
  4589. /**
  4590. * Stores the provided instance into the provided array.
  4591. * @param value - The value to pack.
  4592. * @param array - The array to pack into.
  4593. * @param [startingIndex = 0] - The index into the array at which to start packing the elements.
  4594. * @returns The array that was packed into
  4595. */
  4596. static pack(value: CorridorGeometry, array: number[], startingIndex?: number): number[];
  4597. /**
  4598. * Retrieves an instance from a packed array.
  4599. * @param array - The packed array.
  4600. * @param [startingIndex = 0] - The starting index of the element to be unpacked.
  4601. * @param [result] - The object into which to store the result.
  4602. * @returns The modified result parameter or a new CorridorGeometry instance if one was not provided.
  4603. */
  4604. static unpack(array: number[], startingIndex?: number, result?: CorridorGeometry): CorridorGeometry;
  4605. /**
  4606. * Computes the bounding rectangle given the provided options
  4607. * @param options - Object with the following properties:
  4608. * @param options.positions - An array of positions that define the center of the corridor.
  4609. * @param options.width - The distance between the edges of the corridor in meters.
  4610. * @param [options.ellipsoid = Ellipsoid.WGS84] - The ellipsoid to be used as a reference.
  4611. * @param [options.cornerType = CornerType.ROUNDED] - Determines the style of the corners.
  4612. * @param [result] - An object in which to store the result.
  4613. * @returns The result rectangle.
  4614. */
  4615. static computeRectangle(options: {
  4616. positions: Cartesian3[];
  4617. width: number;
  4618. ellipsoid?: Ellipsoid;
  4619. cornerType?: CornerType;
  4620. }, result?: Rectangle): Rectangle;
  4621. /**
  4622. * Computes the geometric representation of a corridor, including its vertices, indices, and a bounding sphere.
  4623. * @param corridorGeometry - A description of the corridor.
  4624. * @returns The computed vertices and indices.
  4625. */
  4626. static createGeometry(corridorGeometry: CorridorGeometry): Geometry | undefined;
  4627. }
  4628. /**
  4629. * A description of a corridor outline.
  4630. * @example
  4631. * var corridor = new Cesium.CorridorOutlineGeometry({
  4632. positions : Cesium.Cartesian3.fromDegreesArray([-72.0, 40.0, -70.0, 35.0]),
  4633. width : 100000
  4634. });
  4635. * @param options - Object with the following properties:
  4636. * @param options.positions - An array of positions that define the center of the corridor outline.
  4637. * @param options.width - The distance between the edges of the corridor outline.
  4638. * @param [options.ellipsoid = Ellipsoid.WGS84] - The ellipsoid to be used as a reference.
  4639. * @param [options.granularity = Math.RADIANS_PER_DEGREE] - The distance, in radians, between each latitude and longitude. Determines the number of positions in the buffer.
  4640. * @param [options.height = 0] - The distance in meters between the positions and the ellipsoid surface.
  4641. * @param [options.extrudedHeight] - The distance in meters between the extruded face and the ellipsoid surface.
  4642. * @param [options.cornerType = CornerType.ROUNDED] - Determines the style of the corners.
  4643. */
  4644. export class CorridorOutlineGeometry {
  4645. constructor(options: {
  4646. positions: Cartesian3[];
  4647. width: number;
  4648. ellipsoid?: Ellipsoid;
  4649. granularity?: number;
  4650. height?: number;
  4651. extrudedHeight?: number;
  4652. cornerType?: CornerType;
  4653. });
  4654. /**
  4655. * The number of elements used to pack the object into an array.
  4656. */
  4657. packedLength: number;
  4658. /**
  4659. * Stores the provided instance into the provided array.
  4660. * @param value - The value to pack.
  4661. * @param array - The array to pack into.
  4662. * @param [startingIndex = 0] - The index into the array at which to start packing the elements.
  4663. * @returns The array that was packed into
  4664. */
  4665. static pack(value: CorridorOutlineGeometry, array: number[], startingIndex?: number): number[];
  4666. /**
  4667. * Retrieves an instance from a packed array.
  4668. * @param array - The packed array.
  4669. * @param [startingIndex = 0] - The starting index of the element to be unpacked.
  4670. * @param [result] - The object into which to store the result.
  4671. * @returns The modified result parameter or a new CorridorOutlineGeometry instance if one was not provided.
  4672. */
  4673. static unpack(array: number[], startingIndex?: number, result?: CorridorOutlineGeometry): CorridorOutlineGeometry;
  4674. /**
  4675. * Computes the geometric representation of a corridor, including its vertices, indices, and a bounding sphere.
  4676. * @param corridorOutlineGeometry - A description of the corridor.
  4677. * @returns The computed vertices and indices.
  4678. */
  4679. static createGeometry(corridorOutlineGeometry: CorridorOutlineGeometry): Geometry | undefined;
  4680. }
  4681. /**
  4682. * Creates a Globally unique identifier (GUID) string. A GUID is 128 bits long, and can guarantee uniqueness across space and time.
  4683. * @example
  4684. * this.guid = Cesium.createGuid();
  4685. */
  4686. export function createGuid(): string;
  4687. /**
  4688. * Creates a {@link CesiumTerrainProvider} instance for the {@link https://cesium.com/content/#cesium-world-terrain|Cesium World Terrain}.
  4689. * @example
  4690. * // Create Cesium World Terrain with default settings
  4691. var viewer = new Cesium.Viewer('cesiumContainer', {
  4692. terrainProvider : Cesium.createWorldTerrain();
  4693. });
  4694. * @example
  4695. * // Create Cesium World Terrain with water and normals.
  4696. var viewer = new Cesium.Viewer('cesiumContainer', {
  4697. terrainProvider : Cesium.createWorldTerrain({
  4698. requestWaterMask : true,
  4699. requestVertexNormals : true
  4700. });
  4701. });
  4702. * @param [options] - Object with the following properties:
  4703. * @param [options.requestVertexNormals = false] - Flag that indicates if the client should request additional lighting information from the server if available.
  4704. * @param [options.requestWaterMask = false] - Flag that indicates if the client should request per tile water masks from the server if available.
  4705. */
  4706. export function createWorldTerrain(options?: {
  4707. requestVertexNormals?: boolean;
  4708. requestWaterMask?: boolean;
  4709. }): CesiumTerrainProvider;
  4710. /**
  4711. * A credit contains data pertaining to how to display attributions/credits for certain content on the screen.
  4712. * @example
  4713. * //Create a credit with a tooltip, image and link
  4714. var credit = new Cesium.Credit('<a href="https://cesium.com/" target="_blank"><img src="/images/cesium_logo.png" title="Cesium"/></a>');
  4715. * @param html - An string representing an html code snippet
  4716. * @param [showOnScreen = false] - If true, the credit will be visible in the main credit container. Otherwise, it will appear in a popover
  4717. */
  4718. export class Credit {
  4719. constructor(html: string, showOnScreen?: boolean);
  4720. /**
  4721. * The credit content
  4722. */
  4723. readonly html: string;
  4724. /**
  4725. * Whether the credit should be displayed on screen or in a lightbox
  4726. */
  4727. readonly showOnScreen: boolean;
  4728. /**
  4729. * Gets the credit element
  4730. */
  4731. readonly element: HTMLElement;
  4732. /**
  4733. * Returns true if the credits are equal
  4734. * @param left - The first credit
  4735. * @param right - The second credit
  4736. * @returns <code>true</code> if left and right are equal, <code>false</code> otherwise.
  4737. */
  4738. static equals(left: Credit, right: Credit): boolean;
  4739. /**
  4740. * Returns true if the credits are equal
  4741. * @param credit - The credit to compare to.
  4742. * @returns <code>true</code> if left and right are equal, <code>false</code> otherwise.
  4743. */
  4744. equals(credit: Credit): boolean;
  4745. /**
  4746. * Duplicates a Credit instance.
  4747. * @param [credit] - The Credit to duplicate.
  4748. * @returns A new Credit instance that is a duplicate of the one provided. (Returns undefined if the credit is undefined)
  4749. */
  4750. static clone(credit?: Credit): Credit;
  4751. }
  4752. /**
  4753. * Defines functions for 3rd order polynomial functions of one variable with only real coefficients.
  4754. */
  4755. export namespace CubicRealPolynomial {
  4756. /**
  4757. * Provides the discriminant of the cubic equation from the supplied coefficients.
  4758. * @param a - The coefficient of the 3rd order monomial.
  4759. * @param b - The coefficient of the 2nd order monomial.
  4760. * @param c - The coefficient of the 1st order monomial.
  4761. * @param d - The coefficient of the 0th order monomial.
  4762. * @returns The value of the discriminant.
  4763. */
  4764. function computeDiscriminant(a: number, b: number, c: number, d: number): number;
  4765. /**
  4766. * Provides the real valued roots of the cubic polynomial with the provided coefficients.
  4767. * @param a - The coefficient of the 3rd order monomial.
  4768. * @param b - The coefficient of the 2nd order monomial.
  4769. * @param c - The coefficient of the 1st order monomial.
  4770. * @param d - The coefficient of the 0th order monomial.
  4771. * @returns The real valued roots.
  4772. */
  4773. function computeRealRoots(a: number, b: number, c: number, d: number): number[];
  4774. }
  4775. /**
  4776. * The culling volume defined by planes.
  4777. * @param [planes] - An array of clipping planes.
  4778. */
  4779. export class CullingVolume {
  4780. constructor(planes?: Cartesian4[]);
  4781. /**
  4782. * Each plane is represented by a Cartesian4 object, where the x, y, and z components
  4783. define the unit vector normal to the plane, and the w component is the distance of the
  4784. plane from the origin.
  4785. */
  4786. planes: Cartesian4[];
  4787. /**
  4788. * Constructs a culling volume from a bounding sphere. Creates six planes that create a box containing the sphere.
  4789. The planes are aligned to the x, y, and z axes in world coordinates.
  4790. * @param boundingSphere - The bounding sphere used to create the culling volume.
  4791. * @param [result] - The object onto which to store the result.
  4792. * @returns The culling volume created from the bounding sphere.
  4793. */
  4794. static fromBoundingSphere(boundingSphere: BoundingSphere, result?: CullingVolume): CullingVolume;
  4795. /**
  4796. * Determines whether a bounding volume intersects the culling volume.
  4797. * @param boundingVolume - The bounding volume whose intersection with the culling volume is to be tested.
  4798. * @returns Intersect.OUTSIDE, Intersect.INTERSECTING, or Intersect.INSIDE.
  4799. */
  4800. computeVisibility(boundingVolume: any): Intersect;
  4801. }
  4802. /**
  4803. * A description of a cylinder.
  4804. * @example
  4805. * // create cylinder geometry
  4806. var cylinder = new Cesium.CylinderGeometry({
  4807. length: 200000,
  4808. topRadius: 80000,
  4809. bottomRadius: 200000,
  4810. });
  4811. var geometry = Cesium.CylinderGeometry.createGeometry(cylinder);
  4812. * @param options - Object with the following properties:
  4813. * @param options.length - The length of the cylinder.
  4814. * @param options.topRadius - The radius of the top of the cylinder.
  4815. * @param options.bottomRadius - The radius of the bottom of the cylinder.
  4816. * @param [options.slices = 128] - The number of edges around the perimeter of the cylinder.
  4817. * @param [options.vertexFormat = VertexFormat.DEFAULT] - The vertex attributes to be computed.
  4818. */
  4819. export class CylinderGeometry {
  4820. constructor(options: {
  4821. length: number;
  4822. topRadius: number;
  4823. bottomRadius: number;
  4824. slices?: number;
  4825. vertexFormat?: VertexFormat;
  4826. });
  4827. /**
  4828. * The number of elements used to pack the object into an array.
  4829. */
  4830. static packedLength: number;
  4831. /**
  4832. * Stores the provided instance into the provided array.
  4833. * @param value - The value to pack.
  4834. * @param array - The array to pack into.
  4835. * @param [startingIndex = 0] - The index into the array at which to start packing the elements.
  4836. * @returns The array that was packed into
  4837. */
  4838. static pack(value: CylinderGeometry, array: number[], startingIndex?: number): number[];
  4839. /**
  4840. * Retrieves an instance from a packed array.
  4841. * @param array - The packed array.
  4842. * @param [startingIndex = 0] - The starting index of the element to be unpacked.
  4843. * @param [result] - The object into which to store the result.
  4844. * @returns The modified result parameter or a new CylinderGeometry instance if one was not provided.
  4845. */
  4846. static unpack(array: number[], startingIndex?: number, result?: CylinderGeometry): CylinderGeometry;
  4847. /**
  4848. * Computes the geometric representation of a cylinder, including its vertices, indices, and a bounding sphere.
  4849. * @param cylinderGeometry - A description of the cylinder.
  4850. * @returns The computed vertices and indices.
  4851. */
  4852. static createGeometry(cylinderGeometry: CylinderGeometry): Geometry | undefined;
  4853. }
  4854. /**
  4855. * A description of the outline of a cylinder.
  4856. * @example
  4857. * // create cylinder geometry
  4858. var cylinder = new Cesium.CylinderOutlineGeometry({
  4859. length: 200000,
  4860. topRadius: 80000,
  4861. bottomRadius: 200000,
  4862. });
  4863. var geometry = Cesium.CylinderOutlineGeometry.createGeometry(cylinder);
  4864. * @param options - Object with the following properties:
  4865. * @param options.length - The length of the cylinder.
  4866. * @param options.topRadius - The radius of the top of the cylinder.
  4867. * @param options.bottomRadius - The radius of the bottom of the cylinder.
  4868. * @param [options.slices = 128] - The number of edges around the perimeter of the cylinder.
  4869. * @param [options.numberOfVerticalLines = 16] - Number of lines to draw between the top and bottom surfaces of the cylinder.
  4870. */
  4871. export class CylinderOutlineGeometry {
  4872. constructor(options: {
  4873. length: number;
  4874. topRadius: number;
  4875. bottomRadius: number;
  4876. slices?: number;
  4877. numberOfVerticalLines?: number;
  4878. });
  4879. /**
  4880. * The number of elements used to pack the object into an array.
  4881. */
  4882. static packedLength: number;
  4883. /**
  4884. * Stores the provided instance into the provided array.
  4885. * @param value - The value to pack.
  4886. * @param array - The array to pack into.
  4887. * @param [startingIndex = 0] - The index into the array at which to start packing the elements.
  4888. * @returns The array that was packed into
  4889. */
  4890. static pack(value: CylinderOutlineGeometry, array: number[], startingIndex?: number): number[];
  4891. /**
  4892. * Retrieves an instance from a packed array.
  4893. * @param array - The packed array.
  4894. * @param [startingIndex = 0] - The starting index of the element to be unpacked.
  4895. * @param [result] - The object into which to store the result.
  4896. * @returns The modified result parameter or a new CylinderOutlineGeometry instance if one was not provided.
  4897. */
  4898. static unpack(array: number[], startingIndex?: number, result?: CylinderOutlineGeometry): CylinderOutlineGeometry;
  4899. /**
  4900. * Computes the geometric representation of an outline of a cylinder, including its vertices, indices, and a bounding sphere.
  4901. * @param cylinderGeometry - A description of the cylinder outline.
  4902. * @returns The computed vertices and indices.
  4903. */
  4904. static createGeometry(cylinderGeometry: CylinderOutlineGeometry): Geometry | undefined;
  4905. }
  4906. /**
  4907. * A simple proxy that appends the desired resource as the sole query parameter
  4908. to the given proxy URL.
  4909. * @param proxy - The proxy URL that will be used to requests all resources.
  4910. */
  4911. export class DefaultProxy extends Proxy {
  4912. constructor(proxy: string);
  4913. /**
  4914. * Get the final URL to use to request a given resource.
  4915. * @param resource - The resource to request.
  4916. * @returns proxied resource
  4917. */
  4918. getURL(resource: string): string;
  4919. }
  4920. /**
  4921. * Returns the first parameter if not undefined, otherwise the second parameter.
  4922. Useful for setting a default value for a parameter.
  4923. * @example
  4924. * param = Cesium.defaultValue(param, 'default');
  4925. * @returns Returns the first parameter if not undefined, otherwise the second parameter.
  4926. */
  4927. export function defaultValue(a: any, b: any): any;
  4928. /**
  4929. * @example
  4930. * if (Cesium.defined(positions)) {
  4931. doSomething();
  4932. } else {
  4933. doSomethingElse();
  4934. }
  4935. * @param value - The object.
  4936. * @returns Returns true if the object is defined, returns false otherwise.
  4937. */
  4938. export function defined(value: any): boolean;
  4939. /**
  4940. * Destroys an object. Each of the object's functions, including functions in its prototype,
  4941. is replaced with a function that throws a {@link DeveloperError}, except for the object's
  4942. <code>isDestroyed</code> function, which is set to a function that returns <code>true</code>.
  4943. The object's properties are removed with <code>delete</code>.
  4944. <br /><br />
  4945. This function is used by objects that hold native resources, e.g., WebGL resources, which
  4946. need to be explicitly released. Client code calls an object's <code>destroy</code> function,
  4947. which then releases the native resource and calls <code>destroyObject</code> to put itself
  4948. in a destroyed state.
  4949. * @example
  4950. * // How a texture would destroy itself.
  4951. this.destroy = function () {
  4952. _gl.deleteTexture(_texture);
  4953. return Cesium.destroyObject(this);
  4954. };
  4955. * @param object - The object to destroy.
  4956. * @param [message] - The message to include in the exception that is thrown if
  4957. a destroyed object's function is called.
  4958. */
  4959. export function destroyObject(object: any, message?: string): void;
  4960. /**
  4961. * Constructs an exception object that is thrown due to a developer error, e.g., invalid argument,
  4962. argument out of range, etc. This exception should only be thrown during development;
  4963. it usually indicates a bug in the calling code. This exception should never be
  4964. caught; instead the calling code should strive not to generate it.
  4965. <br /><br />
  4966. On the other hand, a {@link RuntimeError} indicates an exception that may
  4967. be thrown at runtime, e.g., out of memory, that the calling code should be prepared
  4968. to catch.
  4969. * @param [message] - The error message for this exception.
  4970. */
  4971. export class DeveloperError extends Error {
  4972. constructor(message?: string);
  4973. /**
  4974. * 'DeveloperError' indicating that this exception was thrown due to a developer error.
  4975. */
  4976. readonly name: string;
  4977. /**
  4978. * The explanation for why this exception was thrown.
  4979. */
  4980. readonly message: string;
  4981. /**
  4982. * The stack trace of this exception, if available.
  4983. */
  4984. readonly stack: string;
  4985. }
  4986. /**
  4987. * Determines visibility based on the distance to the camera.
  4988. * @example
  4989. * // Make a billboard that is only visible when the distance to the camera is between 10 and 20 meters.
  4990. billboard.distanceDisplayCondition = new Cesium.DistanceDisplayCondition(10.0, 20.0);
  4991. * @param [near = 0.0] - The smallest distance in the interval where the object is visible.
  4992. * @param [far = Number.MAX_VALUE] - The largest distance in the interval where the object is visible.
  4993. */
  4994. export class DistanceDisplayCondition {
  4995. constructor(near?: number, far?: number);
  4996. /**
  4997. * The smallest distance in the interval where the object is visible.
  4998. */
  4999. near: number;
  5000. /**
  5001. * The largest distance in the interval where the object is visible.
  5002. */
  5003. far: number;
  5004. /**
  5005. * The number of elements used to pack the object into an array.
  5006. */
  5007. static packedLength: number;
  5008. /**
  5009. * Stores the provided instance into the provided array.
  5010. * @param value - The value to pack.
  5011. * @param array - The array to pack into.
  5012. * @param [startingIndex = 0] - The index into the array at which to start packing the elements.
  5013. * @returns The array that was packed into
  5014. */
  5015. static pack(value: DistanceDisplayCondition, array: number[], startingIndex?: number): number[];
  5016. /**
  5017. * Retrieves an instance from a packed array.
  5018. * @param array - The packed array.
  5019. * @param [startingIndex = 0] - The starting index of the element to be unpacked.
  5020. * @param [result] - The object into which to store the result.
  5021. * @returns The modified result parameter or a new DistanceDisplayCondition instance if one was not provided.
  5022. */
  5023. static unpack(array: number[], startingIndex?: number, result?: DistanceDisplayCondition): DistanceDisplayCondition;
  5024. /**
  5025. * Determines if two distance display conditions are equal.
  5026. * @param left - A distance display condition.
  5027. * @param right - Another distance display condition.
  5028. * @returns Whether the two distance display conditions are equal.
  5029. */
  5030. static equals(left: DistanceDisplayCondition, right: DistanceDisplayCondition): boolean;
  5031. /**
  5032. * Duplicates a distance display condition instance.
  5033. * @param [value] - The distance display condition to duplicate.
  5034. * @param [result] - The result onto which to store the result.
  5035. * @returns The duplicated instance.
  5036. */
  5037. static clone(value?: DistanceDisplayCondition, result?: DistanceDisplayCondition): DistanceDisplayCondition;
  5038. /**
  5039. * Duplicates this instance.
  5040. * @param [result] - The result onto which to store the result.
  5041. * @returns The duplicated instance.
  5042. */
  5043. clone(result?: DistanceDisplayCondition): DistanceDisplayCondition;
  5044. /**
  5045. * Determines if this distance display condition is equal to another.
  5046. * @param other - Another distance display condition.
  5047. * @returns Whether this distance display condition is equal to the other.
  5048. */
  5049. equals(other: DistanceDisplayCondition): boolean;
  5050. }
  5051. /**
  5052. * Value and type information for per-instance geometry attribute that determines if the geometry instance has a distance display condition.
  5053. * @example
  5054. * var instance = new Cesium.GeometryInstance({
  5055. geometry : new Cesium.BoxGeometry({
  5056. vertexFormat : Cesium.VertexFormat.POSITION_AND_NORMAL,
  5057. minimum : new Cesium.Cartesian3(-250000.0, -250000.0, -250000.0),
  5058. maximum : new Cesium.Cartesian3(250000.0, 250000.0, 250000.0)
  5059. }),
  5060. modelMatrix : Cesium.Matrix4.multiplyByTranslation(Cesium.Transforms.eastNorthUpToFixedFrame(
  5061. Cesium.Cartesian3.fromDegrees(-75.59777, 40.03883)), new Cesium.Cartesian3(0.0, 0.0, 1000000.0), new Cesium.Matrix4()),
  5062. id : 'box',
  5063. attributes : {
  5064. distanceDisplayCondition : new Cesium.DistanceDisplayConditionGeometryInstanceAttribute(100.0, 10000.0)
  5065. }
  5066. });
  5067. * @param [near = 0.0] - The near distance.
  5068. * @param [far = Number.MAX_VALUE] - The far distance.
  5069. */
  5070. export class DistanceDisplayConditionGeometryInstanceAttribute {
  5071. constructor(near?: number, far?: number);
  5072. /**
  5073. * The values for the attributes stored in a typed array.
  5074. */
  5075. value: Float32Array;
  5076. /**
  5077. * The datatype of each component in the attribute, e.g., individual elements in
  5078. {@link DistanceDisplayConditionGeometryInstanceAttribute#value}.
  5079. */
  5080. readonly componentDatatype: ComponentDatatype;
  5081. /**
  5082. * The number of components in the attributes, i.e., {@link DistanceDisplayConditionGeometryInstanceAttribute#value}.
  5083. */
  5084. readonly componentsPerAttribute: number;
  5085. /**
  5086. * When <code>true</code> and <code>componentDatatype</code> is an integer format,
  5087. indicate that the components should be mapped to the range [0, 1] (unsigned)
  5088. or [-1, 1] (signed) when they are accessed as floating-point for rendering.
  5089. */
  5090. readonly normalize: boolean;
  5091. /**
  5092. * Creates a new {@link DistanceDisplayConditionGeometryInstanceAttribute} instance given the provided an enabled flag and {@link DistanceDisplayCondition}.
  5093. * @example
  5094. * var distanceDisplayCondition = new Cesium.DistanceDisplayCondition(100.0, 10000.0);
  5095. var instance = new Cesium.GeometryInstance({
  5096. geometry : geometry,
  5097. attributes : {
  5098. distanceDisplayCondition : Cesium.DistanceDisplayConditionGeometryInstanceAttribute.fromDistanceDisplayCondition(distanceDisplayCondition)
  5099. }
  5100. });
  5101. * @param distanceDisplayCondition - The distance display condition.
  5102. * @returns The new {@link DistanceDisplayConditionGeometryInstanceAttribute} instance.
  5103. */
  5104. static fromDistanceDisplayCondition(distanceDisplayCondition: DistanceDisplayCondition): DistanceDisplayConditionGeometryInstanceAttribute;
  5105. /**
  5106. * Converts a distance display condition to a typed array that can be used to assign a distance display condition attribute.
  5107. * @example
  5108. * var attributes = primitive.getGeometryInstanceAttributes('an id');
  5109. attributes.distanceDisplayCondition = Cesium.DistanceDisplayConditionGeometryInstanceAttribute.toValue(distanceDisplayCondition, attributes.distanceDisplayCondition);
  5110. * @param distanceDisplayCondition - The distance display condition value.
  5111. * @param [result] - The array to store the result in, if undefined a new instance will be created.
  5112. * @returns The modified result parameter or a new instance if result was undefined.
  5113. */
  5114. static toValue(distanceDisplayCondition: DistanceDisplayCondition, result?: Float32Array): Float32Array;
  5115. }
  5116. /**
  5117. * Easing functions for use with TweenCollection. These function are from
  5118. {@link https://github.com/sole/tween.js/|Tween.js} and Robert Penner. See the
  5119. {@link http://sole.github.io/tween.js/examples/03_graphs.html|Tween.js graphs for each function}.
  5120. */
  5121. export namespace EasingFunction {
  5122. /**
  5123. * Linear easing.
  5124. */
  5125. const LINEAR_NONE: EasingFunction.Callback;
  5126. /**
  5127. * Quadratic in.
  5128. */
  5129. const QUADRACTIC_IN: EasingFunction.Callback;
  5130. /**
  5131. * Quadratic out.
  5132. */
  5133. const QUADRACTIC_OUT: EasingFunction.Callback;
  5134. /**
  5135. * Quadratic in then out.
  5136. */
  5137. const QUADRACTIC_IN_OUT: EasingFunction.Callback;
  5138. /**
  5139. * Cubic in.
  5140. */
  5141. const CUBIC_IN: EasingFunction.Callback;
  5142. /**
  5143. * Cubic out.
  5144. */
  5145. const CUBIC_OUT: EasingFunction.Callback;
  5146. /**
  5147. * Cubic in then out.
  5148. */
  5149. const CUBIC_IN_OUT: EasingFunction.Callback;
  5150. /**
  5151. * Quartic in.
  5152. */
  5153. const QUARTIC_IN: EasingFunction.Callback;
  5154. /**
  5155. * Quartic out.
  5156. */
  5157. const QUARTIC_OUT: EasingFunction.Callback;
  5158. /**
  5159. * Quartic in then out.
  5160. */
  5161. const QUARTIC_IN_OUT: EasingFunction.Callback;
  5162. /**
  5163. * Quintic in.
  5164. */
  5165. const QUINTIC_IN: EasingFunction.Callback;
  5166. /**
  5167. * Quintic out.
  5168. */
  5169. const QUINTIC_OUT: EasingFunction.Callback;
  5170. /**
  5171. * Quintic in then out.
  5172. */
  5173. const QUINTIC_IN_OUT: EasingFunction.Callback;
  5174. /**
  5175. * Sinusoidal in.
  5176. */
  5177. const SINUSOIDAL_IN: EasingFunction.Callback;
  5178. /**
  5179. * Sinusoidal out.
  5180. */
  5181. const SINUSOIDAL_OUT: EasingFunction.Callback;
  5182. /**
  5183. * Sinusoidal in then out.
  5184. */
  5185. const SINUSOIDAL_IN_OUT: EasingFunction.Callback;
  5186. /**
  5187. * Exponential in.
  5188. */
  5189. const EXPONENTIAL_IN: EasingFunction.Callback;
  5190. /**
  5191. * Exponential out.
  5192. */
  5193. const EXPONENTIAL_OUT: EasingFunction.Callback;
  5194. /**
  5195. * Exponential in then out.
  5196. */
  5197. const EXPONENTIAL_IN_OUT: EasingFunction.Callback;
  5198. /**
  5199. * Circular in.
  5200. */
  5201. const CIRCULAR_IN: EasingFunction.Callback;
  5202. /**
  5203. * Circular out.
  5204. */
  5205. const CIRCULAR_OUT: EasingFunction.Callback;
  5206. /**
  5207. * Circular in then out.
  5208. */
  5209. const CIRCULAR_IN_OUT: EasingFunction.Callback;
  5210. /**
  5211. * Elastic in.
  5212. */
  5213. const ELASTIC_IN: EasingFunction.Callback;
  5214. /**
  5215. * Elastic out.
  5216. */
  5217. const ELASTIC_OUT: EasingFunction.Callback;
  5218. /**
  5219. * Elastic in then out.
  5220. */
  5221. const ELASTIC_IN_OUT: EasingFunction.Callback;
  5222. /**
  5223. * Back in.
  5224. */
  5225. const BACK_IN: EasingFunction.Callback;
  5226. /**
  5227. * Back out.
  5228. */
  5229. const BACK_OUT: EasingFunction.Callback;
  5230. /**
  5231. * Back in then out.
  5232. */
  5233. const BACK_IN_OUT: EasingFunction.Callback;
  5234. /**
  5235. * Bounce in.
  5236. */
  5237. const BOUNCE_IN: EasingFunction.Callback;
  5238. /**
  5239. * Bounce out.
  5240. */
  5241. const BOUNCE_OUT: EasingFunction.Callback;
  5242. /**
  5243. * Bounce in then out.
  5244. */
  5245. const BOUNCE_IN_OUT: EasingFunction.Callback;
  5246. /**
  5247. * Function interface for implementing a custom easing function.
  5248. * @example
  5249. * function quadraticIn(time) {
  5250. return time * time;
  5251. }
  5252. * @example
  5253. * function quadraticOut(time) {
  5254. return time * (2.0 - time);
  5255. }
  5256. * @param time - The time in the range <code>[0, 1]</code>.
  5257. */
  5258. type Callback = (time: number) => number;
  5259. }
  5260. /**
  5261. * A description of an ellipse on an ellipsoid. Ellipse geometry can be rendered with both {@link Primitive} and {@link GroundPrimitive}.
  5262. * @example
  5263. * // Create an ellipse.
  5264. var ellipse = new Cesium.EllipseGeometry({
  5265. center : Cesium.Cartesian3.fromDegrees(-75.59777, 40.03883),
  5266. semiMajorAxis : 500000.0,
  5267. semiMinorAxis : 300000.0,
  5268. rotation : Cesium.Math.toRadians(60.0)
  5269. });
  5270. var geometry = Cesium.EllipseGeometry.createGeometry(ellipse);
  5271. * @param options - Object with the following properties:
  5272. * @param options.center - The ellipse's center point in the fixed frame.
  5273. * @param options.semiMajorAxis - The length of the ellipse's semi-major axis in meters.
  5274. * @param options.semiMinorAxis - The length of the ellipse's semi-minor axis in meters.
  5275. * @param [options.ellipsoid = Ellipsoid.WGS84] - The ellipsoid the ellipse will be on.
  5276. * @param [options.height = 0.0] - The distance in meters between the ellipse and the ellipsoid surface.
  5277. * @param [options.extrudedHeight] - The distance in meters between the ellipse's extruded face and the ellipsoid surface.
  5278. * @param [options.rotation = 0.0] - The angle of rotation counter-clockwise from north.
  5279. * @param [options.stRotation = 0.0] - The rotation of the texture coordinates counter-clockwise from north.
  5280. * @param [options.granularity = Math.RADIANS_PER_DEGREE] - The angular distance between points on the ellipse in radians.
  5281. * @param [options.vertexFormat = VertexFormat.DEFAULT] - The vertex attributes to be computed.
  5282. */
  5283. export class EllipseGeometry {
  5284. constructor(options: {
  5285. center: Cartesian3;
  5286. semiMajorAxis: number;
  5287. semiMinorAxis: number;
  5288. ellipsoid?: Ellipsoid;
  5289. height?: number;
  5290. extrudedHeight?: number;
  5291. rotation?: number;
  5292. stRotation?: number;
  5293. granularity?: number;
  5294. vertexFormat?: VertexFormat;
  5295. });
  5296. /**
  5297. * The number of elements used to pack the object into an array.
  5298. */
  5299. static packedLength: number;
  5300. /**
  5301. * Stores the provided instance into the provided array.
  5302. * @param value - The value to pack.
  5303. * @param array - The array to pack into.
  5304. * @param [startingIndex = 0] - The index into the array at which to start packing the elements.
  5305. * @returns The array that was packed into
  5306. */
  5307. static pack(value: EllipseGeometry, array: number[], startingIndex?: number): number[];
  5308. /**
  5309. * Retrieves an instance from a packed array.
  5310. * @param array - The packed array.
  5311. * @param [startingIndex = 0] - The starting index of the element to be unpacked.
  5312. * @param [result] - The object into which to store the result.
  5313. * @returns The modified result parameter or a new EllipseGeometry instance if one was not provided.
  5314. */
  5315. static unpack(array: number[], startingIndex?: number, result?: EllipseGeometry): EllipseGeometry;
  5316. /**
  5317. * Computes the bounding rectangle based on the provided options
  5318. * @param options - Object with the following properties:
  5319. * @param options.center - The ellipse's center point in the fixed frame.
  5320. * @param options.semiMajorAxis - The length of the ellipse's semi-major axis in meters.
  5321. * @param options.semiMinorAxis - The length of the ellipse's semi-minor axis in meters.
  5322. * @param [options.ellipsoid = Ellipsoid.WGS84] - The ellipsoid the ellipse will be on.
  5323. * @param [options.rotation = 0.0] - The angle of rotation counter-clockwise from north.
  5324. * @param [options.granularity = Math.RADIANS_PER_DEGREE] - The angular distance between points on the ellipse in radians.
  5325. * @param [result] - An object in which to store the result
  5326. * @returns The result rectangle
  5327. */
  5328. static computeRectangle(options: {
  5329. center: Cartesian3;
  5330. semiMajorAxis: number;
  5331. semiMinorAxis: number;
  5332. ellipsoid?: Ellipsoid;
  5333. rotation?: number;
  5334. granularity?: number;
  5335. }, result?: Rectangle): Rectangle;
  5336. /**
  5337. * Computes the geometric representation of a ellipse on an ellipsoid, including its vertices, indices, and a bounding sphere.
  5338. * @param ellipseGeometry - A description of the ellipse.
  5339. * @returns The computed vertices and indices.
  5340. */
  5341. static createGeometry(ellipseGeometry: EllipseGeometry): Geometry | undefined;
  5342. }
  5343. /**
  5344. * A description of the outline of an ellipse on an ellipsoid.
  5345. * @example
  5346. * var ellipse = new Cesium.EllipseOutlineGeometry({
  5347. center : Cesium.Cartesian3.fromDegrees(-75.59777, 40.03883),
  5348. semiMajorAxis : 500000.0,
  5349. semiMinorAxis : 300000.0,
  5350. rotation : Cesium.Math.toRadians(60.0)
  5351. });
  5352. var geometry = Cesium.EllipseOutlineGeometry.createGeometry(ellipse);
  5353. * @param options - Object with the following properties:
  5354. * @param options.center - The ellipse's center point in the fixed frame.
  5355. * @param options.semiMajorAxis - The length of the ellipse's semi-major axis in meters.
  5356. * @param options.semiMinorAxis - The length of the ellipse's semi-minor axis in meters.
  5357. * @param [options.ellipsoid = Ellipsoid.WGS84] - The ellipsoid the ellipse will be on.
  5358. * @param [options.height = 0.0] - The distance in meters between the ellipse and the ellipsoid surface.
  5359. * @param [options.extrudedHeight] - The distance in meters between the ellipse's extruded face and the ellipsoid surface.
  5360. * @param [options.rotation = 0.0] - The angle from north (counter-clockwise) in radians.
  5361. * @param [options.granularity = 0.02] - The angular distance between points on the ellipse in radians.
  5362. * @param [options.numberOfVerticalLines = 16] - Number of lines to draw between the top and bottom surface of an extruded ellipse.
  5363. */
  5364. export class EllipseOutlineGeometry {
  5365. constructor(options: {
  5366. center: Cartesian3;
  5367. semiMajorAxis: number;
  5368. semiMinorAxis: number;
  5369. ellipsoid?: Ellipsoid;
  5370. height?: number;
  5371. extrudedHeight?: number;
  5372. rotation?: number;
  5373. granularity?: number;
  5374. numberOfVerticalLines?: number;
  5375. });
  5376. /**
  5377. * The number of elements used to pack the object into an array.
  5378. */
  5379. static packedLength: number;
  5380. /**
  5381. * Stores the provided instance into the provided array.
  5382. * @param value - The value to pack.
  5383. * @param array - The array to pack into.
  5384. * @param [startingIndex = 0] - The index into the array at which to start packing the elements.
  5385. * @returns The array that was packed into
  5386. */
  5387. static pack(value: EllipseOutlineGeometry, array: number[], startingIndex?: number): number[];
  5388. /**
  5389. * Retrieves an instance from a packed array.
  5390. * @param array - The packed array.
  5391. * @param [startingIndex = 0] - The starting index of the element to be unpacked.
  5392. * @param [result] - The object into which to store the result.
  5393. * @returns The modified result parameter or a new EllipseOutlineGeometry instance if one was not provided.
  5394. */
  5395. static unpack(array: number[], startingIndex?: number, result?: EllipseOutlineGeometry): EllipseOutlineGeometry;
  5396. /**
  5397. * Computes the geometric representation of an outline of an ellipse on an ellipsoid, including its vertices, indices, and a bounding sphere.
  5398. * @param ellipseGeometry - A description of the ellipse.
  5399. * @returns The computed vertices and indices.
  5400. */
  5401. static createGeometry(ellipseGeometry: EllipseOutlineGeometry): Geometry | undefined;
  5402. }
  5403. /**
  5404. * A quadratic surface defined in Cartesian coordinates by the equation
  5405. <code>(x / a)^2 + (y / b)^2 + (z / c)^2 = 1</code>. Primarily used
  5406. by Cesium to represent the shape of planetary bodies.
  5407. Rather than constructing this object directly, one of the provided
  5408. constants is normally used.
  5409. * @param [x = 0] - The radius in the x direction.
  5410. * @param [y = 0] - The radius in the y direction.
  5411. * @param [z = 0] - The radius in the z direction.
  5412. */
  5413. export class Ellipsoid {
  5414. constructor(x?: number, y?: number, z?: number);
  5415. /**
  5416. * Gets the radii of the ellipsoid.
  5417. */
  5418. readonly radii: Cartesian3;
  5419. /**
  5420. * Gets the squared radii of the ellipsoid.
  5421. */
  5422. readonly radiiSquared: Cartesian3;
  5423. /**
  5424. * Gets the radii of the ellipsoid raise to the fourth power.
  5425. */
  5426. readonly radiiToTheFourth: Cartesian3;
  5427. /**
  5428. * Gets one over the radii of the ellipsoid.
  5429. */
  5430. readonly oneOverRadii: Cartesian3;
  5431. /**
  5432. * Gets one over the squared radii of the ellipsoid.
  5433. */
  5434. readonly oneOverRadiiSquared: Cartesian3;
  5435. /**
  5436. * Gets the minimum radius of the ellipsoid.
  5437. */
  5438. readonly minimumRadius: number;
  5439. /**
  5440. * Gets the maximum radius of the ellipsoid.
  5441. */
  5442. readonly maximumRadius: number;
  5443. /**
  5444. * Duplicates an Ellipsoid instance.
  5445. * @param ellipsoid - The ellipsoid to duplicate.
  5446. * @param [result] - The object onto which to store the result, or undefined if a new
  5447. instance should be created.
  5448. * @returns The cloned Ellipsoid. (Returns undefined if ellipsoid is undefined)
  5449. */
  5450. static clone(ellipsoid: Ellipsoid, result?: Ellipsoid): Ellipsoid;
  5451. /**
  5452. * Computes an Ellipsoid from a Cartesian specifying the radii in x, y, and z directions.
  5453. * @param [cartesian = Cartesian3.ZERO] - The ellipsoid's radius in the x, y, and z directions.
  5454. * @param [result] - The object onto which to store the result, or undefined if a new
  5455. instance should be created.
  5456. * @returns A new Ellipsoid instance.
  5457. */
  5458. static fromCartesian3(cartesian?: Cartesian3, result?: Ellipsoid): Ellipsoid;
  5459. /**
  5460. * An Ellipsoid instance initialized to the WGS84 standard.
  5461. */
  5462. static readonly WGS84: Ellipsoid;
  5463. /**
  5464. * An Ellipsoid instance initialized to radii of (1.0, 1.0, 1.0).
  5465. */
  5466. static readonly UNIT_SPHERE: Ellipsoid;
  5467. /**
  5468. * An Ellipsoid instance initialized to a sphere with the lunar radius.
  5469. */
  5470. static readonly MOON: Ellipsoid;
  5471. /**
  5472. * Duplicates an Ellipsoid instance.
  5473. * @param [result] - The object onto which to store the result, or undefined if a new
  5474. instance should be created.
  5475. * @returns The cloned Ellipsoid.
  5476. */
  5477. clone(result?: Ellipsoid): Ellipsoid;
  5478. /**
  5479. * The number of elements used to pack the object into an array.
  5480. */
  5481. static packedLength: number;
  5482. /**
  5483. * Stores the provided instance into the provided array.
  5484. * @param value - The value to pack.
  5485. * @param array - The array to pack into.
  5486. * @param [startingIndex = 0] - The index into the array at which to start packing the elements.
  5487. * @returns The array that was packed into
  5488. */
  5489. static pack(value: Ellipsoid, array: number[], startingIndex?: number): number[];
  5490. /**
  5491. * Retrieves an instance from a packed array.
  5492. * @param array - The packed array.
  5493. * @param [startingIndex = 0] - The starting index of the element to be unpacked.
  5494. * @param [result] - The object into which to store the result.
  5495. * @returns The modified result parameter or a new Ellipsoid instance if one was not provided.
  5496. */
  5497. static unpack(array: number[], startingIndex?: number, result?: Ellipsoid): Ellipsoid;
  5498. /**
  5499. * Computes the unit vector directed from the center of this ellipsoid toward the provided Cartesian position.
  5500. * @param cartesian - The Cartesian for which to to determine the geocentric normal.
  5501. * @param [result] - The object onto which to store the result.
  5502. * @returns The modified result parameter or a new Cartesian3 instance if none was provided.
  5503. */
  5504. geocentricSurfaceNormal(cartesian: Cartesian3, result?: Cartesian3): Cartesian3;
  5505. /**
  5506. * Computes the normal of the plane tangent to the surface of the ellipsoid at the provided position.
  5507. * @param cartographic - The cartographic position for which to to determine the geodetic normal.
  5508. * @param [result] - The object onto which to store the result.
  5509. * @returns The modified result parameter or a new Cartesian3 instance if none was provided.
  5510. */
  5511. geodeticSurfaceNormalCartographic(cartographic: Cartographic, result?: Cartesian3): Cartesian3;
  5512. /**
  5513. * Computes the normal of the plane tangent to the surface of the ellipsoid at the provided position.
  5514. * @param cartesian - The Cartesian position for which to to determine the surface normal.
  5515. * @param [result] - The object onto which to store the result.
  5516. * @returns The modified result parameter or a new Cartesian3 instance if none was provided.
  5517. */
  5518. geodeticSurfaceNormal(cartesian: Cartesian3, result?: Cartesian3): Cartesian3;
  5519. /**
  5520. * Converts the provided cartographic to Cartesian representation.
  5521. * @example
  5522. * //Create a Cartographic and determine it's Cartesian representation on a WGS84 ellipsoid.
  5523. var position = new Cesium.Cartographic(Cesium.Math.toRadians(21), Cesium.Math.toRadians(78), 5000);
  5524. var cartesianPosition = Cesium.Ellipsoid.WGS84.cartographicToCartesian(position);
  5525. * @param cartographic - The cartographic position.
  5526. * @param [result] - The object onto which to store the result.
  5527. * @returns The modified result parameter or a new Cartesian3 instance if none was provided.
  5528. */
  5529. cartographicToCartesian(cartographic: Cartographic, result?: Cartesian3): Cartesian3;
  5530. /**
  5531. * Converts the provided array of cartographics to an array of Cartesians.
  5532. * @example
  5533. * //Convert an array of Cartographics and determine their Cartesian representation on a WGS84 ellipsoid.
  5534. var positions = [new Cesium.Cartographic(Cesium.Math.toRadians(21), Cesium.Math.toRadians(78), 0),
  5535. new Cesium.Cartographic(Cesium.Math.toRadians(21.321), Cesium.Math.toRadians(78.123), 100),
  5536. new Cesium.Cartographic(Cesium.Math.toRadians(21.645), Cesium.Math.toRadians(78.456), 250)];
  5537. var cartesianPositions = Cesium.Ellipsoid.WGS84.cartographicArrayToCartesianArray(positions);
  5538. * @param cartographics - An array of cartographic positions.
  5539. * @param [result] - The object onto which to store the result.
  5540. * @returns The modified result parameter or a new Array instance if none was provided.
  5541. */
  5542. cartographicArrayToCartesianArray(cartographics: Cartographic[], result?: Cartesian3[]): Cartesian3[];
  5543. /**
  5544. * Converts the provided cartesian to cartographic representation.
  5545. The cartesian is undefined at the center of the ellipsoid.
  5546. * @example
  5547. * //Create a Cartesian and determine it's Cartographic representation on a WGS84 ellipsoid.
  5548. var position = new Cesium.Cartesian3(17832.12, 83234.52, 952313.73);
  5549. var cartographicPosition = Cesium.Ellipsoid.WGS84.cartesianToCartographic(position);
  5550. * @param cartesian - The Cartesian position to convert to cartographic representation.
  5551. * @param [result] - The object onto which to store the result.
  5552. * @returns The modified result parameter, new Cartographic instance if none was provided, or undefined if the cartesian is at the center of the ellipsoid.
  5553. */
  5554. cartesianToCartographic(cartesian: Cartesian3, result?: Cartographic): Cartographic;
  5555. /**
  5556. * Converts the provided array of cartesians to an array of cartographics.
  5557. * @example
  5558. * //Create an array of Cartesians and determine their Cartographic representation on a WGS84 ellipsoid.
  5559. var positions = [new Cesium.Cartesian3(17832.12, 83234.52, 952313.73),
  5560. new Cesium.Cartesian3(17832.13, 83234.53, 952313.73),
  5561. new Cesium.Cartesian3(17832.14, 83234.54, 952313.73)]
  5562. var cartographicPositions = Cesium.Ellipsoid.WGS84.cartesianArrayToCartographicArray(positions);
  5563. * @param cartesians - An array of Cartesian positions.
  5564. * @param [result] - The object onto which to store the result.
  5565. * @returns The modified result parameter or a new Array instance if none was provided.
  5566. */
  5567. cartesianArrayToCartographicArray(cartesians: Cartesian3[], result?: Cartographic[]): Cartographic[];
  5568. /**
  5569. * Scales the provided Cartesian position along the geodetic surface normal
  5570. so that it is on the surface of this ellipsoid. If the position is
  5571. at the center of the ellipsoid, this function returns undefined.
  5572. * @param cartesian - The Cartesian position to scale.
  5573. * @param [result] - The object onto which to store the result.
  5574. * @returns The modified result parameter, a new Cartesian3 instance if none was provided, or undefined if the position is at the center.
  5575. */
  5576. scaleToGeodeticSurface(cartesian: Cartesian3, result?: Cartesian3): Cartesian3;
  5577. /**
  5578. * Scales the provided Cartesian position along the geocentric surface normal
  5579. so that it is on the surface of this ellipsoid.
  5580. * @param cartesian - The Cartesian position to scale.
  5581. * @param [result] - The object onto which to store the result.
  5582. * @returns The modified result parameter or a new Cartesian3 instance if none was provided.
  5583. */
  5584. scaleToGeocentricSurface(cartesian: Cartesian3, result?: Cartesian3): Cartesian3;
  5585. /**
  5586. * Transforms a Cartesian X, Y, Z position to the ellipsoid-scaled space by multiplying
  5587. its components by the result of {@link Ellipsoid#oneOverRadii}.
  5588. * @param position - The position to transform.
  5589. * @param [result] - The position to which to copy the result, or undefined to create and
  5590. return a new instance.
  5591. * @returns The position expressed in the scaled space. The returned instance is the
  5592. one passed as the result parameter if it is not undefined, or a new instance of it is.
  5593. */
  5594. transformPositionToScaledSpace(position: Cartesian3, result?: Cartesian3): Cartesian3;
  5595. /**
  5596. * Transforms a Cartesian X, Y, Z position from the ellipsoid-scaled space by multiplying
  5597. its components by the result of {@link Ellipsoid#radii}.
  5598. * @param position - The position to transform.
  5599. * @param [result] - The position to which to copy the result, or undefined to create and
  5600. return a new instance.
  5601. * @returns The position expressed in the unscaled space. The returned instance is the
  5602. one passed as the result parameter if it is not undefined, or a new instance of it is.
  5603. */
  5604. transformPositionFromScaledSpace(position: Cartesian3, result?: Cartesian3): Cartesian3;
  5605. /**
  5606. * Compares this Ellipsoid against the provided Ellipsoid componentwise and returns
  5607. <code>true</code> if they are equal, <code>false</code> otherwise.
  5608. * @param [right] - The other Ellipsoid.
  5609. * @returns <code>true</code> if they are equal, <code>false</code> otherwise.
  5610. */
  5611. equals(right?: Ellipsoid): boolean;
  5612. /**
  5613. * Creates a string representing this Ellipsoid in the format '(radii.x, radii.y, radii.z)'.
  5614. * @returns A string representing this ellipsoid in the format '(radii.x, radii.y, radii.z)'.
  5615. */
  5616. toString(): string;
  5617. /**
  5618. * Computes a point which is the intersection of the surface normal with the z-axis.
  5619. * @param position - the position. must be on the surface of the ellipsoid.
  5620. * @param [buffer = 0.0] - A buffer to subtract from the ellipsoid size when checking if the point is inside the ellipsoid.
  5621. 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.
  5622. In WGS84 datum, intersection point is at max z = +-42841.31151331382 (0.673% of z-axis).
  5623. Intersection point could be outside the ellipsoid if the ratio of MajorAxis / AxisOfRotation is bigger than the square root of 2
  5624. * @param [result] - The cartesian to which to copy the result, or undefined to create and
  5625. return a new instance.
  5626. * @returns the intersection point if it's inside the ellipsoid, undefined otherwise
  5627. */
  5628. getSurfaceNormalIntersectionWithZAxis(position: Cartesian3, buffer?: number, result?: Cartesian3): Cartesian3 | undefined;
  5629. /**
  5630. * Computes an approximation of the surface area of a rectangle on the surface of an ellipsoid using
  5631. Gauss-Legendre 10th order quadrature.
  5632. * @param rectangle - The rectangle used for computing the surface area.
  5633. * @returns The approximate area of the rectangle on the surface of this ellipsoid.
  5634. */
  5635. surfaceArea(rectangle: Rectangle): number;
  5636. }
  5637. /**
  5638. * Initializes a geodesic on the ellipsoid connecting the two provided planetodetic points.
  5639. * @param [start] - The initial planetodetic point on the path.
  5640. * @param [end] - The final planetodetic point on the path.
  5641. * @param [ellipsoid = Ellipsoid.WGS84] - The ellipsoid on which the geodesic lies.
  5642. */
  5643. export class EllipsoidGeodesic {
  5644. constructor(start?: Cartographic, end?: Cartographic, ellipsoid?: Ellipsoid);
  5645. /**
  5646. * Gets the ellipsoid.
  5647. */
  5648. readonly ellipsoid: Ellipsoid;
  5649. /**
  5650. * Gets the surface distance between the start and end point
  5651. */
  5652. readonly surfaceDistance: number;
  5653. /**
  5654. * Gets the initial planetodetic point on the path.
  5655. */
  5656. readonly start: Cartographic;
  5657. /**
  5658. * Gets the final planetodetic point on the path.
  5659. */
  5660. readonly end: Cartographic;
  5661. /**
  5662. * Gets the heading at the initial point.
  5663. */
  5664. readonly startHeading: number;
  5665. /**
  5666. * Gets the heading at the final point.
  5667. */
  5668. readonly endHeading: number;
  5669. /**
  5670. * Sets the start and end points of the geodesic
  5671. * @param start - The initial planetodetic point on the path.
  5672. * @param end - The final planetodetic point on the path.
  5673. */
  5674. setEndPoints(start: Cartographic, end: Cartographic): void;
  5675. /**
  5676. * Provides the location of a point at the indicated portion along the geodesic.
  5677. * @param fraction - The portion of the distance between the initial and final points.
  5678. * @param [result] - The object in which to store the result.
  5679. * @returns The location of the point along the geodesic.
  5680. */
  5681. interpolateUsingFraction(fraction: number, result?: Cartographic): Cartographic;
  5682. /**
  5683. * Provides the location of a point at the indicated distance along the geodesic.
  5684. * @param distance - The distance from the inital point to the point of interest along the geodesic
  5685. * @param [result] - The object in which to store the result.
  5686. * @returns The location of the point along the geodesic.
  5687. */
  5688. interpolateUsingSurfaceDistance(distance: number, result?: Cartographic): Cartographic;
  5689. }
  5690. /**
  5691. * A description of an ellipsoid centered at the origin.
  5692. * @example
  5693. * var ellipsoid = new Cesium.EllipsoidGeometry({
  5694. vertexFormat : Cesium.VertexFormat.POSITION_ONLY,
  5695. radii : new Cesium.Cartesian3(1000000.0, 500000.0, 500000.0)
  5696. });
  5697. var geometry = Cesium.EllipsoidGeometry.createGeometry(ellipsoid);
  5698. * @param [options] - Object with the following properties:
  5699. * @param [options.radii = Cartesian3(1.0, 1.0, 1.0)] - The radii of the ellipsoid in the x, y, and z directions.
  5700. * @param [options.innerRadii = options.radii] - The inner radii of the ellipsoid in the x, y, and z directions.
  5701. * @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.
  5702. * @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.
  5703. * @param [options.minimumCone = 0.0] - The minimum angle measured from the positive z-axis and toward the negative z-axis.
  5704. * @param [options.maximumCone = PI] - The maximum angle measured from the positive z-axis and toward the negative z-axis.
  5705. * @param [options.stackPartitions = 64] - The number of times to partition the ellipsoid into stacks.
  5706. * @param [options.slicePartitions = 64] - The number of times to partition the ellipsoid into radial slices.
  5707. * @param [options.vertexFormat = VertexFormat.DEFAULT] - The vertex attributes to be computed.
  5708. */
  5709. export class EllipsoidGeometry {
  5710. constructor(options?: {
  5711. radii?: Cartesian3;
  5712. innerRadii?: Cartesian3;
  5713. minimumClock?: number;
  5714. maximumClock?: number;
  5715. minimumCone?: number;
  5716. maximumCone?: number;
  5717. stackPartitions?: number;
  5718. slicePartitions?: number;
  5719. vertexFormat?: VertexFormat;
  5720. });
  5721. /**
  5722. * The number of elements used to pack the object into an array.
  5723. */
  5724. static packedLength: number;
  5725. /**
  5726. * Stores the provided instance into the provided array.
  5727. * @param value - The value to pack.
  5728. * @param array - The array to pack into.
  5729. * @param [startingIndex = 0] - The index into the array at which to start packing the elements.
  5730. * @returns The array that was packed into
  5731. */
  5732. static pack(value: EllipsoidGeometry, array: number[], startingIndex?: number): number[];
  5733. /**
  5734. * Retrieves an instance from a packed array.
  5735. * @param array - The packed array.
  5736. * @param [startingIndex = 0] - The starting index of the element to be unpacked.
  5737. * @param [result] - The object into which to store the result.
  5738. * @returns The modified result parameter or a new EllipsoidGeometry instance if one was not provided.
  5739. */
  5740. static unpack(array: number[], startingIndex?: number, result?: EllipsoidGeometry): EllipsoidGeometry;
  5741. /**
  5742. * Computes the geometric representation of an ellipsoid, including its vertices, indices, and a bounding sphere.
  5743. * @param ellipsoidGeometry - A description of the ellipsoid.
  5744. * @returns The computed vertices and indices.
  5745. */
  5746. static createGeometry(ellipsoidGeometry: EllipsoidGeometry): Geometry | undefined;
  5747. }
  5748. /**
  5749. * A description of the outline of an ellipsoid centered at the origin.
  5750. * @example
  5751. * var ellipsoid = new Cesium.EllipsoidOutlineGeometry({
  5752. radii : new Cesium.Cartesian3(1000000.0, 500000.0, 500000.0),
  5753. stackPartitions: 6,
  5754. slicePartitions: 5
  5755. });
  5756. var geometry = Cesium.EllipsoidOutlineGeometry.createGeometry(ellipsoid);
  5757. * @param [options] - Object with the following properties:
  5758. * @param [options.radii = Cartesian3(1.0, 1.0, 1.0)] - The radii of the ellipsoid in the x, y, and z directions.
  5759. * @param [options.innerRadii = options.radii] - The inner radii of the ellipsoid in the x, y, and z directions.
  5760. * @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.
  5761. * @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.
  5762. * @param [options.minimumCone = 0.0] - The minimum angle measured from the positive z-axis and toward the negative z-axis.
  5763. * @param [options.maximumCone = PI] - The maximum angle measured from the positive z-axis and toward the negative z-axis.
  5764. * @param [options.stackPartitions = 10] - The count of stacks for the ellipsoid (1 greater than the number of parallel lines).
  5765. * @param [options.slicePartitions = 8] - The count of slices for the ellipsoid (Equal to the number of radial lines).
  5766. * @param [options.subdivisions = 128] - The number of points per line, determining the granularity of the curvature.
  5767. */
  5768. export class EllipsoidOutlineGeometry {
  5769. constructor(options?: {
  5770. radii?: Cartesian3;
  5771. innerRadii?: Cartesian3;
  5772. minimumClock?: number;
  5773. maximumClock?: number;
  5774. minimumCone?: number;
  5775. maximumCone?: number;
  5776. stackPartitions?: number;
  5777. slicePartitions?: number;
  5778. subdivisions?: number;
  5779. });
  5780. /**
  5781. * The number of elements used to pack the object into an array.
  5782. */
  5783. static packedLength: number;
  5784. /**
  5785. * Stores the provided instance into the provided array.
  5786. * @param value - The value to pack.
  5787. * @param array - The array to pack into.
  5788. * @param [startingIndex = 0] - The index into the array at which to start packing the elements.
  5789. * @returns The array that was packed into
  5790. */
  5791. static pack(value: EllipsoidOutlineGeometry, array: number[], startingIndex?: number): number[];
  5792. /**
  5793. * Retrieves an instance from a packed array.
  5794. * @param array - The packed array.
  5795. * @param [startingIndex = 0] - The starting index of the element to be unpacked.
  5796. * @param [result] - The object into which to store the result.
  5797. * @returns The modified result parameter or a new EllipsoidOutlineGeometry instance if one was not provided.
  5798. */
  5799. static unpack(array: number[], startingIndex?: number, result?: EllipsoidOutlineGeometry): EllipsoidOutlineGeometry;
  5800. /**
  5801. * Computes the geometric representation of an outline of an ellipsoid, including its vertices, indices, and a bounding sphere.
  5802. * @param ellipsoidGeometry - A description of the ellipsoid outline.
  5803. * @returns The computed vertices and indices.
  5804. */
  5805. static createGeometry(ellipsoidGeometry: EllipsoidOutlineGeometry): Geometry | undefined;
  5806. }
  5807. /**
  5808. * Initializes a rhumb line on the ellipsoid connecting the two provided planetodetic points.
  5809. * @param [start] - The initial planetodetic point on the path.
  5810. * @param [end] - The final planetodetic point on the path.
  5811. * @param [ellipsoid = Ellipsoid.WGS84] - The ellipsoid on which the rhumb line lies.
  5812. */
  5813. export class EllipsoidRhumbLine {
  5814. constructor(start?: Cartographic, end?: Cartographic, ellipsoid?: Ellipsoid);
  5815. /**
  5816. * Gets the ellipsoid.
  5817. */
  5818. readonly ellipsoid: Ellipsoid;
  5819. /**
  5820. * Gets the surface distance between the start and end point
  5821. */
  5822. readonly surfaceDistance: number;
  5823. /**
  5824. * Gets the initial planetodetic point on the path.
  5825. */
  5826. readonly start: Cartographic;
  5827. /**
  5828. * Gets the final planetodetic point on the path.
  5829. */
  5830. readonly end: Cartographic;
  5831. /**
  5832. * Gets the heading from the start point to the end point.
  5833. */
  5834. readonly heading: number;
  5835. /**
  5836. * Create a rhumb line using an initial position with a heading and distance.
  5837. * @param start - The initial planetodetic point on the path.
  5838. * @param heading - The heading in radians.
  5839. * @param distance - The rhumb line distance between the start and end point.
  5840. * @param [ellipsoid = Ellipsoid.WGS84] - The ellipsoid on which the rhumb line lies.
  5841. * @param [result] - The object in which to store the result.
  5842. * @returns The EllipsoidRhumbLine object.
  5843. */
  5844. static fromStartHeadingDistance(start: Cartographic, heading: number, distance: number, ellipsoid?: Ellipsoid, result?: EllipsoidRhumbLine): EllipsoidRhumbLine;
  5845. /**
  5846. * Sets the start and end points of the rhumb line.
  5847. * @param start - The initial planetodetic point on the path.
  5848. * @param end - The final planetodetic point on the path.
  5849. */
  5850. setEndPoints(start: Cartographic, end: Cartographic): void;
  5851. /**
  5852. * Provides the location of a point at the indicated portion along the rhumb line.
  5853. * @param fraction - The portion of the distance between the initial and final points.
  5854. * @param [result] - The object in which to store the result.
  5855. * @returns The location of the point along the rhumb line.
  5856. */
  5857. interpolateUsingFraction(fraction: number, result?: Cartographic): Cartographic;
  5858. /**
  5859. * Provides the location of a point at the indicated distance along the rhumb line.
  5860. * @param distance - The distance from the inital point to the point of interest along the rhumbLine.
  5861. * @param [result] - The object in which to store the result.
  5862. * @returns The location of the point along the rhumb line.
  5863. */
  5864. interpolateUsingSurfaceDistance(distance: number, result?: Cartographic): Cartographic;
  5865. /**
  5866. * Provides the location of a point at the indicated longitude along the rhumb line.
  5867. 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.
  5868. * @param intersectionLongitude - The longitude, in radians, at which to find the intersection point from the starting point using the heading.
  5869. * @param [result] - The object in which to store the result.
  5870. * @returns The location of the intersection point along the rhumb line, undefined if there is no intersection or infinite intersections.
  5871. */
  5872. findIntersectionWithLongitude(intersectionLongitude: number, result?: Cartographic): Cartographic;
  5873. /**
  5874. * Provides the location of a point at the indicated latitude along the rhumb line.
  5875. 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.
  5876. * @param intersectionLatitude - The latitude, in radians, at which to find the intersection point from the starting point using the heading.
  5877. * @param [result] - The object in which to store the result.
  5878. * @returns The location of the intersection point along the rhumb line, undefined if there is no intersection or infinite intersections.
  5879. */
  5880. findIntersectionWithLatitude(intersectionLatitude: number, result?: Cartographic): Cartographic;
  5881. }
  5882. /**
  5883. * A plane tangent to the provided ellipsoid at the provided origin.
  5884. If origin is not on the surface of the ellipsoid, it's surface projection will be used.
  5885. If origin is at the center of the ellipsoid, an exception will be thrown.
  5886. * @param origin - The point on the surface of the ellipsoid where the tangent plane touches.
  5887. * @param [ellipsoid = Ellipsoid.WGS84] - The ellipsoid to use.
  5888. */
  5889. export class EllipsoidTangentPlane {
  5890. constructor(origin: Cartesian3, ellipsoid?: Ellipsoid);
  5891. /**
  5892. * Gets the ellipsoid.
  5893. */
  5894. ellipsoid: Ellipsoid;
  5895. /**
  5896. * Gets the origin.
  5897. */
  5898. origin: Cartesian3;
  5899. /**
  5900. * Gets the plane which is tangent to the ellipsoid.
  5901. */
  5902. readonly plane: Plane;
  5903. /**
  5904. * Gets the local X-axis (east) of the tangent plane.
  5905. */
  5906. readonly xAxis: Cartesian3;
  5907. /**
  5908. * Gets the local Y-axis (north) of the tangent plane.
  5909. */
  5910. readonly yAxis: Cartesian3;
  5911. /**
  5912. * Gets the local Z-axis (up) of the tangent plane.
  5913. */
  5914. readonly zAxis: Cartesian3;
  5915. /**
  5916. * Creates a new instance from the provided ellipsoid and the center
  5917. point of the provided Cartesians.
  5918. * @param cartesians - The list of positions surrounding the center point.
  5919. * @param [ellipsoid = Ellipsoid.WGS84] - The ellipsoid to use.
  5920. */
  5921. static fromPoints(cartesians: Cartesian3[], ellipsoid?: Ellipsoid): void;
  5922. /**
  5923. * Computes the projection of the provided 3D position onto the 2D plane, radially outward from the {@link EllipsoidTangentPlane.ellipsoid} coordinate system origin.
  5924. * @param cartesian - The point to project.
  5925. * @param [result] - The object onto which to store the result.
  5926. * @returns The modified result parameter or a new Cartesian2 instance if none was provided. Undefined if there is no intersection point
  5927. */
  5928. projectPointOntoPlane(cartesian: Cartesian3, result?: Cartesian2): Cartesian2;
  5929. /**
  5930. * Computes the projection of the provided 3D positions onto the 2D plane (where possible), radially outward from the global origin.
  5931. The resulting array may be shorter than the input array - if a single projection is impossible it will not be included.
  5932. * @param cartesians - The array of points to project.
  5933. * @param [result] - The array of Cartesian2 instances onto which to store results.
  5934. * @returns The modified result parameter or a new array of Cartesian2 instances if none was provided.
  5935. */
  5936. projectPointsOntoPlane(cartesians: Cartesian3[], result?: Cartesian2[]): Cartesian2[];
  5937. /**
  5938. * Computes the projection of the provided 3D position onto the 2D plane, along the plane normal.
  5939. * @param cartesian - The point to project.
  5940. * @param [result] - The object onto which to store the result.
  5941. * @returns The modified result parameter or a new Cartesian2 instance if none was provided.
  5942. */
  5943. projectPointToNearestOnPlane(cartesian: Cartesian3, result?: Cartesian2): Cartesian2;
  5944. /**
  5945. * Computes the projection of the provided 3D positions onto the 2D plane, along the plane normal.
  5946. * @param cartesians - The array of points to project.
  5947. * @param [result] - The array of Cartesian2 instances onto which to store results.
  5948. * @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>.
  5949. */
  5950. projectPointsToNearestOnPlane(cartesians: Cartesian3[], result?: Cartesian2[]): Cartesian2[];
  5951. /**
  5952. * Computes the projection of the provided 2D position onto the 3D ellipsoid.
  5953. * @param cartesian - The points to project.
  5954. * @param [result] - The Cartesian3 instance to store result.
  5955. * @returns The modified result parameter or a new Cartesian3 instance if none was provided.
  5956. */
  5957. projectPointOntoEllipsoid(cartesian: Cartesian2, result?: Cartesian3): Cartesian3;
  5958. /**
  5959. * Computes the projection of the provided 2D positions onto the 3D ellipsoid.
  5960. * @param cartesians - The array of points to project.
  5961. * @param [result] - The array of Cartesian3 instances onto which to store results.
  5962. * @returns The modified result parameter or a new array of Cartesian3 instances if none was provided.
  5963. */
  5964. projectPointsOntoEllipsoid(cartesians: Cartesian2[], result?: Cartesian3[]): Cartesian3[];
  5965. }
  5966. /**
  5967. * A very simple {@link TerrainProvider} that produces geometry by tessellating an ellipsoidal
  5968. surface.
  5969. * @param [options] - Object with the following properties:
  5970. * @param [options.tilingScheme] - The tiling scheme specifying how the ellipsoidal
  5971. surface is broken into tiles. If this parameter is not provided, a {@link GeographicTilingScheme}
  5972. is used.
  5973. * @param [options.ellipsoid] - The ellipsoid. If the tilingScheme is specified,
  5974. this parameter is ignored and the tiling scheme's ellipsoid is used instead. If neither
  5975. parameter is specified, the WGS84 ellipsoid is used.
  5976. */
  5977. export class EllipsoidTerrainProvider {
  5978. constructor(options?: {
  5979. tilingScheme?: TilingScheme;
  5980. ellipsoid?: Ellipsoid;
  5981. });
  5982. /**
  5983. * Gets an event that is raised when the terrain provider encounters an asynchronous error. By subscribing
  5984. to the event, you will be notified of the error and can potentially recover from it. Event listeners
  5985. are passed an instance of {@link TileProviderError}.
  5986. */
  5987. errorEvent: Event;
  5988. /**
  5989. * Gets the credit to display when this terrain provider is active. Typically this is used to credit
  5990. the source of the terrain. This function should not be called before {@link EllipsoidTerrainProvider#ready} returns true.
  5991. */
  5992. credit: Credit;
  5993. /**
  5994. * Gets the tiling scheme used by this provider. This function should
  5995. not be called before {@link EllipsoidTerrainProvider#ready} returns true.
  5996. */
  5997. tilingScheme: GeographicTilingScheme;
  5998. /**
  5999. * Gets a value indicating whether or not the provider is ready for use.
  6000. */
  6001. ready: boolean;
  6002. /**
  6003. * Gets a promise that resolves to true when the provider is ready for use.
  6004. */
  6005. readonly readyPromise: Promise<boolean>;
  6006. /**
  6007. * Gets a value indicating whether or not the provider includes a water mask. The water mask
  6008. indicates which areas of the globe are water rather than land, so they can be rendered
  6009. as a reflective surface with animated waves. This function should not be
  6010. called before {@link EllipsoidTerrainProvider#ready} returns true.
  6011. */
  6012. hasWaterMask: boolean;
  6013. /**
  6014. * Gets a value indicating whether or not the requested tiles include vertex normals.
  6015. This function should not be called before {@link EllipsoidTerrainProvider#ready} returns true.
  6016. */
  6017. hasVertexNormals: boolean;
  6018. /**
  6019. * Gets an object that can be used to determine availability of terrain from this provider, such as
  6020. at points and in rectangles. This function should not be called before
  6021. {@link TerrainProvider#ready} returns true. This property may be undefined if availability
  6022. information is not available.
  6023. */
  6024. availability: TileAvailability;
  6025. /**
  6026. * Requests the geometry for a given tile. This function should not be called before
  6027. {@link TerrainProvider#ready} returns true. The result includes terrain
  6028. data and indicates that all child tiles are available.
  6029. * @param x - The X coordinate of the tile for which to request geometry.
  6030. * @param y - The Y coordinate of the tile for which to request geometry.
  6031. * @param level - The level of the tile for which to request geometry.
  6032. * @param [request] - The request object. Intended for internal use only.
  6033. * @returns A promise for the requested geometry. If this method
  6034. returns undefined instead of a promise, it is an indication that too many requests are already
  6035. pending and the request will be retried later.
  6036. */
  6037. requestTileGeometry(x: number, y: number, level: number, request?: Request): Promise<TerrainData> | undefined;
  6038. /**
  6039. * Gets the maximum geometric error allowed in a tile at a given level.
  6040. * @param level - The tile level for which to get the maximum geometric error.
  6041. * @returns The maximum geometric error.
  6042. */
  6043. getLevelMaximumGeometricError(level: number): number;
  6044. /**
  6045. * Determines whether data for a tile is available to be loaded.
  6046. * @param x - The X coordinate of the tile for which to request geometry.
  6047. * @param y - The Y coordinate of the tile for which to request geometry.
  6048. * @param level - The level of the tile for which to request geometry.
  6049. * @returns Undefined if not supported, otherwise true or false.
  6050. */
  6051. getTileDataAvailable(x: number, y: number, level: number): boolean;
  6052. /**
  6053. * Makes sure we load availability data for a tile
  6054. * @param x - The X coordinate of the tile for which to request geometry.
  6055. * @param y - The Y coordinate of the tile for which to request geometry.
  6056. * @param level - The level of the tile for which to request geometry.
  6057. * @returns Undefined if nothing need to be loaded or a Promise that resolves when all required tiles are loaded
  6058. */
  6059. loadTileDataAvailability(x: number, y: number, level: number): undefined | Promise<void>;
  6060. }
  6061. /**
  6062. * A generic utility class for managing subscribers for a particular event.
  6063. This class is usually instantiated inside of a container class and
  6064. exposed as a property for others to subscribe to.
  6065. * @example
  6066. * MyObject.prototype.myListener = function(arg1, arg2) {
  6067. this.myArg1Copy = arg1;
  6068. this.myArg2Copy = arg2;
  6069. }
  6070. var myObjectInstance = new MyObject();
  6071. var evt = new Cesium.Event();
  6072. evt.addEventListener(MyObject.prototype.myListener, myObjectInstance);
  6073. evt.raiseEvent('1', '2');
  6074. evt.removeEventListener(MyObject.prototype.myListener);
  6075. */
  6076. export class Event {
  6077. constructor();
  6078. /**
  6079. * The number of listeners currently subscribed to the event.
  6080. */
  6081. readonly numberOfListeners: number;
  6082. /**
  6083. * Registers a callback function to be executed whenever the event is raised.
  6084. An optional scope can be provided to serve as the <code>this</code> pointer
  6085. in which the function will execute.
  6086. * @param listener - The function to be executed when the event is raised.
  6087. * @param [scope] - An optional object scope to serve as the <code>this</code>
  6088. pointer in which the listener function will execute.
  6089. * @returns A function that will remove this event listener when invoked.
  6090. */
  6091. addEventListener(listener: (...params: any[]) => any, scope?: any): Event.RemoveCallback;
  6092. /**
  6093. * Unregisters a previously registered callback.
  6094. * @param listener - The function to be unregistered.
  6095. * @param [scope] - The scope that was originally passed to addEventListener.
  6096. * @returns <code>true</code> if the listener was removed; <code>false</code> if the listener and scope are not registered with the event.
  6097. */
  6098. removeEventListener(listener: (...params: any[]) => any, scope?: any): boolean;
  6099. /**
  6100. * Raises the event by calling each registered listener with all supplied arguments.
  6101. * @param arguments - This method takes any number of parameters and passes them through to the listener functions.
  6102. */
  6103. raiseEvent(...arguments: any[]): void;
  6104. }
  6105. export namespace Event {
  6106. /**
  6107. * A function that removes a listener.
  6108. */
  6109. type RemoveCallback = () => void;
  6110. }
  6111. /**
  6112. * A convenience object that simplifies the common pattern of attaching event listeners
  6113. to several events, then removing all those listeners at once later, for example, in
  6114. a destroy method.
  6115. * @example
  6116. * var helper = new Cesium.EventHelper();
  6117. helper.add(someObject.event, listener1, this);
  6118. helper.add(otherObject.event, listener2, this);
  6119. // later...
  6120. helper.removeAll();
  6121. */
  6122. export class EventHelper {
  6123. constructor();
  6124. /**
  6125. * Adds a listener to an event, and records the registration to be cleaned up later.
  6126. * @param event - The event to attach to.
  6127. * @param listener - The function to be executed when the event is raised.
  6128. * @param [scope] - An optional object scope to serve as the <code>this</code>
  6129. pointer in which the listener function will execute.
  6130. * @returns A function that will remove this event listener when invoked.
  6131. */
  6132. add(event: Event, listener: (...params: any[]) => any, scope?: any): EventHelper.RemoveCallback;
  6133. /**
  6134. * Unregisters all previously added listeners.
  6135. */
  6136. removeAll(): void;
  6137. }
  6138. export namespace EventHelper {
  6139. /**
  6140. * A function that removes a listener.
  6141. */
  6142. type RemoveCallback = () => void;
  6143. }
  6144. /**
  6145. * Constants to determine how an interpolated value is extrapolated
  6146. when querying outside the bounds of available data.
  6147. */
  6148. export enum ExtrapolationType {
  6149. /**
  6150. * No extrapolation occurs.
  6151. */
  6152. NONE = 0,
  6153. /**
  6154. * The first or last value is used when outside the range of sample data.
  6155. */
  6156. HOLD = 1,
  6157. /**
  6158. * The value is extrapolated.
  6159. */
  6160. EXTRAPOLATE = 2
  6161. }
  6162. /**
  6163. * A set of functions to detect whether the current browser supports
  6164. various features.
  6165. */
  6166. export namespace FeatureDetection {
  6167. /**
  6168. * Detects whether the current browser supports the full screen standard.
  6169. * @returns true if the browser supports the full screen standard, false if not.
  6170. */
  6171. function supportsFullscreen(): boolean;
  6172. /**
  6173. * Detects whether the current browser supports typed arrays.
  6174. * @returns true if the browser supports typed arrays, false if not.
  6175. */
  6176. function supportsTypedArrays(): boolean;
  6177. /**
  6178. * Detects whether the current browser supports Web Workers.
  6179. * @returns true if the browsers supports Web Workers, false if not.
  6180. */
  6181. function supportsWebWorkers(): boolean;
  6182. /**
  6183. * Detects whether the current browser supports Web Assembly.
  6184. * @returns true if the browsers supports Web Assembly, false if not.
  6185. */
  6186. function supportsWebAssembly(): boolean;
  6187. }
  6188. /**
  6189. * Formats an error object into a String. If available, uses name, message, and stack
  6190. properties, otherwise, falls back on toString().
  6191. * @param object - The item to find in the array.
  6192. * @returns A string containing the formatted error.
  6193. */
  6194. export function formatError(object: any): string;
  6195. /**
  6196. * Describes a frustum at the given the origin and orientation.
  6197. * @param options - Object with the following properties:
  6198. * @param options.frustum - The frustum.
  6199. * @param options.origin - The origin of the frustum.
  6200. * @param options.orientation - The orientation of the frustum.
  6201. * @param [options.vertexFormat = VertexFormat.DEFAULT] - The vertex attributes to be computed.
  6202. */
  6203. export class FrustumGeometry {
  6204. constructor(options: {
  6205. frustum: PerspectiveFrustum | OrthographicFrustum;
  6206. origin: Cartesian3;
  6207. orientation: Quaternion;
  6208. vertexFormat?: VertexFormat;
  6209. });
  6210. /**
  6211. * The number of elements used to pack the object into an array.
  6212. */
  6213. packedLength: number;
  6214. /**
  6215. * Stores the provided instance into the provided array.
  6216. * @param value - The value to pack.
  6217. * @param array - The array to pack into.
  6218. * @param [startingIndex = 0] - The index into the array at which to start packing the elements.
  6219. * @returns The array that was packed into
  6220. */
  6221. static pack(value: FrustumGeometry, array: number[], startingIndex?: number): number[];
  6222. /**
  6223. * Retrieves an instance from a packed array.
  6224. * @param array - The packed array.
  6225. * @param [startingIndex = 0] - The starting index of the element to be unpacked.
  6226. * @param [result] - The object into which to store the result.
  6227. */
  6228. static unpack(array: number[], startingIndex?: number, result?: FrustumGeometry): void;
  6229. /**
  6230. * Computes the geometric representation of a frustum, including its vertices, indices, and a bounding sphere.
  6231. * @param frustumGeometry - A description of the frustum.
  6232. * @returns The computed vertices and indices.
  6233. */
  6234. static createGeometry(frustumGeometry: FrustumGeometry): Geometry | undefined;
  6235. }
  6236. /**
  6237. * A description of the outline of a frustum with the given the origin and orientation.
  6238. * @param options - Object with the following properties:
  6239. * @param options.frustum - The frustum.
  6240. * @param options.origin - The origin of the frustum.
  6241. * @param options.orientation - The orientation of the frustum.
  6242. */
  6243. export class FrustumOutlineGeometry {
  6244. constructor(options: {
  6245. frustum: PerspectiveFrustum | OrthographicFrustum;
  6246. origin: Cartesian3;
  6247. orientation: Quaternion;
  6248. });
  6249. /**
  6250. * The number of elements used to pack the object into an array.
  6251. */
  6252. packedLength: number;
  6253. /**
  6254. * Stores the provided instance into the provided array.
  6255. * @param value - The value to pack.
  6256. * @param array - The array to pack into.
  6257. * @param [startingIndex = 0] - The index into the array at which to start packing the elements.
  6258. * @returns The array that was packed into
  6259. */
  6260. static pack(value: FrustumOutlineGeometry, array: number[], startingIndex?: number): number[];
  6261. /**
  6262. * Retrieves an instance from a packed array.
  6263. * @param array - The packed array.
  6264. * @param [startingIndex = 0] - The starting index of the element to be unpacked.
  6265. * @param [result] - The object into which to store the result.
  6266. */
  6267. static unpack(array: number[], startingIndex?: number, result?: FrustumOutlineGeometry): void;
  6268. /**
  6269. * Computes the geometric representation of a frustum outline, including its vertices, indices, and a bounding sphere.
  6270. * @param frustumGeometry - A description of the frustum.
  6271. * @returns The computed vertices and indices.
  6272. */
  6273. static createGeometry(frustumGeometry: FrustumOutlineGeometry): Geometry | undefined;
  6274. }
  6275. /**
  6276. * Browser-independent functions for working with the standard fullscreen API.
  6277. */
  6278. export namespace Fullscreen {
  6279. /**
  6280. * The element that is currently fullscreen, if any. To simply check if the
  6281. browser is in fullscreen mode or not, use {@link Fullscreen#fullscreen}.
  6282. */
  6283. const element: any;
  6284. /**
  6285. * The name of the event on the document that is fired when fullscreen is
  6286. entered or exited. This event name is intended for use with addEventListener.
  6287. In your event handler, to determine if the browser is in fullscreen mode or not,
  6288. use {@link Fullscreen#fullscreen}.
  6289. */
  6290. const changeEventName: string;
  6291. /**
  6292. * The name of the event that is fired when a fullscreen error
  6293. occurs. This event name is intended for use with addEventListener.
  6294. */
  6295. const errorEventName: string;
  6296. /**
  6297. * Determine whether the browser will allow an element to be made fullscreen, or not.
  6298. For example, by default, iframes cannot go fullscreen unless the containing page
  6299. adds an "allowfullscreen" attribute (or prefixed equivalent).
  6300. */
  6301. const enabled: boolean;
  6302. /**
  6303. * Determines if the browser is currently in fullscreen mode.
  6304. */
  6305. const fullscreen: boolean;
  6306. /**
  6307. * Detects whether the browser supports the standard fullscreen API.
  6308. * @returns <code>true</code> if the browser supports the standard fullscreen API,
  6309. <code>false</code> otherwise.
  6310. */
  6311. function supportsFullscreen(): boolean;
  6312. /**
  6313. * Asynchronously requests the browser to enter fullscreen mode on the given element.
  6314. If fullscreen mode is not supported by the browser, does nothing.
  6315. * @example
  6316. * // Put the entire page into fullscreen.
  6317. Cesium.Fullscreen.requestFullscreen(document.body)
  6318. // Place only the Cesium canvas into fullscreen.
  6319. Cesium.Fullscreen.requestFullscreen(scene.canvas)
  6320. * @param element - The HTML element which will be placed into fullscreen mode.
  6321. * @param [vrDevice] - The HMDVRDevice device.
  6322. */
  6323. function requestFullscreen(element: any, vrDevice?: any): void;
  6324. /**
  6325. * Asynchronously exits fullscreen mode. If the browser is not currently
  6326. in fullscreen, or if fullscreen mode is not supported by the browser, does nothing.
  6327. */
  6328. function exitFullscreen(): void;
  6329. }
  6330. export namespace GeocoderService {
  6331. /**
  6332. * @property displayName - The display name for a location
  6333. * @property destination - The bounding box for a location
  6334. */
  6335. type Result = {
  6336. displayName: string;
  6337. destination: Rectangle | Cartesian3;
  6338. };
  6339. }
  6340. /**
  6341. * Provides geocoding through an external service. This type describes an interface and
  6342. is not intended to be used.
  6343. */
  6344. export class GeocoderService {
  6345. constructor();
  6346. /**
  6347. * @param query - The query to be sent to the geocoder service
  6348. * @param [type = GeocodeType.SEARCH] - The type of geocode to perform.
  6349. */
  6350. geocode(query: string, type?: GeocodeType): Promise<GeocoderService.Result[]>;
  6351. }
  6352. /**
  6353. * The type of geocoding to be performed by a {@link GeocoderService}.
  6354. */
  6355. export enum GeocodeType {
  6356. /**
  6357. * Perform a search where the input is considered complete.
  6358. */
  6359. SEARCH = 0,
  6360. /**
  6361. * Perform an auto-complete using partial input, typically
  6362. reserved for providing possible results as a user is typing.
  6363. */
  6364. AUTOCOMPLETE = 1
  6365. }
  6366. /**
  6367. * A simple map projection where longitude and latitude are linearly mapped to X and Y by multiplying
  6368. them by the {@link Ellipsoid#maximumRadius}. This projection
  6369. is commonly known as geographic, equirectangular, equidistant cylindrical, or plate carrée. It
  6370. is also known as EPSG:4326.
  6371. * @param [ellipsoid = Ellipsoid.WGS84] - The ellipsoid.
  6372. */
  6373. export class GeographicProjection {
  6374. constructor(ellipsoid?: Ellipsoid);
  6375. /**
  6376. * Gets the {@link Ellipsoid}.
  6377. */
  6378. readonly ellipsoid: Ellipsoid;
  6379. /**
  6380. * Projects a set of {@link Cartographic} coordinates, in radians, to map coordinates, in meters.
  6381. X and Y are the longitude and latitude, respectively, multiplied by the maximum radius of the
  6382. ellipsoid. Z is the unmodified height.
  6383. * @param cartographic - The coordinates to project.
  6384. * @param [result] - An instance into which to copy the result. If this parameter is
  6385. undefined, a new instance is created and returned.
  6386. * @returns The projected coordinates. If the result parameter is not undefined, the
  6387. coordinates are copied there and that instance is returned. Otherwise, a new instance is
  6388. created and returned.
  6389. */
  6390. project(cartographic: Cartographic, result?: Cartesian3): Cartesian3;
  6391. /**
  6392. * Unprojects a set of projected {@link Cartesian3} coordinates, in meters, to {@link Cartographic}
  6393. coordinates, in radians. Longitude and Latitude are the X and Y coordinates, respectively,
  6394. divided by the maximum radius of the ellipsoid. Height is the unmodified Z coordinate.
  6395. * @param cartesian - The Cartesian position to unproject with height (z) in meters.
  6396. * @param [result] - An instance into which to copy the result. If this parameter is
  6397. undefined, a new instance is created and returned.
  6398. * @returns The unprojected coordinates. If the result parameter is not undefined, the
  6399. coordinates are copied there and that instance is returned. Otherwise, a new instance is
  6400. created and returned.
  6401. */
  6402. unproject(cartesian: Cartesian3, result?: Cartographic): Cartographic;
  6403. }
  6404. /**
  6405. * A tiling scheme for geometry referenced to a simple {@link GeographicProjection} where
  6406. longitude and latitude are directly mapped to X and Y. This projection is commonly
  6407. known as geographic, equirectangular, equidistant cylindrical, or plate carrée.
  6408. * @param [options] - Object with the following properties:
  6409. * @param [options.ellipsoid = Ellipsoid.WGS84] - The ellipsoid whose surface is being tiled. Defaults to
  6410. the WGS84 ellipsoid.
  6411. * @param [options.rectangle = Rectangle.MAX_VALUE] - The rectangle, in radians, covered by the tiling scheme.
  6412. * @param [options.numberOfLevelZeroTilesX = 2] - The number of tiles in the X direction at level zero of
  6413. the tile tree.
  6414. * @param [options.numberOfLevelZeroTilesY = 1] - The number of tiles in the Y direction at level zero of
  6415. the tile tree.
  6416. */
  6417. export class GeographicTilingScheme {
  6418. constructor(options?: {
  6419. ellipsoid?: Ellipsoid;
  6420. rectangle?: Rectangle;
  6421. numberOfLevelZeroTilesX?: number;
  6422. numberOfLevelZeroTilesY?: number;
  6423. });
  6424. /**
  6425. * Gets the ellipsoid that is tiled by this tiling scheme.
  6426. */
  6427. ellipsoid: Ellipsoid;
  6428. /**
  6429. * Gets the rectangle, in radians, covered by this tiling scheme.
  6430. */
  6431. rectangle: Rectangle;
  6432. /**
  6433. * Gets the map projection used by this tiling scheme.
  6434. */
  6435. projection: MapProjection;
  6436. /**
  6437. * Gets the total number of tiles in the X direction at a specified level-of-detail.
  6438. * @param level - The level-of-detail.
  6439. * @returns The number of tiles in the X direction at the given level.
  6440. */
  6441. getNumberOfXTilesAtLevel(level: number): number;
  6442. /**
  6443. * Gets the total number of tiles in the Y direction at a specified level-of-detail.
  6444. * @param level - The level-of-detail.
  6445. * @returns The number of tiles in the Y direction at the given level.
  6446. */
  6447. getNumberOfYTilesAtLevel(level: number): number;
  6448. /**
  6449. * Transforms a rectangle specified in geodetic radians to the native coordinate system
  6450. of this tiling scheme.
  6451. * @param rectangle - The rectangle to transform.
  6452. * @param [result] - The instance to which to copy the result, or undefined if a new instance
  6453. should be created.
  6454. * @returns The specified 'result', or a new object containing the native rectangle if 'result'
  6455. is undefined.
  6456. */
  6457. rectangleToNativeRectangle(rectangle: Rectangle, result?: Rectangle): Rectangle;
  6458. /**
  6459. * Converts tile x, y coordinates and level to a rectangle expressed in the native coordinates
  6460. of the tiling scheme.
  6461. * @param x - The integer x coordinate of the tile.
  6462. * @param y - The integer y coordinate of the tile.
  6463. * @param level - The tile level-of-detail. Zero is the least detailed.
  6464. * @param [result] - The instance to which to copy the result, or undefined if a new instance
  6465. should be created.
  6466. * @returns The specified 'result', or a new object containing the rectangle
  6467. if 'result' is undefined.
  6468. */
  6469. tileXYToNativeRectangle(x: number, y: number, level: number, result?: any): Rectangle;
  6470. /**
  6471. * Converts tile x, y coordinates and level to a cartographic rectangle in radians.
  6472. * @param x - The integer x coordinate of the tile.
  6473. * @param y - The integer y coordinate of the tile.
  6474. * @param level - The tile level-of-detail. Zero is the least detailed.
  6475. * @param [result] - The instance to which to copy the result, or undefined if a new instance
  6476. should be created.
  6477. * @returns The specified 'result', or a new object containing the rectangle
  6478. if 'result' is undefined.
  6479. */
  6480. tileXYToRectangle(x: number, y: number, level: number, result?: any): Rectangle;
  6481. /**
  6482. * Calculates the tile x, y coordinates of the tile containing
  6483. a given cartographic position.
  6484. * @param position - The position.
  6485. * @param level - The tile level-of-detail. Zero is the least detailed.
  6486. * @param [result] - The instance to which to copy the result, or undefined if a new instance
  6487. should be created.
  6488. * @returns The specified 'result', or a new object containing the tile x, y coordinates
  6489. if 'result' is undefined.
  6490. */
  6491. positionToTileXY(position: Cartographic, level: number, result?: Cartesian2): Cartesian2;
  6492. }
  6493. /**
  6494. * A geometry representation with attributes forming vertices and optional index data
  6495. defining primitives. Geometries and an {@link Appearance}, which describes the shading,
  6496. can be assigned to a {@link Primitive} for visualization. A <code>Primitive</code> can
  6497. be created from many heterogeneous - in many cases - geometries for performance.
  6498. <p>
  6499. Geometries can be transformed and optimized using functions in {@link GeometryPipeline}.
  6500. </p>
  6501. * @example
  6502. * // Create geometry with a position attribute and indexed lines.
  6503. var positions = new Float64Array([
  6504. 0.0, 0.0, 0.0,
  6505. 7500000.0, 0.0, 0.0,
  6506. 0.0, 7500000.0, 0.0
  6507. ]);
  6508. var geometry = new Cesium.Geometry({
  6509. attributes : {
  6510. position : new Cesium.GeometryAttribute({
  6511. componentDatatype : Cesium.ComponentDatatype.DOUBLE,
  6512. componentsPerAttribute : 3,
  6513. values : positions
  6514. })
  6515. },
  6516. indices : new Uint16Array([0, 1, 1, 2, 2, 0]),
  6517. primitiveType : Cesium.PrimitiveType.LINES,
  6518. boundingSphere : Cesium.BoundingSphere.fromVertices(positions)
  6519. });
  6520. * @param options - Object with the following properties:
  6521. * @param options.attributes - Attributes, which make up the geometry's vertices.
  6522. * @param [options.primitiveType = PrimitiveType.TRIANGLES] - The type of primitives in the geometry.
  6523. * @param [options.indices] - Optional index data that determines the primitives in the geometry.
  6524. * @param [options.boundingSphere] - An optional bounding sphere that fully enclosed the geometry.
  6525. */
  6526. export class Geometry {
  6527. constructor(options: {
  6528. attributes: GeometryAttributes;
  6529. primitiveType?: PrimitiveType;
  6530. indices?: Uint16Array | Uint32Array;
  6531. boundingSphere?: BoundingSphere;
  6532. });
  6533. /**
  6534. * Attributes, which make up the geometry's vertices. Each property in this object corresponds to a
  6535. {@link GeometryAttribute} containing the attribute's data.
  6536. <p>
  6537. Attributes are always stored non-interleaved in a Geometry.
  6538. </p>
  6539. <p>
  6540. There are reserved attribute names with well-known semantics. The following attributes
  6541. are created by a Geometry (depending on the provided {@link VertexFormat}.
  6542. <ul>
  6543. <li><code>position</code> - 3D vertex position. 64-bit floating-point (for precision). 3 components per attribute. See {@link VertexFormat#position}.</li>
  6544. <li><code>normal</code> - Normal (normalized), commonly used for lighting. 32-bit floating-point. 3 components per attribute. See {@link VertexFormat#normal}.</li>
  6545. <li><code>st</code> - 2D texture coordinate. 32-bit floating-point. 2 components per attribute. See {@link VertexFormat#st}.</li>
  6546. <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>
  6547. <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>
  6548. </ul>
  6549. </p>
  6550. <p>
  6551. The following attribute names are generally not created by a Geometry, but are added
  6552. to a Geometry by a {@link Primitive} or {@link GeometryPipeline} functions to prepare
  6553. the geometry for rendering.
  6554. <ul>
  6555. <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>
  6556. <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>
  6557. <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>
  6558. <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>
  6559. <li><code>color</code> - RGBA color (normalized) usually from {@link GeometryInstance#color}. 32-bit floating-point. 4 components per attribute.</li>
  6560. <li><code>pickColor</code> - RGBA color used for picking. 32-bit floating-point. 4 components per attribute.</li>
  6561. </ul>
  6562. </p>
  6563. * @example
  6564. * geometry.attributes.position = new Cesium.GeometryAttribute({
  6565. componentDatatype : Cesium.ComponentDatatype.FLOAT,
  6566. componentsPerAttribute : 3,
  6567. values : new Float32Array(0)
  6568. });
  6569. */
  6570. attributes: GeometryAttributes;
  6571. /**
  6572. * Optional index data that - along with {@link Geometry#primitiveType} -
  6573. determines the primitives in the geometry.
  6574. */
  6575. indices: any[];
  6576. /**
  6577. * The type of primitives in the geometry. This is most often {@link PrimitiveType.TRIANGLES},
  6578. but can varying based on the specific geometry.
  6579. */
  6580. primitiveType: PrimitiveType;
  6581. /**
  6582. * An optional bounding sphere that fully encloses the geometry. This is
  6583. commonly used for culling.
  6584. */
  6585. boundingSphere: BoundingSphere;
  6586. /**
  6587. * Computes the number of vertices in a geometry. The runtime is linear with
  6588. respect to the number of attributes in a vertex, not the number of vertices.
  6589. * @example
  6590. * var numVertices = Cesium.Geometry.computeNumberOfVertices(geometry);
  6591. * @param geometry - The geometry.
  6592. * @returns The number of vertices in the geometry.
  6593. */
  6594. static computeNumberOfVertices(geometry: Geometry): number;
  6595. }
  6596. /**
  6597. * Values and type information for geometry attributes. A {@link Geometry}
  6598. generally contains one or more attributes. All attributes together form
  6599. the geometry's vertices.
  6600. * @example
  6601. * var geometry = new Cesium.Geometry({
  6602. attributes : {
  6603. position : new Cesium.GeometryAttribute({
  6604. componentDatatype : Cesium.ComponentDatatype.FLOAT,
  6605. componentsPerAttribute : 3,
  6606. values : new Float32Array([
  6607. 0.0, 0.0, 0.0,
  6608. 7500000.0, 0.0, 0.0,
  6609. 0.0, 7500000.0, 0.0
  6610. ])
  6611. })
  6612. },
  6613. primitiveType : Cesium.PrimitiveType.LINE_LOOP
  6614. });
  6615. * @param [options] - Object with the following properties:
  6616. * @param [options.componentDatatype] - The datatype of each component in the attribute, e.g., individual elements in values.
  6617. * @param [options.componentsPerAttribute] - A number between 1 and 4 that defines the number of components in an attributes.
  6618. * @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.
  6619. * @param [options.values] - The values for the attributes stored in a typed array.
  6620. */
  6621. export class GeometryAttribute {
  6622. constructor(options?: {
  6623. componentDatatype?: ComponentDatatype;
  6624. componentsPerAttribute?: number;
  6625. normalize?: boolean;
  6626. values?: number[] | Int8Array | Uint8Array | Int16Array | Uint16Array | Int32Array | Uint32Array | Float32Array | Float64Array;
  6627. });
  6628. /**
  6629. * The datatype of each component in the attribute, e.g., individual elements in
  6630. {@link GeometryAttribute#values}.
  6631. */
  6632. componentDatatype: ComponentDatatype;
  6633. /**
  6634. * A number between 1 and 4 that defines the number of components in an attributes.
  6635. For example, a position attribute with x, y, and z components would have 3 as
  6636. shown in the code example.
  6637. * @example
  6638. * attribute.componentDatatype = Cesium.ComponentDatatype.FLOAT;
  6639. attribute.componentsPerAttribute = 3;
  6640. attribute.values = new Float32Array([
  6641. 0.0, 0.0, 0.0,
  6642. 7500000.0, 0.0, 0.0,
  6643. 0.0, 7500000.0, 0.0
  6644. ]);
  6645. */
  6646. componentsPerAttribute: number;
  6647. /**
  6648. * When <code>true</code> and <code>componentDatatype</code> is an integer format,
  6649. indicate that the components should be mapped to the range [0, 1] (unsigned)
  6650. or [-1, 1] (signed) when they are accessed as floating-point for rendering.
  6651. <p>
  6652. This is commonly used when storing colors using {@link ComponentDatatype.UNSIGNED_BYTE}.
  6653. </p>
  6654. * @example
  6655. * attribute.componentDatatype = Cesium.ComponentDatatype.UNSIGNED_BYTE;
  6656. attribute.componentsPerAttribute = 4;
  6657. attribute.normalize = true;
  6658. attribute.values = new Uint8Array([
  6659. Cesium.Color.floatToByte(color.red),
  6660. Cesium.Color.floatToByte(color.green),
  6661. Cesium.Color.floatToByte(color.blue),
  6662. Cesium.Color.floatToByte(color.alpha)
  6663. ]);
  6664. */
  6665. normalize: boolean;
  6666. /**
  6667. * The values for the attributes stored in a typed array. In the code example,
  6668. every three elements in <code>values</code> defines one attributes since
  6669. <code>componentsPerAttribute</code> is 3.
  6670. * @example
  6671. * attribute.componentDatatype = Cesium.ComponentDatatype.FLOAT;
  6672. attribute.componentsPerAttribute = 3;
  6673. attribute.values = new Float32Array([
  6674. 0.0, 0.0, 0.0,
  6675. 7500000.0, 0.0, 0.0,
  6676. 0.0, 7500000.0, 0.0
  6677. ]);
  6678. */
  6679. values: number[] | Int8Array | Uint8Array | Int16Array | Uint16Array | Int32Array | Uint32Array | Float32Array | Float64Array;
  6680. }
  6681. /**
  6682. * Attributes, which make up a geometry's vertices. Each property in this object corresponds to a
  6683. {@link GeometryAttribute} containing the attribute's data.
  6684. <p>
  6685. Attributes are always stored non-interleaved in a Geometry.
  6686. </p>
  6687. */
  6688. export class GeometryAttributes {
  6689. constructor();
  6690. /**
  6691. * The 3D position attribute.
  6692. <p>
  6693. 64-bit floating-point (for precision). 3 components per attribute.
  6694. </p>
  6695. */
  6696. position: GeometryAttribute;
  6697. /**
  6698. * The normal attribute (normalized), which is commonly used for lighting.
  6699. <p>
  6700. 32-bit floating-point. 3 components per attribute.
  6701. </p>
  6702. */
  6703. normal: GeometryAttribute;
  6704. /**
  6705. * The 2D texture coordinate attribute.
  6706. <p>
  6707. 32-bit floating-point. 2 components per attribute
  6708. </p>
  6709. */
  6710. st: GeometryAttribute;
  6711. /**
  6712. * The bitangent attribute (normalized), which is used for tangent-space effects like bump mapping.
  6713. <p>
  6714. 32-bit floating-point. 3 components per attribute.
  6715. </p>
  6716. */
  6717. bitangent: GeometryAttribute;
  6718. /**
  6719. * The tangent attribute (normalized), which is used for tangent-space effects like bump mapping.
  6720. <p>
  6721. 32-bit floating-point. 3 components per attribute.
  6722. </p>
  6723. */
  6724. tangent: GeometryAttribute;
  6725. /**
  6726. * The color attribute.
  6727. <p>
  6728. 8-bit unsigned integer. 4 components per attribute.
  6729. </p>
  6730. */
  6731. color: GeometryAttribute;
  6732. }
  6733. /**
  6734. * Base class for all geometry creation utility classes that can be passed to {@link GeometryInstance}
  6735. for asynchronous geometry creation.
  6736. */
  6737. export class GeometryFactory {
  6738. constructor();
  6739. /**
  6740. * Returns a geometry.
  6741. * @param geometryFactory - A description of the circle.
  6742. * @returns The computed vertices and indices.
  6743. */
  6744. static createGeometry(geometryFactory: GeometryFactory): Geometry | undefined;
  6745. }
  6746. /**
  6747. * Geometry instancing allows one {@link Geometry} object to be positions in several
  6748. different locations and colored uniquely. For example, one {@link BoxGeometry} can
  6749. be instanced several times, each with a different <code>modelMatrix</code> to change
  6750. its position, rotation, and scale.
  6751. * @example
  6752. * // Create geometry for a box, and two instances that refer to it.
  6753. // One instance positions the box on the bottom and colored aqua.
  6754. // The other instance positions the box on the top and color white.
  6755. var geometry = Cesium.BoxGeometry.fromDimensions({
  6756. vertexFormat : Cesium.VertexFormat.POSITION_AND_NORMAL,
  6757. dimensions : new Cesium.Cartesian3(1000000.0, 1000000.0, 500000.0)
  6758. });
  6759. var instanceBottom = new Cesium.GeometryInstance({
  6760. geometry : geometry,
  6761. modelMatrix : Cesium.Matrix4.multiplyByTranslation(Cesium.Transforms.eastNorthUpToFixedFrame(
  6762. Cesium.Cartesian3.fromDegrees(-75.59777, 40.03883)), new Cesium.Cartesian3(0.0, 0.0, 1000000.0), new Cesium.Matrix4()),
  6763. attributes : {
  6764. color : Cesium.ColorGeometryInstanceAttribute.fromColor(Cesium.Color.AQUA)
  6765. },
  6766. id : 'bottom'
  6767. });
  6768. var instanceTop = new Cesium.GeometryInstance({
  6769. geometry : geometry,
  6770. modelMatrix : Cesium.Matrix4.multiplyByTranslation(Cesium.Transforms.eastNorthUpToFixedFrame(
  6771. Cesium.Cartesian3.fromDegrees(-75.59777, 40.03883)), new Cesium.Cartesian3(0.0, 0.0, 3000000.0), new Cesium.Matrix4()),
  6772. attributes : {
  6773. color : Cesium.ColorGeometryInstanceAttribute.fromColor(Cesium.Color.AQUA)
  6774. },
  6775. id : 'top'
  6776. });
  6777. * @param options - Object with the following properties:
  6778. * @param options.geometry - The geometry to instance.
  6779. * @param [options.modelMatrix = Matrix4.IDENTITY] - The model matrix that transforms to transform the geometry from model to world coordinates.
  6780. * @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}.
  6781. * @param [options.attributes] - Per-instance attributes like a show or color attribute shown in the example below.
  6782. */
  6783. export class GeometryInstance {
  6784. constructor(options: {
  6785. geometry: Geometry | GeometryFactory;
  6786. modelMatrix?: Matrix4;
  6787. id?: any;
  6788. attributes?: any;
  6789. });
  6790. /**
  6791. * The geometry being instanced.
  6792. */
  6793. geometry: Geometry;
  6794. /**
  6795. * The 4x4 transformation matrix that transforms the geometry from model to world coordinates.
  6796. When this is the identity matrix, the geometry is drawn in world coordinates, i.e., Earth's WGS84 coordinates.
  6797. Local reference frames can be used by providing a different transformation matrix, like that returned
  6798. by {@link Transforms.eastNorthUpToFixedFrame}.
  6799. */
  6800. modelMatrix: Matrix4;
  6801. /**
  6802. * User-defined object returned when the instance is picked or used to get/set per-instance attributes.
  6803. */
  6804. id: any;
  6805. /**
  6806. * Per-instance attributes like {@link ColorGeometryInstanceAttribute} or {@link ShowGeometryInstanceAttribute}.
  6807. {@link Geometry} attributes varying per vertex; these attributes are constant for the entire instance.
  6808. */
  6809. attributes: any;
  6810. }
  6811. /**
  6812. * Values and type information for per-instance geometry attributes.
  6813. * @example
  6814. * var instance = new Cesium.GeometryInstance({
  6815. geometry : Cesium.BoxGeometry.fromDimensions({
  6816. dimensions : new Cesium.Cartesian3(1000000.0, 1000000.0, 500000.0)
  6817. }),
  6818. modelMatrix : Cesium.Matrix4.multiplyByTranslation(Cesium.Transforms.eastNorthUpToFixedFrame(
  6819. Cesium.Cartesian3.fromDegrees(0.0, 0.0)), new Cesium.Cartesian3(0.0, 0.0, 1000000.0), new Cesium.Matrix4()),
  6820. id : 'box',
  6821. attributes : {
  6822. color : new Cesium.GeometryInstanceAttribute({
  6823. componentDatatype : Cesium.ComponentDatatype.UNSIGNED_BYTE,
  6824. componentsPerAttribute : 4,
  6825. normalize : true,
  6826. value : [255, 255, 0, 255]
  6827. })
  6828. }
  6829. });
  6830. * @param options - Object with the following properties:
  6831. * @param options.componentDatatype - The datatype of each component in the attribute, e.g., individual elements in values.
  6832. * @param options.componentsPerAttribute - A number between 1 and 4 that defines the number of components in an attributes.
  6833. * @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.
  6834. * @param options.value - The value for the attribute.
  6835. */
  6836. export class GeometryInstanceAttribute {
  6837. constructor(options: {
  6838. componentDatatype: ComponentDatatype;
  6839. componentsPerAttribute: number;
  6840. normalize?: boolean;
  6841. value: number[];
  6842. });
  6843. /**
  6844. * The datatype of each component in the attribute, e.g., individual elements in
  6845. {@link GeometryInstanceAttribute#value}.
  6846. */
  6847. componentDatatype: ComponentDatatype;
  6848. /**
  6849. * A number between 1 and 4 that defines the number of components in an attributes.
  6850. For example, a position attribute with x, y, and z components would have 3 as
  6851. shown in the code example.
  6852. * @example
  6853. * show : new Cesium.GeometryInstanceAttribute({
  6854. componentDatatype : Cesium.ComponentDatatype.UNSIGNED_BYTE,
  6855. componentsPerAttribute : 1,
  6856. normalize : true,
  6857. value : [1.0]
  6858. })
  6859. */
  6860. componentsPerAttribute: number;
  6861. /**
  6862. * When <code>true</code> and <code>componentDatatype</code> is an integer format,
  6863. indicate that the components should be mapped to the range [0, 1] (unsigned)
  6864. or [-1, 1] (signed) when they are accessed as floating-point for rendering.
  6865. <p>
  6866. This is commonly used when storing colors using {@link ComponentDatatype.UNSIGNED_BYTE}.
  6867. </p>
  6868. * @example
  6869. * attribute.componentDatatype = Cesium.ComponentDatatype.UNSIGNED_BYTE;
  6870. attribute.componentsPerAttribute = 4;
  6871. attribute.normalize = true;
  6872. attribute.value = [
  6873. Cesium.Color.floatToByte(color.red),
  6874. Cesium.Color.floatToByte(color.green),
  6875. Cesium.Color.floatToByte(color.blue),
  6876. Cesium.Color.floatToByte(color.alpha)
  6877. ];
  6878. */
  6879. normalize: boolean;
  6880. /**
  6881. * The values for the attributes stored in a typed array. In the code example,
  6882. every three elements in <code>values</code> defines one attributes since
  6883. <code>componentsPerAttribute</code> is 3.
  6884. * @example
  6885. * show : new Cesium.GeometryInstanceAttribute({
  6886. componentDatatype : Cesium.ComponentDatatype.UNSIGNED_BYTE,
  6887. componentsPerAttribute : 1,
  6888. normalize : true,
  6889. value : [1.0]
  6890. })
  6891. */
  6892. value: number[];
  6893. }
  6894. /**
  6895. * Content pipeline functions for geometries.
  6896. */
  6897. export namespace GeometryPipeline {
  6898. /**
  6899. * Converts a geometry's triangle indices to line indices. If the geometry has an <code>indices</code>
  6900. and its <code>primitiveType</code> is <code>TRIANGLES</code>, <code>TRIANGLE_STRIP</code>,
  6901. <code>TRIANGLE_FAN</code>, it is converted to <code>LINES</code>; otherwise, the geometry is not changed.
  6902. <p>
  6903. This is commonly used to create a wireframe geometry for visual debugging.
  6904. </p>
  6905. * @example
  6906. * geometry = Cesium.GeometryPipeline.toWireframe(geometry);
  6907. * @param geometry - The geometry to modify.
  6908. * @returns The modified <code>geometry</code> argument, with its triangle indices converted to lines.
  6909. */
  6910. function toWireframe(geometry: Geometry): Geometry;
  6911. /**
  6912. * Creates a new {@link Geometry} with <code>LINES</code> representing the provided
  6913. attribute (<code>attributeName</code>) for the provided geometry. This is used to
  6914. visualize vector attributes like normals, tangents, and bitangents.
  6915. * @example
  6916. * var geometry = Cesium.GeometryPipeline.createLineSegmentsForVectors(instance.geometry, 'bitangent', 100000.0);
  6917. * @param geometry - The <code>Geometry</code> instance with the attribute.
  6918. * @param [attributeName = 'normal'] - The name of the attribute.
  6919. * @param [length = 10000.0] - The length of each line segment in meters. This can be negative to point the vector in the opposite direction.
  6920. * @returns A new <code>Geometry</code> instance with line segments for the vector.
  6921. */
  6922. function createLineSegmentsForVectors(geometry: Geometry, attributeName?: string, length?: number): Geometry;
  6923. /**
  6924. * Creates an object that maps attribute names to unique locations (indices)
  6925. for matching vertex attributes and shader programs.
  6926. * @example
  6927. * var attributeLocations = Cesium.GeometryPipeline.createAttributeLocations(geometry);
  6928. // Example output
  6929. // {
  6930. // 'position' : 0,
  6931. // 'normal' : 1
  6932. // }
  6933. * @param geometry - The geometry, which is not modified, to create the object for.
  6934. * @returns An object with attribute name / index pairs.
  6935. */
  6936. function createAttributeLocations(geometry: Geometry): any;
  6937. /**
  6938. * Reorders a geometry's attributes and <code>indices</code> to achieve better performance from the GPU's pre-vertex-shader cache.
  6939. * @example
  6940. * geometry = Cesium.GeometryPipeline.reorderForPreVertexCache(geometry);
  6941. * @param geometry - The geometry to modify.
  6942. * @returns The modified <code>geometry</code> argument, with its attributes and indices reordered for the GPU's pre-vertex-shader cache.
  6943. */
  6944. function reorderForPreVertexCache(geometry: Geometry): Geometry;
  6945. /**
  6946. * Reorders a geometry's <code>indices</code> to achieve better performance from the GPU's
  6947. post vertex-shader cache by using the Tipsify algorithm. If the geometry <code>primitiveType</code>
  6948. is not <code>TRIANGLES</code> or the geometry does not have an <code>indices</code>, this function has no effect.
  6949. * @example
  6950. * geometry = Cesium.GeometryPipeline.reorderForPostVertexCache(geometry);
  6951. * @param geometry - The geometry to modify.
  6952. * @param [cacheCapacity = 24] - The number of vertices that can be held in the GPU's vertex cache.
  6953. * @returns The modified <code>geometry</code> argument, with its indices reordered for the post-vertex-shader cache.
  6954. */
  6955. function reorderForPostVertexCache(geometry: Geometry, cacheCapacity?: number): Geometry;
  6956. /**
  6957. * Splits a geometry into multiple geometries, if necessary, to ensure that indices in the
  6958. <code>indices</code> fit into unsigned shorts. This is used to meet the WebGL requirements
  6959. when unsigned int indices are not supported.
  6960. <p>
  6961. If the geometry does not have any <code>indices</code>, this function has no effect.
  6962. </p>
  6963. * @example
  6964. * var geometries = Cesium.GeometryPipeline.fitToUnsignedShortIndices(geometry);
  6965. * @param geometry - The geometry to be split into multiple geometries.
  6966. * @returns An array of geometries, each with indices that fit into unsigned shorts.
  6967. */
  6968. function fitToUnsignedShortIndices(geometry: Geometry): Geometry[];
  6969. /**
  6970. * Projects a geometry's 3D <code>position</code> attribute to 2D, replacing the <code>position</code>
  6971. attribute with separate <code>position3D</code> and <code>position2D</code> attributes.
  6972. <p>
  6973. If the geometry does not have a <code>position</code>, this function has no effect.
  6974. </p>
  6975. * @example
  6976. * geometry = Cesium.GeometryPipeline.projectTo2D(geometry, 'position', 'position3D', 'position2D');
  6977. * @param geometry - The geometry to modify.
  6978. * @param attributeName - The name of the attribute.
  6979. * @param attributeName3D - The name of the attribute in 3D.
  6980. * @param attributeName2D - The name of the attribute in 2D.
  6981. * @param [projection = new GeographicProjection()] - The projection to use.
  6982. * @returns The modified <code>geometry</code> argument with <code>position3D</code> and <code>position2D</code> attributes.
  6983. */
  6984. function projectTo2D(geometry: Geometry, attributeName: string, attributeName3D: string, attributeName2D: string, projection?: any): Geometry;
  6985. /**
  6986. * Encodes floating-point geometry attribute values as two separate attributes to improve
  6987. rendering precision.
  6988. <p>
  6989. This is commonly used to create high-precision position vertex attributes.
  6990. </p>
  6991. * @example
  6992. * geometry = Cesium.GeometryPipeline.encodeAttribute(geometry, 'position3D', 'position3DHigh', 'position3DLow');
  6993. * @param geometry - The geometry to modify.
  6994. * @param attributeName - The name of the attribute.
  6995. * @param attributeHighName - The name of the attribute for the encoded high bits.
  6996. * @param attributeLowName - The name of the attribute for the encoded low bits.
  6997. * @returns The modified <code>geometry</code> argument, with its encoded attribute.
  6998. */
  6999. function encodeAttribute(geometry: Geometry, attributeName: string, attributeHighName: string, attributeLowName: string): Geometry;
  7000. /**
  7001. * Transforms a geometry instance to world coordinates. This changes
  7002. the instance's <code>modelMatrix</code> to {@link Matrix4.IDENTITY} and transforms the
  7003. following attributes if they are present: <code>position</code>, <code>normal</code>,
  7004. <code>tangent</code>, and <code>bitangent</code>.
  7005. * @example
  7006. * Cesium.GeometryPipeline.transformToWorldCoordinates(instance);
  7007. * @param instance - The geometry instance to modify.
  7008. * @returns The modified <code>instance</code> argument, with its attributes transforms to world coordinates.
  7009. */
  7010. function transformToWorldCoordinates(instance: GeometryInstance): GeometryInstance;
  7011. /**
  7012. * Computes per-vertex normals for a geometry containing <code>TRIANGLES</code> by averaging the normals of
  7013. all triangles incident to the vertex. The result is a new <code>normal</code> attribute added to the geometry.
  7014. This assumes a counter-clockwise winding order.
  7015. * @example
  7016. * Cesium.GeometryPipeline.computeNormal(geometry);
  7017. * @param geometry - The geometry to modify.
  7018. * @returns The modified <code>geometry</code> argument with the computed <code>normal</code> attribute.
  7019. */
  7020. function computeNormal(geometry: Geometry): Geometry;
  7021. /**
  7022. * Computes per-vertex tangents and bitangents for a geometry containing <code>TRIANGLES</code>.
  7023. The result is new <code>tangent</code> and <code>bitangent</code> attributes added to the geometry.
  7024. This assumes a counter-clockwise winding order.
  7025. <p>
  7026. Based on <a href="http://www.terathon.com/code/tangent.html">Computing Tangent Space Basis Vectors
  7027. for an Arbitrary Mesh</a> by Eric Lengyel.
  7028. </p>
  7029. * @example
  7030. * Cesium.GeometryPipeline.computeTangentAndBiTangent(geometry);
  7031. * @param geometry - The geometry to modify.
  7032. * @returns The modified <code>geometry</code> argument with the computed <code>tangent</code> and <code>bitangent</code> attributes.
  7033. */
  7034. function computeTangentAndBitangent(geometry: Geometry): Geometry;
  7035. /**
  7036. * Compresses and packs geometry normal attribute values to save memory.
  7037. * @example
  7038. * geometry = Cesium.GeometryPipeline.compressVertices(geometry);
  7039. * @param geometry - The geometry to modify.
  7040. * @returns The modified <code>geometry</code> argument, with its normals compressed and packed.
  7041. */
  7042. function compressVertices(geometry: Geometry): Geometry;
  7043. }
  7044. /**
  7045. * Given a relative Uri and a base Uri, returns the absolute Uri of the relative Uri.
  7046. * @example
  7047. * //absolute Uri will be "https://test.com/awesome.png";
  7048. var absoluteUri = Cesium.getAbsoluteUri('awesome.png', 'https://test.com');
  7049. * @param relative - The relative Uri.
  7050. * @param [base] - The base Uri.
  7051. * @returns The absolute Uri of the given relative Uri.
  7052. */
  7053. export function getAbsoluteUri(relative: string, base?: string): string;
  7054. /**
  7055. * Given a URI, returns the base path of the URI.
  7056. * @example
  7057. * // basePath will be "/Gallery/";
  7058. var basePath = Cesium.getBaseUri('/Gallery/simple.czml?value=true&example=false');
  7059. // basePath will be "/Gallery/?value=true&example=false";
  7060. var basePath = Cesium.getBaseUri('/Gallery/simple.czml?value=true&example=false', true);
  7061. * @param uri - The Uri.
  7062. * @param [includeQuery = false] - Whether or not to include the query string and fragment form the uri
  7063. * @returns The base path of the Uri.
  7064. */
  7065. export function getBaseUri(uri: string, includeQuery?: boolean): string;
  7066. /**
  7067. * Given a URI, returns the extension of the URI.
  7068. * @example
  7069. * //extension will be "czml";
  7070. var extension = Cesium.getExtensionFromUri('/Gallery/simple.czml?value=true&example=false');
  7071. * @param uri - The Uri.
  7072. * @returns The extension of the Uri.
  7073. */
  7074. export function getExtensionFromUri(uri: string): string;
  7075. /**
  7076. * Given a URI, returns the last segment of the URI, removing any path or query information.
  7077. * @example
  7078. * //fileName will be"simple.czml";
  7079. var fileName = Cesium.getFilenameFromUri('/Gallery/simple.czml?value=true&example=false');
  7080. * @param uri - The Uri.
  7081. * @returns The last segment of the Uri.
  7082. */
  7083. export function getFilenameFromUri(uri: string): string;
  7084. /**
  7085. * Extract a pixel array from a loaded image. Draws the image
  7086. into a canvas so it can read the pixels back.
  7087. * @param image - The image to extract pixels from.
  7088. * @param width - The width of the image. If not defined, then image.width is assigned.
  7089. * @param height - The height of the image. If not defined, then image.height is assigned.
  7090. * @returns The pixels of the image.
  7091. */
  7092. export function getImagePixels(image: HTMLImageElement, width: number, height: number): ImageData;
  7093. /**
  7094. * Gets a timestamp that can be used in measuring the time between events. Timestamps
  7095. are expressed in milliseconds, but it is not specified what the milliseconds are
  7096. measured from. This function uses performance.now() if it is available, or Date.now()
  7097. otherwise.
  7098. * @returns The timestamp in milliseconds since some unspecified reference time.
  7099. */
  7100. export function getTimestamp(): number;
  7101. /**
  7102. * Provides metadata using the Google Earth Enterprise REST API. This is used by the GoogleEarthEnterpriseImageryProvider
  7103. and GoogleEarthEnterpriseTerrainProvider to share metadata requests.
  7104. * @param resourceOrUrl - The url of the Google Earth Enterprise server hosting the imagery
  7105. */
  7106. export class GoogleEarthEnterpriseMetadata {
  7107. constructor(resourceOrUrl: Resource | string);
  7108. /**
  7109. * True if imagery is available.
  7110. */
  7111. imageryPresent: boolean;
  7112. /**
  7113. * True if imagery is sent as a protocol buffer, false if sent as plain images. If undefined we will try both.
  7114. */
  7115. protoImagery: boolean;
  7116. /**
  7117. * True if terrain is available.
  7118. */
  7119. terrainPresent: boolean;
  7120. /**
  7121. * Exponent used to compute constant to calculate negative height values.
  7122. */
  7123. negativeAltitudeExponentBias: number;
  7124. /**
  7125. * Threshold where any numbers smaller are actually negative values. They are multiplied by -2^negativeAltitudeExponentBias.
  7126. */
  7127. negativeAltitudeThreshold: number;
  7128. /**
  7129. * Dictionary of provider id to copyright strings.
  7130. */
  7131. providers: any;
  7132. /**
  7133. * Key used to decode packets
  7134. */
  7135. key: ArrayBuffer;
  7136. /**
  7137. * Gets the name of the Google Earth Enterprise server.
  7138. */
  7139. readonly url: string;
  7140. /**
  7141. * Gets the proxy used for metadata requests.
  7142. */
  7143. readonly proxy: Proxy;
  7144. /**
  7145. * Gets the resource used for metadata requests.
  7146. */
  7147. readonly resource: Resource;
  7148. /**
  7149. * Gets a promise that resolves to true when the metadata is ready for use.
  7150. */
  7151. readonly readyPromise: Promise<boolean>;
  7152. /**
  7153. * Converts a tiles (x, y, level) position into a quadkey used to request an image
  7154. from a Google Earth Enterprise server.
  7155. * @param x - The tile's x coordinate.
  7156. * @param y - The tile's y coordinate.
  7157. * @param level - The tile's zoom level.
  7158. */
  7159. static tileXYToQuadKey(x: number, y: number, level: number): void;
  7160. /**
  7161. * Converts a tile's quadkey used to request an image from a Google Earth Enterprise server into the
  7162. (x, y, level) position.
  7163. * @param quadkey - The tile's quad key
  7164. */
  7165. static quadKeyToTileXY(quadkey: string): void;
  7166. }
  7167. /**
  7168. * Terrain data for a single tile from a Google Earth Enterprise server.
  7169. * @example
  7170. * var buffer = ...
  7171. var childTileMask = ...
  7172. var terrainData = new Cesium.GoogleEarthEnterpriseTerrainData({
  7173. buffer : heightBuffer,
  7174. childTileMask : childTileMask
  7175. });
  7176. * @param options - Object with the following properties:
  7177. * @param options.buffer - The buffer containing terrain data.
  7178. * @param options.negativeAltitudeExponentBias - Multiplier for negative terrain heights that are encoded as very small positive values.
  7179. * @param options.negativeElevationThreshold - Threshold for negative values
  7180. * @param [options.childTileMask = 15] - A bit mask indicating which of this tile's four children exist.
  7181. If a child's bit is set, geometry will be requested for that tile as well when it
  7182. is needed. If the bit is cleared, the child tile is not requested and geometry is
  7183. instead upsampled from the parent. The bit values are as follows:
  7184. <table>
  7185. <tr><th>Bit Position</th><th>Bit Value</th><th>Child Tile</th></tr>
  7186. <tr><td>0</td><td>1</td><td>Southwest</td></tr>
  7187. <tr><td>1</td><td>2</td><td>Southeast</td></tr>
  7188. <tr><td>2</td><td>4</td><td>Northeast</td></tr>
  7189. <tr><td>3</td><td>8</td><td>Northwest</td></tr>
  7190. </table>
  7191. * @param [options.createdByUpsampling = false] - True if this instance was created by upsampling another instance;
  7192. otherwise, false.
  7193. * @param [options.credits] - Array of credits for this tile.
  7194. */
  7195. export class GoogleEarthEnterpriseTerrainData {
  7196. constructor(options: {
  7197. buffer: ArrayBuffer;
  7198. negativeAltitudeExponentBias: number;
  7199. negativeElevationThreshold: number;
  7200. childTileMask?: number;
  7201. createdByUpsampling?: boolean;
  7202. credits?: Credit[];
  7203. });
  7204. /**
  7205. * An array of credits for this tile
  7206. */
  7207. credits: Credit[];
  7208. /**
  7209. * The water mask included in this terrain data, if any. A water mask is a rectangular
  7210. Uint8Array or image where a value of 255 indicates water and a value of 0 indicates land.
  7211. Values in between 0 and 255 are allowed as well to smoothly blend between land and water.
  7212. */
  7213. waterMask: Uint8Array | HTMLImageElement | HTMLCanvasElement;
  7214. /**
  7215. * Computes the terrain height at a specified longitude and latitude.
  7216. * @param rectangle - The rectangle covered by this terrain data.
  7217. * @param longitude - The longitude in radians.
  7218. * @param latitude - The latitude in radians.
  7219. * @returns The terrain height at the specified position. If the position
  7220. is outside the rectangle, this method will extrapolate the height, which is likely to be wildly
  7221. incorrect for positions far outside the rectangle.
  7222. */
  7223. interpolateHeight(rectangle: Rectangle, longitude: number, latitude: number): number;
  7224. /**
  7225. * Upsamples this terrain data for use by a descendant tile. The resulting instance will contain a subset of the
  7226. height samples in this instance, interpolated if necessary.
  7227. * @param tilingScheme - The tiling scheme of this terrain data.
  7228. * @param thisX - The X coordinate of this tile in the tiling scheme.
  7229. * @param thisY - The Y coordinate of this tile in the tiling scheme.
  7230. * @param thisLevel - The level of this tile in the tiling scheme.
  7231. * @param descendantX - The X coordinate within the tiling scheme of the descendant tile for which we are upsampling.
  7232. * @param descendantY - The Y coordinate within the tiling scheme of the descendant tile for which we are upsampling.
  7233. * @param descendantLevel - The level within the tiling scheme of the descendant tile for which we are upsampling.
  7234. * @returns A promise for upsampled heightmap terrain data for the descendant tile,
  7235. or undefined if too many asynchronous upsample operations are in progress and the request has been
  7236. deferred.
  7237. */
  7238. upsample(tilingScheme: TilingScheme, thisX: number, thisY: number, thisLevel: number, descendantX: number, descendantY: number, descendantLevel: number): Promise<HeightmapTerrainData> | undefined;
  7239. /**
  7240. * Determines if a given child tile is available, based on the
  7241. {@link HeightmapTerrainData.childTileMask}. The given child tile coordinates are assumed
  7242. to be one of the four children of this tile. If non-child tile coordinates are
  7243. given, the availability of the southeast child tile is returned.
  7244. * @param thisX - The tile X coordinate of this (the parent) tile.
  7245. * @param thisY - The tile Y coordinate of this (the parent) tile.
  7246. * @param childX - The tile X coordinate of the child tile to check for availability.
  7247. * @param childY - The tile Y coordinate of the child tile to check for availability.
  7248. * @returns True if the child tile is available; otherwise, false.
  7249. */
  7250. isChildAvailable(thisX: number, thisY: number, childX: number, childY: number): boolean;
  7251. /**
  7252. * Gets a value indicating whether or not this terrain data was created by upsampling lower resolution
  7253. terrain data. If this value is false, the data was obtained from some other source, such
  7254. as by downloading it from a remote server. This method should return true for instances
  7255. returned from a call to {@link HeightmapTerrainData#upsample}.
  7256. * @returns True if this instance was created by upsampling; otherwise, false.
  7257. */
  7258. wasCreatedByUpsampling(): boolean;
  7259. }
  7260. /**
  7261. * Provides tiled terrain using the Google Earth Enterprise REST API.
  7262. * @example
  7263. * var geeMetadata = new GoogleEarthEnterpriseMetadata('http://www.earthenterprise.org/3d');
  7264. var gee = new Cesium.GoogleEarthEnterpriseTerrainProvider({
  7265. metadata : geeMetadata
  7266. });
  7267. * @param options - Object with the following properties:
  7268. * @param options.url - The url of the Google Earth Enterprise server hosting the imagery.
  7269. * @param options.metadata - A metadata object that can be used to share metadata requests with a GoogleEarthEnterpriseImageryProvider.
  7270. * @param [options.ellipsoid] - The ellipsoid. If not specified, the WGS84 ellipsoid is used.
  7271. * @param [options.credit] - A credit for the data source, which is displayed on the canvas.
  7272. */
  7273. export class GoogleEarthEnterpriseTerrainProvider {
  7274. constructor(options: {
  7275. url: Resource | string;
  7276. metadata: GoogleEarthEnterpriseMetadata;
  7277. ellipsoid?: Ellipsoid;
  7278. credit?: Credit | string;
  7279. });
  7280. /**
  7281. * Gets the name of the Google Earth Enterprise server url hosting the imagery.
  7282. */
  7283. readonly url: string;
  7284. /**
  7285. * Gets the proxy used by this provider.
  7286. */
  7287. readonly proxy: Proxy;
  7288. /**
  7289. * Gets the tiling scheme used by this provider. This function should
  7290. not be called before {@link GoogleEarthEnterpriseTerrainProvider#ready} returns true.
  7291. */
  7292. readonly tilingScheme: TilingScheme;
  7293. /**
  7294. * Gets an event that is raised when the imagery provider encounters an asynchronous error. By subscribing
  7295. to the event, you will be notified of the error and can potentially recover from it. Event listeners
  7296. are passed an instance of {@link TileProviderError}.
  7297. */
  7298. readonly errorEvent: Event;
  7299. /**
  7300. * Gets a value indicating whether or not the provider is ready for use.
  7301. */
  7302. readonly ready: boolean;
  7303. /**
  7304. * Gets a promise that resolves to true when the provider is ready for use.
  7305. */
  7306. readonly readyPromise: Promise<boolean>;
  7307. /**
  7308. * Gets the credit to display when this terrain provider is active. Typically this is used to credit
  7309. the source of the terrain. This function should not be called before {@link GoogleEarthEnterpriseTerrainProvider#ready} returns true.
  7310. */
  7311. readonly credit: Credit;
  7312. /**
  7313. * Gets a value indicating whether or not the provider includes a water mask. The water mask
  7314. indicates which areas of the globe are water rather than land, so they can be rendered
  7315. as a reflective surface with animated waves. This function should not be
  7316. called before {@link GoogleEarthEnterpriseTerrainProvider#ready} returns true.
  7317. */
  7318. hasWaterMask: boolean;
  7319. /**
  7320. * Gets a value indicating whether or not the requested tiles include vertex normals.
  7321. This function should not be called before {@link GoogleEarthEnterpriseTerrainProvider#ready} returns true.
  7322. */
  7323. hasVertexNormals: boolean;
  7324. /**
  7325. * Gets an object that can be used to determine availability of terrain from this provider, such as
  7326. at points and in rectangles. This function should not be called before
  7327. {@link GoogleEarthEnterpriseTerrainProvider#ready} returns true. This property may be undefined if availability
  7328. information is not available.
  7329. */
  7330. availability: TileAvailability;
  7331. /**
  7332. * Requests the geometry for a given tile. This function should not be called before
  7333. {@link GoogleEarthEnterpriseTerrainProvider#ready} returns true. The result must include terrain data and
  7334. may optionally include a water mask and an indication of which child tiles are available.
  7335. * @param x - The X coordinate of the tile for which to request geometry.
  7336. * @param y - The Y coordinate of the tile for which to request geometry.
  7337. * @param level - The level of the tile for which to request geometry.
  7338. * @param [request] - The request object. Intended for internal use only.
  7339. * @returns A promise for the requested geometry. If this method
  7340. returns undefined instead of a promise, it is an indication that too many requests are already
  7341. pending and the request will be retried later.
  7342. */
  7343. requestTileGeometry(x: number, y: number, level: number, request?: Request): Promise<TerrainData> | undefined;
  7344. /**
  7345. * Gets the maximum geometric error allowed in a tile at a given level.
  7346. * @param level - The tile level for which to get the maximum geometric error.
  7347. * @returns The maximum geometric error.
  7348. */
  7349. getLevelMaximumGeometricError(level: number): number;
  7350. /**
  7351. * Determines whether data for a tile is available to be loaded.
  7352. * @param x - The X coordinate of the tile for which to request geometry.
  7353. * @param y - The Y coordinate of the tile for which to request geometry.
  7354. * @param level - The level of the tile for which to request geometry.
  7355. * @returns Undefined if not supported, otherwise true or false.
  7356. */
  7357. getTileDataAvailable(x: number, y: number, level: number): boolean;
  7358. /**
  7359. * Makes sure we load availability data for a tile
  7360. * @param x - The X coordinate of the tile for which to request geometry.
  7361. * @param y - The Y coordinate of the tile for which to request geometry.
  7362. * @param level - The level of the tile for which to request geometry.
  7363. * @returns Undefined if nothing need to be loaded or a Promise that resolves when all required tiles are loaded
  7364. */
  7365. loadTileDataAvailability(x: number, y: number, level: number): undefined | Promise<void>;
  7366. }
  7367. /**
  7368. * Represents a Gregorian date in a more precise format than the JavaScript Date object.
  7369. In addition to submillisecond precision, this object can also represent leap seconds.
  7370. * @param [year] - The year as a whole number.
  7371. * @param [month] - The month as a whole number with range [1, 12].
  7372. * @param [day] - The day of the month as a whole number starting at 1.
  7373. * @param [hour] - The hour as a whole number with range [0, 23].
  7374. * @param [minute] - The minute of the hour as a whole number with range [0, 59].
  7375. * @param [second] - The second of the minute as a whole number with range [0, 60], with 60 representing a leap second.
  7376. * @param [millisecond] - The millisecond of the second as a floating point number with range [0.0, 1000.0).
  7377. * @param [isLeapSecond] - Whether this time is during a leap second.
  7378. */
  7379. export class GregorianDate {
  7380. constructor(year?: number, month?: number, day?: number, hour?: number, minute?: number, second?: number, millisecond?: number, isLeapSecond?: boolean);
  7381. /**
  7382. * Gets or sets the year as a whole number.
  7383. */
  7384. year: number;
  7385. /**
  7386. * Gets or sets the month as a whole number with range [1, 12].
  7387. */
  7388. month: number;
  7389. /**
  7390. * Gets or sets the day of the month as a whole number starting at 1.
  7391. */
  7392. day: number;
  7393. /**
  7394. * Gets or sets the hour as a whole number with range [0, 23].
  7395. */
  7396. hour: number;
  7397. /**
  7398. * Gets or sets the minute of the hour as a whole number with range [0, 59].
  7399. */
  7400. minute: number;
  7401. /**
  7402. * Gets or sets the second of the minute as a whole number with range [0, 60], with 60 representing a leap second.
  7403. */
  7404. second: number;
  7405. /**
  7406. * Gets or sets the millisecond of the second as a floating point number with range [0.0, 1000.0).
  7407. */
  7408. millisecond: number;
  7409. /**
  7410. * Gets or sets whether this time is during a leap second.
  7411. */
  7412. isLeapSecond: boolean;
  7413. }
  7414. /**
  7415. * A description of a polyline on terrain or 3D Tiles. Only to be used with {@link GroundPolylinePrimitive}.
  7416. * @example
  7417. * var positions = Cesium.Cartesian3.fromDegreesArray([
  7418. -112.1340164450331, 36.05494287836128,
  7419. -112.08821010582645, 36.097804071380715,
  7420. -112.13296079730024, 36.168769146801104
  7421. ]);
  7422. var geometry = new Cesium.GroundPolylineGeometry({
  7423. positions : positions
  7424. });
  7425. * @param options - Options with the following properties:
  7426. * @param options.positions - An array of {@link Cartesian3} defining the polyline's points. Heights above the ellipsoid will be ignored.
  7427. * @param [options.width = 1.0] - The screen space width in pixels.
  7428. * @param [options.granularity = 9999.0] - The distance interval in meters used for interpolating options.points. Defaults to 9999.0 meters. Zero indicates no interpolation.
  7429. * @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.
  7430. * @param [options.arcType = ArcType.GEODESIC] - The type of line the polyline segments must follow. Valid options are {@link ArcType.GEODESIC} and {@link ArcType.RHUMB}.
  7431. */
  7432. export class GroundPolylineGeometry {
  7433. constructor(options: {
  7434. positions: Cartesian3[];
  7435. width?: number;
  7436. granularity?: number;
  7437. loop?: boolean;
  7438. arcType?: ArcType;
  7439. });
  7440. /**
  7441. * The screen space width in pixels.
  7442. */
  7443. width: number;
  7444. /**
  7445. * The distance interval used for interpolating options.points. Zero indicates no interpolation.
  7446. Default of 9999.0 allows centimeter accuracy with 32 bit floating point.
  7447. */
  7448. granularity: boolean;
  7449. /**
  7450. * Whether during geometry creation a line segment will be added between the last and first line positions to make this Polyline a loop.
  7451. If the geometry has two positions this parameter will be ignored.
  7452. */
  7453. loop: boolean;
  7454. /**
  7455. * The type of path the polyline must follow. Valid options are {@link ArcType.GEODESIC} and {@link ArcType.RHUMB}.
  7456. */
  7457. arcType: ArcType;
  7458. /**
  7459. * Stores the provided instance into the provided array.
  7460. * @param value - The value to pack.
  7461. * @param array - The array to pack into.
  7462. * @param [startingIndex = 0] - The index into the array at which to start packing the elements.
  7463. * @returns The array that was packed into
  7464. */
  7465. static pack(value: PolygonGeometry, array: number[], startingIndex?: number): number[];
  7466. /**
  7467. * Retrieves an instance from a packed array.
  7468. * @param array - The packed array.
  7469. * @param [startingIndex = 0] - The starting index of the element to be unpacked.
  7470. * @param [result] - The object into which to store the result.
  7471. */
  7472. static unpack(array: number[], startingIndex?: number, result?: PolygonGeometry): void;
  7473. }
  7474. /**
  7475. * Defines a heading angle, pitch angle, and range in a local frame.
  7476. Heading is the rotation from the local north direction where a positive angle is increasing eastward.
  7477. Pitch is the rotation from the local xy-plane. Positive pitch angles are above the plane. Negative pitch
  7478. angles are below the plane. Range is the distance from the center of the frame.
  7479. * @param [heading = 0.0] - The heading angle in radians.
  7480. * @param [pitch = 0.0] - The pitch angle in radians.
  7481. * @param [range = 0.0] - The distance from the center in meters.
  7482. */
  7483. export class HeadingPitchRange {
  7484. constructor(heading?: number, pitch?: number, range?: number);
  7485. /**
  7486. * Heading is the rotation from the local north direction where a positive angle is increasing eastward.
  7487. */
  7488. heading: number;
  7489. /**
  7490. * Pitch is the rotation from the local xy-plane. Positive pitch angles
  7491. are above the plane. Negative pitch angles are below the plane.
  7492. */
  7493. pitch: number;
  7494. /**
  7495. * Range is the distance from the center of the local frame.
  7496. */
  7497. range: number;
  7498. /**
  7499. * Duplicates a HeadingPitchRange instance.
  7500. * @param hpr - The HeadingPitchRange to duplicate.
  7501. * @param [result] - The object onto which to store the result.
  7502. * @returns The modified result parameter or a new HeadingPitchRange instance if one was not provided. (Returns undefined if hpr is undefined)
  7503. */
  7504. static clone(hpr: HeadingPitchRange, result?: HeadingPitchRange): HeadingPitchRange;
  7505. }
  7506. /**
  7507. * A rotation expressed as a heading, pitch, and roll. Heading is the rotation about the
  7508. negative z axis. Pitch is the rotation about the negative y axis. Roll is the rotation about
  7509. the positive x axis.
  7510. * @param [heading = 0.0] - The heading component in radians.
  7511. * @param [pitch = 0.0] - The pitch component in radians.
  7512. * @param [roll = 0.0] - The roll component in radians.
  7513. */
  7514. export class HeadingPitchRoll {
  7515. constructor(heading?: number, pitch?: number, roll?: number);
  7516. /**
  7517. * Gets or sets the heading.
  7518. */
  7519. heading: number;
  7520. /**
  7521. * Gets or sets the pitch.
  7522. */
  7523. pitch: number;
  7524. /**
  7525. * Gets or sets the roll.
  7526. */
  7527. roll: number;
  7528. /**
  7529. * Computes the heading, pitch and roll from a quaternion (see http://en.wikipedia.org/wiki/Conversion_between_quaternions_and_Euler_angles )
  7530. * @param quaternion - The quaternion from which to retrieve heading, pitch, and roll, all expressed in radians.
  7531. * @param [result] - The object in which to store the result. If not provided, a new instance is created and returned.
  7532. * @returns The modified result parameter or a new HeadingPitchRoll instance if one was not provided.
  7533. */
  7534. static fromQuaternion(quaternion: Quaternion, result?: HeadingPitchRoll): HeadingPitchRoll;
  7535. /**
  7536. * Returns a new HeadingPitchRoll instance from angles given in degrees.
  7537. * @param heading - the heading in degrees
  7538. * @param pitch - the pitch in degrees
  7539. * @param roll - the heading in degrees
  7540. * @param [result] - The object in which to store the result. If not provided, a new instance is created and returned.
  7541. * @returns A new HeadingPitchRoll instance
  7542. */
  7543. static fromDegrees(heading: number, pitch: number, roll: number, result?: HeadingPitchRoll): HeadingPitchRoll;
  7544. /**
  7545. * Duplicates a HeadingPitchRoll instance.
  7546. * @param headingPitchRoll - The HeadingPitchRoll to duplicate.
  7547. * @param [result] - The object onto which to store the result.
  7548. * @returns The modified result parameter or a new HeadingPitchRoll instance if one was not provided. (Returns undefined if headingPitchRoll is undefined)
  7549. */
  7550. static clone(headingPitchRoll: HeadingPitchRoll, result?: HeadingPitchRoll): HeadingPitchRoll;
  7551. /**
  7552. * Compares the provided HeadingPitchRolls componentwise and returns
  7553. <code>true</code> if they are equal, <code>false</code> otherwise.
  7554. * @param [left] - The first HeadingPitchRoll.
  7555. * @param [right] - The second HeadingPitchRoll.
  7556. * @returns <code>true</code> if left and right are equal, <code>false</code> otherwise.
  7557. */
  7558. static equals(left?: HeadingPitchRoll, right?: HeadingPitchRoll): boolean;
  7559. /**
  7560. * Compares the provided HeadingPitchRolls componentwise and returns
  7561. <code>true</code> if they pass an absolute or relative tolerance test,
  7562. <code>false</code> otherwise.
  7563. * @param [left] - The first HeadingPitchRoll.
  7564. * @param [right] - The second HeadingPitchRoll.
  7565. * @param [relativeEpsilon = 0] - The relative epsilon tolerance to use for equality testing.
  7566. * @param [absoluteEpsilon = relativeEpsilon] - The absolute epsilon tolerance to use for equality testing.
  7567. * @returns <code>true</code> if left and right are within the provided epsilon, <code>false</code> otherwise.
  7568. */
  7569. static equalsEpsilon(left?: HeadingPitchRoll, right?: HeadingPitchRoll, relativeEpsilon?: number, absoluteEpsilon?: number): boolean;
  7570. /**
  7571. * Duplicates this HeadingPitchRoll instance.
  7572. * @param [result] - The object onto which to store the result.
  7573. * @returns The modified result parameter or a new HeadingPitchRoll instance if one was not provided.
  7574. */
  7575. clone(result?: HeadingPitchRoll): HeadingPitchRoll;
  7576. /**
  7577. * Compares this HeadingPitchRoll against the provided HeadingPitchRoll componentwise and returns
  7578. <code>true</code> if they are equal, <code>false</code> otherwise.
  7579. * @param [right] - The right hand side HeadingPitchRoll.
  7580. * @returns <code>true</code> if they are equal, <code>false</code> otherwise.
  7581. */
  7582. equals(right?: HeadingPitchRoll): boolean;
  7583. /**
  7584. * Compares this HeadingPitchRoll against the provided HeadingPitchRoll componentwise and returns
  7585. <code>true</code> if they pass an absolute or relative tolerance test,
  7586. <code>false</code> otherwise.
  7587. * @param [right] - The right hand side HeadingPitchRoll.
  7588. * @param [relativeEpsilon = 0] - The relative epsilon tolerance to use for equality testing.
  7589. * @param [absoluteEpsilon = relativeEpsilon] - The absolute epsilon tolerance to use for equality testing.
  7590. * @returns <code>true</code> if they are within the provided epsilon, <code>false</code> otherwise.
  7591. */
  7592. equalsEpsilon(right?: HeadingPitchRoll, relativeEpsilon?: number, absoluteEpsilon?: number): boolean;
  7593. /**
  7594. * Creates a string representing this HeadingPitchRoll in the format '(heading, pitch, roll)' in radians.
  7595. * @returns A string representing the provided HeadingPitchRoll in the format '(heading, pitch, roll)'.
  7596. */
  7597. toString(): string;
  7598. }
  7599. /**
  7600. * The encoding that is used for a heightmap
  7601. */
  7602. export enum HeightmapEncoding {
  7603. /**
  7604. * No encoding
  7605. */
  7606. NONE = 0,
  7607. /**
  7608. * LERC encoding
  7609. */
  7610. LERC = 1
  7611. }
  7612. /**
  7613. * Terrain data for a single tile where the terrain data is represented as a heightmap. A heightmap
  7614. is a rectangular array of heights in row-major order from north to south and west to east.
  7615. * @example
  7616. * var buffer = ...
  7617. var heightBuffer = new Uint16Array(buffer, 0, that._heightmapWidth * that._heightmapWidth);
  7618. var childTileMask = new Uint8Array(buffer, heightBuffer.byteLength, 1)[0];
  7619. var waterMask = new Uint8Array(buffer, heightBuffer.byteLength + 1, buffer.byteLength - heightBuffer.byteLength - 1);
  7620. var terrainData = new Cesium.HeightmapTerrainData({
  7621. buffer : heightBuffer,
  7622. width : 65,
  7623. height : 65,
  7624. childTileMask : childTileMask,
  7625. waterMask : waterMask
  7626. });
  7627. * @param options - Object with the following properties:
  7628. * @param options.buffer - The buffer containing height data.
  7629. * @param options.width - The width (longitude direction) of the heightmap, in samples.
  7630. * @param options.height - The height (latitude direction) of the heightmap, in samples.
  7631. * @param [options.childTileMask = 15] - A bit mask indicating which of this tile's four children exist.
  7632. If a child's bit is set, geometry will be requested for that tile as well when it
  7633. is needed. If the bit is cleared, the child tile is not requested and geometry is
  7634. instead upsampled from the parent. The bit values are as follows:
  7635. <table>
  7636. <tr><th>Bit Position</th><th>Bit Value</th><th>Child Tile</th></tr>
  7637. <tr><td>0</td><td>1</td><td>Southwest</td></tr>
  7638. <tr><td>1</td><td>2</td><td>Southeast</td></tr>
  7639. <tr><td>2</td><td>4</td><td>Northwest</td></tr>
  7640. <tr><td>3</td><td>8</td><td>Northeast</td></tr>
  7641. </table>
  7642. * @param [options.waterMask] - The water mask included in this terrain data, if any. A water mask is a square
  7643. Uint8Array or image where a value of 255 indicates water and a value of 0 indicates land.
  7644. Values in between 0 and 255 are allowed as well to smoothly blend between land and water.
  7645. * @param [options.structure] - An object describing the structure of the height data.
  7646. * @param [options.structure.heightScale = 1.0] - The factor by which to multiply height samples in order to obtain
  7647. the height above the heightOffset, in meters. The heightOffset is added to the resulting
  7648. height after multiplying by the scale.
  7649. * @param [options.structure.heightOffset = 0.0] - The offset to add to the scaled height to obtain the final
  7650. height in meters. The offset is added after the height sample is multiplied by the
  7651. heightScale.
  7652. * @param [options.structure.elementsPerHeight = 1] - The number of elements in the buffer that make up a single height
  7653. sample. This is usually 1, indicating that each element is a separate height sample. If
  7654. it is greater than 1, that number of elements together form the height sample, which is
  7655. computed according to the structure.elementMultiplier and structure.isBigEndian properties.
  7656. * @param [options.structure.stride = 1] - The number of elements to skip to get from the first element of
  7657. one height to the first element of the next height.
  7658. * @param [options.structure.elementMultiplier = 256.0] - The multiplier used to compute the height value when the
  7659. stride property is greater than 1. For example, if the stride is 4 and the strideMultiplier
  7660. is 256, the height is computed as follows:
  7661. `height = buffer[index] + buffer[index + 1] * 256 + buffer[index + 2] * 256 * 256 + buffer[index + 3] * 256 * 256 * 256`
  7662. This is assuming that the isBigEndian property is false. If it is true, the order of the
  7663. elements is reversed.
  7664. * @param [options.structure.isBigEndian = false] - Indicates endianness of the elements in the buffer when the
  7665. stride property is greater than 1. If this property is false, the first element is the
  7666. low-order element. If it is true, the first element is the high-order element.
  7667. * @param [options.structure.lowestEncodedHeight] - The lowest value that can be stored in the height buffer. Any heights that are lower
  7668. than this value after encoding with the `heightScale` and `heightOffset` are clamped to this value. For example, if the height
  7669. buffer is a `Uint16Array`, this value should be 0 because a `Uint16Array` cannot store negative numbers. If this parameter is
  7670. not specified, no minimum value is enforced.
  7671. * @param [options.structure.highestEncodedHeight] - The highest value that can be stored in the height buffer. Any heights that are higher
  7672. than this value after encoding with the `heightScale` and `heightOffset` are clamped to this value. For example, if the height
  7673. buffer is a `Uint16Array`, this value should be `256 * 256 - 1` or 65535 because a `Uint16Array` cannot store numbers larger
  7674. than 65535. If this parameter is not specified, no maximum value is enforced.
  7675. * @param [options.encoding = HeightmapEncoding.NONE] - The encoding that is used on the buffer.
  7676. * @param [options.createdByUpsampling = false] - True if this instance was created by upsampling another instance;
  7677. otherwise, false.
  7678. */
  7679. export class HeightmapTerrainData {
  7680. constructor(options: {
  7681. buffer: Int8Array | Uint8Array | Int16Array | Uint16Array | Int32Array | Uint32Array | Float32Array | Float64Array;
  7682. width: number;
  7683. height: number;
  7684. childTileMask?: number;
  7685. waterMask?: Uint8Array;
  7686. structure?: {
  7687. heightScale?: number;
  7688. heightOffset?: number;
  7689. elementsPerHeight?: number;
  7690. stride?: number;
  7691. elementMultiplier?: number;
  7692. isBigEndian?: boolean;
  7693. lowestEncodedHeight?: number;
  7694. highestEncodedHeight?: number;
  7695. };
  7696. encoding?: HeightmapEncoding;
  7697. createdByUpsampling?: boolean;
  7698. });
  7699. /**
  7700. * An array of credits for this tile.
  7701. */
  7702. credits: Credit[];
  7703. /**
  7704. * The water mask included in this terrain data, if any. A water mask is a square
  7705. Uint8Array or image where a value of 255 indicates water and a value of 0 indicates land.
  7706. Values in between 0 and 255 are allowed as well to smoothly blend between land and water.
  7707. */
  7708. waterMask: Uint8Array | HTMLImageElement | HTMLCanvasElement;
  7709. /**
  7710. * Computes the terrain height at a specified longitude and latitude.
  7711. * @param rectangle - The rectangle covered by this terrain data.
  7712. * @param longitude - The longitude in radians.
  7713. * @param latitude - The latitude in radians.
  7714. * @returns The terrain height at the specified position. If the position
  7715. is outside the rectangle, this method will extrapolate the height, which is likely to be wildly
  7716. incorrect for positions far outside the rectangle.
  7717. */
  7718. interpolateHeight(rectangle: Rectangle, longitude: number, latitude: number): number;
  7719. /**
  7720. * Upsamples this terrain data for use by a descendant tile. The resulting instance will contain a subset of the
  7721. height samples in this instance, interpolated if necessary.
  7722. * @param tilingScheme - The tiling scheme of this terrain data.
  7723. * @param thisX - The X coordinate of this tile in the tiling scheme.
  7724. * @param thisY - The Y coordinate of this tile in the tiling scheme.
  7725. * @param thisLevel - The level of this tile in the tiling scheme.
  7726. * @param descendantX - The X coordinate within the tiling scheme of the descendant tile for which we are upsampling.
  7727. * @param descendantY - The Y coordinate within the tiling scheme of the descendant tile for which we are upsampling.
  7728. * @param descendantLevel - The level within the tiling scheme of the descendant tile for which we are upsampling.
  7729. * @returns A promise for upsampled heightmap terrain data for the descendant tile,
  7730. or undefined if too many asynchronous upsample operations are in progress and the request has been
  7731. deferred.
  7732. */
  7733. upsample(tilingScheme: TilingScheme, thisX: number, thisY: number, thisLevel: number, descendantX: number, descendantY: number, descendantLevel: number): Promise<HeightmapTerrainData> | undefined;
  7734. /**
  7735. * Determines if a given child tile is available, based on the
  7736. {@link HeightmapTerrainData.childTileMask}. The given child tile coordinates are assumed
  7737. to be one of the four children of this tile. If non-child tile coordinates are
  7738. given, the availability of the southeast child tile is returned.
  7739. * @param thisX - The tile X coordinate of this (the parent) tile.
  7740. * @param thisY - The tile Y coordinate of this (the parent) tile.
  7741. * @param childX - The tile X coordinate of the child tile to check for availability.
  7742. * @param childY - The tile Y coordinate of the child tile to check for availability.
  7743. * @returns True if the child tile is available; otherwise, false.
  7744. */
  7745. isChildAvailable(thisX: number, thisY: number, childX: number, childY: number): boolean;
  7746. /**
  7747. * Gets a value indicating whether or not this terrain data was created by upsampling lower resolution
  7748. terrain data. If this value is false, the data was obtained from some other source, such
  7749. as by downloading it from a remote server. This method should return true for instances
  7750. returned from a call to {@link HeightmapTerrainData#upsample}.
  7751. * @returns True if this instance was created by upsampling; otherwise, false.
  7752. */
  7753. wasCreatedByUpsampling(): boolean;
  7754. }
  7755. /**
  7756. * An {@link InterpolationAlgorithm} for performing Hermite interpolation.
  7757. */
  7758. export namespace HermitePolynomialApproximation {
  7759. /**
  7760. * Given the desired degree, returns the number of data points required for interpolation.
  7761. * @param degree - The desired degree of interpolation.
  7762. * @param [inputOrder = 0] - The order of the inputs (0 means just the data, 1 means the data and its derivative, etc).
  7763. * @returns The number of required data points needed for the desired degree of interpolation.
  7764. */
  7765. function getRequiredDataPoints(degree: number, inputOrder?: number): number;
  7766. /**
  7767. * Interpolates values using Hermite Polynomial Approximation.
  7768. * @param x - The independent variable for which the dependent variables will be interpolated.
  7769. * @param xTable - The array of independent variables to use to interpolate. The values
  7770. in this array must be in increasing order and the same value must not occur twice in the array.
  7771. * @param yTable - The array of dependent variables to use to interpolate. For a set of three
  7772. dependent values (p,q,w) at time 1 and time 2 this should be as follows: {p1, q1, w1, p2, q2, w2}.
  7773. * @param yStride - The number of dependent variable values in yTable corresponding to
  7774. each independent variable value in xTable.
  7775. * @param [result] - An existing array into which to store the result.
  7776. * @returns The array of interpolated values, or the result parameter if one was provided.
  7777. */
  7778. function interpolateOrderZero(x: number, xTable: number[], yTable: number[], yStride: number, result?: number[]): number[];
  7779. /**
  7780. * Interpolates values using Hermite Polynomial Approximation.
  7781. * @param x - The independent variable for which the dependent variables will be interpolated.
  7782. * @param xTable - The array of independent variables to use to interpolate. The values
  7783. in this array must be in increasing order and the same value must not occur twice in the array.
  7784. * @param yTable - The array of dependent variables to use to interpolate. For a set of three
  7785. dependent values (p,q,w) at time 1 and time 2 this should be as follows: {p1, q1, w1, p2, q2, w2}.
  7786. * @param yStride - The number of dependent variable values in yTable corresponding to
  7787. each independent variable value in xTable.
  7788. * @param inputOrder - The number of derivatives supplied for input.
  7789. * @param outputOrder - The number of derivatives desired for output.
  7790. * @param [result] - An existing array into which to store the result.
  7791. * @returns The array of interpolated values, or the result parameter if one was provided.
  7792. */
  7793. function interpolate(x: number, xTable: number[], yTable: number[], yStride: number, inputOrder: number, outputOrder: number, result?: number[]): number[];
  7794. }
  7795. /**
  7796. * A Hermite spline is a cubic interpolating spline. Points, incoming tangents, outgoing tangents, and times
  7797. must be defined for each control point. The outgoing tangents are defined for points [0, n - 2] and the incoming
  7798. tangents are defined for points [1, n - 1]. For example, when interpolating a segment of the curve between <code>points[i]</code> and
  7799. <code>points[i + 1]</code>, the tangents at the points will be <code>outTangents[i]</code> and <code>inTangents[i]</code>,
  7800. respectively.
  7801. * @example
  7802. * // Create a G<sup>1</sup> continuous Hermite spline
  7803. var times = [ 0.0, 1.5, 3.0, 4.5, 6.0 ];
  7804. var spline = new Cesium.HermiteSpline({
  7805. times : times,
  7806. points : [
  7807. new Cesium.Cartesian3(1235398.0, -4810983.0, 4146266.0),
  7808. new Cesium.Cartesian3(1372574.0, -5345182.0, 4606657.0),
  7809. new Cesium.Cartesian3(-757983.0, -5542796.0, 4514323.0),
  7810. new Cesium.Cartesian3(-2821260.0, -5248423.0, 4021290.0),
  7811. new Cesium.Cartesian3(-2539788.0, -4724797.0, 3620093.0)
  7812. ],
  7813. outTangents : [
  7814. new Cesium.Cartesian3(1125196, -161816, 270551),
  7815. new Cesium.Cartesian3(-996690.5, -365906.5, 184028.5),
  7816. new Cesium.Cartesian3(-2096917, 48379.5, -292683.5),
  7817. new Cesium.Cartesian3(-890902.5, 408999.5, -447115)
  7818. ],
  7819. inTangents : [
  7820. new Cesium.Cartesian3(-1993381, -731813, 368057),
  7821. new Cesium.Cartesian3(-4193834, 96759, -585367),
  7822. new Cesium.Cartesian3(-1781805, 817999, -894230),
  7823. new Cesium.Cartesian3(1165345, 112641, 47281)
  7824. ]
  7825. });
  7826. var p0 = spline.evaluate(times[0]);
  7827. * @param options - Object with the following properties:
  7828. * @param options.times - An array of strictly increasing, unit-less, floating-point times at each point.
  7829. The values are in no way connected to the clock time. They are the parameterization for the curve.
  7830. * @param options.points - The array of {@link Cartesian3} control points.
  7831. * @param options.inTangents - The array of {@link Cartesian3} incoming tangents at each control point.
  7832. * @param options.outTangents - The array of {@link Cartesian3} outgoing tangents at each control point.
  7833. */
  7834. export class HermiteSpline {
  7835. constructor(options: {
  7836. times: number[];
  7837. points: Cartesian3[];
  7838. inTangents: Cartesian3[];
  7839. outTangents: Cartesian3[];
  7840. });
  7841. /**
  7842. * An array of times for the control points.
  7843. */
  7844. readonly times: number[];
  7845. /**
  7846. * An array of {@link Cartesian3} control points.
  7847. */
  7848. readonly points: Cartesian3[];
  7849. /**
  7850. * An array of {@link Cartesian3} incoming tangents at each control point.
  7851. */
  7852. readonly inTangents: Cartesian3[];
  7853. /**
  7854. * An array of {@link Cartesian3} outgoing tangents at each control point.
  7855. */
  7856. readonly outTangents: Cartesian3[];
  7857. /**
  7858. * Creates a spline where the tangents at each control point are the same.
  7859. The curves are guaranteed to be at least in the class C<sup>1</sup>.
  7860. * @example
  7861. * var points = [
  7862. new Cesium.Cartesian3(1235398.0, -4810983.0, 4146266.0),
  7863. new Cesium.Cartesian3(1372574.0, -5345182.0, 4606657.0),
  7864. new Cesium.Cartesian3(-757983.0, -5542796.0, 4514323.0),
  7865. new Cesium.Cartesian3(-2821260.0, -5248423.0, 4021290.0),
  7866. new Cesium.Cartesian3(-2539788.0, -4724797.0, 3620093.0)
  7867. ];
  7868. // Add tangents
  7869. var tangents = new Array(points.length);
  7870. tangents[0] = new Cesium.Cartesian3(1125196, -161816, 270551);
  7871. var temp = new Cesium.Cartesian3();
  7872. for (var i = 1; i < tangents.length - 1; ++i) {
  7873. tangents[i] = Cesium.Cartesian3.multiplyByScalar(Cesium.Cartesian3.subtract(points[i + 1], points[i - 1], temp), 0.5, new Cesium.Cartesian3());
  7874. }
  7875. tangents[tangents.length - 1] = new Cesium.Cartesian3(1165345, 112641, 47281);
  7876. var spline = Cesium.HermiteSpline.createC1({
  7877. times : times,
  7878. points : points,
  7879. tangents : tangents
  7880. });
  7881. * @param options - Object with the following properties:
  7882. * @param options.times - The array of control point times.
  7883. * @param options.points - The array of control points.
  7884. * @param options.tangents - The array of tangents at the control points.
  7885. * @returns A hermite spline.
  7886. */
  7887. static createC1(options: {
  7888. times: number[];
  7889. points: Cartesian3[];
  7890. tangents: Cartesian3[];
  7891. }): HermiteSpline;
  7892. /**
  7893. * Creates a natural cubic spline. The tangents at the control points are generated
  7894. to create a curve in the class C<sup>2</sup>.
  7895. * @example
  7896. * // Create a natural cubic spline above the earth from Philadelphia to Los Angeles.
  7897. var spline = Cesium.HermiteSpline.createNaturalCubic({
  7898. times : [ 0.0, 1.5, 3.0, 4.5, 6.0 ],
  7899. points : [
  7900. new Cesium.Cartesian3(1235398.0, -4810983.0, 4146266.0),
  7901. new Cesium.Cartesian3(1372574.0, -5345182.0, 4606657.0),
  7902. new Cesium.Cartesian3(-757983.0, -5542796.0, 4514323.0),
  7903. new Cesium.Cartesian3(-2821260.0, -5248423.0, 4021290.0),
  7904. new Cesium.Cartesian3(-2539788.0, -4724797.0, 3620093.0)
  7905. ]
  7906. });
  7907. * @param options - Object with the following properties:
  7908. * @param options.times - The array of control point times.
  7909. * @param options.points - The array of control points.
  7910. * @returns A hermite spline or a linear spline if less than 3 control points were given.
  7911. */
  7912. static createNaturalCubic(options: {
  7913. times: number[];
  7914. points: Cartesian3[];
  7915. }): HermiteSpline | LinearSpline;
  7916. /**
  7917. * Creates a clamped cubic spline. The tangents at the interior control points are generated
  7918. to create a curve in the class C<sup>2</sup>.
  7919. * @example
  7920. * // Create a clamped cubic spline above the earth from Philadelphia to Los Angeles.
  7921. var spline = Cesium.HermiteSpline.createClampedCubic({
  7922. times : [ 0.0, 1.5, 3.0, 4.5, 6.0 ],
  7923. points : [
  7924. new Cesium.Cartesian3(1235398.0, -4810983.0, 4146266.0),
  7925. new Cesium.Cartesian3(1372574.0, -5345182.0, 4606657.0),
  7926. new Cesium.Cartesian3(-757983.0, -5542796.0, 4514323.0),
  7927. new Cesium.Cartesian3(-2821260.0, -5248423.0, 4021290.0),
  7928. new Cesium.Cartesian3(-2539788.0, -4724797.0, 3620093.0)
  7929. ],
  7930. firstTangent : new Cesium.Cartesian3(1125196, -161816, 270551),
  7931. lastTangent : new Cesium.Cartesian3(1165345, 112641, 47281)
  7932. });
  7933. * @param options - Object with the following properties:
  7934. * @param options.times - The array of control point times.
  7935. * @param options.points - The array of control points.
  7936. * @param options.firstTangent - The outgoing tangent of the first control point.
  7937. * @param options.lastTangent - The incoming tangent of the last control point.
  7938. * @returns A hermite spline or a linear spline if less than 3 control points were given.
  7939. */
  7940. static createClampedCubic(options: {
  7941. times: number[];
  7942. points: Cartesian3[];
  7943. firstTangent: Cartesian3;
  7944. lastTangent: Cartesian3;
  7945. }): HermiteSpline | LinearSpline;
  7946. /**
  7947. * Finds an index <code>i</code> in <code>times</code> such that the parameter
  7948. <code>time</code> is in the interval <code>[times[i], times[i + 1]]</code>.
  7949. * @param time - The time.
  7950. * @returns The index for the element at the start of the interval.
  7951. */
  7952. findTimeInterval(time: number): number;
  7953. /**
  7954. * Wraps the given time to the period covered by the spline.
  7955. * @param time - The time.
  7956. * @returns The time, wrapped around to the updated animation.
  7957. */
  7958. wrapTime(time: number): number;
  7959. /**
  7960. * Clamps the given time to the period covered by the spline.
  7961. * @param time - The time.
  7962. * @returns The time, clamped to the animation period.
  7963. */
  7964. clampTime(time: number): number;
  7965. /**
  7966. * Evaluates the curve at a given time.
  7967. * @param time - The time at which to evaluate the curve.
  7968. * @param [result] - The object onto which to store the result.
  7969. * @returns The modified result parameter or a new instance of the point on the curve at the given time.
  7970. */
  7971. evaluate(time: number, result?: Cartesian3): Cartesian3;
  7972. }
  7973. /**
  7974. * Constants for WebGL index datatypes. These corresponds to the
  7975. <code>type</code> parameter of {@link http://www.khronos.org/opengles/sdk/docs/man/xhtml/glDrawElements.xml|drawElements}.
  7976. */
  7977. export enum IndexDatatype {
  7978. /**
  7979. * 8-bit unsigned byte corresponding to <code>UNSIGNED_BYTE</code> and the type
  7980. of an element in <code>Uint8Array</code>.
  7981. */
  7982. UNSIGNED_BYTE = WebGLConstants.UNSIGNED_BYTE,
  7983. /**
  7984. * 16-bit unsigned short corresponding to <code>UNSIGNED_SHORT</code> and the type
  7985. of an element in <code>Uint16Array</code>.
  7986. */
  7987. UNSIGNED_SHORT = WebGLConstants.UNSIGNED_SHORT,
  7988. /**
  7989. * 32-bit unsigned int corresponding to <code>UNSIGNED_INT</code> and the type
  7990. of an element in <code>Uint32Array</code>.
  7991. */
  7992. UNSIGNED_INT = WebGLConstants.UNSIGNED_INT
  7993. }
  7994. export namespace InterpolationAlgorithm {
  7995. /**
  7996. * Gets the name of this interpolation algorithm.
  7997. */
  7998. var type: string;
  7999. /**
  8000. * Given the desired degree, returns the number of data points required for interpolation.
  8001. * @param degree - The desired degree of interpolation.
  8002. * @returns The number of required data points needed for the desired degree of interpolation.
  8003. */
  8004. function getRequiredDataPoints(degree: number): number;
  8005. /**
  8006. * Performs zero order interpolation.
  8007. * @param x - The independent variable for which the dependent variables will be interpolated.
  8008. * @param xTable - The array of independent variables to use to interpolate. The values
  8009. in this array must be in increasing order and the same value must not occur twice in the array.
  8010. * @param yTable - The array of dependent variables to use to interpolate. For a set of three
  8011. dependent values (p,q,w) at time 1 and time 2 this should be as follows: {p1, q1, w1, p2, q2, w2}.
  8012. * @param yStride - The number of dependent variable values in yTable corresponding to
  8013. each independent variable value in xTable.
  8014. * @param [result] - An existing array into which to store the result.
  8015. * @returns The array of interpolated values, or the result parameter if one was provided.
  8016. */
  8017. function interpolateOrderZero(x: number, xTable: number[], yTable: number[], yStride: number, result?: number[]): number[];
  8018. /**
  8019. * Performs higher order interpolation. Not all interpolators need to support high-order interpolation,
  8020. if this function remains undefined on implementing objects, interpolateOrderZero will be used instead.
  8021. * @param x - The independent variable for which the dependent variables will be interpolated.
  8022. * @param xTable - The array of independent variables to use to interpolate. The values
  8023. in this array must be in increasing order and the same value must not occur twice in the array.
  8024. * @param yTable - The array of dependent variables to use to interpolate. For a set of three
  8025. dependent values (p,q,w) at time 1 and time 2 this should be as follows: {p1, q1, w1, p2, q2, w2}.
  8026. * @param yStride - The number of dependent variable values in yTable corresponding to
  8027. each independent variable value in xTable.
  8028. * @param inputOrder - The number of derivatives supplied for input.
  8029. * @param outputOrder - The number of derivatives desired for output.
  8030. * @param [result] - An existing array into which to store the result.
  8031. * @returns The array of interpolated values, or the result parameter if one was provided.
  8032. */
  8033. function interpolate(x: number, xTable: number[], yTable: number[], yStride: number, inputOrder: number, outputOrder: number, result?: number[]): number[];
  8034. }
  8035. /**
  8036. * The interface for interpolation algorithms.
  8037. */
  8038. export interface InterpolationAlgorithm {
  8039. }
  8040. /**
  8041. * This enumerated type is used in determining where, relative to the frustum, an
  8042. object is located. The object can either be fully contained within the frustum (INSIDE),
  8043. partially inside the frustum and partially outside (INTERSECTING), or somewhere entirely
  8044. outside of the frustum's 6 planes (OUTSIDE).
  8045. */
  8046. export enum Intersect {
  8047. /**
  8048. * Represents that an object is not contained within the frustum.
  8049. */
  8050. OUTSIDE = -1,
  8051. /**
  8052. * Represents that an object intersects one of the frustum's planes.
  8053. */
  8054. INTERSECTING = 0,
  8055. /**
  8056. * Represents that an object is fully within the frustum.
  8057. */
  8058. INSIDE = 1
  8059. }
  8060. /**
  8061. * Contains functions for operating on 2D triangles.
  8062. */
  8063. export namespace Intersections2D {
  8064. /**
  8065. * Splits a 2D triangle at given axis-aligned threshold value and returns the resulting
  8066. polygon on a given side of the threshold. The resulting polygon may have 0, 1, 2,
  8067. 3, or 4 vertices.
  8068. * @example
  8069. * var result = Cesium.Intersections2D.clipTriangleAtAxisAlignedThreshold(0.5, false, 0.2, 0.6, 0.4);
  8070. // result === [2, 0, -1, 1, 0, 0.25, -1, 1, 2, 0.5]
  8071. * @param threshold - The threshold coordinate value at which to clip the triangle.
  8072. * @param keepAbove - true to keep the portion of the triangle above the threshold, or false
  8073. to keep the portion below.
  8074. * @param u0 - The coordinate of the first vertex in the triangle, in counter-clockwise order.
  8075. * @param u1 - The coordinate of the second vertex in the triangle, in counter-clockwise order.
  8076. * @param u2 - The coordinate of the third vertex in the triangle, in counter-clockwise order.
  8077. * @param [result] - The array into which to copy the result. If this parameter is not supplied,
  8078. a new array is constructed and returned.
  8079. * @returns The polygon that results after the clip, specified as a list of
  8080. vertices. The vertices are specified in counter-clockwise order.
  8081. Each vertex is either an index from the existing list (identified as
  8082. a 0, 1, or 2) or -1 indicating a new vertex not in the original triangle.
  8083. For new vertices, the -1 is followed by three additional numbers: the
  8084. index of each of the two original vertices forming the line segment that
  8085. the new vertex lies on, and the fraction of the distance from the first
  8086. vertex to the second one.
  8087. */
  8088. function clipTriangleAtAxisAlignedThreshold(threshold: number, keepAbove: boolean, u0: number, u1: number, u2: number, result?: number[]): number[];
  8089. /**
  8090. * Compute the barycentric coordinates of a 2D position within a 2D triangle.
  8091. * @example
  8092. * var result = Cesium.Intersections2D.computeBarycentricCoordinates(0.0, 0.0, 0.0, 1.0, -1, -0.5, 1, -0.5);
  8093. // result === new Cesium.Cartesian3(1.0 / 3.0, 1.0 / 3.0, 1.0 / 3.0);
  8094. * @param x - The x coordinate of the position for which to find the barycentric coordinates.
  8095. * @param y - The y coordinate of the position for which to find the barycentric coordinates.
  8096. * @param x1 - The x coordinate of the triangle's first vertex.
  8097. * @param y1 - The y coordinate of the triangle's first vertex.
  8098. * @param x2 - The x coordinate of the triangle's second vertex.
  8099. * @param y2 - The y coordinate of the triangle's second vertex.
  8100. * @param x3 - The x coordinate of the triangle's third vertex.
  8101. * @param y3 - The y coordinate of the triangle's third vertex.
  8102. * @param [result] - The instance into to which to copy the result. If this parameter
  8103. is undefined, a new instance is created and returned.
  8104. * @returns The barycentric coordinates of the position within the triangle.
  8105. */
  8106. function computeBarycentricCoordinates(x: number, y: number, x1: number, y1: number, x2: number, y2: number, x3: number, y3: number, result?: Cartesian3): Cartesian3;
  8107. /**
  8108. * Compute the intersection between 2 line segments
  8109. * @example
  8110. * var result = Cesium.Intersections2D.computeLineSegmentLineSegmentIntersection(0.0, 0.0, 0.0, 2.0, -1, 1, 1, 1);
  8111. // result === new Cesium.Cartesian2(0.0, 1.0);
  8112. * @param x00 - The x coordinate of the first line's first vertex.
  8113. * @param y00 - The y coordinate of the first line's first vertex.
  8114. * @param x01 - The x coordinate of the first line's second vertex.
  8115. * @param y01 - The y coordinate of the first line's second vertex.
  8116. * @param x10 - The x coordinate of the second line's first vertex.
  8117. * @param y10 - The y coordinate of the second line's first vertex.
  8118. * @param x11 - The x coordinate of the second line's second vertex.
  8119. * @param y11 - The y coordinate of the second line's second vertex.
  8120. * @param [result] - The instance into to which to copy the result. If this parameter
  8121. is undefined, a new instance is created and returned.
  8122. * @returns The intersection point, undefined if there is no intersection point or lines are coincident.
  8123. */
  8124. function computeLineSegmentLineSegmentIntersection(x00: number, y00: number, x01: number, y01: number, x10: number, y10: number, x11: number, y11: number, result?: Cartesian2): Cartesian2;
  8125. }
  8126. /**
  8127. * Functions for computing the intersection between geometries such as rays, planes, triangles, and ellipsoids.
  8128. */
  8129. export namespace IntersectionTests {
  8130. /**
  8131. * Computes the intersection of a ray and a plane.
  8132. * @param ray - The ray.
  8133. * @param plane - The plane.
  8134. * @param [result] - The object onto which to store the result.
  8135. * @returns The intersection point or undefined if there is no intersections.
  8136. */
  8137. function rayPlane(ray: Ray, plane: Plane, result?: Cartesian3): Cartesian3;
  8138. /**
  8139. * 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.
  8140. Implements {@link https://cadxfem.org/inf/Fast%20MinimumStorage%20RayTriangle%20Intersection.pdf|
  8141. Fast Minimum Storage Ray/Triangle Intersection} by Tomas Moller and Ben Trumbore.
  8142. * @param ray - The ray.
  8143. * @param p0 - The first vertex of the triangle.
  8144. * @param p1 - The second vertex of the triangle.
  8145. * @param p2 - The third vertex of the triangle.
  8146. * @param [cullBackFaces = false] - If <code>true</code>, will only compute an intersection with the front face of the triangle
  8147. and return undefined for intersections with the back face.
  8148. * @returns The intersection as a parametric distance along the ray, or undefined if there is no intersection.
  8149. */
  8150. function rayTriangleParametric(ray: Ray, p0: Cartesian3, p1: Cartesian3, p2: Cartesian3, cullBackFaces?: boolean): number;
  8151. /**
  8152. * Computes the intersection of a ray and a triangle as a Cartesian3 coordinate.
  8153. Implements {@link https://cadxfem.org/inf/Fast%20MinimumStorage%20RayTriangle%20Intersection.pdf|
  8154. Fast Minimum Storage Ray/Triangle Intersection} by Tomas Moller and Ben Trumbore.
  8155. * @param ray - The ray.
  8156. * @param p0 - The first vertex of the triangle.
  8157. * @param p1 - The second vertex of the triangle.
  8158. * @param p2 - The third vertex of the triangle.
  8159. * @param [cullBackFaces = false] - If <code>true</code>, will only compute an intersection with the front face of the triangle
  8160. and return undefined for intersections with the back face.
  8161. * @param [result] - The <code>Cartesian3</code> onto which to store the result.
  8162. * @returns The intersection point or undefined if there is no intersections.
  8163. */
  8164. function rayTriangle(ray: Ray, p0: Cartesian3, p1: Cartesian3, p2: Cartesian3, cullBackFaces?: boolean, result?: Cartesian3): Cartesian3;
  8165. /**
  8166. * Computes the intersection of a line segment and a triangle.
  8167. * @param v0 - The an end point of the line segment.
  8168. * @param v1 - The other end point of the line segment.
  8169. * @param p0 - The first vertex of the triangle.
  8170. * @param p1 - The second vertex of the triangle.
  8171. * @param p2 - The third vertex of the triangle.
  8172. * @param [cullBackFaces = false] - If <code>true</code>, will only compute an intersection with the front face of the triangle
  8173. and return undefined for intersections with the back face.
  8174. * @param [result] - The <code>Cartesian3</code> onto which to store the result.
  8175. * @returns The intersection point or undefined if there is no intersections.
  8176. */
  8177. function lineSegmentTriangle(v0: Cartesian3, v1: Cartesian3, p0: Cartesian3, p1: Cartesian3, p2: Cartesian3, cullBackFaces?: boolean, result?: Cartesian3): Cartesian3;
  8178. /**
  8179. * Computes the intersection points of a ray with a sphere.
  8180. * @param ray - The ray.
  8181. * @param sphere - The sphere.
  8182. * @param [result] - The result onto which to store the result.
  8183. * @returns The interval containing scalar points along the ray or undefined if there are no intersections.
  8184. */
  8185. function raySphere(ray: Ray, sphere: BoundingSphere, result?: Interval): Interval;
  8186. /**
  8187. * Computes the intersection points of a line segment with a sphere.
  8188. * @param p0 - An end point of the line segment.
  8189. * @param p1 - The other end point of the line segment.
  8190. * @param sphere - The sphere.
  8191. * @param [result] - The result onto which to store the result.
  8192. * @returns The interval containing scalar points along the ray or undefined if there are no intersections.
  8193. */
  8194. function lineSegmentSphere(p0: Cartesian3, p1: Cartesian3, sphere: BoundingSphere, result?: Interval): Interval;
  8195. /**
  8196. * Computes the intersection points of a ray with an ellipsoid.
  8197. * @param ray - The ray.
  8198. * @param ellipsoid - The ellipsoid.
  8199. * @returns The interval containing scalar points along the ray or undefined if there are no intersections.
  8200. */
  8201. function rayEllipsoid(ray: Ray, ellipsoid: Ellipsoid): Interval;
  8202. /**
  8203. * Provides the point along the ray which is nearest to the ellipsoid.
  8204. * @param ray - The ray.
  8205. * @param ellipsoid - The ellipsoid.
  8206. * @returns The nearest planetodetic point on the ray.
  8207. */
  8208. function grazingAltitudeLocation(ray: Ray, ellipsoid: Ellipsoid): Cartesian3;
  8209. /**
  8210. * Computes the intersection of a line segment and a plane.
  8211. * @example
  8212. * var origin = Cesium.Cartesian3.fromDegrees(-75.59777, 40.03883);
  8213. var normal = ellipsoid.geodeticSurfaceNormal(origin);
  8214. var plane = Cesium.Plane.fromPointNormal(origin, normal);
  8215. var p0 = new Cesium.Cartesian3(...);
  8216. var p1 = new Cesium.Cartesian3(...);
  8217. // find the intersection of the line segment from p0 to p1 and the tangent plane at origin.
  8218. var intersection = Cesium.IntersectionTests.lineSegmentPlane(p0, p1, plane);
  8219. * @param endPoint0 - An end point of the line segment.
  8220. * @param endPoint1 - The other end point of the line segment.
  8221. * @param plane - The plane.
  8222. * @param [result] - The object onto which to store the result.
  8223. * @returns The intersection point or undefined if there is no intersection.
  8224. */
  8225. function lineSegmentPlane(endPoint0: Cartesian3, endPoint1: Cartesian3, plane: Plane, result?: Cartesian3): Cartesian3;
  8226. /**
  8227. * Computes the intersection of a triangle and a plane
  8228. * @example
  8229. * var origin = Cesium.Cartesian3.fromDegrees(-75.59777, 40.03883);
  8230. var normal = ellipsoid.geodeticSurfaceNormal(origin);
  8231. var plane = Cesium.Plane.fromPointNormal(origin, normal);
  8232. var p0 = new Cesium.Cartesian3(...);
  8233. var p1 = new Cesium.Cartesian3(...);
  8234. var p2 = new Cesium.Cartesian3(...);
  8235. // convert the triangle composed of points (p0, p1, p2) to three triangles that don't cross the plane
  8236. var triangles = Cesium.IntersectionTests.trianglePlaneIntersection(p0, p1, p2, plane);
  8237. * @param p0 - First point of the triangle
  8238. * @param p1 - Second point of the triangle
  8239. * @param p2 - Third point of the triangle
  8240. * @param plane - Intersection plane
  8241. * @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)
  8242. */
  8243. function trianglePlaneIntersection(p0: Cartesian3, p1: Cartesian3, p2: Cartesian3, plane: Plane): any;
  8244. }
  8245. /**
  8246. * Represents the closed interval [start, stop].
  8247. * @param [start = 0.0] - The beginning of the interval.
  8248. * @param [stop = 0.0] - The end of the interval.
  8249. */
  8250. export class Interval {
  8251. constructor(start?: number, stop?: number);
  8252. /**
  8253. * The beginning of the interval.
  8254. */
  8255. start: number;
  8256. /**
  8257. * The end of the interval.
  8258. */
  8259. stop: number;
  8260. }
  8261. /**
  8262. * Default settings for accessing the Cesium ion API.
  8263. An ion access token is only required if you are using any ion related APIs.
  8264. A default access token is provided for evaluation purposes only.
  8265. Sign up for a free ion account and get your own access token at {@link https://cesium.com}
  8266. */
  8267. export namespace Ion {
  8268. /**
  8269. * Gets or sets the default Cesium ion access token.
  8270. */
  8271. var defaultAccessToken: string;
  8272. /**
  8273. * Gets or sets the default Cesium ion server.
  8274. */
  8275. var defaultServer: string | Resource;
  8276. }
  8277. /**
  8278. * Provides geocoding through Cesium ion.
  8279. * @param options - Object with the following properties:
  8280. * @param options.scene - The scene
  8281. * @param [options.accessToken = Ion.defaultAccessToken] - The access token to use.
  8282. * @param [options.server = Ion.defaultServer] - The resource to the Cesium ion API server.
  8283. */
  8284. export class IonGeocoderService {
  8285. constructor(options: {
  8286. scene: Scene;
  8287. accessToken?: string;
  8288. server?: string | Resource;
  8289. });
  8290. /**
  8291. * @param query - The query to be sent to the geocoder service
  8292. * @param [type = GeocodeType.SEARCH] - The type of geocode to perform.
  8293. */
  8294. geocode(query: string, type?: GeocodeType): Promise<GeocoderService.Result[]>;
  8295. }
  8296. /**
  8297. * A {@link Resource} instance that encapsulates Cesium ion asset access.
  8298. This object is normally not instantiated directly, use {@link IonResource.fromAssetId}.
  8299. * @param endpoint - The result of the Cesium ion asset endpoint service.
  8300. * @param endpointResource - The resource used to retreive the endpoint.
  8301. */
  8302. export class IonResource extends Resource {
  8303. constructor(endpoint: any, endpointResource: Resource);
  8304. /**
  8305. * Asynchronously creates an instance.
  8306. * @example
  8307. * //Load a Cesium3DTileset with asset ID of 124624234
  8308. viewer.scene.primitives.add(new Cesium.Cesium3DTileset({ url: Cesium.IonResource.fromAssetId(124624234) }));
  8309. * @example
  8310. * //Load a CZML file with asset ID of 10890
  8311. Cesium.IonResource.fromAssetId(10890)
  8312. .then(function (resource) {
  8313. viewer.dataSources.add(Cesium.CzmlDataSource.load(resource));
  8314. });
  8315. * @param assetId - The Cesium ion asset id.
  8316. * @param [options] - An object with the following properties:
  8317. * @param [options.accessToken = Ion.defaultAccessToken] - The access token to use.
  8318. * @param [options.server = Ion.defaultServer] - The resource to the Cesium ion API server.
  8319. * @returns A Promise to am instance representing the Cesium ion Asset.
  8320. */
  8321. static fromAssetId(assetId: number, options?: {
  8322. accessToken?: string;
  8323. server?: string | Resource;
  8324. }): Promise<IonResource>;
  8325. /**
  8326. * Gets the credits required for attribution of the asset.
  8327. */
  8328. readonly credits: Credit[];
  8329. /**
  8330. * Duplicates a Resource instance.
  8331. * @param [result] - The object onto which to store the result.
  8332. * @returns The modified result parameter or a new Resource instance if one was not provided.
  8333. */
  8334. clone(result?: Resource): Resource;
  8335. /**
  8336. * Asynchronously loads the given image resource. Returns a promise that will resolve to
  8337. 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
  8338. {@link https://developer.mozilla.org/en-US/docs/Web/API/HTMLImageElement|Image} once loaded, or reject if the image failed to load.
  8339. * @example
  8340. * // load a single image asynchronously
  8341. resource.fetchImage().then(function(image) {
  8342. // use the loaded image
  8343. }).otherwise(function(error) {
  8344. // an error occurred
  8345. });
  8346. // load several images in parallel
  8347. when.all([resource1.fetchImage(), resource2.fetchImage()]).then(function(images) {
  8348. // images is an array containing all the loaded images
  8349. });
  8350. * @param [options] - An object with the following properties.
  8351. * @param [options.preferBlob = false] - If true, we will load the image via a blob.
  8352. * @param [options.preferImageBitmap = false] - If true, image will be decoded during fetch and an <code>ImageBitmap</code> is returned.
  8353. * @param [options.flipY = false] - If true, image will be vertically flipped during decode. Only applies if the browser supports <code>createImageBitmap</code>.
  8354. * @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.
  8355. */
  8356. fetchImage(options?: {
  8357. preferBlob?: boolean;
  8358. preferImageBitmap?: boolean;
  8359. flipY?: boolean;
  8360. }): Promise<ImageBitmap> | Promise<HTMLImageElement> | undefined;
  8361. }
  8362. /**
  8363. * Determines if a given date is a leap year.
  8364. * @example
  8365. * var leapYear = Cesium.isLeapYear(2000); // true
  8366. * @param year - The year to be tested.
  8367. * @returns True if <code>year</code> is a leap year.
  8368. */
  8369. export function isLeapYear(year: number): boolean;
  8370. /**
  8371. * Constants related to ISO8601 support.
  8372. */
  8373. export namespace Iso8601 {
  8374. /**
  8375. * A {@link JulianDate} representing the earliest time representable by an ISO8601 date.
  8376. This is equivalent to the date string '0000-01-01T00:00:00Z'
  8377. */
  8378. const MINIMUM_VALUE: JulianDate;
  8379. /**
  8380. * A {@link JulianDate} representing the latest time representable by an ISO8601 date.
  8381. This is equivalent to the date string '9999-12-31T24:00:00Z'
  8382. */
  8383. const MAXIMUM_VALUE: JulianDate;
  8384. /**
  8385. * A {@link TimeInterval} representing the largest interval representable by an ISO8601 interval.
  8386. This is equivalent to the interval string '0000-01-01T00:00:00Z/9999-12-31T24:00:00Z'
  8387. */
  8388. const MAXIMUM_INTERVAL: JulianDate;
  8389. }
  8390. /**
  8391. * Represents an astronomical Julian date, which is the number of days since noon on January 1, -4712 (4713 BC).
  8392. For increased precision, this class stores the whole number part of the date and the seconds
  8393. part of the date in separate components. In order to be safe for arithmetic and represent
  8394. leap seconds, the date is always stored in the International Atomic Time standard
  8395. {@link TimeStandard.TAI}.
  8396. * @param [julianDayNumber = 0.0] - The Julian Day Number representing the number of whole days. Fractional days will also be handled correctly.
  8397. * @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.
  8398. * @param [timeStandard = TimeStandard.UTC] - The time standard in which the first two parameters are defined.
  8399. */
  8400. export class JulianDate {
  8401. constructor(julianDayNumber?: number, secondsOfDay?: number, timeStandard?: TimeStandard);
  8402. /**
  8403. * Gets or sets the number of whole days.
  8404. */
  8405. dayNumber: number;
  8406. /**
  8407. * Gets or sets the number of seconds into the current day.
  8408. */
  8409. secondsOfDay: number;
  8410. /**
  8411. * Creates a new instance from a GregorianDate.
  8412. * @param date - A GregorianDate.
  8413. * @param [result] - An existing instance to use for the result.
  8414. * @returns The modified result parameter or a new instance if none was provided.
  8415. */
  8416. static fromGregorianDate(date: GregorianDate, result?: JulianDate): JulianDate;
  8417. /**
  8418. * Creates a new instance from a JavaScript Date.
  8419. * @param date - A JavaScript Date.
  8420. * @param [result] - An existing instance to use for the result.
  8421. * @returns The modified result parameter or a new instance if none was provided.
  8422. */
  8423. static fromDate(date: Date, result?: JulianDate): JulianDate;
  8424. /**
  8425. * Creates a new instance from a from an {@link http://en.wikipedia.org/wiki/ISO_8601|ISO 8601} date.
  8426. This method is superior to <code>Date.parse</code> because it will handle all valid formats defined by the ISO 8601
  8427. specification, including leap seconds and sub-millisecond times, which discarded by most JavaScript implementations.
  8428. * @param iso8601String - An ISO 8601 date.
  8429. * @param [result] - An existing instance to use for the result.
  8430. * @returns The modified result parameter or a new instance if none was provided.
  8431. */
  8432. static fromIso8601(iso8601String: string, result?: JulianDate): JulianDate;
  8433. /**
  8434. * Creates a new instance that represents the current system time.
  8435. This is equivalent to calling <code>JulianDate.fromDate(new Date());</code>.
  8436. * @param [result] - An existing instance to use for the result.
  8437. * @returns The modified result parameter or a new instance if none was provided.
  8438. */
  8439. static now(result?: JulianDate): JulianDate;
  8440. /**
  8441. * Creates a {@link GregorianDate} from the provided instance.
  8442. * @param julianDate - The date to be converted.
  8443. * @param [result] - An existing instance to use for the result.
  8444. * @returns The modified result parameter or a new instance if none was provided.
  8445. */
  8446. static toGregorianDate(julianDate: JulianDate, result?: GregorianDate): GregorianDate;
  8447. /**
  8448. * Creates a JavaScript Date from the provided instance.
  8449. Since JavaScript dates are only accurate to the nearest millisecond and
  8450. cannot represent a leap second, consider using {@link JulianDate.toGregorianDate} instead.
  8451. If the provided JulianDate is during a leap second, the previous second is used.
  8452. * @param julianDate - The date to be converted.
  8453. * @returns A new instance representing the provided date.
  8454. */
  8455. static toDate(julianDate: JulianDate): Date;
  8456. /**
  8457. * Creates an ISO8601 representation of the provided date.
  8458. * @param julianDate - The date to be converted.
  8459. * @param [precision] - The number of fractional digits used to represent the seconds component. By default, the most precise representation is used.
  8460. * @returns The ISO8601 representation of the provided date.
  8461. */
  8462. static toIso8601(julianDate: JulianDate, precision?: number): string;
  8463. /**
  8464. * Duplicates a JulianDate instance.
  8465. * @param julianDate - The date to duplicate.
  8466. * @param [result] - An existing instance to use for the result.
  8467. * @returns The modified result parameter or a new instance if none was provided. Returns undefined if julianDate is undefined.
  8468. */
  8469. static clone(julianDate: JulianDate, result?: JulianDate): JulianDate;
  8470. /**
  8471. * Compares two instances.
  8472. * @param left - The first instance.
  8473. * @param right - The second instance.
  8474. * @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.
  8475. */
  8476. static compare(left: JulianDate, right: JulianDate): number;
  8477. /**
  8478. * Compares two instances and returns <code>true</code> if they are equal, <code>false</code> otherwise.
  8479. * @param [left] - The first instance.
  8480. * @param [right] - The second instance.
  8481. * @returns <code>true</code> if the dates are equal; otherwise, <code>false</code>.
  8482. */
  8483. static equals(left?: JulianDate, right?: JulianDate): boolean;
  8484. /**
  8485. * Compares two instances and returns <code>true</code> if they are within <code>epsilon</code> seconds of
  8486. each other. That is, in order for the dates to be considered equal (and for
  8487. this function to return <code>true</code>), the absolute value of the difference between them, in
  8488. seconds, must be less than <code>epsilon</code>.
  8489. * @param [left] - The first instance.
  8490. * @param [right] - The second instance.
  8491. * @param [epsilon = 0] - The maximum number of seconds that should separate the two instances.
  8492. * @returns <code>true</code> if the two dates are within <code>epsilon</code> seconds of each other; otherwise <code>false</code>.
  8493. */
  8494. static equalsEpsilon(left?: JulianDate, right?: JulianDate, epsilon?: number): boolean;
  8495. /**
  8496. * Computes the total number of whole and fractional days represented by the provided instance.
  8497. * @param julianDate - The date.
  8498. * @returns The Julian date as single floating point number.
  8499. */
  8500. static totalDays(julianDate: JulianDate): number;
  8501. /**
  8502. * Computes the difference in seconds between the provided instance.
  8503. * @param left - The first instance.
  8504. * @param right - The second instance.
  8505. * @returns The difference, in seconds, when subtracting <code>right</code> from <code>left</code>.
  8506. */
  8507. static secondsDifference(left: JulianDate, right: JulianDate): number;
  8508. /**
  8509. * Computes the difference in days between the provided instance.
  8510. * @param left - The first instance.
  8511. * @param right - The second instance.
  8512. * @returns The difference, in days, when subtracting <code>right</code> from <code>left</code>.
  8513. */
  8514. static daysDifference(left: JulianDate, right: JulianDate): number;
  8515. /**
  8516. * Computes the number of seconds the provided instance is ahead of UTC.
  8517. * @param julianDate - The date.
  8518. * @returns The number of seconds the provided instance is ahead of UTC
  8519. */
  8520. static computeTaiMinusUtc(julianDate: JulianDate): number;
  8521. /**
  8522. * Adds the provided number of seconds to the provided date instance.
  8523. * @param julianDate - The date.
  8524. * @param seconds - The number of seconds to add or subtract.
  8525. * @param result - An existing instance to use for the result.
  8526. * @returns The modified result parameter.
  8527. */
  8528. static addSeconds(julianDate: JulianDate, seconds: number, result: JulianDate): JulianDate;
  8529. /**
  8530. * Adds the provided number of minutes to the provided date instance.
  8531. * @param julianDate - The date.
  8532. * @param minutes - The number of minutes to add or subtract.
  8533. * @param result - An existing instance to use for the result.
  8534. * @returns The modified result parameter.
  8535. */
  8536. static addMinutes(julianDate: JulianDate, minutes: number, result: JulianDate): JulianDate;
  8537. /**
  8538. * Adds the provided number of hours to the provided date instance.
  8539. * @param julianDate - The date.
  8540. * @param hours - The number of hours to add or subtract.
  8541. * @param result - An existing instance to use for the result.
  8542. * @returns The modified result parameter.
  8543. */
  8544. static addHours(julianDate: JulianDate, hours: number, result: JulianDate): JulianDate;
  8545. /**
  8546. * Adds the provided number of days to the provided date instance.
  8547. * @param julianDate - The date.
  8548. * @param days - The number of days to add or subtract.
  8549. * @param result - An existing instance to use for the result.
  8550. * @returns The modified result parameter.
  8551. */
  8552. static addDays(julianDate: JulianDate, days: number, result: JulianDate): JulianDate;
  8553. /**
  8554. * Compares the provided instances and returns <code>true</code> if <code>left</code> is earlier than <code>right</code>, <code>false</code> otherwise.
  8555. * @param left - The first instance.
  8556. * @param right - The second instance.
  8557. * @returns <code>true</code> if <code>left</code> is earlier than <code>right</code>, <code>false</code> otherwise.
  8558. */
  8559. static lessThan(left: JulianDate, right: JulianDate): boolean;
  8560. /**
  8561. * 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.
  8562. * @param left - The first instance.
  8563. * @param right - The second instance.
  8564. * @returns <code>true</code> if <code>left</code> is earlier than or equal to <code>right</code>, <code>false</code> otherwise.
  8565. */
  8566. static lessThanOrEquals(left: JulianDate, right: JulianDate): boolean;
  8567. /**
  8568. * Compares the provided instances and returns <code>true</code> if <code>left</code> is later than <code>right</code>, <code>false</code> otherwise.
  8569. * @param left - The first instance.
  8570. * @param right - The second instance.
  8571. * @returns <code>true</code> if <code>left</code> is later than <code>right</code>, <code>false</code> otherwise.
  8572. */
  8573. static greaterThan(left: JulianDate, right: JulianDate): boolean;
  8574. /**
  8575. * 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.
  8576. * @param left - The first instance.
  8577. * @param right - The second instance.
  8578. * @returns <code>true</code> if <code>left</code> is later than or equal to <code>right</code>, <code>false</code> otherwise.
  8579. */
  8580. static greaterThanOrEquals(left: JulianDate, right: JulianDate): boolean;
  8581. /**
  8582. * Duplicates this instance.
  8583. * @param [result] - An existing instance to use for the result.
  8584. * @returns The modified result parameter or a new instance if none was provided.
  8585. */
  8586. clone(result?: JulianDate): JulianDate;
  8587. /**
  8588. * Compares this and the provided instance and returns <code>true</code> if they are equal, <code>false</code> otherwise.
  8589. * @param [right] - The second instance.
  8590. * @returns <code>true</code> if the dates are equal; otherwise, <code>false</code>.
  8591. */
  8592. equals(right?: JulianDate): boolean;
  8593. /**
  8594. * Compares this and the provided instance and returns <code>true</code> if they are within <code>epsilon</code> seconds of
  8595. each other. That is, in order for the dates to be considered equal (and for
  8596. this function to return <code>true</code>), the absolute value of the difference between them, in
  8597. seconds, must be less than <code>epsilon</code>.
  8598. * @param [right] - The second instance.
  8599. * @param [epsilon = 0] - The maximum number of seconds that should separate the two instances.
  8600. * @returns <code>true</code> if the two dates are within <code>epsilon</code> seconds of each other; otherwise <code>false</code>.
  8601. */
  8602. equalsEpsilon(right?: JulianDate, epsilon?: number): boolean;
  8603. /**
  8604. * Creates a string representing this date in ISO8601 format.
  8605. * @returns A string representing this date in ISO8601 format.
  8606. */
  8607. toString(): string;
  8608. /**
  8609. * Gets or sets the list of leap seconds used throughout Cesium.
  8610. */
  8611. static leapSeconds: LeapSecond[];
  8612. }
  8613. /**
  8614. * This enumerated type is for representing keyboard modifiers. These are keys
  8615. that are held down in addition to other event types.
  8616. */
  8617. export enum KeyboardEventModifier {
  8618. /**
  8619. * Represents the shift key being held down.
  8620. */
  8621. SHIFT = 0,
  8622. /**
  8623. * Represents the control key being held down.
  8624. */
  8625. CTRL = 1,
  8626. /**
  8627. * Represents the alt key being held down.
  8628. */
  8629. ALT = 2
  8630. }
  8631. /**
  8632. * An {@link InterpolationAlgorithm} for performing Lagrange interpolation.
  8633. */
  8634. export namespace LagrangePolynomialApproximation {
  8635. /**
  8636. * Given the desired degree, returns the number of data points required for interpolation.
  8637. * @param degree - The desired degree of interpolation.
  8638. * @returns The number of required data points needed for the desired degree of interpolation.
  8639. */
  8640. function getRequiredDataPoints(degree: number): number;
  8641. /**
  8642. * Interpolates values using Lagrange Polynomial Approximation.
  8643. * @param x - The independent variable for which the dependent variables will be interpolated.
  8644. * @param xTable - The array of independent variables to use to interpolate. The values
  8645. in this array must be in increasing order and the same value must not occur twice in the array.
  8646. * @param yTable - The array of dependent variables to use to interpolate. For a set of three
  8647. dependent values (p,q,w) at time 1 and time 2 this should be as follows: {p1, q1, w1, p2, q2, w2}.
  8648. * @param yStride - The number of dependent variable values in yTable corresponding to
  8649. each independent variable value in xTable.
  8650. * @param [result] - An existing array into which to store the result.
  8651. * @returns The array of interpolated values, or the result parameter if one was provided.
  8652. */
  8653. function interpolateOrderZero(x: number, xTable: number[], yTable: number[], yStride: number, result?: number[]): number[];
  8654. }
  8655. /**
  8656. * Describes a single leap second, which is constructed from a {@link JulianDate} and a
  8657. numerical offset representing the number of seconds TAI is ahead of the UTC time standard.
  8658. * @param [date] - A Julian date representing the time of the leap second.
  8659. * @param [offset] - The cumulative number of seconds that TAI is ahead of UTC at the provided date.
  8660. */
  8661. export class LeapSecond {
  8662. constructor(date?: JulianDate, offset?: number);
  8663. /**
  8664. * Gets or sets the date at which this leap second occurs.
  8665. */
  8666. julianDate: JulianDate;
  8667. /**
  8668. * Gets or sets the cumulative number of seconds between the UTC and TAI time standards at the time
  8669. of this leap second.
  8670. */
  8671. offset: number;
  8672. }
  8673. /**
  8674. * An {@link InterpolationAlgorithm} for performing linear interpolation.
  8675. */
  8676. export namespace LinearApproximation {
  8677. /**
  8678. * Given the desired degree, returns the number of data points required for interpolation.
  8679. Since linear interpolation can only generate a first degree polynomial, this function
  8680. always returns 2.
  8681. * @param degree - The desired degree of interpolation.
  8682. * @returns This function always returns 2.
  8683. */
  8684. function getRequiredDataPoints(degree: number): number;
  8685. /**
  8686. * Interpolates values using linear approximation.
  8687. * @param x - The independent variable for which the dependent variables will be interpolated.
  8688. * @param xTable - The array of independent variables to use to interpolate. The values
  8689. in this array must be in increasing order and the same value must not occur twice in the array.
  8690. * @param yTable - The array of dependent variables to use to interpolate. For a set of three
  8691. dependent values (p,q,w) at time 1 and time 2 this should be as follows: {p1, q1, w1, p2, q2, w2}.
  8692. * @param yStride - The number of dependent variable values in yTable corresponding to
  8693. each independent variable value in xTable.
  8694. * @param [result] - An existing array into which to store the result.
  8695. * @returns The array of interpolated values, or the result parameter if one was provided.
  8696. */
  8697. function interpolateOrderZero(x: number, xTable: number[], yTable: number[], yStride: number, result?: number[]): number[];
  8698. }
  8699. /**
  8700. * A spline that uses piecewise linear interpolation to create a curve.
  8701. * @example
  8702. * var times = [ 0.0, 1.5, 3.0, 4.5, 6.0 ];
  8703. var spline = new Cesium.LinearSpline({
  8704. times : times,
  8705. points : [
  8706. new Cesium.Cartesian3(1235398.0, -4810983.0, 4146266.0),
  8707. new Cesium.Cartesian3(1372574.0, -5345182.0, 4606657.0),
  8708. new Cesium.Cartesian3(-757983.0, -5542796.0, 4514323.0),
  8709. new Cesium.Cartesian3(-2821260.0, -5248423.0, 4021290.0),
  8710. new Cesium.Cartesian3(-2539788.0, -4724797.0, 3620093.0)
  8711. ]
  8712. });
  8713. var p0 = spline.evaluate(times[0]);
  8714. * @param options - Object with the following properties:
  8715. * @param options.times - An array of strictly increasing, unit-less, floating-point times at each point.
  8716. The values are in no way connected to the clock time. They are the parameterization for the curve.
  8717. * @param options.points - The array of {@link Cartesian3} control points.
  8718. */
  8719. export class LinearSpline {
  8720. constructor(options: {
  8721. times: number[];
  8722. points: Cartesian3[];
  8723. });
  8724. /**
  8725. * An array of times for the control points.
  8726. */
  8727. readonly times: number[];
  8728. /**
  8729. * An array of {@link Cartesian3} control points.
  8730. */
  8731. readonly points: Cartesian3[];
  8732. /**
  8733. * Finds an index <code>i</code> in <code>times</code> such that the parameter
  8734. <code>time</code> is in the interval <code>[times[i], times[i + 1]]</code>.
  8735. * @param time - The time.
  8736. * @returns The index for the element at the start of the interval.
  8737. */
  8738. findTimeInterval(time: number): number;
  8739. /**
  8740. * Wraps the given time to the period covered by the spline.
  8741. * @param time - The time.
  8742. * @returns The time, wrapped around to the updated animation.
  8743. */
  8744. wrapTime(time: number): number;
  8745. /**
  8746. * Clamps the given time to the period covered by the spline.
  8747. * @param time - The time.
  8748. * @returns The time, clamped to the animation period.
  8749. */
  8750. clampTime(time: number): number;
  8751. /**
  8752. * Evaluates the curve at a given time.
  8753. * @param time - The time at which to evaluate the curve.
  8754. * @param [result] - The object onto which to store the result.
  8755. * @returns The modified result parameter or a new instance of the point on the curve at the given time.
  8756. */
  8757. evaluate(time: number, result?: Cartesian3): Cartesian3;
  8758. }
  8759. /**
  8760. * Asynchronously loads and parses the given URL to a BASIS file or parses the raw binary data of a BASIS file.
  8761. Returns a promise that will resolve to an object containing the image buffer, width, height and format once loaded,
  8762. or reject if the URL failed to load or failed to parse the data. The data is loaded
  8763. using XMLHttpRequest, which means that in order to make requests to another origin,
  8764. the server must have Cross-Origin Resource Sharing (CORS) headers enabled.
  8765. * @example
  8766. * // load a single URL asynchronously
  8767. Cesium.loadBASIS('some/url').then(function(textureData) {
  8768. var width = textureData.width;
  8769. var height = textureData.height;
  8770. var format = textureData.internalFormat;
  8771. var arrayBufferView = textureData.bufferView;
  8772. // use the data to create a texture
  8773. }).otherwise(function(error) {
  8774. // an error occurred
  8775. });
  8776. * @param resourceOrUrlOrBuffer - The URL of the binary data or an ArrayBuffer.
  8777. * @param s3tc - pvrtc etc1
  8778. * @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.
  8779. */
  8780. export function loadBASIS(resourceOrUrlOrBuffer: Resource | string | ArrayBuffer, s3tc: string): Promise<CompressedTextureBuffer> | undefined;
  8781. /**
  8782. * Asynchronously loads and parses the given URL to a CRN file or parses the raw binary data of a CRN file.
  8783. Returns a promise that will resolve to an object containing the image buffer, width, height and format once loaded,
  8784. or reject if the URL failed to load or failed to parse the data. The data is loaded
  8785. using XMLHttpRequest, which means that in order to make requests to another origin,
  8786. the server must have Cross-Origin Resource Sharing (CORS) headers enabled.
  8787. * @example
  8788. * // load a single URL asynchronously
  8789. Cesium.loadCRN('some/url').then(function(textureData) {
  8790. var width = textureData.width;
  8791. var height = textureData.height;
  8792. var format = textureData.internalFormat;
  8793. var arrayBufferView = textureData.bufferView;
  8794. // use the data to create a texture
  8795. }).otherwise(function(error) {
  8796. // an error occurred
  8797. });
  8798. * @param resourceOrUrlOrBuffer - The URL of the binary data or an ArrayBuffer.
  8799. * @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.
  8800. */
  8801. export function loadCRN(resourceOrUrlOrBuffer: Resource | string | ArrayBuffer): Promise<CompressedTextureBuffer> | undefined;
  8802. /**
  8803. * Asynchronously loads and parses the given URL to a KTX file or parses the raw binary data of a KTX file.
  8804. Returns a promise that will resolve to an object containing the image buffer, width, height and format once loaded,
  8805. or reject if the URL failed to load or failed to parse the data. The data is loaded
  8806. using XMLHttpRequest, which means that in order to make requests to another origin,
  8807. the server must have Cross-Origin Resource Sharing (CORS) headers enabled.
  8808. <p>
  8809. The following are part of the KTX format specification but are not supported:
  8810. <ul>
  8811. <li>Big-endian files</li>
  8812. <li>Metadata</li>
  8813. <li>3D textures</li>
  8814. <li>Texture Arrays</li>
  8815. <li>Cubemaps</li>
  8816. <li>Mipmaps</li>
  8817. </ul>
  8818. </p>
  8819. * @example
  8820. * // load a single URL asynchronously
  8821. Cesium.loadKTX('some/url').then(function(ktxData) {
  8822. var width = ktxData.width;
  8823. var height = ktxData.height;
  8824. var format = ktxData.internalFormat;
  8825. var arrayBufferView = ktxData.bufferView;
  8826. // use the data to create a texture
  8827. }).otherwise(function(error) {
  8828. // an error occurred
  8829. });
  8830. * @param resourceOrUrlOrBuffer - The URL of the binary data or an ArrayBuffer.
  8831. * @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.
  8832. */
  8833. export function loadKTX(resourceOrUrlOrBuffer: Resource | string | ArrayBuffer): Promise<CompressedTextureBuffer> | undefined;
  8834. /**
  8835. * Defines how geodetic ellipsoid coordinates ({@link Cartographic}) project to a
  8836. flat map like Cesium's 2D and Columbus View modes.
  8837. */
  8838. export class MapProjection {
  8839. constructor();
  8840. /**
  8841. * Gets the {@link Ellipsoid}.
  8842. */
  8843. readonly ellipsoid: Ellipsoid;
  8844. /**
  8845. * Projects {@link Cartographic} coordinates, in radians, to projection-specific map coordinates, in meters.
  8846. * @param cartographic - The coordinates to project.
  8847. * @param [result] - An instance into which to copy the result. If this parameter is
  8848. undefined, a new instance is created and returned.
  8849. * @returns The projected coordinates. If the result parameter is not undefined, the
  8850. coordinates are copied there and that instance is returned. Otherwise, a new instance is
  8851. created and returned.
  8852. */
  8853. project(cartographic: Cartographic, result?: Cartesian3): Cartesian3;
  8854. /**
  8855. * Unprojects projection-specific map {@link Cartesian3} coordinates, in meters, to {@link Cartographic}
  8856. coordinates, in radians.
  8857. * @param cartesian - The Cartesian position to unproject with height (z) in meters.
  8858. * @param [result] - An instance into which to copy the result. If this parameter is
  8859. undefined, a new instance is created and returned.
  8860. * @returns The unprojected coordinates. If the result parameter is not undefined, the
  8861. coordinates are copied there and that instance is returned. Otherwise, a new instance is
  8862. created and returned.
  8863. */
  8864. unproject(cartesian: Cartesian3, result?: Cartographic): Cartographic;
  8865. }
  8866. /**
  8867. * Math functions.
  8868. */
  8869. export namespace Math {
  8870. /**
  8871. * 0.1
  8872. */
  8873. const EPSILON1 = 0.1;
  8874. /**
  8875. * 0.01
  8876. */
  8877. const EPSILON2 = 0.01;
  8878. /**
  8879. * 0.001
  8880. */
  8881. const EPSILON3 = 0.001;
  8882. /**
  8883. * 0.0001
  8884. */
  8885. const EPSILON4 = 0.0001;
  8886. /**
  8887. * 0.00001
  8888. */
  8889. const EPSILON5 = 0.00001;
  8890. /**
  8891. * 0.000001
  8892. */
  8893. const EPSILON6 = 0.000001;
  8894. /**
  8895. * 0.0000001
  8896. */
  8897. const EPSILON7 = 1e-7;
  8898. /**
  8899. * 0.00000001
  8900. */
  8901. const EPSILON8 = 1e-8;
  8902. /**
  8903. * 0.000000001
  8904. */
  8905. const EPSILON9 = 1e-9;
  8906. /**
  8907. * 0.0000000001
  8908. */
  8909. const EPSILON10 = 1e-10;
  8910. /**
  8911. * 0.00000000001
  8912. */
  8913. const EPSILON11 = 1e-11;
  8914. /**
  8915. * 0.000000000001
  8916. */
  8917. const EPSILON12 = 1e-12;
  8918. /**
  8919. * 0.0000000000001
  8920. */
  8921. const EPSILON13 = 1e-13;
  8922. /**
  8923. * 0.00000000000001
  8924. */
  8925. const EPSILON14 = 1e-14;
  8926. /**
  8927. * 0.000000000000001
  8928. */
  8929. const EPSILON15 = 1e-15;
  8930. /**
  8931. * 0.0000000000000001
  8932. */
  8933. const EPSILON16 = 1e-16;
  8934. /**
  8935. * 0.00000000000000001
  8936. */
  8937. const EPSILON17 = 1e-17;
  8938. /**
  8939. * 0.000000000000000001
  8940. */
  8941. const EPSILON18 = 1e-18;
  8942. /**
  8943. * 0.0000000000000000001
  8944. */
  8945. const EPSILON19 = 1e-19;
  8946. /**
  8947. * 0.00000000000000000001
  8948. */
  8949. const EPSILON20 = 1e-20;
  8950. /**
  8951. * 0.000000000000000000001
  8952. */
  8953. const EPSILON21 = 1e-21;
  8954. /**
  8955. * The gravitational parameter of the Earth in meters cubed
  8956. per second squared as defined by the WGS84 model: 3.986004418e14
  8957. */
  8958. const GRAVITATIONALPARAMETER = 398600441800000;
  8959. /**
  8960. * Radius of the sun in meters: 6.955e8
  8961. */
  8962. const SOLAR_RADIUS = 695500000;
  8963. /**
  8964. * The mean radius of the moon, according to the "Report of the IAU/IAG Working Group on
  8965. Cartographic Coordinates and Rotational Elements of the Planets and satellites: 2000",
  8966. Celestial Mechanics 82: 83-110, 2002.
  8967. */
  8968. const LUNAR_RADIUS = 1737400;
  8969. /**
  8970. * 64 * 1024
  8971. */
  8972. const SIXTY_FOUR_KILOBYTES: number;
  8973. /**
  8974. * 4 * 1024 * 1024 * 1024
  8975. */
  8976. const FOUR_GIGABYTES: number;
  8977. /**
  8978. * Returns the sign of the value; 1 if the value is positive, -1 if the value is
  8979. negative, or 0 if the value is 0.
  8980. * @param value - The value to return the sign of.
  8981. * @returns The sign of value.
  8982. */
  8983. function sign(value: number): number;
  8984. /**
  8985. * Returns 1.0 if the given value is positive or zero, and -1.0 if it is negative.
  8986. This is similar to {@link Math#sign} except that returns 1.0 instead of
  8987. 0.0 when the input value is 0.0.
  8988. * @param value - The value to return the sign of.
  8989. * @returns The sign of value.
  8990. */
  8991. function signNotZero(value: number): number;
  8992. /**
  8993. * Converts a scalar value in the range [-1.0, 1.0] to a SNORM in the range [0, rangeMaximum]
  8994. * @param value - The scalar value in the range [-1.0, 1.0]
  8995. * @param [rangeMaximum = 255] - The maximum value in the mapped range, 255 by default.
  8996. * @returns A SNORM value, where 0 maps to -1.0 and rangeMaximum maps to 1.0.
  8997. */
  8998. function toSNorm(value: number, rangeMaximum?: number): number;
  8999. /**
  9000. * Converts a SNORM value in the range [0, rangeMaximum] to a scalar in the range [-1.0, 1.0].
  9001. * @param value - SNORM value in the range [0, rangeMaximum]
  9002. * @param [rangeMaximum = 255] - The maximum value in the SNORM range, 255 by default.
  9003. * @returns Scalar in the range [-1.0, 1.0].
  9004. */
  9005. function fromSNorm(value: number, rangeMaximum?: number): number;
  9006. /**
  9007. * Converts a scalar value in the range [rangeMinimum, rangeMaximum] to a scalar in the range [0.0, 1.0]
  9008. * @param value - The scalar value in the range [rangeMinimum, rangeMaximum]
  9009. * @param rangeMinimum - The minimum value in the mapped range.
  9010. * @param rangeMaximum - The maximum value in the mapped range.
  9011. * @returns A scalar value, where rangeMinimum maps to 0.0 and rangeMaximum maps to 1.0.
  9012. */
  9013. function normalize(value: number, rangeMinimum: number, rangeMaximum: number): number;
  9014. /**
  9015. * Returns the hyperbolic sine of a number.
  9016. The hyperbolic sine of <em>value</em> is defined to be
  9017. (<em>e<sup>x</sup>&nbsp;-&nbsp;e<sup>-x</sup></em>)/2.0
  9018. where <i>e</i> is Euler's number, approximately 2.71828183.
  9019. <p>Special cases:
  9020. <ul>
  9021. <li>If the argument is NaN, then the result is NaN.</li>
  9022. <li>If the argument is infinite, then the result is an infinity
  9023. with the same sign as the argument.</li>
  9024. <li>If the argument is zero, then the result is a zero with the
  9025. same sign as the argument.</li>
  9026. </ul>
  9027. </p>
  9028. * @param value - The number whose hyperbolic sine is to be returned.
  9029. * @returns The hyperbolic sine of <code>value</code>.
  9030. */
  9031. function sinh(value: number): number;
  9032. /**
  9033. * Returns the hyperbolic cosine of a number.
  9034. The hyperbolic cosine of <strong>value</strong> is defined to be
  9035. (<em>e<sup>x</sup>&nbsp;+&nbsp;e<sup>-x</sup></em>)/2.0
  9036. where <i>e</i> is Euler's number, approximately 2.71828183.
  9037. <p>Special cases:
  9038. <ul>
  9039. <li>If the argument is NaN, then the result is NaN.</li>
  9040. <li>If the argument is infinite, then the result is positive infinity.</li>
  9041. <li>If the argument is zero, then the result is 1.0.</li>
  9042. </ul>
  9043. </p>
  9044. * @param value - The number whose hyperbolic cosine is to be returned.
  9045. * @returns The hyperbolic cosine of <code>value</code>.
  9046. */
  9047. function cosh(value: number): number;
  9048. /**
  9049. * Computes the linear interpolation of two values.
  9050. * @example
  9051. * var n = Cesium.Math.lerp(0.0, 2.0, 0.5); // returns 1.0
  9052. * @param p - The start value to interpolate.
  9053. * @param q - The end value to interpolate.
  9054. * @param time - The time of interpolation generally in the range <code>[0.0, 1.0]</code>.
  9055. * @returns The linearly interpolated value.
  9056. */
  9057. function lerp(p: number, q: number, time: number): number;
  9058. /**
  9059. * pi
  9060. */
  9061. const PI: number;
  9062. /**
  9063. * 1/pi
  9064. */
  9065. const ONE_OVER_PI: number;
  9066. /**
  9067. * pi/2
  9068. */
  9069. const PI_OVER_TWO: number;
  9070. /**
  9071. * pi/3
  9072. */
  9073. const PI_OVER_THREE: number;
  9074. /**
  9075. * pi/4
  9076. */
  9077. const PI_OVER_FOUR: number;
  9078. /**
  9079. * pi/6
  9080. */
  9081. const PI_OVER_SIX: number;
  9082. /**
  9083. * 3pi/2
  9084. */
  9085. const THREE_PI_OVER_TWO: number;
  9086. /**
  9087. * 2pi
  9088. */
  9089. const TWO_PI: number;
  9090. /**
  9091. * 1/2pi
  9092. */
  9093. const ONE_OVER_TWO_PI: number;
  9094. /**
  9095. * The number of radians in a degree.
  9096. */
  9097. const RADIANS_PER_DEGREE: number;
  9098. /**
  9099. * The number of degrees in a radian.
  9100. */
  9101. const DEGREES_PER_RADIAN: number;
  9102. /**
  9103. * The number of radians in an arc second.
  9104. */
  9105. const RADIANS_PER_ARCSECOND: number;
  9106. /**
  9107. * Converts degrees to radians.
  9108. * @param degrees - The angle to convert in degrees.
  9109. * @returns The corresponding angle in radians.
  9110. */
  9111. function toRadians(degrees: number): number;
  9112. /**
  9113. * Converts radians to degrees.
  9114. * @param radians - The angle to convert in radians.
  9115. * @returns The corresponding angle in degrees.
  9116. */
  9117. function toDegrees(radians: number): number;
  9118. /**
  9119. * Converts a longitude value, in radians, to the range [<code>-Math.PI</code>, <code>Math.PI</code>).
  9120. * @example
  9121. * // Convert 270 degrees to -90 degrees longitude
  9122. var longitude = Cesium.Math.convertLongitudeRange(Cesium.Math.toRadians(270.0));
  9123. * @param angle - The longitude value, in radians, to convert to the range [<code>-Math.PI</code>, <code>Math.PI</code>).
  9124. * @returns The equivalent longitude value in the range [<code>-Math.PI</code>, <code>Math.PI</code>).
  9125. */
  9126. function convertLongitudeRange(angle: number): number;
  9127. /**
  9128. * Convenience function that clamps a latitude value, in radians, to the range [<code>-Math.PI/2</code>, <code>Math.PI/2</code>).
  9129. Useful for sanitizing data before use in objects requiring correct range.
  9130. * @example
  9131. * // Clamp 108 degrees latitude to 90 degrees latitude
  9132. var latitude = Cesium.Math.clampToLatitudeRange(Cesium.Math.toRadians(108.0));
  9133. * @param angle - The latitude value, in radians, to clamp to the range [<code>-Math.PI/2</code>, <code>Math.PI/2</code>).
  9134. * @returns The latitude value clamped to the range [<code>-Math.PI/2</code>, <code>Math.PI/2</code>).
  9135. */
  9136. function clampToLatitudeRange(angle: number): number;
  9137. /**
  9138. * Produces an angle in the range -Pi <= angle <= Pi which is equivalent to the provided angle.
  9139. * @param angle - in radians
  9140. * @returns The angle in the range [<code>-Math.PI</code>, <code>Math.PI</code>].
  9141. */
  9142. function negativePiToPi(angle: number): number;
  9143. /**
  9144. * Produces an angle in the range 0 <= angle <= 2Pi which is equivalent to the provided angle.
  9145. * @param angle - in radians
  9146. * @returns The angle in the range [0, <code>Math.TWO_PI</code>].
  9147. */
  9148. function zeroToTwoPi(angle: number): number;
  9149. /**
  9150. * The modulo operation that also works for negative dividends.
  9151. * @param m - The dividend.
  9152. * @param n - The divisor.
  9153. * @returns The remainder.
  9154. */
  9155. function mod(m: number, n: number): number;
  9156. /**
  9157. * Determines if two values are equal using an absolute or relative tolerance test. This is useful
  9158. to avoid problems due to roundoff error when comparing floating-point values directly. The values are
  9159. first compared using an absolute tolerance test. If that fails, a relative tolerance test is performed.
  9160. Use this test if you are unsure of the magnitudes of left and right.
  9161. * @example
  9162. * var a = Cesium.Math.equalsEpsilon(0.0, 0.01, Cesium.Math.EPSILON2); // true
  9163. var b = Cesium.Math.equalsEpsilon(0.0, 0.1, Cesium.Math.EPSILON2); // false
  9164. var c = Cesium.Math.equalsEpsilon(3699175.1634344, 3699175.2, Cesium.Math.EPSILON7); // true
  9165. var d = Cesium.Math.equalsEpsilon(3699175.1634344, 3699175.2, Cesium.Math.EPSILON9); // false
  9166. * @param left - The first value to compare.
  9167. * @param right - The other value to compare.
  9168. * @param [relativeEpsilon = 0] - The maximum inclusive delta between <code>left</code> and <code>right</code> for the relative tolerance test.
  9169. * @param [absoluteEpsilon = relativeEpsilon] - The maximum inclusive delta between <code>left</code> and <code>right</code> for the absolute tolerance test.
  9170. * @returns <code>true</code> if the values are equal within the epsilon; otherwise, <code>false</code>.
  9171. */
  9172. function equalsEpsilon(left: number, right: number, relativeEpsilon?: number, absoluteEpsilon?: number): boolean;
  9173. /**
  9174. * Determines if the left value is less than the right value. If the two values are within
  9175. <code>absoluteEpsilon</code> of each other, they are considered equal and this function returns false.
  9176. * @param left - The first number to compare.
  9177. * @param right - The second number to compare.
  9178. * @param absoluteEpsilon - The absolute epsilon to use in comparison.
  9179. * @returns <code>true</code> if <code>left</code> is less than <code>right</code> by more than
  9180. <code>absoluteEpsilon<code>. <code>false</code> if <code>left</code> is greater or if the two
  9181. values are nearly equal.
  9182. */
  9183. function lessThan(left: number, right: number, absoluteEpsilon: number): boolean;
  9184. /**
  9185. * Determines if the left value is less than or equal to the right value. If the two values are within
  9186. <code>absoluteEpsilon</code> of each other, they are considered equal and this function returns true.
  9187. * @param left - The first number to compare.
  9188. * @param right - The second number to compare.
  9189. * @param absoluteEpsilon - The absolute epsilon to use in comparison.
  9190. * @returns <code>true</code> if <code>left</code> is less than <code>right</code> or if the
  9191. the values are nearly equal.
  9192. */
  9193. function lessThanOrEquals(left: number, right: number, absoluteEpsilon: number): boolean;
  9194. /**
  9195. * Determines if the left value is greater the right value. If the two values are within
  9196. <code>absoluteEpsilon</code> of each other, they are considered equal and this function returns false.
  9197. * @param left - The first number to compare.
  9198. * @param right - The second number to compare.
  9199. * @param absoluteEpsilon - The absolute epsilon to use in comparison.
  9200. * @returns <code>true</code> if <code>left</code> is greater than <code>right</code> by more than
  9201. <code>absoluteEpsilon<code>. <code>false</code> if <code>left</code> is less or if the two
  9202. values are nearly equal.
  9203. */
  9204. function greaterThan(left: number, right: number, absoluteEpsilon: number): boolean;
  9205. /**
  9206. * Determines if the left value is greater than or equal to the right value. If the two values are within
  9207. <code>absoluteEpsilon</code> of each other, they are considered equal and this function returns true.
  9208. * @param left - The first number to compare.
  9209. * @param right - The second number to compare.
  9210. * @param absoluteEpsilon - The absolute epsilon to use in comparison.
  9211. * @returns <code>true</code> if <code>left</code> is greater than <code>right</code> or if the
  9212. the values are nearly equal.
  9213. */
  9214. function greaterThanOrEquals(left: number, right: number, absoluteEpsilon: number): boolean;
  9215. /**
  9216. * Computes the factorial of the provided number.
  9217. * @example
  9218. * //Compute 7!, which is equal to 5040
  9219. var computedFactorial = Cesium.Math.factorial(7);
  9220. * @param n - The number whose factorial is to be computed.
  9221. * @returns The factorial of the provided number or undefined if the number is less than 0.
  9222. */
  9223. function factorial(n: number): number;
  9224. /**
  9225. * Increments a number with a wrapping to a minimum value if the number exceeds the maximum value.
  9226. * @example
  9227. * var n = Cesium.Math.incrementWrap(5, 10, 0); // returns 6
  9228. var n = Cesium.Math.incrementWrap(10, 10, 0); // returns 0
  9229. * @param [n] - The number to be incremented.
  9230. * @param [maximumValue] - The maximum incremented value before rolling over to the minimum value.
  9231. * @param [minimumValue = 0.0] - The number reset to after the maximum value has been exceeded.
  9232. * @returns The incremented number.
  9233. */
  9234. function incrementWrap(n?: number, maximumValue?: number, minimumValue?: number): number;
  9235. /**
  9236. * Determines if a positive integer is a power of two.
  9237. * @example
  9238. * var t = Cesium.Math.isPowerOfTwo(16); // true
  9239. var f = Cesium.Math.isPowerOfTwo(20); // false
  9240. * @param n - The positive integer to test.
  9241. * @returns <code>true</code> if the number if a power of two; otherwise, <code>false</code>.
  9242. */
  9243. function isPowerOfTwo(n: number): boolean;
  9244. /**
  9245. * Computes the next power-of-two integer greater than or equal to the provided positive integer.
  9246. * @example
  9247. * var n = Cesium.Math.nextPowerOfTwo(29); // 32
  9248. var m = Cesium.Math.nextPowerOfTwo(32); // 32
  9249. * @param n - The positive integer to test.
  9250. * @returns The next power-of-two integer.
  9251. */
  9252. function nextPowerOfTwo(n: number): number;
  9253. /**
  9254. * Constraint a value to lie between two values.
  9255. * @param value - The value to constrain.
  9256. * @param min - The minimum value.
  9257. * @param max - The maximum value.
  9258. * @returns The value clamped so that min <= value <= max.
  9259. */
  9260. function clamp(value: number, min: number, max: number): number;
  9261. /**
  9262. * Sets the seed used by the random number generator
  9263. in {@link Math#nextRandomNumber}.
  9264. * @param seed - An integer used as the seed.
  9265. */
  9266. function setRandomNumberSeed(seed: number): void;
  9267. /**
  9268. * Generates a random floating point number in the range of [0.0, 1.0)
  9269. using a Mersenne twister.
  9270. * @returns A random number in the range of [0.0, 1.0).
  9271. */
  9272. function nextRandomNumber(): number;
  9273. /**
  9274. * Generates a random number between two numbers.
  9275. * @param min - The minimum value.
  9276. * @param max - The maximum value.
  9277. * @returns A random number between the min and max.
  9278. */
  9279. function randomBetween(min: number, max: number): number;
  9280. /**
  9281. * Computes <code>Math.acos(value)</code>, but first clamps <code>value</code> to the range [-1.0, 1.0]
  9282. so that the function will never return NaN.
  9283. * @param value - The value for which to compute acos.
  9284. * @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,
  9285. whichever is closer, if the value is outside the range.
  9286. */
  9287. function acosClamped(value: number): number;
  9288. /**
  9289. * Computes <code>Math.asin(value)</code>, but first clamps <code>value</code> to the range [-1.0, 1.0]
  9290. so that the function will never return NaN.
  9291. * @param value - The value for which to compute asin.
  9292. * @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,
  9293. whichever is closer, if the value is outside the range.
  9294. */
  9295. function asinClamped(value: number): number;
  9296. /**
  9297. * Finds the chord length between two points given the circle's radius and the angle between the points.
  9298. * @param angle - The angle between the two points.
  9299. * @param radius - The radius of the circle.
  9300. * @returns The chord length.
  9301. */
  9302. function chordLength(angle: number, radius: number): number;
  9303. /**
  9304. * Finds the logarithm of a number to a base.
  9305. * @param number - The number.
  9306. * @param base - The base.
  9307. * @returns The result.
  9308. */
  9309. function logBase(number: number, base: number): number;
  9310. /**
  9311. * Finds the cube root of a number.
  9312. Returns NaN if <code>number</code> is not provided.
  9313. * @param [number] - The number.
  9314. * @returns The result.
  9315. */
  9316. function cbrt(number?: number): number;
  9317. /**
  9318. * Finds the base 2 logarithm of a number.
  9319. * @param number - The number.
  9320. * @returns The result.
  9321. */
  9322. function log2(number: number): number;
  9323. /**
  9324. * Computes a fast approximation of Atan for input in the range [-1, 1].
  9325. Based on Michal Drobot's approximation from ShaderFastLibs,
  9326. which in turn is based on "Efficient approximations for the arctangent function,"
  9327. Rajan, S. Sichun Wang Inkol, R. Joyal, A., May 2006.
  9328. Adapted from ShaderFastLibs under MIT License.
  9329. * @param x - An input number in the range [-1, 1]
  9330. * @returns An approximation of atan(x)
  9331. */
  9332. function fastApproximateAtan(x: number): number;
  9333. /**
  9334. * Computes a fast approximation of Atan2(x, y) for arbitrary input scalars.
  9335. Range reduction math based on nvidia's cg reference implementation: http://developer.download.nvidia.com/cg/atan2.html
  9336. * @param x - An input number that isn't zero if y is zero.
  9337. * @param y - An input number that isn't zero if x is zero.
  9338. * @returns An approximation of atan2(x, y)
  9339. */
  9340. function fastApproximateAtan2(x: number, y: number): number;
  9341. }
  9342. export interface Matrix2 extends ArrayLike<number> {
  9343. }
  9344. /**
  9345. * A 2x2 matrix, indexable as a column-major order array.
  9346. Constructor parameters are in row-major order for code readability.
  9347. * @param [column0Row0 = 0.0] - The value for column 0, row 0.
  9348. * @param [column1Row0 = 0.0] - The value for column 1, row 0.
  9349. * @param [column0Row1 = 0.0] - The value for column 0, row 1.
  9350. * @param [column1Row1 = 0.0] - The value for column 1, row 1.
  9351. */
  9352. export class Matrix2 implements ArrayLike<number> {
  9353. constructor(column0Row0?: number, column1Row0?: number, column0Row1?: number, column1Row1?: number);
  9354. /**
  9355. * The number of elements used to pack the object into an array.
  9356. */
  9357. static packedLength: number;
  9358. /**
  9359. * Stores the provided instance into the provided array.
  9360. * @param value - The value to pack.
  9361. * @param array - The array to pack into.
  9362. * @param [startingIndex = 0] - The index into the array at which to start packing the elements.
  9363. * @returns The array that was packed into
  9364. */
  9365. static pack(value: Matrix2, array: number[], startingIndex?: number): number[];
  9366. /**
  9367. * Retrieves an instance from a packed array.
  9368. * @param array - The packed array.
  9369. * @param [startingIndex = 0] - The starting index of the element to be unpacked.
  9370. * @param [result] - The object into which to store the result.
  9371. * @returns The modified result parameter or a new Matrix2 instance if one was not provided.
  9372. */
  9373. static unpack(array: number[], startingIndex?: number, result?: Matrix2): Matrix2;
  9374. /**
  9375. * Duplicates a Matrix2 instance.
  9376. * @param matrix - The matrix to duplicate.
  9377. * @param [result] - The object onto which to store the result.
  9378. * @returns The modified result parameter or a new Matrix2 instance if one was not provided. (Returns undefined if matrix is undefined)
  9379. */
  9380. static clone(matrix: Matrix2, result?: Matrix2): Matrix2;
  9381. /**
  9382. * Creates a Matrix2 from 4 consecutive elements in an array.
  9383. * @example
  9384. * // Create the Matrix2:
  9385. // [1.0, 2.0]
  9386. // [1.0, 2.0]
  9387. var v = [1.0, 1.0, 2.0, 2.0];
  9388. var m = Cesium.Matrix2.fromArray(v);
  9389. // Create same Matrix2 with using an offset into an array
  9390. var v2 = [0.0, 0.0, 1.0, 1.0, 2.0, 2.0];
  9391. var m2 = Cesium.Matrix2.fromArray(v2, 2);
  9392. * @param array - The array whose 4 consecutive elements correspond to the positions of the matrix. Assumes column-major order.
  9393. * @param [startingIndex = 0] - The offset into the array of the first element, which corresponds to first column first row position in the matrix.
  9394. * @param [result] - The object onto which to store the result.
  9395. * @returns The modified result parameter or a new Matrix2 instance if one was not provided.
  9396. */
  9397. static fromArray(array: number[], startingIndex?: number, result?: Matrix2): Matrix2;
  9398. /**
  9399. * Creates a Matrix2 instance from a column-major order array.
  9400. * @param values - The column-major order array.
  9401. * @param [result] - The object in which the result will be stored, if undefined a new instance will be created.
  9402. * @returns The modified result parameter, or a new Matrix2 instance if one was not provided.
  9403. */
  9404. static fromColumnMajorArray(values: number[], result?: Matrix2): Matrix2;
  9405. /**
  9406. * Creates a Matrix2 instance from a row-major order array.
  9407. The resulting matrix will be in column-major order.
  9408. * @param values - The row-major order array.
  9409. * @param [result] - The object in which the result will be stored, if undefined a new instance will be created.
  9410. * @returns The modified result parameter, or a new Matrix2 instance if one was not provided.
  9411. */
  9412. static fromRowMajorArray(values: number[], result?: Matrix2): Matrix2;
  9413. /**
  9414. * Computes a Matrix2 instance representing a non-uniform scale.
  9415. * @example
  9416. * // Creates
  9417. // [7.0, 0.0]
  9418. // [0.0, 8.0]
  9419. var m = Cesium.Matrix2.fromScale(new Cesium.Cartesian2(7.0, 8.0));
  9420. * @param scale - The x and y scale factors.
  9421. * @param [result] - The object in which the result will be stored, if undefined a new instance will be created.
  9422. * @returns The modified result parameter, or a new Matrix2 instance if one was not provided.
  9423. */
  9424. static fromScale(scale: Cartesian2, result?: Matrix2): Matrix2;
  9425. /**
  9426. * Computes a Matrix2 instance representing a uniform scale.
  9427. * @example
  9428. * // Creates
  9429. // [2.0, 0.0]
  9430. // [0.0, 2.0]
  9431. var m = Cesium.Matrix2.fromUniformScale(2.0);
  9432. * @param scale - The uniform scale factor.
  9433. * @param [result] - The object in which the result will be stored, if undefined a new instance will be created.
  9434. * @returns The modified result parameter, or a new Matrix2 instance if one was not provided.
  9435. */
  9436. static fromUniformScale(scale: number, result?: Matrix2): Matrix2;
  9437. /**
  9438. * Creates a rotation matrix.
  9439. * @example
  9440. * // Rotate a point 45 degrees counterclockwise.
  9441. var p = new Cesium.Cartesian2(5, 6);
  9442. var m = Cesium.Matrix2.fromRotation(Cesium.Math.toRadians(45.0));
  9443. var rotated = Cesium.Matrix2.multiplyByVector(m, p, new Cesium.Cartesian2());
  9444. * @param angle - The angle, in radians, of the rotation. Positive angles are counterclockwise.
  9445. * @param [result] - The object in which the result will be stored, if undefined a new instance will be created.
  9446. * @returns The modified result parameter, or a new Matrix2 instance if one was not provided.
  9447. */
  9448. static fromRotation(angle: number, result?: Matrix2): Matrix2;
  9449. /**
  9450. * Creates an Array from the provided Matrix2 instance.
  9451. The array will be in column-major order.
  9452. * @param matrix - The matrix to use..
  9453. * @param [result] - The Array onto which to store the result.
  9454. * @returns The modified Array parameter or a new Array instance if one was not provided.
  9455. */
  9456. static toArray(matrix: Matrix2, result?: number[]): number[];
  9457. /**
  9458. * Computes the array index of the element at the provided row and column.
  9459. * @example
  9460. * var myMatrix = new Cesium.Matrix2();
  9461. var column1Row0Index = Cesium.Matrix2.getElementIndex(1, 0);
  9462. var column1Row0 = myMatrix[column1Row0Index]
  9463. myMatrix[column1Row0Index] = 10.0;
  9464. * @param row - The zero-based index of the row.
  9465. * @param column - The zero-based index of the column.
  9466. * @returns The index of the element at the provided row and column.
  9467. */
  9468. static getElementIndex(row: number, column: number): number;
  9469. /**
  9470. * Retrieves a copy of the matrix column at the provided index as a Cartesian2 instance.
  9471. * @param matrix - The matrix to use.
  9472. * @param index - The zero-based index of the column to retrieve.
  9473. * @param result - The object onto which to store the result.
  9474. * @returns The modified result parameter.
  9475. */
  9476. static getColumn(matrix: Matrix2, index: number, result: Cartesian2): Cartesian2;
  9477. /**
  9478. * Computes a new matrix that replaces the specified column in the provided matrix with the provided Cartesian2 instance.
  9479. * @param matrix - The matrix to use.
  9480. * @param index - The zero-based index of the column to set.
  9481. * @param cartesian - The Cartesian whose values will be assigned to the specified column.
  9482. * @param result - The object onto which to store the result.
  9483. * @returns The modified result parameter.
  9484. */
  9485. static setColumn(matrix: Matrix2, index: number, cartesian: Cartesian2, result: Cartesian2): Matrix2;
  9486. /**
  9487. * Retrieves a copy of the matrix row at the provided index as a Cartesian2 instance.
  9488. * @param matrix - The matrix to use.
  9489. * @param index - The zero-based index of the row to retrieve.
  9490. * @param result - The object onto which to store the result.
  9491. * @returns The modified result parameter.
  9492. */
  9493. static getRow(matrix: Matrix2, index: number, result: Cartesian2): Cartesian2;
  9494. /**
  9495. * Computes a new matrix that replaces the specified row in the provided matrix with the provided Cartesian2 instance.
  9496. * @param matrix - The matrix to use.
  9497. * @param index - The zero-based index of the row to set.
  9498. * @param cartesian - The Cartesian whose values will be assigned to the specified row.
  9499. * @param result - The object onto which to store the result.
  9500. * @returns The modified result parameter.
  9501. */
  9502. static setRow(matrix: Matrix2, index: number, cartesian: Cartesian2, result: Matrix2): Matrix2;
  9503. /**
  9504. * Extracts the non-uniform scale assuming the matrix is an affine transformation.
  9505. * @param matrix - The matrix.
  9506. * @param result - The object onto which to store the result.
  9507. * @returns The modified result parameter.
  9508. */
  9509. static getScale(matrix: Matrix2, result: Cartesian2): Cartesian2;
  9510. /**
  9511. * Computes the maximum scale assuming the matrix is an affine transformation.
  9512. The maximum scale is the maximum length of the column vectors.
  9513. * @param matrix - The matrix.
  9514. * @returns The maximum scale.
  9515. */
  9516. static getMaximumScale(matrix: Matrix2): number;
  9517. /**
  9518. * Computes the product of two matrices.
  9519. * @param left - The first matrix.
  9520. * @param right - The second matrix.
  9521. * @param result - The object onto which to store the result.
  9522. * @returns The modified result parameter.
  9523. */
  9524. static multiply(left: Matrix2, right: Matrix2, result: Matrix2): Matrix2;
  9525. /**
  9526. * Computes the sum of two matrices.
  9527. * @param left - The first matrix.
  9528. * @param right - The second matrix.
  9529. * @param result - The object onto which to store the result.
  9530. * @returns The modified result parameter.
  9531. */
  9532. static add(left: Matrix2, right: Matrix2, result: Matrix2): Matrix2;
  9533. /**
  9534. * Computes the difference of two matrices.
  9535. * @param left - The first matrix.
  9536. * @param right - The second matrix.
  9537. * @param result - The object onto which to store the result.
  9538. * @returns The modified result parameter.
  9539. */
  9540. static subtract(left: Matrix2, right: Matrix2, result: Matrix2): Matrix2;
  9541. /**
  9542. * Computes the product of a matrix and a column vector.
  9543. * @param matrix - The matrix.
  9544. * @param cartesian - The column.
  9545. * @param result - The object onto which to store the result.
  9546. * @returns The modified result parameter.
  9547. */
  9548. static multiplyByVector(matrix: Matrix2, cartesian: Cartesian2, result: Cartesian2): Cartesian2;
  9549. /**
  9550. * Computes the product of a matrix and a scalar.
  9551. * @param matrix - The matrix.
  9552. * @param scalar - The number to multiply by.
  9553. * @param result - The object onto which to store the result.
  9554. * @returns The modified result parameter.
  9555. */
  9556. static multiplyByScalar(matrix: Matrix2, scalar: number, result: Matrix2): Matrix2;
  9557. /**
  9558. * Computes the product of a matrix times a (non-uniform) scale, as if the scale were a scale matrix.
  9559. * @example
  9560. * // Instead of Cesium.Matrix2.multiply(m, Cesium.Matrix2.fromScale(scale), m);
  9561. Cesium.Matrix2.multiplyByScale(m, scale, m);
  9562. * @param matrix - The matrix on the left-hand side.
  9563. * @param scale - The non-uniform scale on the right-hand side.
  9564. * @param result - The object onto which to store the result.
  9565. * @returns The modified result parameter.
  9566. */
  9567. static multiplyByScale(matrix: Matrix2, scale: Cartesian2, result: Matrix2): Matrix2;
  9568. /**
  9569. * Creates a negated copy of the provided matrix.
  9570. * @param matrix - The matrix to negate.
  9571. * @param result - The object onto which to store the result.
  9572. * @returns The modified result parameter.
  9573. */
  9574. static negate(matrix: Matrix2, result: Matrix2): Matrix2;
  9575. /**
  9576. * Computes the transpose of the provided matrix.
  9577. * @param matrix - The matrix to transpose.
  9578. * @param result - The object onto which to store the result.
  9579. * @returns The modified result parameter.
  9580. */
  9581. static transpose(matrix: Matrix2, result: Matrix2): Matrix2;
  9582. /**
  9583. * Computes a matrix, which contains the absolute (unsigned) values of the provided matrix's elements.
  9584. * @param matrix - The matrix with signed elements.
  9585. * @param result - The object onto which to store the result.
  9586. * @returns The modified result parameter.
  9587. */
  9588. static abs(matrix: Matrix2, result: Matrix2): Matrix2;
  9589. /**
  9590. * Compares the provided matrices componentwise and returns
  9591. <code>true</code> if they are equal, <code>false</code> otherwise.
  9592. * @param [left] - The first matrix.
  9593. * @param [right] - The second matrix.
  9594. * @returns <code>true</code> if left and right are equal, <code>false</code> otherwise.
  9595. */
  9596. static equals(left?: Matrix2, right?: Matrix2): boolean;
  9597. /**
  9598. * Compares the provided matrices componentwise and returns
  9599. <code>true</code> if they are within the provided epsilon,
  9600. <code>false</code> otherwise.
  9601. * @param [left] - The first matrix.
  9602. * @param [right] - The second matrix.
  9603. * @param [epsilon = 0] - The epsilon to use for equality testing.
  9604. * @returns <code>true</code> if left and right are within the provided epsilon, <code>false</code> otherwise.
  9605. */
  9606. static equalsEpsilon(left?: Matrix2, right?: Matrix2, epsilon?: number): boolean;
  9607. /**
  9608. * An immutable Matrix2 instance initialized to the identity matrix.
  9609. */
  9610. static readonly IDENTITY: Matrix2;
  9611. /**
  9612. * An immutable Matrix2 instance initialized to the zero matrix.
  9613. */
  9614. static readonly ZERO: Matrix2;
  9615. /**
  9616. * The index into Matrix2 for column 0, row 0.
  9617. * @example
  9618. * var matrix = new Cesium.Matrix2();
  9619. matrix[Cesium.Matrix2.COLUMN0ROW0] = 5.0; // set column 0, row 0 to 5.0
  9620. */
  9621. static readonly COLUMN0ROW0: number;
  9622. /**
  9623. * The index into Matrix2 for column 0, row 1.
  9624. * @example
  9625. * var matrix = new Cesium.Matrix2();
  9626. matrix[Cesium.Matrix2.COLUMN0ROW1] = 5.0; // set column 0, row 1 to 5.0
  9627. */
  9628. static readonly COLUMN0ROW1: number;
  9629. /**
  9630. * The index into Matrix2 for column 1, row 0.
  9631. * @example
  9632. * var matrix = new Cesium.Matrix2();
  9633. matrix[Cesium.Matrix2.COLUMN1ROW0] = 5.0; // set column 1, row 0 to 5.0
  9634. */
  9635. static readonly COLUMN1ROW0: number;
  9636. /**
  9637. * The index into Matrix2 for column 1, row 1.
  9638. * @example
  9639. * var matrix = new Cesium.Matrix2();
  9640. matrix[Cesium.Matrix2.COLUMN1ROW1] = 5.0; // set column 1, row 1 to 5.0
  9641. */
  9642. static readonly COLUMN1ROW1: number;
  9643. /**
  9644. * Gets the number of items in the collection.
  9645. */
  9646. length: number;
  9647. /**
  9648. * Duplicates the provided Matrix2 instance.
  9649. * @param [result] - The object onto which to store the result.
  9650. * @returns The modified result parameter or a new Matrix2 instance if one was not provided.
  9651. */
  9652. clone(result?: Matrix2): Matrix2;
  9653. /**
  9654. * Compares this matrix to the provided matrix componentwise and returns
  9655. <code>true</code> if they are equal, <code>false</code> otherwise.
  9656. * @param [right] - The right hand side matrix.
  9657. * @returns <code>true</code> if they are equal, <code>false</code> otherwise.
  9658. */
  9659. equals(right?: Matrix2): boolean;
  9660. /**
  9661. * Compares this matrix to the provided matrix componentwise and returns
  9662. <code>true</code> if they are within the provided epsilon,
  9663. <code>false</code> otherwise.
  9664. * @param [right] - The right hand side matrix.
  9665. * @param [epsilon = 0] - The epsilon to use for equality testing.
  9666. * @returns <code>true</code> if they are within the provided epsilon, <code>false</code> otherwise.
  9667. */
  9668. equalsEpsilon(right?: Matrix2, epsilon?: number): boolean;
  9669. /**
  9670. * Creates a string representing this Matrix with each row being
  9671. on a separate line and in the format '(column0, column1)'.
  9672. * @returns A string representing the provided Matrix with each row being on a separate line and in the format '(column0, column1)'.
  9673. */
  9674. toString(): string;
  9675. }
  9676. export interface Matrix3 extends ArrayLike<number> {
  9677. }
  9678. /**
  9679. * A 3x3 matrix, indexable as a column-major order array.
  9680. Constructor parameters are in row-major order for code readability.
  9681. * @param [column0Row0 = 0.0] - The value for column 0, row 0.
  9682. * @param [column1Row0 = 0.0] - The value for column 1, row 0.
  9683. * @param [column2Row0 = 0.0] - The value for column 2, row 0.
  9684. * @param [column0Row1 = 0.0] - The value for column 0, row 1.
  9685. * @param [column1Row1 = 0.0] - The value for column 1, row 1.
  9686. * @param [column2Row1 = 0.0] - The value for column 2, row 1.
  9687. * @param [column0Row2 = 0.0] - The value for column 0, row 2.
  9688. * @param [column1Row2 = 0.0] - The value for column 1, row 2.
  9689. * @param [column2Row2 = 0.0] - The value for column 2, row 2.
  9690. */
  9691. export class Matrix3 implements ArrayLike<number> {
  9692. constructor(column0Row0?: number, column1Row0?: number, column2Row0?: number, column0Row1?: number, column1Row1?: number, column2Row1?: number, column0Row2?: number, column1Row2?: number, column2Row2?: number);
  9693. /**
  9694. * The number of elements used to pack the object into an array.
  9695. */
  9696. static packedLength: number;
  9697. /**
  9698. * Stores the provided instance into the provided array.
  9699. * @param value - The value to pack.
  9700. * @param array - The array to pack into.
  9701. * @param [startingIndex = 0] - The index into the array at which to start packing the elements.
  9702. * @returns The array that was packed into
  9703. */
  9704. static pack(value: Matrix3, array: number[], startingIndex?: number): number[];
  9705. /**
  9706. * Retrieves an instance from a packed array.
  9707. * @param array - The packed array.
  9708. * @param [startingIndex = 0] - The starting index of the element to be unpacked.
  9709. * @param [result] - The object into which to store the result.
  9710. * @returns The modified result parameter or a new Matrix3 instance if one was not provided.
  9711. */
  9712. static unpack(array: number[], startingIndex?: number, result?: Matrix3): Matrix3;
  9713. /**
  9714. * Duplicates a Matrix3 instance.
  9715. * @param matrix - The matrix to duplicate.
  9716. * @param [result] - The object onto which to store the result.
  9717. * @returns The modified result parameter or a new Matrix3 instance if one was not provided. (Returns undefined if matrix is undefined)
  9718. */
  9719. static clone(matrix: Matrix3, result?: Matrix3): Matrix3;
  9720. /**
  9721. * Creates a Matrix3 from 9 consecutive elements in an array.
  9722. * @example
  9723. * // Create the Matrix3:
  9724. // [1.0, 2.0, 3.0]
  9725. // [1.0, 2.0, 3.0]
  9726. // [1.0, 2.0, 3.0]
  9727. var v = [1.0, 1.0, 1.0, 2.0, 2.0, 2.0, 3.0, 3.0, 3.0];
  9728. var m = Cesium.Matrix3.fromArray(v);
  9729. // Create same Matrix3 with using an offset into an array
  9730. var v2 = [0.0, 0.0, 1.0, 1.0, 1.0, 2.0, 2.0, 2.0, 3.0, 3.0, 3.0];
  9731. var m2 = Cesium.Matrix3.fromArray(v2, 2);
  9732. * @param array - The array whose 9 consecutive elements correspond to the positions of the matrix. Assumes column-major order.
  9733. * @param [startingIndex = 0] - The offset into the array of the first element, which corresponds to first column first row position in the matrix.
  9734. * @param [result] - The object onto which to store the result.
  9735. * @returns The modified result parameter or a new Matrix3 instance if one was not provided.
  9736. */
  9737. static fromArray(array: number[], startingIndex?: number, result?: Matrix3): Matrix3;
  9738. /**
  9739. * Creates a Matrix3 instance from a column-major order array.
  9740. * @param values - The column-major order array.
  9741. * @param [result] - The object in which the result will be stored, if undefined a new instance will be created.
  9742. * @returns The modified result parameter, or a new Matrix3 instance if one was not provided.
  9743. */
  9744. static fromColumnMajorArray(values: number[], result?: Matrix3): Matrix3;
  9745. /**
  9746. * Creates a Matrix3 instance from a row-major order array.
  9747. The resulting matrix will be in column-major order.
  9748. * @param values - The row-major order array.
  9749. * @param [result] - The object in which the result will be stored, if undefined a new instance will be created.
  9750. * @returns The modified result parameter, or a new Matrix3 instance if one was not provided.
  9751. */
  9752. static fromRowMajorArray(values: number[], result?: Matrix3): Matrix3;
  9753. /**
  9754. * Computes a 3x3 rotation matrix from the provided quaternion.
  9755. * @param quaternion - the quaternion to use.
  9756. * @param [result] - The object in which the result will be stored, if undefined a new instance will be created.
  9757. * @returns The 3x3 rotation matrix from this quaternion.
  9758. */
  9759. static fromQuaternion(quaternion: Quaternion, result?: Matrix3): Matrix3;
  9760. /**
  9761. * Computes a 3x3 rotation matrix from the provided headingPitchRoll. (see http://en.wikipedia.org/wiki/Conversion_between_quaternions_and_Euler_angles )
  9762. * @param headingPitchRoll - the headingPitchRoll to use.
  9763. * @param [result] - The object in which the result will be stored, if undefined a new instance will be created.
  9764. * @returns The 3x3 rotation matrix from this headingPitchRoll.
  9765. */
  9766. static fromHeadingPitchRoll(headingPitchRoll: HeadingPitchRoll, result?: Matrix3): Matrix3;
  9767. /**
  9768. * Computes a Matrix3 instance representing a non-uniform scale.
  9769. * @example
  9770. * // Creates
  9771. // [7.0, 0.0, 0.0]
  9772. // [0.0, 8.0, 0.0]
  9773. // [0.0, 0.0, 9.0]
  9774. var m = Cesium.Matrix3.fromScale(new Cesium.Cartesian3(7.0, 8.0, 9.0));
  9775. * @param scale - The x, y, and z scale factors.
  9776. * @param [result] - The object in which the result will be stored, if undefined a new instance will be created.
  9777. * @returns The modified result parameter, or a new Matrix3 instance if one was not provided.
  9778. */
  9779. static fromScale(scale: Cartesian3, result?: Matrix3): Matrix3;
  9780. /**
  9781. * Computes a Matrix3 instance representing a uniform scale.
  9782. * @example
  9783. * // Creates
  9784. // [2.0, 0.0, 0.0]
  9785. // [0.0, 2.0, 0.0]
  9786. // [0.0, 0.0, 2.0]
  9787. var m = Cesium.Matrix3.fromUniformScale(2.0);
  9788. * @param scale - The uniform scale factor.
  9789. * @param [result] - The object in which the result will be stored, if undefined a new instance will be created.
  9790. * @returns The modified result parameter, or a new Matrix3 instance if one was not provided.
  9791. */
  9792. static fromUniformScale(scale: number, result?: Matrix3): Matrix3;
  9793. /**
  9794. * Computes a Matrix3 instance representing the cross product equivalent matrix of a Cartesian3 vector.
  9795. * @example
  9796. * // Creates
  9797. // [0.0, -9.0, 8.0]
  9798. // [9.0, 0.0, -7.0]
  9799. // [-8.0, 7.0, 0.0]
  9800. var m = Cesium.Matrix3.fromCrossProduct(new Cesium.Cartesian3(7.0, 8.0, 9.0));
  9801. * @param vector - the vector on the left hand side of the cross product operation.
  9802. * @param [result] - The object in which the result will be stored, if undefined a new instance will be created.
  9803. * @returns The modified result parameter, or a new Matrix3 instance if one was not provided.
  9804. */
  9805. static fromCrossProduct(vector: Cartesian3, result?: Matrix3): Matrix3;
  9806. /**
  9807. * Creates a rotation matrix around the x-axis.
  9808. * @example
  9809. * // Rotate a point 45 degrees counterclockwise around the x-axis.
  9810. var p = new Cesium.Cartesian3(5, 6, 7);
  9811. var m = Cesium.Matrix3.fromRotationX(Cesium.Math.toRadians(45.0));
  9812. var rotated = Cesium.Matrix3.multiplyByVector(m, p, new Cesium.Cartesian3());
  9813. * @param angle - The angle, in radians, of the rotation. Positive angles are counterclockwise.
  9814. * @param [result] - The object in which the result will be stored, if undefined a new instance will be created.
  9815. * @returns The modified result parameter, or a new Matrix3 instance if one was not provided.
  9816. */
  9817. static fromRotationX(angle: number, result?: Matrix3): Matrix3;
  9818. /**
  9819. * Creates a rotation matrix around the y-axis.
  9820. * @example
  9821. * // Rotate a point 45 degrees counterclockwise around the y-axis.
  9822. var p = new Cesium.Cartesian3(5, 6, 7);
  9823. var m = Cesium.Matrix3.fromRotationY(Cesium.Math.toRadians(45.0));
  9824. var rotated = Cesium.Matrix3.multiplyByVector(m, p, new Cesium.Cartesian3());
  9825. * @param angle - The angle, in radians, of the rotation. Positive angles are counterclockwise.
  9826. * @param [result] - The object in which the result will be stored, if undefined a new instance will be created.
  9827. * @returns The modified result parameter, or a new Matrix3 instance if one was not provided.
  9828. */
  9829. static fromRotationY(angle: number, result?: Matrix3): Matrix3;
  9830. /**
  9831. * Creates a rotation matrix around the z-axis.
  9832. * @example
  9833. * // Rotate a point 45 degrees counterclockwise around the z-axis.
  9834. var p = new Cesium.Cartesian3(5, 6, 7);
  9835. var m = Cesium.Matrix3.fromRotationZ(Cesium.Math.toRadians(45.0));
  9836. var rotated = Cesium.Matrix3.multiplyByVector(m, p, new Cesium.Cartesian3());
  9837. * @param angle - The angle, in radians, of the rotation. Positive angles are counterclockwise.
  9838. * @param [result] - The object in which the result will be stored, if undefined a new instance will be created.
  9839. * @returns The modified result parameter, or a new Matrix3 instance if one was not provided.
  9840. */
  9841. static fromRotationZ(angle: number, result?: Matrix3): Matrix3;
  9842. /**
  9843. * Creates an Array from the provided Matrix3 instance.
  9844. The array will be in column-major order.
  9845. * @param matrix - The matrix to use..
  9846. * @param [result] - The Array onto which to store the result.
  9847. * @returns The modified Array parameter or a new Array instance if one was not provided.
  9848. */
  9849. static toArray(matrix: Matrix3, result?: number[]): number[];
  9850. /**
  9851. * Computes the array index of the element at the provided row and column.
  9852. * @example
  9853. * var myMatrix = new Cesium.Matrix3();
  9854. var column1Row0Index = Cesium.Matrix3.getElementIndex(1, 0);
  9855. var column1Row0 = myMatrix[column1Row0Index]
  9856. myMatrix[column1Row0Index] = 10.0;
  9857. * @param row - The zero-based index of the row.
  9858. * @param column - The zero-based index of the column.
  9859. * @returns The index of the element at the provided row and column.
  9860. */
  9861. static getElementIndex(row: number, column: number): number;
  9862. /**
  9863. * Retrieves a copy of the matrix column at the provided index as a Cartesian3 instance.
  9864. * @param matrix - The matrix to use.
  9865. * @param index - The zero-based index of the column to retrieve.
  9866. * @param result - The object onto which to store the result.
  9867. * @returns The modified result parameter.
  9868. */
  9869. static getColumn(matrix: Matrix3, index: number, result: Cartesian3): Cartesian3;
  9870. /**
  9871. * Computes a new matrix that replaces the specified column in the provided matrix with the provided Cartesian3 instance.
  9872. * @param matrix - The matrix to use.
  9873. * @param index - The zero-based index of the column to set.
  9874. * @param cartesian - The Cartesian whose values will be assigned to the specified column.
  9875. * @param result - The object onto which to store the result.
  9876. * @returns The modified result parameter.
  9877. */
  9878. static setColumn(matrix: Matrix3, index: number, cartesian: Cartesian3, result: Matrix3): Matrix3;
  9879. /**
  9880. * Retrieves a copy of the matrix row at the provided index as a Cartesian3 instance.
  9881. * @param matrix - The matrix to use.
  9882. * @param index - The zero-based index of the row to retrieve.
  9883. * @param result - The object onto which to store the result.
  9884. * @returns The modified result parameter.
  9885. */
  9886. static getRow(matrix: Matrix3, index: number, result: Cartesian3): Cartesian3;
  9887. /**
  9888. * Computes a new matrix that replaces the specified row in the provided matrix with the provided Cartesian3 instance.
  9889. * @param matrix - The matrix to use.
  9890. * @param index - The zero-based index of the row to set.
  9891. * @param cartesian - The Cartesian whose values will be assigned to the specified row.
  9892. * @param result - The object onto which to store the result.
  9893. * @returns The modified result parameter.
  9894. */
  9895. static setRow(matrix: Matrix3, index: number, cartesian: Cartesian3, result: Matrix3): Matrix3;
  9896. /**
  9897. * Extracts the non-uniform scale assuming the matrix is an affine transformation.
  9898. * @param matrix - The matrix.
  9899. * @param result - The object onto which to store the result.
  9900. * @returns The modified result parameter.
  9901. */
  9902. static getScale(matrix: Matrix3, result: Cartesian3): Cartesian3;
  9903. /**
  9904. * Computes the maximum scale assuming the matrix is an affine transformation.
  9905. The maximum scale is the maximum length of the column vectors.
  9906. * @param matrix - The matrix.
  9907. * @returns The maximum scale.
  9908. */
  9909. static getMaximumScale(matrix: Matrix3): number;
  9910. /**
  9911. * Computes the product of two matrices.
  9912. * @param left - The first matrix.
  9913. * @param right - The second matrix.
  9914. * @param result - The object onto which to store the result.
  9915. * @returns The modified result parameter.
  9916. */
  9917. static multiply(left: Matrix3, right: Matrix3, result: Matrix3): Matrix3;
  9918. /**
  9919. * Computes the sum of two matrices.
  9920. * @param left - The first matrix.
  9921. * @param right - The second matrix.
  9922. * @param result - The object onto which to store the result.
  9923. * @returns The modified result parameter.
  9924. */
  9925. static add(left: Matrix3, right: Matrix3, result: Matrix3): Matrix3;
  9926. /**
  9927. * Computes the difference of two matrices.
  9928. * @param left - The first matrix.
  9929. * @param right - The second matrix.
  9930. * @param result - The object onto which to store the result.
  9931. * @returns The modified result parameter.
  9932. */
  9933. static subtract(left: Matrix3, right: Matrix3, result: Matrix3): Matrix3;
  9934. /**
  9935. * Computes the product of a matrix and a column vector.
  9936. * @param matrix - The matrix.
  9937. * @param cartesian - The column.
  9938. * @param result - The object onto which to store the result.
  9939. * @returns The modified result parameter.
  9940. */
  9941. static multiplyByVector(matrix: Matrix3, cartesian: Cartesian3, result: Cartesian3): Cartesian3;
  9942. /**
  9943. * Computes the product of a matrix and a scalar.
  9944. * @param matrix - The matrix.
  9945. * @param scalar - The number to multiply by.
  9946. * @param result - The object onto which to store the result.
  9947. * @returns The modified result parameter.
  9948. */
  9949. static multiplyByScalar(matrix: Matrix3, scalar: number, result: Matrix3): Matrix3;
  9950. /**
  9951. * Computes the product of a matrix times a (non-uniform) scale, as if the scale were a scale matrix.
  9952. * @example
  9953. * // Instead of Cesium.Matrix3.multiply(m, Cesium.Matrix3.fromScale(scale), m);
  9954. Cesium.Matrix3.multiplyByScale(m, scale, m);
  9955. * @param matrix - The matrix on the left-hand side.
  9956. * @param scale - The non-uniform scale on the right-hand side.
  9957. * @param result - The object onto which to store the result.
  9958. * @returns The modified result parameter.
  9959. */
  9960. static multiplyByScale(matrix: Matrix3, scale: Cartesian3, result: Matrix3): Matrix3;
  9961. /**
  9962. * Creates a negated copy of the provided matrix.
  9963. * @param matrix - The matrix to negate.
  9964. * @param result - The object onto which to store the result.
  9965. * @returns The modified result parameter.
  9966. */
  9967. static negate(matrix: Matrix3, result: Matrix3): Matrix3;
  9968. /**
  9969. * Computes the transpose of the provided matrix.
  9970. * @param matrix - The matrix to transpose.
  9971. * @param result - The object onto which to store the result.
  9972. * @returns The modified result parameter.
  9973. */
  9974. static transpose(matrix: Matrix3, result: Matrix3): Matrix3;
  9975. /**
  9976. * Extracts the rotation assuming the matrix is an affine transformation.
  9977. * @param matrix - The matrix.
  9978. * @param result - The object onto which to store the result.
  9979. * @returns The modified result parameter
  9980. */
  9981. static getRotation(matrix: Matrix3, result: Matrix3): Matrix3;
  9982. /**
  9983. * Computes the eigenvectors and eigenvalues of a symmetric matrix.
  9984. <p>
  9985. Returns a diagonal matrix and unitary matrix such that:
  9986. <code>matrix = unitary matrix * diagonal matrix * transpose(unitary matrix)</code>
  9987. </p>
  9988. <p>
  9989. The values along the diagonal of the diagonal matrix are the eigenvalues. The columns
  9990. of the unitary matrix are the corresponding eigenvectors.
  9991. </p>
  9992. * @example
  9993. * var a = //... symetric matrix
  9994. var result = {
  9995. unitary : new Cesium.Matrix3(),
  9996. diagonal : new Cesium.Matrix3()
  9997. };
  9998. Cesium.Matrix3.computeEigenDecomposition(a, result);
  9999. var unitaryTranspose = Cesium.Matrix3.transpose(result.unitary, new Cesium.Matrix3());
  10000. var b = Cesium.Matrix3.multiply(result.unitary, result.diagonal, new Cesium.Matrix3());
  10001. Cesium.Matrix3.multiply(b, unitaryTranspose, b); // b is now equal to a
  10002. var lambda = Cesium.Matrix3.getColumn(result.diagonal, 0, new Cesium.Cartesian3()).x; // first eigenvalue
  10003. var v = Cesium.Matrix3.getColumn(result.unitary, 0, new Cesium.Cartesian3()); // first eigenvector
  10004. var c = Cesium.Cartesian3.multiplyByScalar(v, lambda, new Cesium.Cartesian3()); // equal to Cesium.Matrix3.multiplyByVector(a, v)
  10005. * @param matrix - The matrix to decompose into diagonal and unitary matrix. Expected to be symmetric.
  10006. * @param [result] - An object with unitary and diagonal properties which are matrices onto which to store the result.
  10007. * @returns An object with unitary and diagonal properties which are the unitary and diagonal matrices, respectively.
  10008. */
  10009. static computeEigenDecomposition(matrix: Matrix3, result?: any): any;
  10010. /**
  10011. * Computes a matrix, which contains the absolute (unsigned) values of the provided matrix's elements.
  10012. * @param matrix - The matrix with signed elements.
  10013. * @param result - The object onto which to store the result.
  10014. * @returns The modified result parameter.
  10015. */
  10016. static abs(matrix: Matrix3, result: Matrix3): Matrix3;
  10017. /**
  10018. * Computes the determinant of the provided matrix.
  10019. * @param matrix - The matrix to use.
  10020. * @returns The value of the determinant of the matrix.
  10021. */
  10022. static determinant(matrix: Matrix3): number;
  10023. /**
  10024. * Computes the inverse of the provided matrix.
  10025. * @param matrix - The matrix to invert.
  10026. * @param result - The object onto which to store the result.
  10027. * @returns The modified result parameter.
  10028. */
  10029. static inverse(matrix: Matrix3, result: Matrix3): Matrix3;
  10030. /**
  10031. * Computes the inverse transpose of a matrix.
  10032. * @param matrix - The matrix to transpose and invert.
  10033. * @param result - The object onto which to store the result.
  10034. * @returns The modified result parameter.
  10035. */
  10036. static inverseTranspose(matrix: Matrix3, result: Matrix3): Matrix3;
  10037. /**
  10038. * Compares the provided matrices componentwise and returns
  10039. <code>true</code> if they are equal, <code>false</code> otherwise.
  10040. * @param [left] - The first matrix.
  10041. * @param [right] - The second matrix.
  10042. * @returns <code>true</code> if left and right are equal, <code>false</code> otherwise.
  10043. */
  10044. static equals(left?: Matrix3, right?: Matrix3): boolean;
  10045. /**
  10046. * Compares the provided matrices componentwise and returns
  10047. <code>true</code> if they are within the provided epsilon,
  10048. <code>false</code> otherwise.
  10049. * @param [left] - The first matrix.
  10050. * @param [right] - The second matrix.
  10051. * @param [epsilon = 0] - The epsilon to use for equality testing.
  10052. * @returns <code>true</code> if left and right are within the provided epsilon, <code>false</code> otherwise.
  10053. */
  10054. static equalsEpsilon(left?: Matrix3, right?: Matrix3, epsilon?: number): boolean;
  10055. /**
  10056. * An immutable Matrix3 instance initialized to the identity matrix.
  10057. */
  10058. static readonly IDENTITY: Matrix3;
  10059. /**
  10060. * An immutable Matrix3 instance initialized to the zero matrix.
  10061. */
  10062. static readonly ZERO: Matrix3;
  10063. /**
  10064. * The index into Matrix3 for column 0, row 0.
  10065. */
  10066. static readonly COLUMN0ROW0: number;
  10067. /**
  10068. * The index into Matrix3 for column 0, row 1.
  10069. */
  10070. static readonly COLUMN0ROW1: number;
  10071. /**
  10072. * The index into Matrix3 for column 0, row 2.
  10073. */
  10074. static readonly COLUMN0ROW2: number;
  10075. /**
  10076. * The index into Matrix3 for column 1, row 0.
  10077. */
  10078. static readonly COLUMN1ROW0: number;
  10079. /**
  10080. * The index into Matrix3 for column 1, row 1.
  10081. */
  10082. static readonly COLUMN1ROW1: number;
  10083. /**
  10084. * The index into Matrix3 for column 1, row 2.
  10085. */
  10086. static readonly COLUMN1ROW2: number;
  10087. /**
  10088. * The index into Matrix3 for column 2, row 0.
  10089. */
  10090. static readonly COLUMN2ROW0: number;
  10091. /**
  10092. * The index into Matrix3 for column 2, row 1.
  10093. */
  10094. static readonly COLUMN2ROW1: number;
  10095. /**
  10096. * The index into Matrix3 for column 2, row 2.
  10097. */
  10098. static readonly COLUMN2ROW2: number;
  10099. /**
  10100. * Gets the number of items in the collection.
  10101. */
  10102. length: number;
  10103. /**
  10104. * Duplicates the provided Matrix3 instance.
  10105. * @param [result] - The object onto which to store the result.
  10106. * @returns The modified result parameter or a new Matrix3 instance if one was not provided.
  10107. */
  10108. clone(result?: Matrix3): Matrix3;
  10109. /**
  10110. * Compares this matrix to the provided matrix componentwise and returns
  10111. <code>true</code> if they are equal, <code>false</code> otherwise.
  10112. * @param [right] - The right hand side matrix.
  10113. * @returns <code>true</code> if they are equal, <code>false</code> otherwise.
  10114. */
  10115. equals(right?: Matrix3): boolean;
  10116. /**
  10117. * Compares this matrix to the provided matrix componentwise and returns
  10118. <code>true</code> if they are within the provided epsilon,
  10119. <code>false</code> otherwise.
  10120. * @param [right] - The right hand side matrix.
  10121. * @param [epsilon = 0] - The epsilon to use for equality testing.
  10122. * @returns <code>true</code> if they are within the provided epsilon, <code>false</code> otherwise.
  10123. */
  10124. equalsEpsilon(right?: Matrix3, epsilon?: number): boolean;
  10125. /**
  10126. * Creates a string representing this Matrix with each row being
  10127. on a separate line and in the format '(column0, column1, column2)'.
  10128. * @returns A string representing the provided Matrix with each row being on a separate line and in the format '(column0, column1, column2)'.
  10129. */
  10130. toString(): string;
  10131. }
  10132. export interface Matrix4 extends ArrayLike<number> {
  10133. }
  10134. /**
  10135. * A 4x4 matrix, indexable as a column-major order array.
  10136. Constructor parameters are in row-major order for code readability.
  10137. * @param [column0Row0 = 0.0] - The value for column 0, row 0.
  10138. * @param [column1Row0 = 0.0] - The value for column 1, row 0.
  10139. * @param [column2Row0 = 0.0] - The value for column 2, row 0.
  10140. * @param [column3Row0 = 0.0] - The value for column 3, row 0.
  10141. * @param [column0Row1 = 0.0] - The value for column 0, row 1.
  10142. * @param [column1Row1 = 0.0] - The value for column 1, row 1.
  10143. * @param [column2Row1 = 0.0] - The value for column 2, row 1.
  10144. * @param [column3Row1 = 0.0] - The value for column 3, row 1.
  10145. * @param [column0Row2 = 0.0] - The value for column 0, row 2.
  10146. * @param [column1Row2 = 0.0] - The value for column 1, row 2.
  10147. * @param [column2Row2 = 0.0] - The value for column 2, row 2.
  10148. * @param [column3Row2 = 0.0] - The value for column 3, row 2.
  10149. * @param [column0Row3 = 0.0] - The value for column 0, row 3.
  10150. * @param [column1Row3 = 0.0] - The value for column 1, row 3.
  10151. * @param [column2Row3 = 0.0] - The value for column 2, row 3.
  10152. * @param [column3Row3 = 0.0] - The value for column 3, row 3.
  10153. */
  10154. export class Matrix4 implements ArrayLike<number> {
  10155. 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);
  10156. /**
  10157. * The number of elements used to pack the object into an array.
  10158. */
  10159. static packedLength: number;
  10160. /**
  10161. * Stores the provided instance into the provided array.
  10162. * @param value - The value to pack.
  10163. * @param array - The array to pack into.
  10164. * @param [startingIndex = 0] - The index into the array at which to start packing the elements.
  10165. * @returns The array that was packed into
  10166. */
  10167. static pack(value: Matrix4, array: number[], startingIndex?: number): number[];
  10168. /**
  10169. * Retrieves an instance from a packed array.
  10170. * @param array - The packed array.
  10171. * @param [startingIndex = 0] - The starting index of the element to be unpacked.
  10172. * @param [result] - The object into which to store the result.
  10173. * @returns The modified result parameter or a new Matrix4 instance if one was not provided.
  10174. */
  10175. static unpack(array: number[], startingIndex?: number, result?: Matrix4): Matrix4;
  10176. /**
  10177. * Duplicates a Matrix4 instance.
  10178. * @param matrix - The matrix to duplicate.
  10179. * @param [result] - The object onto which to store the result.
  10180. * @returns The modified result parameter or a new Matrix4 instance if one was not provided. (Returns undefined if matrix is undefined)
  10181. */
  10182. static clone(matrix: Matrix4, result?: Matrix4): Matrix4;
  10183. /**
  10184. * Creates a Matrix4 from 16 consecutive elements in an array.
  10185. * @example
  10186. * // Create the Matrix4:
  10187. // [1.0, 2.0, 3.0, 4.0]
  10188. // [1.0, 2.0, 3.0, 4.0]
  10189. // [1.0, 2.0, 3.0, 4.0]
  10190. // [1.0, 2.0, 3.0, 4.0]
  10191. 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];
  10192. var m = Cesium.Matrix4.fromArray(v);
  10193. // Create same Matrix4 with using an offset into an array
  10194. 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];
  10195. var m2 = Cesium.Matrix4.fromArray(v2, 2);
  10196. * @param array - The array whose 16 consecutive elements correspond to the positions of the matrix. Assumes column-major order.
  10197. * @param [startingIndex = 0] - The offset into the array of the first element, which corresponds to first column first row position in the matrix.
  10198. * @param [result] - The object onto which to store the result.
  10199. * @returns The modified result parameter or a new Matrix4 instance if one was not provided.
  10200. */
  10201. static fromArray(array: number[], startingIndex?: number, result?: Matrix4): Matrix4;
  10202. /**
  10203. * Computes a Matrix4 instance from a column-major order array.
  10204. * @param values - The column-major order array.
  10205. * @param [result] - The object in which the result will be stored, if undefined a new instance will be created.
  10206. * @returns The modified result parameter, or a new Matrix4 instance if one was not provided.
  10207. */
  10208. static fromColumnMajorArray(values: number[], result?: Matrix4): Matrix4;
  10209. /**
  10210. * Computes a Matrix4 instance from a row-major order array.
  10211. The resulting matrix will be in column-major order.
  10212. * @param values - The row-major order array.
  10213. * @param [result] - The object in which the result will be stored, if undefined a new instance will be created.
  10214. * @returns The modified result parameter, or a new Matrix4 instance if one was not provided.
  10215. */
  10216. static fromRowMajorArray(values: number[], result?: Matrix4): Matrix4;
  10217. /**
  10218. * Computes a Matrix4 instance from a Matrix3 representing the rotation
  10219. and a Cartesian3 representing the translation.
  10220. * @param rotation - The upper left portion of the matrix representing the rotation.
  10221. * @param [translation = Cartesian3.ZERO] - The upper right portion of the matrix representing the translation.
  10222. * @param [result] - The object in which the result will be stored, if undefined a new instance will be created.
  10223. * @returns The modified result parameter, or a new Matrix4 instance if one was not provided.
  10224. */
  10225. static fromRotationTranslation(rotation: Matrix3, translation?: Cartesian3, result?: Matrix4): Matrix4;
  10226. /**
  10227. * Computes a Matrix4 instance from a translation, rotation, and scale (TRS)
  10228. representation with the rotation represented as a quaternion.
  10229. * @example
  10230. * var result = Cesium.Matrix4.fromTranslationQuaternionRotationScale(
  10231. new Cesium.Cartesian3(1.0, 2.0, 3.0), // translation
  10232. Cesium.Quaternion.IDENTITY, // rotation
  10233. new Cesium.Cartesian3(7.0, 8.0, 9.0), // scale
  10234. result);
  10235. * @param translation - The translation transformation.
  10236. * @param rotation - The rotation transformation.
  10237. * @param scale - The non-uniform scale transformation.
  10238. * @param [result] - The object in which the result will be stored, if undefined a new instance will be created.
  10239. * @returns The modified result parameter, or a new Matrix4 instance if one was not provided.
  10240. */
  10241. static fromTranslationQuaternionRotationScale(translation: Cartesian3, rotation: Quaternion, scale: Cartesian3, result?: Matrix4): Matrix4;
  10242. /**
  10243. * Creates a Matrix4 instance from a {@link TranslationRotationScale} instance.
  10244. * @param translationRotationScale - The instance.
  10245. * @param [result] - The object in which the result will be stored, if undefined a new instance will be created.
  10246. * @returns The modified result parameter, or a new Matrix4 instance if one was not provided.
  10247. */
  10248. static fromTranslationRotationScale(translationRotationScale: TranslationRotationScale, result?: Matrix4): Matrix4;
  10249. /**
  10250. * Creates a Matrix4 instance from a Cartesian3 representing the translation.
  10251. * @param translation - The upper right portion of the matrix representing the translation.
  10252. * @param [result] - The object in which the result will be stored, if undefined a new instance will be created.
  10253. * @returns The modified result parameter, or a new Matrix4 instance if one was not provided.
  10254. */
  10255. static fromTranslation(translation: Cartesian3, result?: Matrix4): Matrix4;
  10256. /**
  10257. * Computes a Matrix4 instance representing a non-uniform scale.
  10258. * @example
  10259. * // Creates
  10260. // [7.0, 0.0, 0.0, 0.0]
  10261. // [0.0, 8.0, 0.0, 0.0]
  10262. // [0.0, 0.0, 9.0, 0.0]
  10263. // [0.0, 0.0, 0.0, 1.0]
  10264. var m = Cesium.Matrix4.fromScale(new Cesium.Cartesian3(7.0, 8.0, 9.0));
  10265. * @param scale - The x, y, and z scale factors.
  10266. * @param [result] - The object in which the result will be stored, if undefined a new instance will be created.
  10267. * @returns The modified result parameter, or a new Matrix4 instance if one was not provided.
  10268. */
  10269. static fromScale(scale: Cartesian3, result?: Matrix4): Matrix4;
  10270. /**
  10271. * Computes a Matrix4 instance representing a uniform scale.
  10272. * @example
  10273. * // Creates
  10274. // [2.0, 0.0, 0.0, 0.0]
  10275. // [0.0, 2.0, 0.0, 0.0]
  10276. // [0.0, 0.0, 2.0, 0.0]
  10277. // [0.0, 0.0, 0.0, 1.0]
  10278. var m = Cesium.Matrix4.fromUniformScale(2.0);
  10279. * @param scale - The uniform scale factor.
  10280. * @param [result] - The object in which the result will be stored, if undefined a new instance will be created.
  10281. * @returns The modified result parameter, or a new Matrix4 instance if one was not provided.
  10282. */
  10283. static fromUniformScale(scale: number, result?: Matrix4): Matrix4;
  10284. /**
  10285. * Computes a Matrix4 instance from a Camera.
  10286. * @param camera - The camera to use.
  10287. * @param [result] - The object in which the result will be stored, if undefined a new instance will be created.
  10288. * @returns The modified result parameter, or a new Matrix4 instance if one was not provided.
  10289. */
  10290. static fromCamera(camera: Camera, result?: Matrix4): Matrix4;
  10291. /**
  10292. * Computes a Matrix4 instance representing a perspective transformation matrix.
  10293. * @param fovY - The field of view along the Y axis in radians.
  10294. * @param aspectRatio - The aspect ratio.
  10295. * @param near - The distance to the near plane in meters.
  10296. * @param far - The distance to the far plane in meters.
  10297. * @param result - The object in which the result will be stored.
  10298. * @returns The modified result parameter.
  10299. */
  10300. static computePerspectiveFieldOfView(fovY: number, aspectRatio: number, near: number, far: number, result: Matrix4): Matrix4;
  10301. /**
  10302. * Computes a Matrix4 instance representing an orthographic transformation matrix.
  10303. * @param left - The number of meters to the left of the camera that will be in view.
  10304. * @param right - The number of meters to the right of the camera that will be in view.
  10305. * @param bottom - The number of meters below of the camera that will be in view.
  10306. * @param top - The number of meters above of the camera that will be in view.
  10307. * @param near - The distance to the near plane in meters.
  10308. * @param far - The distance to the far plane in meters.
  10309. * @param result - The object in which the result will be stored.
  10310. * @returns The modified result parameter.
  10311. */
  10312. static computeOrthographicOffCenter(left: number, right: number, bottom: number, top: number, near: number, far: number, result: Matrix4): Matrix4;
  10313. /**
  10314. * Computes a Matrix4 instance representing an off center perspective transformation.
  10315. * @param left - The number of meters to the left of the camera that will be in view.
  10316. * @param right - The number of meters to the right of the camera that will be in view.
  10317. * @param bottom - The number of meters below of the camera that will be in view.
  10318. * @param top - The number of meters above of the camera that will be in view.
  10319. * @param near - The distance to the near plane in meters.
  10320. * @param far - The distance to the far plane in meters.
  10321. * @param result - The object in which the result will be stored.
  10322. * @returns The modified result parameter.
  10323. */
  10324. static computePerspectiveOffCenter(left: number, right: number, bottom: number, top: number, near: number, far: number, result: Matrix4): Matrix4;
  10325. /**
  10326. * Computes a Matrix4 instance representing an infinite off center perspective transformation.
  10327. * @param left - The number of meters to the left of the camera that will be in view.
  10328. * @param right - The number of meters to the right of the camera that will be in view.
  10329. * @param bottom - The number of meters below of the camera that will be in view.
  10330. * @param top - The number of meters above of the camera that will be in view.
  10331. * @param near - The distance to the near plane in meters.
  10332. * @param result - The object in which the result will be stored.
  10333. * @returns The modified result parameter.
  10334. */
  10335. static computeInfinitePerspectiveOffCenter(left: number, right: number, bottom: number, top: number, near: number, result: Matrix4): Matrix4;
  10336. /**
  10337. * Computes a Matrix4 instance that transforms from normalized device coordinates to window coordinates.
  10338. * @example
  10339. * // Create viewport transformation using an explicit viewport and depth range.
  10340. var m = Cesium.Matrix4.computeViewportTransformation({
  10341. x : 0.0,
  10342. y : 0.0,
  10343. width : 1024.0,
  10344. height : 768.0
  10345. }, 0.0, 1.0, new Cesium.Matrix4());
  10346. * @param [viewport = { x : 0.0, y : 0.0, width : 0.0, height : 0.0 }] - The viewport's corners as shown in Example 1.
  10347. * @param [nearDepthRange = 0.0] - The near plane distance in window coordinates.
  10348. * @param [farDepthRange = 1.0] - The far plane distance in window coordinates.
  10349. * @param [result] - The object in which the result will be stored.
  10350. * @returns The modified result parameter.
  10351. */
  10352. static computeViewportTransformation(viewport?: any, nearDepthRange?: number, farDepthRange?: number, result?: Matrix4): Matrix4;
  10353. /**
  10354. * Computes a Matrix4 instance that transforms from world space to view space.
  10355. * @param position - The position of the camera.
  10356. * @param direction - The forward direction.
  10357. * @param up - The up direction.
  10358. * @param right - The right direction.
  10359. * @param result - The object in which the result will be stored.
  10360. * @returns The modified result parameter.
  10361. */
  10362. static computeView(position: Cartesian3, direction: Cartesian3, up: Cartesian3, right: Cartesian3, result: Matrix4): Matrix4;
  10363. /**
  10364. * Computes an Array from the provided Matrix4 instance.
  10365. The array will be in column-major order.
  10366. * @example
  10367. * //create an array from an instance of Matrix4
  10368. // m = [10.0, 14.0, 18.0, 22.0]
  10369. // [11.0, 15.0, 19.0, 23.0]
  10370. // [12.0, 16.0, 20.0, 24.0]
  10371. // [13.0, 17.0, 21.0, 25.0]
  10372. var a = Cesium.Matrix4.toArray(m);
  10373. // m remains the same
  10374. //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]
  10375. * @param matrix - The matrix to use..
  10376. * @param [result] - The Array onto which to store the result.
  10377. * @returns The modified Array parameter or a new Array instance if one was not provided.
  10378. */
  10379. static toArray(matrix: Matrix4, result?: number[]): number[];
  10380. /**
  10381. * Computes the array index of the element at the provided row and column.
  10382. * @example
  10383. * var myMatrix = new Cesium.Matrix4();
  10384. var column1Row0Index = Cesium.Matrix4.getElementIndex(1, 0);
  10385. var column1Row0 = myMatrix[column1Row0Index];
  10386. myMatrix[column1Row0Index] = 10.0;
  10387. * @param row - The zero-based index of the row.
  10388. * @param column - The zero-based index of the column.
  10389. * @returns The index of the element at the provided row and column.
  10390. */
  10391. static getElementIndex(row: number, column: number): number;
  10392. /**
  10393. * Retrieves a copy of the matrix column at the provided index as a Cartesian4 instance.
  10394. * @example
  10395. * //returns a Cartesian4 instance with values from the specified column
  10396. // m = [10.0, 11.0, 12.0, 13.0]
  10397. // [14.0, 15.0, 16.0, 17.0]
  10398. // [18.0, 19.0, 20.0, 21.0]
  10399. // [22.0, 23.0, 24.0, 25.0]
  10400. //Example 1: Creates an instance of Cartesian
  10401. var a = Cesium.Matrix4.getColumn(m, 2, new Cesium.Cartesian4());
  10402. * @example
  10403. * //Example 2: Sets values for Cartesian instance
  10404. var a = new Cesium.Cartesian4();
  10405. Cesium.Matrix4.getColumn(m, 2, a);
  10406. // a.x = 12.0; a.y = 16.0; a.z = 20.0; a.w = 24.0;
  10407. * @param matrix - The matrix to use.
  10408. * @param index - The zero-based index of the column to retrieve.
  10409. * @param result - The object onto which to store the result.
  10410. * @returns The modified result parameter.
  10411. */
  10412. static getColumn(matrix: Matrix4, index: number, result: Cartesian4): Cartesian4;
  10413. /**
  10414. * Computes a new matrix that replaces the specified column in the provided matrix with the provided Cartesian4 instance.
  10415. * @example
  10416. * //creates a new Matrix4 instance with new column values from the Cartesian4 instance
  10417. // m = [10.0, 11.0, 12.0, 13.0]
  10418. // [14.0, 15.0, 16.0, 17.0]
  10419. // [18.0, 19.0, 20.0, 21.0]
  10420. // [22.0, 23.0, 24.0, 25.0]
  10421. var a = Cesium.Matrix4.setColumn(m, 2, new Cesium.Cartesian4(99.0, 98.0, 97.0, 96.0), new Cesium.Matrix4());
  10422. // m remains the same
  10423. // a = [10.0, 11.0, 99.0, 13.0]
  10424. // [14.0, 15.0, 98.0, 17.0]
  10425. // [18.0, 19.0, 97.0, 21.0]
  10426. // [22.0, 23.0, 96.0, 25.0]
  10427. * @param matrix - The matrix to use.
  10428. * @param index - The zero-based index of the column to set.
  10429. * @param cartesian - The Cartesian whose values will be assigned to the specified column.
  10430. * @param result - The object onto which to store the result.
  10431. * @returns The modified result parameter.
  10432. */
  10433. static setColumn(matrix: Matrix4, index: number, cartesian: Cartesian4, result: Matrix4): Matrix4;
  10434. /**
  10435. * Computes a new matrix that replaces the translation in the rightmost column of the provided
  10436. matrix with the provided translation. This assumes the matrix is an affine transformation
  10437. * @param matrix - The matrix to use.
  10438. * @param translation - The translation that replaces the translation of the provided matrix.
  10439. * @param result - The object onto which to store the result.
  10440. * @returns The modified result parameter.
  10441. */
  10442. static setTranslation(matrix: Matrix4, translation: Cartesian3, result: Matrix4): Matrix4;
  10443. /**
  10444. * Computes a new matrix that replaces the scale with the provided scale. This assumes the matrix is an affine transformation
  10445. * @param matrix - The matrix to use.
  10446. * @param scale - The scale that replaces the scale of the provided matrix.
  10447. * @param result - The object onto which to store the result.
  10448. * @returns The modified result parameter.
  10449. */
  10450. static setScale(matrix: Matrix4, scale: Cartesian3, result: Matrix4): Matrix4;
  10451. /**
  10452. * Retrieves a copy of the matrix row at the provided index as a Cartesian4 instance.
  10453. * @example
  10454. * //returns a Cartesian4 instance with values from the specified column
  10455. // m = [10.0, 11.0, 12.0, 13.0]
  10456. // [14.0, 15.0, 16.0, 17.0]
  10457. // [18.0, 19.0, 20.0, 21.0]
  10458. // [22.0, 23.0, 24.0, 25.0]
  10459. //Example 1: Returns an instance of Cartesian
  10460. var a = Cesium.Matrix4.getRow(m, 2, new Cesium.Cartesian4());
  10461. * @example
  10462. * //Example 2: Sets values for a Cartesian instance
  10463. var a = new Cesium.Cartesian4();
  10464. Cesium.Matrix4.getRow(m, 2, a);
  10465. // a.x = 18.0; a.y = 19.0; a.z = 20.0; a.w = 21.0;
  10466. * @param matrix - The matrix to use.
  10467. * @param index - The zero-based index of the row to retrieve.
  10468. * @param result - The object onto which to store the result.
  10469. * @returns The modified result parameter.
  10470. */
  10471. static getRow(matrix: Matrix4, index: number, result: Cartesian4): Cartesian4;
  10472. /**
  10473. * Computes a new matrix that replaces the specified row in the provided matrix with the provided Cartesian4 instance.
  10474. * @example
  10475. * //create a new Matrix4 instance with new row values from the Cartesian4 instance
  10476. // m = [10.0, 11.0, 12.0, 13.0]
  10477. // [14.0, 15.0, 16.0, 17.0]
  10478. // [18.0, 19.0, 20.0, 21.0]
  10479. // [22.0, 23.0, 24.0, 25.0]
  10480. var a = Cesium.Matrix4.setRow(m, 2, new Cesium.Cartesian4(99.0, 98.0, 97.0, 96.0), new Cesium.Matrix4());
  10481. // m remains the same
  10482. // a = [10.0, 11.0, 12.0, 13.0]
  10483. // [14.0, 15.0, 16.0, 17.0]
  10484. // [99.0, 98.0, 97.0, 96.0]
  10485. // [22.0, 23.0, 24.0, 25.0]
  10486. * @param matrix - The matrix to use.
  10487. * @param index - The zero-based index of the row to set.
  10488. * @param cartesian - The Cartesian whose values will be assigned to the specified row.
  10489. * @param result - The object onto which to store the result.
  10490. * @returns The modified result parameter.
  10491. */
  10492. static setRow(matrix: Matrix4, index: number, cartesian: Cartesian4, result: Matrix4): Matrix4;
  10493. /**
  10494. * Extracts the non-uniform scale assuming the matrix is an affine transformation.
  10495. * @param matrix - The matrix.
  10496. * @param result - The object onto which to store the result.
  10497. * @returns The modified result parameter
  10498. */
  10499. static getScale(matrix: Matrix4, result: Cartesian3): Cartesian3;
  10500. /**
  10501. * Computes the maximum scale assuming the matrix is an affine transformation.
  10502. The maximum scale is the maximum length of the column vectors in the upper-left
  10503. 3x3 matrix.
  10504. * @param matrix - The matrix.
  10505. * @returns The maximum scale.
  10506. */
  10507. static getMaximumScale(matrix: Matrix4): number;
  10508. /**
  10509. * Computes the product of two matrices.
  10510. * @param left - The first matrix.
  10511. * @param right - The second matrix.
  10512. * @param result - The object onto which to store the result.
  10513. * @returns The modified result parameter.
  10514. */
  10515. static multiply(left: Matrix4, right: Matrix4, result: Matrix4): Matrix4;
  10516. /**
  10517. * Computes the sum of two matrices.
  10518. * @param left - The first matrix.
  10519. * @param right - The second matrix.
  10520. * @param result - The object onto which to store the result.
  10521. * @returns The modified result parameter.
  10522. */
  10523. static add(left: Matrix4, right: Matrix4, result: Matrix4): Matrix4;
  10524. /**
  10525. * Computes the difference of two matrices.
  10526. * @param left - The first matrix.
  10527. * @param right - The second matrix.
  10528. * @param result - The object onto which to store the result.
  10529. * @returns The modified result parameter.
  10530. */
  10531. static subtract(left: Matrix4, right: Matrix4, result: Matrix4): Matrix4;
  10532. /**
  10533. * Computes the product of two matrices assuming the matrices are
  10534. affine transformation matrices, where the upper left 3x3 elements
  10535. are a rotation matrix, and the upper three elements in the fourth
  10536. column are the translation. The bottom row is assumed to be [0, 0, 0, 1].
  10537. The matrix is not verified to be in the proper form.
  10538. This method is faster than computing the product for general 4x4
  10539. matrices using {@link Matrix4.multiply}.
  10540. * @example
  10541. * 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);
  10542. var m2 = Cesium.Transforms.eastNorthUpToFixedFrame(new Cesium.Cartesian3(1.0, 1.0, 1.0));
  10543. var m3 = Cesium.Matrix4.multiplyTransformation(m1, m2, new Cesium.Matrix4());
  10544. * @param left - The first matrix.
  10545. * @param right - The second matrix.
  10546. * @param result - The object onto which to store the result.
  10547. * @returns The modified result parameter.
  10548. */
  10549. static multiplyTransformation(left: Matrix4, right: Matrix4, result: Matrix4): Matrix4;
  10550. /**
  10551. * Multiplies a transformation matrix (with a bottom row of <code>[0.0, 0.0, 0.0, 1.0]</code>)
  10552. by a 3x3 rotation matrix. This is an optimization
  10553. for <code>Matrix4.multiply(m, Matrix4.fromRotationTranslation(rotation), m);</code> with less allocations and arithmetic operations.
  10554. * @example
  10555. * // Instead of Cesium.Matrix4.multiply(m, Cesium.Matrix4.fromRotationTranslation(rotation), m);
  10556. Cesium.Matrix4.multiplyByMatrix3(m, rotation, m);
  10557. * @param matrix - The matrix on the left-hand side.
  10558. * @param rotation - The 3x3 rotation matrix on the right-hand side.
  10559. * @param result - The object onto which to store the result.
  10560. * @returns The modified result parameter.
  10561. */
  10562. static multiplyByMatrix3(matrix: Matrix4, rotation: Matrix3, result: Matrix4): Matrix4;
  10563. /**
  10564. * Multiplies a transformation matrix (with a bottom row of <code>[0.0, 0.0, 0.0, 1.0]</code>)
  10565. by an implicit translation matrix defined by a {@link Cartesian3}. This is an optimization
  10566. for <code>Matrix4.multiply(m, Matrix4.fromTranslation(position), m);</code> with less allocations and arithmetic operations.
  10567. * @example
  10568. * // Instead of Cesium.Matrix4.multiply(m, Cesium.Matrix4.fromTranslation(position), m);
  10569. Cesium.Matrix4.multiplyByTranslation(m, position, m);
  10570. * @param matrix - The matrix on the left-hand side.
  10571. * @param translation - The translation on the right-hand side.
  10572. * @param result - The object onto which to store the result.
  10573. * @returns The modified result parameter.
  10574. */
  10575. static multiplyByTranslation(matrix: Matrix4, translation: Cartesian3, result: Matrix4): Matrix4;
  10576. /**
  10577. * Multiplies an affine transformation matrix (with a bottom row of <code>[0.0, 0.0, 0.0, 1.0]</code>)
  10578. by an implicit uniform scale matrix. This is an optimization
  10579. for <code>Matrix4.multiply(m, Matrix4.fromUniformScale(scale), m);</code>, where
  10580. <code>m</code> must be an affine matrix.
  10581. This function performs fewer allocations and arithmetic operations.
  10582. * @example
  10583. * // Instead of Cesium.Matrix4.multiply(m, Cesium.Matrix4.fromUniformScale(scale), m);
  10584. Cesium.Matrix4.multiplyByUniformScale(m, scale, m);
  10585. * @param matrix - The affine matrix on the left-hand side.
  10586. * @param scale - The uniform scale on the right-hand side.
  10587. * @param result - The object onto which to store the result.
  10588. * @returns The modified result parameter.
  10589. */
  10590. static multiplyByUniformScale(matrix: Matrix4, scale: number, result: Matrix4): Matrix4;
  10591. /**
  10592. * Multiplies an affine transformation matrix (with a bottom row of <code>[0.0, 0.0, 0.0, 1.0]</code>)
  10593. by an implicit non-uniform scale matrix. This is an optimization
  10594. for <code>Matrix4.multiply(m, Matrix4.fromUniformScale(scale), m);</code>, where
  10595. <code>m</code> must be an affine matrix.
  10596. This function performs fewer allocations and arithmetic operations.
  10597. * @example
  10598. * // Instead of Cesium.Matrix4.multiply(m, Cesium.Matrix4.fromScale(scale), m);
  10599. Cesium.Matrix4.multiplyByScale(m, scale, m);
  10600. * @param matrix - The affine matrix on the left-hand side.
  10601. * @param scale - The non-uniform scale on the right-hand side.
  10602. * @param result - The object onto which to store the result.
  10603. * @returns The modified result parameter.
  10604. */
  10605. static multiplyByScale(matrix: Matrix4, scale: Cartesian3, result: Matrix4): Matrix4;
  10606. /**
  10607. * Computes the product of a matrix and a column vector.
  10608. * @param matrix - The matrix.
  10609. * @param cartesian - The vector.
  10610. * @param result - The object onto which to store the result.
  10611. * @returns The modified result parameter.
  10612. */
  10613. static multiplyByVector(matrix: Matrix4, cartesian: Cartesian4, result: Cartesian4): Cartesian4;
  10614. /**
  10615. * Computes the product of a matrix and a {@link Cartesian3}. This is equivalent to calling {@link Matrix4.multiplyByVector}
  10616. with a {@link Cartesian4} with a <code>w</code> component of zero.
  10617. * @example
  10618. * var p = new Cesium.Cartesian3(1.0, 2.0, 3.0);
  10619. var result = Cesium.Matrix4.multiplyByPointAsVector(matrix, p, new Cesium.Cartesian3());
  10620. // A shortcut for
  10621. // Cartesian3 p = ...
  10622. // Cesium.Matrix4.multiplyByVector(matrix, new Cesium.Cartesian4(p.x, p.y, p.z, 0.0), result);
  10623. * @param matrix - The matrix.
  10624. * @param cartesian - The point.
  10625. * @param result - The object onto which to store the result.
  10626. * @returns The modified result parameter.
  10627. */
  10628. static multiplyByPointAsVector(matrix: Matrix4, cartesian: Cartesian3, result: Cartesian3): Cartesian3;
  10629. /**
  10630. * Computes the product of a matrix and a {@link Cartesian3}. This is equivalent to calling {@link Matrix4.multiplyByVector}
  10631. with a {@link Cartesian4} with a <code>w</code> component of 1, but returns a {@link Cartesian3} instead of a {@link Cartesian4}.
  10632. * @example
  10633. * var p = new Cesium.Cartesian3(1.0, 2.0, 3.0);
  10634. var result = Cesium.Matrix4.multiplyByPoint(matrix, p, new Cesium.Cartesian3());
  10635. * @param matrix - The matrix.
  10636. * @param cartesian - The point.
  10637. * @param result - The object onto which to store the result.
  10638. * @returns The modified result parameter.
  10639. */
  10640. static multiplyByPoint(matrix: Matrix4, cartesian: Cartesian3, result: Cartesian3): Cartesian3;
  10641. /**
  10642. * Computes the product of a matrix and a scalar.
  10643. * @example
  10644. * //create a Matrix4 instance which is a scaled version of the supplied Matrix4
  10645. // m = [10.0, 11.0, 12.0, 13.0]
  10646. // [14.0, 15.0, 16.0, 17.0]
  10647. // [18.0, 19.0, 20.0, 21.0]
  10648. // [22.0, 23.0, 24.0, 25.0]
  10649. var a = Cesium.Matrix4.multiplyByScalar(m, -2, new Cesium.Matrix4());
  10650. // m remains the same
  10651. // a = [-20.0, -22.0, -24.0, -26.0]
  10652. // [-28.0, -30.0, -32.0, -34.0]
  10653. // [-36.0, -38.0, -40.0, -42.0]
  10654. // [-44.0, -46.0, -48.0, -50.0]
  10655. * @param matrix - The matrix.
  10656. * @param scalar - The number to multiply by.
  10657. * @param result - The object onto which to store the result.
  10658. * @returns The modified result parameter.
  10659. */
  10660. static multiplyByScalar(matrix: Matrix4, scalar: number, result: Matrix4): Matrix4;
  10661. /**
  10662. * Computes a negated copy of the provided matrix.
  10663. * @example
  10664. * //create a new Matrix4 instance which is a negation of a Matrix4
  10665. // m = [10.0, 11.0, 12.0, 13.0]
  10666. // [14.0, 15.0, 16.0, 17.0]
  10667. // [18.0, 19.0, 20.0, 21.0]
  10668. // [22.0, 23.0, 24.0, 25.0]
  10669. var a = Cesium.Matrix4.negate(m, new Cesium.Matrix4());
  10670. // m remains the same
  10671. // a = [-10.0, -11.0, -12.0, -13.0]
  10672. // [-14.0, -15.0, -16.0, -17.0]
  10673. // [-18.0, -19.0, -20.0, -21.0]
  10674. // [-22.0, -23.0, -24.0, -25.0]
  10675. * @param matrix - The matrix to negate.
  10676. * @param result - The object onto which to store the result.
  10677. * @returns The modified result parameter.
  10678. */
  10679. static negate(matrix: Matrix4, result: Matrix4): Matrix4;
  10680. /**
  10681. * Computes the transpose of the provided matrix.
  10682. * @example
  10683. * //returns transpose of a Matrix4
  10684. // m = [10.0, 11.0, 12.0, 13.0]
  10685. // [14.0, 15.0, 16.0, 17.0]
  10686. // [18.0, 19.0, 20.0, 21.0]
  10687. // [22.0, 23.0, 24.0, 25.0]
  10688. var a = Cesium.Matrix4.transpose(m, new Cesium.Matrix4());
  10689. // m remains the same
  10690. // a = [10.0, 14.0, 18.0, 22.0]
  10691. // [11.0, 15.0, 19.0, 23.0]
  10692. // [12.0, 16.0, 20.0, 24.0]
  10693. // [13.0, 17.0, 21.0, 25.0]
  10694. * @param matrix - The matrix to transpose.
  10695. * @param result - The object onto which to store the result.
  10696. * @returns The modified result parameter.
  10697. */
  10698. static transpose(matrix: Matrix4, result: Matrix4): Matrix4;
  10699. /**
  10700. * Computes a matrix, which contains the absolute (unsigned) values of the provided matrix's elements.
  10701. * @param matrix - The matrix with signed elements.
  10702. * @param result - The object onto which to store the result.
  10703. * @returns The modified result parameter.
  10704. */
  10705. static abs(matrix: Matrix4, result: Matrix4): Matrix4;
  10706. /**
  10707. * Compares the provided matrices componentwise and returns
  10708. <code>true</code> if they are equal, <code>false</code> otherwise.
  10709. * @example
  10710. * //compares two Matrix4 instances
  10711. // a = [10.0, 14.0, 18.0, 22.0]
  10712. // [11.0, 15.0, 19.0, 23.0]
  10713. // [12.0, 16.0, 20.0, 24.0]
  10714. // [13.0, 17.0, 21.0, 25.0]
  10715. // b = [10.0, 14.0, 18.0, 22.0]
  10716. // [11.0, 15.0, 19.0, 23.0]
  10717. // [12.0, 16.0, 20.0, 24.0]
  10718. // [13.0, 17.0, 21.0, 25.0]
  10719. if(Cesium.Matrix4.equals(a,b)) {
  10720. console.log("Both matrices are equal");
  10721. } else {
  10722. console.log("They are not equal");
  10723. }
  10724. //Prints "Both matrices are equal" on the console
  10725. * @param [left] - The first matrix.
  10726. * @param [right] - The second matrix.
  10727. * @returns <code>true</code> if left and right are equal, <code>false</code> otherwise.
  10728. */
  10729. static equals(left?: Matrix4, right?: Matrix4): boolean;
  10730. /**
  10731. * Compares the provided matrices componentwise and returns
  10732. <code>true</code> if they are within the provided epsilon,
  10733. <code>false</code> otherwise.
  10734. * @example
  10735. * //compares two Matrix4 instances
  10736. // a = [10.5, 14.5, 18.5, 22.5]
  10737. // [11.5, 15.5, 19.5, 23.5]
  10738. // [12.5, 16.5, 20.5, 24.5]
  10739. // [13.5, 17.5, 21.5, 25.5]
  10740. // b = [10.0, 14.0, 18.0, 22.0]
  10741. // [11.0, 15.0, 19.0, 23.0]
  10742. // [12.0, 16.0, 20.0, 24.0]
  10743. // [13.0, 17.0, 21.0, 25.0]
  10744. if(Cesium.Matrix4.equalsEpsilon(a,b,0.1)){
  10745. console.log("Difference between both the matrices is less than 0.1");
  10746. } else {
  10747. console.log("Difference between both the matrices is not less than 0.1");
  10748. }
  10749. //Prints "Difference between both the matrices is not less than 0.1" on the console
  10750. * @param [left] - The first matrix.
  10751. * @param [right] - The second matrix.
  10752. * @param [epsilon = 0] - The epsilon to use for equality testing.
  10753. * @returns <code>true</code> if left and right are within the provided epsilon, <code>false</code> otherwise.
  10754. */
  10755. static equalsEpsilon(left?: Matrix4, right?: Matrix4, epsilon?: number): boolean;
  10756. /**
  10757. * Gets the translation portion of the provided matrix, assuming the matrix is a affine transformation matrix.
  10758. * @param matrix - The matrix to use.
  10759. * @param result - The object onto which to store the result.
  10760. * @returns The modified result parameter.
  10761. */
  10762. static getTranslation(matrix: Matrix4, result: Cartesian3): Cartesian3;
  10763. /**
  10764. * Gets the upper left 3x3 rotation matrix of the provided matrix, assuming the matrix is an affine transformation matrix.
  10765. * @example
  10766. * // returns a Matrix3 instance from a Matrix4 instance
  10767. // m = [10.0, 14.0, 18.0, 22.0]
  10768. // [11.0, 15.0, 19.0, 23.0]
  10769. // [12.0, 16.0, 20.0, 24.0]
  10770. // [13.0, 17.0, 21.0, 25.0]
  10771. var b = new Cesium.Matrix3();
  10772. Cesium.Matrix4.getMatrix3(m,b);
  10773. // b = [10.0, 14.0, 18.0]
  10774. // [11.0, 15.0, 19.0]
  10775. // [12.0, 16.0, 20.0]
  10776. * @param matrix - The matrix to use.
  10777. * @param result - The object onto which to store the result.
  10778. * @returns The modified result parameter.
  10779. */
  10780. static getMatrix3(matrix: Matrix4, result: Matrix3): Matrix3;
  10781. /**
  10782. * Computes the inverse of the provided matrix using Cramers Rule.
  10783. If the determinant is zero, the matrix can not be inverted, and an exception is thrown.
  10784. If the matrix is an affine transformation matrix, it is more efficient
  10785. to invert it with {@link Matrix4.inverseTransformation}.
  10786. * @param matrix - The matrix to invert.
  10787. * @param result - The object onto which to store the result.
  10788. * @returns The modified result parameter.
  10789. */
  10790. static inverse(matrix: Matrix4, result: Matrix4): Matrix4;
  10791. /**
  10792. * Computes the inverse of the provided matrix assuming it is
  10793. an affine transformation matrix, where the upper left 3x3 elements
  10794. are a rotation matrix, and the upper three elements in the fourth
  10795. column are the translation. The bottom row is assumed to be [0, 0, 0, 1].
  10796. The matrix is not verified to be in the proper form.
  10797. This method is faster than computing the inverse for a general 4x4
  10798. matrix using {@link Matrix4.inverse}.
  10799. * @param matrix - The matrix to invert.
  10800. * @param result - The object onto which to store the result.
  10801. * @returns The modified result parameter.
  10802. */
  10803. static inverseTransformation(matrix: Matrix4, result: Matrix4): Matrix4;
  10804. /**
  10805. * Computes the inverse transpose of a matrix.
  10806. * @param matrix - The matrix to transpose and invert.
  10807. * @param result - The object onto which to store the result.
  10808. * @returns The modified result parameter.
  10809. */
  10810. static inverseTranspose(matrix: Matrix4, result: Matrix4): Matrix4;
  10811. /**
  10812. * An immutable Matrix4 instance initialized to the identity matrix.
  10813. */
  10814. static readonly IDENTITY: Matrix4;
  10815. /**
  10816. * An immutable Matrix4 instance initialized to the zero matrix.
  10817. */
  10818. static readonly ZERO: Matrix4;
  10819. /**
  10820. * The index into Matrix4 for column 0, row 0.
  10821. */
  10822. static readonly COLUMN0ROW0: number;
  10823. /**
  10824. * The index into Matrix4 for column 0, row 1.
  10825. */
  10826. static readonly COLUMN0ROW1: number;
  10827. /**
  10828. * The index into Matrix4 for column 0, row 2.
  10829. */
  10830. static readonly COLUMN0ROW2: number;
  10831. /**
  10832. * The index into Matrix4 for column 0, row 3.
  10833. */
  10834. static readonly COLUMN0ROW3: number;
  10835. /**
  10836. * The index into Matrix4 for column 1, row 0.
  10837. */
  10838. static readonly COLUMN1ROW0: number;
  10839. /**
  10840. * The index into Matrix4 for column 1, row 1.
  10841. */
  10842. static readonly COLUMN1ROW1: number;
  10843. /**
  10844. * The index into Matrix4 for column 1, row 2.
  10845. */
  10846. static readonly COLUMN1ROW2: number;
  10847. /**
  10848. * The index into Matrix4 for column 1, row 3.
  10849. */
  10850. static readonly COLUMN1ROW3: number;
  10851. /**
  10852. * The index into Matrix4 for column 2, row 0.
  10853. */
  10854. static readonly COLUMN2ROW0: number;
  10855. /**
  10856. * The index into Matrix4 for column 2, row 1.
  10857. */
  10858. static readonly COLUMN2ROW1: number;
  10859. /**
  10860. * The index into Matrix4 for column 2, row 2.
  10861. */
  10862. static readonly COLUMN2ROW2: number;
  10863. /**
  10864. * The index into Matrix4 for column 2, row 3.
  10865. */
  10866. static readonly COLUMN2ROW3: number;
  10867. /**
  10868. * The index into Matrix4 for column 3, row 0.
  10869. */
  10870. static readonly COLUMN3ROW0: number;
  10871. /**
  10872. * The index into Matrix4 for column 3, row 1.
  10873. */
  10874. static readonly COLUMN3ROW1: number;
  10875. /**
  10876. * The index into Matrix4 for column 3, row 2.
  10877. */
  10878. static readonly COLUMN3ROW2: number;
  10879. /**
  10880. * The index into Matrix4 for column 3, row 3.
  10881. */
  10882. static readonly COLUMN3ROW3: number;
  10883. /**
  10884. * Gets the number of items in the collection.
  10885. */
  10886. length: number;
  10887. /**
  10888. * Duplicates the provided Matrix4 instance.
  10889. * @param [result] - The object onto which to store the result.
  10890. * @returns The modified result parameter or a new Matrix4 instance if one was not provided.
  10891. */
  10892. clone(result?: Matrix4): Matrix4;
  10893. /**
  10894. * Compares this matrix to the provided matrix componentwise and returns
  10895. <code>true</code> if they are equal, <code>false</code> otherwise.
  10896. * @param [right] - The right hand side matrix.
  10897. * @returns <code>true</code> if they are equal, <code>false</code> otherwise.
  10898. */
  10899. equals(right?: Matrix4): boolean;
  10900. /**
  10901. * Compares this matrix to the provided matrix componentwise and returns
  10902. <code>true</code> if they are within the provided epsilon,
  10903. <code>false</code> otherwise.
  10904. * @param [right] - The right hand side matrix.
  10905. * @param [epsilon = 0] - The epsilon to use for equality testing.
  10906. * @returns <code>true</code> if they are within the provided epsilon, <code>false</code> otherwise.
  10907. */
  10908. equalsEpsilon(right?: Matrix4, epsilon?: number): boolean;
  10909. /**
  10910. * Computes a string representing this Matrix with each row being
  10911. on a separate line and in the format '(column0, column1, column2, column3)'.
  10912. * @returns A string representing the provided Matrix with each row being on a separate line and in the format '(column0, column1, column2, column3)'.
  10913. */
  10914. toString(): string;
  10915. }
  10916. /**
  10917. * A stable merge sort.
  10918. * @example
  10919. * // Assume array contains BoundingSpheres in world coordinates.
  10920. // Sort them in ascending order of distance from the camera.
  10921. var position = camera.positionWC;
  10922. Cesium.mergeSort(array, function(a, b, position) {
  10923. return Cesium.BoundingSphere.distanceSquaredTo(b, position) - Cesium.BoundingSphere.distanceSquaredTo(a, position);
  10924. }, position);
  10925. * @param array - The array to sort.
  10926. * @param comparator - The function to use to compare elements in the array.
  10927. * @param [userDefinedObject] - Any item to pass as the third parameter to <code>comparator</code>.
  10928. */
  10929. export function mergeSort(array: any[], comparator: mergeSortComparator, userDefinedObject?: any): void;
  10930. /**
  10931. * A function used to compare two items while performing a merge sort.
  10932. * @example
  10933. * function compareNumbers(a, b, userDefinedObject) {
  10934. return a - b;
  10935. }
  10936. * @param a - An item in the array.
  10937. * @param b - An item in the array.
  10938. * @param [userDefinedObject] - An object that was passed to {@link mergeSort}.
  10939. */
  10940. export type mergeSortComparator = (a: any, b: any, userDefinedObject?: any) => number;
  10941. /**
  10942. * Represents a scalar value's lower and upper bound at a near distance and far distance in eye space.
  10943. * @param [near = 0.0] - The lower bound of the camera range.
  10944. * @param [nearValue = 0.0] - The value at the lower bound of the camera range.
  10945. * @param [far = 1.0] - The upper bound of the camera range.
  10946. * @param [farValue = 0.0] - The value at the upper bound of the camera range.
  10947. */
  10948. export class NearFarScalar {
  10949. constructor(near?: number, nearValue?: number, far?: number, farValue?: number);
  10950. /**
  10951. * The lower bound of the camera range.
  10952. */
  10953. near: number;
  10954. /**
  10955. * The value at the lower bound of the camera range.
  10956. */
  10957. nearValue: number;
  10958. /**
  10959. * The upper bound of the camera range.
  10960. */
  10961. far: number;
  10962. /**
  10963. * The value at the upper bound of the camera range.
  10964. */
  10965. farValue: number;
  10966. /**
  10967. * Duplicates a NearFarScalar instance.
  10968. * @param nearFarScalar - The NearFarScalar to duplicate.
  10969. * @param [result] - The object onto which to store the result.
  10970. * @returns The modified result parameter or a new NearFarScalar instance if one was not provided. (Returns undefined if nearFarScalar is undefined)
  10971. */
  10972. static clone(nearFarScalar: NearFarScalar, result?: NearFarScalar): NearFarScalar;
  10973. /**
  10974. * The number of elements used to pack the object into an array.
  10975. */
  10976. static packedLength: number;
  10977. /**
  10978. * Stores the provided instance into the provided array.
  10979. * @param value - The value to pack.
  10980. * @param array - The array to pack into.
  10981. * @param [startingIndex = 0] - The index into the array at which to start packing the elements.
  10982. * @returns The array that was packed into
  10983. */
  10984. static pack(value: NearFarScalar, array: number[], startingIndex?: number): number[];
  10985. /**
  10986. * Retrieves an instance from a packed array.
  10987. * @param array - The packed array.
  10988. * @param [startingIndex = 0] - The starting index of the element to be unpacked.
  10989. * @param [result] - The object into which to store the result.
  10990. * @returns The modified result parameter or a new NearFarScalar instance if one was not provided.
  10991. */
  10992. static unpack(array: number[], startingIndex?: number, result?: NearFarScalar): NearFarScalar;
  10993. /**
  10994. * Compares the provided NearFarScalar and returns <code>true</code> if they are equal,
  10995. <code>false</code> otherwise.
  10996. * @param [left] - The first NearFarScalar.
  10997. * @param [right] - The second NearFarScalar.
  10998. * @returns <code>true</code> if left and right are equal; otherwise <code>false</code>.
  10999. */
  11000. static equals(left?: NearFarScalar, right?: NearFarScalar): boolean;
  11001. /**
  11002. * Duplicates this instance.
  11003. * @param [result] - The object onto which to store the result.
  11004. * @returns The modified result parameter or a new NearFarScalar instance if one was not provided.
  11005. */
  11006. clone(result?: NearFarScalar): NearFarScalar;
  11007. /**
  11008. * Compares this instance to the provided NearFarScalar and returns <code>true</code> if they are equal,
  11009. <code>false</code> otherwise.
  11010. * @param [right] - The right hand side NearFarScalar.
  11011. * @returns <code>true</code> if left and right are equal; otherwise <code>false</code>.
  11012. */
  11013. equals(right?: NearFarScalar): boolean;
  11014. }
  11015. /**
  11016. * Converts an object representing a set of name/value pairs into a query string,
  11017. with names and values encoded properly for use in a URL. Values that are arrays
  11018. will produce multiple values with the same name.
  11019. * @example
  11020. * var str = Cesium.objectToQuery({
  11021. key1 : 'some value',
  11022. key2 : 'a/b',
  11023. key3 : ['x', 'y']
  11024. });
  11025. * @param obj - The object containing data to encode.
  11026. * @returns An encoded query string.
  11027. */
  11028. export function objectToQuery(obj: any): string;
  11029. /**
  11030. * Creates an Occluder derived from an object's position and radius, as well as the camera position.
  11031. The occluder can be used to determine whether or not other objects are visible or hidden behind the
  11032. visible horizon defined by the occluder and camera position.
  11033. * @example
  11034. * // Construct an occluder one unit away from the origin with a radius of one.
  11035. var cameraPosition = Cesium.Cartesian3.ZERO;
  11036. var occluderBoundingSphere = new Cesium.BoundingSphere(new Cesium.Cartesian3(0, 0, -1), 1);
  11037. var occluder = new Cesium.Occluder(occluderBoundingSphere, cameraPosition);
  11038. * @param occluderBoundingSphere - The bounding sphere surrounding the occluder.
  11039. * @param cameraPosition - The coordinate of the viewer/camera.
  11040. */
  11041. export class Occluder {
  11042. constructor(occluderBoundingSphere: BoundingSphere, cameraPosition: Cartesian3);
  11043. /**
  11044. * The position of the occluder.
  11045. */
  11046. position: Cartesian3;
  11047. /**
  11048. * The radius of the occluder.
  11049. */
  11050. radius: number;
  11051. /**
  11052. * The position of the camera.
  11053. */
  11054. cameraPosition: Cartesian3;
  11055. /**
  11056. * Creates an occluder from a bounding sphere and the camera position.
  11057. * @param occluderBoundingSphere - The bounding sphere surrounding the occluder.
  11058. * @param cameraPosition - The coordinate of the viewer/camera.
  11059. * @param [result] - The object onto which to store the result.
  11060. * @returns The occluder derived from an object's position and radius, as well as the camera position.
  11061. */
  11062. static fromBoundingSphere(occluderBoundingSphere: BoundingSphere, cameraPosition: Cartesian3, result?: Occluder): Occluder;
  11063. /**
  11064. * Determines whether or not a point, the <code>occludee</code>, is hidden from view by the occluder.
  11065. * @example
  11066. * var cameraPosition = new Cesium.Cartesian3(0, 0, 0);
  11067. var littleSphere = new Cesium.BoundingSphere(new Cesium.Cartesian3(0, 0, -1), 0.25);
  11068. var occluder = new Cesium.Occluder(littleSphere, cameraPosition);
  11069. var point = new Cesium.Cartesian3(0, 0, -3);
  11070. occluder.isPointVisible(point); //returns true
  11071. * @param occludee - The point surrounding the occludee object.
  11072. * @returns <code>true</code> if the occludee is visible; otherwise <code>false</code>.
  11073. */
  11074. isPointVisible(occludee: Cartesian3): boolean;
  11075. /**
  11076. * Determines whether or not a sphere, the <code>occludee</code>, is hidden from view by the occluder.
  11077. * @example
  11078. * var cameraPosition = new Cesium.Cartesian3(0, 0, 0);
  11079. var littleSphere = new Cesium.BoundingSphere(new Cesium.Cartesian3(0, 0, -1), 0.25);
  11080. var occluder = new Cesium.Occluder(littleSphere, cameraPosition);
  11081. var bigSphere = new Cesium.BoundingSphere(new Cesium.Cartesian3(0, 0, -3), 1);
  11082. occluder.isBoundingSphereVisible(bigSphere); //returns true
  11083. * @param occludee - The bounding sphere surrounding the occludee object.
  11084. * @returns <code>true</code> if the occludee is visible; otherwise <code>false</code>.
  11085. */
  11086. isBoundingSphereVisible(occludee: BoundingSphere): boolean;
  11087. /**
  11088. * Determine to what extent an occludee is visible (not visible, partially visible, or fully visible).
  11089. * @example
  11090. * var sphere1 = new Cesium.BoundingSphere(new Cesium.Cartesian3(0, 0, -1.5), 0.5);
  11091. var sphere2 = new Cesium.BoundingSphere(new Cesium.Cartesian3(0, 0, -2.5), 0.5);
  11092. var cameraPosition = new Cesium.Cartesian3(0, 0, 0);
  11093. var occluder = new Cesium.Occluder(sphere1, cameraPosition);
  11094. occluder.computeVisibility(sphere2); //returns Visibility.NONE
  11095. * @param occludeeBS - The bounding sphere of the occludee.
  11096. * @returns Visibility.NONE if the occludee is not visible,
  11097. Visibility.PARTIAL if the occludee is partially visible, or
  11098. Visibility.FULL if the occludee is fully visible.
  11099. */
  11100. computeVisibility(occludeeBS: BoundingSphere): Visibility;
  11101. /**
  11102. * Computes a point that can be used as the occludee position to the visibility functions.
  11103. Use a radius of zero for the occludee radius. Typically, a user computes a bounding sphere around
  11104. an object that is used for visibility; however it is also possible to compute a point that if
  11105. seen/not seen would also indicate if an object is visible/not visible. This function is better
  11106. called for objects that do not move relative to the occluder and is large, such as a chunk of
  11107. terrain. You are better off not calling this and using the object's bounding sphere for objects
  11108. such as a satellite or ground vehicle.
  11109. * @example
  11110. * var cameraPosition = new Cesium.Cartesian3(0, 0, 0);
  11111. var occluderBoundingSphere = new Cesium.BoundingSphere(new Cesium.Cartesian3(0, 0, -8), 2);
  11112. var occluder = new Cesium.Occluder(occluderBoundingSphere, cameraPosition);
  11113. var positions = [new Cesium.Cartesian3(-0.25, 0, -5.3), new Cesium.Cartesian3(0.25, 0, -5.3)];
  11114. var tileOccluderSphere = Cesium.BoundingSphere.fromPoints(positions);
  11115. var occludeePosition = tileOccluderSphere.center;
  11116. var occludeePt = Cesium.Occluder.computeOccludeePoint(occluderBoundingSphere, occludeePosition, positions);
  11117. * @param occluderBoundingSphere - The bounding sphere surrounding the occluder.
  11118. * @param occludeePosition - The point where the occludee (bounding sphere of radius 0) is located.
  11119. * @param positions - List of altitude points on the horizon near the surface of the occluder.
  11120. * @returns An object containing two attributes: <code>occludeePoint</code> and <code>valid</code>
  11121. which is a boolean value.
  11122. */
  11123. static computeOccludeePoint(occluderBoundingSphere: BoundingSphere, occludeePosition: Cartesian3, positions: Cartesian3[]): any;
  11124. /**
  11125. * Computes a point that can be used as the occludee position to the visibility functions from a rectangle.
  11126. * @param rectangle - The rectangle used to create a bounding sphere.
  11127. * @param [ellipsoid = Ellipsoid.WGS84] - The ellipsoid used to determine positions of the rectangle.
  11128. * @returns An object containing two attributes: <code>occludeePoint</code> and <code>valid</code>
  11129. which is a boolean value.
  11130. */
  11131. static computeOccludeePointFromRectangle(rectangle: Rectangle, ellipsoid?: Ellipsoid): any;
  11132. }
  11133. /**
  11134. * Provides geocoding via a {@link https://opencagedata.com/|OpenCage} server.
  11135. * @example
  11136. * // Configure a Viewer to use the OpenCage Geocoder
  11137. var viewer = new Cesium.Viewer('cesiumContainer', {
  11138. geocoder: new Cesium.OpenCageGeocoderService('https://api.opencagedata.com/geocode/v1/', '<API key>')
  11139. });
  11140. * @param url - The endpoint to the OpenCage server.
  11141. * @param apiKey - The OpenCage API Key.
  11142. * @param [params] - An object with the following properties (See https://opencagedata.com/api#forward-opt):
  11143. * @param [params.abbrv] - When set to 1 we attempt to abbreviate and shorten the formatted string we return.
  11144. * @param [options.add_request] - When set to 1 the various request parameters are added to the response for ease of debugging.
  11145. * @param [options.bounds] - Provides the geocoder with a hint to the region that the query resides in.
  11146. * @param [options.countrycode] - Restricts the results to the specified country or countries (as defined by the ISO 3166-1 Alpha 2 standard).
  11147. * @param [options.jsonp] - Wraps the returned JSON with a function name.
  11148. * @param [options.language] - An IETF format language code.
  11149. * @param [options.limit] - The maximum number of results we should return.
  11150. * @param [options.min_confidence] - An integer from 1-10. Only results with at least this confidence will be returned.
  11151. * @param [options.no_annotations] - When set to 1 results will not contain annotations.
  11152. * @param [options.no_dedupe] - When set to 1 results will not be deduplicated.
  11153. * @param [options.no_record] - When set to 1 the query contents are not logged.
  11154. * @param [options.pretty] - When set to 1 results are 'pretty' printed for easier reading. Useful for debugging.
  11155. * @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).
  11156. */
  11157. export class OpenCageGeocoderService {
  11158. constructor(url: Resource | string, apiKey: string, params?: {
  11159. abbrv?: number;
  11160. });
  11161. /**
  11162. * The Resource used to access the OpenCage endpoint.
  11163. */
  11164. readonly url: Resource;
  11165. /**
  11166. * Optional params passed to OpenCage in order to customize geocoding
  11167. */
  11168. readonly params: any;
  11169. /**
  11170. * @param query - The query to be sent to the geocoder service
  11171. */
  11172. geocode(query: string): Promise<GeocoderService.Result[]>;
  11173. }
  11174. /**
  11175. * Creates an instance of an OrientedBoundingBox.
  11176. 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.
  11177. * @example
  11178. * // Create an OrientedBoundingBox using a transformation matrix, a position where the box will be translated, and a scale.
  11179. var center = new Cesium.Cartesian3(1.0, 0.0, 0.0);
  11180. var halfAxes = Cesium.Matrix3.fromScale(new Cesium.Cartesian3(1.0, 3.0, 2.0), new Cesium.Matrix3());
  11181. var obb = new Cesium.OrientedBoundingBox(center, halfAxes);
  11182. * @param [center = Cartesian3.ZERO] - The center of the box.
  11183. * @param [halfAxes = Matrix3.ZERO] - The three orthogonal half-axes of the bounding box.
  11184. Equivalently, the transformation matrix, to rotate and scale a 0x0x0
  11185. cube centered at the origin.
  11186. */
  11187. export class OrientedBoundingBox {
  11188. constructor(center?: Cartesian3, halfAxes?: Matrix3);
  11189. /**
  11190. * The center of the box.
  11191. */
  11192. center: Cartesian3;
  11193. /**
  11194. * The transformation matrix, to rotate the box to the right position.
  11195. */
  11196. halfAxes: Matrix3;
  11197. /**
  11198. * The number of elements used to pack the object into an array.
  11199. */
  11200. static packedLength: number;
  11201. /**
  11202. * Stores the provided instance into the provided array.
  11203. * @param value - The value to pack.
  11204. * @param array - The array to pack into.
  11205. * @param [startingIndex = 0] - The index into the array at which to start packing the elements.
  11206. * @returns The array that was packed into
  11207. */
  11208. static pack(value: OrientedBoundingBox, array: number[], startingIndex?: number): number[];
  11209. /**
  11210. * Retrieves an instance from a packed array.
  11211. * @param array - The packed array.
  11212. * @param [startingIndex = 0] - The starting index of the element to be unpacked.
  11213. * @param [result] - The object into which to store the result.
  11214. * @returns The modified result parameter or a new OrientedBoundingBox instance if one was not provided.
  11215. */
  11216. static unpack(array: number[], startingIndex?: number, result?: OrientedBoundingBox): OrientedBoundingBox;
  11217. /**
  11218. * Computes an instance of an OrientedBoundingBox of the given positions.
  11219. This is an implementation of Stefan Gottschalk's Collision Queries using Oriented Bounding Boxes solution (PHD thesis).
  11220. Reference: http://gamma.cs.unc.edu/users/gottschalk/main.pdf
  11221. * @example
  11222. * // Compute an object oriented bounding box enclosing two points.
  11223. var box = Cesium.OrientedBoundingBox.fromPoints([new Cesium.Cartesian3(2, 0, 0), new Cesium.Cartesian3(-2, 0, 0)]);
  11224. * @param [positions] - List of {@link Cartesian3} points that the bounding box will enclose.
  11225. * @param [result] - The object onto which to store the result.
  11226. * @returns The modified result parameter or a new OrientedBoundingBox instance if one was not provided.
  11227. */
  11228. static fromPoints(positions?: Cartesian3[], result?: OrientedBoundingBox): OrientedBoundingBox;
  11229. /**
  11230. * Computes an OrientedBoundingBox that bounds a {@link Rectangle} on the surface of an {@link Ellipsoid}.
  11231. There are no guarantees about the orientation of the bounding box.
  11232. * @param rectangle - The cartographic rectangle on the surface of the ellipsoid.
  11233. * @param [minimumHeight = 0.0] - The minimum height (elevation) within the tile.
  11234. * @param [maximumHeight = 0.0] - The maximum height (elevation) within the tile.
  11235. * @param [ellipsoid = Ellipsoid.WGS84] - The ellipsoid on which the rectangle is defined.
  11236. * @param [result] - The object onto which to store the result.
  11237. * @returns The modified result parameter or a new OrientedBoundingBox instance if none was provided.
  11238. */
  11239. static fromRectangle(rectangle: Rectangle, minimumHeight?: number, maximumHeight?: number, ellipsoid?: Ellipsoid, result?: OrientedBoundingBox): OrientedBoundingBox;
  11240. /**
  11241. * Duplicates a OrientedBoundingBox instance.
  11242. * @param box - The bounding box to duplicate.
  11243. * @param [result] - The object onto which to store the result.
  11244. * @returns The modified result parameter or a new OrientedBoundingBox instance if none was provided. (Returns undefined if box is undefined)
  11245. */
  11246. static clone(box: OrientedBoundingBox, result?: OrientedBoundingBox): OrientedBoundingBox;
  11247. /**
  11248. * Determines which side of a plane the oriented bounding box is located.
  11249. * @param box - The oriented bounding box to test.
  11250. * @param plane - The plane to test against.
  11251. * @returns {@link Intersect.INSIDE} if the entire box is on the side of the plane
  11252. the normal is pointing, {@link Intersect.OUTSIDE} if the entire box is
  11253. on the opposite side, and {@link Intersect.INTERSECTING} if the box
  11254. intersects the plane.
  11255. */
  11256. static intersectPlane(box: OrientedBoundingBox, plane: Plane): Intersect;
  11257. /**
  11258. * Computes the estimated distance squared from the closest point on a bounding box to a point.
  11259. * @example
  11260. * // Sort bounding boxes from back to front
  11261. boxes.sort(function(a, b) {
  11262. return Cesium.OrientedBoundingBox.distanceSquaredTo(b, camera.positionWC) - Cesium.OrientedBoundingBox.distanceSquaredTo(a, camera.positionWC);
  11263. });
  11264. * @param box - The box.
  11265. * @param cartesian - The point
  11266. * @returns The estimated distance squared from the bounding sphere to the point.
  11267. */
  11268. static distanceSquaredTo(box: OrientedBoundingBox, cartesian: Cartesian3): number;
  11269. /**
  11270. * The distances calculated by the vector from the center of the bounding box to position projected onto direction.
  11271. <br>
  11272. If you imagine the infinite number of planes with normal direction, this computes the smallest distance to the
  11273. closest and farthest planes from position that intersect the bounding box.
  11274. * @param box - The bounding box to calculate the distance to.
  11275. * @param position - The position to calculate the distance from.
  11276. * @param direction - The direction from position.
  11277. * @param [result] - A Interval to store the nearest and farthest distances.
  11278. * @returns The nearest and farthest distances on the bounding box from position in direction.
  11279. */
  11280. static computePlaneDistances(box: OrientedBoundingBox, position: Cartesian3, direction: Cartesian3, result?: Interval): Interval;
  11281. /**
  11282. * Determines whether or not a bounding box is hidden from view by the occluder.
  11283. * @param box - The bounding box surrounding the occludee object.
  11284. * @param occluder - The occluder.
  11285. * @returns <code>true</code> if the box is not visible; otherwise <code>false</code>.
  11286. */
  11287. static isOccluded(box: OrientedBoundingBox, occluder: Occluder): boolean;
  11288. /**
  11289. * Determines which side of a plane the oriented bounding box is located.
  11290. * @param plane - The plane to test against.
  11291. * @returns {@link Intersect.INSIDE} if the entire box is on the side of the plane
  11292. the normal is pointing, {@link Intersect.OUTSIDE} if the entire box is
  11293. on the opposite side, and {@link Intersect.INTERSECTING} if the box
  11294. intersects the plane.
  11295. */
  11296. intersectPlane(plane: Plane): Intersect;
  11297. /**
  11298. * Computes the estimated distance squared from the closest point on a bounding box to a point.
  11299. * @example
  11300. * // Sort bounding boxes from back to front
  11301. boxes.sort(function(a, b) {
  11302. return b.distanceSquaredTo(camera.positionWC) - a.distanceSquaredTo(camera.positionWC);
  11303. });
  11304. * @param cartesian - The point
  11305. * @returns The estimated distance squared from the bounding sphere to the point.
  11306. */
  11307. distanceSquaredTo(cartesian: Cartesian3): number;
  11308. /**
  11309. * The distances calculated by the vector from the center of the bounding box to position projected onto direction.
  11310. <br>
  11311. If you imagine the infinite number of planes with normal direction, this computes the smallest distance to the
  11312. closest and farthest planes from position that intersect the bounding box.
  11313. * @param position - The position to calculate the distance from.
  11314. * @param direction - The direction from position.
  11315. * @param [result] - A Interval to store the nearest and farthest distances.
  11316. * @returns The nearest and farthest distances on the bounding box from position in direction.
  11317. */
  11318. computePlaneDistances(position: Cartesian3, direction: Cartesian3, result?: Interval): Interval;
  11319. /**
  11320. * Determines whether or not a bounding box is hidden from view by the occluder.
  11321. * @param occluder - The occluder.
  11322. * @returns <code>true</code> if the sphere is not visible; otherwise <code>false</code>.
  11323. */
  11324. isOccluded(occluder: Occluder): boolean;
  11325. /**
  11326. * Compares the provided OrientedBoundingBox componentwise and returns
  11327. <code>true</code> if they are equal, <code>false</code> otherwise.
  11328. * @param left - The first OrientedBoundingBox.
  11329. * @param right - The second OrientedBoundingBox.
  11330. * @returns <code>true</code> if left and right are equal, <code>false</code> otherwise.
  11331. */
  11332. static equals(left: OrientedBoundingBox, right: OrientedBoundingBox): boolean;
  11333. /**
  11334. * Duplicates this OrientedBoundingBox instance.
  11335. * @param [result] - The object onto which to store the result.
  11336. * @returns The modified result parameter or a new OrientedBoundingBox instance if one was not provided.
  11337. */
  11338. clone(result?: OrientedBoundingBox): OrientedBoundingBox;
  11339. /**
  11340. * Compares this OrientedBoundingBox against the provided OrientedBoundingBox componentwise and returns
  11341. <code>true</code> if they are equal, <code>false</code> otherwise.
  11342. * @param [right] - The right hand side OrientedBoundingBox.
  11343. * @returns <code>true</code> if they are equal, <code>false</code> otherwise.
  11344. */
  11345. equals(right?: OrientedBoundingBox): boolean;
  11346. }
  11347. /**
  11348. * The viewing frustum is defined by 6 planes.
  11349. Each plane is represented by a {@link Cartesian4} object, where the x, y, and z components
  11350. define the unit vector normal to the plane, and the w component is the distance of the
  11351. plane from the origin/camera position.
  11352. * @example
  11353. * var maxRadii = ellipsoid.maximumRadius;
  11354. var frustum = new Cesium.OrthographicFrustum();
  11355. frustum.near = 0.01 * maxRadii;
  11356. frustum.far = 50.0 * maxRadii;
  11357. * @param [options] - An object with the following properties:
  11358. * @param [options.width] - The width of the frustum in meters.
  11359. * @param [options.aspectRatio] - The aspect ratio of the frustum's width to it's height.
  11360. * @param [options.near = 1.0] - The distance of the near plane.
  11361. * @param [options.far = 500000000.0] - The distance of the far plane.
  11362. */
  11363. export class OrthographicFrustum {
  11364. constructor(options?: {
  11365. width?: number;
  11366. aspectRatio?: number;
  11367. near?: number;
  11368. far?: number;
  11369. });
  11370. /**
  11371. * The horizontal width of the frustum in meters.
  11372. */
  11373. width: number;
  11374. /**
  11375. * The aspect ratio of the frustum's width to it's height.
  11376. */
  11377. aspectRatio: number;
  11378. /**
  11379. * The distance of the near plane.
  11380. */
  11381. near: number;
  11382. /**
  11383. * The distance of the far plane.
  11384. */
  11385. far: number;
  11386. /**
  11387. * The number of elements used to pack the object into an array.
  11388. */
  11389. static packedLength: number;
  11390. /**
  11391. * Stores the provided instance into the provided array.
  11392. * @param value - The value to pack.
  11393. * @param array - The array to pack into.
  11394. * @param [startingIndex = 0] - The index into the array at which to start packing the elements.
  11395. * @returns The array that was packed into
  11396. */
  11397. static pack(value: OrthographicFrustum, array: number[], startingIndex?: number): number[];
  11398. /**
  11399. * Retrieves an instance from a packed array.
  11400. * @param array - The packed array.
  11401. * @param [startingIndex = 0] - The starting index of the element to be unpacked.
  11402. * @param [result] - The object into which to store the result.
  11403. * @returns The modified result parameter or a new OrthographicFrustum instance if one was not provided.
  11404. */
  11405. static unpack(array: number[], startingIndex?: number, result?: OrthographicFrustum): OrthographicFrustum;
  11406. /**
  11407. * Gets the orthographic projection matrix computed from the view frustum.
  11408. */
  11409. readonly projectionMatrix: Matrix4;
  11410. /**
  11411. * Creates a culling volume for this frustum.
  11412. * @example
  11413. * // Check if a bounding volume intersects the frustum.
  11414. var cullingVolume = frustum.computeCullingVolume(cameraPosition, cameraDirection, cameraUp);
  11415. var intersect = cullingVolume.computeVisibility(boundingVolume);
  11416. * @param position - The eye position.
  11417. * @param direction - The view direction.
  11418. * @param up - The up direction.
  11419. * @returns A culling volume at the given position and orientation.
  11420. */
  11421. computeCullingVolume(position: Cartesian3, direction: Cartesian3, up: Cartesian3): CullingVolume;
  11422. /**
  11423. * Returns the pixel's width and height in meters.
  11424. * @example
  11425. * // Example 1
  11426. // Get the width and height of a pixel.
  11427. var pixelSize = camera.frustum.getPixelDimensions(scene.drawingBufferWidth, scene.drawingBufferHeight, 0.0, scene.pixelRatio, new Cesium.Cartesian2());
  11428. * @param drawingBufferWidth - The width of the drawing buffer.
  11429. * @param drawingBufferHeight - The height of the drawing buffer.
  11430. * @param distance - The distance to the near plane in meters.
  11431. * @param pixelRatio - The scaling factor from pixel space to coordinate space.
  11432. * @param result - The object onto which to store the result.
  11433. * @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.
  11434. */
  11435. getPixelDimensions(drawingBufferWidth: number, drawingBufferHeight: number, distance: number, pixelRatio: number, result: Cartesian2): Cartesian2;
  11436. /**
  11437. * Returns a duplicate of a OrthographicFrustum instance.
  11438. * @param [result] - The object onto which to store the result.
  11439. * @returns The modified result parameter or a new OrthographicFrustum instance if one was not provided.
  11440. */
  11441. clone(result?: OrthographicFrustum): OrthographicFrustum;
  11442. /**
  11443. * Compares the provided OrthographicFrustum componentwise and returns
  11444. <code>true</code> if they are equal, <code>false</code> otherwise.
  11445. * @param [other] - The right hand side OrthographicFrustum.
  11446. * @returns <code>true</code> if they are equal, <code>false</code> otherwise.
  11447. */
  11448. equals(other?: OrthographicFrustum): boolean;
  11449. /**
  11450. * Compares the provided OrthographicFrustum componentwise and returns
  11451. <code>true</code> if they pass an absolute or relative tolerance test,
  11452. <code>false</code> otherwise.
  11453. * @param other - The right hand side OrthographicFrustum.
  11454. * @param relativeEpsilon - The relative epsilon tolerance to use for equality testing.
  11455. * @param [absoluteEpsilon = relativeEpsilon] - The absolute epsilon tolerance to use for equality testing.
  11456. * @returns <code>true</code> if this and other are within the provided epsilon, <code>false</code> otherwise.
  11457. */
  11458. equalsEpsilon(other: OrthographicFrustum, relativeEpsilon: number, absoluteEpsilon?: number): boolean;
  11459. }
  11460. /**
  11461. * The viewing frustum is defined by 6 planes.
  11462. Each plane is represented by a {@link Cartesian4} object, where the x, y, and z components
  11463. define the unit vector normal to the plane, and the w component is the distance of the
  11464. plane from the origin/camera position.
  11465. * @example
  11466. * var maxRadii = ellipsoid.maximumRadius;
  11467. var frustum = new Cesium.OrthographicOffCenterFrustum();
  11468. frustum.right = maxRadii * Cesium.Math.PI;
  11469. frustum.left = -c.frustum.right;
  11470. frustum.top = c.frustum.right * (canvas.clientHeight / canvas.clientWidth);
  11471. frustum.bottom = -c.frustum.top;
  11472. frustum.near = 0.01 * maxRadii;
  11473. frustum.far = 50.0 * maxRadii;
  11474. * @param [options] - An object with the following properties:
  11475. * @param [options.left] - The left clipping plane distance.
  11476. * @param [options.right] - The right clipping plane distance.
  11477. * @param [options.top] - The top clipping plane distance.
  11478. * @param [options.bottom] - The bottom clipping plane distance.
  11479. * @param [options.near = 1.0] - The near clipping plane distance.
  11480. * @param [options.far = 500000000.0] - The far clipping plane distance.
  11481. */
  11482. export class OrthographicOffCenterFrustum {
  11483. constructor(options?: {
  11484. left?: number;
  11485. right?: number;
  11486. top?: number;
  11487. bottom?: number;
  11488. near?: number;
  11489. far?: number;
  11490. });
  11491. /**
  11492. * The left clipping plane.
  11493. */
  11494. left: number;
  11495. /**
  11496. * The right clipping plane.
  11497. */
  11498. right: number;
  11499. /**
  11500. * The top clipping plane.
  11501. */
  11502. top: number;
  11503. /**
  11504. * The bottom clipping plane.
  11505. */
  11506. bottom: number;
  11507. /**
  11508. * The distance of the near plane.
  11509. */
  11510. near: number;
  11511. /**
  11512. * The distance of the far plane.
  11513. */
  11514. far: number;
  11515. /**
  11516. * Gets the orthographic projection matrix computed from the view frustum.
  11517. */
  11518. readonly projectionMatrix: Matrix4;
  11519. /**
  11520. * Creates a culling volume for this frustum.
  11521. * @example
  11522. * // Check if a bounding volume intersects the frustum.
  11523. var cullingVolume = frustum.computeCullingVolume(cameraPosition, cameraDirection, cameraUp);
  11524. var intersect = cullingVolume.computeVisibility(boundingVolume);
  11525. * @param position - The eye position.
  11526. * @param direction - The view direction.
  11527. * @param up - The up direction.
  11528. * @returns A culling volume at the given position and orientation.
  11529. */
  11530. computeCullingVolume(position: Cartesian3, direction: Cartesian3, up: Cartesian3): CullingVolume;
  11531. /**
  11532. * Returns the pixel's width and height in meters.
  11533. * @example
  11534. * // Example 1
  11535. // Get the width and height of a pixel.
  11536. var pixelSize = camera.frustum.getPixelDimensions(scene.drawingBufferWidth, scene.drawingBufferHeight, 0.0, scene.pixelRatio, new Cesium.Cartesian2());
  11537. * @param drawingBufferWidth - The width of the drawing buffer.
  11538. * @param drawingBufferHeight - The height of the drawing buffer.
  11539. * @param distance - The distance to the near plane in meters.
  11540. * @param pixelRatio - The scaling factor from pixel space to coordinate space.
  11541. * @param result - The object onto which to store the result.
  11542. * @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.
  11543. */
  11544. getPixelDimensions(drawingBufferWidth: number, drawingBufferHeight: number, distance: number, pixelRatio: number, result: Cartesian2): Cartesian2;
  11545. /**
  11546. * Returns a duplicate of a OrthographicOffCenterFrustum instance.
  11547. * @param [result] - The object onto which to store the result.
  11548. * @returns The modified result parameter or a new OrthographicOffCenterFrustum instance if one was not provided.
  11549. */
  11550. clone(result?: OrthographicOffCenterFrustum): OrthographicOffCenterFrustum;
  11551. /**
  11552. * Compares the provided OrthographicOffCenterFrustum componentwise and returns
  11553. <code>true</code> if they are equal, <code>false</code> otherwise.
  11554. * @param [other] - The right hand side OrthographicOffCenterFrustum.
  11555. * @returns <code>true</code> if they are equal, <code>false</code> otherwise.
  11556. */
  11557. equals(other?: OrthographicOffCenterFrustum): boolean;
  11558. /**
  11559. * Compares the provided OrthographicOffCenterFrustum componentwise and returns
  11560. <code>true</code> if they pass an absolute or relative tolerance test,
  11561. <code>false</code> otherwise.
  11562. * @param other - The right hand side OrthographicOffCenterFrustum.
  11563. * @param relativeEpsilon - The relative epsilon tolerance to use for equality testing.
  11564. * @param [absoluteEpsilon = relativeEpsilon] - The absolute epsilon tolerance to use for equality testing.
  11565. * @returns <code>true</code> if this and other are within the provided epsilon, <code>false</code> otherwise.
  11566. */
  11567. equalsEpsilon(other: OrthographicOffCenterFrustum, relativeEpsilon: number, absoluteEpsilon?: number): boolean;
  11568. }
  11569. export namespace Packable {
  11570. /**
  11571. * The number of elements used to pack the object into an array.
  11572. */
  11573. var packedLength: number;
  11574. /**
  11575. * Stores the provided instance into the provided array.
  11576. * @param value - The value to pack.
  11577. * @param array - The array to pack into.
  11578. * @param [startingIndex = 0] - The index into the array at which to start packing the elements.
  11579. */
  11580. function pack(value: any, array: number[], startingIndex?: number): void;
  11581. /**
  11582. * Retrieves an instance from a packed array.
  11583. * @param array - The packed array.
  11584. * @param [startingIndex = 0] - The starting index of the element to be unpacked.
  11585. * @param [result] - The object into which to store the result.
  11586. * @returns The modified result parameter or a new Object instance if one was not provided.
  11587. */
  11588. function unpack(array: number[], startingIndex?: number, result?: any): any;
  11589. }
  11590. /**
  11591. * Static interface for types which can store their values as packed
  11592. elements in an array. These methods and properties are expected to be
  11593. defined on a constructor function.
  11594. */
  11595. export interface Packable {
  11596. }
  11597. /**
  11598. * Static interface for {@link Packable} types which are interpolated in a
  11599. different representation than their packed value. These methods and
  11600. properties are expected to be defined on a constructor function.
  11601. */
  11602. export namespace PackableForInterpolation {
  11603. /**
  11604. * The number of elements used to store the object into an array in its interpolatable form.
  11605. */
  11606. var packedInterpolationLength: number;
  11607. /**
  11608. * Converts a packed array into a form suitable for interpolation.
  11609. * @param packedArray - The packed array.
  11610. * @param [startingIndex = 0] - The index of the first element to be converted.
  11611. * @param [lastIndex = packedArray.length] - The index of the last element to be converted.
  11612. * @param [result] - The object into which to store the result.
  11613. */
  11614. function convertPackedArrayForInterpolation(packedArray: number[], startingIndex?: number, lastIndex?: number, result?: number[]): void;
  11615. /**
  11616. * Retrieves an instance from a packed array converted with {@link PackableForInterpolation.convertPackedArrayForInterpolation}.
  11617. * @param array - The array previously packed for interpolation.
  11618. * @param sourceArray - The original packed array.
  11619. * @param [startingIndex = 0] - The startingIndex used to convert the array.
  11620. * @param [lastIndex = packedArray.length] - The lastIndex used to convert the array.
  11621. * @param [result] - The object into which to store the result.
  11622. * @returns The modified result parameter or a new Object instance if one was not provided.
  11623. */
  11624. function unpackInterpolationResult(array: number[], sourceArray: number[], startingIndex?: number, lastIndex?: number, result?: any): any;
  11625. }
  11626. /**
  11627. * Provides geocoding via a {@link https://pelias.io/|Pelias} server.
  11628. * @example
  11629. * // Configure a Viewer to use the Pelias server hosted by https://geocode.earth/
  11630. var viewer = new Cesium.Viewer('cesiumContainer', {
  11631. geocoder: new Cesium.PeliasGeocoderService(new Cesium.Resource({
  11632. url: 'https://api.geocode.earth/v1/',
  11633. queryParameters: {
  11634. api_key: '<Your geocode.earth API key>'
  11635. }
  11636. }))
  11637. });
  11638. * @param url - The endpoint to the Pelias server.
  11639. */
  11640. export class PeliasGeocoderService {
  11641. constructor(url: Resource | string);
  11642. /**
  11643. * The Resource used to access the Pelias endpoint.
  11644. */
  11645. readonly url: Resource;
  11646. /**
  11647. * @param query - The query to be sent to the geocoder service
  11648. * @param [type = GeocodeType.SEARCH] - The type of geocode to perform.
  11649. */
  11650. geocode(query: string, type?: GeocodeType): Promise<GeocoderService.Result[]>;
  11651. }
  11652. /**
  11653. * The viewing frustum is defined by 6 planes.
  11654. Each plane is represented by a {@link Cartesian4} object, where the x, y, and z components
  11655. define the unit vector normal to the plane, and the w component is the distance of the
  11656. plane from the origin/camera position.
  11657. * @example
  11658. * var frustum = new Cesium.PerspectiveFrustum({
  11659. fov : Cesium.Math.PI_OVER_THREE,
  11660. aspectRatio : canvas.clientWidth / canvas.clientHeight
  11661. near : 1.0,
  11662. far : 1000.0
  11663. });
  11664. * @param [options] - An object with the following properties:
  11665. * @param [options.fov] - The angle of the field of view (FOV), in radians.
  11666. * @param [options.aspectRatio] - The aspect ratio of the frustum's width to it's height.
  11667. * @param [options.near = 1.0] - The distance of the near plane.
  11668. * @param [options.far = 500000000.0] - The distance of the far plane.
  11669. * @param [options.xOffset = 0.0] - The offset in the x direction.
  11670. * @param [options.yOffset = 0.0] - The offset in the y direction.
  11671. */
  11672. export class PerspectiveFrustum {
  11673. constructor(options?: {
  11674. fov?: number;
  11675. aspectRatio?: number;
  11676. near?: number;
  11677. far?: number;
  11678. xOffset?: number;
  11679. yOffset?: number;
  11680. });
  11681. /**
  11682. * The angle of the field of view (FOV), in radians. This angle will be used
  11683. as the horizontal FOV if the width is greater than the height, otherwise
  11684. it will be the vertical FOV.
  11685. */
  11686. fov: number;
  11687. /**
  11688. * The aspect ratio of the frustum's width to it's height.
  11689. */
  11690. aspectRatio: number;
  11691. /**
  11692. * The distance of the near plane.
  11693. */
  11694. near: number;
  11695. /**
  11696. * The distance of the far plane.
  11697. */
  11698. far: number;
  11699. /**
  11700. * Offsets the frustum in the x direction.
  11701. */
  11702. xOffset: number;
  11703. /**
  11704. * Offsets the frustum in the y direction.
  11705. */
  11706. yOffset: number;
  11707. /**
  11708. * The number of elements used to pack the object into an array.
  11709. */
  11710. static packedLength: number;
  11711. /**
  11712. * Stores the provided instance into the provided array.
  11713. * @param value - The value to pack.
  11714. * @param array - The array to pack into.
  11715. * @param [startingIndex = 0] - The index into the array at which to start packing the elements.
  11716. * @returns The array that was packed into
  11717. */
  11718. static pack(value: PerspectiveFrustum, array: number[], startingIndex?: number): number[];
  11719. /**
  11720. * Retrieves an instance from a packed array.
  11721. * @param array - The packed array.
  11722. * @param [startingIndex = 0] - The starting index of the element to be unpacked.
  11723. * @param [result] - The object into which to store the result.
  11724. * @returns The modified result parameter or a new PerspectiveFrustum instance if one was not provided.
  11725. */
  11726. static unpack(array: number[], startingIndex?: number, result?: PerspectiveFrustum): PerspectiveFrustum;
  11727. /**
  11728. * Gets the perspective projection matrix computed from the view frustum.
  11729. */
  11730. readonly projectionMatrix: Matrix4;
  11731. /**
  11732. * The perspective projection matrix computed from the view frustum with an infinite far plane.
  11733. */
  11734. readonly infiniteProjectionMatrix: Matrix4;
  11735. /**
  11736. * Gets the angle of the vertical field of view, in radians.
  11737. */
  11738. readonly fovy: number;
  11739. /**
  11740. * Creates a culling volume for this frustum.
  11741. * @example
  11742. * // Check if a bounding volume intersects the frustum.
  11743. var cullingVolume = frustum.computeCullingVolume(cameraPosition, cameraDirection, cameraUp);
  11744. var intersect = cullingVolume.computeVisibility(boundingVolume);
  11745. * @param position - The eye position.
  11746. * @param direction - The view direction.
  11747. * @param up - The up direction.
  11748. * @returns A culling volume at the given position and orientation.
  11749. */
  11750. computeCullingVolume(position: Cartesian3, direction: Cartesian3, up: Cartesian3): CullingVolume;
  11751. /**
  11752. * Returns the pixel's width and height in meters.
  11753. * @example
  11754. * // Example 1
  11755. // Get the width and height of a pixel.
  11756. var pixelSize = camera.frustum.getPixelDimensions(scene.drawingBufferWidth, scene.drawingBufferHeight, 1.0, scene.pixelRatio, new Cesium.Cartesian2());
  11757. * @example
  11758. * // Example 2
  11759. // Get the width and height of a pixel if the near plane was set to 'distance'.
  11760. // For example, get the size of a pixel of an image on a billboard.
  11761. var position = camera.position;
  11762. var direction = camera.direction;
  11763. var toCenter = Cesium.Cartesian3.subtract(primitive.boundingVolume.center, position, new Cesium.Cartesian3()); // vector from camera to a primitive
  11764. var toCenterProj = Cesium.Cartesian3.multiplyByScalar(direction, Cesium.Cartesian3.dot(direction, toCenter), new Cesium.Cartesian3()); // project vector onto camera direction vector
  11765. var distance = Cesium.Cartesian3.magnitude(toCenterProj);
  11766. var pixelSize = camera.frustum.getPixelDimensions(scene.drawingBufferWidth, scene.drawingBufferHeight, distance, scene.pixelRatio, new Cesium.Cartesian2());
  11767. * @param drawingBufferWidth - The width of the drawing buffer.
  11768. * @param drawingBufferHeight - The height of the drawing buffer.
  11769. * @param distance - The distance to the near plane in meters.
  11770. * @param pixelRatio - The scaling factor from pixel space to coordinate space.
  11771. * @param result - The object onto which to store the result.
  11772. * @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.
  11773. */
  11774. getPixelDimensions(drawingBufferWidth: number, drawingBufferHeight: number, distance: number, pixelRatio: number, result: Cartesian2): Cartesian2;
  11775. /**
  11776. * Returns a duplicate of a PerspectiveFrustum instance.
  11777. * @param [result] - The object onto which to store the result.
  11778. * @returns The modified result parameter or a new PerspectiveFrustum instance if one was not provided.
  11779. */
  11780. clone(result?: PerspectiveFrustum): PerspectiveFrustum;
  11781. /**
  11782. * Compares the provided PerspectiveFrustum componentwise and returns
  11783. <code>true</code> if they are equal, <code>false</code> otherwise.
  11784. * @param [other] - The right hand side PerspectiveFrustum.
  11785. * @returns <code>true</code> if they are equal, <code>false</code> otherwise.
  11786. */
  11787. equals(other?: PerspectiveFrustum): boolean;
  11788. /**
  11789. * Compares the provided PerspectiveFrustum componentwise and returns
  11790. <code>true</code> if they pass an absolute or relative tolerance test,
  11791. <code>false</code> otherwise.
  11792. * @param other - The right hand side PerspectiveFrustum.
  11793. * @param relativeEpsilon - The relative epsilon tolerance to use for equality testing.
  11794. * @param [absoluteEpsilon = relativeEpsilon] - The absolute epsilon tolerance to use for equality testing.
  11795. * @returns <code>true</code> if this and other are within the provided epsilon, <code>false</code> otherwise.
  11796. */
  11797. equalsEpsilon(other: PerspectiveFrustum, relativeEpsilon: number, absoluteEpsilon?: number): boolean;
  11798. }
  11799. /**
  11800. * The viewing frustum is defined by 6 planes.
  11801. Each plane is represented by a {@link Cartesian4} object, where the x, y, and z components
  11802. define the unit vector normal to the plane, and the w component is the distance of the
  11803. plane from the origin/camera position.
  11804. * @example
  11805. * var frustum = new Cesium.PerspectiveOffCenterFrustum({
  11806. left : -1.0,
  11807. right : 1.0,
  11808. top : 1.0,
  11809. bottom : -1.0,
  11810. near : 1.0,
  11811. far : 100.0
  11812. });
  11813. * @param [options] - An object with the following properties:
  11814. * @param [options.left] - The left clipping plane distance.
  11815. * @param [options.right] - The right clipping plane distance.
  11816. * @param [options.top] - The top clipping plane distance.
  11817. * @param [options.bottom] - The bottom clipping plane distance.
  11818. * @param [options.near = 1.0] - The near clipping plane distance.
  11819. * @param [options.far = 500000000.0] - The far clipping plane distance.
  11820. */
  11821. export class PerspectiveOffCenterFrustum {
  11822. constructor(options?: {
  11823. left?: number;
  11824. right?: number;
  11825. top?: number;
  11826. bottom?: number;
  11827. near?: number;
  11828. far?: number;
  11829. });
  11830. /**
  11831. * Defines the left clipping plane.
  11832. */
  11833. left: number;
  11834. /**
  11835. * Defines the right clipping plane.
  11836. */
  11837. right: number;
  11838. /**
  11839. * Defines the top clipping plane.
  11840. */
  11841. top: number;
  11842. /**
  11843. * Defines the bottom clipping plane.
  11844. */
  11845. bottom: number;
  11846. /**
  11847. * The distance of the near plane.
  11848. */
  11849. near: number;
  11850. /**
  11851. * The distance of the far plane.
  11852. */
  11853. far: number;
  11854. /**
  11855. * Gets the perspective projection matrix computed from the view frustum.
  11856. */
  11857. readonly projectionMatrix: Matrix4;
  11858. /**
  11859. * Gets the perspective projection matrix computed from the view frustum with an infinite far plane.
  11860. */
  11861. readonly infiniteProjectionMatrix: Matrix4;
  11862. /**
  11863. * Creates a culling volume for this frustum.
  11864. * @example
  11865. * // Check if a bounding volume intersects the frustum.
  11866. var cullingVolume = frustum.computeCullingVolume(cameraPosition, cameraDirection, cameraUp);
  11867. var intersect = cullingVolume.computeVisibility(boundingVolume);
  11868. * @param position - The eye position.
  11869. * @param direction - The view direction.
  11870. * @param up - The up direction.
  11871. * @returns A culling volume at the given position and orientation.
  11872. */
  11873. computeCullingVolume(position: Cartesian3, direction: Cartesian3, up: Cartesian3): CullingVolume;
  11874. /**
  11875. * Returns the pixel's width and height in meters.
  11876. * @example
  11877. * // Example 1
  11878. // Get the width and height of a pixel.
  11879. var pixelSize = camera.frustum.getPixelDimensions(scene.drawingBufferWidth, scene.drawingBufferHeight, 1.0, scene.pixelRatio, new Cesium.Cartesian2());
  11880. * @example
  11881. * // Example 2
  11882. // Get the width and height of a pixel if the near plane was set to 'distance'.
  11883. // For example, get the size of a pixel of an image on a billboard.
  11884. var position = camera.position;
  11885. var direction = camera.direction;
  11886. var toCenter = Cesium.Cartesian3.subtract(primitive.boundingVolume.center, position, new Cesium.Cartesian3()); // vector from camera to a primitive
  11887. var toCenterProj = Cesium.Cartesian3.multiplyByScalar(direction, Cesium.Cartesian3.dot(direction, toCenter), new Cesium.Cartesian3()); // project vector onto camera direction vector
  11888. var distance = Cesium.Cartesian3.magnitude(toCenterProj);
  11889. var pixelSize = camera.frustum.getPixelDimensions(scene.drawingBufferWidth, scene.drawingBufferHeight, distance, scene.pixelRatio, new Cesium.Cartesian2());
  11890. * @param drawingBufferWidth - The width of the drawing buffer.
  11891. * @param drawingBufferHeight - The height of the drawing buffer.
  11892. * @param distance - The distance to the near plane in meters.
  11893. * @param pixelRatio - The scaling factor from pixel space to coordinate space.
  11894. * @param result - The object onto which to store the result.
  11895. * @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.
  11896. */
  11897. getPixelDimensions(drawingBufferWidth: number, drawingBufferHeight: number, distance: number, pixelRatio: number, result: Cartesian2): Cartesian2;
  11898. /**
  11899. * Returns a duplicate of a PerspectiveOffCenterFrustum instance.
  11900. * @param [result] - The object onto which to store the result.
  11901. * @returns The modified result parameter or a new PerspectiveFrustum instance if one was not provided.
  11902. */
  11903. clone(result?: PerspectiveOffCenterFrustum): PerspectiveOffCenterFrustum;
  11904. /**
  11905. * Compares the provided PerspectiveOffCenterFrustum componentwise and returns
  11906. <code>true</code> if they are equal, <code>false</code> otherwise.
  11907. * @param [other] - The right hand side PerspectiveOffCenterFrustum.
  11908. * @returns <code>true</code> if they are equal, <code>false</code> otherwise.
  11909. */
  11910. equals(other?: PerspectiveOffCenterFrustum): boolean;
  11911. /**
  11912. * Compares the provided PerspectiveOffCenterFrustum componentwise and returns
  11913. <code>true</code> if they pass an absolute or relative tolerance test,
  11914. <code>false</code> otherwise.
  11915. * @param other - The right hand side PerspectiveOffCenterFrustum.
  11916. * @param relativeEpsilon - The relative epsilon tolerance to use for equality testing.
  11917. * @param [absoluteEpsilon = relativeEpsilon] - The absolute epsilon tolerance to use for equality testing.
  11918. * @returns <code>true</code> if this and other are within the provided epsilon, <code>false</code> otherwise.
  11919. */
  11920. equalsEpsilon(other: PerspectiveOffCenterFrustum, relativeEpsilon: number, absoluteEpsilon?: number): boolean;
  11921. }
  11922. /**
  11923. * A utility class for generating custom map pins as canvas elements.
  11924. <br /><br />
  11925. <div align='center'>
  11926. <img src='Images/PinBuilder.png' width='500'/><br />
  11927. Example pins generated using both the maki icon set, which ships with Cesium, and single character text.
  11928. </div>
  11929. */
  11930. export class PinBuilder {
  11931. constructor();
  11932. /**
  11933. * Creates an empty pin of the specified color and size.
  11934. * @param color - The color of the pin.
  11935. * @param size - The size of the pin, in pixels.
  11936. * @returns The canvas element that represents the generated pin.
  11937. */
  11938. fromColor(color: Color, size: number): HTMLCanvasElement;
  11939. /**
  11940. * Creates a pin with the specified icon, color, and size.
  11941. * @param url - The url of the image to be stamped onto the pin.
  11942. * @param color - The color of the pin.
  11943. * @param size - The size of the pin, in pixels.
  11944. * @returns The canvas element or a Promise to the canvas element that represents the generated pin.
  11945. */
  11946. fromUrl(url: Resource | string, color: Color, size: number): HTMLCanvasElement | Promise<HTMLCanvasElement>;
  11947. /**
  11948. * Creates a pin with the specified {@link https://www.mapbox.com/maki/|maki} icon identifier, color, and size.
  11949. * @param id - The id of the maki icon to be stamped onto the pin.
  11950. * @param color - The color of the pin.
  11951. * @param size - The size of the pin, in pixels.
  11952. * @returns The canvas element or a Promise to the canvas element that represents the generated pin.
  11953. */
  11954. fromMakiIconId(id: string, color: Color, size: number): HTMLCanvasElement | Promise<HTMLCanvasElement>;
  11955. /**
  11956. * Creates a pin with the specified text, color, and size. The text will be sized to be as large as possible
  11957. while still being contained completely within the pin.
  11958. * @param text - The text to be stamped onto the pin.
  11959. * @param color - The color of the pin.
  11960. * @param size - The size of the pin, in pixels.
  11961. * @returns The canvas element that represents the generated pin.
  11962. */
  11963. fromText(text: string, color: Color, size: number): HTMLCanvasElement;
  11964. }
  11965. /**
  11966. * The format of a pixel, i.e., the number of components it has and what they represent.
  11967. */
  11968. export enum PixelFormat {
  11969. /**
  11970. * A pixel format containing a depth value.
  11971. */
  11972. DEPTH_COMPONENT = WebGLConstants.DEPTH_COMPONENT,
  11973. /**
  11974. * A pixel format containing a depth and stencil value, most often used with {@link PixelDatatype.UNSIGNED_INT_24_8}.
  11975. */
  11976. DEPTH_STENCIL = WebGLConstants.DEPTH_STENCIL,
  11977. /**
  11978. * A pixel format containing an alpha channel.
  11979. */
  11980. ALPHA = WebGLConstants.ALPHA,
  11981. /**
  11982. * A pixel format containing red, green, and blue channels.
  11983. */
  11984. RGB = WebGLConstants.RGB,
  11985. /**
  11986. * A pixel format containing red, green, blue, and alpha channels.
  11987. */
  11988. RGBA = WebGLConstants.RGBA,
  11989. /**
  11990. * A pixel format containing a luminance (intensity) channel.
  11991. */
  11992. LUMINANCE = WebGLConstants.LUMINANCE,
  11993. /**
  11994. * A pixel format containing luminance (intensity) and alpha channels.
  11995. */
  11996. LUMINANCE_ALPHA = WebGLConstants.LUMINANCE_ALPHA,
  11997. /**
  11998. * A pixel format containing red, green, and blue channels that is DXT1 compressed.
  11999. */
  12000. RGB_DXT1 = WebGLConstants.COMPRESSED_RGB_S3TC_DXT1_EXT,
  12001. /**
  12002. * A pixel format containing red, green, blue, and alpha channels that is DXT1 compressed.
  12003. */
  12004. RGBA_DXT1 = WebGLConstants.COMPRESSED_RGBA_S3TC_DXT1_EXT,
  12005. /**
  12006. * A pixel format containing red, green, blue, and alpha channels that is DXT3 compressed.
  12007. */
  12008. RGBA_DXT3 = WebGLConstants.COMPRESSED_RGBA_S3TC_DXT3_EXT,
  12009. /**
  12010. * A pixel format containing red, green, blue, and alpha channels that is DXT5 compressed.
  12011. */
  12012. RGBA_DXT5 = WebGLConstants.COMPRESSED_RGBA_S3TC_DXT5_EXT,
  12013. /**
  12014. * A pixel format containing red, green, and blue channels that is PVR 4bpp compressed.
  12015. */
  12016. RGB_PVRTC_4BPPV1 = WebGLConstants.COMPRESSED_RGB_PVRTC_4BPPV1_IMG,
  12017. /**
  12018. * A pixel format containing red, green, and blue channels that is PVR 2bpp compressed.
  12019. */
  12020. RGB_PVRTC_2BPPV1 = WebGLConstants.COMPRESSED_RGB_PVRTC_2BPPV1_IMG,
  12021. /**
  12022. * A pixel format containing red, green, blue, and alpha channels that is PVR 4bpp compressed.
  12023. */
  12024. RGBA_PVRTC_4BPPV1 = WebGLConstants.COMPRESSED_RGBA_PVRTC_4BPPV1_IMG,
  12025. /**
  12026. * A pixel format containing red, green, blue, and alpha channels that is PVR 2bpp compressed.
  12027. */
  12028. RGBA_PVRTC_2BPPV1 = WebGLConstants.COMPRESSED_RGBA_PVRTC_2BPPV1_IMG,
  12029. /**
  12030. * A pixel format containing red, green, and blue channels that is ETC1 compressed.
  12031. */
  12032. RGB_ETC1 = WebGLConstants.COMPRESSED_RGB_ETC1_WEBGL
  12033. }
  12034. /**
  12035. * A plane in Hessian Normal Form defined by
  12036. <pre>
  12037. ax + by + cz + d = 0
  12038. </pre>
  12039. where (a, b, c) is the plane's <code>normal</code>, d is the signed
  12040. <code>distance</code> to the plane, and (x, y, z) is any point on
  12041. the plane.
  12042. * @example
  12043. * // The plane x=0
  12044. var plane = new Cesium.Plane(Cesium.Cartesian3.UNIT_X, 0.0);
  12045. * @param normal - The plane's normal (normalized).
  12046. * @param distance - The shortest distance from the origin to the plane. The sign of
  12047. <code>distance</code> determines which side of the plane the origin
  12048. is on. If <code>distance</code> is positive, the origin is in the half-space
  12049. in the direction of the normal; if negative, the origin is in the half-space
  12050. opposite to the normal; if zero, the plane passes through the origin.
  12051. */
  12052. export class Plane {
  12053. constructor(normal: Cartesian3, distance: number);
  12054. /**
  12055. * The plane's normal.
  12056. */
  12057. normal: Cartesian3;
  12058. /**
  12059. * The shortest distance from the origin to the plane. The sign of
  12060. <code>distance</code> determines which side of the plane the origin
  12061. is on. If <code>distance</code> is positive, the origin is in the half-space
  12062. in the direction of the normal; if negative, the origin is in the half-space
  12063. opposite to the normal; if zero, the plane passes through the origin.
  12064. */
  12065. distance: number;
  12066. /**
  12067. * Creates a plane from a normal and a point on the plane.
  12068. * @example
  12069. * var point = Cesium.Cartesian3.fromDegrees(-72.0, 40.0);
  12070. var normal = ellipsoid.geodeticSurfaceNormal(point);
  12071. var tangentPlane = Cesium.Plane.fromPointNormal(point, normal);
  12072. * @param point - The point on the plane.
  12073. * @param normal - The plane's normal (normalized).
  12074. * @param [result] - The object onto which to store the result.
  12075. * @returns A new plane instance or the modified result parameter.
  12076. */
  12077. static fromPointNormal(point: Cartesian3, normal: Cartesian3, result?: Plane): Plane;
  12078. /**
  12079. * Creates a plane from the general equation
  12080. * @param coefficients - The plane's normal (normalized).
  12081. * @param [result] - The object onto which to store the result.
  12082. * @returns A new plane instance or the modified result parameter.
  12083. */
  12084. static fromCartesian4(coefficients: Cartesian4, result?: Plane): Plane;
  12085. /**
  12086. * Computes the signed shortest distance of a point to a plane.
  12087. The sign of the distance determines which side of the plane the point
  12088. is on. If the distance is positive, the point is in the half-space
  12089. in the direction of the normal; if negative, the point is in the half-space
  12090. opposite to the normal; if zero, the plane passes through the point.
  12091. * @param plane - The plane.
  12092. * @param point - The point.
  12093. * @returns The signed shortest distance of the point to the plane.
  12094. */
  12095. static getPointDistance(plane: Plane, point: Cartesian3): number;
  12096. /**
  12097. * Projects a point onto the plane.
  12098. * @param plane - The plane to project the point onto
  12099. * @param point - The point to project onto the plane
  12100. * @param [result] - The result point. If undefined, a new Cartesian3 will be created.
  12101. * @returns The modified result parameter or a new Cartesian3 instance if one was not provided.
  12102. */
  12103. static projectPointOntoPlane(plane: Plane, point: Cartesian3, result?: Cartesian3): Cartesian3;
  12104. /**
  12105. * Transforms the plane by the given transformation matrix.
  12106. * @param plane - The plane.
  12107. * @param transform - The transformation matrix.
  12108. * @param [result] - The object into which to store the result.
  12109. * @returns The plane transformed by the given transformation matrix.
  12110. */
  12111. static transform(plane: Plane, transform: Matrix4, result?: Plane): Plane;
  12112. /**
  12113. * Duplicates a Plane instance.
  12114. * @param plane - The plane to duplicate.
  12115. * @param [result] - The object onto which to store the result.
  12116. * @returns The modified result parameter or a new Plane instance if one was not provided.
  12117. */
  12118. static clone(plane: Plane, result?: Plane): Plane;
  12119. /**
  12120. * Compares the provided Planes by normal and distance and returns
  12121. <code>true</code> if they are equal, <code>false</code> otherwise.
  12122. * @param left - The first plane.
  12123. * @param right - The second plane.
  12124. * @returns <code>true</code> if left and right are equal, <code>false</code> otherwise.
  12125. */
  12126. static equals(left: Plane, right: Plane): boolean;
  12127. /**
  12128. * A constant initialized to the XY plane passing through the origin, with normal in positive Z.
  12129. */
  12130. static readonly ORIGIN_XY_PLANE: Plane;
  12131. /**
  12132. * A constant initialized to the YZ plane passing through the origin, with normal in positive X.
  12133. */
  12134. static readonly ORIGIN_YZ_PLANE: Plane;
  12135. /**
  12136. * A constant initialized to the ZX plane passing through the origin, with normal in positive Y.
  12137. */
  12138. static readonly ORIGIN_ZX_PLANE: Plane;
  12139. }
  12140. /**
  12141. * Describes geometry representing a plane centered at the origin, with a unit width and length.
  12142. * @example
  12143. * var planeGeometry = new Cesium.PlaneGeometry({
  12144. vertexFormat : Cesium.VertexFormat.POSITION_ONLY
  12145. });
  12146. * @param [options] - Object with the following properties:
  12147. * @param [options.vertexFormat = VertexFormat.DEFAULT] - The vertex attributes to be computed.
  12148. */
  12149. export class PlaneGeometry {
  12150. constructor(options?: {
  12151. vertexFormat?: VertexFormat;
  12152. });
  12153. /**
  12154. * The number of elements used to pack the object into an array.
  12155. */
  12156. static packedLength: number;
  12157. /**
  12158. * Stores the provided instance into the provided array.
  12159. * @param value - The value to pack.
  12160. * @param array - The array to pack into.
  12161. * @param [startingIndex = 0] - The index into the array at which to start packing the elements.
  12162. * @returns The array that was packed into
  12163. */
  12164. static pack(value: PlaneGeometry, array: number[], startingIndex?: number): number[];
  12165. /**
  12166. * Retrieves an instance from a packed array.
  12167. * @param array - The packed array.
  12168. * @param [startingIndex = 0] - The starting index of the element to be unpacked.
  12169. * @param [result] - The object into which to store the result.
  12170. * @returns The modified result parameter or a new PlaneGeometry instance if one was not provided.
  12171. */
  12172. static unpack(array: number[], startingIndex?: number, result?: PlaneGeometry): PlaneGeometry;
  12173. /**
  12174. * Computes the geometric representation of a plane, including its vertices, indices, and a bounding sphere.
  12175. * @param planeGeometry - A description of the plane.
  12176. * @returns The computed vertices and indices.
  12177. */
  12178. static createGeometry(planeGeometry: PlaneGeometry): Geometry | undefined;
  12179. }
  12180. /**
  12181. * Describes geometry representing the outline of a plane centered at the origin, with a unit width and length.
  12182. */
  12183. export class PlaneOutlineGeometry {
  12184. constructor();
  12185. /**
  12186. * The number of elements used to pack the object into an array.
  12187. */
  12188. static packedLength: number;
  12189. /**
  12190. * Stores the provided instance into the provided array.
  12191. * @param value - The value to pack.
  12192. * @param array - The array to pack into.
  12193. * @returns The array that was packed into
  12194. */
  12195. static pack(value: PlaneOutlineGeometry, array: number[]): number[];
  12196. /**
  12197. * Retrieves an instance from a packed array.
  12198. * @param array - The packed array.
  12199. * @param [startingIndex = 0] - The starting index of the element to be unpacked.
  12200. * @param [result] - The object into which to store the result.
  12201. * @returns The modified result parameter or a new PlaneOutlineGeometry instance if one was not provided.
  12202. */
  12203. static unpack(array: number[], startingIndex?: number, result?: PlaneOutlineGeometry): PlaneOutlineGeometry;
  12204. /**
  12205. * Computes the geometric representation of an outline of a plane, including its vertices, indices, and a bounding sphere.
  12206. * @returns The computed vertices and indices.
  12207. */
  12208. static createGeometry(): Geometry | undefined;
  12209. }
  12210. /**
  12211. * Determines if a point is inside a triangle.
  12212. * @example
  12213. * // Returns true
  12214. var p = new Cesium.Cartesian2(0.25, 0.25);
  12215. var b = Cesium.pointInsideTriangle(p,
  12216. new Cesium.Cartesian2(0.0, 0.0),
  12217. new Cesium.Cartesian2(1.0, 0.0),
  12218. new Cesium.Cartesian2(0.0, 1.0));
  12219. * @param point - The point to test.
  12220. * @param p0 - The first point of the triangle.
  12221. * @param p1 - The second point of the triangle.
  12222. * @param p2 - The third point of the triangle.
  12223. * @returns <code>true</code> if the point is inside the triangle; otherwise, <code>false</code>.
  12224. */
  12225. export function pointInsideTriangle(point: Cartesian2 | Cartesian3, p0: Cartesian2 | Cartesian3, p1: Cartesian2 | Cartesian3, p2: Cartesian2 | Cartesian3): boolean;
  12226. /**
  12227. * 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}.
  12228. * @example
  12229. * // 1. create a polygon from points
  12230. var polygon = new Cesium.PolygonGeometry({
  12231. polygonHierarchy : new Cesium.PolygonHierarchy(
  12232. Cesium.Cartesian3.fromDegreesArray([
  12233. -72.0, 40.0,
  12234. -70.0, 35.0,
  12235. -75.0, 30.0,
  12236. -70.0, 30.0,
  12237. -68.0, 40.0
  12238. ])
  12239. )
  12240. });
  12241. var geometry = Cesium.PolygonGeometry.createGeometry(polygon);
  12242. // 2. create a nested polygon with holes
  12243. var polygonWithHole = new Cesium.PolygonGeometry({
  12244. polygonHierarchy : new Cesium.PolygonHierarchy(
  12245. Cesium.Cartesian3.fromDegreesArray([
  12246. -109.0, 30.0,
  12247. -95.0, 30.0,
  12248. -95.0, 40.0,
  12249. -109.0, 40.0
  12250. ]),
  12251. [new Cesium.PolygonHierarchy(
  12252. Cesium.Cartesian3.fromDegreesArray([
  12253. -107.0, 31.0,
  12254. -107.0, 39.0,
  12255. -97.0, 39.0,
  12256. -97.0, 31.0
  12257. ]),
  12258. [new Cesium.PolygonHierarchy(
  12259. Cesium.Cartesian3.fromDegreesArray([
  12260. -105.0, 33.0,
  12261. -99.0, 33.0,
  12262. -99.0, 37.0,
  12263. -105.0, 37.0
  12264. ]),
  12265. [new Cesium.PolygonHierarchy(
  12266. Cesium.Cartesian3.fromDegreesArray([
  12267. -103.0, 34.0,
  12268. -101.0, 34.0,
  12269. -101.0, 36.0,
  12270. -103.0, 36.0
  12271. ])
  12272. )]
  12273. )]
  12274. )]
  12275. )
  12276. });
  12277. var geometry = Cesium.PolygonGeometry.createGeometry(polygonWithHole);
  12278. // 3. create extruded polygon
  12279. var extrudedPolygon = new Cesium.PolygonGeometry({
  12280. polygonHierarchy : new Cesium.PolygonHierarchy(
  12281. Cesium.Cartesian3.fromDegreesArray([
  12282. -72.0, 40.0,
  12283. -70.0, 35.0,
  12284. -75.0, 30.0,
  12285. -70.0, 30.0,
  12286. -68.0, 40.0
  12287. ])
  12288. ),
  12289. extrudedHeight: 300000
  12290. });
  12291. var geometry = Cesium.PolygonGeometry.createGeometry(extrudedPolygon);
  12292. * @param options - Object with the following properties:
  12293. * @param options.polygonHierarchy - A polygon hierarchy that can include holes.
  12294. * @param [options.height = 0.0] - The distance in meters between the polygon and the ellipsoid surface.
  12295. * @param [options.extrudedHeight] - The distance in meters between the polygon's extruded face and the ellipsoid surface.
  12296. * @param [options.vertexFormat = VertexFormat.DEFAULT] - The vertex attributes to be computed.
  12297. * @param [options.stRotation = 0.0] - The rotation of the texture coordinates, in radians. A positive rotation is counter-clockwise.
  12298. * @param [options.ellipsoid = Ellipsoid.WGS84] - The ellipsoid to be used as a reference.
  12299. * @param [options.granularity = Math.RADIANS_PER_DEGREE] - The distance, in radians, between each latitude and longitude. Determines the number of positions in the buffer.
  12300. * @param [options.perPositionHeight = false] - Use the height of options.positions for each position instead of using options.height to determine the height.
  12301. * @param [options.closeTop = true] - When false, leaves off the top of an extruded polygon open.
  12302. * @param [options.closeBottom = true] - When false, leaves off the bottom of an extruded polygon open.
  12303. * @param [options.arcType = ArcType.GEODESIC] - The type of line the polygon edges must follow. Valid options are {@link ArcType.GEODESIC} and {@link ArcType.RHUMB}.
  12304. */
  12305. export class PolygonGeometry {
  12306. constructor(options: {
  12307. polygonHierarchy: PolygonHierarchy;
  12308. height?: number;
  12309. extrudedHeight?: number;
  12310. vertexFormat?: VertexFormat;
  12311. stRotation?: number;
  12312. ellipsoid?: Ellipsoid;
  12313. granularity?: number;
  12314. perPositionHeight?: boolean;
  12315. closeTop?: boolean;
  12316. closeBottom?: boolean;
  12317. arcType?: ArcType;
  12318. });
  12319. /**
  12320. * The number of elements used to pack the object into an array.
  12321. */
  12322. packedLength: number;
  12323. /**
  12324. * A description of a polygon from an array of positions. Polygon geometry can be rendered with both {@link Primitive} and {@link GroundPrimitive}.
  12325. * @example
  12326. * // create a polygon from points
  12327. var polygon = Cesium.PolygonGeometry.fromPositions({
  12328. positions : Cesium.Cartesian3.fromDegreesArray([
  12329. -72.0, 40.0,
  12330. -70.0, 35.0,
  12331. -75.0, 30.0,
  12332. -70.0, 30.0,
  12333. -68.0, 40.0
  12334. ])
  12335. });
  12336. var geometry = Cesium.PolygonGeometry.createGeometry(polygon);
  12337. * @param options - Object with the following properties:
  12338. * @param options.positions - An array of positions that defined the corner points of the polygon.
  12339. * @param [options.height = 0.0] - The height of the polygon.
  12340. * @param [options.extrudedHeight] - The height of the polygon extrusion.
  12341. * @param [options.vertexFormat = VertexFormat.DEFAULT] - The vertex attributes to be computed.
  12342. * @param [options.stRotation = 0.0] - The rotation of the texture coordinates, in radians. A positive rotation is counter-clockwise.
  12343. * @param [options.ellipsoid = Ellipsoid.WGS84] - The ellipsoid to be used as a reference.
  12344. * @param [options.granularity = Math.RADIANS_PER_DEGREE] - The distance, in radians, between each latitude and longitude. Determines the number of positions in the buffer.
  12345. * @param [options.perPositionHeight = false] - Use the height of options.positions for each position instead of using options.height to determine the height.
  12346. * @param [options.closeTop = true] - When false, leaves off the top of an extruded polygon open.
  12347. * @param [options.closeBottom = true] - When false, leaves off the bottom of an extruded polygon open.
  12348. * @param [options.arcType = ArcType.GEODESIC] - The type of line the polygon edges must follow. Valid options are {@link ArcType.GEODESIC} and {@link ArcType.RHUMB}.
  12349. */
  12350. static fromPositions(options: {
  12351. positions: Cartesian3[];
  12352. height?: number;
  12353. extrudedHeight?: number;
  12354. vertexFormat?: VertexFormat;
  12355. stRotation?: number;
  12356. ellipsoid?: Ellipsoid;
  12357. granularity?: number;
  12358. perPositionHeight?: boolean;
  12359. closeTop?: boolean;
  12360. closeBottom?: boolean;
  12361. arcType?: ArcType;
  12362. }): PolygonGeometry;
  12363. /**
  12364. * Stores the provided instance into the provided array.
  12365. * @param value - The value to pack.
  12366. * @param array - The array to pack into.
  12367. * @param [startingIndex = 0] - The index into the array at which to start packing the elements.
  12368. * @returns The array that was packed into
  12369. */
  12370. static pack(value: PolygonGeometry, array: number[], startingIndex?: number): number[];
  12371. /**
  12372. * Retrieves an instance from a packed array.
  12373. * @param array - The packed array.
  12374. * @param [startingIndex = 0] - The starting index of the element to be unpacked.
  12375. * @param [result] - The object into which to store the result.
  12376. */
  12377. static unpack(array: number[], startingIndex?: number, result?: PolygonGeometry): void;
  12378. /**
  12379. * Returns the bounding rectangle given the provided options
  12380. * @param options - Object with the following properties:
  12381. * @param options.polygonHierarchy - A polygon hierarchy that can include holes.
  12382. * @param [options.granularity = Math.RADIANS_PER_DEGREE] - The distance, in radians, between each latitude and longitude. Determines the number of positions sampled.
  12383. * @param [options.arcType = ArcType.GEODESIC] - The type of line the polygon edges must follow. Valid options are {@link ArcType.GEODESIC} and {@link ArcType.RHUMB}.
  12384. * @param [options.ellipsoid = Ellipsoid.WGS84] - The ellipsoid to be used as a reference.
  12385. * @param [result] - An object in which to store the result.
  12386. * @returns The result rectangle
  12387. */
  12388. static computeRectangle(options: {
  12389. polygonHierarchy: PolygonHierarchy;
  12390. granularity?: number;
  12391. arcType?: ArcType;
  12392. ellipsoid?: Ellipsoid;
  12393. }, result?: Rectangle): Rectangle;
  12394. /**
  12395. * Computes the geometric representation of a polygon, including its vertices, indices, and a bounding sphere.
  12396. * @param polygonGeometry - A description of the polygon.
  12397. * @returns The computed vertices and indices.
  12398. */
  12399. static createGeometry(polygonGeometry: PolygonGeometry): Geometry | undefined;
  12400. }
  12401. /**
  12402. * An hierarchy of linear rings which define a polygon and its holes.
  12403. The holes themselves may also have holes which nest inner polygons.
  12404. * @param [positions] - A linear ring defining the outer boundary of the polygon or hole.
  12405. * @param [holes] - An array of polygon hierarchies defining holes in the polygon.
  12406. */
  12407. export class PolygonHierarchy {
  12408. constructor(positions?: Cartesian3[], holes?: PolygonHierarchy[]);
  12409. /**
  12410. * A linear ring defining the outer boundary of the polygon or hole.
  12411. */
  12412. positions: Cartesian3[];
  12413. /**
  12414. * An array of polygon hierarchies defining holes in the polygon.
  12415. */
  12416. holes: PolygonHierarchy[];
  12417. }
  12418. /**
  12419. * A description of the outline of a polygon on the ellipsoid. The polygon is defined by a polygon hierarchy.
  12420. * @example
  12421. * // 1. create a polygon outline from points
  12422. var polygon = new Cesium.PolygonOutlineGeometry({
  12423. polygonHierarchy : new Cesium.PolygonHierarchy(
  12424. Cesium.Cartesian3.fromDegreesArray([
  12425. -72.0, 40.0,
  12426. -70.0, 35.0,
  12427. -75.0, 30.0,
  12428. -70.0, 30.0,
  12429. -68.0, 40.0
  12430. ])
  12431. )
  12432. });
  12433. var geometry = Cesium.PolygonOutlineGeometry.createGeometry(polygon);
  12434. // 2. create a nested polygon with holes outline
  12435. var polygonWithHole = new Cesium.PolygonOutlineGeometry({
  12436. polygonHierarchy : new Cesium.PolygonHierarchy(
  12437. Cesium.Cartesian3.fromDegreesArray([
  12438. -109.0, 30.0,
  12439. -95.0, 30.0,
  12440. -95.0, 40.0,
  12441. -109.0, 40.0
  12442. ]),
  12443. [new Cesium.PolygonHierarchy(
  12444. Cesium.Cartesian3.fromDegreesArray([
  12445. -107.0, 31.0,
  12446. -107.0, 39.0,
  12447. -97.0, 39.0,
  12448. -97.0, 31.0
  12449. ]),
  12450. [new Cesium.PolygonHierarchy(
  12451. Cesium.Cartesian3.fromDegreesArray([
  12452. -105.0, 33.0,
  12453. -99.0, 33.0,
  12454. -99.0, 37.0,
  12455. -105.0, 37.0
  12456. ]),
  12457. [new Cesium.PolygonHierarchy(
  12458. Cesium.Cartesian3.fromDegreesArray([
  12459. -103.0, 34.0,
  12460. -101.0, 34.0,
  12461. -101.0, 36.0,
  12462. -103.0, 36.0
  12463. ])
  12464. )]
  12465. )]
  12466. )]
  12467. )
  12468. });
  12469. var geometry = Cesium.PolygonOutlineGeometry.createGeometry(polygonWithHole);
  12470. // 3. create extruded polygon outline
  12471. var extrudedPolygon = new Cesium.PolygonOutlineGeometry({
  12472. polygonHierarchy : new Cesium.PolygonHierarchy(
  12473. Cesium.Cartesian3.fromDegreesArray([
  12474. -72.0, 40.0,
  12475. -70.0, 35.0,
  12476. -75.0, 30.0,
  12477. -70.0, 30.0,
  12478. -68.0, 40.0
  12479. ])
  12480. ),
  12481. extrudedHeight: 300000
  12482. });
  12483. var geometry = Cesium.PolygonOutlineGeometry.createGeometry(extrudedPolygon);
  12484. * @param options - Object with the following properties:
  12485. * @param options.polygonHierarchy - A polygon hierarchy that can include holes.
  12486. * @param [options.height = 0.0] - The distance in meters between the polygon and the ellipsoid surface.
  12487. * @param [options.extrudedHeight] - The distance in meters between the polygon's extruded face and the ellipsoid surface.
  12488. * @param [options.vertexFormat = VertexFormat.DEFAULT] - The vertex attributes to be computed.
  12489. * @param [options.ellipsoid = Ellipsoid.WGS84] - The ellipsoid to be used as a reference.
  12490. * @param [options.granularity = Math.RADIANS_PER_DEGREE] - The distance, in radians, between each latitude and longitude. Determines the number of positions in the buffer.
  12491. * @param [options.perPositionHeight = false] - Use the height of options.positions for each position instead of using options.height to determine the height.
  12492. * @param [options.arcType = ArcType.GEODESIC] - The type of path the outline must follow. Valid options are {@link ArcType.GEODESIC} and {@link ArcType.RHUMB}.
  12493. */
  12494. export class PolygonOutlineGeometry {
  12495. constructor(options: {
  12496. polygonHierarchy: PolygonHierarchy;
  12497. height?: number;
  12498. extrudedHeight?: number;
  12499. vertexFormat?: VertexFormat;
  12500. ellipsoid?: Ellipsoid;
  12501. granularity?: number;
  12502. perPositionHeight?: boolean;
  12503. arcType?: ArcType;
  12504. });
  12505. /**
  12506. * The number of elements used to pack the object into an array.
  12507. */
  12508. packedLength: number;
  12509. /**
  12510. * Stores the provided instance into the provided array.
  12511. * @param value - The value to pack.
  12512. * @param array - The array to pack into.
  12513. * @param [startingIndex = 0] - The index into the array at which to start packing the elements.
  12514. * @returns The array that was packed into
  12515. */
  12516. static pack(value: PolygonOutlineGeometry, array: number[], startingIndex?: number): number[];
  12517. /**
  12518. * Retrieves an instance from a packed array.
  12519. * @param array - The packed array.
  12520. * @param [startingIndex = 0] - The starting index of the element to be unpacked.
  12521. * @param [result] - The object into which to store the result.
  12522. * @returns The modified result parameter or a new PolygonOutlineGeometry instance if one was not provided.
  12523. */
  12524. static unpack(array: number[], startingIndex?: number, result?: PolygonOutlineGeometry): PolygonOutlineGeometry;
  12525. /**
  12526. * A description of a polygon outline from an array of positions.
  12527. * @example
  12528. * // create a polygon from points
  12529. var polygon = Cesium.PolygonOutlineGeometry.fromPositions({
  12530. positions : Cesium.Cartesian3.fromDegreesArray([
  12531. -72.0, 40.0,
  12532. -70.0, 35.0,
  12533. -75.0, 30.0,
  12534. -70.0, 30.0,
  12535. -68.0, 40.0
  12536. ])
  12537. });
  12538. var geometry = Cesium.PolygonOutlineGeometry.createGeometry(polygon);
  12539. * @param options - Object with the following properties:
  12540. * @param options.positions - An array of positions that defined the corner points of the polygon.
  12541. * @param [options.height = 0.0] - The height of the polygon.
  12542. * @param [options.extrudedHeight] - The height of the polygon extrusion.
  12543. * @param [options.ellipsoid = Ellipsoid.WGS84] - The ellipsoid to be used as a reference.
  12544. * @param [options.granularity = Math.RADIANS_PER_DEGREE] - The distance, in radians, between each latitude and longitude. Determines the number of positions in the buffer.
  12545. * @param [options.perPositionHeight = false] - Use the height of options.positions for each position instead of using options.height to determine the height.
  12546. * @param [options.arcType = ArcType.GEODESIC] - The type of path the outline must follow. Valid options are {@link LinkType.GEODESIC} and {@link ArcType.RHUMB}.
  12547. */
  12548. static fromPositions(options: {
  12549. positions: Cartesian3[];
  12550. height?: number;
  12551. extrudedHeight?: number;
  12552. ellipsoid?: Ellipsoid;
  12553. granularity?: number;
  12554. perPositionHeight?: boolean;
  12555. arcType?: ArcType;
  12556. }): PolygonOutlineGeometry;
  12557. /**
  12558. * Computes the geometric representation of a polygon outline, including its vertices, indices, and a bounding sphere.
  12559. * @param polygonGeometry - A description of the polygon outline.
  12560. * @returns The computed vertices and indices.
  12561. */
  12562. static createGeometry(polygonGeometry: PolygonOutlineGeometry): Geometry | undefined;
  12563. }
  12564. /**
  12565. * A description of a polyline modeled as a line strip; the first two positions define a line segment,
  12566. and each additional position defines a line segment from the previous position. The polyline is capable of
  12567. displaying with a material.
  12568. * @example
  12569. * // A polyline with two connected line segments
  12570. var polyline = new Cesium.PolylineGeometry({
  12571. positions : Cesium.Cartesian3.fromDegreesArray([
  12572. 0.0, 0.0,
  12573. 5.0, 0.0,
  12574. 5.0, 5.0
  12575. ]),
  12576. width : 10.0
  12577. });
  12578. var geometry = Cesium.PolylineGeometry.createGeometry(polyline);
  12579. * @param options - Object with the following properties:
  12580. * @param options.positions - An array of {@link Cartesian3} defining the positions in the polyline as a line strip.
  12581. * @param [options.width = 1.0] - The width in pixels.
  12582. * @param [options.colors] - An Array of {@link Color} defining the per vertex or per segment colors.
  12583. * @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.
  12584. * @param [options.arcType = ArcType.GEODESIC] - The type of line the polyline segments must follow.
  12585. * @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.
  12586. * @param [options.vertexFormat = VertexFormat.DEFAULT] - The vertex attributes to be computed.
  12587. * @param [options.ellipsoid = Ellipsoid.WGS84] - The ellipsoid to be used as a reference.
  12588. */
  12589. export class PolylineGeometry {
  12590. constructor(options: {
  12591. positions: Cartesian3[];
  12592. width?: number;
  12593. colors?: Color[];
  12594. colorsPerVertex?: boolean;
  12595. arcType?: ArcType;
  12596. granularity?: number;
  12597. vertexFormat?: VertexFormat;
  12598. ellipsoid?: Ellipsoid;
  12599. });
  12600. /**
  12601. * The number of elements used to pack the object into an array.
  12602. */
  12603. packedLength: number;
  12604. /**
  12605. * Stores the provided instance into the provided array.
  12606. * @param value - The value to pack.
  12607. * @param array - The array to pack into.
  12608. * @param [startingIndex = 0] - The index into the array at which to start packing the elements.
  12609. * @returns The array that was packed into
  12610. */
  12611. static pack(value: PolylineGeometry, array: number[], startingIndex?: number): number[];
  12612. /**
  12613. * Retrieves an instance from a packed array.
  12614. * @param array - The packed array.
  12615. * @param [startingIndex = 0] - The starting index of the element to be unpacked.
  12616. * @param [result] - The object into which to store the result.
  12617. * @returns The modified result parameter or a new PolylineGeometry instance if one was not provided.
  12618. */
  12619. static unpack(array: number[], startingIndex?: number, result?: PolylineGeometry): PolylineGeometry;
  12620. /**
  12621. * Computes the geometric representation of a polyline, including its vertices, indices, and a bounding sphere.
  12622. * @param polylineGeometry - A description of the polyline.
  12623. * @returns The computed vertices and indices.
  12624. */
  12625. static createGeometry(polylineGeometry: PolylineGeometry): Geometry | undefined;
  12626. }
  12627. /**
  12628. * A description of a polyline with a volume (a 2D shape extruded along a polyline).
  12629. * @example
  12630. * function computeCircle(radius) {
  12631. var positions = [];
  12632. for (var i = 0; i < 360; i++) {
  12633. var radians = Cesium.Math.toRadians(i);
  12634. positions.push(new Cesium.Cartesian2(radius * Math.cos(radians), radius * Math.sin(radians)));
  12635. }
  12636. return positions;
  12637. }
  12638. var volume = new Cesium.PolylineVolumeGeometry({
  12639. vertexFormat : Cesium.VertexFormat.POSITION_ONLY,
  12640. polylinePositions : Cesium.Cartesian3.fromDegreesArray([
  12641. -72.0, 40.0,
  12642. -70.0, 35.0
  12643. ]),
  12644. shapePositions : computeCircle(100000.0)
  12645. });
  12646. * @param options - Object with the following properties:
  12647. * @param options.polylinePositions - An array of {@link Cartesain3} positions that define the center of the polyline volume.
  12648. * @param options.shapePositions - An array of {@link Cartesian2} positions that define the shape to be extruded along the polyline
  12649. * @param [options.ellipsoid = Ellipsoid.WGS84] - The ellipsoid to be used as a reference.
  12650. * @param [options.granularity = Math.RADIANS_PER_DEGREE] - The distance, in radians, between each latitude and longitude. Determines the number of positions in the buffer.
  12651. * @param [options.vertexFormat = VertexFormat.DEFAULT] - The vertex attributes to be computed.
  12652. * @param [options.cornerType = CornerType.ROUNDED] - Determines the style of the corners.
  12653. */
  12654. export class PolylineVolumeGeometry {
  12655. constructor(options: {
  12656. polylinePositions: Cartesian3[];
  12657. shapePositions: Cartesian2[];
  12658. ellipsoid?: Ellipsoid;
  12659. granularity?: number;
  12660. vertexFormat?: VertexFormat;
  12661. cornerType?: CornerType;
  12662. });
  12663. /**
  12664. * The number of elements used to pack the object into an array.
  12665. */
  12666. packedLength: number;
  12667. /**
  12668. * Stores the provided instance into the provided array.
  12669. * @param value - The value to pack.
  12670. * @param array - The array to pack into.
  12671. * @param [startingIndex = 0] - The index into the array at which to start packing the elements.
  12672. * @returns The array that was packed into
  12673. */
  12674. static pack(value: PolylineVolumeGeometry, array: number[], startingIndex?: number): number[];
  12675. /**
  12676. * Retrieves an instance from a packed array.
  12677. * @param array - The packed array.
  12678. * @param [startingIndex = 0] - The starting index of the element to be unpacked.
  12679. * @param [result] - The object into which to store the result.
  12680. * @returns The modified result parameter or a new PolylineVolumeGeometry instance if one was not provided.
  12681. */
  12682. static unpack(array: number[], startingIndex?: number, result?: PolylineVolumeGeometry): PolylineVolumeGeometry;
  12683. /**
  12684. * Computes the geometric representation of a polyline with a volume, including its vertices, indices, and a bounding sphere.
  12685. * @param polylineVolumeGeometry - A description of the polyline volume.
  12686. * @returns The computed vertices and indices.
  12687. */
  12688. static createGeometry(polylineVolumeGeometry: PolylineVolumeGeometry): Geometry | undefined;
  12689. }
  12690. /**
  12691. * A description of a polyline with a volume (a 2D shape extruded along a polyline).
  12692. * @example
  12693. * function computeCircle(radius) {
  12694. var positions = [];
  12695. for (var i = 0; i < 360; i++) {
  12696. var radians = Cesium.Math.toRadians(i);
  12697. positions.push(new Cesium.Cartesian2(radius * Math.cos(radians), radius * Math.sin(radians)));
  12698. }
  12699. return positions;
  12700. }
  12701. var volumeOutline = new Cesium.PolylineVolumeOutlineGeometry({
  12702. polylinePositions : Cesium.Cartesian3.fromDegreesArray([
  12703. -72.0, 40.0,
  12704. -70.0, 35.0
  12705. ]),
  12706. shapePositions : computeCircle(100000.0)
  12707. });
  12708. * @param options - Object with the following properties:
  12709. * @param options.polylinePositions - An array of positions that define the center of the polyline volume.
  12710. * @param options.shapePositions - An array of positions that define the shape to be extruded along the polyline
  12711. * @param [options.ellipsoid = Ellipsoid.WGS84] - The ellipsoid to be used as a reference.
  12712. * @param [options.granularity = Math.RADIANS_PER_DEGREE] - The distance, in radians, between each latitude and longitude. Determines the number of positions in the buffer.
  12713. * @param [options.cornerType = CornerType.ROUNDED] - Determines the style of the corners.
  12714. */
  12715. export class PolylineVolumeOutlineGeometry {
  12716. constructor(options: {
  12717. polylinePositions: Cartesian3[];
  12718. shapePositions: Cartesian2[];
  12719. ellipsoid?: Ellipsoid;
  12720. granularity?: number;
  12721. cornerType?: CornerType;
  12722. });
  12723. /**
  12724. * The number of elements used to pack the object into an array.
  12725. */
  12726. packedLength: number;
  12727. /**
  12728. * Stores the provided instance into the provided array.
  12729. * @param value - The value to pack.
  12730. * @param array - The array to pack into.
  12731. * @param [startingIndex = 0] - The index into the array at which to start packing the elements.
  12732. * @returns The array that was packed into
  12733. */
  12734. static pack(value: PolylineVolumeOutlineGeometry, array: number[], startingIndex?: number): number[];
  12735. /**
  12736. * Retrieves an instance from a packed array.
  12737. * @param array - The packed array.
  12738. * @param [startingIndex = 0] - The starting index of the element to be unpacked.
  12739. * @param [result] - The object into which to store the result.
  12740. * @returns The modified result parameter or a new PolylineVolumeOutlineGeometry instance if one was not provided.
  12741. */
  12742. static unpack(array: number[], startingIndex?: number, result?: PolylineVolumeOutlineGeometry): PolylineVolumeOutlineGeometry;
  12743. /**
  12744. * Computes the geometric representation of the outline of a polyline with a volume, including its vertices, indices, and a bounding sphere.
  12745. * @param polylineVolumeOutlineGeometry - A description of the polyline volume outline.
  12746. * @returns The computed vertices and indices.
  12747. */
  12748. static createGeometry(polylineVolumeOutlineGeometry: PolylineVolumeOutlineGeometry): Geometry | undefined;
  12749. }
  12750. /**
  12751. * The type of a geometric primitive, i.e., points, lines, and triangles.
  12752. */
  12753. export enum PrimitiveType {
  12754. /**
  12755. * Points primitive where each vertex (or index) is a separate point.
  12756. */
  12757. POINTS = WebGLConstants.POINTS,
  12758. /**
  12759. * Lines primitive where each two vertices (or indices) is a line segment. Line segments are not necessarily connected.
  12760. */
  12761. LINES = WebGLConstants.LINES,
  12762. /**
  12763. * Line loop primitive where each vertex (or index) after the first connects a line to
  12764. the previous vertex, and the last vertex implicitly connects to the first.
  12765. */
  12766. LINE_LOOP = WebGLConstants.LINE_LOOP,
  12767. /**
  12768. * Line strip primitive where each vertex (or index) after the first connects a line to the previous vertex.
  12769. */
  12770. LINE_STRIP = WebGLConstants.LINE_STRIP,
  12771. /**
  12772. * Triangles primitive where each three vertices (or indices) is a triangle. Triangles do not necessarily share edges.
  12773. */
  12774. TRIANGLES = WebGLConstants.TRIANGLES,
  12775. /**
  12776. * Triangle strip primitive where each vertex (or index) after the first two connect to
  12777. the previous two vertices forming a triangle. For example, this can be used to model a wall.
  12778. */
  12779. TRIANGLE_STRIP = WebGLConstants.TRIANGLE_STRIP,
  12780. /**
  12781. * Triangle fan primitive where each vertex (or index) after the first two connect to
  12782. the previous vertex and the first vertex forming a triangle. For example, this can be used
  12783. to model a cone or circle.
  12784. */
  12785. TRIANGLE_FAN = WebGLConstants.TRIANGLE_FAN
  12786. }
  12787. /**
  12788. * Base class for proxying requested made by {@link Resource}.
  12789. */
  12790. export class Proxy {
  12791. constructor();
  12792. /**
  12793. * Get the final URL to use to request a given resource.
  12794. * @param resource - The resource to request.
  12795. * @returns proxied resource
  12796. */
  12797. getURL(resource: string): string;
  12798. }
  12799. /**
  12800. * Defines functions for 2nd order polynomial functions of one variable with only real coefficients.
  12801. */
  12802. export namespace QuadraticRealPolynomial {
  12803. /**
  12804. * Provides the discriminant of the quadratic equation from the supplied coefficients.
  12805. * @param a - The coefficient of the 2nd order monomial.
  12806. * @param b - The coefficient of the 1st order monomial.
  12807. * @param c - The coefficient of the 0th order monomial.
  12808. * @returns The value of the discriminant.
  12809. */
  12810. function computeDiscriminant(a: number, b: number, c: number): number;
  12811. /**
  12812. * Provides the real valued roots of the quadratic polynomial with the provided coefficients.
  12813. * @param a - The coefficient of the 2nd order monomial.
  12814. * @param b - The coefficient of the 1st order monomial.
  12815. * @param c - The coefficient of the 0th order monomial.
  12816. * @returns The real valued roots.
  12817. */
  12818. function computeRealRoots(a: number, b: number, c: number): number[];
  12819. }
  12820. /**
  12821. * Terrain data for a single tile where the terrain data is represented as a quantized mesh. A quantized
  12822. mesh consists of three vertex attributes, longitude, latitude, and height. All attributes are expressed
  12823. as 16-bit values in the range 0 to 32767. Longitude and latitude are zero at the southwest corner
  12824. of the tile and 32767 at the northeast corner. Height is zero at the minimum height in the tile
  12825. and 32767 at the maximum height in the tile.
  12826. * @example
  12827. * var data = new Cesium.QuantizedMeshTerrainData({
  12828. minimumHeight : -100,
  12829. maximumHeight : 2101,
  12830. quantizedVertices : new Uint16Array([// order is SW NW SE NE
  12831. // longitude
  12832. 0, 0, 32767, 32767,
  12833. // latitude
  12834. 0, 32767, 0, 32767,
  12835. // heights
  12836. 16384, 0, 32767, 16384]),
  12837. indices : new Uint16Array([0, 3, 1,
  12838. 0, 2, 3]),
  12839. boundingSphere : new Cesium.BoundingSphere(new Cesium.Cartesian3(1.0, 2.0, 3.0), 10000),
  12840. orientedBoundingBox : new Cesium.OrientedBoundingBox(new Cesium.Cartesian3(1.0, 2.0, 3.0), Cesium.Matrix3.fromRotationX(Cesium.Math.PI, new Cesium.Matrix3())),
  12841. horizonOcclusionPoint : new Cesium.Cartesian3(3.0, 2.0, 1.0),
  12842. westIndices : [0, 1],
  12843. southIndices : [0, 1],
  12844. eastIndices : [2, 3],
  12845. northIndices : [1, 3],
  12846. westSkirtHeight : 1.0,
  12847. southSkirtHeight : 1.0,
  12848. eastSkirtHeight : 1.0,
  12849. northSkirtHeight : 1.0
  12850. });
  12851. * @param options - Object with the following properties:
  12852. * @param options.quantizedVertices - The buffer containing the quantized mesh.
  12853. * @param options.indices - The indices specifying how the quantized vertices are linked
  12854. together into triangles. Each three indices specifies one triangle.
  12855. * @param options.minimumHeight - The minimum terrain height within the tile, in meters above the ellipsoid.
  12856. * @param options.maximumHeight - The maximum terrain height within the tile, in meters above the ellipsoid.
  12857. * @param options.boundingSphere - A sphere bounding all of the vertices in the mesh.
  12858. * @param [options.orientedBoundingBox] - An OrientedBoundingBox bounding all of the vertices in the mesh.
  12859. * @param options.horizonOcclusionPoint - The horizon occlusion point of the mesh. If this point
  12860. is below the horizon, the entire tile is assumed to be below the horizon as well.
  12861. The point is expressed in ellipsoid-scaled coordinates.
  12862. * @param options.westIndices - The indices of the vertices on the western edge of the tile.
  12863. * @param options.southIndices - The indices of the vertices on the southern edge of the tile.
  12864. * @param options.eastIndices - The indices of the vertices on the eastern edge of the tile.
  12865. * @param options.northIndices - The indices of the vertices on the northern edge of the tile.
  12866. * @param options.westSkirtHeight - The height of the skirt to add on the western edge of the tile.
  12867. * @param options.southSkirtHeight - The height of the skirt to add on the southern edge of the tile.
  12868. * @param options.eastSkirtHeight - The height of the skirt to add on the eastern edge of the tile.
  12869. * @param options.northSkirtHeight - The height of the skirt to add on the northern edge of the tile.
  12870. * @param [options.childTileMask = 15] - A bit mask indicating which of this tile's four children exist.
  12871. If a child's bit is set, geometry will be requested for that tile as well when it
  12872. is needed. If the bit is cleared, the child tile is not requested and geometry is
  12873. instead upsampled from the parent. The bit values are as follows:
  12874. <table>
  12875. <tr><th>Bit Position</th><th>Bit Value</th><th>Child Tile</th></tr>
  12876. <tr><td>0</td><td>1</td><td>Southwest</td></tr>
  12877. <tr><td>1</td><td>2</td><td>Southeast</td></tr>
  12878. <tr><td>2</td><td>4</td><td>Northwest</td></tr>
  12879. <tr><td>3</td><td>8</td><td>Northeast</td></tr>
  12880. </table>
  12881. * @param [options.createdByUpsampling = false] - True if this instance was created by upsampling another instance;
  12882. otherwise, false.
  12883. * @param [options.encodedNormals] - The buffer containing per vertex normals, encoded using 'oct' encoding
  12884. * @param [options.waterMask] - The buffer containing the watermask.
  12885. * @param [options.credits] - Array of credits for this tile.
  12886. */
  12887. export class QuantizedMeshTerrainData {
  12888. constructor(options: {
  12889. quantizedVertices: Uint16Array;
  12890. indices: Uint16Array | Uint32Array;
  12891. minimumHeight: number;
  12892. maximumHeight: number;
  12893. boundingSphere: BoundingSphere;
  12894. orientedBoundingBox?: OrientedBoundingBox;
  12895. horizonOcclusionPoint: Cartesian3;
  12896. westIndices: number[];
  12897. southIndices: number[];
  12898. eastIndices: number[];
  12899. northIndices: number[];
  12900. westSkirtHeight: number;
  12901. southSkirtHeight: number;
  12902. eastSkirtHeight: number;
  12903. northSkirtHeight: number;
  12904. childTileMask?: number;
  12905. createdByUpsampling?: boolean;
  12906. encodedNormals?: Uint8Array;
  12907. waterMask?: Uint8Array;
  12908. credits?: Credit[];
  12909. });
  12910. /**
  12911. * An array of credits for this tile.
  12912. */
  12913. credits: Credit[];
  12914. /**
  12915. * The water mask included in this terrain data, if any. A water mask is a rectangular
  12916. Uint8Array or image where a value of 255 indicates water and a value of 0 indicates land.
  12917. Values in between 0 and 255 are allowed as well to smoothly blend between land and water.
  12918. */
  12919. waterMask: Uint8Array | HTMLImageElement | HTMLCanvasElement;
  12920. /**
  12921. * Upsamples this terrain data for use by a descendant tile. The resulting instance will contain a subset of the
  12922. vertices in this instance, interpolated if necessary.
  12923. * @param tilingScheme - The tiling scheme of this terrain data.
  12924. * @param thisX - The X coordinate of this tile in the tiling scheme.
  12925. * @param thisY - The Y coordinate of this tile in the tiling scheme.
  12926. * @param thisLevel - The level of this tile in the tiling scheme.
  12927. * @param descendantX - The X coordinate within the tiling scheme of the descendant tile for which we are upsampling.
  12928. * @param descendantY - The Y coordinate within the tiling scheme of the descendant tile for which we are upsampling.
  12929. * @param descendantLevel - The level within the tiling scheme of the descendant tile for which we are upsampling.
  12930. * @returns A promise for upsampled heightmap terrain data for the descendant tile,
  12931. or undefined if too many asynchronous upsample operations are in progress and the request has been
  12932. deferred.
  12933. */
  12934. upsample(tilingScheme: TilingScheme, thisX: number, thisY: number, thisLevel: number, descendantX: number, descendantY: number, descendantLevel: number): Promise<QuantizedMeshTerrainData> | undefined;
  12935. /**
  12936. * Computes the terrain height at a specified longitude and latitude.
  12937. * @param rectangle - The rectangle covered by this terrain data.
  12938. * @param longitude - The longitude in radians.
  12939. * @param latitude - The latitude in radians.
  12940. * @returns The terrain height at the specified position. The position is clamped to
  12941. the rectangle, so expect incorrect results for positions far outside the rectangle.
  12942. */
  12943. interpolateHeight(rectangle: Rectangle, longitude: number, latitude: number): number;
  12944. /**
  12945. * Determines if a given child tile is available, based on the
  12946. {@link HeightmapTerrainData.childTileMask}. The given child tile coordinates are assumed
  12947. to be one of the four children of this tile. If non-child tile coordinates are
  12948. given, the availability of the southeast child tile is returned.
  12949. * @param thisX - The tile X coordinate of this (the parent) tile.
  12950. * @param thisY - The tile Y coordinate of this (the parent) tile.
  12951. * @param childX - The tile X coordinate of the child tile to check for availability.
  12952. * @param childY - The tile Y coordinate of the child tile to check for availability.
  12953. * @returns True if the child tile is available; otherwise, false.
  12954. */
  12955. isChildAvailable(thisX: number, thisY: number, childX: number, childY: number): boolean;
  12956. /**
  12957. * Gets a value indicating whether or not this terrain data was created by upsampling lower resolution
  12958. terrain data. If this value is false, the data was obtained from some other source, such
  12959. as by downloading it from a remote server. This method should return true for instances
  12960. returned from a call to {@link HeightmapTerrainData#upsample}.
  12961. * @returns True if this instance was created by upsampling; otherwise, false.
  12962. */
  12963. wasCreatedByUpsampling(): boolean;
  12964. }
  12965. /**
  12966. * Defines functions for 4th order polynomial functions of one variable with only real coefficients.
  12967. */
  12968. export namespace QuarticRealPolynomial {
  12969. /**
  12970. * Provides the discriminant of the quartic equation from the supplied coefficients.
  12971. * @param a - The coefficient of the 4th order monomial.
  12972. * @param b - The coefficient of the 3rd order monomial.
  12973. * @param c - The coefficient of the 2nd order monomial.
  12974. * @param d - The coefficient of the 1st order monomial.
  12975. * @param e - The coefficient of the 0th order monomial.
  12976. * @returns The value of the discriminant.
  12977. */
  12978. function computeDiscriminant(a: number, b: number, c: number, d: number, e: number): number;
  12979. /**
  12980. * Provides the real valued roots of the quartic polynomial with the provided coefficients.
  12981. * @param a - The coefficient of the 4th order monomial.
  12982. * @param b - The coefficient of the 3rd order monomial.
  12983. * @param c - The coefficient of the 2nd order monomial.
  12984. * @param d - The coefficient of the 1st order monomial.
  12985. * @param e - The coefficient of the 0th order monomial.
  12986. * @returns The real valued roots.
  12987. */
  12988. function computeRealRoots(a: number, b: number, c: number, d: number, e: number): number[];
  12989. }
  12990. /**
  12991. * A set of 4-dimensional coordinates used to represent rotation in 3-dimensional space.
  12992. * @param [x = 0.0] - The X component.
  12993. * @param [y = 0.0] - The Y component.
  12994. * @param [z = 0.0] - The Z component.
  12995. * @param [w = 0.0] - The W component.
  12996. */
  12997. export class Quaternion {
  12998. constructor(x?: number, y?: number, z?: number, w?: number);
  12999. /**
  13000. * The X component.
  13001. */
  13002. x: number;
  13003. /**
  13004. * The Y component.
  13005. */
  13006. y: number;
  13007. /**
  13008. * The Z component.
  13009. */
  13010. z: number;
  13011. /**
  13012. * The W component.
  13013. */
  13014. w: number;
  13015. /**
  13016. * Computes a quaternion representing a rotation around an axis.
  13017. * @param axis - The axis of rotation.
  13018. * @param angle - The angle in radians to rotate around the axis.
  13019. * @param [result] - The object onto which to store the result.
  13020. * @returns The modified result parameter or a new Quaternion instance if one was not provided.
  13021. */
  13022. static fromAxisAngle(axis: Cartesian3, angle: number, result?: Quaternion): Quaternion;
  13023. /**
  13024. * Computes a Quaternion from the provided Matrix3 instance.
  13025. * @param matrix - The rotation matrix.
  13026. * @param [result] - The object onto which to store the result.
  13027. * @returns The modified result parameter or a new Quaternion instance if one was not provided.
  13028. */
  13029. static fromRotationMatrix(matrix: Matrix3, result?: Quaternion): Quaternion;
  13030. /**
  13031. * Computes a rotation from the given heading, pitch and roll angles. Heading is the rotation about the
  13032. negative z axis. Pitch is the rotation about the negative y axis. Roll is the rotation about
  13033. the positive x axis.
  13034. * @param headingPitchRoll - The rotation expressed as a heading, pitch and roll.
  13035. * @param [result] - The object onto which to store the result.
  13036. * @returns The modified result parameter or a new Quaternion instance if none was provided.
  13037. */
  13038. static fromHeadingPitchRoll(headingPitchRoll: HeadingPitchRoll, result?: Quaternion): Quaternion;
  13039. /**
  13040. * The number of elements used to pack the object into an array.
  13041. */
  13042. static packedLength: number;
  13043. /**
  13044. * Stores the provided instance into the provided array.
  13045. * @param value - The value to pack.
  13046. * @param array - The array to pack into.
  13047. * @param [startingIndex = 0] - The index into the array at which to start packing the elements.
  13048. * @returns The array that was packed into
  13049. */
  13050. static pack(value: Quaternion, array: number[], startingIndex?: number): number[];
  13051. /**
  13052. * Retrieves an instance from a packed array.
  13053. * @param array - The packed array.
  13054. * @param [startingIndex = 0] - The starting index of the element to be unpacked.
  13055. * @param [result] - The object into which to store the result.
  13056. * @returns The modified result parameter or a new Quaternion instance if one was not provided.
  13057. */
  13058. static unpack(array: number[], startingIndex?: number, result?: Quaternion): Quaternion;
  13059. /**
  13060. * The number of elements used to store the object into an array in its interpolatable form.
  13061. */
  13062. static packedInterpolationLength: number;
  13063. /**
  13064. * Converts a packed array into a form suitable for interpolation.
  13065. * @param packedArray - The packed array.
  13066. * @param [startingIndex = 0] - The index of the first element to be converted.
  13067. * @param [lastIndex = packedArray.length] - The index of the last element to be converted.
  13068. * @param [result] - The object into which to store the result.
  13069. */
  13070. static convertPackedArrayForInterpolation(packedArray: number[], startingIndex?: number, lastIndex?: number, result?: number[]): void;
  13071. /**
  13072. * Retrieves an instance from a packed array converted with {@link convertPackedArrayForInterpolation}.
  13073. * @param array - The array previously packed for interpolation.
  13074. * @param sourceArray - The original packed array.
  13075. * @param [firstIndex = 0] - The firstIndex used to convert the array.
  13076. * @param [lastIndex = packedArray.length] - The lastIndex used to convert the array.
  13077. * @param [result] - The object into which to store the result.
  13078. * @returns The modified result parameter or a new Quaternion instance if one was not provided.
  13079. */
  13080. static unpackInterpolationResult(array: number[], sourceArray: number[], firstIndex?: number, lastIndex?: number, result?: Quaternion): Quaternion;
  13081. /**
  13082. * Duplicates a Quaternion instance.
  13083. * @param quaternion - The quaternion to duplicate.
  13084. * @param [result] - The object onto which to store the result.
  13085. * @returns The modified result parameter or a new Quaternion instance if one was not provided. (Returns undefined if quaternion is undefined)
  13086. */
  13087. static clone(quaternion: Quaternion, result?: Quaternion): Quaternion;
  13088. /**
  13089. * Computes the conjugate of the provided quaternion.
  13090. * @param quaternion - The quaternion to conjugate.
  13091. * @param result - The object onto which to store the result.
  13092. * @returns The modified result parameter.
  13093. */
  13094. static conjugate(quaternion: Quaternion, result: Quaternion): Quaternion;
  13095. /**
  13096. * Computes magnitude squared for the provided quaternion.
  13097. * @param quaternion - The quaternion to conjugate.
  13098. * @returns The magnitude squared.
  13099. */
  13100. static magnitudeSquared(quaternion: Quaternion): number;
  13101. /**
  13102. * Computes magnitude for the provided quaternion.
  13103. * @param quaternion - The quaternion to conjugate.
  13104. * @returns The magnitude.
  13105. */
  13106. static magnitude(quaternion: Quaternion): number;
  13107. /**
  13108. * Computes the normalized form of the provided quaternion.
  13109. * @param quaternion - The quaternion to normalize.
  13110. * @param result - The object onto which to store the result.
  13111. * @returns The modified result parameter.
  13112. */
  13113. static normalize(quaternion: Quaternion, result: Quaternion): Quaternion;
  13114. /**
  13115. * Computes the inverse of the provided quaternion.
  13116. * @param quaternion - The quaternion to normalize.
  13117. * @param result - The object onto which to store the result.
  13118. * @returns The modified result parameter.
  13119. */
  13120. static inverse(quaternion: Quaternion, result: Quaternion): Quaternion;
  13121. /**
  13122. * Computes the componentwise sum of two quaternions.
  13123. * @param left - The first quaternion.
  13124. * @param right - The second quaternion.
  13125. * @param result - The object onto which to store the result.
  13126. * @returns The modified result parameter.
  13127. */
  13128. static add(left: Quaternion, right: Quaternion, result: Quaternion): Quaternion;
  13129. /**
  13130. * Computes the componentwise difference of two quaternions.
  13131. * @param left - The first quaternion.
  13132. * @param right - The second quaternion.
  13133. * @param result - The object onto which to store the result.
  13134. * @returns The modified result parameter.
  13135. */
  13136. static subtract(left: Quaternion, right: Quaternion, result: Quaternion): Quaternion;
  13137. /**
  13138. * Negates the provided quaternion.
  13139. * @param quaternion - The quaternion to be negated.
  13140. * @param result - The object onto which to store the result.
  13141. * @returns The modified result parameter.
  13142. */
  13143. static negate(quaternion: Quaternion, result: Quaternion): Quaternion;
  13144. /**
  13145. * Computes the dot (scalar) product of two quaternions.
  13146. * @param left - The first quaternion.
  13147. * @param right - The second quaternion.
  13148. * @returns The dot product.
  13149. */
  13150. static dot(left: Quaternion, right: Quaternion): number;
  13151. /**
  13152. * Computes the product of two quaternions.
  13153. * @param left - The first quaternion.
  13154. * @param right - The second quaternion.
  13155. * @param result - The object onto which to store the result.
  13156. * @returns The modified result parameter.
  13157. */
  13158. static multiply(left: Quaternion, right: Quaternion, result: Quaternion): Quaternion;
  13159. /**
  13160. * Multiplies the provided quaternion componentwise by the provided scalar.
  13161. * @param quaternion - The quaternion to be scaled.
  13162. * @param scalar - The scalar to multiply with.
  13163. * @param result - The object onto which to store the result.
  13164. * @returns The modified result parameter.
  13165. */
  13166. static multiplyByScalar(quaternion: Quaternion, scalar: number, result: Quaternion): Quaternion;
  13167. /**
  13168. * Divides the provided quaternion componentwise by the provided scalar.
  13169. * @param quaternion - The quaternion to be divided.
  13170. * @param scalar - The scalar to divide by.
  13171. * @param result - The object onto which to store the result.
  13172. * @returns The modified result parameter.
  13173. */
  13174. static divideByScalar(quaternion: Quaternion, scalar: number, result: Quaternion): Quaternion;
  13175. /**
  13176. * Computes the axis of rotation of the provided quaternion.
  13177. * @param quaternion - The quaternion to use.
  13178. * @param result - The object onto which to store the result.
  13179. * @returns The modified result parameter.
  13180. */
  13181. static computeAxis(quaternion: Quaternion, result: Cartesian3): Cartesian3;
  13182. /**
  13183. * Computes the angle of rotation of the provided quaternion.
  13184. * @param quaternion - The quaternion to use.
  13185. * @returns The angle of rotation.
  13186. */
  13187. static computeAngle(quaternion: Quaternion): number;
  13188. /**
  13189. * Computes the linear interpolation or extrapolation at t using the provided quaternions.
  13190. * @param start - The value corresponding to t at 0.0.
  13191. * @param end - The value corresponding to t at 1.0.
  13192. * @param t - The point along t at which to interpolate.
  13193. * @param result - The object onto which to store the result.
  13194. * @returns The modified result parameter.
  13195. */
  13196. static lerp(start: Quaternion, end: Quaternion, t: number, result: Quaternion): Quaternion;
  13197. /**
  13198. * Computes the spherical linear interpolation or extrapolation at t using the provided quaternions.
  13199. * @param start - The value corresponding to t at 0.0.
  13200. * @param end - The value corresponding to t at 1.0.
  13201. * @param t - The point along t at which to interpolate.
  13202. * @param result - The object onto which to store the result.
  13203. * @returns The modified result parameter.
  13204. */
  13205. static slerp(start: Quaternion, end: Quaternion, t: number, result: Quaternion): Quaternion;
  13206. /**
  13207. * The logarithmic quaternion function.
  13208. * @param quaternion - The unit quaternion.
  13209. * @param result - The object onto which to store the result.
  13210. * @returns The modified result parameter.
  13211. */
  13212. static log(quaternion: Quaternion, result: Cartesian3): Cartesian3;
  13213. /**
  13214. * The exponential quaternion function.
  13215. * @param cartesian - The cartesian.
  13216. * @param result - The object onto which to store the result.
  13217. * @returns The modified result parameter.
  13218. */
  13219. static exp(cartesian: Cartesian3, result: Quaternion): Quaternion;
  13220. /**
  13221. * Computes an inner quadrangle point.
  13222. <p>This will compute quaternions that ensure a squad curve is C<sup>1</sup>.</p>
  13223. * @param q0 - The first quaternion.
  13224. * @param q1 - The second quaternion.
  13225. * @param q2 - The third quaternion.
  13226. * @param result - The object onto which to store the result.
  13227. * @returns The modified result parameter.
  13228. */
  13229. static computeInnerQuadrangle(q0: Quaternion, q1: Quaternion, q2: Quaternion, result: Quaternion): Quaternion;
  13230. /**
  13231. * Computes the spherical quadrangle interpolation between quaternions.
  13232. * @example
  13233. * // 1. compute the squad interpolation between two quaternions on a curve
  13234. var s0 = Cesium.Quaternion.computeInnerQuadrangle(quaternions[i - 1], quaternions[i], quaternions[i + 1], new Cesium.Quaternion());
  13235. var s1 = Cesium.Quaternion.computeInnerQuadrangle(quaternions[i], quaternions[i + 1], quaternions[i + 2], new Cesium.Quaternion());
  13236. var q = Cesium.Quaternion.squad(quaternions[i], quaternions[i + 1], s0, s1, t, new Cesium.Quaternion());
  13237. // 2. compute the squad interpolation as above but where the first quaternion is a end point.
  13238. var s1 = Cesium.Quaternion.computeInnerQuadrangle(quaternions[0], quaternions[1], quaternions[2], new Cesium.Quaternion());
  13239. var q = Cesium.Quaternion.squad(quaternions[0], quaternions[1], quaternions[0], s1, t, new Cesium.Quaternion());
  13240. * @param q0 - The first quaternion.
  13241. * @param q1 - The second quaternion.
  13242. * @param s0 - The first inner quadrangle.
  13243. * @param s1 - The second inner quadrangle.
  13244. * @param t - The time in [0,1] used to interpolate.
  13245. * @param result - The object onto which to store the result.
  13246. * @returns The modified result parameter.
  13247. */
  13248. static squad(q0: Quaternion, q1: Quaternion, s0: Quaternion, s1: Quaternion, t: number, result: Quaternion): Quaternion;
  13249. /**
  13250. * Computes the spherical linear interpolation or extrapolation at t using the provided quaternions.
  13251. This implementation is faster than {@link Quaternion#slerp}, but is only accurate up to 10<sup>-6</sup>.
  13252. * @param start - The value corresponding to t at 0.0.
  13253. * @param end - The value corresponding to t at 1.0.
  13254. * @param t - The point along t at which to interpolate.
  13255. * @param result - The object onto which to store the result.
  13256. * @returns The modified result parameter.
  13257. */
  13258. static fastSlerp(start: Quaternion, end: Quaternion, t: number, result: Quaternion): Quaternion;
  13259. /**
  13260. * Computes the spherical quadrangle interpolation between quaternions.
  13261. An implementation that is faster than {@link Quaternion#squad}, but less accurate.
  13262. * @param q0 - The first quaternion.
  13263. * @param q1 - The second quaternion.
  13264. * @param s0 - The first inner quadrangle.
  13265. * @param s1 - The second inner quadrangle.
  13266. * @param t - The time in [0,1] used to interpolate.
  13267. * @param result - The object onto which to store the result.
  13268. * @returns The modified result parameter or a new instance if none was provided.
  13269. */
  13270. static fastSquad(q0: Quaternion, q1: Quaternion, s0: Quaternion, s1: Quaternion, t: number, result: Quaternion): Quaternion;
  13271. /**
  13272. * Compares the provided quaternions componentwise and returns
  13273. <code>true</code> if they are equal, <code>false</code> otherwise.
  13274. * @param [left] - The first quaternion.
  13275. * @param [right] - The second quaternion.
  13276. * @returns <code>true</code> if left and right are equal, <code>false</code> otherwise.
  13277. */
  13278. static equals(left?: Quaternion, right?: Quaternion): boolean;
  13279. /**
  13280. * Compares the provided quaternions componentwise and returns
  13281. <code>true</code> if they are within the provided epsilon,
  13282. <code>false</code> otherwise.
  13283. * @param [left] - The first quaternion.
  13284. * @param [right] - The second quaternion.
  13285. * @param [epsilon = 0] - The epsilon to use for equality testing.
  13286. * @returns <code>true</code> if left and right are within the provided epsilon, <code>false</code> otherwise.
  13287. */
  13288. static equalsEpsilon(left?: Quaternion, right?: Quaternion, epsilon?: number): boolean;
  13289. /**
  13290. * An immutable Quaternion instance initialized to (0.0, 0.0, 0.0, 0.0).
  13291. */
  13292. static readonly ZERO: Quaternion;
  13293. /**
  13294. * An immutable Quaternion instance initialized to (0.0, 0.0, 0.0, 1.0).
  13295. */
  13296. static readonly IDENTITY: Quaternion;
  13297. /**
  13298. * Duplicates this Quaternion instance.
  13299. * @param [result] - The object onto which to store the result.
  13300. * @returns The modified result parameter or a new Quaternion instance if one was not provided.
  13301. */
  13302. clone(result?: Quaternion): Quaternion;
  13303. /**
  13304. * Compares this and the provided quaternion componentwise and returns
  13305. <code>true</code> if they are equal, <code>false</code> otherwise.
  13306. * @param [right] - The right hand side quaternion.
  13307. * @returns <code>true</code> if left and right are equal, <code>false</code> otherwise.
  13308. */
  13309. equals(right?: Quaternion): boolean;
  13310. /**
  13311. * Compares this and the provided quaternion componentwise and returns
  13312. <code>true</code> if they are within the provided epsilon,
  13313. <code>false</code> otherwise.
  13314. * @param [right] - The right hand side quaternion.
  13315. * @param [epsilon = 0] - The epsilon to use for equality testing.
  13316. * @returns <code>true</code> if left and right are within the provided epsilon, <code>false</code> otherwise.
  13317. */
  13318. equalsEpsilon(right?: Quaternion, epsilon?: number): boolean;
  13319. /**
  13320. * Returns a string representing this quaternion in the format (x, y, z, w).
  13321. * @returns A string representing this Quaternion.
  13322. */
  13323. toString(): string;
  13324. }
  13325. /**
  13326. * A spline that uses spherical linear (slerp) interpolation to create a quaternion curve.
  13327. The generated curve is in the class C<sup>1</sup>.
  13328. * @param options - Object with the following properties:
  13329. * @param options.times - An array of strictly increasing, unit-less, floating-point times at each point.
  13330. The values are in no way connected to the clock time. They are the parameterization for the curve.
  13331. * @param options.points - The array of {@link Quaternion} control points.
  13332. */
  13333. export class QuaternionSpline {
  13334. constructor(options: {
  13335. times: number[];
  13336. points: Quaternion[];
  13337. });
  13338. /**
  13339. * An array of times for the control points.
  13340. */
  13341. readonly times: number[];
  13342. /**
  13343. * An array of {@link Quaternion} control points.
  13344. */
  13345. readonly points: Quaternion[];
  13346. /**
  13347. * Finds an index <code>i</code> in <code>times</code> such that the parameter
  13348. <code>time</code> is in the interval <code>[times[i], times[i + 1]]</code>.
  13349. * @param time - The time.
  13350. * @returns The index for the element at the start of the interval.
  13351. */
  13352. findTimeInterval(time: number): number;
  13353. /**
  13354. * Wraps the given time to the period covered by the spline.
  13355. * @param time - The time.
  13356. * @returns The time, wrapped around to the updated animation.
  13357. */
  13358. wrapTime(time: number): number;
  13359. /**
  13360. * Clamps the given time to the period covered by the spline.
  13361. * @param time - The time.
  13362. * @returns The time, clamped to the animation period.
  13363. */
  13364. clampTime(time: number): number;
  13365. /**
  13366. * Evaluates the curve at a given time.
  13367. * @param time - The time at which to evaluate the curve.
  13368. * @param [result] - The object onto which to store the result.
  13369. * @returns The modified result parameter or a new instance of the point on the curve at the given time.
  13370. */
  13371. evaluate(time: number, result?: Quaternion): Quaternion;
  13372. }
  13373. /**
  13374. * Parses a query string into an object, where the keys and values of the object are the
  13375. name/value pairs from the query string, decoded. If a name appears multiple times,
  13376. the value in the object will be an array of values.
  13377. * @example
  13378. * var obj = Cesium.queryToObject('key1=some%20value&key2=a%2Fb&key3=x&key3=y');
  13379. // obj will be:
  13380. // {
  13381. // key1 : 'some value',
  13382. // key2 : 'a/b',
  13383. // key3 : ['x', 'y']
  13384. // }
  13385. * @param queryString - The query string.
  13386. * @returns An object containing the parameters parsed from the query string.
  13387. */
  13388. export function queryToObject(queryString: string): any;
  13389. /**
  13390. * A queue that can enqueue items at the end, and dequeue items from the front.
  13391. */
  13392. export class Queue {
  13393. constructor();
  13394. /**
  13395. * The length of the queue.
  13396. */
  13397. readonly length: number;
  13398. /**
  13399. * Enqueues the specified item.
  13400. * @param item - The item to enqueue.
  13401. */
  13402. enqueue(item: any): void;
  13403. /**
  13404. * Dequeues an item. Returns undefined if the queue is empty.
  13405. * @returns The the dequeued item.
  13406. */
  13407. dequeue(): any;
  13408. /**
  13409. * Returns the item at the front of the queue. Returns undefined if the queue is empty.
  13410. * @returns The item at the front of the queue.
  13411. */
  13412. peek(): any;
  13413. /**
  13414. * Check whether this queue contains the specified item.
  13415. * @param item - The item to search for.
  13416. */
  13417. contains(item: any): void;
  13418. /**
  13419. * Remove all items from the queue.
  13420. */
  13421. clear(): void;
  13422. /**
  13423. * Sort the items in the queue in-place.
  13424. * @param compareFunction - A function that defines the sort order.
  13425. */
  13426. sort(compareFunction: Queue.Comparator): void;
  13427. }
  13428. export namespace Queue {
  13429. /**
  13430. * A function used to compare two items while sorting a queue.
  13431. * @example
  13432. * function compareNumbers(a, b) {
  13433. return a - b;
  13434. }
  13435. * @param a - An item in the array.
  13436. * @param b - An item in the array.
  13437. */
  13438. type Comparator = (a: any, b: any) => number;
  13439. }
  13440. /**
  13441. * Represents a ray that extends infinitely from the provided origin in the provided direction.
  13442. * @param [origin = Cartesian3.ZERO] - The origin of the ray.
  13443. * @param [direction = Cartesian3.ZERO] - The direction of the ray.
  13444. */
  13445. export class Ray {
  13446. constructor(origin?: Cartesian3, direction?: Cartesian3);
  13447. /**
  13448. * The origin of the ray.
  13449. */
  13450. origin: Cartesian3;
  13451. /**
  13452. * The direction of the ray.
  13453. */
  13454. direction: Cartesian3;
  13455. /**
  13456. * Duplicates a Ray instance.
  13457. * @param ray - The ray to duplicate.
  13458. * @param [result] - The object onto which to store the result.
  13459. * @returns The modified result parameter or a new Ray instance if one was not provided. (Returns undefined if ray is undefined)
  13460. */
  13461. static clone(ray: Ray, result?: Ray): Ray;
  13462. /**
  13463. * Computes the point along the ray given by r(t) = o + t*d,
  13464. where o is the origin of the ray and d is the direction.
  13465. * @example
  13466. * //Get the first intersection point of a ray and an ellipsoid.
  13467. var intersection = Cesium.IntersectionTests.rayEllipsoid(ray, ellipsoid);
  13468. var point = Cesium.Ray.getPoint(ray, intersection.start);
  13469. * @param ray - The ray.
  13470. * @param t - A scalar value.
  13471. * @param [result] - The object in which the result will be stored.
  13472. * @returns The modified result parameter, or a new instance if none was provided.
  13473. */
  13474. static getPoint(ray: Ray, t: number, result?: Cartesian3): Cartesian3;
  13475. }
  13476. /**
  13477. * A two dimensional region specified as longitude and latitude coordinates.
  13478. * @param [west = 0.0] - The westernmost longitude, in radians, in the range [-Pi, Pi].
  13479. * @param [south = 0.0] - The southernmost latitude, in radians, in the range [-Pi/2, Pi/2].
  13480. * @param [east = 0.0] - The easternmost longitude, in radians, in the range [-Pi, Pi].
  13481. * @param [north = 0.0] - The northernmost latitude, in radians, in the range [-Pi/2, Pi/2].
  13482. */
  13483. export class Rectangle {
  13484. constructor(west?: number, south?: number, east?: number, north?: number);
  13485. /**
  13486. * The westernmost longitude in radians in the range [-Pi, Pi].
  13487. */
  13488. west: number;
  13489. /**
  13490. * The southernmost latitude in radians in the range [-Pi/2, Pi/2].
  13491. */
  13492. south: number;
  13493. /**
  13494. * The easternmost longitude in radians in the range [-Pi, Pi].
  13495. */
  13496. east: number;
  13497. /**
  13498. * The northernmost latitude in radians in the range [-Pi/2, Pi/2].
  13499. */
  13500. north: number;
  13501. /**
  13502. * Gets the width of the rectangle in radians.
  13503. */
  13504. readonly width: number;
  13505. /**
  13506. * Gets the height of the rectangle in radians.
  13507. */
  13508. readonly height: number;
  13509. /**
  13510. * The number of elements used to pack the object into an array.
  13511. */
  13512. static packedLength: number;
  13513. /**
  13514. * Stores the provided instance into the provided array.
  13515. * @param value - The value to pack.
  13516. * @param array - The array to pack into.
  13517. * @param [startingIndex = 0] - The index into the array at which to start packing the elements.
  13518. * @returns The array that was packed into
  13519. */
  13520. static pack(value: Rectangle, array: number[], startingIndex?: number): number[];
  13521. /**
  13522. * Retrieves an instance from a packed array.
  13523. * @param array - The packed array.
  13524. * @param [startingIndex = 0] - The starting index of the element to be unpacked.
  13525. * @param [result] - The object into which to store the result.
  13526. * @returns The modified result parameter or a new Rectangle instance if one was not provided.
  13527. */
  13528. static unpack(array: number[], startingIndex?: number, result?: Rectangle): Rectangle;
  13529. /**
  13530. * Computes the width of a rectangle in radians.
  13531. * @param rectangle - The rectangle to compute the width of.
  13532. * @returns The width.
  13533. */
  13534. static computeWidth(rectangle: Rectangle): number;
  13535. /**
  13536. * Computes the height of a rectangle in radians.
  13537. * @param rectangle - The rectangle to compute the height of.
  13538. * @returns The height.
  13539. */
  13540. static computeHeight(rectangle: Rectangle): number;
  13541. /**
  13542. * Creates a rectangle given the boundary longitude and latitude in degrees.
  13543. * @example
  13544. * var rectangle = Cesium.Rectangle.fromDegrees(0.0, 20.0, 10.0, 30.0);
  13545. * @param [west = 0.0] - The westernmost longitude in degrees in the range [-180.0, 180.0].
  13546. * @param [south = 0.0] - The southernmost latitude in degrees in the range [-90.0, 90.0].
  13547. * @param [east = 0.0] - The easternmost longitude in degrees in the range [-180.0, 180.0].
  13548. * @param [north = 0.0] - The northernmost latitude in degrees in the range [-90.0, 90.0].
  13549. * @param [result] - The object onto which to store the result, or undefined if a new instance should be created.
  13550. * @returns The modified result parameter or a new Rectangle instance if none was provided.
  13551. */
  13552. static fromDegrees(west?: number, south?: number, east?: number, north?: number, result?: Rectangle): Rectangle;
  13553. /**
  13554. * Creates a rectangle given the boundary longitude and latitude in radians.
  13555. * @example
  13556. * var rectangle = Cesium.Rectangle.fromRadians(0.0, Math.PI/4, Math.PI/8, 3*Math.PI/4);
  13557. * @param [west = 0.0] - The westernmost longitude in radians in the range [-Math.PI, Math.PI].
  13558. * @param [south = 0.0] - The southernmost latitude in radians in the range [-Math.PI/2, Math.PI/2].
  13559. * @param [east = 0.0] - The easternmost longitude in radians in the range [-Math.PI, Math.PI].
  13560. * @param [north = 0.0] - The northernmost latitude in radians in the range [-Math.PI/2, Math.PI/2].
  13561. * @param [result] - The object onto which to store the result, or undefined if a new instance should be created.
  13562. * @returns The modified result parameter or a new Rectangle instance if none was provided.
  13563. */
  13564. static fromRadians(west?: number, south?: number, east?: number, north?: number, result?: Rectangle): Rectangle;
  13565. /**
  13566. * Creates the smallest possible Rectangle that encloses all positions in the provided array.
  13567. * @param cartographics - The list of Cartographic instances.
  13568. * @param [result] - The object onto which to store the result, or undefined if a new instance should be created.
  13569. * @returns The modified result parameter or a new Rectangle instance if none was provided.
  13570. */
  13571. static fromCartographicArray(cartographics: Cartographic[], result?: Rectangle): Rectangle;
  13572. /**
  13573. * Creates the smallest possible Rectangle that encloses all positions in the provided array.
  13574. * @param cartesians - The list of Cartesian instances.
  13575. * @param [ellipsoid = Ellipsoid.WGS84] - The ellipsoid the cartesians are on.
  13576. * @param [result] - The object onto which to store the result, or undefined if a new instance should be created.
  13577. * @returns The modified result parameter or a new Rectangle instance if none was provided.
  13578. */
  13579. static fromCartesianArray(cartesians: Cartesian3[], ellipsoid?: Ellipsoid, result?: Rectangle): Rectangle;
  13580. /**
  13581. * Duplicates a Rectangle.
  13582. * @param rectangle - The rectangle to clone.
  13583. * @param [result] - The object onto which to store the result, or undefined if a new instance should be created.
  13584. * @returns The modified result parameter or a new Rectangle instance if none was provided. (Returns undefined if rectangle is undefined)
  13585. */
  13586. static clone(rectangle: Rectangle, result?: Rectangle): Rectangle;
  13587. /**
  13588. * Compares the provided Rectangles componentwise and returns
  13589. <code>true</code> if they pass an absolute or relative tolerance test,
  13590. <code>false</code> otherwise.
  13591. * @param [left] - The first Rectangle.
  13592. * @param [right] - The second Rectangle.
  13593. * @param [absoluteEpsilon = 0] - The absolute epsilon tolerance to use for equality testing.
  13594. * @returns <code>true</code> if left and right are within the provided epsilon, <code>false</code> otherwise.
  13595. */
  13596. static equalsEpsilon(left?: Rectangle, right?: Rectangle, absoluteEpsilon?: number): boolean;
  13597. /**
  13598. * Duplicates this Rectangle.
  13599. * @param [result] - The object onto which to store the result.
  13600. * @returns The modified result parameter or a new Rectangle instance if none was provided.
  13601. */
  13602. clone(result?: Rectangle): Rectangle;
  13603. /**
  13604. * Compares the provided Rectangle with this Rectangle componentwise and returns
  13605. <code>true</code> if they are equal, <code>false</code> otherwise.
  13606. * @param [other] - The Rectangle to compare.
  13607. * @returns <code>true</code> if the Rectangles are equal, <code>false</code> otherwise.
  13608. */
  13609. equals(other?: Rectangle): boolean;
  13610. /**
  13611. * Compares the provided rectangles and returns <code>true</code> if they are equal,
  13612. <code>false</code> otherwise.
  13613. * @param [left] - The first Rectangle.
  13614. * @param [right] - The second Rectangle.
  13615. * @returns <code>true</code> if left and right are equal; otherwise <code>false</code>.
  13616. */
  13617. static equals(left?: Rectangle, right?: Rectangle): boolean;
  13618. /**
  13619. * Compares the provided Rectangle with this Rectangle componentwise and returns
  13620. <code>true</code> if they are within the provided epsilon,
  13621. <code>false</code> otherwise.
  13622. * @param [other] - The Rectangle to compare.
  13623. * @param [epsilon = 0] - The epsilon to use for equality testing.
  13624. * @returns <code>true</code> if the Rectangles are within the provided epsilon, <code>false</code> otherwise.
  13625. */
  13626. equalsEpsilon(other?: Rectangle, epsilon?: number): boolean;
  13627. /**
  13628. * Checks a Rectangle's properties and throws if they are not in valid ranges.
  13629. * @param rectangle - The rectangle to validate
  13630. */
  13631. static validate(rectangle: Rectangle): void;
  13632. /**
  13633. * Computes the southwest corner of a rectangle.
  13634. * @param rectangle - The rectangle for which to find the corner
  13635. * @param [result] - The object onto which to store the result.
  13636. * @returns The modified result parameter or a new Cartographic instance if none was provided.
  13637. */
  13638. static southwest(rectangle: Rectangle, result?: Cartographic): Cartographic;
  13639. /**
  13640. * Computes the northwest corner of a rectangle.
  13641. * @param rectangle - The rectangle for which to find the corner
  13642. * @param [result] - The object onto which to store the result.
  13643. * @returns The modified result parameter or a new Cartographic instance if none was provided.
  13644. */
  13645. static northwest(rectangle: Rectangle, result?: Cartographic): Cartographic;
  13646. /**
  13647. * Computes the northeast corner of a rectangle.
  13648. * @param rectangle - The rectangle for which to find the corner
  13649. * @param [result] - The object onto which to store the result.
  13650. * @returns The modified result parameter or a new Cartographic instance if none was provided.
  13651. */
  13652. static northeast(rectangle: Rectangle, result?: Cartographic): Cartographic;
  13653. /**
  13654. * Computes the southeast corner of a rectangle.
  13655. * @param rectangle - The rectangle for which to find the corner
  13656. * @param [result] - The object onto which to store the result.
  13657. * @returns The modified result parameter or a new Cartographic instance if none was provided.
  13658. */
  13659. static southeast(rectangle: Rectangle, result?: Cartographic): Cartographic;
  13660. /**
  13661. * Computes the center of a rectangle.
  13662. * @param rectangle - The rectangle for which to find the center
  13663. * @param [result] - The object onto which to store the result.
  13664. * @returns The modified result parameter or a new Cartographic instance if none was provided.
  13665. */
  13666. static center(rectangle: Rectangle, result?: Cartographic): Cartographic;
  13667. /**
  13668. * Computes the intersection of two rectangles. This function assumes that the rectangle's coordinates are
  13669. latitude and longitude in radians and produces a correct intersection, taking into account the fact that
  13670. the same angle can be represented with multiple values as well as the wrapping of longitude at the
  13671. anti-meridian. For a simple intersection that ignores these factors and can be used with projected
  13672. coordinates, see {@link Rectangle.simpleIntersection}.
  13673. * @param rectangle - On rectangle to find an intersection
  13674. * @param otherRectangle - Another rectangle to find an intersection
  13675. * @param [result] - The object onto which to store the result.
  13676. * @returns The modified result parameter, a new Rectangle instance if none was provided or undefined if there is no intersection.
  13677. */
  13678. static intersection(rectangle: Rectangle, otherRectangle: Rectangle, result?: Rectangle): Rectangle | undefined;
  13679. /**
  13680. * Computes a simple intersection of two rectangles. Unlike {@link Rectangle.intersection}, this function
  13681. does not attempt to put the angular coordinates into a consistent range or to account for crossing the
  13682. anti-meridian. As such, it can be used for rectangles where the coordinates are not simply latitude
  13683. and longitude (i.e. projected coordinates).
  13684. * @param rectangle - On rectangle to find an intersection
  13685. * @param otherRectangle - Another rectangle to find an intersection
  13686. * @param [result] - The object onto which to store the result.
  13687. * @returns The modified result parameter, a new Rectangle instance if none was provided or undefined if there is no intersection.
  13688. */
  13689. static simpleIntersection(rectangle: Rectangle, otherRectangle: Rectangle, result?: Rectangle): Rectangle | undefined;
  13690. /**
  13691. * Computes a rectangle that is the union of two rectangles.
  13692. * @param rectangle - A rectangle to enclose in rectangle.
  13693. * @param otherRectangle - A rectangle to enclose in a rectangle.
  13694. * @param [result] - The object onto which to store the result.
  13695. * @returns The modified result parameter or a new Rectangle instance if none was provided.
  13696. */
  13697. static union(rectangle: Rectangle, otherRectangle: Rectangle, result?: Rectangle): Rectangle;
  13698. /**
  13699. * Computes a rectangle by enlarging the provided rectangle until it contains the provided cartographic.
  13700. * @param rectangle - A rectangle to expand.
  13701. * @param cartographic - A cartographic to enclose in a rectangle.
  13702. * @param [result] - The object onto which to store the result.
  13703. * @returns The modified result parameter or a new Rectangle instance if one was not provided.
  13704. */
  13705. static expand(rectangle: Rectangle, cartographic: Cartographic, result?: Rectangle): Rectangle;
  13706. /**
  13707. * Returns true if the cartographic is on or inside the rectangle, false otherwise.
  13708. * @param rectangle - The rectangle
  13709. * @param cartographic - The cartographic to test.
  13710. * @returns true if the provided cartographic is inside the rectangle, false otherwise.
  13711. */
  13712. static contains(rectangle: Rectangle, cartographic: Cartographic): boolean;
  13713. /**
  13714. * Samples a rectangle so that it includes a list of Cartesian points suitable for passing to
  13715. {@link BoundingSphere#fromPoints}. Sampling is necessary to account
  13716. for rectangles that cover the poles or cross the equator.
  13717. * @param rectangle - The rectangle to subsample.
  13718. * @param [ellipsoid = Ellipsoid.WGS84] - The ellipsoid to use.
  13719. * @param [surfaceHeight = 0.0] - The height of the rectangle above the ellipsoid.
  13720. * @param [result] - The array of Cartesians onto which to store the result.
  13721. * @returns The modified result parameter or a new Array of Cartesians instances if none was provided.
  13722. */
  13723. static subsample(rectangle: Rectangle, ellipsoid?: Ellipsoid, surfaceHeight?: number, result?: Cartesian3[]): Cartesian3[];
  13724. /**
  13725. * The largest possible rectangle.
  13726. */
  13727. static readonly MAX_VALUE: Rectangle;
  13728. }
  13729. /**
  13730. * 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}.
  13731. * @example
  13732. * // 1. create a rectangle
  13733. var rectangle = new Cesium.RectangleGeometry({
  13734. ellipsoid : Cesium.Ellipsoid.WGS84,
  13735. rectangle : Cesium.Rectangle.fromDegrees(-80.0, 39.0, -74.0, 42.0),
  13736. height : 10000.0
  13737. });
  13738. var geometry = Cesium.RectangleGeometry.createGeometry(rectangle);
  13739. // 2. create an extruded rectangle without a top
  13740. var rectangle = new Cesium.RectangleGeometry({
  13741. ellipsoid : Cesium.Ellipsoid.WGS84,
  13742. rectangle : Cesium.Rectangle.fromDegrees(-80.0, 39.0, -74.0, 42.0),
  13743. height : 10000.0,
  13744. extrudedHeight: 300000
  13745. });
  13746. var geometry = Cesium.RectangleGeometry.createGeometry(rectangle);
  13747. * @param options - Object with the following properties:
  13748. * @param options.rectangle - A cartographic rectangle with north, south, east and west properties in radians.
  13749. * @param [options.vertexFormat = VertexFormat.DEFAULT] - The vertex attributes to be computed.
  13750. * @param [options.ellipsoid = Ellipsoid.WGS84] - The ellipsoid on which the rectangle lies.
  13751. * @param [options.granularity = Math.RADIANS_PER_DEGREE] - The distance, in radians, between each latitude and longitude. Determines the number of positions in the buffer.
  13752. * @param [options.height = 0.0] - The distance in meters between the rectangle and the ellipsoid surface.
  13753. * @param [options.rotation = 0.0] - The rotation of the rectangle, in radians. A positive rotation is counter-clockwise.
  13754. * @param [options.stRotation = 0.0] - The rotation of the texture coordinates, in radians. A positive rotation is counter-clockwise.
  13755. * @param [options.extrudedHeight] - The distance in meters between the rectangle's extruded face and the ellipsoid surface.
  13756. */
  13757. export class RectangleGeometry {
  13758. constructor(options: {
  13759. rectangle: Rectangle;
  13760. vertexFormat?: VertexFormat;
  13761. ellipsoid?: Ellipsoid;
  13762. granularity?: number;
  13763. height?: number;
  13764. rotation?: number;
  13765. stRotation?: number;
  13766. extrudedHeight?: number;
  13767. });
  13768. /**
  13769. * The number of elements used to pack the object into an array.
  13770. */
  13771. static packedLength: number;
  13772. /**
  13773. * Stores the provided instance into the provided array.
  13774. * @param value - The value to pack.
  13775. * @param array - The array to pack into.
  13776. * @param [startingIndex = 0] - The index into the array at which to start packing the elements.
  13777. * @returns The array that was packed into
  13778. */
  13779. static pack(value: RectangleGeometry, array: number[], startingIndex?: number): number[];
  13780. /**
  13781. * Retrieves an instance from a packed array.
  13782. * @param array - The packed array.
  13783. * @param [startingIndex = 0] - The starting index of the element to be unpacked.
  13784. * @param [result] - The object into which to store the result.
  13785. * @returns The modified result parameter or a new RectangleGeometry instance if one was not provided.
  13786. */
  13787. static unpack(array: number[], startingIndex?: number, result?: RectangleGeometry): RectangleGeometry;
  13788. /**
  13789. * Computes the bounding rectangle based on the provided options
  13790. * @param options - Object with the following properties:
  13791. * @param options.rectangle - A cartographic rectangle with north, south, east and west properties in radians.
  13792. * @param [options.ellipsoid = Ellipsoid.WGS84] - The ellipsoid on which the rectangle lies.
  13793. * @param [options.granularity = Math.RADIANS_PER_DEGREE] - The distance, in radians, between each latitude and longitude. Determines the number of positions in the buffer.
  13794. * @param [options.rotation = 0.0] - The rotation of the rectangle, in radians. A positive rotation is counter-clockwise.
  13795. * @param [result] - An object in which to store the result.
  13796. * @returns The result rectangle
  13797. */
  13798. static computeRectangle(options: {
  13799. rectangle: Rectangle;
  13800. ellipsoid?: Ellipsoid;
  13801. granularity?: number;
  13802. rotation?: number;
  13803. }, result?: Rectangle): Rectangle;
  13804. /**
  13805. * Computes the geometric representation of a rectangle, including its vertices, indices, and a bounding sphere.
  13806. * @param rectangleGeometry - A description of the rectangle.
  13807. * @returns The computed vertices and indices.
  13808. */
  13809. static createGeometry(rectangleGeometry: RectangleGeometry): Geometry | undefined;
  13810. }
  13811. /**
  13812. * A description of the outline of a a cartographic rectangle on an ellipsoid centered at the origin.
  13813. * @example
  13814. * var rectangle = new Cesium.RectangleOutlineGeometry({
  13815. ellipsoid : Cesium.Ellipsoid.WGS84,
  13816. rectangle : Cesium.Rectangle.fromDegrees(-80.0, 39.0, -74.0, 42.0),
  13817. height : 10000.0
  13818. });
  13819. var geometry = Cesium.RectangleOutlineGeometry.createGeometry(rectangle);
  13820. * @param options - Object with the following properties:
  13821. * @param options.rectangle - A cartographic rectangle with north, south, east and west properties in radians.
  13822. * @param [options.ellipsoid = Ellipsoid.WGS84] - The ellipsoid on which the rectangle lies.
  13823. * @param [options.granularity = Math.RADIANS_PER_DEGREE] - The distance, in radians, between each latitude and longitude. Determines the number of positions in the buffer.
  13824. * @param [options.height = 0.0] - The distance in meters between the rectangle and the ellipsoid surface.
  13825. * @param [options.rotation = 0.0] - The rotation of the rectangle, in radians. A positive rotation is counter-clockwise.
  13826. * @param [options.extrudedHeight] - The distance in meters between the rectangle's extruded face and the ellipsoid surface.
  13827. */
  13828. export class RectangleOutlineGeometry {
  13829. constructor(options: {
  13830. rectangle: Rectangle;
  13831. ellipsoid?: Ellipsoid;
  13832. granularity?: number;
  13833. height?: number;
  13834. rotation?: number;
  13835. extrudedHeight?: number;
  13836. });
  13837. /**
  13838. * The number of elements used to pack the object into an array.
  13839. */
  13840. static packedLength: number;
  13841. /**
  13842. * Stores the provided instance into the provided array.
  13843. * @param value - The value to pack.
  13844. * @param array - The array to pack into.
  13845. * @param [startingIndex = 0] - The index into the array at which to start packing the elements.
  13846. * @returns The array that was packed into
  13847. */
  13848. static pack(value: RectangleOutlineGeometry, array: number[], startingIndex?: number): number[];
  13849. /**
  13850. * Retrieves an instance from a packed array.
  13851. * @param array - The packed array.
  13852. * @param [startingIndex = 0] - The starting index of the element to be unpacked.
  13853. * @param [result] - The object into which to store the result.
  13854. * @returns The modified result parameter or a new Quaternion instance if one was not provided.
  13855. */
  13856. static unpack(array: number[], startingIndex?: number, result?: RectangleOutlineGeometry): RectangleOutlineGeometry;
  13857. /**
  13858. * Computes the geometric representation of an outline of a rectangle, including its vertices, indices, and a bounding sphere.
  13859. * @param rectangleGeometry - A description of the rectangle outline.
  13860. * @returns The computed vertices and indices.
  13861. */
  13862. static createGeometry(rectangleGeometry: RectangleOutlineGeometry): Geometry | undefined;
  13863. }
  13864. /**
  13865. * Constants for identifying well-known reference frames.
  13866. */
  13867. export enum ReferenceFrame {
  13868. /**
  13869. * The fixed frame.
  13870. */
  13871. FIXED = 0,
  13872. /**
  13873. * The inertial frame.
  13874. */
  13875. INERTIAL = 1
  13876. }
  13877. /**
  13878. * Stores information for making a request. In general this does not need to be constructed directly.
  13879. * @param [options] - An object with the following properties:
  13880. * @param [options.url] - The url to request.
  13881. * @param [options.requestFunction] - The function that makes the actual data request.
  13882. * @param [options.cancelFunction] - The function that is called when the request is cancelled.
  13883. * @param [options.priorityFunction] - The function that is called to update the request's priority, which occurs once per frame.
  13884. * @param [options.priority = 0.0] - The initial priority of the request.
  13885. * @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.
  13886. * @param [options.throttleByServer = false] - Whether to throttle the request by server.
  13887. * @param [options.type = RequestType.OTHER] - The type of request.
  13888. */
  13889. export class Request {
  13890. constructor(options?: {
  13891. url?: string;
  13892. requestFunction?: Request.RequestCallback;
  13893. cancelFunction?: Request.CancelCallback;
  13894. priorityFunction?: Request.PriorityCallback;
  13895. priority?: number;
  13896. throttle?: boolean;
  13897. throttleByServer?: boolean;
  13898. type?: RequestType;
  13899. });
  13900. /**
  13901. * The URL to request.
  13902. */
  13903. url: string;
  13904. /**
  13905. * The function that makes the actual data request.
  13906. */
  13907. requestFunction: Request.RequestCallback;
  13908. /**
  13909. * The function that is called when the request is cancelled.
  13910. */
  13911. cancelFunction: Request.CancelCallback;
  13912. /**
  13913. * The function that is called to update the request's priority, which occurs once per frame.
  13914. */
  13915. priorityFunction: Request.PriorityCallback;
  13916. /**
  13917. * Priority is a unit-less value where lower values represent higher priority.
  13918. For world-based objects, this is usually the distance from the camera.
  13919. A request that does not have a priority function defaults to a priority of 0.
  13920. If priorityFunction is defined, this value is updated every frame with the result of that call.
  13921. */
  13922. priority: number;
  13923. /**
  13924. * Whether to throttle and prioritize the request. If false, the request will be sent immediately. If true, the
  13925. request will be throttled and sent based on priority.
  13926. */
  13927. readonly throttle: boolean;
  13928. /**
  13929. * Whether to throttle the request by server. Browsers typically support about 6-8 parallel connections
  13930. for HTTP/1 servers, and an unlimited amount of connections for HTTP/2 servers. Setting this value
  13931. to <code>true</code> is preferable for requests going through HTTP/1 servers.
  13932. */
  13933. readonly throttleByServer: boolean;
  13934. /**
  13935. * Type of request.
  13936. */
  13937. readonly type: RequestType;
  13938. /**
  13939. * The current state of the request.
  13940. */
  13941. readonly state: RequestState;
  13942. /**
  13943. * Duplicates a Request instance.
  13944. * @param [result] - The object onto which to store the result.
  13945. * @returns The modified result parameter or a new Resource instance if one was not provided.
  13946. */
  13947. clone(result?: Request): Request;
  13948. }
  13949. export namespace Request {
  13950. /**
  13951. * The function that makes the actual data request.
  13952. */
  13953. type RequestCallback = () => Promise<void>;
  13954. /**
  13955. * The function that is called when the request is cancelled.
  13956. */
  13957. type CancelCallback = () => void;
  13958. /**
  13959. * The function that is called to update the request's priority, which occurs once per frame.
  13960. */
  13961. type PriorityCallback = () => number;
  13962. }
  13963. /**
  13964. * A browser-independent function to request a new animation frame. This is used to create
  13965. an application's draw loop as shown in the example below.
  13966. * @example
  13967. * // Create a draw loop using requestAnimationFrame. The
  13968. // tick callback function is called for every animation frame.
  13969. function tick() {
  13970. scene.render();
  13971. Cesium.requestAnimationFrame(tick);
  13972. }
  13973. tick();
  13974. * @param callback - The function to call when the next frame should be drawn.
  13975. * @returns An ID that can be passed to {@link cancelAnimationFrame} to cancel the request.
  13976. */
  13977. export function requestAnimationFrame(callback: requestAnimationFrameCallback): number;
  13978. /**
  13979. * A function that will be called when the next frame should be drawn.
  13980. * @param timestamp - A timestamp for the frame, in milliseconds.
  13981. */
  13982. export type requestAnimationFrameCallback = (timestamp: number) => void;
  13983. /**
  13984. * An event that is raised when a request encounters an error.
  13985. * @param [statusCode] - The HTTP error status code, such as 404.
  13986. * @param [response] - The response included along with the error.
  13987. * @param [responseHeaders] - The response headers, represented either as an object literal or as a
  13988. string in the format returned by XMLHttpRequest's getAllResponseHeaders() function.
  13989. */
  13990. export class RequestErrorEvent {
  13991. constructor(statusCode?: number, response?: any, responseHeaders?: string | any);
  13992. /**
  13993. * The HTTP error status code, such as 404. If the error does not have a particular
  13994. HTTP code, this property will be undefined.
  13995. */
  13996. statusCode: number;
  13997. /**
  13998. * The response included along with the error. If the error does not include a response,
  13999. this property will be undefined.
  14000. */
  14001. response: any;
  14002. /**
  14003. * The headers included in the response, represented as an object literal of key/value pairs.
  14004. If the error does not include any headers, this property will be undefined.
  14005. */
  14006. responseHeaders: any;
  14007. /**
  14008. * Creates a string representing this RequestErrorEvent.
  14009. * @returns A string representing the provided RequestErrorEvent.
  14010. */
  14011. toString(): string;
  14012. }
  14013. /**
  14014. * The request scheduler is used to track and constrain the number of active requests in order to prioritize incoming requests. The ability
  14015. to retain control over the number of requests in CesiumJS is important because due to events such as changes in the camera position,
  14016. a lot of new requests may be generated and a lot of in-flight requests may become redundant. The request scheduler manually constrains the
  14017. 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.
  14018. */
  14019. export namespace RequestScheduler {
  14020. /**
  14021. * The maximum number of simultaneous active requests. Un-throttled requests do not observe this limit.
  14022. */
  14023. var maximumRequests: number;
  14024. /**
  14025. * The maximum number of simultaneous active requests per server. Un-throttled requests or servers specifically
  14026. listed in {@link requestsByServer} do not observe this limit.
  14027. */
  14028. var maximumRequestsPerServer: number;
  14029. /**
  14030. * A per server key list of overrides to use for throttling instead of <code>maximumRequestsPerServer</code>
  14031. * @example
  14032. * RequestScheduler.requestsByServer = {
  14033. 'api.cesium.com:443': 18,
  14034. 'assets.cesium.com:443': 18
  14035. };
  14036. */
  14037. var requestsByServer: any;
  14038. /**
  14039. * Specifies if the request scheduler should throttle incoming requests, or let the browser queue requests under its control.
  14040. */
  14041. var throttleRequests: boolean;
  14042. }
  14043. /**
  14044. * State of the request.
  14045. */
  14046. export enum RequestState {
  14047. /**
  14048. * Initial unissued state.
  14049. */
  14050. UNISSUED = 0,
  14051. /**
  14052. * Issued but not yet active. Will become active when open slots are available.
  14053. */
  14054. ISSUED = 1,
  14055. /**
  14056. * Actual http request has been sent.
  14057. */
  14058. ACTIVE = 2,
  14059. /**
  14060. * Request completed successfully.
  14061. */
  14062. RECEIVED = 3,
  14063. /**
  14064. * Request was cancelled, either explicitly or automatically because of low priority.
  14065. */
  14066. CANCELLED = 4,
  14067. /**
  14068. * Request failed.
  14069. */
  14070. FAILED = 5
  14071. }
  14072. /**
  14073. * An enum identifying the type of request. Used for finer grained logging and priority sorting.
  14074. */
  14075. export enum RequestType {
  14076. /**
  14077. * Terrain request.
  14078. */
  14079. TERRAIN = 0,
  14080. /**
  14081. * Imagery request.
  14082. */
  14083. IMAGERY = 1,
  14084. /**
  14085. * 3D Tiles request.
  14086. */
  14087. TILES3D = 2,
  14088. /**
  14089. * Other request.
  14090. */
  14091. OTHER = 3
  14092. }
  14093. /**
  14094. * 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.
  14095. * @example
  14096. * function refreshTokenRetryCallback(resource, error) {
  14097. if (error.statusCode === 403) {
  14098. // 403 status code means a new token should be generated
  14099. return getNewAccessToken()
  14100. .then(function(token) {
  14101. resource.queryParameters.access_token = token;
  14102. return true;
  14103. })
  14104. .otherwise(function() {
  14105. return false;
  14106. });
  14107. }
  14108. return false;
  14109. }
  14110. var resource = new Resource({
  14111. url: 'http://server.com/path/to/resource.json',
  14112. proxy: new DefaultProxy('/proxy/'),
  14113. headers: {
  14114. 'X-My-Header': 'valueOfHeader'
  14115. },
  14116. queryParameters: {
  14117. 'access_token': '123-435-456-000'
  14118. },
  14119. retryCallback: refreshTokenRetryCallback,
  14120. retryAttempts: 1
  14121. });
  14122. * @param options - A url or an object with the following properties
  14123. * @param options.url - The url of the resource.
  14124. * @param [options.queryParameters] - An object containing query parameters that will be sent when retrieving the resource.
  14125. * @param [options.templateValues] - Key/Value pairs that are used to replace template values (eg. {x}).
  14126. * @param [options.headers = {}] - Additional HTTP headers that will be sent.
  14127. * @param [options.proxy] - A proxy to be used when loading the resource.
  14128. * @param [options.retryCallback] - The Function to call when a request for this resource fails. If it returns true, the request will be retried.
  14129. * @param [options.retryAttempts = 0] - The number of times the retryCallback should be called before giving up.
  14130. * @param [options.request] - A Request object that will be used. Intended for internal use only.
  14131. */
  14132. export class Resource {
  14133. constructor(options: {
  14134. url: string;
  14135. queryParameters?: any;
  14136. templateValues?: any;
  14137. headers?: any;
  14138. proxy?: Proxy;
  14139. retryCallback?: Resource.RetryCallback;
  14140. retryAttempts?: number;
  14141. request?: Request;
  14142. });
  14143. /**
  14144. * Additional HTTP headers that will be sent with the request.
  14145. */
  14146. headers: any;
  14147. /**
  14148. * A Request object that will be used. Intended for internal use only.
  14149. */
  14150. request: Request;
  14151. /**
  14152. * A proxy to be used when loading the resource.
  14153. */
  14154. proxy: Proxy;
  14155. /**
  14156. * 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.
  14157. */
  14158. retryCallback: (...params: any[]) => any;
  14159. /**
  14160. * The number of times the retryCallback should be called before giving up.
  14161. */
  14162. retryAttempts: number;
  14163. /**
  14164. * Returns true if blobs are supported.
  14165. */
  14166. static readonly isBlobSupported: boolean;
  14167. /**
  14168. * Query parameters appended to the url.
  14169. */
  14170. readonly queryParameters: any;
  14171. /**
  14172. * The key/value pairs used to replace template parameters in the url.
  14173. */
  14174. readonly templateValues: any;
  14175. /**
  14176. * The url to the resource with template values replaced, query string appended and encoded by proxy if one was set.
  14177. */
  14178. url: string;
  14179. /**
  14180. * The file extension of the resource.
  14181. */
  14182. readonly extension: string;
  14183. /**
  14184. * True if the Resource refers to a data URI.
  14185. */
  14186. isDataUri: boolean;
  14187. /**
  14188. * True if the Resource refers to a blob URI.
  14189. */
  14190. isBlobUri: boolean;
  14191. /**
  14192. * True if the Resource refers to a cross origin URL.
  14193. */
  14194. isCrossOriginUrl: boolean;
  14195. /**
  14196. * True if the Resource has request headers. This is equivalent to checking if the headers property has any keys.
  14197. */
  14198. hasHeaders: boolean;
  14199. /**
  14200. * Override Object#toString so that implicit string conversion gives the
  14201. complete URL represented by this Resource.
  14202. * @returns The URL represented by this Resource
  14203. */
  14204. toString(): string;
  14205. /**
  14206. * Returns the url, optional with the query string and processed by a proxy.
  14207. * @param [query = false] - If true, the query string is included.
  14208. * @param [proxy = false] - If true, the url is processed by the proxy object, if defined.
  14209. * @returns The url with all the requested components.
  14210. */
  14211. getUrlComponent(query?: boolean, proxy?: boolean): string;
  14212. /**
  14213. * Combines the specified object and the existing query parameters. This allows you to add many parameters at once,
  14214. 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.
  14215. * @param params - The query parameters
  14216. * @param [useAsDefault = false] - If true the params will be used as the default values, so they will only be set if they are undefined.
  14217. */
  14218. setQueryParameters(params: any, useAsDefault?: boolean): void;
  14219. /**
  14220. * Combines the specified object and the existing query parameters. This allows you to add many parameters at once,
  14221. as opposed to adding them one at a time to the queryParameters property.
  14222. * @param params - The query parameters
  14223. */
  14224. appendQueryParameters(params: any): void;
  14225. /**
  14226. * Combines the specified object and the existing template values. This allows you to add many values at once,
  14227. 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.
  14228. * @param template - The template values
  14229. * @param [useAsDefault = false] - If true the values will be used as the default values, so they will only be set if they are undefined.
  14230. */
  14231. setTemplateValues(template: any, useAsDefault?: boolean): void;
  14232. /**
  14233. * Returns a resource relative to the current instance. All properties remain the same as the current instance unless overridden in options.
  14234. * @param options - An object with the following properties
  14235. * @param [options.url] - The url that will be resolved relative to the url of the current instance.
  14236. * @param [options.queryParameters] - An object containing query parameters that will be combined with those of the current instance.
  14237. * @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.
  14238. * @param [options.headers = {}] - Additional HTTP headers that will be sent.
  14239. * @param [options.proxy] - A proxy to be used when loading the resource.
  14240. * @param [options.retryCallback] - The function to call when loading the resource fails.
  14241. * @param [options.retryAttempts] - The number of times the retryCallback should be called before giving up.
  14242. * @param [options.request] - A Request object that will be used. Intended for internal use only.
  14243. * @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.
  14244. * @returns The resource derived from the current one.
  14245. */
  14246. getDerivedResource(options: {
  14247. url?: string;
  14248. queryParameters?: any;
  14249. templateValues?: any;
  14250. headers?: any;
  14251. proxy?: Proxy;
  14252. retryCallback?: Resource.RetryCallback;
  14253. retryAttempts?: number;
  14254. request?: Request;
  14255. preserveQueryParameters?: boolean;
  14256. }): Resource;
  14257. /**
  14258. * Duplicates a Resource instance.
  14259. * @param [result] - The object onto which to store the result.
  14260. * @returns The modified result parameter or a new Resource instance if one was not provided.
  14261. */
  14262. clone(result?: Resource): Resource;
  14263. /**
  14264. * Returns the base path of the Resource.
  14265. * @param [includeQuery = false] - Whether or not to include the query string and fragment form the uri
  14266. * @returns The base URI of the resource
  14267. */
  14268. getBaseUri(includeQuery?: boolean): string;
  14269. /**
  14270. * Appends a forward slash to the URL.
  14271. */
  14272. appendForwardSlash(): void;
  14273. /**
  14274. * Asynchronously loads the resource as raw binary data. Returns a promise that will resolve to
  14275. an ArrayBuffer once loaded, or reject if the resource failed to load. The data is loaded
  14276. using XMLHttpRequest, which means that in order to make requests to another origin,
  14277. the server must have Cross-Origin Resource Sharing (CORS) headers enabled.
  14278. * @example
  14279. * // load a single URL asynchronously
  14280. resource.fetchArrayBuffer().then(function(arrayBuffer) {
  14281. // use the data
  14282. }).otherwise(function(error) {
  14283. // an error occurred
  14284. });
  14285. * @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.
  14286. */
  14287. fetchArrayBuffer(): Promise<ArrayBuffer> | undefined;
  14288. /**
  14289. * Creates a Resource and calls fetchArrayBuffer() on it.
  14290. * @param options - A url or an object with the following properties
  14291. * @param options.url - The url of the resource.
  14292. * @param [options.queryParameters] - An object containing query parameters that will be sent when retrieving the resource.
  14293. * @param [options.templateValues] - Key/Value pairs that are used to replace template values (eg. {x}).
  14294. * @param [options.headers = {}] - Additional HTTP headers that will be sent.
  14295. * @param [options.proxy] - A proxy to be used when loading the resource.
  14296. * @param [options.retryCallback] - The Function to call when a request for this resource fails. If it returns true, the request will be retried.
  14297. * @param [options.retryAttempts = 0] - The number of times the retryCallback should be called before giving up.
  14298. * @param [options.request] - A Request object that will be used. Intended for internal use only.
  14299. * @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.
  14300. */
  14301. static fetchArrayBuffer(options: {
  14302. url: string;
  14303. queryParameters?: any;
  14304. templateValues?: any;
  14305. headers?: any;
  14306. proxy?: Proxy;
  14307. retryCallback?: Resource.RetryCallback;
  14308. retryAttempts?: number;
  14309. request?: Request;
  14310. }): Promise<ArrayBuffer> | undefined;
  14311. /**
  14312. * Asynchronously loads the given resource as a blob. Returns a promise that will resolve to
  14313. a Blob once loaded, or reject if the resource failed to load. The data is loaded
  14314. using XMLHttpRequest, which means that in order to make requests to another origin,
  14315. the server must have Cross-Origin Resource Sharing (CORS) headers enabled.
  14316. * @example
  14317. * // load a single URL asynchronously
  14318. resource.fetchBlob().then(function(blob) {
  14319. // use the data
  14320. }).otherwise(function(error) {
  14321. // an error occurred
  14322. });
  14323. * @returns a promise that will resolve to the requested data when loaded. Returns undefined if <code>request.throttle</code> is true and the request does not have high enough priority.
  14324. */
  14325. fetchBlob(): Promise<Blob> | undefined;
  14326. /**
  14327. * Creates a Resource and calls fetchBlob() on it.
  14328. * @param options - A url or an object with the following properties
  14329. * @param options.url - The url of the resource.
  14330. * @param [options.queryParameters] - An object containing query parameters that will be sent when retrieving the resource.
  14331. * @param [options.templateValues] - Key/Value pairs that are used to replace template values (eg. {x}).
  14332. * @param [options.headers = {}] - Additional HTTP headers that will be sent.
  14333. * @param [options.proxy] - A proxy to be used when loading the resource.
  14334. * @param [options.retryCallback] - The Function to call when a request for this resource fails. If it returns true, the request will be retried.
  14335. * @param [options.retryAttempts = 0] - The number of times the retryCallback should be called before giving up.
  14336. * @param [options.request] - A Request object that will be used. Intended for internal use only.
  14337. * @returns a promise that will resolve to the requested data when loaded. Returns undefined if <code>request.throttle</code> is true and the request does not have high enough priority.
  14338. */
  14339. static fetchBlob(options: {
  14340. url: string;
  14341. queryParameters?: any;
  14342. templateValues?: any;
  14343. headers?: any;
  14344. proxy?: Proxy;
  14345. retryCallback?: Resource.RetryCallback;
  14346. retryAttempts?: number;
  14347. request?: Request;
  14348. }): Promise<Blob> | undefined;
  14349. /**
  14350. * Asynchronously loads the given image resource. Returns a promise that will resolve to
  14351. 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
  14352. {@link https://developer.mozilla.org/en-US/docs/Web/API/HTMLImageElement|Image} once loaded, or reject if the image failed to load.
  14353. * @example
  14354. * // load a single image asynchronously
  14355. resource.fetchImage().then(function(image) {
  14356. // use the loaded image
  14357. }).otherwise(function(error) {
  14358. // an error occurred
  14359. });
  14360. // load several images in parallel
  14361. when.all([resource1.fetchImage(), resource2.fetchImage()]).then(function(images) {
  14362. // images is an array containing all the loaded images
  14363. });
  14364. * @param [options] - An object with the following properties.
  14365. * @param [options.preferBlob = false] - If true, we will load the image via a blob.
  14366. * @param [options.preferImageBitmap = false] - If true, image will be decoded during fetch and an <code>ImageBitmap</code> is returned.
  14367. * @param [options.flipY = false] - If true, image will be vertically flipped during decode. Only applies if the browser supports <code>createImageBitmap</code>.
  14368. * @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.
  14369. */
  14370. fetchImage(options?: {
  14371. preferBlob?: boolean;
  14372. preferImageBitmap?: boolean;
  14373. flipY?: boolean;
  14374. }): Promise<ImageBitmap> | Promise<HTMLImageElement> | undefined;
  14375. /**
  14376. * Creates a Resource and calls fetchImage() on it.
  14377. * @param options - A url or an object with the following properties
  14378. * @param options.url - The url of the resource.
  14379. * @param [options.queryParameters] - An object containing query parameters that will be sent when retrieving the resource.
  14380. * @param [options.templateValues] - Key/Value pairs that are used to replace template values (eg. {x}).
  14381. * @param [options.headers = {}] - Additional HTTP headers that will be sent.
  14382. * @param [options.proxy] - A proxy to be used when loading the resource.
  14383. * @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>.
  14384. * @param [options.retryCallback] - The Function to call when a request for this resource fails. If it returns true, the request will be retried.
  14385. * @param [options.retryAttempts = 0] - The number of times the retryCallback should be called before giving up.
  14386. * @param [options.request] - A Request object that will be used. Intended for internal use only.
  14387. * @param [options.preferBlob = false] - If true, we will load the image via a blob.
  14388. * @param [options.preferImageBitmap = false] - If true, image will be decoded during fetch and an <code>ImageBitmap</code> is returned.
  14389. * @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.
  14390. */
  14391. static fetchImage(options: {
  14392. url: string;
  14393. queryParameters?: any;
  14394. templateValues?: any;
  14395. headers?: any;
  14396. proxy?: Proxy;
  14397. flipY?: boolean;
  14398. retryCallback?: Resource.RetryCallback;
  14399. retryAttempts?: number;
  14400. request?: Request;
  14401. preferBlob?: boolean;
  14402. preferImageBitmap?: boolean;
  14403. }): Promise<ImageBitmap> | Promise<HTMLImageElement> | undefined;
  14404. /**
  14405. * Asynchronously loads the given resource as text. Returns a promise that will resolve to
  14406. a String once loaded, or reject if the resource failed to load. The data is loaded
  14407. using XMLHttpRequest, which means that in order to make requests to another origin,
  14408. the server must have Cross-Origin Resource Sharing (CORS) headers enabled.
  14409. * @example
  14410. * // load text from a URL, setting a custom header
  14411. var resource = new Resource({
  14412. url: 'http://someUrl.com/someJson.txt',
  14413. headers: {
  14414. 'X-Custom-Header' : 'some value'
  14415. }
  14416. });
  14417. resource.fetchText().then(function(text) {
  14418. // Do something with the text
  14419. }).otherwise(function(error) {
  14420. // an error occurred
  14421. });
  14422. * @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.
  14423. */
  14424. fetchText(): Promise<string> | undefined;
  14425. /**
  14426. * Creates a Resource and calls fetchText() on it.
  14427. * @param options - A url or an object with the following properties
  14428. * @param options.url - The url of the resource.
  14429. * @param [options.queryParameters] - An object containing query parameters that will be sent when retrieving the resource.
  14430. * @param [options.templateValues] - Key/Value pairs that are used to replace template values (eg. {x}).
  14431. * @param [options.headers = {}] - Additional HTTP headers that will be sent.
  14432. * @param [options.proxy] - A proxy to be used when loading the resource.
  14433. * @param [options.retryCallback] - The Function to call when a request for this resource fails. If it returns true, the request will be retried.
  14434. * @param [options.retryAttempts = 0] - The number of times the retryCallback should be called before giving up.
  14435. * @param [options.request] - A Request object that will be used. Intended for internal use only.
  14436. * @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.
  14437. */
  14438. static fetchText(options: {
  14439. url: string;
  14440. queryParameters?: any;
  14441. templateValues?: any;
  14442. headers?: any;
  14443. proxy?: Proxy;
  14444. retryCallback?: Resource.RetryCallback;
  14445. retryAttempts?: number;
  14446. request?: Request;
  14447. }): Promise<string> | undefined;
  14448. /**
  14449. * Asynchronously loads the given resource as JSON. Returns a promise that will resolve to
  14450. a JSON object once loaded, or reject if the resource failed to load. The data is loaded
  14451. using XMLHttpRequest, which means that in order to make requests to another origin,
  14452. the server must have Cross-Origin Resource Sharing (CORS) headers enabled. This function
  14453. adds 'Accept: application/json,&#42;&#47;&#42;;q=0.01' to the request headers, if not
  14454. already specified.
  14455. * @example
  14456. * resource.fetchJson().then(function(jsonData) {
  14457. // Do something with the JSON object
  14458. }).otherwise(function(error) {
  14459. // an error occurred
  14460. });
  14461. * @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.
  14462. */
  14463. fetchJson(): Promise<any> | undefined;
  14464. /**
  14465. * Creates a Resource and calls fetchJson() on it.
  14466. * @param options - A url or an object with the following properties
  14467. * @param options.url - The url of the resource.
  14468. * @param [options.queryParameters] - An object containing query parameters that will be sent when retrieving the resource.
  14469. * @param [options.templateValues] - Key/Value pairs that are used to replace template values (eg. {x}).
  14470. * @param [options.headers = {}] - Additional HTTP headers that will be sent.
  14471. * @param [options.proxy] - A proxy to be used when loading the resource.
  14472. * @param [options.retryCallback] - The Function to call when a request for this resource fails. If it returns true, the request will be retried.
  14473. * @param [options.retryAttempts = 0] - The number of times the retryCallback should be called before giving up.
  14474. * @param [options.request] - A Request object that will be used. Intended for internal use only.
  14475. * @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.
  14476. */
  14477. static fetchJson(options: {
  14478. url: string;
  14479. queryParameters?: any;
  14480. templateValues?: any;
  14481. headers?: any;
  14482. proxy?: Proxy;
  14483. retryCallback?: Resource.RetryCallback;
  14484. retryAttempts?: number;
  14485. request?: Request;
  14486. }): Promise<any> | undefined;
  14487. /**
  14488. * Asynchronously loads the given resource as XML. Returns a promise that will resolve to
  14489. an XML Document once loaded, or reject if the resource failed to load. The data is loaded
  14490. using XMLHttpRequest, which means that in order to make requests to another origin,
  14491. the server must have Cross-Origin Resource Sharing (CORS) headers enabled.
  14492. * @example
  14493. * // load XML from a URL, setting a custom header
  14494. Cesium.loadXML('http://someUrl.com/someXML.xml', {
  14495. 'X-Custom-Header' : 'some value'
  14496. }).then(function(document) {
  14497. // Do something with the document
  14498. }).otherwise(function(error) {
  14499. // an error occurred
  14500. });
  14501. * @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.
  14502. */
  14503. fetchXML(): Promise<XMLDocument> | undefined;
  14504. /**
  14505. * Creates a Resource and calls fetchXML() on it.
  14506. * @param options - A url or an object with the following properties
  14507. * @param options.url - The url of the resource.
  14508. * @param [options.queryParameters] - An object containing query parameters that will be sent when retrieving the resource.
  14509. * @param [options.templateValues] - Key/Value pairs that are used to replace template values (eg. {x}).
  14510. * @param [options.headers = {}] - Additional HTTP headers that will be sent.
  14511. * @param [options.proxy] - A proxy to be used when loading the resource.
  14512. * @param [options.retryCallback] - The Function to call when a request for this resource fails. If it returns true, the request will be retried.
  14513. * @param [options.retryAttempts = 0] - The number of times the retryCallback should be called before giving up.
  14514. * @param [options.request] - A Request object that will be used. Intended for internal use only.
  14515. * @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.
  14516. */
  14517. static fetchXML(options: {
  14518. url: string;
  14519. queryParameters?: any;
  14520. templateValues?: any;
  14521. headers?: any;
  14522. proxy?: Proxy;
  14523. retryCallback?: Resource.RetryCallback;
  14524. retryAttempts?: number;
  14525. request?: Request;
  14526. }): Promise<XMLDocument> | undefined;
  14527. /**
  14528. * Requests a resource using JSONP.
  14529. * @example
  14530. * // load a data asynchronously
  14531. resource.fetchJsonp().then(function(data) {
  14532. // use the loaded data
  14533. }).otherwise(function(error) {
  14534. // an error occurred
  14535. });
  14536. * @param [callbackParameterName = 'callback'] - The callback parameter name that the server expects.
  14537. * @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.
  14538. */
  14539. fetchJsonp(callbackParameterName?: string): Promise<any> | undefined;
  14540. /**
  14541. * Creates a Resource from a URL and calls fetchJsonp() on it.
  14542. * @param options - A url or an object with the following properties
  14543. * @param options.url - The url of the resource.
  14544. * @param [options.queryParameters] - An object containing query parameters that will be sent when retrieving the resource.
  14545. * @param [options.templateValues] - Key/Value pairs that are used to replace template values (eg. {x}).
  14546. * @param [options.headers = {}] - Additional HTTP headers that will be sent.
  14547. * @param [options.proxy] - A proxy to be used when loading the resource.
  14548. * @param [options.retryCallback] - The Function to call when a request for this resource fails. If it returns true, the request will be retried.
  14549. * @param [options.retryAttempts = 0] - The number of times the retryCallback should be called before giving up.
  14550. * @param [options.request] - A Request object that will be used. Intended for internal use only.
  14551. * @param [options.callbackParameterName = 'callback'] - The callback parameter name that the server expects.
  14552. * @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.
  14553. */
  14554. static fetchJsonp(options: {
  14555. url: string;
  14556. queryParameters?: any;
  14557. templateValues?: any;
  14558. headers?: any;
  14559. proxy?: Proxy;
  14560. retryCallback?: Resource.RetryCallback;
  14561. retryAttempts?: number;
  14562. request?: Request;
  14563. callbackParameterName?: string;
  14564. }): Promise<any> | undefined;
  14565. /**
  14566. * Asynchronously loads the given resource. Returns a promise that will resolve to
  14567. the result once loaded, or reject if the resource failed to load. The data is loaded
  14568. using XMLHttpRequest, which means that in order to make requests to another origin,
  14569. the server must have Cross-Origin Resource Sharing (CORS) headers enabled. It's recommended that you use
  14570. the more specific functions eg. fetchJson, fetchBlob, etc.
  14571. * @example
  14572. * resource.fetch()
  14573. .then(function(body) {
  14574. // use the data
  14575. }).otherwise(function(error) {
  14576. // an error occurred
  14577. });
  14578. * @param [options] - Object with the following properties:
  14579. * @param [options.responseType] - The type of response. This controls the type of item returned.
  14580. * @param [options.headers] - Additional HTTP headers to send with the request, if any.
  14581. * @param [options.overrideMimeType] - Overrides the MIME type returned by the server.
  14582. * @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.
  14583. */
  14584. fetch(options?: {
  14585. responseType?: string;
  14586. headers?: any;
  14587. overrideMimeType?: string;
  14588. }): Promise<any> | undefined;
  14589. /**
  14590. * Creates a Resource from a URL and calls fetch() on it.
  14591. * @param options - A url or an object with the following properties
  14592. * @param options.url - The url of the resource.
  14593. * @param [options.queryParameters] - An object containing query parameters that will be sent when retrieving the resource.
  14594. * @param [options.templateValues] - Key/Value pairs that are used to replace template values (eg. {x}).
  14595. * @param [options.headers = {}] - Additional HTTP headers that will be sent.
  14596. * @param [options.proxy] - A proxy to be used when loading the resource.
  14597. * @param [options.retryCallback] - The Function to call when a request for this resource fails. If it returns true, the request will be retried.
  14598. * @param [options.retryAttempts = 0] - The number of times the retryCallback should be called before giving up.
  14599. * @param [options.request] - A Request object that will be used. Intended for internal use only.
  14600. * @param [options.responseType] - The type of response. This controls the type of item returned.
  14601. * @param [options.overrideMimeType] - Overrides the MIME type returned by the server.
  14602. * @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.
  14603. */
  14604. static fetch(options: {
  14605. url: string;
  14606. queryParameters?: any;
  14607. templateValues?: any;
  14608. headers?: any;
  14609. proxy?: Proxy;
  14610. retryCallback?: Resource.RetryCallback;
  14611. retryAttempts?: number;
  14612. request?: Request;
  14613. responseType?: string;
  14614. overrideMimeType?: string;
  14615. }): Promise<any> | undefined;
  14616. /**
  14617. * Asynchronously deletes the given resource. Returns a promise that will resolve to
  14618. the result once loaded, or reject if the resource failed to load. The data is loaded
  14619. using XMLHttpRequest, which means that in order to make requests to another origin,
  14620. the server must have Cross-Origin Resource Sharing (CORS) headers enabled.
  14621. * @example
  14622. * resource.delete()
  14623. .then(function(body) {
  14624. // use the data
  14625. }).otherwise(function(error) {
  14626. // an error occurred
  14627. });
  14628. * @param [options] - Object with the following properties:
  14629. * @param [options.responseType] - The type of response. This controls the type of item returned.
  14630. * @param [options.headers] - Additional HTTP headers to send with the request, if any.
  14631. * @param [options.overrideMimeType] - Overrides the MIME type returned by the server.
  14632. * @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.
  14633. */
  14634. delete(options?: {
  14635. responseType?: string;
  14636. headers?: any;
  14637. overrideMimeType?: string;
  14638. }): Promise<any> | undefined;
  14639. /**
  14640. * Creates a Resource from a URL and calls delete() on it.
  14641. * @param options - A url or an object with the following properties
  14642. * @param options.url - The url of the resource.
  14643. * @param [options.data] - Data that is posted with the resource.
  14644. * @param [options.queryParameters] - An object containing query parameters that will be sent when retrieving the resource.
  14645. * @param [options.templateValues] - Key/Value pairs that are used to replace template values (eg. {x}).
  14646. * @param [options.headers = {}] - Additional HTTP headers that will be sent.
  14647. * @param [options.proxy] - A proxy to be used when loading the resource.
  14648. * @param [options.retryCallback] - The Function to call when a request for this resource fails. If it returns true, the request will be retried.
  14649. * @param [options.retryAttempts = 0] - The number of times the retryCallback should be called before giving up.
  14650. * @param [options.request] - A Request object that will be used. Intended for internal use only.
  14651. * @param [options.responseType] - The type of response. This controls the type of item returned.
  14652. * @param [options.overrideMimeType] - Overrides the MIME type returned by the server.
  14653. * @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.
  14654. */
  14655. static delete(options: {
  14656. url: string;
  14657. data?: any;
  14658. queryParameters?: any;
  14659. templateValues?: any;
  14660. headers?: any;
  14661. proxy?: Proxy;
  14662. retryCallback?: Resource.RetryCallback;
  14663. retryAttempts?: number;
  14664. request?: Request;
  14665. responseType?: string;
  14666. overrideMimeType?: string;
  14667. }): Promise<any> | undefined;
  14668. /**
  14669. * Asynchronously gets headers the given resource. Returns a promise that will resolve to
  14670. the result once loaded, or reject if the resource failed to load. The data is loaded
  14671. using XMLHttpRequest, which means that in order to make requests to another origin,
  14672. the server must have Cross-Origin Resource Sharing (CORS) headers enabled.
  14673. * @example
  14674. * resource.head()
  14675. .then(function(headers) {
  14676. // use the data
  14677. }).otherwise(function(error) {
  14678. // an error occurred
  14679. });
  14680. * @param [options] - Object with the following properties:
  14681. * @param [options.responseType] - The type of response. This controls the type of item returned.
  14682. * @param [options.headers] - Additional HTTP headers to send with the request, if any.
  14683. * @param [options.overrideMimeType] - Overrides the MIME type returned by the server.
  14684. * @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.
  14685. */
  14686. head(options?: {
  14687. responseType?: string;
  14688. headers?: any;
  14689. overrideMimeType?: string;
  14690. }): Promise<any> | undefined;
  14691. /**
  14692. * Creates a Resource from a URL and calls head() on it.
  14693. * @param options - A url or an object with the following properties
  14694. * @param options.url - The url of the resource.
  14695. * @param [options.queryParameters] - An object containing query parameters that will be sent when retrieving the resource.
  14696. * @param [options.templateValues] - Key/Value pairs that are used to replace template values (eg. {x}).
  14697. * @param [options.headers = {}] - Additional HTTP headers that will be sent.
  14698. * @param [options.proxy] - A proxy to be used when loading the resource.
  14699. * @param [options.retryCallback] - The Function to call when a request for this resource fails. If it returns true, the request will be retried.
  14700. * @param [options.retryAttempts = 0] - The number of times the retryCallback should be called before giving up.
  14701. * @param [options.request] - A Request object that will be used. Intended for internal use only.
  14702. * @param [options.responseType] - The type of response. This controls the type of item returned.
  14703. * @param [options.overrideMimeType] - Overrides the MIME type returned by the server.
  14704. * @returns a promise that will resolve to the requested data when loaded. Returns undefined if <code>request.throttle</code> is true and the request does not have high enough priority.
  14705. */
  14706. static head(options: {
  14707. url: string;
  14708. queryParameters?: any;
  14709. templateValues?: any;
  14710. headers?: any;
  14711. proxy?: Proxy;
  14712. retryCallback?: Resource.RetryCallback;
  14713. retryAttempts?: number;
  14714. request?: Request;
  14715. responseType?: string;
  14716. overrideMimeType?: string;
  14717. }): Promise<any> | undefined;
  14718. /**
  14719. * Asynchronously gets options the given resource. Returns a promise that will resolve to
  14720. the result once loaded, or reject if the resource failed to load. The data is loaded
  14721. using XMLHttpRequest, which means that in order to make requests to another origin,
  14722. the server must have Cross-Origin Resource Sharing (CORS) headers enabled.
  14723. * @example
  14724. * resource.options()
  14725. .then(function(headers) {
  14726. // use the data
  14727. }).otherwise(function(error) {
  14728. // an error occurred
  14729. });
  14730. * @param [options] - Object with the following properties:
  14731. * @param [options.responseType] - The type of response. This controls the type of item returned.
  14732. * @param [options.headers] - Additional HTTP headers to send with the request, if any.
  14733. * @param [options.overrideMimeType] - Overrides the MIME type returned by the server.
  14734. * @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.
  14735. */
  14736. options(options?: {
  14737. responseType?: string;
  14738. headers?: any;
  14739. overrideMimeType?: string;
  14740. }): Promise<any> | undefined;
  14741. /**
  14742. * Creates a Resource from a URL and calls options() on it.
  14743. * @param options - A url or an object with the following properties
  14744. * @param options.url - The url of the resource.
  14745. * @param [options.queryParameters] - An object containing query parameters that will be sent when retrieving the resource.
  14746. * @param [options.templateValues] - Key/Value pairs that are used to replace template values (eg. {x}).
  14747. * @param [options.headers = {}] - Additional HTTP headers that will be sent.
  14748. * @param [options.proxy] - A proxy to be used when loading the resource.
  14749. * @param [options.retryCallback] - The Function to call when a request for this resource fails. If it returns true, the request will be retried.
  14750. * @param [options.retryAttempts = 0] - The number of times the retryCallback should be called before giving up.
  14751. * @param [options.request] - A Request object that will be used. Intended for internal use only.
  14752. * @param [options.responseType] - The type of response. This controls the type of item returned.
  14753. * @param [options.overrideMimeType] - Overrides the MIME type returned by the server.
  14754. * @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.
  14755. */
  14756. static options(options: {
  14757. url: string;
  14758. queryParameters?: any;
  14759. templateValues?: any;
  14760. headers?: any;
  14761. proxy?: Proxy;
  14762. retryCallback?: Resource.RetryCallback;
  14763. retryAttempts?: number;
  14764. request?: Request;
  14765. responseType?: string;
  14766. overrideMimeType?: string;
  14767. }): Promise<any> | undefined;
  14768. /**
  14769. * Asynchronously posts data to the given resource. Returns a promise that will resolve to
  14770. the result once loaded, or reject if the resource failed to load. The data is loaded
  14771. using XMLHttpRequest, which means that in order to make requests to another origin,
  14772. the server must have Cross-Origin Resource Sharing (CORS) headers enabled.
  14773. * @example
  14774. * resource.post(data)
  14775. .then(function(result) {
  14776. // use the result
  14777. }).otherwise(function(error) {
  14778. // an error occurred
  14779. });
  14780. * @param data - Data that is posted with the resource.
  14781. * @param [options] - Object with the following properties:
  14782. * @param [options.data] - Data that is posted with the resource.
  14783. * @param [options.responseType] - The type of response. This controls the type of item returned.
  14784. * @param [options.headers] - Additional HTTP headers to send with the request, if any.
  14785. * @param [options.overrideMimeType] - Overrides the MIME type returned by the server.
  14786. * @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.
  14787. */
  14788. post(data: any, options?: {
  14789. data?: any;
  14790. responseType?: string;
  14791. headers?: any;
  14792. overrideMimeType?: string;
  14793. }): Promise<any> | undefined;
  14794. /**
  14795. * Creates a Resource from a URL and calls post() on it.
  14796. * @param options - A url or an object with the following properties
  14797. * @param options.url - The url of the resource.
  14798. * @param options.data - Data that is posted with the resource.
  14799. * @param [options.queryParameters] - An object containing query parameters that will be sent when retrieving the resource.
  14800. * @param [options.templateValues] - Key/Value pairs that are used to replace template values (eg. {x}).
  14801. * @param [options.headers = {}] - Additional HTTP headers that will be sent.
  14802. * @param [options.proxy] - A proxy to be used when loading the resource.
  14803. * @param [options.retryCallback] - The Function to call when a request for this resource fails. If it returns true, the request will be retried.
  14804. * @param [options.retryAttempts = 0] - The number of times the retryCallback should be called before giving up.
  14805. * @param [options.request] - A Request object that will be used. Intended for internal use only.
  14806. * @param [options.responseType] - The type of response. This controls the type of item returned.
  14807. * @param [options.overrideMimeType] - Overrides the MIME type returned by the server.
  14808. * @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.
  14809. */
  14810. static post(options: {
  14811. url: string;
  14812. data: any;
  14813. queryParameters?: any;
  14814. templateValues?: any;
  14815. headers?: any;
  14816. proxy?: Proxy;
  14817. retryCallback?: Resource.RetryCallback;
  14818. retryAttempts?: number;
  14819. request?: Request;
  14820. responseType?: string;
  14821. overrideMimeType?: string;
  14822. }): Promise<any> | undefined;
  14823. /**
  14824. * Asynchronously puts data to the given resource. Returns a promise that will resolve to
  14825. the result once loaded, or reject if the resource failed to load. The data is loaded
  14826. using XMLHttpRequest, which means that in order to make requests to another origin,
  14827. the server must have Cross-Origin Resource Sharing (CORS) headers enabled.
  14828. * @example
  14829. * resource.put(data)
  14830. .then(function(result) {
  14831. // use the result
  14832. }).otherwise(function(error) {
  14833. // an error occurred
  14834. });
  14835. * @param data - Data that is posted with the resource.
  14836. * @param [options] - Object with the following properties:
  14837. * @param [options.responseType] - The type of response. This controls the type of item returned.
  14838. * @param [options.headers] - Additional HTTP headers to send with the request, if any.
  14839. * @param [options.overrideMimeType] - Overrides the MIME type returned by the server.
  14840. * @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.
  14841. */
  14842. put(data: any, options?: {
  14843. responseType?: string;
  14844. headers?: any;
  14845. overrideMimeType?: string;
  14846. }): Promise<any> | undefined;
  14847. /**
  14848. * Creates a Resource from a URL and calls put() on it.
  14849. * @param options - A url or an object with the following properties
  14850. * @param options.url - The url of the resource.
  14851. * @param options.data - Data that is posted with the resource.
  14852. * @param [options.queryParameters] - An object containing query parameters that will be sent when retrieving the resource.
  14853. * @param [options.templateValues] - Key/Value pairs that are used to replace template values (eg. {x}).
  14854. * @param [options.headers = {}] - Additional HTTP headers that will be sent.
  14855. * @param [options.proxy] - A proxy to be used when loading the resource.
  14856. * @param [options.retryCallback] - The Function to call when a request for this resource fails. If it returns true, the request will be retried.
  14857. * @param [options.retryAttempts = 0] - The number of times the retryCallback should be called before giving up.
  14858. * @param [options.request] - A Request object that will be used. Intended for internal use only.
  14859. * @param [options.responseType] - The type of response. This controls the type of item returned.
  14860. * @param [options.overrideMimeType] - Overrides the MIME type returned by the server.
  14861. * @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.
  14862. */
  14863. static put(options: {
  14864. url: string;
  14865. data: any;
  14866. queryParameters?: any;
  14867. templateValues?: any;
  14868. headers?: any;
  14869. proxy?: Proxy;
  14870. retryCallback?: Resource.RetryCallback;
  14871. retryAttempts?: number;
  14872. request?: Request;
  14873. responseType?: string;
  14874. overrideMimeType?: string;
  14875. }): Promise<any> | undefined;
  14876. /**
  14877. * Asynchronously patches data to the given resource. Returns a promise that will resolve to
  14878. the result once loaded, or reject if the resource failed to load. The data is loaded
  14879. using XMLHttpRequest, which means that in order to make requests to another origin,
  14880. the server must have Cross-Origin Resource Sharing (CORS) headers enabled.
  14881. * @example
  14882. * resource.patch(data)
  14883. .then(function(result) {
  14884. // use the result
  14885. }).otherwise(function(error) {
  14886. // an error occurred
  14887. });
  14888. * @param data - Data that is posted with the resource.
  14889. * @param [options] - Object with the following properties:
  14890. * @param [options.responseType] - The type of response. This controls the type of item returned.
  14891. * @param [options.headers] - Additional HTTP headers to send with the request, if any.
  14892. * @param [options.overrideMimeType] - Overrides the MIME type returned by the server.
  14893. * @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.
  14894. */
  14895. patch(data: any, options?: {
  14896. responseType?: string;
  14897. headers?: any;
  14898. overrideMimeType?: string;
  14899. }): Promise<any> | undefined;
  14900. /**
  14901. * Creates a Resource from a URL and calls patch() on it.
  14902. * @param options - A url or an object with the following properties
  14903. * @param options.url - The url of the resource.
  14904. * @param options.data - Data that is posted with the resource.
  14905. * @param [options.queryParameters] - An object containing query parameters that will be sent when retrieving the resource.
  14906. * @param [options.templateValues] - Key/Value pairs that are used to replace template values (eg. {x}).
  14907. * @param [options.headers = {}] - Additional HTTP headers that will be sent.
  14908. * @param [options.proxy] - A proxy to be used when loading the resource.
  14909. * @param [options.retryCallback] - The Function to call when a request for this resource fails. If it returns true, the request will be retried.
  14910. * @param [options.retryAttempts = 0] - The number of times the retryCallback should be called before giving up.
  14911. * @param [options.request] - A Request object that will be used. Intended for internal use only.
  14912. * @param [options.responseType] - The type of response. This controls the type of item returned.
  14913. * @param [options.overrideMimeType] - Overrides the MIME type returned by the server.
  14914. * @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.
  14915. */
  14916. static patch(options: {
  14917. url: string;
  14918. data: any;
  14919. queryParameters?: any;
  14920. templateValues?: any;
  14921. headers?: any;
  14922. proxy?: Proxy;
  14923. retryCallback?: Resource.RetryCallback;
  14924. retryAttempts?: number;
  14925. request?: Request;
  14926. responseType?: string;
  14927. overrideMimeType?: string;
  14928. }): Promise<any> | undefined;
  14929. /**
  14930. * A resource instance initialized to the current browser location
  14931. */
  14932. static readonly DEFAULT: Resource;
  14933. }
  14934. export namespace Resource {
  14935. /**
  14936. * A function that returns the value of the property.
  14937. * @param [resource] - The resource that failed to load.
  14938. * @param [error] - The error that occurred during the loading of the resource.
  14939. */
  14940. type RetryCallback = (resource?: Resource, error?: Error) => boolean | Promise<boolean>;
  14941. }
  14942. /**
  14943. * Constructs an exception object that is thrown due to an error that can occur at runtime, e.g.,
  14944. out of memory, could not compile shader, etc. If a function may throw this
  14945. exception, the calling code should be prepared to catch it.
  14946. <br /><br />
  14947. On the other hand, a {@link DeveloperError} indicates an exception due
  14948. to a developer error, e.g., invalid argument, that usually indicates a bug in the
  14949. calling code.
  14950. * @param [message] - The error message for this exception.
  14951. */
  14952. export class RuntimeError extends Error {
  14953. constructor(message?: string);
  14954. /**
  14955. * 'RuntimeError' indicating that this exception was thrown due to a runtime error.
  14956. */
  14957. readonly name: string;
  14958. /**
  14959. * The explanation for why this exception was thrown.
  14960. */
  14961. readonly message: string;
  14962. /**
  14963. * The stack trace of this exception, if available.
  14964. */
  14965. readonly stack: string;
  14966. }
  14967. /**
  14968. * Initiates a terrain height query for an array of {@link Cartographic} positions by
  14969. requesting tiles from a terrain provider, sampling, and interpolating. The interpolation
  14970. matches the triangles used to render the terrain at the specified level. The query
  14971. happens asynchronously, so this function returns a promise that is resolved when
  14972. the query completes. Each point height is modified in place. If a height can not be
  14973. determined because no terrain data is available for the specified level at that location,
  14974. or another error occurs, the height is set to undefined. As is typical of the
  14975. {@link Cartographic} type, the supplied height is a height above the reference ellipsoid
  14976. (such as {@link Ellipsoid.WGS84}) rather than an altitude above mean sea level. In other
  14977. words, it will not necessarily be 0.0 if sampled in the ocean. This function needs the
  14978. terrain level of detail as input, if you need to get the altitude of the terrain as precisely
  14979. as possible (i.e. with maximum level of detail) use {@link sampleTerrainMostDetailed}.
  14980. * @example
  14981. * // Query the terrain height of two Cartographic positions
  14982. var terrainProvider = Cesium.createWorldTerrain();
  14983. var positions = [
  14984. Cesium.Cartographic.fromDegrees(86.925145, 27.988257),
  14985. Cesium.Cartographic.fromDegrees(87.0, 28.0)
  14986. ];
  14987. var promise = Cesium.sampleTerrain(terrainProvider, 11, positions);
  14988. Cesium.when(promise, function(updatedPositions) {
  14989. // positions[0].height and positions[1].height have been updated.
  14990. // updatedPositions is just a reference to positions.
  14991. });
  14992. * @param terrainProvider - The terrain provider from which to query heights.
  14993. * @param level - The terrain level-of-detail from which to query terrain heights.
  14994. * @param positions - The positions to update with terrain heights.
  14995. * @returns A promise that resolves to the provided list of positions when terrain the query has completed.
  14996. */
  14997. export function sampleTerrain(terrainProvider: TerrainProvider, level: number, positions: Cartographic[]): Promise<Cartographic[]>;
  14998. /**
  14999. * Initiates a sampleTerrain() request at the maximum available tile level for a terrain dataset.
  15000. * @example
  15001. * // Query the terrain height of two Cartographic positions
  15002. var terrainProvider = Cesium.createWorldTerrain();
  15003. var positions = [
  15004. Cesium.Cartographic.fromDegrees(86.925145, 27.988257),
  15005. Cesium.Cartographic.fromDegrees(87.0, 28.0)
  15006. ];
  15007. var promise = Cesium.sampleTerrainMostDetailed(terrainProvider, positions);
  15008. Cesium.when(promise, function(updatedPositions) {
  15009. // positions[0].height and positions[1].height have been updated.
  15010. // updatedPositions is just a reference to positions.
  15011. });
  15012. * @param terrainProvider - The terrain provider from which to query heights.
  15013. * @param positions - The positions to update with terrain heights.
  15014. * @returns A promise that resolves to the provided list of positions when terrain the query has completed. This
  15015. promise will reject if the terrain provider's `availability` property is undefined.
  15016. */
  15017. export function sampleTerrainMostDetailed(terrainProvider: TerrainProvider, positions: Cartographic[]): Promise<Cartographic[]>;
  15018. /**
  15019. * Handles user input events. Custom functions can be added to be executed on
  15020. when the user enters input.
  15021. * @param [element = document] - The element to add events to.
  15022. */
  15023. export class ScreenSpaceEventHandler {
  15024. constructor(element?: HTMLCanvasElement);
  15025. /**
  15026. * Set a function to be executed on an input event.
  15027. * @param action - Function to be executed when the input event occurs.
  15028. * @param type - The ScreenSpaceEventType of input event.
  15029. * @param [modifier] - A KeyboardEventModifier key that is held when a <code>type</code>
  15030. event occurs.
  15031. */
  15032. setInputAction(action: (...params: any[]) => any, type: number, modifier?: number): void;
  15033. /**
  15034. * Returns the function to be executed on an input event.
  15035. * @param type - The ScreenSpaceEventType of input event.
  15036. * @param [modifier] - A KeyboardEventModifier key that is held when a <code>type</code>
  15037. event occurs.
  15038. * @returns The function to be executed on an input event.
  15039. */
  15040. getInputAction(type: number, modifier?: number): (...params: any[]) => any;
  15041. /**
  15042. * Removes the function to be executed on an input event.
  15043. * @param type - The ScreenSpaceEventType of input event.
  15044. * @param [modifier] - A KeyboardEventModifier key that is held when a <code>type</code>
  15045. event occurs.
  15046. */
  15047. removeInputAction(type: number, modifier?: number): void;
  15048. /**
  15049. * Returns true if this object was destroyed; otherwise, false.
  15050. <br /><br />
  15051. If this object was destroyed, it should not be used; calling any function other than
  15052. <code>isDestroyed</code> will result in a {@link DeveloperError} exception.
  15053. * @returns <code>true</code> if this object was destroyed; otherwise, <code>false</code>.
  15054. */
  15055. isDestroyed(): boolean;
  15056. /**
  15057. * Removes listeners held by this object.
  15058. <br /><br />
  15059. Once an object is destroyed, it should not be used; calling any function other than
  15060. <code>isDestroyed</code> will result in a {@link DeveloperError} exception. Therefore,
  15061. assign the return value (<code>undefined</code>) to the object as done in the example.
  15062. * @example
  15063. * handler = handler && handler.destroy();
  15064. */
  15065. destroy(): void;
  15066. /**
  15067. * The amount of time, in milliseconds, that mouse events will be disabled after
  15068. receiving any touch events, such that any emulated mouse events will be ignored.
  15069. */
  15070. static mouseEmulationIgnoreMilliseconds: number;
  15071. /**
  15072. * The amount of time, in milliseconds, before a touch on the screen becomes a
  15073. touch and hold.
  15074. */
  15075. static touchHoldDelayMilliseconds: number;
  15076. }
  15077. /**
  15078. * This enumerated type is for classifying mouse events: down, up, click, double click, move and move while a button is held down.
  15079. */
  15080. export enum ScreenSpaceEventType {
  15081. /**
  15082. * Represents a mouse left button down event.
  15083. */
  15084. LEFT_DOWN = 0,
  15085. /**
  15086. * Represents a mouse left button up event.
  15087. */
  15088. LEFT_UP = 1,
  15089. /**
  15090. * Represents a mouse left click event.
  15091. */
  15092. LEFT_CLICK = 2,
  15093. /**
  15094. * Represents a mouse left double click event.
  15095. */
  15096. LEFT_DOUBLE_CLICK = 3,
  15097. /**
  15098. * Represents a mouse left button down event.
  15099. */
  15100. RIGHT_DOWN = 5,
  15101. /**
  15102. * Represents a mouse right button up event.
  15103. */
  15104. RIGHT_UP = 6,
  15105. /**
  15106. * Represents a mouse right click event.
  15107. */
  15108. RIGHT_CLICK = 7,
  15109. /**
  15110. * Represents a mouse middle button down event.
  15111. */
  15112. MIDDLE_DOWN = 10,
  15113. /**
  15114. * Represents a mouse middle button up event.
  15115. */
  15116. MIDDLE_UP = 11,
  15117. /**
  15118. * Represents a mouse middle click event.
  15119. */
  15120. MIDDLE_CLICK = 12,
  15121. /**
  15122. * Represents a mouse move event.
  15123. */
  15124. MOUSE_MOVE = 15,
  15125. /**
  15126. * Represents a mouse wheel event.
  15127. */
  15128. WHEEL = 16,
  15129. /**
  15130. * Represents the start of a two-finger event on a touch surface.
  15131. */
  15132. PINCH_START = 17,
  15133. /**
  15134. * Represents the end of a two-finger event on a touch surface.
  15135. */
  15136. PINCH_END = 18,
  15137. /**
  15138. * Represents a change of a two-finger event on a touch surface.
  15139. */
  15140. PINCH_MOVE = 19
  15141. }
  15142. /**
  15143. * Value and type information for per-instance geometry attribute that determines if the geometry instance will be shown.
  15144. * @example
  15145. * var instance = new Cesium.GeometryInstance({
  15146. geometry : new Cesium.BoxGeometry({
  15147. vertexFormat : Cesium.VertexFormat.POSITION_AND_NORMAL,
  15148. minimum : new Cesium.Cartesian3(-250000.0, -250000.0, -250000.0),
  15149. maximum : new Cesium.Cartesian3(250000.0, 250000.0, 250000.0)
  15150. }),
  15151. modelMatrix : Cesium.Matrix4.multiplyByTranslation(Cesium.Transforms.eastNorthUpToFixedFrame(
  15152. Cesium.Cartesian3.fromDegrees(-75.59777, 40.03883)), new Cesium.Cartesian3(0.0, 0.0, 1000000.0), new Cesium.Matrix4()),
  15153. id : 'box',
  15154. attributes : {
  15155. show : new Cesium.ShowGeometryInstanceAttribute(false)
  15156. }
  15157. });
  15158. * @param [show = true] - Determines if the geometry instance will be shown.
  15159. */
  15160. export class ShowGeometryInstanceAttribute {
  15161. constructor(show?: boolean);
  15162. /**
  15163. * The values for the attributes stored in a typed array.
  15164. */
  15165. value: Uint8Array;
  15166. /**
  15167. * The datatype of each component in the attribute, e.g., individual elements in
  15168. {@link ColorGeometryInstanceAttribute#value}.
  15169. */
  15170. readonly componentDatatype: ComponentDatatype;
  15171. /**
  15172. * The number of components in the attributes, i.e., {@link ColorGeometryInstanceAttribute#value}.
  15173. */
  15174. readonly componentsPerAttribute: number;
  15175. /**
  15176. * When <code>true</code> and <code>componentDatatype</code> is an integer format,
  15177. indicate that the components should be mapped to the range [0, 1] (unsigned)
  15178. or [-1, 1] (signed) when they are accessed as floating-point for rendering.
  15179. */
  15180. readonly normalize: boolean;
  15181. /**
  15182. * Converts a boolean show to a typed array that can be used to assign a show attribute.
  15183. * @example
  15184. * var attributes = primitive.getGeometryInstanceAttributes('an id');
  15185. attributes.show = Cesium.ShowGeometryInstanceAttribute.toValue(true, attributes.show);
  15186. * @param show - The show value.
  15187. * @param [result] - The array to store the result in, if undefined a new instance will be created.
  15188. * @returns The modified result parameter or a new instance if result was undefined.
  15189. */
  15190. static toValue(show: boolean, result?: Uint8Array): Uint8Array;
  15191. }
  15192. /**
  15193. * Contains functions for finding the Cartesian coordinates of the sun and the moon in the
  15194. Earth-centered inertial frame.
  15195. */
  15196. export namespace Simon1994PlanetaryPositions {
  15197. /**
  15198. * Computes the position of the Sun in the Earth-centered inertial frame
  15199. * @param [julianDate] - The time at which to compute the Sun's position, if not provided the current system time is used.
  15200. * @param [result] - The object onto which to store the result.
  15201. * @returns Calculated sun position
  15202. */
  15203. function computeSunPositionInEarthInertialFrame(julianDate?: JulianDate, result?: Cartesian3): Cartesian3;
  15204. /**
  15205. * Computes the position of the Moon in the Earth-centered inertial frame
  15206. * @param [julianDate] - The time at which to compute the Sun's position, if not provided the current system time is used.
  15207. * @param [result] - The object onto which to store the result.
  15208. * @returns Calculated moon position
  15209. */
  15210. function computeMoonPositionInEarthInertialFrame(julianDate?: JulianDate, result?: Cartesian3): Cartesian3;
  15211. }
  15212. /**
  15213. * A description of a polyline modeled as a line strip; the first two positions define a line segment,
  15214. and each additional position defines a line segment from the previous position.
  15215. * @example
  15216. * // A polyline with two connected line segments
  15217. var polyline = new Cesium.SimplePolylineGeometry({
  15218. positions : Cesium.Cartesian3.fromDegreesArray([
  15219. 0.0, 0.0,
  15220. 5.0, 0.0,
  15221. 5.0, 5.0
  15222. ])
  15223. });
  15224. var geometry = Cesium.SimplePolylineGeometry.createGeometry(polyline);
  15225. * @param options - Object with the following properties:
  15226. * @param options.positions - An array of {@link Cartesian3} defining the positions in the polyline as a line strip.
  15227. * @param [options.colors] - An Array of {@link Color} defining the per vertex or per segment colors.
  15228. * @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.
  15229. * @param [options.arcType = ArcType.GEODESIC] - The type of line the polyline segments must follow.
  15230. * @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.
  15231. * @param [options.ellipsoid = Ellipsoid.WGS84] - The ellipsoid to be used as a reference.
  15232. */
  15233. export class SimplePolylineGeometry {
  15234. constructor(options: {
  15235. positions: Cartesian3[];
  15236. colors?: Color[];
  15237. colorsPerVertex?: boolean;
  15238. arcType?: ArcType;
  15239. granularity?: number;
  15240. ellipsoid?: Ellipsoid;
  15241. });
  15242. /**
  15243. * The number of elements used to pack the object into an array.
  15244. */
  15245. packedLength: number;
  15246. /**
  15247. * Stores the provided instance into the provided array.
  15248. * @param value - The value to pack.
  15249. * @param array - The array to pack into.
  15250. * @param [startingIndex = 0] - The index into the array at which to start packing the elements.
  15251. * @returns The array that was packed into
  15252. */
  15253. static pack(value: SimplePolylineGeometry, array: number[], startingIndex?: number): number[];
  15254. /**
  15255. * Retrieves an instance from a packed array.
  15256. * @param array - The packed array.
  15257. * @param [startingIndex = 0] - The starting index of the element to be unpacked.
  15258. * @param [result] - The object into which to store the result.
  15259. * @returns The modified result parameter or a new SimplePolylineGeometry instance if one was not provided.
  15260. */
  15261. static unpack(array: number[], startingIndex?: number, result?: SimplePolylineGeometry): SimplePolylineGeometry;
  15262. /**
  15263. * Computes the geometric representation of a simple polyline, including its vertices, indices, and a bounding sphere.
  15264. * @param simplePolylineGeometry - A description of the polyline.
  15265. * @returns The computed vertices and indices.
  15266. */
  15267. static createGeometry(simplePolylineGeometry: SimplePolylineGeometry): Geometry | undefined;
  15268. }
  15269. /**
  15270. * A description of a sphere centered at the origin.
  15271. * @example
  15272. * var sphere = new Cesium.SphereGeometry({
  15273. radius : 100.0,
  15274. vertexFormat : Cesium.VertexFormat.POSITION_ONLY
  15275. });
  15276. var geometry = Cesium.SphereGeometry.createGeometry(sphere);
  15277. * @param [options] - Object with the following properties:
  15278. * @param [options.radius = 1.0] - The radius of the sphere.
  15279. * @param [options.stackPartitions = 64] - The number of times to partition the ellipsoid into stacks.
  15280. * @param [options.slicePartitions = 64] - The number of times to partition the ellipsoid into radial slices.
  15281. * @param [options.vertexFormat = VertexFormat.DEFAULT] - The vertex attributes to be computed.
  15282. */
  15283. export class SphereGeometry {
  15284. constructor(options?: {
  15285. radius?: number;
  15286. stackPartitions?: number;
  15287. slicePartitions?: number;
  15288. vertexFormat?: VertexFormat;
  15289. });
  15290. /**
  15291. * The number of elements used to pack the object into an array.
  15292. */
  15293. static packedLength: number;
  15294. /**
  15295. * Stores the provided instance into the provided array.
  15296. * @param value - The value to pack.
  15297. * @param array - The array to pack into.
  15298. * @param [startingIndex = 0] - The index into the array at which to start packing the elements.
  15299. * @returns The array that was packed into
  15300. */
  15301. static pack(value: SphereGeometry, array: number[], startingIndex?: number): number[];
  15302. /**
  15303. * Retrieves an instance from a packed array.
  15304. * @param array - The packed array.
  15305. * @param [startingIndex = 0] - The starting index of the element to be unpacked.
  15306. * @param [result] - The object into which to store the result.
  15307. * @returns The modified result parameter or a new SphereGeometry instance if one was not provided.
  15308. */
  15309. static unpack(array: number[], startingIndex?: number, result?: SphereGeometry): SphereGeometry;
  15310. /**
  15311. * Computes the geometric representation of a sphere, including its vertices, indices, and a bounding sphere.
  15312. * @param sphereGeometry - A description of the sphere.
  15313. * @returns The computed vertices and indices.
  15314. */
  15315. static createGeometry(sphereGeometry: SphereGeometry): Geometry | undefined;
  15316. }
  15317. /**
  15318. * A description of the outline of a sphere.
  15319. * @example
  15320. * var sphere = new Cesium.SphereOutlineGeometry({
  15321. radius : 100.0,
  15322. stackPartitions : 6,
  15323. slicePartitions: 5
  15324. });
  15325. var geometry = Cesium.SphereOutlineGeometry.createGeometry(sphere);
  15326. * @param [options] - Object with the following properties:
  15327. * @param [options.radius = 1.0] - The radius of the sphere.
  15328. * @param [options.stackPartitions = 10] - The count of stacks for the sphere (1 greater than the number of parallel lines).
  15329. * @param [options.slicePartitions = 8] - The count of slices for the sphere (Equal to the number of radial lines).
  15330. * @param [options.subdivisions = 200] - The number of points per line, determining the granularity of the curvature .
  15331. */
  15332. export class SphereOutlineGeometry {
  15333. constructor(options?: {
  15334. radius?: number;
  15335. stackPartitions?: number;
  15336. slicePartitions?: number;
  15337. subdivisions?: number;
  15338. });
  15339. /**
  15340. * The number of elements used to pack the object into an array.
  15341. */
  15342. static packedLength: number;
  15343. /**
  15344. * Stores the provided instance into the provided array.
  15345. * @param value - The value to pack.
  15346. * @param array - The array to pack into.
  15347. * @param [startingIndex = 0] - The index into the array at which to start packing the elements.
  15348. * @returns The array that was packed into
  15349. */
  15350. static pack(value: SphereOutlineGeometry, array: number[], startingIndex?: number): number[];
  15351. /**
  15352. * Retrieves an instance from a packed array.
  15353. * @param array - The packed array.
  15354. * @param [startingIndex = 0] - The starting index of the element to be unpacked.
  15355. * @param [result] - The object into which to store the result.
  15356. * @returns The modified result parameter or a new SphereOutlineGeometry instance if one was not provided.
  15357. */
  15358. static unpack(array: number[], startingIndex?: number, result?: SphereOutlineGeometry): SphereOutlineGeometry;
  15359. /**
  15360. * Computes the geometric representation of an outline of a sphere, including its vertices, indices, and a bounding sphere.
  15361. * @param sphereGeometry - A description of the sphere outline.
  15362. * @returns The computed vertices and indices.
  15363. */
  15364. static createGeometry(sphereGeometry: SphereOutlineGeometry): Geometry | undefined;
  15365. }
  15366. /**
  15367. * A set of curvilinear 3-dimensional coordinates.
  15368. * @param [clock = 0.0] - The angular coordinate lying in the xy-plane measured from the positive x-axis and toward the positive y-axis.
  15369. * @param [cone = 0.0] - The angular coordinate measured from the positive z-axis and toward the negative z-axis.
  15370. * @param [magnitude = 1.0] - The linear coordinate measured from the origin.
  15371. */
  15372. export class Spherical {
  15373. constructor(clock?: number, cone?: number, magnitude?: number);
  15374. /**
  15375. * The clock component.
  15376. */
  15377. clock: number;
  15378. /**
  15379. * The cone component.
  15380. */
  15381. cone: number;
  15382. /**
  15383. * The magnitude component.
  15384. */
  15385. magnitude: number;
  15386. /**
  15387. * Converts the provided Cartesian3 into Spherical coordinates.
  15388. * @param cartesian3 - The Cartesian3 to be converted to Spherical.
  15389. * @param [result] - The object in which the result will be stored, if undefined a new instance will be created.
  15390. * @returns The modified result parameter, or a new instance if one was not provided.
  15391. */
  15392. static fromCartesian3(cartesian3: Cartesian3, result?: Spherical): Spherical;
  15393. /**
  15394. * Creates a duplicate of a Spherical.
  15395. * @param spherical - The spherical to clone.
  15396. * @param [result] - The object to store the result into, if undefined a new instance will be created.
  15397. * @returns The modified result parameter or a new instance if result was undefined. (Returns undefined if spherical is undefined)
  15398. */
  15399. static clone(spherical: Spherical, result?: Spherical): Spherical;
  15400. /**
  15401. * Computes the normalized version of the provided spherical.
  15402. * @param spherical - The spherical to be normalized.
  15403. * @param [result] - The object to store the result into, if undefined a new instance will be created.
  15404. * @returns The modified result parameter or a new instance if result was undefined.
  15405. */
  15406. static normalize(spherical: Spherical, result?: Spherical): Spherical;
  15407. /**
  15408. * Returns true if the first spherical is equal to the second spherical, false otherwise.
  15409. * @param left - The first Spherical to be compared.
  15410. * @param right - The second Spherical to be compared.
  15411. * @returns true if the first spherical is equal to the second spherical, false otherwise.
  15412. */
  15413. static equals(left: Spherical, right: Spherical): boolean;
  15414. /**
  15415. * Returns true if the first spherical is within the provided epsilon of the second spherical, false otherwise.
  15416. * @param left - The first Spherical to be compared.
  15417. * @param right - The second Spherical to be compared.
  15418. * @param [epsilon = 0.0] - The epsilon to compare against.
  15419. * @returns true if the first spherical is within the provided epsilon of the second spherical, false otherwise.
  15420. */
  15421. static equalsEpsilon(left: Spherical, right: Spherical, epsilon?: number): boolean;
  15422. /**
  15423. * Returns true if this spherical is equal to the provided spherical, false otherwise.
  15424. * @param other - The Spherical to be compared.
  15425. * @returns true if this spherical is equal to the provided spherical, false otherwise.
  15426. */
  15427. equals(other: Spherical): boolean;
  15428. /**
  15429. * Creates a duplicate of this Spherical.
  15430. * @param [result] - The object to store the result into, if undefined a new instance will be created.
  15431. * @returns The modified result parameter or a new instance if result was undefined.
  15432. */
  15433. clone(result?: Spherical): Spherical;
  15434. /**
  15435. * Returns true if this spherical is within the provided epsilon of the provided spherical, false otherwise.
  15436. * @param other - The Spherical to be compared.
  15437. * @param epsilon - The epsilon to compare against.
  15438. * @returns true if this spherical is within the provided epsilon of the provided spherical, false otherwise.
  15439. */
  15440. equalsEpsilon(other: Spherical, epsilon: number): boolean;
  15441. /**
  15442. * Returns a string representing this instance in the format (clock, cone, magnitude).
  15443. * @returns A string representing this instance.
  15444. */
  15445. toString(): string;
  15446. }
  15447. /**
  15448. * Creates a curve parameterized and evaluated by time. This type describes an interface
  15449. and is not intended to be instantiated directly.
  15450. */
  15451. export class Spline {
  15452. constructor();
  15453. /**
  15454. * An array of times for the control points.
  15455. */
  15456. times: number[];
  15457. /**
  15458. * An array of control points.
  15459. */
  15460. points: Cartesian3[] | Quaternion[];
  15461. /**
  15462. * Evaluates the curve at a given time.
  15463. * @param time - The time at which to evaluate the curve.
  15464. * @param [result] - The object onto which to store the result.
  15465. * @returns The modified result parameter or a new instance of the point on the curve at the given time.
  15466. */
  15467. evaluate(time: number, result?: Cartesian3 | Quaternion | number[]): Cartesian3 | Quaternion | number[];
  15468. /**
  15469. * Finds an index <code>i</code> in <code>times</code> such that the parameter
  15470. <code>time</code> is in the interval <code>[times[i], times[i + 1]]</code>.
  15471. * @param time - The time.
  15472. * @param startIndex - The index from which to start the search.
  15473. * @returns The index for the element at the start of the interval.
  15474. */
  15475. findTimeInterval(time: number, startIndex: number): number;
  15476. /**
  15477. * Wraps the given time to the period covered by the spline.
  15478. * @param time - The time.
  15479. * @returns The time, wrapped around the animation period.
  15480. */
  15481. wrapTime(time: number): number;
  15482. /**
  15483. * Clamps the given time to the period covered by the spline.
  15484. * @param time - The time.
  15485. * @returns The time, clamped to the animation period.
  15486. */
  15487. clampTime(time: number): number;
  15488. }
  15489. /**
  15490. * Subdivides an array into a number of smaller, equal sized arrays.
  15491. * @param array - The array to divide.
  15492. * @param numberOfArrays - The number of arrays to divide the provided array into.
  15493. */
  15494. export function subdivideArray(array: any[], numberOfArrays: number): void;
  15495. /**
  15496. * A wrapper around a web worker that allows scheduling tasks for a given worker,
  15497. returning results asynchronously via a promise.
  15498. The Worker is not constructed until a task is scheduled.
  15499. * @param workerName - The name of the worker. This is expected to be a script
  15500. in the Workers folder.
  15501. * @param [maximumActiveTasks = 5] - The maximum number of active tasks. Once exceeded,
  15502. scheduleTask will not queue any more tasks, allowing
  15503. work to be rescheduled in future frames.
  15504. */
  15505. export class TaskProcessor {
  15506. constructor(workerName: string, maximumActiveTasks?: number);
  15507. /**
  15508. * Schedule a task to be processed by the web worker asynchronously. If there are currently more
  15509. tasks active than the maximum set by the constructor, will immediately return undefined.
  15510. Otherwise, returns a promise that will resolve to the result posted back by the worker when
  15511. finished.
  15512. * @example
  15513. * var taskProcessor = new Cesium.TaskProcessor('myWorkerName');
  15514. var promise = taskProcessor.scheduleTask({
  15515. someParameter : true,
  15516. another : 'hello'
  15517. });
  15518. if (!Cesium.defined(promise)) {
  15519. // too many active tasks - try again later
  15520. } else {
  15521. Cesium.when(promise, function(result) {
  15522. // use the result of the task
  15523. });
  15524. }
  15525. * @param parameters - Any input data that will be posted to the worker.
  15526. * @param [transferableObjects] - An array of objects contained in parameters that should be
  15527. transferred to the worker instead of copied.
  15528. * @returns Either a promise that will resolve to the result when available, or undefined
  15529. if there are too many active tasks,
  15530. */
  15531. scheduleTask(parameters: any, transferableObjects?: object[]): Promise<object> | undefined;
  15532. /**
  15533. * Posts a message to a web worker with configuration to initialize loading
  15534. and compiling a web assembly module asychronously, as well as an optional
  15535. fallback JavaScript module to use if Web Assembly is not supported.
  15536. * @param [webAssemblyOptions] - An object with the following properties:
  15537. * @param [webAssemblyOptions.modulePath] - The path of the web assembly JavaScript wrapper module.
  15538. * @param [webAssemblyOptions.wasmBinaryFile] - The path of the web assembly binary file.
  15539. * @param [webAssemblyOptions.fallbackModulePath] - The path of the fallback JavaScript module to use if web assembly is not supported.
  15540. * @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.
  15541. */
  15542. initWebAssemblyModule(webAssemblyOptions?: {
  15543. modulePath?: string;
  15544. wasmBinaryFile?: string;
  15545. fallbackModulePath?: string;
  15546. }): Promise<object>;
  15547. /**
  15548. * Returns true if this object was destroyed; otherwise, false.
  15549. <br /><br />
  15550. If this object was destroyed, it should not be used; calling any function other than
  15551. <code>isDestroyed</code> will result in a {@link DeveloperError} exception.
  15552. * @returns True if this object was destroyed; otherwise, false.
  15553. */
  15554. isDestroyed(): boolean;
  15555. /**
  15556. * Destroys this object. This will immediately terminate the Worker.
  15557. <br /><br />
  15558. Once an object is destroyed, it should not be used; calling any function other than
  15559. <code>isDestroyed</code> will result in a {@link DeveloperError} exception.
  15560. */
  15561. destroy(): void;
  15562. }
  15563. /**
  15564. * Terrain data for a single tile. This type describes an
  15565. interface and is not intended to be instantiated directly.
  15566. */
  15567. export class TerrainData {
  15568. constructor();
  15569. /**
  15570. * An array of credits for this tile.
  15571. */
  15572. credits: Credit[];
  15573. /**
  15574. * The water mask included in this terrain data, if any. A water mask is a rectangular
  15575. Uint8Array or image where a value of 255 indicates water and a value of 0 indicates land.
  15576. Values in between 0 and 255 are allowed as well to smoothly blend between land and water.
  15577. */
  15578. waterMask: Uint8Array | HTMLImageElement | HTMLCanvasElement;
  15579. /**
  15580. * Computes the terrain height at a specified longitude and latitude.
  15581. * @param rectangle - The rectangle covered by this terrain data.
  15582. * @param longitude - The longitude in radians.
  15583. * @param latitude - The latitude in radians.
  15584. * @returns The terrain height at the specified position. If the position
  15585. is outside the rectangle, this method will extrapolate the height, which is likely to be wildly
  15586. incorrect for positions far outside the rectangle.
  15587. */
  15588. interpolateHeight(rectangle: Rectangle, longitude: number, latitude: number): number;
  15589. /**
  15590. * Determines if a given child tile is available, based on the
  15591. {@link TerrainData#childTileMask}. The given child tile coordinates are assumed
  15592. to be one of the four children of this tile. If non-child tile coordinates are
  15593. given, the availability of the southeast child tile is returned.
  15594. * @param thisX - The tile X coordinate of this (the parent) tile.
  15595. * @param thisY - The tile Y coordinate of this (the parent) tile.
  15596. * @param childX - The tile X coordinate of the child tile to check for availability.
  15597. * @param childY - The tile Y coordinate of the child tile to check for availability.
  15598. * @returns True if the child tile is available; otherwise, false.
  15599. */
  15600. isChildAvailable(thisX: number, thisY: number, childX: number, childY: number): boolean;
  15601. /**
  15602. * Upsamples this terrain data for use by a descendant tile.
  15603. * @param tilingScheme - The tiling scheme of this terrain data.
  15604. * @param thisX - The X coordinate of this tile in the tiling scheme.
  15605. * @param thisY - The Y coordinate of this tile in the tiling scheme.
  15606. * @param thisLevel - The level of this tile in the tiling scheme.
  15607. * @param descendantX - The X coordinate within the tiling scheme of the descendant tile for which we are upsampling.
  15608. * @param descendantY - The Y coordinate within the tiling scheme of the descendant tile for which we are upsampling.
  15609. * @param descendantLevel - The level within the tiling scheme of the descendant tile for which we are upsampling.
  15610. * @returns A promise for upsampled terrain data for the descendant tile,
  15611. or undefined if too many asynchronous upsample operations are in progress and the request has been
  15612. deferred.
  15613. */
  15614. upsample(tilingScheme: TilingScheme, thisX: number, thisY: number, thisLevel: number, descendantX: number, descendantY: number, descendantLevel: number): Promise<TerrainData> | undefined;
  15615. /**
  15616. * Gets a value indicating whether or not this terrain data was created by upsampling lower resolution
  15617. terrain data. If this value is false, the data was obtained from some other source, such
  15618. as by downloading it from a remote server. This method should return true for instances
  15619. returned from a call to {@link TerrainData#upsample}.
  15620. * @returns True if this instance was created by upsampling; otherwise, false.
  15621. */
  15622. wasCreatedByUpsampling(): boolean;
  15623. }
  15624. /**
  15625. * Provides terrain or other geometry for the surface of an ellipsoid. The surface geometry is
  15626. organized into a pyramid of tiles according to a {@link TilingScheme}. This type describes an
  15627. interface and is not intended to be instantiated directly.
  15628. */
  15629. export class TerrainProvider {
  15630. constructor();
  15631. /**
  15632. * Gets an event that is raised when the terrain provider encounters an asynchronous error.. By subscribing
  15633. to the event, you will be notified of the error and can potentially recover from it. Event listeners
  15634. are passed an instance of {@link TileProviderError}.
  15635. */
  15636. errorEvent: Event;
  15637. /**
  15638. * Gets the credit to display when this terrain provider is active. Typically this is used to credit
  15639. the source of the terrain. This function should
  15640. not be called before {@link TerrainProvider#ready} returns true.
  15641. */
  15642. credit: Credit;
  15643. /**
  15644. * Gets the tiling scheme used by the provider. This function should
  15645. not be called before {@link TerrainProvider#ready} returns true.
  15646. */
  15647. tilingScheme: TilingScheme;
  15648. /**
  15649. * Gets a value indicating whether or not the provider is ready for use.
  15650. */
  15651. ready: boolean;
  15652. /**
  15653. * Gets a promise that resolves to true when the provider is ready for use.
  15654. */
  15655. readonly readyPromise: Promise<boolean>;
  15656. /**
  15657. * Gets a value indicating whether or not the provider includes a water mask. The water mask
  15658. indicates which areas of the globe are water rather than land, so they can be rendered
  15659. as a reflective surface with animated waves. This function should not be
  15660. called before {@link TerrainProvider#ready} returns true.
  15661. */
  15662. hasWaterMask: boolean;
  15663. /**
  15664. * Gets a value indicating whether or not the requested tiles include vertex normals.
  15665. This function should not be called before {@link TerrainProvider#ready} returns true.
  15666. */
  15667. hasVertexNormals: boolean;
  15668. /**
  15669. * Gets an object that can be used to determine availability of terrain from this provider, such as
  15670. at points and in rectangles. This function should not be called before
  15671. {@link TerrainProvider#ready} returns true. This property may be undefined if availability
  15672. information is not available.
  15673. */
  15674. availability: TileAvailability;
  15675. /**
  15676. * Gets a list of indices for a triangle mesh representing a regular grid. Calling
  15677. this function multiple times with the same grid width and height returns the
  15678. same list of indices. The total number of vertices must be less than or equal
  15679. to 65536.
  15680. * @param width - The number of vertices in the regular grid in the horizontal direction.
  15681. * @param height - The number of vertices in the regular grid in the vertical direction.
  15682. * @returns The list of indices. Uint16Array gets returned for 64KB or less and Uint32Array for 4GB or less.
  15683. */
  15684. static getRegularGridIndices(width: number, height: number): Uint16Array | Uint32Array;
  15685. /**
  15686. * Specifies the quality of terrain created from heightmaps. A value of 1.0 will
  15687. ensure that adjacent heightmap vertices are separated by no more than
  15688. {@link Globe.maximumScreenSpaceError} screen pixels and will probably go very slowly.
  15689. A value of 0.5 will cut the estimated level zero geometric error in half, allowing twice the
  15690. screen pixels between adjacent heightmap vertices and thus rendering more quickly.
  15691. */
  15692. static heightmapTerrainQuality: number;
  15693. /**
  15694. * Determines an appropriate geometric error estimate when the geometry comes from a heightmap.
  15695. * @param ellipsoid - The ellipsoid to which the terrain is attached.
  15696. * @param tileImageWidth - The width, in pixels, of the heightmap associated with a single tile.
  15697. * @param numberOfTilesAtLevelZero - The number of tiles in the horizontal direction at tile level zero.
  15698. * @returns An estimated geometric error.
  15699. */
  15700. static getEstimatedLevelZeroGeometricErrorForAHeightmap(ellipsoid: Ellipsoid, tileImageWidth: number, numberOfTilesAtLevelZero: number): number;
  15701. /**
  15702. * Requests the geometry for a given tile. This function should not be called before
  15703. {@link TerrainProvider#ready} returns true. The result must include terrain data and
  15704. may optionally include a water mask and an indication of which child tiles are available.
  15705. * @param x - The X coordinate of the tile for which to request geometry.
  15706. * @param y - The Y coordinate of the tile for which to request geometry.
  15707. * @param level - The level of the tile for which to request geometry.
  15708. * @param [request] - The request object. Intended for internal use only.
  15709. * @returns A promise for the requested geometry. If this method
  15710. returns undefined instead of a promise, it is an indication that too many requests are already
  15711. pending and the request will be retried later.
  15712. */
  15713. requestTileGeometry(x: number, y: number, level: number, request?: Request): Promise<TerrainData> | undefined;
  15714. /**
  15715. * Gets the maximum geometric error allowed in a tile at a given level. This function should not be
  15716. called before {@link TerrainProvider#ready} returns true.
  15717. * @param level - The tile level for which to get the maximum geometric error.
  15718. * @returns The maximum geometric error.
  15719. */
  15720. getLevelMaximumGeometricError(level: number): number;
  15721. /**
  15722. * Determines whether data for a tile is available to be loaded.
  15723. * @param x - The X coordinate of the tile for which to request geometry.
  15724. * @param y - The Y coordinate of the tile for which to request geometry.
  15725. * @param level - The level of the tile for which to request geometry.
  15726. * @returns Undefined if not supported by the terrain provider, otherwise true or false.
  15727. */
  15728. getTileDataAvailable(x: number, y: number, level: number): boolean;
  15729. /**
  15730. * Makes sure we load availability data for a tile
  15731. * @param x - The X coordinate of the tile for which to request geometry.
  15732. * @param y - The Y coordinate of the tile for which to request geometry.
  15733. * @param level - The level of the tile for which to request geometry.
  15734. * @returns Undefined if nothing need to be loaded or a Promise that resolves when all required tiles are loaded
  15735. */
  15736. loadTileDataAvailability(x: number, y: number, level: number): undefined | Promise<void>;
  15737. }
  15738. /**
  15739. * Reports the availability of tiles in a {@link TilingScheme}.
  15740. * @param tilingScheme - The tiling scheme in which to report availability.
  15741. * @param maximumLevel - The maximum tile level that is potentially available.
  15742. */
  15743. export class TileAvailability {
  15744. constructor(tilingScheme: TilingScheme, maximumLevel: number);
  15745. /**
  15746. * Marks a rectangular range of tiles in a particular level as being available. For best performance,
  15747. add your ranges in order of increasing level.
  15748. * @param level - The level.
  15749. * @param startX - The X coordinate of the first available tiles at the level.
  15750. * @param startY - The Y coordinate of the first available tiles at the level.
  15751. * @param endX - The X coordinate of the last available tiles at the level.
  15752. * @param endY - The Y coordinate of the last available tiles at the level.
  15753. */
  15754. addAvailableTileRange(level: number, startX: number, startY: number, endX: number, endY: number): void;
  15755. /**
  15756. * Determines the level of the most detailed tile covering the position. This function
  15757. usually completes in time logarithmic to the number of rectangles added with
  15758. {@link TileAvailability#addAvailableTileRange}.
  15759. * @param position - The position for which to determine the maximum available level. The height component is ignored.
  15760. * @returns The level of the most detailed tile covering the position.
  15761. */
  15762. computeMaximumLevelAtPosition(position: Cartographic): number;
  15763. /**
  15764. * Finds the most detailed level that is available _everywhere_ within a given rectangle. More detailed
  15765. tiles may be available in parts of the rectangle, but not the whole thing. The return value of this
  15766. function may be safely passed to {@link sampleTerrain} for any position within the rectangle. This function
  15767. usually completes in time logarithmic to the number of rectangles added with
  15768. {@link TileAvailability#addAvailableTileRange}.
  15769. * @param rectangle - The rectangle.
  15770. * @returns The best available level for the entire rectangle.
  15771. */
  15772. computeBestAvailableLevelOverRectangle(rectangle: Rectangle): number;
  15773. /**
  15774. * Determines if a particular tile is available.
  15775. * @param level - The tile level to check.
  15776. * @param x - The X coordinate of the tile to check.
  15777. * @param y - The Y coordinate of the tile to check.
  15778. * @returns True if the tile is available; otherwise, false.
  15779. */
  15780. isTileAvailable(level: number, x: number, y: number): boolean;
  15781. /**
  15782. * Computes a bit mask indicating which of a tile's four children exist.
  15783. If a child's bit is set, a tile is available for that child. If it is cleared,
  15784. the tile is not available. The bit values are as follows:
  15785. <table>
  15786. <tr><th>Bit Position</th><th>Bit Value</th><th>Child Tile</th></tr>
  15787. <tr><td>0</td><td>1</td><td>Southwest</td></tr>
  15788. <tr><td>1</td><td>2</td><td>Southeast</td></tr>
  15789. <tr><td>2</td><td>4</td><td>Northwest</td></tr>
  15790. <tr><td>3</td><td>8</td><td>Northeast</td></tr>
  15791. </table>
  15792. * @param level - The level of the parent tile.
  15793. * @param x - The X coordinate of the parent tile.
  15794. * @param y - The Y coordinate of the parent tile.
  15795. * @returns The bit mask indicating child availability.
  15796. */
  15797. computeChildMaskForTile(level: number, x: number, y: number): number;
  15798. }
  15799. /**
  15800. * Provides details about an error that occurred in an {@link ImageryProvider} or a {@link TerrainProvider}.
  15801. * @param provider - The imagery or terrain provider that experienced the error.
  15802. * @param message - A message describing the error.
  15803. * @param [x] - The X coordinate of the tile that experienced the error, or undefined if the error
  15804. is not specific to a particular tile.
  15805. * @param [y] - The Y coordinate of the tile that experienced the error, or undefined if the error
  15806. is not specific to a particular tile.
  15807. * @param [level] - The level of the tile that experienced the error, or undefined if the error
  15808. is not specific to a particular tile.
  15809. * @param [timesRetried = 0] - The number of times this operation has been retried.
  15810. * @param [error] - The error or exception that occurred, if any.
  15811. */
  15812. export class TileProviderError {
  15813. constructor(provider: ImageryProvider | TerrainProvider, message: string, x?: number, y?: number, level?: number, timesRetried?: number, error?: Error);
  15814. /**
  15815. * The {@link ImageryProvider} or {@link TerrainProvider} that experienced the error.
  15816. */
  15817. provider: ImageryProvider | TerrainProvider;
  15818. /**
  15819. * The message describing the error.
  15820. */
  15821. message: string;
  15822. /**
  15823. * The X coordinate of the tile that experienced the error. If the error is not specific
  15824. to a particular tile, this property will be undefined.
  15825. */
  15826. x: number;
  15827. /**
  15828. * The Y coordinate of the tile that experienced the error. If the error is not specific
  15829. to a particular tile, this property will be undefined.
  15830. */
  15831. y: number;
  15832. /**
  15833. * The level-of-detail of the tile that experienced the error. If the error is not specific
  15834. to a particular tile, this property will be undefined.
  15835. */
  15836. level: number;
  15837. /**
  15838. * The number of times this operation has been retried.
  15839. */
  15840. timesRetried: number;
  15841. /**
  15842. * True if the failed operation should be retried; otherwise, false. The imagery or terrain provider
  15843. will set the initial value of this property before raising the event, but any listeners
  15844. can change it. The value after the last listener is invoked will be acted upon.
  15845. */
  15846. retry: boolean;
  15847. /**
  15848. * The error or exception that occurred, if any.
  15849. */
  15850. error: Error;
  15851. /**
  15852. * Handles an error in an {@link ImageryProvider} or {@link TerrainProvider} by raising an event if it has any listeners, or by
  15853. logging the error to the console if the event has no listeners. This method also tracks the number
  15854. of times the operation has been retried and will automatically retry if requested to do so by the
  15855. event listeners.
  15856. * @param previousError - The error instance returned by this function the last
  15857. time it was called for this error, or undefined if this is the first time this error has
  15858. occurred.
  15859. * @param provider - The imagery or terrain provider that encountered the error.
  15860. * @param event - The event to raise to inform listeners of the error.
  15861. * @param message - The message describing the error.
  15862. * @param x - The X coordinate of the tile that experienced the error, or undefined if the
  15863. error is not specific to a particular tile.
  15864. * @param y - The Y coordinate of the tile that experienced the error, or undefined if the
  15865. error is not specific to a particular tile.
  15866. * @param level - The level-of-detail of the tile that experienced the error, or undefined if the
  15867. error is not specific to a particular tile.
  15868. * @param retryFunction - The function to call to retry the operation. If undefined, the
  15869. operation will not be retried.
  15870. * @param [errorDetails] - The error or exception that occurred, if any.
  15871. * @returns The error instance that was passed to the event listeners and that
  15872. should be passed to this function the next time it is called for the same error in order
  15873. to track retry counts.
  15874. */
  15875. static handleError(previousError: TileProviderError, provider: ImageryProvider | TerrainProvider, event: Event, message: string, x: number, y: number, level: number, retryFunction: TileProviderError.RetryFunction, errorDetails?: Error): TileProviderError;
  15876. /**
  15877. * Handles success of an operation by resetting the retry count of a previous error, if any. This way,
  15878. if the error occurs again in the future, the listeners will be informed that it has not yet been retried.
  15879. * @param previousError - The previous error, or undefined if this operation has
  15880. not previously resulted in an error.
  15881. */
  15882. static handleSuccess(previousError: TileProviderError): void;
  15883. }
  15884. export namespace TileProviderError {
  15885. /**
  15886. * A function that will be called to retry the operation.
  15887. */
  15888. type RetryFunction = () => void;
  15889. }
  15890. /**
  15891. * A tiling scheme for geometry or imagery on the surface of an ellipsoid. At level-of-detail zero,
  15892. the coarsest, least-detailed level, the number of tiles is configurable.
  15893. At level of detail one, each of the level zero tiles has four children, two in each direction.
  15894. At level of detail two, each of the level one tiles has four children, two in each direction.
  15895. This continues for as many levels as are present in the geometry or imagery source.
  15896. */
  15897. export class TilingScheme {
  15898. constructor();
  15899. /**
  15900. * Gets the ellipsoid that is tiled by the tiling scheme.
  15901. */
  15902. ellipsoid: Ellipsoid;
  15903. /**
  15904. * Gets the rectangle, in radians, covered by this tiling scheme.
  15905. */
  15906. rectangle: Rectangle;
  15907. /**
  15908. * Gets the map projection used by the tiling scheme.
  15909. */
  15910. projection: MapProjection;
  15911. /**
  15912. * Gets the total number of tiles in the X direction at a specified level-of-detail.
  15913. * @param level - The level-of-detail.
  15914. * @returns The number of tiles in the X direction at the given level.
  15915. */
  15916. getNumberOfXTilesAtLevel(level: number): number;
  15917. /**
  15918. * Gets the total number of tiles in the Y direction at a specified level-of-detail.
  15919. * @param level - The level-of-detail.
  15920. * @returns The number of tiles in the Y direction at the given level.
  15921. */
  15922. getNumberOfYTilesAtLevel(level: number): number;
  15923. /**
  15924. * Transforms a rectangle specified in geodetic radians to the native coordinate system
  15925. of this tiling scheme.
  15926. * @param rectangle - The rectangle to transform.
  15927. * @param [result] - The instance to which to copy the result, or undefined if a new instance
  15928. should be created.
  15929. * @returns The specified 'result', or a new object containing the native rectangle if 'result'
  15930. is undefined.
  15931. */
  15932. rectangleToNativeRectangle(rectangle: Rectangle, result?: Rectangle): Rectangle;
  15933. /**
  15934. * Converts tile x, y coordinates and level to a rectangle expressed in the native coordinates
  15935. of the tiling scheme.
  15936. * @param x - The integer x coordinate of the tile.
  15937. * @param y - The integer y coordinate of the tile.
  15938. * @param level - The tile level-of-detail. Zero is the least detailed.
  15939. * @param [result] - The instance to which to copy the result, or undefined if a new instance
  15940. should be created.
  15941. * @returns The specified 'result', or a new object containing the rectangle
  15942. if 'result' is undefined.
  15943. */
  15944. tileXYToNativeRectangle(x: number, y: number, level: number, result?: any): Rectangle;
  15945. /**
  15946. * Converts tile x, y coordinates and level to a cartographic rectangle in radians.
  15947. * @param x - The integer x coordinate of the tile.
  15948. * @param y - The integer y coordinate of the tile.
  15949. * @param level - The tile level-of-detail. Zero is the least detailed.
  15950. * @param [result] - The instance to which to copy the result, or undefined if a new instance
  15951. should be created.
  15952. * @returns The specified 'result', or a new object containing the rectangle
  15953. if 'result' is undefined.
  15954. */
  15955. tileXYToRectangle(x: number, y: number, level: number, result?: any): Rectangle;
  15956. /**
  15957. * Calculates the tile x, y coordinates of the tile containing
  15958. a given cartographic position.
  15959. * @param position - The position.
  15960. * @param level - The tile level-of-detail. Zero is the least detailed.
  15961. * @param [result] - The instance to which to copy the result, or undefined if a new instance
  15962. should be created.
  15963. * @returns The specified 'result', or a new object containing the tile x, y coordinates
  15964. if 'result' is undefined.
  15965. */
  15966. positionToTileXY(position: Cartographic, level: number, result?: Cartesian2): Cartesian2;
  15967. }
  15968. /**
  15969. * An interval defined by a start and a stop time; optionally including those times as part of the interval.
  15970. Arbitrary data can optionally be associated with each instance for used with {@link TimeIntervalCollection}.
  15971. * @example
  15972. * // Create an instance that spans August 1st, 1980 and is associated
  15973. // with a Cartesian position.
  15974. var timeInterval = new Cesium.TimeInterval({
  15975. start : Cesium.JulianDate.fromIso8601('1980-08-01T00:00:00Z'),
  15976. stop : Cesium.JulianDate.fromIso8601('1980-08-02T00:00:00Z'),
  15977. isStartIncluded : true,
  15978. isStopIncluded : false,
  15979. data : Cesium.Cartesian3.fromDegrees(39.921037, -75.170082)
  15980. });
  15981. * @example
  15982. * // Create two instances from ISO 8601 intervals with associated numeric data
  15983. // then compute their intersection, summing the data they contain.
  15984. var left = Cesium.TimeInterval.fromIso8601({
  15985. iso8601 : '2000/2010',
  15986. data : 2
  15987. });
  15988. var right = Cesium.TimeInterval.fromIso8601({
  15989. iso8601 : '1995/2005',
  15990. data : 3
  15991. });
  15992. //The result of the below intersection will be an interval equivalent to
  15993. //var intersection = Cesium.TimeInterval.fromIso8601({
  15994. // iso8601 : '2000/2005',
  15995. // data : 5
  15996. //});
  15997. var intersection = new Cesium.TimeInterval();
  15998. Cesium.TimeInterval.intersect(left, right, intersection, function(leftData, rightData) {
  15999. return leftData + rightData;
  16000. });
  16001. * @example
  16002. * // Check if an interval contains a specific time.
  16003. var dateToCheck = Cesium.JulianDate.fromIso8601('1982-09-08T11:30:00Z');
  16004. var containsDate = Cesium.TimeInterval.contains(timeInterval, dateToCheck);
  16005. * @param [options] - Object with the following properties:
  16006. * @param [options.start = new JulianDate()] - The start time of the interval.
  16007. * @param [options.stop = new JulianDate()] - The stop time of the interval.
  16008. * @param [options.isStartIncluded = true] - <code>true</code> if <code>options.start</code> is included in the interval, <code>false</code> otherwise.
  16009. * @param [options.isStopIncluded = true] - <code>true</code> if <code>options.stop</code> is included in the interval, <code>false</code> otherwise.
  16010. * @param [options.data] - Arbitrary data associated with this interval.
  16011. */
  16012. export class TimeInterval {
  16013. constructor(options?: {
  16014. start?: JulianDate;
  16015. stop?: JulianDate;
  16016. isStartIncluded?: boolean;
  16017. isStopIncluded?: boolean;
  16018. data?: any;
  16019. });
  16020. /**
  16021. * Gets or sets the start time of this interval.
  16022. */
  16023. start: JulianDate;
  16024. /**
  16025. * Gets or sets the stop time of this interval.
  16026. */
  16027. stop: JulianDate;
  16028. /**
  16029. * Gets or sets the data associated with this interval.
  16030. */
  16031. data: any;
  16032. /**
  16033. * Gets or sets whether or not the start time is included in this interval.
  16034. */
  16035. isStartIncluded: boolean;
  16036. /**
  16037. * Gets or sets whether or not the stop time is included in this interval.
  16038. */
  16039. isStopIncluded: boolean;
  16040. /**
  16041. * Gets whether or not this interval is empty.
  16042. */
  16043. readonly isEmpty: boolean;
  16044. /**
  16045. * Creates a new instance from a {@link http://en.wikipedia.org/wiki/ISO_8601|ISO 8601} interval.
  16046. * @param options - Object with the following properties:
  16047. * @param options.iso8601 - An ISO 8601 interval.
  16048. * @param [options.isStartIncluded = true] - <code>true</code> if <code>options.start</code> is included in the interval, <code>false</code> otherwise.
  16049. * @param [options.isStopIncluded = true] - <code>true</code> if <code>options.stop</code> is included in the interval, <code>false</code> otherwise.
  16050. * @param [options.data] - Arbitrary data associated with this interval.
  16051. * @param [result] - An existing instance to use for the result.
  16052. * @returns The modified result parameter or a new instance if none was provided.
  16053. */
  16054. static fromIso8601(options: {
  16055. iso8601: string;
  16056. isStartIncluded?: boolean;
  16057. isStopIncluded?: boolean;
  16058. data?: any;
  16059. }, result?: TimeInterval): TimeInterval;
  16060. /**
  16061. * Creates an ISO8601 representation of the provided interval.
  16062. * @param timeInterval - The interval to be converted.
  16063. * @param [precision] - The number of fractional digits used to represent the seconds component. By default, the most precise representation is used.
  16064. * @returns The ISO8601 representation of the provided interval.
  16065. */
  16066. static toIso8601(timeInterval: TimeInterval, precision?: number): string;
  16067. /**
  16068. * Duplicates the provided instance.
  16069. * @param [timeInterval] - The instance to clone.
  16070. * @param [result] - An existing instance to use for the result.
  16071. * @returns The modified result parameter or a new instance if none was provided.
  16072. */
  16073. static clone(timeInterval?: TimeInterval, result?: TimeInterval): TimeInterval;
  16074. /**
  16075. * Compares two instances and returns <code>true</code> if they are equal, <code>false</code> otherwise.
  16076. * @param [left] - The first instance.
  16077. * @param [right] - The second instance.
  16078. * @param [dataComparer] - A function which compares the data of the two intervals. If omitted, reference equality is used.
  16079. * @returns <code>true</code> if the dates are equal; otherwise, <code>false</code>.
  16080. */
  16081. static equals(left?: TimeInterval, right?: TimeInterval, dataComparer?: TimeInterval.DataComparer): boolean;
  16082. /**
  16083. * Compares two instances and returns <code>true</code> if they are within <code>epsilon</code> seconds of
  16084. each other. That is, in order for the dates to be considered equal (and for
  16085. this function to return <code>true</code>), the absolute value of the difference between them, in
  16086. seconds, must be less than <code>epsilon</code>.
  16087. * @param [left] - The first instance.
  16088. * @param [right] - The second instance.
  16089. * @param [epsilon = 0] - The maximum number of seconds that should separate the two instances.
  16090. * @param [dataComparer] - A function which compares the data of the two intervals. If omitted, reference equality is used.
  16091. * @returns <code>true</code> if the two dates are within <code>epsilon</code> seconds of each other; otherwise <code>false</code>.
  16092. */
  16093. static equalsEpsilon(left?: TimeInterval, right?: TimeInterval, epsilon?: number, dataComparer?: TimeInterval.DataComparer): boolean;
  16094. /**
  16095. * Computes the intersection of two intervals, optionally merging their data.
  16096. * @param left - The first interval.
  16097. * @param [right] - The second interval.
  16098. * @param [result] - An existing instance to use for the result.
  16099. * @param [mergeCallback] - A function which merges the data of the two intervals. If omitted, the data from the left interval will be used.
  16100. * @returns The modified result parameter.
  16101. */
  16102. static intersect(left: TimeInterval, right?: TimeInterval, result?: TimeInterval, mergeCallback?: TimeInterval.MergeCallback): TimeInterval;
  16103. /**
  16104. * Checks if the specified date is inside the provided interval.
  16105. * @param timeInterval - The interval.
  16106. * @param julianDate - The date to check.
  16107. * @returns <code>true</code> if the interval contains the specified date, <code>false</code> otherwise.
  16108. */
  16109. static contains(timeInterval: TimeInterval, julianDate: JulianDate): boolean;
  16110. /**
  16111. * Duplicates this instance.
  16112. * @param [result] - An existing instance to use for the result.
  16113. * @returns The modified result parameter or a new instance if none was provided.
  16114. */
  16115. clone(result?: TimeInterval): TimeInterval;
  16116. /**
  16117. * Compares this instance against the provided instance componentwise and returns
  16118. <code>true</code> if they are equal, <code>false</code> otherwise.
  16119. * @param [right] - The right hand side interval.
  16120. * @param [dataComparer] - A function which compares the data of the two intervals. If omitted, reference equality is used.
  16121. * @returns <code>true</code> if they are equal, <code>false</code> otherwise.
  16122. */
  16123. equals(right?: TimeInterval, dataComparer?: TimeInterval.DataComparer): boolean;
  16124. /**
  16125. * Compares this instance against the provided instance componentwise and returns
  16126. <code>true</code> if they are within the provided epsilon,
  16127. <code>false</code> otherwise.
  16128. * @param [right] - The right hand side interval.
  16129. * @param [epsilon = 0] - The epsilon to use for equality testing.
  16130. * @param [dataComparer] - A function which compares the data of the two intervals. If omitted, reference equality is used.
  16131. * @returns <code>true</code> if they are within the provided epsilon, <code>false</code> otherwise.
  16132. */
  16133. equalsEpsilon(right?: TimeInterval, epsilon?: number, dataComparer?: TimeInterval.DataComparer): boolean;
  16134. /**
  16135. * Creates a string representing this TimeInterval in ISO8601 format.
  16136. * @returns A string representing this TimeInterval in ISO8601 format.
  16137. */
  16138. toString(): string;
  16139. /**
  16140. * An immutable empty interval.
  16141. */
  16142. static readonly EMPTY: TimeInterval;
  16143. }
  16144. export namespace TimeInterval {
  16145. /**
  16146. * Function interface for merging interval data.
  16147. * @param leftData - The first data instance.
  16148. * @param rightData - The second data instance.
  16149. */
  16150. type MergeCallback = (leftData: any, rightData: any) => any;
  16151. /**
  16152. * Function interface for comparing interval data.
  16153. * @param leftData - The first data instance.
  16154. * @param rightData - The second data instance.
  16155. */
  16156. type DataComparer = (leftData: any, rightData: any) => boolean;
  16157. }
  16158. /**
  16159. * A non-overlapping collection of {@link TimeInterval} instances sorted by start time.
  16160. * @param [intervals] - An array of intervals to add to the collection.
  16161. */
  16162. export class TimeIntervalCollection {
  16163. constructor(intervals?: TimeInterval[]);
  16164. /**
  16165. * Gets an event that is raised whenever the collection of intervals change.
  16166. */
  16167. readonly changedEvent: Event;
  16168. /**
  16169. * Gets the start time of the collection.
  16170. */
  16171. readonly start: JulianDate;
  16172. /**
  16173. * Gets whether or not the start time is included in the collection.
  16174. */
  16175. readonly isStartIncluded: boolean;
  16176. /**
  16177. * Gets the stop time of the collection.
  16178. */
  16179. readonly stop: JulianDate;
  16180. /**
  16181. * Gets whether or not the stop time is included in the collection.
  16182. */
  16183. readonly isStopIncluded: boolean;
  16184. /**
  16185. * Gets the number of intervals in the collection.
  16186. */
  16187. readonly length: number;
  16188. /**
  16189. * Gets whether or not the collection is empty.
  16190. */
  16191. readonly isEmpty: boolean;
  16192. /**
  16193. * Compares this instance against the provided instance componentwise and returns
  16194. <code>true</code> if they are equal, <code>false</code> otherwise.
  16195. * @param [right] - The right hand side collection.
  16196. * @param [dataComparer] - A function which compares the data of the two intervals. If omitted, reference equality is used.
  16197. * @returns <code>true</code> if they are equal, <code>false</code> otherwise.
  16198. */
  16199. equals(right?: TimeIntervalCollection, dataComparer?: TimeInterval.DataComparer): boolean;
  16200. /**
  16201. * Gets the interval at the specified index.
  16202. * @param index - The index of the interval to retrieve.
  16203. * @returns The interval at the specified index, or <code>undefined</code> if no interval exists as that index.
  16204. */
  16205. get(index: number): TimeInterval | undefined;
  16206. /**
  16207. * Removes all intervals from the collection.
  16208. */
  16209. removeAll(): void;
  16210. /**
  16211. * Finds and returns the interval that contains the specified date.
  16212. * @param date - The date to search for.
  16213. * @returns The interval containing the specified date, <code>undefined</code> if no such interval exists.
  16214. */
  16215. findIntervalContainingDate(date: JulianDate): TimeInterval | undefined;
  16216. /**
  16217. * Finds and returns the data for the interval that contains the specified date.
  16218. * @param date - The date to search for.
  16219. * @returns The data for the interval containing the specified date, or <code>undefined</code> if no such interval exists.
  16220. */
  16221. findDataForIntervalContainingDate(date: JulianDate): any;
  16222. /**
  16223. * Checks if the specified date is inside this collection.
  16224. * @param julianDate - The date to check.
  16225. * @returns <code>true</code> if the collection contains the specified date, <code>false</code> otherwise.
  16226. */
  16227. contains(julianDate: JulianDate): boolean;
  16228. /**
  16229. * Finds and returns the index of the interval in the collection that contains the specified date.
  16230. * @param date - The date to search for.
  16231. * @returns The index of the interval that contains the specified date, if no such interval exists,
  16232. it returns a negative number which is the bitwise complement of the index of the next interval that
  16233. starts after the date, or if no interval starts after the specified date, the bitwise complement of
  16234. the length of the collection.
  16235. */
  16236. indexOf(date: JulianDate): number;
  16237. /**
  16238. * Returns the first interval in the collection that matches the specified parameters.
  16239. All parameters are optional and <code>undefined</code> parameters are treated as a don't care condition.
  16240. * @param [options] - Object with the following properties:
  16241. * @param [options.start] - The start time of the interval.
  16242. * @param [options.stop] - The stop time of the interval.
  16243. * @param [options.isStartIncluded] - <code>true</code> if <code>options.start</code> is included in the interval, <code>false</code> otherwise.
  16244. * @param [options.isStopIncluded] - <code>true</code> if <code>options.stop</code> is included in the interval, <code>false</code> otherwise.
  16245. * @returns The first interval in the collection that matches the specified parameters.
  16246. */
  16247. findInterval(options?: {
  16248. start?: JulianDate;
  16249. stop?: JulianDate;
  16250. isStartIncluded?: boolean;
  16251. isStopIncluded?: boolean;
  16252. }): TimeInterval | undefined;
  16253. /**
  16254. * Adds an interval to the collection, merging intervals that contain the same data and
  16255. splitting intervals of different data as needed in order to maintain a non-overlapping collection.
  16256. The data in the new interval takes precedence over any existing intervals in the collection.
  16257. * @param interval - The interval to add.
  16258. * @param [dataComparer] - A function which compares the data of the two intervals. If omitted, reference equality is used.
  16259. */
  16260. addInterval(interval: TimeInterval, dataComparer?: TimeInterval.DataComparer): void;
  16261. /**
  16262. * Removes the specified interval from this interval collection, creating a hole over the specified interval.
  16263. The data property of the input interval is ignored.
  16264. * @param interval - The interval to remove.
  16265. * @returns <code>true</code> if the interval was removed, <code>false</code> if no part of the interval was in the collection.
  16266. */
  16267. removeInterval(interval: TimeInterval): boolean;
  16268. /**
  16269. * Creates a new instance that is the intersection of this collection and the provided collection.
  16270. * @param other - The collection to intersect with.
  16271. * @param [dataComparer] - A function which compares the data of the two intervals. If omitted, reference equality is used.
  16272. * @param [mergeCallback] - A function which merges the data of the two intervals. If omitted, the data from the left interval will be used.
  16273. * @returns A new TimeIntervalCollection which is the intersection of this collection and the provided collection.
  16274. */
  16275. intersect(other: TimeIntervalCollection, dataComparer?: TimeInterval.DataComparer, mergeCallback?: TimeInterval.MergeCallback): TimeIntervalCollection;
  16276. /**
  16277. * Creates a new instance from a JulianDate array.
  16278. * @param options - Object with the following properties:
  16279. * @param options.julianDates - An array of ISO 8601 dates.
  16280. * @param [options.isStartIncluded = true] - <code>true</code> if start time is included in the interval, <code>false</code> otherwise.
  16281. * @param [options.isStopIncluded = true] - <code>true</code> if stop time is included in the interval, <code>false</code> otherwise.
  16282. * @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.
  16283. * @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.
  16284. * @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.
  16285. * @param [result] - An existing instance to use for the result.
  16286. * @returns The modified result parameter or a new instance if none was provided.
  16287. */
  16288. static fromJulianDateArray(options: {
  16289. julianDates: JulianDate[];
  16290. isStartIncluded?: boolean;
  16291. isStopIncluded?: boolean;
  16292. leadingInterval?: boolean;
  16293. trailingInterval?: boolean;
  16294. dataCallback?: (...params: any[]) => any;
  16295. }, result?: TimeIntervalCollection): TimeIntervalCollection;
  16296. /**
  16297. * Creates a new instance from an {@link http://en.wikipedia.org/wiki/ISO_8601|ISO 8601} time interval (start/end/duration).
  16298. * @param options - Object with the following properties:
  16299. * @param options.iso8601 - An ISO 8601 interval.
  16300. * @param [options.isStartIncluded = true] - <code>true</code> if start time is included in the interval, <code>false</code> otherwise.
  16301. * @param [options.isStopIncluded = true] - <code>true</code> if stop time is included in the interval, <code>false</code> otherwise.
  16302. * @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.
  16303. * @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.
  16304. * @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.
  16305. * @param [result] - An existing instance to use for the result.
  16306. * @returns The modified result parameter or a new instance if none was provided.
  16307. */
  16308. static fromIso8601(options: {
  16309. iso8601: string;
  16310. isStartIncluded?: boolean;
  16311. isStopIncluded?: boolean;
  16312. leadingInterval?: boolean;
  16313. trailingInterval?: boolean;
  16314. dataCallback?: (...params: any[]) => any;
  16315. }, result?: TimeIntervalCollection): TimeIntervalCollection;
  16316. /**
  16317. * Creates a new instance from a {@link http://en.wikipedia.org/wiki/ISO_8601|ISO 8601} date array.
  16318. * @param options - Object with the following properties:
  16319. * @param options.iso8601Dates - An array of ISO 8601 dates.
  16320. * @param [options.isStartIncluded = true] - <code>true</code> if start time is included in the interval, <code>false</code> otherwise.
  16321. * @param [options.isStopIncluded = true] - <code>true</code> if stop time is included in the interval, <code>false</code> otherwise.
  16322. * @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.
  16323. * @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.
  16324. * @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.
  16325. * @param [result] - An existing instance to use for the result.
  16326. * @returns The modified result parameter or a new instance if none was provided.
  16327. */
  16328. static fromIso8601DateArray(options: {
  16329. iso8601Dates: string[];
  16330. isStartIncluded?: boolean;
  16331. isStopIncluded?: boolean;
  16332. leadingInterval?: boolean;
  16333. trailingInterval?: boolean;
  16334. dataCallback?: (...params: any[]) => any;
  16335. }, result?: TimeIntervalCollection): TimeIntervalCollection;
  16336. /**
  16337. * Creates a new instance from a {@link http://en.wikipedia.org/wiki/ISO_8601|ISO 8601} duration array.
  16338. * @param options - Object with the following properties:
  16339. * @param options.epoch - An date that the durations are relative to.
  16340. * @param options.iso8601Durations - An array of ISO 8601 durations.
  16341. * @param [options.relativeToPrevious = false] - <code>true</code> if durations are relative to previous date, <code>false</code> if always relative to the epoch.
  16342. * @param [options.isStartIncluded = true] - <code>true</code> if start time is included in the interval, <code>false</code> otherwise.
  16343. * @param [options.isStopIncluded = true] - <code>true</code> if stop time is included in the interval, <code>false</code> otherwise.
  16344. * @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.
  16345. * @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.
  16346. * @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.
  16347. * @param [result] - An existing instance to use for the result.
  16348. * @returns The modified result parameter or a new instance if none was provided.
  16349. */
  16350. static fromIso8601DurationArray(options: {
  16351. epoch: JulianDate;
  16352. iso8601Durations: string;
  16353. relativeToPrevious?: boolean;
  16354. isStartIncluded?: boolean;
  16355. isStopIncluded?: boolean;
  16356. leadingInterval?: boolean;
  16357. trailingInterval?: boolean;
  16358. dataCallback?: (...params: any[]) => any;
  16359. }, result?: TimeIntervalCollection): TimeIntervalCollection;
  16360. }
  16361. /**
  16362. * Provides the type of time standards which JulianDate can take as input.
  16363. */
  16364. export enum TimeStandard {
  16365. /**
  16366. * Represents the coordinated Universal Time (UTC) time standard.
  16367. UTC is related to TAI according to the relationship
  16368. <code>UTC = TAI - deltaT</code> where <code>deltaT</code> is the number of leap
  16369. seconds which have been introduced as of the time in TAI.
  16370. */
  16371. UTC = 0,
  16372. /**
  16373. * Represents the International Atomic Time (TAI) time standard.
  16374. TAI is the principal time standard to which the other time standards are related.
  16375. */
  16376. TAI = 1
  16377. }
  16378. /**
  16379. * Contains functions for transforming positions to various reference frames.
  16380. */
  16381. export namespace Transforms {
  16382. /**
  16383. * Generates a function that computes a 4x4 transformation matrix from a reference frame
  16384. centered at the provided origin to the provided ellipsoid's fixed reference frame.
  16385. * @param firstAxis - name of the first axis of the local reference frame. Must be
  16386. 'east', 'north', 'up', 'west', 'south' or 'down'.
  16387. * @param secondAxis - name of the second axis of the local reference frame. Must be
  16388. 'east', 'north', 'up', 'west', 'south' or 'down'.
  16389. * @returns The function that will computes a
  16390. 4x4 transformation matrix from a reference frame, with first axis and second axis compliant with the parameters,
  16391. */
  16392. function localFrameToFixedFrameGenerator(firstAxis: string, secondAxis: string): Transforms.LocalFrameToFixedFrame;
  16393. /**
  16394. * Computes a 4x4 transformation matrix from a reference frame
  16395. centered at the provided origin to the provided ellipsoid's fixed reference frame.
  16396. * @param origin - The center point of the local reference frame.
  16397. * @param [ellipsoid = Ellipsoid.WGS84] - The ellipsoid whose fixed frame is used in the transformation.
  16398. * @param [result] - The object onto which to store the result.
  16399. */
  16400. type LocalFrameToFixedFrame = (origin: Cartesian3, ellipsoid?: Ellipsoid, result?: Matrix4) => Matrix4;
  16401. /**
  16402. * Computes a 4x4 transformation matrix from a reference frame with an east-north-up axes
  16403. centered at the provided origin to the provided ellipsoid's fixed reference frame.
  16404. The local axes are defined as:
  16405. <ul>
  16406. <li>The <code>x</code> axis points in the local east direction.</li>
  16407. <li>The <code>y</code> axis points in the local north direction.</li>
  16408. <li>The <code>z</code> axis points in the direction of the ellipsoid surface normal which passes through the position.</li>
  16409. </ul>
  16410. * @example
  16411. * // Get the transform from local east-north-up at cartographic (0.0, 0.0) to Earth's fixed frame.
  16412. var center = Cesium.Cartesian3.fromDegrees(0.0, 0.0);
  16413. var transform = Cesium.Transforms.eastNorthUpToFixedFrame(center);
  16414. * @param origin - The center point of the local reference frame.
  16415. * @param [ellipsoid = Ellipsoid.WGS84] - The ellipsoid whose fixed frame is used in the transformation.
  16416. * @param [result] - The object onto which to store the result.
  16417. * @returns The modified result parameter or a new Matrix4 instance if none was provided.
  16418. */
  16419. function eastNorthUpToFixedFrame(origin: Cartesian3, ellipsoid?: Ellipsoid, result?: Matrix4): Matrix4;
  16420. /**
  16421. * Computes a 4x4 transformation matrix from a reference frame with an north-east-down axes
  16422. centered at the provided origin to the provided ellipsoid's fixed reference frame.
  16423. The local axes are defined as:
  16424. <ul>
  16425. <li>The <code>x</code> axis points in the local north direction.</li>
  16426. <li>The <code>y</code> axis points in the local east direction.</li>
  16427. <li>The <code>z</code> axis points in the opposite direction of the ellipsoid surface normal which passes through the position.</li>
  16428. </ul>
  16429. * @example
  16430. * // Get the transform from local north-east-down at cartographic (0.0, 0.0) to Earth's fixed frame.
  16431. var center = Cesium.Cartesian3.fromDegrees(0.0, 0.0);
  16432. var transform = Cesium.Transforms.northEastDownToFixedFrame(center);
  16433. * @param origin - The center point of the local reference frame.
  16434. * @param [ellipsoid = Ellipsoid.WGS84] - The ellipsoid whose fixed frame is used in the transformation.
  16435. * @param [result] - The object onto which to store the result.
  16436. * @returns The modified result parameter or a new Matrix4 instance if none was provided.
  16437. */
  16438. function northEastDownToFixedFrame(origin: Cartesian3, ellipsoid?: Ellipsoid, result?: Matrix4): Matrix4;
  16439. /**
  16440. * Computes a 4x4 transformation matrix from a reference frame with an north-up-east axes
  16441. centered at the provided origin to the provided ellipsoid's fixed reference frame.
  16442. The local axes are defined as:
  16443. <ul>
  16444. <li>The <code>x</code> axis points in the local north direction.</li>
  16445. <li>The <code>y</code> axis points in the direction of the ellipsoid surface normal which passes through the position.</li>
  16446. <li>The <code>z</code> axis points in the local east direction.</li>
  16447. </ul>
  16448. * @example
  16449. * // Get the transform from local north-up-east at cartographic (0.0, 0.0) to Earth's fixed frame.
  16450. var center = Cesium.Cartesian3.fromDegrees(0.0, 0.0);
  16451. var transform = Cesium.Transforms.northUpEastToFixedFrame(center);
  16452. * @param origin - The center point of the local reference frame.
  16453. * @param [ellipsoid = Ellipsoid.WGS84] - The ellipsoid whose fixed frame is used in the transformation.
  16454. * @param [result] - The object onto which to store the result.
  16455. * @returns The modified result parameter or a new Matrix4 instance if none was provided.
  16456. */
  16457. function northUpEastToFixedFrame(origin: Cartesian3, ellipsoid?: Ellipsoid, result?: Matrix4): Matrix4;
  16458. /**
  16459. * Computes a 4x4 transformation matrix from a reference frame with an north-west-up axes
  16460. centered at the provided origin to the provided ellipsoid's fixed reference frame.
  16461. The local axes are defined as:
  16462. <ul>
  16463. <li>The <code>x</code> axis points in the local north direction.</li>
  16464. <li>The <code>y</code> axis points in the local west direction.</li>
  16465. <li>The <code>z</code> axis points in the direction of the ellipsoid surface normal which passes through the position.</li>
  16466. </ul>
  16467. * @example
  16468. * // Get the transform from local north-West-Up at cartographic (0.0, 0.0) to Earth's fixed frame.
  16469. var center = Cesium.Cartesian3.fromDegrees(0.0, 0.0);
  16470. var transform = Cesium.Transforms.northWestUpToFixedFrame(center);
  16471. * @param origin - The center point of the local reference frame.
  16472. * @param [ellipsoid = Ellipsoid.WGS84] - The ellipsoid whose fixed frame is used in the transformation.
  16473. * @param [result] - The object onto which to store the result.
  16474. * @returns The modified result parameter or a new Matrix4 instance if none was provided.
  16475. */
  16476. function northWestUpToFixedFrame(origin: Cartesian3, ellipsoid?: Ellipsoid, result?: Matrix4): Matrix4;
  16477. /**
  16478. * Computes a 4x4 transformation matrix from a reference frame with axes computed from the heading-pitch-roll angles
  16479. centered at the provided origin to the provided ellipsoid's fixed reference frame. Heading is the rotation from the local north
  16480. direction where a positive angle is increasing eastward. Pitch is the rotation from the local east-north plane. Positive pitch angles
  16481. are above the plane. Negative pitch angles are below the plane. Roll is the first rotation applied about the local east axis.
  16482. * @example
  16483. * // Get the transform from local heading-pitch-roll at cartographic (0.0, 0.0) to Earth's fixed frame.
  16484. var center = Cesium.Cartesian3.fromDegrees(0.0, 0.0);
  16485. var heading = -Cesium.Math.PI_OVER_TWO;
  16486. var pitch = Cesium.Math.PI_OVER_FOUR;
  16487. var roll = 0.0;
  16488. var hpr = new Cesium.HeadingPitchRoll(heading, pitch, roll);
  16489. var transform = Cesium.Transforms.headingPitchRollToFixedFrame(center, hpr);
  16490. * @param origin - The center point of the local reference frame.
  16491. * @param headingPitchRoll - The heading, pitch, and roll.
  16492. * @param [ellipsoid = Ellipsoid.WGS84] - The ellipsoid whose fixed frame is used in the transformation.
  16493. * @param [fixedFrameTransform = Transforms.eastNorthUpToFixedFrame] - A 4x4 transformation
  16494. matrix from a reference frame to the provided ellipsoid's fixed reference frame
  16495. * @param [result] - The object onto which to store the result.
  16496. * @returns The modified result parameter or a new Matrix4 instance if none was provided.
  16497. */
  16498. function headingPitchRollToFixedFrame(origin: Cartesian3, headingPitchRoll: HeadingPitchRoll, ellipsoid?: Ellipsoid, fixedFrameTransform?: Transforms.LocalFrameToFixedFrame, result?: Matrix4): Matrix4;
  16499. /**
  16500. * Computes a quaternion from a reference frame with axes computed from the heading-pitch-roll angles
  16501. centered at the provided origin. Heading is the rotation from the local north
  16502. direction where a positive angle is increasing eastward. Pitch is the rotation from the local east-north plane. Positive pitch angles
  16503. are above the plane. Negative pitch angles are below the plane. Roll is the first rotation applied about the local east axis.
  16504. * @example
  16505. * // Get the quaternion from local heading-pitch-roll at cartographic (0.0, 0.0) to Earth's fixed frame.
  16506. var center = Cesium.Cartesian3.fromDegrees(0.0, 0.0);
  16507. var heading = -Cesium.Math.PI_OVER_TWO;
  16508. var pitch = Cesium.Math.PI_OVER_FOUR;
  16509. var roll = 0.0;
  16510. var hpr = new HeadingPitchRoll(heading, pitch, roll);
  16511. var quaternion = Cesium.Transforms.headingPitchRollQuaternion(center, hpr);
  16512. * @param origin - The center point of the local reference frame.
  16513. * @param headingPitchRoll - The heading, pitch, and roll.
  16514. * @param [ellipsoid = Ellipsoid.WGS84] - The ellipsoid whose fixed frame is used in the transformation.
  16515. * @param [fixedFrameTransform = Transforms.eastNorthUpToFixedFrame] - A 4x4 transformation
  16516. matrix from a reference frame to the provided ellipsoid's fixed reference frame
  16517. * @param [result] - The object onto which to store the result.
  16518. * @returns The modified result parameter or a new Quaternion instance if none was provided.
  16519. */
  16520. function headingPitchRollQuaternion(origin: Cartesian3, headingPitchRoll: HeadingPitchRoll, ellipsoid?: Ellipsoid, fixedFrameTransform?: Transforms.LocalFrameToFixedFrame, result?: Quaternion): Quaternion;
  16521. /**
  16522. * Computes heading-pitch-roll angles from a transform in a particular reference frame. Heading is the rotation from the local north
  16523. direction where a positive angle is increasing eastward. Pitch is the rotation from the local east-north plane. Positive pitch angles
  16524. are above the plane. Negative pitch angles are below the plane. Roll is the first rotation applied about the local east axis.
  16525. * @param transform - The transform
  16526. * @param [ellipsoid = Ellipsoid.WGS84] - The ellipsoid whose fixed frame is used in the transformation.
  16527. * @param [fixedFrameTransform = Transforms.eastNorthUpToFixedFrame] - A 4x4 transformation
  16528. matrix from a reference frame to the provided ellipsoid's fixed reference frame
  16529. * @param [result] - The object onto which to store the result.
  16530. * @returns The modified result parameter or a new HeadingPitchRoll instance if none was provided.
  16531. */
  16532. function fixedFrameToHeadingPitchRoll(transform: Matrix4, ellipsoid?: Ellipsoid, fixedFrameTransform?: Transforms.LocalFrameToFixedFrame, result?: HeadingPitchRoll): HeadingPitchRoll;
  16533. /**
  16534. * Computes a rotation matrix to transform a point or vector from True Equator Mean Equinox (TEME) axes to the
  16535. pseudo-fixed axes at a given time. This method treats the UT1 time standard as equivalent to UTC.
  16536. * @example
  16537. * //Set the view to the inertial frame.
  16538. scene.postUpdate.addEventListener(function(scene, time) {
  16539. var now = Cesium.JulianDate.now();
  16540. var offset = Cesium.Matrix4.multiplyByPoint(camera.transform, camera.position, new Cesium.Cartesian3());
  16541. var transform = Cesium.Matrix4.fromRotationTranslation(Cesium.Transforms.computeTemeToPseudoFixedMatrix(now));
  16542. var inverseTransform = Cesium.Matrix4.inverseTransformation(transform, new Cesium.Matrix4());
  16543. Cesium.Matrix4.multiplyByPoint(inverseTransform, offset, offset);
  16544. camera.lookAtTransform(transform, offset);
  16545. });
  16546. * @param date - The time at which to compute the rotation matrix.
  16547. * @param [result] - The object onto which to store the result.
  16548. * @returns The modified result parameter or a new Matrix3 instance if none was provided.
  16549. */
  16550. function computeTemeToPseudoFixedMatrix(date: JulianDate, result?: Matrix3): Matrix3;
  16551. /**
  16552. * Preloads the data necessary to transform between the ICRF and Fixed axes, in either
  16553. direction, over a given interval. This function returns a promise that, when resolved,
  16554. indicates that the preload has completed.
  16555. * @example
  16556. * var interval = new Cesium.TimeInterval(...);
  16557. when(Cesium.Transforms.preloadIcrfFixed(interval), function() {
  16558. // the data is now loaded
  16559. });
  16560. * @param timeInterval - The interval to preload.
  16561. * @returns A promise that, when resolved, indicates that the preload has completed
  16562. and evaluation of the transformation between the fixed and ICRF axes will
  16563. no longer return undefined for a time inside the interval.
  16564. */
  16565. function preloadIcrfFixed(timeInterval: TimeInterval): Promise<void>;
  16566. /**
  16567. * Computes a rotation matrix to transform a point or vector from the International Celestial
  16568. Reference Frame (GCRF/ICRF) inertial frame axes to the Earth-Fixed frame axes (ITRF)
  16569. at a given time. This function may return undefined if the data necessary to
  16570. do the transformation is not yet loaded.
  16571. * @example
  16572. * scene.postUpdate.addEventListener(function(scene, time) {
  16573. // View in ICRF.
  16574. var icrfToFixed = Cesium.Transforms.computeIcrfToFixedMatrix(time);
  16575. if (Cesium.defined(icrfToFixed)) {
  16576. var offset = Cesium.Cartesian3.clone(camera.position);
  16577. var transform = Cesium.Matrix4.fromRotationTranslation(icrfToFixed);
  16578. camera.lookAtTransform(transform, offset);
  16579. }
  16580. });
  16581. * @param date - The time at which to compute the rotation matrix.
  16582. * @param [result] - The object onto which to store the result. If this parameter is
  16583. not specified, a new instance is created and returned.
  16584. * @returns The rotation matrix, or undefined if the data necessary to do the
  16585. transformation is not yet loaded.
  16586. */
  16587. function computeIcrfToFixedMatrix(date: JulianDate, result?: Matrix3): Matrix3;
  16588. /**
  16589. * Computes a rotation matrix to transform a point or vector from the Earth-Fixed frame axes (ITRF)
  16590. to the International Celestial Reference Frame (GCRF/ICRF) inertial frame axes
  16591. at a given time. This function may return undefined if the data necessary to
  16592. do the transformation is not yet loaded.
  16593. * @example
  16594. * // Transform a point from the ICRF axes to the Fixed axes.
  16595. var now = Cesium.JulianDate.now();
  16596. var pointInFixed = Cesium.Cartesian3.fromDegrees(0.0, 0.0);
  16597. var fixedToIcrf = Cesium.Transforms.computeIcrfToFixedMatrix(now);
  16598. var pointInInertial = new Cesium.Cartesian3();
  16599. if (Cesium.defined(fixedToIcrf)) {
  16600. pointInInertial = Cesium.Matrix3.multiplyByVector(fixedToIcrf, pointInFixed, pointInInertial);
  16601. }
  16602. * @param date - The time at which to compute the rotation matrix.
  16603. * @param [result] - The object onto which to store the result. If this parameter is
  16604. not specified, a new instance is created and returned.
  16605. * @returns The rotation matrix, or undefined if the data necessary to do the
  16606. transformation is not yet loaded.
  16607. */
  16608. function computeFixedToIcrfMatrix(date: JulianDate, result?: Matrix3): Matrix3;
  16609. /**
  16610. * Transform a point from model coordinates to window coordinates.
  16611. * @param modelViewProjectionMatrix - The 4x4 model-view-projection matrix.
  16612. * @param viewportTransformation - The 4x4 viewport transformation.
  16613. * @param point - The point to transform.
  16614. * @param [result] - The object onto which to store the result.
  16615. * @returns The modified result parameter or a new Cartesian2 instance if none was provided.
  16616. */
  16617. function pointToWindowCoordinates(modelViewProjectionMatrix: Matrix4, viewportTransformation: Matrix4, point: Cartesian3, result?: Cartesian2): Cartesian2;
  16618. /**
  16619. * Transform a position and velocity to a rotation matrix.
  16620. * @param position - The position to transform.
  16621. * @param velocity - The velocity vector to transform.
  16622. * @param [ellipsoid = Ellipsoid.WGS84] - The ellipsoid whose fixed frame is used in the transformation.
  16623. * @param [result] - The object onto which to store the result.
  16624. * @returns The modified result parameter or a new Matrix3 instance if none was provided.
  16625. */
  16626. function rotationMatrixFromPositionVelocity(position: Cartesian3, velocity: Cartesian3, ellipsoid?: Ellipsoid, result?: Matrix3): Matrix3;
  16627. }
  16628. /**
  16629. * An affine transformation defined by a translation, rotation, and scale.
  16630. * @param [translation = Cartesian3.ZERO] - A {@link Cartesian3} specifying the (x, y, z) translation to apply to the node.
  16631. * @param [rotation = Quaternion.IDENTITY] - A {@link Quaternion} specifying the (x, y, z, w) rotation to apply to the node.
  16632. * @param [scale = new Cartesian3(1.0, 1.0, 1.0)] - A {@link Cartesian3} specifying the (x, y, z) scaling to apply to the node.
  16633. */
  16634. export class TranslationRotationScale {
  16635. constructor(translation?: Cartesian3, rotation?: Quaternion, scale?: Cartesian3);
  16636. /**
  16637. * Gets or sets the (x, y, z) translation to apply to the node.
  16638. */
  16639. translation: Cartesian3;
  16640. /**
  16641. * Gets or sets the (x, y, z, w) rotation to apply to the node.
  16642. */
  16643. rotation: Quaternion;
  16644. /**
  16645. * Gets or sets the (x, y, z) scaling to apply to the node.
  16646. */
  16647. scale: Cartesian3;
  16648. /**
  16649. * Compares this instance against the provided instance and returns
  16650. <code>true</code> if they are equal, <code>false</code> otherwise.
  16651. * @param [right] - The right hand side TranslationRotationScale.
  16652. * @returns <code>true</code> if they are equal, <code>false</code> otherwise.
  16653. */
  16654. equals(right?: TranslationRotationScale): boolean;
  16655. }
  16656. /**
  16657. * Uses the Tridiagonal Matrix Algorithm, also known as the Thomas Algorithm, to solve
  16658. a system of linear equations where the coefficient matrix is a tridiagonal matrix.
  16659. */
  16660. export namespace TridiagonalSystemSolver {
  16661. /**
  16662. * Solves a tridiagonal system of linear equations.
  16663. * @example
  16664. * var lowerDiagonal = [1.0, 1.0, 1.0, 1.0];
  16665. var diagonal = [2.0, 4.0, 4.0, 4.0, 2.0];
  16666. var upperDiagonal = [1.0, 1.0, 1.0, 1.0];
  16667. var rightHandSide = [
  16668. new Cesium.Cartesian3(410757.0, -1595711.0, 1375302.0),
  16669. new Cesium.Cartesian3(-5986705.0, -2190640.0, 1099600.0),
  16670. new Cesium.Cartesian3(-12593180.0, 288588.0, -1755549.0),
  16671. new Cesium.Cartesian3(-5349898.0, 2457005.0, -2685438.0),
  16672. new Cesium.Cartesian3(845820.0, 1573488.0, -1205591.0)
  16673. ];
  16674. var solution = Cesium.TridiagonalSystemSolver.solve(lowerDiagonal, diagonal, upperDiagonal, rightHandSide);
  16675. * @param diagonal - An array with length <code>n</code> that contains the diagonal of the coefficient matrix.
  16676. * @param lower - An array with length <code>n - 1</code> that contains the lower diagonal of the coefficient matrix.
  16677. * @param upper - An array with length <code>n - 1</code> that contains the upper diagonal of the coefficient matrix.
  16678. * @param right - An array of Cartesians with length <code>n</code> that is the right side of the system of equations.
  16679. * @returns An array of Cartesians with length <code>n</code> that is the solution to the tridiagonal system of equations.
  16680. */
  16681. function solve(diagonal: number[], lower: number[], upper: number[], right: Cartesian3[]): Cartesian3[];
  16682. }
  16683. /**
  16684. * A singleton that contains all of the servers that are trusted. Credentials will be sent with
  16685. any requests to these servers.
  16686. */
  16687. export namespace TrustedServers {
  16688. /**
  16689. * Adds a trusted server to the registry
  16690. * @example
  16691. * // Add a trusted server
  16692. TrustedServers.add('my.server.com', 80);
  16693. * @param host - The host to be added.
  16694. * @param port - The port used to access the host.
  16695. */
  16696. function add(host: string, port: number): void;
  16697. /**
  16698. * Removes a trusted server from the registry
  16699. * @example
  16700. * // Remove a trusted server
  16701. TrustedServers.remove('my.server.com', 80);
  16702. * @param host - The host to be removed.
  16703. * @param port - The port used to access the host.
  16704. */
  16705. function remove(host: string, port: number): void;
  16706. /**
  16707. * Tests whether a server is trusted or not. The server must have been added with the port if it is included in the url.
  16708. * @example
  16709. * // Add server
  16710. TrustedServers.add('my.server.com', 81);
  16711. // Check if server is trusted
  16712. if (TrustedServers.contains('https://my.server.com:81/path/to/file.png')) {
  16713. // my.server.com:81 is trusted
  16714. }
  16715. if (TrustedServers.contains('https://my.server.com/path/to/file.png')) {
  16716. // my.server.com isn't trusted
  16717. }
  16718. * @param url - The url to be tested against the trusted list
  16719. * @returns Returns true if url is trusted, false otherwise.
  16720. */
  16721. function contains(url: string): boolean;
  16722. /**
  16723. * Clears the registry
  16724. * @example
  16725. * // Remove a trusted server
  16726. TrustedServers.clear();
  16727. */
  16728. function clear(): void;
  16729. }
  16730. /**
  16731. * A vertex format defines what attributes make up a vertex. A VertexFormat can be provided
  16732. to a {@link Geometry} to request that certain properties be computed, e.g., just position,
  16733. position and normal, etc.
  16734. * @example
  16735. * // Create a vertex format with position and 2D texture coordinate attributes.
  16736. var format = new Cesium.VertexFormat({
  16737. position : true,
  16738. st : true
  16739. });
  16740. * @param [options] - An object with boolean properties corresponding to VertexFormat properties as shown in the code example.
  16741. */
  16742. export class VertexFormat {
  16743. constructor(options?: any);
  16744. /**
  16745. * When <code>true</code>, the vertex has a 3D position attribute.
  16746. <p>
  16747. 64-bit floating-point (for precision). 3 components per attribute.
  16748. </p>
  16749. */
  16750. position: boolean;
  16751. /**
  16752. * When <code>true</code>, the vertex has a normal attribute (normalized), which is commonly used for lighting.
  16753. <p>
  16754. 32-bit floating-point. 3 components per attribute.
  16755. </p>
  16756. */
  16757. normal: boolean;
  16758. /**
  16759. * When <code>true</code>, the vertex has a 2D texture coordinate attribute.
  16760. <p>
  16761. 32-bit floating-point. 2 components per attribute
  16762. </p>
  16763. */
  16764. st: boolean;
  16765. /**
  16766. * When <code>true</code>, the vertex has a bitangent attribute (normalized), which is used for tangent-space effects like bump mapping.
  16767. <p>
  16768. 32-bit floating-point. 3 components per attribute.
  16769. </p>
  16770. */
  16771. bitangent: boolean;
  16772. /**
  16773. * When <code>true</code>, the vertex has a tangent attribute (normalized), which is used for tangent-space effects like bump mapping.
  16774. <p>
  16775. 32-bit floating-point. 3 components per attribute.
  16776. </p>
  16777. */
  16778. tangent: boolean;
  16779. /**
  16780. * When <code>true</code>, the vertex has an RGB color attribute.
  16781. <p>
  16782. 8-bit unsigned byte. 3 components per attribute.
  16783. </p>
  16784. */
  16785. color: boolean;
  16786. /**
  16787. * An immutable vertex format with only a position attribute.
  16788. */
  16789. static readonly POSITION_ONLY: VertexFormat;
  16790. /**
  16791. * An immutable vertex format with position and normal attributes.
  16792. This is compatible with per-instance color appearances like {@link PerInstanceColorAppearance}.
  16793. */
  16794. static readonly POSITION_AND_NORMAL: VertexFormat;
  16795. /**
  16796. * An immutable vertex format with position, normal, and st attributes.
  16797. This is compatible with {@link MaterialAppearance} when {@link MaterialAppearance#materialSupport}
  16798. is <code>TEXTURED/code>.
  16799. */
  16800. static readonly POSITION_NORMAL_AND_ST: VertexFormat;
  16801. /**
  16802. * An immutable vertex format with position and st attributes.
  16803. This is compatible with {@link EllipsoidSurfaceAppearance}.
  16804. */
  16805. static readonly POSITION_AND_ST: VertexFormat;
  16806. /**
  16807. * An immutable vertex format with position and color attributes.
  16808. */
  16809. static readonly POSITION_AND_COLOR: VertexFormat;
  16810. /**
  16811. * An immutable vertex format with well-known attributes: position, normal, st, tangent, and bitangent.
  16812. */
  16813. static readonly ALL: VertexFormat;
  16814. /**
  16815. * An immutable vertex format with position, normal, and st attributes.
  16816. This is compatible with most appearances and materials; however
  16817. normal and st attributes are not always required. When this is
  16818. known in advance, another <code>VertexFormat</code> should be used.
  16819. */
  16820. static readonly DEFAULT: VertexFormat;
  16821. /**
  16822. * The number of elements used to pack the object into an array.
  16823. */
  16824. static packedLength: number;
  16825. /**
  16826. * Stores the provided instance into the provided array.
  16827. * @param value - The value to pack.
  16828. * @param array - The array to pack into.
  16829. * @param [startingIndex = 0] - The index into the array at which to start packing the elements.
  16830. * @returns The array that was packed into
  16831. */
  16832. static pack(value: VertexFormat, array: number[], startingIndex?: number): number[];
  16833. /**
  16834. * Retrieves an instance from a packed array.
  16835. * @param array - The packed array.
  16836. * @param [startingIndex = 0] - The starting index of the element to be unpacked.
  16837. * @param [result] - The object into which to store the result.
  16838. * @returns The modified result parameter or a new VertexFormat instance if one was not provided.
  16839. */
  16840. static unpack(array: number[], startingIndex?: number, result?: VertexFormat): VertexFormat;
  16841. /**
  16842. * Duplicates a VertexFormat instance.
  16843. * @param vertexFormat - The vertex format to duplicate.
  16844. * @param [result] - The object onto which to store the result.
  16845. * @returns The modified result parameter or a new VertexFormat instance if one was not provided. (Returns undefined if vertexFormat is undefined)
  16846. */
  16847. static clone(vertexFormat: VertexFormat, result?: VertexFormat): VertexFormat;
  16848. }
  16849. /**
  16850. * Synchronizes a video element with a simulation clock.
  16851. * @param [options] - Object with the following properties:
  16852. * @param [options.clock] - The clock instance used to drive the video.
  16853. * @param [options.element] - The video element to be synchronized.
  16854. * @param [options.epoch = Iso8601.MINIMUM_VALUE] - The simulation time that marks the start of the video.
  16855. * @param [options.tolerance = 1.0] - The maximum amount of time, in seconds, that the clock and video can diverge.
  16856. */
  16857. export class VideoSynchronizer {
  16858. constructor(options?: {
  16859. clock?: Clock;
  16860. element?: HTMLVideoElement;
  16861. epoch?: JulianDate;
  16862. tolerance?: number;
  16863. });
  16864. /**
  16865. * Gets or sets the simulation time that marks the start of the video.
  16866. */
  16867. epoch: JulianDate;
  16868. /**
  16869. * Gets or sets the amount of time in seconds the video's currentTime
  16870. and the clock's currentTime can diverge before a video seek is performed.
  16871. Lower values make the synchronization more accurate but video
  16872. performance might suffer. Higher values provide better performance
  16873. but at the cost of accuracy.
  16874. */
  16875. tolerance: number;
  16876. /**
  16877. * Gets or sets the clock used to drive the video element.
  16878. */
  16879. clock: Clock;
  16880. /**
  16881. * Gets or sets the video element to synchronize.
  16882. */
  16883. element: HTMLVideoElement;
  16884. /**
  16885. * Destroys and resources used by the object. Once an object is destroyed, it should not be used.
  16886. */
  16887. destroy(): void;
  16888. /**
  16889. * Returns true if this object was destroyed; otherwise, false.
  16890. * @returns True if this object was destroyed; otherwise, false.
  16891. */
  16892. isDestroyed(): boolean;
  16893. }
  16894. /**
  16895. * This enumerated type is used in determining to what extent an object, the occludee,
  16896. is visible during horizon culling. An occluder may fully block an occludee, in which case
  16897. it has no visibility, may partially block an occludee from view, or may not block it at all,
  16898. leading to full visibility.
  16899. */
  16900. export enum Visibility {
  16901. /**
  16902. * Represents that no part of an object is visible.
  16903. */
  16904. NONE = -1,
  16905. /**
  16906. * Represents that part, but not all, of an object is visible
  16907. */
  16908. PARTIAL = 0,
  16909. /**
  16910. * Represents that an object is visible in its entirety.
  16911. */
  16912. FULL = 1
  16913. }
  16914. /**
  16915. * A {@link TerrainProvider} that produces terrain geometry by tessellating height maps
  16916. retrieved from a {@link http://vr-theworld.com/|VT MÄK VR-TheWorld server}.
  16917. * @example
  16918. * var terrainProvider = new Cesium.VRTheWorldTerrainProvider({
  16919. url : 'https://www.vr-theworld.com/vr-theworld/tiles1.0.0/73/'
  16920. });
  16921. viewer.terrainProvider = terrainProvider;
  16922. * @param options - Object with the following properties:
  16923. * @param options.url - The URL of the VR-TheWorld TileMap.
  16924. * @param [options.ellipsoid = Ellipsoid.WGS84] - The ellipsoid. If this parameter is not
  16925. specified, the WGS84 ellipsoid is used.
  16926. * @param [options.credit] - A credit for the data source, which is displayed on the canvas.
  16927. */
  16928. export class VRTheWorldTerrainProvider {
  16929. constructor(options: {
  16930. url: Resource | string;
  16931. ellipsoid?: Ellipsoid;
  16932. credit?: Credit | string;
  16933. });
  16934. /**
  16935. * Gets an event that is raised when the terrain provider encounters an asynchronous error. By subscribing
  16936. to the event, you will be notified of the error and can potentially recover from it. Event listeners
  16937. are passed an instance of {@link TileProviderError}.
  16938. */
  16939. errorEvent: Event;
  16940. /**
  16941. * Gets the credit to display when this terrain provider is active. Typically this is used to credit
  16942. the source of the terrain. This function should not be called before {@link VRTheWorldTerrainProvider#ready} returns true.
  16943. */
  16944. credit: Credit;
  16945. /**
  16946. * Gets the tiling scheme used by this provider. This function should
  16947. not be called before {@link VRTheWorldTerrainProvider#ready} returns true.
  16948. */
  16949. tilingScheme: GeographicTilingScheme;
  16950. /**
  16951. * Gets a value indicating whether or not the provider is ready for use.
  16952. */
  16953. ready: boolean;
  16954. /**
  16955. * Gets a promise that resolves to true when the provider is ready for use.
  16956. */
  16957. readonly readyPromise: Promise<boolean>;
  16958. /**
  16959. * Gets a value indicating whether or not the provider includes a water mask. The water mask
  16960. indicates which areas of the globe are water rather than land, so they can be rendered
  16961. as a reflective surface with animated waves. This function should not be
  16962. called before {@link VRTheWorldTerrainProvider#ready} returns true.
  16963. */
  16964. hasWaterMask: boolean;
  16965. /**
  16966. * Gets a value indicating whether or not the requested tiles include vertex normals.
  16967. This function should not be called before {@link VRTheWorldTerrainProvider#ready} returns true.
  16968. */
  16969. hasVertexNormals: boolean;
  16970. /**
  16971. * Gets an object that can be used to determine availability of terrain from this provider, such as
  16972. at points and in rectangles. This function should not be called before
  16973. {@link TerrainProvider#ready} returns true. This property may be undefined if availability
  16974. information is not available.
  16975. */
  16976. availability: TileAvailability;
  16977. /**
  16978. * Requests the geometry for a given tile. This function should not be called before
  16979. {@link VRTheWorldTerrainProvider#ready} returns true. The result includes terrain
  16980. data and indicates that all child tiles are available.
  16981. * @param x - The X coordinate of the tile for which to request geometry.
  16982. * @param y - The Y coordinate of the tile for which to request geometry.
  16983. * @param level - The level of the tile for which to request geometry.
  16984. * @param [request] - The request object. Intended for internal use only.
  16985. * @returns A promise for the requested geometry. If this method
  16986. returns undefined instead of a promise, it is an indication that too many requests are already
  16987. pending and the request will be retried later.
  16988. */
  16989. requestTileGeometry(x: number, y: number, level: number, request?: Request): Promise<TerrainData> | undefined;
  16990. /**
  16991. * Gets the maximum geometric error allowed in a tile at a given level.
  16992. * @param level - The tile level for which to get the maximum geometric error.
  16993. * @returns The maximum geometric error.
  16994. */
  16995. getLevelMaximumGeometricError(level: number): number;
  16996. /**
  16997. * Determines whether data for a tile is available to be loaded.
  16998. * @param x - The X coordinate of the tile for which to request geometry.
  16999. * @param y - The Y coordinate of the tile for which to request geometry.
  17000. * @param level - The level of the tile for which to request geometry.
  17001. * @returns Undefined if not supported, otherwise true or false.
  17002. */
  17003. getTileDataAvailable(x: number, y: number, level: number): boolean;
  17004. /**
  17005. * Makes sure we load availability data for a tile
  17006. * @param x - The X coordinate of the tile for which to request geometry.
  17007. * @param y - The Y coordinate of the tile for which to request geometry.
  17008. * @param level - The level of the tile for which to request geometry.
  17009. * @returns Undefined if nothing need to be loaded or a Promise that resolves when all required tiles are loaded
  17010. */
  17011. loadTileDataAvailability(x: number, y: number, level: number): undefined | Promise<void>;
  17012. }
  17013. /**
  17014. * A description of a wall, which is similar to a KML line string. A wall is defined by a series of points,
  17015. which extrude down to the ground. Optionally, they can extrude downwards to a specified height.
  17016. * @example
  17017. * // create a wall that spans from ground level to 10000 meters
  17018. var wall = new Cesium.WallGeometry({
  17019. positions : Cesium.Cartesian3.fromDegreesArrayHeights([
  17020. 19.0, 47.0, 10000.0,
  17021. 19.0, 48.0, 10000.0,
  17022. 20.0, 48.0, 10000.0,
  17023. 20.0, 47.0, 10000.0,
  17024. 19.0, 47.0, 10000.0
  17025. ])
  17026. });
  17027. var geometry = Cesium.WallGeometry.createGeometry(wall);
  17028. * @param options - Object with the following properties:
  17029. * @param options.positions - An array of Cartesian objects, which are the points of the wall.
  17030. * @param [options.granularity = Math.RADIANS_PER_DEGREE] - The distance, in radians, between each latitude and longitude. Determines the number of positions in the buffer.
  17031. * @param [options.maximumHeights] - An array parallel to <code>positions</code> that give the maximum height of the
  17032. wall at <code>positions</code>. If undefined, the height of each position in used.
  17033. * @param [options.minimumHeights] - An array parallel to <code>positions</code> that give the minimum height of the
  17034. wall at <code>positions</code>. If undefined, the height at each position is 0.0.
  17035. * @param [options.ellipsoid = Ellipsoid.WGS84] - The ellipsoid for coordinate manipulation
  17036. * @param [options.vertexFormat = VertexFormat.DEFAULT] - The vertex attributes to be computed.
  17037. */
  17038. export class WallGeometry {
  17039. constructor(options: {
  17040. positions: Cartesian3[];
  17041. granularity?: number;
  17042. maximumHeights?: number[];
  17043. minimumHeights?: number[];
  17044. ellipsoid?: Ellipsoid;
  17045. vertexFormat?: VertexFormat;
  17046. });
  17047. /**
  17048. * The number of elements used to pack the object into an array.
  17049. */
  17050. packedLength: number;
  17051. /**
  17052. * Stores the provided instance into the provided array.
  17053. * @param value - The value to pack.
  17054. * @param array - The array to pack into.
  17055. * @param [startingIndex = 0] - The index into the array at which to start packing the elements.
  17056. * @returns The array that was packed into
  17057. */
  17058. static pack(value: WallGeometry, array: number[], startingIndex?: number): number[];
  17059. /**
  17060. * Retrieves an instance from a packed array.
  17061. * @param array - The packed array.
  17062. * @param [startingIndex = 0] - The starting index of the element to be unpacked.
  17063. * @param [result] - The object into which to store the result.
  17064. * @returns The modified result parameter or a new WallGeometry instance if one was not provided.
  17065. */
  17066. static unpack(array: number[], startingIndex?: number, result?: WallGeometry): WallGeometry;
  17067. /**
  17068. * A description of a wall, which is similar to a KML line string. A wall is defined by a series of points,
  17069. which extrude down to the ground. Optionally, they can extrude downwards to a specified height.
  17070. * @example
  17071. * // create a wall that spans from 10000 meters to 20000 meters
  17072. var wall = Cesium.WallGeometry.fromConstantHeights({
  17073. positions : Cesium.Cartesian3.fromDegreesArray([
  17074. 19.0, 47.0,
  17075. 19.0, 48.0,
  17076. 20.0, 48.0,
  17077. 20.0, 47.0,
  17078. 19.0, 47.0,
  17079. ]),
  17080. minimumHeight : 20000.0,
  17081. maximumHeight : 10000.0
  17082. });
  17083. var geometry = Cesium.WallGeometry.createGeometry(wall);
  17084. * @param options - Object with the following properties:
  17085. * @param options.positions - An array of Cartesian objects, which are the points of the wall.
  17086. * @param [options.maximumHeight] - A constant that defines the maximum height of the
  17087. wall at <code>positions</code>. If undefined, the height of each position in used.
  17088. * @param [options.minimumHeight] - A constant that defines the minimum height of the
  17089. wall at <code>positions</code>. If undefined, the height at each position is 0.0.
  17090. * @param [options.ellipsoid = Ellipsoid.WGS84] - The ellipsoid for coordinate manipulation
  17091. * @param [options.vertexFormat = VertexFormat.DEFAULT] - The vertex attributes to be computed.
  17092. */
  17093. static fromConstantHeights(options: {
  17094. positions: Cartesian3[];
  17095. maximumHeight?: number;
  17096. minimumHeight?: number;
  17097. ellipsoid?: Ellipsoid;
  17098. vertexFormat?: VertexFormat;
  17099. }): WallGeometry;
  17100. /**
  17101. * Computes the geometric representation of a wall, including its vertices, indices, and a bounding sphere.
  17102. * @param wallGeometry - A description of the wall.
  17103. * @returns The computed vertices and indices.
  17104. */
  17105. static createGeometry(wallGeometry: WallGeometry): Geometry | undefined;
  17106. }
  17107. /**
  17108. * A description of a wall outline. A wall is defined by a series of points,
  17109. which extrude down to the ground. Optionally, they can extrude downwards to a specified height.
  17110. * @example
  17111. * // create a wall outline that spans from ground level to 10000 meters
  17112. var wall = new Cesium.WallOutlineGeometry({
  17113. positions : Cesium.Cartesian3.fromDegreesArrayHeights([
  17114. 19.0, 47.0, 10000.0,
  17115. 19.0, 48.0, 10000.0,
  17116. 20.0, 48.0, 10000.0,
  17117. 20.0, 47.0, 10000.0,
  17118. 19.0, 47.0, 10000.0
  17119. ])
  17120. });
  17121. var geometry = Cesium.WallOutlineGeometry.createGeometry(wall);
  17122. * @param options - Object with the following properties:
  17123. * @param options.positions - An array of Cartesian objects, which are the points of the wall.
  17124. * @param [options.granularity = Math.RADIANS_PER_DEGREE] - The distance, in radians, between each latitude and longitude. Determines the number of positions in the buffer.
  17125. * @param [options.maximumHeights] - An array parallel to <code>positions</code> that give the maximum height of the
  17126. wall at <code>positions</code>. If undefined, the height of each position in used.
  17127. * @param [options.minimumHeights] - An array parallel to <code>positions</code> that give the minimum height of the
  17128. wall at <code>positions</code>. If undefined, the height at each position is 0.0.
  17129. * @param [options.ellipsoid = Ellipsoid.WGS84] - The ellipsoid for coordinate manipulation
  17130. */
  17131. export class WallOutlineGeometry {
  17132. constructor(options: {
  17133. positions: Cartesian3[];
  17134. granularity?: number;
  17135. maximumHeights?: number[];
  17136. minimumHeights?: number[];
  17137. ellipsoid?: Ellipsoid;
  17138. });
  17139. /**
  17140. * The number of elements used to pack the object into an array.
  17141. */
  17142. packedLength: number;
  17143. /**
  17144. * Stores the provided instance into the provided array.
  17145. * @param value - The value to pack.
  17146. * @param array - The array to pack into.
  17147. * @param [startingIndex = 0] - The index into the array at which to start packing the elements.
  17148. * @returns The array that was packed into
  17149. */
  17150. static pack(value: WallOutlineGeometry, array: number[], startingIndex?: number): number[];
  17151. /**
  17152. * Retrieves an instance from a packed array.
  17153. * @param array - The packed array.
  17154. * @param [startingIndex = 0] - The starting index of the element to be unpacked.
  17155. * @param [result] - The object into which to store the result.
  17156. * @returns The modified result parameter or a new WallOutlineGeometry instance if one was not provided.
  17157. */
  17158. static unpack(array: number[], startingIndex?: number, result?: WallOutlineGeometry): WallOutlineGeometry;
  17159. /**
  17160. * A description of a walloutline. A wall is defined by a series of points,
  17161. which extrude down to the ground. Optionally, they can extrude downwards to a specified height.
  17162. * @example
  17163. * // create a wall that spans from 10000 meters to 20000 meters
  17164. var wall = Cesium.WallOutlineGeometry.fromConstantHeights({
  17165. positions : Cesium.Cartesian3.fromDegreesArray([
  17166. 19.0, 47.0,
  17167. 19.0, 48.0,
  17168. 20.0, 48.0,
  17169. 20.0, 47.0,
  17170. 19.0, 47.0,
  17171. ]),
  17172. minimumHeight : 20000.0,
  17173. maximumHeight : 10000.0
  17174. });
  17175. var geometry = Cesium.WallOutlineGeometry.createGeometry(wall);
  17176. * @param options - Object with the following properties:
  17177. * @param options.positions - An array of Cartesian objects, which are the points of the wall.
  17178. * @param [options.maximumHeight] - A constant that defines the maximum height of the
  17179. wall at <code>positions</code>. If undefined, the height of each position in used.
  17180. * @param [options.minimumHeight] - A constant that defines the minimum height of the
  17181. wall at <code>positions</code>. If undefined, the height at each position is 0.0.
  17182. * @param [options.ellipsoid = Ellipsoid.WGS84] - The ellipsoid for coordinate manipulation
  17183. */
  17184. static fromConstantHeights(options: {
  17185. positions: Cartesian3[];
  17186. maximumHeight?: number;
  17187. minimumHeight?: number;
  17188. ellipsoid?: Ellipsoid;
  17189. }): WallOutlineGeometry;
  17190. /**
  17191. * Computes the geometric representation of a wall outline, including its vertices, indices, and a bounding sphere.
  17192. * @param wallGeometry - A description of the wall outline.
  17193. * @returns The computed vertices and indices.
  17194. */
  17195. static createGeometry(wallGeometry: WallOutlineGeometry): Geometry | undefined;
  17196. }
  17197. /**
  17198. * The map projection used by Google Maps, Bing Maps, and most of ArcGIS Online, EPSG:3857. This
  17199. projection use longitude and latitude expressed with the WGS84 and transforms them to Mercator using
  17200. the spherical (rather than ellipsoidal) equations.
  17201. * @param [ellipsoid = Ellipsoid.WGS84] - The ellipsoid.
  17202. */
  17203. export class WebMercatorProjection {
  17204. constructor(ellipsoid?: Ellipsoid);
  17205. /**
  17206. * Gets the {@link Ellipsoid}.
  17207. */
  17208. readonly ellipsoid: Ellipsoid;
  17209. /**
  17210. * Converts a Mercator angle, in the range -PI to PI, to a geodetic latitude
  17211. in the range -PI/2 to PI/2.
  17212. * @param mercatorAngle - The angle to convert.
  17213. * @returns The geodetic latitude in radians.
  17214. */
  17215. static mercatorAngleToGeodeticLatitude(mercatorAngle: number): number;
  17216. /**
  17217. * Converts a geodetic latitude in radians, in the range -PI/2 to PI/2, to a Mercator
  17218. angle in the range -PI to PI.
  17219. * @param latitude - The geodetic latitude in radians.
  17220. * @returns The Mercator angle.
  17221. */
  17222. static geodeticLatitudeToMercatorAngle(latitude: number): number;
  17223. /**
  17224. * The maximum latitude (both North and South) supported by a Web Mercator
  17225. (EPSG:3857) projection. Technically, the Mercator projection is defined
  17226. for any latitude up to (but not including) 90 degrees, but it makes sense
  17227. to cut it off sooner because it grows exponentially with increasing latitude.
  17228. The logic behind this particular cutoff value, which is the one used by
  17229. Google Maps, Bing Maps, and Esri, is that it makes the projection
  17230. square. That is, the rectangle is equal in the X and Y directions.
  17231. The constant value is computed by calling:
  17232. WebMercatorProjection.mercatorAngleToGeodeticLatitude(Math.PI)
  17233. */
  17234. static MaximumLatitude: number;
  17235. /**
  17236. * Converts geodetic ellipsoid coordinates, in radians, to the equivalent Web Mercator
  17237. X, Y, Z coordinates expressed in meters and returned in a {@link Cartesian3}. The height
  17238. is copied unmodified to the Z coordinate.
  17239. * @param cartographic - The cartographic coordinates in radians.
  17240. * @param [result] - The instance to which to copy the result, or undefined if a
  17241. new instance should be created.
  17242. * @returns The equivalent web mercator X, Y, Z coordinates, in meters.
  17243. */
  17244. project(cartographic: Cartographic, result?: Cartesian3): Cartesian3;
  17245. /**
  17246. * Converts Web Mercator X, Y coordinates, expressed in meters, to a {@link Cartographic}
  17247. containing geodetic ellipsoid coordinates. The Z coordinate is copied unmodified to the
  17248. height.
  17249. * @param cartesian - The web mercator Cartesian position to unrproject with height (z) in meters.
  17250. * @param [result] - The instance to which to copy the result, or undefined if a
  17251. new instance should be created.
  17252. * @returns The equivalent cartographic coordinates.
  17253. */
  17254. unproject(cartesian: Cartesian3, result?: Cartographic): Cartographic;
  17255. }
  17256. /**
  17257. * A tiling scheme for geometry referenced to a {@link WebMercatorProjection}, EPSG:3857. This is
  17258. the tiling scheme used by Google Maps, Microsoft Bing Maps, and most of ESRI ArcGIS Online.
  17259. * @param [options] - Object with the following properties:
  17260. * @param [options.ellipsoid = Ellipsoid.WGS84] - The ellipsoid whose surface is being tiled. Defaults to
  17261. the WGS84 ellipsoid.
  17262. * @param [options.numberOfLevelZeroTilesX = 1] - The number of tiles in the X direction at level zero of
  17263. the tile tree.
  17264. * @param [options.numberOfLevelZeroTilesY = 1] - The number of tiles in the Y direction at level zero of
  17265. the tile tree.
  17266. * @param [options.rectangleSouthwestInMeters] - The southwest corner of the rectangle covered by the
  17267. tiling scheme, in meters. If this parameter or rectangleNortheastInMeters is not specified, the entire
  17268. globe is covered in the longitude direction and an equal distance is covered in the latitude
  17269. direction, resulting in a square projection.
  17270. * @param [options.rectangleNortheastInMeters] - The northeast corner of the rectangle covered by the
  17271. tiling scheme, in meters. If this parameter or rectangleSouthwestInMeters is not specified, the entire
  17272. globe is covered in the longitude direction and an equal distance is covered in the latitude
  17273. direction, resulting in a square projection.
  17274. */
  17275. export class WebMercatorTilingScheme {
  17276. constructor(options?: {
  17277. ellipsoid?: Ellipsoid;
  17278. numberOfLevelZeroTilesX?: number;
  17279. numberOfLevelZeroTilesY?: number;
  17280. rectangleSouthwestInMeters?: Cartesian2;
  17281. rectangleNortheastInMeters?: Cartesian2;
  17282. });
  17283. /**
  17284. * Gets the ellipsoid that is tiled by this tiling scheme.
  17285. */
  17286. ellipsoid: Ellipsoid;
  17287. /**
  17288. * Gets the rectangle, in radians, covered by this tiling scheme.
  17289. */
  17290. rectangle: Rectangle;
  17291. /**
  17292. * Gets the map projection used by this tiling scheme.
  17293. */
  17294. projection: MapProjection;
  17295. /**
  17296. * Gets the total number of tiles in the X direction at a specified level-of-detail.
  17297. * @param level - The level-of-detail.
  17298. * @returns The number of tiles in the X direction at the given level.
  17299. */
  17300. getNumberOfXTilesAtLevel(level: number): number;
  17301. /**
  17302. * Gets the total number of tiles in the Y direction at a specified level-of-detail.
  17303. * @param level - The level-of-detail.
  17304. * @returns The number of tiles in the Y direction at the given level.
  17305. */
  17306. getNumberOfYTilesAtLevel(level: number): number;
  17307. /**
  17308. * Transforms a rectangle specified in geodetic radians to the native coordinate system
  17309. of this tiling scheme.
  17310. * @param rectangle - The rectangle to transform.
  17311. * @param [result] - The instance to which to copy the result, or undefined if a new instance
  17312. should be created.
  17313. * @returns The specified 'result', or a new object containing the native rectangle if 'result'
  17314. is undefined.
  17315. */
  17316. rectangleToNativeRectangle(rectangle: Rectangle, result?: Rectangle): Rectangle;
  17317. /**
  17318. * Converts tile x, y coordinates and level to a rectangle expressed in the native coordinates
  17319. of the tiling scheme.
  17320. * @param x - The integer x coordinate of the tile.
  17321. * @param y - The integer y coordinate of the tile.
  17322. * @param level - The tile level-of-detail. Zero is the least detailed.
  17323. * @param [result] - The instance to which to copy the result, or undefined if a new instance
  17324. should be created.
  17325. * @returns The specified 'result', or a new object containing the rectangle
  17326. if 'result' is undefined.
  17327. */
  17328. tileXYToNativeRectangle(x: number, y: number, level: number, result?: any): Rectangle;
  17329. /**
  17330. * Converts tile x, y coordinates and level to a cartographic rectangle in radians.
  17331. * @param x - The integer x coordinate of the tile.
  17332. * @param y - The integer y coordinate of the tile.
  17333. * @param level - The tile level-of-detail. Zero is the least detailed.
  17334. * @param [result] - The instance to which to copy the result, or undefined if a new instance
  17335. should be created.
  17336. * @returns The specified 'result', or a new object containing the rectangle
  17337. if 'result' is undefined.
  17338. */
  17339. tileXYToRectangle(x: number, y: number, level: number, result?: any): Rectangle;
  17340. /**
  17341. * Calculates the tile x, y coordinates of the tile containing
  17342. a given cartographic position.
  17343. * @param position - The position.
  17344. * @param level - The tile level-of-detail. Zero is the least detailed.
  17345. * @param [result] - The instance to which to copy the result, or undefined if a new instance
  17346. should be created.
  17347. * @returns The specified 'result', or a new object containing the tile x, y coordinates
  17348. if 'result' is undefined.
  17349. */
  17350. positionToTileXY(position: Cartographic, level: number, result?: Cartesian2): Cartesian2;
  17351. }
  17352. /**
  17353. * A spline that linearly interpolates over an array of weight values used by morph targets.
  17354. * @example
  17355. * var times = [ 0.0, 1.5, 3.0, 4.5, 6.0 ];
  17356. var weights = [0.0, 1.0, 0.25, 0.75, 0.5, 0.5, 0.75, 0.25, 1.0, 0.0]; //Two targets
  17357. var spline = new Cesium.WeightSpline({
  17358. times : times,
  17359. weights : weights
  17360. });
  17361. var p0 = spline.evaluate(times[0]);
  17362. * @param options - Object with the following properties:
  17363. * @param options.times - An array of strictly increasing, unit-less, floating-point times at each point.
  17364. The values are in no way connected to the clock time. They are the parameterization for the curve.
  17365. * @param options.weights - The array of floating-point control weights given. The weights are ordered such
  17366. that all weights for the targets are given in chronological order and order in which they appear in
  17367. 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) ...]
  17368. where i and j in w(i,j) are the time indices and target indices, respectively.
  17369. */
  17370. export class WeightSpline {
  17371. constructor(options: {
  17372. times: number[];
  17373. weights: number[];
  17374. });
  17375. /**
  17376. * An array of times for the control weights.
  17377. */
  17378. readonly times: number[];
  17379. /**
  17380. * An array of floating-point array control weights.
  17381. */
  17382. readonly weights: number[];
  17383. /**
  17384. * Finds an index <code>i</code> in <code>times</code> such that the parameter
  17385. <code>time</code> is in the interval <code>[times[i], times[i + 1]]</code>.
  17386. * @param time - The time.
  17387. * @returns The index for the element at the start of the interval.
  17388. */
  17389. findTimeInterval(time: number): number;
  17390. /**
  17391. * Wraps the given time to the period covered by the spline.
  17392. * @param time - The time.
  17393. * @returns The time, wrapped around to the updated animation.
  17394. */
  17395. wrapTime(time: number): number;
  17396. /**
  17397. * Clamps the given time to the period covered by the spline.
  17398. * @param time - The time.
  17399. * @returns The time, clamped to the animation period.
  17400. */
  17401. clampTime(time: number): number;
  17402. /**
  17403. * Evaluates the curve at a given time.
  17404. * @param time - The time at which to evaluate the curve.
  17405. * @param [result] - The object onto which to store the result.
  17406. * @returns The modified result parameter or a new instance of the point on the curve at the given time.
  17407. */
  17408. evaluate(time: number, result?: number[]): number[];
  17409. }
  17410. /**
  17411. * Winding order defines the order of vertices for a triangle to be considered front-facing.
  17412. */
  17413. export enum WindingOrder {
  17414. /**
  17415. * Vertices are in clockwise order.
  17416. */
  17417. CLOCKWISE = WebGLConstants.CW,
  17418. /**
  17419. * Vertices are in counter-clockwise order.
  17420. */
  17421. COUNTER_CLOCKWISE = WebGLConstants.CCW
  17422. }
  17423. /**
  17424. * Writes the given text into a new canvas. The canvas will be sized to fit the text.
  17425. If text is blank, returns undefined.
  17426. * @param text - The text to write.
  17427. * @param [options] - Object with the following properties:
  17428. * @param [options.font = '10px sans-serif'] - The CSS font to use.
  17429. * @param [options.textBaseline = 'bottom'] - The baseline of the text.
  17430. * @param [options.fill = true] - Whether to fill the text.
  17431. * @param [options.stroke = false] - Whether to stroke the text.
  17432. * @param [options.fillColor = Color.WHITE] - The fill color.
  17433. * @param [options.strokeColor = Color.BLACK] - The stroke color.
  17434. * @param [options.strokeWidth = 1] - The stroke width.
  17435. * @param [options.backgroundColor = Color.TRANSPARENT] - The background color of the canvas.
  17436. * @param [options.padding = 0] - The pixel size of the padding to add around the text.
  17437. * @returns A new canvas with the given text drawn into it. The dimensions object
  17438. from measureText will also be added to the returned canvas. If text is
  17439. blank, returns undefined.
  17440. */
  17441. export function writeTextToCanvas(text: string, options?: {
  17442. font?: string;
  17443. textBaseline?: string;
  17444. fill?: boolean;
  17445. stroke?: boolean;
  17446. fillColor?: Color;
  17447. strokeColor?: Color;
  17448. strokeWidth?: number;
  17449. backgroundColor?: Color;
  17450. padding?: number;
  17451. }): HTMLCanvasElement | undefined;
  17452. export namespace BillboardGraphics {
  17453. /**
  17454. * Initialization options for the BillboardGraphics constructor
  17455. * @property [show = true] - A boolean Property specifying the visibility of the billboard.
  17456. * @property [image] - A Property specifying the Image, URI, or Canvas to use for the billboard.
  17457. * @property [scale = 1.0] - A numeric Property specifying the scale to apply to the image size.
  17458. * @property [pixelOffset = Cartesian2.ZERO] - A {@link Cartesian2} Property specifying the pixel offset.
  17459. * @property [eyeOffset = Cartesian3.ZERO] - A {@link Cartesian3} Property specifying the eye offset.
  17460. * @property [horizontalOrigin = HorizontalOrigin.CENTER] - A Property specifying the {@link HorizontalOrigin}.
  17461. * @property [verticalOrigin = VerticalOrigin.CENTER] - A Property specifying the {@link VerticalOrigin}.
  17462. * @property [heightReference = HeightReference.NONE] - A Property specifying what the height is relative to.
  17463. * @property [color = Color.WHITE] - A Property specifying the tint {@link Color} of the image.
  17464. * @property [rotation = 0] - A numeric Property specifying the rotation about the alignedAxis.
  17465. * @property [alignedAxis = Cartesian3.ZERO] - A {@link Cartesian3} Property specifying the unit vector axis of rotation.
  17466. * @property [sizeInMeters] - A boolean Property specifying whether this billboard's size should be measured in meters.
  17467. * @property [width] - A numeric Property specifying the width of the billboard in pixels, overriding the native size.
  17468. * @property [height] - A numeric Property specifying the height of the billboard in pixels, overriding the native size.
  17469. * @property [scaleByDistance] - A {@link NearFarScalar} Property used to scale the point based on distance from the camera.
  17470. * @property [translucencyByDistance] - A {@link NearFarScalar} Property used to set translucency based on distance from the camera.
  17471. * @property [pixelOffsetScaleByDistance] - A {@link NearFarScalar} Property used to set pixelOffset based on distance from the camera.
  17472. * @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.
  17473. * @property [distanceDisplayCondition] - A Property specifying at what distance from the camera that this billboard will be displayed.
  17474. * @property [disableDepthTestDistance] - A Property specifying the distance from the camera at which to disable the depth test to.
  17475. */
  17476. type ConstructorOptions = {
  17477. show?: Property | boolean;
  17478. image?: Property | string | HTMLCanvasElement;
  17479. scale?: Property | number;
  17480. pixelOffset?: Property | Cartesian2;
  17481. eyeOffset?: Property | Cartesian3;
  17482. horizontalOrigin?: Property | HorizontalOrigin;
  17483. verticalOrigin?: Property | VerticalOrigin;
  17484. heightReference?: Property | HeightReference;
  17485. color?: Property | Color;
  17486. rotation?: Property | number;
  17487. alignedAxis?: Property | Cartesian3;
  17488. sizeInMeters?: Property | boolean;
  17489. width?: Property | number;
  17490. height?: Property | number;
  17491. scaleByDistance?: Property | NearFarScalar;
  17492. translucencyByDistance?: Property | NearFarScalar;
  17493. pixelOffsetScaleByDistance?: Property | NearFarScalar;
  17494. imageSubRegion?: Property | BoundingRectangle;
  17495. distanceDisplayCondition?: Property | DistanceDisplayCondition;
  17496. disableDepthTestDistance?: Property | number;
  17497. };
  17498. }
  17499. /**
  17500. * Describes a two dimensional icon located at the position of the containing {@link Entity}.
  17501. <p>
  17502. <div align='center'>
  17503. <img src='Images/Billboard.png' width='400' height='300' /><br />
  17504. Example billboards
  17505. </div>
  17506. </p>
  17507. * @param [options] - Object describing initialization options
  17508. */
  17509. export class BillboardGraphics {
  17510. constructor(options?: BillboardGraphics.ConstructorOptions);
  17511. /**
  17512. * Gets the event that is raised whenever a property or sub-property is changed or modified.
  17513. */
  17514. readonly definitionChanged: Event;
  17515. /**
  17516. * Gets or sets the boolean Property specifying the visibility of the billboard.
  17517. */
  17518. show: Property | undefined;
  17519. /**
  17520. * Gets or sets the Property specifying the Image, URI, or Canvas to use for the billboard.
  17521. */
  17522. image: Property | undefined;
  17523. /**
  17524. * Gets or sets the numeric Property specifying the uniform scale to apply to the image.
  17525. A scale greater than <code>1.0</code> enlarges the billboard while a scale less than <code>1.0</code> shrinks it.
  17526. <p>
  17527. <div align='center'>
  17528. <img src='Images/Billboard.setScale.png' width='400' height='300' /><br/>
  17529. From left to right in the above image, the scales are <code>0.5</code>, <code>1.0</code>, and <code>2.0</code>.
  17530. </div>
  17531. </p>
  17532. */
  17533. scale: Property | undefined;
  17534. /**
  17535. * Gets or sets the {@link Cartesian2} Property specifying the billboard's pixel offset in screen space
  17536. from the origin of this billboard. This is commonly used to align multiple billboards and labels at
  17537. the same position, e.g., an image and text. The screen space origin is the top, left corner of the
  17538. canvas; <code>x</code> increases from left to right, and <code>y</code> increases from top to bottom.
  17539. <p>
  17540. <div align='center'>
  17541. <table border='0' cellpadding='5'><tr>
  17542. <td align='center'><code>default</code><br/><img src='Images/Billboard.setPixelOffset.default.png' width='250' height='188' /></td>
  17543. <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>
  17544. </tr></table>
  17545. The billboard's origin is indicated by the yellow point.
  17546. </div>
  17547. </p>
  17548. */
  17549. pixelOffset: Property | undefined;
  17550. /**
  17551. * Gets or sets the {@link Cartesian3} Property specifying the billboard's offset in eye coordinates.
  17552. Eye coordinates is a left-handed coordinate system, where <code>x</code> points towards the viewer's
  17553. right, <code>y</code> points up, and <code>z</code> points into the screen.
  17554. <p>
  17555. An eye offset is commonly used to arrange multiple billboards or objects at the same position, e.g., to
  17556. arrange a billboard above its corresponding 3D model.
  17557. </p>
  17558. Below, the billboard is positioned at the center of the Earth but an eye offset makes it always
  17559. appear on top of the Earth regardless of the viewer's or Earth's orientation.
  17560. <p>
  17561. <div align='center'>
  17562. <table border='0' cellpadding='5'><tr>
  17563. <td align='center'><img src='Images/Billboard.setEyeOffset.one.png' width='250' height='188' /></td>
  17564. <td align='center'><img src='Images/Billboard.setEyeOffset.two.png' width='250' height='188' /></td>
  17565. </tr></table>
  17566. <code>b.eyeOffset = new Cartesian3(0.0, 8000000.0, 0.0);</code>
  17567. </div>
  17568. </p>
  17569. */
  17570. eyeOffset: Property | undefined;
  17571. /**
  17572. * Gets or sets the Property specifying the {@link HorizontalOrigin}.
  17573. */
  17574. horizontalOrigin: Property | undefined;
  17575. /**
  17576. * Gets or sets the Property specifying the {@link VerticalOrigin}.
  17577. */
  17578. verticalOrigin: Property | undefined;
  17579. /**
  17580. * Gets or sets the Property specifying the {@link HeightReference}.
  17581. */
  17582. heightReference: Property | undefined;
  17583. /**
  17584. * Gets or sets the Property specifying the {@link Color} that is multiplied with the <code>image</code>.
  17585. This has two common use cases. First, the same white texture may be used by many different billboards,
  17586. each with a different color, to create colored billboards. Second, the color's alpha component can be
  17587. used to make the billboard translucent as shown below. An alpha of <code>0.0</code> makes the billboard
  17588. transparent, and <code>1.0</code> makes the billboard opaque.
  17589. <p>
  17590. <div align='center'>
  17591. <table border='0' cellpadding='5'><tr>
  17592. <td align='center'><code>default</code><br/><img src='Images/Billboard.setColor.Alpha255.png' width='250' height='188' /></td>
  17593. <td align='center'><code>alpha : 0.5</code><br/><img src='Images/Billboard.setColor.Alpha127.png' width='250' height='188' /></td>
  17594. </tr></table>
  17595. </div>
  17596. </p>
  17597. */
  17598. color: Property | undefined;
  17599. /**
  17600. * Gets or sets the numeric Property specifying the rotation of the image
  17601. counter clockwise from the <code>alignedAxis</code>.
  17602. */
  17603. rotation: Property | undefined;
  17604. /**
  17605. * Gets or sets the {@link Cartesian3} Property specifying the unit vector axis of rotation
  17606. in the fixed frame. When set to Cartesian3.ZERO the rotation is from the top of the screen.
  17607. */
  17608. alignedAxis: Property | undefined;
  17609. /**
  17610. * Gets or sets the boolean Property specifying if this billboard's size will be measured in meters.
  17611. */
  17612. sizeInMeters: Property | undefined;
  17613. /**
  17614. * Gets or sets the numeric Property specifying the width of the billboard in pixels.
  17615. When undefined, the native width is used.
  17616. */
  17617. width: Property | undefined;
  17618. /**
  17619. * Gets or sets the numeric Property specifying the height of the billboard in pixels.
  17620. When undefined, the native height is used.
  17621. */
  17622. height: Property | undefined;
  17623. /**
  17624. * Gets or sets {@link NearFarScalar} Property specifying the scale of the billboard based on the distance from the camera.
  17625. A billboard's scale will interpolate between the {@link NearFarScalar#nearValue} and
  17626. {@link NearFarScalar#farValue} while the camera distance falls within the lower and upper bounds
  17627. of the specified {@link NearFarScalar#near} and {@link NearFarScalar#far}.
  17628. Outside of these ranges the billboard's scale remains clamped to the nearest bound.
  17629. */
  17630. scaleByDistance: Property | undefined;
  17631. /**
  17632. * Gets or sets {@link NearFarScalar} Property specifying the translucency of the billboard based on the distance from the camera.
  17633. A billboard's translucency will interpolate between the {@link NearFarScalar#nearValue} and
  17634. {@link NearFarScalar#farValue} while the camera distance falls within the lower and upper bounds
  17635. of the specified {@link NearFarScalar#near} and {@link NearFarScalar#far}.
  17636. Outside of these ranges the billboard's translucency remains clamped to the nearest bound.
  17637. */
  17638. translucencyByDistance: Property | undefined;
  17639. /**
  17640. * Gets or sets {@link NearFarScalar} Property specifying the pixel offset of the billboard based on the distance from the camera.
  17641. A billboard's pixel offset will interpolate between the {@link NearFarScalar#nearValue} and
  17642. {@link NearFarScalar#farValue} while the camera distance falls within the lower and upper bounds
  17643. of the specified {@link NearFarScalar#near} and {@link NearFarScalar#far}.
  17644. Outside of these ranges the billboard's pixel offset remains clamped to the nearest bound.
  17645. */
  17646. pixelOffsetScaleByDistance: Property | undefined;
  17647. /**
  17648. * Gets or sets the Property specifying a {@link BoundingRectangle} that defines a
  17649. sub-region of the <code>image</code> to use for the billboard, rather than the entire image,
  17650. measured in pixels from the bottom-left.
  17651. */
  17652. imageSubRegion: Property | undefined;
  17653. /**
  17654. * Gets or sets the {@link DistanceDisplayCondition} Property specifying at what distance from the camera that this billboard will be displayed.
  17655. */
  17656. distanceDisplayCondition: Property | undefined;
  17657. /**
  17658. * Gets or sets the distance from the camera at which to disable the depth test to, for example, prevent clipping against terrain.
  17659. When set to zero, the depth test is always applied. When set to Number.POSITIVE_INFINITY, the depth test is never applied.
  17660. */
  17661. disableDepthTestDistance: Property | undefined;
  17662. /**
  17663. * Duplicates this instance.
  17664. * @param [result] - The object onto which to store the result.
  17665. * @returns The modified result parameter or a new instance if one was not provided.
  17666. */
  17667. clone(result?: BillboardGraphics): BillboardGraphics;
  17668. /**
  17669. * Assigns each unassigned property on this object to the value
  17670. of the same property on the provided source object.
  17671. * @param source - The object to be merged into this object.
  17672. */
  17673. merge(source: BillboardGraphics): void;
  17674. }
  17675. /**
  17676. * A {@link Visualizer} which maps {@link Entity#billboard} to a {@link Billboard}.
  17677. * @param entityCluster - The entity cluster to manage the collection of billboards and optionally cluster with other entities.
  17678. * @param entityCollection - The entityCollection to visualize.
  17679. */
  17680. export class BillboardVisualizer {
  17681. constructor(entityCluster: EntityCluster, entityCollection: EntityCollection);
  17682. /**
  17683. * Updates the primitives created by this visualizer to match their
  17684. Entity counterpart at the given time.
  17685. * @param time - The time to update to.
  17686. * @returns This function always returns true.
  17687. */
  17688. update(time: JulianDate): boolean;
  17689. /**
  17690. * Returns true if this object was destroyed; otherwise, false.
  17691. * @returns True if this object was destroyed; otherwise, false.
  17692. */
  17693. isDestroyed(): boolean;
  17694. /**
  17695. * Removes and destroys all primitives created by this instance.
  17696. */
  17697. destroy(): void;
  17698. }
  17699. /**
  17700. * A {@link GeometryUpdater} for boxes.
  17701. Clients do not normally create this class directly, but instead rely on {@link DataSourceDisplay}.
  17702. * @param entity - The entity containing the geometry to be visualized.
  17703. * @param scene - The scene where visualization is taking place.
  17704. */
  17705. export class BoxGeometryUpdater {
  17706. constructor(entity: Entity, scene: Scene);
  17707. /**
  17708. * Creates the geometry instance which represents the fill of the geometry.
  17709. * @param time - The time to use when retrieving initial attribute values.
  17710. * @returns The geometry instance representing the filled portion of the geometry.
  17711. */
  17712. createFillGeometryInstance(time: JulianDate): GeometryInstance;
  17713. /**
  17714. * Creates the geometry instance which represents the outline of the geometry.
  17715. * @param time - The time to use when retrieving initial attribute values.
  17716. * @returns The geometry instance representing the outline portion of the geometry.
  17717. */
  17718. createOutlineGeometryInstance(time: JulianDate): GeometryInstance;
  17719. }
  17720. export namespace BoxGraphics {
  17721. /**
  17722. * Initialization options for the BoxGraphics constructor
  17723. * @property [show = true] - A boolean Property specifying the visibility of the box.
  17724. * @property [dimensions] - A {@link Cartesian3} Property specifying the length, width, and height of the box.
  17725. * @property [heightReference = HeightReference.NONE] - A Property specifying what the height from the entity position is relative to.
  17726. * @property [fill = true] - A boolean Property specifying whether the box is filled with the provided material.
  17727. * @property [material = Color.WHITE] - A Property specifying the material used to fill the box.
  17728. * @property [outline = false] - A boolean Property specifying whether the box is outlined.
  17729. * @property [outlineColor = Color.BLACK] - A Property specifying the {@link Color} of the outline.
  17730. * @property [outlineWidth = 1.0] - A numeric Property specifying the width of the outline.
  17731. * @property [shadows = ShadowMode.DISABLED] - An enum Property specifying whether the box casts or receives shadows from light sources.
  17732. * @property [distanceDisplayCondition] - A Property specifying at what distance from the camera that this box will be displayed.
  17733. */
  17734. type ConstructorOptions = {
  17735. show?: Property | boolean;
  17736. dimensions?: Property | Cartesian3;
  17737. heightReference?: Property | HeightReference;
  17738. fill?: Property | boolean;
  17739. material?: MaterialProperty | Color;
  17740. outline?: Property | boolean;
  17741. outlineColor?: Property | Color;
  17742. outlineWidth?: Property | number;
  17743. shadows?: Property | ShadowMode;
  17744. distanceDisplayCondition?: Property | DistanceDisplayCondition;
  17745. };
  17746. }
  17747. /**
  17748. * Describes a box. The center position and orientation are determined by the containing {@link Entity}.
  17749. * @param [options] - Object describing initialization options
  17750. */
  17751. export class BoxGraphics {
  17752. constructor(options?: BoxGraphics.ConstructorOptions);
  17753. /**
  17754. * Gets the event that is raised whenever a property or sub-property is changed or modified.
  17755. */
  17756. readonly definitionChanged: Event;
  17757. /**
  17758. * Gets or sets the boolean Property specifying the visibility of the box.
  17759. */
  17760. show: Property | undefined;
  17761. /**
  17762. * Gets or sets {@link Cartesian3} Property property specifying the length, width, and height of the box.
  17763. */
  17764. dimensions: Property | undefined;
  17765. /**
  17766. * Gets or sets the Property specifying the {@link HeightReference}.
  17767. */
  17768. heightReference: Property | undefined;
  17769. /**
  17770. * Gets or sets the boolean Property specifying whether the box is filled with the provided material.
  17771. */
  17772. fill: Property | undefined;
  17773. /**
  17774. * Gets or sets the material used to fill the box.
  17775. */
  17776. material: MaterialProperty | undefined;
  17777. /**
  17778. * Gets or sets the Property specifying whether the box is outlined.
  17779. */
  17780. outline: Property | undefined;
  17781. /**
  17782. * Gets or sets the Property specifying the {@link Color} of the outline.
  17783. */
  17784. outlineColor: Property | undefined;
  17785. /**
  17786. * Gets or sets the numeric Property specifying the width of the outline.
  17787. */
  17788. outlineWidth: Property | undefined;
  17789. /**
  17790. * Get or sets the enum Property specifying whether the box
  17791. casts or receives shadows from light sources.
  17792. */
  17793. shadows: Property | undefined;
  17794. /**
  17795. * Gets or sets the {@link DistanceDisplayCondition} Property specifying at what distance from the camera that this box will be displayed.
  17796. */
  17797. distanceDisplayCondition: Property | undefined;
  17798. /**
  17799. * Duplicates this instance.
  17800. * @param [result] - The object onto which to store the result.
  17801. * @returns The modified result parameter or a new instance if one was not provided.
  17802. */
  17803. clone(result?: BoxGraphics): BoxGraphics;
  17804. /**
  17805. * Assigns each unassigned property on this object to the value
  17806. of the same property on the provided source object.
  17807. * @param source - The object to be merged into this object.
  17808. */
  17809. merge(source: BoxGraphics): void;
  17810. }
  17811. /**
  17812. * A {@link Property} whose value is lazily evaluated by a callback function.
  17813. * @param callback - The function to be called when the property is evaluated.
  17814. * @param isConstant - <code>true</code> when the callback function returns the same value every time, <code>false</code> if the value will change.
  17815. */
  17816. export class CallbackProperty {
  17817. constructor(callback: CallbackProperty.Callback, isConstant: boolean);
  17818. /**
  17819. * Gets a value indicating if this property is constant.
  17820. */
  17821. readonly isConstant: boolean;
  17822. /**
  17823. * Gets the event that is raised whenever the definition of this property changes.
  17824. The definition is changed whenever setCallback is called.
  17825. */
  17826. readonly definitionChanged: Event;
  17827. /**
  17828. * Gets the value of the property.
  17829. * @param [time] - The time for which to retrieve the value. This parameter is unused since the value does not change with respect to time.
  17830. * @param [result] - The object to store the value into, if omitted, a new instance is created and returned.
  17831. * @returns The modified result parameter or a new instance if the result parameter was not supplied or is unsupported.
  17832. */
  17833. getValue(time?: JulianDate, result?: any): any;
  17834. /**
  17835. * Sets the callback to be used.
  17836. * @param callback - The function to be called when the property is evaluated.
  17837. * @param isConstant - <code>true</code> when the callback function returns the same value every time, <code>false</code> if the value will change.
  17838. */
  17839. setCallback(callback: CallbackProperty.Callback, isConstant: boolean): void;
  17840. /**
  17841. * Compares this property to the provided property and returns
  17842. <code>true</code> if they are equal, <code>false</code> otherwise.
  17843. * @param [other] - The other property.
  17844. * @returns <code>true</code> if left and right are equal, <code>false</code> otherwise.
  17845. */
  17846. equals(other?: Property): boolean;
  17847. }
  17848. export namespace CallbackProperty {
  17849. /**
  17850. * A function that returns the value of the property.
  17851. * @param [time] - The time for which to retrieve the value.
  17852. * @param [result] - The object to store the value into, if omitted, a new instance is created and returned.
  17853. */
  17854. type Callback = (time?: JulianDate, result?: any) => any;
  17855. }
  17856. export namespace Cesium3DTilesetGraphics {
  17857. /**
  17858. * Initialization options for the Cesium3DTilesetGraphics constructor
  17859. * @property [show = true] - A boolean Property specifying the visibility of the tileset.
  17860. * @property [uri] - A string or Resource Property specifying the URI of the tileset.
  17861. * @property [maximumScreenSpaceError] - A number or Property specifying the maximum screen space error used to drive level of detail refinement.
  17862. */
  17863. type ConstructorOptions = {
  17864. show?: Property | boolean;
  17865. uri?: Property | string | Resource;
  17866. maximumScreenSpaceError?: Property | number;
  17867. };
  17868. }
  17869. /**
  17870. * A 3D Tiles tileset represented by an {@link Entity}.
  17871. The tileset modelMatrix is determined by the containing Entity position and orientation
  17872. or is left unset if position is undefined.
  17873. * @param [options] - Object describing initialization options
  17874. */
  17875. export class Cesium3DTilesetGraphics {
  17876. constructor(options?: Cesium3DTilesetGraphics.ConstructorOptions);
  17877. /**
  17878. * Gets the event that is raised whenever a property or sub-property is changed or modified.
  17879. */
  17880. readonly definitionChanged: Event;
  17881. /**
  17882. * Gets or sets the boolean Property specifying the visibility of the model.
  17883. */
  17884. show: Property | undefined;
  17885. /**
  17886. * Gets or sets the string Property specifying the URI of the glTF asset.
  17887. */
  17888. uri: Property | undefined;
  17889. /**
  17890. * Gets or sets the maximum screen space error used to drive level of detail refinement.
  17891. */
  17892. maximumScreenSpaceError: Property | undefined;
  17893. /**
  17894. * Duplicates this instance.
  17895. * @param [result] - The object onto which to store the result.
  17896. * @returns The modified result parameter or a new instance if one was not provided.
  17897. */
  17898. clone(result?: Cesium3DTilesetGraphics): Cesium3DTilesetGraphics;
  17899. /**
  17900. * Assigns each unassigned property on this object to the value
  17901. of the same property on the provided source object.
  17902. * @param source - The object to be merged into this object.
  17903. */
  17904. merge(source: Cesium3DTilesetGraphics): void;
  17905. }
  17906. /**
  17907. * A {@link Visualizer} which maps {@link Entity#tileset} to a {@link Cesium3DTileset}.
  17908. * @param scene - The scene the primitives will be rendered in.
  17909. * @param entityCollection - The entityCollection to visualize.
  17910. */
  17911. export class Cesium3DTilesetVisualizer {
  17912. constructor(scene: Scene, entityCollection: EntityCollection);
  17913. /**
  17914. * Updates models created this visualizer to match their
  17915. Entity counterpart at the given time.
  17916. * @param time - The time to update to.
  17917. * @returns This function always returns true.
  17918. */
  17919. update(time: JulianDate): boolean;
  17920. /**
  17921. * Returns true if this object was destroyed; otherwise, false.
  17922. * @returns True if this object was destroyed; otherwise, false.
  17923. */
  17924. isDestroyed(): boolean;
  17925. /**
  17926. * Removes and destroys all primitives created by this instance.
  17927. */
  17928. destroy(): void;
  17929. }
  17930. /**
  17931. * A {@link MaterialProperty} that maps to checkerboard {@link Material} uniforms.
  17932. * @param [options] - Object with the following properties:
  17933. * @param [options.evenColor = Color.WHITE] - A Property specifying the first {@link Color}.
  17934. * @param [options.oddColor = Color.BLACK] - A Property specifying the second {@link Color}.
  17935. * @param [options.repeat = new Cartesian2(2.0, 2.0)] - A {@link Cartesian2} Property specifying how many times the tiles repeat in each direction.
  17936. */
  17937. export class CheckerboardMaterialProperty {
  17938. constructor(options?: {
  17939. evenColor?: Property | Color;
  17940. oddColor?: Property | Color;
  17941. repeat?: Property | Cartesian2;
  17942. });
  17943. /**
  17944. * Gets a value indicating if this property is constant. A property is considered
  17945. constant if getValue always returns the same result for the current definition.
  17946. */
  17947. readonly isConstant: boolean;
  17948. /**
  17949. * Gets the event that is raised whenever the definition of this property changes.
  17950. The definition is considered to have changed if a call to getValue would return
  17951. a different result for the same time.
  17952. */
  17953. readonly definitionChanged: Event;
  17954. /**
  17955. * Gets or sets the Property specifying the first {@link Color}.
  17956. */
  17957. evenColor: Property | undefined;
  17958. /**
  17959. * Gets or sets the Property specifying the second {@link Color}.
  17960. */
  17961. oddColor: Property | undefined;
  17962. /**
  17963. * Gets or sets the {@link Cartesian2} Property specifying how many times the tiles repeat in each direction.
  17964. */
  17965. repeat: Property | undefined;
  17966. /**
  17967. * Gets the {@link Material} type at the provided time.
  17968. * @param time - The time for which to retrieve the type.
  17969. * @returns The type of material.
  17970. */
  17971. getType(time: JulianDate): string;
  17972. /**
  17973. * Gets the value of the property at the provided time.
  17974. * @param time - The time for which to retrieve the value.
  17975. * @param [result] - The object to store the value into, if omitted, a new instance is created and returned.
  17976. * @returns The modified result parameter or a new instance if the result parameter was not supplied.
  17977. */
  17978. getValue(time: JulianDate, result?: any): any;
  17979. /**
  17980. * Compares this property to the provided property and returns
  17981. <code>true</code> if they are equal, <code>false</code> otherwise.
  17982. * @param [other] - The other property.
  17983. * @returns <code>true</code> if left and right are equal, <code>false</code> otherwise.
  17984. */
  17985. equals(other?: Property): boolean;
  17986. }
  17987. /**
  17988. * A {@link MaterialProperty} that maps to solid color {@link Material} uniforms.
  17989. * @param [color = Color.WHITE] - The {@link Color} Property to be used.
  17990. */
  17991. export class ColorMaterialProperty {
  17992. constructor(color?: Property | Color);
  17993. /**
  17994. * Gets a value indicating if this property is constant. A property is considered
  17995. constant if getValue always returns the same result for the current definition.
  17996. */
  17997. readonly isConstant: boolean;
  17998. /**
  17999. * Gets the event that is raised whenever the definition of this property changes.
  18000. The definition is considered to have changed if a call to getValue would return
  18001. a different result for the same time.
  18002. */
  18003. readonly definitionChanged: Event;
  18004. /**
  18005. * Gets or sets the {@link Color} {@link Property}.
  18006. */
  18007. color: Property | undefined;
  18008. /**
  18009. * Gets the {@link Material} type at the provided time.
  18010. * @param time - The time for which to retrieve the type.
  18011. * @returns The type of material.
  18012. */
  18013. getType(time: JulianDate): string;
  18014. /**
  18015. * Gets the value of the property at the provided time.
  18016. * @param time - The time for which to retrieve the value.
  18017. * @param [result] - The object to store the value into, if omitted, a new instance is created and returned.
  18018. * @returns The modified result parameter or a new instance if the result parameter was not supplied.
  18019. */
  18020. getValue(time: JulianDate, result?: any): any;
  18021. /**
  18022. * Compares this property to the provided property and returns
  18023. <code>true</code> if they are equal, <code>false</code> otherwise.
  18024. * @param [other] - The other property.
  18025. * @returns <code>true</code> if left and right are equal, <code>false</code> otherwise.
  18026. */
  18027. equals(other?: Property): boolean;
  18028. }
  18029. /**
  18030. * Non-destructively composites multiple {@link EntityCollection} instances into a single collection.
  18031. If a Entity with the same ID exists in multiple collections, it is non-destructively
  18032. merged into a single new entity instance. If an entity has the same property in multiple
  18033. collections, the property of the Entity in the last collection of the list it
  18034. belongs to is used. CompositeEntityCollection can be used almost anywhere that a
  18035. EntityCollection is used.
  18036. * @param [collections] - The initial list of EntityCollection instances to merge.
  18037. * @param [owner] - The data source (or composite entity collection) which created this collection.
  18038. */
  18039. export class CompositeEntityCollection {
  18040. constructor(collections?: EntityCollection[], owner?: DataSource | CompositeEntityCollection);
  18041. /**
  18042. * Gets the event that is fired when entities are added or removed from the collection.
  18043. The generated event is a {@link EntityCollection.collectionChangedEventCallback}.
  18044. */
  18045. readonly collectionChanged: Event;
  18046. /**
  18047. * Gets a globally unique identifier for this collection.
  18048. */
  18049. readonly id: string;
  18050. /**
  18051. * Gets the array of Entity instances in the collection.
  18052. This array should not be modified directly.
  18053. */
  18054. readonly values: Entity[];
  18055. /**
  18056. * Gets the owner of this composite entity collection, ie. the data source or composite entity collection which created it.
  18057. */
  18058. readonly owner: DataSource | CompositeEntityCollection;
  18059. /**
  18060. * Adds a collection to the composite.
  18061. * @param collection - the collection to add.
  18062. * @param [index] - the index to add the collection at. If omitted, the collection will
  18063. added on top of all existing collections.
  18064. */
  18065. addCollection(collection: EntityCollection, index?: number): void;
  18066. /**
  18067. * Removes a collection from this composite, if present.
  18068. * @param collection - The collection to remove.
  18069. * @returns true if the collection was in the composite and was removed,
  18070. false if the collection was not in the composite.
  18071. */
  18072. removeCollection(collection: EntityCollection): boolean;
  18073. /**
  18074. * Removes all collections from this composite.
  18075. */
  18076. removeAllCollections(): void;
  18077. /**
  18078. * Checks to see if the composite contains a given collection.
  18079. * @param collection - the collection to check for.
  18080. * @returns true if the composite contains the collection, false otherwise.
  18081. */
  18082. containsCollection(collection: EntityCollection): boolean;
  18083. /**
  18084. * Returns true if the provided entity is in this collection, false otherwise.
  18085. * @param entity - The entity.
  18086. * @returns true if the provided entity is in this collection, false otherwise.
  18087. */
  18088. contains(entity: Entity): boolean;
  18089. /**
  18090. * Determines the index of a given collection in the composite.
  18091. * @param collection - The collection to find the index of.
  18092. * @returns The index of the collection in the composite, or -1 if the collection does not exist in the composite.
  18093. */
  18094. indexOfCollection(collection: EntityCollection): number;
  18095. /**
  18096. * Gets a collection by index from the composite.
  18097. * @param index - the index to retrieve.
  18098. */
  18099. getCollection(index: number): void;
  18100. /**
  18101. * Gets the number of collections in this composite.
  18102. */
  18103. getCollectionsLength(): void;
  18104. /**
  18105. * Raises a collection up one position in the composite.
  18106. * @param collection - the collection to move.
  18107. */
  18108. raiseCollection(collection: EntityCollection): void;
  18109. /**
  18110. * Lowers a collection down one position in the composite.
  18111. * @param collection - the collection to move.
  18112. */
  18113. lowerCollection(collection: EntityCollection): void;
  18114. /**
  18115. * Raises a collection to the top of the composite.
  18116. * @param collection - the collection to move.
  18117. */
  18118. raiseCollectionToTop(collection: EntityCollection): void;
  18119. /**
  18120. * Lowers a collection to the bottom of the composite.
  18121. * @param collection - the collection to move.
  18122. */
  18123. lowerCollectionToBottom(collection: EntityCollection): void;
  18124. /**
  18125. * Prevents {@link EntityCollection#collectionChanged} events from being raised
  18126. until a corresponding call is made to {@link EntityCollection#resumeEvents}, at which
  18127. point a single event will be raised that covers all suspended operations.
  18128. This allows for many items to be added and removed efficiently.
  18129. While events are suspended, recompositing of the collections will
  18130. also be suspended, as this can be a costly operation.
  18131. This function can be safely called multiple times as long as there
  18132. are corresponding calls to {@link EntityCollection#resumeEvents}.
  18133. */
  18134. suspendEvents(): void;
  18135. /**
  18136. * Resumes raising {@link EntityCollection#collectionChanged} events immediately
  18137. when an item is added or removed. Any modifications made while while events were suspended
  18138. will be triggered as a single event when this function is called. This function also ensures
  18139. the collection is recomposited if events are also resumed.
  18140. This function is reference counted and can safely be called multiple times as long as there
  18141. are corresponding calls to {@link EntityCollection#resumeEvents}.
  18142. */
  18143. resumeEvents(): void;
  18144. /**
  18145. * Computes the maximum availability of the entities in the collection.
  18146. If the collection contains a mix of infinitely available data and non-infinite data,
  18147. It will return the interval pertaining to the non-infinite data only. If all
  18148. data is infinite, an infinite interval will be returned.
  18149. * @returns The availability of entities in the collection.
  18150. */
  18151. computeAvailability(): TimeInterval;
  18152. /**
  18153. * Gets an entity with the specified id.
  18154. * @param id - The id of the entity to retrieve.
  18155. * @returns The entity with the provided id or undefined if the id did not exist in the collection.
  18156. */
  18157. getById(id: string): Entity | undefined;
  18158. }
  18159. /**
  18160. * A {@link CompositeProperty} which is also a {@link MaterialProperty}.
  18161. */
  18162. export class CompositeMaterialProperty {
  18163. constructor();
  18164. /**
  18165. * Gets a value indicating if this property is constant. A property is considered
  18166. constant if getValue always returns the same result for the current definition.
  18167. */
  18168. readonly isConstant: boolean;
  18169. /**
  18170. * Gets the event that is raised whenever the definition of this property changes.
  18171. The definition is changed whenever setValue is called with data different
  18172. than the current value.
  18173. */
  18174. readonly definitionChanged: Event;
  18175. /**
  18176. * Gets the interval collection.
  18177. */
  18178. intervals: TimeIntervalCollection;
  18179. /**
  18180. * Gets the {@link Material} type at the provided time.
  18181. * @param time - The time for which to retrieve the type.
  18182. * @returns The type of material.
  18183. */
  18184. getType(time: JulianDate): string;
  18185. /**
  18186. * Gets the value of the property at the provided time.
  18187. * @param time - The time for which to retrieve the value.
  18188. * @param [result] - The object to store the value into, if omitted, a new instance is created and returned.
  18189. * @returns The modified result parameter or a new instance if the result parameter was not supplied.
  18190. */
  18191. getValue(time: JulianDate, result?: any): any;
  18192. /**
  18193. * Compares this property to the provided property and returns
  18194. <code>true</code> if they are equal, <code>false</code> otherwise.
  18195. * @param [other] - The other property.
  18196. * @returns <code>true</code> if left and right are equal, <code>false</code> otherwise.
  18197. */
  18198. equals(other?: Property): boolean;
  18199. }
  18200. /**
  18201. * A {@link CompositeProperty} which is also a {@link PositionProperty}.
  18202. * @param [referenceFrame = ReferenceFrame.FIXED] - The reference frame in which the position is defined.
  18203. */
  18204. export class CompositePositionProperty {
  18205. constructor(referenceFrame?: ReferenceFrame);
  18206. /**
  18207. * Gets a value indicating if this property is constant. A property is considered
  18208. constant if getValue always returns the same result for the current definition.
  18209. */
  18210. readonly isConstant: boolean;
  18211. /**
  18212. * Gets the event that is raised whenever the definition of this property changes.
  18213. The definition is changed whenever setValue is called with data different
  18214. than the current value.
  18215. */
  18216. readonly definitionChanged: Event;
  18217. /**
  18218. * Gets the interval collection.
  18219. */
  18220. intervals: TimeIntervalCollection;
  18221. /**
  18222. * Gets or sets the reference frame which this position presents itself as.
  18223. Each PositionProperty making up this object has it's own reference frame,
  18224. so this property merely exposes a "preferred" reference frame for clients
  18225. to use.
  18226. */
  18227. referenceFrame: ReferenceFrame;
  18228. /**
  18229. * Gets the value of the property at the provided time in the fixed frame.
  18230. * @param time - The time for which to retrieve the value.
  18231. * @param [result] - The object to store the value into, if omitted, a new instance is created and returned.
  18232. * @returns The modified result parameter or a new instance if the result parameter was not supplied.
  18233. */
  18234. getValue(time: JulianDate, result?: any): any;
  18235. /**
  18236. * Gets the value of the property at the provided time and in the provided reference frame.
  18237. * @param time - The time for which to retrieve the value.
  18238. * @param referenceFrame - The desired referenceFrame of the result.
  18239. * @param [result] - The object to store the value into, if omitted, a new instance is created and returned.
  18240. * @returns The modified result parameter or a new instance if the result parameter was not supplied.
  18241. */
  18242. getValueInReferenceFrame(time: JulianDate, referenceFrame: ReferenceFrame, result?: Cartesian3): Cartesian3;
  18243. /**
  18244. * Compares this property to the provided property and returns
  18245. <code>true</code> if they are equal, <code>false</code> otherwise.
  18246. * @param [other] - The other property.
  18247. * @returns <code>true</code> if left and right are equal, <code>false</code> otherwise.
  18248. */
  18249. equals(other?: Property): boolean;
  18250. }
  18251. /**
  18252. * A {@link Property} which is defined by a {@link TimeIntervalCollection}, where the
  18253. data property of each {@link TimeInterval} is another Property instance which is
  18254. evaluated at the provided time.
  18255. * @example
  18256. * var constantProperty = ...;
  18257. var sampledProperty = ...;
  18258. //Create a composite property from two previously defined properties
  18259. //where the property is valid on August 1st, 2012 and uses a constant
  18260. //property for the first half of the day and a sampled property for the
  18261. //remaining half.
  18262. var composite = new Cesium.CompositeProperty();
  18263. composite.intervals.addInterval(Cesium.TimeInterval.fromIso8601({
  18264. iso8601 : '2012-08-01T00:00:00.00Z/2012-08-01T12:00:00.00Z',
  18265. data : constantProperty
  18266. }));
  18267. composite.intervals.addInterval(Cesium.TimeInterval.fromIso8601({
  18268. iso8601 : '2012-08-01T12:00:00.00Z/2012-08-02T00:00:00.00Z',
  18269. isStartIncluded : false,
  18270. isStopIncluded : false,
  18271. data : sampledProperty
  18272. }));
  18273. */
  18274. export class CompositeProperty {
  18275. constructor();
  18276. /**
  18277. * Gets a value indicating if this property is constant. A property is considered
  18278. constant if getValue always returns the same result for the current definition.
  18279. */
  18280. readonly isConstant: boolean;
  18281. /**
  18282. * Gets the event that is raised whenever the definition of this property changes.
  18283. The definition is changed whenever setValue is called with data different
  18284. than the current value.
  18285. */
  18286. readonly definitionChanged: Event;
  18287. /**
  18288. * Gets the interval collection.
  18289. */
  18290. intervals: TimeIntervalCollection;
  18291. /**
  18292. * Gets the value of the property at the provided time.
  18293. * @param time - The time for which to retrieve the value.
  18294. * @param [result] - The object to store the value into, if omitted, a new instance is created and returned.
  18295. * @returns The modified result parameter or a new instance if the result parameter was not supplied.
  18296. */
  18297. getValue(time: JulianDate, result?: any): any;
  18298. /**
  18299. * Compares this property to the provided property and returns
  18300. <code>true</code> if they are equal, <code>false</code> otherwise.
  18301. * @param [other] - The other property.
  18302. * @returns <code>true</code> if left and right are equal, <code>false</code> otherwise.
  18303. */
  18304. equals(other?: Property): boolean;
  18305. }
  18306. /**
  18307. * A {@link PositionProperty} whose value does not change in respect to the
  18308. {@link ReferenceFrame} in which is it defined.
  18309. * @param [value] - The property value.
  18310. * @param [referenceFrame = ReferenceFrame.FIXED] - The reference frame in which the position is defined.
  18311. */
  18312. export class ConstantPositionProperty {
  18313. constructor(value?: Cartesian3, referenceFrame?: ReferenceFrame);
  18314. /**
  18315. * Gets a value indicating if this property is constant. A property is considered
  18316. constant if getValue always returns the same result for the current definition.
  18317. */
  18318. readonly isConstant: boolean;
  18319. /**
  18320. * Gets the event that is raised whenever the definition of this property changes.
  18321. The definition is considered to have changed if a call to getValue would return
  18322. a different result for the same time.
  18323. */
  18324. readonly definitionChanged: Event;
  18325. /**
  18326. * Gets the reference frame in which the position is defined.
  18327. */
  18328. referenceFrame: ReferenceFrame;
  18329. /**
  18330. * Gets the value of the property at the provided time in the fixed frame.
  18331. * @param time - The time for which to retrieve the value.
  18332. * @param [result] - The object to store the value into, if omitted, a new instance is created and returned.
  18333. * @returns The modified result parameter or a new instance if the result parameter was not supplied.
  18334. */
  18335. getValue(time: JulianDate, result?: any): any;
  18336. /**
  18337. * Sets the value of the property.
  18338. * @param value - The property value.
  18339. * @param [referenceFrame = this.referenceFrame] - The reference frame in which the position is defined.
  18340. */
  18341. setValue(value: Cartesian3, referenceFrame?: ReferenceFrame): void;
  18342. /**
  18343. * Gets the value of the property at the provided time and in the provided reference frame.
  18344. * @param time - The time for which to retrieve the value.
  18345. * @param referenceFrame - The desired referenceFrame of the result.
  18346. * @param [result] - The object to store the value into, if omitted, a new instance is created and returned.
  18347. * @returns The modified result parameter or a new instance if the result parameter was not supplied.
  18348. */
  18349. getValueInReferenceFrame(time: JulianDate, referenceFrame: ReferenceFrame, result?: Cartesian3): Cartesian3;
  18350. /**
  18351. * Compares this property to the provided property and returns
  18352. <code>true</code> if they are equal, <code>false</code> otherwise.
  18353. * @param [other] - The other property.
  18354. * @returns <code>true</code> if left and right are equal, <code>false</code> otherwise.
  18355. */
  18356. equals(other?: Property): boolean;
  18357. }
  18358. /**
  18359. * A {@link Property} whose value does not change with respect to simulation time.
  18360. * @param [value] - The property value.
  18361. */
  18362. export class ConstantProperty {
  18363. constructor(value?: any);
  18364. /**
  18365. * Gets a value indicating if this property is constant.
  18366. This property always returns <code>true</code>.
  18367. */
  18368. readonly isConstant: boolean;
  18369. /**
  18370. * Gets the event that is raised whenever the definition of this property changes.
  18371. The definition is changed whenever setValue is called with data different
  18372. than the current value.
  18373. */
  18374. readonly definitionChanged: Event;
  18375. /**
  18376. * Gets the value of the property.
  18377. * @param [time] - The time for which to retrieve the value. This parameter is unused since the value does not change with respect to time.
  18378. * @param [result] - The object to store the value into, if omitted, a new instance is created and returned.
  18379. * @returns The modified result parameter or a new instance if the result parameter was not supplied.
  18380. */
  18381. getValue(time?: JulianDate, result?: any): any;
  18382. /**
  18383. * Sets the value of the property.
  18384. * @param value - The property value.
  18385. */
  18386. setValue(value: any): void;
  18387. /**
  18388. * Compares this property to the provided property and returns
  18389. <code>true</code> if they are equal, <code>false</code> otherwise.
  18390. * @param [other] - The other property.
  18391. * @returns <code>true</code> if left and right are equal, <code>false</code> otherwise.
  18392. */
  18393. equals(other?: Property): boolean;
  18394. /**
  18395. * Gets this property's value.
  18396. * @returns This property's value.
  18397. */
  18398. valueOf(): any;
  18399. /**
  18400. * Creates a string representing this property's value.
  18401. * @returns A string representing the property's value.
  18402. */
  18403. toString(): string;
  18404. }
  18405. /**
  18406. * A {@link GeometryUpdater} for corridors.
  18407. Clients do not normally create this class directly, but instead rely on {@link DataSourceDisplay}.
  18408. * @param entity - The entity containing the geometry to be visualized.
  18409. * @param scene - The scene where visualization is taking place.
  18410. */
  18411. export class CorridorGeometryUpdater {
  18412. constructor(entity: Entity, scene: Scene);
  18413. /**
  18414. * Creates the geometry instance which represents the fill of the geometry.
  18415. * @param time - The time to use when retrieving initial attribute values.
  18416. * @returns The geometry instance representing the filled portion of the geometry.
  18417. */
  18418. createFillGeometryInstance(time: JulianDate): GeometryInstance;
  18419. /**
  18420. * Creates the geometry instance which represents the outline of the geometry.
  18421. * @param time - The time to use when retrieving initial attribute values.
  18422. * @returns The geometry instance representing the outline portion of the geometry.
  18423. */
  18424. createOutlineGeometryInstance(time: JulianDate): GeometryInstance;
  18425. }
  18426. export namespace CorridorGraphics {
  18427. /**
  18428. * Initialization options for the CorridorGraphics constructor
  18429. * @property [show = true] - A boolean Property specifying the visibility of the corridor.
  18430. * @property [positions] - A Property specifying the array of {@link Cartesian3} positions that define the centerline of the corridor.
  18431. * @property [width] - A numeric Property specifying the distance between the edges of the corridor.
  18432. * @property [height = 0] - A numeric Property specifying the altitude of the corridor relative to the ellipsoid surface.
  18433. * @property [heightReference = HeightReference.NONE] - A Property specifying what the height is relative to.
  18434. * @property [extrudedHeight] - A numeric Property specifying the altitude of the corridor's extruded face relative to the ellipsoid surface.
  18435. * @property [extrudedHeightReference = HeightReference.NONE] - A Property specifying what the extrudedHeight is relative to.
  18436. * @property [cornerType = CornerType.ROUNDED] - A {@link CornerType} Property specifying the style of the corners.
  18437. * @property [granularity = Cesium.Math.RADIANS_PER_DEGREE] - A numeric Property specifying the distance between each latitude and longitude.
  18438. * @property [fill = true] - A boolean Property specifying whether the corridor is filled with the provided material.
  18439. * @property [material = Color.WHITE] - A Property specifying the material used to fill the corridor.
  18440. * @property [outline = false] - A boolean Property specifying whether the corridor is outlined.
  18441. * @property [outlineColor = Color.BLACK] - A Property specifying the {@link Color} of the outline.
  18442. * @property [outlineWidth = 1.0] - A numeric Property specifying the width of the outline.
  18443. * @property [shadows = ShadowMode.DISABLED] - An enum Property specifying whether the corridor casts or receives shadows from light sources.
  18444. * @property [distanceDisplayCondition] - A Property specifying at what distance from the camera that this corridor will be displayed.
  18445. * @property [classificationType = ClassificationType.BOTH] - An enum Property specifying whether this corridor will classify terrain, 3D Tiles, or both when on the ground.
  18446. * @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.
  18447. */
  18448. type ConstructorOptions = {
  18449. show?: Property | boolean;
  18450. positions?: Property | Cartesian3;
  18451. width?: Property | number;
  18452. height?: Property | number;
  18453. heightReference?: Property | HeightReference;
  18454. extrudedHeight?: Property | number;
  18455. extrudedHeightReference?: Property | HeightReference;
  18456. cornerType?: Property | CornerType;
  18457. granularity?: Property | number;
  18458. fill?: Property | boolean;
  18459. material?: MaterialProperty | Color;
  18460. outline?: Property | boolean;
  18461. outlineColor?: Property | Color;
  18462. outlineWidth?: Property | number;
  18463. shadows?: Property | ShadowMode;
  18464. distanceDisplayCondition?: Property | DistanceDisplayCondition;
  18465. classificationType?: Property | ClassificationType;
  18466. zIndex?: ConstantProperty | number;
  18467. };
  18468. }
  18469. /**
  18470. * Describes a corridor, which is a shape defined by a centerline and width that
  18471. conforms to the curvature of the globe. It can be placed on the surface or at altitude
  18472. and can optionally be extruded into a volume.
  18473. * @param [options] - Object describing initialization options
  18474. */
  18475. export class CorridorGraphics {
  18476. constructor(options?: CorridorGraphics.ConstructorOptions);
  18477. /**
  18478. * Gets the event that is raised whenever a property or sub-property is changed or modified.
  18479. */
  18480. readonly definitionChanged: Event;
  18481. /**
  18482. * Gets or sets the boolean Property specifying the visibility of the corridor.
  18483. */
  18484. show: Property | undefined;
  18485. /**
  18486. * Gets or sets a Property specifying the array of {@link Cartesian3} positions that define the centerline of the corridor.
  18487. */
  18488. positions: Property | undefined;
  18489. /**
  18490. * Gets or sets the numeric Property specifying the width of the corridor.
  18491. */
  18492. width: Property | undefined;
  18493. /**
  18494. * Gets or sets the numeric Property specifying the altitude of the corridor.
  18495. */
  18496. height: Property | undefined;
  18497. /**
  18498. * Gets or sets the Property specifying the {@link HeightReference}.
  18499. */
  18500. heightReference: Property | undefined;
  18501. /**
  18502. * Gets or sets the numeric Property specifying the altitude of the corridor extrusion.
  18503. Setting this property creates a corridor shaped volume starting at height and ending
  18504. at this altitude.
  18505. */
  18506. extrudedHeight: Property | undefined;
  18507. /**
  18508. * Gets or sets the Property specifying the extruded {@link HeightReference}.
  18509. */
  18510. extrudedHeightReference: Property | undefined;
  18511. /**
  18512. * Gets or sets the {@link CornerType} Property specifying how corners are styled.
  18513. */
  18514. cornerType: Property | undefined;
  18515. /**
  18516. * Gets or sets the numeric Property specifying the sampling distance between each latitude and longitude point.
  18517. */
  18518. granularity: Property | undefined;
  18519. /**
  18520. * Gets or sets the boolean Property specifying whether the corridor is filled with the provided material.
  18521. */
  18522. fill: Property | undefined;
  18523. /**
  18524. * Gets or sets the Property specifying the material used to fill the corridor.
  18525. */
  18526. material: MaterialProperty | undefined;
  18527. /**
  18528. * Gets or sets the Property specifying whether the corridor is outlined.
  18529. */
  18530. outline: Property | undefined;
  18531. /**
  18532. * Gets or sets the Property specifying the {@link Color} of the outline.
  18533. */
  18534. outlineColor: Property | undefined;
  18535. /**
  18536. * Gets or sets the numeric Property specifying the width of the outline.
  18537. */
  18538. outlineWidth: Property | undefined;
  18539. /**
  18540. * Get or sets the enum Property specifying whether the corridor
  18541. casts or receives shadows from light sources.
  18542. */
  18543. shadows: Property | undefined;
  18544. /**
  18545. * Gets or sets the {@link DistanceDisplayCondition} Property specifying at what distance from the camera that this corridor will be displayed.
  18546. */
  18547. distanceDisplayCondition: Property | undefined;
  18548. /**
  18549. * Gets or sets the {@link ClassificationType} Property specifying whether this corridor will classify terrain, 3D Tiles, or both when on the ground.
  18550. */
  18551. classificationType: Property | undefined;
  18552. /**
  18553. * 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.
  18554. */
  18555. zIndex: ConstantProperty | undefined;
  18556. /**
  18557. * Duplicates this instance.
  18558. * @param [result] - The object onto which to store the result.
  18559. * @returns The modified result parameter or a new instance if one was not provided.
  18560. */
  18561. clone(result?: CorridorGraphics): CorridorGraphics;
  18562. /**
  18563. * Assigns each unassigned property on this object to the value
  18564. of the same property on the provided source object.
  18565. * @param source - The object to be merged into this object.
  18566. */
  18567. merge(source: CorridorGraphics): void;
  18568. }
  18569. /**
  18570. * A {@link DataSource} implementation which can be used to manually manage a group of entities.
  18571. * @example
  18572. * var dataSource = new Cesium.CustomDataSource('myData');
  18573. var entity = dataSource.entities.add({
  18574. position : Cesium.Cartesian3.fromDegrees(1, 2, 0),
  18575. billboard : {
  18576. image : 'image.png'
  18577. }
  18578. });
  18579. viewer.dataSources.add(dataSource);
  18580. * @param [name] - A human-readable name for this instance.
  18581. */
  18582. export class CustomDataSource {
  18583. constructor(name?: string);
  18584. /**
  18585. * Gets or sets a human-readable name for this instance.
  18586. */
  18587. name: string;
  18588. /**
  18589. * Gets or sets the clock for this instance.
  18590. */
  18591. clock: DataSourceClock;
  18592. /**
  18593. * Gets the collection of {@link Entity} instances.
  18594. */
  18595. entities: EntityCollection;
  18596. /**
  18597. * Gets or sets whether the data source is currently loading data.
  18598. */
  18599. isLoading: boolean;
  18600. /**
  18601. * Gets an event that will be raised when the underlying data changes.
  18602. */
  18603. changedEvent: Event;
  18604. /**
  18605. * Gets an event that will be raised if an error is encountered during processing.
  18606. */
  18607. errorEvent: Event;
  18608. /**
  18609. * Gets an event that will be raised when the data source either starts or stops loading.
  18610. */
  18611. loadingEvent: Event;
  18612. /**
  18613. * Gets whether or not this data source should be displayed.
  18614. */
  18615. show: boolean;
  18616. /**
  18617. * Gets or sets the clustering options for this data source. This object can be shared between multiple data sources.
  18618. */
  18619. clustering: EntityCluster;
  18620. /**
  18621. * Updates the data source to the provided time. This function is optional and
  18622. is not required to be implemented. It is provided for data sources which
  18623. retrieve data based on the current animation time or scene state.
  18624. If implemented, update will be called by {@link DataSourceDisplay} once a frame.
  18625. * @param time - The simulation time.
  18626. * @returns True if this data source is ready to be displayed at the provided time, false otherwise.
  18627. */
  18628. update(time: JulianDate): boolean;
  18629. }
  18630. /**
  18631. * A {@link GeometryUpdater} for cylinders.
  18632. Clients do not normally create this class directly, but instead rely on {@link DataSourceDisplay}.
  18633. * @param entity - The entity containing the geometry to be visualized.
  18634. * @param scene - The scene where visualization is taking place.
  18635. */
  18636. export class CylinderGeometryUpdater {
  18637. constructor(entity: Entity, scene: Scene);
  18638. /**
  18639. * Creates the geometry instance which represents the fill of the geometry.
  18640. * @param time - The time to use when retrieving initial attribute values.
  18641. * @returns The geometry instance representing the filled portion of the geometry.
  18642. */
  18643. createFillGeometryInstance(time: JulianDate): GeometryInstance;
  18644. /**
  18645. * Creates the geometry instance which represents the outline of the geometry.
  18646. * @param time - The time to use when retrieving initial attribute values.
  18647. * @returns The geometry instance representing the outline portion of the geometry.
  18648. */
  18649. createOutlineGeometryInstance(time: JulianDate): GeometryInstance;
  18650. }
  18651. export namespace CylinderGraphics {
  18652. /**
  18653. * Initialization options for the CylinderGraphics constructor
  18654. * @property [show = true] - A boolean Property specifying the visibility of the cylinder.
  18655. * @property [length] - A numeric Property specifying the length of the cylinder.
  18656. * @property [topRadius] - A numeric Property specifying the radius of the top of the cylinder.
  18657. * @property [bottomRadius] - A numeric Property specifying the radius of the bottom of the cylinder.
  18658. * @property [heightReference = HeightReference.NONE] - A Property specifying what the height from the entity position is relative to.
  18659. * @property [fill = true] - A boolean Property specifying whether the cylinder is filled with the provided material.
  18660. * @property [material = Color.WHITE] - A Property specifying the material used to fill the cylinder.
  18661. * @property [outline = false] - A boolean Property specifying whether the cylinder is outlined.
  18662. * @property [outlineColor = Color.BLACK] - A Property specifying the {@link Color} of the outline.
  18663. * @property [outlineWidth = 1.0] - A numeric Property specifying the width of the outline.
  18664. * @property [numberOfVerticalLines = 16] - A numeric Property specifying the number of vertical lines to draw along the perimeter for the outline.
  18665. * @property [slices = 128] - The number of edges around the perimeter of the cylinder.
  18666. * @property [shadows = ShadowMode.DISABLED] - An enum Property specifying whether the cylinder casts or receives shadows from light sources.
  18667. * @property [distanceDisplayCondition] - A Property specifying at what distance from the camera that this cylinder will be displayed.
  18668. */
  18669. type ConstructorOptions = {
  18670. show?: Property | boolean;
  18671. length?: Property | number;
  18672. topRadius?: Property | number;
  18673. bottomRadius?: Property | number;
  18674. heightReference?: Property | HeightReference;
  18675. fill?: Property | boolean;
  18676. material?: MaterialProperty | Color;
  18677. outline?: Property | boolean;
  18678. outlineColor?: Property | Color;
  18679. outlineWidth?: Property | number;
  18680. numberOfVerticalLines?: Property | number;
  18681. slices?: Property | number;
  18682. shadows?: Property | ShadowMode;
  18683. distanceDisplayCondition?: Property | DistanceDisplayCondition;
  18684. };
  18685. }
  18686. /**
  18687. * Describes a cylinder, truncated cone, or cone defined by a length, top radius, and bottom radius.
  18688. The center position and orientation are determined by the containing {@link Entity}.
  18689. * @param [options] - Object describing initialization options
  18690. */
  18691. export class CylinderGraphics {
  18692. constructor(options?: CylinderGraphics.ConstructorOptions);
  18693. /**
  18694. * Gets the event that is raised whenever a property or sub-property is changed or modified.
  18695. */
  18696. readonly definitionChanged: Event;
  18697. /**
  18698. * Gets or sets the boolean Property specifying the visibility of the cylinder.
  18699. */
  18700. show: Property | undefined;
  18701. /**
  18702. * Gets or sets the numeric Property specifying the length of the cylinder.
  18703. */
  18704. length: Property | undefined;
  18705. /**
  18706. * Gets or sets the numeric Property specifying the radius of the top of the cylinder.
  18707. */
  18708. topRadius: Property | undefined;
  18709. /**
  18710. * Gets or sets the numeric Property specifying the radius of the bottom of the cylinder.
  18711. */
  18712. bottomRadius: Property | undefined;
  18713. /**
  18714. * Gets or sets the Property specifying the {@link HeightReference}.
  18715. */
  18716. heightReference: Property | undefined;
  18717. /**
  18718. * Gets or sets the boolean Property specifying whether the cylinder is filled with the provided material.
  18719. */
  18720. fill: Property | undefined;
  18721. /**
  18722. * Gets or sets the Property specifying the material used to fill the cylinder.
  18723. */
  18724. material: MaterialProperty | undefined;
  18725. /**
  18726. * Gets or sets the boolean Property specifying whether the cylinder is outlined.
  18727. */
  18728. outline: Property | undefined;
  18729. /**
  18730. * Gets or sets the Property specifying the {@link Color} of the outline.
  18731. */
  18732. outlineColor: Property | undefined;
  18733. /**
  18734. * Gets or sets the numeric Property specifying the width of the outline.
  18735. */
  18736. outlineWidth: Property | undefined;
  18737. /**
  18738. * Gets or sets the Property specifying the number of vertical lines to draw along the perimeter for the outline.
  18739. */
  18740. numberOfVerticalLines: Property | undefined;
  18741. /**
  18742. * Gets or sets the Property specifying the number of edges around the perimeter of the cylinder.
  18743. */
  18744. slices: Property | undefined;
  18745. /**
  18746. * Get or sets the enum Property specifying whether the cylinder
  18747. casts or receives shadows from light sources.
  18748. */
  18749. shadows: Property | undefined;
  18750. /**
  18751. * Gets or sets the {@link DistanceDisplayCondition} Property specifying at what distance from the camera that this cylinder will be displayed.
  18752. */
  18753. distanceDisplayCondition: Property | undefined;
  18754. /**
  18755. * Duplicates this instance.
  18756. * @param [result] - The object onto which to store the result.
  18757. * @returns The modified result parameter or a new instance if one was not provided.
  18758. */
  18759. clone(result?: CylinderGraphics): CylinderGraphics;
  18760. /**
  18761. * Assigns each unassigned property on this object to the value
  18762. of the same property on the provided source object.
  18763. * @param source - The object to be merged into this object.
  18764. */
  18765. merge(source: CylinderGraphics): void;
  18766. }
  18767. export namespace CzmlDataSource {
  18768. /**
  18769. * Initialization options for the `load` method.
  18770. * @property [sourceUri] - Overrides the url to use for resolving relative links.
  18771. * @property [credit] - A credit for the data source, which is displayed on the canvas.
  18772. */
  18773. type LoadOptions = {
  18774. sourceUri?: Resource | string;
  18775. credit?: Credit | string;
  18776. };
  18777. }
  18778. /**
  18779. * A {@link DataSource} which processes {@link https://github.com/AnalyticalGraphicsInc/czml-writer/wiki/CZML-Guide|CZML}.
  18780. * @param [name] - An optional name for the data source. This value will be overwritten if a loaded document contains a name.
  18781. */
  18782. export class CzmlDataSource {
  18783. constructor(name?: string);
  18784. /**
  18785. * Creates a Promise to a new instance loaded with the provided CZML data.
  18786. * @param czml - A url or CZML object to be processed.
  18787. * @param [options] - An object specifying configuration options
  18788. * @returns A promise that resolves to the new instance once the data is processed.
  18789. */
  18790. static load(czml: Resource | string | any, options?: CzmlDataSource.LoadOptions): Promise<CzmlDataSource>;
  18791. /**
  18792. * Gets a human-readable name for this instance.
  18793. */
  18794. name: string;
  18795. /**
  18796. * Gets the clock settings defined by the loaded CZML. If no clock is explicitly
  18797. defined in the CZML, the combined availability of all objects is returned. If
  18798. only static data exists, this value is undefined.
  18799. */
  18800. clock: DataSourceClock;
  18801. /**
  18802. * Gets the collection of {@link Entity} instances.
  18803. */
  18804. entities: EntityCollection;
  18805. /**
  18806. * Gets a value indicating if the data source is currently loading data.
  18807. */
  18808. isLoading: boolean;
  18809. /**
  18810. * Gets an event that will be raised when the underlying data changes.
  18811. */
  18812. changedEvent: Event;
  18813. /**
  18814. * Gets an event that will be raised if an error is encountered during processing.
  18815. */
  18816. errorEvent: Event;
  18817. /**
  18818. * Gets an event that will be raised when the data source either starts or stops loading.
  18819. */
  18820. loadingEvent: Event;
  18821. /**
  18822. * Gets whether or not this data source should be displayed.
  18823. */
  18824. show: boolean;
  18825. /**
  18826. * Gets or sets the clustering options for this data source. This object can be shared between multiple data sources.
  18827. */
  18828. clustering: EntityCluster;
  18829. /**
  18830. * Gets the credit that will be displayed for the data source
  18831. */
  18832. credit: Credit;
  18833. /**
  18834. * Gets the array of CZML processing functions.
  18835. */
  18836. static updaters: any[];
  18837. /**
  18838. * Processes the provided url or CZML object without clearing any existing data.
  18839. * @param czml - A url or CZML object to be processed.
  18840. * @param [options] - An object with the following properties:
  18841. * @param [options.sourceUri] - Overrides the url to use for resolving relative links.
  18842. * @returns A promise that resolves to this instances once the data is processed.
  18843. */
  18844. process(czml: Resource | string | any, options?: {
  18845. sourceUri?: string;
  18846. }): Promise<CzmlDataSource>;
  18847. /**
  18848. * Loads the provided url or CZML object, replacing any existing data.
  18849. * @param czml - A url or CZML object to be processed.
  18850. * @param [options] - An object specifying configuration options
  18851. * @returns A promise that resolves to this instances once the data is processed.
  18852. */
  18853. load(czml: Resource | string | any, options?: CzmlDataSource.LoadOptions): Promise<CzmlDataSource>;
  18854. /**
  18855. * Updates the data source to the provided time. This function is optional and
  18856. is not required to be implemented. It is provided for data sources which
  18857. retrieve data based on the current animation time or scene state.
  18858. If implemented, update will be called by {@link DataSourceDisplay} once a frame.
  18859. * @param time - The simulation time.
  18860. * @returns True if this data source is ready to be displayed at the provided time, false otherwise.
  18861. */
  18862. update(time: JulianDate): boolean;
  18863. /**
  18864. * A helper function used by custom CZML updater functions
  18865. which creates or updates a {@link Property} from a CZML packet.
  18866. * @param type - The constructor function for the property being processed.
  18867. * @param object - The object on which the property will be added or updated.
  18868. * @param propertyName - The name of the property on the object.
  18869. * @param packetData - The CZML packet being processed.
  18870. * @param interval - A constraining interval for which the data is valid.
  18871. * @param sourceUri - The originating uri of the data being processed.
  18872. * @param entityCollection - The collection being processsed.
  18873. */
  18874. static processPacketData(type: (...params: any[]) => any, object: any, propertyName: string, packetData: any, interval: TimeInterval, sourceUri: string, entityCollection: EntityCollection): void;
  18875. /**
  18876. * A helper function used by custom CZML updater functions
  18877. which creates or updates a {@link PositionProperty} from a CZML packet.
  18878. * @param object - The object on which the property will be added or updated.
  18879. * @param propertyName - The name of the property on the object.
  18880. * @param packetData - The CZML packet being processed.
  18881. * @param interval - A constraining interval for which the data is valid.
  18882. * @param sourceUri - The originating uri of the data being processed.
  18883. * @param entityCollection - The collection being processsed.
  18884. */
  18885. static processPositionPacketData(object: any, propertyName: string, packetData: any, interval: TimeInterval, sourceUri: string, entityCollection: EntityCollection): void;
  18886. /**
  18887. * A helper function used by custom CZML updater functions
  18888. which creates or updates a {@link MaterialProperty} from a CZML packet.
  18889. * @param object - The object on which the property will be added or updated.
  18890. * @param propertyName - The name of the property on the object.
  18891. * @param packetData - The CZML packet being processed.
  18892. * @param interval - A constraining interval for which the data is valid.
  18893. * @param sourceUri - The originating uri of the data being processed.
  18894. * @param entityCollection - The collection being processsed.
  18895. */
  18896. static processMaterialPacketData(object: any, propertyName: string, packetData: any, interval: TimeInterval, sourceUri: string, entityCollection: EntityCollection): void;
  18897. }
  18898. /**
  18899. * Defines the interface for data sources, which turn arbitrary data into a
  18900. {@link EntityCollection} for generic consumption. This object is an interface
  18901. for documentation purposes and is not intended to be instantiated directly.
  18902. */
  18903. export class DataSource {
  18904. constructor();
  18905. /**
  18906. * Gets a human-readable name for this instance.
  18907. */
  18908. name: string;
  18909. /**
  18910. * Gets the preferred clock settings for this data source.
  18911. */
  18912. clock: DataSourceClock;
  18913. /**
  18914. * Gets the collection of {@link Entity} instances.
  18915. */
  18916. entities: EntityCollection;
  18917. /**
  18918. * Gets a value indicating if the data source is currently loading data.
  18919. */
  18920. isLoading: boolean;
  18921. /**
  18922. * Gets an event that will be raised when the underlying data changes.
  18923. */
  18924. changedEvent: Event;
  18925. /**
  18926. * Gets an event that will be raised if an error is encountered during processing.
  18927. */
  18928. errorEvent: Event;
  18929. /**
  18930. * Gets an event that will be raised when the value of isLoading changes.
  18931. */
  18932. loadingEvent: Event;
  18933. /**
  18934. * Gets whether or not this data source should be displayed.
  18935. */
  18936. show: boolean;
  18937. /**
  18938. * Gets or sets the clustering options for this data source. This object can be shared between multiple data sources.
  18939. */
  18940. clustering: EntityCluster;
  18941. /**
  18942. * Updates the data source to the provided time. This function is optional and
  18943. is not required to be implemented. It is provided for data sources which
  18944. retrieve data based on the current animation time or scene state.
  18945. If implemented, update will be called by {@link DataSourceDisplay} once a frame.
  18946. * @param time - The simulation time.
  18947. * @returns True if this data source is ready to be displayed at the provided time, false otherwise.
  18948. */
  18949. update(time: JulianDate): boolean;
  18950. }
  18951. /**
  18952. * Represents desired clock settings for a particular {@link DataSource}. These settings may be applied
  18953. to the {@link Clock} when the DataSource is loaded.
  18954. */
  18955. export class DataSourceClock {
  18956. constructor();
  18957. /**
  18958. * Gets the event that is raised whenever a new property is assigned.
  18959. */
  18960. readonly definitionChanged: Event;
  18961. /**
  18962. * Gets or sets the desired start time of the clock.
  18963. See {@link Clock#startTime}.
  18964. */
  18965. startTime: JulianDate;
  18966. /**
  18967. * Gets or sets the desired stop time of the clock.
  18968. See {@link Clock#stopTime}.
  18969. */
  18970. stopTime: JulianDate;
  18971. /**
  18972. * Gets or sets the desired current time when this data source is loaded.
  18973. See {@link Clock#currentTime}.
  18974. */
  18975. currentTime: JulianDate;
  18976. /**
  18977. * Gets or sets the desired clock range setting.
  18978. See {@link Clock#clockRange}.
  18979. */
  18980. clockRange: ClockRange;
  18981. /**
  18982. * Gets or sets the desired clock step setting.
  18983. See {@link Clock#clockStep}.
  18984. */
  18985. clockStep: ClockStep;
  18986. /**
  18987. * Gets or sets the desired clock multiplier.
  18988. See {@link Clock#multiplier}.
  18989. */
  18990. multiplier: number;
  18991. /**
  18992. * Duplicates a DataSourceClock instance.
  18993. * @param [result] - The object onto which to store the result.
  18994. * @returns The modified result parameter or a new instance if one was not provided.
  18995. */
  18996. clone(result?: DataSourceClock): DataSourceClock;
  18997. /**
  18998. * Returns true if this DataSourceClock is equivalent to the other
  18999. * @param other - The other DataSourceClock to compare to.
  19000. * @returns <code>true</code> if the DataSourceClocks are equal; otherwise, <code>false</code>.
  19001. */
  19002. equals(other: DataSourceClock): boolean;
  19003. /**
  19004. * Assigns each unassigned property on this object to the value
  19005. of the same property on the provided source object.
  19006. * @param source - The object to be merged into this object.
  19007. */
  19008. merge(source: DataSourceClock): void;
  19009. /**
  19010. * Gets the value of this clock instance as a {@link Clock} object.
  19011. * @returns The modified result parameter or a new instance if one was not provided.
  19012. */
  19013. getValue(): Clock;
  19014. }
  19015. /**
  19016. * A collection of {@link DataSource} instances.
  19017. */
  19018. export class DataSourceCollection {
  19019. constructor();
  19020. /**
  19021. * Gets the number of data sources in this collection.
  19022. */
  19023. readonly length: number;
  19024. /**
  19025. * An event that is raised when a data source is added to the collection.
  19026. Event handlers are passed the data source that was added.
  19027. */
  19028. readonly dataSourceAdded: Event;
  19029. /**
  19030. * An event that is raised when a data source is removed from the collection.
  19031. Event handlers are passed the data source that was removed.
  19032. */
  19033. readonly dataSourceRemoved: Event;
  19034. /**
  19035. * An event that is raised when a data source changes position in the collection. Event handlers are passed the data source
  19036. that was moved, its new index after the move, and its old index prior to the move.
  19037. */
  19038. readonly dataSourceMoved: Event;
  19039. /**
  19040. * Adds a data source to the collection.
  19041. * @param dataSource - A data source or a promise to a data source to add to the collection.
  19042. When passing a promise, the data source will not actually be added
  19043. to the collection until the promise resolves successfully.
  19044. * @returns A Promise that resolves once the data source has been added to the collection.
  19045. */
  19046. add(dataSource: DataSource | Promise<DataSource>): Promise<DataSource>;
  19047. /**
  19048. * Removes a data source from this collection, if present.
  19049. * @param dataSource - The data source to remove.
  19050. * @param [destroy = false] - Whether to destroy the data source in addition to removing it.
  19051. * @returns true if the data source was in the collection and was removed,
  19052. false if the data source was not in the collection.
  19053. */
  19054. remove(dataSource: DataSource, destroy?: boolean): boolean;
  19055. /**
  19056. * Removes all data sources from this collection.
  19057. * @param [destroy = false] - whether to destroy the data sources in addition to removing them.
  19058. */
  19059. removeAll(destroy?: boolean): void;
  19060. /**
  19061. * Checks to see if the collection contains a given data source.
  19062. * @param dataSource - The data source to check for.
  19063. * @returns true if the collection contains the data source, false otherwise.
  19064. */
  19065. contains(dataSource: DataSource): boolean;
  19066. /**
  19067. * Determines the index of a given data source in the collection.
  19068. * @param dataSource - The data source to find the index of.
  19069. * @returns The index of the data source in the collection, or -1 if the data source does not exist in the collection.
  19070. */
  19071. indexOf(dataSource: DataSource): number;
  19072. /**
  19073. * Gets a data source by index from the collection.
  19074. * @param index - the index to retrieve.
  19075. * @returns The data source at the specified index.
  19076. */
  19077. get(index: number): DataSource;
  19078. /**
  19079. * Gets a data source by name from the collection.
  19080. * @param name - The name to retrieve.
  19081. * @returns A list of all data sources matching the provided name.
  19082. */
  19083. getByName(name: string): DataSource[];
  19084. /**
  19085. * Raises a data source up one position in the collection.
  19086. * @param dataSource - The data source to move.
  19087. */
  19088. raise(dataSource: DataSource): void;
  19089. /**
  19090. * Lowers a data source down one position in the collection.
  19091. * @param dataSource - The data source to move.
  19092. */
  19093. lower(dataSource: DataSource): void;
  19094. /**
  19095. * Raises a data source to the top of the collection.
  19096. * @param dataSource - The data source to move.
  19097. */
  19098. raiseToTop(dataSource: DataSource): void;
  19099. /**
  19100. * Lowers a data source to the bottom of the collection.
  19101. * @param dataSource - The data source to move.
  19102. */
  19103. lowerToBottom(dataSource: DataSource): void;
  19104. /**
  19105. * Returns true if this object was destroyed; otherwise, false.
  19106. If this object was destroyed, it should not be used; calling any function other than
  19107. <code>isDestroyed</code> will result in a {@link DeveloperError} exception.
  19108. * @returns true if this object was destroyed; otherwise, false.
  19109. */
  19110. isDestroyed(): boolean;
  19111. /**
  19112. * Destroys the resources held by all data sources in this collection. Explicitly destroying this
  19113. object allows for deterministic release of WebGL resources, instead of relying on the garbage
  19114. collector. Once this object is destroyed, it should not be used; calling any function other than
  19115. <code>isDestroyed</code> will result in a {@link DeveloperError} exception. Therefore,
  19116. assign the return value (<code>undefined</code>) to the object as done in the example.
  19117. * @example
  19118. * dataSourceCollection = dataSourceCollection && dataSourceCollection.destroy();
  19119. */
  19120. destroy(): void;
  19121. }
  19122. /**
  19123. * Visualizes a collection of {@link DataSource} instances.
  19124. * @param options - Object with the following properties:
  19125. * @param options.scene - The scene in which to display the data.
  19126. * @param options.dataSourceCollection - The data sources to display.
  19127. * @param [options.visualizersCallback = DataSourceDisplay.defaultVisualizersCallback] - A function which creates an array of visualizers used for visualization.
  19128. If undefined, all standard visualizers are used.
  19129. */
  19130. export class DataSourceDisplay {
  19131. constructor(options: {
  19132. scene: Scene;
  19133. dataSourceCollection: DataSourceCollection;
  19134. visualizersCallback?: DataSourceDisplay.VisualizersCallback;
  19135. });
  19136. /**
  19137. * Gets or sets the default function which creates an array of visualizers used for visualization.
  19138. By default, this function uses all standard visualizers.
  19139. */
  19140. static defaultVisualizersCallback(): void;
  19141. /**
  19142. * Gets the scene associated with this display.
  19143. */
  19144. scene: Scene;
  19145. /**
  19146. * Gets the collection of data sources to display.
  19147. */
  19148. dataSources: DataSourceCollection;
  19149. /**
  19150. * Gets the default data source instance which can be used to
  19151. manually create and visualize entities not tied to
  19152. a specific data source. This instance is always available
  19153. and does not appear in the list dataSources collection.
  19154. */
  19155. defaultDataSource: CustomDataSource;
  19156. /**
  19157. * Gets a value indicating whether or not all entities in the data source are ready
  19158. */
  19159. readonly ready: boolean;
  19160. /**
  19161. * Returns true if this object was destroyed; otherwise, false.
  19162. <br /><br />
  19163. If this object was destroyed, it should not be used; calling any function other than
  19164. <code>isDestroyed</code> will result in a {@link DeveloperError} exception.
  19165. * @returns True if this object was destroyed; otherwise, false.
  19166. */
  19167. isDestroyed(): boolean;
  19168. /**
  19169. * Destroys the WebGL resources held by this object. Destroying an object allows for deterministic
  19170. release of WebGL resources, instead of relying on the garbage collector to destroy this object.
  19171. <br /><br />
  19172. Once an object is destroyed, it should not be used; calling any function other than
  19173. <code>isDestroyed</code> will result in a {@link DeveloperError} exception. Therefore,
  19174. assign the return value (<code>undefined</code>) to the object as done in the example.
  19175. * @example
  19176. * dataSourceDisplay = dataSourceDisplay.destroy();
  19177. */
  19178. destroy(): void;
  19179. /**
  19180. * Updates the display to the provided time.
  19181. * @param time - The simulation time.
  19182. * @returns True if all data sources are ready to be displayed, false otherwise.
  19183. */
  19184. update(time: JulianDate): boolean;
  19185. }
  19186. export namespace DataSourceDisplay {
  19187. /**
  19188. * A function which creates an array of visualizers used for visualization.
  19189. * @example
  19190. * function createVisualizers(scene, dataSource) {
  19191. return [new Cesium.BillboardVisualizer(scene, dataSource.entities)];
  19192. }
  19193. * @param scene - The scene to create visualizers for.
  19194. * @param dataSource - The data source to create visualizers for.
  19195. */
  19196. type VisualizersCallback = (scene: Scene, dataSource: DataSource) => Visualizer[];
  19197. }
  19198. /**
  19199. * A {@link GeometryUpdater} for ellipses.
  19200. Clients do not normally create this class directly, but instead rely on {@link DataSourceDisplay}.
  19201. * @param entity - The entity containing the geometry to be visualized.
  19202. * @param scene - The scene where visualization is taking place.
  19203. */
  19204. export class EllipseGeometryUpdater {
  19205. constructor(entity: Entity, scene: Scene);
  19206. /**
  19207. * Creates the geometry instance which represents the fill of the geometry.
  19208. * @param time - The time to use when retrieving initial attribute values.
  19209. * @returns The geometry instance representing the filled portion of the geometry.
  19210. */
  19211. createFillGeometryInstance(time: JulianDate): GeometryInstance;
  19212. /**
  19213. * Creates the geometry instance which represents the outline of the geometry.
  19214. * @param time - The time to use when retrieving initial attribute values.
  19215. * @returns The geometry instance representing the outline portion of the geometry.
  19216. */
  19217. createOutlineGeometryInstance(time: JulianDate): GeometryInstance;
  19218. /**
  19219. * Gets a value indicating if the geometry should be drawn on terrain.
  19220. */
  19221. readonly onTerrain: boolean;
  19222. }
  19223. export namespace EllipseGraphics {
  19224. /**
  19225. * Initialization options for the EllipseGraphics constructor
  19226. * @property [show = true] - A boolean Property specifying the visibility of the ellipse.
  19227. * @property [semiMajorAxis] - The numeric Property specifying the semi-major axis.
  19228. * @property [semiMinorAxis] - The numeric Property specifying the semi-minor axis.
  19229. * @property [height = 0] - A numeric Property specifying the altitude of the ellipse relative to the ellipsoid surface.
  19230. * @property [heightReference = HeightReference.NONE] - A Property specifying what the height is relative to.
  19231. * @property [extrudedHeight] - A numeric Property specifying the altitude of the ellipse's extruded face relative to the ellipsoid surface.
  19232. * @property [extrudedHeightReference = HeightReference.NONE] - A Property specifying what the extrudedHeight is relative to.
  19233. * @property [rotation = 0.0] - A numeric property specifying the rotation of the ellipse counter-clockwise from north.
  19234. * @property [stRotation = 0.0] - A numeric property specifying the rotation of the ellipse texture counter-clockwise from north.
  19235. * @property [granularity = Cesium.Math.RADIANS_PER_DEGREE] - A numeric Property specifying the angular distance between points on the ellipse.
  19236. * @property [fill = true] - A boolean Property specifying whether the ellipse is filled with the provided material.
  19237. * @property [material = Color.WHITE] - A Property specifying the material used to fill the ellipse.
  19238. * @property [outline = false] - A boolean Property specifying whether the ellipse is outlined.
  19239. * @property [outlineColor = Color.BLACK] - A Property specifying the {@link Color} of the outline.
  19240. * @property [outlineWidth = 1.0] - A numeric Property specifying the width of the outline.
  19241. * @property [numberOfVerticalLines = 16] - A numeric Property specifying the number of vertical lines to draw along the perimeter for the outline.
  19242. * @property [shadows = ShadowMode.DISABLED] - An enum Property specifying whether the ellipse casts or receives shadows from light sources.
  19243. * @property [distanceDisplayCondition] - A Property specifying at what distance from the camera that this ellipse will be displayed.
  19244. * @property [classificationType = ClassificationType.BOTH] - An enum Property specifying whether this ellipse will classify terrain, 3D Tiles, or both when on the ground.
  19245. * @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.
  19246. */
  19247. type ConstructorOptions = {
  19248. show?: Property | boolean;
  19249. semiMajorAxis?: Property | number;
  19250. semiMinorAxis?: Property | number;
  19251. height?: Property | number;
  19252. heightReference?: Property | HeightReference;
  19253. extrudedHeight?: Property | number;
  19254. extrudedHeightReference?: Property | HeightReference;
  19255. rotation?: Property | number;
  19256. stRotation?: Property | number;
  19257. granularity?: Property | number;
  19258. fill?: Property | boolean;
  19259. material?: MaterialProperty | Color;
  19260. outline?: Property | boolean;
  19261. outlineColor?: Property | Color;
  19262. outlineWidth?: Property | number;
  19263. numberOfVerticalLines?: Property | number;
  19264. shadows?: Property | ShadowMode;
  19265. distanceDisplayCondition?: Property | DistanceDisplayCondition;
  19266. classificationType?: Property | ClassificationType;
  19267. zIndex?: ConstantProperty | number;
  19268. };
  19269. }
  19270. /**
  19271. * Describes an ellipse defined by a center point and semi-major and semi-minor axes.
  19272. The ellipse conforms to the curvature of the globe and can be placed on the surface or
  19273. at altitude and can optionally be extruded into a volume.
  19274. The center point is determined by the containing {@link Entity}.
  19275. * @param [options] - Object describing initialization options
  19276. */
  19277. export class EllipseGraphics {
  19278. constructor(options?: EllipseGraphics.ConstructorOptions);
  19279. /**
  19280. * Gets the event that is raised whenever a property or sub-property is changed or modified.
  19281. */
  19282. readonly definitionChanged: Event;
  19283. /**
  19284. * Gets or sets the boolean Property specifying the visibility of the ellipse.
  19285. */
  19286. show: Property | undefined;
  19287. /**
  19288. * Gets or sets the numeric Property specifying the semi-major axis.
  19289. */
  19290. semiMajorAxis: Property | undefined;
  19291. /**
  19292. * Gets or sets the numeric Property specifying the semi-minor axis.
  19293. */
  19294. semiMinorAxis: Property | undefined;
  19295. /**
  19296. * Gets or sets the numeric Property specifying the altitude of the ellipse.
  19297. */
  19298. height: Property | undefined;
  19299. /**
  19300. * Gets or sets the Property specifying the {@link HeightReference}.
  19301. */
  19302. heightReference: Property | undefined;
  19303. /**
  19304. * Gets or sets the numeric Property specifying the altitude of the ellipse extrusion.
  19305. Setting this property creates volume starting at height and ending at this altitude.
  19306. */
  19307. extrudedHeight: Property | undefined;
  19308. /**
  19309. * Gets or sets the Property specifying the extruded {@link HeightReference}.
  19310. */
  19311. extrudedHeightReference: Property | undefined;
  19312. /**
  19313. * Gets or sets the numeric property specifying the rotation of the ellipse clockwise from north.
  19314. */
  19315. rotation: Property | undefined;
  19316. /**
  19317. * Gets or sets the numeric property specifying the rotation of the ellipse texture counter-clockwise from north.
  19318. */
  19319. stRotation: Property | undefined;
  19320. /**
  19321. * Gets or sets the numeric Property specifying the angular distance between points on the ellipse.
  19322. */
  19323. granularity: Property | undefined;
  19324. /**
  19325. * Gets or sets the boolean Property specifying whether the ellipse is filled with the provided material.
  19326. */
  19327. fill: Property | undefined;
  19328. /**
  19329. * Gets or sets the Property specifying the material used to fill the ellipse.
  19330. */
  19331. material: MaterialProperty | undefined;
  19332. /**
  19333. * Gets or sets the Property specifying whether the ellipse is outlined.
  19334. */
  19335. outline: Property | undefined;
  19336. /**
  19337. * Gets or sets the Property specifying the {@link Color} of the outline.
  19338. */
  19339. outlineColor: Property | undefined;
  19340. /**
  19341. * Gets or sets the numeric Property specifying the width of the outline.
  19342. */
  19343. outlineWidth: Property | undefined;
  19344. /**
  19345. * Gets or sets the numeric Property specifying the number of vertical lines to draw along the perimeter for the outline.
  19346. */
  19347. numberOfVerticalLines: Property | undefined;
  19348. /**
  19349. * Get or sets the enum Property specifying whether the ellipse
  19350. casts or receives shadows from light sources.
  19351. */
  19352. shadows: Property | undefined;
  19353. /**
  19354. * Gets or sets the {@link DistanceDisplayCondition} Property specifying at what distance from the camera that this ellipse will be displayed.
  19355. */
  19356. distanceDisplayCondition: Property | undefined;
  19357. /**
  19358. * Gets or sets the {@link ClassificationType} Property specifying whether this ellipse will classify terrain, 3D Tiles, or both when on the ground.
  19359. */
  19360. classificationType: Property | undefined;
  19361. /**
  19362. * 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
  19363. */
  19364. zIndex: ConstantProperty | undefined;
  19365. /**
  19366. * Duplicates this instance.
  19367. * @param [result] - The object onto which to store the result.
  19368. * @returns The modified result parameter or a new instance if one was not provided.
  19369. */
  19370. clone(result?: EllipseGraphics): EllipseGraphics;
  19371. /**
  19372. * Assigns each unassigned property on this object to the value
  19373. of the same property on the provided source object.
  19374. * @param source - The object to be merged into this object.
  19375. */
  19376. merge(source: EllipseGraphics): void;
  19377. }
  19378. /**
  19379. * A {@link GeometryUpdater} for ellipsoids.
  19380. Clients do not normally create this class directly, but instead rely on {@link DataSourceDisplay}.
  19381. * @param entity - The entity containing the geometry to be visualized.
  19382. * @param scene - The scene where visualization is taking place.
  19383. */
  19384. export class EllipsoidGeometryUpdater {
  19385. constructor(entity: Entity, scene: Scene);
  19386. /**
  19387. * Creates the geometry instance which represents the fill of the geometry.
  19388. * @param time - The time to use when retrieving initial attribute values.
  19389. * @param [skipModelMatrix = false] - Whether to compute a model matrix for the geometry instance
  19390. * @param [modelMatrixResult] - Used to store the result of the model matrix calculation
  19391. * @returns The geometry instance representing the filled portion of the geometry.
  19392. */
  19393. createFillGeometryInstance(time: JulianDate, skipModelMatrix?: boolean, modelMatrixResult?: Matrix4): GeometryInstance;
  19394. /**
  19395. * Creates the geometry instance which represents the outline of the geometry.
  19396. * @param time - The time to use when retrieving initial attribute values.
  19397. * @param [skipModelMatrix = false] - Whether to compute a model matrix for the geometry instance
  19398. * @param [modelMatrixResult] - Used to store the result of the model matrix calculation
  19399. * @returns The geometry instance representing the outline portion of the geometry.
  19400. */
  19401. createOutlineGeometryInstance(time: JulianDate, skipModelMatrix?: boolean, modelMatrixResult?: Matrix4): GeometryInstance;
  19402. }
  19403. export namespace EllipsoidGraphics {
  19404. /**
  19405. * Initialization options for the EllipsoidGraphics constructor
  19406. * @property [show = true] - A boolean Property specifying the visibility of the ellipsoid.
  19407. * @property [radii] - A {@link Cartesian3} Property specifying the radii of the ellipsoid.
  19408. * @property [innerRadii] - A {@link Cartesian3} Property specifying the inner radii of the ellipsoid.
  19409. * @property [minimumClock = 0.0] - A Property specifying the minimum clock angle of the ellipsoid.
  19410. * @property [maximumClock = 2*PI] - A Property specifying the maximum clock angle of the ellipsoid.
  19411. * @property [minimumCone = 0.0] - A Property specifying the minimum cone angle of the ellipsoid.
  19412. * @property [maximumCone = PI] - A Property specifying the maximum cone angle of the ellipsoid.
  19413. * @property [heightReference = HeightReference.NONE] - A Property specifying what the height from the entity position is relative to.
  19414. * @property [fill = true] - A boolean Property specifying whether the ellipsoid is filled with the provided material.
  19415. * @property [material = Color.WHITE] - A Property specifying the material used to fill the ellipsoid.
  19416. * @property [outline = false] - A boolean Property specifying whether the ellipsoid is outlined.
  19417. * @property [outlineColor = Color.BLACK] - A Property specifying the {@link Color} of the outline.
  19418. * @property [outlineWidth = 1.0] - A numeric Property specifying the width of the outline.
  19419. * @property [stackPartitions = 64] - A Property specifying the number of stacks.
  19420. * @property [slicePartitions = 64] - A Property specifying the number of radial slices.
  19421. * @property [subdivisions = 128] - A Property specifying the number of samples per outline ring, determining the granularity of the curvature.
  19422. * @property [shadows = ShadowMode.DISABLED] - An enum Property specifying whether the ellipsoid casts or receives shadows from light sources.
  19423. * @property [distanceDisplayCondition] - A Property specifying at what distance from the camera that this ellipsoid will be displayed.
  19424. */
  19425. type ConstructorOptions = {
  19426. show?: Property | boolean;
  19427. radii?: Property | Cartesian3;
  19428. innerRadii?: Property | Cartesian3;
  19429. minimumClock?: Property | number;
  19430. maximumClock?: Property | number;
  19431. minimumCone?: Property | number;
  19432. maximumCone?: Property | number;
  19433. heightReference?: Property | HeightReference;
  19434. fill?: Property | boolean;
  19435. material?: MaterialProperty | Color;
  19436. outline?: Property | boolean;
  19437. outlineColor?: Property | Color;
  19438. outlineWidth?: Property | number;
  19439. stackPartitions?: Property | number;
  19440. slicePartitions?: Property | number;
  19441. subdivisions?: Property | number;
  19442. shadows?: Property | ShadowMode;
  19443. distanceDisplayCondition?: Property | DistanceDisplayCondition;
  19444. };
  19445. }
  19446. /**
  19447. * Describe an ellipsoid or sphere. The center position and orientation are determined by the containing {@link Entity}.
  19448. * @param [options] - Object describing initialization options
  19449. */
  19450. export class EllipsoidGraphics {
  19451. constructor(options?: EllipsoidGraphics.ConstructorOptions);
  19452. /**
  19453. * Gets the event that is raised whenever a property or sub-property is changed or modified.
  19454. */
  19455. readonly definitionChanged: Event;
  19456. /**
  19457. * Gets or sets the boolean Property specifying the visibility of the ellipsoid.
  19458. */
  19459. show: Property | undefined;
  19460. /**
  19461. * Gets or sets the {@link Cartesian3} {@link Property} specifying the radii of the ellipsoid.
  19462. */
  19463. radii: Property | undefined;
  19464. /**
  19465. * Gets or sets the {@link Cartesian3} {@link Property} specifying the inner radii of the ellipsoid.
  19466. */
  19467. innerRadii: Property | undefined;
  19468. /**
  19469. * Gets or sets the Property specifying the minimum clock angle of the ellipsoid.
  19470. */
  19471. minimumClock: Property | undefined;
  19472. /**
  19473. * Gets or sets the Property specifying the maximum clock angle of the ellipsoid.
  19474. */
  19475. maximumClock: Property | undefined;
  19476. /**
  19477. * Gets or sets the Property specifying the minimum cone angle of the ellipsoid.
  19478. */
  19479. minimumCone: Property | undefined;
  19480. /**
  19481. * Gets or sets the Property specifying the maximum cone angle of the ellipsoid.
  19482. */
  19483. maximumCone: Property | undefined;
  19484. /**
  19485. * Gets or sets the Property specifying the {@link HeightReference}.
  19486. */
  19487. heightReference: Property | undefined;
  19488. /**
  19489. * Gets or sets the boolean Property specifying whether the ellipsoid is filled with the provided material.
  19490. */
  19491. fill: Property | undefined;
  19492. /**
  19493. * Gets or sets the Property specifying the material used to fill the ellipsoid.
  19494. */
  19495. material: MaterialProperty;
  19496. /**
  19497. * Gets or sets the Property specifying whether the ellipsoid is outlined.
  19498. */
  19499. outline: Property | undefined;
  19500. /**
  19501. * Gets or sets the Property specifying the {@link Color} of the outline.
  19502. */
  19503. outlineColor: Property | undefined;
  19504. /**
  19505. * Gets or sets the numeric Property specifying the width of the outline.
  19506. */
  19507. outlineWidth: Property | undefined;
  19508. /**
  19509. * Gets or sets the Property specifying the number of stacks.
  19510. */
  19511. stackPartitions: Property | undefined;
  19512. /**
  19513. * Gets or sets the Property specifying the number of radial slices per 360 degrees.
  19514. */
  19515. slicePartitions: Property | undefined;
  19516. /**
  19517. * Gets or sets the Property specifying the number of samples per outline ring, determining the granularity of the curvature.
  19518. */
  19519. subdivisions: Property | undefined;
  19520. /**
  19521. * Get or sets the enum Property specifying whether the ellipsoid
  19522. casts or receives shadows from light sources.
  19523. */
  19524. shadows: Property | undefined;
  19525. /**
  19526. * Gets or sets the {@link DistanceDisplayCondition} Property specifying at what distance from the camera that this ellipsoid will be displayed.
  19527. */
  19528. distanceDisplayCondition: Property | undefined;
  19529. /**
  19530. * Duplicates this instance.
  19531. * @param [result] - The object onto which to store the result.
  19532. * @returns The modified result parameter or a new instance if one was not provided.
  19533. */
  19534. clone(result?: EllipsoidGraphics): EllipsoidGraphics;
  19535. /**
  19536. * Assigns each unassigned property on this object to the value
  19537. of the same property on the provided source object.
  19538. * @param source - The object to be merged into this object.
  19539. */
  19540. merge(source: EllipsoidGraphics): void;
  19541. }
  19542. export namespace Entity {
  19543. /**
  19544. * Initialization options for the Entity constructor
  19545. * @property [id] - A unique identifier for this object. If none is provided, a GUID is generated.
  19546. * @property [name] - A human readable name to display to users. It does not have to be unique.
  19547. * @property [availability] - The availability, if any, associated with this object.
  19548. * @property [show] - A boolean value indicating if the entity and its children are displayed.
  19549. * @property [description] - A string Property specifying an HTML description for this entity.
  19550. * @property [position] - A Property specifying the entity position.
  19551. * @property [orientation] - A Property specifying the entity orientation.
  19552. * @property [viewFrom] - A suggested initial offset for viewing this object.
  19553. * @property [parent] - A parent entity to associate with this entity.
  19554. * @property [billboard] - A billboard to associate with this entity.
  19555. * @property [box] - A box to associate with this entity.
  19556. * @property [corridor] - A corridor to associate with this entity.
  19557. * @property [cylinder] - A cylinder to associate with this entity.
  19558. * @property [ellipse] - A ellipse to associate with this entity.
  19559. * @property [ellipsoid] - A ellipsoid to associate with this entity.
  19560. * @property [label] - A options.label to associate with this entity.
  19561. * @property [model] - A model to associate with this entity.
  19562. * @property [tileset] - A 3D Tiles tileset to associate with this entity.
  19563. * @property [path] - A path to associate with this entity.
  19564. * @property [plane] - A plane to associate with this entity.
  19565. * @property [point] - A point to associate with this entity.
  19566. * @property [polygon] - A polygon to associate with this entity.
  19567. * @property [polyline] - A polyline to associate with this entity.
  19568. * @property [properties] - Arbitrary properties to associate with this entity.
  19569. * @property [polylineVolume] - A polylineVolume to associate with this entity.
  19570. * @property [rectangle] - A rectangle to associate with this entity.
  19571. * @property [wall] - A wall to associate with this entity.
  19572. */
  19573. type ConstructorOptions = {
  19574. id?: string;
  19575. name?: string;
  19576. availability?: TimeIntervalCollection;
  19577. show?: boolean;
  19578. description?: Property | string;
  19579. position?: PositionProperty | Cartesian3;
  19580. orientation?: Property;
  19581. viewFrom?: Property;
  19582. parent?: Entity;
  19583. billboard?: BillboardGraphics | BillboardGraphics.ConstructorOptions;
  19584. box?: BoxGraphics | BoxGraphics.ConstructorOptions;
  19585. corridor?: CorridorGraphics | CorridorGraphics.ConstructorOptions;
  19586. cylinder?: CylinderGraphics | CylinderGraphics.ConstructorOptions;
  19587. ellipse?: EllipseGraphics | EllipseGraphics.ConstructorOptions;
  19588. ellipsoid?: EllipsoidGraphics | EllipsoidGraphics.ConstructorOptions;
  19589. label?: LabelGraphics | LabelGraphics.ConstructorOptions;
  19590. model?: ModelGraphics | ModelGraphics.ConstructorOptions;
  19591. tileset?: Cesium3DTilesetGraphics | Cesium3DTilesetGraphics.ConstructorOptions;
  19592. path?: PathGraphics | PathGraphics.ConstructorOptions;
  19593. plane?: PlaneGraphics | PlaneGraphics.ConstructorOptions;
  19594. point?: PointGraphics | PointGraphics.ConstructorOptions;
  19595. polygon?: PolygonGraphics | PolygonGraphics.ConstructorOptions;
  19596. polyline?: PolylineGraphics | PolylineGraphics.ConstructorOptions;
  19597. properties?: PropertyBag | {
  19598. [key: string]: any;
  19599. };
  19600. polylineVolume?: PolylineVolumeGraphics | PolylineVolumeGraphics.ConstructorOptions;
  19601. rectangle?: RectangleGraphics | RectangleGraphics.ConstructorOptions;
  19602. wall?: WallGraphics | WallGraphics.ConstructorOptions;
  19603. };
  19604. }
  19605. /**
  19606. * Entity instances aggregate multiple forms of visualization into a single high-level object.
  19607. They can be created manually and added to {@link Viewer#entities} or be produced by
  19608. data sources, such as {@link CzmlDataSource} and {@link GeoJsonDataSource}.
  19609. * @param [options] - Object describing initialization options
  19610. */
  19611. export class Entity {
  19612. constructor(options?: Entity.ConstructorOptions);
  19613. /**
  19614. * Gets or sets the entity collection that this entity belongs to.
  19615. */
  19616. entityCollection: EntityCollection;
  19617. /**
  19618. * The availability, if any, associated with this object.
  19619. If availability is undefined, it is assumed that this object's
  19620. other properties will return valid data for any provided time.
  19621. If availability exists, the objects other properties will only
  19622. provide valid data if queried within the given interval.
  19623. */
  19624. availability: TimeIntervalCollection | undefined;
  19625. /**
  19626. * Gets the unique ID associated with this object.
  19627. */
  19628. id: string;
  19629. /**
  19630. * Gets the event that is raised whenever a property or sub-property is changed or modified.
  19631. */
  19632. readonly definitionChanged: Event;
  19633. /**
  19634. * Gets or sets the name of the object. The name is intended for end-user
  19635. consumption and does not need to be unique.
  19636. */
  19637. name: string | undefined;
  19638. /**
  19639. * Gets or sets whether this entity should be displayed. When set to true,
  19640. the entity is only displayed if the parent entity's show property is also true.
  19641. */
  19642. show: boolean;
  19643. /**
  19644. * Gets whether this entity is being displayed, taking into account
  19645. the visibility of any ancestor entities.
  19646. */
  19647. isShowing: boolean;
  19648. /**
  19649. * Gets or sets the parent object.
  19650. */
  19651. parent: Entity | undefined;
  19652. /**
  19653. * Gets the names of all properties registered on this instance.
  19654. */
  19655. propertyNames: string[];
  19656. /**
  19657. * Gets or sets the billboard.
  19658. */
  19659. billboard: BillboardGraphics | undefined;
  19660. /**
  19661. * Gets or sets the box.
  19662. */
  19663. box: BoxGraphics | undefined;
  19664. /**
  19665. * Gets or sets the corridor.
  19666. */
  19667. corridor: CorridorGraphics | undefined;
  19668. /**
  19669. * Gets or sets the cylinder.
  19670. */
  19671. cylinder: CylinderGraphics | undefined;
  19672. /**
  19673. * Gets or sets the description.
  19674. */
  19675. description: Property | undefined;
  19676. /**
  19677. * Gets or sets the ellipse.
  19678. */
  19679. ellipse: EllipseGraphics | undefined;
  19680. /**
  19681. * Gets or sets the ellipsoid.
  19682. */
  19683. ellipsoid: EllipsoidGraphics | undefined;
  19684. /**
  19685. * Gets or sets the label.
  19686. */
  19687. label: LabelGraphics | undefined;
  19688. /**
  19689. * Gets or sets the model.
  19690. */
  19691. model: ModelGraphics | undefined;
  19692. /**
  19693. * Gets or sets the tileset.
  19694. */
  19695. tileset: Cesium3DTilesetGraphics | undefined;
  19696. /**
  19697. * Gets or sets the orientation.
  19698. */
  19699. orientation: Property | undefined;
  19700. /**
  19701. * Gets or sets the path.
  19702. */
  19703. path: PathGraphics | undefined;
  19704. /**
  19705. * Gets or sets the plane.
  19706. */
  19707. plane: PlaneGraphics | undefined;
  19708. /**
  19709. * Gets or sets the point graphic.
  19710. */
  19711. point: PointGraphics | undefined;
  19712. /**
  19713. * Gets or sets the polygon.
  19714. */
  19715. polygon: PolygonGraphics | undefined;
  19716. /**
  19717. * Gets or sets the polyline.
  19718. */
  19719. polyline: PolylineGraphics | undefined;
  19720. /**
  19721. * Gets or sets the polyline volume.
  19722. */
  19723. polylineVolume: PolylineVolumeGraphics | undefined;
  19724. /**
  19725. * Gets or sets the bag of arbitrary properties associated with this entity.
  19726. */
  19727. properties: PropertyBag | undefined;
  19728. /**
  19729. * Gets or sets the position.
  19730. */
  19731. position: PositionProperty | undefined;
  19732. /**
  19733. * Gets or sets the rectangle.
  19734. */
  19735. rectangle: RectangleGraphics | undefined;
  19736. /**
  19737. * Gets or sets the suggested initial offset when tracking this object.
  19738. The offset is typically defined in the east-north-up reference frame,
  19739. but may be another frame depending on the object's velocity.
  19740. */
  19741. viewFrom: Property | undefined;
  19742. /**
  19743. * Gets or sets the wall.
  19744. */
  19745. wall: WallGraphics | undefined;
  19746. /**
  19747. * Given a time, returns true if this object should have data during that time.
  19748. * @param time - The time to check availability for.
  19749. * @returns true if the object should have data during the provided time, false otherwise.
  19750. */
  19751. isAvailable(time: JulianDate): boolean;
  19752. /**
  19753. * Adds a property to this object. Once a property is added, it can be
  19754. observed with {@link Entity#definitionChanged} and composited
  19755. with {@link CompositeEntityCollection}
  19756. * @param propertyName - The name of the property to add.
  19757. */
  19758. addProperty(propertyName: string): void;
  19759. /**
  19760. * Removed a property previously added with addProperty.
  19761. * @param propertyName - The name of the property to remove.
  19762. */
  19763. removeProperty(propertyName: string): void;
  19764. /**
  19765. * Assigns each unassigned property on this object to the value
  19766. of the same property on the provided source object.
  19767. * @param source - The object to be merged into this object.
  19768. */
  19769. merge(source: Entity): void;
  19770. /**
  19771. * Computes the model matrix for the entity's transform at specified time. Returns undefined if orientation or position
  19772. are undefined.
  19773. * @param time - The time to retrieve model matrix for.
  19774. * @param [result] - The object onto which to store the result.
  19775. * @returns The modified result parameter or a new Matrix4 instance if one was not provided. Result is undefined if position or orientation are undefined.
  19776. */
  19777. computeModelMatrix(time: JulianDate, result?: Matrix4): Matrix4;
  19778. /**
  19779. * Checks if the given Scene supports materials besides Color on Entities draped on terrain or 3D Tiles.
  19780. If this feature is not supported, Entities with non-color materials but no `height` will
  19781. instead be rendered as if height is 0.
  19782. * @param scene - The current scene.
  19783. * @returns Whether or not the current scene supports materials for entities on terrain.
  19784. */
  19785. static supportsMaterialsforEntitiesOnTerrain(scene: Scene): boolean;
  19786. /**
  19787. * Checks if the given Scene supports polylines clamped to terrain or 3D Tiles.
  19788. If this feature is not supported, Entities with PolylineGraphics will be rendered with vertices at
  19789. the provided heights and using the `arcType` parameter instead of clamped to the ground.
  19790. * @param scene - The current scene.
  19791. * @returns Whether or not the current scene supports polylines on terrain or 3D TIles.
  19792. */
  19793. static supportsPolylinesOnTerrain(scene: Scene): boolean;
  19794. }
  19795. /**
  19796. * Defines how screen space objects (billboards, points, labels) are clustered.
  19797. * @param [options] - An object with the following properties:
  19798. * @param [options.enabled = false] - Whether or not to enable clustering.
  19799. * @param [options.pixelRange = 80] - The pixel range to extend the screen space bounding box.
  19800. * @param [options.minimumClusterSize = 2] - The minimum number of screen space objects that can be clustered.
  19801. * @param [options.clusterBillboards = true] - Whether or not to cluster the billboards of an entity.
  19802. * @param [options.clusterLabels = true] - Whether or not to cluster the labels of an entity.
  19803. * @param [options.clusterPoints = true] - Whether or not to cluster the points of an entity.
  19804. */
  19805. export class EntityCluster {
  19806. constructor(options?: {
  19807. enabled?: boolean;
  19808. pixelRange?: number;
  19809. minimumClusterSize?: number;
  19810. clusterBillboards?: boolean;
  19811. clusterLabels?: boolean;
  19812. clusterPoints?: boolean;
  19813. });
  19814. /**
  19815. * Gets or sets whether clustering is enabled.
  19816. */
  19817. enabled: boolean;
  19818. /**
  19819. * Gets or sets the pixel range to extend the screen space bounding box.
  19820. */
  19821. pixelRange: number;
  19822. /**
  19823. * Gets or sets the minimum number of screen space objects that can be clustered.
  19824. */
  19825. minimumClusterSize: number;
  19826. /**
  19827. * Gets the event that will be raised when a new cluster will be displayed. The signature of the event listener is {@link EntityCluster.newClusterCallback}.
  19828. */
  19829. clusterEvent: Event;
  19830. /**
  19831. * Gets or sets whether clustering billboard entities is enabled.
  19832. */
  19833. clusterBillboards: boolean;
  19834. /**
  19835. * Gets or sets whether clustering labels entities is enabled.
  19836. */
  19837. clusterLabels: boolean;
  19838. /**
  19839. * Gets or sets whether clustering point entities is enabled.
  19840. */
  19841. clusterPoints: boolean;
  19842. /**
  19843. * Destroys the WebGL resources held by this object. Destroying an object allows for deterministic
  19844. release of WebGL resources, instead of relying on the garbage collector to destroy this object.
  19845. <p>
  19846. Unlike other objects that use WebGL resources, this object can be reused. For example, if a data source is removed
  19847. from a data source collection and added to another.
  19848. </p>
  19849. */
  19850. destroy(): void;
  19851. }
  19852. export namespace EntityCluster {
  19853. /**
  19854. * A event listener function used to style clusters.
  19855. * @example
  19856. * // The default cluster values.
  19857. dataSource.clustering.clusterEvent.addEventListener(function(entities, cluster) {
  19858. cluster.label.show = true;
  19859. cluster.label.text = entities.length.toLocaleString();
  19860. });
  19861. * @param clusteredEntities - An array of the entities contained in the cluster.
  19862. * @param cluster - An object containing billboard, label, and point properties. The values are the same as
  19863. billboard, label and point entities, but must be the values of the ConstantProperty.
  19864. */
  19865. type newClusterCallback = (clusteredEntities: Entity[], cluster: any) => void;
  19866. }
  19867. /**
  19868. * An observable collection of {@link Entity} instances where each entity has a unique id.
  19869. * @param [owner] - The data source (or composite entity collection) which created this collection.
  19870. */
  19871. export class EntityCollection {
  19872. constructor(owner?: DataSource | CompositeEntityCollection);
  19873. /**
  19874. * Prevents {@link EntityCollection#collectionChanged} events from being raised
  19875. until a corresponding call is made to {@link EntityCollection#resumeEvents}, at which
  19876. point a single event will be raised that covers all suspended operations.
  19877. This allows for many items to be added and removed efficiently.
  19878. This function can be safely called multiple times as long as there
  19879. are corresponding calls to {@link EntityCollection#resumeEvents}.
  19880. */
  19881. suspendEvents(): void;
  19882. /**
  19883. * Resumes raising {@link EntityCollection#collectionChanged} events immediately
  19884. when an item is added or removed. Any modifications made while while events were suspended
  19885. will be triggered as a single event when this function is called.
  19886. This function is reference counted and can safely be called multiple times as long as there
  19887. are corresponding calls to {@link EntityCollection#resumeEvents}.
  19888. */
  19889. resumeEvents(): void;
  19890. /**
  19891. * The signature of the event generated by {@link EntityCollection#collectionChanged}.
  19892. * @param collection - The collection that triggered the event.
  19893. * @param added - The array of {@link Entity} instances that have been added to the collection.
  19894. * @param removed - The array of {@link Entity} instances that have been removed from the collection.
  19895. * @param changed - The array of {@link Entity} instances that have been modified.
  19896. */
  19897. static collectionChangedEventCallback(collection: EntityCollection, added: Entity[], removed: Entity[], changed: Entity[]): void;
  19898. /**
  19899. * Gets the event that is fired when entities are added or removed from the collection.
  19900. The generated event is a {@link EntityCollection.collectionChangedEventCallback}.
  19901. */
  19902. readonly collectionChanged: Event;
  19903. /**
  19904. * Gets a globally unique identifier for this collection.
  19905. */
  19906. readonly id: string;
  19907. /**
  19908. * Gets the array of Entity instances in the collection.
  19909. This array should not be modified directly.
  19910. */
  19911. readonly values: Entity[];
  19912. /**
  19913. * Gets whether or not this entity collection should be
  19914. displayed. When true, each entity is only displayed if
  19915. its own show property is also true.
  19916. */
  19917. show: boolean;
  19918. /**
  19919. * Gets the owner of this entity collection, ie. the data source or composite entity collection which created it.
  19920. */
  19921. readonly owner: DataSource | CompositeEntityCollection;
  19922. /**
  19923. * Computes the maximum availability of the entities in the collection.
  19924. If the collection contains a mix of infinitely available data and non-infinite data,
  19925. it will return the interval pertaining to the non-infinite data only. If all
  19926. data is infinite, an infinite interval will be returned.
  19927. * @returns The availability of entities in the collection.
  19928. */
  19929. computeAvailability(): TimeInterval;
  19930. /**
  19931. * Add an entity to the collection.
  19932. * @param entity - The entity to be added.
  19933. * @returns The entity that was added.
  19934. */
  19935. add(entity: Entity | Entity.ConstructorOptions): Entity;
  19936. /**
  19937. * Removes an entity from the collection.
  19938. * @param entity - The entity to be removed.
  19939. * @returns true if the item was removed, false if it did not exist in the collection.
  19940. */
  19941. remove(entity: Entity): boolean;
  19942. /**
  19943. * Returns true if the provided entity is in this collection, false otherwise.
  19944. * @param entity - The entity.
  19945. * @returns true if the provided entity is in this collection, false otherwise.
  19946. */
  19947. contains(entity: Entity): boolean;
  19948. /**
  19949. * Removes an entity with the provided id from the collection.
  19950. * @param id - The id of the entity to remove.
  19951. * @returns true if the item was removed, false if no item with the provided id existed in the collection.
  19952. */
  19953. removeById(id: string): boolean;
  19954. /**
  19955. * Removes all Entities from the collection.
  19956. */
  19957. removeAll(): void;
  19958. /**
  19959. * Gets an entity with the specified id.
  19960. * @param id - The id of the entity to retrieve.
  19961. * @returns The entity with the provided id or undefined if the id did not exist in the collection.
  19962. */
  19963. getById(id: string): Entity | undefined;
  19964. /**
  19965. * Gets an entity with the specified id or creates it and adds it to the collection if it does not exist.
  19966. * @param id - The id of the entity to retrieve or create.
  19967. * @returns The new or existing object.
  19968. */
  19969. getOrCreateEntity(id: string): Entity;
  19970. }
  19971. /**
  19972. * A utility object for tracking an entity with the camera.
  19973. * @param entity - The entity to track with the camera.
  19974. * @param scene - The scene to use.
  19975. * @param [ellipsoid = Ellipsoid.WGS84] - The ellipsoid to use for orienting the camera.
  19976. */
  19977. export class EntityView {
  19978. constructor(entity: Entity, scene: Scene, ellipsoid?: Ellipsoid);
  19979. /**
  19980. * The entity to track with the camera.
  19981. */
  19982. entity: Entity;
  19983. /**
  19984. * The scene in which to track the object.
  19985. */
  19986. scene: Scene;
  19987. /**
  19988. * The ellipsoid to use for orienting the camera.
  19989. */
  19990. ellipsoid: Ellipsoid;
  19991. /**
  19992. * The bounding sphere of the object.
  19993. */
  19994. boundingSphere: BoundingSphere;
  19995. /**
  19996. * Gets or sets a camera offset that will be used to
  19997. initialize subsequent EntityViews.
  19998. */
  19999. static defaultOffset3D: Cartesian3;
  20000. /**
  20001. * Should be called each animation frame to update the camera
  20002. to the latest settings.
  20003. * @param time - The current animation time.
  20004. * @param [boundingSphere] - bounding sphere of the object.
  20005. */
  20006. update(time: JulianDate, boundingSphere?: BoundingSphere): void;
  20007. }
  20008. /**
  20009. * @property kml - The generated KML.
  20010. * @property externalFiles - An object dictionary of external files
  20011. */
  20012. export type exportKmlResultKml = {
  20013. kml: string;
  20014. externalFiles: {
  20015. [key: string]: Blob;
  20016. };
  20017. };
  20018. /**
  20019. * @property kmz - The generated kmz file.
  20020. */
  20021. export type exportKmlResultKmz = {
  20022. kmz: Blob;
  20023. };
  20024. /**
  20025. * Exports an EntityCollection as a KML document. Only Point, Billboard, Model, Path, Polygon, Polyline geometries
  20026. will be exported. Note that there is not a 1 to 1 mapping of Entity properties to KML Feature properties. For
  20027. example, entity properties that are time dynamic but cannot be dynamic in KML are exported with their values at
  20028. options.time or the beginning of the EntityCollection's time interval if not specified. For time-dynamic properties
  20029. that are supported in KML, we use the samples if it is a {@link SampledProperty} otherwise we sample the value using
  20030. the options.sampleDuration. Point, Billboard, Model and Path geometries with time-dynamic positions will be exported
  20031. as gx:Track Features. Not all Materials are representable in KML, so for more advanced Materials just the primary
  20032. color is used. Canvas objects are exported as PNG images.
  20033. * @example
  20034. * Cesium.exportKml({
  20035. entities: entityCollection
  20036. })
  20037. .then(function(result) {
  20038. // The XML string is in result.kml
  20039. var externalFiles = result.externalFiles
  20040. for(var file in externalFiles) {
  20041. // file is the name of the file used in the KML document as the href
  20042. // externalFiles[file] is a blob with the contents of the file
  20043. }
  20044. });
  20045. * @param options - An object with the following properties:
  20046. * @param options.entities - The EntityCollection to export as KML.
  20047. * @param [options.ellipsoid = Ellipsoid.WGS84] - The ellipsoid for the output file.
  20048. * @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.
  20049. * @param [options.time = entities.computeAvailability().start] - The time value to use to get properties that are not time varying in KML.
  20050. * @param [options.defaultAvailability = entities.computeAvailability()] - The interval that will be sampled if an entity doesn't have an availability.
  20051. * @param [options.sampleDuration = 60] - The number of seconds to sample properties that are varying in KML.
  20052. * @param [options.kmz = false] - If true KML and external files will be compressed into a kmz file.
  20053. * @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.
  20054. */
  20055. export function exportKml(options: {
  20056. entities: EntityCollection;
  20057. ellipsoid?: Ellipsoid;
  20058. modelCallback?: exportKmlModelCallback;
  20059. time?: JulianDate;
  20060. defaultAvailability?: TimeInterval;
  20061. sampleDuration?: number;
  20062. kmz?: boolean;
  20063. }): Promise<exportKmlResultKml | exportKmlResultKmz>;
  20064. /**
  20065. * Since KML does not support glTF models, this callback is required to specify what URL to use for the model in the KML document.
  20066. 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,
  20067. or otherwise returned with the KML string when exporting.
  20068. * @param model - The ModelGraphics instance for an Entity.
  20069. * @param time - The time that any properties should use to get the value.
  20070. * @param externalFiles - An object that maps a filename to a Blob or a Promise that resolves to a Blob.
  20071. */
  20072. export type exportKmlModelCallback = (model: ModelGraphics, time: JulianDate, externalFiles: any) => string;
  20073. export namespace GeoJsonDataSource {
  20074. /**
  20075. * Initialization options for the `load` method.
  20076. * @property [sourceUri] - Overrides the url to use for resolving relative links.
  20077. * @property [markerSize = GeoJsonDataSource.markerSize] - The default size of the map pin created for each point, in pixels.
  20078. * @property [markerSymbol = GeoJsonDataSource.markerSymbol] - The default symbol of the map pin created for each point.
  20079. * @property [markerColor = GeoJsonDataSource.markerColor] - The default color of the map pin created for each point.
  20080. * @property [stroke = GeoJsonDataSource.stroke] - The default color of polylines and polygon outlines.
  20081. * @property [strokeWidth = GeoJsonDataSource.strokeWidth] - The default width of polylines and polygon outlines.
  20082. * @property [fill = GeoJsonDataSource.fill] - The default color for polygon interiors.
  20083. * @property [clampToGround = GeoJsonDataSource.clampToGround] - true if we want the geometry features (polygons or linestrings) clamped to the ground.
  20084. * @property [credit] - A credit for the data source, which is displayed on the canvas.
  20085. */
  20086. type LoadOptions = {
  20087. sourceUri?: string;
  20088. markerSize?: number;
  20089. markerSymbol?: string;
  20090. markerColor?: Color;
  20091. stroke?: Color;
  20092. strokeWidth?: number;
  20093. fill?: Color;
  20094. clampToGround?: boolean;
  20095. credit?: Credit | string;
  20096. };
  20097. /**
  20098. * This callback is displayed as part of the GeoJsonDataSource class.
  20099. * @param properties - The properties of the feature.
  20100. * @param nameProperty - The property key that Cesium estimates to have the name of the feature.
  20101. */
  20102. type describe = (properties: any, nameProperty: string) => void;
  20103. }
  20104. /**
  20105. * A {@link DataSource} which processes both
  20106. {@link http://www.geojson.org/|GeoJSON} and {@link https://github.com/mbostock/topojson|TopoJSON} data.
  20107. {@link https://github.com/mapbox/simplestyle-spec|simplestyle-spec} properties will also be used if they
  20108. are present.
  20109. * @example
  20110. * var viewer = new Cesium.Viewer('cesiumContainer');
  20111. viewer.dataSources.add(Cesium.GeoJsonDataSource.load('../../SampleData/ne_10m_us_states.topojson', {
  20112. stroke: Cesium.Color.HOTPINK,
  20113. fill: Cesium.Color.PINK,
  20114. strokeWidth: 3,
  20115. markerSymbol: '?'
  20116. }));
  20117. * @param [name] - The name of this data source. If undefined, a name will be taken from
  20118. the name of the GeoJSON file.
  20119. */
  20120. export class GeoJsonDataSource {
  20121. constructor(name?: string);
  20122. /**
  20123. * Creates a Promise to a new instance loaded with the provided GeoJSON or TopoJSON data.
  20124. * @param data - A url, GeoJSON object, or TopoJSON object to be loaded.
  20125. * @param [options] - An object specifying configuration options
  20126. * @returns A promise that will resolve when the data is loaded.
  20127. */
  20128. static load(data: Resource | string | any, options?: GeoJsonDataSource.LoadOptions): Promise<GeoJsonDataSource>;
  20129. /**
  20130. * Gets or sets the default size of the map pin created for each point, in pixels.
  20131. */
  20132. static markerSize: number;
  20133. /**
  20134. * Gets or sets the default symbol of the map pin created for each point.
  20135. This can be any valid {@link http://mapbox.com/maki/|Maki} identifier, any single character,
  20136. or blank if no symbol is to be used.
  20137. */
  20138. static markerSymbol: string;
  20139. /**
  20140. * Gets or sets the default color of the map pin created for each point.
  20141. */
  20142. static markerColor: Color;
  20143. /**
  20144. * Gets or sets the default color of polylines and polygon outlines.
  20145. */
  20146. static stroke: Color;
  20147. /**
  20148. * Gets or sets the default width of polylines and polygon outlines.
  20149. */
  20150. static strokeWidth: number;
  20151. /**
  20152. * Gets or sets default color for polygon interiors.
  20153. */
  20154. static fill: Color;
  20155. /**
  20156. * Gets or sets default of whether to clamp to the ground.
  20157. */
  20158. static clampToGround: boolean;
  20159. /**
  20160. * Gets an object that maps the name of a crs to a callback function which takes a GeoJSON coordinate
  20161. and transforms it into a WGS84 Earth-fixed Cartesian. Older versions of GeoJSON which
  20162. supported the EPSG type can be added to this list as well, by specifying the complete EPSG name,
  20163. for example 'EPSG:4326'.
  20164. */
  20165. static crsNames: any;
  20166. /**
  20167. * Gets an object that maps the href property of a crs link to a callback function
  20168. which takes the crs properties object and returns a Promise that resolves
  20169. to a function that takes a GeoJSON coordinate and transforms it into a WGS84 Earth-fixed Cartesian.
  20170. Items in this object take precedence over those defined in <code>crsLinkHrefs</code>, assuming
  20171. the link has a type specified.
  20172. */
  20173. static crsLinkHrefs: any;
  20174. /**
  20175. * Gets an object that maps the type property of a crs link to a callback function
  20176. which takes the crs properties object and returns a Promise that resolves
  20177. to a function that takes a GeoJSON coordinate and transforms it into a WGS84 Earth-fixed Cartesian.
  20178. Items in <code>crsLinkHrefs</code> take precedence over this object.
  20179. */
  20180. static crsLinkTypes: any;
  20181. /**
  20182. * Gets or sets a human-readable name for this instance.
  20183. */
  20184. name: string;
  20185. /**
  20186. * This DataSource only defines static data, therefore this property is always undefined.
  20187. */
  20188. clock: DataSourceClock;
  20189. /**
  20190. * Gets the collection of {@link Entity} instances.
  20191. */
  20192. entities: EntityCollection;
  20193. /**
  20194. * Gets a value indicating if the data source is currently loading data.
  20195. */
  20196. isLoading: boolean;
  20197. /**
  20198. * Gets an event that will be raised when the underlying data changes.
  20199. */
  20200. changedEvent: Event;
  20201. /**
  20202. * Gets an event that will be raised if an error is encountered during processing.
  20203. */
  20204. errorEvent: Event;
  20205. /**
  20206. * Gets an event that will be raised when the data source either starts or stops loading.
  20207. */
  20208. loadingEvent: Event;
  20209. /**
  20210. * Gets whether or not this data source should be displayed.
  20211. */
  20212. show: boolean;
  20213. /**
  20214. * Gets or sets the clustering options for this data source. This object can be shared between multiple data sources.
  20215. */
  20216. clustering: EntityCluster;
  20217. /**
  20218. * Gets the credit that will be displayed for the data source
  20219. */
  20220. credit: Credit;
  20221. /**
  20222. * Asynchronously loads the provided GeoJSON or TopoJSON data, replacing any existing data.
  20223. * @param data - A url, GeoJSON object, or TopoJSON object to be loaded.
  20224. * @param [options] - An object with the following properties:
  20225. * @param [options.sourceUri] - Overrides the url to use for resolving relative links.
  20226. * @param [options.describe = GeoJsonDataSource.defaultDescribeProperty] - A function which returns a Property object (or just a string),
  20227. which converts the properties into an html description.
  20228. * @param [options.markerSize = GeoJsonDataSource.markerSize] - The default size of the map pin created for each point, in pixels.
  20229. * @param [options.markerSymbol = GeoJsonDataSource.markerSymbol] - The default symbol of the map pin created for each point.
  20230. * @param [options.markerColor = GeoJsonDataSource.markerColor] - The default color of the map pin created for each point.
  20231. * @param [options.stroke = GeoJsonDataSource.stroke] - The default color of polylines and polygon outlines.
  20232. * @param [options.strokeWidth = GeoJsonDataSource.strokeWidth] - The default width of polylines and polygon outlines.
  20233. * @param [options.fill = GeoJsonDataSource.fill] - The default color for polygon interiors.
  20234. * @param [options.clampToGround = GeoJsonDataSource.clampToGround] - true if we want the features clamped to the ground.
  20235. * @param [options.credit] - A credit for the data source, which is displayed on the canvas.
  20236. * @returns a promise that will resolve when the GeoJSON is loaded.
  20237. */
  20238. load(data: Resource | string | any, options?: {
  20239. sourceUri?: string;
  20240. describe?: GeoJsonDataSource.describe;
  20241. markerSize?: number;
  20242. markerSymbol?: string;
  20243. markerColor?: Color;
  20244. stroke?: Color;
  20245. strokeWidth?: number;
  20246. fill?: Color;
  20247. clampToGround?: boolean;
  20248. credit?: Credit | string;
  20249. }): Promise<GeoJsonDataSource>;
  20250. /**
  20251. * Updates the data source to the provided time. This function is optional and
  20252. is not required to be implemented. It is provided for data sources which
  20253. retrieve data based on the current animation time or scene state.
  20254. If implemented, update will be called by {@link DataSourceDisplay} once a frame.
  20255. * @param time - The simulation time.
  20256. * @returns True if this data source is ready to be displayed at the provided time, false otherwise.
  20257. */
  20258. update(time: JulianDate): boolean;
  20259. }
  20260. /**
  20261. * An abstract class for updating geometry entities.
  20262. * @param options - An object with the following properties:
  20263. * @param options.entity - The entity containing the geometry to be visualized.
  20264. * @param options.scene - The scene where visualization is taking place.
  20265. * @param options.geometryOptions - Options for the geometry
  20266. * @param options.geometryPropertyName - The geometry property name
  20267. * @param options.observedPropertyNames - The entity properties this geometry cares about
  20268. */
  20269. export class GeometryUpdater {
  20270. constructor(options: {
  20271. entity: Entity;
  20272. scene: Scene;
  20273. geometryOptions: any;
  20274. geometryPropertyName: string;
  20275. observedPropertyNames: string[];
  20276. });
  20277. /**
  20278. * Gets the unique ID associated with this updater
  20279. */
  20280. readonly id: string;
  20281. /**
  20282. * Gets the entity associated with this geometry.
  20283. */
  20284. readonly entity: Entity;
  20285. /**
  20286. * Gets a value indicating if the geometry has a fill component.
  20287. */
  20288. readonly fillEnabled: boolean;
  20289. /**
  20290. * Gets a value indicating if fill visibility varies with simulation time.
  20291. */
  20292. readonly hasConstantFill: boolean;
  20293. /**
  20294. * Gets the material property used to fill the geometry.
  20295. */
  20296. readonly fillMaterialProperty: MaterialProperty;
  20297. /**
  20298. * Gets a value indicating if the geometry has an outline component.
  20299. */
  20300. readonly outlineEnabled: boolean;
  20301. /**
  20302. * Gets a value indicating if the geometry has an outline component.
  20303. */
  20304. readonly hasConstantOutline: boolean;
  20305. /**
  20306. * Gets the {@link Color} property for the geometry outline.
  20307. */
  20308. readonly outlineColorProperty: Property;
  20309. /**
  20310. * Gets the constant with of the geometry outline, in pixels.
  20311. This value is only valid if isDynamic is false.
  20312. */
  20313. readonly outlineWidth: number;
  20314. /**
  20315. * Gets the property specifying whether the geometry
  20316. casts or receives shadows from light sources.
  20317. */
  20318. readonly shadowsProperty: Property;
  20319. /**
  20320. * Gets or sets the {@link DistanceDisplayCondition} Property specifying at what distance from the camera that this geometry will be displayed.
  20321. */
  20322. readonly distanceDisplayConditionProperty: Property;
  20323. /**
  20324. * Gets or sets the {@link ClassificationType} Property specifying if this geometry will classify terrain, 3D Tiles, or both when on the ground.
  20325. */
  20326. readonly classificationTypeProperty: Property;
  20327. /**
  20328. * Gets a value indicating if the geometry is time-varying.
  20329. If true, all visualization is delegated to a DynamicGeometryUpdater
  20330. returned by GeometryUpdater#createDynamicUpdater.
  20331. */
  20332. readonly isDynamic: boolean;
  20333. /**
  20334. * Gets a value indicating if the geometry is closed.
  20335. This property is only valid for static geometry.
  20336. */
  20337. readonly isClosed: boolean;
  20338. /**
  20339. * Gets an event that is raised whenever the public properties
  20340. of this updater change.
  20341. */
  20342. readonly geometryChanged: boolean;
  20343. /**
  20344. * Checks if the geometry is outlined at the provided time.
  20345. * @param time - The time for which to retrieve visibility.
  20346. * @returns true if geometry is outlined at the provided time, false otherwise.
  20347. */
  20348. isOutlineVisible(time: JulianDate): boolean;
  20349. /**
  20350. * Checks if the geometry is filled at the provided time.
  20351. * @param time - The time for which to retrieve visibility.
  20352. * @returns true if geometry is filled at the provided time, false otherwise.
  20353. */
  20354. isFilled(time: JulianDate): boolean;
  20355. /**
  20356. * Creates the geometry instance which represents the fill of the geometry.
  20357. * @param time - The time to use when retrieving initial attribute values.
  20358. * @returns The geometry instance representing the filled portion of the geometry.
  20359. */
  20360. createFillGeometryInstance(time: JulianDate): GeometryInstance;
  20361. /**
  20362. * Creates the geometry instance which represents the outline of the geometry.
  20363. * @param time - The time to use when retrieving initial attribute values.
  20364. * @returns The geometry instance representing the outline portion of the geometry.
  20365. */
  20366. createOutlineGeometryInstance(time: JulianDate): GeometryInstance;
  20367. /**
  20368. * Returns true if this object was destroyed; otherwise, false.
  20369. * @returns True if this object was destroyed; otherwise, false.
  20370. */
  20371. isDestroyed(): boolean;
  20372. /**
  20373. * Destroys and resources used by the object. Once an object is destroyed, it should not be used.
  20374. */
  20375. destroy(): void;
  20376. }
  20377. /**
  20378. * A general purpose visualizer for geometry represented by {@link Primitive} instances.
  20379. * @param scene - The scene the primitives will be rendered in.
  20380. * @param entityCollection - The entityCollection to visualize.
  20381. * @param [primitives = scene.primitives] - A collection to add primitives related to the entities
  20382. * @param [groundPrimitives = scene.groundPrimitives] - A collection to add ground primitives related to the entities
  20383. */
  20384. export class GeometryVisualizer {
  20385. constructor(scene: Scene, entityCollection: EntityCollection, primitives?: PrimitiveCollection, groundPrimitives?: PrimitiveCollection);
  20386. /**
  20387. * Updates all of the primitives created by this visualizer to match their
  20388. Entity counterpart at the given time.
  20389. * @param time - The time to update to.
  20390. * @returns True if the visualizer successfully updated to the provided time,
  20391. false if the visualizer is waiting for asynchronous primitives to be created.
  20392. */
  20393. update(time: JulianDate): boolean;
  20394. /**
  20395. * Returns true if this object was destroyed; otherwise, false.
  20396. * @returns True if this object was destroyed; otherwise, false.
  20397. */
  20398. isDestroyed(): boolean;
  20399. /**
  20400. * Removes and destroys all primitives created by this instance.
  20401. */
  20402. destroy(): void;
  20403. }
  20404. /**
  20405. * A {@link MaterialProperty} that maps to grid {@link Material} uniforms.
  20406. * @param [options] - Object with the following properties:
  20407. * @param [options.color = Color.WHITE] - A Property specifying the grid {@link Color}.
  20408. * @param [options.cellAlpha = 0.1] - A numeric Property specifying cell alpha values.
  20409. * @param [options.lineCount = new Cartesian2(8, 8)] - A {@link Cartesian2} Property specifying the number of grid lines along each axis.
  20410. * @param [options.lineThickness = new Cartesian2(1.0, 1.0)] - A {@link Cartesian2} Property specifying the thickness of grid lines along each axis.
  20411. * @param [options.lineOffset = new Cartesian2(0.0, 0.0)] - A {@link Cartesian2} Property specifying starting offset of grid lines along each axis.
  20412. */
  20413. export class GridMaterialProperty {
  20414. constructor(options?: {
  20415. color?: Property | Color;
  20416. cellAlpha?: Property | number;
  20417. lineCount?: Property | Cartesian2;
  20418. lineThickness?: Property | Cartesian2;
  20419. lineOffset?: Property | Cartesian2;
  20420. });
  20421. /**
  20422. * Gets a value indicating if this property is constant. A property is considered
  20423. constant if getValue always returns the same result for the current definition.
  20424. */
  20425. readonly isConstant: boolean;
  20426. /**
  20427. * Gets the event that is raised whenever the definition of this property changes.
  20428. The definition is considered to have changed if a call to getValue would return
  20429. a different result for the same time.
  20430. */
  20431. readonly definitionChanged: Event;
  20432. /**
  20433. * Gets or sets the Property specifying the grid {@link Color}.
  20434. */
  20435. color: Property | undefined;
  20436. /**
  20437. * Gets or sets the numeric Property specifying cell alpha values.
  20438. */
  20439. cellAlpha: Property | undefined;
  20440. /**
  20441. * Gets or sets the {@link Cartesian2} Property specifying the number of grid lines along each axis.
  20442. */
  20443. lineCount: Property | undefined;
  20444. /**
  20445. * Gets or sets the {@link Cartesian2} Property specifying the thickness of grid lines along each axis.
  20446. */
  20447. lineThickness: Property | undefined;
  20448. /**
  20449. * Gets or sets the {@link Cartesian2} Property specifying the starting offset of grid lines along each axis.
  20450. */
  20451. lineOffset: Property | undefined;
  20452. /**
  20453. * Gets the {@link Material} type at the provided time.
  20454. * @param time - The time for which to retrieve the type.
  20455. * @returns The type of material.
  20456. */
  20457. getType(time: JulianDate): string;
  20458. /**
  20459. * Gets the value of the property at the provided time.
  20460. * @param time - The time for which to retrieve the value.
  20461. * @param [result] - The object to store the value into, if omitted, a new instance is created and returned.
  20462. * @returns The modified result parameter or a new instance if the result parameter was not supplied.
  20463. */
  20464. getValue(time: JulianDate, result?: any): any;
  20465. /**
  20466. * Compares this property to the provided property and returns
  20467. <code>true</code> if they are equal, <code>false</code> otherwise.
  20468. * @param [other] - The other property.
  20469. * @returns <code>true</code> if left and right are equal, <code>false</code> otherwise.
  20470. */
  20471. equals(other?: Property): boolean;
  20472. }
  20473. /**
  20474. * An abstract class for updating ground geometry entities.
  20475. * @param options - An object with the following properties:
  20476. * @param options.entity - The entity containing the geometry to be visualized.
  20477. * @param options.scene - The scene where visualization is taking place.
  20478. * @param options.geometryOptions - Options for the geometry
  20479. * @param options.geometryPropertyName - The geometry property name
  20480. * @param options.observedPropertyNames - The entity properties this geometry cares about
  20481. */
  20482. export class GroundGeometryUpdater {
  20483. constructor(options: {
  20484. entity: Entity;
  20485. scene: Scene;
  20486. geometryOptions: any;
  20487. geometryPropertyName: string;
  20488. observedPropertyNames: string[];
  20489. });
  20490. /**
  20491. * Gets the zindex
  20492. */
  20493. readonly zIndex: number;
  20494. /**
  20495. * Destroys and resources used by the object. Once an object is destroyed, it should not be used.
  20496. */
  20497. destroy(): void;
  20498. }
  20499. /**
  20500. * A {@link MaterialProperty} that maps to image {@link Material} uniforms.
  20501. * @param [options] - Object with the following properties:
  20502. * @param [options.image] - A Property specifying the Image, URL, Canvas, or Video.
  20503. * @param [options.repeat = new Cartesian2(1.0, 1.0)] - A {@link Cartesian2} Property specifying the number of times the image repeats in each direction.
  20504. * @param [options.color = Color.WHITE] - The color applied to the image
  20505. * @param [options.transparent = false] - Set to true when the image has transparency (for example, when a png has transparent sections)
  20506. */
  20507. export class ImageMaterialProperty {
  20508. constructor(options?: {
  20509. image?: Property | string | HTMLImageElement | HTMLCanvasElement | HTMLVideoElement;
  20510. repeat?: Property | Cartesian2;
  20511. color?: Property | Color;
  20512. transparent?: Property | boolean;
  20513. });
  20514. /**
  20515. * Gets a value indicating if this property is constant. A property is considered
  20516. constant if getValue always returns the same result for the current definition.
  20517. */
  20518. readonly isConstant: boolean;
  20519. /**
  20520. * Gets the event that is raised whenever the definition of this property changes.
  20521. The definition is considered to have changed if a call to getValue would return
  20522. a different result for the same time.
  20523. */
  20524. readonly definitionChanged: Event;
  20525. /**
  20526. * Gets or sets the Property specifying Image, URL, Canvas, or Video to use.
  20527. */
  20528. image: Property | undefined;
  20529. /**
  20530. * Gets or sets the {@link Cartesian2} Property specifying the number of times the image repeats in each direction.
  20531. */
  20532. repeat: Property | undefined;
  20533. /**
  20534. * Gets or sets the Color Property specifying the desired color applied to the image.
  20535. */
  20536. color: Property | undefined;
  20537. /**
  20538. * Gets or sets the Boolean Property specifying whether the image has transparency
  20539. */
  20540. transparent: Property | undefined;
  20541. /**
  20542. * Gets the {@link Material} type at the provided time.
  20543. * @param time - The time for which to retrieve the type.
  20544. * @returns The type of material.
  20545. */
  20546. getType(time: JulianDate): string;
  20547. /**
  20548. * Gets the value of the property at the provided time.
  20549. * @param time - The time for which to retrieve the value.
  20550. * @param [result] - The object to store the value into, if omitted, a new instance is created and returned.
  20551. * @returns The modified result parameter or a new instance if the result parameter was not supplied.
  20552. */
  20553. getValue(time: JulianDate, result?: any): any;
  20554. /**
  20555. * Compares this property to the provided property and returns
  20556. <code>true</code> if they are equal, <code>false</code> otherwise.
  20557. * @param [other] - The other property.
  20558. * @returns <code>true</code> if left and right are equal, <code>false</code> otherwise.
  20559. */
  20560. equals(other?: Property): boolean;
  20561. }
  20562. /**
  20563. * Representation of <Camera> from KML
  20564. * @param position - camera position
  20565. * @param headingPitchRoll - camera orientation
  20566. */
  20567. export class KmlCamera {
  20568. constructor(position: Cartesian3, headingPitchRoll: HeadingPitchRoll);
  20569. }
  20570. export namespace KmlDataSource {
  20571. /**
  20572. * Initialization options for the `load` method.
  20573. * @property camera - The camera that is used for viewRefreshModes and sending camera properties to network links.
  20574. * @property canvas - The canvas that is used for sending viewer properties to network links.
  20575. * @property [sourceUri] - Overrides the url to use for resolving relative links and other KML network features.
  20576. * @property [clampToGround = false] - true if we want the geometry features (Polygons, LineStrings and LinearRings) clamped to the ground.
  20577. * @property [ellipsoid = Ellipsoid.WGS84] - The global ellipsoid used for geographical calculations.
  20578. * @property [credit] - A credit for the data source, which is displayed on the canvas.
  20579. */
  20580. type LoadOptions = {
  20581. camera: Camera;
  20582. canvas: HTMLCanvasElement;
  20583. sourceUri?: string;
  20584. clampToGround?: boolean;
  20585. ellipsoid?: Ellipsoid;
  20586. credit?: Credit | string;
  20587. };
  20588. }
  20589. /**
  20590. * A {@link DataSource} which processes Keyhole Markup Language 2.2 (KML).
  20591. <p>
  20592. KML support in Cesium is incomplete, but a large amount of the standard,
  20593. as well as Google's <code>gx</code> extension namespace, is supported. See Github issue
  20594. {@link https://github.com/CesiumGS/cesium/issues/873|#873} for a
  20595. detailed list of what is and isn't support. Cesium will also write information to the
  20596. console when it encounters most unsupported features.
  20597. </p>
  20598. <p>
  20599. Non visual feature data, such as <code>atom:author</code> and <code>ExtendedData</code>
  20600. is exposed via an instance of {@link KmlFeatureData}, which is added to each {@link Entity}
  20601. under the <code>kml</code> property.
  20602. </p>
  20603. * @example
  20604. * var viewer = new Cesium.Viewer('cesiumContainer');
  20605. viewer.dataSources.add(Cesium.KmlDataSource.load('../../SampleData/facilities.kmz',
  20606. {
  20607. camera: viewer.scene.camera,
  20608. canvas: viewer.scene.canvas
  20609. })
  20610. );
  20611. * @param options - An object with the following properties:
  20612. * @param options.camera - The camera that is used for viewRefreshModes and sending camera properties to network links.
  20613. * @param options.canvas - The canvas that is used for sending viewer properties to network links.
  20614. * @param [options.ellipsoid = Ellipsoid.WGS84] - The global ellipsoid used for geographical calculations.
  20615. * @param [options.credit] - A credit for the data source, which is displayed on the canvas.
  20616. */
  20617. export class KmlDataSource {
  20618. constructor(options: {
  20619. camera: Camera;
  20620. canvas: HTMLCanvasElement;
  20621. ellipsoid?: Ellipsoid;
  20622. credit?: Credit | string;
  20623. });
  20624. /**
  20625. * Creates a Promise to a new instance loaded with the provided KML data.
  20626. * @param data - A url, parsed KML document, or Blob containing binary KMZ data or a parsed KML document.
  20627. * @param [options] - An object specifying configuration options
  20628. * @returns A promise that will resolve to a new KmlDataSource instance once the KML is loaded.
  20629. */
  20630. static load(data: Resource | string | Document | Blob, options?: KmlDataSource.LoadOptions): Promise<KmlDataSource>;
  20631. /**
  20632. * Gets or sets a human-readable name for this instance.
  20633. This will be automatically be set to the KML document name on load.
  20634. */
  20635. name: string;
  20636. /**
  20637. * Gets the clock settings defined by the loaded KML. This represents the total
  20638. availability interval for all time-dynamic data. If the KML does not contain
  20639. time-dynamic data, this value is undefined.
  20640. */
  20641. clock: DataSourceClock;
  20642. /**
  20643. * Gets the collection of {@link Entity} instances.
  20644. */
  20645. entities: EntityCollection;
  20646. /**
  20647. * Gets a value indicating if the data source is currently loading data.
  20648. */
  20649. isLoading: boolean;
  20650. /**
  20651. * Gets an event that will be raised when the underlying data changes.
  20652. */
  20653. changedEvent: Event;
  20654. /**
  20655. * Gets an event that will be raised if an error is encountered during processing.
  20656. */
  20657. errorEvent: Event;
  20658. /**
  20659. * Gets an event that will be raised when the data source either starts or stops loading.
  20660. */
  20661. loadingEvent: Event;
  20662. /**
  20663. * Gets an event that will be raised when the data source refreshes a network link.
  20664. */
  20665. refreshEvent: Event;
  20666. /**
  20667. * Gets an event that will be raised when the data source finds an unsupported node type.
  20668. */
  20669. unsupportedNodeEvent: Event;
  20670. /**
  20671. * Gets whether or not this data source should be displayed.
  20672. */
  20673. show: boolean;
  20674. /**
  20675. * Gets or sets the clustering options for this data source. This object can be shared between multiple data sources.
  20676. */
  20677. clustering: EntityCluster;
  20678. /**
  20679. * Gets the credit that will be displayed for the data source
  20680. */
  20681. credit: Credit;
  20682. /**
  20683. * Asynchronously loads the provided KML data, replacing any existing data.
  20684. * @param data - A url, parsed KML document, or Blob containing binary KMZ data or a parsed KML document.
  20685. * @param [options] - An object with the following properties:
  20686. * @param [options.sourceUri] - Overrides the url to use for resolving relative links and other KML network features.
  20687. * @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.
  20688. * @param [options.ellipsoid = Ellipsoid.WGS84] - The global ellipsoid used for geographical calculations.
  20689. * @returns A promise that will resolve to this instances once the KML is loaded.
  20690. */
  20691. load(data: Resource | string | Document | Blob, options?: {
  20692. sourceUri?: Resource | string;
  20693. clampToGround?: boolean;
  20694. ellipsoid?: Ellipsoid;
  20695. }): Promise<KmlDataSource>;
  20696. /**
  20697. * Updates any NetworkLink that require updating.
  20698. * @param time - The simulation time.
  20699. * @returns True if this data source is ready to be displayed at the provided time, false otherwise.
  20700. */
  20701. update(time: JulianDate): boolean;
  20702. }
  20703. /**
  20704. * Contains KML Feature data loaded into the <code>Entity.kml</code> property by {@link KmlDataSource}.
  20705. */
  20706. export class KmlFeatureData {
  20707. constructor();
  20708. /**
  20709. * Gets the atom syndication format author field.
  20710. */
  20711. author: KmlFeatureData.Author;
  20712. /**
  20713. * Gets the link.
  20714. */
  20715. link: KmlFeatureData.Link;
  20716. /**
  20717. * Gets the unstructured address field.
  20718. */
  20719. address: string;
  20720. /**
  20721. * Gets the phone number.
  20722. */
  20723. phoneNumber: string;
  20724. /**
  20725. * Gets the snippet.
  20726. */
  20727. snippet: string;
  20728. /**
  20729. * Gets the extended data, parsed into a JSON object.
  20730. Currently only the <code>Data</code> property is supported.
  20731. <code>SchemaData</code> and custom data are ignored.
  20732. */
  20733. extendedData: string;
  20734. }
  20735. export namespace KmlFeatureData {
  20736. /**
  20737. * @property name - Gets the name.
  20738. * @property uri - Gets the URI.
  20739. * @property age - Gets the email.
  20740. */
  20741. type Author = {
  20742. name: string;
  20743. uri: string;
  20744. age: number;
  20745. };
  20746. /**
  20747. * @property href - Gets the href.
  20748. * @property hreflang - Gets the language of the linked resource.
  20749. * @property rel - Gets the link relation.
  20750. * @property type - Gets the link type.
  20751. * @property title - Gets the link title.
  20752. * @property length - Gets the link length.
  20753. */
  20754. type Link = {
  20755. href: string;
  20756. hreflang: string;
  20757. rel: string;
  20758. type: string;
  20759. title: string;
  20760. length: string;
  20761. };
  20762. }
  20763. /**
  20764. * @param position - camera position
  20765. * @param headingPitchRange - camera orientation
  20766. */
  20767. export class KmlLookAt {
  20768. constructor(position: Cartesian3, headingPitchRange: HeadingPitchRange);
  20769. }
  20770. /**
  20771. * @param name - name parsed from KML
  20772. * @param id - id parsed from KML
  20773. * @param playlist - array with KMLTourFlyTos, KMLTourWaits and KMLTourSoundCues
  20774. */
  20775. export class KmlTour {
  20776. constructor(name: string, id: string, playlist: any[]);
  20777. /**
  20778. * Id of kml gx:Tour entry
  20779. */
  20780. id: string;
  20781. /**
  20782. * Tour name
  20783. */
  20784. name: string;
  20785. /**
  20786. * Index of current entry from playlist
  20787. */
  20788. playlistIndex: number;
  20789. /**
  20790. * Array of playlist entries
  20791. */
  20792. playlist: any[];
  20793. /**
  20794. * Event will be called when tour starts to play,
  20795. before any playlist entry starts to play.
  20796. */
  20797. tourStart: Event;
  20798. /**
  20799. * Event will be called when all playlist entries are
  20800. played, or tour playback being canceled.
  20801. If tour playback was terminated, event callback will
  20802. be called with terminated=true parameter.
  20803. */
  20804. tourEnd: Event;
  20805. /**
  20806. * Event will be called when entry from playlist starts to play.
  20807. Event callback will be called with curent entry as first parameter.
  20808. */
  20809. entryStart: Event;
  20810. /**
  20811. * Event will be called when entry from playlist ends to play.
  20812. Event callback will be called with following parameters:
  20813. 1. entry - entry
  20814. 2. terminated - true if playback was terminated by calling {@link KmlTour#stop}
  20815. */
  20816. entryEnd: Event;
  20817. /**
  20818. * Add entry to this tour playlist.
  20819. * @param entry - an entry to add to the playlist.
  20820. */
  20821. addPlaylistEntry(entry: KmlTourFlyTo | KmlTourWait): void;
  20822. /**
  20823. * Play this tour.
  20824. * @param viewer - viewer widget.
  20825. * @param [cameraOptions] - these options will be merged with {@link Camera#flyTo}
  20826. options for FlyTo playlist entries.
  20827. */
  20828. play(viewer: Viewer, cameraOptions?: any): void;
  20829. /**
  20830. * Stop curently playing tour.
  20831. */
  20832. stop(): void;
  20833. }
  20834. /**
  20835. * @param duration - entry duration
  20836. * @param flyToMode - KML fly to mode: bounce, smooth, etc
  20837. * @param view - KmlCamera or KmlLookAt
  20838. */
  20839. export class KmlTourFlyTo {
  20840. constructor(duration: number, flyToMode: string, view: KmlCamera | KmlLookAt);
  20841. /**
  20842. * Play this playlist entry
  20843. * @param done - function which will be called when playback ends
  20844. * @param camera - Cesium camera
  20845. * @param [cameraOptions] - which will be merged with camera flyTo options. See {@link Camera#flyTo}
  20846. */
  20847. play(done: KmlTourFlyTo.DoneCallback, camera: Camera, cameraOptions?: any): void;
  20848. /**
  20849. * Stop execution of curent entry. Cancel camera flyTo
  20850. */
  20851. stop(): void;
  20852. /**
  20853. * Returns options for {@link Camera#flyTo} or {@link Camera#flyToBoundingSphere}
  20854. depends on this.view type.
  20855. * @param cameraOptions - options to merge with generated. See {@link Camera#flyTo}
  20856. * @returns {@link Camera#flyTo} or {@link Camera#flyToBoundingSphere} options
  20857. */
  20858. getCameraOptions(cameraOptions: any): any;
  20859. }
  20860. export namespace KmlTourFlyTo {
  20861. /**
  20862. * A function that will be executed when the flight completes.
  20863. * @param terminated - true if {@link KmlTourFlyTo#stop} was
  20864. called before entry done playback.
  20865. */
  20866. type DoneCallback = (terminated: boolean) => void;
  20867. }
  20868. /**
  20869. * @param duration - entry duration
  20870. */
  20871. export class KmlTourWait {
  20872. constructor(duration: number);
  20873. /**
  20874. * Play this playlist entry
  20875. * @param done - function which will be called when playback ends
  20876. */
  20877. play(done: KmlTourWait.DoneCallback): void;
  20878. /**
  20879. * Stop execution of curent entry, cancel curent timeout
  20880. */
  20881. stop(): void;
  20882. }
  20883. export namespace KmlTourWait {
  20884. /**
  20885. * A function which will be called when playback ends.
  20886. * @param terminated - true if {@link KmlTourWait#stop} was
  20887. called before entry done playback.
  20888. */
  20889. type DoneCallback = (terminated: boolean) => void;
  20890. }
  20891. export namespace LabelGraphics {
  20892. /**
  20893. * Initialization options for the LabelGraphics constructor
  20894. * @property [show = true] - A boolean Property specifying the visibility of the label.
  20895. * @property [text] - A Property specifying the text. Explicit newlines '\n' are supported.
  20896. * @property [font = '30px sans-serif'] - A Property specifying the CSS font.
  20897. * @property [style = LabelStyle.FILL] - A Property specifying the {@link LabelStyle}.
  20898. * @property [scale = 1.0] - A numeric Property specifying the scale to apply to the text.
  20899. * @property [showBackground = false] - A boolean Property specifying the visibility of the background behind the label.
  20900. * @property [backgroundColor = new Color(0.165, 0.165, 0.165, 0.8)] - A Property specifying the background {@link Color}.
  20901. * @property [backgroundPadding = new Cartesian2(7, 5)] - A {@link Cartesian2} Property specifying the horizontal and vertical background padding in pixels.
  20902. * @property [pixelOffset = Cartesian2.ZERO] - A {@link Cartesian2} Property specifying the pixel offset.
  20903. * @property [eyeOffset = Cartesian3.ZERO] - A {@link Cartesian3} Property specifying the eye offset.
  20904. * @property [horizontalOrigin = HorizontalOrigin.CENTER] - A Property specifying the {@link HorizontalOrigin}.
  20905. * @property [verticalOrigin = VerticalOrigin.CENTER] - A Property specifying the {@link VerticalOrigin}.
  20906. * @property [heightReference = HeightReference.NONE] - A Property specifying what the height is relative to.
  20907. * @property [fillColor = Color.WHITE] - A Property specifying the fill {@link Color}.
  20908. * @property [outlineColor = Color.BLACK] - A Property specifying the outline {@link Color}.
  20909. * @property [outlineWidth = 1.0] - A numeric Property specifying the outline width.
  20910. * @property [translucencyByDistance] - A {@link NearFarScalar} Property used to set translucency based on distance from the camera.
  20911. * @property [pixelOffsetScaleByDistance] - A {@link NearFarScalar} Property used to set pixelOffset based on distance from the camera.
  20912. * @property [scaleByDistance] - A {@link NearFarScalar} Property used to set scale based on distance from the camera.
  20913. * @property [distanceDisplayCondition] - A Property specifying at what distance from the camera that this label will be displayed.
  20914. * @property [disableDepthTestDistance] - A Property specifying the distance from the camera at which to disable the depth test to.
  20915. */
  20916. type ConstructorOptions = {
  20917. show?: Property | boolean;
  20918. text?: Property | string;
  20919. font?: Property | string;
  20920. style?: Property | LabelStyle;
  20921. scale?: Property | number;
  20922. showBackground?: Property | boolean;
  20923. backgroundColor?: Property | Color;
  20924. backgroundPadding?: Property | Cartesian2;
  20925. pixelOffset?: Property | Cartesian2;
  20926. eyeOffset?: Property | Cartesian3;
  20927. horizontalOrigin?: Property | HorizontalOrigin;
  20928. verticalOrigin?: Property | VerticalOrigin;
  20929. heightReference?: Property | HeightReference;
  20930. fillColor?: Property | Color;
  20931. outlineColor?: Property | Color;
  20932. outlineWidth?: Property | number;
  20933. translucencyByDistance?: Property | NearFarScalar;
  20934. pixelOffsetScaleByDistance?: Property | NearFarScalar;
  20935. scaleByDistance?: Property | NearFarScalar;
  20936. distanceDisplayCondition?: Property | DistanceDisplayCondition;
  20937. disableDepthTestDistance?: Property | number;
  20938. };
  20939. }
  20940. /**
  20941. * Describes a two dimensional label located at the position of the containing {@link Entity}.
  20942. <p>
  20943. <div align='center'>
  20944. <img src='Images/Label.png' width='400' height='300' /><br />
  20945. Example labels
  20946. </div>
  20947. </p>
  20948. * @param [options] - Object describing initialization options
  20949. */
  20950. export class LabelGraphics {
  20951. constructor(options?: LabelGraphics.ConstructorOptions);
  20952. /**
  20953. * Gets the event that is raised whenever a property or sub-property is changed or modified.
  20954. */
  20955. readonly definitionChanged: Event;
  20956. /**
  20957. * Gets or sets the boolean Property specifying the visibility of the label.
  20958. */
  20959. show: Property | undefined;
  20960. /**
  20961. * Gets or sets the string Property specifying the text of the label.
  20962. Explicit newlines '\n' are supported.
  20963. */
  20964. text: Property | undefined;
  20965. /**
  20966. * Gets or sets the string Property specifying the font in CSS syntax.
  20967. */
  20968. font: Property | undefined;
  20969. /**
  20970. * Gets or sets the Property specifying the {@link LabelStyle}.
  20971. */
  20972. style: Property | undefined;
  20973. /**
  20974. * Gets or sets the numeric Property specifying the uniform scale to apply to the image.
  20975. A scale greater than <code>1.0</code> enlarges the label while a scale less than <code>1.0</code> shrinks it.
  20976. <p>
  20977. <div align='center'>
  20978. <img src='Images/Label.setScale.png' width='400' height='300' /><br/>
  20979. From left to right in the above image, the scales are <code>0.5</code>, <code>1.0</code>,
  20980. and <code>2.0</code>.
  20981. </div>
  20982. </p>
  20983. */
  20984. scale: Property | undefined;
  20985. /**
  20986. * Gets or sets the boolean Property specifying the visibility of the background behind the label.
  20987. */
  20988. showBackground: Property | undefined;
  20989. /**
  20990. * Gets or sets the Property specifying the background {@link Color}.
  20991. */
  20992. backgroundColor: Property | undefined;
  20993. /**
  20994. * Gets or sets the {@link Cartesian2} Property specifying the label's horizontal and vertical
  20995. background padding in pixels.
  20996. */
  20997. backgroundPadding: Property | undefined;
  20998. /**
  20999. * Gets or sets the {@link Cartesian2} Property specifying the label's pixel offset in screen space
  21000. from the origin of this label. This is commonly used to align multiple labels and labels at
  21001. the same position, e.g., an image and text. The screen space origin is the top, left corner of the
  21002. canvas; <code>x</code> increases from left to right, and <code>y</code> increases from top to bottom.
  21003. <p>
  21004. <div align='center'>
  21005. <table border='0' cellpadding='5'><tr>
  21006. <td align='center'><code>default</code><br/><img src='Images/Label.setPixelOffset.default.png' width='250' height='188' /></td>
  21007. <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>
  21008. </tr></table>
  21009. The label's origin is indicated by the yellow point.
  21010. </div>
  21011. </p>
  21012. */
  21013. pixelOffset: Property | undefined;
  21014. /**
  21015. * Gets or sets the {@link Cartesian3} Property specifying the label's offset in eye coordinates.
  21016. Eye coordinates is a left-handed coordinate system, where <code>x</code> points towards the viewer's
  21017. right, <code>y</code> points up, and <code>z</code> points into the screen.
  21018. <p>
  21019. An eye offset is commonly used to arrange multiple labels or objects at the same position, e.g., to
  21020. arrange a label above its corresponding 3D model.
  21021. </p>
  21022. Below, the label is positioned at the center of the Earth but an eye offset makes it always
  21023. appear on top of the Earth regardless of the viewer's or Earth's orientation.
  21024. <p>
  21025. <div align='center'>
  21026. <table border='0' cellpadding='5'><tr>
  21027. <td align='center'><img src='Images/Billboard.setEyeOffset.one.png' width='250' height='188' /></td>
  21028. <td align='center'><img src='Images/Billboard.setEyeOffset.two.png' width='250' height='188' /></td>
  21029. </tr></table>
  21030. <code>l.eyeOffset = new Cartesian3(0.0, 8000000.0, 0.0);</code><br /><br />
  21031. </div>
  21032. </p>
  21033. */
  21034. eyeOffset: Property | undefined;
  21035. /**
  21036. * Gets or sets the Property specifying the {@link HorizontalOrigin}.
  21037. */
  21038. horizontalOrigin: Property | undefined;
  21039. /**
  21040. * Gets or sets the Property specifying the {@link VerticalOrigin}.
  21041. */
  21042. verticalOrigin: Property | undefined;
  21043. /**
  21044. * Gets or sets the Property specifying the {@link HeightReference}.
  21045. */
  21046. heightReference: Property | undefined;
  21047. /**
  21048. * Gets or sets the Property specifying the fill {@link Color}.
  21049. */
  21050. fillColor: Property | undefined;
  21051. /**
  21052. * Gets or sets the Property specifying the outline {@link Color}.
  21053. */
  21054. outlineColor: Property | undefined;
  21055. /**
  21056. * Gets or sets the numeric Property specifying the outline width.
  21057. */
  21058. outlineWidth: Property | undefined;
  21059. /**
  21060. * Gets or sets {@link NearFarScalar} Property specifying the translucency of the label based on the distance from the camera.
  21061. A label's translucency will interpolate between the {@link NearFarScalar#nearValue} and
  21062. {@link NearFarScalar#farValue} while the camera distance falls within the lower and upper bounds
  21063. of the specified {@link NearFarScalar#near} and {@link NearFarScalar#far}.
  21064. Outside of these ranges the label's translucency remains clamped to the nearest bound.
  21065. */
  21066. translucencyByDistance: Property | undefined;
  21067. /**
  21068. * Gets or sets {@link NearFarScalar} Property specifying the pixel offset of the label based on the distance from the camera.
  21069. A label's pixel offset will interpolate between the {@link NearFarScalar#nearValue} and
  21070. {@link NearFarScalar#farValue} while the camera distance falls within the lower and upper bounds
  21071. of the specified {@link NearFarScalar#near} and {@link NearFarScalar#far}.
  21072. Outside of these ranges the label's pixel offset remains clamped to the nearest bound.
  21073. */
  21074. pixelOffsetScaleByDistance: Property | undefined;
  21075. /**
  21076. * Gets or sets near and far scaling properties of a Label based on the label's distance from the camera.
  21077. A label's scale will interpolate between the {@link NearFarScalar#nearValue} and
  21078. {@link NearFarScalar#farValue} while the camera distance falls within the lower and upper bounds
  21079. of the specified {@link NearFarScalar#near} and {@link NearFarScalar#far}.
  21080. Outside of these ranges the label's scale remains clamped to the nearest bound. If undefined,
  21081. scaleByDistance will be disabled.
  21082. */
  21083. scaleByDistance: Property | undefined;
  21084. /**
  21085. * Gets or sets the {@link DistanceDisplayCondition} Property specifying at what distance from the camera that this label will be displayed.
  21086. */
  21087. distanceDisplayCondition: Property | undefined;
  21088. /**
  21089. * Gets or sets the distance from the camera at which to disable the depth test to, for example, prevent clipping against terrain.
  21090. When set to zero, the depth test is always applied. When set to Number.POSITIVE_INFINITY, the depth test is never applied.
  21091. */
  21092. disableDepthTestDistance: Property | undefined;
  21093. /**
  21094. * Duplicates this instance.
  21095. * @param [result] - The object onto which to store the result.
  21096. * @returns The modified result parameter or a new instance if one was not provided.
  21097. */
  21098. clone(result?: LabelGraphics): LabelGraphics;
  21099. /**
  21100. * Assigns each unassigned property on this object to the value
  21101. of the same property on the provided source object.
  21102. * @param source - The object to be merged into this object.
  21103. */
  21104. merge(source: LabelGraphics): void;
  21105. }
  21106. /**
  21107. * A {@link Visualizer} which maps the {@link LabelGraphics} instance
  21108. in {@link Entity#label} to a {@link Label}.
  21109. * @param entityCluster - The entity cluster to manage the collection of billboards and optionally cluster with other entities.
  21110. * @param entityCollection - The entityCollection to visualize.
  21111. */
  21112. export class LabelVisualizer {
  21113. constructor(entityCluster: EntityCluster, entityCollection: EntityCollection);
  21114. /**
  21115. * Updates the primitives created by this visualizer to match their
  21116. Entity counterpart at the given time.
  21117. * @param time - The time to update to.
  21118. * @returns This function always returns true.
  21119. */
  21120. update(time: JulianDate): boolean;
  21121. /**
  21122. * Returns true if this object was destroyed; otherwise, false.
  21123. * @returns True if this object was destroyed; otherwise, false.
  21124. */
  21125. isDestroyed(): boolean;
  21126. /**
  21127. * Removes and destroys all primitives created by this instance.
  21128. */
  21129. destroy(): void;
  21130. }
  21131. /**
  21132. * The interface for all {@link Property} objects that represent {@link Material} uniforms.
  21133. This type defines an interface and cannot be instantiated directly.
  21134. */
  21135. export class MaterialProperty {
  21136. constructor();
  21137. /**
  21138. * Gets a value indicating if this property is constant. A property is considered
  21139. constant if getValue always returns the same result for the current definition.
  21140. */
  21141. readonly isConstant: boolean;
  21142. /**
  21143. * Gets the event that is raised whenever the definition of this property changes.
  21144. The definition is considered to have changed if a call to getValue would return
  21145. a different result for the same time.
  21146. */
  21147. readonly definitionChanged: Event;
  21148. /**
  21149. * Gets the {@link Material} type at the provided time.
  21150. * @param time - The time for which to retrieve the type.
  21151. * @returns The type of material.
  21152. */
  21153. getType(time: JulianDate): string;
  21154. /**
  21155. * Gets the value of the property at the provided time.
  21156. * @param time - The time for which to retrieve the value.
  21157. * @param [result] - The object to store the value into, if omitted, a new instance is created and returned.
  21158. * @returns The modified result parameter or a new instance if the result parameter was not supplied.
  21159. */
  21160. getValue(time: JulianDate, result?: any): any;
  21161. /**
  21162. * Compares this property to the provided property and returns
  21163. <code>true</code> if they are equal, <code>false</code> otherwise.
  21164. * @param [other] - The other property.
  21165. * @returns <code>true</code> if left and right are equal, <code>false</code> otherwise.
  21166. */
  21167. equals(other?: Property): boolean;
  21168. }
  21169. export namespace ModelGraphics {
  21170. /**
  21171. * Initialization options for the ModelGraphics constructor
  21172. * @property [show = true] - A boolean Property specifying the visibility of the model.
  21173. * @property [uri] - A string or Resource Property specifying the URI of the glTF asset.
  21174. * @property [scale = 1.0] - A numeric Property specifying a uniform linear scale.
  21175. * @property [minimumPixelSize = 0.0] - A numeric Property specifying the approximate minimum pixel size of the model regardless of zoom.
  21176. * @property [maximumScale] - The maximum scale size of a model. An upper limit for minimumPixelSize.
  21177. * @property [incrementallyLoadTextures = true] - Determine if textures may continue to stream in after the model is loaded.
  21178. * @property [runAnimations = true] - A boolean Property specifying if glTF animations specified in the model should be started.
  21179. * @property [clampAnimations = true] - A boolean Property specifying if glTF animations should hold the last pose for time durations with no keyframes.
  21180. * @property [shadows = ShadowMode.ENABLED] - An enum Property specifying whether the model casts or receives shadows from light sources.
  21181. * @property [heightReference = HeightReference.NONE] - A Property specifying what the height is relative to.
  21182. * @property [silhouetteColor = Color.RED] - A Property specifying the {@link Color} of the silhouette.
  21183. * @property [silhouetteSize = 0.0] - A numeric Property specifying the size of the silhouette in pixels.
  21184. * @property [color = Color.WHITE] - A Property specifying the {@link Color} that blends with the model's rendered color.
  21185. * @property [colorBlendMode = ColorBlendMode.HIGHLIGHT] - An enum Property specifying how the color blends with the model.
  21186. * @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.
  21187. * @property [imageBasedLightingFactor = new Cartesian2(1.0, 1.0)] - A property specifying the contribution from diffuse and specular image-based lighting.
  21188. * @property [lightColor] - A property specifying the light color when shading the model. When <code>undefined</code> the scene's light color is used instead.
  21189. * @property [distanceDisplayCondition] - A Property specifying at what distance from the camera that this model will be displayed.
  21190. * @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.
  21191. * @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.
  21192. * @property [clippingPlanes] - A property specifying the {@link ClippingPlaneCollection} used to selectively disable rendering the model.
  21193. */
  21194. type ConstructorOptions = {
  21195. show?: Property | boolean;
  21196. uri?: Property | string | Resource;
  21197. scale?: Property | number;
  21198. minimumPixelSize?: Property | number;
  21199. maximumScale?: Property | number;
  21200. incrementallyLoadTextures?: Property | boolean;
  21201. runAnimations?: Property | boolean;
  21202. clampAnimations?: Property | boolean;
  21203. shadows?: Property | ShadowMode;
  21204. heightReference?: Property | HeightReference;
  21205. silhouetteColor?: Property | Color;
  21206. silhouetteSize?: Property | number;
  21207. color?: Property | Color;
  21208. colorBlendMode?: Property | ColorBlendMode;
  21209. colorBlendAmount?: Property | number;
  21210. imageBasedLightingFactor?: Property | Cartesian2;
  21211. lightColor?: Property | Color;
  21212. distanceDisplayCondition?: Property | DistanceDisplayCondition;
  21213. nodeTransformations?: PropertyBag | {
  21214. [key: string]: TranslationRotationScale;
  21215. };
  21216. articulations?: PropertyBag | {
  21217. [key: string]: number;
  21218. };
  21219. clippingPlanes?: Property | ClippingPlaneCollection;
  21220. };
  21221. }
  21222. /**
  21223. * A 3D model based on {@link https://github.com/KhronosGroup/glTF|glTF}, the runtime asset format for WebGL, OpenGL ES, and OpenGL.
  21224. The position and orientation of the model is determined by the containing {@link Entity}.
  21225. <p>
  21226. Cesium includes support for glTF geometry, materials, animations, and skinning.
  21227. Cameras and lights are not currently supported.
  21228. </p>
  21229. * @param [options] - Object describing initialization options
  21230. */
  21231. export class ModelGraphics {
  21232. constructor(options?: ModelGraphics.ConstructorOptions);
  21233. /**
  21234. * Gets the event that is raised whenever a property or sub-property is changed or modified.
  21235. */
  21236. readonly definitionChanged: Event;
  21237. /**
  21238. * Gets or sets the boolean Property specifying the visibility of the model.
  21239. */
  21240. show: Property | undefined;
  21241. /**
  21242. * Gets or sets the string Property specifying the URI of the glTF asset.
  21243. */
  21244. uri: Property | undefined;
  21245. /**
  21246. * Gets or sets the numeric Property specifying a uniform linear scale
  21247. for this model. Values greater than 1.0 increase the size of the model while
  21248. values less than 1.0 decrease it.
  21249. */
  21250. scale: Property | undefined;
  21251. /**
  21252. * Gets or sets the numeric Property specifying the approximate minimum
  21253. pixel size of the model regardless of zoom. This can be used to ensure that
  21254. a model is visible even when the viewer zooms out. When <code>0.0</code>,
  21255. no minimum size is enforced.
  21256. */
  21257. minimumPixelSize: Property | undefined;
  21258. /**
  21259. * Gets or sets the numeric Property specifying the maximum scale
  21260. size of a model. This property is used as an upper limit for
  21261. {@link ModelGraphics#minimumPixelSize}.
  21262. */
  21263. maximumScale: Property | undefined;
  21264. /**
  21265. * Get or sets the boolean Property specifying whether textures
  21266. may continue to stream in after the model is loaded.
  21267. */
  21268. incrementallyLoadTextures: Property | undefined;
  21269. /**
  21270. * Gets or sets the boolean Property specifying if glTF animations should be run.
  21271. */
  21272. runAnimations: Property | undefined;
  21273. /**
  21274. * Gets or sets the boolean Property specifying if glTF animations should hold the last pose for time durations with no keyframes.
  21275. */
  21276. clampAnimations: Property | undefined;
  21277. /**
  21278. * Get or sets the enum Property specifying whether the model
  21279. casts or receives shadows from light sources.
  21280. */
  21281. shadows: Property | undefined;
  21282. /**
  21283. * Gets or sets the Property specifying the {@link HeightReference}.
  21284. */
  21285. heightReference: Property | undefined;
  21286. /**
  21287. * Gets or sets the Property specifying the {@link Color} of the silhouette.
  21288. */
  21289. silhouetteColor: Property | undefined;
  21290. /**
  21291. * Gets or sets the numeric Property specifying the size of the silhouette in pixels.
  21292. */
  21293. silhouetteSize: Property | undefined;
  21294. /**
  21295. * Gets or sets the Property specifying the {@link Color} that blends with the model's rendered color.
  21296. */
  21297. color: Property | undefined;
  21298. /**
  21299. * Gets or sets the enum Property specifying how the color blends with the model.
  21300. */
  21301. colorBlendMode: Property | undefined;
  21302. /**
  21303. * A numeric Property specifying the color strength when the <code>colorBlendMode</code> is MIX.
  21304. A value of 0.0 results in the model's rendered color while a value of 1.0 results in a solid color, with
  21305. any value in-between resulting in a mix of the two.
  21306. */
  21307. colorBlendAmount: Property | undefined;
  21308. /**
  21309. * A property specifying the {@link Cartesian2} used to scale the diffuse and specular image-based lighting contribution to the final color.
  21310. */
  21311. imageBasedLightingFactor: Property | undefined;
  21312. /**
  21313. * A property specifying the {@link Cartesian3} light color when shading the model. When <code>undefined</code> the scene's light color is used instead.
  21314. */
  21315. lightColor: Property | undefined;
  21316. /**
  21317. * Gets or sets the {@link DistanceDisplayCondition} Property specifying at what distance from the camera that this model will be displayed.
  21318. */
  21319. distanceDisplayCondition: Property | undefined;
  21320. /**
  21321. * Gets or sets the set of node transformations to apply to this model. This is represented as an {@link PropertyBag}, where keys are
  21322. names of nodes, and values are {@link TranslationRotationScale} Properties describing the transformation to apply to that node.
  21323. The transformation is applied after the node's existing transformation as specified in the glTF, and does not replace the node's existing transformation.
  21324. */
  21325. nodeTransformations: PropertyBag;
  21326. /**
  21327. * Gets or sets the set of articulation values to apply to this model. This is represented as an {@link PropertyBag}, where keys are
  21328. composed as the name of the articulation, a single space, and the name of the stage.
  21329. */
  21330. articulations: PropertyBag;
  21331. /**
  21332. * A property specifying the {@link ClippingPlaneCollection} used to selectively disable rendering the model.
  21333. */
  21334. clippingPlanes: Property | undefined;
  21335. /**
  21336. * Duplicates this instance.
  21337. * @param [result] - The object onto which to store the result.
  21338. * @returns The modified result parameter or a new instance if one was not provided.
  21339. */
  21340. clone(result?: ModelGraphics): ModelGraphics;
  21341. /**
  21342. * Assigns each unassigned property on this object to the value
  21343. of the same property on the provided source object.
  21344. * @param source - The object to be merged into this object.
  21345. */
  21346. merge(source: ModelGraphics): void;
  21347. }
  21348. /**
  21349. * A {@link Visualizer} which maps {@link Entity#model} to a {@link Model}.
  21350. * @param scene - The scene the primitives will be rendered in.
  21351. * @param entityCollection - The entityCollection to visualize.
  21352. */
  21353. export class ModelVisualizer {
  21354. constructor(scene: Scene, entityCollection: EntityCollection);
  21355. /**
  21356. * Updates models created this visualizer to match their
  21357. Entity counterpart at the given time.
  21358. * @param time - The time to update to.
  21359. * @returns This function always returns true.
  21360. */
  21361. update(time: JulianDate): boolean;
  21362. /**
  21363. * Returns true if this object was destroyed; otherwise, false.
  21364. * @returns True if this object was destroyed; otherwise, false.
  21365. */
  21366. isDestroyed(): boolean;
  21367. /**
  21368. * Removes and destroys all primitives created by this instance.
  21369. */
  21370. destroy(): void;
  21371. }
  21372. /**
  21373. * A {@link Property} that produces {@link TranslationRotationScale} data.
  21374. * @param [options] - Object with the following properties:
  21375. * @param [options.translation = Cartesian3.ZERO] - A {@link Cartesian3} Property specifying the (x, y, z) translation to apply to the node.
  21376. * @param [options.rotation = Quaternion.IDENTITY] - A {@link Quaternion} Property specifying the (x, y, z, w) rotation to apply to the node.
  21377. * @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.
  21378. */
  21379. export class NodeTransformationProperty {
  21380. constructor(options?: {
  21381. translation?: Property | Cartesian3;
  21382. rotation?: Property | Quaternion;
  21383. scale?: Property | Cartesian3;
  21384. });
  21385. /**
  21386. * Gets a value indicating if this property is constant. A property is considered
  21387. constant if getValue always returns the same result for the current definition.
  21388. */
  21389. readonly isConstant: boolean;
  21390. /**
  21391. * Gets the event that is raised whenever the definition of this property changes.
  21392. The definition is considered to have changed if a call to getValue would return
  21393. a different result for the same time.
  21394. */
  21395. readonly definitionChanged: Event;
  21396. /**
  21397. * Gets or sets the {@link Cartesian3} Property specifying the (x, y, z) translation to apply to the node.
  21398. */
  21399. translation: Property | undefined;
  21400. /**
  21401. * Gets or sets the {@link Quaternion} Property specifying the (x, y, z, w) rotation to apply to the node.
  21402. */
  21403. rotation: Property | undefined;
  21404. /**
  21405. * Gets or sets the {@link Cartesian3} Property specifying the (x, y, z) scaling to apply to the node.
  21406. */
  21407. scale: Property | undefined;
  21408. /**
  21409. * Gets the value of the property at the provided time.
  21410. * @param time - The time for which to retrieve the value.
  21411. * @param [result] - The object to store the value into, if omitted, a new instance is created and returned.
  21412. * @returns The modified result parameter or a new instance if the result parameter was not supplied.
  21413. */
  21414. getValue(time: JulianDate, result?: TranslationRotationScale): TranslationRotationScale;
  21415. /**
  21416. * Compares this property to the provided property and returns
  21417. <code>true</code> if they are equal, <code>false</code> otherwise.
  21418. * @param [other] - The other property.
  21419. * @returns <code>true</code> if left and right are equal, <code>false</code> otherwise.
  21420. */
  21421. equals(other?: Property): boolean;
  21422. }
  21423. export namespace PathGraphics {
  21424. /**
  21425. * Initialization options for the PathGraphics constructor
  21426. * @property [show = true] - A boolean Property specifying the visibility of the path.
  21427. * @property [leadTime] - A Property specifying the number of seconds in front the object to show.
  21428. * @property [trailTime] - A Property specifying the number of seconds behind of the object to show.
  21429. * @property [width = 1.0] - A numeric Property specifying the width in pixels.
  21430. * @property [resolution = 60] - A numeric Property specifying the maximum number of seconds to step when sampling the position.
  21431. * @property [material = Color.WHITE] - A Property specifying the material used to draw the path.
  21432. * @property [distanceDisplayCondition] - A Property specifying at what distance from the camera that this path will be displayed.
  21433. */
  21434. type ConstructorOptions = {
  21435. show?: Property | boolean;
  21436. leadTime?: Property | number;
  21437. trailTime?: Property | number;
  21438. width?: Property | number;
  21439. resolution?: Property | number;
  21440. material?: MaterialProperty | Color;
  21441. distanceDisplayCondition?: Property | DistanceDisplayCondition;
  21442. };
  21443. }
  21444. /**
  21445. * Describes a polyline defined as the path made by an {@link Entity} as it moves over time.
  21446. * @param [options] - Object describing initialization options
  21447. */
  21448. export class PathGraphics {
  21449. constructor(options?: PathGraphics.ConstructorOptions);
  21450. /**
  21451. * Gets the event that is raised whenever a property or sub-property is changed or modified.
  21452. */
  21453. readonly definitionChanged: Event;
  21454. /**
  21455. * Gets or sets the boolean Property specifying the visibility of the path.
  21456. */
  21457. show: Property | undefined;
  21458. /**
  21459. * Gets or sets the Property specifying the number of seconds in front of the object to show.
  21460. */
  21461. leadTime: Property | undefined;
  21462. /**
  21463. * Gets or sets the Property specifying the number of seconds behind the object to show.
  21464. */
  21465. trailTime: Property | undefined;
  21466. /**
  21467. * Gets or sets the numeric Property specifying the width in pixels.
  21468. */
  21469. width: Property | undefined;
  21470. /**
  21471. * Gets or sets the Property specifying the maximum number of seconds to step when sampling the position.
  21472. */
  21473. resolution: Property | undefined;
  21474. /**
  21475. * Gets or sets the Property specifying the material used to draw the path.
  21476. */
  21477. material: MaterialProperty;
  21478. /**
  21479. * Gets or sets the {@link DistanceDisplayCondition} Property specifying at what distance from the camera that this path will be displayed.
  21480. */
  21481. distanceDisplayCondition: Property | undefined;
  21482. /**
  21483. * Duplicates this instance.
  21484. * @param [result] - The object onto which to store the result.
  21485. * @returns The modified result parameter or a new instance if one was not provided.
  21486. */
  21487. clone(result?: PathGraphics): PathGraphics;
  21488. /**
  21489. * Assigns each unassigned property on this object to the value
  21490. of the same property on the provided source object.
  21491. * @param source - The object to be merged into this object.
  21492. */
  21493. merge(source: PathGraphics): void;
  21494. }
  21495. /**
  21496. * A {@link Visualizer} which maps {@link Entity#path} to a {@link Polyline}.
  21497. * @param scene - The scene the primitives will be rendered in.
  21498. * @param entityCollection - The entityCollection to visualize.
  21499. */
  21500. export class PathVisualizer {
  21501. constructor(scene: Scene, entityCollection: EntityCollection);
  21502. /**
  21503. * Updates all of the primitives created by this visualizer to match their
  21504. Entity counterpart at the given time.
  21505. * @param time - The time to update to.
  21506. * @returns This function always returns true.
  21507. */
  21508. update(time: JulianDate): boolean;
  21509. /**
  21510. * Returns true if this object was destroyed; otherwise, false.
  21511. * @returns True if this object was destroyed; otherwise, false.
  21512. */
  21513. isDestroyed(): boolean;
  21514. /**
  21515. * Removes and destroys all primitives created by this instance.
  21516. */
  21517. destroy(): void;
  21518. }
  21519. /**
  21520. * A {@link GeometryUpdater} for planes.
  21521. Clients do not normally create this class directly, but instead rely on {@link DataSourceDisplay}.
  21522. * @param entity - The entity containing the geometry to be visualized.
  21523. * @param scene - The scene where visualization is taking place.
  21524. */
  21525. export class PlaneGeometryUpdater {
  21526. constructor(entity: Entity, scene: Scene);
  21527. /**
  21528. * Creates the geometry instance which represents the fill of the geometry.
  21529. * @param time - The time to use when retrieving initial attribute values.
  21530. * @returns The geometry instance representing the filled portion of the geometry.
  21531. */
  21532. createFillGeometryInstance(time: JulianDate): GeometryInstance;
  21533. /**
  21534. * Creates the geometry instance which represents the outline of the geometry.
  21535. * @param time - The time to use when retrieving initial attribute values.
  21536. * @returns The geometry instance representing the outline portion of the geometry.
  21537. */
  21538. createOutlineGeometryInstance(time: JulianDate): GeometryInstance;
  21539. }
  21540. export namespace PlaneGraphics {
  21541. /**
  21542. * Initialization options for the PlaneGraphics constructor
  21543. * @property [show = true] - A boolean Property specifying the visibility of the plane.
  21544. * @property [plane] - A {@link Plane} Property specifying the normal and distance for the plane.
  21545. * @property [dimensions] - A {@link Cartesian2} Property specifying the width and height of the plane.
  21546. * @property [fill = true] - A boolean Property specifying whether the plane is filled with the provided material.
  21547. * @property [material = Color.WHITE] - A Property specifying the material used to fill the plane.
  21548. * @property [outline = false] - A boolean Property specifying whether the plane is outlined.
  21549. * @property [outlineColor = Color.BLACK] - A Property specifying the {@link Color} of the outline.
  21550. * @property [outlineWidth = 1.0] - A numeric Property specifying the width of the outline.
  21551. * @property [shadows = ShadowMode.DISABLED] - An enum Property specifying whether the plane casts or receives shadows from light sources.
  21552. * @property [distanceDisplayCondition] - A Property specifying at what distance from the camera that this plane will be displayed.
  21553. */
  21554. type ConstructorOptions = {
  21555. show?: Property | boolean;
  21556. plane?: Property | Plane;
  21557. dimensions?: Property | Cartesian2;
  21558. fill?: Property | boolean;
  21559. material?: MaterialProperty | Color;
  21560. outline?: Property | boolean;
  21561. outlineColor?: Property | Color;
  21562. outlineWidth?: Property | number;
  21563. shadows?: Property | ShadowMode;
  21564. distanceDisplayCondition?: Property | DistanceDisplayCondition;
  21565. };
  21566. }
  21567. /**
  21568. * Describes a plane. The center position and orientation are determined by the containing {@link Entity}.
  21569. * @param [options] - Object describing initialization options
  21570. */
  21571. export class PlaneGraphics {
  21572. constructor(options?: PlaneGraphics.ConstructorOptions);
  21573. /**
  21574. * Gets the event that is raised whenever a property or sub-property is changed or modified.
  21575. */
  21576. readonly definitionChanged: Event;
  21577. /**
  21578. * Gets or sets the boolean Property specifying the visibility of the plane.
  21579. */
  21580. show: Property | undefined;
  21581. /**
  21582. * Gets or sets the {@link Plane} Property specifying the normal and distance of the plane.
  21583. */
  21584. plane: Property | undefined;
  21585. /**
  21586. * Gets or sets the {@link Cartesian2} Property specifying the width and height of the plane.
  21587. */
  21588. dimensions: Property | undefined;
  21589. /**
  21590. * Gets or sets the boolean Property specifying whether the plane is filled with the provided material.
  21591. */
  21592. fill: Property | undefined;
  21593. /**
  21594. * Gets or sets the material used to fill the plane.
  21595. */
  21596. material: MaterialProperty;
  21597. /**
  21598. * Gets or sets the Property specifying whether the plane is outlined.
  21599. */
  21600. outline: Property | undefined;
  21601. /**
  21602. * Gets or sets the Property specifying the {@link Color} of the outline.
  21603. */
  21604. outlineColor: Property | undefined;
  21605. /**
  21606. * Gets or sets the numeric Property specifying the width of the outline.
  21607. */
  21608. outlineWidth: Property | undefined;
  21609. /**
  21610. * Get or sets the enum Property specifying whether the plane
  21611. casts or receives shadows from light sources.
  21612. */
  21613. shadows: Property | undefined;
  21614. /**
  21615. * Gets or sets the {@link DistanceDisplayCondition} Property specifying at what distance from the camera that this plane will be displayed.
  21616. */
  21617. distanceDisplayCondition: Property | undefined;
  21618. /**
  21619. * Duplicates this instance.
  21620. * @param [result] - The object onto which to store the result.
  21621. * @returns The modified result parameter or a new instance if one was not provided.
  21622. */
  21623. clone(result?: PlaneGraphics): PlaneGraphics;
  21624. /**
  21625. * Assigns each unassigned property on this object to the value
  21626. of the same property on the provided source object.
  21627. * @param source - The object to be merged into this object.
  21628. */
  21629. merge(source: PlaneGraphics): void;
  21630. }
  21631. export namespace PointGraphics {
  21632. /**
  21633. * Initialization options for the PointGraphics constructor
  21634. * @property [show = true] - A boolean Property specifying the visibility of the point.
  21635. * @property [pixelSize = 1] - A numeric Property specifying the size in pixels.
  21636. * @property [heightReference = HeightReference.NONE] - A Property specifying what the height is relative to.
  21637. * @property [color = Color.WHITE] - A Property specifying the {@link Color} of the point.
  21638. * @property [outlineColor = Color.BLACK] - A Property specifying the {@link Color} of the outline.
  21639. * @property [outlineWidth = 0] - A numeric Property specifying the the outline width in pixels.
  21640. * @property [scaleByDistance] - A {@link NearFarScalar} Property used to scale the point based on distance.
  21641. * @property [translucencyByDistance] - A {@link NearFarScalar} Property used to set translucency based on distance from the camera.
  21642. * @property [distanceDisplayCondition] - A Property specifying at what distance from the camera that this point will be displayed.
  21643. * @property [disableDepthTestDistance] - A Property specifying the distance from the camera at which to disable the depth test to.
  21644. */
  21645. type ConstructorOptions = {
  21646. show?: Property | boolean;
  21647. pixelSize?: Property | number;
  21648. heightReference?: Property | HeightReference;
  21649. color?: Property | Color;
  21650. outlineColor?: Property | Color;
  21651. outlineWidth?: Property | number;
  21652. scaleByDistance?: Property | NearFarScalar;
  21653. translucencyByDistance?: Property | NearFarScalar;
  21654. distanceDisplayCondition?: Property | DistanceDisplayCondition;
  21655. disableDepthTestDistance?: Property | number;
  21656. };
  21657. }
  21658. /**
  21659. * Describes a graphical point located at the position of the containing {@link Entity}.
  21660. * @param [options] - Object describing initialization options
  21661. */
  21662. export class PointGraphics {
  21663. constructor(options?: PointGraphics.ConstructorOptions);
  21664. /**
  21665. * Gets the event that is raised whenever a property or sub-property is changed or modified.
  21666. */
  21667. readonly definitionChanged: Event;
  21668. /**
  21669. * Gets or sets the boolean Property specifying the visibility of the point.
  21670. */
  21671. show: Property | undefined;
  21672. /**
  21673. * Gets or sets the numeric Property specifying the size in pixels.
  21674. */
  21675. pixelSize: Property | undefined;
  21676. /**
  21677. * Gets or sets the Property specifying the {@link HeightReference}.
  21678. */
  21679. heightReference: Property | undefined;
  21680. /**
  21681. * Gets or sets the Property specifying the {@link Color} of the point.
  21682. */
  21683. color: Property | undefined;
  21684. /**
  21685. * Gets or sets the Property specifying the {@link Color} of the outline.
  21686. */
  21687. outlineColor: Property | undefined;
  21688. /**
  21689. * Gets or sets the numeric Property specifying the the outline width in pixels.
  21690. */
  21691. outlineWidth: Property | undefined;
  21692. /**
  21693. * Gets or sets the {@link NearFarScalar} Property used to scale the point based on distance.
  21694. If undefined, a constant size is used.
  21695. */
  21696. scaleByDistance: Property | undefined;
  21697. /**
  21698. * Gets or sets {@link NearFarScalar} Property specifying the translucency of the point based on the distance from the camera.
  21699. A point's translucency will interpolate between the {@link NearFarScalar#nearValue} and
  21700. {@link NearFarScalar#farValue} while the camera distance falls within the lower and upper bounds
  21701. of the specified {@link NearFarScalar#near} and {@link NearFarScalar#far}.
  21702. Outside of these ranges the points's translucency remains clamped to the nearest bound.
  21703. */
  21704. translucencyByDistance: Property | undefined;
  21705. /**
  21706. * Gets or sets the {@link DistanceDisplayCondition} Property specifying at what distance from the camera that this point will be displayed.
  21707. */
  21708. distanceDisplayCondition: Property | undefined;
  21709. /**
  21710. * Gets or sets the distance from the camera at which to disable the depth test to, for example, prevent clipping against terrain.
  21711. When set to zero, the depth test is always applied. When set to Number.POSITIVE_INFINITY, the depth test is never applied.
  21712. */
  21713. disableDepthTestDistance: Property | undefined;
  21714. /**
  21715. * Duplicates this instance.
  21716. * @param [result] - The object onto which to store the result.
  21717. * @returns The modified result parameter or a new instance if one was not provided.
  21718. */
  21719. clone(result?: PointGraphics): PointGraphics;
  21720. /**
  21721. * Assigns each unassigned property on this object to the value
  21722. of the same property on the provided source object.
  21723. * @param source - The object to be merged into this object.
  21724. */
  21725. merge(source: PointGraphics): void;
  21726. }
  21727. /**
  21728. * A {@link Visualizer} which maps {@link Entity#point} to a {@link PointPrimitive}.
  21729. * @param entityCluster - The entity cluster to manage the collection of billboards and optionally cluster with other entities.
  21730. * @param entityCollection - The entityCollection to visualize.
  21731. */
  21732. export class PointVisualizer {
  21733. constructor(entityCluster: EntityCluster, entityCollection: EntityCollection);
  21734. /**
  21735. * Updates the primitives created by this visualizer to match their
  21736. Entity counterpart at the given time.
  21737. * @param time - The time to update to.
  21738. * @returns This function always returns true.
  21739. */
  21740. update(time: JulianDate): boolean;
  21741. /**
  21742. * Returns true if this object was destroyed; otherwise, false.
  21743. * @returns True if this object was destroyed; otherwise, false.
  21744. */
  21745. isDestroyed(): boolean;
  21746. /**
  21747. * Removes and destroys all primitives created by this instance.
  21748. */
  21749. destroy(): void;
  21750. }
  21751. /**
  21752. * A {@link GeometryUpdater} for polygons.
  21753. Clients do not normally create this class directly, but instead rely on {@link DataSourceDisplay}.
  21754. * @param entity - The entity containing the geometry to be visualized.
  21755. * @param scene - The scene where visualization is taking place.
  21756. */
  21757. export class PolygonGeometryUpdater {
  21758. constructor(entity: Entity, scene: Scene);
  21759. /**
  21760. * Creates the geometry instance which represents the fill of the geometry.
  21761. * @param time - The time to use when retrieving initial attribute values.
  21762. * @returns The geometry instance representing the filled portion of the geometry.
  21763. */
  21764. createFillGeometryInstance(time: JulianDate): GeometryInstance;
  21765. /**
  21766. * Creates the geometry instance which represents the outline of the geometry.
  21767. * @param time - The time to use when retrieving initial attribute values.
  21768. * @returns The geometry instance representing the outline portion of the geometry.
  21769. */
  21770. createOutlineGeometryInstance(time: JulianDate): GeometryInstance;
  21771. }
  21772. export namespace PolygonGraphics {
  21773. /**
  21774. * Initialization options for the PolygonGraphics constructor
  21775. * @property [show = true] - A boolean Property specifying the visibility of the polygon.
  21776. * @property [hierarchy] - A Property specifying the {@link PolygonHierarchy}.
  21777. * @property [height = 0] - A numeric Property specifying the altitude of the polygon relative to the ellipsoid surface.
  21778. * @property [heightReference = HeightReference.NONE] - A Property specifying what the height is relative to.
  21779. * @property [extrudedHeight] - A numeric Property specifying the altitude of the polygon's extruded face relative to the ellipsoid surface.
  21780. * @property [extrudedHeightReference = HeightReference.NONE] - A Property specifying what the extrudedHeight is relative to.
  21781. * @property [stRotation = 0.0] - A numeric property specifying the rotation of the polygon texture counter-clockwise from north.
  21782. * @property [granularity = Cesium.Math.RADIANS_PER_DEGREE] - A numeric Property specifying the angular distance between each latitude and longitude point.
  21783. * @property [fill = true] - A boolean Property specifying whether the polygon is filled with the provided material.
  21784. * @property [material = Color.WHITE] - A Property specifying the material used to fill the polygon.
  21785. * @property [outline = false] - A boolean Property specifying whether the polygon is outlined.
  21786. * @property [outlineColor = Color.BLACK] - A Property specifying the {@link Color} of the outline.
  21787. * @property [outlineWidth = 1.0] - A numeric Property specifying the width of the outline.
  21788. * @property [perPositionHeight = false] - A boolean specifying whether or not the height of each position is used.
  21789. * @property [closeTop = true] - When false, leaves off the top of an extruded polygon open.
  21790. * @property [closeBottom = true] - When false, leaves off the bottom of an extruded polygon open.
  21791. * @property [arcType = ArcType.GEODESIC] - The type of line the polygon edges must follow.
  21792. * @property [shadows = ShadowMode.DISABLED] - An enum Property specifying whether the polygon casts or receives shadows from light sources.
  21793. * @property [distanceDisplayCondition] - A Property specifying at what distance from the camera that this polygon will be displayed.
  21794. * @property [classificationType = ClassificationType.BOTH] - An enum Property specifying whether this polygon will classify terrain, 3D Tiles, or both when on the ground.
  21795. * @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.
  21796. */
  21797. type ConstructorOptions = {
  21798. show?: Property | boolean;
  21799. hierarchy?: Property | PolygonHierarchy;
  21800. height?: Property | number;
  21801. heightReference?: Property | HeightReference;
  21802. extrudedHeight?: Property | number;
  21803. extrudedHeightReference?: Property | HeightReference;
  21804. stRotation?: Property | number;
  21805. granularity?: Property | number;
  21806. fill?: Property | boolean;
  21807. material?: MaterialProperty | Color;
  21808. outline?: Property | boolean;
  21809. outlineColor?: Property | Color;
  21810. outlineWidth?: Property | number;
  21811. perPositionHeight?: Property | boolean;
  21812. closeTop?: boolean | boolean;
  21813. closeBottom?: boolean | boolean;
  21814. arcType?: Property | ArcType;
  21815. shadows?: Property | ShadowMode;
  21816. distanceDisplayCondition?: Property | DistanceDisplayCondition;
  21817. classificationType?: Property | ClassificationType;
  21818. zIndex?: ConstantProperty | number;
  21819. };
  21820. }
  21821. /**
  21822. * Describes a polygon defined by an hierarchy of linear rings which make up the outer shape and any nested holes.
  21823. The polygon conforms to the curvature of the globe and can be placed on the surface or
  21824. at altitude and can optionally be extruded into a volume.
  21825. * @param [options] - Object describing initialization options
  21826. */
  21827. export class PolygonGraphics {
  21828. constructor(options?: PolygonGraphics.ConstructorOptions);
  21829. /**
  21830. * Gets the event that is raised whenever a property or sub-property is changed or modified.
  21831. */
  21832. readonly definitionChanged: Event;
  21833. /**
  21834. * Gets or sets the boolean Property specifying the visibility of the polygon.
  21835. */
  21836. show: Property | undefined;
  21837. /**
  21838. * Gets or sets the Property specifying the {@link PolygonHierarchy}.
  21839. */
  21840. hierarchy: Property | undefined;
  21841. /**
  21842. * Gets or sets the numeric Property specifying the constant altitude of the polygon.
  21843. */
  21844. height: Property | undefined;
  21845. /**
  21846. * Gets or sets the Property specifying the {@link HeightReference}.
  21847. */
  21848. heightReference: Property | undefined;
  21849. /**
  21850. * Gets or sets the numeric Property specifying the altitude of the polygon extrusion.
  21851. If {@link PolygonGraphics#perPositionHeight} is false, the volume starts at {@link PolygonGraphics#height} and ends at this altitude.
  21852. If {@link PolygonGraphics#perPositionHeight} is true, the volume starts at the height of each {@link PolygonGraphics#hierarchy} position and ends at this altitude.
  21853. */
  21854. extrudedHeight: Property | undefined;
  21855. /**
  21856. * Gets or sets the Property specifying the extruded {@link HeightReference}.
  21857. */
  21858. extrudedHeightReference: Property | undefined;
  21859. /**
  21860. * Gets or sets the numeric property specifying the rotation of the polygon texture counter-clockwise from north.
  21861. */
  21862. stRotation: Property | undefined;
  21863. /**
  21864. * Gets or sets the numeric Property specifying the angular distance between points on the polygon.
  21865. */
  21866. granularity: Property | undefined;
  21867. /**
  21868. * Gets or sets the boolean Property specifying whether the polygon is filled with the provided material.
  21869. */
  21870. fill: boolean;
  21871. /**
  21872. * Gets or sets the Property specifying the material used to fill the polygon.
  21873. */
  21874. material: MaterialProperty;
  21875. /**
  21876. * Gets or sets the Property specifying whether the polygon is outlined.
  21877. */
  21878. outline: Property | undefined;
  21879. /**
  21880. * Gets or sets the Property specifying the {@link Color} of the outline.
  21881. */
  21882. outlineColor: Property | undefined;
  21883. /**
  21884. * Gets or sets the numeric Property specifying the width of the outline.
  21885. */
  21886. outlineWidth: Property | undefined;
  21887. /**
  21888. * Gets or sets the boolean specifying whether or not the the height of each position is used.
  21889. If true, the shape will have non-uniform altitude defined by the height of each {@link PolygonGraphics#hierarchy} position.
  21890. If false, the shape will have a constant altitude as specified by {@link PolygonGraphics#height}.
  21891. */
  21892. perPositionHeight: Property | undefined;
  21893. /**
  21894. * Gets or sets a boolean specifying whether or not the top of an extruded polygon is included.
  21895. */
  21896. closeTop: Property | undefined;
  21897. /**
  21898. * Gets or sets a boolean specifying whether or not the bottom of an extruded polygon is included.
  21899. */
  21900. closeBottom: Property | undefined;
  21901. /**
  21902. * Gets or sets the {@link ArcType} Property specifying the type of lines the polygon edges use.
  21903. */
  21904. arcType: Property | undefined;
  21905. /**
  21906. * Get or sets the enum Property specifying whether the polygon
  21907. casts or receives shadows from light sources.
  21908. */
  21909. shadows: Property | undefined;
  21910. /**
  21911. * Gets or sets the {@link DistanceDisplayCondition} Property specifying at what distance from the camera that this polygon will be displayed.
  21912. */
  21913. distanceDisplayCondition: Property | undefined;
  21914. /**
  21915. * Gets or sets the {@link ClassificationType} Property specifying whether this polygon will classify terrain, 3D Tiles, or both when on the ground.
  21916. */
  21917. classificationType: Property | undefined;
  21918. /**
  21919. * 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.
  21920. */
  21921. zIndex: ConstantProperty | undefined;
  21922. /**
  21923. * Duplicates this instance.
  21924. * @param [result] - The object onto which to store the result.
  21925. * @returns The modified result parameter or a new instance if one was not provided.
  21926. */
  21927. clone(result?: PolygonGraphics): PolygonGraphics;
  21928. /**
  21929. * Assigns each unassigned property on this object to the value
  21930. of the same property on the provided source object.
  21931. * @param source - The object to be merged into this object.
  21932. */
  21933. merge(source: PolygonGraphics): void;
  21934. }
  21935. /**
  21936. * A {@link MaterialProperty} that maps to PolylineArrow {@link Material} uniforms.
  21937. * @param [color = Color.WHITE] - The {@link Color} Property to be used.
  21938. */
  21939. export class PolylineArrowMaterialProperty {
  21940. constructor(color?: Property | Color);
  21941. /**
  21942. * Gets a value indicating if this property is constant. A property is considered
  21943. constant if getValue always returns the same result for the current definition.
  21944. */
  21945. readonly isConstant: boolean;
  21946. /**
  21947. * Gets the event that is raised whenever the definition of this property changes.
  21948. The definition is considered to have changed if a call to getValue would return
  21949. a different result for the same time.
  21950. */
  21951. readonly definitionChanged: Event;
  21952. /**
  21953. * Gets or sets the {@link Color} {@link Property}.
  21954. */
  21955. color: Property | undefined;
  21956. /**
  21957. * Gets the {@link Material} type at the provided time.
  21958. * @param time - The time for which to retrieve the type.
  21959. * @returns The type of material.
  21960. */
  21961. getType(time: JulianDate): string;
  21962. /**
  21963. * Gets the value of the property at the provided time.
  21964. * @param time - The time for which to retrieve the value.
  21965. * @param [result] - The object to store the value into, if omitted, a new instance is created and returned.
  21966. * @returns The modified result parameter or a new instance if the result parameter was not supplied.
  21967. */
  21968. getValue(time: JulianDate, result?: any): any;
  21969. /**
  21970. * Compares this property to the provided property and returns
  21971. <code>true</code> if they are equal, <code>false</code> otherwise.
  21972. * @param [other] - The other property.
  21973. * @returns <code>true</code> if left and right are equal, <code>false</code> otherwise.
  21974. */
  21975. equals(other?: Property): boolean;
  21976. }
  21977. /**
  21978. * A {@link MaterialProperty} that maps to polyline dash {@link Material} uniforms.
  21979. * @param [options] - Object with the following properties:
  21980. * @param [options.color = Color.WHITE] - A Property specifying the {@link Color} of the line.
  21981. * @param [options.gapColor = Color.TRANSPARENT] - A Property specifying the {@link Color} of the gaps in the line.
  21982. * @param [options.dashLength = 16.0] - A numeric Property specifying the length of the dash pattern in pixels.
  21983. * @param [options.dashPattern = 255.0] - A numeric Property specifying a 16 bit pattern for the dash
  21984. */
  21985. export class PolylineDashMaterialProperty {
  21986. constructor(options?: {
  21987. color?: Property | Color;
  21988. gapColor?: Property | Color;
  21989. dashLength?: Property | number;
  21990. dashPattern?: Property | number;
  21991. });
  21992. /**
  21993. * Gets a value indicating if this property is constant. A property is considered
  21994. constant if getValue always returns the same result for the current definition.
  21995. */
  21996. readonly isConstant: boolean;
  21997. /**
  21998. * Gets the event that is raised whenever the definition of this property changes.
  21999. The definition is considered to have changed if a call to getValue would return
  22000. a different result for the same time.
  22001. */
  22002. readonly definitionChanged: Event;
  22003. /**
  22004. * Gets or sets the Property specifying the {@link Color} of the line.
  22005. */
  22006. color: Property | undefined;
  22007. /**
  22008. * Gets or sets the Property specifying the {@link Color} of the gaps in the line.
  22009. */
  22010. gapColor: Property | undefined;
  22011. /**
  22012. * Gets or sets the numeric Property specifying the length of a dash cycle
  22013. */
  22014. dashLength: Property | undefined;
  22015. /**
  22016. * Gets or sets the numeric Property specifying a dash pattern
  22017. */
  22018. dashPattern: Property | undefined;
  22019. /**
  22020. * Gets the {@link Material} type at the provided time.
  22021. * @param time - The time for which to retrieve the type.
  22022. * @returns The type of material.
  22023. */
  22024. getType(time: JulianDate): string;
  22025. /**
  22026. * Gets the value of the property at the provided time.
  22027. * @param time - The time for which to retrieve the value.
  22028. * @param [result] - The object to store the value into, if omitted, a new instance is created and returned.
  22029. * @returns The modified result parameter or a new instance if the result parameter was not supplied.
  22030. */
  22031. getValue(time: JulianDate, result?: any): any;
  22032. /**
  22033. * Compares this property to the provided property and returns
  22034. <code>true</code> if they are equal, <code>false</code> otherwise.
  22035. * @param [other] - The other property.
  22036. * @returns <code>true</code> if left and right are equal, <code>false</code> otherwise.
  22037. */
  22038. equals(other?: Property): boolean;
  22039. }
  22040. /**
  22041. * A {@link GeometryUpdater} for polylines.
  22042. Clients do not normally create this class directly, but instead rely on {@link DataSourceDisplay}.
  22043. * @param entity - The entity containing the geometry to be visualized.
  22044. * @param scene - The scene where visualization is taking place.
  22045. */
  22046. export class PolylineGeometryUpdater {
  22047. constructor(entity: Entity, scene: Scene);
  22048. /**
  22049. * Gets the unique ID associated with this updater
  22050. */
  22051. readonly id: string;
  22052. /**
  22053. * Gets the entity associated with this geometry.
  22054. */
  22055. readonly entity: Entity;
  22056. /**
  22057. * Gets a value indicating if the geometry has a fill component.
  22058. */
  22059. readonly fillEnabled: boolean;
  22060. /**
  22061. * Gets a value indicating if fill visibility varies with simulation time.
  22062. */
  22063. readonly hasConstantFill: boolean;
  22064. /**
  22065. * Gets the material property used to fill the geometry.
  22066. */
  22067. readonly fillMaterialProperty: MaterialProperty;
  22068. /**
  22069. * Gets the material property used to fill the geometry when it fails the depth test.
  22070. */
  22071. readonly depthFailMaterialProperty: MaterialProperty;
  22072. /**
  22073. * Gets a value indicating if the geometry has an outline component.
  22074. */
  22075. readonly outlineEnabled: boolean;
  22076. /**
  22077. * Gets a value indicating if outline visibility varies with simulation time.
  22078. */
  22079. readonly hasConstantOutline: boolean;
  22080. /**
  22081. * Gets the {@link Color} property for the geometry outline.
  22082. */
  22083. readonly outlineColorProperty: Property;
  22084. /**
  22085. * Gets the property specifying whether the geometry
  22086. casts or receives shadows from light sources.
  22087. */
  22088. readonly shadowsProperty: Property;
  22089. /**
  22090. * Gets or sets the {@link DistanceDisplayCondition} Property specifying at what distance from the camera that this geometry will be displayed.
  22091. */
  22092. readonly distanceDisplayConditionProperty: Property;
  22093. /**
  22094. * Gets or sets the {@link ClassificationType} Property specifying if this geometry will classify terrain, 3D Tiles, or both when on the ground.
  22095. */
  22096. readonly classificationTypeProperty: Property;
  22097. /**
  22098. * Gets a value indicating if the geometry is time-varying.
  22099. If true, all visualization is delegated to the {@link DynamicGeometryUpdater}
  22100. returned by GeometryUpdater#createDynamicUpdater.
  22101. */
  22102. readonly isDynamic: boolean;
  22103. /**
  22104. * Gets a value indicating if the geometry is closed.
  22105. This property is only valid for static geometry.
  22106. */
  22107. readonly isClosed: boolean;
  22108. /**
  22109. * Gets an event that is raised whenever the public properties
  22110. of this updater change.
  22111. */
  22112. readonly geometryChanged: boolean;
  22113. /**
  22114. * Gets a value indicating if the path of the line.
  22115. */
  22116. readonly arcType: ArcType;
  22117. /**
  22118. * Gets a value indicating if the geometry is clamped to the ground.
  22119. Returns false if polylines on terrain is not supported.
  22120. */
  22121. readonly clampToGround: boolean;
  22122. /**
  22123. * Gets the zindex
  22124. */
  22125. readonly zIndex: number;
  22126. /**
  22127. * Checks if the geometry is outlined at the provided time.
  22128. * @param time - The time for which to retrieve visibility.
  22129. * @returns true if geometry is outlined at the provided time, false otherwise.
  22130. */
  22131. isOutlineVisible(time: JulianDate): boolean;
  22132. /**
  22133. * Checks if the geometry is filled at the provided time.
  22134. * @param time - The time for which to retrieve visibility.
  22135. * @returns true if geometry is filled at the provided time, false otherwise.
  22136. */
  22137. isFilled(time: JulianDate): boolean;
  22138. /**
  22139. * Creates the geometry instance which represents the fill of the geometry.
  22140. * @param time - The time to use when retrieving initial attribute values.
  22141. * @returns The geometry instance representing the filled portion of the geometry.
  22142. */
  22143. createFillGeometryInstance(time: JulianDate): GeometryInstance;
  22144. /**
  22145. * Creates the geometry instance which represents the outline of the geometry.
  22146. * @param time - The time to use when retrieving initial attribute values.
  22147. * @returns The geometry instance representing the outline portion of the geometry.
  22148. */
  22149. createOutlineGeometryInstance(time: JulianDate): GeometryInstance;
  22150. /**
  22151. * Returns true if this object was destroyed; otherwise, false.
  22152. * @returns True if this object was destroyed; otherwise, false.
  22153. */
  22154. isDestroyed(): boolean;
  22155. /**
  22156. * Destroys and resources used by the object. Once an object is destroyed, it should not be used.
  22157. */
  22158. destroy(): void;
  22159. }
  22160. /**
  22161. * A {@link MaterialProperty} that maps to polyline glow {@link Material} uniforms.
  22162. * @param [options] - Object with the following properties:
  22163. * @param [options.color = Color.WHITE] - A Property specifying the {@link Color} of the line.
  22164. * @param [options.glowPower = 0.25] - A numeric Property specifying the strength of the glow, as a percentage of the total line width.
  22165. * @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.
  22166. */
  22167. export class PolylineGlowMaterialProperty {
  22168. constructor(options?: {
  22169. color?: Property | Color;
  22170. glowPower?: Property | number;
  22171. taperPower?: Property | number;
  22172. });
  22173. /**
  22174. * Gets a value indicating if this property is constant. A property is considered
  22175. constant if getValue always returns the same result for the current definition.
  22176. */
  22177. readonly isConstant: boolean;
  22178. /**
  22179. * Gets the event that is raised whenever the definition of this property changes.
  22180. The definition is considered to have changed if a call to getValue would return
  22181. a different result for the same time.
  22182. */
  22183. readonly definitionChanged: Event;
  22184. /**
  22185. * Gets or sets the Property specifying the {@link Color} of the line.
  22186. */
  22187. color: Property | undefined;
  22188. /**
  22189. * Gets or sets the numeric Property specifying the strength of the glow, as a percentage of the total line width (less than 1.0).
  22190. */
  22191. glowPower: Property | undefined;
  22192. /**
  22193. * 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.
  22194. */
  22195. taperPower: Property | undefined;
  22196. /**
  22197. * Gets the {@link Material} type at the provided time.
  22198. * @param time - The time for which to retrieve the type.
  22199. * @returns The type of material.
  22200. */
  22201. getType(time: JulianDate): string;
  22202. /**
  22203. * Gets the value of the property at the provided time.
  22204. * @param time - The time for which to retrieve the value.
  22205. * @param [result] - The object to store the value into, if omitted, a new instance is created and returned.
  22206. * @returns The modified result parameter or a new instance if the result parameter was not supplied.
  22207. */
  22208. getValue(time: JulianDate, result?: any): any;
  22209. /**
  22210. * Compares this property to the provided property and returns
  22211. <code>true</code> if they are equal, <code>false</code> otherwise.
  22212. * @param [other] - The other property.
  22213. * @returns <code>true</code> if left and right are equal, <code>false</code> otherwise.
  22214. */
  22215. equals(other?: Property): boolean;
  22216. }
  22217. export namespace PolylineGraphics {
  22218. /**
  22219. * Initialization options for the PolylineGraphics constructor
  22220. * @property [show = true] - A boolean Property specifying the visibility of the polyline.
  22221. * @property [positions] - A Property specifying the array of {@link Cartesian3} positions that define the line strip.
  22222. * @property [width = 1.0] - A numeric Property specifying the width in pixels.
  22223. * @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.
  22224. * @property [material = Color.WHITE] - A Property specifying the material used to draw the polyline.
  22225. * @property [depthFailMaterial] - A property specifying the material used to draw the polyline when it is below the terrain.
  22226. * @property [arcType = ArcType.GEODESIC] - The type of line the polyline segments must follow.
  22227. * @property [clampToGround = false] - A boolean Property specifying whether the Polyline should be clamped to the ground.
  22228. * @property [shadows = ShadowMode.DISABLED] - An enum Property specifying whether the polyline casts or receives shadows from light sources.
  22229. * @property [distanceDisplayCondition] - A Property specifying at what distance from the camera that this polyline will be displayed.
  22230. * @property [classificationType = ClassificationType.BOTH] - An enum Property specifying whether this polyline will classify terrain, 3D Tiles, or both when on the ground.
  22231. * @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.
  22232. */
  22233. type ConstructorOptions = {
  22234. show?: Property | boolean;
  22235. positions?: Property | Cartesian3[];
  22236. width?: Property | number;
  22237. granularity?: Property | number;
  22238. material?: MaterialProperty | Color;
  22239. depthFailMaterial?: MaterialProperty | Color;
  22240. arcType?: Property | ArcType;
  22241. clampToGround?: Property | boolean;
  22242. shadows?: Property | ShadowMode;
  22243. distanceDisplayCondition?: Property | DistanceDisplayCondition;
  22244. classificationType?: Property | ClassificationType;
  22245. zIndex?: Property | number;
  22246. };
  22247. }
  22248. /**
  22249. * Describes a polyline. The first two positions define a line segment,
  22250. and each additional position defines a line segment from the previous position. The segments
  22251. can be linear connected points, great arcs, or clamped to terrain.
  22252. * @param [options] - Object describing initialization options
  22253. */
  22254. export class PolylineGraphics {
  22255. constructor(options?: PolylineGraphics.ConstructorOptions);
  22256. /**
  22257. * Gets the event that is raised whenever a property or sub-property is changed or modified.
  22258. */
  22259. readonly definitionChanged: Event;
  22260. /**
  22261. * Gets or sets the boolean Property specifying the visibility of the polyline.
  22262. */
  22263. show: Property | undefined;
  22264. /**
  22265. * Gets or sets the Property specifying the array of {@link Cartesian3}
  22266. positions that define the line strip.
  22267. */
  22268. positions: Property | undefined;
  22269. /**
  22270. * Gets or sets the numeric Property specifying the width in pixels.
  22271. */
  22272. width: Property | undefined;
  22273. /**
  22274. * 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.
  22275. */
  22276. granularity: Property | undefined;
  22277. /**
  22278. * Gets or sets the Property specifying the material used to draw the polyline.
  22279. */
  22280. material: MaterialProperty;
  22281. /**
  22282. * Gets or sets the Property specifying the material used to draw the polyline when it fails the depth test.
  22283. <p>
  22284. Requires the EXT_frag_depth WebGL extension to render properly. If the extension is not supported,
  22285. there may be artifacts.
  22286. </p>
  22287. */
  22288. depthFailMaterial: MaterialProperty;
  22289. /**
  22290. * Gets or sets the {@link ArcType} Property specifying whether the line segments should be great arcs, rhumb lines or linearly connected.
  22291. */
  22292. arcType: Property | undefined;
  22293. /**
  22294. * Gets or sets the boolean Property specifying whether the polyline
  22295. should be clamped to the ground.
  22296. */
  22297. clampToGround: Property | undefined;
  22298. /**
  22299. * Get or sets the enum Property specifying whether the polyline
  22300. casts or receives shadows from light sources.
  22301. */
  22302. shadows: Property | undefined;
  22303. /**
  22304. * Gets or sets the {@link DistanceDisplayCondition} Property specifying at what distance from the camera that this polyline will be displayed.
  22305. */
  22306. distanceDisplayCondition: Property | undefined;
  22307. /**
  22308. * Gets or sets the {@link ClassificationType} Property specifying whether this polyline will classify terrain, 3D Tiles, or both when on the ground.
  22309. */
  22310. classificationType: Property | undefined;
  22311. /**
  22312. * 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.
  22313. */
  22314. zIndex: ConstantProperty | undefined;
  22315. /**
  22316. * Duplicates this instance.
  22317. * @param [result] - The object onto which to store the result.
  22318. * @returns The modified result parameter or a new instance if one was not provided.
  22319. */
  22320. clone(result?: PolylineGraphics): PolylineGraphics;
  22321. /**
  22322. * Assigns each unassigned property on this object to the value
  22323. of the same property on the provided source object.
  22324. * @param source - The object to be merged into this object.
  22325. */
  22326. merge(source: PolylineGraphics): void;
  22327. }
  22328. /**
  22329. * A {@link MaterialProperty} that maps to polyline outline {@link Material} uniforms.
  22330. * @param [options] - Object with the following properties:
  22331. * @param [options.color = Color.WHITE] - A Property specifying the {@link Color} of the line.
  22332. * @param [options.outlineColor = Color.BLACK] - A Property specifying the {@link Color} of the outline.
  22333. * @param [options.outlineWidth = 1.0] - A numeric Property specifying the width of the outline, in pixels.
  22334. */
  22335. export class PolylineOutlineMaterialProperty {
  22336. constructor(options?: {
  22337. color?: Property | Color;
  22338. outlineColor?: Property | Color;
  22339. outlineWidth?: Property | number;
  22340. });
  22341. /**
  22342. * Gets a value indicating if this property is constant. A property is considered
  22343. constant if getValue always returns the same result for the current definition.
  22344. */
  22345. readonly isConstant: boolean;
  22346. /**
  22347. * Gets the event that is raised whenever the definition of this property changes.
  22348. The definition is considered to have changed if a call to getValue would return
  22349. a different result for the same time.
  22350. */
  22351. readonly definitionChanged: Event;
  22352. /**
  22353. * Gets or sets the Property specifying the {@link Color} of the line.
  22354. */
  22355. color: Property | undefined;
  22356. /**
  22357. * Gets or sets the Property specifying the {@link Color} of the outline.
  22358. */
  22359. outlineColor: Property | undefined;
  22360. /**
  22361. * Gets or sets the numeric Property specifying the width of the outline.
  22362. */
  22363. outlineWidth: Property | undefined;
  22364. /**
  22365. * Gets the {@link Material} type at the provided time.
  22366. * @param time - The time for which to retrieve the type.
  22367. * @returns The type of material.
  22368. */
  22369. getType(time: JulianDate): string;
  22370. /**
  22371. * Gets the value of the property at the provided time.
  22372. * @param time - The time for which to retrieve the value.
  22373. * @param [result] - The object to store the value into, if omitted, a new instance is created and returned.
  22374. * @returns The modified result parameter or a new instance if the result parameter was not supplied.
  22375. */
  22376. getValue(time: JulianDate, result?: any): any;
  22377. /**
  22378. * Compares this property to the provided property and returns
  22379. <code>true</code> if they are equal, <code>false</code> otherwise.
  22380. * @param [other] - The other property.
  22381. * @returns <code>true</code> if left and right are equal, <code>false</code> otherwise.
  22382. */
  22383. equals(other?: Property): boolean;
  22384. }
  22385. /**
  22386. * A visualizer for polylines represented by {@link Primitive} instances.
  22387. * @param scene - The scene the primitives will be rendered in.
  22388. * @param entityCollection - The entityCollection to visualize.
  22389. * @param [primitives = scene.primitives] - A collection to add primitives related to the entities
  22390. * @param [groundPrimitives = scene.groundPrimitives] - A collection to add ground primitives related to the entities
  22391. */
  22392. export class PolylineVisualizer {
  22393. constructor(scene: Scene, entityCollection: EntityCollection, primitives?: PrimitiveCollection, groundPrimitives?: PrimitiveCollection);
  22394. /**
  22395. * Updates all of the primitives created by this visualizer to match their
  22396. Entity counterpart at the given time.
  22397. * @param time - The time to update to.
  22398. * @returns True if the visualizer successfully updated to the provided time,
  22399. false if the visualizer is waiting for asynchronous primitives to be created.
  22400. */
  22401. update(time: JulianDate): boolean;
  22402. /**
  22403. * Returns true if this object was destroyed; otherwise, false.
  22404. * @returns True if this object was destroyed; otherwise, false.
  22405. */
  22406. isDestroyed(): boolean;
  22407. /**
  22408. * Removes and destroys all primitives created by this instance.
  22409. */
  22410. destroy(): void;
  22411. }
  22412. /**
  22413. * A {@link GeometryUpdater} for polyline volumes.
  22414. Clients do not normally create this class directly, but instead rely on {@link DataSourceDisplay}.
  22415. * @param entity - The entity containing the geometry to be visualized.
  22416. * @param scene - The scene where visualization is taking place.
  22417. */
  22418. export class PolylineVolumeGeometryUpdater {
  22419. constructor(entity: Entity, scene: Scene);
  22420. /**
  22421. * Creates the geometry instance which represents the fill of the geometry.
  22422. * @param time - The time to use when retrieving initial attribute values.
  22423. * @returns The geometry instance representing the filled portion of the geometry.
  22424. */
  22425. createFillGeometryInstance(time: JulianDate): GeometryInstance;
  22426. /**
  22427. * Creates the geometry instance which represents the outline of the geometry.
  22428. * @param time - The time to use when retrieving initial attribute values.
  22429. * @returns The geometry instance representing the outline portion of the geometry.
  22430. */
  22431. createOutlineGeometryInstance(time: JulianDate): GeometryInstance;
  22432. }
  22433. export namespace PolylineVolumeGraphics {
  22434. /**
  22435. * Initialization options for the PolylineVolumeGraphics constructor
  22436. * @property [show = true] - A boolean Property specifying the visibility of the volume.
  22437. * @property [positions] - A Property specifying the array of {@link Cartesian3} positions which define the line strip.
  22438. * @property [shape] - A Property specifying the array of {@link Cartesian2} positions which define the shape to be extruded.
  22439. * @property [cornerType = CornerType.ROUNDED] - A {@link CornerType} Property specifying the style of the corners.
  22440. * @property [granularity = Cesium.Math.RADIANS_PER_DEGREE] - A numeric Property specifying the angular distance between each latitude and longitude point.
  22441. * @property [fill = true] - A boolean Property specifying whether the volume is filled with the provided material.
  22442. * @property [material = Color.WHITE] - A Property specifying the material used to fill the volume.
  22443. * @property [outline = false] - A boolean Property specifying whether the volume is outlined.
  22444. * @property [outlineColor = Color.BLACK] - A Property specifying the {@link Color} of the outline.
  22445. * @property [outlineWidth = 1.0] - A numeric Property specifying the width of the outline.
  22446. * @property [shadows = ShadowMode.DISABLED] - An enum Property specifying whether the volume casts or receives shadows from light sources.
  22447. * @property [distanceDisplayCondition] - A Property specifying at what distance from the camera that this volume will be displayed.
  22448. */
  22449. type ConstructorOptions = {
  22450. show?: Property | boolean;
  22451. positions?: Property | Cartesian3[];
  22452. shape?: Property | Cartesian2[];
  22453. cornerType?: Property | CornerType;
  22454. granularity?: Property | number;
  22455. fill?: Property | boolean;
  22456. material?: MaterialProperty | Color;
  22457. outline?: Property | boolean;
  22458. outlineColor?: Property | Color;
  22459. outlineWidth?: Property | number;
  22460. shadows?: Property | ShadowMode;
  22461. distanceDisplayCondition?: Property | DistanceDisplayCondition;
  22462. };
  22463. }
  22464. /**
  22465. * Describes a polyline volume defined as a line strip and corresponding two dimensional shape which is extruded along it.
  22466. The resulting volume conforms to the curvature of the globe.
  22467. * @param [options] - Object describing initialization options
  22468. */
  22469. export class PolylineVolumeGraphics {
  22470. constructor(options?: PolylineVolumeGraphics.ConstructorOptions);
  22471. /**
  22472. * Gets the event that is raised whenever a property or sub-property is changed or modified.
  22473. */
  22474. readonly definitionChanged: Event;
  22475. /**
  22476. * Gets or sets the boolean Property specifying the visibility of the volume.
  22477. */
  22478. show: Property | undefined;
  22479. /**
  22480. * Gets or sets the Property specifying the array of {@link Cartesian3} positions which define the line strip.
  22481. */
  22482. positions: Property | undefined;
  22483. /**
  22484. * Gets or sets the Property specifying the array of {@link Cartesian2} positions which define the shape to be extruded.
  22485. */
  22486. shape: Property | undefined;
  22487. /**
  22488. * Gets or sets the {@link CornerType} Property specifying the style of the corners.
  22489. */
  22490. cornerType: Property | undefined;
  22491. /**
  22492. * Gets or sets the numeric Property specifying the angular distance between points on the volume.
  22493. */
  22494. granularity: Property | undefined;
  22495. /**
  22496. * Gets or sets the boolean Property specifying whether the volume is filled with the provided material.
  22497. */
  22498. fill: Property | undefined;
  22499. /**
  22500. * Gets or sets the Property specifying the material used to fill the volume.
  22501. */
  22502. material: MaterialProperty;
  22503. /**
  22504. * Gets or sets the Property specifying whether the volume is outlined.
  22505. */
  22506. outline: Property | undefined;
  22507. /**
  22508. * Gets or sets the Property specifying the {@link Color} of the outline.
  22509. */
  22510. outlineColor: Property | undefined;
  22511. /**
  22512. * Gets or sets the numeric Property specifying the width of the outline.
  22513. */
  22514. outlineWidth: Property | undefined;
  22515. /**
  22516. * Get or sets the enum Property specifying whether the volume
  22517. casts or receives shadows from light sources.
  22518. */
  22519. shadows: Property | undefined;
  22520. /**
  22521. * Gets or sets the {@link DistanceDisplayCondition} Property specifying at what distance from the camera that this volume will be displayed.
  22522. */
  22523. distanceDisplayCondition: Property | undefined;
  22524. /**
  22525. * Duplicates this instance.
  22526. * @param [result] - The object onto which to store the result.
  22527. * @returns The modified result parameter or a new instance if one was not provided.
  22528. */
  22529. clone(result?: PolylineVolumeGraphics): PolylineVolumeGraphics;
  22530. /**
  22531. * Assigns each unassigned property on this object to the value
  22532. of the same property on the provided source object.
  22533. * @param source - The object to be merged into this object.
  22534. */
  22535. merge(source: PolylineVolumeGraphics): void;
  22536. }
  22537. /**
  22538. * The interface for all {@link Property} objects that define a world
  22539. location as a {@link Cartesian3} with an associated {@link ReferenceFrame}.
  22540. This type defines an interface and cannot be instantiated directly.
  22541. */
  22542. export class PositionProperty {
  22543. constructor();
  22544. /**
  22545. * Gets a value indicating if this property is constant. A property is considered
  22546. constant if getValue always returns the same result for the current definition.
  22547. */
  22548. readonly isConstant: boolean;
  22549. /**
  22550. * Gets the event that is raised whenever the definition of this property changes.
  22551. The definition is considered to have changed if a call to getValue would return
  22552. a different result for the same time.
  22553. */
  22554. readonly definitionChanged: Event;
  22555. /**
  22556. * Gets the reference frame that the position is defined in.
  22557. */
  22558. referenceFrame: ReferenceFrame;
  22559. /**
  22560. * Gets the value of the property at the provided time in the fixed frame.
  22561. * @param time - The time for which to retrieve the value.
  22562. * @param [result] - The object to store the value into, if omitted, a new instance is created and returned.
  22563. * @returns The modified result parameter or a new instance if the result parameter was not supplied.
  22564. */
  22565. getValue(time: JulianDate, result?: Cartesian3): Cartesian3;
  22566. /**
  22567. * Gets the value of the property at the provided time and in the provided reference frame.
  22568. * @param time - The time for which to retrieve the value.
  22569. * @param referenceFrame - The desired referenceFrame of the result.
  22570. * @param [result] - The object to store the value into, if omitted, a new instance is created and returned.
  22571. * @returns The modified result parameter or a new instance if the result parameter was not supplied.
  22572. */
  22573. getValueInReferenceFrame(time: JulianDate, referenceFrame: ReferenceFrame, result?: Cartesian3): Cartesian3;
  22574. /**
  22575. * Compares this property to the provided property and returns
  22576. <code>true</code> if they are equal, <code>false</code> otherwise.
  22577. * @param [other] - The other property.
  22578. * @returns <code>true</code> if left and right are equal, <code>false</code> otherwise.
  22579. */
  22580. equals(other?: Property): boolean;
  22581. }
  22582. /**
  22583. * A {@link Property} whose value is an array whose items are the computed value
  22584. of other PositionProperty instances.
  22585. * @param [value] - An array of Property instances.
  22586. * @param [referenceFrame = ReferenceFrame.FIXED] - The reference frame in which the position is defined.
  22587. */
  22588. export class PositionPropertyArray {
  22589. constructor(value?: Property[], referenceFrame?: ReferenceFrame);
  22590. /**
  22591. * Gets a value indicating if this property is constant. This property
  22592. is considered constant if all property items in the array are constant.
  22593. */
  22594. readonly isConstant: boolean;
  22595. /**
  22596. * Gets the event that is raised whenever the definition of this property changes.
  22597. The definition is changed whenever setValue is called with data different
  22598. than the current value or one of the properties in the array also changes.
  22599. */
  22600. readonly definitionChanged: Event;
  22601. /**
  22602. * Gets the reference frame in which the position is defined.
  22603. */
  22604. referenceFrame: ReferenceFrame;
  22605. /**
  22606. * Gets the value of the property.
  22607. * @param time - The time for which to retrieve the value.
  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. getValue(time: JulianDate, result?: Cartesian3[]): Cartesian3[];
  22612. /**
  22613. * Gets the value of the property at the provided time and in the provided reference frame.
  22614. * @param time - The time for which to retrieve the value.
  22615. * @param referenceFrame - The desired referenceFrame of the result.
  22616. * @param [result] - The object to store the value into, if omitted, a new instance is created and returned.
  22617. * @returns The modified result parameter or a new instance if the result parameter was not supplied.
  22618. */
  22619. getValueInReferenceFrame(time: JulianDate, referenceFrame: ReferenceFrame, result?: Cartesian3[]): Cartesian3[];
  22620. /**
  22621. * Sets the value of the property.
  22622. * @param value - An array of Property instances.
  22623. */
  22624. setValue(value: Property[]): void;
  22625. /**
  22626. * Compares this property to the provided property and returns
  22627. <code>true</code> if they are equal, <code>false</code> otherwise.
  22628. * @param [other] - The other property.
  22629. * @returns <code>true</code> if left and right are equal, <code>false</code> otherwise.
  22630. */
  22631. equals(other?: Property): boolean;
  22632. }
  22633. /**
  22634. * The interface for all properties, which represent a value that can optionally vary over time.
  22635. This type defines an interface and cannot be instantiated directly.
  22636. */
  22637. export class Property {
  22638. constructor();
  22639. /**
  22640. * Gets a value indicating if this property is constant. A property is considered
  22641. constant if getValue always returns the same result for the current definition.
  22642. */
  22643. readonly isConstant: boolean;
  22644. /**
  22645. * Gets the event that is raised whenever the definition of this property changes.
  22646. The definition is considered to have changed if a call to getValue would return
  22647. a different result for the same time.
  22648. */
  22649. readonly definitionChanged: Event;
  22650. /**
  22651. * Gets the value of the property at the provided time.
  22652. * @param time - The time for which to retrieve the value.
  22653. * @param [result] - The object to store the value into, if omitted, a new instance is created and returned.
  22654. * @returns The modified result parameter or a new instance if the result parameter was not supplied.
  22655. */
  22656. getValue(time: JulianDate, result?: any): any;
  22657. /**
  22658. * Compares this property to the provided property and returns
  22659. <code>true</code> if they are equal, <code>false</code> otherwise.
  22660. * @param [other] - The other property.
  22661. * @returns <code>true</code> if left and right are equal, <code>false</code> otherwise.
  22662. */
  22663. equals(other?: Property): boolean;
  22664. }
  22665. /**
  22666. * A {@link Property} whose value is an array whose items are the computed value
  22667. of other property instances.
  22668. * @param [value] - An array of Property instances.
  22669. */
  22670. export class PropertyArray {
  22671. constructor(value?: Property[]);
  22672. /**
  22673. * Gets a value indicating if this property is constant. This property
  22674. is considered constant if all property items in the array are constant.
  22675. */
  22676. readonly isConstant: boolean;
  22677. /**
  22678. * Gets the event that is raised whenever the definition of this property changes.
  22679. The definition is changed whenever setValue is called with data different
  22680. than the current value or one of the properties in the array also changes.
  22681. */
  22682. readonly definitionChanged: Event;
  22683. /**
  22684. * Gets the value of the property.
  22685. * @param time - The time for which to retrieve the value.
  22686. * @param [result] - The object to store the value into, if omitted, a new instance is created and returned.
  22687. * @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.
  22688. */
  22689. getValue(time: JulianDate, result?: object[]): object[];
  22690. /**
  22691. * Sets the value of the property.
  22692. * @param value - An array of Property instances.
  22693. */
  22694. setValue(value: Property[]): void;
  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. export interface PropertyBag extends DictionaryLike {
  22704. }
  22705. /**
  22706. * A {@link Property} whose value is a key-value mapping of property names to the computed value of other properties.
  22707. * @param [value] - An object, containing key-value mapping of property names to properties.
  22708. * @param [createPropertyCallback] - A function that will be called when the value of any of the properties in value are not a Property.
  22709. */
  22710. export class PropertyBag implements DictionaryLike {
  22711. constructor(value?: any, createPropertyCallback?: (...params: any[]) => any);
  22712. /**
  22713. * Gets the names of all properties registered on this instance.
  22714. */
  22715. propertyNames: any[];
  22716. /**
  22717. * Gets a value indicating if this property is constant. This property
  22718. is considered constant if all property items in this object are constant.
  22719. */
  22720. readonly isConstant: boolean;
  22721. /**
  22722. * Gets the event that is raised whenever the set of properties contained in this
  22723. object changes, or one of the properties itself changes.
  22724. */
  22725. readonly definitionChanged: Event;
  22726. /**
  22727. * Determines if this object has defined a property with the given name.
  22728. * @param propertyName - The name of the property to check for.
  22729. * @returns True if this object has defined a property with the given name, false otherwise.
  22730. */
  22731. hasProperty(propertyName: string): boolean;
  22732. /**
  22733. * Adds a property to this object.
  22734. * @param propertyName - The name of the property to add.
  22735. * @param [value] - The value of the new property, if provided.
  22736. * @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.
  22737. */
  22738. addProperty(propertyName: string, value?: any, createPropertyCallback?: (...params: any[]) => any): void;
  22739. /**
  22740. * Removed a property previously added with addProperty.
  22741. * @param propertyName - The name of the property to remove.
  22742. */
  22743. removeProperty(propertyName: string): void;
  22744. /**
  22745. * Gets the value of this property. Each contained property will be evaluated at the given time, and the overall
  22746. result will be an object, mapping property names to those values.
  22747. * @param time - The time for which to retrieve the value.
  22748. * @param [result] - The object to store the value into, if omitted, a new instance is created and returned.
  22749. Note that any properties in result which are not part of this PropertyBag will be left as-is.
  22750. * @returns The modified result parameter or a new instance if the result parameter was not supplied.
  22751. */
  22752. getValue(time: JulianDate, result?: any): any;
  22753. /**
  22754. * Assigns each unassigned property on this object to the value
  22755. of the same property on the provided source object.
  22756. * @param source - The object to be merged into this object.
  22757. * @param [createPropertyCallback] - A function that will be called when the value of any of the properties in value are not a Property.
  22758. */
  22759. merge(source: any, createPropertyCallback?: (...params: any[]) => any): void;
  22760. /**
  22761. * Compares this property to the provided property and returns
  22762. <code>true</code> if they are equal, <code>false</code> otherwise.
  22763. * @param [other] - The other property.
  22764. * @returns <code>true</code> if left and right are equal, <code>false</code> otherwise.
  22765. */
  22766. equals(other?: Property): boolean;
  22767. }
  22768. /**
  22769. * A {@link GeometryUpdater} for rectangles.
  22770. Clients do not normally create this class directly, but instead rely on {@link DataSourceDisplay}.
  22771. * @param entity - The entity containing the geometry to be visualized.
  22772. * @param scene - The scene where visualization is taking place.
  22773. */
  22774. export class RectangleGeometryUpdater {
  22775. constructor(entity: Entity, scene: Scene);
  22776. /**
  22777. * Creates the geometry instance which represents the fill of the geometry.
  22778. * @param time - The time to use when retrieving initial attribute values.
  22779. * @returns The geometry instance representing the filled portion of the geometry.
  22780. */
  22781. createFillGeometryInstance(time: JulianDate): GeometryInstance;
  22782. /**
  22783. * Creates the geometry instance which represents the outline of the geometry.
  22784. * @param time - The time to use when retrieving initial attribute values.
  22785. * @returns The geometry instance representing the outline portion of the geometry.
  22786. */
  22787. createOutlineGeometryInstance(time: JulianDate): GeometryInstance;
  22788. }
  22789. export namespace RectangleGraphics {
  22790. /**
  22791. * Initialization options for the RectangleGraphics constructor
  22792. * @property [show = true] - A boolean Property specifying the visibility of the rectangle.
  22793. * @property [coordinates] - The Property specifying the {@link Rectangle}.
  22794. * @property [height = 0] - A numeric Property specifying the altitude of the rectangle relative to the ellipsoid surface.
  22795. * @property [heightReference = HeightReference.NONE] - A Property specifying what the height is relative to.
  22796. * @property [extrudedHeight] - A numeric Property specifying the altitude of the rectangle's extruded face relative to the ellipsoid surface.
  22797. * @property [extrudedHeightReference = HeightReference.NONE] - A Property specifying what the extrudedHeight is relative to.
  22798. * @property [rotation = 0.0] - A numeric property specifying the rotation of the rectangle clockwise from north.
  22799. * @property [stRotation = 0.0] - A numeric property specifying the rotation of the rectangle texture counter-clockwise from north.
  22800. * @property [granularity = Cesium.Math.RADIANS_PER_DEGREE] - A numeric Property specifying the angular distance between points on the rectangle.
  22801. * @property [fill = true] - A boolean Property specifying whether the rectangle is filled with the provided material.
  22802. * @property [material = Color.WHITE] - A Property specifying the material used to fill the rectangle.
  22803. * @property [outline = false] - A boolean Property specifying whether the rectangle is outlined.
  22804. * @property [outlineColor = Color.BLACK] - A Property specifying the {@link Color} of the outline.
  22805. * @property [outlineWidth = 1.0] - A numeric Property specifying the width of the outline.
  22806. * @property [shadows = ShadowMode.DISABLED] - An enum Property specifying whether the rectangle casts or receives shadows from light sources.
  22807. * @property [distanceDisplayCondition] - A Property specifying at what distance from the camera that this rectangle will be displayed.
  22808. * @property [classificationType = ClassificationType.BOTH] - An enum Property specifying whether this rectangle will classify terrain, 3D Tiles, or both when on the ground.
  22809. * @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.
  22810. */
  22811. type ConstructorOptions = {
  22812. show?: Property | boolean;
  22813. coordinates?: Property | Rectangle;
  22814. height?: Property | number;
  22815. heightReference?: Property | HeightReference;
  22816. extrudedHeight?: Property | number;
  22817. extrudedHeightReference?: Property | HeightReference;
  22818. rotation?: Property | number;
  22819. stRotation?: Property | number;
  22820. granularity?: Property | number;
  22821. fill?: Property | boolean;
  22822. material?: MaterialProperty | Color;
  22823. outline?: Property | boolean;
  22824. outlineColor?: Property | Color;
  22825. outlineWidth?: Property | number;
  22826. shadows?: Property | ShadowMode;
  22827. distanceDisplayCondition?: Property | DistanceDisplayCondition;
  22828. classificationType?: Property | ClassificationType;
  22829. zIndex?: Property | number;
  22830. };
  22831. }
  22832. /**
  22833. * Describes graphics for a {@link Rectangle}.
  22834. The rectangle conforms to the curvature of the globe and can be placed on the surface or
  22835. at altitude and can optionally be extruded into a volume.
  22836. * @param [options] - Object describing initialization options
  22837. */
  22838. export class RectangleGraphics {
  22839. constructor(options?: RectangleGraphics.ConstructorOptions);
  22840. /**
  22841. * Gets the event that is raised whenever a property or sub-property is changed or modified.
  22842. */
  22843. readonly definitionChanged: Event;
  22844. /**
  22845. * Gets or sets the boolean Property specifying the visibility of the rectangle.
  22846. */
  22847. show: Property | undefined;
  22848. /**
  22849. * Gets or sets the Property specifying the {@link Rectangle}.
  22850. */
  22851. coordinates: Property | undefined;
  22852. /**
  22853. * Gets or sets the numeric Property specifying the altitude of the rectangle.
  22854. */
  22855. height: Property | undefined;
  22856. /**
  22857. * Gets or sets the Property specifying the {@link HeightReference}.
  22858. */
  22859. heightReference: Property | undefined;
  22860. /**
  22861. * Gets or sets the numeric Property specifying the altitude of the rectangle extrusion.
  22862. Setting this property creates volume starting at height and ending at this altitude.
  22863. */
  22864. extrudedHeight: Property | undefined;
  22865. /**
  22866. * Gets or sets the Property specifying the extruded {@link HeightReference}.
  22867. */
  22868. extrudedHeightReference: Property | undefined;
  22869. /**
  22870. * Gets or sets the numeric property specifying the rotation of the rectangle clockwise from north.
  22871. */
  22872. rotation: Property | undefined;
  22873. /**
  22874. * Gets or sets the numeric property specifying the rotation of the rectangle texture counter-clockwise from north.
  22875. */
  22876. stRotation: Property | undefined;
  22877. /**
  22878. * Gets or sets the numeric Property specifying the angular distance between points on the rectangle.
  22879. */
  22880. granularity: Property | undefined;
  22881. /**
  22882. * Gets or sets the boolean Property specifying whether the rectangle is filled with the provided material.
  22883. */
  22884. fill: Property | undefined;
  22885. /**
  22886. * Gets or sets the Property specifying the material used to fill the rectangle.
  22887. */
  22888. material: MaterialProperty;
  22889. /**
  22890. * Gets or sets the Property specifying whether the rectangle is outlined.
  22891. */
  22892. outline: Property | undefined;
  22893. /**
  22894. * Gets or sets the Property specifying the {@link Color} of the outline.
  22895. */
  22896. outlineColor: Property | undefined;
  22897. /**
  22898. * Gets or sets the numeric Property specifying the width of the outline.
  22899. */
  22900. outlineWidth: Property | undefined;
  22901. /**
  22902. * Get or sets the enum Property specifying whether the rectangle
  22903. casts or receives shadows from light sources.
  22904. */
  22905. shadows: Property | undefined;
  22906. /**
  22907. * Gets or sets the {@link DistanceDisplayCondition} Property specifying at what distance from the camera that this rectangle will be displayed.
  22908. */
  22909. distanceDisplayCondition: Property | undefined;
  22910. /**
  22911. * Gets or sets the {@link ClassificationType} Property specifying whether this rectangle will classify terrain, 3D Tiles, or both when on the ground.
  22912. */
  22913. classificationType: Property | undefined;
  22914. /**
  22915. * 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.
  22916. */
  22917. zIndex: ConstantProperty | undefined;
  22918. /**
  22919. * Duplicates this instance.
  22920. * @param [result] - The object onto which to store the result.
  22921. * @returns The modified result parameter or a new instance if one was not provided.
  22922. */
  22923. clone(result?: RectangleGraphics): RectangleGraphics;
  22924. /**
  22925. * Assigns each unassigned property on this object to the value
  22926. of the same property on the provided source object.
  22927. * @param source - The object to be merged into this object.
  22928. */
  22929. merge(source: RectangleGraphics): void;
  22930. }
  22931. /**
  22932. * A {@link Property} which transparently links to another property on a provided object.
  22933. * @example
  22934. * var collection = new Cesium.EntityCollection();
  22935. //Create a new entity and assign a billboard scale.
  22936. var object1 = new Cesium.Entity({id:'object1'});
  22937. object1.billboard = new Cesium.BillboardGraphics();
  22938. object1.billboard.scale = new Cesium.ConstantProperty(2.0);
  22939. collection.add(object1);
  22940. //Create a second entity and reference the scale from the first one.
  22941. var object2 = new Cesium.Entity({id:'object2'});
  22942. object2.model = new Cesium.ModelGraphics();
  22943. object2.model.scale = new Cesium.ReferenceProperty(collection, 'object1', ['billboard', 'scale']);
  22944. collection.add(object2);
  22945. //Create a third object, but use the fromString helper function.
  22946. var object3 = new Cesium.Entity({id:'object3'});
  22947. object3.billboard = new Cesium.BillboardGraphics();
  22948. object3.billboard.scale = Cesium.ReferenceProperty.fromString(collection, 'object1#billboard.scale');
  22949. collection.add(object3);
  22950. //You can refer to an entity with a # or . in id and property names by escaping them.
  22951. var object4 = new Cesium.Entity({id:'#object.4'});
  22952. object4.billboard = new Cesium.BillboardGraphics();
  22953. object4.billboard.scale = new Cesium.ConstantProperty(2.0);
  22954. collection.add(object4);
  22955. var object5 = new Cesium.Entity({id:'object5'});
  22956. object5.billboard = new Cesium.BillboardGraphics();
  22957. object5.billboard.scale = Cesium.ReferenceProperty.fromString(collection, '\\#object\\.4#billboard.scale');
  22958. collection.add(object5);
  22959. * @param targetCollection - The entity collection which will be used to resolve the reference.
  22960. * @param targetId - The id of the entity which is being referenced.
  22961. * @param targetPropertyNames - The names of the property on the target entity which we will use.
  22962. */
  22963. export class ReferenceProperty {
  22964. constructor(targetCollection: EntityCollection, targetId: string, targetPropertyNames: string[]);
  22965. /**
  22966. * Gets a value indicating if this property is constant.
  22967. */
  22968. readonly isConstant: boolean;
  22969. /**
  22970. * Gets the event that is raised whenever the definition of this property changes.
  22971. The definition is changed whenever the referenced property's definition is changed.
  22972. */
  22973. readonly definitionChanged: Event;
  22974. /**
  22975. * Gets the reference frame that the position is defined in.
  22976. This property is only valid if the referenced property is a {@link PositionProperty}.
  22977. */
  22978. readonly referenceFrame: ReferenceFrame;
  22979. /**
  22980. * Gets the id of the entity being referenced.
  22981. */
  22982. readonly targetId: string;
  22983. /**
  22984. * Gets the collection containing the entity being referenced.
  22985. */
  22986. readonly targetCollection: EntityCollection;
  22987. /**
  22988. * Gets the array of property names used to retrieve the referenced property.
  22989. */
  22990. readonly targetPropertyNames: string[];
  22991. /**
  22992. * Gets the resolved instance of the underlying referenced property.
  22993. */
  22994. readonly resolvedProperty: Property | undefined;
  22995. /**
  22996. * Creates a new instance given the entity collection that will
  22997. be used to resolve it and a string indicating the target entity id and property.
  22998. The format of the string is "objectId#foo.bar", where # separates the id from
  22999. property path and . separates sub-properties. If the reference identifier or
  23000. or any sub-properties contains a # . or \ they must be escaped.
  23001. * @returns A new instance of ReferenceProperty.
  23002. */
  23003. static fromString(targetCollection: EntityCollection, referenceString: string): ReferenceProperty;
  23004. /**
  23005. * Gets the value of the property at the provided time.
  23006. * @param time - The time for which to retrieve the value.
  23007. * @param [result] - The object to store the value into, if omitted, a new instance is created and returned.
  23008. * @returns The modified result parameter or a new instance if the result parameter was not supplied.
  23009. */
  23010. getValue(time: JulianDate, result?: any): any;
  23011. /**
  23012. * Gets the value of the property at the provided time and in the provided reference frame.
  23013. This method is only valid if the property being referenced is a {@link PositionProperty}.
  23014. * @param time - The time for which to retrieve the value.
  23015. * @param referenceFrame - The desired referenceFrame of the result.
  23016. * @param [result] - The object to store the value into, if omitted, a new instance is created and returned.
  23017. * @returns The modified result parameter or a new instance if the result parameter was not supplied.
  23018. */
  23019. getValueInReferenceFrame(time: JulianDate, referenceFrame: ReferenceFrame, result?: Cartesian3): Cartesian3;
  23020. /**
  23021. * Gets the {@link Material} type at the provided time.
  23022. This method is only valid if the property being referenced is a {@link MaterialProperty}.
  23023. * @param time - The time for which to retrieve the type.
  23024. * @returns The type of material.
  23025. */
  23026. getType(time: JulianDate): string;
  23027. /**
  23028. * Compares this property to the provided property and returns
  23029. <code>true</code> if they are equal, <code>false</code> otherwise.
  23030. * @param [other] - The other property.
  23031. * @returns <code>true</code> if left and right are equal, <code>false</code> otherwise.
  23032. */
  23033. equals(other?: Property): boolean;
  23034. }
  23035. export namespace Rotation {
  23036. /**
  23037. * The number of elements used to pack the object into an array.
  23038. */
  23039. var packedLength: number;
  23040. /**
  23041. * Stores the provided instance into the provided array.
  23042. * @param value - The value to pack.
  23043. * @param array - The array to pack into.
  23044. * @param [startingIndex = 0] - The index into the array at which to start packing the elements.
  23045. * @returns The array that was packed into
  23046. */
  23047. function pack(value: Rotation, array: number[], startingIndex?: number): number[];
  23048. /**
  23049. * Retrieves an instance from a packed array.
  23050. * @param array - The packed array.
  23051. * @param [startingIndex = 0] - The starting index of the element to be unpacked.
  23052. * @param [result] - The object into which to store the result.
  23053. * @returns The modified result parameter or a new Rotation instance if one was not provided.
  23054. */
  23055. function unpack(array: number[], startingIndex?: number, result?: Rotation): Rotation;
  23056. /**
  23057. * Converts a packed array into a form suitable for interpolation.
  23058. * @param packedArray - The packed array.
  23059. * @param [startingIndex = 0] - The index of the first element to be converted.
  23060. * @param [lastIndex = packedArray.length] - The index of the last element to be converted.
  23061. * @param [result] - The object into which to store the result.
  23062. */
  23063. function convertPackedArrayForInterpolation(packedArray: number[], startingIndex?: number, lastIndex?: number, result?: number[]): void;
  23064. /**
  23065. * Retrieves an instance from a packed array converted with {@link Rotation.convertPackedArrayForInterpolation}.
  23066. * @param array - The array previously packed for interpolation.
  23067. * @param sourceArray - The original packed array.
  23068. * @param [firstIndex = 0] - The firstIndex used to convert the array.
  23069. * @param [lastIndex = packedArray.length] - The lastIndex used to convert the array.
  23070. * @param [result] - The object into which to store the result.
  23071. * @returns The modified result parameter or a new Rotation instance if one was not provided.
  23072. */
  23073. function unpackInterpolationResult(array: number[], sourceArray: number[], firstIndex?: number, lastIndex?: number, result?: Rotation): Rotation;
  23074. }
  23075. /**
  23076. * Represents a {@link Packable} number that always interpolates values
  23077. towards the shortest angle of rotation. This object is never used directly
  23078. but is instead passed to the constructor of {@link SampledProperty}
  23079. in order to represent a two-dimensional angle of rotation.
  23080. * @example
  23081. * var time1 = Cesium.JulianDate.fromIso8601('2010-05-07T00:00:00');
  23082. var time2 = Cesium.JulianDate.fromIso8601('2010-05-07T00:01:00');
  23083. var time3 = Cesium.JulianDate.fromIso8601('2010-05-07T00:02:00');
  23084. var property = new Cesium.SampledProperty(Cesium.Rotation);
  23085. property.addSample(time1, 0);
  23086. property.addSample(time3, Cesium.Math.toRadians(350));
  23087. //Getting the value at time2 will equal 355 degrees instead
  23088. //of 175 degrees (which is what you get if you construct
  23089. //a SampledProperty(Number) instead. Note, the actual
  23090. //return value is in radians, not degrees.
  23091. property.getValue(time2);
  23092. */
  23093. export interface Rotation {
  23094. }
  23095. /**
  23096. * A {@link SampledProperty} which is also a {@link PositionProperty}.
  23097. * @param [referenceFrame = ReferenceFrame.FIXED] - The reference frame in which the position is defined.
  23098. * @param [numberOfDerivatives = 0] - The number of derivatives that accompany each position; i.e. velocity, acceleration, etc...
  23099. */
  23100. export class SampledPositionProperty {
  23101. constructor(referenceFrame?: ReferenceFrame, numberOfDerivatives?: number);
  23102. /**
  23103. * Gets a value indicating if this property is constant. A property is considered
  23104. constant if getValue always returns the same result for the current definition.
  23105. */
  23106. readonly isConstant: boolean;
  23107. /**
  23108. * Gets the event that is raised whenever the definition of this property changes.
  23109. The definition is considered to have changed if a call to getValue would return
  23110. a different result for the same time.
  23111. */
  23112. readonly definitionChanged: Event;
  23113. /**
  23114. * Gets the reference frame in which the position is defined.
  23115. */
  23116. referenceFrame: ReferenceFrame;
  23117. /**
  23118. * Gets the degree of interpolation to perform when retrieving a value. Call <code>setInterpolationOptions</code> to set this.
  23119. */
  23120. readonly interpolationDegree: number;
  23121. /**
  23122. * Gets the interpolation algorithm to use when retrieving a value. Call <code>setInterpolationOptions</code> to set this.
  23123. */
  23124. readonly interpolationAlgorithm: InterpolationAlgorithm;
  23125. /**
  23126. * The number of derivatives contained by this property; i.e. 0 for just position, 1 for velocity, etc.
  23127. */
  23128. numberOfDerivatives: number;
  23129. /**
  23130. * Gets or sets the type of extrapolation to perform when a value
  23131. is requested at a time after any available samples.
  23132. */
  23133. forwardExtrapolationType: ExtrapolationType;
  23134. /**
  23135. * Gets or sets the amount of time to extrapolate forward before
  23136. the property becomes undefined. A value of 0 will extrapolate forever.
  23137. */
  23138. forwardExtrapolationDuration: number;
  23139. /**
  23140. * Gets or sets the type of extrapolation to perform when a value
  23141. is requested at a time before any available samples.
  23142. */
  23143. backwardExtrapolationType: ExtrapolationType;
  23144. /**
  23145. * Gets or sets the amount of time to extrapolate backward
  23146. before the property becomes undefined. A value of 0 will extrapolate forever.
  23147. */
  23148. backwardExtrapolationDuration: number;
  23149. /**
  23150. * Gets the position at the provided time.
  23151. * @param time - The time for which to retrieve the value.
  23152. * @param [result] - The object to store the value into, if omitted, a new instance is created and returned.
  23153. * @returns The modified result parameter or a new instance if the result parameter was not supplied.
  23154. */
  23155. getValue(time: JulianDate, result?: Cartesian3): Cartesian3;
  23156. /**
  23157. * Gets the position at the provided time and in the provided reference frame.
  23158. * @param time - The time for which to retrieve the value.
  23159. * @param referenceFrame - The desired referenceFrame of the result.
  23160. * @param [result] - The object to store the value into, if omitted, a new instance is created and returned.
  23161. * @returns The modified result parameter or a new instance if the result parameter was not supplied.
  23162. */
  23163. getValueInReferenceFrame(time: JulianDate, referenceFrame: ReferenceFrame, result?: Cartesian3): Cartesian3;
  23164. /**
  23165. * Sets the algorithm and degree to use when interpolating a position.
  23166. * @param [options] - Object with the following properties:
  23167. * @param [options.interpolationAlgorithm] - The new interpolation algorithm. If undefined, the existing property will be unchanged.
  23168. * @param [options.interpolationDegree] - The new interpolation degree. If undefined, the existing property will be unchanged.
  23169. */
  23170. setInterpolationOptions(options?: {
  23171. interpolationAlgorithm?: InterpolationAlgorithm;
  23172. interpolationDegree?: number;
  23173. }): void;
  23174. /**
  23175. * Adds a new sample.
  23176. * @param time - The sample time.
  23177. * @param position - The position at the provided time.
  23178. * @param [derivatives] - The array of derivative values at the provided time.
  23179. */
  23180. addSample(time: JulianDate, position: Cartesian3, derivatives?: Cartesian3[]): void;
  23181. /**
  23182. * Adds multiple samples via parallel arrays.
  23183. * @param times - An array of JulianDate instances where each index is a sample time.
  23184. * @param positions - An array of Cartesian3 position instances, where each value corresponds to the provided time index.
  23185. * @param [derivatives] - An array where each value is another array containing derivatives for the corresponding time index.
  23186. */
  23187. addSamples(times: JulianDate[], positions: Cartesian3[], derivatives?: any[][]): void;
  23188. /**
  23189. * Adds samples as a single packed array where each new sample is represented as a date,
  23190. followed by the packed representation of the corresponding value and derivatives.
  23191. * @param packedSamples - The array of packed samples.
  23192. * @param [epoch] - If any of the dates in packedSamples are numbers, they are considered an offset from this epoch, in seconds.
  23193. */
  23194. addSamplesPackedArray(packedSamples: number[], epoch?: JulianDate): void;
  23195. /**
  23196. * Removes a sample at the given time, if present.
  23197. * @param time - The sample time.
  23198. * @returns <code>true</code> if a sample at time was removed, <code>false</code> otherwise.
  23199. */
  23200. removeSample(time: JulianDate): boolean;
  23201. /**
  23202. * Removes all samples for the given time interval.
  23203. * @param time - The time interval for which to remove all samples.
  23204. */
  23205. removeSamples(time: TimeInterval): void;
  23206. /**
  23207. * Compares this property to the provided property and returns
  23208. <code>true</code> if they are equal, <code>false</code> otherwise.
  23209. * @param [other] - The other property.
  23210. * @returns <code>true</code> if left and right are equal, <code>false</code> otherwise.
  23211. */
  23212. equals(other?: Property): boolean;
  23213. }
  23214. /**
  23215. * A {@link Property} whose value is interpolated for a given time from the
  23216. provided set of samples and specified interpolation algorithm and degree.
  23217. * @example
  23218. * //Create a linearly interpolated Cartesian2
  23219. var property = new Cesium.SampledProperty(Cesium.Cartesian2);
  23220. //Populate it with data
  23221. property.addSample(Cesium.JulianDate.fromIso8601('2012-08-01T00:00:00.00Z'), new Cesium.Cartesian2(0, 0));
  23222. property.addSample(Cesium.JulianDate.fromIso8601('2012-08-02T00:00:00.00Z'), new Cesium.Cartesian2(4, 7));
  23223. //Retrieve an interpolated value
  23224. var result = property.getValue(Cesium.JulianDate.fromIso8601('2012-08-01T12:00:00.00Z'));
  23225. * @example
  23226. * //Create a simple numeric SampledProperty that uses third degree Hermite Polynomial Approximation
  23227. var property = new Cesium.SampledProperty(Number);
  23228. property.setInterpolationOptions({
  23229. interpolationDegree : 3,
  23230. interpolationAlgorithm : Cesium.HermitePolynomialApproximation
  23231. });
  23232. //Populate it with data
  23233. property.addSample(Cesium.JulianDate.fromIso8601('2012-08-01T00:00:00.00Z'), 1.0);
  23234. property.addSample(Cesium.JulianDate.fromIso8601('2012-08-01T00:01:00.00Z'), 6.0);
  23235. property.addSample(Cesium.JulianDate.fromIso8601('2012-08-01T00:02:00.00Z'), 12.0);
  23236. property.addSample(Cesium.JulianDate.fromIso8601('2012-08-01T00:03:30.00Z'), 5.0);
  23237. property.addSample(Cesium.JulianDate.fromIso8601('2012-08-01T00:06:30.00Z'), 2.0);
  23238. //Samples can be added in any order.
  23239. property.addSample(Cesium.JulianDate.fromIso8601('2012-08-01T00:00:30.00Z'), 6.2);
  23240. //Retrieve an interpolated value
  23241. var result = property.getValue(Cesium.JulianDate.fromIso8601('2012-08-01T00:02:34.00Z'));
  23242. * @param type - The type of property.
  23243. * @param [derivativeTypes] - When supplied, indicates that samples will contain derivative information of the specified types.
  23244. */
  23245. export class SampledProperty {
  23246. constructor(type: number | Packable, derivativeTypes?: Packable[]);
  23247. /**
  23248. * Gets a value indicating if this property is constant. A property is considered
  23249. constant if getValue always returns the same result for the current definition.
  23250. */
  23251. readonly isConstant: boolean;
  23252. /**
  23253. * Gets the event that is raised whenever the definition of this property changes.
  23254. The definition is considered to have changed if a call to getValue would return
  23255. a different result for the same time.
  23256. */
  23257. readonly definitionChanged: Event;
  23258. /**
  23259. * Gets the type of property.
  23260. */
  23261. type: any;
  23262. /**
  23263. * Gets the derivative types used by this property.
  23264. */
  23265. derivativeTypes: Packable[];
  23266. /**
  23267. * Gets the degree of interpolation to perform when retrieving a value.
  23268. */
  23269. interpolationDegree: number;
  23270. /**
  23271. * Gets the interpolation algorithm to use when retrieving a value.
  23272. */
  23273. interpolationAlgorithm: InterpolationAlgorithm;
  23274. /**
  23275. * Gets or sets the type of extrapolation to perform when a value
  23276. is requested at a time after any available samples.
  23277. */
  23278. forwardExtrapolationType: ExtrapolationType;
  23279. /**
  23280. * Gets or sets the amount of time to extrapolate forward before
  23281. the property becomes undefined. A value of 0 will extrapolate forever.
  23282. */
  23283. forwardExtrapolationDuration: number;
  23284. /**
  23285. * Gets or sets the type of extrapolation to perform when a value
  23286. is requested at a time before any available samples.
  23287. */
  23288. backwardExtrapolationType: ExtrapolationType;
  23289. /**
  23290. * Gets or sets the amount of time to extrapolate backward
  23291. before the property becomes undefined. A value of 0 will extrapolate forever.
  23292. */
  23293. backwardExtrapolationDuration: number;
  23294. /**
  23295. * Gets the value of the property at the provided time.
  23296. * @param time - The time for which to retrieve the value.
  23297. * @param [result] - The object to store the value into, if omitted, a new instance is created and returned.
  23298. * @returns The modified result parameter or a new instance if the result parameter was not supplied.
  23299. */
  23300. getValue(time: JulianDate, result?: any): any;
  23301. /**
  23302. * Sets the algorithm and degree to use when interpolating a value.
  23303. * @param [options] - Object with the following properties:
  23304. * @param [options.interpolationAlgorithm] - The new interpolation algorithm. If undefined, the existing property will be unchanged.
  23305. * @param [options.interpolationDegree] - The new interpolation degree. If undefined, the existing property will be unchanged.
  23306. */
  23307. setInterpolationOptions(options?: {
  23308. interpolationAlgorithm?: InterpolationAlgorithm;
  23309. interpolationDegree?: number;
  23310. }): void;
  23311. /**
  23312. * Adds a new sample.
  23313. * @param time - The sample time.
  23314. * @param value - The value at the provided time.
  23315. * @param [derivatives] - The array of derivatives at the provided time.
  23316. */
  23317. addSample(time: JulianDate, value: Packable, derivatives?: Packable[]): void;
  23318. /**
  23319. * Adds an array of samples.
  23320. * @param times - An array of JulianDate instances where each index is a sample time.
  23321. * @param values - The array of values, where each value corresponds to the provided times index.
  23322. * @param [derivativeValues] - An array where each item is the array of derivatives at the equivalent time index.
  23323. */
  23324. addSamples(times: JulianDate[], values: Packable[], derivativeValues?: any[][]): void;
  23325. /**
  23326. * Adds samples as a single packed array where each new sample is represented as a date,
  23327. followed by the packed representation of the corresponding value and derivatives.
  23328. * @param packedSamples - The array of packed samples.
  23329. * @param [epoch] - If any of the dates in packedSamples are numbers, they are considered an offset from this epoch, in seconds.
  23330. */
  23331. addSamplesPackedArray(packedSamples: number[], epoch?: JulianDate): void;
  23332. /**
  23333. * Removes a sample at the given time, if present.
  23334. * @param time - The sample time.
  23335. * @returns <code>true</code> if a sample at time was removed, <code>false</code> otherwise.
  23336. */
  23337. removeSample(time: JulianDate): boolean;
  23338. /**
  23339. * Removes all samples for the given time interval.
  23340. * @param time - The time interval for which to remove all samples.
  23341. */
  23342. removeSamples(time: TimeInterval): void;
  23343. /**
  23344. * Compares this property to the provided property and returns
  23345. <code>true</code> if they are equal, <code>false</code> otherwise.
  23346. * @param [other] - The other property.
  23347. * @returns <code>true</code> if left and right are equal, <code>false</code> otherwise.
  23348. */
  23349. equals(other?: Property): boolean;
  23350. }
  23351. /**
  23352. * A {@link MaterialProperty} that maps to stripe {@link Material} uniforms.
  23353. * @param [options] - Object with the following properties:
  23354. * @param [options.orientation = StripeOrientation.HORIZONTAL] - A Property specifying the {@link StripeOrientation}.
  23355. * @param [options.evenColor = Color.WHITE] - A Property specifying the first {@link Color}.
  23356. * @param [options.oddColor = Color.BLACK] - A Property specifying the second {@link Color}.
  23357. * @param [options.offset = 0] - A numeric Property specifying how far into the pattern to start the material.
  23358. * @param [options.repeat = 1] - A numeric Property specifying how many times the stripes repeat.
  23359. */
  23360. export class StripeMaterialProperty {
  23361. constructor(options?: {
  23362. orientation?: Property | StripeOrientation;
  23363. evenColor?: Property | Color;
  23364. oddColor?: Property | Color;
  23365. offset?: Property | number;
  23366. repeat?: Property | number;
  23367. });
  23368. /**
  23369. * Gets a value indicating if this property is constant. A property is considered
  23370. constant if getValue always returns the same result for the current definition.
  23371. */
  23372. readonly isConstant: boolean;
  23373. /**
  23374. * Gets the event that is raised whenever the definition of this property changes.
  23375. The definition is considered to have changed if a call to getValue would return
  23376. a different result for the same time.
  23377. */
  23378. readonly definitionChanged: Event;
  23379. /**
  23380. * Gets or sets the Property specifying the {@link StripeOrientation}/
  23381. */
  23382. orientation: Property | undefined;
  23383. /**
  23384. * Gets or sets the Property specifying the first {@link Color}.
  23385. */
  23386. evenColor: Property | undefined;
  23387. /**
  23388. * Gets or sets the Property specifying the second {@link Color}.
  23389. */
  23390. oddColor: Property | undefined;
  23391. /**
  23392. * Gets or sets the numeric Property specifying the point into the pattern
  23393. to begin drawing; with 0.0 being the beginning of the even color, 1.0 the beginning
  23394. of the odd color, 2.0 being the even color again, and any multiple or fractional values
  23395. being in between.
  23396. */
  23397. offset: Property | undefined;
  23398. /**
  23399. * Gets or sets the numeric Property specifying how many times the stripes repeat.
  23400. */
  23401. repeat: Property | undefined;
  23402. /**
  23403. * Gets the {@link Material} type at the provided time.
  23404. * @param time - The time for which to retrieve the type.
  23405. * @returns The type of material.
  23406. */
  23407. getType(time: JulianDate): string;
  23408. /**
  23409. * Gets the value of the property at the provided time.
  23410. * @param time - The time for which to retrieve the value.
  23411. * @param [result] - The object to store the value into, if omitted, a new instance is created and returned.
  23412. * @returns The modified result parameter or a new instance if the result parameter was not supplied.
  23413. */
  23414. getValue(time: JulianDate, result?: any): any;
  23415. /**
  23416. * Compares this property to the provided property and returns
  23417. <code>true</code> if they are equal, <code>false</code> otherwise.
  23418. * @param [other] - The other property.
  23419. * @returns <code>true</code> if left and right are equal, <code>false</code> otherwise.
  23420. */
  23421. equals(other?: Property): boolean;
  23422. }
  23423. /**
  23424. * Defined the orientation of stripes in {@link StripeMaterialProperty}.
  23425. */
  23426. export enum StripeOrientation {
  23427. /**
  23428. * Horizontal orientation.
  23429. */
  23430. HORIZONTAL = 0,
  23431. /**
  23432. * Vertical orientation.
  23433. */
  23434. VERTICAL = 1
  23435. }
  23436. /**
  23437. * A {@link TimeIntervalCollectionProperty} which is also a {@link PositionProperty}.
  23438. * @param [referenceFrame = ReferenceFrame.FIXED] - The reference frame in which the position is defined.
  23439. */
  23440. export class TimeIntervalCollectionPositionProperty {
  23441. constructor(referenceFrame?: ReferenceFrame);
  23442. /**
  23443. * Gets a value indicating if this property is constant. A property is considered
  23444. constant if getValue always returns the same result for the current definition.
  23445. */
  23446. readonly isConstant: boolean;
  23447. /**
  23448. * Gets the event that is raised whenever the definition of this property changes.
  23449. The definition is considered to have changed if a call to getValue would return
  23450. a different result for the same time.
  23451. */
  23452. readonly definitionChanged: Event;
  23453. /**
  23454. * Gets the interval collection.
  23455. */
  23456. intervals: TimeIntervalCollection;
  23457. /**
  23458. * Gets the reference frame in which the position is defined.
  23459. */
  23460. referenceFrame: ReferenceFrame;
  23461. /**
  23462. * Gets the value of the property at the provided time in the fixed frame.
  23463. * @param time - The time for which to retrieve the value.
  23464. * @param [result] - The object to store the value into, if omitted, a new instance is created and returned.
  23465. * @returns The modified result parameter or a new instance if the result parameter was not supplied.
  23466. */
  23467. getValue(time: JulianDate, result?: any): any;
  23468. /**
  23469. * Gets the value of the property at the provided time and in the provided reference frame.
  23470. * @param time - The time for which to retrieve the value.
  23471. * @param referenceFrame - The desired referenceFrame of the result.
  23472. * @param [result] - The object to store the value into, if omitted, a new instance is created and returned.
  23473. * @returns The modified result parameter or a new instance if the result parameter was not supplied.
  23474. */
  23475. getValueInReferenceFrame(time: JulianDate, referenceFrame: ReferenceFrame, result?: Cartesian3): Cartesian3;
  23476. /**
  23477. * Compares this property to the provided property and returns
  23478. <code>true</code> if they are equal, <code>false</code> otherwise.
  23479. * @param [other] - The other property.
  23480. * @returns <code>true</code> if left and right are equal, <code>false</code> otherwise.
  23481. */
  23482. equals(other?: Property): boolean;
  23483. }
  23484. /**
  23485. * A {@link Property} which is defined by a {@link TimeIntervalCollection}, where the
  23486. data property of each {@link TimeInterval} represents the value at time.
  23487. * @example
  23488. * //Create a Cartesian2 interval property which contains data on August 1st, 2012
  23489. //and uses a different value every 6 hours.
  23490. var composite = new Cesium.TimeIntervalCollectionProperty();
  23491. composite.intervals.addInterval(Cesium.TimeInterval.fromIso8601({
  23492. iso8601 : '2012-08-01T00:00:00.00Z/2012-08-01T06:00:00.00Z',
  23493. isStartIncluded : true,
  23494. isStopIncluded : false,
  23495. data : new Cesium.Cartesian2(2.0, 3.4)
  23496. }));
  23497. composite.intervals.addInterval(Cesium.TimeInterval.fromIso8601({
  23498. iso8601 : '2012-08-01T06:00:00.00Z/2012-08-01T12:00:00.00Z',
  23499. isStartIncluded : true,
  23500. isStopIncluded : false,
  23501. data : new Cesium.Cartesian2(12.0, 2.7)
  23502. }));
  23503. composite.intervals.addInterval(Cesium.TimeInterval.fromIso8601({
  23504. iso8601 : '2012-08-01T12:00:00.00Z/2012-08-01T18:00:00.00Z',
  23505. isStartIncluded : true,
  23506. isStopIncluded : false,
  23507. data : new Cesium.Cartesian2(5.0, 12.4)
  23508. }));
  23509. composite.intervals.addInterval(Cesium.TimeInterval.fromIso8601({
  23510. iso8601 : '2012-08-01T18:00:00.00Z/2012-08-02T00:00:00.00Z',
  23511. isStartIncluded : true,
  23512. isStopIncluded : true,
  23513. data : new Cesium.Cartesian2(85.0, 4.1)
  23514. }));
  23515. */
  23516. export class TimeIntervalCollectionProperty {
  23517. constructor();
  23518. /**
  23519. * Gets a value indicating if this property is constant. A property is considered
  23520. constant if getValue always returns the same result for the current definition.
  23521. */
  23522. readonly isConstant: boolean;
  23523. /**
  23524. * Gets the event that is raised whenever the definition of this property changes.
  23525. The definition is changed whenever setValue is called with data different
  23526. than the current value.
  23527. */
  23528. readonly definitionChanged: Event;
  23529. /**
  23530. * Gets the interval collection.
  23531. */
  23532. intervals: TimeIntervalCollection;
  23533. /**
  23534. * Gets the value of the property at the provided time.
  23535. * @param time - The time for which to retrieve the value.
  23536. * @param [result] - The object to store the value into, if omitted, a new instance is created and returned.
  23537. * @returns The modified result parameter or a new instance if the result parameter was not supplied.
  23538. */
  23539. getValue(time: JulianDate, result?: any): any;
  23540. /**
  23541. * Compares this property to the provided property and returns
  23542. <code>true</code> if they are equal, <code>false</code> otherwise.
  23543. * @param [other] - The other property.
  23544. * @returns <code>true</code> if left and right are equal, <code>false</code> otherwise.
  23545. */
  23546. equals(other?: Property): boolean;
  23547. }
  23548. /**
  23549. * A {@link Property} which evaluates to a {@link Quaternion} rotation
  23550. based on the velocity of the provided {@link PositionProperty}.
  23551. * @example
  23552. * //Create an entity with position and orientation.
  23553. var position = new Cesium.SampledProperty();
  23554. position.addSamples(...);
  23555. var entity = viewer.entities.add({
  23556. position : position,
  23557. orientation : new Cesium.VelocityOrientationProperty(position)
  23558. }));
  23559. * @param [position] - The position property used to compute the orientation.
  23560. * @param [ellipsoid = Ellipsoid.WGS84] - The ellipsoid used to determine which way is up.
  23561. */
  23562. export class VelocityOrientationProperty {
  23563. constructor(position?: PositionProperty, ellipsoid?: Ellipsoid);
  23564. /**
  23565. * Gets a value indicating if this property is constant.
  23566. */
  23567. readonly isConstant: boolean;
  23568. /**
  23569. * Gets the event that is raised whenever the definition of this property changes.
  23570. */
  23571. readonly definitionChanged: Event;
  23572. /**
  23573. * Gets or sets the position property used to compute orientation.
  23574. */
  23575. position: Property | undefined;
  23576. /**
  23577. * Gets or sets the ellipsoid used to determine which way is up.
  23578. */
  23579. ellipsoid: Property | undefined;
  23580. /**
  23581. * Gets the value of the property at the provided time.
  23582. * @param [time] - The time for which to retrieve the value.
  23583. * @param [result] - The object to store the value into, if omitted, a new instance is created and returned.
  23584. * @returns The modified result parameter or a new instance if the result parameter was not supplied.
  23585. */
  23586. getValue(time?: JulianDate, result?: Quaternion): Quaternion;
  23587. /**
  23588. * Compares this property to the provided property and returns
  23589. <code>true</code> if they are equal, <code>false</code> otherwise.
  23590. * @param [other] - The other property.
  23591. * @returns <code>true</code> if left and right are equal, <code>false</code> otherwise.
  23592. */
  23593. equals(other?: Property): boolean;
  23594. }
  23595. /**
  23596. * A {@link Property} which evaluates to a {@link Cartesian3} vector
  23597. based on the velocity of the provided {@link PositionProperty}.
  23598. * @example
  23599. * //Create an entity with a billboard rotated to match its velocity.
  23600. var position = new Cesium.SampledProperty();
  23601. position.addSamples(...);
  23602. var entity = viewer.entities.add({
  23603. position : position,
  23604. billboard : {
  23605. image : 'image.png',
  23606. alignedAxis : new Cesium.VelocityVectorProperty(position, true) // alignedAxis must be a unit vector
  23607. }
  23608. }));
  23609. * @param [position] - The position property used to compute the velocity.
  23610. * @param [normalize = true] - Whether to normalize the computed velocity vector.
  23611. */
  23612. export class VelocityVectorProperty {
  23613. constructor(position?: PositionProperty, normalize?: boolean);
  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 the velocity vector.
  23624. */
  23625. position: Property | undefined;
  23626. /**
  23627. * Gets or sets whether the vector produced by this property
  23628. will be normalized or not.
  23629. */
  23630. normalize: boolean;
  23631. /**
  23632. * Gets the value of the property at the provided time.
  23633. * @param [time] - The time for which to retrieve the value.
  23634. * @param [result] - The object to store the value into, if omitted, a new instance is created and returned.
  23635. * @returns The modified result parameter or a new instance if the result parameter was not supplied.
  23636. */
  23637. getValue(time?: JulianDate, result?: Cartesian3): Cartesian3;
  23638. /**
  23639. * Compares this property to the provided property and returns
  23640. <code>true</code> if they are equal, <code>false</code> otherwise.
  23641. * @param [other] - The other property.
  23642. * @returns <code>true</code> if left and right are equal, <code>false</code> otherwise.
  23643. */
  23644. equals(other?: Property): boolean;
  23645. }
  23646. /**
  23647. * Defines the interface for visualizers. Visualizers are plug-ins to
  23648. {@link DataSourceDisplay} that render data associated with
  23649. {@link DataSource} instances.
  23650. This object is an interface for documentation purposes and is not intended
  23651. to be instantiated directly.
  23652. */
  23653. export class Visualizer {
  23654. constructor();
  23655. /**
  23656. * Updates the visualization to the provided time.
  23657. * @param time - The time.
  23658. * @returns True if the display was updated to the provided time,
  23659. false if the visualizer is waiting for an asynchronous operation to
  23660. complete before data can be updated.
  23661. */
  23662. update(time: JulianDate): boolean;
  23663. /**
  23664. * Returns true if this object was destroyed; otherwise, false.
  23665. * @returns True if this object was destroyed; otherwise, false.
  23666. */
  23667. isDestroyed(): boolean;
  23668. /**
  23669. * Removes all visualization and cleans up any resources associated with this instance.
  23670. */
  23671. destroy(): void;
  23672. }
  23673. /**
  23674. * A {@link GeometryUpdater} for walls.
  23675. Clients do not normally create this class directly, but instead rely on {@link DataSourceDisplay}.
  23676. * @param entity - The entity containing the geometry to be visualized.
  23677. * @param scene - The scene where visualization is taking place.
  23678. */
  23679. export class WallGeometryUpdater {
  23680. constructor(entity: Entity, scene: Scene);
  23681. /**
  23682. * Creates the geometry instance which represents the fill of the geometry.
  23683. * @param time - The time to use when retrieving initial attribute values.
  23684. * @returns The geometry instance representing the filled portion of the geometry.
  23685. */
  23686. createFillGeometryInstance(time: JulianDate): GeometryInstance;
  23687. /**
  23688. * Creates the geometry instance which represents the outline of the geometry.
  23689. * @param time - The time to use when retrieving initial attribute values.
  23690. * @returns The geometry instance representing the outline portion of the geometry.
  23691. */
  23692. createOutlineGeometryInstance(time: JulianDate): GeometryInstance;
  23693. }
  23694. export namespace WallGraphics {
  23695. /**
  23696. * Initialization options for the WallGraphics constructor
  23697. * @property [show = true] - A boolean Property specifying the visibility of the wall.
  23698. * @property [positions] - A Property specifying the array of {@link Cartesian3} positions which define the top of the wall.
  23699. * @property [minimumHeights] - A Property specifying an array of heights to be used for the bottom of the wall instead of the globe surface.
  23700. * @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.
  23701. * @property [granularity = Cesium.Math.RADIANS_PER_DEGREE] - A numeric Property specifying the angular distance between each latitude and longitude point.
  23702. * @property [fill = true] - A boolean Property specifying whether the wall is filled with the provided material.
  23703. * @property [material = Color.WHITE] - A Property specifying the material used to fill the wall.
  23704. * @property [outline = false] - A boolean Property specifying whether the wall is outlined.
  23705. * @property [outlineColor = Color.BLACK] - A Property specifying the {@link Color} of the outline.
  23706. * @property [outlineWidth = 1.0] - A numeric Property specifying the width of the outline.
  23707. * @property [shadows = ShadowMode.DISABLED] - An enum Property specifying whether the wall casts or receives shadows from light sources.
  23708. * @property [distanceDisplayCondition] - A Property specifying at what distance from the camera that this wall will be displayed.
  23709. */
  23710. type ConstructorOptions = {
  23711. show?: Property | boolean;
  23712. positions?: Property | Cartesian3[];
  23713. minimumHeights?: Property | number[];
  23714. maximumHeights?: Property | number[];
  23715. granularity?: Property | number;
  23716. fill?: Property | boolean;
  23717. material?: MaterialProperty | Color;
  23718. outline?: Property | boolean;
  23719. outlineColor?: Property | Color;
  23720. outlineWidth?: Property | number;
  23721. shadows?: Property | ShadowMode;
  23722. distanceDisplayCondition?: Property | DistanceDisplayCondition;
  23723. };
  23724. }
  23725. /**
  23726. * Describes a two dimensional wall defined as a line strip and optional maximum and minimum heights.
  23727. The wall conforms to the curvature of the globe and can be placed along the surface or at altitude.
  23728. * @param [options] - Object describing initialization options
  23729. */
  23730. export class WallGraphics {
  23731. constructor(options?: WallGraphics.ConstructorOptions);
  23732. /**
  23733. * Gets the event that is raised whenever a property or sub-property is changed or modified.
  23734. */
  23735. readonly definitionChanged: Event;
  23736. /**
  23737. * Gets or sets the boolean Property specifying the visibility of the wall.
  23738. */
  23739. show: Property | undefined;
  23740. /**
  23741. * Gets or sets the Property specifying the array of {@link Cartesian3} positions which define the top of the wall.
  23742. */
  23743. positions: Property | undefined;
  23744. /**
  23745. * 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.
  23746. If defined, the array must be the same length as {@link Wall#positions}.
  23747. */
  23748. minimumHeights: Property | undefined;
  23749. /**
  23750. * 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.
  23751. If defined, the array must be the same length as {@link Wall#positions}.
  23752. */
  23753. maximumHeights: Property | undefined;
  23754. /**
  23755. * Gets or sets the numeric Property specifying the angular distance between points on the wall.
  23756. */
  23757. granularity: Property | undefined;
  23758. /**
  23759. * Gets or sets the boolean Property specifying whether the wall is filled with the provided material.
  23760. */
  23761. fill: Property | undefined;
  23762. /**
  23763. * Gets or sets the Property specifying the material used to fill the wall.
  23764. */
  23765. material: MaterialProperty;
  23766. /**
  23767. * Gets or sets the Property specifying whether the wall is outlined.
  23768. */
  23769. outline: Property | undefined;
  23770. /**
  23771. * Gets or sets the Property specifying the {@link Color} of the outline.
  23772. */
  23773. outlineColor: Property | undefined;
  23774. /**
  23775. * Gets or sets the numeric Property specifying the width of the outline.
  23776. */
  23777. outlineWidth: Property | undefined;
  23778. /**
  23779. * Get or sets the enum Property specifying whether the wall
  23780. casts or receives shadows from light sources.
  23781. */
  23782. shadows: Property | undefined;
  23783. /**
  23784. * Gets or sets the {@link DistanceDisplayCondition} Property specifying at what distance from the camera that this wall will be displayed.
  23785. */
  23786. distanceDisplayCondition: Property | undefined;
  23787. /**
  23788. * Duplicates this instance.
  23789. * @param [result] - The object onto which to store the result.
  23790. * @returns The modified result parameter or a new instance if one was not provided.
  23791. */
  23792. clone(result?: WallGraphics): WallGraphics;
  23793. /**
  23794. * Assigns each unassigned property on this object to the value
  23795. of the same property on the provided source object.
  23796. * @param source - The object to be merged into this object.
  23797. */
  23798. merge(source: WallGraphics): void;
  23799. }
  23800. /**
  23801. * The data type of a pixel.
  23802. */
  23803. export enum PixelDatatype {
  23804. UNSIGNED_BYTE = WebGLConstants.UNSIGNED_BYTE,
  23805. UNSIGNED_SHORT = WebGLConstants.UNSIGNED_SHORT,
  23806. UNSIGNED_INT = WebGLConstants.UNSIGNED_INT,
  23807. FLOAT = WebGLConstants.FLOAT,
  23808. HALF_FLOAT = WebGLConstants.HALF_FLOAT_OES,
  23809. UNSIGNED_INT_24_8 = WebGLConstants.UNSIGNED_INT_24_8,
  23810. UNSIGNED_SHORT_4_4_4_4 = WebGLConstants.UNSIGNED_SHORT_4_4_4_4,
  23811. UNSIGNED_SHORT_5_5_5_1 = WebGLConstants.UNSIGNED_SHORT_5_5_5_1,
  23812. UNSIGNED_SHORT_5_6_5 = WebGLConstants.UNSIGNED_SHORT_5_6_5
  23813. }
  23814. /**
  23815. * Enumerates all possible filters used when magnifying WebGL textures.
  23816. */
  23817. export enum TextureMagnificationFilter {
  23818. /**
  23819. * Samples the texture by returning the closest pixel.
  23820. */
  23821. NEAREST = WebGLConstants.NEAREST,
  23822. /**
  23823. * Samples the texture through bi-linear interpolation of the four nearest pixels. This produces smoother results than <code>NEAREST</code> filtering.
  23824. */
  23825. LINEAR = WebGLConstants.LINEAR
  23826. }
  23827. /**
  23828. * Enumerates all possible filters used when minifying WebGL textures.
  23829. */
  23830. export enum TextureMinificationFilter {
  23831. /**
  23832. * Samples the texture by returning the closest pixel.
  23833. */
  23834. NEAREST = WebGLConstants.NEAREST,
  23835. /**
  23836. * Samples the texture through bi-linear interpolation of the four nearest pixels. This produces smoother results than <code>NEAREST</code> filtering.
  23837. */
  23838. LINEAR = WebGLConstants.LINEAR,
  23839. /**
  23840. * Selects the nearest mip level and applies nearest sampling within that level.
  23841. <p>
  23842. Requires that the texture has a mipmap. The mip level is chosen by the view angle and screen-space size of the texture.
  23843. </p>
  23844. */
  23845. NEAREST_MIPMAP_NEAREST = WebGLConstants.NEAREST_MIPMAP_NEAREST,
  23846. /**
  23847. * Selects the nearest mip level and applies linear sampling within that level.
  23848. <p>
  23849. Requires that the texture has a mipmap. The mip level is chosen by the view angle and screen-space size of the texture.
  23850. </p>
  23851. */
  23852. LINEAR_MIPMAP_NEAREST = WebGLConstants.LINEAR_MIPMAP_NEAREST,
  23853. /**
  23854. * Read texture values with nearest sampling from two adjacent mip levels and linearly interpolate the results.
  23855. <p>
  23856. This option provides a good balance of visual quality and speed when sampling from a mipmapped texture.
  23857. </p>
  23858. <p>
  23859. Requires that the texture has a mipmap. The mip level is chosen by the view angle and screen-space size of the texture.
  23860. </p>
  23861. */
  23862. NEAREST_MIPMAP_LINEAR = WebGLConstants.NEAREST_MIPMAP_LINEAR,
  23863. /**
  23864. * Read texture values with linear sampling from two adjacent mip levels and linearly interpolate the results.
  23865. <p>
  23866. This option provides a good balance of visual quality and speed when sampling from a mipmapped texture.
  23867. </p>
  23868. <p>
  23869. Requires that the texture has a mipmap. The mip level is chosen by the view angle and screen-space size of the texture.
  23870. </p>
  23871. */
  23872. LINEAR_MIPMAP_LINEAR = WebGLConstants.LINEAR_MIPMAP_LINEAR
  23873. }
  23874. /**
  23875. * An appearance defines the full GLSL vertex and fragment shaders and the
  23876. render state used to draw a {@link Primitive}. All appearances implement
  23877. this base <code>Appearance</code> interface.
  23878. * @param [options] - Object with the following properties:
  23879. * @param [options.translucent = true] - When <code>true</code>, the geometry is expected to appear translucent so {@link Appearance#renderState} has alpha blending enabled.
  23880. * @param [options.closed = false] - When <code>true</code>, the geometry is expected to be closed so {@link Appearance#renderState} has backface culling enabled.
  23881. * @param [options.material = Material.ColorType] - The material used to determine the fragment color.
  23882. * @param [options.vertexShaderSource] - Optional GLSL vertex shader source to override the default vertex shader.
  23883. * @param [options.fragmentShaderSource] - Optional GLSL fragment shader source to override the default fragment shader.
  23884. * @param [options.renderState] - Optional render state to override the default render state.
  23885. */
  23886. export class Appearance {
  23887. constructor(options?: {
  23888. translucent?: boolean;
  23889. closed?: boolean;
  23890. material?: Material;
  23891. vertexShaderSource?: string;
  23892. fragmentShaderSource?: string;
  23893. renderState?: any;
  23894. });
  23895. /**
  23896. * The material used to determine the fragment color. Unlike other {@link Appearance}
  23897. properties, this is not read-only, so an appearance's material can change on the fly.
  23898. */
  23899. material: Material;
  23900. /**
  23901. * When <code>true</code>, the geometry is expected to appear translucent.
  23902. */
  23903. translucent: boolean;
  23904. /**
  23905. * The GLSL source code for the vertex shader.
  23906. */
  23907. readonly vertexShaderSource: string;
  23908. /**
  23909. * The GLSL source code for the fragment shader. The full fragment shader
  23910. source is built procedurally taking into account the {@link Appearance#material}.
  23911. Use {@link Appearance#getFragmentShaderSource} to get the full source.
  23912. */
  23913. readonly fragmentShaderSource: string;
  23914. /**
  23915. * The WebGL fixed-function state to use when rendering the geometry.
  23916. */
  23917. readonly renderState: any;
  23918. /**
  23919. * When <code>true</code>, the geometry is expected to be closed.
  23920. */
  23921. readonly closed: boolean;
  23922. /**
  23923. * Procedurally creates the full GLSL fragment shader source for this appearance
  23924. taking into account {@link Appearance#fragmentShaderSource} and {@link Appearance#material}.
  23925. * @returns The full GLSL fragment shader source.
  23926. */
  23927. getFragmentShaderSource(): string;
  23928. /**
  23929. * Determines if the geometry is translucent based on {@link Appearance#translucent} and {@link Material#isTranslucent}.
  23930. * @returns <code>true</code> if the appearance is translucent.
  23931. */
  23932. isTranslucent(): boolean;
  23933. /**
  23934. * Creates a render state. This is not the final render state instance; instead,
  23935. it can contain a subset of render state properties identical to the render state
  23936. created in the context.
  23937. * @returns The render state.
  23938. */
  23939. getRenderState(): any;
  23940. }
  23941. export namespace ArcGisMapServerImageryProvider {
  23942. /**
  23943. * Initialization options for the ArcGisMapServerImageryProvider constructor
  23944. * @property url - The URL of the ArcGIS MapServer service.
  23945. * @property [token] - The ArcGIS token used to authenticate with the ArcGIS MapServer service.
  23946. * @property [tileDiscardPolicy] - The policy that determines if a tile
  23947. is invalid and should be discarded. If this value is not specified, a default
  23948. {@link DiscardMissingTileImagePolicy} is used for tiled map servers, and a
  23949. {@link NeverTileDiscardPolicy} is used for non-tiled map servers. In the former case,
  23950. we request tile 0,0 at the maximum tile level and check pixels (0,0), (200,20), (20,200),
  23951. (80,110), and (160, 130). If all of these pixels are transparent, the discard check is
  23952. disabled and no tiles are discarded. If any of them have a non-transparent color, any
  23953. tile that has the same values in these pixel locations is discarded. The end result of
  23954. these defaults should be correct tile discarding for a standard ArcGIS Server. To ensure
  23955. that no tiles are discarded, construct and pass a {@link NeverTileDiscardPolicy} for this
  23956. parameter.
  23957. * @property [usePreCachedTilesIfAvailable = true] - If true, the server's pre-cached
  23958. tiles are used if they are available. If false, any pre-cached tiles are ignored and the
  23959. 'export' service is used.
  23960. * @property [layers] - A comma-separated list of the layers to show, or undefined if all layers should be shown.
  23961. * @property [enablePickFeatures = true] - If true, {@link ArcGisMapServerImageryProvider#pickFeatures} will invoke
  23962. the Identify service on the MapServer and return the features included in the response. If false,
  23963. {@link ArcGisMapServerImageryProvider#pickFeatures} will immediately return undefined (indicating no pickable features)
  23964. without communicating with the server. Set this property to false if you don't want this provider's features to
  23965. be pickable. Can be overridden by setting the {@link ArcGisMapServerImageryProvider#enablePickFeatures} property on the object.
  23966. * @property [rectangle = Rectangle.MAX_VALUE] - The rectangle of the layer. This parameter is ignored when accessing
  23967. a tiled layer.
  23968. * @property [tilingScheme = new GeographicTilingScheme()] - The tiling scheme to use to divide the world into tiles.
  23969. This parameter is ignored when accessing a tiled server.
  23970. * @property [ellipsoid] - The ellipsoid. If the tilingScheme is specified and used,
  23971. this parameter is ignored and the tiling scheme's ellipsoid is used instead. If neither
  23972. parameter is specified, the WGS84 ellipsoid is used.
  23973. * @property [credit] - A credit for the data source, which is displayed on the canvas. This parameter is ignored when accessing a tiled server.
  23974. * @property [tileWidth = 256] - The width of each tile in pixels. This parameter is ignored when accessing a tiled server.
  23975. * @property [tileHeight = 256] - The height of each tile in pixels. This parameter is ignored when accessing a tiled server.
  23976. * @property [maximumLevel] - The maximum tile level to request, or undefined if there is no maximum. This parameter is ignored when accessing
  23977. a tiled server.
  23978. */
  23979. type ConstructorOptions = {
  23980. url: Resource | string;
  23981. token?: string;
  23982. tileDiscardPolicy?: TileDiscardPolicy;
  23983. usePreCachedTilesIfAvailable?: boolean;
  23984. layers?: string;
  23985. enablePickFeatures?: boolean;
  23986. rectangle?: Rectangle;
  23987. tilingScheme?: TilingScheme;
  23988. ellipsoid?: Ellipsoid;
  23989. credit?: Credit | string;
  23990. tileWidth?: number;
  23991. tileHeight?: number;
  23992. maximumLevel?: number;
  23993. };
  23994. }
  23995. /**
  23996. * Provides tiled imagery hosted by an ArcGIS MapServer. By default, the server's pre-cached tiles are
  23997. used, if available.
  23998. * @example
  23999. * var esri = new Cesium.ArcGisMapServerImageryProvider({
  24000. url : 'https://services.arcgisonline.com/ArcGIS/rest/services/World_Imagery/MapServer'
  24001. });
  24002. * @param options - Object describing initialization options
  24003. */
  24004. export class ArcGisMapServerImageryProvider {
  24005. constructor(options: ArcGisMapServerImageryProvider.ConstructorOptions);
  24006. /**
  24007. * The default alpha blending value of this provider, with 0.0 representing fully transparent and
  24008. 1.0 representing fully opaque.
  24009. */
  24010. defaultAlpha: number | undefined;
  24011. /**
  24012. * The default alpha blending value on the night side of the globe of this provider, with 0.0 representing fully transparent and
  24013. 1.0 representing fully opaque.
  24014. */
  24015. defaultNightAlpha: number | undefined;
  24016. /**
  24017. * The default alpha blending value on the day side of the globe of this provider, with 0.0 representing fully transparent and
  24018. 1.0 representing fully opaque.
  24019. */
  24020. defaultDayAlpha: number | undefined;
  24021. /**
  24022. * The default brightness of this provider. 1.0 uses the unmodified imagery color. Less than 1.0
  24023. makes the imagery darker while greater than 1.0 makes it brighter.
  24024. */
  24025. defaultBrightness: number | undefined;
  24026. /**
  24027. * The default contrast of this provider. 1.0 uses the unmodified imagery color. Less than 1.0 reduces
  24028. the contrast while greater than 1.0 increases it.
  24029. */
  24030. defaultContrast: number | undefined;
  24031. /**
  24032. * The default hue of this provider in radians. 0.0 uses the unmodified imagery color.
  24033. */
  24034. defaultHue: number | undefined;
  24035. /**
  24036. * The default saturation of this provider. 1.0 uses the unmodified imagery color. Less than 1.0 reduces the
  24037. saturation while greater than 1.0 increases it.
  24038. */
  24039. defaultSaturation: number | undefined;
  24040. /**
  24041. * The default gamma correction to apply to this provider. 1.0 uses the unmodified imagery color.
  24042. */
  24043. defaultGamma: number | undefined;
  24044. /**
  24045. * The default texture minification filter to apply to this provider.
  24046. */
  24047. defaultMinificationFilter: TextureMinificationFilter;
  24048. /**
  24049. * The default texture magnification filter to apply to this provider.
  24050. */
  24051. defaultMagnificationFilter: TextureMagnificationFilter;
  24052. /**
  24053. * Gets or sets a value indicating whether feature picking is enabled. If true, {@link ArcGisMapServerImageryProvider#pickFeatures} will
  24054. invoke the "identify" operation on the ArcGIS server and return the features included in the response. If false,
  24055. {@link ArcGisMapServerImageryProvider#pickFeatures} will immediately return undefined (indicating no pickable features)
  24056. without communicating with the server.
  24057. */
  24058. enablePickFeatures: boolean;
  24059. /**
  24060. * Gets the URL of the ArcGIS MapServer.
  24061. */
  24062. readonly url: string;
  24063. /**
  24064. * Gets the ArcGIS token used to authenticate with the ArcGis MapServer service.
  24065. */
  24066. readonly token: string;
  24067. /**
  24068. * Gets the proxy used by this provider.
  24069. */
  24070. readonly proxy: Proxy;
  24071. /**
  24072. * Gets the width of each tile, in pixels. This function should
  24073. not be called before {@link ArcGisMapServerImageryProvider#ready} returns true.
  24074. */
  24075. readonly tileWidth: number;
  24076. /**
  24077. * Gets the height of each tile, in pixels. This function should
  24078. not be called before {@link ArcGisMapServerImageryProvider#ready} returns true.
  24079. */
  24080. readonly tileHeight: number;
  24081. /**
  24082. * Gets the maximum level-of-detail that can be requested. This function should
  24083. not be called before {@link ArcGisMapServerImageryProvider#ready} returns true.
  24084. */
  24085. readonly maximumLevel: number | undefined;
  24086. /**
  24087. * Gets the minimum level-of-detail that can be requested. This function should
  24088. not be called before {@link ArcGisMapServerImageryProvider#ready} returns true.
  24089. */
  24090. readonly minimumLevel: number;
  24091. /**
  24092. * Gets the tiling scheme used by this provider. This function should
  24093. not be called before {@link ArcGisMapServerImageryProvider#ready} returns true.
  24094. */
  24095. readonly tilingScheme: TilingScheme;
  24096. /**
  24097. * Gets the rectangle, in radians, of the imagery provided by this instance. This function should
  24098. not be called before {@link ArcGisMapServerImageryProvider#ready} returns true.
  24099. */
  24100. readonly rectangle: Rectangle;
  24101. /**
  24102. * Gets the tile discard policy. If not undefined, the discard policy is responsible
  24103. for filtering out "missing" tiles via its shouldDiscardImage function. If this function
  24104. returns undefined, no tiles are filtered. This function should
  24105. not be called before {@link ArcGisMapServerImageryProvider#ready} returns true.
  24106. */
  24107. readonly tileDiscardPolicy: TileDiscardPolicy;
  24108. /**
  24109. * Gets an event that is raised when the imagery provider encounters an asynchronous error. By subscribing
  24110. to the event, you will be notified of the error and can potentially recover from it. Event listeners
  24111. are passed an instance of {@link TileProviderError}.
  24112. */
  24113. readonly errorEvent: Event;
  24114. /**
  24115. * Gets a value indicating whether or not the provider is ready for use.
  24116. */
  24117. readonly ready: boolean;
  24118. /**
  24119. * Gets a promise that resolves to true when the provider is ready for use.
  24120. */
  24121. readonly readyPromise: Promise<boolean>;
  24122. /**
  24123. * Gets the credit to display when this imagery provider is active. Typically this is used to credit
  24124. the source of the imagery. This function should not be called before {@link ArcGisMapServerImageryProvider#ready} returns true.
  24125. */
  24126. readonly credit: Credit;
  24127. /**
  24128. * Gets a value indicating whether this imagery provider is using pre-cached tiles from the
  24129. ArcGIS MapServer. If the imagery provider is not yet ready ({@link ArcGisMapServerImageryProvider#ready}), this function
  24130. will return the value of `options.usePreCachedTilesIfAvailable`, even if the MapServer does
  24131. not have pre-cached tiles.
  24132. */
  24133. readonly usingPrecachedTiles: boolean;
  24134. /**
  24135. * Gets a value indicating whether or not the images provided by this imagery provider
  24136. include an alpha channel. If this property is false, an alpha channel, if present, will
  24137. be ignored. If this property is true, any images without an alpha channel will be treated
  24138. as if their alpha is 1.0 everywhere. When this property is false, memory usage
  24139. and texture upload time are reduced.
  24140. */
  24141. readonly hasAlphaChannel: boolean;
  24142. /**
  24143. * Gets the comma-separated list of layer IDs to show.
  24144. */
  24145. layers: string;
  24146. /**
  24147. * Gets the credits to be displayed when a given tile is displayed.
  24148. * @param x - The tile X coordinate.
  24149. * @param y - The tile Y coordinate.
  24150. * @param level - The tile level;
  24151. * @returns The credits to be displayed when the tile is displayed.
  24152. */
  24153. getTileCredits(x: number, y: number, level: number): Credit[];
  24154. /**
  24155. * Requests the image for a given tile. This function should
  24156. not be called before {@link ArcGisMapServerImageryProvider#ready} returns true.
  24157. * @param x - The tile X coordinate.
  24158. * @param y - The tile Y coordinate.
  24159. * @param level - The tile level.
  24160. * @param [request] - The request object. Intended for internal use only.
  24161. * @returns A promise for the image that will resolve when the image is available, or
  24162. undefined if there are too many active requests to the server, and the request
  24163. should be retried later. The resolved image may be either an
  24164. Image or a Canvas DOM object.
  24165. */
  24166. requestImage(x: number, y: number, level: number, request?: Request): Promise<HTMLImageElement | HTMLCanvasElement> | undefined;
  24167. /**
  24168. * /**
  24169. Asynchronously determines what features, if any, are located at a given longitude and latitude within
  24170. a tile. This function should not be called before {@link ImageryProvider#ready} returns true.
  24171. * @param x - The tile X coordinate.
  24172. * @param y - The tile Y coordinate.
  24173. * @param level - The tile level.
  24174. * @param longitude - The longitude at which to pick features.
  24175. * @param latitude - The latitude at which to pick features.
  24176. * @returns A promise for the picked features that will resolve when the asynchronous
  24177. picking completes. The resolved value is an array of {@link ImageryLayerFeatureInfo}
  24178. instances. The array may be empty if no features are found at the given location.
  24179. */
  24180. pickFeatures(x: number, y: number, level: number, longitude: number, latitude: number): Promise<ImageryLayerFeatureInfo[]> | undefined;
  24181. }
  24182. /**
  24183. * An enum describing the x, y, and z axes and helper conversion functions.
  24184. */
  24185. export enum Axis {
  24186. /**
  24187. * Denotes the x-axis.
  24188. */
  24189. X = 0,
  24190. /**
  24191. * Denotes the y-axis.
  24192. */
  24193. Y = 1,
  24194. /**
  24195. * Denotes the z-axis.
  24196. */
  24197. Z = 2
  24198. }
  24199. /**
  24200. * A viewport-aligned image positioned in the 3D scene, that is created
  24201. and rendered using a {@link BillboardCollection}. A billboard is created and its initial
  24202. properties are set by calling {@link BillboardCollection#add}.
  24203. <br /><br />
  24204. <div align='center'>
  24205. <img src='Images/Billboard.png' width='400' height='300' /><br />
  24206. Example billboards
  24207. </div>
  24208. */
  24209. export class Billboard {
  24210. constructor();
  24211. /**
  24212. * Determines if this billboard will be shown. Use this to hide or show a billboard, instead
  24213. of removing it and re-adding it to the collection.
  24214. */
  24215. show: boolean;
  24216. /**
  24217. * Gets or sets the Cartesian position of this billboard.
  24218. */
  24219. position: Cartesian3;
  24220. /**
  24221. * Gets or sets the height reference of this billboard.
  24222. */
  24223. heightReference: HeightReference;
  24224. /**
  24225. * Gets or sets the pixel offset in screen space from the origin of this billboard. This is commonly used
  24226. to align multiple billboards and labels at the same position, e.g., an image and text. The
  24227. screen space origin is the top, left corner of the canvas; <code>x</code> increases from
  24228. left to right, and <code>y</code> increases from top to bottom.
  24229. <br /><br />
  24230. <div align='center'>
  24231. <table border='0' cellpadding='5'><tr>
  24232. <td align='center'><code>default</code><br/><img src='Images/Billboard.setPixelOffset.default.png' width='250' height='188' /></td>
  24233. <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>
  24234. </tr></table>
  24235. The billboard's origin is indicated by the yellow point.
  24236. </div>
  24237. */
  24238. pixelOffset: Cartesian2;
  24239. /**
  24240. * Gets or sets near and far scaling properties of a Billboard based on the billboard's distance from the camera.
  24241. A billboard's scale will interpolate between the {@link NearFarScalar#nearValue} and
  24242. {@link NearFarScalar#farValue} while the camera distance falls within the lower and upper bounds
  24243. of the specified {@link NearFarScalar#near} and {@link NearFarScalar#far}.
  24244. Outside of these ranges the billboard's scale remains clamped to the nearest bound. If undefined,
  24245. scaleByDistance will be disabled.
  24246. * @example
  24247. * // Example 1.
  24248. // Set a billboard's scaleByDistance to scale by 1.5 when the
  24249. // camera is 1500 meters from the billboard and disappear as
  24250. // the camera distance approaches 8.0e6 meters.
  24251. b.scaleByDistance = new Cesium.NearFarScalar(1.5e2, 1.5, 8.0e6, 0.0);
  24252. * @example
  24253. * // Example 2.
  24254. // disable scaling by distance
  24255. b.scaleByDistance = undefined;
  24256. */
  24257. scaleByDistance: NearFarScalar;
  24258. /**
  24259. * Gets or sets near and far translucency properties of a Billboard based on the billboard's distance from the camera.
  24260. A billboard's translucency will interpolate between the {@link NearFarScalar#nearValue} and
  24261. {@link NearFarScalar#farValue} while the camera distance falls within the lower and upper bounds
  24262. of the specified {@link NearFarScalar#near} and {@link NearFarScalar#far}.
  24263. Outside of these ranges the billboard's translucency remains clamped to the nearest bound. If undefined,
  24264. translucencyByDistance will be disabled.
  24265. * @example
  24266. * // Example 1.
  24267. // Set a billboard's translucency to 1.0 when the
  24268. // camera is 1500 meters from the billboard and disappear as
  24269. // the camera distance approaches 8.0e6 meters.
  24270. b.translucencyByDistance = new Cesium.NearFarScalar(1.5e2, 1.0, 8.0e6, 0.0);
  24271. * @example
  24272. * // Example 2.
  24273. // disable translucency by distance
  24274. b.translucencyByDistance = undefined;
  24275. */
  24276. translucencyByDistance: NearFarScalar;
  24277. /**
  24278. * Gets or sets near and far pixel offset scaling properties of a Billboard based on the billboard's distance from the camera.
  24279. A billboard's pixel offset will be scaled between the {@link NearFarScalar#nearValue} and
  24280. {@link NearFarScalar#farValue} while the camera distance falls within the lower and upper bounds
  24281. of the specified {@link NearFarScalar#near} and {@link NearFarScalar#far}.
  24282. Outside of these ranges the billboard's pixel offset scale remains clamped to the nearest bound. If undefined,
  24283. pixelOffsetScaleByDistance will be disabled.
  24284. * @example
  24285. * // Example 1.
  24286. // Set a billboard's pixel offset scale to 0.0 when the
  24287. // camera is 1500 meters from the billboard and scale pixel offset to 10.0 pixels
  24288. // in the y direction the camera distance approaches 8.0e6 meters.
  24289. b.pixelOffset = new Cesium.Cartesian2(0.0, 1.0);
  24290. b.pixelOffsetScaleByDistance = new Cesium.NearFarScalar(1.5e2, 0.0, 8.0e6, 10.0);
  24291. * @example
  24292. * // Example 2.
  24293. // disable pixel offset by distance
  24294. b.pixelOffsetScaleByDistance = undefined;
  24295. */
  24296. pixelOffsetScaleByDistance: NearFarScalar;
  24297. /**
  24298. * Gets or sets the 3D Cartesian offset applied to this billboard in eye coordinates. Eye coordinates is a left-handed
  24299. coordinate system, where <code>x</code> points towards the viewer's right, <code>y</code> points up, and
  24300. <code>z</code> points into the screen. Eye coordinates use the same scale as world and model coordinates,
  24301. which is typically meters.
  24302. <br /><br />
  24303. An eye offset is commonly used to arrange multiple billboards or objects at the same position, e.g., to
  24304. arrange a billboard above its corresponding 3D model.
  24305. <br /><br />
  24306. Below, the billboard is positioned at the center of the Earth but an eye offset makes it always
  24307. appear on top of the Earth regardless of the viewer's or Earth's orientation.
  24308. <br /><br />
  24309. <div align='center'>
  24310. <table border='0' cellpadding='5'><tr>
  24311. <td align='center'><img src='Images/Billboard.setEyeOffset.one.png' width='250' height='188' /></td>
  24312. <td align='center'><img src='Images/Billboard.setEyeOffset.two.png' width='250' height='188' /></td>
  24313. </tr></table>
  24314. <code>b.eyeOffset = new Cartesian3(0.0, 8000000.0, 0.0);</code><br /><br />
  24315. </div>
  24316. */
  24317. eyeOffset: Cartesian3;
  24318. /**
  24319. * Gets or sets the horizontal origin of this billboard, which determines if the billboard is
  24320. to the left, center, or right of its anchor position.
  24321. <br /><br />
  24322. <div align='center'>
  24323. <img src='Images/Billboard.setHorizontalOrigin.png' width='648' height='196' /><br />
  24324. </div>
  24325. * @example
  24326. * // Use a bottom, left origin
  24327. b.horizontalOrigin = Cesium.HorizontalOrigin.LEFT;
  24328. b.verticalOrigin = Cesium.VerticalOrigin.BOTTOM;
  24329. */
  24330. horizontalOrigin: HorizontalOrigin;
  24331. /**
  24332. * Gets or sets the vertical origin of this billboard, which determines if the billboard is
  24333. to the above, below, or at the center of its anchor position.
  24334. <br /><br />
  24335. <div align='center'>
  24336. <img src='Images/Billboard.setVerticalOrigin.png' width='695' height='175' /><br />
  24337. </div>
  24338. * @example
  24339. * // Use a bottom, left origin
  24340. b.horizontalOrigin = Cesium.HorizontalOrigin.LEFT;
  24341. b.verticalOrigin = Cesium.VerticalOrigin.BOTTOM;
  24342. */
  24343. verticalOrigin: VerticalOrigin;
  24344. /**
  24345. * Gets or sets the uniform scale that is multiplied with the billboard's image size in pixels.
  24346. A scale of <code>1.0</code> does not change the size of the billboard; a scale greater than
  24347. <code>1.0</code> enlarges the billboard; a positive scale less than <code>1.0</code> shrinks
  24348. the billboard.
  24349. <br /><br />
  24350. <div align='center'>
  24351. <img src='Images/Billboard.setScale.png' width='400' height='300' /><br/>
  24352. From left to right in the above image, the scales are <code>0.5</code>, <code>1.0</code>,
  24353. and <code>2.0</code>.
  24354. </div>
  24355. */
  24356. scale: number;
  24357. /**
  24358. * Gets or sets the color that is multiplied with the billboard's texture. This has two common use cases. First,
  24359. the same white texture may be used by many different billboards, each with a different color, to create
  24360. colored billboards. Second, the color's alpha component can be used to make the billboard translucent as shown below.
  24361. An alpha of <code>0.0</code> makes the billboard transparent, and <code>1.0</code> makes the billboard opaque.
  24362. <br /><br />
  24363. <div align='center'>
  24364. <table border='0' cellpadding='5'><tr>
  24365. <td align='center'><code>default</code><br/><img src='Images/Billboard.setColor.Alpha255.png' width='250' height='188' /></td>
  24366. <td align='center'><code>alpha : 0.5</code><br/><img src='Images/Billboard.setColor.Alpha127.png' width='250' height='188' /></td>
  24367. </tr></table>
  24368. </div>
  24369. <br />
  24370. The red, green, blue, and alpha values are indicated by <code>value</code>'s <code>red</code>, <code>green</code>,
  24371. <code>blue</code>, and <code>alpha</code> properties as shown in Example 1. These components range from <code>0.0</code>
  24372. (no intensity) to <code>1.0</code> (full intensity).
  24373. * @example
  24374. * // Example 1. Assign yellow.
  24375. b.color = Cesium.Color.YELLOW;
  24376. * @example
  24377. * // Example 2. Make a billboard 50% translucent.
  24378. b.color = new Cesium.Color(1.0, 1.0, 1.0, 0.5);
  24379. */
  24380. color: Color;
  24381. /**
  24382. * Gets or sets the rotation angle in radians.
  24383. */
  24384. rotation: number;
  24385. /**
  24386. * Gets or sets the aligned axis in world space. The aligned axis is the unit vector that the billboard up vector points towards.
  24387. The default is the zero vector, which means the billboard is aligned to the screen up vector.
  24388. * @example
  24389. * // Example 1.
  24390. // Have the billboard up vector point north
  24391. billboard.alignedAxis = Cesium.Cartesian3.UNIT_Z;
  24392. * @example
  24393. * // Example 2.
  24394. // Have the billboard point east.
  24395. billboard.alignedAxis = Cesium.Cartesian3.UNIT_Z;
  24396. billboard.rotation = -Cesium.Math.PI_OVER_TWO;
  24397. * @example
  24398. * // Example 3.
  24399. // Reset the aligned axis
  24400. billboard.alignedAxis = Cesium.Cartesian3.ZERO;
  24401. */
  24402. alignedAxis: Cartesian3;
  24403. /**
  24404. * Gets or sets a width for the billboard. If undefined, the image width will be used.
  24405. */
  24406. width: number;
  24407. /**
  24408. * Gets or sets a height for the billboard. If undefined, the image height will be used.
  24409. */
  24410. height: number;
  24411. /**
  24412. * Gets or sets if the billboard size is in meters or pixels. <code>true</code> to size the billboard in meters;
  24413. otherwise, the size is in pixels.
  24414. */
  24415. sizeInMeters: boolean;
  24416. /**
  24417. * Gets or sets the condition specifying at what distance from the camera that this billboard will be displayed.
  24418. */
  24419. distanceDisplayCondition: DistanceDisplayCondition;
  24420. /**
  24421. * Gets or sets the distance from the camera at which to disable the depth test to, for example, prevent clipping against terrain.
  24422. When set to zero, the depth test is always applied. When set to Number.POSITIVE_INFINITY, the depth test is never applied.
  24423. */
  24424. disableDepthTestDistance: number;
  24425. /**
  24426. * Gets or sets the user-defined object returned when the billboard is picked.
  24427. */
  24428. id: any;
  24429. /**
  24430. * <p>
  24431. Gets or sets the image to be used for this billboard. If a texture has already been created for the
  24432. given image, the existing texture is used.
  24433. </p>
  24434. <p>
  24435. This property can be set to a loaded Image, a URL which will be loaded as an Image automatically,
  24436. a canvas, or another billboard's image property (from the same billboard collection).
  24437. </p>
  24438. * @example
  24439. * // load an image from a URL
  24440. b.image = 'some/image/url.png';
  24441. // assuming b1 and b2 are billboards in the same billboard collection,
  24442. // use the same image for both billboards.
  24443. b2.image = b1.image;
  24444. */
  24445. image: string;
  24446. /**
  24447. * When <code>true</code>, this billboard is ready to render, i.e., the image
  24448. has been downloaded and the WebGL resources are created.
  24449. */
  24450. readonly ready: boolean;
  24451. /**
  24452. * <p>
  24453. Sets the image to be used for this billboard. If a texture has already been created for the
  24454. given id, the existing texture is used.
  24455. </p>
  24456. <p>
  24457. This function is useful for dynamically creating textures that are shared across many billboards.
  24458. Only the first billboard will actually call the function and create the texture, while subsequent
  24459. billboards created with the same id will simply re-use the existing texture.
  24460. </p>
  24461. <p>
  24462. To load an image from a URL, setting the {@link Billboard#image} property is more convenient.
  24463. </p>
  24464. * @example
  24465. * // create a billboard image dynamically
  24466. function drawImage(id) {
  24467. // create and draw an image using a canvas
  24468. var canvas = document.createElement('canvas');
  24469. var context2D = canvas.getContext('2d');
  24470. // ... draw image
  24471. return canvas;
  24472. }
  24473. // drawImage will be called to create the texture
  24474. b.setImage('myImage', drawImage);
  24475. // subsequent billboards created in the same collection using the same id will use the existing
  24476. // texture, without the need to create the canvas or draw the image
  24477. b2.setImage('myImage', drawImage);
  24478. * @param id - The id of the image. This can be any string that uniquely identifies the image.
  24479. * @param image - The image to load. This parameter
  24480. can either be a loaded Image or Canvas, a URL which will be loaded as an Image automatically,
  24481. or a function which will be called to create the image if it hasn't been loaded already.
  24482. */
  24483. setImage(id: string, image: HTMLImageElement | HTMLCanvasElement | string | Resource | Billboard.CreateImageCallback): void;
  24484. /**
  24485. * Uses a sub-region of the image with the given id as the image for this billboard,
  24486. measured in pixels from the bottom-left.
  24487. * @param id - The id of the image to use.
  24488. * @param subRegion - The sub-region of the image.
  24489. */
  24490. setImageSubRegion(id: string, subRegion: BoundingRectangle): void;
  24491. /**
  24492. * Computes the screen-space position of the billboard's origin, taking into account eye and pixel offsets.
  24493. The screen space origin is the top, left corner of the canvas; <code>x</code> increases from
  24494. left to right, and <code>y</code> increases from top to bottom.
  24495. * @example
  24496. * console.log(b.computeScreenSpacePosition(scene).toString());
  24497. * @param scene - The scene.
  24498. * @param [result] - The object onto which to store the result.
  24499. * @returns The screen-space position of the billboard.
  24500. */
  24501. computeScreenSpacePosition(scene: Scene, result?: Cartesian2): Cartesian2;
  24502. /**
  24503. * Determines if this billboard equals another billboard. Billboards are equal if all their properties
  24504. are equal. Billboards in different collections can be equal.
  24505. * @param other - The billboard to compare for equality.
  24506. * @returns <code>true</code> if the billboards are equal; otherwise, <code>false</code>.
  24507. */
  24508. equals(other: Billboard): boolean;
  24509. }
  24510. export namespace Billboard {
  24511. /**
  24512. * A function that creates an image.
  24513. * @param id - The identifier of the image to load.
  24514. */
  24515. type CreateImageCallback = (id: string) => HTMLImageElement | HTMLCanvasElement | Promise<HTMLImageElement | HTMLCanvasElement>;
  24516. }
  24517. /**
  24518. * A renderable collection of billboards. Billboards are viewport-aligned
  24519. images positioned in the 3D scene.
  24520. <br /><br />
  24521. <div align='center'>
  24522. <img src='Images/Billboard.png' width='400' height='300' /><br />
  24523. Example billboards
  24524. </div>
  24525. <br /><br />
  24526. Billboards are added and removed from the collection using {@link BillboardCollection#add}
  24527. and {@link BillboardCollection#remove}. Billboards in a collection automatically share textures
  24528. for images with the same identifier.
  24529. * @example
  24530. * // Create a billboard collection with two billboards
  24531. var billboards = scene.primitives.add(new Cesium.BillboardCollection());
  24532. billboards.add({
  24533. position : new Cesium.Cartesian3(1.0, 2.0, 3.0),
  24534. image : 'url/to/image'
  24535. });
  24536. billboards.add({
  24537. position : new Cesium.Cartesian3(4.0, 5.0, 6.0),
  24538. image : 'url/to/another/image'
  24539. });
  24540. * @param [options] - Object with the following properties:
  24541. * @param [options.modelMatrix = Matrix4.IDENTITY] - The 4x4 transformation matrix that transforms each billboard from model to world coordinates.
  24542. * @param [options.debugShowBoundingVolume = false] - For debugging only. Determines if this primitive's commands' bounding spheres are shown.
  24543. * @param [options.scene] - Must be passed in for billboards that use the height reference property or will be depth tested against the globe.
  24544. * @param [options.blendOption = BlendOption.OPAQUE_AND_TRANSLUCENT] - The billboard blending option. The default
  24545. is used for rendering both opaque and translucent billboards. However, if either all of the billboards are completely opaque or all are completely translucent,
  24546. setting the technique to BlendOption.OPAQUE or BlendOption.TRANSLUCENT can improve performance by up to 2x.
  24547. */
  24548. export class BillboardCollection {
  24549. constructor(options?: {
  24550. modelMatrix?: Matrix4;
  24551. debugShowBoundingVolume?: boolean;
  24552. scene?: Scene;
  24553. blendOption?: BlendOption;
  24554. });
  24555. /**
  24556. * The 4x4 transformation matrix that transforms each billboard in this collection from model to world coordinates.
  24557. When this is the identity matrix, the billboards are drawn in world coordinates, i.e., Earth's WGS84 coordinates.
  24558. Local reference frames can be used by providing a different transformation matrix, like that returned
  24559. by {@link Transforms.eastNorthUpToFixedFrame}.
  24560. * @example
  24561. * var center = Cesium.Cartesian3.fromDegrees(-75.59777, 40.03883);
  24562. billboards.modelMatrix = Cesium.Transforms.eastNorthUpToFixedFrame(center);
  24563. billboards.add({
  24564. image : 'url/to/image',
  24565. position : new Cesium.Cartesian3(0.0, 0.0, 0.0) // center
  24566. });
  24567. billboards.add({
  24568. image : 'url/to/image',
  24569. position : new Cesium.Cartesian3(1000000.0, 0.0, 0.0) // east
  24570. });
  24571. billboards.add({
  24572. image : 'url/to/image',
  24573. position : new Cesium.Cartesian3(0.0, 1000000.0, 0.0) // north
  24574. });
  24575. billboards.add({
  24576. image : 'url/to/image',
  24577. position : new Cesium.Cartesian3(0.0, 0.0, 1000000.0) // up
  24578. });
  24579. */
  24580. modelMatrix: Matrix4;
  24581. /**
  24582. * This property is for debugging only; it is not for production use nor is it optimized.
  24583. <p>
  24584. Draws the bounding sphere for each draw command in the primitive.
  24585. </p>
  24586. */
  24587. debugShowBoundingVolume: boolean;
  24588. /**
  24589. * This property is for debugging only; it is not for production use nor is it optimized.
  24590. <p>
  24591. Draws the texture atlas for this BillboardCollection as a fullscreen quad.
  24592. </p>
  24593. */
  24594. debugShowTextureAtlas: boolean;
  24595. /**
  24596. * The billboard blending option. The default is used for rendering both opaque and translucent billboards.
  24597. However, if either all of the billboards are completely opaque or all are completely translucent,
  24598. setting the technique to BlendOption.OPAQUE or BlendOption.TRANSLUCENT can improve
  24599. performance by up to 2x.
  24600. */
  24601. blendOption: BlendOption;
  24602. /**
  24603. * Returns the number of billboards in this collection. This is commonly used with
  24604. {@link BillboardCollection#get} to iterate over all the billboards
  24605. in the collection.
  24606. */
  24607. length: number;
  24608. /**
  24609. * Creates and adds a billboard with the specified initial properties to the collection.
  24610. The added billboard is returned so it can be modified or removed from the collection later.
  24611. * @example
  24612. * // Example 1: Add a billboard, specifying all the default values.
  24613. var b = billboards.add({
  24614. show : true,
  24615. position : Cesium.Cartesian3.ZERO,
  24616. pixelOffset : Cesium.Cartesian2.ZERO,
  24617. eyeOffset : Cesium.Cartesian3.ZERO,
  24618. heightReference : Cesium.HeightReference.NONE,
  24619. horizontalOrigin : Cesium.HorizontalOrigin.CENTER,
  24620. verticalOrigin : Cesium.VerticalOrigin.CENTER,
  24621. scale : 1.0,
  24622. image : 'url/to/image',
  24623. imageSubRegion : undefined,
  24624. color : Cesium.Color.WHITE,
  24625. id : undefined,
  24626. rotation : 0.0,
  24627. alignedAxis : Cesium.Cartesian3.ZERO,
  24628. width : undefined,
  24629. height : undefined,
  24630. scaleByDistance : undefined,
  24631. translucencyByDistance : undefined,
  24632. pixelOffsetScaleByDistance : undefined,
  24633. sizeInMeters : false,
  24634. distanceDisplayCondition : undefined
  24635. });
  24636. * @example
  24637. * // Example 2: Specify only the billboard's cartographic position.
  24638. var b = billboards.add({
  24639. position : Cesium.Cartesian3.fromDegrees(longitude, latitude, height)
  24640. });
  24641. * @param [options] - A template describing the billboard's properties as shown in Example 1.
  24642. * @returns The billboard that was added to the collection.
  24643. */
  24644. add(options?: any): Billboard;
  24645. /**
  24646. * Removes a billboard from the collection.
  24647. * @example
  24648. * var b = billboards.add(...);
  24649. billboards.remove(b); // Returns true
  24650. * @param billboard - The billboard to remove.
  24651. * @returns <code>true</code> if the billboard was removed; <code>false</code> if the billboard was not found in the collection.
  24652. */
  24653. remove(billboard: Billboard): boolean;
  24654. /**
  24655. * Removes all billboards from the collection.
  24656. * @example
  24657. * billboards.add(...);
  24658. billboards.add(...);
  24659. billboards.removeAll();
  24660. */
  24661. removeAll(): void;
  24662. /**
  24663. * Check whether this collection contains a given billboard.
  24664. * @param [billboard] - The billboard to check for.
  24665. * @returns true if this collection contains the billboard, false otherwise.
  24666. */
  24667. contains(billboard?: Billboard): boolean;
  24668. /**
  24669. * Returns the billboard in the collection at the specified index. Indices are zero-based
  24670. and increase as billboards are added. Removing a billboard shifts all billboards after
  24671. it to the left, changing their indices. This function is commonly used with
  24672. {@link BillboardCollection#length} to iterate over all the billboards
  24673. in the collection.
  24674. * @example
  24675. * // Toggle the show property of every billboard in the collection
  24676. var len = billboards.length;
  24677. for (var i = 0; i < len; ++i) {
  24678. var b = billboards.get(i);
  24679. b.show = !b.show;
  24680. }
  24681. * @param index - The zero-based index of the billboard.
  24682. * @returns The billboard at the specified index.
  24683. */
  24684. get(index: number): Billboard;
  24685. /**
  24686. * Called when {@link Viewer} or {@link CesiumWidget} render the scene to
  24687. get the draw commands needed to render this primitive.
  24688. <p>
  24689. Do not call this function directly. This is documented just to
  24690. list the exceptions that may be propagated when the scene is rendered:
  24691. </p>
  24692. */
  24693. update(): void;
  24694. /**
  24695. * Returns true if this object was destroyed; otherwise, false.
  24696. <br /><br />
  24697. If this object was destroyed, it should not be used; calling any function other than
  24698. <code>isDestroyed</code> will result in a {@link DeveloperError} exception.
  24699. * @returns <code>true</code> if this object was destroyed; otherwise, <code>false</code>.
  24700. */
  24701. isDestroyed(): boolean;
  24702. /**
  24703. * Destroys the WebGL resources held by this object. Destroying an object allows for deterministic
  24704. release of WebGL resources, instead of relying on the garbage collector to destroy this object.
  24705. <br /><br />
  24706. Once an object is destroyed, it should not be used; calling any function other than
  24707. <code>isDestroyed</code> will result in a {@link DeveloperError} exception. Therefore,
  24708. assign the return value (<code>undefined</code>) to the object as done in the example.
  24709. * @example
  24710. * billboards = billboards && billboards.destroy();
  24711. */
  24712. destroy(): void;
  24713. }
  24714. export namespace BingMapsImageryProvider {
  24715. /**
  24716. * Initialization options for the BingMapsImageryProvider constructor
  24717. * @property url - The url of the Bing Maps server hosting the imagery.
  24718. * @property key - The Bing Maps key for your application, which can be
  24719. created at {@link https://www.bingmapsportal.com/}.
  24720. * @property [tileProtocol] - The protocol to use when loading tiles, e.g. 'http' or 'https'.
  24721. By default, tiles are loaded using the same protocol as the page.
  24722. * @property [mapStyle = BingMapsStyle.AERIAL] - The type of Bing Maps imagery to load.
  24723. * @property [culture = ''] - The culture to use when requesting Bing Maps imagery. Not
  24724. all cultures are supported. See {@link http://msdn.microsoft.com/en-us/library/hh441729.aspx}
  24725. for information on the supported cultures.
  24726. * @property [ellipsoid] - The ellipsoid. If not specified, the WGS84 ellipsoid is used.
  24727. * @property [tileDiscardPolicy] - The policy that determines if a tile
  24728. is invalid and should be discarded. By default, a {@link DiscardEmptyTileImagePolicy}
  24729. will be used, with the expectation that the Bing Maps server will send a zero-length response for missing tiles.
  24730. To ensure that no tiles are discarded, construct and pass a {@link NeverTileDiscardPolicy} for this parameter.
  24731. */
  24732. type ConstructorOptions = {
  24733. url: Resource | string;
  24734. key: string;
  24735. tileProtocol?: string;
  24736. mapStyle?: BingMapsStyle;
  24737. culture?: string;
  24738. ellipsoid?: Ellipsoid;
  24739. tileDiscardPolicy?: TileDiscardPolicy;
  24740. };
  24741. }
  24742. /**
  24743. * Provides tiled imagery using the Bing Maps Imagery REST API.
  24744. * @example
  24745. * var bing = new Cesium.BingMapsImageryProvider({
  24746. url : 'https://dev.virtualearth.net',
  24747. key : 'get-yours-at-https://www.bingmapsportal.com/',
  24748. mapStyle : Cesium.BingMapsStyle.AERIAL
  24749. });
  24750. * @param options - Object describing initialization options
  24751. */
  24752. export class BingMapsImageryProvider {
  24753. constructor(options: BingMapsImageryProvider.ConstructorOptions);
  24754. /**
  24755. * The default alpha blending value of this provider, with 0.0 representing fully transparent and
  24756. 1.0 representing fully opaque.
  24757. */
  24758. defaultAlpha: number | undefined;
  24759. /**
  24760. * The default alpha blending value on the night side of the globe of this provider, with 0.0 representing fully transparent and
  24761. 1.0 representing fully opaque.
  24762. */
  24763. defaultNightAlpha: number | undefined;
  24764. /**
  24765. * The default alpha blending value on the day side of the globe of this provider, with 0.0 representing fully transparent and
  24766. 1.0 representing fully opaque.
  24767. */
  24768. defaultDayAlpha: number | undefined;
  24769. /**
  24770. * The default brightness of this provider. 1.0 uses the unmodified imagery color. Less than 1.0
  24771. makes the imagery darker while greater than 1.0 makes it brighter.
  24772. */
  24773. defaultBrightness: number | undefined;
  24774. /**
  24775. * The default contrast of this provider. 1.0 uses the unmodified imagery color. Less than 1.0 reduces
  24776. the contrast while greater than 1.0 increases it.
  24777. */
  24778. defaultContrast: number | undefined;
  24779. /**
  24780. * The default hue of this provider in radians. 0.0 uses the unmodified imagery color.
  24781. */
  24782. defaultHue: number | undefined;
  24783. /**
  24784. * The default saturation of this provider. 1.0 uses the unmodified imagery color. Less than 1.0 reduces the
  24785. saturation while greater than 1.0 increases it.
  24786. */
  24787. defaultSaturation: number | undefined;
  24788. /**
  24789. * The default gamma correction to apply to this provider. 1.0 uses the unmodified imagery color.
  24790. */
  24791. defaultGamma: number | undefined;
  24792. /**
  24793. * The default texture minification filter to apply to this provider.
  24794. */
  24795. defaultMinificationFilter: TextureMinificationFilter;
  24796. /**
  24797. * The default texture magnification filter to apply to this provider.
  24798. */
  24799. defaultMagnificationFilter: TextureMagnificationFilter;
  24800. /**
  24801. * Gets the name of the BingMaps server url hosting the imagery.
  24802. */
  24803. readonly url: string;
  24804. /**
  24805. * Gets the proxy used by this provider.
  24806. */
  24807. readonly proxy: Proxy;
  24808. /**
  24809. * Gets the Bing Maps key.
  24810. */
  24811. readonly key: string;
  24812. /**
  24813. * Gets the type of Bing Maps imagery to load.
  24814. */
  24815. readonly mapStyle: BingMapsStyle;
  24816. /**
  24817. * The culture to use when requesting Bing Maps imagery. Not
  24818. all cultures are supported. See {@link http://msdn.microsoft.com/en-us/library/hh441729.aspx}
  24819. for information on the supported cultures.
  24820. */
  24821. readonly culture: string;
  24822. /**
  24823. * Gets the width of each tile, in pixels. This function should
  24824. not be called before {@link BingMapsImageryProvider#ready} returns true.
  24825. */
  24826. readonly tileWidth: number;
  24827. /**
  24828. * Gets the height of each tile, in pixels. This function should
  24829. not be called before {@link BingMapsImageryProvider#ready} returns true.
  24830. */
  24831. readonly tileHeight: number;
  24832. /**
  24833. * Gets the maximum level-of-detail that can be requested. This function should
  24834. not be called before {@link BingMapsImageryProvider#ready} returns true.
  24835. */
  24836. readonly maximumLevel: number | undefined;
  24837. /**
  24838. * Gets the minimum level-of-detail that can be requested. This function should
  24839. not be called before {@link BingMapsImageryProvider#ready} returns true.
  24840. */
  24841. readonly minimumLevel: number;
  24842. /**
  24843. * Gets the tiling scheme used by this provider. This function should
  24844. not be called before {@link BingMapsImageryProvider#ready} returns true.
  24845. */
  24846. readonly tilingScheme: TilingScheme;
  24847. /**
  24848. * Gets the rectangle, in radians, of the imagery provided by this instance. This function should
  24849. not be called before {@link BingMapsImageryProvider#ready} returns true.
  24850. */
  24851. readonly rectangle: Rectangle;
  24852. /**
  24853. * Gets the tile discard policy. If not undefined, the discard policy is responsible
  24854. for filtering out "missing" tiles via its shouldDiscardImage function. If this function
  24855. returns undefined, no tiles are filtered. This function should
  24856. not be called before {@link BingMapsImageryProvider#ready} returns true.
  24857. */
  24858. readonly tileDiscardPolicy: TileDiscardPolicy;
  24859. /**
  24860. * Gets an event that is raised when the imagery provider encounters an asynchronous error. By subscribing
  24861. to the event, you will be notified of the error and can potentially recover from it. Event listeners
  24862. are passed an instance of {@link TileProviderError}.
  24863. */
  24864. readonly errorEvent: Event;
  24865. /**
  24866. * Gets a value indicating whether or not the provider is ready for use.
  24867. */
  24868. readonly ready: boolean;
  24869. /**
  24870. * Gets a promise that resolves to true when the provider is ready for use.
  24871. */
  24872. readonly readyPromise: Promise<boolean>;
  24873. /**
  24874. * Gets the credit to display when this imagery provider is active. Typically this is used to credit
  24875. the source of the imagery. This function should not be called before {@link BingMapsImageryProvider#ready} returns true.
  24876. */
  24877. readonly credit: Credit;
  24878. /**
  24879. * Gets a value indicating whether or not the images provided by this imagery provider
  24880. include an alpha channel. If this property is false, an alpha channel, if present, will
  24881. be ignored. If this property is true, any images without an alpha channel will be treated
  24882. as if their alpha is 1.0 everywhere. Setting this property to false reduces memory usage
  24883. and texture upload time.
  24884. */
  24885. readonly hasAlphaChannel: boolean;
  24886. /**
  24887. * Gets the credits to be displayed when a given tile is displayed.
  24888. * @param x - The tile X coordinate.
  24889. * @param y - The tile Y coordinate.
  24890. * @param level - The tile level;
  24891. * @returns The credits to be displayed when the tile is displayed.
  24892. */
  24893. getTileCredits(x: number, y: number, level: number): Credit[];
  24894. /**
  24895. * Requests the image for a given tile. This function should
  24896. not be called before {@link BingMapsImageryProvider#ready} returns true.
  24897. * @param x - The tile X coordinate.
  24898. * @param y - The tile Y coordinate.
  24899. * @param level - The tile level.
  24900. * @param [request] - The request object. Intended for internal use only.
  24901. * @returns A promise for the image that will resolve when the image is available, or
  24902. undefined if there are too many active requests to the server, and the request
  24903. should be retried later. The resolved image may be either an
  24904. Image or a Canvas DOM object.
  24905. */
  24906. requestImage(x: number, y: number, level: number, request?: Request): Promise<HTMLImageElement | HTMLCanvasElement> | undefined;
  24907. /**
  24908. * Picking features is not currently supported by this imagery provider, so this function simply returns
  24909. undefined.
  24910. * @param x - The tile X coordinate.
  24911. * @param y - The tile Y coordinate.
  24912. * @param level - The tile level.
  24913. * @param longitude - The longitude at which to pick features.
  24914. * @param latitude - The latitude at which to pick features.
  24915. * @returns A promise for the picked features that will resolve when the asynchronous
  24916. picking completes. The resolved value is an array of {@link ImageryLayerFeatureInfo}
  24917. instances. The array may be empty if no features are found at the given location.
  24918. It may also be undefined if picking is not supported.
  24919. */
  24920. pickFeatures(x: number, y: number, level: number, longitude: number, latitude: number): Promise<ImageryLayerFeatureInfo[]> | undefined;
  24921. /**
  24922. * Converts a tiles (x, y, level) position into a quadkey used to request an image
  24923. from a Bing Maps server.
  24924. * @param x - The tile's x coordinate.
  24925. * @param y - The tile's y coordinate.
  24926. * @param level - The tile's zoom level.
  24927. */
  24928. static tileXYToQuadKey(x: number, y: number, level: number): void;
  24929. /**
  24930. * Converts a tile's quadkey used to request an image from a Bing Maps server into the
  24931. (x, y, level) position.
  24932. * @param quadkey - The tile's quad key
  24933. */
  24934. static quadKeyToTileXY(quadkey: string): void;
  24935. /**
  24936. * Gets or sets the URL to the Bing logo for display in the credit.
  24937. */
  24938. static logoUrl: string;
  24939. }
  24940. /**
  24941. * The types of imagery provided by Bing Maps.
  24942. */
  24943. export enum BingMapsStyle {
  24944. /**
  24945. * Aerial imagery.
  24946. */
  24947. AERIAL = "Aerial",
  24948. /**
  24949. * Aerial imagery with a road overlay.
  24950. */
  24951. AERIAL_WITH_LABELS = "AerialWithLabels",
  24952. /**
  24953. * Aerial imagery with a road overlay.
  24954. */
  24955. AERIAL_WITH_LABELS_ON_DEMAND = "AerialWithLabelsOnDemand",
  24956. /**
  24957. * Roads without additional imagery.
  24958. */
  24959. ROAD = "Road",
  24960. /**
  24961. * Roads without additional imagery.
  24962. */
  24963. ROAD_ON_DEMAND = "RoadOnDemand",
  24964. /**
  24965. * A dark version of the road maps.
  24966. */
  24967. CANVAS_DARK = "CanvasDark",
  24968. /**
  24969. * A lighter version of the road maps.
  24970. */
  24971. CANVAS_LIGHT = "CanvasLight",
  24972. /**
  24973. * A grayscale version of the road maps.
  24974. */
  24975. CANVAS_GRAY = "CanvasGray",
  24976. /**
  24977. * Ordnance Survey imagery. This imagery is visible only for the London, UK area.
  24978. */
  24979. ORDNANCE_SURVEY = "OrdnanceSurvey",
  24980. /**
  24981. * Collins Bart imagery.
  24982. */
  24983. COLLINS_BART = "CollinsBart"
  24984. }
  24985. /**
  24986. * Determines how two pixels' values are combined.
  24987. */
  24988. export enum BlendEquation {
  24989. /**
  24990. * Pixel values are added componentwise. This is used in additive blending for translucency.
  24991. */
  24992. ADD = WebGLConstants.FUNC_ADD,
  24993. /**
  24994. * Pixel values are subtracted componentwise (source - destination). This is used in alpha blending for translucency.
  24995. */
  24996. SUBTRACT = WebGLConstants.FUNC_SUBTRACT,
  24997. /**
  24998. * Pixel values are subtracted componentwise (destination - source).
  24999. */
  25000. REVERSE_SUBTRACT = WebGLConstants.FUNC_REVERSE_SUBTRACT,
  25001. /**
  25002. * Pixel values are given to the minimum function (min(source, destination)).
  25003. This equation operates on each pixel color component.
  25004. */
  25005. MIN = WebGLConstants.MIN,
  25006. /**
  25007. * Pixel values are given to the maximum function (max(source, destination)).
  25008. This equation operates on each pixel color component.
  25009. */
  25010. MAX = WebGLConstants.MAX
  25011. }
  25012. /**
  25013. * Determines how blending factors are computed.
  25014. */
  25015. export enum BlendFunction {
  25016. /**
  25017. * The blend factor is zero.
  25018. */
  25019. ZERO = WebGLConstants.ZERO,
  25020. /**
  25021. * The blend factor is one.
  25022. */
  25023. ONE = WebGLConstants.ONE,
  25024. /**
  25025. * The blend factor is the source color.
  25026. */
  25027. SOURCE_COLOR = WebGLConstants.SRC_COLOR,
  25028. /**
  25029. * The blend factor is one minus the source color.
  25030. */
  25031. ONE_MINUS_SOURCE_COLOR = WebGLConstants.ONE_MINUS_SRC_COLOR,
  25032. /**
  25033. * The blend factor is the destination color.
  25034. */
  25035. DESTINATION_COLOR = WebGLConstants.DST_COLOR,
  25036. /**
  25037. * The blend factor is one minus the destination color.
  25038. */
  25039. ONE_MINUS_DESTINATION_COLOR = WebGLConstants.ONE_MINUS_DST_COLOR,
  25040. /**
  25041. * The blend factor is the source alpha.
  25042. */
  25043. SOURCE_ALPHA = WebGLConstants.SRC_ALPHA,
  25044. /**
  25045. * The blend factor is one minus the source alpha.
  25046. */
  25047. ONE_MINUS_SOURCE_ALPHA = WebGLConstants.ONE_MINUS_SRC_ALPHA,
  25048. /**
  25049. * The blend factor is the destination alpha.
  25050. */
  25051. DESTINATION_ALPHA = WebGLConstants.DST_ALPHA,
  25052. /**
  25053. * The blend factor is one minus the destination alpha.
  25054. */
  25055. ONE_MINUS_DESTINATION_ALPHA = WebGLConstants.ONE_MINUS_DST_ALPHA,
  25056. /**
  25057. * The blend factor is the constant color.
  25058. */
  25059. CONSTANT_COLOR = WebGLConstants.CONSTANT_COLOR,
  25060. /**
  25061. * The blend factor is one minus the constant color.
  25062. */
  25063. ONE_MINUS_CONSTANT_COLOR = WebGLConstants.ONE_MINUS_CONSTANT_COLOR,
  25064. /**
  25065. * The blend factor is the constant alpha.
  25066. */
  25067. CONSTANT_ALPHA = WebGLConstants.CONSTANT_ALPHA,
  25068. /**
  25069. * The blend factor is one minus the constant alpha.
  25070. */
  25071. ONE_MINUS_CONSTANT_ALPHA = WebGLConstants.ONE_MINUS_CONSTANT_ALPHA,
  25072. /**
  25073. * The blend factor is the saturated source alpha.
  25074. */
  25075. SOURCE_ALPHA_SATURATE = WebGLConstants.SRC_ALPHA_SATURATE
  25076. }
  25077. /**
  25078. * The blending state combines {@link BlendEquation} and {@link BlendFunction} and the
  25079. <code>enabled</code> flag to define the full blending state for combining source and
  25080. destination fragments when rendering.
  25081. <p>
  25082. This is a helper when using custom render states with {@link Appearance#renderState}.
  25083. </p>
  25084. */
  25085. export namespace BlendingState {
  25086. /**
  25087. * Blending is disabled.
  25088. */
  25089. const DISABLED: any;
  25090. /**
  25091. * Blending is enabled using alpha blending, <code>source(source.alpha) + destination(1 - source.alpha)</code>.
  25092. */
  25093. const ALPHA_BLEND: any;
  25094. /**
  25095. * Blending is enabled using alpha blending with premultiplied alpha, <code>source + destination(1 - source.alpha)</code>.
  25096. */
  25097. const PRE_MULTIPLIED_ALPHA_BLEND: any;
  25098. /**
  25099. * Blending is enabled using additive blending, <code>source(source.alpha) + destination</code>.
  25100. */
  25101. const ADDITIVE_BLEND: any;
  25102. }
  25103. /**
  25104. * Determines how opaque and translucent parts of billboards, points, and labels are blended with the scene.
  25105. */
  25106. export enum BlendOption {
  25107. /**
  25108. * The billboards, points, or labels in the collection are completely opaque.
  25109. */
  25110. OPAQUE = 0,
  25111. /**
  25112. * The billboards, points, or labels in the collection are completely translucent.
  25113. */
  25114. TRANSLUCENT = 1,
  25115. /**
  25116. * The billboards, points, or labels in the collection are both opaque and translucent.
  25117. */
  25118. OPAQUE_AND_TRANSLUCENT = 2
  25119. }
  25120. /**
  25121. * A ParticleEmitter that emits particles within a box.
  25122. Particles will be positioned randomly within the box and have initial velocities emanating from the center of the box.
  25123. * @param dimensions - The width, height and depth dimensions of the box.
  25124. */
  25125. export class BoxEmitter {
  25126. constructor(dimensions: Cartesian3);
  25127. /**
  25128. * The width, height and depth dimensions of the box in meters.
  25129. */
  25130. dimensions: Cartesian3;
  25131. }
  25132. /**
  25133. * The camera is defined by a position, orientation, and view frustum.
  25134. <br /><br />
  25135. The orientation forms an orthonormal basis with a view, up and right = view x up unit vectors.
  25136. <br /><br />
  25137. The viewing frustum is defined by 6 planes.
  25138. Each plane is represented by a {@link Cartesian4} object, where the x, y, and z components
  25139. define the unit vector normal to the plane, and the w component is the distance of the
  25140. plane from the origin/camera position.
  25141. * @example
  25142. * // Create a camera looking down the negative z-axis, positioned at the origin,
  25143. // with a field of view of 60 degrees, and 1:1 aspect ratio.
  25144. var camera = new Cesium.Camera(scene);
  25145. camera.position = new Cesium.Cartesian3();
  25146. camera.direction = Cesium.Cartesian3.negate(Cesium.Cartesian3.UNIT_Z, new Cesium.Cartesian3());
  25147. camera.up = Cesium.Cartesian3.clone(Cesium.Cartesian3.UNIT_Y);
  25148. camera.frustum.fov = Cesium.Math.PI_OVER_THREE;
  25149. camera.frustum.near = 1.0;
  25150. camera.frustum.far = 2.0;
  25151. * @param scene - The scene.
  25152. */
  25153. export class Camera {
  25154. constructor(scene: Scene);
  25155. /**
  25156. * The position of the camera.
  25157. */
  25158. position: Cartesian3;
  25159. /**
  25160. * The view direction of the camera.
  25161. */
  25162. direction: Cartesian3;
  25163. /**
  25164. * The up direction of the camera.
  25165. */
  25166. up: Cartesian3;
  25167. /**
  25168. * The right direction of the camera.
  25169. */
  25170. right: Cartesian3;
  25171. /**
  25172. * The region of space in view.
  25173. */
  25174. frustum: PerspectiveFrustum | PerspectiveOffCenterFrustum | OrthographicFrustum;
  25175. /**
  25176. * The default amount to move the camera when an argument is not
  25177. provided to the move methods.
  25178. */
  25179. defaultMoveAmount: number;
  25180. /**
  25181. * The default amount to rotate the camera when an argument is not
  25182. provided to the look methods.
  25183. */
  25184. defaultLookAmount: number;
  25185. /**
  25186. * The default amount to rotate the camera when an argument is not
  25187. provided to the rotate methods.
  25188. */
  25189. defaultRotateAmount: number;
  25190. /**
  25191. * The default amount to move the camera when an argument is not
  25192. provided to the zoom methods.
  25193. */
  25194. defaultZoomAmount: number;
  25195. /**
  25196. * If set, the camera will not be able to rotate past this axis in either direction.
  25197. */
  25198. constrainedAxis: Cartesian3;
  25199. /**
  25200. * The factor multiplied by the the map size used to determine where to clamp the camera position
  25201. when zooming out from the surface. The default is 1.5. Only valid for 2D and the map is rotatable.
  25202. */
  25203. maximumZoomFactor: number;
  25204. /**
  25205. * 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.
  25206. */
  25207. percentageChanged: number;
  25208. /**
  25209. * The default rectangle the camera will view on creation.
  25210. */
  25211. static DEFAULT_VIEW_RECTANGLE: Rectangle;
  25212. /**
  25213. * A scalar to multiply to the camera position and add it back after setting the camera to view the rectangle.
  25214. A value of zero means the camera will view the entire {@link Camera#DEFAULT_VIEW_RECTANGLE}, a value greater than zero
  25215. will move it further away from the extent, and a value less than zero will move it close to the extent.
  25216. */
  25217. static DEFAULT_VIEW_FACTOR: number;
  25218. /**
  25219. * The default heading/pitch/range that is used when the camera flies to a location that contains a bounding sphere.
  25220. */
  25221. static DEFAULT_OFFSET: HeadingPitchRange;
  25222. /**
  25223. * Gets the camera's reference frame. The inverse of this transformation is appended to the view matrix.
  25224. */
  25225. readonly transform: Matrix4;
  25226. /**
  25227. * Gets the inverse camera transform.
  25228. */
  25229. readonly inverseTransform: Matrix4;
  25230. /**
  25231. * Gets the view matrix.
  25232. */
  25233. readonly viewMatrix: Matrix4;
  25234. /**
  25235. * Gets the inverse view matrix.
  25236. */
  25237. readonly inverseViewMatrix: Matrix4;
  25238. /**
  25239. * Gets the {@link Cartographic} position of the camera, with longitude and latitude
  25240. expressed in radians and height in meters. In 2D and Columbus View, it is possible
  25241. for the returned longitude and latitude to be outside the range of valid longitudes
  25242. and latitudes when the camera is outside the map.
  25243. */
  25244. readonly positionCartographic: Cartographic;
  25245. /**
  25246. * Gets the position of the camera in world coordinates.
  25247. */
  25248. readonly positionWC: Cartesian3;
  25249. /**
  25250. * Gets the view direction of the camera in world coordinates.
  25251. */
  25252. readonly directionWC: Cartesian3;
  25253. /**
  25254. * Gets the up direction of the camera in world coordinates.
  25255. */
  25256. readonly upWC: Cartesian3;
  25257. /**
  25258. * Gets the right direction of the camera in world coordinates.
  25259. */
  25260. readonly rightWC: Cartesian3;
  25261. /**
  25262. * Gets the camera heading in radians.
  25263. */
  25264. readonly heading: number;
  25265. /**
  25266. * Gets the camera pitch in radians.
  25267. */
  25268. readonly pitch: number;
  25269. /**
  25270. * Gets the camera roll in radians.
  25271. */
  25272. readonly roll: number;
  25273. /**
  25274. * Gets the event that will be raised at when the camera starts to move.
  25275. */
  25276. readonly moveStart: Event;
  25277. /**
  25278. * Gets the event that will be raised when the camera has stopped moving.
  25279. */
  25280. readonly moveEnd: Event;
  25281. /**
  25282. * Gets the event that will be raised when the camera has changed by <code>percentageChanged</code>.
  25283. */
  25284. readonly changed: Event;
  25285. /**
  25286. * Sets the camera position, orientation and transform.
  25287. * @example
  25288. * // 1. Set position with a top-down view
  25289. viewer.camera.setView({
  25290. destination : Cesium.Cartesian3.fromDegrees(-117.16, 32.71, 15000.0)
  25291. });
  25292. // 2 Set view with heading, pitch and roll
  25293. viewer.camera.setView({
  25294. destination : cartesianPosition,
  25295. orientation: {
  25296. heading : Cesium.Math.toRadians(90.0), // east, default value is 0.0 (north)
  25297. pitch : Cesium.Math.toRadians(-90), // default value (looking down)
  25298. roll : 0.0 // default value
  25299. }
  25300. });
  25301. // 3. Change heading, pitch and roll with the camera position remaining the same.
  25302. viewer.camera.setView({
  25303. orientation: {
  25304. heading : Cesium.Math.toRadians(90.0), // east, default value is 0.0 (north)
  25305. pitch : Cesium.Math.toRadians(-90), // default value (looking down)
  25306. roll : 0.0 // default value
  25307. }
  25308. });
  25309. // 4. View rectangle with a top-down view
  25310. viewer.camera.setView({
  25311. destination : Cesium.Rectangle.fromDegrees(west, south, east, north)
  25312. });
  25313. // 5. Set position with an orientation using unit vectors.
  25314. viewer.camera.setView({
  25315. destination : Cesium.Cartesian3.fromDegrees(-122.19, 46.25, 5000.0),
  25316. orientation : {
  25317. direction : new Cesium.Cartesian3(-0.04231243104240401, -0.20123236049443421, -0.97862924300734),
  25318. up : new Cesium.Cartesian3(-0.47934589305293746, -0.8553216253114552, 0.1966022179118339)
  25319. }
  25320. });
  25321. * @param options - Object with the following properties:
  25322. * @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.
  25323. * @param [options.orientation] - An object that contains either direction and up properties or heading, pitch and roll properties. By default, the direction will point
  25324. 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
  25325. y direction in Columbus view. Orientation is not used in 2D when in infinite scrolling mode.
  25326. * @param [options.endTransform] - Transform matrix representing the reference frame of the camera.
  25327. * @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>.
  25328. */
  25329. setView(options: {
  25330. destination?: Cartesian3 | Rectangle;
  25331. orientation?: any;
  25332. endTransform?: Matrix4;
  25333. convert?: boolean;
  25334. }): void;
  25335. /**
  25336. * Fly the camera to the home view. Use {@link Camera#.DEFAULT_VIEW_RECTANGLE} to set
  25337. the default view for the 3D scene. The home view for 2D and columbus view shows the
  25338. entire map.
  25339. * @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}
  25340. */
  25341. flyHome(duration?: number): void;
  25342. /**
  25343. * Transform a vector or point from world coordinates to the camera's reference frame.
  25344. * @param cartesian - The vector or point to transform.
  25345. * @param [result] - The object onto which to store the result.
  25346. * @returns The transformed vector or point.
  25347. */
  25348. worldToCameraCoordinates(cartesian: Cartesian4, result?: Cartesian4): Cartesian4;
  25349. /**
  25350. * Transform a point from world coordinates to the camera's reference frame.
  25351. * @param cartesian - The point to transform.
  25352. * @param [result] - The object onto which to store the result.
  25353. * @returns The transformed point.
  25354. */
  25355. worldToCameraCoordinatesPoint(cartesian: Cartesian3, result?: Cartesian3): Cartesian3;
  25356. /**
  25357. * Transform a vector from world coordinates to the camera's reference frame.
  25358. * @param cartesian - The vector to transform.
  25359. * @param [result] - The object onto which to store the result.
  25360. * @returns The transformed vector.
  25361. */
  25362. worldToCameraCoordinatesVector(cartesian: Cartesian3, result?: Cartesian3): Cartesian3;
  25363. /**
  25364. * Transform a vector or point from the camera's reference frame to world coordinates.
  25365. * @param cartesian - The vector or point to transform.
  25366. * @param [result] - The object onto which to store the result.
  25367. * @returns The transformed vector or point.
  25368. */
  25369. cameraToWorldCoordinates(cartesian: Cartesian4, result?: Cartesian4): Cartesian4;
  25370. /**
  25371. * Transform a point from the camera's reference frame to world coordinates.
  25372. * @param cartesian - The point to transform.
  25373. * @param [result] - The object onto which to store the result.
  25374. * @returns The transformed point.
  25375. */
  25376. cameraToWorldCoordinatesPoint(cartesian: Cartesian3, result?: Cartesian3): Cartesian3;
  25377. /**
  25378. * Transform a vector from the camera's reference frame to world coordinates.
  25379. * @param cartesian - The vector to transform.
  25380. * @param [result] - The object onto which to store the result.
  25381. * @returns The transformed vector.
  25382. */
  25383. cameraToWorldCoordinatesVector(cartesian: Cartesian3, result?: Cartesian3): Cartesian3;
  25384. /**
  25385. * Translates the camera's position by <code>amount</code> along <code>direction</code>.
  25386. * @param direction - The direction to move.
  25387. * @param [amount] - The amount, in meters, to move. Defaults to <code>defaultMoveAmount</code>.
  25388. */
  25389. move(direction: Cartesian3, amount?: number): void;
  25390. /**
  25391. * Translates the camera's position by <code>amount</code> along the camera's view vector.
  25392. When in 2D mode, this will zoom in the camera instead of translating the camera's position.
  25393. * @param [amount] - The amount, in meters, to move. Defaults to <code>defaultMoveAmount</code>.
  25394. */
  25395. moveForward(amount?: number): void;
  25396. /**
  25397. * Translates the camera's position by <code>amount</code> along the opposite direction
  25398. of the camera's view vector.
  25399. When in 2D mode, this will zoom out the camera instead of translating the camera's position.
  25400. * @param [amount] - The amount, in meters, to move. Defaults to <code>defaultMoveAmount</code>.
  25401. */
  25402. moveBackward(amount?: number): void;
  25403. /**
  25404. * Translates the camera's position by <code>amount</code> along the camera's up vector.
  25405. * @param [amount] - The amount, in meters, to move. Defaults to <code>defaultMoveAmount</code>.
  25406. */
  25407. moveUp(amount?: number): void;
  25408. /**
  25409. * Translates the camera's position by <code>amount</code> along the opposite direction
  25410. of the camera's up vector.
  25411. * @param [amount] - The amount, in meters, to move. Defaults to <code>defaultMoveAmount</code>.
  25412. */
  25413. moveDown(amount?: number): void;
  25414. /**
  25415. * Translates the camera's position by <code>amount</code> along the camera's right vector.
  25416. * @param [amount] - The amount, in meters, to move. Defaults to <code>defaultMoveAmount</code>.
  25417. */
  25418. moveRight(amount?: number): void;
  25419. /**
  25420. * Translates the camera's position by <code>amount</code> along the opposite direction
  25421. of the camera's right vector.
  25422. * @param [amount] - The amount, in meters, to move. Defaults to <code>defaultMoveAmount</code>.
  25423. */
  25424. moveLeft(amount?: number): void;
  25425. /**
  25426. * Rotates the camera around its up vector by amount, in radians, in the opposite direction
  25427. of its right vector if not in 2D mode.
  25428. * @param [amount] - The amount, in radians, to rotate by. Defaults to <code>defaultLookAmount</code>.
  25429. */
  25430. lookLeft(amount?: number): void;
  25431. /**
  25432. * Rotates the camera around its up vector by amount, in radians, in the direction
  25433. of its right vector if not in 2D mode.
  25434. * @param [amount] - The amount, in radians, to rotate by. Defaults to <code>defaultLookAmount</code>.
  25435. */
  25436. lookRight(amount?: number): void;
  25437. /**
  25438. * Rotates the camera around its right vector by amount, in radians, in the direction
  25439. of its up vector if not in 2D mode.
  25440. * @param [amount] - The amount, in radians, to rotate by. Defaults to <code>defaultLookAmount</code>.
  25441. */
  25442. lookUp(amount?: number): void;
  25443. /**
  25444. * Rotates the camera around its right vector by amount, in radians, in the opposite direction
  25445. of its up vector if not in 2D mode.
  25446. * @param [amount] - The amount, in radians, to rotate by. Defaults to <code>defaultLookAmount</code>.
  25447. */
  25448. lookDown(amount?: number): void;
  25449. /**
  25450. * Rotate each of the camera's orientation vectors around <code>axis</code> by <code>angle</code>
  25451. * @param axis - The axis to rotate around.
  25452. * @param [angle] - The angle, in radians, to rotate by. Defaults to <code>defaultLookAmount</code>.
  25453. */
  25454. look(axis: Cartesian3, angle?: number): void;
  25455. /**
  25456. * Rotate the camera counter-clockwise around its direction vector by amount, in radians.
  25457. * @param [amount] - The amount, in radians, to rotate by. Defaults to <code>defaultLookAmount</code>.
  25458. */
  25459. twistLeft(amount?: number): void;
  25460. /**
  25461. * Rotate the camera clockwise around its direction vector by amount, in radians.
  25462. * @param [amount] - The amount, in radians, to rotate by. Defaults to <code>defaultLookAmount</code>.
  25463. */
  25464. twistRight(amount?: number): void;
  25465. /**
  25466. * Rotates the camera around <code>axis</code> by <code>angle</code>. The distance
  25467. of the camera's position to the center of the camera's reference frame remains the same.
  25468. * @param axis - The axis to rotate around given in world coordinates.
  25469. * @param [angle] - The angle, in radians, to rotate by. Defaults to <code>defaultRotateAmount</code>.
  25470. */
  25471. rotate(axis: Cartesian3, angle?: number): void;
  25472. /**
  25473. * Rotates the camera around the center of the camera's reference frame by angle downwards.
  25474. * @param [angle] - The angle, in radians, to rotate by. Defaults to <code>defaultRotateAmount</code>.
  25475. */
  25476. rotateDown(angle?: number): void;
  25477. /**
  25478. * Rotates the camera around the center of the camera's reference frame by angle upwards.
  25479. * @param [angle] - The angle, in radians, to rotate by. Defaults to <code>defaultRotateAmount</code>.
  25480. */
  25481. rotateUp(angle?: number): void;
  25482. /**
  25483. * Rotates the camera around the center of the camera's reference frame by angle to the right.
  25484. * @param [angle] - The angle, in radians, to rotate by. Defaults to <code>defaultRotateAmount</code>.
  25485. */
  25486. rotateRight(angle?: number): void;
  25487. /**
  25488. * Rotates the camera around the center of the camera's reference frame by angle to the left.
  25489. * @param [angle] - The angle, in radians, to rotate by. Defaults to <code>defaultRotateAmount</code>.
  25490. */
  25491. rotateLeft(angle?: number): void;
  25492. /**
  25493. * Zooms <code>amount</code> along the camera's view vector.
  25494. * @param [amount] - The amount to move. Defaults to <code>defaultZoomAmount</code>.
  25495. */
  25496. zoomIn(amount?: number): void;
  25497. /**
  25498. * Zooms <code>amount</code> along the opposite direction of
  25499. the camera's view vector.
  25500. * @param [amount] - The amount to move. Defaults to <code>defaultZoomAmount</code>.
  25501. */
  25502. zoomOut(amount?: number): void;
  25503. /**
  25504. * Gets the magnitude of the camera position. In 3D, this is the vector magnitude. In 2D and
  25505. Columbus view, this is the distance to the map.
  25506. * @returns The magnitude of the position.
  25507. */
  25508. getMagnitude(): number;
  25509. /**
  25510. * Sets the camera position and orientation using a target and offset. The target must be given in
  25511. 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.
  25512. 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
  25513. is heading/pitch/range, then the heading and the pitch angles are defined in the reference frame defined by the transformation matrix.
  25514. The heading is the angle from y axis and increasing towards the x axis. Pitch is the rotation from the xy-plane. Positive pitch
  25515. angles are below the plane. Negative pitch angles are above the plane. The range is the distance from the center.
  25516. In 2D, there must be a top down view. The camera will be placed above the target looking down. The height above the
  25517. target will be the magnitude of the offset. The heading will be determined from the offset. If the heading cannot be
  25518. determined from the offset, the heading will be north.
  25519. * @example
  25520. * // 1. Using a cartesian offset
  25521. var center = Cesium.Cartesian3.fromDegrees(-98.0, 40.0);
  25522. viewer.camera.lookAt(center, new Cesium.Cartesian3(0.0, -4790000.0, 3930000.0));
  25523. // 2. Using a HeadingPitchRange offset
  25524. var center = Cesium.Cartesian3.fromDegrees(-72.0, 40.0);
  25525. var heading = Cesium.Math.toRadians(50.0);
  25526. var pitch = Cesium.Math.toRadians(-20.0);
  25527. var range = 5000.0;
  25528. viewer.camera.lookAt(center, new Cesium.HeadingPitchRange(heading, pitch, range));
  25529. * @param target - The target position in world coordinates.
  25530. * @param offset - The offset from the target in the local east-north-up reference frame centered at the target.
  25531. */
  25532. lookAt(target: Cartesian3, offset: Cartesian3 | HeadingPitchRange): void;
  25533. /**
  25534. * Sets the camera position and orientation using a target and transformation matrix. The offset can be either a cartesian or heading/pitch/range.
  25535. 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
  25536. is heading/pitch/range, then the heading and the pitch angles are defined in the reference frame defined by the transformation matrix.
  25537. The heading is the angle from y axis and increasing towards the x axis. Pitch is the rotation from the xy-plane. Positive pitch
  25538. angles are below the plane. Negative pitch angles are above the plane. The range is the distance from the center.
  25539. 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
  25540. target will be the magnitude of the offset. The heading will be determined from the offset. If the heading cannot be
  25541. determined from the offset, the heading will be north.
  25542. * @example
  25543. * // 1. Using a cartesian offset
  25544. var transform = Cesium.Transforms.eastNorthUpToFixedFrame(Cesium.Cartesian3.fromDegrees(-98.0, 40.0));
  25545. viewer.camera.lookAtTransform(transform, new Cesium.Cartesian3(0.0, -4790000.0, 3930000.0));
  25546. // 2. Using a HeadingPitchRange offset
  25547. var transform = Cesium.Transforms.eastNorthUpToFixedFrame(Cesium.Cartesian3.fromDegrees(-72.0, 40.0));
  25548. var heading = Cesium.Math.toRadians(50.0);
  25549. var pitch = Cesium.Math.toRadians(-20.0);
  25550. var range = 5000.0;
  25551. viewer.camera.lookAtTransform(transform, new Cesium.HeadingPitchRange(heading, pitch, range));
  25552. * @param transform - The transformation matrix defining the reference frame.
  25553. * @param [offset] - The offset from the target in a reference frame centered at the target.
  25554. */
  25555. lookAtTransform(transform: Matrix4, offset?: Cartesian3 | HeadingPitchRange): void;
  25556. /**
  25557. * Get the camera position needed to view a rectangle on an ellipsoid or map
  25558. * @param rectangle - The rectangle to view.
  25559. * @param [result] - The camera position needed to view the rectangle
  25560. * @returns The camera position needed to view the rectangle
  25561. */
  25562. getRectangleCameraCoordinates(rectangle: Rectangle, result?: Cartesian3): Cartesian3;
  25563. /**
  25564. * Pick an ellipsoid or map.
  25565. * @example
  25566. * var canvas = viewer.scene.canvas;
  25567. var center = new Cesium.Cartesian2(canvas.clientWidth / 2.0, canvas.clientHeight / 2.0);
  25568. var ellipsoid = viewer.scene.globe.ellipsoid;
  25569. var result = viewer.camera.pickEllipsoid(center, ellipsoid);
  25570. * @param windowPosition - The x and y coordinates of a pixel.
  25571. * @param [ellipsoid = Ellipsoid.WGS84] - The ellipsoid to pick.
  25572. * @param [result] - The object onto which to store the result.
  25573. * @returns If the ellipsoid or map was picked,
  25574. returns the point on the surface of the ellipsoid or map in world
  25575. coordinates. If the ellipsoid or map was not picked, returns undefined.
  25576. */
  25577. pickEllipsoid(windowPosition: Cartesian2, ellipsoid?: Ellipsoid, result?: Cartesian3): Cartesian3 | undefined;
  25578. /**
  25579. * Create a ray from the camera position through the pixel at <code>windowPosition</code>
  25580. in world coordinates.
  25581. * @param windowPosition - The x and y coordinates of a pixel.
  25582. * @param [result] - The object onto which to store the result.
  25583. * @returns Returns the {@link Cartesian3} position and direction of the ray.
  25584. */
  25585. getPickRay(windowPosition: Cartesian2, result?: Ray): Ray;
  25586. /**
  25587. * Return the distance from the camera to the front of the bounding sphere.
  25588. * @param boundingSphere - The bounding sphere in world coordinates.
  25589. * @returns The distance to the bounding sphere.
  25590. */
  25591. distanceToBoundingSphere(boundingSphere: BoundingSphere): number;
  25592. /**
  25593. * Return the pixel size in meters.
  25594. * @param boundingSphere - The bounding sphere in world coordinates.
  25595. * @param drawingBufferWidth - The drawing buffer width.
  25596. * @param drawingBufferHeight - The drawing buffer height.
  25597. * @returns The pixel size in meters.
  25598. */
  25599. getPixelSize(boundingSphere: BoundingSphere, drawingBufferWidth: number, drawingBufferHeight: number): number;
  25600. /**
  25601. * Cancels the current camera flight and leaves the camera at its current location.
  25602. If no flight is in progress, this this function does nothing.
  25603. */
  25604. cancelFlight(): void;
  25605. /**
  25606. * Completes the current camera flight and moves the camera immediately to its final destination.
  25607. If no flight is in progress, this this function does nothing.
  25608. */
  25609. completeFlight(): void;
  25610. /**
  25611. * Flies the camera from its current position to a new position.
  25612. * @example
  25613. * // 1. Fly to a position with a top-down view
  25614. viewer.camera.flyTo({
  25615. destination : Cesium.Cartesian3.fromDegrees(-117.16, 32.71, 15000.0)
  25616. });
  25617. // 2. Fly to a Rectangle with a top-down view
  25618. viewer.camera.flyTo({
  25619. destination : Cesium.Rectangle.fromDegrees(west, south, east, north)
  25620. });
  25621. // 3. Fly to a position with an orientation using unit vectors.
  25622. viewer.camera.flyTo({
  25623. destination : Cesium.Cartesian3.fromDegrees(-122.19, 46.25, 5000.0),
  25624. orientation : {
  25625. direction : new Cesium.Cartesian3(-0.04231243104240401, -0.20123236049443421, -0.97862924300734),
  25626. up : new Cesium.Cartesian3(-0.47934589305293746, -0.8553216253114552, 0.1966022179118339)
  25627. }
  25628. });
  25629. // 4. Fly to a position with an orientation using heading, pitch and roll.
  25630. viewer.camera.flyTo({
  25631. destination : Cesium.Cartesian3.fromDegrees(-122.19, 46.25, 5000.0),
  25632. orientation : {
  25633. heading : Cesium.Math.toRadians(175.0),
  25634. pitch : Cesium.Math.toRadians(-35.0),
  25635. roll : 0.0
  25636. }
  25637. });
  25638. * @param options - Object with the following properties:
  25639. * @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.
  25640. * @param [options.orientation] - An object that contains either direction and up properties or heading, pitch and roll properties. By default, the direction will point
  25641. 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
  25642. y direction in Columbus view. Orientation is not used in 2D when in infinite scrolling mode.
  25643. * @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.
  25644. * @param [options.complete] - The function to execute when the flight is complete.
  25645. * @param [options.cancel] - The function to execute if the flight is cancelled.
  25646. * @param [options.endTransform] - Transform matrix representing the reference frame the camera will be in when the flight is completed.
  25647. * @param [options.maximumHeight] - The maximum height at the peak of the flight.
  25648. * @param [options.pitchAdjustHeight] - If camera flyes higher than that value, adjust pitch duiring the flight to look down, and keep Earth in viewport.
  25649. * @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.
  25650. * @param [options.flyOverLongitudeWeight] - Fly over the lon specifyed via flyOverLongitude only if that way is not longer than short way times flyOverLongitudeWeight.
  25651. * @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>.
  25652. * @param [options.easingFunction] - Controls how the time is interpolated over the duration of the flight.
  25653. */
  25654. flyTo(options: {
  25655. destination: Cartesian3 | Rectangle;
  25656. orientation?: any;
  25657. duration?: number;
  25658. complete?: Camera.FlightCompleteCallback;
  25659. cancel?: Camera.FlightCancelledCallback;
  25660. endTransform?: Matrix4;
  25661. maximumHeight?: number;
  25662. pitchAdjustHeight?: number;
  25663. flyOverLongitude?: number;
  25664. flyOverLongitudeWeight?: number;
  25665. convert?: boolean;
  25666. easingFunction?: EasingFunction.Callback;
  25667. }): void;
  25668. /**
  25669. * Sets the camera so that the current view contains the provided bounding sphere.
  25670. <p>The offset is heading/pitch/range in the local east-north-up reference frame centered at the center of the bounding sphere.
  25671. The heading and the pitch angles are defined in the local east-north-up reference frame.
  25672. The heading is the angle from y axis and increasing towards the x axis. Pitch is the rotation from the xy-plane. Positive pitch
  25673. angles are below the plane. Negative pitch angles are above the plane. The range is the distance from the center. If the range is
  25674. zero, a range will be computed such that the whole bounding sphere is visible.</p>
  25675. <p>In 2D, there must be a top down view. The camera will be placed above the target looking down. The height above the
  25676. target will be the range. The heading will be determined from the offset. If the heading cannot be
  25677. determined from the offset, the heading will be north.</p>
  25678. * @param boundingSphere - The bounding sphere to view, in world coordinates.
  25679. * @param [offset] - The offset from the target in the local east-north-up reference frame centered at the target.
  25680. */
  25681. viewBoundingSphere(boundingSphere: BoundingSphere, offset?: HeadingPitchRange): void;
  25682. /**
  25683. * Flies the camera to a location where the current view contains the provided bounding sphere.
  25684. <p> The offset is heading/pitch/range in the local east-north-up reference frame centered at the center of the bounding sphere.
  25685. The heading and the pitch angles are defined in the local east-north-up reference frame.
  25686. The heading is the angle from y axis and increasing towards the x axis. Pitch is the rotation from the xy-plane. Positive pitch
  25687. angles are below the plane. Negative pitch angles are above the plane. The range is the distance from the center. If the range is
  25688. zero, a range will be computed such that the whole bounding sphere is visible.</p>
  25689. <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
  25690. target will be the range. The heading will be aligned to local north.</p>
  25691. * @param boundingSphere - The bounding sphere to view, in world coordinates.
  25692. * @param [options] - Object with the following properties:
  25693. * @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.
  25694. * @param [options.offset] - The offset from the target in the local east-north-up reference frame centered at the target.
  25695. * @param [options.complete] - The function to execute when the flight is complete.
  25696. * @param [options.cancel] - The function to execute if the flight is cancelled.
  25697. * @param [options.endTransform] - Transform matrix representing the reference frame the camera will be in when the flight is completed.
  25698. * @param [options.maximumHeight] - The maximum height at the peak of the flight.
  25699. * @param [options.pitchAdjustHeight] - If camera flyes higher than that value, adjust pitch duiring the flight to look down, and keep Earth in viewport.
  25700. * @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.
  25701. * @param [options.flyOverLongitudeWeight] - Fly over the lon specifyed via flyOverLongitude only if that way is not longer than short way times flyOverLongitudeWeight.
  25702. * @param [options.easingFunction] - Controls how the time is interpolated over the duration of the flight.
  25703. */
  25704. flyToBoundingSphere(boundingSphere: BoundingSphere, options?: {
  25705. duration?: number;
  25706. offset?: HeadingPitchRange;
  25707. complete?: Camera.FlightCompleteCallback;
  25708. cancel?: Camera.FlightCancelledCallback;
  25709. endTransform?: Matrix4;
  25710. maximumHeight?: number;
  25711. pitchAdjustHeight?: number;
  25712. flyOverLongitude?: number;
  25713. flyOverLongitudeWeight?: number;
  25714. easingFunction?: EasingFunction.Callback;
  25715. }): void;
  25716. /**
  25717. * Computes the approximate visible rectangle on the ellipsoid.
  25718. * @param [ellipsoid = Ellipsoid.WGS84] - The ellipsoid that you want to know the visible region.
  25719. * @param [result] - The rectangle in which to store the result
  25720. * @returns The visible rectangle or undefined if the ellipsoid isn't visible at all.
  25721. */
  25722. computeViewRectangle(ellipsoid?: Ellipsoid, result?: Rectangle): Rectangle | undefined;
  25723. /**
  25724. * Switches the frustum/projection to perspective.
  25725. This function is a no-op in 2D which must always be orthographic.
  25726. */
  25727. switchToPerspectiveFrustum(): void;
  25728. /**
  25729. * Switches the frustum/projection to orthographic.
  25730. This function is a no-op in 2D which will always be orthographic.
  25731. */
  25732. switchToOrthographicFrustum(): void;
  25733. }
  25734. export namespace Camera {
  25735. /**
  25736. * A function that will execute when a flight completes.
  25737. */
  25738. type FlightCompleteCallback = () => void;
  25739. /**
  25740. * A function that will execute when a flight is cancelled.
  25741. */
  25742. type FlightCancelledCallback = () => void;
  25743. }
  25744. /**
  25745. * Aggregates input events. For example, suppose the following inputs are received between frames:
  25746. left mouse button down, mouse move, mouse move, left mouse button up. These events will be aggregated into
  25747. one event with a start and end position of the mouse.
  25748. * @param [canvas = document] - The element to handle events for.
  25749. */
  25750. export class CameraEventAggregator {
  25751. constructor(canvas?: HTMLCanvasElement);
  25752. /**
  25753. * Gets the current mouse position.
  25754. */
  25755. currentMousePosition: Cartesian2;
  25756. /**
  25757. * Gets whether any mouse button is down, a touch has started, or the wheel has been moved.
  25758. */
  25759. anyButtonDown: boolean;
  25760. /**
  25761. * Gets if a mouse button down or touch has started and has been moved.
  25762. * @param type - The camera event type.
  25763. * @param [modifier] - The keyboard modifier.
  25764. * @returns Returns <code>true</code> if a mouse button down or touch has started and has been moved; otherwise, <code>false</code>
  25765. */
  25766. isMoving(type: CameraEventType, modifier?: KeyboardEventModifier): boolean;
  25767. /**
  25768. * Gets the aggregated start and end position of the current event.
  25769. * @param type - The camera event type.
  25770. * @param [modifier] - The keyboard modifier.
  25771. * @returns An object with two {@link Cartesian2} properties: <code>startPosition</code> and <code>endPosition</code>.
  25772. */
  25773. getMovement(type: CameraEventType, modifier?: KeyboardEventModifier): any;
  25774. /**
  25775. * Gets the start and end position of the last move event (not the aggregated event).
  25776. * @param type - The camera event type.
  25777. * @param [modifier] - The keyboard modifier.
  25778. * @returns An object with two {@link Cartesian2} properties: <code>startPosition</code> and <code>endPosition</code> or <code>undefined</code>.
  25779. */
  25780. getLastMovement(type: CameraEventType, modifier?: KeyboardEventModifier): any | undefined;
  25781. /**
  25782. * Gets whether the mouse button is down or a touch has started.
  25783. * @param type - The camera event type.
  25784. * @param [modifier] - The keyboard modifier.
  25785. * @returns Whether the mouse button is down or a touch has started.
  25786. */
  25787. isButtonDown(type: CameraEventType, modifier?: KeyboardEventModifier): boolean;
  25788. /**
  25789. * Gets the mouse position that started the aggregation.
  25790. * @param type - The camera event type.
  25791. * @param [modifier] - The keyboard modifier.
  25792. * @returns The mouse position.
  25793. */
  25794. getStartMousePosition(type: CameraEventType, modifier?: KeyboardEventModifier): Cartesian2;
  25795. /**
  25796. * Gets the time the button was pressed or the touch was started.
  25797. * @param type - The camera event type.
  25798. * @param [modifier] - The keyboard modifier.
  25799. * @returns The time the button was pressed or the touch was started.
  25800. */
  25801. getButtonPressTime(type: CameraEventType, modifier?: KeyboardEventModifier): Date;
  25802. /**
  25803. * Gets the time the button was released or the touch was ended.
  25804. * @param type - The camera event type.
  25805. * @param [modifier] - The keyboard modifier.
  25806. * @returns The time the button was released or the touch was ended.
  25807. */
  25808. getButtonReleaseTime(type: CameraEventType, modifier?: KeyboardEventModifier): Date;
  25809. /**
  25810. * Signals that all of the events have been handled and the aggregator should be reset to handle new events.
  25811. */
  25812. reset(): void;
  25813. /**
  25814. * Returns true if this object was destroyed; otherwise, false.
  25815. <br /><br />
  25816. If this object was destroyed, it should not be used; calling any function other than
  25817. <code>isDestroyed</code> will result in a {@link DeveloperError} exception.
  25818. * @returns <code>true</code> if this object was destroyed; otherwise, <code>false</code>.
  25819. */
  25820. isDestroyed(): boolean;
  25821. /**
  25822. * Removes mouse listeners held by this object.
  25823. <br /><br />
  25824. Once an object is destroyed, it should not be used; calling any function other than
  25825. <code>isDestroyed</code> will result in a {@link DeveloperError} exception. Therefore,
  25826. assign the return value (<code>undefined</code>) to the object as done in the example.
  25827. * @example
  25828. * handler = handler && handler.destroy();
  25829. */
  25830. destroy(): void;
  25831. }
  25832. /**
  25833. * Enumerates the available input for interacting with the camera.
  25834. */
  25835. export enum CameraEventType {
  25836. /**
  25837. * A left mouse button press followed by moving the mouse and releasing the button.
  25838. */
  25839. LEFT_DRAG = 0,
  25840. /**
  25841. * A right mouse button press followed by moving the mouse and releasing the button.
  25842. */
  25843. RIGHT_DRAG = 1,
  25844. /**
  25845. * A middle mouse button press followed by moving the mouse and releasing the button.
  25846. */
  25847. MIDDLE_DRAG = 2,
  25848. /**
  25849. * Scrolling the middle mouse button.
  25850. */
  25851. WHEEL = 3,
  25852. /**
  25853. * A two-finger touch on a touch surface.
  25854. */
  25855. PINCH = 4
  25856. }
  25857. /**
  25858. * A tile in a {@link Cesium3DTileset}. When a tile is first created, its content is not loaded;
  25859. the content is loaded on-demand when needed based on the view.
  25860. <p>
  25861. Do not construct this directly, instead access tiles through {@link Cesium3DTileset#tileVisible}.
  25862. </p>
  25863. */
  25864. export class Cesium3DTile {
  25865. constructor();
  25866. /**
  25867. * The local transform of this tile.
  25868. */
  25869. transform: Matrix4;
  25870. /**
  25871. * The final computed transform of this tile.
  25872. */
  25873. readonly computedTransform: Matrix4;
  25874. /**
  25875. * The error, in meters, introduced if this tile is rendered and its children are not.
  25876. This is used to compute screen space error, i.e., the error measured in pixels.
  25877. */
  25878. readonly geometricError: number;
  25879. /**
  25880. * Gets the tile's children.
  25881. */
  25882. readonly children: Cesium3DTile[];
  25883. /**
  25884. * This tile's parent or <code>undefined</code> if this tile is the root.
  25885. <p>
  25886. When a tile's content points to an external tileset JSON file, the external tileset's
  25887. root tile's parent is not <code>undefined</code>; instead, the parent references
  25888. the tile (with its content pointing to an external tileset JSON file) as if the two tilesets were merged.
  25889. </p>
  25890. */
  25891. readonly parent: Cesium3DTile;
  25892. /**
  25893. * The time in seconds after the tile's content is ready when the content expires and new content is requested.
  25894. */
  25895. expireDuration: number;
  25896. /**
  25897. * The date when the content expires and new content is requested.
  25898. */
  25899. expireDate: JulianDate;
  25900. /**
  25901. * The tileset containing this tile.
  25902. */
  25903. readonly tileset: Cesium3DTileset;
  25904. /**
  25905. * The tile's content. This represents the actual tile's payload,
  25906. not the content's metadata in the tileset JSON file.
  25907. */
  25908. readonly content: Cesium3DTileContent;
  25909. /**
  25910. * Get the bounding sphere derived from the tile's bounding volume.
  25911. */
  25912. readonly boundingSphere: BoundingSphere;
  25913. /**
  25914. * Returns the <code>extras</code> property in the tileset JSON for this tile, which contains application specific metadata.
  25915. Returns <code>undefined</code> if <code>extras</code> does not exist.
  25916. */
  25917. readonly extras: any;
  25918. }
  25919. /**
  25920. * Defines how per-feature colors set from the Cesium API or declarative styling blend with the source colors from
  25921. the original feature, e.g. glTF material or per-point color in the tile.
  25922. <p>
  25923. When <code>REPLACE</code> or <code>MIX</code> are used and the source color is a glTF material, the technique must assign the
  25924. <code>_3DTILESDIFFUSE</code> semantic to the diffuse color parameter. Otherwise only <code>HIGHLIGHT</code> is supported.
  25925. </p>
  25926. <p>
  25927. A feature whose color evaluates to white (1.0, 1.0, 1.0) is always rendered without color blending, regardless of the
  25928. tileset's color blend mode.
  25929. </p>
  25930. <pre><code>
  25931. "techniques": {
  25932. "technique0": {
  25933. "parameters": {
  25934. "diffuse": {
  25935. "semantic": "_3DTILESDIFFUSE",
  25936. "type": 35666
  25937. }
  25938. }
  25939. }
  25940. }
  25941. </code></pre>
  25942. */
  25943. export enum Cesium3DTileColorBlendMode {
  25944. /**
  25945. * Multiplies the source color by the feature color.
  25946. */
  25947. HIGHLIGHT = 0,
  25948. /**
  25949. * Replaces the source color with the feature color.
  25950. */
  25951. REPLACE = 1,
  25952. /**
  25953. * Blends the source color and feature color together.
  25954. */
  25955. MIX = 2
  25956. }
  25957. /**
  25958. * The content of a tile in a {@link Cesium3DTileset}.
  25959. <p>
  25960. Derived classes of this interface provide access to individual features in the tile.
  25961. Access derived objects through {@link Cesium3DTile#content}.
  25962. </p>
  25963. <p>
  25964. This type describes an interface and is not intended to be instantiated directly.
  25965. </p>
  25966. */
  25967. export class Cesium3DTileContent {
  25968. constructor();
  25969. /**
  25970. * Gets the number of features in the tile.
  25971. */
  25972. readonly featuresLength: number;
  25973. /**
  25974. * Gets the number of points in the tile.
  25975. <p>
  25976. Only applicable for tiles with Point Cloud content. This is different than {@link Cesium3DTileContent#featuresLength} which
  25977. equals the number of groups of points as distinguished by the <code>BATCH_ID</code> feature table semantic.
  25978. </p>
  25979. */
  25980. readonly pointsLength: number;
  25981. /**
  25982. * Gets the number of triangles in the tile.
  25983. */
  25984. readonly trianglesLength: number;
  25985. /**
  25986. * Gets the tile's geometry memory in bytes.
  25987. */
  25988. readonly geometryByteLength: number;
  25989. /**
  25990. * Gets the tile's texture memory in bytes.
  25991. */
  25992. readonly texturesByteLength: number;
  25993. /**
  25994. * Gets the amount of memory used by the batch table textures, in bytes.
  25995. */
  25996. readonly batchTableByteLength: number;
  25997. /**
  25998. * Gets the array of {@link Cesium3DTileContent} objects that represent the
  25999. content a composite's inner tiles, which can also be composites.
  26000. */
  26001. readonly innerContents: any[];
  26002. /**
  26003. * Gets the promise that will be resolved when the tile's content is ready to render.
  26004. */
  26005. readonly readyPromise: Promise<Cesium3DTileContent>;
  26006. /**
  26007. * Gets the tileset for this tile.
  26008. */
  26009. readonly tileset: Cesium3DTileset;
  26010. /**
  26011. * Gets the tile containing this content.
  26012. */
  26013. readonly tile: Cesium3DTile;
  26014. /**
  26015. * Gets the url of the tile's content.
  26016. */
  26017. readonly url: string;
  26018. /**
  26019. * Determines if the tile's batch table has a property. If it does, each feature in
  26020. the tile will have the property.
  26021. * @param batchId - The batchId for the feature.
  26022. * @param name - The case-sensitive name of the property.
  26023. * @returns <code>true</code> if the property exists; otherwise, <code>false</code>.
  26024. */
  26025. hasProperty(batchId: number, name: string): boolean;
  26026. /**
  26027. * Returns the {@link Cesium3DTileFeature} object for the feature with the
  26028. given <code>batchId</code>. This object is used to get and modify the
  26029. feature's properties.
  26030. <p>
  26031. Features in a tile are ordered by <code>batchId</code>, an index used to retrieve their metadata from the batch table.
  26032. </p>
  26033. * @param batchId - The batchId for the feature.
  26034. * @returns The corresponding {@link Cesium3DTileFeature} object.
  26035. */
  26036. getFeature(batchId: number): Cesium3DTileFeature;
  26037. }
  26038. /**
  26039. * A feature of a {@link Cesium3DTileset}.
  26040. <p>
  26041. Provides access to a feature's properties stored in the tile's batch table, as well
  26042. as the ability to show/hide a feature and change its highlight color via
  26043. {@link Cesium3DTileFeature#show} and {@link Cesium3DTileFeature#color}, respectively.
  26044. </p>
  26045. <p>
  26046. Modifications to a <code>Cesium3DTileFeature</code> object have the lifetime of the tile's
  26047. content. If the tile's content is unloaded, e.g., due to it going out of view and needing
  26048. to free space in the cache for visible tiles, listen to the {@link Cesium3DTileset#tileUnload} event to save any
  26049. modifications. Also listen to the {@link Cesium3DTileset#tileVisible} event to reapply any modifications.
  26050. </p>
  26051. <p>
  26052. Do not construct this directly. Access it through {@link Cesium3DTileContent#getFeature}
  26053. or picking using {@link Scene#pick} and {@link Scene#pickPosition}.
  26054. </p>
  26055. * @example
  26056. * // On mouse over, display all the properties for a feature in the console log.
  26057. handler.setInputAction(function(movement) {
  26058. var feature = scene.pick(movement.endPosition);
  26059. if (feature instanceof Cesium.Cesium3DTileFeature) {
  26060. var propertyNames = feature.getPropertyNames();
  26061. var length = propertyNames.length;
  26062. for (var i = 0; i < length; ++i) {
  26063. var propertyName = propertyNames[i];
  26064. console.log(propertyName + ': ' + feature.getProperty(propertyName));
  26065. }
  26066. }
  26067. }, Cesium.ScreenSpaceEventType.MOUSE_MOVE);
  26068. */
  26069. export class Cesium3DTileFeature {
  26070. constructor();
  26071. /**
  26072. * Gets or sets if the feature will be shown. This is set for all features
  26073. when a style's show is evaluated.
  26074. */
  26075. show: boolean;
  26076. /**
  26077. * Gets or sets the highlight color multiplied with the feature's color. When
  26078. this is white, the feature's color is not changed. This is set for all features
  26079. when a style's color is evaluated.
  26080. */
  26081. color: Color;
  26082. /**
  26083. * Gets the tileset containing the feature.
  26084. */
  26085. readonly tileset: Cesium3DTileset;
  26086. /**
  26087. * All objects returned by {@link Scene#pick} have a <code>primitive</code> property. This returns
  26088. the tileset containing the feature.
  26089. */
  26090. readonly primitive: Cesium3DTileset;
  26091. /**
  26092. * Returns whether the feature contains this property. This includes properties from this feature's
  26093. class and inherited classes when using a batch table hierarchy.
  26094. * @param name - The case-sensitive name of the property.
  26095. * @returns Whether the feature contains this property.
  26096. */
  26097. hasProperty(name: string): boolean;
  26098. /**
  26099. * Returns an array of property names for the feature. This includes properties from this feature's
  26100. class and inherited classes when using a batch table hierarchy.
  26101. * @param [results] - An array into which to store the results.
  26102. * @returns The names of the feature's properties.
  26103. */
  26104. getPropertyNames(results?: string[]): string[];
  26105. /**
  26106. * Returns a copy of the value of the feature's property with the given name. This includes properties from this feature's
  26107. class and inherited classes when using a batch table hierarchy.
  26108. * @example
  26109. * // Display all the properties for a feature in the console log.
  26110. var propertyNames = feature.getPropertyNames();
  26111. var length = propertyNames.length;
  26112. for (var i = 0; i < length; ++i) {
  26113. var propertyName = propertyNames[i];
  26114. console.log(propertyName + ': ' + feature.getProperty(propertyName));
  26115. }
  26116. * @param name - The case-sensitive name of the property.
  26117. * @returns The value of the property or <code>undefined</code> if the property does not exist.
  26118. */
  26119. getProperty(name: string): any;
  26120. /**
  26121. * Sets the value of the feature's property with the given name.
  26122. <p>
  26123. If a property with the given name doesn't exist, it is created.
  26124. </p>
  26125. * @example
  26126. * var height = feature.getProperty('Height'); // e.g., the height of a building
  26127. * @example
  26128. * var name = 'clicked';
  26129. if (feature.getProperty(name)) {
  26130. console.log('already clicked');
  26131. } else {
  26132. feature.setProperty(name, true);
  26133. console.log('first click');
  26134. }
  26135. * @param name - The case-sensitive name of the property.
  26136. * @param value - The value of the property that will be copied.
  26137. */
  26138. setProperty(name: string, value: any): void;
  26139. }
  26140. /**
  26141. * A point feature of a {@link Cesium3DTileset}.
  26142. <p>
  26143. Provides access to a feature's properties stored in the tile's batch table, as well
  26144. as the ability to show/hide a feature and change its point properties
  26145. </p>
  26146. <p>
  26147. Modifications to a <code>Cesium3DTilePointFeature</code> object have the lifetime of the tile's
  26148. content. If the tile's content is unloaded, e.g., due to it going out of view and needing
  26149. to free space in the cache for visible tiles, listen to the {@link Cesium3DTileset#tileUnload} event to save any
  26150. modifications. Also listen to the {@link Cesium3DTileset#tileVisible} event to reapply any modifications.
  26151. </p>
  26152. <p>
  26153. Do not construct this directly. Access it through {@link Cesium3DTileContent#getFeature}
  26154. or picking using {@link Scene#pick} and {@link Scene#pickPosition}.
  26155. </p>
  26156. * @example
  26157. * // On mouse over, display all the properties for a feature in the console log.
  26158. handler.setInputAction(function(movement) {
  26159. var feature = scene.pick(movement.endPosition);
  26160. if (feature instanceof Cesium.Cesium3DTilePointFeature) {
  26161. var propertyNames = feature.getPropertyNames();
  26162. var length = propertyNames.length;
  26163. for (var i = 0; i < length; ++i) {
  26164. var propertyName = propertyNames[i];
  26165. console.log(propertyName + ': ' + feature.getProperty(propertyName));
  26166. }
  26167. }
  26168. }, Cesium.ScreenSpaceEventType.MOUSE_MOVE);
  26169. */
  26170. export class Cesium3DTilePointFeature {
  26171. constructor();
  26172. /**
  26173. * Gets or sets if the feature will be shown. This is set for all features
  26174. when a style's show is evaluated.
  26175. */
  26176. show: boolean;
  26177. /**
  26178. * Gets or sets the color of the point of this feature.
  26179. <p>
  26180. Only applied when <code>image</code> is <code>undefined</code>.
  26181. </p>
  26182. */
  26183. color: Color;
  26184. /**
  26185. * Gets or sets the point size of this feature.
  26186. <p>
  26187. Only applied when <code>image</code> is <code>undefined</code>.
  26188. </p>
  26189. */
  26190. pointSize: number;
  26191. /**
  26192. * Gets or sets the point outline color of this feature.
  26193. <p>
  26194. Only applied when <code>image</code> is <code>undefined</code>.
  26195. </p>
  26196. */
  26197. pointOutlineColor: Color;
  26198. /**
  26199. * Gets or sets the point outline width in pixels of this feature.
  26200. <p>
  26201. Only applied when <code>image</code> is <code>undefined</code>.
  26202. </p>
  26203. */
  26204. pointOutlineWidth: number;
  26205. /**
  26206. * Gets or sets the label color of this feature.
  26207. <p>
  26208. The color will be applied to the label if <code>labelText</code> is defined.
  26209. </p>
  26210. */
  26211. labelColor: Color;
  26212. /**
  26213. * Gets or sets the label outline color of this feature.
  26214. <p>
  26215. The outline color will be applied to the label if <code>labelText</code> is defined.
  26216. </p>
  26217. */
  26218. labelOutlineColor: Color;
  26219. /**
  26220. * Gets or sets the outline width in pixels of this feature.
  26221. <p>
  26222. The outline width will be applied to the point if <code>labelText</code> is defined.
  26223. </p>
  26224. */
  26225. labelOutlineWidth: number;
  26226. /**
  26227. * Gets or sets the font of this feature.
  26228. <p>
  26229. Only applied when the <code>labelText</code> is defined.
  26230. </p>
  26231. */
  26232. font: string;
  26233. /**
  26234. * Gets or sets the fill and outline style of this feature.
  26235. <p>
  26236. Only applied when <code>labelText</code> is defined.
  26237. </p>
  26238. */
  26239. labelStyle: LabelStyle;
  26240. /**
  26241. * Gets or sets the text for this feature.
  26242. */
  26243. labelText: string;
  26244. /**
  26245. * Gets or sets the background color of the text for this feature.
  26246. <p>
  26247. Only applied when <code>labelText</code> is defined.
  26248. </p>
  26249. */
  26250. backgroundColor: Color;
  26251. /**
  26252. * Gets or sets the background padding of the text for this feature.
  26253. <p>
  26254. Only applied when <code>labelText</code> is defined.
  26255. </p>
  26256. */
  26257. backgroundPadding: Cartesian2;
  26258. /**
  26259. * Gets or sets whether to display the background of the text for this feature.
  26260. <p>
  26261. Only applied when <code>labelText</code> is defined.
  26262. </p>
  26263. */
  26264. backgroundEnabled: boolean;
  26265. /**
  26266. * Gets or sets the near and far scaling properties for this feature.
  26267. */
  26268. scaleByDistance: NearFarScalar;
  26269. /**
  26270. * Gets or sets the near and far translucency properties for this feature.
  26271. */
  26272. translucencyByDistance: NearFarScalar;
  26273. /**
  26274. * Gets or sets the condition specifying at what distance from the camera that this feature will be displayed.
  26275. */
  26276. distanceDisplayCondition: DistanceDisplayCondition;
  26277. /**
  26278. * Gets or sets the height offset in meters of this feature.
  26279. */
  26280. heightOffset: number;
  26281. /**
  26282. * Gets or sets whether the anchor line is displayed.
  26283. <p>
  26284. Only applied when <code>heightOffset</code> is defined.
  26285. </p>
  26286. */
  26287. anchorLineEnabled: boolean;
  26288. /**
  26289. * Gets or sets the color for the anchor line.
  26290. <p>
  26291. Only applied when <code>heightOffset</code> is defined.
  26292. </p>
  26293. */
  26294. anchorLineColor: Color;
  26295. /**
  26296. * Gets or sets the image of this feature.
  26297. */
  26298. image: string;
  26299. /**
  26300. * Gets or sets the distance where depth testing will be disabled.
  26301. */
  26302. disableDepthTestDistance: number;
  26303. /**
  26304. * Gets or sets the horizontal origin of this point, which determines if the point is
  26305. to the left, center, or right of its anchor position.
  26306. */
  26307. horizontalOrigin: HorizontalOrigin;
  26308. /**
  26309. * Gets or sets the vertical origin of this point, which determines if the point is
  26310. to the bottom, center, or top of its anchor position.
  26311. */
  26312. verticalOrigin: VerticalOrigin;
  26313. /**
  26314. * Gets or sets the horizontal origin of this point's text, which determines if the point's text is
  26315. to the left, center, or right of its anchor position.
  26316. */
  26317. labelHorizontalOrigin: HorizontalOrigin;
  26318. /**
  26319. * Get or sets the vertical origin of this point's text, which determines if the point's text is
  26320. to the bottom, center, top, or baseline of it's anchor point.
  26321. */
  26322. labelVerticalOrigin: VerticalOrigin;
  26323. /**
  26324. * Gets the tileset containing the feature.
  26325. */
  26326. readonly tileset: Cesium3DTileset;
  26327. /**
  26328. * All objects returned by {@link Scene#pick} have a <code>primitive</code> property. This returns
  26329. the tileset containing the feature.
  26330. */
  26331. readonly primitive: Cesium3DTileset;
  26332. /**
  26333. * Returns whether the feature contains this property. This includes properties from this feature's
  26334. class and inherited classes when using a batch table hierarchy.
  26335. * @param name - The case-sensitive name of the property.
  26336. * @returns Whether the feature contains this property.
  26337. */
  26338. hasProperty(name: string): boolean;
  26339. /**
  26340. * Returns an array of property names for the feature. This includes properties from this feature's
  26341. class and inherited classes when using a batch table hierarchy.
  26342. * @param [results] - An array into which to store the results.
  26343. * @returns The names of the feature's properties.
  26344. */
  26345. getPropertyNames(results?: string[]): string[];
  26346. /**
  26347. * Returns a copy of the value of the feature's property with the given name. This includes properties from this feature's
  26348. class and inherited classes when using a batch table hierarchy.
  26349. * @example
  26350. * // Display all the properties for a feature in the console log.
  26351. var propertyNames = feature.getPropertyNames();
  26352. var length = propertyNames.length;
  26353. for (var i = 0; i < length; ++i) {
  26354. var propertyName = propertyNames[i];
  26355. console.log(propertyName + ': ' + feature.getProperty(propertyName));
  26356. }
  26357. * @param name - The case-sensitive name of the property.
  26358. * @returns The value of the property or <code>undefined</code> if the property does not exist.
  26359. */
  26360. getProperty(name: string): any;
  26361. /**
  26362. * Sets the value of the feature's property with the given name.
  26363. <p>
  26364. If a property with the given name doesn't exist, it is created.
  26365. </p>
  26366. * @example
  26367. * var height = feature.getProperty('Height'); // e.g., the height of a building
  26368. * @example
  26369. * var name = 'clicked';
  26370. if (feature.getProperty(name)) {
  26371. console.log('already clicked');
  26372. } else {
  26373. feature.setProperty(name, true);
  26374. console.log('first click');
  26375. }
  26376. * @param name - The case-sensitive name of the property.
  26377. * @param value - The value of the property that will be copied.
  26378. */
  26379. setProperty(name: string, value: any): void;
  26380. }
  26381. /**
  26382. * A {@link https://github.com/CesiumGS/3d-tiles/tree/master/specification|3D Tiles tileset},
  26383. used for streaming massive heterogeneous 3D geospatial datasets.
  26384. * @example
  26385. * var tileset = scene.primitives.add(new Cesium.Cesium3DTileset({
  26386. url : 'http://localhost:8002/tilesets/Seattle/tileset.json'
  26387. }));
  26388. * @example
  26389. * // Common setting for the skipLevelOfDetail optimization
  26390. var tileset = scene.primitives.add(new Cesium.Cesium3DTileset({
  26391. url : 'http://localhost:8002/tilesets/Seattle/tileset.json',
  26392. skipLevelOfDetail : true,
  26393. baseScreenSpaceError : 1024,
  26394. skipScreenSpaceErrorFactor : 16,
  26395. skipLevels : 1,
  26396. immediatelyLoadDesiredLevelOfDetail : false,
  26397. loadSiblings : false,
  26398. cullWithChildrenBounds : true
  26399. }));
  26400. * @example
  26401. * // Common settings for the dynamicScreenSpaceError optimization
  26402. var tileset = scene.primitives.add(new Cesium.Cesium3DTileset({
  26403. url : 'http://localhost:8002/tilesets/Seattle/tileset.json',
  26404. dynamicScreenSpaceError : true,
  26405. dynamicScreenSpaceErrorDensity : 0.00278,
  26406. dynamicScreenSpaceErrorFactor : 4.0,
  26407. dynamicScreenSpaceErrorHeightFalloff : 0.25
  26408. }));
  26409. * @param options - Object with the following properties:
  26410. * @param options.url - The url to a tileset JSON file.
  26411. * @param [options.show = true] - Determines if the tileset will be shown.
  26412. * @param [options.modelMatrix = Matrix4.IDENTITY] - A 4x4 transformation matrix that transforms the tileset's root tile.
  26413. * @param [options.shadows = ShadowMode.ENABLED] - Determines whether the tileset casts or receives shadows from light sources.
  26414. * @param [options.maximumScreenSpaceError = 16] - The maximum screen space error used to drive level of detail refinement.
  26415. * @param [options.maximumMemoryUsage = 512] - The maximum amount of memory in MB that can be used by the tileset.
  26416. * @param [options.cullWithChildrenBounds = true] - Optimization option. Whether to cull tiles using the union of their children bounding volumes.
  26417. * @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.
  26418. * @param [options.cullRequestsWhileMovingMultiplier = 60.0] - Optimization option. Multiplier used in culling requests while moving. Larger is more aggressive culling, smaller less aggressive culling.
  26419. * @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.
  26420. * @param [options.preloadFlightDestinations = true] - Optimization option. Preload tiles at the camera's flight destination while the camera is in flight.
  26421. * @param [options.preferLeaves = false] - Optimization option. Prefer loading of leaves first.
  26422. * @param [options.dynamicScreenSpaceError = false] - Optimization option. Reduce the screen space error for tiles that are further away from the camera.
  26423. * @param [options.dynamicScreenSpaceErrorDensity = 0.00278] - Density used to adjust the dynamic screen space error, similar to fog density.
  26424. * @param [options.dynamicScreenSpaceErrorFactor = 4.0] - A factor used to increase the computed dynamic screen space error.
  26425. * @param [options.dynamicScreenSpaceErrorHeightFalloff = 0.25] - A ratio of the tileset's height at which the density starts to falloff.
  26426. * @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.
  26427. * @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.
  26428. * @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.
  26429. * @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}.
  26430. * @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}
  26431. * @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.
  26432. * @param [options.skipLevelOfDetail = false] - Optimization option. Determines if level of detail skipping should be applied during the traversal.
  26433. * @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.
  26434. * @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.
  26435. * @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.
  26436. * @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.
  26437. * @param [options.loadSiblings = false] - When <code>skipLevelOfDetail</code> is <code>true</code>, determines whether siblings of visible tiles are always downloaded during traversal.
  26438. * @param [options.clippingPlanes] - The {@link ClippingPlaneCollection} used to selectively disable rendering the tileset.
  26439. * @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.
  26440. * @param [options.ellipsoid = Ellipsoid.WGS84] - The ellipsoid determining the size and shape of the globe.
  26441. * @param [options.pointCloudShading] - Options for constructing a {@link PointCloudShading} object to control point attenuation based on geometric error and lighting.
  26442. * @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.
  26443. * @param [options.lightColor] - The light color when shading models. When <code>undefined</code> the scene's light color is used instead.
  26444. * @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.
  26445. * @param [options.sphericalHarmonicCoefficients] - The third order spherical harmonic coefficients used for the diffuse color of image-based lighting.
  26446. * @param [options.specularEnvironmentMaps] - A URL to a KTX file that contains a cube map of the specular lighting and the convoluted specular mipmaps.
  26447. * @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.
  26448. * @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.
  26449. * @param [options.debugFreezeFrame = false] - For debugging only. Determines if only the tiles from last frame should be used for rendering.
  26450. * @param [options.debugColorizeTiles = false] - For debugging only. When true, assigns a random color to each tile.
  26451. * @param [options.debugWireframe = false] - For debugging only. When true, render's each tile's content as a wireframe.
  26452. * @param [options.debugShowBoundingVolume = false] - For debugging only. When true, renders the bounding volume for each tile.
  26453. * @param [options.debugShowContentBoundingVolume = false] - For debugging only. When true, renders the bounding volume for each tile's content.
  26454. * @param [options.debugShowViewerRequestVolume = false] - For debugging only. When true, renders the viewer request volume for each tile.
  26455. * @param [options.debugShowGeometricError = false] - For debugging only. When true, draws labels to indicate the geometric error of each tile.
  26456. * @param [options.debugShowRenderingStatistics = false] - For debugging only. When true, draws labels to indicate the number of commands, points, triangles and features for each tile.
  26457. * @param [options.debugShowMemoryUsage = false] - For debugging only. When true, draws labels to indicate the texture and geometry memory in megabytes used by each tile.
  26458. * @param [options.debugShowUrl = false] - For debugging only. When true, draws labels to indicate the url of each tile.
  26459. */
  26460. export class Cesium3DTileset {
  26461. constructor(options: {
  26462. url: Resource | string | Promise<Resource> | Promise<string>;
  26463. show?: boolean;
  26464. modelMatrix?: Matrix4;
  26465. shadows?: ShadowMode;
  26466. maximumScreenSpaceError?: number;
  26467. maximumMemoryUsage?: number;
  26468. cullWithChildrenBounds?: boolean;
  26469. cullRequestsWhileMoving?: boolean;
  26470. cullRequestsWhileMovingMultiplier?: number;
  26471. preloadWhenHidden?: boolean;
  26472. preloadFlightDestinations?: boolean;
  26473. preferLeaves?: boolean;
  26474. dynamicScreenSpaceError?: boolean;
  26475. dynamicScreenSpaceErrorDensity?: number;
  26476. dynamicScreenSpaceErrorFactor?: number;
  26477. dynamicScreenSpaceErrorHeightFalloff?: number;
  26478. progressiveResolutionHeightFraction?: number;
  26479. foveatedScreenSpaceError?: boolean;
  26480. foveatedConeSize?: number;
  26481. foveatedMinimumScreenSpaceErrorRelaxation?: number;
  26482. foveatedInterpolationCallback?: Cesium3DTileset.foveatedInterpolationCallback;
  26483. foveatedTimeDelay?: number;
  26484. skipLevelOfDetail?: boolean;
  26485. baseScreenSpaceError?: number;
  26486. skipScreenSpaceErrorFactor?: number;
  26487. skipLevels?: number;
  26488. immediatelyLoadDesiredLevelOfDetail?: boolean;
  26489. loadSiblings?: boolean;
  26490. clippingPlanes?: ClippingPlaneCollection;
  26491. classificationType?: ClassificationType;
  26492. ellipsoid?: Ellipsoid;
  26493. pointCloudShading?: any;
  26494. imageBasedLightingFactor?: Cartesian2;
  26495. lightColor?: Cartesian3;
  26496. luminanceAtZenith?: number;
  26497. sphericalHarmonicCoefficients?: Cartesian3[];
  26498. specularEnvironmentMaps?: string;
  26499. backFaceCulling?: boolean;
  26500. debugHeatmapTilePropertyName?: string;
  26501. debugFreezeFrame?: boolean;
  26502. debugColorizeTiles?: boolean;
  26503. debugWireframe?: boolean;
  26504. debugShowBoundingVolume?: boolean;
  26505. debugShowContentBoundingVolume?: boolean;
  26506. debugShowViewerRequestVolume?: boolean;
  26507. debugShowGeometricError?: boolean;
  26508. debugShowRenderingStatistics?: boolean;
  26509. debugShowMemoryUsage?: boolean;
  26510. debugShowUrl?: boolean;
  26511. });
  26512. /**
  26513. * 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.
  26514. */
  26515. cullRequestsWhileMoving: boolean;
  26516. /**
  26517. * Optimization option. Multiplier used in culling requests while moving. Larger is more aggressive culling, smaller less aggressive culling.
  26518. */
  26519. cullRequestsWhileMovingMultiplier: number;
  26520. /**
  26521. * 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.
  26522. */
  26523. progressiveResolutionHeightFraction: number;
  26524. /**
  26525. * Optimization option. Prefer loading of leaves first.
  26526. */
  26527. preferLeaves: boolean;
  26528. /**
  26529. * Preload tiles when <code>tileset.show</code> is <code>false</code>. Loads tiles as if the tileset is visible but does not render them.
  26530. */
  26531. preloadWhenHidden: boolean;
  26532. /**
  26533. * Optimization option. Fetch tiles at the camera's flight destination while the camera is in flight.
  26534. */
  26535. preloadFlightDestinations: boolean;
  26536. /**
  26537. * Optimization option. Whether the tileset should refine based on a dynamic screen space error. Tiles that are further
  26538. away will be rendered with lower detail than closer tiles. This improves performance by rendering fewer
  26539. tiles and making less requests, but may result in a slight drop in visual quality for tiles in the distance.
  26540. The algorithm is biased towards "street views" where the camera is close to the ground plane of the tileset and looking
  26541. at the horizon. In addition results are more accurate for tightly fitting bounding volumes like box and region.
  26542. */
  26543. dynamicScreenSpaceError: boolean;
  26544. /**
  26545. * Optimization option. Prioritize loading tiles in the center of the screen by temporarily raising the
  26546. screen space error for tiles around the edge of the screen. Screen space error returns to normal once all
  26547. the tiles in the center of the screen as determined by the {@link Cesium3DTileset#foveatedConeSize} are loaded.
  26548. */
  26549. foveatedScreenSpaceError: boolean;
  26550. /**
  26551. * Gets or sets a callback to control how much to raise the screen space error for tiles outside the foveated cone,
  26552. interpolating between {@link Cesium3DTileset#foveatedMinimumScreenSpaceErrorRelaxation} and {@link Cesium3DTileset#maximumScreenSpaceError}.
  26553. */
  26554. foveatedInterpolationCallback: Cesium3DTileset.foveatedInterpolationCallback;
  26555. /**
  26556. * Optimization option. Used when {@link Cesium3DTileset#foveatedScreenSpaceError} is true to control
  26557. how long in seconds to wait after the camera stops moving before deferred tiles start loading in.
  26558. This time delay prevents requesting tiles around the edges of the screen when the camera is moving.
  26559. Setting this to 0.0 will immediately request all tiles in any given view.
  26560. */
  26561. foveatedTimeDelay: number;
  26562. /**
  26563. * A scalar that determines the density used to adjust the dynamic screen space error, similar to {@link Fog}. Increasing this
  26564. value has the effect of increasing the maximum screen space error for all tiles, but in a non-linear fashion.
  26565. The error starts at 0.0 and increases exponentially until a midpoint is reached, and then approaches 1.0 asymptotically.
  26566. This has the effect of keeping high detail in the closer tiles and lower detail in the further tiles, with all tiles
  26567. beyond a certain distance all roughly having an error of 1.0.
  26568. <p>
  26569. The dynamic error is in the range [0.0, 1.0) and is multiplied by <code>dynamicScreenSpaceErrorFactor</code> to produce the
  26570. final dynamic error. This dynamic error is then subtracted from the tile's actual screen space error.
  26571. </p>
  26572. <p>
  26573. Increasing <code>dynamicScreenSpaceErrorDensity</code> has the effect of moving the error midpoint closer to the camera.
  26574. It is analogous to moving fog closer to the camera.
  26575. </p>
  26576. */
  26577. dynamicScreenSpaceErrorDensity: number;
  26578. /**
  26579. * A factor used to increase the screen space error of tiles for dynamic screen space error. As this value increases less tiles
  26580. are requested for rendering and tiles in the distance will have lower detail. If set to zero, the feature will be disabled.
  26581. */
  26582. dynamicScreenSpaceErrorFactor: number;
  26583. /**
  26584. * A ratio of the tileset's height at which the density starts to falloff. If the camera is below this height the
  26585. full computed density is applied, otherwise the density falls off. This has the effect of higher density at
  26586. street level views.
  26587. <p>
  26588. Valid values are between 0.0 and 1.0.
  26589. </p>
  26590. */
  26591. dynamicScreenSpaceErrorHeightFalloff: number;
  26592. /**
  26593. * Determines whether the tileset casts or receives shadows from light sources.
  26594. <p>
  26595. 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.
  26596. </p>
  26597. <p>
  26598. Shadows are rendered only when {@link Viewer#shadows} is <code>true</code>.
  26599. </p>
  26600. */
  26601. shadows: ShadowMode;
  26602. /**
  26603. * Determines if the tileset will be shown.
  26604. */
  26605. show: boolean;
  26606. /**
  26607. * Defines how per-feature colors set from the Cesium API or declarative styling blend with the source colors from
  26608. the original feature, e.g. glTF material or per-point color in the tile.
  26609. */
  26610. colorBlendMode: Cesium3DTileColorBlendMode;
  26611. /**
  26612. * Defines the value used to linearly interpolate between the source color and feature color when the {@link Cesium3DTileset#colorBlendMode} is <code>MIX</code>.
  26613. 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
  26614. resulting in a mix of the source color and feature color.
  26615. */
  26616. colorBlendAmount: number;
  26617. /**
  26618. * Options for controlling point size based on geometric error and eye dome lighting.
  26619. */
  26620. pointCloudShading: PointCloudShading;
  26621. /**
  26622. * The event fired to indicate progress of loading new tiles. This event is fired when a new tile
  26623. is requested, when a requested tile is finished downloading, and when a downloaded tile has been
  26624. processed and is ready to render.
  26625. <p>
  26626. The number of pending tile requests, <code>numberOfPendingRequests</code>, and number of tiles
  26627. processing, <code>numberOfTilesProcessing</code> are passed to the event listener.
  26628. </p>
  26629. <p>
  26630. This event is fired at the end of the frame after the scene is rendered.
  26631. </p>
  26632. * @example
  26633. * tileset.loadProgress.addEventListener(function(numberOfPendingRequests, numberOfTilesProcessing) {
  26634. if ((numberOfPendingRequests === 0) && (numberOfTilesProcessing === 0)) {
  26635. console.log('Stopped loading');
  26636. return;
  26637. }
  26638. console.log('Loading: requests: ' + numberOfPendingRequests + ', processing: ' + numberOfTilesProcessing);
  26639. });
  26640. */
  26641. loadProgress: Event;
  26642. /**
  26643. * The event fired to indicate that all tiles that meet the screen space error this frame are loaded. The tileset
  26644. is completely loaded for this view.
  26645. <p>
  26646. This event is fired at the end of the frame after the scene is rendered.
  26647. </p>
  26648. * @example
  26649. * tileset.allTilesLoaded.addEventListener(function() {
  26650. console.log('All tiles are loaded');
  26651. });
  26652. */
  26653. allTilesLoaded: Event;
  26654. /**
  26655. * The event fired to indicate that all tiles that meet the screen space error this frame are loaded. This event
  26656. is fired once when all tiles in the initial view are loaded.
  26657. <p>
  26658. This event is fired at the end of the frame after the scene is rendered.
  26659. </p>
  26660. * @example
  26661. * tileset.initialTilesLoaded.addEventListener(function() {
  26662. console.log('Initial tiles are loaded');
  26663. });
  26664. */
  26665. initialTilesLoaded: Event;
  26666. /**
  26667. * The event fired to indicate that a tile's content was loaded.
  26668. <p>
  26669. The loaded {@link Cesium3DTile} is passed to the event listener.
  26670. </p>
  26671. <p>
  26672. This event is fired during the tileset traversal while the frame is being rendered
  26673. so that updates to the tile take effect in the same frame. Do not create or modify
  26674. Cesium entities or primitives during the event listener.
  26675. </p>
  26676. * @example
  26677. * tileset.tileLoad.addEventListener(function(tile) {
  26678. console.log('A tile was loaded.');
  26679. });
  26680. */
  26681. tileLoad: Event;
  26682. /**
  26683. * The event fired to indicate that a tile's content was unloaded.
  26684. <p>
  26685. The unloaded {@link Cesium3DTile} is passed to the event listener.
  26686. </p>
  26687. <p>
  26688. This event is fired immediately before the tile's content is unloaded while the frame is being
  26689. rendered so that the event listener has access to the tile's content. Do not create
  26690. or modify Cesium entities or primitives during the event listener.
  26691. </p>
  26692. * @example
  26693. * tileset.tileUnload.addEventListener(function(tile) {
  26694. console.log('A tile was unloaded from the cache.');
  26695. });
  26696. */
  26697. tileUnload: Event;
  26698. /**
  26699. * The event fired to indicate that a tile's content failed to load.
  26700. <p>
  26701. If there are no event listeners, error messages will be logged to the console.
  26702. </p>
  26703. <p>
  26704. The error object passed to the listener contains two properties:
  26705. <ul>
  26706. <li><code>url</code>: the url of the failed tile.</li>
  26707. <li><code>message</code>: the error message.</li>
  26708. </ul>
  26709. * @example
  26710. * tileset.tileFailed.addEventListener(function(error) {
  26711. console.log('An error occurred loading tile: ' + error.url);
  26712. console.log('Error: ' + error.message);
  26713. });
  26714. */
  26715. tileFailed: Event;
  26716. /**
  26717. * This event fires once for each visible tile in a frame. This can be used to manually
  26718. style a tileset.
  26719. <p>
  26720. The visible {@link Cesium3DTile} is passed to the event listener.
  26721. </p>
  26722. <p>
  26723. This event is fired during the tileset traversal while the frame is being rendered
  26724. so that updates to the tile take effect in the same frame. Do not create or modify
  26725. Cesium entities or primitives during the event listener.
  26726. </p>
  26727. * @example
  26728. * tileset.tileVisible.addEventListener(function(tile) {
  26729. if (tile.content instanceof Cesium.Batched3DModel3DTileContent) {
  26730. console.log('A Batched 3D Model tile is visible.');
  26731. }
  26732. });
  26733. * @example
  26734. * // Apply a red style and then manually set random colors for every other feature when the tile becomes visible.
  26735. tileset.style = new Cesium.Cesium3DTileStyle({
  26736. color : 'color("red")'
  26737. });
  26738. tileset.tileVisible.addEventListener(function(tile) {
  26739. var content = tile.content;
  26740. var featuresLength = content.featuresLength;
  26741. for (var i = 0; i < featuresLength; i+=2) {
  26742. content.getFeature(i).color = Cesium.Color.fromRandom();
  26743. }
  26744. });
  26745. */
  26746. tileVisible: Event;
  26747. /**
  26748. * Optimization option. Determines if level of detail skipping should be applied during the traversal.
  26749. <p>
  26750. The common strategy for replacement-refinement traversal is to store all levels of the tree in memory and require
  26751. all children to be loaded before the parent can refine. With this optimization levels of the tree can be skipped
  26752. entirely and children can be rendered alongside their parents. The tileset requires significantly less memory when
  26753. using this optimization.
  26754. </p>
  26755. */
  26756. skipLevelOfDetail: boolean;
  26757. /**
  26758. * The screen space error that must be reached before skipping levels of detail.
  26759. <p>
  26760. Only used when {@link Cesium3DTileset#skipLevelOfDetail} is <code>true</code>.
  26761. </p>
  26762. */
  26763. baseScreenSpaceError: number;
  26764. /**
  26765. * Multiplier defining the minimum screen space error to skip.
  26766. For example, if a tile has screen space error of 100, no tiles will be loaded unless they
  26767. are leaves or have a screen space error <code><= 100 / skipScreenSpaceErrorFactor</code>.
  26768. <p>
  26769. Only used when {@link Cesium3DTileset#skipLevelOfDetail} is <code>true</code>.
  26770. </p>
  26771. */
  26772. skipScreenSpaceErrorFactor: number;
  26773. /**
  26774. * Constant defining the minimum number of levels to skip when loading tiles. When it is 0, no levels are skipped.
  26775. For example, if a tile is level 1, no tiles will be loaded unless they are at level greater than 2.
  26776. <p>
  26777. Only used when {@link Cesium3DTileset#skipLevelOfDetail} is <code>true</code>.
  26778. </p>
  26779. */
  26780. skipLevels: number;
  26781. /**
  26782. * When true, only tiles that meet the maximum screen space error will ever be downloaded.
  26783. Skipping factors are ignored and just the desired tiles are loaded.
  26784. <p>
  26785. Only used when {@link Cesium3DTileset#skipLevelOfDetail} is <code>true</code>.
  26786. </p>
  26787. */
  26788. immediatelyLoadDesiredLevelOfDetail: boolean;
  26789. /**
  26790. * Determines whether siblings of visible tiles are always downloaded during traversal.
  26791. This may be useful for ensuring that tiles are already available when the viewer turns left/right.
  26792. <p>
  26793. Only used when {@link Cesium3DTileset#skipLevelOfDetail} is <code>true</code>.
  26794. </p>
  26795. */
  26796. loadSiblings: boolean;
  26797. /**
  26798. * The light color when shading models. When <code>undefined</code> the scene's light color is used instead.
  26799. <p>
  26800. For example, disabling additional light sources by setting <code>model.imageBasedLightingFactor = new Cartesian2(0.0, 0.0)</code> will make the
  26801. model much darker. Here, increasing the intensity of the light source will make the model brighter.
  26802. </p>
  26803. */
  26804. lightColor: Cartesian3;
  26805. /**
  26806. * The sun's luminance at the zenith in kilo candela per meter squared to use for this model's procedural environment map.
  26807. This is used when {@link Cesium3DTileset#specularEnvironmentMaps} and {@link Cesium3DTileset#sphericalHarmonicCoefficients} are not defined.
  26808. */
  26809. luminanceAtZenith: number;
  26810. /**
  26811. * The third order spherical harmonic coefficients used for the diffuse color of image-based lighting. When <code>undefined</code>, a diffuse irradiance
  26812. computed from the atmosphere color is used.
  26813. <p>
  26814. There are nine <code>Cartesian3</code> coefficients.
  26815. 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>
  26816. </p>
  26817. These values can be obtained by preprocessing the environment map using the <code>cmgen</code> tool of
  26818. {@link https://github.com/google/filament/releases|Google's Filament project}. This will also generate a KTX file that can be
  26819. supplied to {@link Cesium3DTileset#specularEnvironmentMaps}.
  26820. */
  26821. sphericalHarmonicCoefficients: Cartesian3[];
  26822. /**
  26823. * A URL to a KTX file that contains a cube map of the specular lighting and the convoluted specular mipmaps.
  26824. */
  26825. specularEnvironmentMaps: string;
  26826. /**
  26827. * Whether to cull back-facing geometry. When true, back face culling is determined
  26828. by the glTF material's doubleSided property; when false, back face culling is disabled.
  26829. */
  26830. backFaceCulling: boolean;
  26831. /**
  26832. * This property is for debugging only; it is not optimized for production use.
  26833. <p>
  26834. Determines if only the tiles from last frame should be used for rendering. This
  26835. effectively "freezes" the tileset to the previous frame so it is possible to zoom
  26836. out and see what was rendered.
  26837. </p>
  26838. */
  26839. debugFreezeFrame: boolean;
  26840. /**
  26841. * This property is for debugging only; it is not optimized for production use.
  26842. <p>
  26843. When true, assigns a random color to each tile. This is useful for visualizing
  26844. what features belong to what tiles, especially with additive refinement where features
  26845. from parent tiles may be interleaved with features from child tiles.
  26846. </p>
  26847. */
  26848. debugColorizeTiles: boolean;
  26849. /**
  26850. * This property is for debugging only; it is not optimized for production use.
  26851. <p>
  26852. When true, renders each tile's content as a wireframe.
  26853. </p>
  26854. */
  26855. debugWireframe: boolean;
  26856. /**
  26857. * This property is for debugging only; it is not optimized for production use.
  26858. <p>
  26859. When true, renders the bounding volume for each visible tile. The bounding volume is
  26860. white if the tile has a content bounding volume or is empty; otherwise, it is red. Tiles that don't meet the
  26861. screen space error and are still refining to their descendants are yellow.
  26862. </p>
  26863. */
  26864. debugShowBoundingVolume: boolean;
  26865. /**
  26866. * This property is for debugging only; it is not optimized for production use.
  26867. <p>
  26868. When true, renders the bounding volume for each visible tile's content. The bounding volume is
  26869. blue if the tile has a content bounding volume; otherwise it is red.
  26870. </p>
  26871. */
  26872. debugShowContentBoundingVolume: boolean;
  26873. /**
  26874. * This property is for debugging only; it is not optimized for production use.
  26875. <p>
  26876. When true, renders the viewer request volume for each tile.
  26877. </p>
  26878. */
  26879. debugShowViewerRequestVolume: boolean;
  26880. /**
  26881. * This property is for debugging only; it is not optimized for production use.
  26882. <p>
  26883. When true, draws labels to indicate the geometric error of each tile.
  26884. </p>
  26885. */
  26886. debugShowGeometricError: boolean;
  26887. /**
  26888. * This property is for debugging only; it is not optimized for production use.
  26889. <p>
  26890. When true, draws labels to indicate the number of commands, points, triangles and features of each tile.
  26891. </p>
  26892. */
  26893. debugShowRenderingStatistics: boolean;
  26894. /**
  26895. * This property is for debugging only; it is not optimized for production use.
  26896. <p>
  26897. When true, draws labels to indicate the geometry and texture memory usage of each tile.
  26898. </p>
  26899. */
  26900. debugShowMemoryUsage: boolean;
  26901. /**
  26902. * This property is for debugging only; it is not optimized for production use.
  26903. <p>
  26904. When true, draws labels to indicate the url of each tile.
  26905. </p>
  26906. */
  26907. debugShowUrl: boolean;
  26908. /**
  26909. * Gets the tileset's asset object property, which contains metadata about the tileset.
  26910. <p>
  26911. See the {@link https://github.com/CesiumGS/3d-tiles/tree/master/specification#reference-asset|asset schema reference}
  26912. in the 3D Tiles spec for the full set of properties.
  26913. </p>
  26914. */
  26915. readonly asset: any;
  26916. /**
  26917. * Gets the tileset's extensions object property.
  26918. */
  26919. readonly extensions: any;
  26920. /**
  26921. * The {@link ClippingPlaneCollection} used to selectively disable rendering the tileset.
  26922. */
  26923. clippingPlanes: ClippingPlaneCollection;
  26924. /**
  26925. * Gets the tileset's properties dictionary object, which contains metadata about per-feature properties.
  26926. <p>
  26927. See the {@link https://github.com/CesiumGS/3d-tiles/tree/master/specification#reference-properties|properties schema reference}
  26928. in the 3D Tiles spec for the full set of properties.
  26929. </p>
  26930. * @example
  26931. * console.log('Maximum building height: ' + tileset.properties.height.maximum);
  26932. console.log('Minimum building height: ' + tileset.properties.height.minimum);
  26933. */
  26934. readonly properties: any;
  26935. /**
  26936. * When <code>true</code>, the tileset's root tile is loaded and the tileset is ready to render.
  26937. This is set to <code>true</code> right before {@link Cesium3DTileset#readyPromise} is resolved.
  26938. */
  26939. readonly ready: boolean;
  26940. /**
  26941. * Gets the promise that will be resolved when the tileset's root tile is loaded and the tileset is ready to render.
  26942. <p>
  26943. This promise is resolved at the end of the frame before the first frame the tileset is rendered in.
  26944. </p>
  26945. * @example
  26946. * tileset.readyPromise.then(function(tileset) {
  26947. // tile.properties is not defined until readyPromise resolves.
  26948. var properties = tileset.properties;
  26949. if (Cesium.defined(properties)) {
  26950. for (var name in properties) {
  26951. console.log(properties[name]);
  26952. }
  26953. }
  26954. });
  26955. */
  26956. readonly readyPromise: Promise<Cesium3DTileset>;
  26957. /**
  26958. * When <code>true</code>, all tiles that meet the screen space error this frame are loaded. The tileset is
  26959. completely loaded for this view.
  26960. */
  26961. readonly tilesLoaded: boolean;
  26962. /**
  26963. * The url to a tileset JSON file.
  26964. */
  26965. readonly url: string;
  26966. /**
  26967. * The base path that non-absolute paths in tileset JSON file are relative to.
  26968. */
  26969. readonly basePath: string;
  26970. /**
  26971. * The style, defined using the
  26972. {@link https://github.com/CesiumGS/3d-tiles/tree/master/specification/Styling|3D Tiles Styling language},
  26973. applied to each feature in the tileset.
  26974. <p>
  26975. Assign <code>undefined</code> to remove the style, which will restore the visual
  26976. appearance of the tileset to its default when no style was applied.
  26977. </p>
  26978. <p>
  26979. The style is applied to a tile before the {@link Cesium3DTileset#tileVisible}
  26980. event is raised, so code in <code>tileVisible</code> can manually set a feature's
  26981. properties (e.g. color and show) after the style is applied. When
  26982. a new style is assigned any manually set properties are overwritten.
  26983. </p>
  26984. * @example
  26985. * tileset.style = new Cesium.Cesium3DTileStyle({
  26986. color : {
  26987. conditions : [
  26988. ['${Height} >= 100', 'color("purple", 0.5)'],
  26989. ['${Height} >= 50', 'color("red")'],
  26990. ['true', 'color("blue")']
  26991. ]
  26992. },
  26993. show : '${Height} > 0',
  26994. meta : {
  26995. description : '"Building id ${id} has height ${Height}."'
  26996. }
  26997. });
  26998. */
  26999. style: Cesium3DTileStyle | undefined;
  27000. /**
  27001. * The maximum screen space error used to drive level of detail refinement. This value helps determine when a tile
  27002. refines to its descendants, and therefore plays a major role in balancing performance with visual quality.
  27003. <p>
  27004. A tile's screen space error is roughly equivalent to the number of pixels wide that would be drawn if a sphere with a
  27005. radius equal to the tile's <b>geometric error</b> were rendered at the tile's position. If this value exceeds
  27006. <code>maximumScreenSpaceError</code> the tile refines to its descendants.
  27007. </p>
  27008. <p>
  27009. Depending on the tileset, <code>maximumScreenSpaceError</code> may need to be tweaked to achieve the right balance.
  27010. Higher values provide better performance but lower visual quality.
  27011. </p>
  27012. */
  27013. maximumScreenSpaceError: number;
  27014. /**
  27015. * The maximum amount of GPU memory (in MB) that may be used to cache tiles. This value is estimated from
  27016. geometry, textures, and batch table textures of loaded tiles. For point clouds, this value also
  27017. includes per-point metadata.
  27018. <p>
  27019. Tiles not in view are unloaded to enforce this.
  27020. </p>
  27021. <p>
  27022. If decreasing this value results in unloading tiles, the tiles are unloaded the next frame.
  27023. </p>
  27024. <p>
  27025. If tiles sized more than <code>maximumMemoryUsage</code> are needed
  27026. to meet the desired screen space error, determined by {@link Cesium3DTileset#maximumScreenSpaceError},
  27027. for the current view, then the memory usage of the tiles loaded will exceed
  27028. <code>maximumMemoryUsage</code>. For example, if the maximum is 256 MB, but
  27029. 300 MB of tiles are needed to meet the screen space error, then 300 MB of tiles may be loaded. When
  27030. these tiles go out of view, they will be unloaded.
  27031. </p>
  27032. */
  27033. maximumMemoryUsage: number;
  27034. /**
  27035. * The root tile.
  27036. */
  27037. readonly root: Cesium3DTile;
  27038. /**
  27039. * The tileset's bounding sphere.
  27040. * @example
  27041. * var tileset = viewer.scene.primitives.add(new Cesium.Cesium3DTileset({
  27042. url : 'http://localhost:8002/tilesets/Seattle/tileset.json'
  27043. }));
  27044. tileset.readyPromise.then(function(tileset) {
  27045. // Set the camera to view the newly added tileset
  27046. viewer.camera.viewBoundingSphere(tileset.boundingSphere, new Cesium.HeadingPitchRange(0, -0.5, 0));
  27047. });
  27048. */
  27049. readonly boundingSphere: BoundingSphere;
  27050. /**
  27051. * A 4x4 transformation matrix that transforms the entire tileset.
  27052. * @example
  27053. * // Adjust a tileset's height from the globe's surface.
  27054. var heightOffset = 20.0;
  27055. var boundingSphere = tileset.boundingSphere;
  27056. var cartographic = Cesium.Cartographic.fromCartesian(boundingSphere.center);
  27057. var surface = Cesium.Cartesian3.fromRadians(cartographic.longitude, cartographic.latitude, 0.0);
  27058. var offset = Cesium.Cartesian3.fromRadians(cartographic.longitude, cartographic.latitude, heightOffset);
  27059. var translation = Cesium.Cartesian3.subtract(offset, surface, new Cesium.Cartesian3());
  27060. tileset.modelMatrix = Cesium.Matrix4.fromTranslation(translation);
  27061. */
  27062. modelMatrix: Matrix4;
  27063. /**
  27064. * Returns the time, in milliseconds, since the tileset was loaded and first updated.
  27065. */
  27066. readonly timeSinceLoad: number;
  27067. /**
  27068. * The total amount of GPU memory in bytes used by the tileset. This value is estimated from
  27069. geometry, texture, and batch table textures of loaded tiles. For point clouds, this value also
  27070. includes per-point metadata.
  27071. */
  27072. readonly totalMemoryUsageInBytes: number;
  27073. /**
  27074. * Determines whether terrain, 3D Tiles or both will be classified by this tileset.
  27075. <p>
  27076. This option is only applied to tilesets containing batched 3D models, geometry data, or vector data. Even when undefined, vector data and geometry data
  27077. must render as classifications and will default to rendering on both terrain and other 3D Tiles tilesets.
  27078. </p>
  27079. <p>
  27080. When enabled for batched 3D model tilesets, there are a few requirements/limitations on the glTF:
  27081. <ul>
  27082. <li>POSITION and _BATCHID semantics are required.</li>
  27083. <li>All indices with the same batch id must occupy contiguous sections of the index buffer.</li>
  27084. <li>All shaders and techniques are ignored. The generated shader simply multiplies the position by the model-view-projection matrix.</li>
  27085. <li>The only supported extensions are CESIUM_RTC and WEB3D_quantized_attributes.</li>
  27086. <li>Only one node is supported.</li>
  27087. <li>Only one mesh per node is supported.</li>
  27088. <li>Only one primitive per mesh is supported.</li>
  27089. </ul>
  27090. </p>
  27091. */
  27092. readonly classificationType: ClassificationType;
  27093. /**
  27094. * Gets an ellipsoid describing the shape of the globe.
  27095. */
  27096. readonly ellipsoid: Ellipsoid;
  27097. /**
  27098. * Optimization option. Used when {@link Cesium3DTileset#foveatedScreenSpaceError} is true to control the cone size that determines which tiles are deferred.
  27099. 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}.
  27100. 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.
  27101. */
  27102. foveatedConeSize: number;
  27103. /**
  27104. * Optimization option. Used when {@link Cesium3DTileset#foveatedScreenSpaceError} is true to control the starting screen space error relaxation for tiles outside the foveated cone.
  27105. The screen space error will be raised starting with this value up to {@link Cesium3DTileset#maximumScreenSpaceError} based on the provided {@link Cesium3DTileset#foveatedInterpolationCallback}.
  27106. */
  27107. foveatedMinimumScreenSpaceErrorRelaxation: number;
  27108. /**
  27109. * Returns the <code>extras</code> property at the top-level of the tileset JSON, which contains application specific metadata.
  27110. Returns <code>undefined</code> if <code>extras</code> does not exist.
  27111. */
  27112. readonly extras: any;
  27113. /**
  27114. * Cesium adds lighting from the earth, sky, atmosphere, and star skybox. This cartesian is used to scale the final
  27115. diffuse and specular lighting contribution from those sources to the final color. A value of 0.0 will disable those light sources.
  27116. */
  27117. imageBasedLightingFactor: Cartesian2;
  27118. /**
  27119. * Provides a hook to override the method used to request the tileset json
  27120. useful when fetching tilesets from remote servers
  27121. * @param tilesetUrl - The url of the json file to be fetched
  27122. * @returns A promise that resolves with the fetched json data
  27123. */
  27124. static loadJson(tilesetUrl: Resource | string): Promise<object>;
  27125. /**
  27126. * Marks the tileset's {@link Cesium3DTileset#style} as dirty, which forces all
  27127. features to re-evaluate the style in the next frame each is visible.
  27128. */
  27129. makeStyleDirty(): void;
  27130. /**
  27131. * Unloads all tiles that weren't selected the previous frame. This can be used to
  27132. explicitly manage the tile cache and reduce the total number of tiles loaded below
  27133. {@link Cesium3DTileset#maximumMemoryUsage}.
  27134. <p>
  27135. Tile unloads occur at the next frame to keep all the WebGL delete calls
  27136. within the render loop.
  27137. </p>
  27138. */
  27139. trimLoadedTiles(): void;
  27140. /**
  27141. * <code>true</code> if the tileset JSON file lists the extension in extensionsUsed; otherwise, <code>false</code>.
  27142. * @param extensionName - The name of the extension to check.
  27143. * @returns <code>true</code> if the tileset JSON file lists the extension in extensionsUsed; otherwise, <code>false</code>.
  27144. */
  27145. hasExtension(extensionName: string): boolean;
  27146. /**
  27147. * Returns true if this object was destroyed; otherwise, false.
  27148. <br /><br />
  27149. If this object was destroyed, it should not be used; calling any function other than
  27150. <code>isDestroyed</code> will result in a {@link DeveloperError} exception.
  27151. * @returns <code>true</code> if this object was destroyed; otherwise, <code>false</code>.
  27152. */
  27153. isDestroyed(): boolean;
  27154. /**
  27155. * Destroys the WebGL resources held by this object. Destroying an object allows for deterministic
  27156. release of WebGL resources, instead of relying on the garbage collector to destroy this object.
  27157. <br /><br />
  27158. Once an object is destroyed, it should not be used; calling any function other than
  27159. <code>isDestroyed</code> will result in a {@link DeveloperError} exception. Therefore,
  27160. assign the return value (<code>undefined</code>) to the object as done in the example.
  27161. * @example
  27162. * tileset = tileset && tileset.destroy();
  27163. */
  27164. destroy(): void;
  27165. }
  27166. export namespace Cesium3DTileset {
  27167. /**
  27168. * 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,
  27169. interpolating between {@link Cesium3DTileset#foveatedMinimumScreenSpaceErrorRelaxation} and {@link Cesium3DTileset#maximumScreenSpaceError}.
  27170. * @param p - The start value to interpolate.
  27171. * @param q - The end value to interpolate.
  27172. * @param time - The time of interpolation generally in the range <code>[0.0, 1.0]</code>.
  27173. */
  27174. type foveatedInterpolationCallback = (p: number, q: number, time: number) => number;
  27175. }
  27176. /**
  27177. * A style that is applied to a {@link Cesium3DTileset}.
  27178. <p>
  27179. Evaluates an expression defined using the
  27180. {@link https://github.com/CesiumGS/3d-tiles/tree/master/specification/Styling|3D Tiles Styling language}.
  27181. </p>
  27182. * @example
  27183. * tileset.style = new Cesium.Cesium3DTileStyle({
  27184. color : {
  27185. conditions : [
  27186. ['${Height} >= 100', 'color("purple", 0.5)'],
  27187. ['${Height} >= 50', 'color("red")'],
  27188. ['true', 'color("blue")']
  27189. ]
  27190. },
  27191. show : '${Height} > 0',
  27192. meta : {
  27193. description : '"Building id ${id} has height ${Height}."'
  27194. }
  27195. });
  27196. * @example
  27197. * tileset.style = new Cesium.Cesium3DTileStyle({
  27198. color : 'vec4(${Temperature})',
  27199. pointSize : '${Temperature} * 2.0'
  27200. });
  27201. * @param [style] - The url of a style or an object defining a style.
  27202. */
  27203. export class Cesium3DTileStyle {
  27204. constructor(style?: Resource | string | any);
  27205. /**
  27206. * Gets the object defining the style using the
  27207. {@link https://github.com/CesiumGS/3d-tiles/tree/master/specification/Styling|3D Tiles Styling language}.
  27208. */
  27209. readonly style: any;
  27210. /**
  27211. * When <code>true</code>, the style is ready and its expressions can be evaluated. When
  27212. a style is constructed with an object, as opposed to a url, this is <code>true</code> immediately.
  27213. */
  27214. readonly ready: boolean;
  27215. /**
  27216. * Gets the promise that will be resolved when the the style is ready and its expressions can be evaluated.
  27217. */
  27218. readonly readyPromise: Promise<Cesium3DTileStyle>;
  27219. /**
  27220. * 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.
  27221. The getter will return the internal {@link Expression} or {@link ConditionsExpression}, which may differ from the value provided to the setter.
  27222. <p>
  27223. The expression must return or convert to a <code>Boolean</code>.
  27224. </p>
  27225. <p>
  27226. This expression is applicable to all tile formats.
  27227. </p>
  27228. * @example
  27229. * var style = new Cesium3DTileStyle({
  27230. show : '(regExp("^Chest").test(${County})) && (${YearBuilt} >= 1970)'
  27231. });
  27232. style.show.evaluate(feature); // returns true or false depending on the feature's properties
  27233. * @example
  27234. * var style = new Cesium.Cesium3DTileStyle();
  27235. // Override show expression with a custom function
  27236. style.show = {
  27237. evaluate : function(feature) {
  27238. return true;
  27239. }
  27240. };
  27241. * @example
  27242. * var style = new Cesium.Cesium3DTileStyle();
  27243. // Override show expression with a boolean
  27244. style.show = true;
  27245. };
  27246. * @example
  27247. * var style = new Cesium.Cesium3DTileStyle();
  27248. // Override show expression with a string
  27249. style.show = '${Height} > 0';
  27250. };
  27251. * @example
  27252. * var style = new Cesium.Cesium3DTileStyle();
  27253. // Override show expression with a condition
  27254. style.show = {
  27255. conditions: [
  27256. ['${height} > 2', 'false'],
  27257. ['true', 'true']
  27258. ];
  27259. };
  27260. */
  27261. show: StyleExpression;
  27262. /**
  27263. * 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.
  27264. The getter will return the internal {@link Expression} or {@link ConditionsExpression}, which may differ from the value provided to the setter.
  27265. <p>
  27266. The expression must return a <code>Color</code>.
  27267. </p>
  27268. <p>
  27269. This expression is applicable to all tile formats.
  27270. </p>
  27271. * @example
  27272. * var style = new Cesium3DTileStyle({
  27273. color : '(${Temperature} > 90) ? color("red") : color("white")'
  27274. });
  27275. style.color.evaluateColor(feature, result); // returns a Cesium.Color object
  27276. * @example
  27277. * var style = new Cesium.Cesium3DTileStyle();
  27278. // Override color expression with a custom function
  27279. style.color = {
  27280. evaluateColor : function(feature, result) {
  27281. return Cesium.Color.clone(Cesium.Color.WHITE, result);
  27282. }
  27283. };
  27284. * @example
  27285. * var style = new Cesium.Cesium3DTileStyle();
  27286. // Override color expression with a string
  27287. style.color = 'color("blue")';
  27288. * @example
  27289. * var style = new Cesium.Cesium3DTileStyle();
  27290. // Override color expression with a condition
  27291. style.color = {
  27292. conditions : [
  27293. ['${height} > 2', 'color("cyan")'],
  27294. ['true', 'color("blue")']
  27295. ]
  27296. };
  27297. */
  27298. color: StyleExpression;
  27299. /**
  27300. * 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.
  27301. The getter will return the internal {@link Expression} or {@link ConditionsExpression}, which may differ from the value provided to the setter.
  27302. <p>
  27303. The expression must return a <code>Number</code>.
  27304. </p>
  27305. <p>
  27306. This expression is only applicable to point features in a Vector tile or a Point Cloud tile.
  27307. </p>
  27308. * @example
  27309. * var style = new Cesium3DTileStyle({
  27310. pointSize : '(${Temperature} > 90) ? 2.0 : 1.0'
  27311. });
  27312. style.pointSize.evaluate(feature); // returns a Number
  27313. * @example
  27314. * var style = new Cesium.Cesium3DTileStyle();
  27315. // Override pointSize expression with a custom function
  27316. style.pointSize = {
  27317. evaluate : function(feature) {
  27318. return 1.0;
  27319. }
  27320. };
  27321. * @example
  27322. * var style = new Cesium.Cesium3DTileStyle();
  27323. // Override pointSize expression with a number
  27324. style.pointSize = 1.0;
  27325. * @example
  27326. * var style = new Cesium.Cesium3DTileStyle();
  27327. // Override pointSize expression with a string
  27328. style.pointSize = '${height} / 10';
  27329. * @example
  27330. * var style = new Cesium.Cesium3DTileStyle();
  27331. // Override pointSize expression with a condition
  27332. style.pointSize = {
  27333. conditions : [
  27334. ['${height} > 2', '1.0'],
  27335. ['true', '2.0']
  27336. ]
  27337. };
  27338. */
  27339. pointSize: StyleExpression;
  27340. /**
  27341. * 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.
  27342. The getter will return the internal {@link Expression} or {@link ConditionsExpression}, which may differ from the value provided to the setter.
  27343. <p>
  27344. The expression must return a <code>Color</code>.
  27345. </p>
  27346. <p>
  27347. This expression is only applicable to point features in a Vector tile.
  27348. </p>
  27349. * @example
  27350. * var style = new Cesium.Cesium3DTileStyle();
  27351. // Override pointOutlineColor expression with a string
  27352. style.pointOutlineColor = 'color("blue")';
  27353. * @example
  27354. * var style = new Cesium.Cesium3DTileStyle();
  27355. // Override pointOutlineColor expression with a condition
  27356. style.pointOutlineColor = {
  27357. conditions : [
  27358. ['${height} > 2', 'color("cyan")'],
  27359. ['true', 'color("blue")']
  27360. ]
  27361. };
  27362. */
  27363. pointOutlineColor: StyleExpression;
  27364. /**
  27365. * 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.
  27366. The getter will return the internal {@link Expression} or {@link ConditionsExpression}, which may differ from the value provided to the setter.
  27367. <p>
  27368. The expression must return a <code>Number</code>.
  27369. </p>
  27370. <p>
  27371. This expression is only applicable to point features in a Vector tile.
  27372. </p>
  27373. * @example
  27374. * var style = new Cesium.Cesium3DTileStyle();
  27375. // Override pointOutlineWidth expression with a string
  27376. style.pointOutlineWidth = '5';
  27377. * @example
  27378. * var style = new Cesium.Cesium3DTileStyle();
  27379. // Override pointOutlineWidth expression with a condition
  27380. style.pointOutlineWidth = {
  27381. conditions : [
  27382. ['${height} > 2', '5'],
  27383. ['true', '0']
  27384. ]
  27385. };
  27386. */
  27387. pointOutlineWidth: StyleExpression;
  27388. /**
  27389. * 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.
  27390. The getter will return the internal {@link Expression} or {@link ConditionsExpression}, which may differ from the value provided to the setter.
  27391. <p>
  27392. The expression must return a <code>Color</code>.
  27393. </p>
  27394. <p>
  27395. This expression is only applicable to point features in a Vector tile.
  27396. </p>
  27397. * @example
  27398. * var style = new Cesium.Cesium3DTileStyle();
  27399. // Override labelColor expression with a string
  27400. style.labelColor = 'color("blue")';
  27401. * @example
  27402. * var style = new Cesium.Cesium3DTileStyle();
  27403. // Override labelColor expression with a condition
  27404. style.labelColor = {
  27405. conditions : [
  27406. ['${height} > 2', 'color("cyan")'],
  27407. ['true', 'color("blue")']
  27408. ]
  27409. };
  27410. */
  27411. labelColor: StyleExpression;
  27412. /**
  27413. * 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.
  27414. The getter will return the internal {@link Expression} or {@link ConditionsExpression}, which may differ from the value provided to the setter.
  27415. <p>
  27416. The expression must return a <code>Color</code>.
  27417. </p>
  27418. <p>
  27419. This expression is only applicable to point features in a Vector tile.
  27420. </p>
  27421. * @example
  27422. * var style = new Cesium.Cesium3DTileStyle();
  27423. // Override labelOutlineColor expression with a string
  27424. style.labelOutlineColor = 'color("blue")';
  27425. * @example
  27426. * var style = new Cesium.Cesium3DTileStyle();
  27427. // Override labelOutlineColor expression with a condition
  27428. style.labelOutlineColor = {
  27429. conditions : [
  27430. ['${height} > 2', 'color("cyan")'],
  27431. ['true', 'color("blue")']
  27432. ]
  27433. };
  27434. */
  27435. labelOutlineColor: StyleExpression;
  27436. /**
  27437. * 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.
  27438. The getter will return the internal {@link Expression} or {@link ConditionsExpression}, which may differ from the value provided to the setter.
  27439. <p>
  27440. The expression must return a <code>Number</code>.
  27441. </p>
  27442. <p>
  27443. This expression is only applicable to point features in a Vector tile.
  27444. </p>
  27445. * @example
  27446. * var style = new Cesium.Cesium3DTileStyle();
  27447. // Override labelOutlineWidth expression with a string
  27448. style.labelOutlineWidth = '5';
  27449. * @example
  27450. * var style = new Cesium.Cesium3DTileStyle();
  27451. // Override labelOutlineWidth expression with a condition
  27452. style.labelOutlineWidth = {
  27453. conditions : [
  27454. ['${height} > 2', '5'],
  27455. ['true', '0']
  27456. ]
  27457. };
  27458. */
  27459. labelOutlineWidth: StyleExpression;
  27460. /**
  27461. * 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.
  27462. The getter will return the internal {@link Expression} or {@link ConditionsExpression}, which may differ from the value provided to the setter.
  27463. <p>
  27464. The expression must return a <code>String</code>.
  27465. </p>
  27466. <p>
  27467. This expression is only applicable to point features in a Vector tile.
  27468. </p>
  27469. * @example
  27470. * var style = new Cesium3DTileStyle({
  27471. font : '(${Temperature} > 90) ? "30px Helvetica" : "24px Helvetica"'
  27472. });
  27473. style.font.evaluate(feature); // returns a String
  27474. * @example
  27475. * var style = new Cesium.Cesium3DTileStyle();
  27476. // Override font expression with a custom function
  27477. style.font = {
  27478. evaluate : function(feature) {
  27479. return '24px Helvetica';
  27480. }
  27481. };
  27482. */
  27483. font: StyleExpression;
  27484. /**
  27485. * 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.
  27486. The getter will return the internal {@link Expression} or {@link ConditionsExpression}, which may differ from the value provided to the setter.
  27487. <p>
  27488. The expression must return a <code>LabelStyle</code>.
  27489. </p>
  27490. <p>
  27491. This expression is only applicable to point features in a Vector tile.
  27492. </p>
  27493. * @example
  27494. * var style = new Cesium3DTileStyle({
  27495. labelStyle : '(${Temperature} > 90) ? ' + LabelStyle.FILL_AND_OUTLINE + ' : ' + LabelStyle.FILL
  27496. });
  27497. style.labelStyle.evaluate(feature); // returns a LabelStyle
  27498. * @example
  27499. * var style = new Cesium.Cesium3DTileStyle();
  27500. // Override labelStyle expression with a custom function
  27501. style.labelStyle = {
  27502. evaluate : function(feature) {
  27503. return LabelStyle.FILL;
  27504. }
  27505. };
  27506. */
  27507. labelStyle: StyleExpression;
  27508. /**
  27509. * 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.
  27510. The getter will return the internal {@link Expression} or {@link ConditionsExpression}, which may differ from the value provided to the setter.
  27511. <p>
  27512. The expression must return a <code>String</code>.
  27513. </p>
  27514. <p>
  27515. This expression is only applicable to point features in a Vector tile.
  27516. </p>
  27517. * @example
  27518. * var style = new Cesium3DTileStyle({
  27519. labelText : '(${Temperature} > 90) ? ">90" : "<=90"'
  27520. });
  27521. style.labelText.evaluate(feature); // returns a String
  27522. * @example
  27523. * var style = new Cesium.Cesium3DTileStyle();
  27524. // Override labelText expression with a custom function
  27525. style.labelText = {
  27526. evaluate : function(feature) {
  27527. return 'Example label text';
  27528. }
  27529. };
  27530. */
  27531. labelText: StyleExpression;
  27532. /**
  27533. * 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.
  27534. The getter will return the internal {@link Expression} or {@link ConditionsExpression}, which may differ from the value provided to the setter.
  27535. <p>
  27536. The expression must return a <code>Color</code>.
  27537. </p>
  27538. <p>
  27539. This expression is only applicable to point features in a Vector tile.
  27540. </p>
  27541. * @example
  27542. * var style = new Cesium.Cesium3DTileStyle();
  27543. // Override backgroundColor expression with a string
  27544. style.backgroundColor = 'color("blue")';
  27545. * @example
  27546. * var style = new Cesium.Cesium3DTileStyle();
  27547. // Override backgroundColor expression with a condition
  27548. style.backgroundColor = {
  27549. conditions : [
  27550. ['${height} > 2', 'color("cyan")'],
  27551. ['true', 'color("blue")']
  27552. ]
  27553. };
  27554. */
  27555. backgroundColor: StyleExpression;
  27556. /**
  27557. * 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.
  27558. The getter will return the internal {@link Expression} or {@link ConditionsExpression}, which may differ from the value provided to the setter.
  27559. <p>
  27560. The expression must return a <code>Cartesian2</code>.
  27561. </p>
  27562. <p>
  27563. This expression is only applicable to point features in a Vector tile.
  27564. </p>
  27565. * @example
  27566. * var style = new Cesium.Cesium3DTileStyle();
  27567. // Override backgroundPadding expression with a string
  27568. style.backgroundPadding = 'vec2(5.0, 7.0)';
  27569. style.backgroundPadding.evaluate(feature); // returns a Cartesian2
  27570. */
  27571. backgroundPadding: StyleExpression;
  27572. /**
  27573. * 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.
  27574. The getter will return the internal {@link Expression} or {@link ConditionsExpression}, which may differ from the value provided to the setter.
  27575. <p>
  27576. The expression must return a <code>Boolean</code>.
  27577. </p>
  27578. <p>
  27579. This expression is only applicable to point features in a Vector tile.
  27580. </p>
  27581. * @example
  27582. * var style = new Cesium.Cesium3DTileStyle();
  27583. // Override backgroundEnabled expression with a string
  27584. style.backgroundEnabled = 'true';
  27585. * @example
  27586. * var style = new Cesium.Cesium3DTileStyle();
  27587. // Override backgroundEnabled expression with a condition
  27588. style.backgroundEnabled = {
  27589. conditions : [
  27590. ['${height} > 2', 'true'],
  27591. ['true', 'false']
  27592. ]
  27593. };
  27594. */
  27595. backgroundEnabled: StyleExpression;
  27596. /**
  27597. * 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.
  27598. The getter will return the internal {@link Expression} or {@link ConditionsExpression}, which may differ from the value provided to the setter.
  27599. <p>
  27600. The expression must return a <code>Cartesian4</code>.
  27601. </p>
  27602. <p>
  27603. This expression is only applicable to point features in a Vector tile.
  27604. </p>
  27605. * @example
  27606. * var style = new Cesium.Cesium3DTileStyle();
  27607. // Override scaleByDistance expression with a string
  27608. style.scaleByDistance = 'vec4(1.5e2, 2.0, 1.5e7, 0.5)';
  27609. style.scaleByDistance.evaluate(feature); // returns a Cartesian4
  27610. */
  27611. scaleByDistance: StyleExpression;
  27612. /**
  27613. * 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.
  27614. The getter will return the internal {@link Expression} or {@link ConditionsExpression}, which may differ from the value provided to the setter.
  27615. <p>
  27616. The expression must return a <code>Cartesian4</code>.
  27617. </p>
  27618. <p>
  27619. This expression is only applicable to point features in a Vector tile.
  27620. </p>
  27621. * @example
  27622. * var style = new Cesium.Cesium3DTileStyle();
  27623. // Override translucencyByDistance expression with a string
  27624. style.translucencyByDistance = 'vec4(1.5e2, 1.0, 1.5e7, 0.2)';
  27625. style.translucencyByDistance.evaluate(feature); // returns a Cartesian4
  27626. */
  27627. translucencyByDistance: StyleExpression;
  27628. /**
  27629. * 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.
  27630. The getter will return the internal {@link Expression} or {@link ConditionsExpression}, which may differ from the value provided to the setter.
  27631. <p>
  27632. The expression must return a <code>Cartesian2</code>.
  27633. </p>
  27634. <p>
  27635. This expression is only applicable to point features in a Vector tile.
  27636. </p>
  27637. * @example
  27638. * var style = new Cesium.Cesium3DTileStyle();
  27639. // Override distanceDisplayCondition expression with a string
  27640. style.distanceDisplayCondition = 'vec2(0.0, 5.5e6)';
  27641. style.distanceDisplayCondition.evaluate(feature); // returns a Cartesian2
  27642. */
  27643. distanceDisplayCondition: StyleExpression;
  27644. /**
  27645. * 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.
  27646. The getter will return the internal {@link Expression} or {@link ConditionsExpression}, which may differ from the value provided to the setter.
  27647. <p>
  27648. The expression must return a <code>Number</code>.
  27649. </p>
  27650. <p>
  27651. This expression is only applicable to point features in a Vector tile.
  27652. </p>
  27653. * @example
  27654. * var style = new Cesium.Cesium3DTileStyle();
  27655. // Override heightOffset expression with a string
  27656. style.heightOffset = '2.0';
  27657. * @example
  27658. * var style = new Cesium.Cesium3DTileStyle();
  27659. // Override heightOffset expression with a condition
  27660. style.heightOffset = {
  27661. conditions : [
  27662. ['${height} > 2', '4.0'],
  27663. ['true', '2.0']
  27664. ]
  27665. };
  27666. */
  27667. heightOffset: StyleExpression;
  27668. /**
  27669. * 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.
  27670. The getter will return the internal {@link Expression} or {@link ConditionsExpression}, which may differ from the value provided to the setter.
  27671. <p>
  27672. The expression must return a <code>Boolean</code>.
  27673. </p>
  27674. <p>
  27675. This expression is only applicable to point features in a Vector tile.
  27676. </p>
  27677. * @example
  27678. * var style = new Cesium.Cesium3DTileStyle();
  27679. // Override anchorLineEnabled expression with a string
  27680. style.anchorLineEnabled = 'true';
  27681. * @example
  27682. * var style = new Cesium.Cesium3DTileStyle();
  27683. // Override anchorLineEnabled expression with a condition
  27684. style.anchorLineEnabled = {
  27685. conditions : [
  27686. ['${height} > 2', 'true'],
  27687. ['true', 'false']
  27688. ]
  27689. };
  27690. */
  27691. anchorLineEnabled: StyleExpression;
  27692. /**
  27693. * 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.
  27694. The getter will return the internal {@link Expression} or {@link ConditionsExpression}, which may differ from the value provided to the setter.
  27695. <p>
  27696. The expression must return a <code>Color</code>.
  27697. </p>
  27698. <p>
  27699. This expression is only applicable to point features in a Vector tile.
  27700. </p>
  27701. * @example
  27702. * var style = new Cesium.Cesium3DTileStyle();
  27703. // Override anchorLineColor expression with a string
  27704. style.anchorLineColor = 'color("blue")';
  27705. * @example
  27706. * var style = new Cesium.Cesium3DTileStyle();
  27707. // Override anchorLineColor expression with a condition
  27708. style.anchorLineColor = {
  27709. conditions : [
  27710. ['${height} > 2', 'color("cyan")'],
  27711. ['true', 'color("blue")']
  27712. ]
  27713. };
  27714. */
  27715. anchorLineColor: StyleExpression;
  27716. /**
  27717. * 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.
  27718. The getter will return the internal {@link Expression} or {@link ConditionsExpression}, which may differ from the value provided to the setter.
  27719. <p>
  27720. The expression must return a <code>String</code>.
  27721. </p>
  27722. <p>
  27723. This expression is only applicable to point features in a Vector tile.
  27724. </p>
  27725. * @example
  27726. * var style = new Cesium3DTileStyle({
  27727. image : '(${Temperature} > 90) ? "/url/to/image1" : "/url/to/image2"'
  27728. });
  27729. style.image.evaluate(feature); // returns a String
  27730. * @example
  27731. * var style = new Cesium.Cesium3DTileStyle();
  27732. // Override image expression with a custom function
  27733. style.image = {
  27734. evaluate : function(feature) {
  27735. return '/url/to/image';
  27736. }
  27737. };
  27738. */
  27739. image: StyleExpression;
  27740. /**
  27741. * 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.
  27742. The getter will return the internal {@link Expression} or {@link ConditionsExpression}, which may differ from the value provided to the setter.
  27743. <p>
  27744. The expression must return a <code>Number</code>.
  27745. </p>
  27746. <p>
  27747. This expression is only applicable to point features in a Vector tile.
  27748. </p>
  27749. * @example
  27750. * var style = new Cesium.Cesium3DTileStyle();
  27751. // Override disableDepthTestDistance expression with a string
  27752. style.disableDepthTestDistance = '1000.0';
  27753. style.disableDepthTestDistance.evaluate(feature); // returns a Number
  27754. */
  27755. disableDepthTestDistance: StyleExpression;
  27756. /**
  27757. * 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.
  27758. The getter will return the internal {@link Expression} or {@link ConditionsExpression}, which may differ from the value provided to the setter.
  27759. <p>
  27760. The expression must return a <code>HorizontalOrigin</code>.
  27761. </p>
  27762. <p>
  27763. This expression is only applicable to point features in a Vector tile.
  27764. </p>
  27765. * @example
  27766. * var style = new Cesium3DTileStyle({
  27767. horizontalOrigin : HorizontalOrigin.LEFT
  27768. });
  27769. style.horizontalOrigin.evaluate(feature); // returns a HorizontalOrigin
  27770. * @example
  27771. * var style = new Cesium.Cesium3DTileStyle();
  27772. // Override horizontalOrigin expression with a custom function
  27773. style.horizontalOrigin = {
  27774. evaluate : function(feature) {
  27775. return HorizontalOrigin.CENTER;
  27776. }
  27777. };
  27778. */
  27779. horizontalOrigin: StyleExpression;
  27780. /**
  27781. * 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.
  27782. The getter will return the internal {@link Expression} or {@link ConditionsExpression}, which may differ from the value provided to the setter.
  27783. <p>
  27784. The expression must return a <code>VerticalOrigin</code>.
  27785. </p>
  27786. <p>
  27787. This expression is only applicable to point features in a Vector tile.
  27788. </p>
  27789. * @example
  27790. * var style = new Cesium3DTileStyle({
  27791. verticalOrigin : VerticalOrigin.TOP
  27792. });
  27793. style.verticalOrigin.evaluate(feature); // returns a VerticalOrigin
  27794. * @example
  27795. * var style = new Cesium.Cesium3DTileStyle();
  27796. // Override verticalOrigin expression with a custom function
  27797. style.verticalOrigin = {
  27798. evaluate : function(feature) {
  27799. return VerticalOrigin.CENTER;
  27800. }
  27801. };
  27802. */
  27803. verticalOrigin: StyleExpression;
  27804. /**
  27805. * 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.
  27806. The getter will return the internal {@link Expression} or {@link ConditionsExpression}, which may differ from the value provided to the setter.
  27807. <p>
  27808. The expression must return a <code>HorizontalOrigin</code>.
  27809. </p>
  27810. <p>
  27811. This expression is only applicable to point features in a Vector tile.
  27812. </p>
  27813. * @example
  27814. * var style = new Cesium3DTileStyle({
  27815. labelHorizontalOrigin : HorizontalOrigin.LEFT
  27816. });
  27817. style.labelHorizontalOrigin.evaluate(feature); // returns a HorizontalOrigin
  27818. * @example
  27819. * var style = new Cesium.Cesium3DTileStyle();
  27820. // Override labelHorizontalOrigin expression with a custom function
  27821. style.labelHorizontalOrigin = {
  27822. evaluate : function(feature) {
  27823. return HorizontalOrigin.CENTER;
  27824. }
  27825. };
  27826. */
  27827. labelHorizontalOrigin: StyleExpression;
  27828. /**
  27829. * 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.
  27830. The getter will return the internal {@link Expression} or {@link ConditionsExpression}, which may differ from the value provided to the setter.
  27831. <p>
  27832. The expression must return a <code>VerticalOrigin</code>.
  27833. </p>
  27834. <p>
  27835. This expression is only applicable to point features in a Vector tile.
  27836. </p>
  27837. * @example
  27838. * var style = new Cesium3DTileStyle({
  27839. labelVerticalOrigin : VerticalOrigin.TOP
  27840. });
  27841. style.labelVerticalOrigin.evaluate(feature); // returns a VerticalOrigin
  27842. * @example
  27843. * var style = new Cesium.Cesium3DTileStyle();
  27844. // Override labelVerticalOrigin expression with a custom function
  27845. style.labelVerticalOrigin = {
  27846. evaluate : function(feature) {
  27847. return VerticalOrigin.CENTER;
  27848. }
  27849. };
  27850. */
  27851. labelVerticalOrigin: StyleExpression;
  27852. /**
  27853. * Gets or sets the object containing application-specific expression that can be explicitly
  27854. evaluated, e.g., for display in a UI.
  27855. * @example
  27856. * var style = new Cesium3DTileStyle({
  27857. meta : {
  27858. description : '"Building id ${id} has height ${Height}."'
  27859. }
  27860. });
  27861. style.meta.description.evaluate(feature); // returns a String with the substituted variables
  27862. */
  27863. meta: StyleExpression;
  27864. }
  27865. /**
  27866. * A ParticleEmitter that emits particles from a circle.
  27867. Particles will be positioned within a circle and have initial velocities going along the z vector.
  27868. * @param [radius = 1.0] - The radius of the circle in meters.
  27869. */
  27870. export class CircleEmitter {
  27871. constructor(radius?: number);
  27872. /**
  27873. * The radius of the circle in meters.
  27874. */
  27875. radius: number;
  27876. /**
  27877. * The angle of the cone in radians.
  27878. */
  27879. angle: number;
  27880. }
  27881. /**
  27882. * A classification primitive represents a volume enclosing geometry in the {@link Scene} to be highlighted.
  27883. <p>
  27884. A primitive combines geometry instances with an {@link Appearance} that describes the full shading, including
  27885. {@link Material} and {@link RenderState}. Roughly, the geometry instance defines the structure and placement,
  27886. and the appearance defines the visual characteristics. Decoupling geometry and appearance allows us to mix
  27887. and match most of them and add a new geometry or appearance independently of each other.
  27888. Only {@link PerInstanceColorAppearance} with the same color across all instances is supported at this time when using
  27889. ClassificationPrimitive directly.
  27890. For full {@link Appearance} support when classifying terrain or 3D Tiles use {@link GroundPrimitive} instead.
  27891. </p>
  27892. <p>
  27893. For correct rendering, this feature requires the EXT_frag_depth WebGL extension. For hardware that do not support this extension, there
  27894. will be rendering artifacts for some viewing angles.
  27895. </p>
  27896. <p>
  27897. Valid geometries are {@link BoxGeometry}, {@link CylinderGeometry}, {@link EllipsoidGeometry}, {@link PolylineVolumeGeometry}, and {@link SphereGeometry}.
  27898. </p>
  27899. <p>
  27900. Geometries that follow the surface of the ellipsoid, such as {@link CircleGeometry}, {@link CorridorGeometry}, {@link EllipseGeometry}, {@link PolygonGeometry}, and {@link RectangleGeometry},
  27901. are also valid if they are extruded volumes; otherwise, they will not be rendered.
  27902. </p>
  27903. * @param [options] - Object with the following properties:
  27904. * @param [options.geometryInstances] - The geometry instances to render. This can either be a single instance or an array of length one.
  27905. * @param [options.appearance] - The appearance used to render the primitive. Defaults to PerInstanceColorAppearance when GeometryInstances have a color attribute.
  27906. * @param [options.show = true] - Determines if this primitive will be shown.
  27907. * @param [options.vertexCacheOptimize = false] - When <code>true</code>, geometry vertices are optimized for the pre and post-vertex-shader caches.
  27908. * @param [options.interleave = false] - When <code>true</code>, geometry vertex attributes are interleaved, which can slightly improve rendering performance but increases load time.
  27909. * @param [options.compressVertices = true] - When <code>true</code>, the geometry vertices are compressed, which will save memory.
  27910. * @param [options.releaseGeometryInstances = true] - When <code>true</code>, the primitive does not keep a reference to the input <code>geometryInstances</code> to save memory.
  27911. * @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.
  27912. * @param [options.asynchronous = true] - Determines if the primitive will be created asynchronously or block until ready. If false initializeTerrainHeights() must be called first.
  27913. * @param [options.classificationType = ClassificationType.BOTH] - Determines whether terrain, 3D Tiles or both will be classified.
  27914. * @param [options.debugShowBoundingVolume = false] - For debugging only. Determines if this primitive's commands' bounding spheres are shown.
  27915. * @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
  27916. creation for the volumes to be created before the geometry is released or options.releaseGeometryInstance must be <code>false</code>.
  27917. */
  27918. export class ClassificationPrimitive {
  27919. constructor(options?: {
  27920. geometryInstances?: any[] | GeometryInstance;
  27921. appearance?: Appearance;
  27922. show?: boolean;
  27923. vertexCacheOptimize?: boolean;
  27924. interleave?: boolean;
  27925. compressVertices?: boolean;
  27926. releaseGeometryInstances?: boolean;
  27927. allowPicking?: boolean;
  27928. asynchronous?: boolean;
  27929. classificationType?: ClassificationType;
  27930. debugShowBoundingVolume?: boolean;
  27931. debugShowShadowVolume?: boolean;
  27932. });
  27933. /**
  27934. * The geometry instance rendered with this primitive. This may
  27935. be <code>undefined</code> if <code>options.releaseGeometryInstances</code>
  27936. is <code>true</code> when the primitive is constructed.
  27937. <p>
  27938. Changing this property after the primitive is rendered has no effect.
  27939. </p>
  27940. <p>
  27941. Because of the rendering technique used, all geometry instances must be the same color.
  27942. If there is an instance with a differing color, a <code>DeveloperError</code> will be thrown
  27943. on the first attempt to render.
  27944. </p>
  27945. */
  27946. readonly geometryInstances: any[] | GeometryInstance;
  27947. /**
  27948. * Determines if the primitive will be shown. This affects all geometry
  27949. instances in the primitive.
  27950. */
  27951. show: boolean;
  27952. /**
  27953. * Determines whether terrain, 3D Tiles or both will be classified.
  27954. */
  27955. classificationType: ClassificationType;
  27956. /**
  27957. * This property is for debugging only; it is not for production use nor is it optimized.
  27958. <p>
  27959. Draws the bounding sphere for each draw command in the primitive.
  27960. </p>
  27961. */
  27962. debugShowBoundingVolume: boolean;
  27963. /**
  27964. * This property is for debugging only; it is not for production use nor is it optimized.
  27965. <p>
  27966. Draws the shadow volume for each geometry in the primitive.
  27967. </p>
  27968. */
  27969. debugShowShadowVolume: boolean;
  27970. /**
  27971. * When <code>true</code>, geometry vertices are optimized for the pre and post-vertex-shader caches.
  27972. */
  27973. readonly vertexCacheOptimize: boolean;
  27974. /**
  27975. * Determines if geometry vertex attributes are interleaved, which can slightly improve rendering performance.
  27976. */
  27977. readonly interleave: boolean;
  27978. /**
  27979. * When <code>true</code>, the primitive does not keep a reference to the input <code>geometryInstances</code> to save memory.
  27980. */
  27981. readonly releaseGeometryInstances: boolean;
  27982. /**
  27983. * When <code>true</code>, each geometry instance will only be pickable with {@link Scene#pick}. When <code>false</code>, GPU memory is saved.
  27984. */
  27985. readonly allowPicking: boolean;
  27986. /**
  27987. * Determines if the geometry instances will be created and batched on a web worker.
  27988. */
  27989. readonly asynchronous: boolean;
  27990. /**
  27991. * When <code>true</code>, geometry vertices are compressed, which will save memory.
  27992. */
  27993. readonly compressVertices: boolean;
  27994. /**
  27995. * Determines if the primitive is complete and ready to render. If this property is
  27996. true, the primitive will be rendered the next time that {@link ClassificationPrimitive#update}
  27997. is called.
  27998. */
  27999. readonly ready: boolean;
  28000. /**
  28001. * Gets a promise that resolves when the primitive is ready to render.
  28002. */
  28003. readonly readyPromise: Promise<ClassificationPrimitive>;
  28004. /**
  28005. * Determines if ClassificationPrimitive rendering is supported.
  28006. * @param scene - The scene.
  28007. * @returns <code>true</code> if ClassificationPrimitives are supported; otherwise, returns <code>false</code>
  28008. */
  28009. static isSupported(scene: Scene): boolean;
  28010. /**
  28011. * Called when {@link Viewer} or {@link CesiumWidget} render the scene to
  28012. get the draw commands needed to render this primitive.
  28013. <p>
  28014. Do not call this function directly. This is documented just to
  28015. list the exceptions that may be propagated when the scene is rendered:
  28016. </p>
  28017. */
  28018. update(): void;
  28019. /**
  28020. * Returns the modifiable per-instance attributes for a {@link GeometryInstance}.
  28021. * @example
  28022. * var attributes = primitive.getGeometryInstanceAttributes('an id');
  28023. attributes.color = Cesium.ColorGeometryInstanceAttribute.toValue(Cesium.Color.AQUA);
  28024. attributes.show = Cesium.ShowGeometryInstanceAttribute.toValue(true);
  28025. * @param id - The id of the {@link GeometryInstance}.
  28026. * @returns The typed array in the attribute's format or undefined if the is no instance with id.
  28027. */
  28028. getGeometryInstanceAttributes(id: any): any;
  28029. /**
  28030. * Returns true if this object was destroyed; otherwise, false.
  28031. <p>
  28032. If this object was destroyed, it should not be used; calling any function other than
  28033. <code>isDestroyed</code> will result in a {@link DeveloperError} exception.
  28034. </p>
  28035. * @returns <code>true</code> if this object was destroyed; otherwise, <code>false</code>.
  28036. */
  28037. isDestroyed(): boolean;
  28038. /**
  28039. * Destroys the WebGL resources held by this object. Destroying an object allows for deterministic
  28040. release of WebGL resources, instead of relying on the garbage collector to destroy this object.
  28041. <p>
  28042. Once an object is destroyed, it should not be used; calling any function other than
  28043. <code>isDestroyed</code> will result in a {@link DeveloperError} exception. Therefore,
  28044. assign the return value (<code>undefined</code>) to the object as done in the example.
  28045. </p>
  28046. * @example
  28047. * e = e && e.destroy();
  28048. */
  28049. destroy(): void;
  28050. }
  28051. /**
  28052. * Whether a classification affects terrain, 3D Tiles or both.
  28053. */
  28054. export enum ClassificationType {
  28055. /**
  28056. * Only terrain will be classified.
  28057. */
  28058. TERRAIN = 0,
  28059. /**
  28060. * Only 3D Tiles will be classified.
  28061. */
  28062. CESIUM_3D_TILE = 1,
  28063. /**
  28064. * Both terrain and 3D Tiles will be classified.
  28065. */
  28066. BOTH = 2
  28067. }
  28068. /**
  28069. * A Plane in Hessian Normal form to be used with {@link ClippingPlaneCollection}.
  28070. Compatible with mathematics functions in {@link Plane}
  28071. * @param normal - The plane's normal (normalized).
  28072. * @param distance - The shortest distance from the origin to the plane. The sign of
  28073. <code>distance</code> determines which side of the plane the origin
  28074. is on. If <code>distance</code> is positive, the origin is in the half-space
  28075. in the direction of the normal; if negative, the origin is in the half-space
  28076. opposite to the normal; if zero, the plane passes through the origin.
  28077. */
  28078. export class ClippingPlane {
  28079. constructor(normal: Cartesian3, distance: number);
  28080. /**
  28081. * The shortest distance from the origin to the plane. The sign of
  28082. <code>distance</code> determines which side of the plane the origin
  28083. is on. If <code>distance</code> is positive, the origin is in the half-space
  28084. in the direction of the normal; if negative, the origin is in the half-space
  28085. opposite to the normal; if zero, the plane passes through the origin.
  28086. */
  28087. distance: number;
  28088. /**
  28089. * The plane's normal.
  28090. */
  28091. normal: Cartesian3;
  28092. /**
  28093. * Create a ClippingPlane from a Plane object.
  28094. * @param plane - The plane containing parameters to copy
  28095. * @param [result] - The object on which to store the result
  28096. * @returns The ClippingPlane generated from the plane's parameters.
  28097. */
  28098. static fromPlane(plane: Plane, result?: ClippingPlane): ClippingPlane;
  28099. /**
  28100. * Clones the ClippingPlane without setting its ownership.
  28101. * @param clippingPlane - The ClippingPlane to be cloned
  28102. * @param [result] - The object on which to store the cloned parameters.
  28103. * @returns a clone of the input ClippingPlane
  28104. */
  28105. static clone(clippingPlane: ClippingPlane, result?: ClippingPlane): ClippingPlane;
  28106. }
  28107. /**
  28108. * Specifies a set of clipping planes. Clipping planes selectively disable rendering in a region on the
  28109. outside of the specified list of {@link ClippingPlane} objects for a single gltf model, 3D Tileset, or the globe.
  28110. <p>
  28111. 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
  28112. through the center of the object.
  28113. </p>
  28114. <p>
  28115. 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.
  28116. </p>
  28117. * @example
  28118. * // This clipping plane's distance is positive, which means its normal
  28119. // is facing the origin. This will clip everything that is behind
  28120. // the plane, which is anything with y coordinate < -5.
  28121. var clippingPlanes = new Cesium.ClippingPlaneCollection({
  28122. planes : [
  28123. new Cesium.ClippingPlane(new Cesium.Cartesian3(0.0, 1.0, 0.0), 5.0)
  28124. ],
  28125. });
  28126. // Create an entity and attach the ClippingPlaneCollection to the model.
  28127. var entity = viewer.entities.add({
  28128. position : Cesium.Cartesian3.fromDegrees(-123.0744619, 44.0503706, 10000),
  28129. model : {
  28130. uri : 'model.gltf',
  28131. minimumPixelSize : 128,
  28132. maximumScale : 20000,
  28133. clippingPlanes : clippingPlanes
  28134. }
  28135. });
  28136. viewer.zoomTo(entity);
  28137. * @param [options] - Object with the following properties:
  28138. * @param [options.planes = []] - An array of {@link ClippingPlane} objects used to selectively disable rendering on the outside of each plane.
  28139. * @param [options.enabled = true] - Determines whether the clipping planes are active.
  28140. * @param [options.modelMatrix = Matrix4.IDENTITY] - The 4x4 transformation matrix specifying an additional transform relative to the clipping planes original coordinate system.
  28141. * @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.
  28142. * @param [options.edgeColor = Color.WHITE] - The color applied to highlight the edge along which an object is clipped.
  28143. * @param [options.edgeWidth = 0.0] - The width, in pixels, of the highlight applied to the edge along which an object is clipped.
  28144. */
  28145. export class ClippingPlaneCollection {
  28146. constructor(options?: {
  28147. planes?: ClippingPlane[];
  28148. enabled?: boolean;
  28149. modelMatrix?: Matrix4;
  28150. unionClippingRegions?: boolean;
  28151. edgeColor?: Color;
  28152. edgeWidth?: number;
  28153. });
  28154. /**
  28155. * The 4x4 transformation matrix specifying an additional transform relative to the clipping planes
  28156. original coordinate system.
  28157. */
  28158. modelMatrix: Matrix4;
  28159. /**
  28160. * The color applied to highlight the edge along which an object is clipped.
  28161. */
  28162. edgeColor: Color;
  28163. /**
  28164. * The width, in pixels, of the highlight applied to the edge along which an object is clipped.
  28165. */
  28166. edgeWidth: number;
  28167. /**
  28168. * An event triggered when a new clipping plane is added to the collection. Event handlers
  28169. are passed the new plane and the index at which it was added.
  28170. */
  28171. planeAdded: Event;
  28172. /**
  28173. * An event triggered when a new clipping plane is removed from the collection. Event handlers
  28174. are passed the new plane and the index from which it was removed.
  28175. */
  28176. planeRemoved: Event;
  28177. /**
  28178. * Returns the number of planes in this collection. This is commonly used with
  28179. {@link ClippingPlaneCollection#get} to iterate over all the planes
  28180. in the collection.
  28181. */
  28182. readonly length: number;
  28183. /**
  28184. * If true, a region will be clipped if it is on the outside of any plane in the
  28185. collection. Otherwise, a region will only be clipped if it is on the
  28186. outside of every plane.
  28187. */
  28188. unionClippingRegions: boolean;
  28189. /**
  28190. * If true, clipping will be enabled.
  28191. */
  28192. enabled: boolean;
  28193. /**
  28194. * Adds the specified {@link ClippingPlane} to the collection to be used to selectively disable rendering
  28195. on the outside of each plane. Use {@link ClippingPlaneCollection#unionClippingRegions} to modify
  28196. how modify the clipping behavior of multiple planes.
  28197. * @param plane - The ClippingPlane to add to the collection.
  28198. */
  28199. add(plane: ClippingPlane): void;
  28200. /**
  28201. * Returns the plane in the collection at the specified index. Indices are zero-based
  28202. and increase as planes are added. Removing a plane shifts all planes after
  28203. it to the left, changing their indices. This function is commonly used with
  28204. {@link ClippingPlaneCollection#length} to iterate over all the planes
  28205. in the collection.
  28206. * @param index - The zero-based index of the plane.
  28207. * @returns The ClippingPlane at the specified index.
  28208. */
  28209. get(index: number): ClippingPlane;
  28210. /**
  28211. * Checks whether this collection contains a ClippingPlane equal to the given ClippingPlane.
  28212. * @param [clippingPlane] - The ClippingPlane to check for.
  28213. * @returns true if this collection contains the ClippingPlane, false otherwise.
  28214. */
  28215. contains(clippingPlane?: ClippingPlane): boolean;
  28216. /**
  28217. * Removes the first occurrence of the given ClippingPlane from the collection.
  28218. * @returns <code>true</code> if the plane was removed; <code>false</code> if the plane was not found in the collection.
  28219. */
  28220. remove(clippingPlane: ClippingPlane): boolean;
  28221. /**
  28222. * Removes all planes from the collection.
  28223. */
  28224. removeAll(): void;
  28225. /**
  28226. * Called when {@link Viewer} or {@link CesiumWidget} render the scene to
  28227. build the resources for clipping planes.
  28228. <p>
  28229. Do not call this function directly.
  28230. </p>
  28231. */
  28232. update(): void;
  28233. /**
  28234. * Returns true if this object was destroyed; otherwise, false.
  28235. <br /><br />
  28236. If this object was destroyed, it should not be used; calling any function other than
  28237. <code>isDestroyed</code> will result in a {@link DeveloperError} exception.
  28238. * @returns <code>true</code> if this object was destroyed; otherwise, <code>false</code>.
  28239. */
  28240. isDestroyed(): boolean;
  28241. /**
  28242. * Destroys the WebGL resources held by this object. Destroying an object allows for deterministic
  28243. release of WebGL resources, instead of relying on the garbage collector to destroy this object.
  28244. <br /><br />
  28245. Once an object is destroyed, it should not be used; calling any function other than
  28246. <code>isDestroyed</code> will result in a {@link DeveloperError} exception. Therefore,
  28247. assign the return value (<code>undefined</code>) to the object as done in the example.
  28248. * @example
  28249. * clippingPlanes = clippingPlanes && clippingPlanes.destroy();
  28250. */
  28251. destroy(): void;
  28252. }
  28253. /**
  28254. * Defines different modes for blending between a target color and a primitive's source color.
  28255. HIGHLIGHT multiplies the source color by the target color
  28256. REPLACE replaces the source color with the target color
  28257. MIX blends the source color and target color together
  28258. */
  28259. export enum ColorBlendMode {
  28260. HIGHLIGHT = 0,
  28261. REPLACE = 1,
  28262. MIX = 2
  28263. }
  28264. /**
  28265. * An expression for a style applied to a {@link Cesium3DTileset}.
  28266. <p>
  28267. Evaluates a conditions expression defined using the
  28268. {@link https://github.com/CesiumGS/3d-tiles/tree/master/specification/Styling|3D Tiles Styling language}.
  28269. </p>
  28270. <p>
  28271. Implements the {@link StyleExpression} interface.
  28272. </p>
  28273. * @example
  28274. * var expression = new Cesium.ConditionsExpression({
  28275. conditions : [
  28276. ['${Area} > 10, 'color("#FF0000")'],
  28277. ['${id} !== "1"', 'color("#00FF00")'],
  28278. ['true', 'color("#FFFFFF")']
  28279. ]
  28280. });
  28281. expression.evaluateColor(feature, result); // returns a Cesium.Color object
  28282. * @param [conditionsExpression] - The conditions expression defined using the 3D Tiles Styling language.
  28283. * @param [defines] - Defines in the style.
  28284. */
  28285. export class ConditionsExpression {
  28286. constructor(conditionsExpression?: any, defines?: any);
  28287. /**
  28288. * Gets the conditions expression defined in the 3D Tiles Styling language.
  28289. */
  28290. readonly conditionsExpression: any;
  28291. /**
  28292. * Evaluates the result of an expression, optionally using the provided feature's properties. If the result of
  28293. the expression in the
  28294. {@link https://github.com/CesiumGS/3d-tiles/tree/master/specification/Styling|3D Tiles Styling language}
  28295. is of type <code>Boolean</code>, <code>Number</code>, or <code>String</code>, the corresponding JavaScript
  28296. primitive type will be returned. If the result is a <code>RegExp</code>, a Javascript <code>RegExp</code>
  28297. object will be returned. If the result is a <code>Cartesian2</code>, <code>Cartesian3</code>, or <code>Cartesian4</code>,
  28298. a {@link Cartesian2}, {@link Cartesian3}, or {@link Cartesian4} object will be returned. If the <code>result</code> argument is
  28299. a {@link Color}, the {@link Cartesian4} value is converted to a {@link Color} and then returned.
  28300. * @param feature - The feature whose properties may be used as variables in the expression.
  28301. * @param [result] - The object onto which to store the result.
  28302. * @returns The result of evaluating the expression.
  28303. */
  28304. evaluate(feature: Cesium3DTileFeature, result?: any): boolean | number | string | RegExp | Cartesian2 | Cartesian3 | Cartesian4 | Color;
  28305. /**
  28306. * Evaluates the result of a Color expression, using the values defined by a feature.
  28307. <p>
  28308. This is equivalent to {@link ConditionsExpression#evaluate} but always returns a {@link Color} object.
  28309. </p>
  28310. * @param feature - The feature whose properties may be used as variables in the expression.
  28311. * @param [result] - The object in which to store the result
  28312. * @returns The modified result parameter or a new Color instance if one was not provided.
  28313. */
  28314. evaluateColor(feature: Cesium3DTileFeature, result?: Color): Color;
  28315. }
  28316. /**
  28317. * A ParticleEmitter that emits particles within a cone.
  28318. Particles will be positioned at the tip of the cone and have initial velocities going towards the base.
  28319. * @param [angle = Cesium.Math.toRadians(30.0)] - The angle of the cone in radians.
  28320. */
  28321. export class ConeEmitter {
  28322. constructor(angle?: number);
  28323. }
  28324. /**
  28325. * Creates a {@link Cesium3DTileset} instance for the
  28326. {@link https://cesium.com/content/cesium-osm-buildings/|Cesium OSM Buildings}
  28327. tileset.
  28328. * @example
  28329. * // Create Cesium OSM Buildings with default styling
  28330. var viewer = new Cesium.Viewer('cesiumContainer');
  28331. viewer.scene.primitives.add(Cesium.createOsmBuildings());
  28332. * @example
  28333. * // Create Cesium OSM Buildings with a custom style highlighting
  28334. // schools and hospitals.
  28335. viewer.scene.primitives.add(Cesium.createOsmBuildings({
  28336. style: new Cesium.Cesium3DTileStyle({
  28337. color: {
  28338. conditions: [
  28339. ["${feature['building']} === 'hospital'", "color('#0000FF')"],
  28340. ["${feature['building']} === 'school'", "color('#00FF00')"],
  28341. [true, "color('#ffffff')"]
  28342. ]
  28343. }
  28344. })
  28345. }));
  28346. * @param [options] - Construction options. Any options allowed by the {@link Cesium3DTileset} constructor
  28347. may be specified here. In addition to those, the following properties are supported:
  28348. * @param [options.defaultColor = Color.WHITE] - The default color to use for buildings
  28349. that do not have a color. This parameter is ignored if <code>options.style</code> is specified.
  28350. * @param [options.style] - The style to use with the tileset. If not
  28351. specified, a default style is used which gives each building or building part a
  28352. color inferred from its OpenStreetMap <code>tags</code>. If no color can be inferred,
  28353. <code>options.defaultColor</code> is used.
  28354. */
  28355. export function createOsmBuildings(options?: {
  28356. defaultColor?: Color;
  28357. style?: Cesium3DTileStyle;
  28358. }): Cesium3DTileset;
  28359. /**
  28360. * Creates a {@link Primitive} to visualize well-known vector vertex attributes:
  28361. <code>normal</code>, <code>tangent</code>, and <code>bitangent</code>. Normal
  28362. is red; tangent is green; and bitangent is blue. If an attribute is not
  28363. present, it is not drawn.
  28364. * @example
  28365. * scene.primitives.add(Cesium.createTangentSpaceDebugPrimitive({
  28366. geometry : instance.geometry,
  28367. length : 100000.0,
  28368. modelMatrix : instance.modelMatrix
  28369. }));
  28370. * @param options - Object with the following properties:
  28371. * @param options.geometry - The <code>Geometry</code> instance with the attribute.
  28372. * @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.
  28373. * @param [options.modelMatrix = Matrix4.IDENTITY] - The model matrix that transforms to transform the geometry from model to world coordinates.
  28374. * @returns A new <code>Primitive</code> instance with geometry for the vectors.
  28375. */
  28376. export function createTangentSpaceDebugPrimitive(options: {
  28377. geometry: Geometry;
  28378. length?: number;
  28379. modelMatrix?: Matrix4;
  28380. }): Primitive;
  28381. /**
  28382. * Creates an {@link IonImageryProvider} instance for ion's default global base imagery layer, currently Bing Maps.
  28383. * @example
  28384. * // Create Cesium World Terrain with default settings
  28385. var viewer = new Cesium.Viewer('cesiumContainer', {
  28386. imageryProvider : Cesium.createWorldImagery();
  28387. });
  28388. * @example
  28389. * // Create Cesium World Terrain with water and normals.
  28390. var viewer = new Cesium.Viewer('cesiumContainer', {
  28391. imageryProvider : Cesium.createWorldImagery({
  28392. style: Cesium.IonWorldImageryStyle.AERIAL_WITH_LABELS
  28393. })
  28394. });
  28395. * @param [options] - Object with the following properties:
  28396. * @param [options.style = IonWorldImageryStyle] - The style of base imagery, only AERIAL, AERIAL_WITH_LABELS, and ROAD are currently supported.
  28397. */
  28398. export function createWorldImagery(options?: {
  28399. style?: IonWorldImageryStyle;
  28400. }): IonImageryProvider;
  28401. /**
  28402. * The credit display is responsible for displaying credits on screen.
  28403. * @example
  28404. * var creditDisplay = new Cesium.CreditDisplay(creditContainer);
  28405. * @param container - The HTML element where credits will be displayed
  28406. * @param [delimiter = ' • '] - The string to separate text credits
  28407. * @param [viewport = document.body] - The HTML element that will contain the credits popup
  28408. */
  28409. export class CreditDisplay {
  28410. constructor(container: HTMLElement, delimiter?: string, viewport?: HTMLElement);
  28411. /**
  28412. * The HTML element where credits will be displayed.
  28413. */
  28414. container: HTMLElement;
  28415. /**
  28416. * Adds a credit to the list of current credits to be displayed in the credit container
  28417. * @param credit - The credit to display
  28418. */
  28419. addCredit(credit: Credit): void;
  28420. /**
  28421. * Adds credits that will persist until they are removed
  28422. * @param credit - The credit to added to defaults
  28423. */
  28424. addDefaultCredit(credit: Credit): void;
  28425. /**
  28426. * Removes a default credit
  28427. * @param credit - The credit to be removed from defaults
  28428. */
  28429. removeDefaultCredit(credit: Credit): void;
  28430. /**
  28431. * Updates the credit display before a new frame is rendered.
  28432. */
  28433. update(): void;
  28434. /**
  28435. * Resets the credit display to a beginning of frame state, clearing out current credits.
  28436. */
  28437. beginFrame(): void;
  28438. /**
  28439. * Sets the credit display to the end of frame state, displaying credits from the last frame in the credit container.
  28440. */
  28441. endFrame(): void;
  28442. /**
  28443. * Destroys the resources held by this object. Destroying an object allows for deterministic
  28444. release of resources, instead of relying on the garbage collector to destroy this object.
  28445. <br /><br />
  28446. Once an object is destroyed, it should not be used; calling any function other than
  28447. <code>isDestroyed</code> will result in a {@link DeveloperError} exception. Therefore,
  28448. assign the return value (<code>undefined</code>) to the object as done in the example.
  28449. */
  28450. destroy(): void;
  28451. /**
  28452. * Returns true if this object was destroyed; otherwise, false.
  28453. <br /><br />
  28454. * @returns <code>true</code> if this object was destroyed; otherwise, <code>false</code>.
  28455. */
  28456. isDestroyed(): boolean;
  28457. /**
  28458. * Gets or sets the Cesium logo credit.
  28459. */
  28460. static cesiumCredit: Credit;
  28461. }
  28462. /**
  28463. * Determines which triangles, if any, are culled.
  28464. */
  28465. export enum CullFace {
  28466. /**
  28467. * Front-facing triangles are culled.
  28468. */
  28469. FRONT = WebGLConstants.FRONT,
  28470. /**
  28471. * Back-facing triangles are culled.
  28472. */
  28473. BACK = WebGLConstants.BACK,
  28474. /**
  28475. * Both front-facing and back-facing triangles are culled.
  28476. */
  28477. FRONT_AND_BACK = WebGLConstants.FRONT_AND_BACK
  28478. }
  28479. /**
  28480. * Visualizes a vertex attribute by displaying it as a color for debugging.
  28481. <p>
  28482. Components for well-known unit-length vectors, i.e., <code>normal</code>,
  28483. <code>tangent</code>, and <code>bitangent</code>, are scaled and biased
  28484. from [-1.0, 1.0] to (-1.0, 1.0).
  28485. </p>
  28486. * @example
  28487. * var primitive = new Cesium.Primitive({
  28488. geometryInstances : // ...
  28489. appearance : new Cesium.DebugAppearance({
  28490. attributeName : 'normal'
  28491. })
  28492. });
  28493. * @param options - Object with the following properties:
  28494. * @param options.attributeName - The name of the attribute to visualize.
  28495. * @param [options.perInstanceAttribute = false] - Boolean that determines whether this attribute is a per-instance geometry attribute.
  28496. * @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>.
  28497. * @param [options.vertexShaderSource] - Optional GLSL vertex shader source to override the default vertex shader.
  28498. * @param [options.fragmentShaderSource] - Optional GLSL fragment shader source to override the default fragment shader.
  28499. * @param [options.renderState] - Optional render state to override the default render state.
  28500. */
  28501. export class DebugAppearance {
  28502. constructor(options: {
  28503. attributeName: string;
  28504. perInstanceAttribute?: boolean;
  28505. glslDatatype?: string;
  28506. vertexShaderSource?: string;
  28507. fragmentShaderSource?: string;
  28508. renderState?: any;
  28509. });
  28510. /**
  28511. * This property is part of the {@link Appearance} interface, but is not
  28512. used by {@link DebugAppearance} since a fully custom fragment shader is used.
  28513. */
  28514. material: Material;
  28515. /**
  28516. * When <code>true</code>, the geometry is expected to appear translucent.
  28517. */
  28518. translucent: boolean;
  28519. /**
  28520. * The GLSL source code for the vertex shader.
  28521. */
  28522. readonly vertexShaderSource: string;
  28523. /**
  28524. * The GLSL source code for the fragment shader. The full fragment shader
  28525. source is built procedurally taking into account the {@link DebugAppearance#material}.
  28526. Use {@link DebugAppearance#getFragmentShaderSource} to get the full source.
  28527. */
  28528. readonly fragmentShaderSource: string;
  28529. /**
  28530. * The WebGL fixed-function state to use when rendering the geometry.
  28531. */
  28532. readonly renderState: any;
  28533. /**
  28534. * When <code>true</code>, the geometry is expected to be closed.
  28535. */
  28536. readonly closed: boolean;
  28537. /**
  28538. * The name of the attribute being visualized.
  28539. */
  28540. readonly attributeName: string;
  28541. /**
  28542. * The GLSL datatype of the attribute being visualized.
  28543. */
  28544. readonly glslDatatype: string;
  28545. /**
  28546. * Returns the full GLSL fragment shader source, which for {@link DebugAppearance} is just
  28547. {@link DebugAppearance#fragmentShaderSource}.
  28548. * @returns The full GLSL fragment shader source.
  28549. */
  28550. getFragmentShaderSource(): string;
  28551. /**
  28552. * Determines if the geometry is translucent based on {@link DebugAppearance#translucent}.
  28553. * @returns <code>true</code> if the appearance is translucent.
  28554. */
  28555. isTranslucent(): boolean;
  28556. /**
  28557. * Creates a render state. This is not the final render state instance; instead,
  28558. it can contain a subset of render state properties identical to the render state
  28559. created in the context.
  28560. * @returns The render state.
  28561. */
  28562. getRenderState(): any;
  28563. }
  28564. /**
  28565. * Draws the outline of the camera's view frustum.
  28566. * @example
  28567. * primitives.add(new Cesium.DebugCameraPrimitive({
  28568. camera : camera,
  28569. color : Cesium.Color.YELLOW
  28570. }));
  28571. * @param options - Object with the following properties:
  28572. * @param options.camera - The camera.
  28573. * @param [options.frustumSplits] - Distances to the near and far planes of the camera frustums. This overrides the camera's frustum near and far values.
  28574. * @param [options.color = Color.CYAN] - The color of the debug outline.
  28575. * @param [options.updateOnChange = true] - Whether the primitive updates when the underlying camera changes.
  28576. * @param [options.show = true] - Determines if this primitive will be shown.
  28577. * @param [options.id] - A user-defined object to return when the instance is picked with {@link Scene#pick}.
  28578. */
  28579. export class DebugCameraPrimitive {
  28580. constructor(options: {
  28581. camera: Camera;
  28582. frustumSplits?: number[];
  28583. color?: Color;
  28584. updateOnChange?: boolean;
  28585. show?: boolean;
  28586. id?: any;
  28587. });
  28588. /**
  28589. * Determines if this primitive will be shown.
  28590. */
  28591. show: boolean;
  28592. /**
  28593. * User-defined value returned when the primitive is picked.
  28594. */
  28595. id: any;
  28596. /**
  28597. * Returns true if this object was destroyed; otherwise, false.
  28598. <p>
  28599. If this object was destroyed, it should not be used; calling any function other than
  28600. <code>isDestroyed</code> will result in a {@link DeveloperError} exception.
  28601. </p>
  28602. * @returns <code>true</code> if this object was destroyed; otherwise, <code>false</code>.
  28603. */
  28604. isDestroyed(): boolean;
  28605. /**
  28606. * Destroys the WebGL resources held by this object. Destroying an object allows for deterministic
  28607. release of WebGL resources, instead of relying on the garbage collector to destroy this object.
  28608. <p>
  28609. Once an object is destroyed, it should not be used; calling any function other than
  28610. <code>isDestroyed</code> will result in a {@link DeveloperError} exception. Therefore,
  28611. assign the return value (<code>undefined</code>) to the object as done in the example.
  28612. </p>
  28613. * @example
  28614. * p = p && p.destroy();
  28615. */
  28616. destroy(): void;
  28617. }
  28618. /**
  28619. * Draws the axes of a reference frame defined by a matrix that transforms to world
  28620. coordinates, i.e., Earth's WGS84 coordinates. The most prominent example is
  28621. a primitives <code>modelMatrix</code>.
  28622. <p>
  28623. The X axis is red; Y is green; and Z is blue.
  28624. </p>
  28625. <p>
  28626. This is for debugging only; it is not optimized for production use.
  28627. </p>
  28628. * @example
  28629. * primitives.add(new Cesium.DebugModelMatrixPrimitive({
  28630. modelMatrix : primitive.modelMatrix, // primitive to debug
  28631. length : 100000.0,
  28632. width : 10.0
  28633. }));
  28634. * @param [options] - Object with the following properties:
  28635. * @param [options.length = 10000000.0] - The length of the axes in meters.
  28636. * @param [options.width = 2.0] - The width of the axes in pixels.
  28637. * @param [options.modelMatrix = Matrix4.IDENTITY] - The 4x4 matrix that defines the reference frame, i.e., origin plus axes, to visualize.
  28638. * @param [options.show = true] - Determines if this primitive will be shown.
  28639. * @param [options.id] - A user-defined object to return when the instance is picked with {@link Scene#pick}
  28640. */
  28641. export class DebugModelMatrixPrimitive {
  28642. constructor(options?: {
  28643. length?: number;
  28644. width?: number;
  28645. modelMatrix?: Matrix4;
  28646. show?: boolean;
  28647. id?: any;
  28648. });
  28649. /**
  28650. * The length of the axes in meters.
  28651. */
  28652. length: number;
  28653. /**
  28654. * The width of the axes in pixels.
  28655. */
  28656. width: number;
  28657. /**
  28658. * Determines if this primitive will be shown.
  28659. */
  28660. show: boolean;
  28661. /**
  28662. * The 4x4 matrix that defines the reference frame, i.e., origin plus axes, to visualize.
  28663. */
  28664. modelMatrix: Matrix4;
  28665. /**
  28666. * User-defined value returned when the primitive is picked.
  28667. */
  28668. id: any;
  28669. /**
  28670. * Returns true if this object was destroyed; otherwise, false.
  28671. <p>
  28672. If this object was destroyed, it should not be used; calling any function other than
  28673. <code>isDestroyed</code> will result in a {@link DeveloperError} exception.
  28674. </p>
  28675. * @returns <code>true</code> if this object was destroyed; otherwise, <code>false</code>.
  28676. */
  28677. isDestroyed(): boolean;
  28678. /**
  28679. * Destroys the WebGL resources held by this object. Destroying an object allows for deterministic
  28680. release of WebGL resources, instead of relying on the garbage collector to destroy this object.
  28681. <p>
  28682. Once an object is destroyed, it should not be used; calling any function other than
  28683. <code>isDestroyed</code> will result in a {@link DeveloperError} exception. Therefore,
  28684. assign the return value (<code>undefined</code>) to the object as done in the example.
  28685. </p>
  28686. * @example
  28687. * p = p && p.destroy();
  28688. */
  28689. destroy(): void;
  28690. }
  28691. /**
  28692. * Determines the function used to compare two depths for the depth test.
  28693. */
  28694. export enum DepthFunction {
  28695. /**
  28696. * The depth test never passes.
  28697. */
  28698. NEVER = WebGLConstants.NEVER,
  28699. /**
  28700. * The depth test passes if the incoming depth is less than the stored depth.
  28701. */
  28702. LESS = WebGLConstants.LESS,
  28703. /**
  28704. * The depth test passes if the incoming depth is equal to the stored depth.
  28705. */
  28706. EQUAL = WebGLConstants.EQUAL,
  28707. /**
  28708. * The depth test passes if the incoming depth is less than or equal to the stored depth.
  28709. */
  28710. LESS_OR_EQUAL = WebGLConstants.LEQUAL,
  28711. /**
  28712. * The depth test passes if the incoming depth is greater than the stored depth.
  28713. */
  28714. GREATER = WebGLConstants.GREATER,
  28715. /**
  28716. * The depth test passes if the incoming depth is not equal to the stored depth.
  28717. */
  28718. NOT_EQUAL = WebGLConstants.NOTEQUAL,
  28719. /**
  28720. * The depth test passes if the incoming depth is greater than or equal to the stored depth.
  28721. */
  28722. GREATER_OR_EQUAL = WebGLConstants.GEQUAL,
  28723. /**
  28724. * The depth test always passes.
  28725. */
  28726. ALWAYS = WebGLConstants.ALWAYS
  28727. }
  28728. /**
  28729. * A light that gets emitted in a single direction from infinitely far away.
  28730. * @param options - Object with the following properties:
  28731. * @param options.direction - The direction in which light gets emitted.
  28732. * @param [options.color = Color.WHITE] - The color of the light.
  28733. * @param [options.intensity = 1.0] - The intensity of the light.
  28734. */
  28735. export class DirectionalLight {
  28736. constructor(options: {
  28737. direction: Cartesian3;
  28738. color?: Color;
  28739. intensity?: number;
  28740. });
  28741. /**
  28742. * The direction in which light gets emitted.
  28743. */
  28744. direction: Cartesian3;
  28745. /**
  28746. * The color of the light.
  28747. */
  28748. color: Color;
  28749. /**
  28750. * The intensity of the light.
  28751. */
  28752. intensity: number;
  28753. }
  28754. /**
  28755. * A policy for discarding tile images that contain no data (and so aren't actually images).
  28756. This policy discards {@link DiscardEmptyTileImagePolicy.EMPTY_IMAGE}, which is
  28757. expected to be used in place of any empty tile images by the image loading code.
  28758. */
  28759. export class DiscardEmptyTileImagePolicy {
  28760. constructor();
  28761. /**
  28762. * Determines if the discard policy is ready to process images.
  28763. * @returns True if the discard policy is ready to process images; otherwise, false.
  28764. */
  28765. isReady(): boolean;
  28766. /**
  28767. * Given a tile image, decide whether to discard that image.
  28768. * @param image - An image to test.
  28769. * @returns True if the image should be discarded; otherwise, false.
  28770. */
  28771. shouldDiscardImage(image: HTMLImageElement): boolean;
  28772. /**
  28773. * Default value for representing an empty image.
  28774. */
  28775. static readonly EMPTY_IMAGE: HTMLImageElement;
  28776. }
  28777. /**
  28778. * A policy for discarding tile images that match a known image containing a
  28779. "missing" image.
  28780. * @param options - Object with the following properties:
  28781. * @param options.missingImageUrl - The URL of the known missing image.
  28782. * @param options.pixelsToCheck - An array of {@link Cartesian2} pixel positions to
  28783. compare against the missing image.
  28784. * @param [options.disableCheckIfAllPixelsAreTransparent = false] - If true, the discard check will be disabled
  28785. if all of the pixelsToCheck in the missingImageUrl have an alpha value of 0. If false, the
  28786. discard check will proceed no matter the values of the pixelsToCheck.
  28787. */
  28788. export class DiscardMissingTileImagePolicy {
  28789. constructor(options: {
  28790. missingImageUrl: Resource | string;
  28791. pixelsToCheck: Cartesian2[];
  28792. disableCheckIfAllPixelsAreTransparent?: boolean;
  28793. });
  28794. /**
  28795. * Determines if the discard policy is ready to process images.
  28796. * @returns True if the discard policy is ready to process images; otherwise, false.
  28797. */
  28798. isReady(): boolean;
  28799. /**
  28800. * Given a tile image, decide whether to discard that image.
  28801. * @param image - An image to test.
  28802. * @returns True if the image should be discarded; otherwise, false.
  28803. */
  28804. shouldDiscardImage(image: HTMLImageElement): boolean;
  28805. }
  28806. /**
  28807. * An appearance for geometry on the surface of the ellipsoid like {@link PolygonGeometry}
  28808. and {@link RectangleGeometry}, which supports all materials like {@link MaterialAppearance}
  28809. with {@link MaterialAppearance.MaterialSupport.ALL}. However, this appearance requires
  28810. fewer vertex attributes since the fragment shader can procedurally compute <code>normal</code>,
  28811. <code>tangent</code>, and <code>bitangent</code>.
  28812. * @example
  28813. * var primitive = new Cesium.Primitive({
  28814. geometryInstances : new Cesium.GeometryInstance({
  28815. geometry : new Cesium.PolygonGeometry({
  28816. vertexFormat : Cesium.EllipsoidSurfaceAppearance.VERTEX_FORMAT,
  28817. // ...
  28818. })
  28819. }),
  28820. appearance : new Cesium.EllipsoidSurfaceAppearance({
  28821. material : Cesium.Material.fromType('Stripe')
  28822. })
  28823. });
  28824. * @param [options] - Object with the following properties:
  28825. * @param [options.flat = false] - When <code>true</code>, flat shading is used in the fragment shader, which means lighting is not taking into account.
  28826. * @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}.
  28827. * @param [options.translucent = true] - When <code>true</code>, the geometry is expected to appear translucent so {@link EllipsoidSurfaceAppearance#renderState} has alpha blending enabled.
  28828. * @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.
  28829. * @param [options.material = Material.ColorType] - The material used to determine the fragment color.
  28830. * @param [options.vertexShaderSource] - Optional GLSL vertex shader source to override the default vertex shader.
  28831. * @param [options.fragmentShaderSource] - Optional GLSL fragment shader source to override the default fragment shader.
  28832. * @param [options.renderState] - Optional render state to override the default render state.
  28833. */
  28834. export class EllipsoidSurfaceAppearance {
  28835. constructor(options?: {
  28836. flat?: boolean;
  28837. faceForward?: boolean;
  28838. translucent?: boolean;
  28839. aboveGround?: boolean;
  28840. material?: Material;
  28841. vertexShaderSource?: string;
  28842. fragmentShaderSource?: string;
  28843. renderState?: any;
  28844. });
  28845. /**
  28846. * The material used to determine the fragment color. Unlike other {@link EllipsoidSurfaceAppearance}
  28847. properties, this is not read-only, so an appearance's material can change on the fly.
  28848. */
  28849. material: Material;
  28850. /**
  28851. * When <code>true</code>, the geometry is expected to appear translucent.
  28852. */
  28853. translucent: boolean;
  28854. /**
  28855. * The GLSL source code for the vertex shader.
  28856. */
  28857. readonly vertexShaderSource: string;
  28858. /**
  28859. * The GLSL source code for the fragment shader. The full fragment shader
  28860. source is built procedurally taking into account {@link EllipsoidSurfaceAppearance#material},
  28861. {@link EllipsoidSurfaceAppearance#flat}, and {@link EllipsoidSurfaceAppearance#faceForward}.
  28862. Use {@link EllipsoidSurfaceAppearance#getFragmentShaderSource} to get the full source.
  28863. */
  28864. readonly fragmentShaderSource: string;
  28865. /**
  28866. * The WebGL fixed-function state to use when rendering the geometry.
  28867. <p>
  28868. The render state can be explicitly defined when constructing a {@link EllipsoidSurfaceAppearance}
  28869. instance, or it is set implicitly via {@link EllipsoidSurfaceAppearance#translucent}
  28870. and {@link EllipsoidSurfaceAppearance#aboveGround}.
  28871. </p>
  28872. */
  28873. readonly renderState: any;
  28874. /**
  28875. * When <code>true</code>, the geometry is expected to be closed so
  28876. {@link EllipsoidSurfaceAppearance#renderState} has backface culling enabled.
  28877. If the viewer enters the geometry, it will not be visible.
  28878. */
  28879. readonly closed: boolean;
  28880. /**
  28881. * The {@link VertexFormat} that this appearance instance is compatible with.
  28882. A geometry can have more vertex attributes and still be compatible - at a
  28883. potential performance cost - but it can't have less.
  28884. */
  28885. readonly vertexFormat: VertexFormat;
  28886. /**
  28887. * When <code>true</code>, flat shading is used in the fragment shader,
  28888. which means lighting is not taking into account.
  28889. */
  28890. readonly flat: boolean;
  28891. /**
  28892. * When <code>true</code>, the fragment shader flips the surface normal
  28893. as needed to ensure that the normal faces the viewer to avoid
  28894. dark spots. This is useful when both sides of a geometry should be
  28895. shaded like {@link WallGeometry}.
  28896. */
  28897. readonly faceForward: boolean;
  28898. /**
  28899. * When <code>true</code>, the geometry is expected to be on the ellipsoid's
  28900. surface - not at a constant height above it - so {@link EllipsoidSurfaceAppearance#renderState}
  28901. has backface culling enabled.
  28902. */
  28903. readonly aboveGround: boolean;
  28904. /**
  28905. * The {@link VertexFormat} that all {@link EllipsoidSurfaceAppearance} instances
  28906. are compatible with, which requires only <code>position</code> and <code>st</code>
  28907. attributes. Other attributes are procedurally computed in the fragment shader.
  28908. */
  28909. static readonly VERTEX_FORMAT: VertexFormat;
  28910. /**
  28911. * Procedurally creates the full GLSL fragment shader source. For {@link EllipsoidSurfaceAppearance},
  28912. this is derived from {@link EllipsoidSurfaceAppearance#fragmentShaderSource}, {@link EllipsoidSurfaceAppearance#flat},
  28913. and {@link EllipsoidSurfaceAppearance#faceForward}.
  28914. * @returns The full GLSL fragment shader source.
  28915. */
  28916. getFragmentShaderSource(): string;
  28917. /**
  28918. * Determines if the geometry is translucent based on {@link EllipsoidSurfaceAppearance#translucent} and {@link Material#isTranslucent}.
  28919. * @returns <code>true</code> if the appearance is translucent.
  28920. */
  28921. isTranslucent(): boolean;
  28922. /**
  28923. * Creates a render state. This is not the final render state instance; instead,
  28924. it can contain a subset of render state properties identical to the render state
  28925. created in the context.
  28926. * @returns The render state.
  28927. */
  28928. getRenderState(): any;
  28929. }
  28930. /**
  28931. * An expression for a style applied to a {@link Cesium3DTileset}.
  28932. <p>
  28933. Evaluates an expression defined using the
  28934. {@link https://github.com/CesiumGS/3d-tiles/tree/master/specification/Styling|3D Tiles Styling language}.
  28935. </p>
  28936. <p>
  28937. Implements the {@link StyleExpression} interface.
  28938. </p>
  28939. * @example
  28940. * var expression = new Cesium.Expression('(regExp("^Chest").test(${County})) && (${YearBuilt} >= 1970)');
  28941. expression.evaluate(feature); // returns true or false depending on the feature's properties
  28942. * @example
  28943. * var expression = new Cesium.Expression('(${Temperature} > 90) ? color("red") : color("white")');
  28944. expression.evaluateColor(feature, result); // returns a Cesium.Color object
  28945. * @param [expression] - The expression defined using the 3D Tiles Styling language.
  28946. * @param [defines] - Defines in the style.
  28947. */
  28948. export class Expression {
  28949. constructor(expression?: string, defines?: any);
  28950. /**
  28951. * Gets the expression defined in the 3D Tiles Styling language.
  28952. */
  28953. readonly expression: string;
  28954. /**
  28955. * Evaluates the result of an expression, optionally using the provided feature's properties. If the result of
  28956. the expression in the
  28957. {@link https://github.com/CesiumGS/3d-tiles/tree/master/specification/Styling|3D Tiles Styling language}
  28958. is of type <code>Boolean</code>, <code>Number</code>, or <code>String</code>, the corresponding JavaScript
  28959. primitive type will be returned. If the result is a <code>RegExp</code>, a Javascript <code>RegExp</code>
  28960. object will be returned. If the result is a <code>Cartesian2</code>, <code>Cartesian3</code>, or <code>Cartesian4</code>,
  28961. a {@link Cartesian2}, {@link Cartesian3}, or {@link Cartesian4} object will be returned. If the <code>result</code> argument is
  28962. a {@link Color}, the {@link Cartesian4} value is converted to a {@link Color} and then returned.
  28963. * @param feature - The feature whose properties may be used as variables in the expression.
  28964. * @param [result] - The object onto which to store the result.
  28965. * @returns The result of evaluating the expression.
  28966. */
  28967. evaluate(feature: Cesium3DTileFeature, result?: any): boolean | number | string | RegExp | Cartesian2 | Cartesian3 | Cartesian4 | Color;
  28968. /**
  28969. * Evaluates the result of a Color expression, optionally using the provided feature's properties.
  28970. <p>
  28971. This is equivalent to {@link Expression#evaluate} but always returns a {@link Color} object.
  28972. </p>
  28973. * @param feature - The feature whose properties may be used as variables in the expression.
  28974. * @param [result] - The object in which to store the result
  28975. * @returns The modified result parameter or a new Color instance if one was not provided.
  28976. */
  28977. evaluateColor(feature: Cesium3DTileFeature, result?: Color): Color;
  28978. }
  28979. /**
  28980. * Blends the atmosphere to geometry far from the camera for horizon views. Allows for additional
  28981. performance improvements by rendering less geometry and dispatching less terrain requests.
  28982. */
  28983. export class Fog {
  28984. constructor();
  28985. /**
  28986. * <code>true</code> if fog is enabled, <code>false</code> otherwise.
  28987. */
  28988. enabled: boolean;
  28989. /**
  28990. * A scalar that determines the density of the fog. Terrain that is in full fog are culled.
  28991. The density of the fog increases as this number approaches 1.0 and becomes less dense as it approaches zero.
  28992. The more dense the fog is, the more aggressively the terrain is culled. For example, if the camera is a height of
  28993. 1000.0m above the ellipsoid, increasing the value to 3.0e-3 will cause many tiles close to the viewer be culled.
  28994. Decreasing the value will push the fog further from the viewer, but decrease performance as more of the terrain is rendered.
  28995. */
  28996. density: number;
  28997. /**
  28998. * A factor used to increase the screen space error of terrain tiles when they are partially in fog. The effect is to reduce
  28999. the number of terrain tiles requested for rendering. If set to zero, the feature will be disabled. If the value is increased
  29000. for mountainous regions, less tiles will need to be requested, but the terrain meshes near the horizon may be a noticeably
  29001. lower resolution. If the value is increased in a relatively flat area, there will be little noticeable change on the horizon.
  29002. */
  29003. screenSpaceErrorFactor: number;
  29004. /**
  29005. * 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
  29006. the brightness at all.
  29007. */
  29008. minimumBrightness: number;
  29009. }
  29010. /**
  29011. * Monitors the frame rate (frames per second) in a {@link Scene} and raises an event if the frame rate is
  29012. lower than a threshold. Later, if the frame rate returns to the required level, a separate event is raised.
  29013. To avoid creating multiple FrameRateMonitors for a single {@link Scene}, use {@link FrameRateMonitor.fromScene}
  29014. instead of constructing an instance explicitly.
  29015. * @param [options] - Object with the following properties:
  29016. * @param options.scene - The Scene instance for which to monitor performance.
  29017. * @param [options.samplingWindow = 5.0] - The length of the sliding window over which to compute the average frame rate, in seconds.
  29018. * @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
  29019. switches back to the tab) before starting to measure performance, in seconds.
  29020. * @param [options.warmupPeriod = 5.0] - The length of the warmup period, in seconds. During the warmup period, a separate
  29021. (usually lower) frame rate is required.
  29022. * @param [options.minimumFrameRateDuringWarmup = 4] - The minimum frames-per-second that are required for acceptable performance during
  29023. the warmup period. If the frame rate averages less than this during any samplingWindow during the warmupPeriod, the
  29024. lowFrameRate event will be raised and the page will redirect to the redirectOnLowFrameRateUrl, if any.
  29025. * @param [options.minimumFrameRateAfterWarmup = 8] - The minimum frames-per-second that are required for acceptable performance after
  29026. the end of the warmup period. If the frame rate averages less than this during any samplingWindow after the warmupPeriod, the
  29027. lowFrameRate event will be raised and the page will redirect to the redirectOnLowFrameRateUrl, if any.
  29028. */
  29029. export class FrameRateMonitor {
  29030. constructor(options?: {
  29031. scene: Scene;
  29032. samplingWindow?: number;
  29033. quietPeriod?: number;
  29034. warmupPeriod?: number;
  29035. minimumFrameRateDuringWarmup?: number;
  29036. minimumFrameRateAfterWarmup?: number;
  29037. });
  29038. /**
  29039. * Gets or sets the length of the sliding window over which to compute the average frame rate, in seconds.
  29040. */
  29041. samplingWindow: number;
  29042. /**
  29043. * Gets or sets the length of time to wait at startup and each time the page becomes visible (i.e. when the user
  29044. switches back to the tab) before starting to measure performance, in seconds.
  29045. */
  29046. quietPeriod: number;
  29047. /**
  29048. * Gets or sets the length of the warmup period, in seconds. During the warmup period, a separate
  29049. (usually lower) frame rate is required.
  29050. */
  29051. warmupPeriod: number;
  29052. /**
  29053. * Gets or sets the minimum frames-per-second that are required for acceptable performance during
  29054. the warmup period. If the frame rate averages less than this during any <code>samplingWindow</code> during the <code>warmupPeriod</code>, the
  29055. <code>lowFrameRate</code> event will be raised and the page will redirect to the <code>redirectOnLowFrameRateUrl</code>, if any.
  29056. */
  29057. minimumFrameRateDuringWarmup: number;
  29058. /**
  29059. * Gets or sets the minimum frames-per-second that are required for acceptable performance after
  29060. 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
  29061. <code>lowFrameRate</code> event will be raised and the page will redirect to the <code>redirectOnLowFrameRateUrl</code>, if any.
  29062. */
  29063. minimumFrameRateAfterWarmup: number;
  29064. /**
  29065. * The default frame rate monitoring settings. These settings are used when {@link FrameRateMonitor.fromScene}
  29066. needs to create a new frame rate monitor, and for any settings that are not passed to the
  29067. {@link FrameRateMonitor} constructor.
  29068. */
  29069. static defaultSettings: any;
  29070. /**
  29071. * Gets the {@link FrameRateMonitor} for a given scene. If the scene does not yet have
  29072. a {@link FrameRateMonitor}, one is created with the {@link FrameRateMonitor.defaultSettings}.
  29073. * @param scene - The scene for which to get the {@link FrameRateMonitor}.
  29074. * @returns The scene's {@link FrameRateMonitor}.
  29075. */
  29076. static fromScene(scene: Scene): FrameRateMonitor;
  29077. /**
  29078. * Gets the {@link Scene} instance for which to monitor performance.
  29079. */
  29080. scene: Scene;
  29081. /**
  29082. * Gets the event that is raised when a low frame rate is detected. The function will be passed
  29083. the {@link Scene} instance as its first parameter and the average number of frames per second
  29084. over the sampling window as its second parameter.
  29085. */
  29086. lowFrameRate: Event;
  29087. /**
  29088. * Gets the event that is raised when the frame rate returns to a normal level after having been low.
  29089. The function will be passed the {@link Scene} instance as its first parameter and the average
  29090. number of frames per second over the sampling window as its second parameter.
  29091. */
  29092. nominalFrameRate: Event;
  29093. /**
  29094. * Gets the most recently computed average frames-per-second over the last <code>samplingWindow</code>.
  29095. This property may be undefined if the frame rate has not been computed.
  29096. */
  29097. lastFramesPerSecond: number;
  29098. /**
  29099. * Pauses monitoring of the frame rate. To resume monitoring, {@link FrameRateMonitor#unpause}
  29100. must be called once for each time this function is called.
  29101. */
  29102. pause(): void;
  29103. /**
  29104. * Resumes monitoring of the frame rate. If {@link FrameRateMonitor#pause} was called
  29105. multiple times, this function must be called the same number of times in order to
  29106. actually resume monitoring.
  29107. */
  29108. unpause(): void;
  29109. /**
  29110. * Returns true if this object was destroyed; otherwise, false.
  29111. <br /><br />
  29112. If this object was destroyed, it should not be used; calling any function other than
  29113. <code>isDestroyed</code> will result in a {@link DeveloperError} exception.
  29114. * @returns True if this object was destroyed; otherwise, false.
  29115. */
  29116. isDestroyed(): boolean;
  29117. /**
  29118. * Unsubscribes this instance from all events it is listening to.
  29119. Once an object is destroyed, it should not be used; calling any function other than
  29120. <code>isDestroyed</code> will result in a {@link DeveloperError} exception. Therefore,
  29121. assign the return value (<code>undefined</code>) to the object as done in the example.
  29122. */
  29123. destroy(): void;
  29124. }
  29125. /**
  29126. * Describes the format in which to request GetFeatureInfo from a Web Map Service (WMS) server.
  29127. * @param type - The type of response to expect from a GetFeatureInfo request. Valid
  29128. values are 'json', 'xml', 'html', or 'text'.
  29129. * @param [format] - The info format to request from the WMS server. This is usually a
  29130. MIME type such as 'application/json' or text/xml'. If this parameter is not specified, the provider will request 'json'
  29131. using 'application/json', 'xml' using 'text/xml', 'html' using 'text/html', and 'text' using 'text/plain'.
  29132. * @param [callback] - A function to invoke with the GetFeatureInfo response from the WMS server
  29133. in order to produce an array of picked {@link ImageryLayerFeatureInfo} instances. If this parameter is not specified,
  29134. a default function for the type of response is used.
  29135. */
  29136. export class GetFeatureInfoFormat {
  29137. constructor(type: string, format?: string, callback?: (...params: any[]) => any);
  29138. }
  29139. /**
  29140. * The globe rendered in the scene, including its terrain ({@link Globe#terrainProvider})
  29141. and imagery layers ({@link Globe#imageryLayers}). Access the globe using {@link Scene#globe}.
  29142. * @param [ellipsoid = Ellipsoid.WGS84] - Determines the size and shape of the
  29143. globe.
  29144. */
  29145. export class Globe {
  29146. constructor(ellipsoid?: Ellipsoid);
  29147. /**
  29148. * Determines if the globe will be shown.
  29149. */
  29150. show: boolean;
  29151. /**
  29152. * The maximum screen-space error used to drive level-of-detail refinement. Higher
  29153. values will provide better performance but lower visual quality.
  29154. */
  29155. maximumScreenSpaceError: number;
  29156. /**
  29157. * The size of the terrain tile cache, expressed as a number of tiles. Any additional
  29158. tiles beyond this number will be freed, as long as they aren't needed for rendering
  29159. this frame. A larger number will consume more memory but will show detail faster
  29160. when, for example, zooming out and then back in.
  29161. */
  29162. tileCacheSize: number;
  29163. /**
  29164. * Gets or sets the number of loading descendant tiles that is considered "too many".
  29165. If a tile has too many loading descendants, that tile will be loaded and rendered before any of
  29166. its descendants are loaded and rendered. This means more feedback for the user that something
  29167. is happening at the cost of a longer overall load time. Setting this to 0 will cause each
  29168. tile level to be loaded successively, significantly increasing load time. Setting it to a large
  29169. number (e.g. 1000) will minimize the number of tiles that are loaded but tend to make
  29170. detail appear all at once after a long wait.
  29171. */
  29172. loadingDescendantLimit: number;
  29173. /**
  29174. * Gets or sets a value indicating whether the ancestors of rendered tiles should be preloaded.
  29175. Setting this to true optimizes the zoom-out experience and provides more detail in
  29176. newly-exposed areas when panning. The down side is that it requires loading more tiles.
  29177. */
  29178. preloadAncestors: boolean;
  29179. /**
  29180. * Gets or sets a value indicating whether the siblings of rendered tiles should be preloaded.
  29181. Setting this to true causes tiles with the same parent as a rendered tile to be loaded, even
  29182. if they are culled. Setting this to true may provide a better panning experience at the
  29183. cost of loading more tiles.
  29184. */
  29185. preloadSiblings: boolean;
  29186. /**
  29187. * The color to use to highlight terrain fill tiles. If undefined, fill tiles are not
  29188. highlighted at all. The alpha value is used to alpha blend with the tile's
  29189. actual color. Because terrain fill tiles do not represent the actual terrain surface,
  29190. it may be useful in some applications to indicate visually that they are not to be trusted.
  29191. */
  29192. fillHighlightColor: Color;
  29193. /**
  29194. * Enable lighting the globe with the scene's light source.
  29195. */
  29196. enableLighting: boolean;
  29197. /**
  29198. * Enable dynamic lighting effects on atmosphere and fog. This only takes effect
  29199. when <code>enableLighting</code> is <code>true</code>.
  29200. */
  29201. dynamicAtmosphereLighting: boolean;
  29202. /**
  29203. * Whether dynamic atmosphere lighting uses the sun direction instead of the scene's
  29204. light direction. This only takes effect when <code>enableLighting</code> and
  29205. <code>dynamicAtmosphereLighting</code> are <code>true</code>.
  29206. */
  29207. dynamicAtmosphereLightingFromSun: boolean;
  29208. /**
  29209. * Enable the ground atmosphere, which is drawn over the globe when viewed from a distance between <code>lightingFadeInDistance</code> and <code>lightingFadeOutDistance</code>.
  29210. */
  29211. showGroundAtmosphere: boolean;
  29212. /**
  29213. * The distance where everything becomes lit. This only takes effect
  29214. when <code>enableLighting</code> or <code>showGroundAtmosphere</code> is <code>true</code>.
  29215. */
  29216. lightingFadeOutDistance: number;
  29217. /**
  29218. * The distance where lighting resumes. This only takes effect
  29219. when <code>enableLighting</code> or <code>showGroundAtmosphere</code> is <code>true</code>.
  29220. */
  29221. lightingFadeInDistance: number;
  29222. /**
  29223. * The distance where the darkness of night from the ground atmosphere fades out to a lit ground atmosphere.
  29224. This only takes effect when <code>showGroundAtmosphere</code>, <code>enableLighting</code>, and
  29225. <code>dynamicAtmosphereLighting</code> are <code>true</code>.
  29226. */
  29227. nightFadeOutDistance: number;
  29228. /**
  29229. * The distance where the darkness of night from the ground atmosphere fades in to an unlit ground atmosphere.
  29230. This only takes effect when <code>showGroundAtmosphere</code>, <code>enableLighting</code>, and
  29231. <code>dynamicAtmosphereLighting</code> are <code>true</code>.
  29232. */
  29233. nightFadeInDistance: number;
  29234. /**
  29235. * True if an animated wave effect should be shown in areas of the globe
  29236. covered by water; otherwise, false. This property is ignored if the
  29237. <code>terrainProvider</code> does not provide a water mask.
  29238. */
  29239. showWaterEffect: boolean;
  29240. /**
  29241. * True if primitives such as billboards, polylines, labels, etc. should be depth-tested
  29242. against the terrain surface, or false if such primitives should always be drawn on top
  29243. of terrain unless they're on the opposite side of the globe. The disadvantage of depth
  29244. testing primitives against terrain is that slight numerical noise or terrain level-of-detail
  29245. switched can sometimes make a primitive that should be on the surface disappear underneath it.
  29246. */
  29247. depthTestAgainstTerrain: boolean;
  29248. /**
  29249. * Determines whether the globe casts or receives shadows from light sources. Setting the globe
  29250. to cast shadows may impact performance since the terrain is rendered again from the light's perspective.
  29251. Currently only terrain that is in view casts shadows. By default the globe does not cast shadows.
  29252. */
  29253. shadows: ShadowMode;
  29254. /**
  29255. * The hue shift to apply to the atmosphere. Defaults to 0.0 (no shift).
  29256. A hue shift of 1.0 indicates a complete rotation of the hues available.
  29257. */
  29258. atmosphereHueShift: number;
  29259. /**
  29260. * The saturation shift to apply to the atmosphere. Defaults to 0.0 (no shift).
  29261. A saturation shift of -1.0 is monochrome.
  29262. */
  29263. atmosphereSaturationShift: number;
  29264. /**
  29265. * The brightness shift to apply to the atmosphere. Defaults to 0.0 (no shift).
  29266. A brightness shift of -1.0 is complete darkness, which will let space show through.
  29267. */
  29268. atmosphereBrightnessShift: number;
  29269. /**
  29270. * Whether to show terrain skirts. Terrain skirts are geometry extending downwards from a tile's edges used to hide seams between neighboring tiles.
  29271. Skirts are always hidden when the camera is underground or translucency is enabled.
  29272. */
  29273. showSkirts: boolean;
  29274. /**
  29275. * Whether to cull back-facing terrain. Back faces are not culled when the camera is underground or translucency is enabled.
  29276. */
  29277. backFaceCulling: boolean;
  29278. /**
  29279. * Gets an ellipsoid describing the shape of this globe.
  29280. */
  29281. ellipsoid: Ellipsoid;
  29282. /**
  29283. * Gets the collection of image layers that will be rendered on this globe.
  29284. */
  29285. imageryLayers: ImageryLayerCollection;
  29286. /**
  29287. * Gets an event that's raised when an imagery layer is added, shown, hidden, moved, or removed.
  29288. */
  29289. readonly imageryLayersUpdatedEvent: Event;
  29290. /**
  29291. * Returns <code>true</code> when the tile load queue is empty, <code>false</code> otherwise. When the load queue is empty,
  29292. all terrain and imagery for the current view have been loaded.
  29293. */
  29294. readonly tilesLoaded: boolean;
  29295. /**
  29296. * Gets or sets the color of the globe when no imagery is available.
  29297. */
  29298. baseColor: Color;
  29299. /**
  29300. * A property specifying a {@link ClippingPlaneCollection} used to selectively disable rendering on the outside of each plane.
  29301. */
  29302. clippingPlanes: ClippingPlaneCollection;
  29303. /**
  29304. * A property specifying a {@link Rectangle} used to limit globe rendering to a cartographic area.
  29305. Defaults to the maximum extent of cartographic coordinates.
  29306. */
  29307. cartographicLimitRectangle: Rectangle;
  29308. /**
  29309. * The normal map to use for rendering waves in the ocean. Setting this property will
  29310. only have an effect if the configured terrain provider includes a water mask.
  29311. */
  29312. oceanNormalMapUrl: string;
  29313. /**
  29314. * The terrain provider providing surface geometry for this globe.
  29315. */
  29316. terrainProvider: TerrainProvider;
  29317. /**
  29318. * Gets an event that's raised when the terrain provider is changed
  29319. */
  29320. readonly terrainProviderChanged: Event;
  29321. /**
  29322. * 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,
  29323. all terrain and imagery for the current view have been loaded. The event passes the new length of the tile load queue.
  29324. */
  29325. tileLoadProgressEvent: Event;
  29326. /**
  29327. * 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
  29328. {@link https://github.com/CesiumGS/cesium/wiki/Fabric|Fabric}.
  29329. */
  29330. material: Material;
  29331. /**
  29332. * The color to render the back side of the globe when the camera is underground or the globe is translucent,
  29333. blended with the globe color based on the camera's distance.
  29334. <br /><br />
  29335. To disable underground coloring, set <code>undergroundColor</code> to <code>undefined</code>.
  29336. */
  29337. undergroundColor: Color;
  29338. /**
  29339. * Gets or sets the near and far distance for blending {@link Globe#undergroundColor} with the globe color.
  29340. The alpha will interpolate between the {@link NearFarScalar#nearValue} and
  29341. {@link NearFarScalar#farValue} while the camera distance falls within the lower and upper bounds
  29342. of the specified {@link NearFarScalar#near} and {@link NearFarScalar#far}.
  29343. Outside of these ranges the alpha remains clamped to the nearest bound. If undefined,
  29344. the underground color will not be blended with the globe color.
  29345. <br /> <br />
  29346. When the camera is above the ellipsoid the distance is computed from the nearest
  29347. point on the ellipsoid instead of the camera's position.
  29348. */
  29349. undergroundColorAlphaByDistance: NearFarScalar;
  29350. /**
  29351. * Properties for controlling globe translucency.
  29352. */
  29353. translucency: GlobeTranslucency;
  29354. /**
  29355. * Find an intersection between a ray and the globe surface that was rendered. The ray must be given in world coordinates.
  29356. * @example
  29357. * // find intersection of ray through a pixel and the globe
  29358. var ray = viewer.camera.getPickRay(windowCoordinates);
  29359. var intersection = globe.pick(ray, scene);
  29360. * @param ray - The ray to test for intersection.
  29361. * @param scene - The scene.
  29362. * @param [result] - The object onto which to store the result.
  29363. * @returns The intersection or <code>undefined</code> if none was found.
  29364. */
  29365. pick(ray: Ray, scene: Scene, result?: Cartesian3): Cartesian3 | undefined;
  29366. /**
  29367. * Get the height of the surface at a given cartographic.
  29368. * @param cartographic - The cartographic for which to find the height.
  29369. * @returns The height of the cartographic or undefined if it could not be found.
  29370. */
  29371. getHeight(cartographic: Cartographic): number | undefined;
  29372. /**
  29373. * Returns true if this object was destroyed; otherwise, false.
  29374. <br /><br />
  29375. If this object was destroyed, it should not be used; calling any function other than
  29376. <code>isDestroyed</code> will result in a {@link DeveloperError} exception.
  29377. * @returns True if this object was destroyed; otherwise, false.
  29378. */
  29379. isDestroyed(): boolean;
  29380. /**
  29381. * Destroys the WebGL resources held by this object. Destroying an object allows for deterministic
  29382. release of WebGL resources, instead of relying on the garbage collector to destroy this object.
  29383. <br /><br />
  29384. Once an object is destroyed, it should not be used; calling any function other than
  29385. <code>isDestroyed</code> will result in a {@link DeveloperError} exception. Therefore,
  29386. assign the return value (<code>undefined</code>) to the object as done in the example.
  29387. * @example
  29388. * globe = globe && globe.destroy();
  29389. */
  29390. destroy(): void;
  29391. }
  29392. /**
  29393. * Properties for controlling globe translucency.
  29394. */
  29395. export class GlobeTranslucency {
  29396. constructor();
  29397. /**
  29398. * When true, the globe is rendered as a translucent surface.
  29399. <br /><br />
  29400. The alpha is computed by blending {@link Globe#material}, {@link Globe#imageryLayers},
  29401. and {@link Globe#baseColor}, all of which may contain translucency, and then multiplying by
  29402. {@link GlobeTranslucency#frontFaceAlpha} and {@link GlobeTranslucency#frontFaceAlphaByDistance} for front faces and
  29403. {@link GlobeTranslucency#backFaceAlpha} and {@link GlobeTranslucency#backFaceAlphaByDistance} for back faces.
  29404. When the camera is underground back faces and front faces are swapped, i.e. back-facing geometry
  29405. is considered front facing.
  29406. <br /><br />
  29407. Translucency is disabled by default.
  29408. */
  29409. enabled: boolean;
  29410. /**
  29411. * A constant translucency to apply to front faces of the globe.
  29412. <br /><br />
  29413. {@link GlobeTranslucency#enabled} must be set to true for this option to take effect.
  29414. * @example
  29415. * // Set front face translucency to 0.5.
  29416. globe.translucency.frontFaceAlpha = 0.5;
  29417. globe.translucency.enabled = true;
  29418. */
  29419. frontFaceAlpha: number;
  29420. /**
  29421. * Gets or sets near and far translucency properties of front faces of the globe based on the distance to the camera.
  29422. The translucency will interpolate between the {@link NearFarScalar#nearValue} and
  29423. {@link NearFarScalar#farValue} while the camera distance falls within the lower and upper bounds
  29424. of the specified {@link NearFarScalar#near} and {@link NearFarScalar#far}.
  29425. Outside of these ranges the translucency remains clamped to the nearest bound. If undefined,
  29426. frontFaceAlphaByDistance will be disabled.
  29427. <br /><br />
  29428. {@link GlobeTranslucency#enabled} must be set to true for this option to take effect.
  29429. * @example
  29430. * // Example 1.
  29431. // Set front face translucency to 0.5 when the
  29432. // camera is 1500 meters from the surface and 1.0
  29433. // as the camera distance approaches 8.0e6 meters.
  29434. globe.translucency.frontFaceAlphaByDistance = new Cesium.NearFarScalar(1.5e2, 0.5, 8.0e6, 1.0);
  29435. globe.translucency.enabled = true;
  29436. * @example
  29437. * // Example 2.
  29438. // Disable front face translucency by distance
  29439. globe.translucency.frontFaceAlphaByDistance = undefined;
  29440. */
  29441. frontFaceAlphaByDistance: NearFarScalar;
  29442. /**
  29443. * A constant translucency to apply to back faces of the globe.
  29444. <br /><br />
  29445. {@link GlobeTranslucency#enabled} must be set to true for this option to take effect.
  29446. * @example
  29447. * // Set back face translucency to 0.5.
  29448. globe.translucency.backFaceAlpha = 0.5;
  29449. globe.translucency.enabled = true;
  29450. */
  29451. backFaceAlpha: number;
  29452. /**
  29453. * Gets or sets near and far translucency properties of back faces of the globe based on the distance to the camera.
  29454. The translucency will interpolate between the {@link NearFarScalar#nearValue} and
  29455. {@link NearFarScalar#farValue} while the camera distance falls within the lower and upper bounds
  29456. of the specified {@link NearFarScalar#near} and {@link NearFarScalar#far}.
  29457. Outside of these ranges the translucency remains clamped to the nearest bound. If undefined,
  29458. backFaceAlphaByDistance will be disabled.
  29459. <br /><br />
  29460. {@link GlobeTranslucency#enabled} must be set to true for this option to take effect.
  29461. * @example
  29462. * // Example 1.
  29463. // Set back face translucency to 0.5 when the
  29464. // camera is 1500 meters from the surface and 1.0
  29465. // as the camera distance approaches 8.0e6 meters.
  29466. globe.translucency.backFaceAlphaByDistance = new Cesium.NearFarScalar(1.5e2, 0.5, 8.0e6, 1.0);
  29467. globe.translucency.enabled = true;
  29468. * @example
  29469. * // Example 2.
  29470. // Disable back face translucency by distance
  29471. globe.translucency.backFaceAlphaByDistance = undefined;
  29472. */
  29473. backFaceAlphaByDistance: NearFarScalar;
  29474. /**
  29475. * A property specifying a {@link Rectangle} used to limit translucency to a cartographic area.
  29476. Defaults to the maximum extent of cartographic coordinates.
  29477. */
  29478. rectangle: Rectangle;
  29479. }
  29480. export namespace GoogleEarthEnterpriseImageryProvider {
  29481. /**
  29482. * Initialization options for the GoogleEarthEnterpriseImageryProvider constructor
  29483. * @property url - The url of the Google Earth Enterprise server hosting the imagery.
  29484. * @property metadata - A metadata object that can be used to share metadata requests with a GoogleEarthEnterpriseTerrainProvider.
  29485. * @property [ellipsoid] - The ellipsoid. If not specified, the WGS84 ellipsoid is used.
  29486. * @property [tileDiscardPolicy] - The policy that determines if a tile
  29487. is invalid and should be discarded. If this value is not specified, a default
  29488. is to discard tiles that fail to download.
  29489. * @property [credit] - A credit for the data source, which is displayed on the canvas.
  29490. */
  29491. type ConstructorOptions = {
  29492. url: Resource | string;
  29493. metadata: GoogleEarthEnterpriseMetadata;
  29494. ellipsoid?: Ellipsoid;
  29495. tileDiscardPolicy?: TileDiscardPolicy;
  29496. credit?: Credit | string;
  29497. };
  29498. }
  29499. /**
  29500. * Provides tiled imagery using the Google Earth Enterprise REST API.
  29501. Notes: This provider is for use with the 3D Earth API of Google Earth Enterprise,
  29502. {@link GoogleEarthEnterpriseMapsProvider} should be used with 2D Maps API.
  29503. * @example
  29504. * var geeMetadata = new GoogleEarthEnterpriseMetadata('http://www.earthenterprise.org/3d');
  29505. var gee = new Cesium.GoogleEarthEnterpriseImageryProvider({
  29506. metadata : geeMetadata
  29507. });
  29508. * @param options - Object describing initialization options
  29509. */
  29510. export class GoogleEarthEnterpriseImageryProvider {
  29511. constructor(options: GoogleEarthEnterpriseImageryProvider.ConstructorOptions);
  29512. /**
  29513. * The default alpha blending value of this provider, with 0.0 representing fully transparent and
  29514. 1.0 representing fully opaque.
  29515. */
  29516. defaultAlpha: number | undefined;
  29517. /**
  29518. * The default alpha blending value on the night side of the globe of this provider, with 0.0 representing fully transparent and
  29519. 1.0 representing fully opaque.
  29520. */
  29521. defaultNightAlpha: number | undefined;
  29522. /**
  29523. * The default alpha blending value on the day side of the globe of this provider, with 0.0 representing fully transparent and
  29524. 1.0 representing fully opaque.
  29525. */
  29526. defaultDayAlpha: number | undefined;
  29527. /**
  29528. * The default brightness of this provider. 1.0 uses the unmodified imagery color. Less than 1.0
  29529. makes the imagery darker while greater than 1.0 makes it brighter.
  29530. */
  29531. defaultBrightness: number | undefined;
  29532. /**
  29533. * The default contrast of this provider. 1.0 uses the unmodified imagery color. Less than 1.0 reduces
  29534. the contrast while greater than 1.0 increases it.
  29535. */
  29536. defaultContrast: number | undefined;
  29537. /**
  29538. * The default hue of this provider in radians. 0.0 uses the unmodified imagery color.
  29539. */
  29540. defaultHue: number | undefined;
  29541. /**
  29542. * The default saturation of this provider. 1.0 uses the unmodified imagery color. Less than 1.0 reduces the
  29543. saturation while greater than 1.0 increases it.
  29544. */
  29545. defaultSaturation: number | undefined;
  29546. /**
  29547. * The default gamma correction to apply to this provider. 1.0 uses the unmodified imagery color.
  29548. */
  29549. defaultGamma: number | undefined;
  29550. /**
  29551. * The default texture minification filter to apply to this provider.
  29552. */
  29553. defaultMinificationFilter: TextureMinificationFilter;
  29554. /**
  29555. * The default texture magnification filter to apply to this provider.
  29556. */
  29557. defaultMagnificationFilter: TextureMagnificationFilter;
  29558. /**
  29559. * Gets the name of the Google Earth Enterprise server url hosting the imagery.
  29560. */
  29561. readonly url: string;
  29562. /**
  29563. * Gets the proxy used by this provider.
  29564. */
  29565. readonly proxy: Proxy;
  29566. /**
  29567. * Gets the width of each tile, in pixels. This function should
  29568. not be called before {@link GoogleEarthEnterpriseImageryProvider#ready} returns true.
  29569. */
  29570. readonly tileWidth: number;
  29571. /**
  29572. * Gets the height of each tile, in pixels. This function should
  29573. not be called before {@link GoogleEarthEnterpriseImageryProvider#ready} returns true.
  29574. */
  29575. readonly tileHeight: number;
  29576. /**
  29577. * Gets the maximum level-of-detail that can be requested. This function should
  29578. not be called before {@link GoogleEarthEnterpriseImageryProvider#ready} returns true.
  29579. */
  29580. readonly maximumLevel: number | undefined;
  29581. /**
  29582. * Gets the minimum level-of-detail that can be requested. This function should
  29583. not be called before {@link GoogleEarthEnterpriseImageryProvider#ready} returns true.
  29584. */
  29585. readonly minimumLevel: number;
  29586. /**
  29587. * Gets the tiling scheme used by this provider. This function should
  29588. not be called before {@link GoogleEarthEnterpriseImageryProvider#ready} returns true.
  29589. */
  29590. readonly tilingScheme: TilingScheme;
  29591. /**
  29592. * Gets the rectangle, in radians, of the imagery provided by this instance. This function should
  29593. not be called before {@link GoogleEarthEnterpriseImageryProvider#ready} returns true.
  29594. */
  29595. readonly rectangle: Rectangle;
  29596. /**
  29597. * Gets the tile discard policy. If not undefined, the discard policy is responsible
  29598. for filtering out "missing" tiles via its shouldDiscardImage function. If this function
  29599. returns undefined, no tiles are filtered. This function should
  29600. not be called before {@link GoogleEarthEnterpriseImageryProvider#ready} returns true.
  29601. */
  29602. readonly tileDiscardPolicy: TileDiscardPolicy;
  29603. /**
  29604. * Gets an event that is raised when the imagery provider encounters an asynchronous error. By subscribing
  29605. to the event, you will be notified of the error and can potentially recover from it. Event listeners
  29606. are passed an instance of {@link TileProviderError}.
  29607. */
  29608. readonly errorEvent: Event;
  29609. /**
  29610. * Gets a value indicating whether or not the provider is ready for use.
  29611. */
  29612. readonly ready: boolean;
  29613. /**
  29614. * Gets a promise that resolves to true when the provider is ready for use.
  29615. */
  29616. readonly readyPromise: Promise<boolean>;
  29617. /**
  29618. * Gets the credit to display when this imagery provider is active. Typically this is used to credit
  29619. the source of the imagery. This function should not be called before {@link GoogleEarthEnterpriseImageryProvider#ready} returns true.
  29620. */
  29621. readonly credit: Credit;
  29622. /**
  29623. * Gets a value indicating whether or not the images provided by this imagery provider
  29624. include an alpha channel. If this property is false, an alpha channel, if present, will
  29625. be ignored. If this property is true, any images without an alpha channel will be treated
  29626. as if their alpha is 1.0 everywhere. Setting this property to false reduces memory usage
  29627. and texture upload time.
  29628. */
  29629. readonly hasAlphaChannel: boolean;
  29630. /**
  29631. * Gets the credits to be displayed when a given tile is displayed.
  29632. * @param x - The tile X coordinate.
  29633. * @param y - The tile Y coordinate.
  29634. * @param level - The tile level;
  29635. * @returns The credits to be displayed when the tile is displayed.
  29636. */
  29637. getTileCredits(x: number, y: number, level: number): Credit[];
  29638. /**
  29639. * Requests the image for a given tile. This function should
  29640. not be called before {@link GoogleEarthEnterpriseImageryProvider#ready} returns true.
  29641. * @param x - The tile X coordinate.
  29642. * @param y - The tile Y coordinate.
  29643. * @param level - The tile level.
  29644. * @param [request] - The request object. Intended for internal use only.
  29645. * @returns A promise for the image that will resolve when the image is available, or
  29646. undefined if there are too many active requests to the server, and the request
  29647. should be retried later. The resolved image may be either an
  29648. Image or a Canvas DOM object.
  29649. */
  29650. requestImage(x: number, y: number, level: number, request?: Request): Promise<HTMLImageElement | HTMLCanvasElement> | undefined;
  29651. /**
  29652. * Picking features is not currently supported by this imagery provider, so this function simply returns
  29653. undefined.
  29654. * @param x - The tile X coordinate.
  29655. * @param y - The tile Y coordinate.
  29656. * @param level - The tile level.
  29657. * @param longitude - The longitude at which to pick features.
  29658. * @param latitude - The latitude at which to pick features.
  29659. * @returns A promise for the picked features that will resolve when the asynchronous
  29660. picking completes. The resolved value is an array of {@link ImageryLayerFeatureInfo}
  29661. instances. The array may be empty if no features are found at the given location.
  29662. It may also be undefined if picking is not supported.
  29663. */
  29664. pickFeatures(x: number, y: number, level: number, longitude: number, latitude: number): Promise<ImageryLayerFeatureInfo[]> | undefined;
  29665. }
  29666. export namespace GoogleEarthEnterpriseMapsProvider {
  29667. /**
  29668. * Initialization options for the GoogleEarthEnterpriseMapsProvider constructor
  29669. * @property url - The url of the Google Earth server hosting the imagery.
  29670. * @property channel - The channel (id) to be used when requesting data from the server.
  29671. The channel number can be found by looking at the json file located at:
  29672. earth.localdomain/default_map/query?request=Json&vars=geeServerDefs The /default_map path may
  29673. differ depending on your Google Earth Enterprise server configuration. Look for the "id" that
  29674. is associated with a "ImageryMaps" requestType. There may be more than one id available.
  29675. Example:
  29676. {
  29677. layers: [
  29678. {
  29679. id: 1002,
  29680. requestType: "ImageryMaps"
  29681. },
  29682. {
  29683. id: 1007,
  29684. requestType: "VectorMapsRaster"
  29685. }
  29686. ]
  29687. }
  29688. * @property [path = "/default_map"] - The path of the Google Earth server hosting the imagery.
  29689. * @property [maximumLevel] - The maximum level-of-detail supported by the Google Earth
  29690. Enterprise server, or undefined if there is no limit.
  29691. * @property [tileDiscardPolicy] - The policy that determines if a tile
  29692. is invalid and should be discarded. To ensure that no tiles are discarded, construct and pass
  29693. a {@link NeverTileDiscardPolicy} for this parameter.
  29694. * @property [ellipsoid] - The ellipsoid. If not specified, the WGS84 ellipsoid is used.
  29695. */
  29696. type ConstructorOptions = {
  29697. url: Resource | string;
  29698. channel: number;
  29699. path?: string;
  29700. maximumLevel?: number;
  29701. tileDiscardPolicy?: TileDiscardPolicy;
  29702. ellipsoid?: Ellipsoid;
  29703. };
  29704. }
  29705. /**
  29706. * Provides tiled imagery using the Google Earth Imagery API.
  29707. Notes: This imagery provider does not work with the public Google Earth servers. It works with the
  29708. Google Earth Enterprise Server.
  29709. By default the Google Earth Enterprise server does not set the
  29710. {@link http://www.w3.org/TR/cors/|Cross-Origin Resource Sharing} headers. You can either
  29711. use a proxy server which adds these headers, or in the /opt/google/gehttpd/conf/gehttpd.conf
  29712. and add the 'Header set Access-Control-Allow-Origin "*"' option to the '&lt;Directory /&gt;' and
  29713. '&lt;Directory "/opt/google/gehttpd/htdocs"&gt;' directives.
  29714. This provider is for use with 2D Maps API as part of Google Earth Enterprise. For 3D Earth API uses, it
  29715. is necessary to use {@link GoogleEarthEnterpriseImageryProvider}
  29716. * @example
  29717. * var google = new Cesium.GoogleEarthEnterpriseMapsProvider({
  29718. url : 'https://earth.localdomain',
  29719. channel : 1008
  29720. });
  29721. * @param options - Object describing initialization options
  29722. */
  29723. export class GoogleEarthEnterpriseMapsProvider {
  29724. constructor(options: GoogleEarthEnterpriseMapsProvider.ConstructorOptions);
  29725. /**
  29726. * The default alpha blending value of this provider, with 0.0 representing fully transparent and
  29727. 1.0 representing fully opaque.
  29728. */
  29729. defaultAlpha: number | undefined;
  29730. /**
  29731. * The default alpha blending value on the night side of the globe of this provider, with 0.0 representing fully transparent and
  29732. 1.0 representing fully opaque.
  29733. */
  29734. defaultNightAlpha: number | undefined;
  29735. /**
  29736. * The default alpha blending value on the day side of the globe of this provider, with 0.0 representing fully transparent and
  29737. 1.0 representing fully opaque.
  29738. */
  29739. defaultDayAlpha: number | undefined;
  29740. /**
  29741. * The default brightness of this provider. 1.0 uses the unmodified imagery color. Less than 1.0
  29742. makes the imagery darker while greater than 1.0 makes it brighter.
  29743. */
  29744. defaultBrightness: number | undefined;
  29745. /**
  29746. * The default contrast of this provider. 1.0 uses the unmodified imagery color. Less than 1.0 reduces
  29747. the contrast while greater than 1.0 increases it.
  29748. */
  29749. defaultContrast: number | undefined;
  29750. /**
  29751. * The default hue of this provider in radians. 0.0 uses the unmodified imagery color.
  29752. */
  29753. defaultHue: number | undefined;
  29754. /**
  29755. * The default saturation of this provider. 1.0 uses the unmodified imagery color. Less than 1.0 reduces the
  29756. saturation while greater than 1.0 increases it.
  29757. */
  29758. defaultSaturation: number | undefined;
  29759. /**
  29760. * The default gamma correction to apply to this provider. 1.0 uses the unmodified imagery color.
  29761. */
  29762. defaultGamma: number | undefined;
  29763. /**
  29764. * The default texture minification filter to apply to this provider.
  29765. */
  29766. defaultMinificationFilter: TextureMinificationFilter;
  29767. /**
  29768. * The default texture magnification filter to apply to this provider.
  29769. */
  29770. defaultMagnificationFilter: TextureMagnificationFilter;
  29771. /**
  29772. * Gets the URL of the Google Earth MapServer.
  29773. */
  29774. readonly url: string;
  29775. /**
  29776. * Gets the url path of the data on the Google Earth server.
  29777. */
  29778. readonly path: string;
  29779. /**
  29780. * Gets the proxy used by this provider.
  29781. */
  29782. readonly proxy: Proxy;
  29783. /**
  29784. * Gets the imagery channel (id) currently being used.
  29785. */
  29786. readonly channel: number;
  29787. /**
  29788. * Gets the width of each tile, in pixels. This function should
  29789. not be called before {@link GoogleEarthEnterpriseMapsProvider#ready} returns true.
  29790. */
  29791. readonly tileWidth: number;
  29792. /**
  29793. * Gets the height of each tile, in pixels. This function should
  29794. not be called before {@link GoogleEarthEnterpriseMapsProvider#ready} returns true.
  29795. */
  29796. readonly tileHeight: number;
  29797. /**
  29798. * Gets the maximum level-of-detail that can be requested. This function should
  29799. not be called before {@link GoogleEarthEnterpriseMapsProvider#ready} returns true.
  29800. */
  29801. readonly maximumLevel: number | undefined;
  29802. /**
  29803. * Gets the minimum level-of-detail that can be requested. This function should
  29804. not be called before {@link GoogleEarthEnterpriseMapsProvider#ready} returns true.
  29805. */
  29806. readonly minimumLevel: number;
  29807. /**
  29808. * Gets the tiling scheme used by this provider. This function should
  29809. not be called before {@link GoogleEarthEnterpriseMapsProvider#ready} returns true.
  29810. */
  29811. readonly tilingScheme: TilingScheme;
  29812. /**
  29813. * Gets the version of the data used by this provider. This function should
  29814. not be called before {@link GoogleEarthEnterpriseMapsProvider#ready} returns true.
  29815. */
  29816. readonly version: number;
  29817. /**
  29818. * Gets the type of data that is being requested from the provider. This function should
  29819. not be called before {@link GoogleEarthEnterpriseMapsProvider#ready} returns true.
  29820. */
  29821. readonly requestType: string;
  29822. /**
  29823. * Gets the rectangle, in radians, of the imagery provided by this instance. This function should
  29824. not be called before {@link GoogleEarthEnterpriseMapsProvider#ready} returns true.
  29825. */
  29826. readonly rectangle: Rectangle;
  29827. /**
  29828. * Gets the tile discard policy. If not undefined, the discard policy is responsible
  29829. for filtering out "missing" tiles via its shouldDiscardImage function. If this function
  29830. returns undefined, no tiles are filtered. This function should
  29831. not be called before {@link GoogleEarthEnterpriseMapsProvider#ready} returns true.
  29832. */
  29833. readonly tileDiscardPolicy: TileDiscardPolicy;
  29834. /**
  29835. * Gets an event that is raised when the imagery provider encounters an asynchronous error. By subscribing
  29836. to the event, you will be notified of the error and can potentially recover from it. Event listeners
  29837. are passed an instance of {@link TileProviderError}.
  29838. */
  29839. readonly errorEvent: Event;
  29840. /**
  29841. * Gets a value indicating whether or not the provider is ready for use.
  29842. */
  29843. readonly ready: boolean;
  29844. /**
  29845. * Gets a promise that resolves to true when the provider is ready for use.
  29846. */
  29847. readonly readyPromise: Promise<boolean>;
  29848. /**
  29849. * Gets the credit to display when this imagery provider is active. Typically this is used to credit
  29850. the source of the imagery. This function should not be called before {@link GoogleEarthEnterpriseMapsProvider#ready} returns true.
  29851. */
  29852. readonly credit: Credit;
  29853. /**
  29854. * Gets a value indicating whether or not the images provided by this imagery provider
  29855. include an alpha channel. If this property is false, an alpha channel, if present, will
  29856. be ignored. If this property is true, any images without an alpha channel will be treated
  29857. as if their alpha is 1.0 everywhere. When this property is false, memory usage
  29858. and texture upload time are reduced.
  29859. */
  29860. readonly hasAlphaChannel: boolean;
  29861. /**
  29862. * Gets the credits to be displayed when a given tile is displayed.
  29863. * @param x - The tile X coordinate.
  29864. * @param y - The tile Y coordinate.
  29865. * @param level - The tile level;
  29866. * @returns The credits to be displayed when the tile is displayed.
  29867. */
  29868. getTileCredits(x: number, y: number, level: number): Credit[];
  29869. /**
  29870. * Requests the image for a given tile. This function should
  29871. not be called before {@link GoogleEarthEnterpriseMapsProvider#ready} returns true.
  29872. * @param x - The tile X coordinate.
  29873. * @param y - The tile Y coordinate.
  29874. * @param level - The tile level.
  29875. * @param [request] - The request object. Intended for internal use only.
  29876. * @returns A promise for the image that will resolve when the image is available, or
  29877. undefined if there are too many active requests to the server, and the request
  29878. should be retried later. The resolved image may be either an
  29879. Image or a Canvas DOM object.
  29880. */
  29881. requestImage(x: number, y: number, level: number, request?: Request): Promise<HTMLImageElement | HTMLCanvasElement> | undefined;
  29882. /**
  29883. * Picking features is not currently supported by this imagery provider, so this function simply returns
  29884. undefined.
  29885. * @param x - The tile X coordinate.
  29886. * @param y - The tile Y coordinate.
  29887. * @param level - The tile level.
  29888. * @param longitude - The longitude at which to pick features.
  29889. * @param latitude - The latitude at which to pick features.
  29890. * @returns A promise for the picked features that will resolve when the asynchronous
  29891. picking completes. The resolved value is an array of {@link ImageryLayerFeatureInfo}
  29892. instances. The array may be empty if no features are found at the given location.
  29893. It may also be undefined if picking is not supported.
  29894. */
  29895. pickFeatures(x: number, y: number, level: number, longitude: number, latitude: number): Promise<ImageryLayerFeatureInfo[]> | undefined;
  29896. /**
  29897. * Gets or sets the URL to the Google Earth logo for display in the credit.
  29898. */
  29899. static logoUrl: string;
  29900. }
  29901. export namespace GridImageryProvider {
  29902. /**
  29903. * Initialization options for the GridImageryProvider constructor
  29904. * @property [tilingScheme = new GeographicTilingScheme()] - The tiling scheme for which to draw tiles.
  29905. * @property [ellipsoid] - The ellipsoid. If the tilingScheme is specified,
  29906. this parameter is ignored and the tiling scheme's ellipsoid is used instead. If neither
  29907. parameter is specified, the WGS84 ellipsoid is used.
  29908. * @property [cells = 8] - The number of grids cells.
  29909. * @property [color = Color(1.0, 1.0, 1.0, 0.4)] - The color to draw grid lines.
  29910. * @property [glowColor = Color(0.0, 1.0, 0.0, 0.05)] - The color to draw glow for grid lines.
  29911. * @property [glowWidth = 6] - The width of lines used for rendering the line glow effect.
  29912. * @property [backgroundColor = Color(0.0, 0.5, 0.0, 0.2)] - Background fill color.
  29913. * @property [tileWidth = 256] - The width of the tile for level-of-detail selection purposes.
  29914. * @property [tileHeight = 256] - The height of the tile for level-of-detail selection purposes.
  29915. * @property [canvasSize = 256] - The size of the canvas used for rendering.
  29916. */
  29917. type ConstructorOptions = {
  29918. tilingScheme?: TilingScheme;
  29919. ellipsoid?: Ellipsoid;
  29920. cells?: number;
  29921. color?: Color;
  29922. glowColor?: Color;
  29923. glowWidth?: number;
  29924. backgroundColor?: Color;
  29925. tileWidth?: number;
  29926. tileHeight?: number;
  29927. canvasSize?: number;
  29928. };
  29929. }
  29930. /**
  29931. * An {@link ImageryProvider} that draws a wireframe grid on every tile with controllable background and glow.
  29932. May be useful for custom rendering effects or debugging terrain.
  29933. * @param options - Object describing initialization options
  29934. */
  29935. export class GridImageryProvider {
  29936. constructor(options: GridImageryProvider.ConstructorOptions);
  29937. /**
  29938. * The default alpha blending value of this provider, with 0.0 representing fully transparent and
  29939. 1.0 representing fully opaque.
  29940. */
  29941. defaultAlpha: number | undefined;
  29942. /**
  29943. * The default alpha blending value on the night side of the globe of this provider, with 0.0 representing fully transparent and
  29944. 1.0 representing fully opaque.
  29945. */
  29946. defaultNightAlpha: number | undefined;
  29947. /**
  29948. * The default alpha blending value on the day side of the globe of this provider, with 0.0 representing fully transparent and
  29949. 1.0 representing fully opaque.
  29950. */
  29951. defaultDayAlpha: number | undefined;
  29952. /**
  29953. * The default brightness of this provider. 1.0 uses the unmodified imagery color. Less than 1.0
  29954. makes the imagery darker while greater than 1.0 makes it brighter.
  29955. */
  29956. defaultBrightness: number | undefined;
  29957. /**
  29958. * The default contrast of this provider. 1.0 uses the unmodified imagery color. Less than 1.0 reduces
  29959. the contrast while greater than 1.0 increases it.
  29960. */
  29961. defaultContrast: number | undefined;
  29962. /**
  29963. * The default hue of this provider in radians. 0.0 uses the unmodified imagery color.
  29964. */
  29965. defaultHue: number | undefined;
  29966. /**
  29967. * The default saturation of this provider. 1.0 uses the unmodified imagery color. Less than 1.0 reduces the
  29968. saturation while greater than 1.0 increases it.
  29969. */
  29970. defaultSaturation: number | undefined;
  29971. /**
  29972. * The default gamma correction to apply to this provider. 1.0 uses the unmodified imagery color.
  29973. */
  29974. defaultGamma: number | undefined;
  29975. /**
  29976. * The default texture minification filter to apply to this provider.
  29977. */
  29978. defaultMinificationFilter: TextureMinificationFilter;
  29979. /**
  29980. * The default texture magnification filter to apply to this provider.
  29981. */
  29982. defaultMagnificationFilter: TextureMagnificationFilter;
  29983. /**
  29984. * Gets the proxy used by this provider.
  29985. */
  29986. readonly proxy: Proxy;
  29987. /**
  29988. * Gets the width of each tile, in pixels. This function should
  29989. not be called before {@link GridImageryProvider#ready} returns true.
  29990. */
  29991. readonly tileWidth: number;
  29992. /**
  29993. * Gets the height of each tile, in pixels. This function should
  29994. not be called before {@link GridImageryProvider#ready} returns true.
  29995. */
  29996. readonly tileHeight: number;
  29997. /**
  29998. * Gets the maximum level-of-detail that can be requested. This function should
  29999. not be called before {@link GridImageryProvider#ready} returns true.
  30000. */
  30001. readonly maximumLevel: number | undefined;
  30002. /**
  30003. * Gets the minimum level-of-detail that can be requested. This function should
  30004. not be called before {@link GridImageryProvider#ready} returns true.
  30005. */
  30006. readonly minimumLevel: number;
  30007. /**
  30008. * Gets the tiling scheme used by this provider. This function should
  30009. not be called before {@link GridImageryProvider#ready} returns true.
  30010. */
  30011. readonly tilingScheme: TilingScheme;
  30012. /**
  30013. * Gets the rectangle, in radians, of the imagery provided by this instance. This function should
  30014. not be called before {@link GridImageryProvider#ready} returns true.
  30015. */
  30016. readonly rectangle: Rectangle;
  30017. /**
  30018. * Gets the tile discard policy. If not undefined, the discard policy is responsible
  30019. for filtering out "missing" tiles via its shouldDiscardImage function. If this function
  30020. returns undefined, no tiles are filtered. This function should
  30021. not be called before {@link GridImageryProvider#ready} returns true.
  30022. */
  30023. readonly tileDiscardPolicy: TileDiscardPolicy;
  30024. /**
  30025. * Gets an event that is raised when the imagery provider encounters an asynchronous error. By subscribing
  30026. to the event, you will be notified of the error and can potentially recover from it. Event listeners
  30027. are passed an instance of {@link TileProviderError}.
  30028. */
  30029. readonly errorEvent: Event;
  30030. /**
  30031. * Gets a value indicating whether or not the provider is ready for use.
  30032. */
  30033. readonly ready: boolean;
  30034. /**
  30035. * Gets a promise that resolves to true when the provider is ready for use.
  30036. */
  30037. readonly readyPromise: Promise<boolean>;
  30038. /**
  30039. * Gets the credit to display when this imagery provider is active. Typically this is used to credit
  30040. the source of the imagery. This function should not be called before {@link GridImageryProvider#ready} returns true.
  30041. */
  30042. readonly credit: Credit;
  30043. /**
  30044. * Gets a value indicating whether or not the images provided by this imagery provider
  30045. include an alpha channel. If this property is false, an alpha channel, if present, will
  30046. be ignored. If this property is true, any images without an alpha channel will be treated
  30047. as if their alpha is 1.0 everywhere. When this property is false, memory usage
  30048. and texture upload time are reduced.
  30049. */
  30050. readonly hasAlphaChannel: boolean;
  30051. /**
  30052. * Draws a grid of lines into a canvas.
  30053. */
  30054. _drawGrid(): void;
  30055. /**
  30056. * Render a grid into a canvas with background and glow
  30057. */
  30058. _createGridCanvas(): void;
  30059. /**
  30060. * Gets the credits to be displayed when a given tile is displayed.
  30061. * @param x - The tile X coordinate.
  30062. * @param y - The tile Y coordinate.
  30063. * @param level - The tile level;
  30064. * @returns The credits to be displayed when the tile is displayed.
  30065. */
  30066. getTileCredits(x: number, y: number, level: number): Credit[];
  30067. /**
  30068. * Requests the image for a given tile. This function should
  30069. not be called before {@link GridImageryProvider#ready} returns true.
  30070. * @param x - The tile X coordinate.
  30071. * @param y - The tile Y coordinate.
  30072. * @param level - The tile level.
  30073. * @param [request] - The request object. Intended for internal use only.
  30074. * @returns A promise for the image that will resolve when the image is available, or
  30075. undefined if there are too many active requests to the server, and the request
  30076. should be retried later. The resolved image may be either an
  30077. Image or a Canvas DOM object.
  30078. */
  30079. requestImage(x: number, y: number, level: number, request?: Request): Promise<HTMLImageElement | HTMLCanvasElement> | undefined;
  30080. /**
  30081. * Picking features is not currently supported by this imagery provider, so this function simply returns
  30082. undefined.
  30083. * @param x - The tile X coordinate.
  30084. * @param y - The tile Y coordinate.
  30085. * @param level - The tile level.
  30086. * @param longitude - The longitude at which to pick features.
  30087. * @param latitude - The latitude at which to pick features.
  30088. * @returns A promise for the picked features that will resolve when the asynchronous
  30089. picking completes. The resolved value is an array of {@link ImageryLayerFeatureInfo}
  30090. instances. The array may be empty if no features are found at the given location.
  30091. It may also be undefined if picking is not supported.
  30092. */
  30093. pickFeatures(x: number, y: number, level: number, longitude: number, latitude: number): Promise<ImageryLayerFeatureInfo[]> | undefined;
  30094. }
  30095. /**
  30096. * A GroundPolylinePrimitive represents a polyline draped over the terrain or 3D Tiles in the {@link Scene}.
  30097. <p>
  30098. Only to be used with GeometryInstances containing {@link GroundPolylineGeometry}.
  30099. </p>
  30100. * @example
  30101. * // 1. Draw a polyline on terrain with a basic color material
  30102. var instance = new Cesium.GeometryInstance({
  30103. geometry : new Cesium.GroundPolylineGeometry({
  30104. positions : Cesium.Cartesian3.fromDegreesArray([
  30105. -112.1340164450331, 36.05494287836128,
  30106. -112.08821010582645, 36.097804071380715
  30107. ]),
  30108. width : 4.0
  30109. }),
  30110. id : 'object returned when this instance is picked and to get/set per-instance attributes'
  30111. });
  30112. scene.groundPrimitives.add(new Cesium.GroundPolylinePrimitive({
  30113. geometryInstances : instance,
  30114. appearance : new Cesium.PolylineMaterialAppearance()
  30115. }));
  30116. // 2. Draw a looped polyline on terrain with per-instance color and a distance display condition.
  30117. // Distance display conditions for polylines on terrain are based on an approximate terrain height
  30118. // instead of true terrain height.
  30119. var instance = new Cesium.GeometryInstance({
  30120. geometry : new Cesium.GroundPolylineGeometry({
  30121. positions : Cesium.Cartesian3.fromDegreesArray([
  30122. -112.1340164450331, 36.05494287836128,
  30123. -112.08821010582645, 36.097804071380715,
  30124. -112.13296079730024, 36.168769146801104
  30125. ]),
  30126. loop : true,
  30127. width : 4.0
  30128. }),
  30129. attributes : {
  30130. color : Cesium.ColorGeometryInstanceAttribute.fromColor(Cesium.Color.fromCssColorString('green').withAlpha(0.7)),
  30131. distanceDisplayCondition : new Cesium.DistanceDisplayConditionGeometryInstanceAttribute(1000, 30000)
  30132. },
  30133. id : 'object returned when this instance is picked and to get/set per-instance attributes'
  30134. });
  30135. scene.groundPrimitives.add(new Cesium.GroundPolylinePrimitive({
  30136. geometryInstances : instance,
  30137. appearance : new Cesium.PolylineColorAppearance()
  30138. }));
  30139. * @param [options] - Object with the following properties:
  30140. * @param [options.geometryInstances] - GeometryInstances containing GroundPolylineGeometry
  30141. * @param [options.appearance] - The Appearance used to render the polyline. Defaults to a white color {@link Material} on a {@link PolylineMaterialAppearance}.
  30142. * @param [options.show = true] - Determines if this primitive will be shown.
  30143. * @param [options.interleave = false] - When <code>true</code>, geometry vertex attributes are interleaved, which can slightly improve rendering performance but increases load time.
  30144. * @param [options.releaseGeometryInstances = true] - When <code>true</code>, the primitive does not keep a reference to the input <code>geometryInstances</code> to save memory.
  30145. * @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.
  30146. * @param [options.asynchronous = true] - Determines if the primitive will be created asynchronously or block until ready. If false initializeTerrainHeights() must be called first.
  30147. * @param [options.classificationType = ClassificationType.BOTH] - Determines whether terrain, 3D Tiles or both will be classified.
  30148. * @param [options.debugShowBoundingVolume = false] - For debugging only. Determines if this primitive's commands' bounding spheres are shown.
  30149. * @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.
  30150. */
  30151. export class GroundPolylinePrimitive {
  30152. constructor(options?: {
  30153. geometryInstances?: any[] | GeometryInstance;
  30154. appearance?: Appearance;
  30155. show?: boolean;
  30156. interleave?: boolean;
  30157. releaseGeometryInstances?: boolean;
  30158. allowPicking?: boolean;
  30159. asynchronous?: boolean;
  30160. classificationType?: ClassificationType;
  30161. debugShowBoundingVolume?: boolean;
  30162. debugShowShadowVolume?: boolean;
  30163. });
  30164. /**
  30165. * The geometry instances rendered with this primitive. This may
  30166. be <code>undefined</code> if <code>options.releaseGeometryInstances</code>
  30167. is <code>true</code> when the primitive is constructed.
  30168. <p>
  30169. Changing this property after the primitive is rendered has no effect.
  30170. </p>
  30171. */
  30172. readonly geometryInstances: any[] | GeometryInstance;
  30173. /**
  30174. * The {@link Appearance} used to shade this primitive. Each geometry
  30175. instance is shaded with the same appearance. Some appearances, like
  30176. {@link PolylineColorAppearance} allow giving each instance unique
  30177. properties.
  30178. */
  30179. appearance: Appearance;
  30180. /**
  30181. * Determines if the primitive will be shown. This affects all geometry
  30182. instances in the primitive.
  30183. */
  30184. show: boolean;
  30185. /**
  30186. * Determines whether terrain, 3D Tiles or both will be classified.
  30187. */
  30188. classificationType: ClassificationType;
  30189. /**
  30190. * This property is for debugging only; it is not for production use nor is it optimized.
  30191. <p>
  30192. Draws the bounding sphere for each draw command in the primitive.
  30193. </p>
  30194. */
  30195. debugShowBoundingVolume: boolean;
  30196. /**
  30197. * Determines if geometry vertex attributes are interleaved, which can slightly improve rendering performance.
  30198. */
  30199. readonly interleave: boolean;
  30200. /**
  30201. * When <code>true</code>, the primitive does not keep a reference to the input <code>geometryInstances</code> to save memory.
  30202. */
  30203. readonly releaseGeometryInstances: boolean;
  30204. /**
  30205. * When <code>true</code>, each geometry instance will only be pickable with {@link Scene#pick}. When <code>false</code>, GPU memory is saved.
  30206. */
  30207. readonly allowPicking: boolean;
  30208. /**
  30209. * Determines if the geometry instances will be created and batched on a web worker.
  30210. */
  30211. readonly asynchronous: boolean;
  30212. /**
  30213. * Determines if the primitive is complete and ready to render. If this property is
  30214. true, the primitive will be rendered the next time that {@link GroundPolylinePrimitive#update}
  30215. is called.
  30216. */
  30217. readonly ready: boolean;
  30218. /**
  30219. * Gets a promise that resolves when the primitive is ready to render.
  30220. */
  30221. readonly readyPromise: Promise<GroundPolylinePrimitive>;
  30222. /**
  30223. * This property is for debugging only; it is not for production use nor is it optimized.
  30224. <p>
  30225. If true, draws the shadow volume for each geometry in the primitive.
  30226. </p>
  30227. */
  30228. readonly debugShowShadowVolume: boolean;
  30229. /**
  30230. * Initializes the minimum and maximum terrain heights. This only needs to be called if you are creating the
  30231. GroundPolylinePrimitive synchronously.
  30232. * @returns A promise that will resolve once the terrain heights have been loaded.
  30233. */
  30234. static initializeTerrainHeights(): Promise<void>;
  30235. /**
  30236. * Called when {@link Viewer} or {@link CesiumWidget} render the scene to
  30237. get the draw commands needed to render this primitive.
  30238. <p>
  30239. Do not call this function directly. This is documented just to
  30240. list the exceptions that may be propagated when the scene is rendered:
  30241. </p>
  30242. */
  30243. update(): void;
  30244. /**
  30245. * Returns the modifiable per-instance attributes for a {@link GeometryInstance}.
  30246. * @example
  30247. * var attributes = primitive.getGeometryInstanceAttributes('an id');
  30248. attributes.color = Cesium.ColorGeometryInstanceAttribute.toValue(Cesium.Color.AQUA);
  30249. attributes.show = Cesium.ShowGeometryInstanceAttribute.toValue(true);
  30250. * @param id - The id of the {@link GeometryInstance}.
  30251. * @returns The typed array in the attribute's format or undefined if the is no instance with id.
  30252. */
  30253. getGeometryInstanceAttributes(id: any): any;
  30254. /**
  30255. * Checks if the given Scene supports GroundPolylinePrimitives.
  30256. GroundPolylinePrimitives require support for the WEBGL_depth_texture extension.
  30257. * @param scene - The current scene.
  30258. * @returns Whether or not the current scene supports GroundPolylinePrimitives.
  30259. */
  30260. static isSupported(scene: Scene): boolean;
  30261. /**
  30262. * Returns true if this object was destroyed; otherwise, false.
  30263. <p>
  30264. If this object was destroyed, it should not be used; calling any function other than
  30265. <code>isDestroyed</code> will result in a {@link DeveloperError} exception.
  30266. </p>
  30267. * @returns <code>true</code> if this object was destroyed; otherwise, <code>false</code>.
  30268. */
  30269. isDestroyed(): boolean;
  30270. /**
  30271. * Destroys the WebGL resources held by this object. Destroying an object allows for deterministic
  30272. release of WebGL resources, instead of relying on the garbage collector to destroy this object.
  30273. <p>
  30274. Once an object is destroyed, it should not be used; calling any function other than
  30275. <code>isDestroyed</code> will result in a {@link DeveloperError} exception. Therefore,
  30276. assign the return value (<code>undefined</code>) to the object as done in the example.
  30277. </p>
  30278. * @example
  30279. * e = e && e.destroy();
  30280. */
  30281. destroy(): void;
  30282. }
  30283. /**
  30284. * A ground primitive represents geometry draped over terrain or 3D Tiles in the {@link Scene}.
  30285. <p>
  30286. A primitive combines geometry instances with an {@link Appearance} that describes the full shading, including
  30287. {@link Material} and {@link RenderState}. Roughly, the geometry instance defines the structure and placement,
  30288. and the appearance defines the visual characteristics. Decoupling geometry and appearance allows us to mix
  30289. and match most of them and add a new geometry or appearance independently of each other.
  30290. </p>
  30291. <p>
  30292. Support for the WEBGL_depth_texture extension is required to use GeometryInstances with different PerInstanceColors
  30293. or materials besides PerInstanceColorAppearance.
  30294. </p>
  30295. <p>
  30296. Textured GroundPrimitives were designed for notional patterns and are not meant for precisely mapping
  30297. textures to terrain - for that use case, use {@link SingleTileImageryProvider}.
  30298. </p>
  30299. <p>
  30300. For correct rendering, this feature requires the EXT_frag_depth WebGL extension. For hardware that do not support this extension, there
  30301. will be rendering artifacts for some viewing angles.
  30302. </p>
  30303. <p>
  30304. Valid geometries are {@link CircleGeometry}, {@link CorridorGeometry}, {@link EllipseGeometry}, {@link PolygonGeometry}, and {@link RectangleGeometry}.
  30305. </p>
  30306. * @example
  30307. * // Example 1: Create primitive with a single instance
  30308. var rectangleInstance = new Cesium.GeometryInstance({
  30309. geometry : new Cesium.RectangleGeometry({
  30310. rectangle : Cesium.Rectangle.fromDegrees(-140.0, 30.0, -100.0, 40.0)
  30311. }),
  30312. id : 'rectangle',
  30313. attributes : {
  30314. color : new Cesium.ColorGeometryInstanceAttribute(0.0, 1.0, 1.0, 0.5)
  30315. }
  30316. });
  30317. scene.primitives.add(new Cesium.GroundPrimitive({
  30318. geometryInstances : rectangleInstance
  30319. }));
  30320. // Example 2: Batch instances
  30321. var color = new Cesium.ColorGeometryInstanceAttribute(0.0, 1.0, 1.0, 0.5); // Both instances must have the same color.
  30322. var rectangleInstance = new Cesium.GeometryInstance({
  30323. geometry : new Cesium.RectangleGeometry({
  30324. rectangle : Cesium.Rectangle.fromDegrees(-140.0, 30.0, -100.0, 40.0)
  30325. }),
  30326. id : 'rectangle',
  30327. attributes : {
  30328. color : color
  30329. }
  30330. });
  30331. var ellipseInstance = new Cesium.GeometryInstance({
  30332. geometry : new Cesium.EllipseGeometry({
  30333. center : Cesium.Cartesian3.fromDegrees(-105.0, 40.0),
  30334. semiMinorAxis : 300000.0,
  30335. semiMajorAxis : 400000.0
  30336. }),
  30337. id : 'ellipse',
  30338. attributes : {
  30339. color : color
  30340. }
  30341. });
  30342. scene.primitives.add(new Cesium.GroundPrimitive({
  30343. geometryInstances : [rectangleInstance, ellipseInstance]
  30344. }));
  30345. * @param [options] - Object with the following properties:
  30346. * @param [options.geometryInstances] - The geometry instances to render.
  30347. * @param [options.appearance] - The appearance used to render the primitive. Defaults to a flat PerInstanceColorAppearance when GeometryInstances have a color attribute.
  30348. * @param [options.show = true] - Determines if this primitive will be shown.
  30349. * @param [options.vertexCacheOptimize = false] - When <code>true</code>, geometry vertices are optimized for the pre and post-vertex-shader caches.
  30350. * @param [options.interleave = false] - When <code>true</code>, geometry vertex attributes are interleaved, which can slightly improve rendering performance but increases load time.
  30351. * @param [options.compressVertices = true] - When <code>true</code>, the geometry vertices are compressed, which will save memory.
  30352. * @param [options.releaseGeometryInstances = true] - When <code>true</code>, the primitive does not keep a reference to the input <code>geometryInstances</code> to save memory.
  30353. * @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.
  30354. * @param [options.asynchronous = true] - Determines if the primitive will be created asynchronously or block until ready. If false initializeTerrainHeights() must be called first.
  30355. * @param [options.classificationType = ClassificationType.BOTH] - Determines whether terrain, 3D Tiles or both will be classified.
  30356. * @param [options.debugShowBoundingVolume = false] - For debugging only. Determines if this primitive's commands' bounding spheres are shown.
  30357. * @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
  30358. creation for the volumes to be created before the geometry is released or options.releaseGeometryInstance must be <code>false</code>.
  30359. */
  30360. export class GroundPrimitive {
  30361. constructor(options?: {
  30362. geometryInstances?: any[] | GeometryInstance;
  30363. appearance?: Appearance;
  30364. show?: boolean;
  30365. vertexCacheOptimize?: boolean;
  30366. interleave?: boolean;
  30367. compressVertices?: boolean;
  30368. releaseGeometryInstances?: boolean;
  30369. allowPicking?: boolean;
  30370. asynchronous?: boolean;
  30371. classificationType?: ClassificationType;
  30372. debugShowBoundingVolume?: boolean;
  30373. debugShowShadowVolume?: boolean;
  30374. });
  30375. /**
  30376. * The {@link Appearance} used to shade this primitive. Each geometry
  30377. instance is shaded with the same appearance. Some appearances, like
  30378. {@link PerInstanceColorAppearance} allow giving each instance unique
  30379. properties.
  30380. */
  30381. appearance: Appearance;
  30382. /**
  30383. * The geometry instances rendered with this primitive. This may
  30384. be <code>undefined</code> if <code>options.releaseGeometryInstances</code>
  30385. is <code>true</code> when the primitive is constructed.
  30386. <p>
  30387. Changing this property after the primitive is rendered has no effect.
  30388. </p>
  30389. */
  30390. readonly geometryInstances: any[] | GeometryInstance;
  30391. /**
  30392. * Determines if the primitive will be shown. This affects all geometry
  30393. instances in the primitive.
  30394. */
  30395. show: boolean;
  30396. /**
  30397. * Determines whether terrain, 3D Tiles or both will be classified.
  30398. */
  30399. classificationType: ClassificationType;
  30400. /**
  30401. * This property is for debugging only; it is not for production use nor is it optimized.
  30402. <p>
  30403. Draws the bounding sphere for each draw command in the primitive.
  30404. </p>
  30405. */
  30406. debugShowBoundingVolume: boolean;
  30407. /**
  30408. * This property is for debugging only; it is not for production use nor is it optimized.
  30409. <p>
  30410. Draws the shadow volume for each geometry in the primitive.
  30411. </p>
  30412. */
  30413. debugShowShadowVolume: boolean;
  30414. /**
  30415. * When <code>true</code>, geometry vertices are optimized for the pre and post-vertex-shader caches.
  30416. */
  30417. readonly vertexCacheOptimize: boolean;
  30418. /**
  30419. * Determines if geometry vertex attributes are interleaved, which can slightly improve rendering performance.
  30420. */
  30421. readonly interleave: boolean;
  30422. /**
  30423. * When <code>true</code>, the primitive does not keep a reference to the input <code>geometryInstances</code> to save memory.
  30424. */
  30425. readonly releaseGeometryInstances: boolean;
  30426. /**
  30427. * When <code>true</code>, each geometry instance will only be pickable with {@link Scene#pick}. When <code>false</code>, GPU memory is saved.
  30428. */
  30429. readonly allowPicking: boolean;
  30430. /**
  30431. * Determines if the geometry instances will be created and batched on a web worker.
  30432. */
  30433. readonly asynchronous: boolean;
  30434. /**
  30435. * When <code>true</code>, geometry vertices are compressed, which will save memory.
  30436. */
  30437. readonly compressVertices: boolean;
  30438. /**
  30439. * Determines if the primitive is complete and ready to render. If this property is
  30440. true, the primitive will be rendered the next time that {@link GroundPrimitive#update}
  30441. is called.
  30442. */
  30443. readonly ready: boolean;
  30444. /**
  30445. * Gets a promise that resolves when the primitive is ready to render.
  30446. */
  30447. readonly readyPromise: Promise<GroundPrimitive>;
  30448. /**
  30449. * Determines if GroundPrimitive rendering is supported.
  30450. * @param scene - The scene.
  30451. * @returns <code>true</code> if GroundPrimitives are supported; otherwise, returns <code>false</code>
  30452. */
  30453. static isSupported(scene: Scene): boolean;
  30454. /**
  30455. * Initializes the minimum and maximum terrain heights. This only needs to be called if you are creating the
  30456. GroundPrimitive synchronously.
  30457. * @returns A promise that will resolve once the terrain heights have been loaded.
  30458. */
  30459. static initializeTerrainHeights(): Promise<void>;
  30460. /**
  30461. * Called when {@link Viewer} or {@link CesiumWidget} render the scene to
  30462. get the draw commands needed to render this primitive.
  30463. <p>
  30464. Do not call this function directly. This is documented just to
  30465. list the exceptions that may be propagated when the scene is rendered:
  30466. </p>
  30467. */
  30468. update(): void;
  30469. /**
  30470. * Returns the modifiable per-instance attributes for a {@link GeometryInstance}.
  30471. * @example
  30472. * var attributes = primitive.getGeometryInstanceAttributes('an id');
  30473. attributes.color = Cesium.ColorGeometryInstanceAttribute.toValue(Cesium.Color.AQUA);
  30474. attributes.show = Cesium.ShowGeometryInstanceAttribute.toValue(true);
  30475. * @param id - The id of the {@link GeometryInstance}.
  30476. * @returns The typed array in the attribute's format or undefined if the is no instance with id.
  30477. */
  30478. getGeometryInstanceAttributes(id: any): any;
  30479. /**
  30480. * Returns true if this object was destroyed; otherwise, false.
  30481. <p>
  30482. If this object was destroyed, it should not be used; calling any function other than
  30483. <code>isDestroyed</code> will result in a {@link DeveloperError} exception.
  30484. </p>
  30485. * @returns <code>true</code> if this object was destroyed; otherwise, <code>false</code>.
  30486. */
  30487. isDestroyed(): boolean;
  30488. /**
  30489. * Destroys the WebGL resources held by this object. Destroying an object allows for deterministic
  30490. release of WebGL resources, instead of relying on the garbage collector to destroy this object.
  30491. <p>
  30492. Once an object is destroyed, it should not be used; calling any function other than
  30493. <code>isDestroyed</code> will result in a {@link DeveloperError} exception. Therefore,
  30494. assign the return value (<code>undefined</code>) to the object as done in the example.
  30495. </p>
  30496. * @example
  30497. * e = e && e.destroy();
  30498. */
  30499. destroy(): void;
  30500. /**
  30501. * Checks if the given Scene supports materials on GroundPrimitives.
  30502. Materials on GroundPrimitives require support for the WEBGL_depth_texture extension.
  30503. * @param scene - The current scene.
  30504. * @returns Whether or not the current scene supports materials on GroundPrimitives.
  30505. */
  30506. static supportsMaterials(scene: Scene): boolean;
  30507. }
  30508. /**
  30509. * Represents the position relative to the terrain.
  30510. */
  30511. export enum HeightReference {
  30512. /**
  30513. * The position is absolute.
  30514. */
  30515. NONE = 0,
  30516. /**
  30517. * The position is clamped to the terrain.
  30518. */
  30519. CLAMP_TO_GROUND = 1,
  30520. /**
  30521. * The position height is the height above the terrain.
  30522. */
  30523. RELATIVE_TO_GROUND = 2
  30524. }
  30525. /**
  30526. * The horizontal location of an origin relative to an object, e.g., a {@link Billboard}
  30527. or {@link Label}. For example, setting the horizontal origin to <code>LEFT</code>
  30528. or <code>RIGHT</code> will display a billboard to the left or right (in screen space)
  30529. of the anchor position.
  30530. <br /><br />
  30531. <div align='center'>
  30532. <img src='Images/Billboard.setHorizontalOrigin.png' width='648' height='196' /><br />
  30533. </div>
  30534. */
  30535. export enum HorizontalOrigin {
  30536. /**
  30537. * The origin is at the horizontal center of the object.
  30538. */
  30539. CENTER = 0,
  30540. /**
  30541. * The origin is on the left side of the object.
  30542. */
  30543. LEFT = 1,
  30544. /**
  30545. * The origin is on the right side of the object.
  30546. */
  30547. RIGHT = -1
  30548. }
  30549. /**
  30550. * An imagery layer that displays tiled image data from a single imagery provider
  30551. on a {@link Globe}.
  30552. * @param imageryProvider - The imagery provider to use.
  30553. * @param [options] - Object with the following properties:
  30554. * @param [options.rectangle = imageryProvider.rectangle] - The rectangle of the layer. This rectangle
  30555. can limit the visible portion of the imagery provider.
  30556. * @param [options.alpha = 1.0] - The alpha blending value of this layer, from 0.0 to 1.0.
  30557. This can either be a simple number or a function with the signature
  30558. <code>function(frameState, layer, x, y, level)</code>. The function is passed the
  30559. current frame state, this layer, and the x, y, and level coordinates of the
  30560. imagery tile for which the alpha is required, and it is expected to return
  30561. the alpha value to use for the tile.
  30562. * @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.
  30563. This can either be a simple number or a function with the signature
  30564. <code>function(frameState, layer, x, y, level)</code>. The function is passed the
  30565. current frame state, this layer, and the x, y, and level coordinates of the
  30566. imagery tile for which the alpha is required, and it is expected to return
  30567. the alpha value to use for the tile. This only takes effect when <code>enableLighting</code> is <code>true</code>.
  30568. * @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.
  30569. This can either be a simple number or a function with the signature
  30570. <code>function(frameState, layer, x, y, level)</code>. The function is passed the
  30571. current frame state, this layer, and the x, y, and level coordinates of the
  30572. imagery tile for which the alpha is required, and it is expected to return
  30573. the alpha value to use for the tile. This only takes effect when <code>enableLighting</code> is <code>true</code>.
  30574. * @param [options.brightness = 1.0] - The brightness of this layer. 1.0 uses the unmodified imagery
  30575. color. Less than 1.0 makes the imagery darker while greater than 1.0 makes it brighter.
  30576. This can either be a simple number or a function with the signature
  30577. <code>function(frameState, layer, x, y, level)</code>. The function is passed the
  30578. current frame state, this layer, and the x, y, and level coordinates of the
  30579. imagery tile for which the brightness is required, and it is expected to return
  30580. the brightness value to use for the tile. The function is executed for every
  30581. frame and for every tile, so it must be fast.
  30582. * @param [options.contrast = 1.0] - The contrast of this layer. 1.0 uses the unmodified imagery color.
  30583. Less than 1.0 reduces the contrast while greater than 1.0 increases it.
  30584. This can either be a simple number or a function with the signature
  30585. <code>function(frameState, layer, x, y, level)</code>. The function is passed the
  30586. current frame state, this layer, and the x, y, and level coordinates of the
  30587. imagery tile for which the contrast is required, and it is expected to return
  30588. the contrast value to use for the tile. The function is executed for every
  30589. frame and for every tile, so it must be fast.
  30590. * @param [options.hue = 0.0] - The hue of this layer. 0.0 uses the unmodified imagery color.
  30591. This can either be a simple number or a function with the signature
  30592. <code>function(frameState, layer, x, y, level)</code>. The function is passed the
  30593. current frame state, this layer, and the x, y, and level coordinates
  30594. of the imagery tile for which the hue is required, and it is expected to return
  30595. the contrast value to use for the tile. The function is executed for every
  30596. frame and for every tile, so it must be fast.
  30597. * @param [options.saturation = 1.0] - The saturation of this layer. 1.0 uses the unmodified imagery color.
  30598. Less than 1.0 reduces the saturation while greater than 1.0 increases it.
  30599. This can either be a simple number or a function with the signature
  30600. <code>function(frameState, layer, x, y, level)</code>. The function is passed the
  30601. current frame state, this layer, and the x, y, and level coordinates
  30602. of the imagery tile for which the saturation is required, and it is expected to return
  30603. the contrast value to use for the tile. The function is executed for every
  30604. frame and for every tile, so it must be fast.
  30605. * @param [options.gamma = 1.0] - The gamma correction to apply to this layer. 1.0 uses the unmodified imagery color.
  30606. This can either be a simple number or a function with the signature
  30607. <code>function(frameState, layer, x, y, level)</code>. The function is passed the
  30608. current frame state, this layer, and the x, y, and level coordinates of the
  30609. imagery tile for which the gamma is required, and it is expected to return
  30610. the gamma value to use for the tile. The function is executed for every
  30611. frame and for every tile, so it must be fast.
  30612. * @param [options.splitDirection = ImagerySplitDirection.NONE] - The {@link ImagerySplitDirection} split to apply to this layer.
  30613. * @param [options.minificationFilter = TextureMinificationFilter.LINEAR] - The
  30614. texture minification filter to apply to this layer. Possible values
  30615. are <code>TextureMinificationFilter.LINEAR</code> and
  30616. <code>TextureMinificationFilter.NEAREST</code>.
  30617. * @param [options.magnificationFilter = TextureMagnificationFilter.LINEAR] - The
  30618. texture minification filter to apply to this layer. Possible values
  30619. are <code>TextureMagnificationFilter.LINEAR</code> and
  30620. <code>TextureMagnificationFilter.NEAREST</code>.
  30621. * @param [options.show = true] - True if the layer is shown; otherwise, false.
  30622. * @param [options.maximumAnisotropy = maximum supported] - The maximum anisotropy level to use
  30623. for texture filtering. If this parameter is not specified, the maximum anisotropy supported
  30624. by the WebGL stack will be used. Larger values make the imagery look better in horizon
  30625. views.
  30626. * @param [options.minimumTerrainLevel] - The minimum terrain level-of-detail at which to show this imagery layer,
  30627. or undefined to show it at all levels. Level zero is the least-detailed level.
  30628. * @param [options.maximumTerrainLevel] - The maximum terrain level-of-detail at which to show this imagery layer,
  30629. or undefined to show it at all levels. Level zero is the least-detailed level.
  30630. * @param [options.cutoutRectangle] - Cartographic rectangle for cutting out a portion of this ImageryLayer.
  30631. * @param [options.colorToAlpha] - Color to be used as alpha.
  30632. * @param [options.colorToAlphaThreshold = 0.004] - Threshold for color-to-alpha.
  30633. */
  30634. export class ImageryLayer {
  30635. constructor(imageryProvider: ImageryProvider, options?: {
  30636. rectangle?: Rectangle;
  30637. alpha?: number | ((...params: any[]) => any);
  30638. nightAlpha?: number | ((...params: any[]) => any);
  30639. dayAlpha?: number | ((...params: any[]) => any);
  30640. brightness?: number | ((...params: any[]) => any);
  30641. contrast?: number | ((...params: any[]) => any);
  30642. hue?: number | ((...params: any[]) => any);
  30643. saturation?: number | ((...params: any[]) => any);
  30644. gamma?: number | ((...params: any[]) => any);
  30645. splitDirection?: ImagerySplitDirection | ((...params: any[]) => any);
  30646. minificationFilter?: TextureMinificationFilter;
  30647. magnificationFilter?: TextureMagnificationFilter;
  30648. show?: boolean;
  30649. maximumAnisotropy?: number;
  30650. minimumTerrainLevel?: number;
  30651. maximumTerrainLevel?: number;
  30652. cutoutRectangle?: Rectangle;
  30653. colorToAlpha?: Color;
  30654. colorToAlphaThreshold?: number;
  30655. });
  30656. /**
  30657. * The alpha blending value of this layer, with 0.0 representing fully transparent and
  30658. 1.0 representing fully opaque.
  30659. */
  30660. alpha: number;
  30661. /**
  30662. * The alpha blending value of this layer on the night side of the globe, with 0.0 representing fully transparent and
  30663. 1.0 representing fully opaque. This only takes effect when {@link Globe#enableLighting} is <code>true</code>.
  30664. */
  30665. nightAlpha: number;
  30666. /**
  30667. * The alpha blending value of this layer on the day side of the globe, with 0.0 representing fully transparent and
  30668. 1.0 representing fully opaque. This only takes effect when {@link Globe#enableLighting} is <code>true</code>.
  30669. */
  30670. dayAlpha: number;
  30671. /**
  30672. * The brightness of this layer. 1.0 uses the unmodified imagery color. Less than 1.0
  30673. makes the imagery darker while greater than 1.0 makes it brighter.
  30674. */
  30675. brightness: number;
  30676. /**
  30677. * The contrast of this layer. 1.0 uses the unmodified imagery color. Less than 1.0 reduces
  30678. the contrast while greater than 1.0 increases it.
  30679. */
  30680. contrast: number;
  30681. /**
  30682. * The hue of this layer in radians. 0.0 uses the unmodified imagery color.
  30683. */
  30684. hue: number;
  30685. /**
  30686. * The saturation of this layer. 1.0 uses the unmodified imagery color. Less than 1.0 reduces the
  30687. saturation while greater than 1.0 increases it.
  30688. */
  30689. saturation: number;
  30690. /**
  30691. * The gamma correction to apply to this layer. 1.0 uses the unmodified imagery color.
  30692. */
  30693. gamma: number;
  30694. /**
  30695. * The {@link ImagerySplitDirection} to apply to this layer.
  30696. */
  30697. splitDirection: ImagerySplitDirection;
  30698. /**
  30699. * The {@link TextureMinificationFilter} to apply to this layer.
  30700. Possible values are {@link TextureMinificationFilter.LINEAR} (the default)
  30701. and {@link TextureMinificationFilter.NEAREST}.
  30702. To take effect, this property must be set immediately after adding the imagery layer.
  30703. Once a texture is loaded it won't be possible to change the texture filter used.
  30704. */
  30705. minificationFilter: TextureMinificationFilter;
  30706. /**
  30707. * The {@link TextureMagnificationFilter} to apply to this layer.
  30708. Possible values are {@link TextureMagnificationFilter.LINEAR} (the default)
  30709. and {@link TextureMagnificationFilter.NEAREST}.
  30710. To take effect, this property must be set immediately after adding the imagery layer.
  30711. Once a texture is loaded it won't be possible to change the texture filter used.
  30712. */
  30713. magnificationFilter: TextureMagnificationFilter;
  30714. /**
  30715. * Determines if this layer is shown.
  30716. */
  30717. show: boolean;
  30718. /**
  30719. * Rectangle cutout in this layer of imagery.
  30720. */
  30721. cutoutRectangle: Rectangle;
  30722. /**
  30723. * Color value that should be set to transparent.
  30724. */
  30725. colorToAlpha: Color;
  30726. /**
  30727. * Normalized (0-1) threshold for color-to-alpha.
  30728. */
  30729. colorToAlphaThreshold: number;
  30730. /**
  30731. * Gets the imagery provider for this layer.
  30732. */
  30733. readonly imageryProvider: ImageryProvider;
  30734. /**
  30735. * Gets the rectangle of this layer. If this rectangle is smaller than the rectangle of the
  30736. {@link ImageryProvider}, only a portion of the imagery provider is shown.
  30737. */
  30738. readonly rectangle: Rectangle;
  30739. /**
  30740. * This value is used as the default brightness for the imagery layer if one is not provided during construction
  30741. or by the imagery provider. This value does not modify the brightness of the imagery.
  30742. */
  30743. static DEFAULT_BRIGHTNESS: number;
  30744. /**
  30745. * This value is used as the default contrast for the imagery layer if one is not provided during construction
  30746. or by the imagery provider. This value does not modify the contrast of the imagery.
  30747. */
  30748. static DEFAULT_CONTRAST: number;
  30749. /**
  30750. * This value is used as the default hue for the imagery layer if one is not provided during construction
  30751. or by the imagery provider. This value does not modify the hue of the imagery.
  30752. */
  30753. static DEFAULT_HUE: number;
  30754. /**
  30755. * This value is used as the default saturation for the imagery layer if one is not provided during construction
  30756. or by the imagery provider. This value does not modify the saturation of the imagery.
  30757. */
  30758. static DEFAULT_SATURATION: number;
  30759. /**
  30760. * This value is used as the default gamma for the imagery layer if one is not provided during construction
  30761. or by the imagery provider. This value does not modify the gamma of the imagery.
  30762. */
  30763. static DEFAULT_GAMMA: number;
  30764. /**
  30765. * This value is used as the default split for the imagery layer if one is not provided during construction
  30766. or by the imagery provider.
  30767. */
  30768. static DEFAULT_SPLIT: ImagerySplitDirection;
  30769. /**
  30770. * This value is used as the default texture minification filter for the imagery layer if one is not provided
  30771. during construction or by the imagery provider.
  30772. */
  30773. static DEFAULT_MINIFICATION_FILTER: TextureMinificationFilter;
  30774. /**
  30775. * This value is used as the default texture magnification filter for the imagery layer if one is not provided
  30776. during construction or by the imagery provider.
  30777. */
  30778. static DEFAULT_MAGNIFICATION_FILTER: TextureMagnificationFilter;
  30779. /**
  30780. * This value is used as the default threshold for color-to-alpha if one is not provided
  30781. during construction or by the imagery provider.
  30782. */
  30783. static DEFAULT_APPLY_COLOR_TO_ALPHA_THRESHOLD: number;
  30784. /**
  30785. * Gets a value indicating whether this layer is the base layer in the
  30786. {@link ImageryLayerCollection}. The base layer is the one that underlies all
  30787. others. It is special in that it is treated as if it has global rectangle, even if
  30788. it actually does not, by stretching the texels at the edges over the entire
  30789. globe.
  30790. * @returns true if this is the base layer; otherwise, false.
  30791. */
  30792. isBaseLayer(): boolean;
  30793. /**
  30794. * Returns true if this object was destroyed; otherwise, false.
  30795. <br /><br />
  30796. If this object was destroyed, it should not be used; calling any function other than
  30797. <code>isDestroyed</code> will result in a {@link DeveloperError} exception.
  30798. * @returns True if this object was destroyed; otherwise, false.
  30799. */
  30800. isDestroyed(): boolean;
  30801. /**
  30802. * Destroys the WebGL resources held by this object. Destroying an object allows for deterministic
  30803. release of WebGL resources, instead of relying on the garbage collector to destroy this object.
  30804. <br /><br />
  30805. Once an object is destroyed, it should not be used; calling any function other than
  30806. <code>isDestroyed</code> will result in a {@link DeveloperError} exception. Therefore,
  30807. assign the return value (<code>undefined</code>) to the object as done in the example.
  30808. * @example
  30809. * imageryLayer = imageryLayer && imageryLayer.destroy();
  30810. */
  30811. destroy(): void;
  30812. /**
  30813. * Computes the intersection of this layer's rectangle with the imagery provider's availability rectangle,
  30814. producing the overall bounds of imagery that can be produced by this layer.
  30815. * @example
  30816. * // Zoom to an imagery layer.
  30817. imageryLayer.getViewableRectangle().then(function (rectangle) {
  30818. return camera.flyTo({
  30819. destination: rectangle
  30820. });
  30821. });
  30822. * @returns A promise to a rectangle which defines the overall bounds of imagery that can be produced by this layer.
  30823. */
  30824. getViewableRectangle(): Promise<Rectangle>;
  30825. }
  30826. /**
  30827. * An ordered collection of imagery layers.
  30828. */
  30829. export class ImageryLayerCollection {
  30830. constructor();
  30831. /**
  30832. * An event that is raised when a layer is added to the collection. Event handlers are passed the layer that
  30833. was added and the index at which it was added.
  30834. */
  30835. layerAdded: Event;
  30836. /**
  30837. * An event that is raised when a layer is removed from the collection. Event handlers are passed the layer that
  30838. was removed and the index from which it was removed.
  30839. */
  30840. layerRemoved: Event;
  30841. /**
  30842. * An event that is raised when a layer changes position in the collection. Event handlers are passed the layer that
  30843. was moved, its new index after the move, and its old index prior to the move.
  30844. */
  30845. layerMoved: Event;
  30846. /**
  30847. * An event that is raised when a layer is shown or hidden by setting the
  30848. {@link ImageryLayer#show} property. Event handlers are passed a reference to this layer,
  30849. the index of the layer in the collection, and a flag that is true if the layer is now
  30850. shown or false if it is now hidden.
  30851. */
  30852. layerShownOrHidden: Event;
  30853. /**
  30854. * Gets the number of layers in this collection.
  30855. */
  30856. length: number;
  30857. /**
  30858. * Adds a layer to the collection.
  30859. * @param layer - the layer to add.
  30860. * @param [index] - the index to add the layer at. If omitted, the layer will
  30861. be added on top of all existing layers.
  30862. */
  30863. add(layer: ImageryLayer, index?: number): void;
  30864. /**
  30865. * Creates a new layer using the given ImageryProvider and adds it to the collection.
  30866. * @param imageryProvider - the imagery provider to create a new layer for.
  30867. * @param [index] - the index to add the layer at. If omitted, the layer will
  30868. added on top of all existing layers.
  30869. * @returns The newly created layer.
  30870. */
  30871. addImageryProvider(imageryProvider: ImageryProvider, index?: number): ImageryLayer;
  30872. /**
  30873. * Removes a layer from this collection, if present.
  30874. * @param layer - The layer to remove.
  30875. * @param [destroy = true] - whether to destroy the layers in addition to removing them.
  30876. * @returns true if the layer was in the collection and was removed,
  30877. false if the layer was not in the collection.
  30878. */
  30879. remove(layer: ImageryLayer, destroy?: boolean): boolean;
  30880. /**
  30881. * Removes all layers from this collection.
  30882. * @param [destroy = true] - whether to destroy the layers in addition to removing them.
  30883. */
  30884. removeAll(destroy?: boolean): void;
  30885. /**
  30886. * Checks to see if the collection contains a given layer.
  30887. * @param layer - the layer to check for.
  30888. * @returns true if the collection contains the layer, false otherwise.
  30889. */
  30890. contains(layer: ImageryLayer): boolean;
  30891. /**
  30892. * Determines the index of a given layer in the collection.
  30893. * @param layer - The layer to find the index of.
  30894. * @returns The index of the layer in the collection, or -1 if the layer does not exist in the collection.
  30895. */
  30896. indexOf(layer: ImageryLayer): number;
  30897. /**
  30898. * Gets a layer by index from the collection.
  30899. * @param index - the index to retrieve.
  30900. * @returns The imagery layer at the given index.
  30901. */
  30902. get(index: number): ImageryLayer;
  30903. /**
  30904. * Raises a layer up one position in the collection.
  30905. * @param layer - the layer to move.
  30906. */
  30907. raise(layer: ImageryLayer): void;
  30908. /**
  30909. * Lowers a layer down one position in the collection.
  30910. * @param layer - the layer to move.
  30911. */
  30912. lower(layer: ImageryLayer): void;
  30913. /**
  30914. * Raises a layer to the top of the collection.
  30915. * @param layer - the layer to move.
  30916. */
  30917. raiseToTop(layer: ImageryLayer): void;
  30918. /**
  30919. * Lowers a layer to the bottom of the collection.
  30920. * @param layer - the layer to move.
  30921. */
  30922. lowerToBottom(layer: ImageryLayer): void;
  30923. /**
  30924. * Asynchronously determines the imagery layer features that are intersected by a pick ray. The intersected imagery
  30925. layer features are found by invoking {@link ImageryProvider#pickFeatures} for each imagery layer tile intersected
  30926. by the pick ray. To compute a pick ray from a location on the screen, use {@link Camera.getPickRay}.
  30927. * @example
  30928. * var pickRay = viewer.camera.getPickRay(windowPosition);
  30929. var featuresPromise = viewer.imageryLayers.pickImageryLayerFeatures(pickRay, viewer.scene);
  30930. if (!Cesium.defined(featuresPromise)) {
  30931. console.log('No features picked.');
  30932. } else {
  30933. Cesium.when(featuresPromise, function(features) {
  30934. // This function is called asynchronously when the list if picked features is available.
  30935. console.log('Number of features: ' + features.length);
  30936. if (features.length > 0) {
  30937. console.log('First feature name: ' + features[0].name);
  30938. }
  30939. });
  30940. }
  30941. * @param ray - The ray to test for intersection.
  30942. * @param scene - The scene.
  30943. * @returns A promise that resolves to an array of features intersected by the pick ray.
  30944. If it can be quickly determined that no features are intersected (for example,
  30945. because no active imagery providers support {@link ImageryProvider#pickFeatures}
  30946. or because the pick ray does not intersect the surface), this function will
  30947. return undefined.
  30948. */
  30949. pickImageryLayerFeatures(ray: Ray, scene: Scene): Promise<ImageryLayerFeatureInfo[]> | undefined;
  30950. /**
  30951. * Returns true if this object was destroyed; otherwise, false.
  30952. <br /><br />
  30953. If this object was destroyed, it should not be used; calling any function other than
  30954. <code>isDestroyed</code> will result in a {@link DeveloperError} exception.
  30955. * @returns true if this object was destroyed; otherwise, false.
  30956. */
  30957. isDestroyed(): boolean;
  30958. /**
  30959. * Destroys the WebGL resources held by all layers in this collection. Explicitly destroying this
  30960. object allows for deterministic release of WebGL resources, instead of relying on the garbage
  30961. collector.
  30962. <br /><br />
  30963. Once this object is destroyed, it should not be used; calling any function other than
  30964. <code>isDestroyed</code> will result in a {@link DeveloperError} exception. Therefore,
  30965. assign the return value (<code>undefined</code>) to the object as done in the example.
  30966. * @example
  30967. * layerCollection = layerCollection && layerCollection.destroy();
  30968. */
  30969. destroy(): void;
  30970. }
  30971. /**
  30972. * Describes a rasterized feature, such as a point, polygon, polyline, etc., in an imagery layer.
  30973. */
  30974. export class ImageryLayerFeatureInfo {
  30975. constructor();
  30976. /**
  30977. * Gets or sets the name of the feature.
  30978. */
  30979. name: string | undefined;
  30980. /**
  30981. * Gets or sets an HTML description of the feature. The HTML is not trusted and should
  30982. be sanitized before display to the user.
  30983. */
  30984. description: string | undefined;
  30985. /**
  30986. * Gets or sets the position of the feature, or undefined if the position is not known.
  30987. */
  30988. position: Cartographic | undefined;
  30989. /**
  30990. * Gets or sets the raw data describing the feature. The raw data may be in any
  30991. number of formats, such as GeoJSON, KML, etc.
  30992. */
  30993. data: any | undefined;
  30994. /**
  30995. * Gets or sets the image layer of the feature.
  30996. */
  30997. imageryLayer: any | undefined;
  30998. /**
  30999. * Configures the name of this feature by selecting an appropriate property. The name will be obtained from
  31000. one of the following sources, in this order: 1) the property with the name 'name', 2) the property with the name 'title',
  31001. 3) the first property containing the word 'name', 4) the first property containing the word 'title'. If
  31002. the name cannot be obtained from any of these sources, the existing name will be left unchanged.
  31003. * @param properties - An object literal containing the properties of the feature.
  31004. */
  31005. configureNameFromProperties(properties: any): void;
  31006. /**
  31007. * Configures the description of this feature by creating an HTML table of properties and their values.
  31008. * @param properties - An object literal containing the properties of the feature.
  31009. */
  31010. configureDescriptionFromProperties(properties: any): void;
  31011. }
  31012. /**
  31013. * Provides imagery to be displayed on the surface of an ellipsoid. This type describes an
  31014. interface and is not intended to be instantiated directly.
  31015. */
  31016. export class ImageryProvider {
  31017. constructor();
  31018. /**
  31019. * The default alpha blending value of this provider, with 0.0 representing fully transparent and
  31020. 1.0 representing fully opaque.
  31021. */
  31022. defaultAlpha: number | undefined;
  31023. /**
  31024. * The default alpha blending value on the night side of the globe of this provider, with 0.0 representing fully transparent and
  31025. 1.0 representing fully opaque.
  31026. */
  31027. defaultNightAlpha: number | undefined;
  31028. /**
  31029. * The default alpha blending value on the day side of the globe of this provider, with 0.0 representing fully transparent and
  31030. 1.0 representing fully opaque.
  31031. */
  31032. defaultDayAlpha: number | undefined;
  31033. /**
  31034. * The default brightness of this provider. 1.0 uses the unmodified imagery color. Less than 1.0
  31035. makes the imagery darker while greater than 1.0 makes it brighter.
  31036. */
  31037. defaultBrightness: number | undefined;
  31038. /**
  31039. * The default contrast of this provider. 1.0 uses the unmodified imagery color. Less than 1.0 reduces
  31040. the contrast while greater than 1.0 increases it.
  31041. */
  31042. defaultContrast: number | undefined;
  31043. /**
  31044. * The default hue of this provider in radians. 0.0 uses the unmodified imagery color.
  31045. */
  31046. defaultHue: number | undefined;
  31047. /**
  31048. * The default saturation of this provider. 1.0 uses the unmodified imagery color. Less than 1.0 reduces the
  31049. saturation while greater than 1.0 increases it.
  31050. */
  31051. defaultSaturation: number | undefined;
  31052. /**
  31053. * The default gamma correction to apply to this provider. 1.0 uses the unmodified imagery color.
  31054. */
  31055. defaultGamma: number | undefined;
  31056. /**
  31057. * The default texture minification filter to apply to this provider.
  31058. */
  31059. defaultMinificationFilter: TextureMinificationFilter;
  31060. /**
  31061. * The default texture magnification filter to apply to this provider.
  31062. */
  31063. defaultMagnificationFilter: TextureMagnificationFilter;
  31064. /**
  31065. * Gets a value indicating whether or not the provider is ready for use.
  31066. */
  31067. readonly ready: boolean;
  31068. /**
  31069. * Gets a promise that resolves to true when the provider is ready for use.
  31070. */
  31071. readonly readyPromise: Promise<boolean>;
  31072. /**
  31073. * Gets the rectangle, in radians, of the imagery provided by the instance. This function should
  31074. not be called before {@link ImageryProvider#ready} returns true.
  31075. */
  31076. readonly rectangle: Rectangle;
  31077. /**
  31078. * Gets the width of each tile, in pixels. This function should
  31079. not be called before {@link ImageryProvider#ready} returns true.
  31080. */
  31081. readonly tileWidth: number;
  31082. /**
  31083. * Gets the height of each tile, in pixels. This function should
  31084. not be called before {@link ImageryProvider#ready} returns true.
  31085. */
  31086. readonly tileHeight: number;
  31087. /**
  31088. * Gets the maximum level-of-detail that can be requested. This function should
  31089. not be called before {@link ImageryProvider#ready} returns true.
  31090. */
  31091. readonly maximumLevel: number | undefined;
  31092. /**
  31093. * Gets the minimum level-of-detail that can be requested. This function should
  31094. not be called before {@link ImageryProvider#ready} returns true. Generally,
  31095. a minimum level should only be used when the rectangle of the imagery is small
  31096. enough that the number of tiles at the minimum level is small. An imagery
  31097. provider with more than a few tiles at the minimum level will lead to
  31098. rendering problems.
  31099. */
  31100. readonly minimumLevel: number;
  31101. /**
  31102. * Gets the tiling scheme used by the provider. This function should
  31103. not be called before {@link ImageryProvider#ready} returns true.
  31104. */
  31105. readonly tilingScheme: TilingScheme;
  31106. /**
  31107. * Gets the tile discard policy. If not undefined, the discard policy is responsible
  31108. for filtering out "missing" tiles via its shouldDiscardImage function. If this function
  31109. returns undefined, no tiles are filtered. This function should
  31110. not be called before {@link ImageryProvider#ready} returns true.
  31111. */
  31112. readonly tileDiscardPolicy: TileDiscardPolicy;
  31113. /**
  31114. * Gets an event that is raised when the imagery provider encounters an asynchronous error.. By subscribing
  31115. to the event, you will be notified of the error and can potentially recover from it. Event listeners
  31116. are passed an instance of {@link TileProviderError}.
  31117. */
  31118. readonly errorEvent: Event;
  31119. /**
  31120. * Gets the credit to display when this imagery provider is active. Typically this is used to credit
  31121. the source of the imagery. This function should
  31122. not be called before {@link ImageryProvider#ready} returns true.
  31123. */
  31124. readonly credit: Credit;
  31125. /**
  31126. * Gets the proxy used by this provider.
  31127. */
  31128. readonly proxy: Proxy;
  31129. /**
  31130. * Gets a value indicating whether or not the images provided by this imagery provider
  31131. include an alpha channel. If this property is false, an alpha channel, if present, will
  31132. be ignored. If this property is true, any images without an alpha channel will be treated
  31133. as if their alpha is 1.0 everywhere. When this property is false, memory usage
  31134. and texture upload time are reduced.
  31135. */
  31136. readonly hasAlphaChannel: boolean;
  31137. /**
  31138. * Gets the credits to be displayed when a given tile is displayed.
  31139. * @param x - The tile X coordinate.
  31140. * @param y - The tile Y coordinate.
  31141. * @param level - The tile level;
  31142. * @returns The credits to be displayed when the tile is displayed.
  31143. */
  31144. getTileCredits(x: number, y: number, level: number): Credit[];
  31145. /**
  31146. * Requests the image for a given tile. This function should
  31147. not be called before {@link ImageryProvider#ready} returns true.
  31148. * @param x - The tile X coordinate.
  31149. * @param y - The tile Y coordinate.
  31150. * @param level - The tile level.
  31151. * @param [request] - The request object. Intended for internal use only.
  31152. * @returns A promise for the image that will resolve when the image is available, or
  31153. undefined if there are too many active requests to the server, and the request
  31154. should be retried later. The resolved image may be either an
  31155. Image or a Canvas DOM object.
  31156. */
  31157. requestImage(x: number, y: number, level: number, request?: Request): Promise<HTMLImageElement | HTMLCanvasElement> | undefined;
  31158. /**
  31159. * Asynchronously determines what features, if any, are located at a given longitude and latitude within
  31160. a tile. This function should not be called before {@link ImageryProvider#ready} returns true.
  31161. This function is optional, so it may not exist on all ImageryProviders.
  31162. * @param x - The tile X coordinate.
  31163. * @param y - The tile Y coordinate.
  31164. * @param level - The tile level.
  31165. * @param longitude - The longitude at which to pick features.
  31166. * @param latitude - The latitude at which to pick features.
  31167. * @returns A promise for the picked features that will resolve when the asynchronous
  31168. picking completes. The resolved value is an array of {@link ImageryLayerFeatureInfo}
  31169. instances. The array may be empty if no features are found at the given location.
  31170. It may also be undefined if picking is not supported.
  31171. */
  31172. pickFeatures(x: number, y: number, level: number, longitude: number, latitude: number): Promise<ImageryLayerFeatureInfo[]> | undefined;
  31173. /**
  31174. * Loads an image from a given URL. If the server referenced by the URL already has
  31175. too many requests pending, this function will instead return undefined, indicating
  31176. that the request should be retried later.
  31177. * @param imageryProvider - The imagery provider for the URL.
  31178. * @param url - The URL of the image.
  31179. * @returns A promise for the image that will resolve when the image is available, or
  31180. undefined if there are too many active requests to the server, and the request
  31181. should be retried later. The resolved image may be either an
  31182. Image or a Canvas DOM object.
  31183. */
  31184. static loadImage(imageryProvider: ImageryProvider, url: Resource | string): Promise<HTMLImageElement | HTMLCanvasElement> | undefined;
  31185. }
  31186. /**
  31187. * The direction to display an ImageryLayer relative to the {@link Scene#imagerySplitPosition}.
  31188. */
  31189. export enum ImagerySplitDirection {
  31190. /**
  31191. * Display the ImageryLayer to the left of the {@link Scene#imagerySplitPosition}.
  31192. */
  31193. LEFT = -1,
  31194. /**
  31195. * Always display the ImageryLayer.
  31196. */
  31197. NONE = 0,
  31198. /**
  31199. * Display the ImageryLayer to the right of the {@link Scene#imagerySplitPosition}.
  31200. */
  31201. RIGHT = 1
  31202. }
  31203. export namespace IonImageryProvider {
  31204. /**
  31205. * Initialization options for the TileMapServiceImageryProvider constructor
  31206. * @property assetId - An ion imagery asset ID
  31207. * @property [accessToken = Ion.defaultAccessToken] - The access token to use.
  31208. * @property [server = Ion.defaultServer] - The resource to the Cesium ion API server.
  31209. */
  31210. type ConstructorOptions = {
  31211. assetId: number;
  31212. accessToken?: string;
  31213. server?: string | Resource;
  31214. };
  31215. }
  31216. /**
  31217. * Provides tiled imagery using the Cesium ion REST API.
  31218. * @example
  31219. * viewer.imageryLayers.addImageryProvider(new Cesium.IonImageryProvider({ assetId : 23489024 }));
  31220. * @param options - Object describing initialization options
  31221. */
  31222. export class IonImageryProvider {
  31223. constructor(options: IonImageryProvider.ConstructorOptions);
  31224. /**
  31225. * The default alpha blending value of this provider, with 0.0 representing fully transparent and
  31226. 1.0 representing fully opaque.
  31227. */
  31228. defaultAlpha: number | undefined;
  31229. /**
  31230. * The default alpha blending value on the night side of the globe of this provider, with 0.0 representing fully transparent and
  31231. 1.0 representing fully opaque.
  31232. */
  31233. defaultNightAlpha: number | undefined;
  31234. /**
  31235. * The default alpha blending value on the day side of the globe of this provider, with 0.0 representing fully transparent and
  31236. 1.0 representing fully opaque.
  31237. */
  31238. defaultDayAlpha: number | undefined;
  31239. /**
  31240. * The default brightness of this provider. 1.0 uses the unmodified imagery color. Less than 1.0
  31241. makes the imagery darker while greater than 1.0 makes it brighter.
  31242. */
  31243. defaultBrightness: number | undefined;
  31244. /**
  31245. * The default contrast of this provider. 1.0 uses the unmodified imagery color. Less than 1.0 reduces
  31246. the contrast while greater than 1.0 increases it.
  31247. */
  31248. defaultContrast: number | undefined;
  31249. /**
  31250. * The default hue of this provider in radians. 0.0 uses the unmodified imagery color.
  31251. */
  31252. defaultHue: number | undefined;
  31253. /**
  31254. * The default saturation of this provider. 1.0 uses the unmodified imagery color. Less than 1.0 reduces the
  31255. saturation while greater than 1.0 increases it.
  31256. */
  31257. defaultSaturation: number | undefined;
  31258. /**
  31259. * The default gamma correction to apply to this provider. 1.0 uses the unmodified imagery color.
  31260. */
  31261. defaultGamma: number | undefined;
  31262. /**
  31263. * The default texture minification filter to apply to this provider.
  31264. */
  31265. defaultMinificationFilter: TextureMinificationFilter;
  31266. /**
  31267. * The default texture magnification filter to apply to this provider.
  31268. */
  31269. defaultMagnificationFilter: TextureMagnificationFilter;
  31270. /**
  31271. * Gets a value indicating whether or not the provider is ready for use.
  31272. */
  31273. readonly ready: boolean;
  31274. /**
  31275. * Gets a promise that resolves to true when the provider is ready for use.
  31276. */
  31277. readonly readyPromise: Promise<boolean>;
  31278. /**
  31279. * Gets the rectangle, in radians, of the imagery provided by the instance. This function should
  31280. not be called before {@link IonImageryProvider#ready} returns true.
  31281. */
  31282. readonly rectangle: Rectangle;
  31283. /**
  31284. * Gets the width of each tile, in pixels. This function should
  31285. not be called before {@link IonImageryProvider#ready} returns true.
  31286. */
  31287. readonly tileWidth: number;
  31288. /**
  31289. * Gets the height of each tile, in pixels. This function should
  31290. not be called before {@link IonImageryProvider#ready} returns true.
  31291. */
  31292. readonly tileHeight: number;
  31293. /**
  31294. * Gets the maximum level-of-detail that can be requested. This function should
  31295. not be called before {@link IonImageryProvider#ready} returns true.
  31296. */
  31297. readonly maximumLevel: number | undefined;
  31298. /**
  31299. * Gets the minimum level-of-detail that can be requested. This function should
  31300. not be called before {@link IonImageryProvider#ready} returns true. Generally,
  31301. a minimum level should only be used when the rectangle of the imagery is small
  31302. enough that the number of tiles at the minimum level is small. An imagery
  31303. provider with more than a few tiles at the minimum level will lead to
  31304. rendering problems.
  31305. */
  31306. readonly minimumLevel: number;
  31307. /**
  31308. * Gets the tiling scheme used by the provider. This function should
  31309. not be called before {@link IonImageryProvider#ready} returns true.
  31310. */
  31311. readonly tilingScheme: TilingScheme;
  31312. /**
  31313. * Gets the tile discard policy. If not undefined, the discard policy is responsible
  31314. for filtering out "missing" tiles via its shouldDiscardImage function. If this function
  31315. returns undefined, no tiles are filtered. This function should
  31316. not be called before {@link IonImageryProvider#ready} returns true.
  31317. */
  31318. readonly tileDiscardPolicy: TileDiscardPolicy;
  31319. /**
  31320. * Gets an event that is raised when the imagery provider encounters an asynchronous error. By subscribing
  31321. to the event, you will be notified of the error and can potentially recover from it. Event listeners
  31322. are passed an instance of {@link TileProviderError}.
  31323. */
  31324. readonly errorEvent: Event;
  31325. /**
  31326. * Gets the credit to display when this imagery provider is active. Typically this is used to credit
  31327. the source of the imagery. This function should
  31328. not be called before {@link IonImageryProvider#ready} returns true.
  31329. */
  31330. readonly credit: Credit;
  31331. /**
  31332. * Gets a value indicating whether or not the images provided by this imagery provider
  31333. include an alpha channel. If this property is false, an alpha channel, if present, will
  31334. be ignored. If this property is true, any images without an alpha channel will be treated
  31335. as if their alpha is 1.0 everywhere. When this property is false, memory usage
  31336. and texture upload time are reduced.
  31337. */
  31338. readonly hasAlphaChannel: boolean;
  31339. /**
  31340. * Gets the proxy used by this provider.
  31341. */
  31342. readonly proxy: Proxy;
  31343. /**
  31344. * Gets the credits to be displayed when a given tile is displayed.
  31345. * @param x - The tile X coordinate.
  31346. * @param y - The tile Y coordinate.
  31347. * @param level - The tile level;
  31348. * @returns The credits to be displayed when the tile is displayed.
  31349. */
  31350. getTileCredits(x: number, y: number, level: number): Credit[];
  31351. /**
  31352. * Requests the image for a given tile. This function should
  31353. not be called before {@link IonImageryProvider#ready} returns true.
  31354. * @param x - The tile X coordinate.
  31355. * @param y - The tile Y coordinate.
  31356. * @param level - The tile level.
  31357. * @param [request] - The request object. Intended for internal use only.
  31358. * @returns A promise for the image that will resolve when the image is available, or
  31359. undefined if there are too many active requests to the server, and the request
  31360. should be retried later. The resolved image may be either an
  31361. Image or a Canvas DOM object.
  31362. */
  31363. requestImage(x: number, y: number, level: number, request?: Request): Promise<HTMLImageElement | HTMLCanvasElement> | undefined;
  31364. /**
  31365. * Asynchronously determines what features, if any, are located at a given longitude and latitude within
  31366. a tile. This function should not be called before {@link IonImageryProvider#ready} returns true.
  31367. This function is optional, so it may not exist on all ImageryProviders.
  31368. * @param x - The tile X coordinate.
  31369. * @param y - The tile Y coordinate.
  31370. * @param level - The tile level.
  31371. * @param longitude - The longitude at which to pick features.
  31372. * @param latitude - The latitude at which to pick features.
  31373. * @returns A promise for the picked features that will resolve when the asynchronous
  31374. picking completes. The resolved value is an array of {@link ImageryLayerFeatureInfo}
  31375. instances. The array may be empty if no features are found at the given location.
  31376. It may also be undefined if picking is not supported.
  31377. */
  31378. pickFeatures(x: number, y: number, level: number, longitude: number, latitude: number): Promise<ImageryLayerFeatureInfo[]> | undefined;
  31379. }
  31380. /**
  31381. * The types of imagery provided by {@link createWorldImagery}.
  31382. */
  31383. export enum IonWorldImageryStyle {
  31384. /**
  31385. * Aerial imagery.
  31386. */
  31387. AERIAL = 2,
  31388. /**
  31389. * Aerial imagery with a road overlay.
  31390. */
  31391. AERIAL_WITH_LABELS = 3,
  31392. /**
  31393. * Roads without additional imagery.
  31394. */
  31395. ROAD = 4
  31396. }
  31397. /**
  31398. * A Label draws viewport-aligned text positioned in the 3D scene. This constructor
  31399. should not be used directly, instead create labels by calling {@link LabelCollection#add}.
  31400. */
  31401. export class Label {
  31402. constructor();
  31403. /**
  31404. * Determines if this label will be shown. Use this to hide or show a label, instead
  31405. of removing it and re-adding it to the collection.
  31406. */
  31407. show: boolean;
  31408. /**
  31409. * Gets or sets the Cartesian position of this label.
  31410. */
  31411. position: Cartesian3;
  31412. /**
  31413. * Gets or sets the height reference of this billboard.
  31414. */
  31415. heightReference: HeightReference;
  31416. /**
  31417. * Gets or sets the text of this label.
  31418. */
  31419. text: string;
  31420. /**
  31421. * Gets or sets the font used to draw this label. Fonts are specified using the same syntax as the CSS 'font' property.
  31422. */
  31423. font: string;
  31424. /**
  31425. * Gets or sets the fill color of this label.
  31426. */
  31427. fillColor: Color;
  31428. /**
  31429. * Gets or sets the outline color of this label.
  31430. */
  31431. outlineColor: Color;
  31432. /**
  31433. * Gets or sets the outline width of this label.
  31434. */
  31435. outlineWidth: number;
  31436. /**
  31437. * Determines if a background behind this label will be shown.
  31438. */
  31439. showBackground: boolean;
  31440. /**
  31441. * Gets or sets the background color of this label.
  31442. */
  31443. backgroundColor: Color;
  31444. /**
  31445. * Gets or sets the background padding, in pixels, of this label. The <code>x</code> value
  31446. controls horizontal padding, and the <code>y</code> value controls vertical padding.
  31447. */
  31448. backgroundPadding: Cartesian2;
  31449. /**
  31450. * Gets or sets the style of this label.
  31451. */
  31452. style: LabelStyle;
  31453. /**
  31454. * Gets or sets the pixel offset in screen space from the origin of this label. This is commonly used
  31455. to align multiple labels and billboards at the same position, e.g., an image and text. The
  31456. screen space origin is the top, left corner of the canvas; <code>x</code> increases from
  31457. left to right, and <code>y</code> increases from top to bottom.
  31458. <br /><br />
  31459. <div align='center'>
  31460. <table border='0' cellpadding='5'><tr>
  31461. <td align='center'><code>default</code><br/><img src='Images/Label.setPixelOffset.default.png' width='250' height='188' /></td>
  31462. <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>
  31463. </tr></table>
  31464. The label's origin is indicated by the yellow point.
  31465. </div>
  31466. */
  31467. pixelOffset: Cartesian2;
  31468. /**
  31469. * Gets or sets near and far translucency properties of a Label based on the Label's distance from the camera.
  31470. A label's translucency will interpolate between the {@link NearFarScalar#nearValue} and
  31471. {@link NearFarScalar#farValue} while the camera distance falls within the lower and upper bounds
  31472. of the specified {@link NearFarScalar#near} and {@link NearFarScalar#far}.
  31473. Outside of these ranges the label's translucency remains clamped to the nearest bound. If undefined,
  31474. translucencyByDistance will be disabled.
  31475. * @example
  31476. * // Example 1.
  31477. // Set a label's translucencyByDistance to 1.0 when the
  31478. // camera is 1500 meters from the label and disappear as
  31479. // the camera distance approaches 8.0e6 meters.
  31480. text.translucencyByDistance = new Cesium.NearFarScalar(1.5e2, 1.0, 8.0e6, 0.0);
  31481. * @example
  31482. * // Example 2.
  31483. // disable translucency by distance
  31484. text.translucencyByDistance = undefined;
  31485. */
  31486. translucencyByDistance: NearFarScalar;
  31487. /**
  31488. * Gets or sets near and far pixel offset scaling properties of a Label based on the Label's distance from the camera.
  31489. A label's pixel offset will be scaled between the {@link NearFarScalar#nearValue} and
  31490. {@link NearFarScalar#farValue} while the camera distance falls within the lower and upper bounds
  31491. of the specified {@link NearFarScalar#near} and {@link NearFarScalar#far}.
  31492. Outside of these ranges the label's pixel offset scaling remains clamped to the nearest bound. If undefined,
  31493. pixelOffsetScaleByDistance will be disabled.
  31494. * @example
  31495. * // Example 1.
  31496. // Set a label's pixel offset scale to 0.0 when the
  31497. // camera is 1500 meters from the label and scale pixel offset to 10.0 pixels
  31498. // in the y direction the camera distance approaches 8.0e6 meters.
  31499. text.pixelOffset = new Cesium.Cartesian2(0.0, 1.0);
  31500. text.pixelOffsetScaleByDistance = new Cesium.NearFarScalar(1.5e2, 0.0, 8.0e6, 10.0);
  31501. * @example
  31502. * // Example 2.
  31503. // disable pixel offset by distance
  31504. text.pixelOffsetScaleByDistance = undefined;
  31505. */
  31506. pixelOffsetScaleByDistance: NearFarScalar;
  31507. /**
  31508. * Gets or sets near and far scaling properties of a Label based on the label's distance from the camera.
  31509. A label's scale will interpolate between the {@link NearFarScalar#nearValue} and
  31510. {@link NearFarScalar#farValue} while the camera distance falls within the lower and upper bounds
  31511. of the specified {@link NearFarScalar#near} and {@link NearFarScalar#far}.
  31512. Outside of these ranges the label's scale remains clamped to the nearest bound. If undefined,
  31513. scaleByDistance will be disabled.
  31514. * @example
  31515. * // Example 1.
  31516. // Set a label's scaleByDistance to scale by 1.5 when the
  31517. // camera is 1500 meters from the label and disappear as
  31518. // the camera distance approaches 8.0e6 meters.
  31519. label.scaleByDistance = new Cesium.NearFarScalar(1.5e2, 1.5, 8.0e6, 0.0);
  31520. * @example
  31521. * // Example 2.
  31522. // disable scaling by distance
  31523. label.scaleByDistance = undefined;
  31524. */
  31525. scaleByDistance: NearFarScalar;
  31526. /**
  31527. * Gets and sets the 3D Cartesian offset applied to this label in eye coordinates. Eye coordinates is a left-handed
  31528. coordinate system, where <code>x</code> points towards the viewer's right, <code>y</code> points up, and
  31529. <code>z</code> points into the screen. Eye coordinates use the same scale as world and model coordinates,
  31530. which is typically meters.
  31531. <br /><br />
  31532. An eye offset is commonly used to arrange multiple label or objects at the same position, e.g., to
  31533. arrange a label above its corresponding 3D model.
  31534. <br /><br />
  31535. Below, the label is positioned at the center of the Earth but an eye offset makes it always
  31536. appear on top of the Earth regardless of the viewer's or Earth's orientation.
  31537. <br /><br />
  31538. <div align='center'>
  31539. <table border='0' cellpadding='5'><tr>
  31540. <td align='center'><img src='Images/Billboard.setEyeOffset.one.png' width='250' height='188' /></td>
  31541. <td align='center'><img src='Images/Billboard.setEyeOffset.two.png' width='250' height='188' /></td>
  31542. </tr></table>
  31543. <code>l.eyeOffset = new Cartesian3(0.0, 8000000.0, 0.0);</code><br /><br />
  31544. </div>
  31545. */
  31546. eyeOffset: Cartesian3;
  31547. /**
  31548. * Gets or sets the horizontal origin of this label, which determines if the label is drawn
  31549. to the left, center, or right of its anchor position.
  31550. <br /><br />
  31551. <div align='center'>
  31552. <img src='Images/Billboard.setHorizontalOrigin.png' width='648' height='196' /><br />
  31553. </div>
  31554. * @example
  31555. * // Use a top, right origin
  31556. l.horizontalOrigin = Cesium.HorizontalOrigin.RIGHT;
  31557. l.verticalOrigin = Cesium.VerticalOrigin.TOP;
  31558. */
  31559. horizontalOrigin: HorizontalOrigin;
  31560. /**
  31561. * Gets or sets the vertical origin of this label, which determines if the label is
  31562. to the above, below, or at the center of its anchor position.
  31563. <br /><br />
  31564. <div align='center'>
  31565. <img src='Images/Billboard.setVerticalOrigin.png' width='695' height='175' /><br />
  31566. </div>
  31567. * @example
  31568. * // Use a top, right origin
  31569. l.horizontalOrigin = Cesium.HorizontalOrigin.RIGHT;
  31570. l.verticalOrigin = Cesium.VerticalOrigin.TOP;
  31571. */
  31572. verticalOrigin: VerticalOrigin;
  31573. /**
  31574. * Gets or sets the uniform scale that is multiplied with the label's size in pixels.
  31575. A scale of <code>1.0</code> does not change the size of the label; a scale greater than
  31576. <code>1.0</code> enlarges the label; a positive scale less than <code>1.0</code> shrinks
  31577. the label.
  31578. <br /><br />
  31579. Applying a large scale value may pixelate the label. To make text larger without pixelation,
  31580. use a larger font size when calling {@link Label#font} instead.
  31581. <br /><br />
  31582. <div align='center'>
  31583. <img src='Images/Label.setScale.png' width='400' height='300' /><br/>
  31584. From left to right in the above image, the scales are <code>0.5</code>, <code>1.0</code>,
  31585. and <code>2.0</code>.
  31586. </div>
  31587. */
  31588. scale: number;
  31589. /**
  31590. * Gets the total scale of the label, which is the label's scale multiplied by the computed relative size
  31591. of the desired font compared to the generated glyph size.
  31592. */
  31593. totalScale: number;
  31594. /**
  31595. * Gets or sets the condition specifying at what distance from the camera that this label will be displayed.
  31596. */
  31597. distanceDisplayCondition: DistanceDisplayCondition;
  31598. /**
  31599. * Gets or sets the distance from the camera at which to disable the depth test to, for example, prevent clipping against terrain.
  31600. When set to zero, the depth test is always applied. When set to Number.POSITIVE_INFINITY, the depth test is never applied.
  31601. */
  31602. disableDepthTestDistance: number;
  31603. /**
  31604. * Gets or sets the user-defined value returned when the label is picked.
  31605. */
  31606. id: any;
  31607. /**
  31608. * Computes the screen-space position of the label's origin, taking into account eye and pixel offsets.
  31609. The screen space origin is the top, left corner of the canvas; <code>x</code> increases from
  31610. left to right, and <code>y</code> increases from top to bottom.
  31611. * @example
  31612. * console.log(l.computeScreenSpacePosition(scene).toString());
  31613. * @param scene - The scene the label is in.
  31614. * @param [result] - The object onto which to store the result.
  31615. * @returns The screen-space position of the label.
  31616. */
  31617. computeScreenSpacePosition(scene: Scene, result?: Cartesian2): Cartesian2;
  31618. /**
  31619. * Determines if this label equals another label. Labels are equal if all their properties
  31620. are equal. Labels in different collections can be equal.
  31621. * @param other - The label to compare for equality.
  31622. * @returns <code>true</code> if the labels are equal; otherwise, <code>false</code>.
  31623. */
  31624. equals(other: Label): boolean;
  31625. /**
  31626. * Returns true if this object was destroyed; otherwise, false.
  31627. <br /><br />
  31628. If this object was destroyed, it should not be used; calling any function other than
  31629. <code>isDestroyed</code> will result in a {@link DeveloperError} exception.
  31630. * @returns True if this object was destroyed; otherwise, false.
  31631. */
  31632. isDestroyed(): boolean;
  31633. /**
  31634. * Determines whether or not run the algorithm, that match the text of the label to right-to-left languages
  31635. * @example
  31636. * // Example 1.
  31637. // Set a label's rightToLeft before init
  31638. Cesium.Label.enableRightToLeftDetection = true;
  31639. var myLabelEntity = viewer.entities.add({
  31640. label: {
  31641. id: 'my label',
  31642. text: 'זה טקסט בעברית \n ועכשיו יורדים שורה',
  31643. }
  31644. });
  31645. * @example
  31646. * // Example 2.
  31647. var myLabelEntity = viewer.entities.add({
  31648. label: {
  31649. id: 'my label',
  31650. text: 'English text'
  31651. }
  31652. });
  31653. // Set a label's rightToLeft after init
  31654. Cesium.Label.enableRightToLeftDetection = true;
  31655. myLabelEntity.text = 'טקסט חדש';
  31656. */
  31657. static enableRightToLeftDetection: boolean;
  31658. }
  31659. /**
  31660. * A renderable collection of labels. Labels are viewport-aligned text positioned in the 3D scene.
  31661. Each label can have a different font, color, scale, etc.
  31662. <br /><br />
  31663. <div align='center'>
  31664. <img src='Images/Label.png' width='400' height='300' /><br />
  31665. Example labels
  31666. </div>
  31667. <br /><br />
  31668. Labels are added and removed from the collection using {@link LabelCollection#add}
  31669. and {@link LabelCollection#remove}.
  31670. * @example
  31671. * // Create a label collection with two labels
  31672. var labels = scene.primitives.add(new Cesium.LabelCollection());
  31673. labels.add({
  31674. position : new Cesium.Cartesian3(1.0, 2.0, 3.0),
  31675. text : 'A label'
  31676. });
  31677. labels.add({
  31678. position : new Cesium.Cartesian3(4.0, 5.0, 6.0),
  31679. text : 'Another label'
  31680. });
  31681. * @param [options] - Object with the following properties:
  31682. * @param [options.modelMatrix = Matrix4.IDENTITY] - The 4x4 transformation matrix that transforms each label from model to world coordinates.
  31683. * @param [options.debugShowBoundingVolume = false] - For debugging only. Determines if this primitive's commands' bounding spheres are shown.
  31684. * @param [options.scene] - Must be passed in for labels that use the height reference property or will be depth tested against the globe.
  31685. * @param [options.blendOption = BlendOption.OPAQUE_AND_TRANSLUCENT] - The label blending option. The default
  31686. is used for rendering both opaque and translucent labels. However, if either all of the labels are completely opaque or all are completely translucent,
  31687. setting the technique to BlendOption.OPAQUE or BlendOption.TRANSLUCENT can improve performance by up to 2x.
  31688. */
  31689. export class LabelCollection {
  31690. constructor(options?: {
  31691. modelMatrix?: Matrix4;
  31692. debugShowBoundingVolume?: boolean;
  31693. scene?: Scene;
  31694. blendOption?: BlendOption;
  31695. });
  31696. /**
  31697. * The 4x4 transformation matrix that transforms each label in this collection from model to world coordinates.
  31698. When this is the identity matrix, the labels are drawn in world coordinates, i.e., Earth's WGS84 coordinates.
  31699. Local reference frames can be used by providing a different transformation matrix, like that returned
  31700. by {@link Transforms.eastNorthUpToFixedFrame}.
  31701. * @example
  31702. * var center = Cesium.Cartesian3.fromDegrees(-75.59777, 40.03883);
  31703. labels.modelMatrix = Cesium.Transforms.eastNorthUpToFixedFrame(center);
  31704. labels.add({
  31705. position : new Cesium.Cartesian3(0.0, 0.0, 0.0),
  31706. text : 'Center'
  31707. });
  31708. labels.add({
  31709. position : new Cesium.Cartesian3(1000000.0, 0.0, 0.0),
  31710. text : 'East'
  31711. });
  31712. labels.add({
  31713. position : new Cesium.Cartesian3(0.0, 1000000.0, 0.0),
  31714. text : 'North'
  31715. });
  31716. labels.add({
  31717. position : new Cesium.Cartesian3(0.0, 0.0, 1000000.0),
  31718. text : 'Up'
  31719. });
  31720. */
  31721. modelMatrix: Matrix4;
  31722. /**
  31723. * This property is for debugging only; it is not for production use nor is it optimized.
  31724. <p>
  31725. Draws the bounding sphere for each draw command in the primitive.
  31726. </p>
  31727. */
  31728. debugShowBoundingVolume: boolean;
  31729. /**
  31730. * The label blending option. The default is used for rendering both opaque and translucent labels.
  31731. However, if either all of the labels are completely opaque or all are completely translucent,
  31732. setting the technique to BlendOption.OPAQUE or BlendOption.TRANSLUCENT can improve
  31733. performance by up to 2x.
  31734. */
  31735. blendOption: BlendOption;
  31736. /**
  31737. * Returns the number of labels in this collection. This is commonly used with
  31738. {@link LabelCollection#get} to iterate over all the labels
  31739. in the collection.
  31740. */
  31741. length: number;
  31742. /**
  31743. * Creates and adds a label with the specified initial properties to the collection.
  31744. The added label is returned so it can be modified or removed from the collection later.
  31745. * @example
  31746. * // Example 1: Add a label, specifying all the default values.
  31747. var l = labels.add({
  31748. show : true,
  31749. position : Cesium.Cartesian3.ZERO,
  31750. text : '',
  31751. font : '30px sans-serif',
  31752. fillColor : Cesium.Color.WHITE,
  31753. outlineColor : Cesium.Color.BLACK,
  31754. outlineWidth : 1.0,
  31755. showBackground : false,
  31756. backgroundColor : new Cesium.Color(0.165, 0.165, 0.165, 0.8),
  31757. backgroundPadding : new Cesium.Cartesian2(7, 5),
  31758. style : Cesium.LabelStyle.FILL,
  31759. pixelOffset : Cesium.Cartesian2.ZERO,
  31760. eyeOffset : Cesium.Cartesian3.ZERO,
  31761. horizontalOrigin : Cesium.HorizontalOrigin.LEFT,
  31762. verticalOrigin : Cesium.VerticalOrigin.BASELINE,
  31763. scale : 1.0,
  31764. translucencyByDistance : undefined,
  31765. pixelOffsetScaleByDistance : undefined,
  31766. heightReference : HeightReference.NONE,
  31767. distanceDisplayCondition : undefined
  31768. });
  31769. * @example
  31770. * // Example 2: Specify only the label's cartographic position,
  31771. // text, and font.
  31772. var l = labels.add({
  31773. position : Cesium.Cartesian3.fromRadians(longitude, latitude, height),
  31774. text : 'Hello World',
  31775. font : '24px Helvetica',
  31776. });
  31777. * @param [options] - A template describing the label's properties as shown in Example 1.
  31778. * @returns The label that was added to the collection.
  31779. */
  31780. add(options?: any): Label;
  31781. /**
  31782. * Removes a label from the collection. Once removed, a label is no longer usable.
  31783. * @example
  31784. * var l = labels.add(...);
  31785. labels.remove(l); // Returns true
  31786. * @param label - The label to remove.
  31787. * @returns <code>true</code> if the label was removed; <code>false</code> if the label was not found in the collection.
  31788. */
  31789. remove(label: Label): boolean;
  31790. /**
  31791. * Removes all labels from the collection.
  31792. * @example
  31793. * labels.add(...);
  31794. labels.add(...);
  31795. labels.removeAll();
  31796. */
  31797. removeAll(): void;
  31798. /**
  31799. * Check whether this collection contains a given label.
  31800. * @param label - The label to check for.
  31801. * @returns true if this collection contains the label, false otherwise.
  31802. */
  31803. contains(label: Label): boolean;
  31804. /**
  31805. * Returns the label in the collection at the specified index. Indices are zero-based
  31806. and increase as labels are added. Removing a label shifts all labels after
  31807. it to the left, changing their indices. This function is commonly used with
  31808. {@link LabelCollection#length} to iterate over all the labels
  31809. in the collection.
  31810. * @example
  31811. * // Toggle the show property of every label in the collection
  31812. var len = labels.length;
  31813. for (var i = 0; i < len; ++i) {
  31814. var l = billboards.get(i);
  31815. l.show = !l.show;
  31816. }
  31817. * @param index - The zero-based index of the billboard.
  31818. * @returns The label at the specified index.
  31819. */
  31820. get(index: number): Label;
  31821. /**
  31822. * Returns true if this object was destroyed; otherwise, false.
  31823. <br /><br />
  31824. If this object was destroyed, it should not be used; calling any function other than
  31825. <code>isDestroyed</code> will result in a {@link DeveloperError} exception.
  31826. * @returns True if this object was destroyed; otherwise, false.
  31827. */
  31828. isDestroyed(): boolean;
  31829. /**
  31830. * Destroys the WebGL resources held by this object. Destroying an object allows for deterministic
  31831. release of WebGL resources, instead of relying on the garbage collector to destroy this object.
  31832. <br /><br />
  31833. Once an object is destroyed, it should not be used; calling any function other than
  31834. <code>isDestroyed</code> will result in a {@link DeveloperError} exception. Therefore,
  31835. assign the return value (<code>undefined</code>) to the object as done in the example.
  31836. * @example
  31837. * labels = labels && labels.destroy();
  31838. */
  31839. destroy(): void;
  31840. }
  31841. /**
  31842. * Describes how to draw a label.
  31843. */
  31844. export enum LabelStyle {
  31845. /**
  31846. * Fill the text of the label, but do not outline.
  31847. */
  31848. FILL = 0,
  31849. /**
  31850. * Outline the text of the label, but do not fill.
  31851. */
  31852. OUTLINE = 1,
  31853. /**
  31854. * Fill and outline the text of the label.
  31855. */
  31856. FILL_AND_OUTLINE = 2
  31857. }
  31858. /**
  31859. * A light source. This type describes an interface and is not intended to be instantiated directly.
  31860. */
  31861. export class Light {
  31862. constructor();
  31863. /**
  31864. * The color of the light.
  31865. */
  31866. color: Color;
  31867. /**
  31868. * The intensity of the light.
  31869. */
  31870. intensity: number;
  31871. }
  31872. export namespace MapboxImageryProvider {
  31873. /**
  31874. * Initialization options for the MapboxImageryProvider constructor
  31875. * @property [url = 'https://api.mapbox.com/v4/'] - The Mapbox server url.
  31876. * @property mapId - The Mapbox Map ID.
  31877. * @property accessToken - The public access token for the imagery.
  31878. * @property [format = 'png'] - The format of the image request.
  31879. * @property [ellipsoid] - The ellipsoid. If not specified, the WGS84 ellipsoid is used.
  31880. * @property [minimumLevel = 0] - The minimum level-of-detail supported by the imagery provider. Take care when specifying
  31881. this that the number of tiles at the minimum level is small, such as four or less. A larger number is likely
  31882. to result in rendering problems.
  31883. * @property [maximumLevel] - The maximum level-of-detail supported by the imagery provider, or undefined if there is no limit.
  31884. * @property [rectangle = Rectangle.MAX_VALUE] - The rectangle, in radians, covered by the image.
  31885. * @property [credit] - A credit for the data source, which is displayed on the canvas.
  31886. */
  31887. type ConstructorOptions = {
  31888. url?: string;
  31889. mapId: string;
  31890. accessToken: string;
  31891. format?: string;
  31892. ellipsoid?: Ellipsoid;
  31893. minimumLevel?: number;
  31894. maximumLevel?: number;
  31895. rectangle?: Rectangle;
  31896. credit?: Credit | string;
  31897. };
  31898. }
  31899. /**
  31900. * Provides tiled imagery hosted by Mapbox.
  31901. * @example
  31902. * // Mapbox tile provider
  31903. var mapbox = new Cesium.MapboxImageryProvider({
  31904. mapId: 'mapbox.streets',
  31905. accessToken: 'thisIsMyAccessToken'
  31906. });
  31907. * @param options - Object describing initialization options
  31908. */
  31909. export class MapboxImageryProvider {
  31910. constructor(options: MapboxImageryProvider.ConstructorOptions);
  31911. /**
  31912. * The default alpha blending value of this provider, with 0.0 representing fully transparent and
  31913. 1.0 representing fully opaque.
  31914. */
  31915. defaultAlpha: number | undefined;
  31916. /**
  31917. * The default alpha blending value on the night side of the globe of this provider, with 0.0 representing fully transparent and
  31918. 1.0 representing fully opaque.
  31919. */
  31920. defaultNightAlpha: number | undefined;
  31921. /**
  31922. * The default alpha blending value on the day side of the globe of this provider, with 0.0 representing fully transparent and
  31923. 1.0 representing fully opaque.
  31924. */
  31925. defaultDayAlpha: number | undefined;
  31926. /**
  31927. * The default brightness of this provider. 1.0 uses the unmodified imagery color. Less than 1.0
  31928. makes the imagery darker while greater than 1.0 makes it brighter.
  31929. */
  31930. defaultBrightness: number | undefined;
  31931. /**
  31932. * The default contrast of this provider. 1.0 uses the unmodified imagery color. Less than 1.0 reduces
  31933. the contrast while greater than 1.0 increases it.
  31934. */
  31935. defaultContrast: number | undefined;
  31936. /**
  31937. * The default hue of this provider in radians. 0.0 uses the unmodified imagery color.
  31938. */
  31939. defaultHue: number | undefined;
  31940. /**
  31941. * The default saturation of this provider. 1.0 uses the unmodified imagery color. Less than 1.0 reduces the
  31942. saturation while greater than 1.0 increases it.
  31943. */
  31944. defaultSaturation: number | undefined;
  31945. /**
  31946. * The default gamma correction to apply to this provider. 1.0 uses the unmodified imagery color.
  31947. */
  31948. defaultGamma: number | undefined;
  31949. /**
  31950. * The default texture minification filter to apply to this provider.
  31951. */
  31952. defaultMinificationFilter: TextureMinificationFilter;
  31953. /**
  31954. * The default texture magnification filter to apply to this provider.
  31955. */
  31956. defaultMagnificationFilter: TextureMagnificationFilter;
  31957. /**
  31958. * Gets the URL of the Mapbox server.
  31959. */
  31960. readonly url: string;
  31961. /**
  31962. * Gets a value indicating whether or not the provider is ready for use.
  31963. */
  31964. readonly ready: boolean;
  31965. /**
  31966. * Gets a promise that resolves to true when the provider is ready for use.
  31967. */
  31968. readonly readyPromise: Promise<boolean>;
  31969. /**
  31970. * Gets the rectangle, in radians, of the imagery provided by the instance. This function should
  31971. not be called before {@link MapboxImageryProvider#ready} returns true.
  31972. */
  31973. readonly rectangle: Rectangle;
  31974. /**
  31975. * Gets the width of each tile, in pixels. This function should
  31976. not be called before {@link MapboxImageryProvider#ready} returns true.
  31977. */
  31978. readonly tileWidth: number;
  31979. /**
  31980. * Gets the height of each tile, in pixels. This function should
  31981. not be called before {@link MapboxImageryProvider#ready} returns true.
  31982. */
  31983. readonly tileHeight: number;
  31984. /**
  31985. * Gets the maximum level-of-detail that can be requested. This function should
  31986. not be called before {@link MapboxImageryProvider#ready} returns true.
  31987. */
  31988. readonly maximumLevel: number | undefined;
  31989. /**
  31990. * Gets the minimum level-of-detail that can be requested. This function should
  31991. not be called before {@link MapboxImageryProvider#ready} returns true. Generally,
  31992. a minimum level should only be used when the rectangle of the imagery is small
  31993. enough that the number of tiles at the minimum level is small. An imagery
  31994. provider with more than a few tiles at the minimum level will lead to
  31995. rendering problems.
  31996. */
  31997. readonly minimumLevel: number;
  31998. /**
  31999. * Gets the tiling scheme used by the provider. This function should
  32000. not be called before {@link MapboxImageryProvider#ready} returns true.
  32001. */
  32002. readonly tilingScheme: TilingScheme;
  32003. /**
  32004. * Gets the tile discard policy. If not undefined, the discard policy is responsible
  32005. for filtering out "missing" tiles via its shouldDiscardImage function. If this function
  32006. returns undefined, no tiles are filtered. This function should
  32007. not be called before {@link MapboxImageryProvider#ready} returns true.
  32008. */
  32009. readonly tileDiscardPolicy: TileDiscardPolicy;
  32010. /**
  32011. * Gets an event that is raised when the imagery provider encounters an asynchronous error.. By subscribing
  32012. to the event, you will be notified of the error and can potentially recover from it. Event listeners
  32013. are passed an instance of {@link TileProviderError}.
  32014. */
  32015. readonly errorEvent: Event;
  32016. /**
  32017. * Gets the credit to display when this imagery provider is active. Typically this is used to credit
  32018. the source of the imagery. This function should
  32019. not be called before {@link MapboxImageryProvider#ready} returns true.
  32020. */
  32021. readonly credit: Credit;
  32022. /**
  32023. * Gets the proxy used by this provider.
  32024. */
  32025. readonly proxy: Proxy;
  32026. /**
  32027. * Gets a value indicating whether or not the images provided by this imagery provider
  32028. include an alpha channel. If this property is false, an alpha channel, if present, will
  32029. be ignored. If this property is true, any images without an alpha channel will be treated
  32030. as if their alpha is 1.0 everywhere. When this property is false, memory usage
  32031. and texture upload time are reduced.
  32032. */
  32033. readonly hasAlphaChannel: boolean;
  32034. /**
  32035. * Gets the credits to be displayed when a given tile is displayed.
  32036. * @param x - The tile X coordinate.
  32037. * @param y - The tile Y coordinate.
  32038. * @param level - The tile level;
  32039. * @returns The credits to be displayed when the tile is displayed.
  32040. */
  32041. getTileCredits(x: number, y: number, level: number): Credit[];
  32042. /**
  32043. * Requests the image for a given tile. This function should
  32044. not be called before {@link MapboxImageryProvider#ready} returns true.
  32045. * @param x - The tile X coordinate.
  32046. * @param y - The tile Y coordinate.
  32047. * @param level - The tile level.
  32048. * @param [request] - The request object. Intended for internal use only.
  32049. * @returns A promise for the image that will resolve when the image is available, or
  32050. undefined if there are too many active requests to the server, and the request
  32051. should be retried later. The resolved image may be either an
  32052. Image or a Canvas DOM object.
  32053. */
  32054. requestImage(x: number, y: number, level: number, request?: Request): Promise<HTMLImageElement | HTMLCanvasElement> | undefined;
  32055. /**
  32056. * Asynchronously determines what features, if any, are located at a given longitude and latitude within
  32057. a tile. This function should not be called before {@link MapboxImageryProvider#ready} returns true.
  32058. This function is optional, so it may not exist on all ImageryProviders.
  32059. * @param x - The tile X coordinate.
  32060. * @param y - The tile Y coordinate.
  32061. * @param level - The tile level.
  32062. * @param longitude - The longitude at which to pick features.
  32063. * @param latitude - The latitude at which to pick features.
  32064. * @returns A promise for the picked features that will resolve when the asynchronous
  32065. picking completes. The resolved value is an array of {@link ImageryLayerFeatureInfo}
  32066. instances. The array may be empty if no features are found at the given location.
  32067. It may also be undefined if picking is not supported.
  32068. */
  32069. pickFeatures(x: number, y: number, level: number, longitude: number, latitude: number): Promise<ImageryLayerFeatureInfo[]> | undefined;
  32070. }
  32071. export namespace MapboxStyleImageryProvider {
  32072. /**
  32073. * Initialization options for the MapboxStyleImageryProvider constructor
  32074. * @property [url = 'https://api.mapbox.com/styles/v1/'] - The Mapbox server url.
  32075. * @property [username = 'mapbox'] - The username of the map account.
  32076. * @property styleId - The Mapbox Style ID.
  32077. * @property accessToken - The public access token for the imagery.
  32078. * @property [tilesize = 512] - The size of the image tiles.
  32079. * @property [scaleFactor] - Determines if tiles are rendered at a @2x scale factor.
  32080. * @property [ellipsoid] - The ellipsoid. If not specified, the WGS84 ellipsoid is used.
  32081. * @property [minimumLevel = 0] - The minimum level-of-detail supported by the imagery provider. Take care when specifying
  32082. this that the number of tiles at the minimum level is small, such as four or less. A larger number is likely
  32083. to result in rendering problems.
  32084. * @property [maximumLevel] - The maximum level-of-detail supported by the imagery provider, or undefined if there is no limit.
  32085. * @property [rectangle = Rectangle.MAX_VALUE] - The rectangle, in radians, covered by the image.
  32086. * @property [credit] - A credit for the data source, which is displayed on the canvas.
  32087. */
  32088. type ConstructorOptions = {
  32089. url?: Resource | string;
  32090. username?: string;
  32091. styleId: string;
  32092. accessToken: string;
  32093. tilesize?: number;
  32094. scaleFactor?: boolean;
  32095. ellipsoid?: Ellipsoid;
  32096. minimumLevel?: number;
  32097. maximumLevel?: number;
  32098. rectangle?: Rectangle;
  32099. credit?: Credit | string;
  32100. };
  32101. }
  32102. /**
  32103. * Provides tiled imagery hosted by Mapbox.
  32104. * @example
  32105. * // Mapbox style provider
  32106. var mapbox = new Cesium.MapboxStyleImageryProvider({
  32107. styleId: 'streets-v11',
  32108. accessToken: 'thisIsMyAccessToken'
  32109. });
  32110. * @param options - Object describing initialization options
  32111. */
  32112. export class MapboxStyleImageryProvider {
  32113. constructor(options: MapboxStyleImageryProvider.ConstructorOptions);
  32114. /**
  32115. * The default alpha blending value of this provider, with 0.0 representing fully transparent and
  32116. 1.0 representing fully opaque.
  32117. */
  32118. defaultAlpha: number | undefined;
  32119. /**
  32120. * The default alpha blending value on the night side of the globe of this provider, with 0.0 representing fully transparent and
  32121. 1.0 representing fully opaque.
  32122. */
  32123. defaultNightAlpha: number | undefined;
  32124. /**
  32125. * The default alpha blending value on the day side of the globe of this provider, with 0.0 representing fully transparent and
  32126. 1.0 representing fully opaque.
  32127. */
  32128. defaultDayAlpha: number | undefined;
  32129. /**
  32130. * The default brightness of this provider. 1.0 uses the unmodified imagery color. Less than 1.0
  32131. makes the imagery darker while greater than 1.0 makes it brighter.
  32132. */
  32133. defaultBrightness: number | undefined;
  32134. /**
  32135. * The default contrast of this provider. 1.0 uses the unmodified imagery color. Less than 1.0 reduces
  32136. the contrast while greater than 1.0 increases it.
  32137. */
  32138. defaultContrast: number | undefined;
  32139. /**
  32140. * The default hue of this provider in radians. 0.0 uses the unmodified imagery color.
  32141. */
  32142. defaultHue: number | undefined;
  32143. /**
  32144. * The default saturation of this provider. 1.0 uses the unmodified imagery color. Less than 1.0 reduces the
  32145. saturation while greater than 1.0 increases it.
  32146. */
  32147. defaultSaturation: number | undefined;
  32148. /**
  32149. * The default gamma correction to apply to this provider. 1.0 uses the unmodified imagery color.
  32150. */
  32151. defaultGamma: number | undefined;
  32152. /**
  32153. * The default texture minification filter to apply to this provider.
  32154. */
  32155. defaultMinificationFilter: TextureMinificationFilter;
  32156. /**
  32157. * The default texture magnification filter to apply to this provider.
  32158. */
  32159. defaultMagnificationFilter: TextureMagnificationFilter;
  32160. /**
  32161. * Gets the URL of the Mapbox server.
  32162. */
  32163. readonly url: string;
  32164. /**
  32165. * Gets a value indicating whether or not the provider is ready for use.
  32166. */
  32167. readonly ready: boolean;
  32168. /**
  32169. * Gets a promise that resolves to true when the provider is ready for use.
  32170. */
  32171. readonly readyPromise: Promise<boolean>;
  32172. /**
  32173. * Gets the rectangle, in radians, of the imagery provided by the instance. This function should
  32174. not be called before {@link MapboxStyleImageryProvider#ready} returns true.
  32175. */
  32176. readonly rectangle: Rectangle;
  32177. /**
  32178. * Gets the width of each tile, in pixels. This function should
  32179. not be called before {@link MapboxStyleImageryProvider#ready} returns true.
  32180. */
  32181. readonly tileWidth: number;
  32182. /**
  32183. * Gets the height of each tile, in pixels. This function should
  32184. not be called before {@link MapboxStyleImageryProvider#ready} returns true.
  32185. */
  32186. readonly tileHeight: number;
  32187. /**
  32188. * Gets the maximum level-of-detail that can be requested. This function should
  32189. not be called before {@link MapboxStyleImageryProvider#ready} returns true.
  32190. */
  32191. readonly maximumLevel: number | undefined;
  32192. /**
  32193. * Gets the minimum level-of-detail that can be requested. This function should
  32194. not be called before {@link MapboxStyleImageryProvider#ready} returns true. Generally,
  32195. a minimum level should only be used when the rectangle of the imagery is small
  32196. enough that the number of tiles at the minimum level is small. An imagery
  32197. provider with more than a few tiles at the minimum level will lead to
  32198. rendering problems.
  32199. */
  32200. readonly minimumLevel: number;
  32201. /**
  32202. * Gets the tiling scheme used by the provider. This function should
  32203. not be called before {@link MapboxStyleImageryProvider#ready} returns true.
  32204. */
  32205. readonly tilingScheme: TilingScheme;
  32206. /**
  32207. * Gets the tile discard policy. If not undefined, the discard policy is responsible
  32208. for filtering out "missing" tiles via its shouldDiscardImage function. If this function
  32209. returns undefined, no tiles are filtered. This function should
  32210. not be called before {@link MapboxStyleImageryProvider#ready} returns true.
  32211. */
  32212. readonly tileDiscardPolicy: TileDiscardPolicy;
  32213. /**
  32214. * Gets an event that is raised when the imagery provider encounters an asynchronous error.. By subscribing
  32215. to the event, you will be notified of the error and can potentially recover from it. Event listeners
  32216. are passed an instance of {@link TileProviderError}.
  32217. */
  32218. readonly errorEvent: Event;
  32219. /**
  32220. * Gets the credit to display when this imagery provider is active. Typically this is used to credit
  32221. the source of the imagery. This function should
  32222. not be called before {@link MapboxStyleImageryProvider#ready} returns true.
  32223. */
  32224. readonly credit: Credit;
  32225. /**
  32226. * Gets the proxy used by this provider.
  32227. */
  32228. readonly proxy: Proxy;
  32229. /**
  32230. * Gets a value indicating whether or not the images provided by this imagery provider
  32231. include an alpha channel. If this property is false, an alpha channel, if present, will
  32232. be ignored. If this property is true, any images without an alpha channel will be treated
  32233. as if their alpha is 1.0 everywhere. When this property is false, memory usage
  32234. and texture upload time are reduced.
  32235. */
  32236. readonly hasAlphaChannel: boolean;
  32237. /**
  32238. * Gets the credits to be displayed when a given tile is displayed.
  32239. * @param x - The tile X coordinate.
  32240. * @param y - The tile Y coordinate.
  32241. * @param level - The tile level;
  32242. * @returns The credits to be displayed when the tile is displayed.
  32243. */
  32244. getTileCredits(x: number, y: number, level: number): Credit[];
  32245. /**
  32246. * Requests the image for a given tile. This function should
  32247. not be called before {@link MapboxStyleImageryProvider#ready} returns true.
  32248. * @param x - The tile X coordinate.
  32249. * @param y - The tile Y coordinate.
  32250. * @param level - The tile level.
  32251. * @param [request] - The request object. Intended for internal use only.
  32252. * @returns A promise for the image that will resolve when the image is available, or
  32253. undefined if there are too many active requests to the server, and the request
  32254. should be retried later. The resolved image may be either an
  32255. Image or a Canvas DOM object.
  32256. */
  32257. requestImage(x: number, y: number, level: number, request?: Request): Promise<HTMLImageElement | HTMLCanvasElement> | undefined;
  32258. /**
  32259. * Asynchronously determines what features, if any, are located at a given longitude and latitude within
  32260. a tile. This function should not be called before {@link MapboxStyleImageryProvider#ready} returns true.
  32261. This function is optional, so it may not exist on all ImageryProviders.
  32262. * @param x - The tile X coordinate.
  32263. * @param y - The tile Y coordinate.
  32264. * @param level - The tile level.
  32265. * @param longitude - The longitude at which to pick features.
  32266. * @param latitude - The latitude at which to pick features.
  32267. * @returns A promise for the picked features that will resolve when the asynchronous
  32268. picking completes. The resolved value is an array of {@link ImageryLayerFeatureInfo}
  32269. instances. The array may be empty if no features are found at the given location.
  32270. It may also be undefined if picking is not supported.
  32271. */
  32272. pickFeatures(x: number, y: number, level: number, longitude: number, latitude: number): Promise<ImageryLayerFeatureInfo[]> | undefined;
  32273. }
  32274. /**
  32275. * Describes how the map will operate in 2D.
  32276. */
  32277. export enum MapMode2D {
  32278. /**
  32279. * The 2D map can be rotated about the z axis.
  32280. */
  32281. ROTATE = 0,
  32282. /**
  32283. * The 2D map can be scrolled infinitely in the horizontal direction.
  32284. */
  32285. INFINITE_SCROLL = 1
  32286. }
  32287. /**
  32288. * A Material defines surface appearance through a combination of diffuse, specular,
  32289. normal, emission, and alpha components. These values are specified using a
  32290. JSON schema called Fabric which gets parsed and assembled into glsl shader code
  32291. behind-the-scenes. Check out the {@link https://github.com/CesiumGS/cesium/wiki/Fabric|wiki page}
  32292. for more details on Fabric.
  32293. <br /><br />
  32294. <style type="text/css">
  32295. #materialDescriptions code {
  32296. font-weight: normal;
  32297. font-family: Consolas, 'Lucida Console', Monaco, monospace;
  32298. color: #A35A00;
  32299. }
  32300. #materialDescriptions ul, #materialDescriptions ul ul {
  32301. list-style-type: none;
  32302. }
  32303. #materialDescriptions ul ul {
  32304. margin-bottom: 10px;
  32305. }
  32306. #materialDescriptions ul ul li {
  32307. font-weight: normal;
  32308. color: #000000;
  32309. text-indent: -2em;
  32310. margin-left: 2em;
  32311. }
  32312. #materialDescriptions ul li {
  32313. font-weight: bold;
  32314. color: #0053CF;
  32315. }
  32316. </style>
  32317. Base material types and their uniforms:
  32318. <div id='materialDescriptions'>
  32319. <ul>
  32320. <li>Color</li>
  32321. <ul>
  32322. <li><code>color</code>: rgba color object.</li>
  32323. </ul>
  32324. <li>Image</li>
  32325. <ul>
  32326. <li><code>image</code>: path to image.</li>
  32327. <li><code>repeat</code>: Object with x and y values specifying the number of times to repeat the image.</li>
  32328. </ul>
  32329. <li>DiffuseMap</li>
  32330. <ul>
  32331. <li><code>image</code>: path to image.</li>
  32332. <li><code>channels</code>: Three character string containing any combination of r, g, b, and a for selecting the desired image channels.</li>
  32333. <li><code>repeat</code>: Object with x and y values specifying the number of times to repeat the image.</li>
  32334. </ul>
  32335. <li>AlphaMap</li>
  32336. <ul>
  32337. <li><code>image</code>: path to image.</li>
  32338. <li><code>channel</code>: One character string containing r, g, b, or a for selecting the desired image channel. </li>
  32339. <li><code>repeat</code>: Object with x and y values specifying the number of times to repeat the image.</li>
  32340. </ul>
  32341. <li>SpecularMap</li>
  32342. <ul>
  32343. <li><code>image</code>: path to image.</li>
  32344. <li><code>channel</code>: One character string containing r, g, b, or a for selecting the desired image channel. </li>
  32345. <li><code>repeat</code>: Object with x and y values specifying the number of times to repeat the image.</li>
  32346. </ul>
  32347. <li>EmissionMap</li>
  32348. <ul>
  32349. <li><code>image</code>: path to image.</li>
  32350. <li><code>channels</code>: Three character string containing any combination of r, g, b, and a for selecting the desired image channels. </li>
  32351. <li><code>repeat</code>: Object with x and y values specifying the number of times to repeat the image.</li>
  32352. </ul>
  32353. <li>BumpMap</li>
  32354. <ul>
  32355. <li><code>image</code>: path to image.</li>
  32356. <li><code>channel</code>: One character string containing r, g, b, or a for selecting the desired image channel. </li>
  32357. <li><code>repeat</code>: Object with x and y values specifying the number of times to repeat the image.</li>
  32358. <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>
  32359. </ul>
  32360. <li>NormalMap</li>
  32361. <ul>
  32362. <li><code>image</code>: path to image.</li>
  32363. <li><code>channels</code>: Three character string containing any combination of r, g, b, and a for selecting the desired image channels. </li>
  32364. <li><code>repeat</code>: Object with x and y values specifying the number of times to repeat the image.</li>
  32365. <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>
  32366. </ul>
  32367. <li>Grid</li>
  32368. <ul>
  32369. <li><code>color</code>: rgba color object for the whole material.</li>
  32370. <li><code>cellAlpha</code>: Alpha value for the cells between grid lines. This will be combined with color.alpha.</li>
  32371. <li><code>lineCount</code>: Object with x and y values specifying the number of columns and rows respectively.</li>
  32372. <li><code>lineThickness</code>: Object with x and y values specifying the thickness of grid lines (in pixels where available).</li>
  32373. <li><code>lineOffset</code>: Object with x and y values specifying the offset of grid lines (range is 0 to 1).</li>
  32374. </ul>
  32375. <li>Stripe</li>
  32376. <ul>
  32377. <li><code>horizontal</code>: Boolean that determines if the stripes are horizontal or vertical.</li>
  32378. <li><code>evenColor</code>: rgba color object for the stripe's first color.</li>
  32379. <li><code>oddColor</code>: rgba color object for the stripe's second color.</li>
  32380. <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>
  32381. <li><code>repeat</code>: Number that controls the total number of stripes, half light and half dark.</li>
  32382. </ul>
  32383. <li>Checkerboard</li>
  32384. <ul>
  32385. <li><code>lightColor</code>: rgba color object for the checkerboard's light alternating color.</li>
  32386. <li><code>darkColor</code>: rgba color object for the checkerboard's dark alternating color.</li>
  32387. <li><code>repeat</code>: Object with x and y values specifying the number of columns and rows respectively.</li>
  32388. </ul>
  32389. <li>Dot</li>
  32390. <ul>
  32391. <li><code>lightColor</code>: rgba color object for the dot color.</li>
  32392. <li><code>darkColor</code>: rgba color object for the background color.</li>
  32393. <li><code>repeat</code>: Object with x and y values specifying the number of columns and rows of dots respectively.</li>
  32394. </ul>
  32395. <li>Water</li>
  32396. <ul>
  32397. <li><code>baseWaterColor</code>: rgba color object base color of the water.</li>
  32398. <li><code>blendColor</code>: rgba color object used when blending from water to non-water areas.</li>
  32399. <li><code>specularMap</code>: Single channel texture used to indicate areas of water.</li>
  32400. <li><code>normalMap</code>: Normal map for water normal perturbation.</li>
  32401. <li><code>frequency</code>: Number that controls the number of waves.</li>
  32402. <li><code>normalMap</code>: Normal map for water normal perturbation.</li>
  32403. <li><code>animationSpeed</code>: Number that controls the animations speed of the water.</li>
  32404. <li><code>amplitude</code>: Number that controls the amplitude of water waves.</li>
  32405. <li><code>specularIntensity</code>: Number that controls the intensity of specular reflections.</li>
  32406. </ul>
  32407. <li>RimLighting</li>
  32408. <ul>
  32409. <li><code>color</code>: diffuse color and alpha.</li>
  32410. <li><code>rimColor</code>: diffuse color and alpha of the rim.</li>
  32411. <li><code>width</code>: Number that determines the rim's width.</li>
  32412. </ul>
  32413. <li>Fade</li>
  32414. <ul>
  32415. <li><code>fadeInColor</code>: diffuse color and alpha at <code>time</code></li>
  32416. <li><code>fadeOutColor</code>: diffuse color and alpha at <code>maximumDistance</code> from <code>time</code></li>
  32417. <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>
  32418. <li><code>repeat</code>: true if the fade should wrap around the texture coodinates.</li>
  32419. <li><code>fadeDirection</code>: Object with x and y values specifying if the fade should be in the x and y directions.</li>
  32420. <li><code>time</code>: Object with x and y values between 0.0 and 1.0 of the <code>fadeInColor</code> position</li>
  32421. </ul>
  32422. <li>PolylineArrow</li>
  32423. <ul>
  32424. <li><code>color</code>: diffuse color and alpha.</li>
  32425. </ul>
  32426. <li>PolylineDash</li>
  32427. <ul>
  32428. <li><code>color</code>: color for the line.</li>
  32429. <li><code>gapColor</code>: color for the gaps in the line.</li>
  32430. <li><code>dashLength</code>: Dash length in pixels.</li>
  32431. <li><code>dashPattern</code>: The 16 bit stipple pattern for the line..</li>
  32432. </ul>
  32433. <li>PolylineGlow</li>
  32434. <ul>
  32435. <li><code>color</code>: color and maximum alpha for the glow on the line.</li>
  32436. <li><code>glowPower</code>: strength of the glow, as a percentage of the total line width (less than 1.0).</li>
  32437. <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>
  32438. </ul>
  32439. <li>PolylineOutline</li>
  32440. <ul>
  32441. <li><code>color</code>: diffuse color and alpha for the interior of the line.</li>
  32442. <li><code>outlineColor</code>: diffuse color and alpha for the outline.</li>
  32443. <li><code>outlineWidth</code>: width of the outline in pixels.</li>
  32444. </ul>
  32445. <li>ElevationContour</li>
  32446. <ul>
  32447. <li><code>color</code>: color and alpha for the contour line.</li>
  32448. <li><code>spacing</code>: spacing for contour lines in meters.</li>
  32449. <li><code>width</code>: Number specifying the width of the grid lines in pixels.</li>
  32450. </ul>
  32451. <li>ElevationRamp</li>
  32452. <ul>
  32453. <li><code>image</code>: color ramp image to use for coloring the terrain.</li>
  32454. <li><code>minimumHeight</code>: minimum height for the ramp.</li>
  32455. <li><code>maximumHeight</code>: maximum height for the ramp.</li>
  32456. </ul>
  32457. <li>SlopeRamp</li>
  32458. <ul>
  32459. <li><code>image</code>: color ramp image to use for coloring the terrain by slope.</li>
  32460. </ul>
  32461. <li>AspectRamp</li>
  32462. <ul>
  32463. <li><code>image</code>: color ramp image to use for color the terrain by aspect.</li>
  32464. </ul>
  32465. </ul>
  32466. </ul>
  32467. </div>
  32468. * @example
  32469. * // Create a color material with fromType:
  32470. polygon.material = Cesium.Material.fromType('Color');
  32471. polygon.material.uniforms.color = new Cesium.Color(1.0, 1.0, 0.0, 1.0);
  32472. // Create the default material:
  32473. polygon.material = new Cesium.Material();
  32474. // Create a color material with full Fabric notation:
  32475. polygon.material = new Cesium.Material({
  32476. fabric : {
  32477. type : 'Color',
  32478. uniforms : {
  32479. color : new Cesium.Color(1.0, 1.0, 0.0, 1.0)
  32480. }
  32481. }
  32482. });
  32483. * @param [options] - Object with the following properties:
  32484. * @param [options.strict = false] - Throws errors for issues that would normally be ignored, including unused uniforms or materials.
  32485. * @param [options.translucent = true] - When <code>true</code> or a function that returns <code>true</code>, the geometry
  32486. with this material is expected to appear translucent.
  32487. * @param [options.minificationFilter = TextureMinificationFilter.LINEAR] - The {@link TextureMinificationFilter} to apply to this material's textures.
  32488. * @param [options.magnificationFilter = TextureMagnificationFilter.LINEAR] - The {@link TextureMagnificationFilter} to apply to this material's textures.
  32489. * @param options.fabric - The fabric JSON used to generate the material.
  32490. */
  32491. export class Material {
  32492. constructor(options?: {
  32493. strict?: boolean;
  32494. translucent?: boolean | ((...params: any[]) => any);
  32495. minificationFilter?: TextureMinificationFilter;
  32496. magnificationFilter?: TextureMagnificationFilter;
  32497. fabric: any;
  32498. });
  32499. /**
  32500. * The material type. Can be an existing type or a new type. If no type is specified in fabric, type is a GUID.
  32501. */
  32502. type: string;
  32503. /**
  32504. * The glsl shader source for this material.
  32505. */
  32506. shaderSource: string;
  32507. /**
  32508. * Maps sub-material names to Material objects.
  32509. */
  32510. materials: any;
  32511. /**
  32512. * Maps uniform names to their values.
  32513. */
  32514. uniforms: any;
  32515. /**
  32516. * When <code>true</code> or a function that returns <code>true</code>,
  32517. the geometry is expected to appear translucent.
  32518. */
  32519. translucent: boolean | ((...params: any[]) => any);
  32520. /**
  32521. * Creates a new material using an existing material type.
  32522. <br /><br />
  32523. Shorthand for: new Material({fabric : {type : type}});
  32524. * @example
  32525. * var material = Cesium.Material.fromType('Color', {
  32526. color : new Cesium.Color(1.0, 0.0, 0.0, 1.0)
  32527. });
  32528. * @param type - The base material type.
  32529. * @param [uniforms] - Overrides for the default uniforms.
  32530. * @returns New material object.
  32531. */
  32532. static fromType(type: string, uniforms?: any): Material;
  32533. /**
  32534. * Gets whether or not this material is translucent.
  32535. * @returns <code>true</code> if this material is translucent, <code>false</code> otherwise.
  32536. */
  32537. isTranslucent(): boolean;
  32538. /**
  32539. * Returns true if this object was destroyed; otherwise, false.
  32540. <br /><br />
  32541. If this object was destroyed, it should not be used; calling any function other than
  32542. <code>isDestroyed</code> will result in a {@link DeveloperError} exception.
  32543. * @returns True if this object was destroyed; otherwise, false.
  32544. */
  32545. isDestroyed(): boolean;
  32546. /**
  32547. * Destroys the WebGL resources held by this object. Destroying an object allows for deterministic
  32548. release of WebGL resources, instead of relying on the garbage collector to destroy this object.
  32549. <br /><br />
  32550. Once an object is destroyed, it should not be used; calling any function other than
  32551. <code>isDestroyed</code> will result in a {@link DeveloperError} exception. Therefore,
  32552. assign the return value (<code>undefined</code>) to the object as done in the example.
  32553. * @example
  32554. * material = material && material.destroy();
  32555. */
  32556. destroy(): void;
  32557. /**
  32558. * Gets or sets the default texture uniform value.
  32559. */
  32560. static DefaultImageId: string;
  32561. /**
  32562. * Gets or sets the default cube map texture uniform value.
  32563. */
  32564. static DefaultCubeMapId: string;
  32565. /**
  32566. * Gets the name of the color material.
  32567. */
  32568. static readonly ColorType: string;
  32569. /**
  32570. * Gets the name of the image material.
  32571. */
  32572. static readonly ImageType: string;
  32573. /**
  32574. * Gets the name of the diffuce map material.
  32575. */
  32576. static readonly DiffuseMapType: string;
  32577. /**
  32578. * Gets the name of the alpha map material.
  32579. */
  32580. static readonly AlphaMapType: string;
  32581. /**
  32582. * Gets the name of the specular map material.
  32583. */
  32584. static readonly SpecularMapType: string;
  32585. /**
  32586. * Gets the name of the emmision map material.
  32587. */
  32588. static readonly EmissionMapType: string;
  32589. /**
  32590. * Gets the name of the bump map material.
  32591. */
  32592. static readonly BumpMapType: string;
  32593. /**
  32594. * Gets the name of the normal map material.
  32595. */
  32596. static readonly NormalMapType: string;
  32597. /**
  32598. * Gets the name of the grid material.
  32599. */
  32600. static readonly GridType: string;
  32601. /**
  32602. * Gets the name of the stripe material.
  32603. */
  32604. static readonly StripeType: string;
  32605. /**
  32606. * Gets the name of the checkerboard material.
  32607. */
  32608. static readonly CheckerboardType: string;
  32609. /**
  32610. * Gets the name of the dot material.
  32611. */
  32612. static readonly DotType: string;
  32613. /**
  32614. * Gets the name of the water material.
  32615. */
  32616. static readonly WaterType: string;
  32617. /**
  32618. * Gets the name of the rim lighting material.
  32619. */
  32620. static readonly RimLightingType: string;
  32621. /**
  32622. * Gets the name of the fade material.
  32623. */
  32624. static readonly FadeType: string;
  32625. /**
  32626. * Gets the name of the polyline arrow material.
  32627. */
  32628. static readonly PolylineArrowType: string;
  32629. /**
  32630. * Gets the name of the polyline glow material.
  32631. */
  32632. static readonly PolylineDashType: string;
  32633. /**
  32634. * Gets the name of the polyline glow material.
  32635. */
  32636. static readonly PolylineGlowType: string;
  32637. /**
  32638. * Gets the name of the polyline outline material.
  32639. */
  32640. static readonly PolylineOutlineType: string;
  32641. /**
  32642. * Gets the name of the elevation contour material.
  32643. */
  32644. static readonly ElevationContourType: string;
  32645. /**
  32646. * Gets the name of the elevation contour material.
  32647. */
  32648. static readonly ElevationRampType: string;
  32649. /**
  32650. * Gets the name of the slope ramp material.
  32651. */
  32652. static readonly SlopeRampMaterialType: string;
  32653. /**
  32654. * Gets the name of the aspect ramp material.
  32655. */
  32656. static readonly AspectRampMaterialType: string;
  32657. }
  32658. /**
  32659. * An appearance for arbitrary geometry (as opposed to {@link EllipsoidSurfaceAppearance}, for example)
  32660. that supports shading with materials.
  32661. * @example
  32662. * var primitive = new Cesium.Primitive({
  32663. geometryInstances : new Cesium.GeometryInstance({
  32664. geometry : new Cesium.WallGeometry({
  32665. * materialSupport : Cesium.MaterialAppearance.MaterialSupport.BASIC.vertexFormat,
  32666. // ...
  32667. })
  32668. }),
  32669. appearance : new Cesium.MaterialAppearance({
  32670. material : Cesium.Material.fromType('Color'),
  32671. faceForward : true
  32672. })
  32673. });
  32674. * @param [options] - Object with the following properties:
  32675. * @param [options.flat = false] - When <code>true</code>, flat shading is used in the fragment shader, which means lighting is not taking into account.
  32676. * @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}.
  32677. * @param [options.translucent = true] - When <code>true</code>, the geometry is expected to appear translucent so {@link MaterialAppearance#renderState} has alpha blending enabled.
  32678. * @param [options.closed = false] - When <code>true</code>, the geometry is expected to be closed so {@link MaterialAppearance#renderState} has backface culling enabled.
  32679. * @param [options.materialSupport = MaterialAppearance.MaterialSupport.TEXTURED] - The type of materials that will be supported.
  32680. * @param [options.material = Material.ColorType] - The material used to determine the fragment color.
  32681. * @param [options.vertexShaderSource] - Optional GLSL vertex shader source to override the default vertex shader.
  32682. * @param [options.fragmentShaderSource] - Optional GLSL fragment shader source to override the default fragment shader.
  32683. * @param [options.renderState] - Optional render state to override the default render state.
  32684. */
  32685. export class MaterialAppearance {
  32686. constructor(options?: {
  32687. flat?: boolean;
  32688. faceForward?: boolean;
  32689. translucent?: boolean;
  32690. closed?: boolean;
  32691. materialSupport?: MaterialAppearance.MaterialSupportType;
  32692. material?: Material;
  32693. vertexShaderSource?: string;
  32694. fragmentShaderSource?: string;
  32695. renderState?: any;
  32696. });
  32697. /**
  32698. * The material used to determine the fragment color. Unlike other {@link MaterialAppearance}
  32699. properties, this is not read-only, so an appearance's material can change on the fly.
  32700. */
  32701. material: Material;
  32702. /**
  32703. * When <code>true</code>, the geometry is expected to appear translucent.
  32704. */
  32705. translucent: boolean;
  32706. /**
  32707. * The GLSL source code for the vertex shader.
  32708. */
  32709. readonly vertexShaderSource: string;
  32710. /**
  32711. * The GLSL source code for the fragment shader. The full fragment shader
  32712. source is built procedurally taking into account {@link MaterialAppearance#material},
  32713. {@link MaterialAppearance#flat}, and {@link MaterialAppearance#faceForward}.
  32714. Use {@link MaterialAppearance#getFragmentShaderSource} to get the full source.
  32715. */
  32716. readonly fragmentShaderSource: string;
  32717. /**
  32718. * The WebGL fixed-function state to use when rendering the geometry.
  32719. <p>
  32720. The render state can be explicitly defined when constructing a {@link MaterialAppearance}
  32721. instance, or it is set implicitly via {@link MaterialAppearance#translucent}
  32722. and {@link MaterialAppearance#closed}.
  32723. </p>
  32724. */
  32725. readonly renderState: any;
  32726. /**
  32727. * When <code>true</code>, the geometry is expected to be closed so
  32728. {@link MaterialAppearance#renderState} has backface culling enabled.
  32729. If the viewer enters the geometry, it will not be visible.
  32730. */
  32731. readonly closed: boolean;
  32732. /**
  32733. * The type of materials supported by this instance. This impacts the required
  32734. {@link VertexFormat} and the complexity of the vertex and fragment shaders.
  32735. */
  32736. readonly materialSupport: MaterialAppearance.MaterialSupportType;
  32737. /**
  32738. * The {@link VertexFormat} that this appearance instance is compatible with.
  32739. A geometry can have more vertex attributes and still be compatible - at a
  32740. potential performance cost - but it can't have less.
  32741. */
  32742. readonly vertexFormat: VertexFormat;
  32743. /**
  32744. * When <code>true</code>, flat shading is used in the fragment shader,
  32745. which means lighting is not taking into account.
  32746. */
  32747. readonly flat: boolean;
  32748. /**
  32749. * When <code>true</code>, the fragment shader flips the surface normal
  32750. as needed to ensure that the normal faces the viewer to avoid
  32751. dark spots. This is useful when both sides of a geometry should be
  32752. shaded like {@link WallGeometry}.
  32753. */
  32754. readonly faceForward: boolean;
  32755. /**
  32756. * Procedurally creates the full GLSL fragment shader source. For {@link MaterialAppearance},
  32757. this is derived from {@link MaterialAppearance#fragmentShaderSource}, {@link MaterialAppearance#material},
  32758. {@link MaterialAppearance#flat}, and {@link MaterialAppearance#faceForward}.
  32759. * @returns The full GLSL fragment shader source.
  32760. */
  32761. getFragmentShaderSource(): string;
  32762. /**
  32763. * Determines if the geometry is translucent based on {@link MaterialAppearance#translucent} and {@link Material#isTranslucent}.
  32764. * @returns <code>true</code> if the appearance is translucent.
  32765. */
  32766. isTranslucent(): boolean;
  32767. /**
  32768. * Creates a render state. This is not the final render state instance; instead,
  32769. it can contain a subset of render state properties identical to the render state
  32770. created in the context.
  32771. * @returns The render state.
  32772. */
  32773. getRenderState(): any;
  32774. }
  32775. export namespace MaterialAppearance {
  32776. type MaterialSupportType = {
  32777. vertexFormat: VertexFormat;
  32778. vertexShaderSource: string;
  32779. fragmentShaderSource: string;
  32780. };
  32781. /**
  32782. * Determines the type of {@link Material} that is supported by a
  32783. {@link MaterialAppearance} instance. This is a trade-off between
  32784. flexibility (a wide array of materials) and memory/performance
  32785. (required vertex format and GLSL shader complexity.
  32786. */
  32787. namespace MaterialSupport {
  32788. /**
  32789. * Only basic materials, which require just <code>position</code> and
  32790. <code>normal</code> vertex attributes, are supported.
  32791. */
  32792. const BASIC: MaterialAppearance.MaterialSupportType;
  32793. /**
  32794. * Materials with textures, which require <code>position</code>,
  32795. <code>normal</code>, and <code>st</code> vertex attributes,
  32796. are supported. The vast majority of materials fall into this category.
  32797. */
  32798. const TEXTURED: MaterialAppearance.MaterialSupportType;
  32799. /**
  32800. * All materials, including those that work in tangent space, are supported.
  32801. This requires <code>position</code>, <code>normal</code>, <code>st</code>,
  32802. <code>tangent</code>, and <code>bitangent</code> vertex attributes.
  32803. */
  32804. const ALL: MaterialAppearance.MaterialSupportType;
  32805. }
  32806. }
  32807. /**
  32808. * A 3D model based on glTF, the runtime asset format for WebGL, OpenGL ES, and OpenGL.
  32809. <p>
  32810. Cesium includes support for geometry and materials, glTF animations, and glTF skinning.
  32811. In addition, individual glTF nodes are pickable with {@link Scene#pick} and animatable
  32812. with {@link Model#getNode}. glTF cameras and lights are not currently supported.
  32813. </p>
  32814. <p>
  32815. An external glTF asset is created with {@link Model.fromGltf}. glTF JSON can also be
  32816. created at runtime and passed to this constructor function. In either case, the
  32817. {@link Model#readyPromise} is resolved when the model is ready to render, i.e.,
  32818. when the external binary, image, and shader files are downloaded and the WebGL
  32819. resources are created.
  32820. </p>
  32821. <p>
  32822. Cesium supports glTF assets with the following extensions:
  32823. <ul>
  32824. <li>
  32825. {@link https://github.com/KhronosGroup/glTF/blob/master/extensions/1.0/Khronos/KHR_binary_glTF/README.md|KHR_binary_glTF (glTF 1.0)}
  32826. </li><li>
  32827. {@link https://github.com/KhronosGroup/glTF/blob/master/extensions/1.0/Khronos/KHR_materials_common/README.md|KHR_materials_common (glTF 1.0)}
  32828. </li><li>
  32829. {@link https://github.com/KhronosGroup/glTF/blob/master/extensions/1.0/Vendor/WEB3D_quantized_attributes/README.md|WEB3D_quantized_attributes (glTF 1.0)}
  32830. </li><li>
  32831. {@link https://github.com/KhronosGroup/glTF/tree/master/extensions/2.0/Vendor/AGI_articulations/README.md|AGI_articulations}
  32832. </li><li>
  32833. {@link https://github.com/KhronosGroup/glTF/pull/1302|KHR_blend (draft)}
  32834. </li><li>
  32835. {@link https://github.com/KhronosGroup/glTF/blob/master/extensions/2.0/Khronos/KHR_draco_mesh_compression/README.md|KHR_draco_mesh_compression}
  32836. </li><li>
  32837. {@link https://github.com/KhronosGroup/glTF/tree/master/extensions/2.0/Khronos/KHR_materials_pbrSpecularGlossiness/README.md|KHR_materials_pbrSpecularGlossiness}
  32838. </li><li>
  32839. {@link https://github.com/KhronosGroup/glTF/tree/master/extensions/2.0/Khronos/KHR_materials_unlit/README.md|KHR_materials_unlit}
  32840. </li><li>
  32841. {@link https://github.com/KhronosGroup/glTF/blob/master/extensions/2.0/Khronos/KHR_techniques_webgl/README.md|KHR_techniques_webgl}
  32842. </li><li>
  32843. {@link https://github.com/KhronosGroup/glTF/blob/master/extensions/2.0/Khronos/KHR_texture_transform/README.md|KHR_texture_transform}
  32844. </li>
  32845. </ul>
  32846. </p>
  32847. <p>
  32848. 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
  32849. CESIUM_RTC_MODELVIEW parameter semantic that says the node is in WGS84 coordinates translated
  32850. relative to a local origin.
  32851. </p>
  32852. * @param [options] - Object with the following properties:
  32853. * @param [options.gltf] - A glTF JSON object, or a binary glTF buffer.
  32854. * @param [options.basePath = ''] - The base path that paths in the glTF JSON are relative to.
  32855. * @param [options.show = true] - Determines if the model primitive will be shown.
  32856. * @param [options.modelMatrix = Matrix4.IDENTITY] - The 4x4 transformation matrix that transforms the model from model to world coordinates.
  32857. * @param [options.scale = 1.0] - A uniform scale applied to this model.
  32858. * @param [options.minimumPixelSize = 0.0] - The approximate minimum pixel size of the model regardless of zoom.
  32859. * @param [options.maximumScale] - The maximum scale size of a model. An upper limit for minimumPixelSize.
  32860. * @param [options.id] - A user-defined object to return when the model is picked with {@link Scene#pick}.
  32861. * @param [options.allowPicking = true] - When <code>true</code>, each glTF mesh and primitive is pickable with {@link Scene#pick}.
  32862. * @param [options.incrementallyLoadTextures = true] - Determine if textures may continue to stream in after the model is loaded.
  32863. * @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.
  32864. * @param [options.clampAnimations = true] - Determines if the model's animations should hold a pose over frames where no keyframes are specified.
  32865. * @param [options.shadows = ShadowMode.ENABLED] - Determines whether the model casts or receives shadows from light sources.
  32866. * @param [options.debugShowBoundingVolume = false] - For debugging only. Draws the bounding sphere for each draw command in the model.
  32867. * @param [options.debugWireframe = false] - For debugging only. Draws the model in wireframe.
  32868. * @param [options.heightReference = HeightReference.NONE] - Determines how the model is drawn relative to terrain.
  32869. * @param [options.scene] - Must be passed in for models that use the height reference property.
  32870. * @param [options.distanceDisplayCondition] - The condition specifying at what distance from the camera that this model will be displayed.
  32871. * @param [options.color = Color.WHITE] - A color that blends with the model's rendered color.
  32872. * @param [options.colorBlendMode = ColorBlendMode.HIGHLIGHT] - Defines how the color blends with the model.
  32873. * @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.
  32874. * @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.
  32875. * @param [options.silhouetteSize = 0.0] - The size of the silhouette in pixels.
  32876. * @param [options.clippingPlanes] - The {@link ClippingPlaneCollection} used to selectively disable rendering the model.
  32877. * @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.
  32878. * @param [options.imageBasedLightingFactor = Cartesian2(1.0, 1.0)] - Scales diffuse and specular image-based lighting from the earth, sky, atmosphere and star skybox.
  32879. * @param [options.lightColor] - The light color when shading the model. When <code>undefined</code> the scene's light color is used instead.
  32880. * @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.
  32881. * @param [options.sphericalHarmonicCoefficients] - The third order spherical harmonic coefficients used for the diffuse color of image-based lighting.
  32882. * @param [options.specularEnvironmentMaps] - A URL to a KTX file that contains a cube map of the specular lighting and the convoluted specular mipmaps.
  32883. * @param [options.credit] - A credit for the data source, which is displayed on the canvas.
  32884. * @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.
  32885. */
  32886. export class Model {
  32887. constructor(options?: {
  32888. gltf?: any | ArrayBuffer | Uint8Array;
  32889. basePath?: Resource | string;
  32890. show?: boolean;
  32891. modelMatrix?: Matrix4;
  32892. scale?: number;
  32893. minimumPixelSize?: number;
  32894. maximumScale?: number;
  32895. id?: any;
  32896. allowPicking?: boolean;
  32897. incrementallyLoadTextures?: boolean;
  32898. asynchronous?: boolean;
  32899. clampAnimations?: boolean;
  32900. shadows?: ShadowMode;
  32901. debugShowBoundingVolume?: boolean;
  32902. debugWireframe?: boolean;
  32903. heightReference?: HeightReference;
  32904. scene?: Scene;
  32905. distanceDisplayCondition?: DistanceDisplayCondition;
  32906. color?: Color;
  32907. colorBlendMode?: ColorBlendMode;
  32908. colorBlendAmount?: number;
  32909. silhouetteColor?: Color;
  32910. silhouetteSize?: number;
  32911. clippingPlanes?: ClippingPlaneCollection;
  32912. dequantizeInShader?: boolean;
  32913. imageBasedLightingFactor?: Cartesian2;
  32914. lightColor?: Cartesian3;
  32915. luminanceAtZenith?: number;
  32916. sphericalHarmonicCoefficients?: Cartesian3[];
  32917. specularEnvironmentMaps?: string;
  32918. credit?: Credit | string;
  32919. backFaceCulling?: boolean;
  32920. });
  32921. /**
  32922. * Determines if the model primitive will be shown.
  32923. */
  32924. show: boolean;
  32925. /**
  32926. * The silhouette color.
  32927. */
  32928. silhouetteColor: Color;
  32929. /**
  32930. * The size of the silhouette in pixels.
  32931. */
  32932. silhouetteSize: number;
  32933. /**
  32934. * The 4x4 transformation matrix that transforms the model from model to world coordinates.
  32935. When this is the identity matrix, the model is drawn in world coordinates, i.e., Earth's WGS84 coordinates.
  32936. Local reference frames can be used by providing a different transformation matrix, like that returned
  32937. by {@link Transforms.eastNorthUpToFixedFrame}.
  32938. * @example
  32939. * var origin = Cesium.Cartesian3.fromDegrees(-95.0, 40.0, 200000.0);
  32940. m.modelMatrix = Cesium.Transforms.eastNorthUpToFixedFrame(origin);
  32941. */
  32942. modelMatrix: Matrix4;
  32943. /**
  32944. * A uniform scale applied to this model before the {@link Model#modelMatrix}.
  32945. Values greater than <code>1.0</code> increase the size of the model; values
  32946. less than <code>1.0</code> decrease.
  32947. */
  32948. scale: number;
  32949. /**
  32950. * The approximate minimum pixel size of the model regardless of zoom.
  32951. This can be used to ensure that a model is visible even when the viewer
  32952. zooms out. When <code>0.0</code>, no minimum size is enforced.
  32953. */
  32954. minimumPixelSize: number;
  32955. /**
  32956. * The maximum scale size for a model. This can be used to give
  32957. an upper limit to the {@link Model#minimumPixelSize}, ensuring that the model
  32958. is never an unreasonable scale.
  32959. */
  32960. maximumScale: number;
  32961. /**
  32962. * User-defined object returned when the model is picked.
  32963. */
  32964. id: any;
  32965. /**
  32966. * Returns the height reference of the model
  32967. */
  32968. heightReference: HeightReference;
  32969. /**
  32970. * The currently playing glTF animations.
  32971. */
  32972. activeAnimations: ModelAnimationCollection;
  32973. /**
  32974. * Determines if the model's animations should hold a pose over frames where no keyframes are specified.
  32975. */
  32976. clampAnimations: boolean;
  32977. /**
  32978. * Determines whether the model casts or receives shadows from light sources.
  32979. */
  32980. shadows: ShadowMode;
  32981. /**
  32982. * A color that blends with the model's rendered color.
  32983. */
  32984. color: Color;
  32985. /**
  32986. * Defines how the color blends with the model.
  32987. */
  32988. colorBlendMode: ColorBlendMode;
  32989. /**
  32990. * Value used to determine the color strength when the <code>colorBlendMode</code> is <code>MIX</code>.
  32991. A value of 0.0 results in the model's rendered color while a value of 1.0 results in a solid color, with
  32992. any value in-between resulting in a mix of the two.
  32993. */
  32994. colorBlendAmount: number;
  32995. /**
  32996. * Whether to cull back-facing geometry. When true, back face culling is
  32997. determined by the material's doubleSided property; when false, back face
  32998. culling is disabled. Back faces are not culled if {@link Model#color} is
  32999. translucent or {@link Model#silhouetteSize} is greater than 0.0.
  33000. */
  33001. backFaceCulling: boolean;
  33002. /**
  33003. * This property is for debugging only; it is not for production use nor is it optimized.
  33004. <p>
  33005. Draws the bounding sphere for each draw command in the model. A glTF primitive corresponds
  33006. to one draw command. A glTF mesh has an array of primitives, often of length one.
  33007. </p>
  33008. */
  33009. debugShowBoundingVolume: boolean;
  33010. /**
  33011. * This property is for debugging only; it is not for production use nor is it optimized.
  33012. <p>
  33013. Draws the model in wireframe.
  33014. </p>
  33015. */
  33016. debugWireframe: boolean;
  33017. /**
  33018. * The object for the glTF JSON, including properties with default values omitted
  33019. from the JSON provided to this model.
  33020. */
  33021. readonly gltf: any;
  33022. /**
  33023. * The base path that paths in the glTF JSON are relative to. The base
  33024. path is the same path as the path containing the .gltf file
  33025. minus the .gltf file, when binary, image, and shader files are
  33026. in the same directory as the .gltf. When this is <code>''</code>,
  33027. the app's base path is used.
  33028. */
  33029. readonly basePath: string;
  33030. /**
  33031. * The model's bounding sphere in its local coordinate system. This does not take into
  33032. account glTF animations and skins nor does it take into account {@link Model#minimumPixelSize}.
  33033. * @example
  33034. * // Center in WGS84 coordinates
  33035. var center = Cesium.Matrix4.multiplyByPoint(model.modelMatrix, model.boundingSphere.center, new Cesium.Cartesian3());
  33036. */
  33037. readonly boundingSphere: BoundingSphere;
  33038. /**
  33039. * When <code>true</code>, this model is ready to render, i.e., the external binary, image,
  33040. and shader files were downloaded and the WebGL resources were created. This is set to
  33041. <code>true</code> right before {@link Model#readyPromise} is resolved.
  33042. */
  33043. readonly ready: boolean;
  33044. /**
  33045. * Gets the promise that will be resolved when this model is ready to render, i.e., when the external binary, image,
  33046. and shader files were downloaded and the WebGL resources were created.
  33047. <p>
  33048. This promise is resolved at the end of the frame before the first frame the model is rendered in.
  33049. </p>
  33050. * @example
  33051. * // Play all animations at half-speed when the model is ready to render
  33052. Cesium.when(model.readyPromise).then(function(model) {
  33053. model.activeAnimations.addAll({
  33054. multiplier : 0.5
  33055. });
  33056. }).otherwise(function(error){
  33057. window.alert(error);
  33058. });
  33059. */
  33060. readonly readyPromise: Promise<Model>;
  33061. /**
  33062. * Determines if model WebGL resource creation will be spread out over several frames or
  33063. block until completion once all glTF files are loaded.
  33064. */
  33065. readonly asynchronous: boolean;
  33066. /**
  33067. * When <code>true</code>, each glTF mesh and primitive is pickable with {@link Scene#pick}. When <code>false</code>, GPU memory is saved.
  33068. */
  33069. readonly allowPicking: boolean;
  33070. /**
  33071. * Determine if textures may continue to stream in after the model is loaded.
  33072. */
  33073. readonly incrementallyLoadTextures: boolean;
  33074. /**
  33075. * Return the number of pending texture loads.
  33076. */
  33077. readonly pendingTextureLoads: number;
  33078. /**
  33079. * Gets or sets the condition specifying at what distance from the camera that this model will be displayed.
  33080. */
  33081. distanceDisplayCondition: DistanceDisplayCondition;
  33082. /**
  33083. * The {@link ClippingPlaneCollection} used to selectively disable rendering the model.
  33084. */
  33085. clippingPlanes: ClippingPlaneCollection;
  33086. /**
  33087. * Cesium adds lighting from the earth, sky, atmosphere, and star skybox. This cartesian is used to scale the final
  33088. diffuse and specular lighting contribution from those sources to the final color. A value of 0.0 will disable those light sources.
  33089. */
  33090. imageBasedLightingFactor: Cartesian2;
  33091. /**
  33092. * The light color when shading the model. When <code>undefined</code> the scene's light color is used instead.
  33093. <p>
  33094. For example, disabling additional light sources by setting <code>model.imageBasedLightingFactor = new Cesium.Cartesian2(0.0, 0.0)</code> will make the
  33095. model much darker. Here, increasing the intensity of the light source will make the model brighter.
  33096. </p>
  33097. */
  33098. lightColor: Cartesian3;
  33099. /**
  33100. * The sun's luminance at the zenith in kilo candela per meter squared to use for this model's procedural environment map.
  33101. This is used when {@link Model#specularEnvironmentMaps} and {@link Model#sphericalHarmonicCoefficients} are not defined.
  33102. */
  33103. luminanceAtZenith: number;
  33104. /**
  33105. * The third order spherical harmonic coefficients used for the diffuse color of image-based lighting. When <code>undefined</code>, a diffuse irradiance
  33106. computed from the atmosphere color is used.
  33107. <p>
  33108. There are nine <code>Cartesian3</code> coefficients.
  33109. 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>
  33110. </p>
  33111. These values can be obtained by preprocessing the environment map using the <code>cmgen</code> tool of
  33112. {@link https://github.com/google/filament/releases|Google's Filament project}. This will also generate a KTX file that can be
  33113. supplied to {@link Model#specularEnvironmentMaps}.
  33114. */
  33115. sphericalHarmonicCoefficients: Cartesian3[];
  33116. /**
  33117. * A URL to a KTX file that contains a cube map of the specular lighting and the convoluted specular mipmaps.
  33118. */
  33119. specularEnvironmentMaps: string;
  33120. /**
  33121. * Gets the credit that will be displayed for the model
  33122. */
  33123. credit: Credit;
  33124. /**
  33125. * Determines if silhouettes are supported.
  33126. * @param scene - The scene.
  33127. * @returns <code>true</code> if silhouettes are supported; otherwise, returns <code>false</code>
  33128. */
  33129. static silhouetteSupported(scene: Scene): boolean;
  33130. /**
  33131. * <p>
  33132. Creates a model from a glTF asset. When the model is ready to render, i.e., when the external binary, image,
  33133. and shader files are downloaded and the WebGL resources are created, the {@link Model#readyPromise} is resolved.
  33134. </p>
  33135. <p>
  33136. The model can be a traditional glTF asset with a .gltf extension or a Binary glTF using the .glb extension.
  33137. </p>
  33138. <p>
  33139. Cesium supports glTF assets with the following extensions:
  33140. <ul>
  33141. <li>
  33142. {@link https://github.com/KhronosGroup/glTF/blob/master/extensions/1.0/Khronos/KHR_binary_glTF/README.md|KHR_binary_glTF (glTF 1.0)}
  33143. </li><li>
  33144. {@link https://github.com/KhronosGroup/glTF/blob/master/extensions/1.0/Khronos/KHR_materials_common/README.md|KHR_materials_common (glTF 1.0)}
  33145. </li><li>
  33146. {@link https://github.com/KhronosGroup/glTF/blob/master/extensions/1.0/Vendor/WEB3D_quantized_attributes/README.md|WEB3D_quantized_attributes (glTF 1.0)}
  33147. </li><li>
  33148. {@link https://github.com/KhronosGroup/glTF/tree/master/extensions/2.0/Vendor/AGI_articulations/README.md|AGI_articulations}
  33149. </li><li>
  33150. {@link https://github.com/KhronosGroup/glTF/pull/1302|KHR_blend (draft)}
  33151. </li><li>
  33152. {@link https://github.com/KhronosGroup/glTF/blob/master/extensions/2.0/Khronos/KHR_draco_mesh_compression/README.md|KHR_draco_mesh_compression}
  33153. </li><li>
  33154. {@link https://github.com/KhronosGroup/glTF/tree/master/extensions/2.0/Khronos/KHR_materials_pbrSpecularGlossiness/README.md|KHR_materials_pbrSpecularGlossiness}
  33155. </li><li>
  33156. {@link https://github.com/KhronosGroup/glTF/tree/master/extensions/2.0/Khronos/KHR_materials_unlit/README.md|KHR_materials_unlit}
  33157. </li><li>
  33158. {@link https://github.com/KhronosGroup/glTF/blob/master/extensions/2.0/Khronos/KHR_techniques_webgl/README.md|KHR_techniques_webgl}
  33159. </li><li>
  33160. {@link https://github.com/KhronosGroup/glTF/blob/master/extensions/2.0/Khronos/KHR_texture_transform/README.md|KHR_texture_transform}
  33161. </li>
  33162. </ul>
  33163. </p>
  33164. <p>
  33165. 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
  33166. CESIUM_RTC_MODELVIEW parameter semantic that says the node is in WGS84 coordinates translated
  33167. relative to a local origin.
  33168. </p>
  33169. * @example
  33170. * // Example 1. Create a model from a glTF asset
  33171. var model = scene.primitives.add(Cesium.Model.fromGltf({
  33172. url : './duck/duck.gltf'
  33173. }));
  33174. * @example
  33175. * // Example 2. Create model and provide all properties and events
  33176. var origin = Cesium.Cartesian3.fromDegrees(-95.0, 40.0, 200000.0);
  33177. var modelMatrix = Cesium.Transforms.eastNorthUpToFixedFrame(origin);
  33178. var model = scene.primitives.add(Cesium.Model.fromGltf({
  33179. url : './duck/duck.gltf',
  33180. show : true, // default
  33181. modelMatrix : modelMatrix,
  33182. scale : 2.0, // double size
  33183. minimumPixelSize : 128, // never smaller than 128 pixels
  33184. maximumScale: 20000, // never larger than 20000 * model size (overrides minimumPixelSize)
  33185. allowPicking : false, // not pickable
  33186. debugShowBoundingVolume : false, // default
  33187. debugWireframe : false
  33188. }));
  33189. model.readyPromise.then(function(model) {
  33190. // Play all animations when the model is ready to render
  33191. model.activeAnimations.addAll();
  33192. });
  33193. * @param options - Object with the following properties:
  33194. * @param options.url - The url to the .gltf file.
  33195. * @param [options.basePath] - The base path that paths in the glTF JSON are relative to.
  33196. * @param [options.show = true] - Determines if the model primitive will be shown.
  33197. * @param [options.modelMatrix = Matrix4.IDENTITY] - The 4x4 transformation matrix that transforms the model from model to world coordinates.
  33198. * @param [options.scale = 1.0] - A uniform scale applied to this model.
  33199. * @param [options.minimumPixelSize = 0.0] - The approximate minimum pixel size of the model regardless of zoom.
  33200. * @param [options.maximumScale] - The maximum scale for the model.
  33201. * @param [options.id] - A user-defined object to return when the model is picked with {@link Scene#pick}.
  33202. * @param [options.allowPicking = true] - When <code>true</code>, each glTF mesh and primitive is pickable with {@link Scene#pick}.
  33203. * @param [options.incrementallyLoadTextures = true] - Determine if textures may continue to stream in after the model is loaded.
  33204. * @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.
  33205. * @param [options.clampAnimations = true] - Determines if the model's animations should hold a pose over frames where no keyframes are specified.
  33206. * @param [options.shadows = ShadowMode.ENABLED] - Determines whether the model casts or receives shadows from light sources.
  33207. * @param [options.debugShowBoundingVolume = false] - For debugging only. Draws the bounding sphere for each draw command in the model.
  33208. * @param [options.debugWireframe = false] - For debugging only. Draws the model in wireframe.
  33209. * @param [options.heightReference = HeightReference.NONE] - Determines how the model is drawn relative to terrain.
  33210. * @param [options.scene] - Must be passed in for models that use the height reference property.
  33211. * @param [options.distanceDisplayCondition] - The condition specifying at what distance from the camera that this model will be displayed.
  33212. * @param [options.color = Color.WHITE] - A color that blends with the model's rendered color.
  33213. * @param [options.colorBlendMode = ColorBlendMode.HIGHLIGHT] - Defines how the color blends with the model.
  33214. * @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.
  33215. * @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.
  33216. * @param [options.silhouetteSize = 0.0] - The size of the silhouette in pixels.
  33217. * @param [options.clippingPlanes] - The {@link ClippingPlaneCollection} used to selectively disable rendering the model.
  33218. * @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.
  33219. * @param [options.credit] - A credit for the model, which is displayed on the canvas.
  33220. * @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.
  33221. * @returns The newly created model.
  33222. */
  33223. static fromGltf(options: {
  33224. url: Resource | string;
  33225. basePath?: Resource | string;
  33226. show?: boolean;
  33227. modelMatrix?: Matrix4;
  33228. scale?: number;
  33229. minimumPixelSize?: number;
  33230. maximumScale?: number;
  33231. id?: any;
  33232. allowPicking?: boolean;
  33233. incrementallyLoadTextures?: boolean;
  33234. asynchronous?: boolean;
  33235. clampAnimations?: boolean;
  33236. shadows?: ShadowMode;
  33237. debugShowBoundingVolume?: boolean;
  33238. debugWireframe?: boolean;
  33239. heightReference?: HeightReference;
  33240. scene?: Scene;
  33241. distanceDisplayCondition?: DistanceDisplayCondition;
  33242. color?: Color;
  33243. colorBlendMode?: ColorBlendMode;
  33244. colorBlendAmount?: number;
  33245. silhouetteColor?: Color;
  33246. silhouetteSize?: number;
  33247. clippingPlanes?: ClippingPlaneCollection;
  33248. dequantizeInShader?: boolean;
  33249. credit?: Credit | string;
  33250. backFaceCulling?: boolean;
  33251. }): Model;
  33252. /**
  33253. * Returns the glTF node with the given <code>name</code> property. This is used to
  33254. modify a node's transform for animation outside of glTF animations.
  33255. * @example
  33256. * // Apply non-uniform scale to node LOD3sp
  33257. var node = model.getNode('LOD3sp');
  33258. node.matrix = Cesium.Matrix4.fromScale(new Cesium.Cartesian3(5.0, 1.0, 1.0), node.matrix);
  33259. * @param name - The glTF name of the node.
  33260. * @returns The node or <code>undefined</code> if no node with <code>name</code> exists.
  33261. */
  33262. getNode(name: string): ModelNode;
  33263. /**
  33264. * Returns the glTF mesh with the given <code>name</code> property.
  33265. * @param name - The glTF name of the mesh.
  33266. * @returns The mesh or <code>undefined</code> if no mesh with <code>name</code> exists.
  33267. */
  33268. getMesh(name: string): ModelMesh;
  33269. /**
  33270. * Returns the glTF material with the given <code>name</code> property.
  33271. * @param name - The glTF name of the material.
  33272. * @returns The material or <code>undefined</code> if no material with <code>name</code> exists.
  33273. */
  33274. getMaterial(name: string): ModelMaterial;
  33275. /**
  33276. * Sets the current value of an articulation stage. After setting one or multiple stage values, call
  33277. Model.applyArticulations() to cause the node matrices to be recalculated.
  33278. * @param articulationStageKey - The name of the articulation, a space, and the name of the stage.
  33279. * @param value - The numeric value of this stage of the articulation.
  33280. */
  33281. setArticulationStage(articulationStageKey: string, value: number): void;
  33282. /**
  33283. * Applies any modified articulation stages to the matrix of each node that participates
  33284. in any articulation. Note that this will overwrite any nodeTransformations on participating nodes.
  33285. */
  33286. applyArticulations(): void;
  33287. /**
  33288. * Called when {@link Viewer} or {@link CesiumWidget} render the scene to
  33289. get the draw commands needed to render this primitive.
  33290. <p>
  33291. Do not call this function directly. This is documented just to
  33292. list the exceptions that may be propagated when the scene is rendered:
  33293. </p>
  33294. */
  33295. update(): void;
  33296. /**
  33297. * Returns true if this object was destroyed; otherwise, false.
  33298. <br /><br />
  33299. If this object was destroyed, it should not be used; calling any function other than
  33300. <code>isDestroyed</code> will result in a {@link DeveloperError} exception.
  33301. * @returns <code>true</code> if this object was destroyed; otherwise, <code>false</code>.
  33302. */
  33303. isDestroyed(): boolean;
  33304. /**
  33305. * Destroys the WebGL resources held by this object. Destroying an object allows for deterministic
  33306. release of WebGL resources, instead of relying on the garbage collector to destroy this object.
  33307. <br /><br />
  33308. Once an object is destroyed, it should not be used; calling any function other than
  33309. <code>isDestroyed</code> will result in a {@link DeveloperError} exception. Therefore,
  33310. assign the return value (<code>undefined</code>) to the object as done in the example.
  33311. * @example
  33312. * model = model && model.destroy();
  33313. */
  33314. destroy(): void;
  33315. }
  33316. /**
  33317. * An active glTF animation. A glTF asset can contain animations. An active animation
  33318. is an animation that is currently playing or scheduled to be played because it was
  33319. added to a model's {@link ModelAnimationCollection}. An active animation is an
  33320. instance of an animation; for example, there can be multiple active animations
  33321. for the same glTF animation, each with a different start time.
  33322. <p>
  33323. Create this by calling {@link ModelAnimationCollection#add}.
  33324. </p>
  33325. */
  33326. export class ModelAnimation {
  33327. constructor();
  33328. /**
  33329. * When <code>true</code>, the animation is removed after it stops playing.
  33330. This is slightly more efficient that not removing it, but if, for example,
  33331. time is reversed, the animation is not played again.
  33332. */
  33333. removeOnStop: boolean;
  33334. /**
  33335. * The event fired when this animation is started. This can be used, for
  33336. example, to play a sound or start a particle system, when the animation starts.
  33337. <p>
  33338. This event is fired at the end of the frame after the scene is rendered.
  33339. </p>
  33340. * @example
  33341. * animation.start.addEventListener(function(model, animation) {
  33342. console.log('Animation started: ' + animation.name);
  33343. });
  33344. */
  33345. start: Event;
  33346. /**
  33347. * The event fired when on each frame when this animation is updated. The
  33348. current time of the animation, relative to the glTF animation time span, is
  33349. passed to the event, which allows, for example, starting new animations at a
  33350. specific time relative to a playing animation.
  33351. <p>
  33352. This event is fired at the end of the frame after the scene is rendered.
  33353. </p>
  33354. * @example
  33355. * animation.update.addEventListener(function(model, animation, time) {
  33356. console.log('Animation updated: ' + animation.name + '. glTF animation time: ' + time);
  33357. });
  33358. */
  33359. update: Event;
  33360. /**
  33361. * The event fired when this animation is stopped. This can be used, for
  33362. example, to play a sound or start a particle system, when the animation stops.
  33363. <p>
  33364. This event is fired at the end of the frame after the scene is rendered.
  33365. </p>
  33366. * @example
  33367. * animation.stop.addEventListener(function(model, animation) {
  33368. console.log('Animation stopped: ' + animation.name);
  33369. });
  33370. */
  33371. stop: Event;
  33372. /**
  33373. * The glTF animation name that identifies this animation.
  33374. */
  33375. readonly name: string;
  33376. /**
  33377. * The scene time to start playing this animation. When this is <code>undefined</code>,
  33378. the animation starts at the next frame.
  33379. */
  33380. readonly startTime: JulianDate;
  33381. /**
  33382. * The delay, in seconds, from {@link ModelAnimation#startTime} to start playing.
  33383. */
  33384. readonly delay: number;
  33385. /**
  33386. * The scene time to stop playing this animation. When this is <code>undefined</code>,
  33387. the animation is played for its full duration and perhaps repeated depending on
  33388. {@link ModelAnimation#loop}.
  33389. */
  33390. readonly stopTime: JulianDate;
  33391. /**
  33392. * Values greater than <code>1.0</code> increase the speed that the animation is played relative
  33393. to the scene clock speed; values less than <code>1.0</code> decrease the speed. A value of
  33394. <code>1.0</code> plays the animation at the speed in the glTF animation mapped to the scene
  33395. clock speed. For example, if the scene is played at 2x real-time, a two-second glTF animation
  33396. will play in one second even if <code>multiplier</code> is <code>1.0</code>.
  33397. */
  33398. readonly multiplier: number;
  33399. /**
  33400. * When <code>true</code>, the animation is played in reverse.
  33401. */
  33402. readonly reverse: boolean;
  33403. /**
  33404. * Determines if and how the animation is looped.
  33405. */
  33406. readonly loop: ModelAnimationLoop;
  33407. }
  33408. /**
  33409. * A collection of active model animations. Access this using {@link Model#activeAnimations}.
  33410. */
  33411. export class ModelAnimationCollection {
  33412. constructor();
  33413. /**
  33414. * The event fired when an animation is added to the collection. This can be used, for
  33415. example, to keep a UI in sync.
  33416. * @example
  33417. * model.activeAnimations.animationAdded.addEventListener(function(model, animation) {
  33418. console.log('Animation added: ' + animation.name);
  33419. });
  33420. */
  33421. animationAdded: Event;
  33422. /**
  33423. * The event fired when an animation is removed from the collection. This can be used, for
  33424. example, to keep a UI in sync.
  33425. * @example
  33426. * model.activeAnimations.animationRemoved.addEventListener(function(model, animation) {
  33427. console.log('Animation removed: ' + animation.name);
  33428. });
  33429. */
  33430. animationRemoved: Event;
  33431. /**
  33432. * The number of animations in the collection.
  33433. */
  33434. readonly length: number;
  33435. /**
  33436. * Creates and adds an animation with the specified initial properties to the collection.
  33437. <p>
  33438. This raises the {@link ModelAnimationCollection#animationAdded} event so, for example, a UI can stay in sync.
  33439. </p>
  33440. * @example
  33441. * // Example 1. Add an animation by name
  33442. model.activeAnimations.add({
  33443. name : 'animation name'
  33444. });
  33445. // Example 2. Add an animation by index
  33446. model.activeAnimations.add({
  33447. index : 0
  33448. });
  33449. * @example
  33450. * // Example 3. Add an animation and provide all properties and events
  33451. var startTime = Cesium.JulianDate.now();
  33452. var animation = model.activeAnimations.add({
  33453. name : 'another animation name',
  33454. startTime : startTime,
  33455. delay : 0.0, // Play at startTime (default)
  33456. stopTime : Cesium.JulianDate.addSeconds(startTime, 4.0, new Cesium.JulianDate()),
  33457. removeOnStop : false, // Do not remove when animation stops (default)
  33458. multiplier : 2.0, // Play at double speed
  33459. reverse : true, // Play in reverse
  33460. loop : Cesium.ModelAnimationLoop.REPEAT // Loop the animation
  33461. });
  33462. animation.start.addEventListener(function(model, animation) {
  33463. console.log('Animation started: ' + animation.name);
  33464. });
  33465. animation.update.addEventListener(function(model, animation, time) {
  33466. console.log('Animation updated: ' + animation.name + '. glTF animation time: ' + time);
  33467. });
  33468. animation.stop.addEventListener(function(model, animation) {
  33469. console.log('Animation stopped: ' + animation.name);
  33470. });
  33471. * @param options - Object with the following properties:
  33472. * @param [options.name] - The glTF animation name that identifies the animation. Must be defined if <code>options.index</code> is <code>undefined</code>.
  33473. * @param [options.index] - The glTF animation index that identifies the animation. Must be defined if <code>options.name</code> is <code>undefined</code>.
  33474. * @param [options.startTime] - The scene time to start playing the animation. When this is <code>undefined</code>, the animation starts at the next frame.
  33475. * @param [options.delay = 0.0] - The delay, in seconds, from <code>startTime</code> to start playing.
  33476. * @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.
  33477. * @param [options.removeOnStop = false] - When <code>true</code>, the animation is removed after it stops playing.
  33478. * @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.
  33479. * @param [options.reverse = false] - When <code>true</code>, the animation is played in reverse.
  33480. * @param [options.loop = ModelAnimationLoop.NONE] - Determines if and how the animation is looped.
  33481. * @returns The animation that was added to the collection.
  33482. */
  33483. add(options: {
  33484. name?: string;
  33485. index?: number;
  33486. startTime?: JulianDate;
  33487. delay?: number;
  33488. stopTime?: JulianDate;
  33489. removeOnStop?: boolean;
  33490. multiplier?: number;
  33491. reverse?: boolean;
  33492. loop?: ModelAnimationLoop;
  33493. }): ModelAnimation;
  33494. /**
  33495. * Creates and adds an animation with the specified initial properties to the collection
  33496. for each animation in the model.
  33497. <p>
  33498. This raises the {@link ModelAnimationCollection#animationAdded} event for each model so, for example, a UI can stay in sync.
  33499. </p>
  33500. * @example
  33501. * model.activeAnimations.addAll({
  33502. multiplier : 0.5, // Play at half-speed
  33503. loop : Cesium.ModelAnimationLoop.REPEAT // Loop the animations
  33504. });
  33505. * @param [options] - Object with the following properties:
  33506. * @param [options.startTime] - The scene time to start playing the animations. When this is <code>undefined</code>, the animations starts at the next frame.
  33507. * @param [options.delay = 0.0] - The delay, in seconds, from <code>startTime</code> to start playing.
  33508. * @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.
  33509. * @param [options.removeOnStop = false] - When <code>true</code>, the animations are removed after they stop playing.
  33510. * @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.
  33511. * @param [options.reverse = false] - When <code>true</code>, the animations are played in reverse.
  33512. * @param [options.loop = ModelAnimationLoop.NONE] - Determines if and how the animations are looped.
  33513. * @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.
  33514. */
  33515. addAll(options?: {
  33516. startTime?: JulianDate;
  33517. delay?: number;
  33518. stopTime?: JulianDate;
  33519. removeOnStop?: boolean;
  33520. multiplier?: number;
  33521. reverse?: boolean;
  33522. loop?: ModelAnimationLoop;
  33523. }): ModelAnimation[];
  33524. /**
  33525. * Removes an animation from the collection.
  33526. <p>
  33527. This raises the {@link ModelAnimationCollection#animationRemoved} event so, for example, a UI can stay in sync.
  33528. </p>
  33529. <p>
  33530. An animation can also be implicitly removed from the collection by setting {@link ModelAnimation#removeOnStop} to
  33531. <code>true</code>. The {@link ModelAnimationCollection#animationRemoved} event is still fired when the animation is removed.
  33532. </p>
  33533. * @example
  33534. * var a = model.activeAnimations.add({
  33535. name : 'animation name'
  33536. });
  33537. model.activeAnimations.remove(a); // Returns true
  33538. * @param animation - The animation to remove.
  33539. * @returns <code>true</code> if the animation was removed; <code>false</code> if the animation was not found in the collection.
  33540. */
  33541. remove(animation: ModelAnimation): boolean;
  33542. /**
  33543. * Removes all animations from the collection.
  33544. <p>
  33545. This raises the {@link ModelAnimationCollection#animationRemoved} event for each
  33546. animation so, for example, a UI can stay in sync.
  33547. </p>
  33548. */
  33549. removeAll(): void;
  33550. /**
  33551. * Determines whether this collection contains a given animation.
  33552. * @param animation - The animation to check for.
  33553. * @returns <code>true</code> if this collection contains the animation, <code>false</code> otherwise.
  33554. */
  33555. contains(animation: ModelAnimation): boolean;
  33556. /**
  33557. * Returns the animation in the collection at the specified index. Indices are zero-based
  33558. and increase as animations are added. Removing an animation shifts all animations after
  33559. it to the left, changing their indices. This function is commonly used to iterate over
  33560. all the animations in the collection.
  33561. * @example
  33562. * // Output the names of all the animations in the collection.
  33563. var animations = model.activeAnimations;
  33564. var length = animations.length;
  33565. for (var i = 0; i < length; ++i) {
  33566. console.log(animations.get(i).name);
  33567. }
  33568. * @param index - The zero-based index of the animation.
  33569. * @returns The animation at the specified index.
  33570. */
  33571. get(index: number): ModelAnimation;
  33572. }
  33573. /**
  33574. * Determines if and how a glTF animation is looped.
  33575. */
  33576. export enum ModelAnimationLoop {
  33577. /**
  33578. * Play the animation once; do not loop it.
  33579. */
  33580. NONE = 0,
  33581. /**
  33582. * Loop the animation playing it from the start immediately after it stops.
  33583. */
  33584. REPEAT = 1,
  33585. /**
  33586. * Loop the animation. First, playing it forward, then in reverse, then forward, and so on.
  33587. */
  33588. MIRRORED_REPEAT = 2
  33589. }
  33590. /**
  33591. * A model's material with modifiable parameters. A glTF material
  33592. contains parameters defined by the material's technique with values
  33593. defined by the technique and potentially overridden by the material.
  33594. This class allows changing these values at runtime.
  33595. <p>
  33596. Use {@link Model#getMaterial} to create an instance.
  33597. </p>
  33598. */
  33599. export class ModelMaterial {
  33600. constructor();
  33601. /**
  33602. * The value of the <code>name</code> property of this material.
  33603. */
  33604. readonly name: string;
  33605. /**
  33606. * The index of the material.
  33607. */
  33608. readonly id: string;
  33609. /**
  33610. * Assigns a value to a material parameter. The type for <code>value</code>
  33611. depends on the glTF type of the parameter. It will be a floating-point
  33612. number, Cartesian, or matrix.
  33613. * @example
  33614. * material.setValue('diffuse', new Cesium.Cartesian4(1.0, 0.0, 0.0, 1.0)); // vec4
  33615. material.setValue('shininess', 256.0); // scalar
  33616. * @param name - The name of the parameter.
  33617. * @param [value] - The value to assign to the parameter.
  33618. */
  33619. setValue(name: string, value?: any): void;
  33620. /**
  33621. * Returns the value of the parameter with the given <code>name</code>. The type of the
  33622. returned object depends on the glTF type of the parameter. It will be a floating-point
  33623. number, Cartesian, or matrix.
  33624. * @param name - The name of the parameter.
  33625. * @returns The value of the parameter or <code>undefined</code> if the parameter does not exist.
  33626. */
  33627. getValue(name: string): any;
  33628. }
  33629. /**
  33630. * A model's mesh and its materials.
  33631. <p>
  33632. Use {@link Model#getMesh} to create an instance.
  33633. </p>
  33634. */
  33635. export class ModelMesh {
  33636. constructor();
  33637. /**
  33638. * The value of the <code>name</code> property of this mesh.
  33639. */
  33640. readonly name: string;
  33641. /**
  33642. * The index of the mesh.
  33643. */
  33644. readonly id: string;
  33645. /**
  33646. * An array of {@link ModelMaterial} instances indexed by the mesh's
  33647. primitive indices.
  33648. */
  33649. readonly materials: ModelMaterial[];
  33650. }
  33651. /**
  33652. * A model node with a transform for user-defined animations. A glTF asset can
  33653. contain animations that target a node's transform. This class allows
  33654. changing a node's transform externally so animation can be driven by another
  33655. source, not just an animation in the glTF asset.
  33656. <p>
  33657. Use {@link Model#getNode} to create an instance.
  33658. </p>
  33659. * @example
  33660. * var node = model.getNode('LOD3sp');
  33661. node.matrix = Cesium.Matrix4.fromScale(new Cesium.Cartesian3(5.0, 1.0, 1.0), node.matrix);
  33662. */
  33663. export class ModelNode {
  33664. constructor();
  33665. /**
  33666. * The value of the <code>name</code> property of this node.
  33667. */
  33668. readonly name: string;
  33669. /**
  33670. * The index of the node.
  33671. */
  33672. readonly id: string;
  33673. /**
  33674. * Determines if this node and its children will be shown.
  33675. */
  33676. show: boolean;
  33677. /**
  33678. * The node's 4x4 matrix transform from its local coordinates to
  33679. its parent's.
  33680. <p>
  33681. For changes to take effect, this property must be assigned to;
  33682. setting individual elements of the matrix will not work.
  33683. </p>
  33684. */
  33685. matrix: Matrix4;
  33686. /**
  33687. * Gets the node's original 4x4 matrix transform from its local coordinates to
  33688. its parent's, without any node transformations or articulations applied.
  33689. */
  33690. originalMatrix: Matrix4;
  33691. }
  33692. /**
  33693. * Draws the Moon in 3D.
  33694. * @example
  33695. * scene.moon = new Cesium.Moon();
  33696. * @param [options] - Object with the following properties:
  33697. * @param [options.show = true] - Determines whether the moon will be rendered.
  33698. * @param [options.textureUrl = buildModuleUrl('Assets/Textures/moonSmall.jpg')] - The moon texture.
  33699. * @param [options.ellipsoid = Ellipsoid.MOON] - The moon ellipsoid.
  33700. * @param [options.onlySunLighting = true] - Use the sun as the only light source.
  33701. */
  33702. export class Moon {
  33703. constructor(options?: {
  33704. show?: boolean;
  33705. textureUrl?: string;
  33706. ellipsoid?: Ellipsoid;
  33707. onlySunLighting?: boolean;
  33708. });
  33709. /**
  33710. * Determines if the moon will be shown.
  33711. */
  33712. show: boolean;
  33713. /**
  33714. * The moon texture.
  33715. */
  33716. textureUrl: string;
  33717. /**
  33718. * Use the sun as the only light source.
  33719. */
  33720. onlySunLighting: boolean;
  33721. /**
  33722. * Get the ellipsoid that defines the shape of the moon.
  33723. */
  33724. readonly ellipsoid: Ellipsoid;
  33725. /**
  33726. * Returns true if this object was destroyed; otherwise, false.
  33727. <br /><br />
  33728. If this object was destroyed, it should not be used; calling any function other than
  33729. <code>isDestroyed</code> will result in a {@link DeveloperError} exception.
  33730. * @returns <code>true</code> if this object was destroyed; otherwise, <code>false</code>.
  33731. */
  33732. isDestroyed(): boolean;
  33733. /**
  33734. * Destroys the WebGL resources held by this object. Destroying an object allows for deterministic
  33735. release of WebGL resources, instead of relying on the garbage collector to destroy this object.
  33736. <br /><br />
  33737. Once an object is destroyed, it should not be used; calling any function other than
  33738. <code>isDestroyed</code> will result in a {@link DeveloperError} exception. Therefore,
  33739. assign the return value (<code>undefined</code>) to the object as done in the example.
  33740. * @example
  33741. * moon = moon && moon.destroy();
  33742. */
  33743. destroy(): void;
  33744. }
  33745. /**
  33746. * A {@link TileDiscardPolicy} specifying that tile images should never be discard.
  33747. */
  33748. export class NeverTileDiscardPolicy {
  33749. constructor();
  33750. /**
  33751. * Determines if the discard policy is ready to process images.
  33752. * @returns True if the discard policy is ready to process images; otherwise, false.
  33753. */
  33754. isReady(): boolean;
  33755. /**
  33756. * Given a tile image, decide whether to discard that image.
  33757. * @param image - An image to test.
  33758. * @returns True if the image should be discarded; otherwise, false.
  33759. */
  33760. shouldDiscardImage(image: HTMLImageElement): boolean;
  33761. }
  33762. export namespace OpenStreetMapImageryProvider {
  33763. /**
  33764. * Initialization options for the OpenStreetMapImageryProvider constructor
  33765. * @property [url = 'https://a.tile.openstreetmap.org'] - The OpenStreetMap server url.
  33766. * @property [fileExtension = 'png'] - The file extension for images on the server.
  33767. * @property [rectangle = Rectangle.MAX_VALUE] - The rectangle of the layer.
  33768. * @property [minimumLevel = 0] - The minimum level-of-detail supported by the imagery provider.
  33769. * @property [maximumLevel] - The maximum level-of-detail supported by the imagery provider, or undefined if there is no limit.
  33770. * @property [ellipsoid] - The ellipsoid. If not specified, the WGS84 ellipsoid is used.
  33771. * @property [credit = 'MapQuest, Open Street Map and contributors, CC-BY-SA'] - A credit for the data source, which is displayed on the canvas.
  33772. */
  33773. type ConstructorOptions = {
  33774. url?: string;
  33775. fileExtension?: string;
  33776. rectangle?: Rectangle;
  33777. minimumLevel?: number;
  33778. maximumLevel?: number;
  33779. ellipsoid?: Ellipsoid;
  33780. credit?: Credit | string;
  33781. };
  33782. }
  33783. /**
  33784. * An imagery provider that provides tiled imagery hosted by OpenStreetMap
  33785. or another provider of Slippy tiles. The default url connects to OpenStreetMap's volunteer-run
  33786. servers, so you must conform to their
  33787. {@link http://wiki.openstreetmap.org/wiki/Tile_usage_policy|Tile Usage Policy}.
  33788. * @example
  33789. * var osm = new Cesium.OpenStreetMapImageryProvider({
  33790. url : 'https://a.tile.openstreetmap.org/'
  33791. });
  33792. * @param options - Object describing initialization options
  33793. */
  33794. export class OpenStreetMapImageryProvider extends UrlTemplateImageryProvider {
  33795. constructor(options: OpenStreetMapImageryProvider.ConstructorOptions);
  33796. }
  33797. /**
  33798. * A particle emitted by a {@link ParticleSystem}.
  33799. * @param options - An object with the following properties:
  33800. * @param [options.mass = 1.0] - The mass of the particle in kilograms.
  33801. * @param [options.position = Cartesian3.ZERO] - The initial position of the particle in world coordinates.
  33802. * @param [options.velocity = Cartesian3.ZERO] - The velocity vector of the particle in world coordinates.
  33803. * @param [options.life = Number.MAX_VALUE] - The life of the particle in seconds.
  33804. * @param [options.image] - The URI, HTMLImageElement, or HTMLCanvasElement to use for the billboard.
  33805. * @param [options.startColor = Color.WHITE] - The color of a particle when it is born.
  33806. * @param [options.endColor = Color.WHITE] - The color of a particle when it dies.
  33807. * @param [options.startScale = 1.0] - The scale of the particle when it is born.
  33808. * @param [options.endScale = 1.0] - The scale of the particle when it dies.
  33809. * @param [options.imageSize = new Cartesian2(1.0, 1.0)] - The dimensions, width by height, to scale the particle image in pixels.
  33810. */
  33811. export class Particle {
  33812. constructor(options: {
  33813. mass?: number;
  33814. position?: Cartesian3;
  33815. velocity?: Cartesian3;
  33816. life?: number;
  33817. image?: any;
  33818. startColor?: Color;
  33819. endColor?: Color;
  33820. startScale?: number;
  33821. endScale?: number;
  33822. imageSize?: Cartesian2;
  33823. });
  33824. /**
  33825. * The mass of the particle in kilograms.
  33826. */
  33827. mass: number;
  33828. /**
  33829. * The positon of the particle in world coordinates.
  33830. */
  33831. position: Cartesian3;
  33832. /**
  33833. * The velocity of the particle in world coordinates.
  33834. */
  33835. velocity: Cartesian3;
  33836. /**
  33837. * The life of the particle in seconds.
  33838. */
  33839. life: number;
  33840. /**
  33841. * The image to use for the particle.
  33842. */
  33843. image: any;
  33844. /**
  33845. * The color of the particle when it is born.
  33846. */
  33847. startColor: Color;
  33848. /**
  33849. * The color of the particle when it dies.
  33850. */
  33851. endColor: Color;
  33852. /**
  33853. * the scale of the particle when it is born.
  33854. */
  33855. startScale: number;
  33856. /**
  33857. * The scale of the particle when it dies.
  33858. */
  33859. endScale: number;
  33860. /**
  33861. * The dimensions, width by height, to scale the particle image in pixels.
  33862. */
  33863. imageSize: Cartesian2;
  33864. /**
  33865. * Gets the age of the particle in seconds.
  33866. */
  33867. age: number;
  33868. /**
  33869. * Gets the age normalized to a value in the range [0.0, 1.0].
  33870. */
  33871. normalizedAge: number;
  33872. }
  33873. /**
  33874. * Represents a burst of {@link Particle}s from a {@link ParticleSystem} at a given time in the systems lifetime.
  33875. * @param [options] - An object with the following properties:
  33876. * @param [options.time = 0.0] - The time in seconds after the beginning of the particle system's lifetime that the burst will occur.
  33877. * @param [options.minimum = 0.0] - The minimum number of particles emmitted in the burst.
  33878. * @param [options.maximum = 50.0] - The maximum number of particles emitted in the burst.
  33879. */
  33880. export class ParticleBurst {
  33881. constructor(options?: {
  33882. time?: number;
  33883. minimum?: number;
  33884. maximum?: number;
  33885. });
  33886. /**
  33887. * The time in seconds after the beginning of the particle system's lifetime that the burst will occur.
  33888. */
  33889. time: number;
  33890. /**
  33891. * The minimum number of particles emitted.
  33892. */
  33893. minimum: number;
  33894. /**
  33895. * The maximum number of particles emitted.
  33896. */
  33897. maximum: number;
  33898. /**
  33899. * <code>true</code> if the burst has been completed; <code>false</code> otherwise.
  33900. */
  33901. complete: boolean;
  33902. }
  33903. /**
  33904. * <p>
  33905. An object that initializes a {@link Particle} from a {@link ParticleSystem}.
  33906. </p>
  33907. <p>
  33908. This type describes an interface and is not intended to be instantiated directly.
  33909. </p>
  33910. */
  33911. export class ParticleEmitter {
  33912. constructor();
  33913. }
  33914. /**
  33915. * A ParticleSystem manages the updating and display of a collection of particles.
  33916. * @param [options] - Object with the following properties:
  33917. * @param [options.show = true] - Whether to display the particle system.
  33918. * @param [options.updateCallback] - The callback function to be called each frame to update a particle.
  33919. * @param [options.emitter = new CircleEmitter(0.5)] - The particle emitter for this system.
  33920. * @param [options.modelMatrix = Matrix4.IDENTITY] - The 4x4 transformation matrix that transforms the particle system from model to world coordinates.
  33921. * @param [options.emitterModelMatrix = Matrix4.IDENTITY] - The 4x4 transformation matrix that transforms the particle system emitter within the particle systems local coordinate system.
  33922. * @param [options.emissionRate = 5] - The number of particles to emit per second.
  33923. * @param [options.bursts] - An array of {@link ParticleBurst}, emitting bursts of particles at periodic times.
  33924. * @param [options.loop = true] - Whether the particle system should loop its bursts when it is complete.
  33925. * @param [options.scale = 1.0] - Sets the scale to apply to the image of the particle for the duration of its particleLife.
  33926. * @param [options.startScale] - The initial scale to apply to the image of the particle at the beginning of its life.
  33927. * @param [options.endScale] - The final scale to apply to the image of the particle at the end of its life.
  33928. * @param [options.color = Color.WHITE] - Sets the color of a particle for the duration of its particleLife.
  33929. * @param [options.startColor] - The color of the particle at the beginning of its life.
  33930. * @param [options.endColor] - The color of the particle at the end of its life.
  33931. * @param [options.image] - The URI, HTMLImageElement, or HTMLCanvasElement to use for the billboard.
  33932. * @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.
  33933. * @param [options.minimumImageSize] - Sets the minimum bound, width by height, above which to randomly scale the particle image's dimensions in pixels.
  33934. * @param [options.maximumImageSize] - Sets the maximum bound, width by height, below which to randomly scale the particle image's dimensions in pixels.
  33935. * @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.
  33936. * @param [options.speed = 1.0] - If set, overrides the minimumSpeed and maximumSpeed inputs with this value.
  33937. * @param [options.minimumSpeed] - Sets the minimum bound in meters per second above which a particle's actual speed will be randomly chosen.
  33938. * @param [options.maximumSpeed] - Sets the maximum bound in meters per second below which a particle's actual speed will be randomly chosen.
  33939. * @param [options.lifetime = Number.MAX_VALUE] - How long the particle system will emit particles, in seconds.
  33940. * @param [options.particleLife = 5.0] - If set, overrides the minimumParticleLife and maximumParticleLife inputs with this value.
  33941. * @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.
  33942. * @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.
  33943. * @param [options.mass = 1.0] - Sets the minimum and maximum mass of particles in kilograms.
  33944. * @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.
  33945. * @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.
  33946. */
  33947. export class ParticleSystem {
  33948. constructor(options?: {
  33949. show?: boolean;
  33950. updateCallback?: ParticleSystem.updateCallback;
  33951. emitter?: ParticleEmitter;
  33952. modelMatrix?: Matrix4;
  33953. emitterModelMatrix?: Matrix4;
  33954. emissionRate?: number;
  33955. bursts?: ParticleBurst[];
  33956. loop?: boolean;
  33957. scale?: number;
  33958. startScale?: number;
  33959. endScale?: number;
  33960. color?: Color;
  33961. startColor?: Color;
  33962. endColor?: Color;
  33963. image?: any;
  33964. imageSize?: Cartesian2;
  33965. minimumImageSize?: Cartesian2;
  33966. maximumImageSize?: Cartesian2;
  33967. sizeInMeters?: boolean;
  33968. speed?: number;
  33969. minimumSpeed?: number;
  33970. maximumSpeed?: number;
  33971. lifetime?: number;
  33972. particleLife?: number;
  33973. minimumParticleLife?: number;
  33974. maximumParticleLife?: number;
  33975. mass?: number;
  33976. minimumMass?: number;
  33977. maximumMass?: number;
  33978. });
  33979. /**
  33980. * Whether to display the particle system.
  33981. */
  33982. show: boolean;
  33983. /**
  33984. * An array of force callbacks. The callback is passed a {@link Particle} and the difference from the last time
  33985. */
  33986. updateCallback: ParticleSystem.updateCallback;
  33987. /**
  33988. * Whether the particle system should loop it's bursts when it is complete.
  33989. */
  33990. loop: boolean;
  33991. /**
  33992. * The URI, HTMLImageElement, or HTMLCanvasElement to use for the billboard.
  33993. */
  33994. image: any;
  33995. /**
  33996. * The particle emitter for this
  33997. */
  33998. emitter: ParticleEmitter;
  33999. /**
  34000. * An array of {@link ParticleBurst}, emitting bursts of particles at periodic times.
  34001. */
  34002. bursts: ParticleBurst[];
  34003. /**
  34004. * The 4x4 transformation matrix that transforms the particle system from model to world coordinates.
  34005. */
  34006. modelMatrix: Matrix4;
  34007. /**
  34008. * The 4x4 transformation matrix that transforms the particle system emitter within the particle systems local coordinate system.
  34009. */
  34010. emitterModelMatrix: Matrix4;
  34011. /**
  34012. * The color of the particle at the beginning of its life.
  34013. */
  34014. startColor: Color;
  34015. /**
  34016. * The color of the particle at the end of its life.
  34017. */
  34018. endColor: Color;
  34019. /**
  34020. * The initial scale to apply to the image of the particle at the beginning of its life.
  34021. */
  34022. startScale: number;
  34023. /**
  34024. * The final scale to apply to the image of the particle at the end of its life.
  34025. */
  34026. endScale: number;
  34027. /**
  34028. * The number of particles to emit per second.
  34029. */
  34030. emissionRate: number;
  34031. /**
  34032. * Sets the minimum bound in meters per second above which a particle's actual speed will be randomly chosen.
  34033. */
  34034. minimumSpeed: number;
  34035. /**
  34036. * Sets the maximum bound in meters per second below which a particle's actual speed will be randomly chosen.
  34037. */
  34038. maximumSpeed: number;
  34039. /**
  34040. * 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.
  34041. */
  34042. minimumParticleLife: number;
  34043. /**
  34044. * 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.
  34045. */
  34046. maximumParticleLife: number;
  34047. /**
  34048. * Sets the minimum mass of particles in kilograms.
  34049. */
  34050. minimumMass: number;
  34051. /**
  34052. * Sets the maximum mass of particles in kilograms.
  34053. */
  34054. maximumMass: number;
  34055. /**
  34056. * Sets the minimum bound, width by height, above which to randomly scale the particle image's dimensions in pixels.
  34057. */
  34058. minimumImageSize: Cartesian2;
  34059. /**
  34060. * Sets the maximum bound, width by height, below which to randomly scale the particle image's dimensions in pixels.
  34061. */
  34062. maximumImageSize: Cartesian2;
  34063. /**
  34064. * 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.
  34065. */
  34066. sizeInMeters: boolean;
  34067. /**
  34068. * How long the particle system will emit particles, in seconds.
  34069. */
  34070. lifetime: number;
  34071. /**
  34072. * Fires an event when the particle system has reached the end of its lifetime.
  34073. */
  34074. complete: Event;
  34075. /**
  34076. * When <code>true</code>, the particle system has reached the end of its lifetime; <code>false</code> otherwise.
  34077. */
  34078. isComplete: boolean;
  34079. /**
  34080. * Returns true if this object was destroyed; otherwise, false.
  34081. <br /><br />
  34082. If this object was destroyed, it should not be used; calling any function other than
  34083. <code>isDestroyed</code> will result in a {@link DeveloperError} exception.
  34084. * @returns <code>true</code> if this object was destroyed; otherwise, <code>false</code>.
  34085. */
  34086. isDestroyed(): boolean;
  34087. /**
  34088. * Destroys the WebGL resources held by this object. Destroying an object allows for deterministic
  34089. release of WebGL resources, instead of relying on the garbage collector to destroy this object.
  34090. <br /><br />
  34091. Once an object is destroyed, it should not be used; calling any function other than
  34092. <code>isDestroyed</code> will result in a {@link DeveloperError} exception. Therefore,
  34093. assign the return value (<code>undefined</code>) to the object as done in the example.
  34094. */
  34095. destroy(): void;
  34096. }
  34097. export namespace ParticleSystem {
  34098. /**
  34099. * A function used to modify attributes of the particle at each time step. This can include force modifications,
  34100. color, sizing, etc.
  34101. * @example
  34102. * function applyGravity(particle, dt) {
  34103. var position = particle.position;
  34104. var gravityVector = Cesium.Cartesian3.normalize(position, new Cesium.Cartesian3());
  34105. Cesium.Cartesian3.multiplyByScalar(gravityVector, GRAVITATIONAL_CONSTANT * dt, gravityVector);
  34106. particle.velocity = Cesium.Cartesian3.add(particle.velocity, gravityVector, particle.velocity);
  34107. }
  34108. * @param particle - The particle being updated.
  34109. * @param dt - The time in seconds since the last update.
  34110. */
  34111. type updateCallback = (particle: Particle, dt: number) => void;
  34112. }
  34113. /**
  34114. * An appearance for {@link GeometryInstance} instances with color attributes.
  34115. This allows several geometry instances, each with a different color, to
  34116. be drawn with the same {@link Primitive} as shown in the second example below.
  34117. * @example
  34118. * // A solid white line segment
  34119. var primitive = new Cesium.Primitive({
  34120. geometryInstances : new Cesium.GeometryInstance({
  34121. geometry : new Cesium.SimplePolylineGeometry({
  34122. positions : Cesium.Cartesian3.fromDegreesArray([
  34123. 0.0, 0.0,
  34124. 5.0, 0.0
  34125. ])
  34126. }),
  34127. attributes : {
  34128. color : Cesium.ColorGeometryInstanceAttribute.fromColor(new Cesium.Color(1.0, 1.0, 1.0, 1.0))
  34129. }
  34130. }),
  34131. appearance : new Cesium.PerInstanceColorAppearance({
  34132. flat : true,
  34133. translucent : false
  34134. })
  34135. });
  34136. // Two rectangles in a primitive, each with a different color
  34137. var instance = new Cesium.GeometryInstance({
  34138. geometry : new Cesium.RectangleGeometry({
  34139. rectangle : Cesium.Rectangle.fromDegrees(0.0, 20.0, 10.0, 30.0)
  34140. }),
  34141. attributes : {
  34142. color : new Cesium.ColorGeometryInstanceAttribute(1.0, 0.0, 0.0, 0.5)
  34143. }
  34144. });
  34145. var anotherInstance = new Cesium.GeometryInstance({
  34146. geometry : new Cesium.RectangleGeometry({
  34147. rectangle : Cesium.Rectangle.fromDegrees(0.0, 40.0, 10.0, 50.0)
  34148. }),
  34149. attributes : {
  34150. color : new Cesium.ColorGeometryInstanceAttribute(0.0, 0.0, 1.0, 0.5)
  34151. }
  34152. });
  34153. var rectanglePrimitive = new Cesium.Primitive({
  34154. geometryInstances : [instance, anotherInstance],
  34155. appearance : new Cesium.PerInstanceColorAppearance()
  34156. });
  34157. * @param [options] - Object with the following properties:
  34158. * @param [options.flat = false] - When <code>true</code>, flat shading is used in the fragment shader, which means lighting is not taking into account.
  34159. * @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}.
  34160. * @param [options.translucent = true] - When <code>true</code>, the geometry is expected to appear translucent so {@link PerInstanceColorAppearance#renderState} has alpha blending enabled.
  34161. * @param [options.closed = false] - When <code>true</code>, the geometry is expected to be closed so {@link PerInstanceColorAppearance#renderState} has backface culling enabled.
  34162. * @param [options.vertexShaderSource] - Optional GLSL vertex shader source to override the default vertex shader.
  34163. * @param [options.fragmentShaderSource] - Optional GLSL fragment shader source to override the default fragment shader.
  34164. * @param [options.renderState] - Optional render state to override the default render state.
  34165. */
  34166. export class PerInstanceColorAppearance {
  34167. constructor(options?: {
  34168. flat?: boolean;
  34169. faceForward?: boolean;
  34170. translucent?: boolean;
  34171. closed?: boolean;
  34172. vertexShaderSource?: string;
  34173. fragmentShaderSource?: string;
  34174. renderState?: any;
  34175. });
  34176. /**
  34177. * This property is part of the {@link Appearance} interface, but is not
  34178. used by {@link PerInstanceColorAppearance} since a fully custom fragment shader is used.
  34179. */
  34180. material: Material;
  34181. /**
  34182. * When <code>true</code>, the geometry is expected to appear translucent so
  34183. {@link PerInstanceColorAppearance#renderState} has alpha blending enabled.
  34184. */
  34185. translucent: boolean;
  34186. /**
  34187. * The GLSL source code for the vertex shader.
  34188. */
  34189. readonly vertexShaderSource: string;
  34190. /**
  34191. * The GLSL source code for the fragment shader.
  34192. */
  34193. readonly fragmentShaderSource: string;
  34194. /**
  34195. * The WebGL fixed-function state to use when rendering the geometry.
  34196. <p>
  34197. The render state can be explicitly defined when constructing a {@link PerInstanceColorAppearance}
  34198. instance, or it is set implicitly via {@link PerInstanceColorAppearance#translucent}
  34199. and {@link PerInstanceColorAppearance#closed}.
  34200. </p>
  34201. */
  34202. readonly renderState: any;
  34203. /**
  34204. * When <code>true</code>, the geometry is expected to be closed so
  34205. {@link PerInstanceColorAppearance#renderState} has backface culling enabled.
  34206. If the viewer enters the geometry, it will not be visible.
  34207. */
  34208. readonly closed: boolean;
  34209. /**
  34210. * The {@link VertexFormat} that this appearance instance is compatible with.
  34211. A geometry can have more vertex attributes and still be compatible - at a
  34212. potential performance cost - but it can't have less.
  34213. */
  34214. readonly vertexFormat: VertexFormat;
  34215. /**
  34216. * When <code>true</code>, flat shading is used in the fragment shader,
  34217. which means lighting is not taking into account.
  34218. */
  34219. readonly flat: boolean;
  34220. /**
  34221. * When <code>true</code>, the fragment shader flips the surface normal
  34222. as needed to ensure that the normal faces the viewer to avoid
  34223. dark spots. This is useful when both sides of a geometry should be
  34224. shaded like {@link WallGeometry}.
  34225. */
  34226. readonly faceForward: boolean;
  34227. /**
  34228. * The {@link VertexFormat} that all {@link PerInstanceColorAppearance} instances
  34229. are compatible with. This requires only <code>position</code> and <code>normal</code>
  34230. attributes.
  34231. */
  34232. static readonly VERTEX_FORMAT: VertexFormat;
  34233. /**
  34234. * The {@link VertexFormat} that all {@link PerInstanceColorAppearance} instances
  34235. are compatible with when {@link PerInstanceColorAppearance#flat} is <code>true</code>.
  34236. This requires only a <code>position</code> attribute.
  34237. */
  34238. static readonly FLAT_VERTEX_FORMAT: VertexFormat;
  34239. /**
  34240. * Procedurally creates the full GLSL fragment shader source. For {@link PerInstanceColorAppearance},
  34241. this is derived from {@link PerInstanceColorAppearance#fragmentShaderSource}, {@link PerInstanceColorAppearance#flat},
  34242. and {@link PerInstanceColorAppearance#faceForward}.
  34243. * @returns The full GLSL fragment shader source.
  34244. */
  34245. getFragmentShaderSource(): string;
  34246. /**
  34247. * Determines if the geometry is translucent based on {@link PerInstanceColorAppearance#translucent}.
  34248. * @returns <code>true</code> if the appearance is translucent.
  34249. */
  34250. isTranslucent(): boolean;
  34251. /**
  34252. * Creates a render state. This is not the final render state instance; instead,
  34253. it can contain a subset of render state properties identical to the render state
  34254. created in the context.
  34255. * @returns The render state.
  34256. */
  34257. getRenderState(): any;
  34258. }
  34259. /**
  34260. * Options for performing point attenuation based on geometric error when rendering
  34261. point clouds using 3D Tiles.
  34262. * @param [options] - Object with the following properties:
  34263. * @param [options.attenuation = false] - Perform point attenuation based on geometric error.
  34264. * @param [options.geometricErrorScale = 1.0] - Scale to be applied to each tile's geometric error.
  34265. * @param [options.maximumAttenuation] - Maximum attenuation in pixels. Defaults to the Cesium3DTileset's maximumScreenSpaceError.
  34266. * @param [options.baseResolution] - Average base resolution for the dataset in meters. Substitute for Geometric Error when not available.
  34267. * @param [options.eyeDomeLighting = true] - When true, use eye dome lighting when drawing with point attenuation.
  34268. * @param [options.eyeDomeLightingStrength = 1.0] - Increasing this value increases contrast on slopes and edges.
  34269. * @param [options.eyeDomeLightingRadius = 1.0] - Increase the thickness of contours from eye dome lighting.
  34270. * @param [options.backFaceCulling = false] - Determines whether back-facing points are hidden. This option works only if data has normals included.
  34271. * @param [options.normalShading = true] - Determines whether a point cloud that contains normals is shaded by the scene's light source.
  34272. */
  34273. export class PointCloudShading {
  34274. constructor(options?: {
  34275. attenuation?: boolean;
  34276. geometricErrorScale?: number;
  34277. maximumAttenuation?: number;
  34278. baseResolution?: number;
  34279. eyeDomeLighting?: boolean;
  34280. eyeDomeLightingStrength?: number;
  34281. eyeDomeLightingRadius?: number;
  34282. backFaceCulling?: boolean;
  34283. normalShading?: boolean;
  34284. });
  34285. /**
  34286. * Perform point attenuation based on geometric error.
  34287. */
  34288. attenuation: boolean;
  34289. /**
  34290. * Scale to be applied to the geometric error before computing attenuation.
  34291. */
  34292. geometricErrorScale: number;
  34293. /**
  34294. * Maximum point attenuation in pixels. If undefined, the Cesium3DTileset's maximumScreenSpaceError will be used.
  34295. */
  34296. maximumAttenuation: number;
  34297. /**
  34298. * Average base resolution for the dataset in meters.
  34299. Used in place of geometric error when geometric error is 0.
  34300. If undefined, an approximation will be computed for each tile that has geometric error of 0.
  34301. */
  34302. baseResolution: number;
  34303. /**
  34304. * Use eye dome lighting when drawing with point attenuation
  34305. Requires support for EXT_frag_depth, OES_texture_float, and WEBGL_draw_buffers extensions in WebGL 1.0,
  34306. otherwise eye dome lighting is ignored.
  34307. */
  34308. eyeDomeLighting: boolean;
  34309. /**
  34310. * Eye dome lighting strength (apparent contrast)
  34311. */
  34312. eyeDomeLightingStrength: number;
  34313. /**
  34314. * Thickness of contours from eye dome lighting
  34315. */
  34316. eyeDomeLightingRadius: number;
  34317. /**
  34318. * Determines whether back-facing points are hidden.
  34319. This option works only if data has normals included.
  34320. */
  34321. backFaceCulling: boolean;
  34322. /**
  34323. * Determines whether a point cloud that contains normals is shaded by the scene's light source.
  34324. */
  34325. normalShading: boolean;
  34326. /**
  34327. * Determines if point cloud shading is supported.
  34328. * @param scene - The scene.
  34329. * @returns <code>true</code> if point cloud shading is supported; otherwise, returns <code>false</code>
  34330. */
  34331. static isSupported(scene: Scene): boolean;
  34332. }
  34333. /**
  34334. * A graphical point positioned in the 3D scene, that is created
  34335. and rendered using a {@link PointPrimitiveCollection}. A point is created and its initial
  34336. properties are set by calling {@link PointPrimitiveCollection#add}.
  34337. */
  34338. export class PointPrimitive {
  34339. constructor();
  34340. /**
  34341. * Determines if this point will be shown. Use this to hide or show a point, instead
  34342. of removing it and re-adding it to the collection.
  34343. */
  34344. show: boolean;
  34345. /**
  34346. * Gets or sets the Cartesian position of this point.
  34347. */
  34348. position: Cartesian3;
  34349. /**
  34350. * Gets or sets near and far scaling properties of a point based on the point's distance from the camera.
  34351. A point's scale will interpolate between the {@link NearFarScalar#nearValue} and
  34352. {@link NearFarScalar#farValue} while the camera distance falls within the lower and upper bounds
  34353. of the specified {@link NearFarScalar#near} and {@link NearFarScalar#far}.
  34354. Outside of these ranges the point's scale remains clamped to the nearest bound. This scale
  34355. multiplies the pixelSize and outlineWidth to affect the total size of the point. If undefined,
  34356. scaleByDistance will be disabled.
  34357. * @example
  34358. * // Example 1.
  34359. // Set a pointPrimitive's scaleByDistance to scale to 15 when the
  34360. // camera is 1500 meters from the pointPrimitive and disappear as
  34361. // the camera distance approaches 8.0e6 meters.
  34362. p.scaleByDistance = new Cesium.NearFarScalar(1.5e2, 15, 8.0e6, 0.0);
  34363. * @example
  34364. * // Example 2.
  34365. // disable scaling by distance
  34366. p.scaleByDistance = undefined;
  34367. */
  34368. scaleByDistance: NearFarScalar;
  34369. /**
  34370. * Gets or sets near and far translucency properties of a point based on the point's distance from the camera.
  34371. A point's translucency will interpolate between the {@link NearFarScalar#nearValue} and
  34372. {@link NearFarScalar#farValue} while the camera distance falls within the lower and upper bounds
  34373. of the specified {@link NearFarScalar#near} and {@link NearFarScalar#far}.
  34374. Outside of these ranges the point's translucency remains clamped to the nearest bound. If undefined,
  34375. translucencyByDistance will be disabled.
  34376. * @example
  34377. * // Example 1.
  34378. // Set a point's translucency to 1.0 when the
  34379. // camera is 1500 meters from the point and disappear as
  34380. // the camera distance approaches 8.0e6 meters.
  34381. p.translucencyByDistance = new Cesium.NearFarScalar(1.5e2, 1.0, 8.0e6, 0.0);
  34382. * @example
  34383. * // Example 2.
  34384. // disable translucency by distance
  34385. p.translucencyByDistance = undefined;
  34386. */
  34387. translucencyByDistance: NearFarScalar;
  34388. /**
  34389. * Gets or sets the inner size of the point in pixels.
  34390. */
  34391. pixelSize: number;
  34392. /**
  34393. * Gets or sets the inner color of the point.
  34394. The red, green, blue, and alpha values are indicated by <code>value</code>'s <code>red</code>, <code>green</code>,
  34395. <code>blue</code>, and <code>alpha</code> properties as shown in Example 1. These components range from <code>0.0</code>
  34396. (no intensity) to <code>1.0</code> (full intensity).
  34397. * @example
  34398. * // Example 1. Assign yellow.
  34399. p.color = Cesium.Color.YELLOW;
  34400. * @example
  34401. * // Example 2. Make a pointPrimitive 50% translucent.
  34402. p.color = new Cesium.Color(1.0, 1.0, 1.0, 0.5);
  34403. */
  34404. color: Color;
  34405. /**
  34406. * Gets or sets the outline color of the point.
  34407. */
  34408. outlineColor: Color;
  34409. /**
  34410. * Gets or sets the outline width in pixels. This width adds to pixelSize,
  34411. increasing the total size of the point.
  34412. */
  34413. outlineWidth: number;
  34414. /**
  34415. * Gets or sets the condition specifying at what distance from the camera that this point will be displayed.
  34416. */
  34417. distanceDisplayCondition: DistanceDisplayCondition;
  34418. /**
  34419. * Gets or sets the distance from the camera at which to disable the depth test to, for example, prevent clipping against terrain.
  34420. When set to zero, the depth test is always applied. When set to Number.POSITIVE_INFINITY, the depth test is never applied.
  34421. */
  34422. disableDepthTestDistance: number;
  34423. /**
  34424. * Gets or sets the user-defined value returned when the point is picked.
  34425. */
  34426. id: any;
  34427. /**
  34428. * Computes the screen-space position of the point's origin.
  34429. The screen space origin is the top, left corner of the canvas; <code>x</code> increases from
  34430. left to right, and <code>y</code> increases from top to bottom.
  34431. * @example
  34432. * console.log(p.computeScreenSpacePosition(scene).toString());
  34433. * @param scene - The scene.
  34434. * @param [result] - The object onto which to store the result.
  34435. * @returns The screen-space position of the point.
  34436. */
  34437. computeScreenSpacePosition(scene: Scene, result?: Cartesian2): Cartesian2;
  34438. /**
  34439. * Determines if this point equals another point. Points are equal if all their properties
  34440. are equal. Points in different collections can be equal.
  34441. * @param other - The point to compare for equality.
  34442. * @returns <code>true</code> if the points are equal; otherwise, <code>false</code>.
  34443. */
  34444. equals(other: PointPrimitive): boolean;
  34445. }
  34446. /**
  34447. * A renderable collection of points.
  34448. <br /><br />
  34449. Points are added and removed from the collection using {@link PointPrimitiveCollection#add}
  34450. and {@link PointPrimitiveCollection#remove}.
  34451. * @example
  34452. * // Create a pointPrimitive collection with two points
  34453. var points = scene.primitives.add(new Cesium.PointPrimitiveCollection());
  34454. points.add({
  34455. position : new Cesium.Cartesian3(1.0, 2.0, 3.0),
  34456. color : Cesium.Color.YELLOW
  34457. });
  34458. points.add({
  34459. position : new Cesium.Cartesian3(4.0, 5.0, 6.0),
  34460. color : Cesium.Color.CYAN
  34461. });
  34462. * @param [options] - Object with the following properties:
  34463. * @param [options.modelMatrix = Matrix4.IDENTITY] - The 4x4 transformation matrix that transforms each point from model to world coordinates.
  34464. * @param [options.debugShowBoundingVolume = false] - For debugging only. Determines if this primitive's commands' bounding spheres are shown.
  34465. * @param [options.blendOption = BlendOption.OPAQUE_AND_TRANSLUCENT] - The point blending option. The default
  34466. is used for rendering both opaque and translucent points. However, if either all of the points are completely opaque or all are completely translucent,
  34467. setting the technique to BlendOption.OPAQUE or BlendOption.TRANSLUCENT can improve performance by up to 2x.
  34468. */
  34469. export class PointPrimitiveCollection {
  34470. constructor(options?: {
  34471. modelMatrix?: Matrix4;
  34472. debugShowBoundingVolume?: boolean;
  34473. blendOption?: BlendOption;
  34474. });
  34475. /**
  34476. * The 4x4 transformation matrix that transforms each point in this collection from model to world coordinates.
  34477. When this is the identity matrix, the pointPrimitives are drawn in world coordinates, i.e., Earth's WGS84 coordinates.
  34478. Local reference frames can be used by providing a different transformation matrix, like that returned
  34479. by {@link Transforms.eastNorthUpToFixedFrame}.
  34480. * @example
  34481. * var center = Cesium.Cartesian3.fromDegrees(-75.59777, 40.03883);
  34482. pointPrimitives.modelMatrix = Cesium.Transforms.eastNorthUpToFixedFrame(center);
  34483. pointPrimitives.add({
  34484. color : Cesium.Color.ORANGE,
  34485. position : new Cesium.Cartesian3(0.0, 0.0, 0.0) // center
  34486. });
  34487. pointPrimitives.add({
  34488. color : Cesium.Color.YELLOW,
  34489. position : new Cesium.Cartesian3(1000000.0, 0.0, 0.0) // east
  34490. });
  34491. pointPrimitives.add({
  34492. color : Cesium.Color.GREEN,
  34493. position : new Cesium.Cartesian3(0.0, 1000000.0, 0.0) // north
  34494. });
  34495. pointPrimitives.add({
  34496. color : Cesium.Color.CYAN,
  34497. position : new Cesium.Cartesian3(0.0, 0.0, 1000000.0) // up
  34498. });
  34499. */
  34500. modelMatrix: Matrix4;
  34501. /**
  34502. * This property is for debugging only; it is not for production use nor is it optimized.
  34503. <p>
  34504. Draws the bounding sphere for each draw command in the primitive.
  34505. </p>
  34506. */
  34507. debugShowBoundingVolume: boolean;
  34508. /**
  34509. * The point blending option. The default is used for rendering both opaque and translucent points.
  34510. However, if either all of the points are completely opaque or all are completely translucent,
  34511. setting the technique to BlendOption.OPAQUE or BlendOption.TRANSLUCENT can improve
  34512. performance by up to 2x.
  34513. */
  34514. blendOption: BlendOption;
  34515. /**
  34516. * Returns the number of points in this collection. This is commonly used with
  34517. {@link PointPrimitiveCollection#get} to iterate over all the points
  34518. in the collection.
  34519. */
  34520. length: number;
  34521. /**
  34522. * Creates and adds a point with the specified initial properties to the collection.
  34523. The added point is returned so it can be modified or removed from the collection later.
  34524. * @example
  34525. * // Example 1: Add a point, specifying all the default values.
  34526. var p = pointPrimitives.add({
  34527. show : true,
  34528. position : Cesium.Cartesian3.ZERO,
  34529. pixelSize : 10.0,
  34530. color : Cesium.Color.WHITE,
  34531. outlineColor : Cesium.Color.TRANSPARENT,
  34532. outlineWidth : 0.0,
  34533. id : undefined
  34534. });
  34535. * @example
  34536. * // Example 2: Specify only the point's cartographic position.
  34537. var p = pointPrimitives.add({
  34538. position : Cesium.Cartesian3.fromDegrees(longitude, latitude, height)
  34539. });
  34540. * @param [options] - A template describing the point's properties as shown in Example 1.
  34541. * @returns The point that was added to the collection.
  34542. */
  34543. add(options?: any): PointPrimitive;
  34544. /**
  34545. * Removes a point from the collection.
  34546. * @example
  34547. * var p = pointPrimitives.add(...);
  34548. pointPrimitives.remove(p); // Returns true
  34549. * @param pointPrimitive - The point to remove.
  34550. * @returns <code>true</code> if the point was removed; <code>false</code> if the point was not found in the collection.
  34551. */
  34552. remove(pointPrimitive: PointPrimitive): boolean;
  34553. /**
  34554. * Removes all points from the collection.
  34555. * @example
  34556. * pointPrimitives.add(...);
  34557. pointPrimitives.add(...);
  34558. pointPrimitives.removeAll();
  34559. */
  34560. removeAll(): void;
  34561. /**
  34562. * Check whether this collection contains a given point.
  34563. * @param [pointPrimitive] - The point to check for.
  34564. * @returns true if this collection contains the point, false otherwise.
  34565. */
  34566. contains(pointPrimitive?: PointPrimitive): boolean;
  34567. /**
  34568. * Returns the point in the collection at the specified index. Indices are zero-based
  34569. and increase as points are added. Removing a point shifts all points after
  34570. it to the left, changing their indices. This function is commonly used with
  34571. {@link PointPrimitiveCollection#length} to iterate over all the points
  34572. in the collection.
  34573. * @example
  34574. * // Toggle the show property of every point in the collection
  34575. var len = pointPrimitives.length;
  34576. for (var i = 0; i < len; ++i) {
  34577. var p = pointPrimitives.get(i);
  34578. p.show = !p.show;
  34579. }
  34580. * @param index - The zero-based index of the point.
  34581. * @returns The point at the specified index.
  34582. */
  34583. get(index: number): PointPrimitive;
  34584. /**
  34585. * Returns true if this object was destroyed; otherwise, false.
  34586. <br /><br />
  34587. If this object was destroyed, it should not be used; calling any function other than
  34588. <code>isDestroyed</code> will result in a {@link DeveloperError} exception.
  34589. * @returns <code>true</code> if this object was destroyed; otherwise, <code>false</code>.
  34590. */
  34591. isDestroyed(): boolean;
  34592. /**
  34593. * Destroys the WebGL resources held by this object. Destroying an object allows for deterministic
  34594. release of WebGL resources, instead of relying on the garbage collector to destroy this object.
  34595. <br /><br />
  34596. Once an object is destroyed, it should not be used; calling any function other than
  34597. <code>isDestroyed</code> will result in a {@link DeveloperError} exception. Therefore,
  34598. assign the return value (<code>undefined</code>) to the object as done in the example.
  34599. * @example
  34600. * pointPrimitives = pointPrimitives && pointPrimitives.destroy();
  34601. */
  34602. destroy(): void;
  34603. }
  34604. /**
  34605. * A renderable polyline. Create this by calling {@link PolylineCollection#add}
  34606. * @param options - Object with the following properties:
  34607. * @param [options.show = true] - <code>true</code> if this polyline will be shown; otherwise, <code>false</code>.
  34608. * @param [options.width = 1.0] - The width of the polyline in pixels.
  34609. * @param [options.loop = false] - Whether a line segment will be added between the last and first line positions to make this line a loop.
  34610. * @param [options.material = Material.ColorType] - The material.
  34611. * @param [options.positions] - The positions.
  34612. * @param [options.id] - The user-defined object to be returned when this polyline is picked.
  34613. * @param [options.distanceDisplayCondition] - The condition specifying at what distance from the camera that this polyline will be displayed.
  34614. * @param polylineCollection - The renderable polyline collection.
  34615. */
  34616. export class Polyline {
  34617. constructor(options: {
  34618. show?: boolean;
  34619. width?: number;
  34620. loop?: boolean;
  34621. material?: Material;
  34622. positions?: Cartesian3[];
  34623. id?: any;
  34624. distanceDisplayCondition?: DistanceDisplayCondition;
  34625. }, polylineCollection: PolylineCollection);
  34626. /**
  34627. * Determines if this polyline will be shown. Use this to hide or show a polyline, instead
  34628. of removing it and re-adding it to the collection.
  34629. */
  34630. show: boolean;
  34631. /**
  34632. * Gets or sets the positions of the polyline.
  34633. * @example
  34634. * polyline.positions = Cesium.Cartesian3.fromDegreesArray([
  34635. 0.0, 0.0,
  34636. 10.0, 0.0,
  34637. 0.0, 20.0
  34638. ]);
  34639. */
  34640. positions: Cartesian3[];
  34641. /**
  34642. * 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
  34643. {@link https://github.com/CesiumGS/cesium/wiki/Fabric|Fabric}.
  34644. */
  34645. material: Material;
  34646. /**
  34647. * Gets or sets the width of the polyline.
  34648. */
  34649. width: number;
  34650. /**
  34651. * Gets or sets whether a line segment will be added between the first and last polyline positions.
  34652. */
  34653. loop: boolean;
  34654. /**
  34655. * Gets or sets the user-defined value returned when the polyline is picked.
  34656. */
  34657. id: any;
  34658. /**
  34659. * Gets or sets the condition specifying at what distance from the camera that this polyline will be displayed.
  34660. */
  34661. distanceDisplayCondition: DistanceDisplayCondition;
  34662. }
  34663. /**
  34664. * A renderable collection of polylines.
  34665. <br /><br />
  34666. <div align="center">
  34667. <img src="Images/Polyline.png" width="400" height="300" /><br />
  34668. Example polylines
  34669. </div>
  34670. <br /><br />
  34671. Polylines are added and removed from the collection using {@link PolylineCollection#add}
  34672. and {@link PolylineCollection#remove}.
  34673. * @example
  34674. * // Create a polyline collection with two polylines
  34675. var polylines = new Cesium.PolylineCollection();
  34676. polylines.add({
  34677. positions : Cesium.Cartesian3.fromDegreesArray([
  34678. -75.10, 39.57,
  34679. -77.02, 38.53,
  34680. -80.50, 35.14,
  34681. -80.12, 25.46]),
  34682. width : 2
  34683. });
  34684. polylines.add({
  34685. positions : Cesium.Cartesian3.fromDegreesArray([
  34686. -73.10, 37.57,
  34687. -75.02, 36.53,
  34688. -78.50, 33.14,
  34689. -78.12, 23.46]),
  34690. width : 4
  34691. });
  34692. * @param [options] - Object with the following properties:
  34693. * @param [options.modelMatrix = Matrix4.IDENTITY] - The 4x4 transformation matrix that transforms each polyline from model to world coordinates.
  34694. * @param [options.debugShowBoundingVolume = false] - For debugging only. Determines if this primitive's commands' bounding spheres are shown.
  34695. */
  34696. export class PolylineCollection {
  34697. constructor(options?: {
  34698. modelMatrix?: Matrix4;
  34699. debugShowBoundingVolume?: boolean;
  34700. });
  34701. /**
  34702. * The 4x4 transformation matrix that transforms each polyline in this collection from model to world coordinates.
  34703. When this is the identity matrix, the polylines are drawn in world coordinates, i.e., Earth's WGS84 coordinates.
  34704. Local reference frames can be used by providing a different transformation matrix, like that returned
  34705. by {@link Transforms.eastNorthUpToFixedFrame}.
  34706. */
  34707. modelMatrix: Matrix4;
  34708. /**
  34709. * This property is for debugging only; it is not for production use nor is it optimized.
  34710. <p>
  34711. Draws the bounding sphere for each draw command in the primitive.
  34712. </p>
  34713. */
  34714. debugShowBoundingVolume: boolean;
  34715. /**
  34716. * Returns the number of polylines in this collection. This is commonly used with
  34717. {@link PolylineCollection#get} to iterate over all the polylines
  34718. in the collection.
  34719. */
  34720. length: number;
  34721. /**
  34722. * Creates and adds a polyline with the specified initial properties to the collection.
  34723. The added polyline is returned so it can be modified or removed from the collection later.
  34724. * @example
  34725. * // Example 1: Add a polyline, specifying all the default values.
  34726. var p = polylines.add({
  34727. show : true,
  34728. positions : ellipsoid.cartographicArrayToCartesianArray([
  34729. * Cesium.Cartographic.fromDegrees(-75.10, 39.57),
  34730. * Cesium.Cartographic.fromDegrees(-77.02, 38.53)]),
  34731. width : 1
  34732. });
  34733. * @param [options] - A template describing the polyline's properties as shown in Example 1.
  34734. * @returns The polyline that was added to the collection.
  34735. */
  34736. add(options?: any): Polyline;
  34737. /**
  34738. * Removes a polyline from the collection.
  34739. * @example
  34740. * var p = polylines.add(...);
  34741. polylines.remove(p); // Returns true
  34742. * @param polyline - The polyline to remove.
  34743. * @returns <code>true</code> if the polyline was removed; <code>false</code> if the polyline was not found in the collection.
  34744. */
  34745. remove(polyline: Polyline): boolean;
  34746. /**
  34747. * Removes all polylines from the collection.
  34748. * @example
  34749. * polylines.add(...);
  34750. polylines.add(...);
  34751. polylines.removeAll();
  34752. */
  34753. removeAll(): void;
  34754. /**
  34755. * Determines if this collection contains the specified polyline.
  34756. * @param polyline - The polyline to check for.
  34757. * @returns true if this collection contains the polyline, false otherwise.
  34758. */
  34759. contains(polyline: Polyline): boolean;
  34760. /**
  34761. * Returns the polyline in the collection at the specified index. Indices are zero-based
  34762. and increase as polylines are added. Removing a polyline shifts all polylines after
  34763. it to the left, changing their indices. This function is commonly used with
  34764. {@link PolylineCollection#length} to iterate over all the polylines
  34765. in the collection.
  34766. * @example
  34767. * // Toggle the show property of every polyline in the collection
  34768. var len = polylines.length;
  34769. for (var i = 0; i < len; ++i) {
  34770. var p = polylines.get(i);
  34771. p.show = !p.show;
  34772. }
  34773. * @param index - The zero-based index of the polyline.
  34774. * @returns The polyline at the specified index.
  34775. */
  34776. get(index: number): Polyline;
  34777. /**
  34778. * Called when {@link Viewer} or {@link CesiumWidget} render the scene to
  34779. get the draw commands needed to render this primitive.
  34780. <p>
  34781. Do not call this function directly. This is documented just to
  34782. list the exceptions that may be propagated when the scene is rendered:
  34783. </p>
  34784. */
  34785. update(): void;
  34786. /**
  34787. * Returns true if this object was destroyed; otherwise, false.
  34788. <br /><br />
  34789. If this object was destroyed, it should not be used; calling any function other than
  34790. <code>isDestroyed</code> will result in a {@link DeveloperError} exception.
  34791. * @returns <code>true</code> if this object was destroyed; otherwise, <code>false</code>.
  34792. */
  34793. isDestroyed(): boolean;
  34794. /**
  34795. * Destroys the WebGL resources held by this object. Destroying an object allows for deterministic
  34796. release of WebGL resources, instead of relying on the garbage collector to destroy this object.
  34797. <br /><br />
  34798. Once an object is destroyed, it should not be used; calling any function other than
  34799. <code>isDestroyed</code> will result in a {@link DeveloperError} exception. Therefore,
  34800. assign the return value (<code>undefined</code>) to the object as done in the example.
  34801. * @example
  34802. * polylines = polylines && polylines.destroy();
  34803. */
  34804. destroy(): void;
  34805. }
  34806. /**
  34807. * An appearance for {@link GeometryInstance} instances with color attributes and
  34808. {@link PolylineGeometry} or {@link GroundPolylineGeometry}.
  34809. This allows several geometry instances, each with a different color, to
  34810. be drawn with the same {@link Primitive}.
  34811. * @example
  34812. * // A solid white line segment
  34813. var primitive = new Cesium.Primitive({
  34814. geometryInstances : new Cesium.GeometryInstance({
  34815. geometry : new Cesium.PolylineGeometry({
  34816. positions : Cesium.Cartesian3.fromDegreesArray([
  34817. 0.0, 0.0,
  34818. 5.0, 0.0
  34819. ]),
  34820. width : 10.0,
  34821. vertexFormat : Cesium.PolylineColorAppearance.VERTEX_FORMAT
  34822. }),
  34823. attributes : {
  34824. color : Cesium.ColorGeometryInstanceAttribute.fromColor(new Cesium.Color(1.0, 1.0, 1.0, 1.0))
  34825. }
  34826. }),
  34827. appearance : new Cesium.PolylineColorAppearance({
  34828. translucent : false
  34829. })
  34830. });
  34831. * @param [options] - Object with the following properties:
  34832. * @param [options.translucent = true] - When <code>true</code>, the geometry is expected to appear translucent so {@link PolylineColorAppearance#renderState} has alpha blending enabled.
  34833. * @param [options.vertexShaderSource] - Optional GLSL vertex shader source to override the default vertex shader.
  34834. * @param [options.fragmentShaderSource] - Optional GLSL fragment shader source to override the default fragment shader.
  34835. * @param [options.renderState] - Optional render state to override the default render state.
  34836. */
  34837. export class PolylineColorAppearance {
  34838. constructor(options?: {
  34839. translucent?: boolean;
  34840. vertexShaderSource?: string;
  34841. fragmentShaderSource?: string;
  34842. renderState?: any;
  34843. });
  34844. /**
  34845. * This property is part of the {@link Appearance} interface, but is not
  34846. used by {@link PolylineColorAppearance} since a fully custom fragment shader is used.
  34847. */
  34848. material: Material;
  34849. /**
  34850. * When <code>true</code>, the geometry is expected to appear translucent so
  34851. {@link PolylineColorAppearance#renderState} has alpha blending enabled.
  34852. */
  34853. translucent: boolean;
  34854. /**
  34855. * The GLSL source code for the vertex shader.
  34856. */
  34857. readonly vertexShaderSource: string;
  34858. /**
  34859. * The GLSL source code for the fragment shader.
  34860. */
  34861. readonly fragmentShaderSource: string;
  34862. /**
  34863. * The WebGL fixed-function state to use when rendering the geometry.
  34864. <p>
  34865. The render state can be explicitly defined when constructing a {@link PolylineColorAppearance}
  34866. instance, or it is set implicitly via {@link PolylineColorAppearance#translucent}.
  34867. </p>
  34868. */
  34869. readonly renderState: any;
  34870. /**
  34871. * When <code>true</code>, the geometry is expected to be closed so
  34872. {@link PolylineColorAppearance#renderState} has backface culling enabled.
  34873. This is always <code>false</code> for <code>PolylineColorAppearance</code>.
  34874. */
  34875. readonly closed: boolean;
  34876. /**
  34877. * The {@link VertexFormat} that this appearance instance is compatible with.
  34878. A geometry can have more vertex attributes and still be compatible - at a
  34879. potential performance cost - but it can't have less.
  34880. */
  34881. readonly vertexFormat: VertexFormat;
  34882. /**
  34883. * The {@link VertexFormat} that all {@link PolylineColorAppearance} instances
  34884. are compatible with. This requires only a <code>position</code> attribute.
  34885. */
  34886. static readonly VERTEX_FORMAT: VertexFormat;
  34887. /**
  34888. * Procedurally creates the full GLSL fragment shader source.
  34889. * @returns The full GLSL fragment shader source.
  34890. */
  34891. getFragmentShaderSource(): string;
  34892. /**
  34893. * Determines if the geometry is translucent based on {@link PolylineColorAppearance#translucent}.
  34894. * @returns <code>true</code> if the appearance is translucent.
  34895. */
  34896. isTranslucent(): boolean;
  34897. /**
  34898. * Creates a render state. This is not the final render state instance; instead,
  34899. it can contain a subset of render state properties identical to the render state
  34900. created in the context.
  34901. * @returns The render state.
  34902. */
  34903. getRenderState(): any;
  34904. }
  34905. /**
  34906. * An appearance for {@link PolylineGeometry} that supports shading with materials.
  34907. * @example
  34908. * var primitive = new Cesium.Primitive({
  34909. geometryInstances : new Cesium.GeometryInstance({
  34910. geometry : new Cesium.PolylineGeometry({
  34911. positions : Cesium.Cartesian3.fromDegreesArray([
  34912. 0.0, 0.0,
  34913. 5.0, 0.0
  34914. ]),
  34915. width : 10.0,
  34916. vertexFormat : Cesium.PolylineMaterialAppearance.VERTEX_FORMAT
  34917. })
  34918. }),
  34919. appearance : new Cesium.PolylineMaterialAppearance({
  34920. material : Cesium.Material.fromType('Color')
  34921. })
  34922. });
  34923. * @param [options] - Object with the following properties:
  34924. * @param [options.translucent = true] - When <code>true</code>, the geometry is expected to appear translucent so {@link PolylineMaterialAppearance#renderState} has alpha blending enabled.
  34925. * @param [options.material = Material.ColorType] - The material used to determine the fragment color.
  34926. * @param [options.vertexShaderSource] - Optional GLSL vertex shader source to override the default vertex shader.
  34927. * @param [options.fragmentShaderSource] - Optional GLSL fragment shader source to override the default fragment shader.
  34928. * @param [options.renderState] - Optional render state to override the default render state.
  34929. */
  34930. export class PolylineMaterialAppearance {
  34931. constructor(options?: {
  34932. translucent?: boolean;
  34933. material?: Material;
  34934. vertexShaderSource?: string;
  34935. fragmentShaderSource?: string;
  34936. renderState?: any;
  34937. });
  34938. /**
  34939. * The material used to determine the fragment color. Unlike other {@link PolylineMaterialAppearance}
  34940. properties, this is not read-only, so an appearance's material can change on the fly.
  34941. */
  34942. material: Material;
  34943. /**
  34944. * When <code>true</code>, the geometry is expected to appear translucent so
  34945. {@link PolylineMaterialAppearance#renderState} has alpha blending enabled.
  34946. */
  34947. translucent: boolean;
  34948. /**
  34949. * The GLSL source code for the vertex shader.
  34950. */
  34951. readonly vertexShaderSource: string;
  34952. /**
  34953. * The GLSL source code for the fragment shader.
  34954. */
  34955. readonly fragmentShaderSource: string;
  34956. /**
  34957. * The WebGL fixed-function state to use when rendering the geometry.
  34958. <p>
  34959. The render state can be explicitly defined when constructing a {@link PolylineMaterialAppearance}
  34960. instance, or it is set implicitly via {@link PolylineMaterialAppearance#translucent}
  34961. and {@link PolylineMaterialAppearance#closed}.
  34962. </p>
  34963. */
  34964. readonly renderState: any;
  34965. /**
  34966. * When <code>true</code>, the geometry is expected to be closed so
  34967. {@link PolylineMaterialAppearance#renderState} has backface culling enabled.
  34968. This is always <code>false</code> for <code>PolylineMaterialAppearance</code>.
  34969. */
  34970. readonly closed: boolean;
  34971. /**
  34972. * The {@link VertexFormat} that this appearance instance is compatible with.
  34973. A geometry can have more vertex attributes and still be compatible - at a
  34974. potential performance cost - but it can't have less.
  34975. */
  34976. readonly vertexFormat: VertexFormat;
  34977. /**
  34978. * The {@link VertexFormat} that all {@link PolylineMaterialAppearance} instances
  34979. are compatible with. This requires <code>position</code> and <code>st</code> attributes.
  34980. */
  34981. static readonly VERTEX_FORMAT: VertexFormat;
  34982. /**
  34983. * Procedurally creates the full GLSL fragment shader source. For {@link PolylineMaterialAppearance},
  34984. this is derived from {@link PolylineMaterialAppearance#fragmentShaderSource} and {@link PolylineMaterialAppearance#material}.
  34985. * @returns The full GLSL fragment shader source.
  34986. */
  34987. getFragmentShaderSource(): string;
  34988. /**
  34989. * Determines if the geometry is translucent based on {@link PolylineMaterialAppearance#translucent} and {@link Material#isTranslucent}.
  34990. * @returns <code>true</code> if the appearance is translucent.
  34991. */
  34992. isTranslucent(): boolean;
  34993. /**
  34994. * Creates a render state. This is not the final render state instance; instead,
  34995. it can contain a subset of render state properties identical to the render state
  34996. created in the context.
  34997. * @returns The render state.
  34998. */
  34999. getRenderState(): any;
  35000. }
  35001. /**
  35002. * Runs a post-process stage on either the texture rendered by the scene or the output of a previous post-process stage.
  35003. * @example
  35004. * // Simple stage to change the color
  35005. var fs =
  35006. 'uniform sampler2D colorTexture;\n' +
  35007. 'varying vec2 v_textureCoordinates;\n' +
  35008. 'uniform float scale;\n' +
  35009. 'uniform vec3 offset;\n' +
  35010. 'void main() {\n' +
  35011. ' vec4 color = texture2D(colorTexture, v_textureCoordinates);\n' +
  35012. ' gl_FragColor = vec4(color.rgb * scale + offset, 1.0);\n' +
  35013. '}\n';
  35014. scene.postProcessStages.add(new Cesium.PostProcessStage({
  35015. fragmentShader : fs,
  35016. uniforms : {
  35017. scale : 1.1,
  35018. offset : function() {
  35019. return new Cesium.Cartesian3(0.1, 0.2, 0.3);
  35020. }
  35021. }
  35022. }));
  35023. * @example
  35024. * // Simple stage to change the color of what is selected.
  35025. // If czm_selected returns true, the current fragment belongs to geometry in the selected array.
  35026. var fs =
  35027. 'uniform sampler2D colorTexture;\n' +
  35028. 'varying vec2 v_textureCoordinates;\n' +
  35029. 'uniform vec4 highlight;\n' +
  35030. 'void main() {\n' +
  35031. ' vec4 color = texture2D(colorTexture, v_textureCoordinates);\n' +
  35032. ' if (czm_selected()) {\n' +
  35033. ' vec3 highlighted = highlight.a * highlight.rgb + (1.0 - highlight.a) * color.rgb;\n' +
  35034. ' gl_FragColor = vec4(highlighted, 1.0);\n' +
  35035. ' } else { \n' +
  35036. ' gl_FragColor = color;\n' +
  35037. ' }\n' +
  35038. '}\n';
  35039. var stage = scene.postProcessStages.add(new Cesium.PostProcessStage({
  35040. fragmentShader : fs,
  35041. uniforms : {
  35042. highlight : function() {
  35043. return new Cesium.Color(1.0, 0.0, 0.0, 0.5);
  35044. }
  35045. }
  35046. }));
  35047. stage.selected = [cesium3DTileFeature];
  35048. * @param options - An object with the following properties:
  35049. * @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.
  35050. * @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.
  35051. * @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.
  35052. * @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.
  35053. * @param [options.sampleMode = PostProcessStageSampleMode.NEAREST] - How to sample the input color texture.
  35054. * @param [options.pixelFormat = PixelFormat.RGBA] - The color pixel format of the output texture.
  35055. * @param [options.pixelDatatype = PixelDatatype.UNSIGNED_BYTE] - The pixel data type of the output texture.
  35056. * @param [options.clearColor = Color.BLACK] - The color to clear the output texture to.
  35057. * @param [options.scissorRectangle] - The rectangle to use for the scissor test.
  35058. * @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.
  35059. */
  35060. export class PostProcessStage {
  35061. constructor(options: {
  35062. fragmentShader: string;
  35063. uniforms?: any;
  35064. textureScale?: number;
  35065. forcePowerOfTwo?: boolean;
  35066. sampleMode?: PostProcessStageSampleMode;
  35067. pixelFormat?: PixelFormat;
  35068. pixelDatatype?: PixelDatatype;
  35069. clearColor?: Color;
  35070. scissorRectangle?: BoundingRectangle;
  35071. name?: string;
  35072. });
  35073. /**
  35074. * Whether or not to execute this post-process stage when ready.
  35075. */
  35076. enabled: boolean;
  35077. /**
  35078. * Determines if this post-process stage is ready to be executed. A stage is only executed when both <code>ready</code>
  35079. and {@link PostProcessStage#enabled} are <code>true</code>. A stage will not be ready while it is waiting on textures
  35080. to load.
  35081. */
  35082. readonly ready: boolean;
  35083. /**
  35084. * The unique name of this post-process stage for reference by other stages in a {@link PostProcessStageComposite}.
  35085. */
  35086. readonly name: string;
  35087. /**
  35088. * The fragment shader to use when execute this post-process stage.
  35089. <p>
  35090. The shader must contain a sampler uniform declaration for <code>colorTexture</code>, <code>depthTexture</code>,
  35091. or both.
  35092. </p>
  35093. <p>
  35094. The shader must contain a <code>vec2</code> varying declaration for <code>v_textureCoordinates</code> for sampling
  35095. the texture uniforms.
  35096. </p>
  35097. */
  35098. readonly fragmentShader: string;
  35099. /**
  35100. * An object whose properties are used to set the uniforms of the fragment shader.
  35101. <p>
  35102. The object property values can be either a constant or a function. The function will be called
  35103. each frame before the post-process stage is executed.
  35104. </p>
  35105. <p>
  35106. 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.
  35107. </p>
  35108. <p>
  35109. If this post-process stage is part of a {@link PostProcessStageComposite} that does not execute in series, the constant value can also be
  35110. the name of another stage in a composite. This will set the uniform to the output texture the stage with that name.
  35111. </p>
  35112. */
  35113. readonly uniforms: any;
  35114. /**
  35115. * 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.
  35116. */
  35117. readonly textureScale: number;
  35118. /**
  35119. * 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.
  35120. */
  35121. readonly forcePowerOfTwo: number;
  35122. /**
  35123. * How to sample the input color texture.
  35124. */
  35125. readonly sampleMode: PostProcessStageSampleMode;
  35126. /**
  35127. * The color pixel format of the output texture.
  35128. */
  35129. readonly pixelFormat: PixelFormat;
  35130. /**
  35131. * The pixel data type of the output texture.
  35132. */
  35133. readonly pixelDatatype: PixelDatatype;
  35134. /**
  35135. * The color to clear the output texture to.
  35136. */
  35137. readonly clearColor: Color;
  35138. /**
  35139. * The {@link BoundingRectangle} to use for the scissor test. A default bounding rectangle will disable the scissor test.
  35140. */
  35141. readonly scissorRectangle: BoundingRectangle;
  35142. /**
  35143. * The features selected for applying the post-process.
  35144. <p>
  35145. In the fragment shader, use <code>czm_selected</code> to determine whether or not to apply the post-process
  35146. stage to that fragment. For example:
  35147. <code>
  35148. if (czm_selected(v_textureCoordinates)) {
  35149. // apply post-process stage
  35150. } else {
  35151. gl_FragColor = texture2D(colorTexture, v_textureCordinates);
  35152. }
  35153. </code>
  35154. </p>
  35155. */
  35156. selected: any[];
  35157. /**
  35158. * Returns true if this object was destroyed; otherwise, false.
  35159. <p>
  35160. If this object was destroyed, it should not be used; calling any function other than
  35161. <code>isDestroyed</code> will result in a {@link DeveloperError} exception.
  35162. </p>
  35163. * @returns <code>true</code> if this object was destroyed; otherwise, <code>false</code>.
  35164. */
  35165. isDestroyed(): boolean;
  35166. /**
  35167. * Destroys the WebGL resources held by this object. Destroying an object allows for deterministic
  35168. release of WebGL resources, instead of relying on the garbage collector to destroy this object.
  35169. <p>
  35170. Once an object is destroyed, it should not be used; calling any function other than
  35171. <code>isDestroyed</code> will result in a {@link DeveloperError} exception. Therefore,
  35172. assign the return value (<code>undefined</code>) to the object as done in the example.
  35173. </p>
  35174. */
  35175. destroy(): void;
  35176. }
  35177. /**
  35178. * A collection of {@link PostProcessStage}s and/or {@link PostProcessStageComposite}s.
  35179. <p>
  35180. The input texture for each post-process stage is the texture rendered to by the scene or the texture rendered
  35181. to by the previous stage in the collection.
  35182. </p>
  35183. <p>
  35184. If the ambient occlusion or bloom stages are enabled, they will execute before all other stages.
  35185. </p>
  35186. <p>
  35187. If the FXAA stage is enabled, it will execute after all other stages.
  35188. </p>
  35189. */
  35190. export class PostProcessStageCollection {
  35191. constructor();
  35192. /**
  35193. * Determines if all of the post-process stages in the collection are ready to be executed.
  35194. */
  35195. readonly ready: boolean;
  35196. /**
  35197. * A post-process stage for Fast Approximate Anti-aliasing.
  35198. <p>
  35199. When enabled, this stage will execute after all others.
  35200. </p>
  35201. */
  35202. readonly fxaa: PostProcessStage;
  35203. /**
  35204. * A post-process stage that applies Horizon-based Ambient Occlusion (HBAO) to the input texture.
  35205. <p>
  35206. Ambient occlusion simulates shadows from ambient light. These shadows would always be present when the
  35207. surface receives light and regardless of the light's position.
  35208. </p>
  35209. <p>
  35210. The uniforms have the following properties: <code>intensity</code>, <code>bias</code>, <code>lengthCap</code>,
  35211. <code>stepSize</code>, <code>frustumLength</code>, <code>ambientOcclusionOnly</code>,
  35212. <code>delta</code>, <code>sigma</code>, and <code>blurStepSize</code>.
  35213. </p>
  35214. <ul>
  35215. <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>
  35216. <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,
  35217. 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>
  35218. <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,
  35219. sampling stops in the current direction. The default value is <code>0.26</code>.</li>
  35220. <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>
  35221. <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.
  35222. The default value is <code>1000.0</code>.</li>
  35223. <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
  35224. 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>
  35225. </ul>
  35226. <p>
  35227. <code>delta</code>, <code>sigma</code>, and <code>blurStepSize</code> are the same properties as {@link PostProcessStageLibrary#createBlurStage}.
  35228. The blur is applied to the shadows generated from the image to make them smoother.
  35229. </p>
  35230. <p>
  35231. When enabled, this stage will execute before all others.
  35232. </p>
  35233. */
  35234. readonly ambientOcclusion: PostProcessStageComposite;
  35235. /**
  35236. * A post-process stage for a bloom effect.
  35237. <p>
  35238. A bloom effect adds glow effect, makes bright areas brighter, and dark areas darker.
  35239. </p>
  35240. <p>
  35241. This stage has the following uniforms: <code>contrast</code>, <code>brightness</code>, <code>glowOnly</code>,
  35242. <code>delta</code>, <code>sigma</code>, and <code>stepSize</code>.
  35243. </p>
  35244. <ul>
  35245. <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>
  35246. <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
  35247. added to the brightness. The default value is <code>-0.3</code>.</li>
  35248. <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.
  35249. The default value is <code>false</code>. This is a debug option for viewing the effects when changing the other uniform values.</li>
  35250. </ul>
  35251. <p>
  35252. <code>delta</code>, <code>sigma</code>, and <code>stepSize</code> are the same properties as {@link PostProcessStageLibrary#createBlurStage}.
  35253. The blur is applied to the shadows generated from the image to make them smoother.
  35254. </p>
  35255. <p>
  35256. When enabled, this stage will execute before all others.
  35257. </p>
  35258. */
  35259. readonly bloom: PostProcessStageComposite;
  35260. /**
  35261. * The number of post-process stages in this collection.
  35262. */
  35263. readonly length: number;
  35264. /**
  35265. * Adds the post-process stage to the collection.
  35266. * @param stage - The post-process stage to add to the collection.
  35267. * @returns The post-process stage that was added to the collection.
  35268. */
  35269. add(stage: PostProcessStage | PostProcessStageComposite): PostProcessStage | PostProcessStageComposite;
  35270. /**
  35271. * Removes a post-process stage from the collection and destroys it.
  35272. * @param stage - The post-process stage to remove from the collection.
  35273. * @returns Whether the post-process stage was removed.
  35274. */
  35275. remove(stage: PostProcessStage | PostProcessStageComposite): boolean;
  35276. /**
  35277. * Returns whether the collection contains a post-process stage.
  35278. * @param stage - The post-process stage.
  35279. * @returns Whether the collection contains the post-process stage.
  35280. */
  35281. contains(stage: PostProcessStage | PostProcessStageComposite): boolean;
  35282. /**
  35283. * Gets the post-process stage at <code>index</code>.
  35284. * @param index - The index of the post-process stage.
  35285. * @returns The post-process stage at index.
  35286. */
  35287. get(index: number): PostProcessStage | PostProcessStageComposite;
  35288. /**
  35289. * Removes all post-process stages from the collection and destroys them.
  35290. */
  35291. removeAll(): void;
  35292. /**
  35293. * Returns true if this object was destroyed; otherwise, false.
  35294. <p>
  35295. If this object was destroyed, it should not be used; calling any function other than
  35296. <code>isDestroyed</code> will result in a {@link DeveloperError} exception.
  35297. </p>
  35298. * @returns <code>true</code> if this object was destroyed; otherwise, <code>false</code>.
  35299. */
  35300. isDestroyed(): boolean;
  35301. /**
  35302. * Destroys the WebGL resources held by this object. Destroying an object allows for deterministic
  35303. release of WebGL resources, instead of relying on the garbage collector to destroy this object.
  35304. <p>
  35305. Once an object is destroyed, it should not be used; calling any function other than
  35306. <code>isDestroyed</code> will result in a {@link DeveloperError} exception. Therefore,
  35307. assign the return value (<code>undefined</code>) to the object as done in the example.
  35308. </p>
  35309. */
  35310. destroy(): void;
  35311. }
  35312. /**
  35313. * A collection of {@link PostProcessStage}s or other post-process composite stages that execute together logically.
  35314. <p>
  35315. All stages are executed in the order of the array. The input texture changes based on the value of <code>inputPreviousStageTexture</code>.
  35316. 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.
  35317. 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
  35318. or the output texture of the previous stage.
  35319. </p>
  35320. * @example
  35321. * // Example 1: separable blur filter
  35322. // The input to blurXDirection is the texture rendered to by the scene or the output of the previous stage.
  35323. // The input to blurYDirection is the texture rendered to by blurXDirection.
  35324. scene.postProcessStages.add(new Cesium.PostProcessStageComposite({
  35325. stages : [blurXDirection, blurYDirection]
  35326. }));
  35327. * @example
  35328. * // Example 2: referencing the output of another post-process stage
  35329. scene.postProcessStages.add(new Cesium.PostProcessStageComposite({
  35330. inputPreviousStageTexture : false,
  35331. stages : [
  35332. // The same as Example 1.
  35333. new Cesium.PostProcessStageComposite({
  35334. inputPreviousStageTexture : true
  35335. stages : [blurXDirection, blurYDirection],
  35336. name : 'blur'
  35337. }),
  35338. // The input texture for this stage is the same input texture to blurXDirection since inputPreviousStageTexture is false
  35339. new Cesium.PostProcessStage({
  35340. fragmentShader : compositeShader,
  35341. uniforms : {
  35342. blurTexture : 'blur' // The output of the composite with name 'blur' (the texture that blurYDirection rendered to).
  35343. }
  35344. })
  35345. ]
  35346. });
  35347. * @example
  35348. * // Example 3: create a uniform alias
  35349. var uniforms = {};
  35350. Cesium.defineProperties(uniforms, {
  35351. filterSize : {
  35352. get : function() {
  35353. return blurXDirection.uniforms.filterSize;
  35354. },
  35355. set : function(value) {
  35356. blurXDirection.uniforms.filterSize = blurYDirection.uniforms.filterSize = value;
  35357. }
  35358. }
  35359. });
  35360. scene.postProcessStages.add(new Cesium.PostProcessStageComposite({
  35361. stages : [blurXDirection, blurYDirection],
  35362. uniforms : uniforms
  35363. }));
  35364. * @param options - An object with the following properties:
  35365. * @param options.stages - An array of {@link PostProcessStage}s or composites to be executed in order.
  35366. * @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.
  35367. * @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.
  35368. * @param [options.uniforms] - An alias to the uniforms of post-process stages.
  35369. */
  35370. export class PostProcessStageComposite {
  35371. constructor(options: {
  35372. stages: any[];
  35373. inputPreviousStageTexture?: boolean;
  35374. name?: string;
  35375. uniforms?: any;
  35376. });
  35377. /**
  35378. * Determines if this post-process stage is ready to be executed.
  35379. */
  35380. readonly ready: boolean;
  35381. /**
  35382. * The unique name of this post-process stage for reference by other stages in a PostProcessStageComposite.
  35383. */
  35384. readonly name: string;
  35385. /**
  35386. * Whether or not to execute this post-process stage when ready.
  35387. */
  35388. enabled: boolean;
  35389. /**
  35390. * 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.
  35391. */
  35392. uniforms: any;
  35393. /**
  35394. * All post-process stages are executed in the order of the array. The input texture changes based on the value of <code>inputPreviousStageTexture</code>.
  35395. 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.
  35396. 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
  35397. or the output texture of the previous stage.
  35398. */
  35399. readonly inputPreviousStageTexture: boolean;
  35400. /**
  35401. * The number of post-process stages in this composite.
  35402. */
  35403. readonly length: number;
  35404. /**
  35405. * The features selected for applying the post-process.
  35406. */
  35407. selected: any[];
  35408. /**
  35409. * Gets the post-process stage at <code>index</code>
  35410. * @param index - The index of the post-process stage or composite.
  35411. * @returns The post-process stage or composite at index.
  35412. */
  35413. get(index: number): PostProcessStage | PostProcessStageComposite;
  35414. /**
  35415. * Returns true if this object was destroyed; otherwise, false.
  35416. <p>
  35417. If this object was destroyed, it should not be used; calling any function other than
  35418. <code>isDestroyed</code> will result in a {@link DeveloperError} exception.
  35419. </p>
  35420. * @returns <code>true</code> if this object was destroyed; otherwise, <code>false</code>.
  35421. */
  35422. isDestroyed(): boolean;
  35423. /**
  35424. * Destroys the WebGL resources held by this object. Destroying an object allows for deterministic
  35425. release of WebGL resources, instead of relying on the garbage collector to destroy this object.
  35426. <p>
  35427. Once an object is destroyed, it should not be used; calling any function other than
  35428. <code>isDestroyed</code> will result in a {@link DeveloperError} exception. Therefore,
  35429. assign the return value (<code>undefined</code>) to the object as done in the example.
  35430. </p>
  35431. */
  35432. destroy(): void;
  35433. }
  35434. /**
  35435. * Contains functions for creating common post-process stages.
  35436. */
  35437. export namespace PostProcessStageLibrary {
  35438. /**
  35439. * Creates a post-process stage that applies a Gaussian blur to the input texture. This stage is usually applied in conjunction with another stage.
  35440. <p>
  35441. This stage has the following uniforms: <code>delta</code>, <code>sigma</code>, and <code>stepSize</code>.
  35442. </p>
  35443. <p>
  35444. <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>.
  35445. The default value for <code>delta</code> is <code>1.0</code>. The default value for <code>sigma</code> is <code>2.0</code>.
  35446. <code>stepSize</code> is the distance to the next texel. The default is <code>1.0</code>.
  35447. </p>
  35448. * @returns A post-process stage that applies a Gaussian blur to the input texture.
  35449. */
  35450. function createBlurStage(): PostProcessStageComposite;
  35451. /**
  35452. * Creates a post-process stage that applies a depth of field effect.
  35453. <p>
  35454. Depth of field simulates camera focus. Objects in the scene that are in focus
  35455. will be clear whereas objects not in focus will be blurred.
  35456. </p>
  35457. <p>
  35458. This stage has the following uniforms: <code>focalDistance</code>, <code>delta</code>, <code>sigma</code>, and <code>stepSize</code>.
  35459. </p>
  35460. <p>
  35461. <code>focalDistance</code> is the distance in meters from the camera to set the camera focus.
  35462. </p>
  35463. <p>
  35464. <code>delta</code>, <code>sigma</code>, and <code>stepSize</code> are the same properties as {@link PostProcessStageLibrary#createBlurStage}.
  35465. The blur is applied to the areas out of focus.
  35466. </p>
  35467. * @returns A post-process stage that applies a depth of field effect.
  35468. */
  35469. function createDepthOfFieldStage(): PostProcessStageComposite;
  35470. /**
  35471. * Whether or not a depth of field stage is supported.
  35472. <p>
  35473. This stage requires the WEBGL_depth_texture extension.
  35474. </p>
  35475. * @param scene - The scene.
  35476. * @returns Whether this post process stage is supported.
  35477. */
  35478. function isDepthOfFieldSupported(scene: Scene): boolean;
  35479. /**
  35480. * Creates a post-process stage that detects edges.
  35481. <p>
  35482. Writes the color to the output texture with alpha set to 1.0 when it is on an edge.
  35483. </p>
  35484. <p>
  35485. This stage has the following uniforms: <code>color</code> and <code>length</code>
  35486. </p>
  35487. <ul>
  35488. <li><code>color</code> is the color of the highlighted edge. The default is {@link Color#BLACK}.</li>
  35489. <li><code>length</code> is the length of the edges in pixels. The default is <code>0.5</code>.</li>
  35490. </ul>
  35491. <p>
  35492. This stage is not supported in 2D.
  35493. </p>
  35494. * @example
  35495. * // multiple silhouette effects
  35496. var yellowEdge = Cesium.PostProcessLibrary.createEdgeDetectionStage();
  35497. yellowEdge.uniforms.color = Cesium.Color.YELLOW;
  35498. yellowEdge.selected = [feature0];
  35499. var greenEdge = Cesium.PostProcessLibrary.createEdgeDetectionStage();
  35500. greenEdge.uniforms.color = Cesium.Color.LIME;
  35501. greenEdge.selected = [feature1];
  35502. // draw edges around feature0 and feature1
  35503. postProcessStages.add(Cesium.PostProcessLibrary.createSilhouetteStage([yellowEdge, greenEdge]);
  35504. * @returns A post-process stage that applies an edge detection effect.
  35505. */
  35506. function createEdgeDetectionStage(): PostProcessStageComposite;
  35507. /**
  35508. * Whether or not an edge detection stage is supported.
  35509. <p>
  35510. This stage requires the WEBGL_depth_texture extension.
  35511. </p>
  35512. * @param scene - The scene.
  35513. * @returns Whether this post process stage is supported.
  35514. */
  35515. function isEdgeDetectionSupported(scene: Scene): boolean;
  35516. /**
  35517. * Creates a post-process stage that applies a silhouette effect.
  35518. <p>
  35519. A silhouette effect composites the color from the edge detection pass with input color texture.
  35520. </p>
  35521. <p>
  35522. This stage has the following uniforms when <code>edgeDetectionStages</code> is <code>undefined</code>: <code>color</code> and <code>length</code>
  35523. </p>
  35524. <p>
  35525. <code>color</code> is the color of the highlighted edge. The default is {@link Color#BLACK}.
  35526. <code>length</code> is the length of the edges in pixels. The default is <code>0.5</code>.
  35527. </p>
  35528. * @param [edgeDetectionStages] - An array of edge detection post process stages.
  35529. * @returns A post-process stage that applies a silhouette effect.
  35530. */
  35531. function createSilhouetteStage(edgeDetectionStages?: PostProcessStage[]): PostProcessStageComposite;
  35532. /**
  35533. * Whether or not a silhouette stage is supported.
  35534. <p>
  35535. This stage requires the WEBGL_depth_texture extension.
  35536. </p>
  35537. * @param scene - The scene.
  35538. * @returns Whether this post process stage is supported.
  35539. */
  35540. function isSilhouetteSupported(scene: Scene): boolean;
  35541. /**
  35542. * Whether or not an ambient occlusion stage is supported.
  35543. <p>
  35544. This stage requires the WEBGL_depth_texture extension.
  35545. </p>
  35546. * @param scene - The scene.
  35547. * @returns Whether this post process stage is supported.
  35548. */
  35549. function isAmbientOcclusionSupported(scene: Scene): boolean;
  35550. /**
  35551. * Creates a post-process stage that renders the input texture with black and white gradations.
  35552. <p>
  35553. This stage has one uniform value, <code>gradations</code>, which scales the luminance of each pixel.
  35554. </p>
  35555. * @returns A post-process stage that renders the input texture with black and white gradations.
  35556. */
  35557. function createBlackAndWhiteStage(): PostProcessStage;
  35558. /**
  35559. * Creates a post-process stage that saturates the input texture.
  35560. <p>
  35561. This stage has one uniform value, <code>brightness</code>, which scales the saturation of each pixel.
  35562. </p>
  35563. * @returns A post-process stage that saturates the input texture.
  35564. */
  35565. function createBrightnessStage(): PostProcessStage;
  35566. /**
  35567. * Creates a post-process stage that adds a night vision effect to the input texture.
  35568. * @returns A post-process stage that adds a night vision effect to the input texture.
  35569. */
  35570. function createNightVisionStage(): PostProcessStage;
  35571. /**
  35572. * Creates a post-process stage that applies an effect simulating light flaring a camera lens.
  35573. <p>
  35574. This stage has the following uniforms: <code>dirtTexture</code>, <code>starTexture</code>, <code>intensity</code>, <code>distortion</code>, <code>ghostDispersal</code>,
  35575. <code>haloWidth</code>, <code>dirtAmount</code>, and <code>earthRadius</code>.
  35576. <ul>
  35577. <li><code>dirtTexture</code> is a texture sampled to simulate dirt on the lens.</li>
  35578. <li><code>starTexture</code> is the texture sampled for the star pattern of the flare.</li>
  35579. <li><code>intensity</code> is a scalar multiplied by the result of the lens flare. The default value is <code>2.0</code>.</li>
  35580. <li><code>distortion</code> is a scalar value that affects the chromatic effect distortion. The default value is <code>10.0</code>.</li>
  35581. <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>
  35582. <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>
  35583. <li><code>dirtAmount</code> is a scalar representing the amount of dirt on the lens. The default value is <code>0.4</code>.</li>
  35584. <li><code>earthRadius</code> is the maximum radius of the earth. The default value is <code>Ellipsoid.WGS84.maximumRadius</code>.</li>
  35585. </ul>
  35586. </p>
  35587. * @returns A post-process stage for applying a lens flare effect.
  35588. */
  35589. function createLensFlareStage(): PostProcessStage;
  35590. }
  35591. /**
  35592. * Determines how input texture to a {@link PostProcessStage} is sampled.
  35593. */
  35594. export enum PostProcessStageSampleMode {
  35595. /**
  35596. * Samples the texture by returning the closest texel.
  35597. */
  35598. NEAREST = 0,
  35599. /**
  35600. * Samples the texture through bi-linear interpolation of the four nearest texels.
  35601. */
  35602. LINEAR = 1
  35603. }
  35604. /**
  35605. * A primitive represents geometry in the {@link Scene}. The geometry can be from a single {@link GeometryInstance}
  35606. as shown in example 1 below, or from an array of instances, even if the geometry is from different
  35607. geometry types, e.g., an {@link RectangleGeometry} and an {@link EllipsoidGeometry} as shown in Code Example 2.
  35608. <p>
  35609. A primitive combines geometry instances with an {@link Appearance} that describes the full shading, including
  35610. {@link Material} and {@link RenderState}. Roughly, the geometry instance defines the structure and placement,
  35611. and the appearance defines the visual characteristics. Decoupling geometry and appearance allows us to mix
  35612. and match most of them and add a new geometry or appearance independently of each other.
  35613. </p>
  35614. <p>
  35615. Combining multiple instances into one primitive is called batching, and significantly improves performance for static data.
  35616. Instances can be individually picked; {@link Scene#pick} returns their {@link GeometryInstance#id}. Using
  35617. per-instance appearances like {@link PerInstanceColorAppearance}, each instance can also have a unique color.
  35618. </p>
  35619. <p>
  35620. {@link Geometry} can either be created and batched on a web worker or the main thread. The first two examples
  35621. show geometry that will be created on a web worker by using the descriptions of the geometry. The third example
  35622. shows how to create the geometry on the main thread by explicitly calling the <code>createGeometry</code> method.
  35623. </p>
  35624. * @example
  35625. * // 1. Draw a translucent ellipse on the surface with a checkerboard pattern
  35626. var instance = new Cesium.GeometryInstance({
  35627. geometry : new Cesium.EllipseGeometry({
  35628. center : Cesium.Cartesian3.fromDegrees(-100.0, 20.0),
  35629. semiMinorAxis : 500000.0,
  35630. semiMajorAxis : 1000000.0,
  35631. rotation : Cesium.Math.PI_OVER_FOUR,
  35632. vertexFormat : Cesium.VertexFormat.POSITION_AND_ST
  35633. }),
  35634. id : 'object returned when this instance is picked and to get/set per-instance attributes'
  35635. });
  35636. scene.primitives.add(new Cesium.Primitive({
  35637. geometryInstances : instance,
  35638. appearance : new Cesium.EllipsoidSurfaceAppearance({
  35639. material : Cesium.Material.fromType('Checkerboard')
  35640. })
  35641. }));
  35642. * @example
  35643. * // 2. Draw different instances each with a unique color
  35644. var rectangleInstance = new Cesium.GeometryInstance({
  35645. geometry : new Cesium.RectangleGeometry({
  35646. rectangle : Cesium.Rectangle.fromDegrees(-140.0, 30.0, -100.0, 40.0),
  35647. vertexFormat : Cesium.PerInstanceColorAppearance.VERTEX_FORMAT
  35648. }),
  35649. id : 'rectangle',
  35650. attributes : {
  35651. color : new Cesium.ColorGeometryInstanceAttribute(0.0, 1.0, 1.0, 0.5)
  35652. }
  35653. });
  35654. var ellipsoidInstance = new Cesium.GeometryInstance({
  35655. geometry : new Cesium.EllipsoidGeometry({
  35656. radii : new Cesium.Cartesian3(500000.0, 500000.0, 1000000.0),
  35657. vertexFormat : Cesium.VertexFormat.POSITION_AND_NORMAL
  35658. }),
  35659. modelMatrix : Cesium.Matrix4.multiplyByTranslation(Cesium.Transforms.eastNorthUpToFixedFrame(
  35660. Cesium.Cartesian3.fromDegrees(-95.59777, 40.03883)), new Cesium.Cartesian3(0.0, 0.0, 500000.0), new Cesium.Matrix4()),
  35661. id : 'ellipsoid',
  35662. attributes : {
  35663. color : Cesium.ColorGeometryInstanceAttribute.fromColor(Cesium.Color.AQUA)
  35664. }
  35665. });
  35666. scene.primitives.add(new Cesium.Primitive({
  35667. geometryInstances : [rectangleInstance, ellipsoidInstance],
  35668. appearance : new Cesium.PerInstanceColorAppearance()
  35669. }));
  35670. * @example
  35671. * // 3. Create the geometry on the main thread.
  35672. scene.primitives.add(new Cesium.Primitive({
  35673. geometryInstances : new Cesium.GeometryInstance({
  35674. geometry : Cesium.EllipsoidGeometry.createGeometry(new Cesium.EllipsoidGeometry({
  35675. radii : new Cesium.Cartesian3(500000.0, 500000.0, 1000000.0),
  35676. vertexFormat : Cesium.VertexFormat.POSITION_AND_NORMAL
  35677. })),
  35678. modelMatrix : Cesium.Matrix4.multiplyByTranslation(Cesium.Transforms.eastNorthUpToFixedFrame(
  35679. Cesium.Cartesian3.fromDegrees(-95.59777, 40.03883)), new Cesium.Cartesian3(0.0, 0.0, 500000.0), new Cesium.Matrix4()),
  35680. id : 'ellipsoid',
  35681. attributes : {
  35682. color : Cesium.ColorGeometryInstanceAttribute.fromColor(Cesium.Color.AQUA)
  35683. }
  35684. }),
  35685. appearance : new Cesium.PerInstanceColorAppearance()
  35686. }));
  35687. * @param [options] - Object with the following properties:
  35688. * @param [options.geometryInstances] - The geometry instances - or a single geometry instance - to render.
  35689. * @param [options.appearance] - The appearance used to render the primitive.
  35690. * @param [options.depthFailAppearance] - The appearance used to shade this primitive when it fails the depth test.
  35691. * @param [options.show = true] - Determines if this primitive will be shown.
  35692. * @param [options.modelMatrix = Matrix4.IDENTITY] - The 4x4 transformation matrix that transforms the primitive (all geometry instances) from model to world coordinates.
  35693. * @param [options.vertexCacheOptimize = false] - When <code>true</code>, geometry vertices are optimized for the pre and post-vertex-shader caches.
  35694. * @param [options.interleave = false] - When <code>true</code>, geometry vertex attributes are interleaved, which can slightly improve rendering performance but increases load time.
  35695. * @param [options.compressVertices = true] - When <code>true</code>, the geometry vertices are compressed, which will save memory.
  35696. * @param [options.releaseGeometryInstances = true] - When <code>true</code>, the primitive does not keep a reference to the input <code>geometryInstances</code> to save memory.
  35697. * @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.
  35698. * @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.
  35699. * @param [options.asynchronous = true] - Determines if the primitive will be created asynchronously or block until ready.
  35700. * @param [options.debugShowBoundingVolume = false] - For debugging only. Determines if this primitive's commands' bounding spheres are shown.
  35701. * @param [options.shadows = ShadowMode.DISABLED] - Determines whether this primitive casts or receives shadows from light sources.
  35702. */
  35703. export class Primitive {
  35704. constructor(options?: {
  35705. geometryInstances?: GeometryInstance[] | GeometryInstance;
  35706. appearance?: Appearance;
  35707. depthFailAppearance?: Appearance;
  35708. show?: boolean;
  35709. modelMatrix?: Matrix4;
  35710. vertexCacheOptimize?: boolean;
  35711. interleave?: boolean;
  35712. compressVertices?: boolean;
  35713. releaseGeometryInstances?: boolean;
  35714. allowPicking?: boolean;
  35715. cull?: boolean;
  35716. asynchronous?: boolean;
  35717. debugShowBoundingVolume?: boolean;
  35718. shadows?: ShadowMode;
  35719. });
  35720. /**
  35721. * The geometry instances rendered with this primitive. This may
  35722. be <code>undefined</code> if <code>options.releaseGeometryInstances</code>
  35723. is <code>true</code> when the primitive is constructed.
  35724. <p>
  35725. Changing this property after the primitive is rendered has no effect.
  35726. </p>
  35727. */
  35728. readonly geometryInstances: GeometryInstance[] | GeometryInstance;
  35729. /**
  35730. * The {@link Appearance} used to shade this primitive. Each geometry
  35731. instance is shaded with the same appearance. Some appearances, like
  35732. {@link PerInstanceColorAppearance} allow giving each instance unique
  35733. properties.
  35734. */
  35735. appearance: Appearance;
  35736. /**
  35737. * The {@link Appearance} used to shade this primitive when it fails the depth test. Each geometry
  35738. instance is shaded with the same appearance. Some appearances, like
  35739. {@link PerInstanceColorAppearance} allow giving each instance unique
  35740. properties.
  35741. <p>
  35742. When using an appearance that requires a color attribute, like PerInstanceColorAppearance,
  35743. add a depthFailColor per-instance attribute instead.
  35744. </p>
  35745. <p>
  35746. Requires the EXT_frag_depth WebGL extension to render properly. If the extension is not supported,
  35747. there may be artifacts.
  35748. </p>
  35749. */
  35750. depthFailAppearance: Appearance;
  35751. /**
  35752. * The 4x4 transformation matrix that transforms the primitive (all geometry instances) from model to world coordinates.
  35753. When this is the identity matrix, the primitive is drawn in world coordinates, i.e., Earth's WGS84 coordinates.
  35754. Local reference frames can be used by providing a different transformation matrix, like that returned
  35755. by {@link Transforms.eastNorthUpToFixedFrame}.
  35756. <p>
  35757. This property is only supported in 3D mode.
  35758. </p>
  35759. * @example
  35760. * var origin = Cesium.Cartesian3.fromDegrees(-95.0, 40.0, 200000.0);
  35761. p.modelMatrix = Cesium.Transforms.eastNorthUpToFixedFrame(origin);
  35762. */
  35763. modelMatrix: Matrix4;
  35764. /**
  35765. * Determines if the primitive will be shown. This affects all geometry
  35766. instances in the primitive.
  35767. */
  35768. show: boolean;
  35769. /**
  35770. * When <code>true</code>, the renderer frustum culls and horizon culls the primitive's commands
  35771. based on their bounding volume. Set this to <code>false</code> for a small performance gain
  35772. if you are manually culling the primitive.
  35773. */
  35774. cull: boolean;
  35775. /**
  35776. * This property is for debugging only; it is not for production use nor is it optimized.
  35777. <p>
  35778. Draws the bounding sphere for each draw command in the primitive.
  35779. </p>
  35780. */
  35781. debugShowBoundingVolume: boolean;
  35782. /**
  35783. * Determines whether this primitive casts or receives shadows from light sources.
  35784. */
  35785. shadows: ShadowMode;
  35786. /**
  35787. * When <code>true</code>, geometry vertices are optimized for the pre and post-vertex-shader caches.
  35788. */
  35789. readonly vertexCacheOptimize: boolean;
  35790. /**
  35791. * Determines if geometry vertex attributes are interleaved, which can slightly improve rendering performance.
  35792. */
  35793. readonly interleave: boolean;
  35794. /**
  35795. * When <code>true</code>, the primitive does not keep a reference to the input <code>geometryInstances</code> to save memory.
  35796. */
  35797. readonly releaseGeometryInstances: boolean;
  35798. /**
  35799. * When <code>true</code>, each geometry instance will only be pickable with {@link Scene#pick}. When <code>false</code>, GPU memory is saved. *
  35800. */
  35801. readonly allowPicking: boolean;
  35802. /**
  35803. * Determines if the geometry instances will be created and batched on a web worker.
  35804. */
  35805. readonly asynchronous: boolean;
  35806. /**
  35807. * When <code>true</code>, geometry vertices are compressed, which will save memory.
  35808. */
  35809. readonly compressVertices: boolean;
  35810. /**
  35811. * Determines if the primitive is complete and ready to render. If this property is
  35812. true, the primitive will be rendered the next time that {@link Primitive#update}
  35813. is called.
  35814. */
  35815. readonly ready: boolean;
  35816. /**
  35817. * Gets a promise that resolves when the primitive is ready to render.
  35818. */
  35819. readonly readyPromise: Promise<Primitive>;
  35820. /**
  35821. * Called when {@link Viewer} or {@link CesiumWidget} render the scene to
  35822. get the draw commands needed to render this primitive.
  35823. <p>
  35824. Do not call this function directly. This is documented just to
  35825. list the exceptions that may be propagated when the scene is rendered:
  35826. </p>
  35827. */
  35828. update(): void;
  35829. /**
  35830. * Returns the modifiable per-instance attributes for a {@link GeometryInstance}.
  35831. * @example
  35832. * var attributes = primitive.getGeometryInstanceAttributes('an id');
  35833. attributes.color = Cesium.ColorGeometryInstanceAttribute.toValue(Cesium.Color.AQUA);
  35834. attributes.show = Cesium.ShowGeometryInstanceAttribute.toValue(true);
  35835. attributes.distanceDisplayCondition = Cesium.DistanceDisplayConditionGeometryInstanceAttribute.toValue(100.0, 10000.0);
  35836. attributes.offset = Cesium.OffsetGeometryInstanceAttribute.toValue(Cartesian3.IDENTITY);
  35837. * @param id - The id of the {@link GeometryInstance}.
  35838. * @returns The typed array in the attribute's format or undefined if the is no instance with id.
  35839. */
  35840. getGeometryInstanceAttributes(id: any): any;
  35841. /**
  35842. * Returns true if this object was destroyed; otherwise, false.
  35843. <p>
  35844. If this object was destroyed, it should not be used; calling any function other than
  35845. <code>isDestroyed</code> will result in a {@link DeveloperError} exception.
  35846. </p>
  35847. * @returns <code>true</code> if this object was destroyed; otherwise, <code>false</code>.
  35848. */
  35849. isDestroyed(): boolean;
  35850. /**
  35851. * Destroys the WebGL resources held by this object. Destroying an object allows for deterministic
  35852. release of WebGL resources, instead of relying on the garbage collector to destroy this object.
  35853. <p>
  35854. Once an object is destroyed, it should not be used; calling any function other than
  35855. <code>isDestroyed</code> will result in a {@link DeveloperError} exception. Therefore,
  35856. assign the return value (<code>undefined</code>) to the object as done in the example.
  35857. </p>
  35858. * @example
  35859. * e = e && e.destroy();
  35860. */
  35861. destroy(): void;
  35862. }
  35863. /**
  35864. * A collection of primitives. This is most often used with {@link Scene#primitives},
  35865. but <code>PrimitiveCollection</code> is also a primitive itself so collections can
  35866. be added to collections forming a hierarchy.
  35867. * @example
  35868. * var billboards = new Cesium.BillboardCollection();
  35869. var labels = new Cesium.LabelCollection();
  35870. var collection = new Cesium.PrimitiveCollection();
  35871. collection.add(billboards);
  35872. scene.primitives.add(collection); // Add collection
  35873. scene.primitives.add(labels); // Add regular primitive
  35874. * @param [options] - Object with the following properties:
  35875. * @param [options.show = true] - Determines if the primitives in the collection will be shown.
  35876. * @param [options.destroyPrimitives = true] - Determines if primitives in the collection are destroyed when they are removed.
  35877. */
  35878. export class PrimitiveCollection {
  35879. constructor(options?: {
  35880. show?: boolean;
  35881. destroyPrimitives?: boolean;
  35882. });
  35883. /**
  35884. * Determines if primitives in this collection will be shown.
  35885. */
  35886. show: boolean;
  35887. /**
  35888. * Determines if primitives in the collection are destroyed when they are removed by
  35889. {@link PrimitiveCollection#destroy} or {@link PrimitiveCollection#remove} or implicitly
  35890. by {@link PrimitiveCollection#removeAll}.
  35891. * @example
  35892. * // Example 1. Primitives are destroyed by default.
  35893. var primitives = new Cesium.PrimitiveCollection();
  35894. var labels = primitives.add(new Cesium.LabelCollection());
  35895. primitives = primitives.destroy();
  35896. var b = labels.isDestroyed(); // true
  35897. * @example
  35898. * // Example 2. Do not destroy primitives in a collection.
  35899. var primitives = new Cesium.PrimitiveCollection();
  35900. primitives.destroyPrimitives = false;
  35901. var labels = primitives.add(new Cesium.LabelCollection());
  35902. primitives = primitives.destroy();
  35903. var b = labels.isDestroyed(); // false
  35904. labels = labels.destroy(); // explicitly destroy
  35905. */
  35906. destroyPrimitives: boolean;
  35907. /**
  35908. * Gets the number of primitives in the collection.
  35909. */
  35910. readonly length: number;
  35911. /**
  35912. * Adds a primitive to the collection.
  35913. * @example
  35914. * var billboards = scene.primitives.add(new Cesium.BillboardCollection());
  35915. * @param primitive - The primitive to add.
  35916. * @param [index] - The index to add the layer at. If omitted, the primitive will be added at the bottom of all existing primitives.
  35917. * @returns The primitive added to the collection.
  35918. */
  35919. add(primitive: any, index?: number): any;
  35920. /**
  35921. * Removes a primitive from the collection.
  35922. * @example
  35923. * var billboards = scene.primitives.add(new Cesium.BillboardCollection());
  35924. scene.primitives.remove(billboards); // Returns true
  35925. * @param [primitive] - The primitive to remove.
  35926. * @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.
  35927. */
  35928. remove(primitive?: any): boolean;
  35929. /**
  35930. * Removes all primitives in the collection.
  35931. */
  35932. removeAll(): void;
  35933. /**
  35934. * Determines if this collection contains a primitive.
  35935. * @param [primitive] - The primitive to check for.
  35936. * @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.
  35937. */
  35938. contains(primitive?: any): boolean;
  35939. /**
  35940. * Raises a primitive "up one" in the collection. If all primitives in the collection are drawn
  35941. on the globe surface, this visually moves the primitive up one.
  35942. * @param [primitive] - The primitive to raise.
  35943. */
  35944. raise(primitive?: any): void;
  35945. /**
  35946. * Raises a primitive to the "top" of the collection. If all primitives in the collection are drawn
  35947. on the globe surface, this visually moves the primitive to the top.
  35948. * @param [primitive] - The primitive to raise the top.
  35949. */
  35950. raiseToTop(primitive?: any): void;
  35951. /**
  35952. * Lowers a primitive "down one" in the collection. If all primitives in the collection are drawn
  35953. on the globe surface, this visually moves the primitive down one.
  35954. * @param [primitive] - The primitive to lower.
  35955. */
  35956. lower(primitive?: any): void;
  35957. /**
  35958. * Lowers a primitive to the "bottom" of the collection. If all primitives in the collection are drawn
  35959. on the globe surface, this visually moves the primitive to the bottom.
  35960. * @param [primitive] - The primitive to lower to the bottom.
  35961. */
  35962. lowerToBottom(primitive?: any): void;
  35963. /**
  35964. * Returns the primitive in the collection at the specified index.
  35965. * @example
  35966. * // Toggle the show property of every primitive in the collection.
  35967. var primitives = scene.primitives;
  35968. var length = primitives.length;
  35969. for (var i = 0; i < length; ++i) {
  35970. var p = primitives.get(i);
  35971. p.show = !p.show;
  35972. }
  35973. * @param index - The zero-based index of the primitive to return.
  35974. * @returns The primitive at the <code>index</code>.
  35975. */
  35976. get(index: number): any;
  35977. /**
  35978. * Returns true if this object was destroyed; otherwise, false.
  35979. <br /><br />
  35980. If this object was destroyed, it should not be used; calling any function other than
  35981. <code>isDestroyed</code> will result in a {@link DeveloperError} exception.
  35982. * @returns True if this object was destroyed; otherwise, false.
  35983. */
  35984. isDestroyed(): boolean;
  35985. /**
  35986. * Destroys the WebGL resources held by each primitive in this collection. Explicitly destroying this
  35987. collection allows for deterministic release of WebGL resources, instead of relying on the garbage
  35988. collector to destroy this collection.
  35989. <br /><br />
  35990. Since destroying a collection destroys all the contained primitives, only destroy a collection
  35991. when you are sure no other code is still using any of the contained primitives.
  35992. <br /><br />
  35993. Once this collection is destroyed, it should not be used; calling any function other than
  35994. <code>isDestroyed</code> will result in a {@link DeveloperError} exception. Therefore,
  35995. assign the return value (<code>undefined</code>) to the object as done in the example.
  35996. * @example
  35997. * primitives = primitives && primitives.destroy();
  35998. */
  35999. destroy(): void;
  36000. }
  36001. /**
  36002. * The container for all 3D graphical objects and state in a Cesium virtual scene. Generally,
  36003. a scene is not created directly; instead, it is implicitly created by {@link CesiumWidget}.
  36004. <p>
  36005. <em><code>contextOptions</code> parameter details:</em>
  36006. </p>
  36007. <p>
  36008. The default values are:
  36009. <code>
  36010. {
  36011. webgl : {
  36012. alpha : false,
  36013. depth : true,
  36014. stencil : false,
  36015. antialias : true,
  36016. powerPreference: 'high-performance',
  36017. premultipliedAlpha : true,
  36018. preserveDrawingBuffer : false,
  36019. failIfMajorPerformanceCaveat : false
  36020. },
  36021. allowTextureFilterAnisotropic : true
  36022. }
  36023. </code>
  36024. </p>
  36025. <p>
  36026. The <code>webgl</code> property corresponds to the {@link http://www.khronos.org/registry/webgl/specs/latest/#5.2|WebGLContextAttributes}
  36027. object used to create the WebGL context.
  36028. </p>
  36029. <p>
  36030. <code>webgl.alpha</code> defaults to false, which can improve performance compared to the standard WebGL default
  36031. of true. If an application needs to composite Cesium above other HTML elements using alpha-blending, set
  36032. <code>webgl.alpha</code> to true.
  36033. </p>
  36034. <p>
  36035. The other <code>webgl</code> properties match the WebGL defaults for {@link http://www.khronos.org/registry/webgl/specs/latest/#5.2|WebGLContextAttributes}.
  36036. </p>
  36037. <p>
  36038. <code>allowTextureFilterAnisotropic</code> defaults to true, which enables anisotropic texture filtering when the
  36039. WebGL extension is supported. Setting this to false will improve performance, but hurt visual quality, especially for horizon views.
  36040. </p>
  36041. * @example
  36042. * // Create scene without anisotropic texture filtering
  36043. var scene = new Cesium.Scene({
  36044. canvas : canvas,
  36045. contextOptions : {
  36046. allowTextureFilterAnisotropic : false
  36047. }
  36048. });
  36049. * @param [options] - Object with the following properties:
  36050. * @param options.canvas - The HTML canvas element to create the scene for.
  36051. * @param [options.contextOptions] - Context and WebGL creation properties. See details above.
  36052. * @param [options.creditContainer] - The HTML element in which the credits will be displayed.
  36053. * @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.
  36054. * @param [options.mapProjection = new GeographicProjection()] - The map projection to use in 2D and Columbus View modes.
  36055. * @param [options.orderIndependentTranslucency = true] - If true and the configuration supports it, use order independent translucency.
  36056. * @param [options.scene3DOnly = false] - If true, optimizes memory use and performance for 3D mode but disables the ability to use 2D or Columbus View.
  36057. * @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.
  36058. * @param [options.shadows = false] - Determines if shadows are cast by light sources.
  36059. * @param [options.mapMode2D = MapMode2D.INFINITE_SCROLL] - Determines if the 2D map is rotatable or can be scrolled infinitely in the horizontal direction.
  36060. * @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}.
  36061. * @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}.
  36062. */
  36063. export class Scene {
  36064. constructor(options?: {
  36065. canvas: HTMLCanvasElement;
  36066. contextOptions?: any;
  36067. creditContainer?: Element;
  36068. creditViewport?: Element;
  36069. mapProjection?: MapProjection;
  36070. orderIndependentTranslucency?: boolean;
  36071. scene3DOnly?: boolean;
  36072. terrainExaggeration?: number;
  36073. shadows?: boolean;
  36074. mapMode2D?: MapMode2D;
  36075. requestRenderMode?: boolean;
  36076. maximumRenderTimeChange?: number;
  36077. });
  36078. /**
  36079. * Exceptions occurring in <code>render</code> are always caught in order to raise the
  36080. <code>renderError</code> event. If this property is true, the error is rethrown
  36081. after the event is raised. If this property is false, the <code>render</code> function
  36082. returns normally after raising the event.
  36083. */
  36084. rethrowRenderErrors: boolean;
  36085. /**
  36086. * Determines whether or not to instantly complete the
  36087. scene transition animation on user input.
  36088. */
  36089. completeMorphOnUserInput: boolean;
  36090. /**
  36091. * The event fired at the beginning of a scene transition.
  36092. */
  36093. morphStart: Event;
  36094. /**
  36095. * The event fired at the completion of a scene transition.
  36096. */
  36097. morphComplete: Event;
  36098. /**
  36099. * The {@link SkyBox} used to draw the stars.
  36100. */
  36101. skyBox: SkyBox;
  36102. /**
  36103. * The sky atmosphere drawn around the globe.
  36104. */
  36105. skyAtmosphere: SkyAtmosphere;
  36106. /**
  36107. * The {@link Sun}.
  36108. */
  36109. sun: Sun;
  36110. /**
  36111. * Uses a bloom filter on the sun when enabled.
  36112. */
  36113. sunBloom: boolean;
  36114. /**
  36115. * The {@link Moon}
  36116. */
  36117. moon: Moon;
  36118. /**
  36119. * The background color, which is only visible if there is no sky box, i.e., {@link Scene#skyBox} is undefined.
  36120. */
  36121. backgroundColor: Color;
  36122. /**
  36123. * The current morph transition time between 2D/Columbus View and 3D,
  36124. with 0.0 being 2D or Columbus View and 1.0 being 3D.
  36125. */
  36126. morphTime: number;
  36127. /**
  36128. * The far-to-near ratio of the multi-frustum when using a normal depth buffer.
  36129. <p>
  36130. This value is used to create the near and far values for each frustum of the multi-frustum. It is only used
  36131. when {@link Scene#logarithmicDepthBuffer} is <code>false</code>. When <code>logarithmicDepthBuffer</code> is
  36132. <code>true</code>, use {@link Scene#logarithmicDepthFarToNearRatio}.
  36133. </p>
  36134. */
  36135. farToNearRatio: number;
  36136. /**
  36137. * The far-to-near ratio of the multi-frustum when using a logarithmic depth buffer.
  36138. <p>
  36139. This value is used to create the near and far values for each frustum of the multi-frustum. It is only used
  36140. when {@link Scene#logarithmicDepthBuffer} is <code>true</code>. When <code>logarithmicDepthBuffer</code> is
  36141. <code>false</code>, use {@link Scene#farToNearRatio}.
  36142. </p>
  36143. */
  36144. logarithmicDepthFarToNearRatio: number;
  36145. /**
  36146. * Determines the uniform depth size in meters of each frustum of the multifrustum in 2D. If a primitive or model close
  36147. to the surface shows z-fighting, decreasing this will eliminate the artifact, but decrease performance. On the
  36148. other hand, increasing this will increase performance but may cause z-fighting among primitives close to the surface.
  36149. */
  36150. nearToFarDistance2D: number;
  36151. /**
  36152. * This property is for debugging only; it is not for production use.
  36153. <p>
  36154. A function that determines what commands are executed. As shown in the examples below,
  36155. the function receives the command's <code>owner</code> as an argument, and returns a boolean indicating if the
  36156. command should be executed.
  36157. </p>
  36158. <p>
  36159. The default is <code>undefined</code>, indicating that all commands are executed.
  36160. </p>
  36161. * @example
  36162. * // Do not execute any commands.
  36163. scene.debugCommandFilter = function(command) {
  36164. return false;
  36165. };
  36166. // Execute only the billboard's commands. That is, only draw the billboard.
  36167. var billboards = new Cesium.BillboardCollection();
  36168. scene.debugCommandFilter = function(command) {
  36169. return command.owner === billboards;
  36170. };
  36171. */
  36172. debugCommandFilter: (...params: any[]) => any;
  36173. /**
  36174. * This property is for debugging only; it is not for production use.
  36175. <p>
  36176. When <code>true</code>, commands are randomly shaded. This is useful
  36177. for performance analysis to see what parts of a scene or model are
  36178. command-dense and could benefit from batching.
  36179. </p>
  36180. */
  36181. debugShowCommands: boolean;
  36182. /**
  36183. * This property is for debugging only; it is not for production use.
  36184. <p>
  36185. When <code>true</code>, commands are shaded based on the frustums they
  36186. overlap. Commands in the closest frustum are tinted red, commands in
  36187. the next closest are green, and commands in the farthest frustum are
  36188. blue. If a command overlaps more than one frustum, the color components
  36189. are combined, e.g., a command overlapping the first two frustums is tinted
  36190. yellow.
  36191. </p>
  36192. */
  36193. debugShowFrustums: boolean;
  36194. /**
  36195. * This property is for debugging only; it is not for production use.
  36196. <p>
  36197. Displays frames per second and time between frames.
  36198. </p>
  36199. */
  36200. debugShowFramesPerSecond: boolean;
  36201. /**
  36202. * This property is for debugging only; it is not for production use.
  36203. <p>
  36204. Displays depth information for the indicated frustum.
  36205. </p>
  36206. */
  36207. debugShowGlobeDepth: boolean;
  36208. /**
  36209. * This property is for debugging only; it is not for production use.
  36210. <p>
  36211. Indicates which frustum will have depth information displayed.
  36212. </p>
  36213. */
  36214. debugShowDepthFrustum: number;
  36215. /**
  36216. * This property is for debugging only; it is not for production use.
  36217. <p>
  36218. When <code>true</code>, draws outlines to show the boundaries of the camera frustums
  36219. </p>
  36220. */
  36221. debugShowFrustumPlanes: boolean;
  36222. /**
  36223. * When <code>true</code>, enables picking using the depth buffer.
  36224. */
  36225. useDepthPicking: boolean;
  36226. /**
  36227. * 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.
  36228. <p>
  36229. Render must be called between picks.
  36230. <br>There is a decrease in performance when enabled. There are extra draw calls to write depth for
  36231. translucent geometry.
  36232. </p>
  36233. * @example
  36234. * // picking the position of a translucent primitive
  36235. viewer.screenSpaceEventHandler.setInputAction(function onLeftClick(movement) {
  36236. var pickedFeature = viewer.scene.pick(movement.position);
  36237. if (!Cesium.defined(pickedFeature)) {
  36238. // nothing picked
  36239. return;
  36240. }
  36241. viewer.scene.render();
  36242. var worldPosition = viewer.scene.pickPosition(movement.position);
  36243. }, Cesium.ScreenSpaceEventType.LEFT_CLICK);
  36244. */
  36245. pickTranslucentDepth: boolean;
  36246. /**
  36247. * Blends the atmosphere to geometry far from the camera for horizon views. Allows for additional
  36248. performance improvements by rendering less geometry and dispatching less terrain requests.
  36249. */
  36250. fog: Fog;
  36251. /**
  36252. * The shadow map for the scene's light source. When enabled, models, primitives, and the globe may cast and receive shadows.
  36253. */
  36254. shadowMap: ShadowMap;
  36255. /**
  36256. * When <code>false</code>, 3D Tiles will render normally. When <code>true</code>, classified 3D Tile geometry will render normally and
  36257. unclassified 3D Tile geometry will render with the color multiplied by {@link Scene#invertClassificationColor}.
  36258. */
  36259. invertClassification: boolean;
  36260. /**
  36261. * The highlight color of unclassified 3D Tile geometry when {@link Scene#invertClassification} is <code>true</code>.
  36262. <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>
  36263. <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>
  36264. */
  36265. invertClassificationColor: Color;
  36266. /**
  36267. * The focal length for use when with cardboard or WebVR.
  36268. */
  36269. focalLength: number;
  36270. /**
  36271. * The eye separation distance in meters for use with cardboard or WebVR.
  36272. */
  36273. eyeSeparation: number;
  36274. /**
  36275. * Post processing effects applied to the final render.
  36276. */
  36277. postProcessStages: PostProcessStageCollection;
  36278. /**
  36279. * When <code>true</code>, rendering a frame will only occur when needed as determined by changes within the scene.
  36280. Enabling improves performance of the application, but requires using {@link Scene#requestRender}
  36281. to render a new frame explicitly in this mode. This will be necessary in many cases after making changes
  36282. to the scene in other parts of the API.
  36283. */
  36284. requestRenderMode: boolean;
  36285. /**
  36286. * If {@link Scene#requestRenderMode} is <code>true</code>, this value defines the maximum change in
  36287. simulation time allowed before a render is requested. Lower values increase the number of frames rendered
  36288. and higher values decrease the number of frames rendered. If <code>undefined</code>, changes to
  36289. the simulation time will never request a render.
  36290. This value impacts the rate of rendering for changes in the scene like lighting, entity property updates,
  36291. and animations.
  36292. */
  36293. maximumRenderTimeChange: number;
  36294. /**
  36295. * The spherical harmonic coefficients for image-based lighting of PBR models.
  36296. */
  36297. sphericalHarmonicCoefficients: Cartesian3[];
  36298. /**
  36299. * The url to the KTX file containing the specular environment map and convoluted mipmaps for image-based lighting of PBR models.
  36300. */
  36301. specularEnvironmentMaps: string;
  36302. /**
  36303. * The light source for shading. Defaults to a directional light from the Sun.
  36304. */
  36305. light: Light;
  36306. /**
  36307. * Gets the canvas element to which this scene is bound.
  36308. */
  36309. readonly canvas: HTMLCanvasElement;
  36310. /**
  36311. * The drawingBufferHeight of the underlying GL context.
  36312. */
  36313. readonly drawingBufferHeight: number;
  36314. /**
  36315. * The drawingBufferHeight of the underlying GL context.
  36316. */
  36317. readonly drawingBufferWidth: number;
  36318. /**
  36319. * The maximum aliased line width, in pixels, supported by this WebGL implementation. It will be at least one.
  36320. */
  36321. readonly maximumAliasedLineWidth: number;
  36322. /**
  36323. * The maximum length in pixels of one edge of a cube map, supported by this WebGL implementation. It will be at least 16.
  36324. */
  36325. readonly maximumCubeMapSize: number;
  36326. /**
  36327. * Returns <code>true</code> if the {@link Scene#pickPosition} function is supported.
  36328. */
  36329. readonly pickPositionSupported: boolean;
  36330. /**
  36331. * Returns <code>true</code> if the {@link Scene#sampleHeight} and {@link Scene#sampleHeightMostDetailed} functions are supported.
  36332. */
  36333. readonly sampleHeightSupported: boolean;
  36334. /**
  36335. * Returns <code>true</code> if the {@link Scene#clampToHeight} and {@link Scene#clampToHeightMostDetailed} functions are supported.
  36336. */
  36337. readonly clampToHeightSupported: boolean;
  36338. /**
  36339. * Returns <code>true</code> if the {@link Scene#invertClassification} is supported.
  36340. */
  36341. readonly invertClassificationSupported: boolean;
  36342. /**
  36343. * Returns <code>true</code> if specular environment maps are supported.
  36344. */
  36345. readonly specularEnvironmentMapsSupported: boolean;
  36346. /**
  36347. * Gets or sets the depth-test ellipsoid.
  36348. */
  36349. globe: Globe;
  36350. /**
  36351. * Gets the collection of primitives.
  36352. */
  36353. readonly primitives: PrimitiveCollection;
  36354. /**
  36355. * Gets the collection of ground primitives.
  36356. */
  36357. readonly groundPrimitives: PrimitiveCollection;
  36358. /**
  36359. * Gets or sets the camera.
  36360. */
  36361. readonly camera: Camera;
  36362. /**
  36363. * Gets the controller for camera input handling.
  36364. */
  36365. readonly screenSpaceCameraController: ScreenSpaceCameraController;
  36366. /**
  36367. * Get the map projection to use in 2D and Columbus View modes.
  36368. */
  36369. readonly mapProjection: MapProjection;
  36370. /**
  36371. * Gets the collection of image layers that will be rendered on the globe.
  36372. */
  36373. readonly imageryLayers: ImageryLayerCollection;
  36374. /**
  36375. * The terrain provider providing surface geometry for the globe.
  36376. */
  36377. terrainProvider: TerrainProvider;
  36378. /**
  36379. * Gets an event that's raised when the terrain provider is changed
  36380. */
  36381. readonly terrainProviderChanged: Event;
  36382. /**
  36383. * Gets the event that will be raised before the scene is updated or rendered. Subscribers to the event
  36384. receive the Scene instance as the first parameter and the current time as the second parameter.
  36385. */
  36386. readonly preUpdate: Event;
  36387. /**
  36388. * Gets the event that will be raised immediately after the scene is updated and before the scene is rendered.
  36389. Subscribers to the event receive the Scene instance as the first parameter and the current time as the second
  36390. parameter.
  36391. */
  36392. readonly postUpdate: Event;
  36393. /**
  36394. * Gets the event that will be raised when an error is thrown inside the <code>render</code> function.
  36395. The Scene instance and the thrown error are the only two parameters passed to the event handler.
  36396. By default, errors are not rethrown after this event is raised, but that can be changed by setting
  36397. the <code>rethrowRenderErrors</code> property.
  36398. */
  36399. readonly renderError: Event;
  36400. /**
  36401. * Gets the event that will be raised after the scene is updated and immediately before the scene is rendered.
  36402. Subscribers to the event receive the Scene instance as the first parameter and the current time as the second
  36403. parameter.
  36404. */
  36405. readonly preRender: Event;
  36406. /**
  36407. * Gets the event that will be raised immediately after the scene is rendered. Subscribers to the event
  36408. receive the Scene instance as the first parameter and the current time as the second parameter.
  36409. */
  36410. readonly postRender: Event;
  36411. /**
  36412. * Gets the simulation time when the scene was last rendered. Returns undefined if the scene has not yet been
  36413. rendered.
  36414. */
  36415. readonly lastRenderTime: JulianDate;
  36416. /**
  36417. * This property is for debugging only; it is not for production use.
  36418. <p>
  36419. When {@link Scene.debugShowFrustums} is <code>true</code>, this contains
  36420. properties with statistics about the number of command execute per frustum.
  36421. <code>totalCommands</code> is the total number of commands executed, ignoring
  36422. overlap. <code>commandsInFrustums</code> is an array with the number of times
  36423. commands are executed redundantly, e.g., how many commands overlap two or
  36424. three frustums.
  36425. </p>
  36426. */
  36427. readonly debugFrustumStatistics: any;
  36428. /**
  36429. * Gets whether or not the scene is optimized for 3D only viewing.
  36430. */
  36431. readonly scene3DOnly: boolean;
  36432. /**
  36433. * Gets whether or not the scene has order independent translucency enabled.
  36434. Note that this only reflects the original construction option, and there are
  36435. other factors that could prevent OIT from functioning on a given system configuration.
  36436. */
  36437. readonly orderIndependentTranslucency: boolean;
  36438. /**
  36439. * Gets the unique identifier for this scene.
  36440. */
  36441. readonly id: string;
  36442. /**
  36443. * Gets or sets the current mode of the scene.
  36444. */
  36445. mode: SceneMode;
  36446. /**
  36447. * Gets the scalar used to exaggerate the terrain.
  36448. */
  36449. readonly terrainExaggeration: number;
  36450. /**
  36451. * When <code>true</code>, splits the scene into two viewports with steroscopic views for the left and right eyes.
  36452. Used for cardboard and WebVR.
  36453. */
  36454. useWebVR: boolean;
  36455. /**
  36456. * Determines if the 2D map is rotatable or can be scrolled infinitely in the horizontal direction.
  36457. */
  36458. readonly mapMode2D: MapMode2D;
  36459. /**
  36460. * Gets or sets the position of the Imagery splitter within the viewport. Valid values are between 0.0 and 1.0.
  36461. */
  36462. imagerySplitPosition: number;
  36463. /**
  36464. * The distance from the camera at which to disable the depth test of billboards, labels and points
  36465. to, for example, prevent clipping against terrain. When set to zero, the depth test should always
  36466. be applied. When less than zero, the depth test should never be applied. Setting the disableDepthTestDistance
  36467. property of a billboard, label or point will override this value.
  36468. */
  36469. minimumDisableDepthTestDistance: number;
  36470. /**
  36471. * Whether or not to use a logarithmic depth buffer. Enabling this option will allow for less frustums in the multi-frustum,
  36472. increasing performance. This property relies on fragmentDepth being supported.
  36473. */
  36474. logarithmicDepthBuffer: boolean;
  36475. /**
  36476. * The value used for gamma correction. This is only used when rendering with high dynamic range.
  36477. */
  36478. gamma: number;
  36479. /**
  36480. * Whether or not to use high dynamic range rendering.
  36481. */
  36482. highDynamicRange: boolean;
  36483. /**
  36484. * Whether or not high dynamic range rendering is supported.
  36485. */
  36486. readonly highDynamicRangeSupported: boolean;
  36487. /**
  36488. * Whether or not the camera is underneath the globe.
  36489. */
  36490. readonly cameraUnderground: boolean;
  36491. /**
  36492. * Determines if a compressed texture format is supported.
  36493. * @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.
  36494. * @returns Whether or not the format is supported.
  36495. */
  36496. getCompressedTextureFormatSupported(format: string): boolean;
  36497. /**
  36498. * Update and render the scene. It is usually not necessary to call this function
  36499. directly because {@link CesiumWidget} or {@link Viewer} do it automatically.
  36500. * @param [time] - The simulation time at which to render.
  36501. */
  36502. render(time?: JulianDate): void;
  36503. /**
  36504. * Requests a new rendered frame when {@link Scene#requestRenderMode} is set to <code>true</code>.
  36505. The render rate will not exceed the {@link CesiumWidget#targetFrameRate}.
  36506. */
  36507. requestRender(): void;
  36508. /**
  36509. * Returns an object with a `primitive` property that contains the first (top) primitive in the scene
  36510. at a particular window coordinate or undefined if nothing is at the location. Other properties may
  36511. potentially be set depending on the type of primitive and may be used to further identify the picked object.
  36512. <p>
  36513. When a feature of a 3D Tiles tileset is picked, <code>pick</code> returns a {@link Cesium3DTileFeature} object.
  36514. </p>
  36515. * @example
  36516. * // On mouse over, color the feature yellow.
  36517. handler.setInputAction(function(movement) {
  36518. var feature = scene.pick(movement.endPosition);
  36519. if (feature instanceof Cesium.Cesium3DTileFeature) {
  36520. feature.color = Cesium.Color.YELLOW;
  36521. }
  36522. }, Cesium.ScreenSpaceEventType.MOUSE_MOVE);
  36523. * @param windowPosition - Window coordinates to perform picking on.
  36524. * @param [width = 3] - Width of the pick rectangle.
  36525. * @param [height = 3] - Height of the pick rectangle.
  36526. * @returns Object containing the picked primitive.
  36527. */
  36528. pick(windowPosition: Cartesian2, width?: number, height?: number): any;
  36529. /**
  36530. * Returns the cartesian position reconstructed from the depth buffer and window position.
  36531. <p>
  36532. The position reconstructed from the depth buffer in 2D may be slightly different from those
  36533. reconstructed in 3D and Columbus view. This is caused by the difference in the distribution
  36534. of depth values of perspective and orthographic projection.
  36535. </p>
  36536. <p>
  36537. Set {@link Scene#pickTranslucentDepth} to <code>true</code> to include the depth of
  36538. translucent primitives; otherwise, this essentially picks through translucent primitives.
  36539. </p>
  36540. * @param windowPosition - Window coordinates to perform picking on.
  36541. * @param [result] - The object on which to restore the result.
  36542. * @returns The cartesian position.
  36543. */
  36544. pickPosition(windowPosition: Cartesian2, result?: Cartesian3): Cartesian3;
  36545. /**
  36546. * Returns a list of objects, each containing a `primitive` property, for all primitives at
  36547. a particular window coordinate position. Other properties may also be set depending on the
  36548. type of primitive and may be used to further identify the picked object. The primitives in
  36549. the list are ordered by their visual order in the scene (front to back).
  36550. * @example
  36551. * var pickedObjects = scene.drillPick(new Cesium.Cartesian2(100.0, 200.0));
  36552. * @param windowPosition - Window coordinates to perform picking on.
  36553. * @param [limit] - If supplied, stop drilling after collecting this many picks.
  36554. * @param [width = 3] - Width of the pick rectangle.
  36555. * @param [height = 3] - Height of the pick rectangle.
  36556. * @returns Array of objects, each containing 1 picked primitives.
  36557. */
  36558. drillPick(windowPosition: Cartesian2, limit?: number, width?: number, height?: number): any[];
  36559. /**
  36560. * Returns the height of scene geometry at the given cartographic position or <code>undefined</code> if there was no
  36561. scene geometry to sample height from. The height of the input position is ignored. May be used to clamp objects to
  36562. the globe, 3D Tiles, or primitives in the scene.
  36563. <p>
  36564. This function only samples height from globe tiles and 3D Tiles that are rendered in the current view. Samples height
  36565. from all other primitives regardless of their visibility.
  36566. </p>
  36567. * @example
  36568. * var position = new Cesium.Cartographic(-1.31968, 0.698874);
  36569. var height = viewer.scene.sampleHeight(position);
  36570. console.log(height);
  36571. * @param position - The cartographic position to sample height from.
  36572. * @param [objectsToExclude] - A list of primitives, entities, or 3D Tiles features to not sample height from.
  36573. * @param [width = 0.1] - Width of the intersection volume in meters.
  36574. * @returns The height. This may be <code>undefined</code> if there was no scene geometry to sample height from.
  36575. */
  36576. sampleHeight(position: Cartographic, objectsToExclude?: object[], width?: number): number;
  36577. /**
  36578. * Clamps the given cartesian position to the scene geometry along the geodetic surface normal. Returns the
  36579. clamped position or <code>undefined</code> if there was no scene geometry to clamp to. May be used to clamp
  36580. objects to the globe, 3D Tiles, or primitives in the scene.
  36581. <p>
  36582. This function only clamps to globe tiles and 3D Tiles that are rendered in the current view. Clamps to
  36583. all other primitives regardless of their visibility.
  36584. </p>
  36585. * @example
  36586. * // Clamp an entity to the underlying scene geometry
  36587. var position = entity.position.getValue(Cesium.JulianDate.now());
  36588. entity.position = viewer.scene.clampToHeight(position);
  36589. * @param cartesian - The cartesian position.
  36590. * @param [objectsToExclude] - A list of primitives, entities, or 3D Tiles features to not clamp to.
  36591. * @param [width = 0.1] - Width of the intersection volume in meters.
  36592. * @param [result] - An optional object to return the clamped position.
  36593. * @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.
  36594. */
  36595. clampToHeight(cartesian: Cartesian3, objectsToExclude?: object[], width?: number, result?: Cartesian3): Cartesian3;
  36596. /**
  36597. * Initiates an asynchronous {@link Scene#sampleHeight} query for an array of {@link Cartographic} positions
  36598. using the maximum level of detail for 3D Tilesets in the scene. The height of the input positions is ignored.
  36599. Returns a promise that is resolved when the query completes. Each point height is modified in place.
  36600. If a height cannot be determined because no geometry can be sampled at that location, or another error occurs,
  36601. the height is set to undefined.
  36602. * @example
  36603. * var positions = [
  36604. new Cesium.Cartographic(-1.31968, 0.69887),
  36605. new Cesium.Cartographic(-1.10489, 0.83923)
  36606. ];
  36607. var promise = viewer.scene.sampleHeightMostDetailed(positions);
  36608. promise.then(function(updatedPosition) {
  36609. // positions[0].height and positions[1].height have been updated.
  36610. // updatedPositions is just a reference to positions.
  36611. }
  36612. * @param positions - The cartographic positions to update with sampled heights.
  36613. * @param [objectsToExclude] - A list of primitives, entities, or 3D Tiles features to not sample height from.
  36614. * @param [width = 0.1] - Width of the intersection volume in meters.
  36615. * @returns A promise that resolves to the provided list of positions when the query has completed.
  36616. */
  36617. sampleHeightMostDetailed(positions: Cartographic[], objectsToExclude?: object[], width?: number): Promise<Cartographic[]>;
  36618. /**
  36619. * Initiates an asynchronous {@link Scene#clampToHeight} query for an array of {@link Cartesian3} positions
  36620. using the maximum level of detail for 3D Tilesets in the scene. Returns a promise that is resolved when
  36621. the query completes. Each position is modified in place. If a position cannot be clamped because no geometry
  36622. can be sampled at that location, or another error occurs, the element in the array is set to undefined.
  36623. * @example
  36624. * var cartesians = [
  36625. entities[0].position.getValue(Cesium.JulianDate.now()),
  36626. entities[1].position.getValue(Cesium.JulianDate.now())
  36627. ];
  36628. var promise = viewer.scene.clampToHeightMostDetailed(cartesians);
  36629. promise.then(function(updatedCartesians) {
  36630. entities[0].position = updatedCartesians[0];
  36631. entities[1].position = updatedCartesians[1];
  36632. }
  36633. * @param cartesians - The cartesian positions to update with clamped positions.
  36634. * @param [objectsToExclude] - A list of primitives, entities, or 3D Tiles features to not clamp to.
  36635. * @param [width = 0.1] - Width of the intersection volume in meters.
  36636. * @returns A promise that resolves to the provided list of positions when the query has completed.
  36637. */
  36638. clampToHeightMostDetailed(cartesians: Cartesian3[], objectsToExclude?: object[], width?: number): Promise<Cartesian3[]>;
  36639. /**
  36640. * Transforms a position in cartesian coordinates to canvas coordinates. This is commonly used to place an
  36641. HTML element at the same screen position as an object in the scene.
  36642. * @example
  36643. * // Output the canvas position of longitude/latitude (0, 0) every time the mouse moves.
  36644. var scene = widget.scene;
  36645. var ellipsoid = scene.globe.ellipsoid;
  36646. var position = Cesium.Cartesian3.fromDegrees(0.0, 0.0);
  36647. var handler = new Cesium.ScreenSpaceEventHandler(scene.canvas);
  36648. handler.setInputAction(function(movement) {
  36649. console.log(scene.cartesianToCanvasCoordinates(position));
  36650. }, Cesium.ScreenSpaceEventType.MOUSE_MOVE);
  36651. * @param position - The position in cartesian coordinates.
  36652. * @param [result] - An optional object to return the input position transformed to canvas coordinates.
  36653. * @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.
  36654. */
  36655. cartesianToCanvasCoordinates(position: Cartesian3, result?: Cartesian2): Cartesian2;
  36656. /**
  36657. * Instantly completes an active transition.
  36658. */
  36659. completeMorph(): void;
  36660. /**
  36661. * Asynchronously transitions the scene to 2D.
  36662. * @param [duration = 2.0] - The amount of time, in seconds, for transition animations to complete.
  36663. */
  36664. morphTo2D(duration?: number): void;
  36665. /**
  36666. * Asynchronously transitions the scene to Columbus View.
  36667. * @param [duration = 2.0] - The amount of time, in seconds, for transition animations to complete.
  36668. */
  36669. morphToColumbusView(duration?: number): void;
  36670. /**
  36671. * Asynchronously transitions the scene to 3D.
  36672. * @param [duration = 2.0] - The amount of time, in seconds, for transition animations to complete.
  36673. */
  36674. morphTo3D(duration?: number): void;
  36675. /**
  36676. * Returns true if this object was destroyed; otherwise, false.
  36677. <br /><br />
  36678. If this object was destroyed, it should not be used; calling any function other than
  36679. <code>isDestroyed</code> will result in a {@link DeveloperError} exception.
  36680. * @returns <code>true</code> if this object was destroyed; otherwise, <code>false</code>.
  36681. */
  36682. isDestroyed(): boolean;
  36683. /**
  36684. * Destroys the WebGL resources held by this object. Destroying an object allows for deterministic
  36685. release of WebGL resources, instead of relying on the garbage collector to destroy this object.
  36686. <br /><br />
  36687. Once an object is destroyed, it should not be used; calling any function other than
  36688. <code>isDestroyed</code> will result in a {@link DeveloperError} exception. Therefore,
  36689. assign the return value (<code>undefined</code>) to the object as done in the example.
  36690. * @example
  36691. * scene = scene && scene.destroy();
  36692. */
  36693. destroy(): void;
  36694. }
  36695. /**
  36696. * Indicates if the scene is viewed in 3D, 2D, or 2.5D Columbus view.
  36697. */
  36698. export enum SceneMode {
  36699. /**
  36700. * Morphing between mode, e.g., 3D to 2D.
  36701. */
  36702. MORPHING = 0,
  36703. /**
  36704. * Columbus View mode. A 2.5D perspective view where the map is laid out
  36705. flat and objects with non-zero height are drawn above it.
  36706. */
  36707. COLUMBUS_VIEW = 1,
  36708. /**
  36709. * 2D mode. The map is viewed top-down with an orthographic projection.
  36710. */
  36711. SCENE2D = 2,
  36712. /**
  36713. * 3D mode. A traditional 3D perspective view of the globe.
  36714. */
  36715. SCENE3D = 3
  36716. }
  36717. /**
  36718. * Functions that do scene-dependent transforms between rendering-related coordinate systems.
  36719. */
  36720. export namespace SceneTransforms {
  36721. /**
  36722. * Transforms a position in WGS84 coordinates to window coordinates. This is commonly used to place an
  36723. HTML element at the same screen position as an object in the scene.
  36724. * @example
  36725. * // Output the window position of longitude/latitude (0, 0) every time the mouse moves.
  36726. var scene = widget.scene;
  36727. var ellipsoid = scene.globe.ellipsoid;
  36728. var position = Cesium.Cartesian3.fromDegrees(0.0, 0.0);
  36729. var handler = new Cesium.ScreenSpaceEventHandler(scene.canvas);
  36730. handler.setInputAction(function(movement) {
  36731. console.log(Cesium.SceneTransforms.wgs84ToWindowCoordinates(scene, position));
  36732. }, Cesium.ScreenSpaceEventType.MOUSE_MOVE);
  36733. * @param scene - The scene.
  36734. * @param position - The position in WGS84 (world) coordinates.
  36735. * @param [result] - An optional object to return the input position transformed to window coordinates.
  36736. * @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.
  36737. */
  36738. function wgs84ToWindowCoordinates(scene: Scene, position: Cartesian3, result?: Cartesian2): Cartesian2;
  36739. /**
  36740. * Transforms a position in WGS84 coordinates to drawing buffer coordinates. This may produce different
  36741. results from SceneTransforms.wgs84ToWindowCoordinates when the browser zoom is not 100%, or on high-DPI displays.
  36742. * @example
  36743. * // Output the window position of longitude/latitude (0, 0) every time the mouse moves.
  36744. var scene = widget.scene;
  36745. var ellipsoid = scene.globe.ellipsoid;
  36746. var position = Cesium.Cartesian3.fromDegrees(0.0, 0.0);
  36747. var handler = new Cesium.ScreenSpaceEventHandler(scene.canvas);
  36748. handler.setInputAction(function(movement) {
  36749. console.log(Cesium.SceneTransforms.wgs84ToWindowCoordinates(scene, position));
  36750. }, Cesium.ScreenSpaceEventType.MOUSE_MOVE);
  36751. * @param scene - The scene.
  36752. * @param position - The position in WGS84 (world) coordinates.
  36753. * @param [result] - An optional object to return the input position transformed to window coordinates.
  36754. * @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.
  36755. */
  36756. function wgs84ToDrawingBufferCoordinates(scene: Scene, position: Cartesian3, result?: Cartesian2): Cartesian2;
  36757. }
  36758. /**
  36759. * Modifies the camera position and orientation based on mouse input to a canvas.
  36760. * @param scene - The scene.
  36761. */
  36762. export class ScreenSpaceCameraController {
  36763. constructor(scene: Scene);
  36764. /**
  36765. * If true, inputs are allowed conditionally with the flags enableTranslate, enableZoom,
  36766. enableRotate, enableTilt, and enableLook. If false, all inputs are disabled.
  36767. NOTE: This setting is for temporary use cases, such as camera flights and
  36768. drag-selection of regions (see Picking demo). It is typically set to false at the
  36769. start of such events, and set true on completion. To keep inputs disabled
  36770. past the end of camera flights, you must use the other booleans (enableTranslate,
  36771. enableZoom, enableRotate, enableTilt, and enableLook).
  36772. */
  36773. enableInputs: boolean;
  36774. /**
  36775. * If true, allows the user to pan around the map. If false, the camera stays locked at the current position.
  36776. This flag only applies in 2D and Columbus view modes.
  36777. */
  36778. enableTranslate: boolean;
  36779. /**
  36780. * If true, allows the user to zoom in and out. If false, the camera is locked to the current distance from the ellipsoid.
  36781. */
  36782. enableZoom: boolean;
  36783. /**
  36784. * If true, allows the user to rotate the world which translates the user's position.
  36785. This flag only applies in 2D and 3D.
  36786. */
  36787. enableRotate: boolean;
  36788. /**
  36789. * If true, allows the user to tilt the camera. If false, the camera is locked to the current heading.
  36790. This flag only applies in 3D and Columbus view.
  36791. */
  36792. enableTilt: boolean;
  36793. /**
  36794. * If true, allows the user to use free-look. If false, the camera view direction can only be changed through translating
  36795. or rotating. This flag only applies in 3D and Columbus view modes.
  36796. */
  36797. enableLook: boolean;
  36798. /**
  36799. * A parameter in the range <code>[0, 1)</code> used to determine how long
  36800. the camera will continue to spin because of inertia.
  36801. With value of zero, the camera will have no inertia.
  36802. */
  36803. inertiaSpin: number;
  36804. /**
  36805. * A parameter in the range <code>[0, 1)</code> used to determine how long
  36806. the camera will continue to translate because of inertia.
  36807. With value of zero, the camera will have no inertia.
  36808. */
  36809. inertiaTranslate: number;
  36810. /**
  36811. * A parameter in the range <code>[0, 1)</code> used to determine how long
  36812. the camera will continue to zoom because of inertia.
  36813. With value of zero, the camera will have no inertia.
  36814. */
  36815. inertiaZoom: number;
  36816. /**
  36817. * A parameter in the range <code>[0, 1)</code> used to limit the range
  36818. of various user inputs to a percentage of the window width/height per animation frame.
  36819. This helps keep the camera under control in low-frame-rate situations.
  36820. */
  36821. maximumMovementRatio: number;
  36822. /**
  36823. * Sets the duration, in seconds, of the bounce back animations in 2D and Columbus view.
  36824. */
  36825. bounceAnimationTime: number;
  36826. /**
  36827. * The minimum magnitude, in meters, of the camera position when zooming. Defaults to 1.0.
  36828. */
  36829. minimumZoomDistance: number;
  36830. /**
  36831. * The maximum magnitude, in meters, of the camera position when zooming. Defaults to positive infinity.
  36832. */
  36833. maximumZoomDistance: number;
  36834. /**
  36835. * The input that allows the user to pan around the map. This only applies in 2D and Columbus view modes.
  36836. <p>
  36837. The type came be a {@link CameraEventType}, <code>undefined</code>, an object with <code>eventType</code>
  36838. and <code>modifier</code> properties with types <code>CameraEventType</code> and {@link KeyboardEventModifier},
  36839. or an array of any of the preceding.
  36840. </p>
  36841. */
  36842. translateEventTypes: CameraEventType | any[] | undefined;
  36843. /**
  36844. * The input that allows the user to zoom in/out.
  36845. <p>
  36846. The type came be a {@link CameraEventType}, <code>undefined</code>, an object with <code>eventType</code>
  36847. and <code>modifier</code> properties with types <code>CameraEventType</code> and {@link KeyboardEventModifier},
  36848. or an array of any of the preceding.
  36849. </p>
  36850. */
  36851. zoomEventTypes: CameraEventType | any[] | undefined;
  36852. /**
  36853. * The input that allows the user to rotate around the globe or another object. This only applies in 3D and Columbus view modes.
  36854. <p>
  36855. The type came be a {@link CameraEventType}, <code>undefined</code>, an object with <code>eventType</code>
  36856. and <code>modifier</code> properties with types <code>CameraEventType</code> and {@link KeyboardEventModifier},
  36857. or an array of any of the preceding.
  36858. </p>
  36859. */
  36860. rotateEventTypes: CameraEventType | any[] | undefined;
  36861. /**
  36862. * The input that allows the user to tilt in 3D and Columbus view or twist in 2D.
  36863. <p>
  36864. The type came be a {@link CameraEventType}, <code>undefined</code>, an object with <code>eventType</code>
  36865. and <code>modifier</code> properties with types <code>CameraEventType</code> and {@link KeyboardEventModifier},
  36866. or an array of any of the preceding.
  36867. </p>
  36868. */
  36869. tiltEventTypes: CameraEventType | any[] | undefined;
  36870. /**
  36871. * The input that allows the user to change the direction the camera is viewing. This only applies in 3D and Columbus view modes.
  36872. <p>
  36873. The type came be a {@link CameraEventType}, <code>undefined</code>, an object with <code>eventType</code>
  36874. and <code>modifier</code> properties with types <code>CameraEventType</code> and {@link KeyboardEventModifier},
  36875. or an array of any of the preceding.
  36876. </p>
  36877. */
  36878. lookEventTypes: CameraEventType | any[] | undefined;
  36879. /**
  36880. * The minimum height the camera must be before picking the terrain instead of the ellipsoid.
  36881. */
  36882. minimumPickingTerrainHeight: number;
  36883. /**
  36884. * The minimum height the camera must be before testing for collision with terrain.
  36885. */
  36886. minimumCollisionTerrainHeight: number;
  36887. /**
  36888. * The minimum height the camera must be before switching from rotating a track ball to
  36889. free look when clicks originate on the sky or in space.
  36890. */
  36891. minimumTrackBallHeight: number;
  36892. /**
  36893. * Enables or disables camera collision detection with terrain.
  36894. */
  36895. enableCollisionDetection: boolean;
  36896. /**
  36897. * Returns true if this object was destroyed; otherwise, false.
  36898. <br /><br />
  36899. If this object was destroyed, it should not be used; calling any function other than
  36900. <code>isDestroyed</code> will result in a {@link DeveloperError} exception.
  36901. * @returns <code>true</code> if this object was destroyed; otherwise, <code>false</code>.
  36902. */
  36903. isDestroyed(): boolean;
  36904. /**
  36905. * Removes mouse listeners held by this object.
  36906. <br /><br />
  36907. Once an object is destroyed, it should not be used; calling any function other than
  36908. <code>isDestroyed</code> will result in a {@link DeveloperError} exception. Therefore,
  36909. assign the return value (<code>undefined</code>) to the object as done in the example.
  36910. * @example
  36911. * controller = controller && controller.destroy();
  36912. */
  36913. destroy(): void;
  36914. }
  36915. /**
  36916. * Use {@link Viewer#shadowMap} to get the scene's shadow map. Do not construct this directly.
  36917. <p>
  36918. The normalOffset bias pushes the shadows forward slightly, and may be disabled
  36919. for applications that require ultra precise shadows.
  36920. </p>
  36921. * @param options - An object containing the following properties:
  36922. * @param options.lightCamera - A camera representing the light source.
  36923. * @param [options.enabled = true] - Whether the shadow map is enabled.
  36924. * @param [options.isPointLight = false] - Whether the light source is a point light. Point light shadows do not use cascades.
  36925. * @param [options.pointLightRadius = 100.0] - Radius of the point light.
  36926. * @param [options.cascadesEnabled = true] - Use multiple shadow maps to cover different partitions of the view frustum.
  36927. * @param [options.numberOfCascades = 4] - The number of cascades to use for the shadow map. Supported values are one and four.
  36928. * @param [options.maximumDistance = 5000.0] - The maximum distance used for generating cascaded shadows. Lower values improve shadow quality.
  36929. * @param [options.size = 2048] - The width and height, in pixels, of each shadow map.
  36930. * @param [options.softShadows = false] - Whether percentage-closer-filtering is enabled for producing softer shadows.
  36931. * @param [options.darkness = 0.3] - The shadow darkness.
  36932. * @param [options.normalOffset = true] - Whether a normal bias is applied to shadows.
  36933. */
  36934. export class ShadowMap {
  36935. constructor(options: {
  36936. lightCamera: Camera;
  36937. enabled?: boolean;
  36938. isPointLight?: boolean;
  36939. pointLightRadius?: boolean;
  36940. cascadesEnabled?: boolean;
  36941. numberOfCascades?: number;
  36942. maximumDistance?: number;
  36943. size?: number;
  36944. softShadows?: boolean;
  36945. darkness?: number;
  36946. normalOffset?: boolean;
  36947. });
  36948. /**
  36949. * Determines the darkness of the shadows.
  36950. */
  36951. darkness: number;
  36952. /**
  36953. * Determines the maximum distance of the shadow map. Only applicable for cascaded shadows. Larger distances may result in lower quality shadows.
  36954. */
  36955. maximumDistance: number;
  36956. /**
  36957. * Determines if the shadow map will be shown.
  36958. */
  36959. enabled: boolean;
  36960. /**
  36961. * Determines if a normal bias will be applied to shadows.
  36962. */
  36963. normalOffset: boolean;
  36964. /**
  36965. * Determines if soft shadows are enabled. Uses pcf filtering which requires more texture reads and may hurt performance.
  36966. */
  36967. softShadows: boolean;
  36968. /**
  36969. * The width and height, in pixels, of each shadow map.
  36970. */
  36971. size: number;
  36972. }
  36973. /**
  36974. * Specifies whether the object casts or receives shadows from light sources when
  36975. shadows are enabled.
  36976. */
  36977. export enum ShadowMode {
  36978. /**
  36979. * The object does not cast or receive shadows.
  36980. */
  36981. DISABLED = 0,
  36982. /**
  36983. * The object casts and receives shadows.
  36984. */
  36985. ENABLED = 1,
  36986. /**
  36987. * The object casts shadows only.
  36988. */
  36989. CAST_ONLY = 2,
  36990. /**
  36991. * The object receives shadows only.
  36992. */
  36993. RECEIVE_ONLY = 3
  36994. }
  36995. export namespace SingleTileImageryProvider {
  36996. /**
  36997. * Initialization options for the SingleTileImageryProvider constructor
  36998. * @property url - The url for the tile.
  36999. * @property [rectangle = Rectangle.MAX_VALUE] - The rectangle, in radians, covered by the image.
  37000. * @property [credit] - A credit for the data source, which is displayed on the canvas.
  37001. * @property [ellipsoid] - The ellipsoid. If not specified, the WGS84 ellipsoid is used.
  37002. */
  37003. type ConstructorOptions = {
  37004. url: Resource | string;
  37005. rectangle?: Rectangle;
  37006. credit?: Credit | string;
  37007. ellipsoid?: Ellipsoid;
  37008. };
  37009. }
  37010. /**
  37011. * Provides a single, top-level imagery tile. The single image is assumed to use a
  37012. {@link GeographicTilingScheme}.
  37013. * @param options - Object describing initialization options
  37014. */
  37015. export class SingleTileImageryProvider {
  37016. constructor(options: SingleTileImageryProvider.ConstructorOptions);
  37017. /**
  37018. * The default alpha blending value of this provider, with 0.0 representing fully transparent and
  37019. 1.0 representing fully opaque.
  37020. */
  37021. defaultAlpha: number | undefined;
  37022. /**
  37023. * The default alpha blending value on the night side of the globe of this provider, with 0.0 representing fully transparent and
  37024. 1.0 representing fully opaque.
  37025. */
  37026. defaultNightAlpha: number | undefined;
  37027. /**
  37028. * The default alpha blending value on the day side of the globe of this provider, with 0.0 representing fully transparent and
  37029. 1.0 representing fully opaque.
  37030. */
  37031. defaultDayAlpha: number | undefined;
  37032. /**
  37033. * The default brightness of this provider. 1.0 uses the unmodified imagery color. Less than 1.0
  37034. makes the imagery darker while greater than 1.0 makes it brighter.
  37035. */
  37036. defaultBrightness: number | undefined;
  37037. /**
  37038. * The default contrast of this provider. 1.0 uses the unmodified imagery color. Less than 1.0 reduces
  37039. the contrast while greater than 1.0 increases it.
  37040. */
  37041. defaultContrast: number | undefined;
  37042. /**
  37043. * The default hue of this provider in radians. 0.0 uses the unmodified imagery color.
  37044. */
  37045. defaultHue: number | undefined;
  37046. /**
  37047. * The default saturation of this provider. 1.0 uses the unmodified imagery color. Less than 1.0 reduces the
  37048. saturation while greater than 1.0 increases it.
  37049. */
  37050. defaultSaturation: number | undefined;
  37051. /**
  37052. * The default gamma correction to apply to this provider. 1.0 uses the unmodified imagery color.
  37053. */
  37054. defaultGamma: number | undefined;
  37055. /**
  37056. * The default texture minification filter to apply to this provider.
  37057. */
  37058. defaultMinificationFilter: TextureMinificationFilter;
  37059. /**
  37060. * The default texture magnification filter to apply to this provider.
  37061. */
  37062. defaultMagnificationFilter: TextureMagnificationFilter;
  37063. /**
  37064. * Gets the URL of the single, top-level imagery tile.
  37065. */
  37066. readonly url: string;
  37067. /**
  37068. * Gets the proxy used by this provider.
  37069. */
  37070. readonly proxy: Proxy;
  37071. /**
  37072. * Gets the width of each tile, in pixels. This function should
  37073. not be called before {@link SingleTileImageryProvider#ready} returns true.
  37074. */
  37075. readonly tileWidth: number;
  37076. /**
  37077. * Gets the height of each tile, in pixels. This function should
  37078. not be called before {@link SingleTileImageryProvider#ready} returns true.
  37079. */
  37080. readonly tileHeight: number;
  37081. /**
  37082. * Gets the maximum level-of-detail that can be requested. This function should
  37083. not be called before {@link SingleTileImageryProvider#ready} returns true.
  37084. */
  37085. readonly maximumLevel: number | undefined;
  37086. /**
  37087. * Gets the minimum level-of-detail that can be requested. This function should
  37088. not be called before {@link SingleTileImageryProvider#ready} returns true.
  37089. */
  37090. readonly minimumLevel: number;
  37091. /**
  37092. * Gets the tiling scheme used by this provider. This function should
  37093. not be called before {@link SingleTileImageryProvider#ready} returns true.
  37094. */
  37095. readonly tilingScheme: TilingScheme;
  37096. /**
  37097. * Gets the rectangle, in radians, of the imagery provided by this instance. This function should
  37098. not be called before {@link SingleTileImageryProvider#ready} returns true.
  37099. */
  37100. readonly rectangle: Rectangle;
  37101. /**
  37102. * Gets the tile discard policy. If not undefined, the discard policy is responsible
  37103. for filtering out "missing" tiles via its shouldDiscardImage function. If this function
  37104. returns undefined, no tiles are filtered. This function should
  37105. not be called before {@link SingleTileImageryProvider#ready} returns true.
  37106. */
  37107. readonly tileDiscardPolicy: TileDiscardPolicy;
  37108. /**
  37109. * Gets an event that is raised when the imagery provider encounters an asynchronous error. By subscribing
  37110. to the event, you will be notified of the error and can potentially recover from it. Event listeners
  37111. are passed an instance of {@link TileProviderError}.
  37112. */
  37113. readonly errorEvent: Event;
  37114. /**
  37115. * Gets a value indicating whether or not the provider is ready for use.
  37116. */
  37117. readonly ready: boolean;
  37118. /**
  37119. * Gets a promise that resolves to true when the provider is ready for use.
  37120. */
  37121. readonly readyPromise: Promise<boolean>;
  37122. /**
  37123. * Gets the credit to display when this imagery provider is active. Typically this is used to credit
  37124. the source of the imagery. This function should not be called before {@link SingleTileImageryProvider#ready} returns true.
  37125. */
  37126. readonly credit: Credit;
  37127. /**
  37128. * Gets a value indicating whether or not the images provided by this imagery provider
  37129. include an alpha channel. If this property is false, an alpha channel, if present, will
  37130. be ignored. If this property is true, any images without an alpha channel will be treated
  37131. as if their alpha is 1.0 everywhere. When this property is false, memory usage
  37132. and texture upload time are reduced.
  37133. */
  37134. readonly hasAlphaChannel: boolean;
  37135. /**
  37136. * Gets the credits to be displayed when a given tile is displayed.
  37137. * @param x - The tile X coordinate.
  37138. * @param y - The tile Y coordinate.
  37139. * @param level - The tile level;
  37140. * @returns The credits to be displayed when the tile is displayed.
  37141. */
  37142. getTileCredits(x: number, y: number, level: number): Credit[];
  37143. /**
  37144. * Requests the image for a given tile. This function should
  37145. not be called before {@link SingleTileImageryProvider#ready} returns true.
  37146. * @param x - The tile X coordinate.
  37147. * @param y - The tile Y coordinate.
  37148. * @param level - The tile level.
  37149. * @param [request] - The request object. Intended for internal use only.
  37150. * @returns A promise for the image that will resolve when the image is available, or
  37151. undefined if there are too many active requests to the server, and the request
  37152. should be retried later. The resolved image may be either an
  37153. Image or a Canvas DOM object.
  37154. */
  37155. requestImage(x: number, y: number, level: number, request?: Request): Promise<HTMLImageElement | HTMLCanvasElement> | undefined;
  37156. /**
  37157. * Picking features is not currently supported by this imagery provider, so this function simply returns
  37158. undefined.
  37159. * @param x - The tile X coordinate.
  37160. * @param y - The tile Y coordinate.
  37161. * @param level - The tile level.
  37162. * @param longitude - The longitude at which to pick features.
  37163. * @param latitude - The latitude at which to pick features.
  37164. * @returns A promise for the picked features that will resolve when the asynchronous
  37165. picking completes. The resolved value is an array of {@link ImageryLayerFeatureInfo}
  37166. instances. The array may be empty if no features are found at the given location.
  37167. It may also be undefined if picking is not supported.
  37168. */
  37169. pickFeatures(x: number, y: number, level: number, longitude: number, latitude: number): Promise<ImageryLayerFeatureInfo[]> | undefined;
  37170. }
  37171. /**
  37172. * An atmosphere drawn around the limb of the provided ellipsoid. Based on
  37173. {@link https://developer.nvidia.com/gpugems/GPUGems2/gpugems2_chapter16.html|Accurate Atmospheric Scattering}
  37174. in GPU Gems 2.
  37175. <p>
  37176. This is only supported in 3D. Atmosphere is faded out when morphing to 2D or Columbus view.
  37177. </p>
  37178. * @example
  37179. * scene.skyAtmosphere = new Cesium.SkyAtmosphere();
  37180. * @param [ellipsoid = Ellipsoid.WGS84] - The ellipsoid that the atmosphere is drawn around.
  37181. */
  37182. export class SkyAtmosphere {
  37183. constructor(ellipsoid?: Ellipsoid);
  37184. /**
  37185. * Determines if the atmosphere is shown.
  37186. */
  37187. show: boolean;
  37188. /**
  37189. * Compute atmosphere per-fragment instead of per-vertex.
  37190. This produces better looking atmosphere with a slight performance penalty.
  37191. */
  37192. perFragmentAtmosphere: boolean;
  37193. /**
  37194. * The hue shift to apply to the atmosphere. Defaults to 0.0 (no shift).
  37195. A hue shift of 1.0 indicates a complete rotation of the hues available.
  37196. */
  37197. hueShift: number;
  37198. /**
  37199. * The saturation shift to apply to the atmosphere. Defaults to 0.0 (no shift).
  37200. A saturation shift of -1.0 is monochrome.
  37201. */
  37202. saturationShift: number;
  37203. /**
  37204. * The brightness shift to apply to the atmosphere. Defaults to 0.0 (no shift).
  37205. A brightness shift of -1.0 is complete darkness, which will let space show through.
  37206. */
  37207. brightnessShift: number;
  37208. /**
  37209. * Gets the ellipsoid the atmosphere is drawn around.
  37210. */
  37211. readonly ellipsoid: Ellipsoid;
  37212. /**
  37213. * Returns true if this object was destroyed; otherwise, false.
  37214. <br /><br />
  37215. If this object was destroyed, it should not be used; calling any function other than
  37216. <code>isDestroyed</code> will result in a {@link DeveloperError} exception.
  37217. * @returns <code>true</code> if this object was destroyed; otherwise, <code>false</code>.
  37218. */
  37219. isDestroyed(): boolean;
  37220. /**
  37221. * Destroys the WebGL resources held by this object. Destroying an object allows for deterministic
  37222. release of WebGL resources, instead of relying on the garbage collector to destroy this object.
  37223. <br /><br />
  37224. Once an object is destroyed, it should not be used; calling any function other than
  37225. <code>isDestroyed</code> will result in a {@link DeveloperError} exception. Therefore,
  37226. assign the return value (<code>undefined</code>) to the object as done in the example.
  37227. * @example
  37228. * skyAtmosphere = skyAtmosphere && skyAtmosphere.destroy();
  37229. */
  37230. destroy(): void;
  37231. }
  37232. /**
  37233. * A sky box around the scene to draw stars. The sky box is defined using the True Equator Mean Equinox (TEME) axes.
  37234. <p>
  37235. This is only supported in 3D. The sky box is faded out when morphing to 2D or Columbus view. The size of
  37236. the sky box must not exceed {@link Scene#maximumCubeMapSize}.
  37237. </p>
  37238. * @example
  37239. * scene.skyBox = new Cesium.SkyBox({
  37240. sources : {
  37241. positiveX : 'skybox_px.png',
  37242. negativeX : 'skybox_nx.png',
  37243. positiveY : 'skybox_py.png',
  37244. negativeY : 'skybox_ny.png',
  37245. positiveZ : 'skybox_pz.png',
  37246. negativeZ : 'skybox_nz.png'
  37247. }
  37248. });
  37249. * @param options - Object with the following properties:
  37250. * @param [options.sources] - The source URL or <code>Image</code> object for each of the six cube map faces. See the example below.
  37251. * @param [options.show = true] - Determines if this primitive will be shown.
  37252. */
  37253. export class SkyBox {
  37254. constructor(options: {
  37255. sources?: any;
  37256. show?: boolean;
  37257. });
  37258. /**
  37259. * The sources used to create the cube map faces: an object
  37260. with <code>positiveX</code>, <code>negativeX</code>, <code>positiveY</code>,
  37261. <code>negativeY</code>, <code>positiveZ</code>, and <code>negativeZ</code> properties.
  37262. These can be either URLs or <code>Image</code> objects.
  37263. */
  37264. sources: any;
  37265. /**
  37266. * Determines if the sky box will be shown.
  37267. */
  37268. show: boolean;
  37269. /**
  37270. * Called when {@link Viewer} or {@link CesiumWidget} render the scene to
  37271. get the draw commands needed to render this primitive.
  37272. <p>
  37273. Do not call this function directly. This is documented just to
  37274. list the exceptions that may be propagated when the scene is rendered:
  37275. </p>
  37276. */
  37277. update(): void;
  37278. /**
  37279. * Returns true if this object was destroyed; otherwise, false.
  37280. <br /><br />
  37281. If this object was destroyed, it should not be used; calling any function other than
  37282. <code>isDestroyed</code> will result in a {@link DeveloperError} exception.
  37283. * @returns <code>true</code> if this object was destroyed; otherwise, <code>false</code>.
  37284. */
  37285. isDestroyed(): boolean;
  37286. /**
  37287. * Destroys the WebGL resources held by this object. Destroying an object allows for deterministic
  37288. release of WebGL resources, instead of relying on the garbage collector to destroy this object.
  37289. <br /><br />
  37290. Once an object is destroyed, it should not be used; calling any function other than
  37291. <code>isDestroyed</code> will result in a {@link DeveloperError} exception. Therefore,
  37292. assign the return value (<code>undefined</code>) to the object as done in the example.
  37293. * @example
  37294. * skyBox = skyBox && skyBox.destroy();
  37295. */
  37296. destroy(): void;
  37297. }
  37298. /**
  37299. * A ParticleEmitter that emits particles within a sphere.
  37300. Particles will be positioned randomly within the sphere and have initial velocities emanating from the center of the sphere.
  37301. * @param [radius = 1.0] - The radius of the sphere in meters.
  37302. */
  37303. export class SphereEmitter {
  37304. constructor(radius?: number);
  37305. /**
  37306. * The radius of the sphere in meters.
  37307. */
  37308. radius: number;
  37309. }
  37310. /**
  37311. * Determines the function used to compare stencil values for the stencil test.
  37312. */
  37313. export enum StencilFunction {
  37314. /**
  37315. * The stencil test never passes.
  37316. */
  37317. NEVER = WebGLConstants.NEVER,
  37318. /**
  37319. * The stencil test passes when the masked reference value is less than the masked stencil value.
  37320. */
  37321. LESS = WebGLConstants.LESS,
  37322. /**
  37323. * The stencil test passes when the masked reference value is equal to the masked stencil value.
  37324. */
  37325. EQUAL = WebGLConstants.EQUAL,
  37326. /**
  37327. * The stencil test passes when the masked reference value is less than or equal to the masked stencil value.
  37328. */
  37329. LESS_OR_EQUAL = WebGLConstants.LEQUAL,
  37330. /**
  37331. * The stencil test passes when the masked reference value is greater than the masked stencil value.
  37332. */
  37333. GREATER = WebGLConstants.GREATER,
  37334. /**
  37335. * The stencil test passes when the masked reference value is not equal to the masked stencil value.
  37336. */
  37337. NOT_EQUAL = WebGLConstants.NOTEQUAL,
  37338. /**
  37339. * The stencil test passes when the masked reference value is greater than or equal to the masked stencil value.
  37340. */
  37341. GREATER_OR_EQUAL = WebGLConstants.GEQUAL,
  37342. /**
  37343. * The stencil test always passes.
  37344. */
  37345. ALWAYS = WebGLConstants.ALWAYS
  37346. }
  37347. /**
  37348. * Determines the action taken based on the result of the stencil test.
  37349. */
  37350. export enum StencilOperation {
  37351. /**
  37352. * Sets the stencil buffer value to zero.
  37353. */
  37354. ZERO = WebGLConstants.ZERO,
  37355. /**
  37356. * Does not change the stencil buffer.
  37357. */
  37358. KEEP = WebGLConstants.KEEP,
  37359. /**
  37360. * Replaces the stencil buffer value with the reference value.
  37361. */
  37362. REPLACE = WebGLConstants.REPLACE,
  37363. /**
  37364. * Increments the stencil buffer value, clamping to unsigned byte.
  37365. */
  37366. INCREMENT = WebGLConstants.INCR,
  37367. /**
  37368. * Decrements the stencil buffer value, clamping to zero.
  37369. */
  37370. DECREMENT = WebGLConstants.DECR,
  37371. /**
  37372. * Bitwise inverts the existing stencil buffer value.
  37373. */
  37374. INVERT = WebGLConstants.INVERT,
  37375. /**
  37376. * Increments the stencil buffer value, wrapping to zero when exceeding the unsigned byte range.
  37377. */
  37378. INCREMENT_WRAP = WebGLConstants.INCR_WRAP,
  37379. /**
  37380. * Decrements the stencil buffer value, wrapping to the maximum unsigned byte instead of going below zero.
  37381. */
  37382. DECREMENT_WRAP = WebGLConstants.DECR_WRAP
  37383. }
  37384. /**
  37385. * An expression for a style applied to a {@link Cesium3DTileset}.
  37386. <p>
  37387. Derived classes of this interface evaluate expressions in the
  37388. {@link https://github.com/CesiumGS/3d-tiles/tree/master/specification/Styling|3D Tiles Styling language}.
  37389. </p>
  37390. <p>
  37391. This type describes an interface and is not intended to be instantiated directly.
  37392. </p>
  37393. */
  37394. export class StyleExpression {
  37395. constructor();
  37396. /**
  37397. * Evaluates the result of an expression, optionally using the provided feature's properties. If the result of
  37398. the expression in the
  37399. {@link https://github.com/CesiumGS/3d-tiles/tree/master/specification/Styling|3D Tiles Styling language}
  37400. is of type <code>Boolean</code>, <code>Number</code>, or <code>String</code>, the corresponding JavaScript
  37401. primitive type will be returned. If the result is a <code>RegExp</code>, a Javascript <code>RegExp</code>
  37402. object will be returned. If the result is a <code>Cartesian2</code>, <code>Cartesian3</code>, or <code>Cartesian4</code>,
  37403. a {@link Cartesian2}, {@link Cartesian3}, or {@link Cartesian4} object will be returned. If the <code>result</code> argument is
  37404. a {@link Color}, the {@link Cartesian4} value is converted to a {@link Color} and then returned.
  37405. * @param feature - The feature whose properties may be used as variables in the expression.
  37406. * @param [result] - The object onto which to store the result.
  37407. * @returns The result of evaluating the expression.
  37408. */
  37409. evaluate(feature: Cesium3DTileFeature, result?: any): boolean | number | string | RegExp | Cartesian2 | Cartesian3 | Cartesian4 | Color;
  37410. /**
  37411. * Evaluates the result of a Color expression, optionally using the provided feature's properties.
  37412. <p>
  37413. This is equivalent to {@link StyleExpression#evaluate} but always returns a {@link Color} object.
  37414. </p>
  37415. * @param feature - The feature whose properties may be used as variables in the expression.
  37416. * @param [result] - The object in which to store the result.
  37417. * @returns The modified result parameter or a new Color instance if one was not provided.
  37418. */
  37419. evaluateColor(feature: Cesium3DTileFeature, result?: Color): Color;
  37420. }
  37421. /**
  37422. * Draws a sun billboard.
  37423. <p>This is only supported in 3D and Columbus view.</p>
  37424. * @example
  37425. * scene.sun = new Cesium.Sun();
  37426. */
  37427. export class Sun {
  37428. constructor();
  37429. /**
  37430. * Determines if the sun will be shown.
  37431. */
  37432. show: boolean;
  37433. /**
  37434. * Gets or sets a number that controls how "bright" the Sun's lens flare appears
  37435. to be. Zero shows just the Sun's disc without any flare.
  37436. Use larger values for a more pronounced flare around the Sun.
  37437. */
  37438. glowFactor: number;
  37439. /**
  37440. * Returns true if this object was destroyed; otherwise, false.
  37441. <br /><br />
  37442. If this object was destroyed, it should not be used; calling any function other than
  37443. <code>isDestroyed</code> will result in a {@link DeveloperError} exception.
  37444. * @returns <code>true</code> if this object was destroyed; otherwise, <code>false</code>.
  37445. */
  37446. isDestroyed(): boolean;
  37447. /**
  37448. * Destroys the WebGL resources held by this object. Destroying an object allows for deterministic
  37449. release of WebGL resources, instead of relying on the garbage collector to destroy this object.
  37450. <br /><br />
  37451. Once an object is destroyed, it should not be used; calling any function other than
  37452. <code>isDestroyed</code> will result in a {@link DeveloperError} exception. Therefore,
  37453. assign the return value (<code>undefined</code>) to the object as done in the example.
  37454. * @example
  37455. * sun = sun && sun.destroy();
  37456. */
  37457. destroy(): void;
  37458. }
  37459. /**
  37460. * A directional light source that originates from the Sun.
  37461. * @param [options] - Object with the following properties:
  37462. * @param [options.color = Color.WHITE] - The light's color.
  37463. * @param [options.intensity = 2.0] - The light's intensity.
  37464. */
  37465. export class SunLight {
  37466. constructor(options?: {
  37467. color?: Color;
  37468. intensity?: number;
  37469. });
  37470. /**
  37471. * The color of the light.
  37472. */
  37473. color: Color;
  37474. /**
  37475. * The intensity of the light.
  37476. */
  37477. intensity: number;
  37478. }
  37479. export namespace TileCoordinatesImageryProvider {
  37480. /**
  37481. * Initialization options for the TileCoordinatesImageryProvider constructor
  37482. * @property [tilingScheme = new GeographicTilingScheme()] - The tiling scheme for which to draw tiles.
  37483. * @property [ellipsoid] - The ellipsoid. If the tilingScheme is specified,
  37484. this parameter is ignored and the tiling scheme's ellipsoid is used instead. If neither
  37485. parameter is specified, the WGS84 ellipsoid is used.
  37486. * @property [color = Color.YELLOW] - The color to draw the tile box and label.
  37487. * @property [tileWidth = 256] - The width of the tile for level-of-detail selection purposes.
  37488. * @property [tileHeight = 256] - The height of the tile for level-of-detail selection purposes.
  37489. */
  37490. type ConstructorOptions = {
  37491. tilingScheme?: TilingScheme;
  37492. ellipsoid?: Ellipsoid;
  37493. color?: Color;
  37494. tileWidth?: number;
  37495. tileHeight?: number;
  37496. };
  37497. }
  37498. /**
  37499. * An {@link ImageryProvider} that draws a box around every rendered tile in the tiling scheme, and draws
  37500. a label inside it indicating the X, Y, Level coordinates of the tile. This is mostly useful for
  37501. debugging terrain and imagery rendering problems.
  37502. * @param [options] - Object describing initialization options
  37503. */
  37504. export class TileCoordinatesImageryProvider {
  37505. constructor(options?: TileCoordinatesImageryProvider.ConstructorOptions);
  37506. /**
  37507. * The default alpha blending value of this provider, with 0.0 representing fully transparent and
  37508. 1.0 representing fully opaque.
  37509. */
  37510. defaultAlpha: number | undefined;
  37511. /**
  37512. * The default alpha blending value on the night side of the globe of this provider, with 0.0 representing fully transparent and
  37513. 1.0 representing fully opaque.
  37514. */
  37515. defaultNightAlpha: number | undefined;
  37516. /**
  37517. * The default alpha blending value on the day side of the globe of this provider, with 0.0 representing fully transparent and
  37518. 1.0 representing fully opaque.
  37519. */
  37520. defaultDayAlpha: number | undefined;
  37521. /**
  37522. * The default brightness of this provider. 1.0 uses the unmodified imagery color. Less than 1.0
  37523. makes the imagery darker while greater than 1.0 makes it brighter.
  37524. */
  37525. defaultBrightness: number | undefined;
  37526. /**
  37527. * The default contrast of this provider. 1.0 uses the unmodified imagery color. Less than 1.0 reduces
  37528. the contrast while greater than 1.0 increases it.
  37529. */
  37530. defaultContrast: number | undefined;
  37531. /**
  37532. * The default hue of this provider in radians. 0.0 uses the unmodified imagery color.
  37533. */
  37534. defaultHue: number | undefined;
  37535. /**
  37536. * The default saturation of this provider. 1.0 uses the unmodified imagery color. Less than 1.0 reduces the
  37537. saturation while greater than 1.0 increases it.
  37538. */
  37539. defaultSaturation: number | undefined;
  37540. /**
  37541. * The default gamma correction to apply to this provider. 1.0 uses the unmodified imagery color.
  37542. */
  37543. defaultGamma: number | undefined;
  37544. /**
  37545. * The default texture minification filter to apply to this provider.
  37546. */
  37547. defaultMinificationFilter: TextureMinificationFilter;
  37548. /**
  37549. * The default texture magnification filter to apply to this provider.
  37550. */
  37551. defaultMagnificationFilter: TextureMagnificationFilter;
  37552. /**
  37553. * Gets the proxy used by this provider.
  37554. */
  37555. readonly proxy: Proxy;
  37556. /**
  37557. * Gets the width of each tile, in pixels. This function should
  37558. not be called before {@link TileCoordinatesImageryProvider#ready} returns true.
  37559. */
  37560. readonly tileWidth: number;
  37561. /**
  37562. * Gets the height of each tile, in pixels. This function should
  37563. not be called before {@link TileCoordinatesImageryProvider#ready} returns true.
  37564. */
  37565. readonly tileHeight: number;
  37566. /**
  37567. * Gets the maximum level-of-detail that can be requested. This function should
  37568. not be called before {@link TileCoordinatesImageryProvider#ready} returns true.
  37569. */
  37570. readonly maximumLevel: number | undefined;
  37571. /**
  37572. * Gets the minimum level-of-detail that can be requested. This function should
  37573. not be called before {@link TileCoordinatesImageryProvider#ready} returns true.
  37574. */
  37575. readonly minimumLevel: number;
  37576. /**
  37577. * Gets the tiling scheme used by this provider. This function should
  37578. not be called before {@link TileCoordinatesImageryProvider#ready} returns true.
  37579. */
  37580. readonly tilingScheme: TilingScheme;
  37581. /**
  37582. * Gets the rectangle, in radians, of the imagery provided by this instance. This function should
  37583. not be called before {@link TileCoordinatesImageryProvider#ready} returns true.
  37584. */
  37585. readonly rectangle: Rectangle;
  37586. /**
  37587. * Gets the tile discard policy. If not undefined, the discard policy is responsible
  37588. for filtering out "missing" tiles via its shouldDiscardImage function. If this function
  37589. returns undefined, no tiles are filtered. This function should
  37590. not be called before {@link TileCoordinatesImageryProvider#ready} returns true.
  37591. */
  37592. readonly tileDiscardPolicy: TileDiscardPolicy;
  37593. /**
  37594. * Gets an event that is raised when the imagery provider encounters an asynchronous error. By subscribing
  37595. to the event, you will be notified of the error and can potentially recover from it. Event listeners
  37596. are passed an instance of {@link TileProviderError}.
  37597. */
  37598. readonly errorEvent: Event;
  37599. /**
  37600. * Gets a value indicating whether or not the provider is ready for use.
  37601. */
  37602. readonly ready: boolean;
  37603. /**
  37604. * Gets a promise that resolves to true when the provider is ready for use.
  37605. */
  37606. readonly readyPromise: Promise<boolean>;
  37607. /**
  37608. * Gets the credit to display when this imagery provider is active. Typically this is used to credit
  37609. the source of the imagery. This function should not be called before {@link TileCoordinatesImageryProvider#ready} returns true.
  37610. */
  37611. readonly credit: Credit;
  37612. /**
  37613. * Gets a value indicating whether or not the images provided by this imagery provider
  37614. include an alpha channel. If this property is false, an alpha channel, if present, will
  37615. be ignored. If this property is true, any images without an alpha channel will be treated
  37616. as if their alpha is 1.0 everywhere. Setting this property to false reduces memory usage
  37617. and texture upload time.
  37618. */
  37619. readonly hasAlphaChannel: boolean;
  37620. /**
  37621. * Gets the credits to be displayed when a given tile is displayed.
  37622. * @param x - The tile X coordinate.
  37623. * @param y - The tile Y coordinate.
  37624. * @param level - The tile level;
  37625. * @returns The credits to be displayed when the tile is displayed.
  37626. */
  37627. getTileCredits(x: number, y: number, level: number): Credit[];
  37628. /**
  37629. * Requests the image for a given tile. This function should
  37630. not be called before {@link TileCoordinatesImageryProvider#ready} returns true.
  37631. * @param x - The tile X coordinate.
  37632. * @param y - The tile Y coordinate.
  37633. * @param level - The tile level.
  37634. * @param [request] - The request object. Intended for internal use only.
  37635. * @returns A promise for the image that will resolve when the image is available, or
  37636. undefined if there are too many active requests to the server, and the request
  37637. should be retried later. The resolved image may be either an
  37638. Image or a Canvas DOM object.
  37639. */
  37640. requestImage(x: number, y: number, level: number, request?: Request): Promise<HTMLImageElement | HTMLCanvasElement> | undefined;
  37641. /**
  37642. * Picking features is not currently supported by this imagery provider, so this function simply returns
  37643. undefined.
  37644. * @param x - The tile X coordinate.
  37645. * @param y - The tile Y coordinate.
  37646. * @param level - The tile level.
  37647. * @param longitude - The longitude at which to pick features.
  37648. * @param latitude - The latitude at which to pick features.
  37649. * @returns A promise for the picked features that will resolve when the asynchronous
  37650. picking completes. The resolved value is an array of {@link ImageryLayerFeatureInfo}
  37651. instances. The array may be empty if no features are found at the given location.
  37652. It may also be undefined if picking is not supported.
  37653. */
  37654. pickFeatures(x: number, y: number, level: number, longitude: number, latitude: number): Promise<ImageryLayerFeatureInfo[]> | undefined;
  37655. }
  37656. /**
  37657. * A policy for discarding tile images according to some criteria. This type describes an
  37658. interface and is not intended to be instantiated directly.
  37659. */
  37660. export class TileDiscardPolicy {
  37661. constructor();
  37662. /**
  37663. * Determines if the discard policy is ready to process images.
  37664. * @returns True if the discard policy is ready to process images; otherwise, false.
  37665. */
  37666. isReady(): boolean;
  37667. /**
  37668. * Given a tile image, decide whether to discard that image.
  37669. * @param image - An image to test.
  37670. * @returns True if the image should be discarded; otherwise, false.
  37671. */
  37672. shouldDiscardImage(image: HTMLImageElement): boolean;
  37673. }
  37674. export namespace TileMapServiceImageryProvider {
  37675. /**
  37676. * Initialization options for the TileMapServiceImageryProvider constructor
  37677. * @property [url = '.'] - Path to image tiles on server.
  37678. * @property [fileExtension = 'png'] - The file extension for images on the server.
  37679. * @property [credit = ''] - A credit for the data source, which is displayed on the canvas.
  37680. * @property [minimumLevel = 0] - The minimum level-of-detail supported by the imagery provider. Take care when specifying
  37681. this that the number of tiles at the minimum level is small, such as four or less. A larger number is likely
  37682. to result in rendering problems.
  37683. * @property [maximumLevel] - The maximum level-of-detail supported by the imagery provider, or undefined if there is no limit.
  37684. * @property [rectangle = Rectangle.MAX_VALUE] - The rectangle, in radians, covered by the image.
  37685. * @property [tilingScheme] - The tiling scheme specifying how the ellipsoidal
  37686. surface is broken into tiles. If this parameter is not provided, a {@link WebMercatorTilingScheme}
  37687. is used.
  37688. * @property [ellipsoid] - The ellipsoid. If the tilingScheme is specified,
  37689. this parameter is ignored and the tiling scheme's ellipsoid is used instead. If neither
  37690. parameter is specified, the WGS84 ellipsoid is used.
  37691. * @property [tileWidth = 256] - Pixel width of image tiles.
  37692. * @property [tileHeight = 256] - Pixel height of image tiles.
  37693. * @property [flipXY] - Older versions of gdal2tiles.py flipped X and Y values in tilemapresource.xml.
  37694. Specifying this option will do the same, allowing for loading of these incorrect tilesets.
  37695. */
  37696. type ConstructorOptions = {
  37697. url?: Resource | string | Promise<Resource> | Promise<string>;
  37698. fileExtension?: string;
  37699. credit?: Credit | string;
  37700. minimumLevel?: number;
  37701. maximumLevel?: number;
  37702. rectangle?: Rectangle;
  37703. tilingScheme?: TilingScheme;
  37704. ellipsoid?: Ellipsoid;
  37705. tileWidth?: number;
  37706. tileHeight?: number;
  37707. flipXY?: boolean;
  37708. };
  37709. }
  37710. /**
  37711. * An imagery provider that provides tiled imagery as generated by
  37712. {@link http://www.maptiler.org/|MapTiler}, {@link http://www.klokan.cz/projects/gdal2tiles/|GDAL2Tiles}, etc.
  37713. * @example
  37714. * var tms = new Cesium.TileMapServiceImageryProvider({
  37715. url : '../images/cesium_maptiler/Cesium_Logo_Color',
  37716. fileExtension: 'png',
  37717. maximumLevel: 4,
  37718. rectangle: new Cesium.Rectangle(
  37719. Cesium.Math.toRadians(-120.0),
  37720. Cesium.Math.toRadians(20.0),
  37721. Cesium.Math.toRadians(-60.0),
  37722. Cesium.Math.toRadians(40.0))
  37723. });
  37724. * @param options - Object describing initialization options
  37725. */
  37726. export class TileMapServiceImageryProvider extends UrlTemplateImageryProvider {
  37727. constructor(options: TileMapServiceImageryProvider.ConstructorOptions);
  37728. }
  37729. /**
  37730. * Provides functionality for ImageryProviders that have time dynamic imagery
  37731. * @param options - Object with the following properties:
  37732. * @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.
  37733. * @param options.times - TimeIntervalCollection with its <code>data</code> property being an object containing time dynamic dimension and their values.
  37734. * @param options.requestImageFunction - A function that will request imagery tiles.
  37735. * @param options.reloadFunction - A function that will be called when all imagery tiles need to be reloaded.
  37736. */
  37737. export class TimeDynamicImagery {
  37738. constructor(options: {
  37739. clock: Clock;
  37740. times: TimeIntervalCollection;
  37741. requestImageFunction: (...params: any[]) => any;
  37742. reloadFunction: (...params: any[]) => any;
  37743. });
  37744. /**
  37745. * Gets or sets a clock that is used to get keep the time used for time dynamic parameters.
  37746. */
  37747. clock: Clock;
  37748. /**
  37749. * Gets or sets a time interval collection.
  37750. */
  37751. times: TimeIntervalCollection;
  37752. /**
  37753. * Gets the current interval.
  37754. */
  37755. currentInterval: TimeInterval;
  37756. /**
  37757. * Gets the tile from the cache if its available.
  37758. * @param x - The tile X coordinate.
  37759. * @param y - The tile Y coordinate.
  37760. * @param level - The tile level.
  37761. * @param [request] - The request object. Intended for internal use only.
  37762. * @returns A promise for the image that will resolve when the image is available, or
  37763. undefined if the tile is not in the cache.
  37764. */
  37765. getFromCache(x: number, y: number, level: number, request?: Request): Promise<HTMLImageElement> | undefined;
  37766. /**
  37767. * Checks if the next interval is approaching and will start preload the tile if necessary. Otherwise it will
  37768. just add the tile to a list to preload when we approach the next interval.
  37769. * @param x - The tile X coordinate.
  37770. * @param y - The tile Y coordinate.
  37771. * @param level - The tile level.
  37772. * @param [request] - The request object. Intended for internal use only.
  37773. */
  37774. checkApproachingInterval(x: number, y: number, level: number, request?: Request): void;
  37775. }
  37776. /**
  37777. * Provides playback of time-dynamic point cloud data.
  37778. <p>
  37779. Point cloud frames are prefetched in intervals determined by the average frame load time and the current clock speed.
  37780. If intermediate frames cannot be loaded in time to meet playback speed, they will be skipped. If frames are sufficiently
  37781. small or the clock is sufficiently slow then no frames will be skipped.
  37782. </p>
  37783. * @param options - Object with the following properties:
  37784. * @param options.clock - A {@link Clock} instance that is used when determining the value for the time dimension.
  37785. * @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>.
  37786. * @param [options.show = true] - Determines if the point cloud will be shown.
  37787. * @param [options.modelMatrix = Matrix4.IDENTITY] - A 4x4 transformation matrix that transforms the point cloud.
  37788. * @param [options.shadows = ShadowMode.ENABLED] - Determines whether the point cloud casts or receives shadows from light sources.
  37789. * @param [options.maximumMemoryUsage = 256] - The maximum amount of memory in MB that can be used by the point cloud.
  37790. * @param [options.shading] - Options for constructing a {@link PointCloudShading} object to control point attenuation and eye dome lighting.
  37791. * @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.
  37792. * @param [options.clippingPlanes] - The {@link ClippingPlaneCollection} used to selectively disable rendering the point cloud.
  37793. */
  37794. export class TimeDynamicPointCloud {
  37795. constructor(options: {
  37796. clock: Clock;
  37797. intervals: TimeIntervalCollection;
  37798. show?: boolean;
  37799. modelMatrix?: Matrix4;
  37800. shadows?: ShadowMode;
  37801. maximumMemoryUsage?: number;
  37802. shading?: any;
  37803. style?: Cesium3DTileStyle;
  37804. clippingPlanes?: ClippingPlaneCollection;
  37805. });
  37806. /**
  37807. * Determines if the point cloud will be shown.
  37808. */
  37809. show: boolean;
  37810. /**
  37811. * A 4x4 transformation matrix that transforms the point cloud.
  37812. */
  37813. modelMatrix: Matrix4;
  37814. /**
  37815. * Determines whether the point cloud casts or receives shadows from light sources.
  37816. <p>
  37817. 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.
  37818. </p>
  37819. <p>
  37820. Shadows are rendered only when {@link Viewer#shadows} is <code>true</code>.
  37821. </p>
  37822. */
  37823. shadows: ShadowMode;
  37824. /**
  37825. * The maximum amount of GPU memory (in MB) that may be used to cache point cloud frames.
  37826. <p>
  37827. Frames that are not being loaded or rendered are unloaded to enforce this.
  37828. </p>
  37829. <p>
  37830. If decreasing this value results in unloading tiles, the tiles are unloaded the next frame.
  37831. </p>
  37832. */
  37833. maximumMemoryUsage: number;
  37834. /**
  37835. * Options for controlling point size based on geometric error and eye dome lighting.
  37836. */
  37837. shading: PointCloudShading;
  37838. /**
  37839. * The style, defined using the
  37840. {@link https://github.com/CesiumGS/3d-tiles/tree/master/specification/Styling|3D Tiles Styling language},
  37841. applied to each point in the point cloud.
  37842. <p>
  37843. Assign <code>undefined</code> to remove the style, which will restore the visual
  37844. appearance of the point cloud to its default when no style was applied.
  37845. </p>
  37846. * @example
  37847. * pointCloud.style = new Cesium.Cesium3DTileStyle({
  37848. color : {
  37849. conditions : [
  37850. ['${Classification} === 0', 'color("purple", 0.5)'],
  37851. ['${Classification} === 1', 'color("red")'],
  37852. ['true', '${COLOR}']
  37853. ]
  37854. },
  37855. show : '${Classification} !== 2'
  37856. });
  37857. */
  37858. style: Cesium3DTileStyle;
  37859. /**
  37860. * The event fired to indicate that a frame failed to load. A frame may fail to load if the
  37861. request for its uri fails or processing fails due to invalid content.
  37862. <p>
  37863. If there are no event listeners, error messages will be logged to the console.
  37864. </p>
  37865. <p>
  37866. The error object passed to the listener contains two properties:
  37867. <ul>
  37868. <li><code>uri</code>: the uri of the failed frame.</li>
  37869. <li><code>message</code>: the error message.</li>
  37870. </ul>
  37871. * @example
  37872. * pointCloud.frameFailed.addEventListener(function(error) {
  37873. console.log('An error occurred loading frame: ' + error.uri);
  37874. console.log('Error: ' + error.message);
  37875. });
  37876. */
  37877. frameFailed: Event;
  37878. /**
  37879. * The event fired to indicate that a new frame was rendered.
  37880. <p>
  37881. The time dynamic point cloud {@link TimeDynamicPointCloud} is passed to the event listener.
  37882. </p>
  37883. * @example
  37884. * pointCloud.frameChanged.addEventListener(function(timeDynamicPointCloud) {
  37885. viewer.camera.viewBoundingSphere(timeDynamicPointCloud.boundingSphere);
  37886. });
  37887. */
  37888. frameChanged: Event;
  37889. /**
  37890. * The {@link ClippingPlaneCollection} used to selectively disable rendering the point cloud.
  37891. */
  37892. clippingPlanes: ClippingPlaneCollection;
  37893. /**
  37894. * The total amount of GPU memory in bytes used by the point cloud.
  37895. */
  37896. readonly totalMemoryUsageInBytes: number;
  37897. /**
  37898. * The bounding sphere of the frame being rendered. Returns <code>undefined</code> if no frame is being rendered.
  37899. */
  37900. readonly boundingSphere: BoundingSphere;
  37901. /**
  37902. * Gets the promise that will be resolved when the point cloud renders a frame for the first time.
  37903. */
  37904. readonly readyPromise: Promise<TimeDynamicPointCloud>;
  37905. /**
  37906. * Marks the point cloud's {@link TimeDynamicPointCloud#style} as dirty, which forces all
  37907. points to re-evaluate the style in the next frame.
  37908. */
  37909. makeStyleDirty(): void;
  37910. /**
  37911. * Returns true if this object was destroyed; otherwise, false.
  37912. <br /><br />
  37913. If this object was destroyed, it should not be used; calling any function other than
  37914. <code>isDestroyed</code> will result in a {@link DeveloperError} exception.
  37915. * @returns <code>true</code> if this object was destroyed; otherwise, <code>false</code>.
  37916. */
  37917. isDestroyed(): boolean;
  37918. /**
  37919. * Destroys the WebGL resources held by this object. Destroying an object allows for deterministic
  37920. release of WebGL resources, instead of relying on the garbage collector to destroy this object.
  37921. <br /><br />
  37922. Once an object is destroyed, it should not be used; calling any function other than
  37923. <code>isDestroyed</code> will result in a {@link DeveloperError} exception. Therefore,
  37924. assign the return value (<code>undefined</code>) to the object as done in the example.
  37925. * @example
  37926. * pointCloud = pointCloud && pointCloud.destroy();
  37927. */
  37928. destroy(): void;
  37929. }
  37930. export namespace UrlTemplateImageryProvider {
  37931. /**
  37932. * Initialization options for the UrlTemplateImageryProvider constructor
  37933. * @property [options] - Object with the following properties:
  37934. * @property url - The URL template to use to request tiles. It has the following keywords:
  37935. <ul>
  37936. <li><code>{z}</code>: The level of the tile in the tiling scheme. Level zero is the root of the quadtree pyramid.</li>
  37937. <li><code>{x}</code>: The tile X coordinate in the tiling scheme, where 0 is the Westernmost tile.</li>
  37938. <li><code>{y}</code>: The tile Y coordinate in the tiling scheme, where 0 is the Northernmost tile.</li>
  37939. <li><code>{s}</code>: One of the available subdomains, used to overcome browser limits on the number of simultaneous requests per host.</li>
  37940. <li><code>{reverseX}</code>: The tile X coordinate in the tiling scheme, where 0 is the Easternmost tile.</li>
  37941. <li><code>{reverseY}</code>: The tile Y coordinate in the tiling scheme, where 0 is the Southernmost tile.</li>
  37942. <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>
  37943. <li><code>{westDegrees}</code>: The Western edge of the tile in geodetic degrees.</li>
  37944. <li><code>{southDegrees}</code>: The Southern edge of the tile in geodetic degrees.</li>
  37945. <li><code>{eastDegrees}</code>: The Eastern edge of the tile in geodetic degrees.</li>
  37946. <li><code>{northDegrees}</code>: The Northern edge of the tile in geodetic degrees.</li>
  37947. <li><code>{westProjected}</code>: The Western edge of the tile in projected coordinates of the tiling scheme.</li>
  37948. <li><code>{southProjected}</code>: The Southern edge of the tile in projected coordinates of the tiling scheme.</li>
  37949. <li><code>{eastProjected}</code>: The Eastern edge of the tile in projected coordinates of the tiling scheme.</li>
  37950. <li><code>{northProjected}</code>: The Northern edge of the tile in projected coordinates of the tiling scheme.</li>
  37951. <li><code>{width}</code>: The width of each tile in pixels.</li>
  37952. <li><code>{height}</code>: The height of each tile in pixels.</li>
  37953. </ul>
  37954. * @property [pickFeaturesUrl] - The URL template to use to pick features. If this property is not specified,
  37955. {@link UrlTemplateImageryProvider#pickFeatures} will immediately returned undefined, indicating no
  37956. features picked. The URL template supports all of the keywords supported by the <code>url</code>
  37957. parameter, plus the following:
  37958. <ul>
  37959. <li><code>{i}</code>: The pixel column (horizontal coordinate) of the picked position, where the Westernmost pixel is 0.</li>
  37960. <li><code>{j}</code>: The pixel row (vertical coordinate) of the picked position, where the Northernmost pixel is 0.</li>
  37961. <li><code>{reverseI}</code>: The pixel column (horizontal coordinate) of the picked position, where the Easternmost pixel is 0.</li>
  37962. <li><code>{reverseJ}</code>: The pixel row (vertical coordinate) of the picked position, where the Southernmost pixel is 0.</li>
  37963. <li><code>{longitudeDegrees}</code>: The longitude of the picked position in degrees.</li>
  37964. <li><code>{latitudeDegrees}</code>: The latitude of the picked position in degrees.</li>
  37965. <li><code>{longitudeProjected}</code>: The longitude of the picked position in the projected coordinates of the tiling scheme.</li>
  37966. <li><code>{latitudeProjected}</code>: The latitude of the picked position in the projected coordinates of the tiling scheme.</li>
  37967. <li><code>{format}</code>: The format in which to get feature information, as specified in the {@link GetFeatureInfoFormat}.</li>
  37968. </ul>
  37969. * @property [urlSchemeZeroPadding] - Gets the URL scheme zero padding for each tile coordinate. The format is '000' where
  37970. each coordinate will be padded on the left with zeros to match the width of the passed string of zeros. e.g. Setting:
  37971. urlSchemeZeroPadding : { '{x}' : '0000'}
  37972. will cause an 'x' value of 12 to return the string '0012' for {x} in the generated URL.
  37973. It the passed object has the following keywords:
  37974. <ul>
  37975. <li> <code>{z}</code>: The zero padding for the level of the tile in the tiling scheme.</li>
  37976. <li> <code>{x}</code>: The zero padding for the tile X coordinate in the tiling scheme.</li>
  37977. <li> <code>{y}</code>: The zero padding for the the tile Y coordinate in the tiling scheme.</li>
  37978. <li> <code>{reverseX}</code>: The zero padding for the tile reverseX coordinate in the tiling scheme.</li>
  37979. <li> <code>{reverseY}</code>: The zero padding for the tile reverseY coordinate in the tiling scheme.</li>
  37980. <li> <code>{reverseZ}</code>: The zero padding for the reverseZ coordinate of the tile in the tiling scheme.</li>
  37981. </ul>
  37982. * @property [subdomains = 'abc'] - The subdomains to use for the <code>{s}</code> placeholder in the URL template.
  37983. If this parameter is a single string, each character in the string is a subdomain. If it is
  37984. an array, each element in the array is a subdomain.
  37985. * @property [credit = ''] - A credit for the data source, which is displayed on the canvas.
  37986. * @property [minimumLevel = 0] - The minimum level-of-detail supported by the imagery provider. Take care when specifying
  37987. this that the number of tiles at the minimum level is small, such as four or less. A larger number is likely
  37988. to result in rendering problems.
  37989. * @property [maximumLevel] - The maximum level-of-detail supported by the imagery provider, or undefined if there is no limit.
  37990. * @property [rectangle = Rectangle.MAX_VALUE] - The rectangle, in radians, covered by the image.
  37991. * @property [tilingScheme = WebMercatorTilingScheme] - The tiling scheme specifying how the ellipsoidal
  37992. surface is broken into tiles. If this parameter is not provided, a {@link WebMercatorTilingScheme}
  37993. is used.
  37994. * @property [ellipsoid] - The ellipsoid. If the tilingScheme is specified,
  37995. this parameter is ignored and the tiling scheme's ellipsoid is used instead. If neither
  37996. parameter is specified, the WGS84 ellipsoid is used.
  37997. * @property [tileWidth = 256] - Pixel width of image tiles.
  37998. * @property [tileHeight = 256] - Pixel height of image tiles.
  37999. * @property [hasAlphaChannel = true] - true if the images provided by this imagery provider
  38000. include an alpha channel; otherwise, false. If this property is false, an alpha channel, if
  38001. present, will be ignored. If this property is true, any images without an alpha channel will
  38002. be treated as if their alpha is 1.0 everywhere. When this property is false, memory usage
  38003. and texture upload time are potentially reduced.
  38004. * @property [getFeatureInfoFormats] - The formats in which to get feature information at a
  38005. specific location when {@link UrlTemplateImageryProvider#pickFeatures} is invoked. If this
  38006. parameter is not specified, feature picking is disabled.
  38007. * @property [enablePickFeatures = true] - If true, {@link UrlTemplateImageryProvider#pickFeatures} will
  38008. request the <code>pickFeaturesUrl</code> and attempt to interpret the features included in the response. If false,
  38009. {@link UrlTemplateImageryProvider#pickFeatures} will immediately return undefined (indicating no pickable
  38010. features) without communicating with the server. Set this property to false if you know your data
  38011. source does not support picking features or if you don't want this provider's features to be pickable. Note
  38012. that this can be dynamically overridden by modifying the {@link UriTemplateImageryProvider#enablePickFeatures}
  38013. property.
  38014. * @property [customTags] - Allow to replace custom keywords in the URL template. The object must have strings as keys and functions as values.
  38015. */
  38016. type ConstructorOptions = {
  38017. options?: Promise<object> | any;
  38018. url: Resource | string;
  38019. pickFeaturesUrl?: Resource | string;
  38020. urlSchemeZeroPadding?: any;
  38021. subdomains?: string | string[];
  38022. credit?: Credit | string;
  38023. minimumLevel?: number;
  38024. maximumLevel?: number;
  38025. rectangle?: Rectangle;
  38026. tilingScheme?: TilingScheme;
  38027. ellipsoid?: Ellipsoid;
  38028. tileWidth?: number;
  38029. tileHeight?: number;
  38030. hasAlphaChannel?: boolean;
  38031. getFeatureInfoFormats?: GetFeatureInfoFormat[];
  38032. enablePickFeatures?: boolean;
  38033. customTags?: any;
  38034. };
  38035. }
  38036. /**
  38037. * Provides imagery by requesting tiles using a specified URL template.
  38038. * @example
  38039. * // Access Natural Earth II imagery, which uses a TMS tiling scheme and Geographic (EPSG:4326) project
  38040. var tms = new Cesium.UrlTemplateImageryProvider({
  38041. url : Cesium.buildModuleUrl('Assets/Textures/NaturalEarthII') + '/{z}/{x}/{reverseY}.jpg',
  38042. credit : '© Analytical Graphics, Inc.',
  38043. tilingScheme : new Cesium.GeographicTilingScheme(),
  38044. maximumLevel : 5
  38045. });
  38046. // Access the CartoDB Positron basemap, which uses an OpenStreetMap-like tiling scheme.
  38047. var positron = new Cesium.UrlTemplateImageryProvider({
  38048. url : 'http://{s}.basemaps.cartocdn.com/light_all/{z}/{x}/{y}.png',
  38049. credit : 'Map tiles by CartoDB, under CC BY 3.0. Data by OpenStreetMap, under ODbL.'
  38050. });
  38051. // Access a Web Map Service (WMS) server.
  38052. var wms = new Cesium.UrlTemplateImageryProvider({
  38053. url : 'https://programs.communications.gov.au/geoserver/ows?tiled=true&' +
  38054. 'transparent=true&format=image%2Fpng&exceptions=application%2Fvnd.ogc.se_xml&' +
  38055. 'styles=&service=WMS&version=1.1.1&request=GetMap&' +
  38056. 'layers=public%3AMyBroadband_Availability&srs=EPSG%3A3857&' +
  38057. 'bbox={westProjected}%2C{southProjected}%2C{eastProjected}%2C{northProjected}&' +
  38058. 'width=256&height=256',
  38059. rectangle : Cesium.Rectangle.fromDegrees(96.799393, -43.598214999057824, 153.63925700000001, -9.2159219997013)
  38060. });
  38061. // Using custom tags in your template url.
  38062. var custom = new Cesium.UrlTemplateImageryProvider({
  38063. url : 'https://yoururl/{Time}/{z}/{y}/{x}.png',
  38064. customTags : {
  38065. Time: function(imageryProvider, x, y, level) {
  38066. return '20171231'
  38067. }
  38068. }
  38069. });
  38070. * @param options - Object describing initialization options
  38071. */
  38072. export class UrlTemplateImageryProvider {
  38073. constructor(options: UrlTemplateImageryProvider.ConstructorOptions);
  38074. /**
  38075. * The default alpha blending value of this provider, with 0.0 representing fully transparent and
  38076. 1.0 representing fully opaque.
  38077. */
  38078. defaultAlpha: number | undefined;
  38079. /**
  38080. * The default alpha blending value on the night side of the globe of this provider, with 0.0 representing fully transparent and
  38081. 1.0 representing fully opaque.
  38082. */
  38083. defaultNightAlpha: number | undefined;
  38084. /**
  38085. * The default alpha blending value on the day side of the globe of this provider, with 0.0 representing fully transparent and
  38086. 1.0 representing fully opaque.
  38087. */
  38088. defaultDayAlpha: number | undefined;
  38089. /**
  38090. * The default brightness of this provider. 1.0 uses the unmodified imagery color. Less than 1.0
  38091. makes the imagery darker while greater than 1.0 makes it brighter.
  38092. */
  38093. defaultBrightness: number | undefined;
  38094. /**
  38095. * The default contrast of this provider. 1.0 uses the unmodified imagery color. Less than 1.0 reduces
  38096. the contrast while greater than 1.0 increases it.
  38097. */
  38098. defaultContrast: number | undefined;
  38099. /**
  38100. * The default hue of this provider in radians. 0.0 uses the unmodified imagery color.
  38101. */
  38102. defaultHue: number | undefined;
  38103. /**
  38104. * The default saturation of this provider. 1.0 uses the unmodified imagery color. Less than 1.0 reduces the
  38105. saturation while greater than 1.0 increases it.
  38106. */
  38107. defaultSaturation: number | undefined;
  38108. /**
  38109. * The default gamma correction to apply to this provider. 1.0 uses the unmodified imagery color.
  38110. */
  38111. defaultGamma: number | undefined;
  38112. /**
  38113. * The default texture minification filter to apply to this provider.
  38114. */
  38115. defaultMinificationFilter: TextureMinificationFilter;
  38116. /**
  38117. * The default texture magnification filter to apply to this provider.
  38118. */
  38119. defaultMagnificationFilter: TextureMagnificationFilter;
  38120. /**
  38121. * Gets or sets a value indicating whether feature picking is enabled. If true, {@link UrlTemplateImageryProvider#pickFeatures} will
  38122. request the <code>options.pickFeaturesUrl</code> and attempt to interpret the features included in the response. If false,
  38123. {@link UrlTemplateImageryProvider#pickFeatures} will immediately return undefined (indicating no pickable
  38124. features) without communicating with the server. Set this property to false if you know your data
  38125. source does not support picking features or if you don't want this provider's features to be pickable.
  38126. */
  38127. enablePickFeatures: boolean;
  38128. /**
  38129. * Gets the URL template to use to request tiles. It has the following keywords:
  38130. <ul>
  38131. <li> <code>{z}</code>: The level of the tile in the tiling scheme. Level zero is the root of the quadtree pyramid.</li>
  38132. <li> <code>{x}</code>: The tile X coordinate in the tiling scheme, where 0 is the Westernmost tile.</li>
  38133. <li> <code>{y}</code>: The tile Y coordinate in the tiling scheme, where 0 is the Northernmost tile.</li>
  38134. <li> <code>{s}</code>: One of the available subdomains, used to overcome browser limits on the number of simultaneous requests per host.</li>
  38135. <li> <code>{reverseX}</code>: The tile X coordinate in the tiling scheme, where 0 is the Easternmost tile.</li>
  38136. <li> <code>{reverseY}</code>: The tile Y coordinate in the tiling scheme, where 0 is the Southernmost tile.</li>
  38137. <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>
  38138. <li> <code>{westDegrees}</code>: The Western edge of the tile in geodetic degrees.</li>
  38139. <li> <code>{southDegrees}</code>: The Southern edge of the tile in geodetic degrees.</li>
  38140. <li> <code>{eastDegrees}</code>: The Eastern edge of the tile in geodetic degrees.</li>
  38141. <li> <code>{northDegrees}</code>: The Northern edge of the tile in geodetic degrees.</li>
  38142. <li> <code>{westProjected}</code>: The Western edge of the tile in projected coordinates of the tiling scheme.</li>
  38143. <li> <code>{southProjected}</code>: The Southern edge of the tile in projected coordinates of the tiling scheme.</li>
  38144. <li> <code>{eastProjected}</code>: The Eastern edge of the tile in projected coordinates of the tiling scheme.</li>
  38145. <li> <code>{northProjected}</code>: The Northern edge of the tile in projected coordinates of the tiling scheme.</li>
  38146. <li> <code>{width}</code>: The width of each tile in pixels.</li>
  38147. <li> <code>{height}</code>: The height of each tile in pixels.</li>
  38148. </ul>
  38149. */
  38150. readonly url: string;
  38151. /**
  38152. * Gets the URL scheme zero padding for each tile coordinate. The format is '000' where each coordinate will be padded on
  38153. the left with zeros to match the width of the passed string of zeros. e.g. Setting:
  38154. urlSchemeZeroPadding : { '{x}' : '0000'}
  38155. will cause an 'x' value of 12 to return the string '0012' for {x} in the generated URL.
  38156. It has the following keywords:
  38157. <ul>
  38158. <li> <code>{z}</code>: The zero padding for the level of the tile in the tiling scheme.</li>
  38159. <li> <code>{x}</code>: The zero padding for the tile X coordinate in the tiling scheme.</li>
  38160. <li> <code>{y}</code>: The zero padding for the the tile Y coordinate in the tiling scheme.</li>
  38161. <li> <code>{reverseX}</code>: The zero padding for the tile reverseX coordinate in the tiling scheme.</li>
  38162. <li> <code>{reverseY}</code>: The zero padding for the tile reverseY coordinate in the tiling scheme.</li>
  38163. <li> <code>{reverseZ}</code>: The zero padding for the reverseZ coordinate of the tile in the tiling scheme.</li>
  38164. </ul>
  38165. */
  38166. readonly urlSchemeZeroPadding: any;
  38167. /**
  38168. * Gets the URL template to use to use to pick features. If this property is not specified,
  38169. {@link UrlTemplateImageryProvider#pickFeatures} will immediately return undefined, indicating no
  38170. features picked. The URL template supports all of the keywords supported by the
  38171. {@link UrlTemplateImageryProvider#url} property, plus the following:
  38172. <ul>
  38173. <li><code>{i}</code>: The pixel column (horizontal coordinate) of the picked position, where the Westernmost pixel is 0.</li>
  38174. <li><code>{j}</code>: The pixel row (vertical coordinate) of the picked position, where the Northernmost pixel is 0.</li>
  38175. <li><code>{reverseI}</code>: The pixel column (horizontal coordinate) of the picked position, where the Easternmost pixel is 0.</li>
  38176. <li><code>{reverseJ}</code>: The pixel row (vertical coordinate) of the picked position, where the Southernmost pixel is 0.</li>
  38177. <li><code>{longitudeDegrees}</code>: The longitude of the picked position in degrees.</li>
  38178. <li><code>{latitudeDegrees}</code>: The latitude of the picked position in degrees.</li>
  38179. <li><code>{longitudeProjected}</code>: The longitude of the picked position in the projected coordinates of the tiling scheme.</li>
  38180. <li><code>{latitudeProjected}</code>: The latitude of the picked position in the projected coordinates of the tiling scheme.</li>
  38181. <li><code>{format}</code>: The format in which to get feature information, as specified in the {@link GetFeatureInfoFormat}.</li>
  38182. </ul>
  38183. */
  38184. readonly pickFeaturesUrl: string;
  38185. /**
  38186. * Gets the proxy used by this provider.
  38187. */
  38188. readonly proxy: Proxy;
  38189. /**
  38190. * Gets the width of each tile, in pixels. This function should
  38191. not be called before {@link UrlTemplateImageryProvider#ready} returns true.
  38192. */
  38193. readonly tileWidth: number;
  38194. /**
  38195. * Gets the height of each tile, in pixels. This function should
  38196. not be called before {@link UrlTemplateImageryProvider#ready} returns true.
  38197. */
  38198. readonly tileHeight: number;
  38199. /**
  38200. * Gets the maximum level-of-detail that can be requested, or undefined if there is no limit.
  38201. This function should not be called before {@link UrlTemplateImageryProvider#ready} returns true.
  38202. */
  38203. readonly maximumLevel: number | undefined;
  38204. /**
  38205. * Gets the minimum level-of-detail that can be requested. This function should
  38206. not be called before {@link UrlTemplateImageryProvider#ready} returns true.
  38207. */
  38208. readonly minimumLevel: number;
  38209. /**
  38210. * Gets the tiling scheme used by this provider. This function should
  38211. not be called before {@link UrlTemplateImageryProvider#ready} returns true.
  38212. */
  38213. readonly tilingScheme: TilingScheme;
  38214. /**
  38215. * Gets the rectangle, in radians, of the imagery provided by this instance. This function should
  38216. not be called before {@link UrlTemplateImageryProvider#ready} returns true.
  38217. */
  38218. readonly rectangle: Rectangle;
  38219. /**
  38220. * Gets the tile discard policy. If not undefined, the discard policy is responsible
  38221. for filtering out "missing" tiles via its shouldDiscardImage function. If this function
  38222. returns undefined, no tiles are filtered. This function should
  38223. not be called before {@link UrlTemplateImageryProvider#ready} returns true.
  38224. */
  38225. readonly tileDiscardPolicy: TileDiscardPolicy;
  38226. /**
  38227. * Gets an event that is raised when the imagery provider encounters an asynchronous error. By subscribing
  38228. to the event, you will be notified of the error and can potentially recover from it. Event listeners
  38229. are passed an instance of {@link TileProviderError}.
  38230. */
  38231. readonly errorEvent: Event;
  38232. /**
  38233. * Gets a value indicating whether or not the provider is ready for use.
  38234. */
  38235. readonly ready: boolean;
  38236. /**
  38237. * Gets a promise that resolves to true when the provider is ready for use.
  38238. */
  38239. readonly readyPromise: Promise<boolean>;
  38240. /**
  38241. * Gets the credit to display when this imagery provider is active. Typically this is used to credit
  38242. the source of the imagery. This function should not be called before {@link UrlTemplateImageryProvider#ready} returns true.
  38243. */
  38244. readonly credit: Credit;
  38245. /**
  38246. * Gets a value indicating whether or not the images provided by this imagery provider
  38247. include an alpha channel. If this property is false, an alpha channel, if present, will
  38248. be ignored. If this property is true, any images without an alpha channel will be treated
  38249. as if their alpha is 1.0 everywhere. When this property is false, memory usage
  38250. and texture upload time are reduced. This function should
  38251. not be called before {@link ImageryProvider#ready} returns true.
  38252. */
  38253. readonly hasAlphaChannel: boolean;
  38254. /**
  38255. * Reinitializes this instance. Reinitializing an instance already in use is supported, but it is not
  38256. recommended because existing tiles provided by the imagery provider will not be updated.
  38257. * @param options - Any of the options that may be passed to the {@link UrlTemplateImageryProvider} constructor.
  38258. */
  38259. reinitialize(options: Promise<object> | any): void;
  38260. /**
  38261. * Gets the credits to be displayed when a given tile is displayed.
  38262. * @param x - The tile X coordinate.
  38263. * @param y - The tile Y coordinate.
  38264. * @param level - The tile level;
  38265. * @returns The credits to be displayed when the tile is displayed.
  38266. */
  38267. getTileCredits(x: number, y: number, level: number): Credit[];
  38268. /**
  38269. * Requests the image for a given tile. This function should
  38270. not be called before {@link UrlTemplateImageryProvider#ready} returns true.
  38271. * @param x - The tile X coordinate.
  38272. * @param y - The tile Y coordinate.
  38273. * @param level - The tile level.
  38274. * @param [request] - The request object. Intended for internal use only.
  38275. * @returns A promise for the image that will resolve when the image is available, or
  38276. undefined if there are too many active requests to the server, and the request
  38277. should be retried later. The resolved image may be either an
  38278. Image or a Canvas DOM object.
  38279. */
  38280. requestImage(x: number, y: number, level: number, request?: Request): Promise<HTMLImageElement | HTMLCanvasElement> | undefined;
  38281. /**
  38282. * Asynchronously determines what features, if any, are located at a given longitude and latitude within
  38283. a tile. This function should not be called before {@link ImageryProvider#ready} returns true.
  38284. * @param x - The tile X coordinate.
  38285. * @param y - The tile Y coordinate.
  38286. * @param level - The tile level.
  38287. * @param longitude - The longitude at which to pick features.
  38288. * @param latitude - The latitude at which to pick features.
  38289. * @returns A promise for the picked features that will resolve when the asynchronous
  38290. picking completes. The resolved value is an array of {@link ImageryLayerFeatureInfo}
  38291. instances. The array may be empty if no features are found at the given location.
  38292. It may also be undefined if picking is not supported.
  38293. */
  38294. pickFeatures(x: number, y: number, level: number, longitude: number, latitude: number): Promise<ImageryLayerFeatureInfo[]> | undefined;
  38295. }
  38296. /**
  38297. * The vertical location of an origin relative to an object, e.g., a {@link Billboard}
  38298. or {@link Label}. For example, setting the vertical origin to <code>TOP</code>
  38299. or <code>BOTTOM</code> will display a billboard above or below (in screen space)
  38300. the anchor position.
  38301. <br /><br />
  38302. <div align='center'>
  38303. <img src='Images/Billboard.setVerticalOrigin.png' width='695' height='175' /><br />
  38304. </div>
  38305. */
  38306. export enum VerticalOrigin {
  38307. /**
  38308. * The origin is at the vertical center between <code>BASELINE</code> and <code>TOP</code>.
  38309. */
  38310. CENTER = 0,
  38311. /**
  38312. * The origin is at the bottom of the object.
  38313. */
  38314. BOTTOM = 1,
  38315. /**
  38316. * If the object contains text, the origin is at the baseline of the text, else the origin is at the bottom of the object.
  38317. */
  38318. BASELINE = 2,
  38319. /**
  38320. * The origin is at the top of the object.
  38321. */
  38322. TOP = -1
  38323. }
  38324. /**
  38325. * A viewport aligned quad.
  38326. * @example
  38327. * var viewportQuad = new Cesium.ViewportQuad(new Cesium.BoundingRectangle(0, 0, 80, 40));
  38328. viewportQuad.material.uniforms.color = new Cesium.Color(1.0, 0.0, 0.0, 1.0);
  38329. * @param [rectangle] - The {@link BoundingRectangle} defining the quad's position within the viewport.
  38330. * @param [material] - The {@link Material} defining the surface appearance of the viewport quad.
  38331. */
  38332. export class ViewportQuad {
  38333. constructor(rectangle?: BoundingRectangle, material?: Material);
  38334. /**
  38335. * Determines if the viewport quad primitive will be shown.
  38336. */
  38337. show: boolean;
  38338. /**
  38339. * The BoundingRectangle defining the quad's position within the viewport.
  38340. * @example
  38341. * viewportQuad.rectangle = new Cesium.BoundingRectangle(0, 0, 80, 40);
  38342. */
  38343. rectangle: BoundingRectangle;
  38344. /**
  38345. * The surface appearance of the viewport quad. This can be one of several built-in {@link Material} objects or a custom material, scripted with
  38346. {@link https://github.com/CesiumGS/cesium/wiki/Fabric|Fabric}.
  38347. <p>
  38348. The default material is <code>Material.ColorType</code>.
  38349. </p>
  38350. * @example
  38351. * // 1. Change the color of the default material to yellow
  38352. viewportQuad.material.uniforms.color = new Cesium.Color(1.0, 1.0, 0.0, 1.0);
  38353. // 2. Change material to horizontal stripes
  38354. viewportQuad.material = Cesium.Material.fromType(Cesium.Material.StripeType);
  38355. */
  38356. material: Material;
  38357. /**
  38358. * Called when {@link Viewer} or {@link CesiumWidget} render the scene to
  38359. get the draw commands needed to render this primitive.
  38360. <p>
  38361. Do not call this function directly. This is documented just to
  38362. list the exceptions that may be propagated when the scene is rendered:
  38363. </p>
  38364. */
  38365. update(): void;
  38366. /**
  38367. * Returns true if this object was destroyed; otherwise, false.
  38368. <br /><br />
  38369. If this object was destroyed, it should not be used; calling any function other than
  38370. <code>isDestroyed</code> will result in a {@link DeveloperError} exception.
  38371. * @returns True if this object was destroyed; otherwise, false.
  38372. */
  38373. isDestroyed(): boolean;
  38374. /**
  38375. * Destroys the WebGL resources held by this object. Destroying an object allows for deterministic
  38376. release of WebGL resources, instead of relying on the garbage collector to destroy this object.
  38377. <br /><br />
  38378. Once an object is destroyed, it should not be used; calling any function other than
  38379. <code>isDestroyed</code> will result in a {@link DeveloperError} exception. Therefore,
  38380. assign the return value (<code>undefined</code>) to the object as done in the example.
  38381. * @example
  38382. * quad = quad && quad.destroy();
  38383. */
  38384. destroy(): void;
  38385. }
  38386. export namespace WebMapServiceImageryProvider {
  38387. /**
  38388. * Initialization options for the WebMapServiceImageryProvider constructor
  38389. * @property url - The URL of the WMS service. The URL supports the same keywords as the {@link UrlTemplateImageryProvider}.
  38390. * @property layers - The layers to include, separated by commas.
  38391. * @property [parameters = WebMapServiceImageryProvider.DefaultParameters] - Additional parameters to pass to the WMS server in the GetMap URL.
  38392. * @property [getFeatureInfoParameters = WebMapServiceImageryProvider.GetFeatureInfoDefaultParameters] - Additional parameters to pass to the WMS server in the GetFeatureInfo URL.
  38393. * @property [enablePickFeatures = true] - If true, {@link WebMapServiceImageryProvider#pickFeatures} will invoke
  38394. the GetFeatureInfo operation on the WMS server and return the features included in the response. If false,
  38395. {@link WebMapServiceImageryProvider#pickFeatures} will immediately return undefined (indicating no pickable features)
  38396. without communicating with the server. Set this property to false if you know your WMS server does not support
  38397. GetFeatureInfo or if you don't want this provider's features to be pickable. Note that this can be dynamically
  38398. overridden by modifying the WebMapServiceImageryProvider#enablePickFeatures property.
  38399. * @property [getFeatureInfoFormats = WebMapServiceImageryProvider.DefaultGetFeatureInfoFormats] - The formats
  38400. in which to try WMS GetFeatureInfo requests.
  38401. * @property [rectangle = Rectangle.MAX_VALUE] - The rectangle of the layer.
  38402. * @property [tilingScheme = new GeographicTilingScheme()] - The tiling scheme to use to divide the world into tiles.
  38403. * @property [ellipsoid] - The ellipsoid. If the tilingScheme is specified,
  38404. this parameter is ignored and the tiling scheme's ellipsoid is used instead. If neither
  38405. parameter is specified, the WGS84 ellipsoid is used.
  38406. * @property [tileWidth = 256] - The width of each tile in pixels.
  38407. * @property [tileHeight = 256] - The height of each tile in pixels.
  38408. * @property [minimumLevel = 0] - The minimum level-of-detail supported by the imagery provider. Take care when
  38409. specifying this that the number of tiles at the minimum level is small, such as four or less. A larger number is
  38410. likely to result in rendering problems.
  38411. * @property [maximumLevel] - The maximum level-of-detail supported by the imagery provider, or undefined if there is no limit.
  38412. If not specified, there is no limit.
  38413. * @property [crs] - CRS specification, for use with WMS specification >= 1.3.0.
  38414. * @property [srs] - SRS specification, for use with WMS specification 1.1.0 or 1.1.1
  38415. * @property [credit] - A credit for the data source, which is displayed on the canvas.
  38416. * @property [subdomains = 'abc'] - The subdomains to use for the <code>{s}</code> placeholder in the URL template.
  38417. If this parameter is a single string, each character in the string is a subdomain. If it is
  38418. an array, each element in the array is a subdomain.
  38419. * @property [clock] - A Clock instance that is used when determining the value for the time dimension. Required when `times` is specified.
  38420. * @property [times] - TimeIntervalCollection with its data property being an object containing time dynamic dimension and their values.
  38421. */
  38422. type ConstructorOptions = {
  38423. url: Resource | string;
  38424. layers: string;
  38425. parameters?: any;
  38426. getFeatureInfoParameters?: any;
  38427. enablePickFeatures?: boolean;
  38428. getFeatureInfoFormats?: GetFeatureInfoFormat[];
  38429. rectangle?: Rectangle;
  38430. tilingScheme?: TilingScheme;
  38431. ellipsoid?: Ellipsoid;
  38432. tileWidth?: number;
  38433. tileHeight?: number;
  38434. minimumLevel?: number;
  38435. maximumLevel?: number;
  38436. crs?: string;
  38437. srs?: string;
  38438. credit?: Credit | string;
  38439. subdomains?: string | string[];
  38440. clock?: Clock;
  38441. times?: TimeIntervalCollection;
  38442. };
  38443. }
  38444. /**
  38445. * Provides tiled imagery hosted by a Web Map Service (WMS) server.
  38446. * @example
  38447. * var provider = new Cesium.WebMapServiceImageryProvider({
  38448. url : 'https://sampleserver1.arcgisonline.com/ArcGIS/services/Specialty/ESRI_StatesCitiesRivers_USA/MapServer/WMSServer',
  38449. layers : '0',
  38450. proxy: new Cesium.DefaultProxy('/proxy/')
  38451. });
  38452. viewer.imageryLayers.addImageryProvider(provider);
  38453. * @param options - Object describing initialization options
  38454. */
  38455. export class WebMapServiceImageryProvider {
  38456. constructor(options: WebMapServiceImageryProvider.ConstructorOptions);
  38457. /**
  38458. * The default alpha blending value of this provider, with 0.0 representing fully transparent and
  38459. 1.0 representing fully opaque.
  38460. */
  38461. defaultAlpha: number | undefined;
  38462. /**
  38463. * The default alpha blending value on the night side of the globe of this provider, with 0.0 representing fully transparent and
  38464. 1.0 representing fully opaque.
  38465. */
  38466. defaultNightAlpha: number | undefined;
  38467. /**
  38468. * The default alpha blending value on the day side of the globe of this provider, with 0.0 representing fully transparent and
  38469. 1.0 representing fully opaque.
  38470. */
  38471. defaultDayAlpha: number | undefined;
  38472. /**
  38473. * The default brightness of this provider. 1.0 uses the unmodified imagery color. Less than 1.0
  38474. makes the imagery darker while greater than 1.0 makes it brighter.
  38475. */
  38476. defaultBrightness: number | undefined;
  38477. /**
  38478. * The default contrast of this provider. 1.0 uses the unmodified imagery color. Less than 1.0 reduces
  38479. the contrast while greater than 1.0 increases it.
  38480. */
  38481. defaultContrast: number | undefined;
  38482. /**
  38483. * The default hue of this provider in radians. 0.0 uses the unmodified imagery color.
  38484. */
  38485. defaultHue: number | undefined;
  38486. /**
  38487. * The default saturation of this provider. 1.0 uses the unmodified imagery color. Less than 1.0 reduces the
  38488. saturation while greater than 1.0 increases it.
  38489. */
  38490. defaultSaturation: number | undefined;
  38491. /**
  38492. * The default gamma correction to apply to this provider. 1.0 uses the unmodified imagery color.
  38493. */
  38494. defaultGamma: number | undefined;
  38495. /**
  38496. * The default texture minification filter to apply to this provider.
  38497. */
  38498. defaultMinificationFilter: TextureMinificationFilter;
  38499. /**
  38500. * The default texture magnification filter to apply to this provider.
  38501. */
  38502. defaultMagnificationFilter: TextureMagnificationFilter;
  38503. /**
  38504. * Gets the URL of the WMS server.
  38505. */
  38506. readonly url: string;
  38507. /**
  38508. * Gets the proxy used by this provider.
  38509. */
  38510. readonly proxy: Proxy;
  38511. /**
  38512. * Gets the names of the WMS layers, separated by commas.
  38513. */
  38514. readonly layers: string;
  38515. /**
  38516. * Gets the width of each tile, in pixels. This function should
  38517. not be called before {@link WebMapServiceImageryProvider#ready} returns true.
  38518. */
  38519. readonly tileWidth: number;
  38520. /**
  38521. * Gets the height of each tile, in pixels. This function should
  38522. not be called before {@link WebMapServiceImageryProvider#ready} returns true.
  38523. */
  38524. readonly tileHeight: number;
  38525. /**
  38526. * Gets the maximum level-of-detail that can be requested. This function should
  38527. not be called before {@link WebMapServiceImageryProvider#ready} returns true.
  38528. */
  38529. readonly maximumLevel: number | undefined;
  38530. /**
  38531. * Gets the minimum level-of-detail that can be requested. This function should
  38532. not be called before {@link WebMapServiceImageryProvider#ready} returns true.
  38533. */
  38534. readonly minimumLevel: number;
  38535. /**
  38536. * Gets the tiling scheme used by this provider. This function should
  38537. not be called before {@link WebMapServiceImageryProvider#ready} returns true.
  38538. */
  38539. readonly tilingScheme: TilingScheme;
  38540. /**
  38541. * Gets the rectangle, in radians, of the imagery provided by this instance. This function should
  38542. not be called before {@link WebMapServiceImageryProvider#ready} returns true.
  38543. */
  38544. readonly rectangle: Rectangle;
  38545. /**
  38546. * Gets the tile discard policy. If not undefined, the discard policy is responsible
  38547. for filtering out "missing" tiles via its shouldDiscardImage function. If this function
  38548. returns undefined, no tiles are filtered. This function should
  38549. not be called before {@link WebMapServiceImageryProvider#ready} returns true.
  38550. */
  38551. readonly tileDiscardPolicy: TileDiscardPolicy;
  38552. /**
  38553. * Gets an event that is raised when the imagery provider encounters an asynchronous error. By subscribing
  38554. to the event, you will be notified of the error and can potentially recover from it. Event listeners
  38555. are passed an instance of {@link TileProviderError}.
  38556. */
  38557. readonly errorEvent: Event;
  38558. /**
  38559. * Gets a value indicating whether or not the provider is ready for use.
  38560. */
  38561. readonly ready: boolean;
  38562. /**
  38563. * Gets a promise that resolves to true when the provider is ready for use.
  38564. */
  38565. readonly readyPromise: Promise<boolean>;
  38566. /**
  38567. * Gets the credit to display when this imagery provider is active. Typically this is used to credit
  38568. the source of the imagery. This function should not be called before {@link WebMapServiceImageryProvider#ready} returns true.
  38569. */
  38570. readonly credit: Credit;
  38571. /**
  38572. * Gets a value indicating whether or not the images provided by this imagery provider
  38573. include an alpha channel. If this property is false, an alpha channel, if present, will
  38574. be ignored. If this property is true, any images without an alpha channel will be treated
  38575. as if their alpha is 1.0 everywhere. When this property is false, memory usage
  38576. and texture upload time are reduced.
  38577. */
  38578. readonly hasAlphaChannel: boolean;
  38579. /**
  38580. * Gets or sets a value indicating whether feature picking is enabled. If true, {@link WebMapServiceImageryProvider#pickFeatures} will
  38581. invoke the <code>GetFeatureInfo</code> service on the WMS server and attempt to interpret the features included in the response. If false,
  38582. {@link WebMapServiceImageryProvider#pickFeatures} will immediately return undefined (indicating no pickable
  38583. features) without communicating with the server. Set this property to false if you know your data
  38584. source does not support picking features or if you don't want this provider's features to be pickable.
  38585. */
  38586. enablePickFeatures: boolean;
  38587. /**
  38588. * Gets or sets a clock that is used to get keep the time used for time dynamic parameters.
  38589. */
  38590. clock: Clock;
  38591. /**
  38592. * Gets or sets a time interval collection that is used to get time dynamic parameters. The data of each
  38593. TimeInterval is an object containing the keys and values of the properties that are used during
  38594. tile requests.
  38595. */
  38596. times: TimeIntervalCollection;
  38597. /**
  38598. * Gets the credits to be displayed when a given tile is displayed.
  38599. * @param x - The tile X coordinate.
  38600. * @param y - The tile Y coordinate.
  38601. * @param level - The tile level;
  38602. * @returns The credits to be displayed when the tile is displayed.
  38603. */
  38604. getTileCredits(x: number, y: number, level: number): Credit[];
  38605. /**
  38606. * Requests the image for a given tile. This function should
  38607. not be called before {@link WebMapServiceImageryProvider#ready} returns true.
  38608. * @param x - The tile X coordinate.
  38609. * @param y - The tile Y coordinate.
  38610. * @param level - The tile level.
  38611. * @param [request] - The request object. Intended for internal use only.
  38612. * @returns A promise for the image that will resolve when the image is available, or
  38613. undefined if there are too many active requests to the server, and the request
  38614. should be retried later. The resolved image may be either an
  38615. Image or a Canvas DOM object.
  38616. */
  38617. requestImage(x: number, y: number, level: number, request?: Request): Promise<HTMLImageElement | HTMLCanvasElement> | undefined;
  38618. /**
  38619. * Asynchronously determines what features, if any, are located at a given longitude and latitude within
  38620. a tile. This function should not be called before {@link ImageryProvider#ready} returns true.
  38621. * @param x - The tile X coordinate.
  38622. * @param y - The tile Y coordinate.
  38623. * @param level - The tile level.
  38624. * @param longitude - The longitude at which to pick features.
  38625. * @param latitude - The latitude at which to pick features.
  38626. * @returns A promise for the picked features that will resolve when the asynchronous
  38627. picking completes. The resolved value is an array of {@link ImageryLayerFeatureInfo}
  38628. instances. The array may be empty if no features are found at the given location.
  38629. */
  38630. pickFeatures(x: number, y: number, level: number, longitude: number, latitude: number): Promise<ImageryLayerFeatureInfo[]> | undefined;
  38631. /**
  38632. * The default parameters to include in the WMS URL to obtain images. The values are as follows:
  38633. service=WMS
  38634. version=1.1.1
  38635. request=GetMap
  38636. styles=
  38637. format=image/jpeg
  38638. */
  38639. static readonly DefaultParameters: any;
  38640. /**
  38641. * The default parameters to include in the WMS URL to get feature information. The values are as follows:
  38642. service=WMS
  38643. version=1.1.1
  38644. request=GetFeatureInfo
  38645. */
  38646. static readonly GetFeatureInfoDefaultParameters: any;
  38647. }
  38648. export namespace WebMapTileServiceImageryProvider {
  38649. /**
  38650. * Initialization options for the WebMapTileServiceImageryProvider constructor
  38651. * @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.
  38652. * @property [format = 'image/jpeg'] - The MIME type for images to retrieve from the server.
  38653. * @property layer - The layer name for WMTS requests.
  38654. * @property style - The style name for WMTS requests.
  38655. * @property tileMatrixSetID - The identifier of the TileMatrixSet to use for WMTS requests.
  38656. * @property [tileMatrixLabels] - A list of identifiers in the TileMatrix to use for WMTS requests, one per TileMatrix level.
  38657. * @property [clock] - A Clock instance that is used when determining the value for the time dimension. Required when `times` is specified.
  38658. * @property [times] - TimeIntervalCollection with its <code>data</code> property being an object containing time dynamic dimension and their values.
  38659. * @property [dimensions] - A object containing static dimensions and their values.
  38660. * @property [tileWidth = 256] - The tile width in pixels.
  38661. * @property [tileHeight = 256] - The tile height in pixels.
  38662. * @property [tilingScheme] - The tiling scheme corresponding to the organization of the tiles in the TileMatrixSet.
  38663. * @property [rectangle = Rectangle.MAX_VALUE] - The rectangle covered by the layer.
  38664. * @property [minimumLevel = 0] - The minimum level-of-detail supported by the imagery provider.
  38665. * @property [maximumLevel] - The maximum level-of-detail supported by the imagery provider, or undefined if there is no limit.
  38666. * @property [ellipsoid] - The ellipsoid. If not specified, the WGS84 ellipsoid is used.
  38667. * @property [credit] - A credit for the data source, which is displayed on the canvas.
  38668. * @property [subdomains = 'abc'] - The subdomains to use for the <code>{s}</code> placeholder in the URL template.
  38669. If this parameter is a single string, each character in the string is a subdomain. If it is
  38670. an array, each element in the array is a subdomain.
  38671. */
  38672. type ConstructorOptions = {
  38673. url: Resource | string;
  38674. format?: string;
  38675. layer: string;
  38676. style: string;
  38677. tileMatrixSetID: string;
  38678. tileMatrixLabels?: any[];
  38679. clock?: Clock;
  38680. times?: TimeIntervalCollection;
  38681. dimensions?: any;
  38682. tileWidth?: number;
  38683. tileHeight?: number;
  38684. tilingScheme?: TilingScheme;
  38685. rectangle?: Rectangle;
  38686. minimumLevel?: number;
  38687. maximumLevel?: number;
  38688. ellipsoid?: Ellipsoid;
  38689. credit?: Credit | string;
  38690. subdomains?: string | string[];
  38691. };
  38692. }
  38693. /**
  38694. * Provides tiled imagery served by {@link http://www.opengeospatial.org/standards/wmts|WMTS 1.0.0} compliant servers.
  38695. This provider supports HTTP KVP-encoded and RESTful GetTile requests, but does not yet support the SOAP encoding.
  38696. * @example
  38697. * // Example 1. USGS shaded relief tiles (KVP)
  38698. var shadedRelief1 = new Cesium.WebMapTileServiceImageryProvider({
  38699. url : 'http://basemap.nationalmap.gov/arcgis/rest/services/USGSShadedReliefOnly/MapServer/WMTS',
  38700. layer : 'USGSShadedReliefOnly',
  38701. style : 'default',
  38702. format : 'image/jpeg',
  38703. tileMatrixSetID : 'default028mm',
  38704. // tileMatrixLabels : ['default028mm:0', 'default028mm:1', 'default028mm:2' ...],
  38705. maximumLevel: 19,
  38706. credit : new Cesium.Credit('U. S. Geological Survey')
  38707. });
  38708. viewer.imageryLayers.addImageryProvider(shadedRelief1);
  38709. * @example
  38710. * // Example 2. USGS shaded relief tiles (RESTful)
  38711. var shadedRelief2 = new Cesium.WebMapTileServiceImageryProvider({
  38712. url : 'http://basemap.nationalmap.gov/arcgis/rest/services/USGSShadedReliefOnly/MapServer/WMTS/tile/1.0.0/USGSShadedReliefOnly/{Style}/{TileMatrixSet}/{TileMatrix}/{TileRow}/{TileCol}.jpg',
  38713. layer : 'USGSShadedReliefOnly',
  38714. style : 'default',
  38715. format : 'image/jpeg',
  38716. tileMatrixSetID : 'default028mm',
  38717. maximumLevel: 19,
  38718. credit : new Cesium.Credit('U. S. Geological Survey')
  38719. });
  38720. viewer.imageryLayers.addImageryProvider(shadedRelief2);
  38721. * @example
  38722. * // Example 3. NASA time dynamic weather data (RESTful)
  38723. var times = Cesium.TimeIntervalCollection.fromIso8601({
  38724. iso8601: '2015-07-30/2017-06-16/P1D',
  38725. dataCallback: function dataCallback(interval, index) {
  38726. return {
  38727. Time: Cesium.JulianDate.toIso8601(interval.start)
  38728. };
  38729. }
  38730. });
  38731. var weather = new Cesium.WebMapTileServiceImageryProvider({
  38732. url : 'https://gibs.earthdata.nasa.gov/wmts/epsg4326/best/AMSR2_Snow_Water_Equivalent/default/{Time}/{TileMatrixSet}/{TileMatrix}/{TileRow}/{TileCol}.png',
  38733. layer : 'AMSR2_Snow_Water_Equivalent',
  38734. style : 'default',
  38735. tileMatrixSetID : '2km',
  38736. maximumLevel : 5,
  38737. format : 'image/png',
  38738. clock: clock,
  38739. times: times,
  38740. credit : new Cesium.Credit('NASA Global Imagery Browse Services for EOSDIS')
  38741. });
  38742. viewer.imageryLayers.addImageryProvider(weather);
  38743. * @param options - Object describing initialization options
  38744. */
  38745. export class WebMapTileServiceImageryProvider {
  38746. constructor(options: WebMapTileServiceImageryProvider.ConstructorOptions);
  38747. /**
  38748. * The default alpha blending value of this provider, with 0.0 representing fully transparent and
  38749. 1.0 representing fully opaque.
  38750. */
  38751. defaultAlpha: number | undefined;
  38752. /**
  38753. * The default alpha blending value on the night side of the globe of this provider, with 0.0 representing fully transparent and
  38754. 1.0 representing fully opaque.
  38755. */
  38756. defaultNightAlpha: number | undefined;
  38757. /**
  38758. * The default alpha blending value on the day side of the globe of this provider, with 0.0 representing fully transparent and
  38759. 1.0 representing fully opaque.
  38760. */
  38761. defaultDayAlpha: number | undefined;
  38762. /**
  38763. * The default brightness of this provider. 1.0 uses the unmodified imagery color. Less than 1.0
  38764. makes the imagery darker while greater than 1.0 makes it brighter.
  38765. */
  38766. defaultBrightness: number | undefined;
  38767. /**
  38768. * The default contrast of this provider. 1.0 uses the unmodified imagery color. Less than 1.0 reduces
  38769. the contrast while greater than 1.0 increases it.
  38770. */
  38771. defaultContrast: number | undefined;
  38772. /**
  38773. * The default hue of this provider in radians. 0.0 uses the unmodified imagery color.
  38774. */
  38775. defaultHue: number | undefined;
  38776. /**
  38777. * The default saturation of this provider. 1.0 uses the unmodified imagery color. Less than 1.0 reduces the
  38778. saturation while greater than 1.0 increases it.
  38779. */
  38780. defaultSaturation: number | undefined;
  38781. /**
  38782. * The default gamma correction to apply to this provider. 1.0 uses the unmodified imagery color.
  38783. */
  38784. defaultGamma: number | undefined;
  38785. /**
  38786. * The default texture minification filter to apply to this provider.
  38787. */
  38788. defaultMinificationFilter: TextureMinificationFilter;
  38789. /**
  38790. * The default texture magnification filter to apply to this provider.
  38791. */
  38792. defaultMagnificationFilter: TextureMagnificationFilter;
  38793. /**
  38794. * Gets the URL of the service hosting the imagery.
  38795. */
  38796. readonly url: string;
  38797. /**
  38798. * Gets the proxy used by this provider.
  38799. */
  38800. readonly proxy: Proxy;
  38801. /**
  38802. * Gets the width of each tile, in pixels. This function should
  38803. not be called before {@link WebMapTileServiceImageryProvider#ready} returns true.
  38804. */
  38805. readonly tileWidth: number;
  38806. /**
  38807. * Gets the height of each tile, in pixels. This function should
  38808. not be called before {@link WebMapTileServiceImageryProvider#ready} returns true.
  38809. */
  38810. readonly tileHeight: number;
  38811. /**
  38812. * Gets the maximum level-of-detail that can be requested. This function should
  38813. not be called before {@link WebMapTileServiceImageryProvider#ready} returns true.
  38814. */
  38815. readonly maximumLevel: number | undefined;
  38816. /**
  38817. * Gets the minimum level-of-detail that can be requested. This function should
  38818. not be called before {@link WebMapTileServiceImageryProvider#ready} returns true.
  38819. */
  38820. readonly minimumLevel: number;
  38821. /**
  38822. * Gets the tiling scheme used by this provider. This function should
  38823. not be called before {@link WebMapTileServiceImageryProvider#ready} returns true.
  38824. */
  38825. readonly tilingScheme: TilingScheme;
  38826. /**
  38827. * Gets the rectangle, in radians, of the imagery provided by this instance. This function should
  38828. not be called before {@link WebMapTileServiceImageryProvider#ready} returns true.
  38829. */
  38830. readonly rectangle: Rectangle;
  38831. /**
  38832. * Gets the tile discard policy. If not undefined, the discard policy is responsible
  38833. for filtering out "missing" tiles via its shouldDiscardImage function. If this function
  38834. returns undefined, no tiles are filtered. This function should
  38835. not be called before {@link WebMapTileServiceImageryProvider#ready} returns true.
  38836. */
  38837. readonly tileDiscardPolicy: TileDiscardPolicy;
  38838. /**
  38839. * Gets an event that is raised when the imagery provider encounters an asynchronous error. By subscribing
  38840. to the event, you will be notified of the error and can potentially recover from it. Event listeners
  38841. are passed an instance of {@link TileProviderError}.
  38842. */
  38843. readonly errorEvent: Event;
  38844. /**
  38845. * Gets the mime type of images returned by this imagery provider.
  38846. */
  38847. readonly format: string;
  38848. /**
  38849. * Gets a value indicating whether or not the provider is ready for use.
  38850. */
  38851. readonly ready: boolean;
  38852. /**
  38853. * Gets a promise that resolves to true when the provider is ready for use.
  38854. */
  38855. readonly readyPromise: Promise<boolean>;
  38856. /**
  38857. * Gets the credit to display when this imagery provider is active. Typically this is used to credit
  38858. the source of the imagery. This function should not be called before {@link WebMapTileServiceImageryProvider#ready} returns true.
  38859. */
  38860. readonly credit: Credit;
  38861. /**
  38862. * Gets a value indicating whether or not the images provided by this imagery provider
  38863. include an alpha channel. If this property is false, an alpha channel, if present, will
  38864. be ignored. If this property is true, any images without an alpha channel will be treated
  38865. as if their alpha is 1.0 everywhere. When this property is false, memory usage
  38866. and texture upload time are reduced.
  38867. */
  38868. readonly hasAlphaChannel: boolean;
  38869. /**
  38870. * Gets or sets a clock that is used to get keep the time used for time dynamic parameters.
  38871. */
  38872. clock: Clock;
  38873. /**
  38874. * Gets or sets a time interval collection that is used to get time dynamic parameters. The data of each
  38875. TimeInterval is an object containing the keys and values of the properties that are used during
  38876. tile requests.
  38877. */
  38878. times: TimeIntervalCollection;
  38879. /**
  38880. * Gets or sets an object that contains static dimensions and their values.
  38881. */
  38882. dimensions: any;
  38883. /**
  38884. * Gets the credits to be displayed when a given tile is displayed.
  38885. * @param x - The tile X coordinate.
  38886. * @param y - The tile Y coordinate.
  38887. * @param level - The tile level;
  38888. * @returns The credits to be displayed when the tile is displayed.
  38889. */
  38890. getTileCredits(x: number, y: number, level: number): Credit[];
  38891. /**
  38892. * Requests the image for a given tile. This function should
  38893. not be called before {@link WebMapTileServiceImageryProvider#ready} returns true.
  38894. * @param x - The tile X coordinate.
  38895. * @param y - The tile Y coordinate.
  38896. * @param level - The tile level.
  38897. * @param [request] - The request object. Intended for internal use only.
  38898. * @returns A promise for the image that will resolve when the image is available, or
  38899. undefined if there are too many active requests to the server, and the request
  38900. should be retried later. The resolved image may be either an
  38901. Image or a Canvas DOM object.
  38902. */
  38903. requestImage(x: number, y: number, level: number, request?: Request): Promise<HTMLImageElement | HTMLCanvasElement> | undefined;
  38904. /**
  38905. * Picking features is not currently supported by this imagery provider, so this function simply returns
  38906. undefined.
  38907. * @param x - The tile X coordinate.
  38908. * @param y - The tile Y coordinate.
  38909. * @param level - The tile level.
  38910. * @param longitude - The longitude at which to pick features.
  38911. * @param latitude - The latitude at which to pick features.
  38912. * @returns A promise for the picked features that will resolve when the asynchronous
  38913. picking completes. The resolved value is an array of {@link ImageryLayerFeatureInfo}
  38914. instances. The array may be empty if no features are found at the given location.
  38915. It may also be undefined if picking is not supported.
  38916. */
  38917. pickFeatures(x: number, y: number, level: number, longitude: number, latitude: number): Promise<ImageryLayerFeatureInfo[]> | undefined;
  38918. }
  38919. /**
  38920. * <span style="display: block; text-align: center;">
  38921. <img src="Images/AnimationWidget.png" width="211" height="142" alt="" />
  38922. <br />Animation widget
  38923. </span>
  38924. <br /><br />
  38925. The Animation widget provides buttons for play, pause, and reverse, along with the
  38926. current time and date, surrounded by a "shuttle ring" for controlling the speed of animation.
  38927. <br /><br />
  38928. The "shuttle ring" concept is borrowed from video editing, where typically a
  38929. "jog wheel" can be rotated to move past individual animation frames very slowly, and
  38930. a surrounding shuttle ring can be twisted to control direction and speed of fast playback.
  38931. Cesium typically treats time as continuous (not broken into pre-defined animation frames),
  38932. so this widget offers no jog wheel. Instead, the shuttle ring is capable of both fast and
  38933. very slow playback. Click and drag the shuttle ring pointer itself (shown above in green),
  38934. or click in the rest of the ring area to nudge the pointer to the next preset speed in that direction.
  38935. <br /><br />
  38936. The Animation widget also provides a "realtime" button (in the upper-left) that keeps
  38937. animation time in sync with the end user's system clock, typically displaying
  38938. "today" or "right now." This mode is not available in {@link ClockRange.CLAMPED} or
  38939. {@link ClockRange.LOOP_STOP} mode if the current time is outside of {@link Clock}'s startTime and endTime.
  38940. * @example
  38941. * // In HTML head, include a link to Animation.css stylesheet,
  38942. // and in the body, include: <div id="animationContainer"></div>
  38943. var clock = new Cesium.Clock();
  38944. var clockViewModel = new Cesium.ClockViewModel(clock);
  38945. var viewModel = new Cesium.AnimationViewModel(clockViewModel);
  38946. var widget = new Cesium.Animation('animationContainer', viewModel);
  38947. function tick() {
  38948. clock.tick();
  38949. Cesium.requestAnimationFrame(tick);
  38950. }
  38951. Cesium.requestAnimationFrame(tick);
  38952. * @param container - The DOM element or ID that will contain the widget.
  38953. * @param viewModel - The view model used by this widget.
  38954. */
  38955. export class Animation {
  38956. constructor(container: Element | string, viewModel: AnimationViewModel);
  38957. /**
  38958. * Gets the parent container.
  38959. */
  38960. readonly container: Element;
  38961. /**
  38962. * Gets the view model.
  38963. */
  38964. readonly viewModel: AnimationViewModel;
  38965. /**
  38966. * @returns true if the object has been destroyed, false otherwise.
  38967. */
  38968. isDestroyed(): boolean;
  38969. /**
  38970. * Destroys the animation widget. Should be called if permanently
  38971. removing the widget from layout.
  38972. */
  38973. destroy(): void;
  38974. /**
  38975. * Resizes the widget to match the container size.
  38976. This function should be called whenever the container size is changed.
  38977. */
  38978. resize(): void;
  38979. /**
  38980. * Updates the widget to reflect any modified CSS rules for theming.
  38981. * @example
  38982. * //Switch to the cesium-lighter theme.
  38983. document.body.className = 'cesium-lighter';
  38984. animation.applyThemeChanges();
  38985. */
  38986. applyThemeChanges(): void;
  38987. }
  38988. /**
  38989. * The view model for the {@link Animation} widget.
  38990. * @param clockViewModel - The ClockViewModel instance to use.
  38991. */
  38992. export class AnimationViewModel {
  38993. constructor(clockViewModel: ClockViewModel);
  38994. /**
  38995. * Gets or sets whether the shuttle ring is currently being dragged. This property is observable.
  38996. */
  38997. shuttleRingDragging: boolean;
  38998. /**
  38999. * Gets or sets whether dragging the shuttle ring should cause the multiplier
  39000. to snap to the defined tick values rather than interpolating between them.
  39001. This property is observable.
  39002. */
  39003. snapToTicks: boolean;
  39004. /**
  39005. * Gets the string representation of the current time. This property is observable.
  39006. */
  39007. timeLabel: string;
  39008. /**
  39009. * Gets the string representation of the current date. This property is observable.
  39010. */
  39011. dateLabel: string;
  39012. /**
  39013. * Gets the string representation of the current multiplier. This property is observable.
  39014. */
  39015. multiplierLabel: string;
  39016. /**
  39017. * Gets or sets the current shuttle ring angle. This property is observable.
  39018. */
  39019. shuttleRingAngle: number;
  39020. /**
  39021. * Gets or sets the default date formatter used by new instances.
  39022. */
  39023. static defaultDateFormatter: AnimationViewModel.DateFormatter;
  39024. /**
  39025. * Gets or sets the default array of known clock multipliers associated with new instances of the shuttle ring.
  39026. */
  39027. static defaultTicks: number[];
  39028. /**
  39029. * Gets or sets the default time formatter used by new instances.
  39030. */
  39031. static defaultTimeFormatter: AnimationViewModel.TimeFormatter;
  39032. /**
  39033. * Gets a copy of the array of positive known clock multipliers to associate with the shuttle ring.
  39034. * @returns The array of known clock multipliers associated with the shuttle ring.
  39035. */
  39036. getShuttleRingTicks(): number[];
  39037. /**
  39038. * Sets the array of positive known clock multipliers to associate with the shuttle ring.
  39039. These values will have negative equivalents created for them and sets both the minimum
  39040. and maximum range of values for the shuttle ring as well as the values that are snapped
  39041. to when a single click is made. The values need not be in order, as they will be sorted
  39042. automatically, and duplicate values will be removed.
  39043. * @param positiveTicks - The list of known positive clock multipliers to associate with the shuttle ring.
  39044. */
  39045. setShuttleRingTicks(positiveTicks: number[]): void;
  39046. /**
  39047. * Gets a command that decreases the speed of animation.
  39048. */
  39049. slower: Command;
  39050. /**
  39051. * Gets a command that increases the speed of animation.
  39052. */
  39053. faster: Command;
  39054. /**
  39055. * Gets the clock view model.
  39056. */
  39057. clockViewModel: ClockViewModel;
  39058. /**
  39059. * Gets the pause toggle button view model.
  39060. */
  39061. pauseViewModel: ToggleButtonViewModel;
  39062. /**
  39063. * Gets the reverse toggle button view model.
  39064. */
  39065. playReverseViewModel: ToggleButtonViewModel;
  39066. /**
  39067. * Gets the play toggle button view model.
  39068. */
  39069. playForwardViewModel: ToggleButtonViewModel;
  39070. /**
  39071. * Gets the realtime toggle button view model.
  39072. */
  39073. playRealtimeViewModel: ToggleButtonViewModel;
  39074. /**
  39075. * Gets or sets the function which formats a date for display.
  39076. */
  39077. dateFormatter: AnimationViewModel.DateFormatter;
  39078. /**
  39079. * Gets or sets the function which formats a time for display.
  39080. */
  39081. timeFormatter: AnimationViewModel.TimeFormatter;
  39082. }
  39083. export namespace AnimationViewModel {
  39084. /**
  39085. * A function that formats a date for display.
  39086. * @param date - The date to be formatted
  39087. * @param viewModel - The AnimationViewModel instance requesting formatting.
  39088. */
  39089. type DateFormatter = (date: JulianDate, viewModel: AnimationViewModel) => string;
  39090. /**
  39091. * A function that formats a time for display.
  39092. * @param date - The date to be formatted
  39093. * @param viewModel - The AnimationViewModel instance requesting formatting.
  39094. */
  39095. type TimeFormatter = (date: JulianDate, viewModel: AnimationViewModel) => string;
  39096. }
  39097. /**
  39098. * <span style="display: block; text-align: center;">
  39099. <img src="Images/BaseLayerPicker.png" width="264" height="287" alt="" />
  39100. <br />BaseLayerPicker with its drop-panel open.
  39101. </span>
  39102. <br /><br />
  39103. The BaseLayerPicker is a single button widget that displays a panel of available imagery and
  39104. terrain providers. When imagery is selected, the corresponding imagery layer is created and inserted
  39105. as the base layer of the imagery collection; removing the existing base. When terrain is selected,
  39106. it replaces the current terrain provider. Each item in the available providers list contains a name,
  39107. a representative icon, and a tooltip to display more information when hovered. The list is initially
  39108. empty, and must be configured before use, as illustrated in the below example.
  39109. * @example
  39110. * // In HTML head, include a link to the BaseLayerPicker.css stylesheet,
  39111. // and in the body, include: <div id="baseLayerPickerContainer"
  39112. // style="position:absolute;top:24px;right:24px;width:38px;height:38px;"></div>
  39113. //Create the list of available providers we would like the user to select from.
  39114. //This example uses 3, OpenStreetMap, The Black Marble, and a single, non-streaming world image.
  39115. var imageryViewModels = [];
  39116. imageryViewModels.push(new Cesium.ProviderViewModel({
  39117. name : 'Open\u00adStreet\u00adMap',
  39118. iconUrl : Cesium.buildModuleUrl('Widgets/Images/ImageryProviders/openStreetMap.png'),
  39119. tooltip : 'OpenStreetMap (OSM) is a collaborative project to create a free editable \
  39120. map of the world.\nhttp://www.openstreetmap.org',
  39121. creationFunction : function() {
  39122. return new Cesium.OpenStreetMapImageryProvider({
  39123. url : 'https://a.tile.openstreetmap.org/'
  39124. });
  39125. }
  39126. }));
  39127. imageryViewModels.push(new Cesium.ProviderViewModel({
  39128. name : 'Earth at Night',
  39129. iconUrl : Cesium.buildModuleUrl('Widgets/Images/ImageryProviders/blackMarble.png'),
  39130. tooltip : 'The lights of cities and villages trace the outlines of civilization \
  39131. in this global view of the Earth at night as seen by NASA/NOAA\'s Suomi NPP satellite.',
  39132. creationFunction : function() {
  39133. return new Cesium.IonImageryProvider({ assetId: 3812 });
  39134. }
  39135. }));
  39136. imageryViewModels.push(new Cesium.ProviderViewModel({
  39137. name : 'Natural Earth\u00a0II',
  39138. iconUrl : Cesium.buildModuleUrl('Widgets/Images/ImageryProviders/naturalEarthII.png'),
  39139. tooltip : 'Natural Earth II, darkened for contrast.\nhttp://www.naturalearthdata.com/',
  39140. creationFunction : function() {
  39141. return new Cesium.TileMapServiceImageryProvider({
  39142. url : Cesium.buildModuleUrl('Assets/Textures/NaturalEarthII')
  39143. });
  39144. }
  39145. }));
  39146. //Create a CesiumWidget without imagery, if you haven't already done so.
  39147. var cesiumWidget = new Cesium.CesiumWidget('cesiumContainer', { imageryProvider: false });
  39148. //Finally, create the baseLayerPicker widget using our view models.
  39149. var layers = cesiumWidget.imageryLayers;
  39150. var baseLayerPicker = new Cesium.BaseLayerPicker('baseLayerPickerContainer', {
  39151. globe : cesiumWidget.scene.globe,
  39152. imageryProviderViewModels : imageryViewModels
  39153. });
  39154. * @param container - The parent HTML container node or ID for this widget.
  39155. * @param options - Object with the following properties:
  39156. * @param options.globe - The Globe to use.
  39157. * @param [options.imageryProviderViewModels = []] - The array of ProviderViewModel instances to use for imagery.
  39158. * @param [options.selectedImageryProviderViewModel] - The view model for the current base imagery layer, if not supplied the first available imagery layer is used.
  39159. * @param [options.terrainProviderViewModels = []] - The array of ProviderViewModel instances to use for terrain.
  39160. * @param [options.selectedTerrainProviderViewModel] - The view model for the current base terrain layer, if not supplied the first available terrain layer is used.
  39161. */
  39162. export class BaseLayerPicker {
  39163. constructor(container: Element | string, options: {
  39164. globe: Globe;
  39165. imageryProviderViewModels?: ProviderViewModel[];
  39166. selectedImageryProviderViewModel?: ProviderViewModel;
  39167. terrainProviderViewModels?: ProviderViewModel[];
  39168. selectedTerrainProviderViewModel?: ProviderViewModel;
  39169. });
  39170. /**
  39171. * Gets the parent container.
  39172. */
  39173. container: Element;
  39174. /**
  39175. * Gets the view model.
  39176. */
  39177. viewModel: BaseLayerPickerViewModel;
  39178. /**
  39179. * @returns true if the object has been destroyed, false otherwise.
  39180. */
  39181. isDestroyed(): boolean;
  39182. /**
  39183. * Destroys the widget. Should be called if permanently
  39184. removing the widget from layout.
  39185. */
  39186. destroy(): void;
  39187. }
  39188. /**
  39189. * The view model for {@link BaseLayerPicker}.
  39190. * @param options - Object with the following properties:
  39191. * @param options.globe - The Globe to use.
  39192. * @param [options.imageryProviderViewModels = []] - The array of ProviderViewModel instances to use for imagery.
  39193. * @param [options.selectedImageryProviderViewModel] - The view model for the current base imagery layer, if not supplied the first available imagery layer is used.
  39194. * @param [options.terrainProviderViewModels = []] - The array of ProviderViewModel instances to use for terrain.
  39195. * @param [options.selectedTerrainProviderViewModel] - The view model for the current base terrain layer, if not supplied the first available terrain layer is used.
  39196. */
  39197. export class BaseLayerPickerViewModel {
  39198. constructor(options: {
  39199. globe: Globe;
  39200. imageryProviderViewModels?: ProviderViewModel[];
  39201. selectedImageryProviderViewModel?: ProviderViewModel;
  39202. terrainProviderViewModels?: ProviderViewModel[];
  39203. selectedTerrainProviderViewModel?: ProviderViewModel;
  39204. });
  39205. /**
  39206. * Gets or sets an array of ProviderViewModel instances available for imagery selection.
  39207. This property is observable.
  39208. */
  39209. imageryProviderViewModels: ProviderViewModel[];
  39210. /**
  39211. * Gets or sets an array of ProviderViewModel instances available for terrain selection.
  39212. This property is observable.
  39213. */
  39214. terrainProviderViewModels: ProviderViewModel[];
  39215. /**
  39216. * Gets or sets whether the imagery selection drop-down is currently visible.
  39217. */
  39218. dropDownVisible: boolean;
  39219. /**
  39220. * Gets the button tooltip. This property is observable.
  39221. */
  39222. buttonTooltip: string;
  39223. /**
  39224. * Gets the button background image. This property is observable.
  39225. */
  39226. buttonImageUrl: string;
  39227. /**
  39228. * Gets or sets the currently selected imagery. This property is observable.
  39229. */
  39230. selectedImagery: ProviderViewModel;
  39231. /**
  39232. * Gets or sets the currently selected terrain. This property is observable.
  39233. */
  39234. selectedTerrain: ProviderViewModel;
  39235. /**
  39236. * Gets the command to toggle the visibility of the drop down.
  39237. */
  39238. toggleDropDown: Command;
  39239. /**
  39240. * Gets the globe.
  39241. */
  39242. globe: Globe;
  39243. }
  39244. /**
  39245. * A view model that represents each item in the {@link BaseLayerPicker}.
  39246. * @param options - The object containing all parameters.
  39247. * @param options.name - The name of the layer.
  39248. * @param options.tooltip - The tooltip to show when the item is moused over.
  39249. * @param options.iconUrl - An icon representing the layer.
  39250. * @param [options.category] - A category for the layer.
  39251. * @param options.creationFunction - A function or Command
  39252. that creates one or more providers which will be added to the globe when this item is selected.
  39253. */
  39254. export class ProviderViewModel {
  39255. constructor(options: {
  39256. name: string;
  39257. tooltip: string;
  39258. iconUrl: string;
  39259. category?: string;
  39260. creationFunction: ProviderViewModel.CreationFunction | Command;
  39261. });
  39262. /**
  39263. * Gets the display name. This property is observable.
  39264. */
  39265. name: string;
  39266. /**
  39267. * Gets the tooltip. This property is observable.
  39268. */
  39269. tooltip: string;
  39270. /**
  39271. * Gets the icon. This property is observable.
  39272. */
  39273. iconUrl: string;
  39274. /**
  39275. * Gets the Command that creates one or more providers which will be added to
  39276. the globe when this item is selected.
  39277. */
  39278. readonly creationCommand: Command;
  39279. /**
  39280. * Gets the category
  39281. */
  39282. readonly category: string;
  39283. }
  39284. export namespace ProviderViewModel {
  39285. /**
  39286. * A function which creates one or more providers.
  39287. */
  39288. type CreationFunction = () => ImageryProvider | TerrainProvider | ImageryProvider[] | TerrainProvider[];
  39289. }
  39290. /**
  39291. * Inspector widget to aid in debugging 3D Tiles
  39292. * @param container - The DOM element or ID that will contain the widget.
  39293. * @param scene - the Scene instance to use.
  39294. */
  39295. export class Cesium3DTilesInspector {
  39296. constructor(container: Element | string, scene: Scene);
  39297. /**
  39298. * Gets the parent container.
  39299. */
  39300. container: Element;
  39301. /**
  39302. * Gets the view model.
  39303. */
  39304. viewModel: Cesium3DTilesInspectorViewModel;
  39305. /**
  39306. * @returns true if the object has been destroyed, false otherwise.
  39307. */
  39308. isDestroyed(): boolean;
  39309. /**
  39310. * Destroys the widget. Should be called if permanently
  39311. removing the widget from layout.
  39312. */
  39313. destroy(): void;
  39314. }
  39315. /**
  39316. * The view model for {@link Cesium3DTilesInspector}.
  39317. * @param scene - The scene instance to use.
  39318. * @param performanceContainer - The container for the performance display
  39319. */
  39320. export class Cesium3DTilesInspectorViewModel {
  39321. constructor(scene: Scene, performanceContainer: HTMLElement);
  39322. /**
  39323. * Gets or sets the flag to enable performance display. This property is observable.
  39324. */
  39325. performance: boolean;
  39326. /**
  39327. * Gets or sets the flag to show statistics. This property is observable.
  39328. */
  39329. showStatistics: boolean;
  39330. /**
  39331. * Gets or sets the flag to show pick statistics. This property is observable.
  39332. */
  39333. showPickStatistics: boolean;
  39334. /**
  39335. * Gets or sets the flag to show the inspector. This property is observable.
  39336. */
  39337. inspectorVisible: boolean;
  39338. /**
  39339. * Gets or sets the flag to show the tileset section. This property is observable.
  39340. */
  39341. tilesetVisible: boolean;
  39342. /**
  39343. * Gets or sets the flag to show the display section. This property is observable.
  39344. */
  39345. displayVisible: boolean;
  39346. /**
  39347. * Gets or sets the flag to show the update section. This property is observable.
  39348. */
  39349. updateVisible: boolean;
  39350. /**
  39351. * Gets or sets the flag to show the logging section. This property is observable.
  39352. */
  39353. loggingVisible: boolean;
  39354. /**
  39355. * Gets or sets the flag to show the style section. This property is observable.
  39356. */
  39357. styleVisible: boolean;
  39358. /**
  39359. * Gets or sets the flag to show the tile info section. This property is observable.
  39360. */
  39361. tileDebugLabelsVisible: boolean;
  39362. /**
  39363. * Gets or sets the flag to show the optimization info section. This property is observable.
  39364. */
  39365. optimizationVisible: boolean;
  39366. /**
  39367. * Gets or sets the JSON for the tileset style. This property is observable.
  39368. */
  39369. styleString: string;
  39370. /**
  39371. * Gets the names of the properties in the tileset. This property is observable.
  39372. */
  39373. readonly properties: string[];
  39374. /**
  39375. * Gets or sets the flag to enable dynamic screen space error. This property is observable.
  39376. */
  39377. dynamicScreenSpaceError: boolean;
  39378. /**
  39379. * Gets or sets the color blend mode. This property is observable.
  39380. */
  39381. colorBlendMode: Cesium3DTileColorBlendMode;
  39382. /**
  39383. * Gets or sets the flag to enable picking. This property is observable.
  39384. */
  39385. picking: boolean;
  39386. /**
  39387. * Gets or sets the flag to colorize tiles. This property is observable.
  39388. */
  39389. colorize: boolean;
  39390. /**
  39391. * Gets or sets the flag to draw with wireframe. This property is observable.
  39392. */
  39393. wireframe: boolean;
  39394. /**
  39395. * Gets or sets the flag to show bounding volumes. This property is observable.
  39396. */
  39397. showBoundingVolumes: boolean;
  39398. /**
  39399. * Gets or sets the flag to show content volumes. This property is observable.
  39400. */
  39401. showContentBoundingVolumes: boolean;
  39402. /**
  39403. * Gets or sets the flag to show request volumes. This property is observable.
  39404. */
  39405. showRequestVolumes: boolean;
  39406. /**
  39407. * Gets or sets the flag to suspend updates. This property is observable.
  39408. */
  39409. freezeFrame: boolean;
  39410. /**
  39411. * Gets or sets the flag to show debug labels only for the currently picked tile. This property is observable.
  39412. */
  39413. showOnlyPickedTileDebugLabel: boolean;
  39414. /**
  39415. * Gets or sets the flag to show tile geometric error. This property is observable.
  39416. */
  39417. showGeometricError: boolean;
  39418. /**
  39419. * Displays the number of commands, points, triangles and features used per tile. This property is observable.
  39420. */
  39421. showRenderingStatistics: boolean;
  39422. /**
  39423. * Displays the memory used per tile. This property is observable.
  39424. */
  39425. showMemoryUsage: boolean;
  39426. /**
  39427. * Gets or sets the flag to show the tile url. This property is observable.
  39428. */
  39429. showUrl: boolean;
  39430. /**
  39431. * Gets or sets the maximum screen space error. This property is observable.
  39432. */
  39433. maximumScreenSpaceError: number;
  39434. /**
  39435. * Gets or sets the dynamic screen space error density. This property is observable.
  39436. */
  39437. dynamicScreenSpaceErrorDensity: number;
  39438. /**
  39439. * Gets or sets the dynamic screen space error density slider value.
  39440. This allows the slider to be exponential because values tend to be closer to 0 than 1.
  39441. This property is observable.
  39442. */
  39443. dynamicScreenSpaceErrorDensitySliderValue: number;
  39444. /**
  39445. * Gets or sets the dynamic screen space error factor. This property is observable.
  39446. */
  39447. dynamicScreenSpaceErrorFactor: number;
  39448. /**
  39449. * Gets or sets the flag to enable point cloud shading. This property is observable.
  39450. */
  39451. pointCloudShading: boolean;
  39452. /**
  39453. * Gets or sets the geometric error scale. This property is observable.
  39454. */
  39455. geometricErrorScale: number;
  39456. /**
  39457. * Gets or sets the maximum attenuation. This property is observable.
  39458. */
  39459. maximumAttenuation: number;
  39460. /**
  39461. * Gets or sets the base resolution. This property is observable.
  39462. */
  39463. baseResolution: number;
  39464. /**
  39465. * Gets or sets the flag to enable eye dome lighting. This property is observable.
  39466. */
  39467. eyeDomeLighting: boolean;
  39468. /**
  39469. * Gets or sets the eye dome lighting strength. This property is observable.
  39470. */
  39471. eyeDomeLightingStrength: number;
  39472. /**
  39473. * Gets or sets the eye dome lighting radius. This property is observable.
  39474. */
  39475. eyeDomeLightingRadius: number;
  39476. /**
  39477. * Gets or sets the pick state
  39478. */
  39479. pickActive: boolean;
  39480. /**
  39481. * Gets or sets the flag to determine if level of detail skipping should be applied during the traversal.
  39482. This property is observable.
  39483. */
  39484. skipLevelOfDetail: boolean;
  39485. /**
  39486. * Gets or sets the multiplier defining the minimum screen space error to skip. This property is observable.
  39487. */
  39488. skipScreenSpaceErrorFactor: number;
  39489. /**
  39490. * Gets or sets the screen space error that must be reached before skipping levels of detail. This property is observable.
  39491. */
  39492. baseScreenSpaceError: number;
  39493. /**
  39494. * Gets or sets the constant defining the minimum number of levels to skip when loading tiles. This property is observable.
  39495. */
  39496. skipLevels: number;
  39497. /**
  39498. * Gets or sets the flag which, when true, only tiles that meet the maximum screen space error will ever be downloaded.
  39499. This property is observable.
  39500. */
  39501. immediatelyLoadDesiredLevelOfDetail: boolean;
  39502. /**
  39503. * Gets or sets the flag which determines whether siblings of visible tiles are always downloaded during traversal.
  39504. This property is observable
  39505. */
  39506. loadSiblings: boolean;
  39507. /**
  39508. * Gets the scene
  39509. */
  39510. readonly scene: Scene;
  39511. /**
  39512. * Gets the performance container
  39513. */
  39514. readonly performanceContainer: HTMLElement;
  39515. /**
  39516. * Gets the statistics text. This property is observable.
  39517. */
  39518. readonly statisticsText: string;
  39519. /**
  39520. * Gets the pick statistics text. This property is observable.
  39521. */
  39522. readonly pickStatisticsText: string;
  39523. /**
  39524. * Gets the available blend modes
  39525. */
  39526. readonly colorBlendModes: object[];
  39527. /**
  39528. * Gets the editor error message
  39529. */
  39530. readonly editorError: string;
  39531. /**
  39532. * Gets or sets the tileset of the view model.
  39533. */
  39534. tileset: Cesium3DTileset;
  39535. /**
  39536. * Gets the current feature of the view model.
  39537. */
  39538. feature: Cesium3DTileFeature;
  39539. /**
  39540. * Gets the current tile of the view model
  39541. */
  39542. tile: Cesium3DTile;
  39543. /**
  39544. * Toggles the pick tileset mode
  39545. */
  39546. togglePickTileset(): void;
  39547. /**
  39548. * Toggles the inspector visibility
  39549. */
  39550. toggleInspector(): void;
  39551. /**
  39552. * Toggles the visibility of the tileset section
  39553. */
  39554. toggleTileset(): void;
  39555. /**
  39556. * Toggles the visibility of the display section
  39557. */
  39558. toggleDisplay(): void;
  39559. /**
  39560. * Toggles the visibility of the update section
  39561. */
  39562. toggleUpdate(): void;
  39563. /**
  39564. * Toggles the visibility of the logging section
  39565. */
  39566. toggleLogging(): void;
  39567. /**
  39568. * Toggles the visibility of the style section
  39569. */
  39570. toggleStyle(): void;
  39571. /**
  39572. * Toggles the visibility of the tile Debug Info section
  39573. */
  39574. toggleTileDebugLabels(): void;
  39575. /**
  39576. * Toggles the visibility of the optimization section
  39577. */
  39578. toggleOptimization(): void;
  39579. /**
  39580. * Trims tile cache
  39581. */
  39582. trimTilesCache(): void;
  39583. /**
  39584. * Compiles the style in the style editor.
  39585. */
  39586. compileStyle(): void;
  39587. /**
  39588. * Handles key press events on the style editor.
  39589. */
  39590. styleEditorKeyPress(): void;
  39591. /**
  39592. * @returns true if the object has been destroyed, false otherwise.
  39593. */
  39594. isDestroyed(): boolean;
  39595. /**
  39596. * Destroys the widget. Should be called if permanently
  39597. removing the widget from layout.
  39598. */
  39599. destroy(): void;
  39600. /**
  39601. * Generates an HTML string of the statistics
  39602. * @param tileset - The tileset
  39603. * @param isPick - Whether this is getting the statistics for the pick pass
  39604. * @returns The formatted statistics
  39605. */
  39606. static getStatistics(tileset: Cesium3DTileset, isPick: boolean): string;
  39607. }
  39608. /**
  39609. * Inspector widget to aid in debugging
  39610. * @param container - The DOM element or ID that will contain the widget.
  39611. * @param scene - The Scene instance to use.
  39612. */
  39613. export class CesiumInspector {
  39614. constructor(container: Element | string, scene: Scene);
  39615. /**
  39616. * Gets the parent container.
  39617. */
  39618. container: Element;
  39619. /**
  39620. * Gets the view model.
  39621. */
  39622. viewModel: CesiumInspectorViewModel;
  39623. /**
  39624. * @returns true if the object has been destroyed, false otherwise.
  39625. */
  39626. isDestroyed(): boolean;
  39627. /**
  39628. * Destroys the widget. Should be called if permanently
  39629. removing the widget from layout.
  39630. */
  39631. destroy(): void;
  39632. }
  39633. /**
  39634. * The view model for {@link CesiumInspector}.
  39635. * @param scene - The scene instance to use.
  39636. * @param performanceContainer - The instance to use for performance container.
  39637. */
  39638. export class CesiumInspectorViewModel {
  39639. constructor(scene: Scene, performanceContainer: Element);
  39640. /**
  39641. * Gets or sets the show frustums state. This property is observable.
  39642. */
  39643. frustums: boolean;
  39644. /**
  39645. * Gets or sets the show frustum planes state. This property is observable.
  39646. */
  39647. frustumPlanes: boolean;
  39648. /**
  39649. * Gets or sets the show performance display state. This property is observable.
  39650. */
  39651. performance: boolean;
  39652. /**
  39653. * Gets or sets the shader cache text. This property is observable.
  39654. */
  39655. shaderCacheText: string;
  39656. /**
  39657. * Gets or sets the show primitive bounding sphere state. This property is observable.
  39658. */
  39659. primitiveBoundingSphere: boolean;
  39660. /**
  39661. * Gets or sets the show primitive reference frame state. This property is observable.
  39662. */
  39663. primitiveReferenceFrame: boolean;
  39664. /**
  39665. * Gets or sets the filter primitive state. This property is observable.
  39666. */
  39667. filterPrimitive: boolean;
  39668. /**
  39669. * Gets or sets the show tile bounding sphere state. This property is observable.
  39670. */
  39671. tileBoundingSphere: boolean;
  39672. /**
  39673. * Gets or sets the filter tile state. This property is observable.
  39674. */
  39675. filterTile: boolean;
  39676. /**
  39677. * Gets or sets the show wireframe state. This property is observable.
  39678. */
  39679. wireframe: boolean;
  39680. /**
  39681. * Gets or sets the show globe depth state. This property is observable.
  39682. */
  39683. globeDepth: boolean;
  39684. /**
  39685. * Gets or sets the show pick depth state. This property is observable.
  39686. */
  39687. pickDepth: boolean;
  39688. /**
  39689. * Gets or sets the index of the depth frustum to display. This property is observable.
  39690. */
  39691. depthFrustum: number;
  39692. /**
  39693. * Gets or sets the suspend updates state. This property is observable.
  39694. */
  39695. suspendUpdates: boolean;
  39696. /**
  39697. * Gets or sets the show tile coordinates state. This property is observable.
  39698. */
  39699. tileCoordinates: boolean;
  39700. /**
  39701. * Gets or sets the frustum statistic text. This property is observable.
  39702. */
  39703. frustumStatisticText: string;
  39704. /**
  39705. * Gets or sets the selected tile information text. This property is observable.
  39706. */
  39707. tileText: string;
  39708. /**
  39709. * Gets if a primitive has been selected. This property is observable.
  39710. */
  39711. hasPickedPrimitive: boolean;
  39712. /**
  39713. * Gets if a tile has been selected. This property is observable
  39714. */
  39715. hasPickedTile: boolean;
  39716. /**
  39717. * Gets if the picking primitive command is active. This property is observable.
  39718. */
  39719. pickPrimitiveActive: boolean;
  39720. /**
  39721. * Gets if the picking tile command is active. This property is observable.
  39722. */
  39723. pickTileActive: boolean;
  39724. /**
  39725. * Gets or sets if the cesium inspector drop down is visible. This property is observable.
  39726. */
  39727. dropDownVisible: boolean;
  39728. /**
  39729. * Gets or sets if the general section is visible. This property is observable.
  39730. */
  39731. generalVisible: boolean;
  39732. /**
  39733. * Gets or sets if the primitive section is visible. This property is observable.
  39734. */
  39735. primitivesVisible: boolean;
  39736. /**
  39737. * Gets or sets if the terrain section is visible. This property is observable.
  39738. */
  39739. terrainVisible: boolean;
  39740. /**
  39741. * Gets or sets the index of the depth frustum text. This property is observable.
  39742. */
  39743. depthFrustumText: string;
  39744. /**
  39745. * Gets the scene to control.
  39746. */
  39747. scene: Scene;
  39748. /**
  39749. * Gets the container of the PerformanceDisplay
  39750. */
  39751. performanceContainer: Element;
  39752. /**
  39753. * Gets the command to toggle the visibility of the drop down.
  39754. */
  39755. toggleDropDown: Command;
  39756. /**
  39757. * Gets the command to toggle the visibility of a BoundingSphere for a primitive
  39758. */
  39759. showPrimitiveBoundingSphere: Command;
  39760. /**
  39761. * Gets the command to toggle the visibility of a {@link DebugModelMatrixPrimitive} for the model matrix of a primitive
  39762. */
  39763. showPrimitiveReferenceFrame: Command;
  39764. /**
  39765. * Gets the command to toggle a filter that renders only a selected primitive
  39766. */
  39767. doFilterPrimitive: Command;
  39768. /**
  39769. * Gets the command to increment the depth frustum index to be shown
  39770. */
  39771. incrementDepthFrustum: Command;
  39772. /**
  39773. * Gets the command to decrement the depth frustum index to be shown
  39774. */
  39775. decrementDepthFrustum: Command;
  39776. /**
  39777. * Gets the command to toggle the visibility of tile coordinates
  39778. */
  39779. showTileCoordinates: Command;
  39780. /**
  39781. * Gets the command to toggle the visibility of a BoundingSphere for a selected tile
  39782. */
  39783. showTileBoundingSphere: Command;
  39784. /**
  39785. * Gets the command to toggle a filter that renders only a selected tile
  39786. */
  39787. doFilterTile: Command;
  39788. /**
  39789. * Gets the command to expand and collapse the general section
  39790. */
  39791. toggleGeneral: Command;
  39792. /**
  39793. * Gets the command to expand and collapse the primitives section
  39794. */
  39795. togglePrimitives: Command;
  39796. /**
  39797. * Gets the command to expand and collapse the terrain section
  39798. */
  39799. toggleTerrain: Command;
  39800. /**
  39801. * Gets the command to pick a primitive
  39802. */
  39803. pickPrimitive: Command;
  39804. /**
  39805. * Gets the command to pick a tile
  39806. */
  39807. pickTile: Command;
  39808. /**
  39809. * Gets the command to pick a tile
  39810. */
  39811. selectParent: Command;
  39812. /**
  39813. * Gets the command to pick a tile
  39814. */
  39815. selectNW: Command;
  39816. /**
  39817. * Gets the command to pick a tile
  39818. */
  39819. selectNE: Command;
  39820. /**
  39821. * Gets the command to pick a tile
  39822. */
  39823. selectSW: Command;
  39824. /**
  39825. * Gets the command to pick a tile
  39826. */
  39827. selectSE: Command;
  39828. /**
  39829. * Gets or sets the current selected primitive
  39830. */
  39831. primitive: Command;
  39832. /**
  39833. * Gets or sets the current selected tile
  39834. */
  39835. tile: Command;
  39836. /**
  39837. * @returns true if the object has been destroyed, false otherwise.
  39838. */
  39839. isDestroyed(): boolean;
  39840. /**
  39841. * Destroys the widget. Should be called if permanently
  39842. removing the widget from layout.
  39843. */
  39844. destroy(): void;
  39845. }
  39846. /**
  39847. * A widget containing a Cesium scene.
  39848. * @example
  39849. * // For each example, include a link to CesiumWidget.css stylesheet in HTML head,
  39850. // and in the body, include: <div id="cesiumContainer"></div>
  39851. //Widget with no terrain and default Bing Maps imagery provider.
  39852. var widget = new Cesium.CesiumWidget('cesiumContainer');
  39853. //Widget with ion imagery and Cesium World Terrain.
  39854. var widget = new Cesium.CesiumWidget('cesiumContainer', {
  39855. imageryProvider : Cesium.createWorldImagery(),
  39856. terrainProvider : Cesium.createWorldTerrain(),
  39857. skyBox : new Cesium.SkyBox({
  39858. sources : {
  39859. positiveX : 'stars/TychoSkymapII.t3_08192x04096_80_px.jpg',
  39860. negativeX : 'stars/TychoSkymapII.t3_08192x04096_80_mx.jpg',
  39861. positiveY : 'stars/TychoSkymapII.t3_08192x04096_80_py.jpg',
  39862. negativeY : 'stars/TychoSkymapII.t3_08192x04096_80_my.jpg',
  39863. positiveZ : 'stars/TychoSkymapII.t3_08192x04096_80_pz.jpg',
  39864. negativeZ : 'stars/TychoSkymapII.t3_08192x04096_80_mz.jpg'
  39865. }
  39866. }),
  39867. // Show Columbus View map with Web Mercator projection
  39868. sceneMode : Cesium.SceneMode.COLUMBUS_VIEW,
  39869. mapProjection : new Cesium.WebMercatorProjection()
  39870. });
  39871. * @param container - The DOM element or ID that will contain the widget.
  39872. * @param [options] - Object with the following properties:
  39873. * @param [options.clock = new Clock()] - The clock to use to control current time.
  39874. * @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.
  39875. * @param [options.terrainProvider = new EllipsoidTerrainProvider] - The terrain provider.
  39876. * @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.
  39877. * @param [options.skyAtmosphere] - Blue sky, and the glow around the Earth's limb. Set to <code>false</code> to turn it off.
  39878. * @param [options.sceneMode = SceneMode.SCENE3D] - The initial scene mode.
  39879. * @param [options.scene3DOnly = false] - When <code>true</code>, each geometry instance will only be rendered in 3D to save GPU memory.
  39880. * @param [options.orderIndependentTranslucency = true] - If true and the configuration supports it, use order independent translucency.
  39881. * @param [options.mapProjection = new GeographicProjection()] - The map projection to use in 2D and Columbus View modes.
  39882. * @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.
  39883. * @param [options.useDefaultRenderLoop = true] - True if this widget should control the render loop, false otherwise.
  39884. * @param [options.useBrowserRecommendedResolution = true] - If true, render at the browser's recommended resolution and ignore <code>window.devicePixelRatio</code>.
  39885. * @param [options.targetFrameRate] - The target frame rate when using the default render loop.
  39886. * @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.
  39887. * @param [options.contextOptions] - Context and WebGL creation properties corresponding to <code>options</code> passed to {@link Scene}.
  39888. * @param [options.creditContainer] - The DOM element or ID that will contain the {@link CreditDisplay}. If not specified, the credits are added
  39889. to the bottom of the widget itself.
  39890. * @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.
  39891. * @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.
  39892. * @param [options.shadows = false] - Determines if shadows are cast by light sources.
  39893. * @param [options.terrainShadows = ShadowMode.RECEIVE_ONLY] - Determines if the terrain casts or receives shadows from light sources.
  39894. * @param [options.mapMode2D = MapMode2D.INFINITE_SCROLL] - Determines if the 2D map is rotatable or can be scrolled infinitely in the horizontal direction.
  39895. * @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}.
  39896. * @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}.
  39897. */
  39898. export class CesiumWidget {
  39899. constructor(container: Element | string, options?: {
  39900. clock?: Clock;
  39901. imageryProvider?: ImageryProvider | false;
  39902. terrainProvider?: TerrainProvider;
  39903. skyBox?: SkyBox | false;
  39904. skyAtmosphere?: SkyAtmosphere | false;
  39905. sceneMode?: SceneMode;
  39906. scene3DOnly?: boolean;
  39907. orderIndependentTranslucency?: boolean;
  39908. mapProjection?: MapProjection;
  39909. globe?: Globe | false;
  39910. useDefaultRenderLoop?: boolean;
  39911. useBrowserRecommendedResolution?: boolean;
  39912. targetFrameRate?: number;
  39913. showRenderLoopErrors?: boolean;
  39914. contextOptions?: any;
  39915. creditContainer?: Element | string;
  39916. creditViewport?: Element | string;
  39917. terrainExaggeration?: number;
  39918. shadows?: boolean;
  39919. terrainShadows?: ShadowMode;
  39920. mapMode2D?: MapMode2D;
  39921. requestRenderMode?: boolean;
  39922. maximumRenderTimeChange?: number;
  39923. });
  39924. /**
  39925. * Gets the parent container.
  39926. */
  39927. readonly container: Element;
  39928. /**
  39929. * Gets the canvas.
  39930. */
  39931. readonly canvas: HTMLCanvasElement;
  39932. /**
  39933. * Gets the credit container.
  39934. */
  39935. readonly creditContainer: Element;
  39936. /**
  39937. * Gets the credit viewport
  39938. */
  39939. readonly creditViewport: Element;
  39940. /**
  39941. * Gets the scene.
  39942. */
  39943. readonly scene: Scene;
  39944. /**
  39945. * Gets the collection of image layers that will be rendered on the globe.
  39946. */
  39947. readonly imageryLayers: ImageryLayerCollection;
  39948. /**
  39949. * The terrain provider providing surface geometry for the globe.
  39950. */
  39951. terrainProvider: TerrainProvider;
  39952. /**
  39953. * Gets the camera.
  39954. */
  39955. readonly camera: Camera;
  39956. /**
  39957. * Gets the clock.
  39958. */
  39959. readonly clock: Clock;
  39960. /**
  39961. * Gets the screen space event handler.
  39962. */
  39963. readonly screenSpaceEventHandler: ScreenSpaceEventHandler;
  39964. /**
  39965. * Gets or sets the target frame rate of the widget when <code>useDefaultRenderLoop</code>
  39966. is true. If undefined, the browser's {@link requestAnimationFrame} implementation
  39967. determines the frame rate. If defined, this value must be greater than 0. A value higher
  39968. than the underlying requestAnimationFrame implementation will have no effect.
  39969. */
  39970. targetFrameRate: number;
  39971. /**
  39972. * Gets or sets whether or not this widget should control the render loop.
  39973. If set to true the widget will use {@link requestAnimationFrame} to
  39974. perform rendering and resizing of the widget, as well as drive the
  39975. simulation clock. If set to false, you must manually call the
  39976. <code>resize</code>, <code>render</code> methods as part of a custom
  39977. render loop. If an error occurs during rendering, {@link Scene}'s
  39978. <code>renderError</code> event will be raised and this property
  39979. will be set to false. It must be set back to true to continue rendering
  39980. after the error.
  39981. */
  39982. useDefaultRenderLoop: boolean;
  39983. /**
  39984. * Gets or sets a scaling factor for rendering resolution. Values less than 1.0 can improve
  39985. performance on less powerful devices while values greater than 1.0 will render at a higher
  39986. resolution and then scale down, resulting in improved visual fidelity.
  39987. For example, if the widget is laid out at a size of 640x480, setting this value to 0.5
  39988. will cause the scene to be rendered at 320x240 and then scaled up while setting
  39989. it to 2.0 will cause the scene to be rendered at 1280x960 and then scaled down.
  39990. */
  39991. resolutionScale: number;
  39992. /**
  39993. * Boolean flag indicating if the browser's recommended resolution is used.
  39994. If true, the browser's device pixel ratio is ignored and 1.0 is used instead,
  39995. effectively rendering based on CSS pixels instead of device pixels. This can improve
  39996. performance on less powerful devices that have high pixel density. When false, rendering
  39997. will be in device pixels. {@link CesiumWidget#resolutionScale} will still take effect whether
  39998. this flag is true or false.
  39999. */
  40000. useBrowserRecommendedResolution: boolean;
  40001. /**
  40002. * Show an error panel to the user containing a title and a longer error message,
  40003. which can be dismissed using an OK button. This panel is displayed automatically
  40004. when a render loop error occurs, if showRenderLoopErrors was not false when the
  40005. widget was constructed.
  40006. * @param title - The title to be displayed on the error panel. This string is interpreted as text.
  40007. * @param [message] - A helpful, user-facing message to display prior to the detailed error information. This string is interpreted as HTML.
  40008. * @param [error] - The error to be displayed on the error panel. This string is formatted using {@link formatError} and then displayed as text.
  40009. */
  40010. showErrorPanel(title: string, message?: string, error?: string): void;
  40011. /**
  40012. * @returns true if the object has been destroyed, false otherwise.
  40013. */
  40014. isDestroyed(): boolean;
  40015. /**
  40016. * Destroys the widget. Should be called if permanently
  40017. removing the widget from layout.
  40018. */
  40019. destroy(): void;
  40020. /**
  40021. * Updates the canvas size, camera aspect ratio, and viewport size.
  40022. This function is called automatically as needed unless
  40023. <code>useDefaultRenderLoop</code> is set to false.
  40024. */
  40025. resize(): void;
  40026. /**
  40027. * Renders the scene. This function is called automatically
  40028. unless <code>useDefaultRenderLoop</code> is set to false;
  40029. */
  40030. render(): void;
  40031. }
  40032. /**
  40033. * A view model which exposes a {@link Clock} for user interfaces.
  40034. * @param [clock] - The clock object wrapped by this view model, if undefined a new instance will be created.
  40035. */
  40036. export class ClockViewModel {
  40037. constructor(clock?: Clock);
  40038. /**
  40039. * Gets the current system time.
  40040. This property is observable.
  40041. */
  40042. systemTime: JulianDate;
  40043. /**
  40044. * Gets or sets the start time of the clock.
  40045. See {@link Clock#startTime}.
  40046. This property is observable.
  40047. */
  40048. startTime: JulianDate;
  40049. /**
  40050. * Gets or sets the stop time of the clock.
  40051. See {@link Clock#stopTime}.
  40052. This property is observable.
  40053. */
  40054. stopTime: JulianDate;
  40055. /**
  40056. * Gets or sets the current time.
  40057. See {@link Clock#currentTime}.
  40058. This property is observable.
  40059. */
  40060. currentTime: JulianDate;
  40061. /**
  40062. * Gets or sets the clock multiplier.
  40063. See {@link Clock#multiplier}.
  40064. This property is observable.
  40065. */
  40066. multiplier: number;
  40067. /**
  40068. * Gets or sets the clock step setting.
  40069. See {@link Clock#clockStep}.
  40070. This property is observable.
  40071. */
  40072. clockStep: ClockStep;
  40073. /**
  40074. * Gets or sets the clock range setting.
  40075. See {@link Clock#clockRange}.
  40076. This property is observable.
  40077. */
  40078. clockRange: ClockRange;
  40079. /**
  40080. * Gets or sets whether the clock can animate.
  40081. See {@link Clock#canAnimate}.
  40082. This property is observable.
  40083. */
  40084. canAnimate: boolean;
  40085. /**
  40086. * Gets or sets whether the clock should animate.
  40087. See {@link Clock#shouldAnimate}.
  40088. This property is observable.
  40089. */
  40090. shouldAnimate: boolean;
  40091. /**
  40092. * Gets the underlying Clock.
  40093. */
  40094. clock: Clock;
  40095. /**
  40096. * Updates the view model with the contents of the underlying clock.
  40097. Can be called to force an update of the viewModel if the underlying
  40098. clock has changed and <code>Clock.tick</code> has not yet been called.
  40099. */
  40100. synchronize(): void;
  40101. /**
  40102. * @returns true if the object has been destroyed, false otherwise.
  40103. */
  40104. isDestroyed(): boolean;
  40105. /**
  40106. * Destroys the view model. Should be called to
  40107. properly clean up the view model when it is no longer needed.
  40108. */
  40109. destroy(): void;
  40110. }
  40111. /**
  40112. * A Command is a function with an extra <code>canExecute</code> observable property to determine
  40113. whether the command can be executed. When executed, a Command function will check the
  40114. value of <code>canExecute</code> and throw if false.
  40115. This type describes an interface and is not intended to be instantiated directly.
  40116. See {@link createCommand} to create a command from a function.
  40117. */
  40118. export class Command {
  40119. constructor();
  40120. /**
  40121. * Gets whether this command can currently be executed. This property is observable.
  40122. */
  40123. canExecute: boolean;
  40124. /**
  40125. * Gets an event which is raised before the command executes, the event
  40126. is raised with an object containing two properties: a <code>cancel</code> property,
  40127. which if set to false by the listener will prevent the command from being executed, and
  40128. an <code>args</code> property, which is the array of arguments being passed to the command.
  40129. */
  40130. beforeExecute: Event;
  40131. /**
  40132. * Gets an event which is raised after the command executes, the event
  40133. is raised with the return value of the command as its only parameter.
  40134. */
  40135. afterExecute: Event;
  40136. }
  40137. /**
  40138. * Create a Command from a given function, for use with ViewModels.
  40139. A Command is a function with an extra <code>canExecute</code> observable property to determine
  40140. whether the command can be executed. When executed, a Command function will check the
  40141. value of <code>canExecute</code> and throw if false. It also provides events for when
  40142. a command has been or is about to be executed.
  40143. * @param func - The function to execute.
  40144. * @param [canExecute = true] - A boolean indicating whether the function can currently be executed.
  40145. */
  40146. export function createCommand(func: (...params: any[]) => any, canExecute?: boolean): void;
  40147. /**
  40148. * A single button widget for toggling fullscreen mode.
  40149. * @param container - The DOM element or ID that will contain the widget.
  40150. * @param [fullscreenElement = document.body] - The element or id to be placed into fullscreen mode.
  40151. */
  40152. export class FullscreenButton {
  40153. constructor(container: Element | string, fullscreenElement?: Element | string);
  40154. /**
  40155. * Gets the parent container.
  40156. */
  40157. container: Element;
  40158. /**
  40159. * Gets the view model.
  40160. */
  40161. viewModel: FullscreenButtonViewModel;
  40162. /**
  40163. * @returns true if the object has been destroyed, false otherwise.
  40164. */
  40165. isDestroyed(): boolean;
  40166. /**
  40167. * Destroys the widget. Should be called if permanently
  40168. removing the widget from layout.
  40169. */
  40170. destroy(): void;
  40171. }
  40172. /**
  40173. * The view model for {@link FullscreenButton}.
  40174. * @param [fullscreenElement = document.body] - The element or id to be placed into fullscreen mode.
  40175. * @param [container] - The DOM element or ID that will contain the widget.
  40176. */
  40177. export class FullscreenButtonViewModel {
  40178. constructor(fullscreenElement?: Element | string, container?: Element | string);
  40179. /**
  40180. * Gets whether or not fullscreen mode is active. This property is observable.
  40181. */
  40182. isFullscreen: boolean;
  40183. /**
  40184. * Gets or sets whether or not fullscreen functionality should be enabled. This property is observable.
  40185. */
  40186. isFullscreenEnabled: boolean;
  40187. /**
  40188. * Gets the tooltip. This property is observable.
  40189. */
  40190. tooltip: string;
  40191. /**
  40192. * Gets or sets the HTML element to place into fullscreen mode when the
  40193. corresponding button is pressed.
  40194. */
  40195. fullscreenElement: Element;
  40196. /**
  40197. * Gets the Command to toggle fullscreen mode.
  40198. */
  40199. command: Command;
  40200. /**
  40201. * @returns true if the object has been destroyed, false otherwise.
  40202. */
  40203. isDestroyed(): boolean;
  40204. /**
  40205. * Destroys the view model. Should be called to
  40206. properly clean up the view model when it is no longer needed.
  40207. */
  40208. destroy(): void;
  40209. }
  40210. /**
  40211. * A widget for finding addresses and landmarks, and flying the camera to them. Geocoding is
  40212. performed using {@link https://cesium.com/cesium-ion/|Cesium ion}.
  40213. * @param options - Object with the following properties:
  40214. * @param options.container - The DOM element or ID that will contain the widget.
  40215. * @param options.scene - The Scene instance to use.
  40216. * @param [options.geocoderServices] - The geocoder services to be used
  40217. * @param [options.autoComplete = true] - True if the geocoder should query as the user types to autocomplete
  40218. * @param [options.flightDuration = 1.5] - The duration of the camera flight to an entered location, in seconds.
  40219. * @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.
  40220. */
  40221. export class Geocoder {
  40222. constructor(options: {
  40223. container: Element | string;
  40224. scene: Scene;
  40225. geocoderServices?: GeocoderService[];
  40226. autoComplete?: boolean;
  40227. flightDuration?: number;
  40228. destinationFound?: Geocoder.DestinationFoundFunction;
  40229. });
  40230. /**
  40231. * Gets the parent container.
  40232. */
  40233. container: Element;
  40234. /**
  40235. * Gets the parent container.
  40236. */
  40237. searchSuggestionsContainer: Element;
  40238. /**
  40239. * Gets the view model.
  40240. */
  40241. viewModel: GeocoderViewModel;
  40242. /**
  40243. * @returns true if the object has been destroyed, false otherwise.
  40244. */
  40245. isDestroyed(): boolean;
  40246. /**
  40247. * Destroys the widget. Should be called if permanently
  40248. removing the widget from layout.
  40249. */
  40250. destroy(): void;
  40251. }
  40252. export namespace Geocoder {
  40253. /**
  40254. * A function that handles the result of a successful geocode.
  40255. * @param viewModel - The view model.
  40256. * @param destination - The destination result of the geocode.
  40257. */
  40258. type DestinationFoundFunction = (viewModel: GeocoderViewModel, destination: Cartesian3 | Rectangle) => void;
  40259. }
  40260. /**
  40261. * The view model for the {@link Geocoder} widget.
  40262. * @param options - Object with the following properties:
  40263. * @param options.scene - The Scene instance to use.
  40264. * @param [options.geocoderServices] - Geocoder services to use for geocoding queries.
  40265. If more than one are supplied, suggestions will be gathered for the geocoders that support it,
  40266. and if no suggestion is selected the result from the first geocoder service wil be used.
  40267. * @param [options.flightDuration] - The duration of the camera flight to an entered location, in seconds.
  40268. * @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.
  40269. */
  40270. export class GeocoderViewModel {
  40271. constructor(options: {
  40272. scene: Scene;
  40273. geocoderServices?: GeocoderService[];
  40274. flightDuration?: number;
  40275. destinationFound?: Geocoder.DestinationFoundFunction;
  40276. });
  40277. /**
  40278. * Gets or sets a value indicating if this instance should always show its text input field.
  40279. */
  40280. keepExpanded: boolean;
  40281. /**
  40282. * True if the geocoder should query as the user types to autocomplete
  40283. */
  40284. autoComplete: boolean;
  40285. /**
  40286. * Gets and sets the command called when a geocode destination is found
  40287. */
  40288. destinationFound: Geocoder.DestinationFoundFunction;
  40289. /**
  40290. * Gets a value indicating whether a search is currently in progress. This property is observable.
  40291. */
  40292. isSearchInProgress: boolean;
  40293. /**
  40294. * Gets or sets the text to search for. The text can be an address, or longitude, latitude,
  40295. and optional height, where longitude and latitude are in degrees and height is in meters.
  40296. */
  40297. searchText: string;
  40298. /**
  40299. * Gets or sets the the duration of the camera flight in seconds.
  40300. A value of zero causes the camera to instantly switch to the geocoding location.
  40301. The duration will be computed based on the distance when undefined.
  40302. */
  40303. flightDuration: number | undefined;
  40304. /**
  40305. * Gets the event triggered on flight completion.
  40306. */
  40307. complete: Event;
  40308. /**
  40309. * Gets the scene to control.
  40310. */
  40311. scene: Scene;
  40312. /**
  40313. * Gets the Command that is executed when the button is clicked.
  40314. */
  40315. search: Command;
  40316. /**
  40317. * Gets the currently selected geocoder search suggestion
  40318. */
  40319. selectedSuggestion: any;
  40320. /**
  40321. * Gets the list of geocoder search suggestions
  40322. */
  40323. suggestions: object[];
  40324. /**
  40325. * Destroys the widget. Should be called if permanently
  40326. removing the widget from layout.
  40327. */
  40328. destroy(): void;
  40329. /**
  40330. * A function to fly to the destination found by a successful geocode.
  40331. */
  40332. static flyToDestination: Geocoder.DestinationFoundFunction;
  40333. }
  40334. /**
  40335. * A single button widget for returning to the default camera view of the current scene.
  40336. * @param container - The DOM element or ID that will contain the widget.
  40337. * @param scene - The Scene instance to use.
  40338. * @param [duration] - The time, in seconds, it takes to complete the camera flight home.
  40339. */
  40340. export class HomeButton {
  40341. constructor(container: Element | string, scene: Scene, duration?: number);
  40342. /**
  40343. * Gets the parent container.
  40344. */
  40345. container: Element;
  40346. /**
  40347. * Gets the view model.
  40348. */
  40349. viewModel: HomeButtonViewModel;
  40350. /**
  40351. * @returns true if the object has been destroyed, false otherwise.
  40352. */
  40353. isDestroyed(): boolean;
  40354. /**
  40355. * Destroys the widget. Should be called if permanently
  40356. removing the widget from layout.
  40357. */
  40358. destroy(): void;
  40359. }
  40360. /**
  40361. * The view model for {@link HomeButton}.
  40362. * @param scene - The scene instance to use.
  40363. * @param [duration] - The duration of the camera flight in seconds.
  40364. */
  40365. export class HomeButtonViewModel {
  40366. constructor(scene: Scene, duration?: number);
  40367. /**
  40368. * Gets or sets the tooltip. This property is observable.
  40369. */
  40370. tooltip: string;
  40371. /**
  40372. * Gets the scene to control.
  40373. */
  40374. scene: Scene;
  40375. /**
  40376. * Gets the Command that is executed when the button is clicked.
  40377. */
  40378. command: Command;
  40379. /**
  40380. * Gets or sets the the duration of the camera flight in seconds.
  40381. A value of zero causes the camera to instantly switch to home view.
  40382. The duration will be computed based on the distance when undefined.
  40383. */
  40384. duration: number | undefined;
  40385. }
  40386. /**
  40387. * A widget for displaying information or a description.
  40388. * @param container - The DOM element or ID that will contain the widget.
  40389. */
  40390. export class InfoBox {
  40391. constructor(container: Element | string);
  40392. /**
  40393. * Gets the parent container.
  40394. */
  40395. container: Element;
  40396. /**
  40397. * Gets the view model.
  40398. */
  40399. viewModel: InfoBoxViewModel;
  40400. /**
  40401. * Gets the iframe used to display the description.
  40402. */
  40403. frame: HTMLIFrameElement;
  40404. /**
  40405. * @returns true if the object has been destroyed, false otherwise.
  40406. */
  40407. isDestroyed(): boolean;
  40408. /**
  40409. * Destroys the widget. Should be called if permanently
  40410. removing the widget from layout.
  40411. */
  40412. destroy(): void;
  40413. }
  40414. /**
  40415. * The view model for {@link InfoBox}.
  40416. */
  40417. export class InfoBoxViewModel {
  40418. constructor();
  40419. /**
  40420. * Gets or sets the maximum height of the info box in pixels. This property is observable.
  40421. */
  40422. maxHeight: number;
  40423. /**
  40424. * Gets or sets whether the camera tracking icon is enabled.
  40425. */
  40426. enableCamera: boolean;
  40427. /**
  40428. * Gets or sets the status of current camera tracking of the selected object.
  40429. */
  40430. isCameraTracking: boolean;
  40431. /**
  40432. * Gets or sets the visibility of the info box.
  40433. */
  40434. showInfo: boolean;
  40435. /**
  40436. * Gets or sets the title text in the info box.
  40437. */
  40438. titleText: string;
  40439. /**
  40440. * Gets or sets the description HTML for the info box.
  40441. */
  40442. description: string;
  40443. /**
  40444. * Gets the SVG path of the camera icon, which can change to be "crossed out" or not.
  40445. */
  40446. cameraIconPath: string;
  40447. /**
  40448. * Gets the maximum height of sections within the info box, minus an offset, in CSS-ready form.
  40449. * @param offset - The offset in pixels.
  40450. */
  40451. maxHeightOffset(offset: number): string;
  40452. /**
  40453. * Gets an {@link Event} that is fired when the user clicks the camera icon.
  40454. */
  40455. cameraClicked: Event;
  40456. /**
  40457. * Gets an {@link Event} that is fired when the user closes the info box.
  40458. */
  40459. closeClicked: Event;
  40460. }
  40461. /**
  40462. * <p>The NavigationHelpButton is a single button widget for displaying instructions for
  40463. navigating the globe with the mouse.</p><p style="clear: both;"></p><br/>
  40464. * @example
  40465. * // In HTML head, include a link to the NavigationHelpButton.css stylesheet,
  40466. // and in the body, include: <div id="navigationHelpButtonContainer"></div>
  40467. var navigationHelpButton = new Cesium.NavigationHelpButton({
  40468. container : 'navigationHelpButtonContainer'
  40469. });
  40470. * @param options - Object with the following properties:
  40471. * @param options.container - The DOM element or ID that will contain the widget.
  40472. * @param [options.instructionsInitiallyVisible = false] - True if the navigation instructions should initially be visible; otherwise, false.
  40473. */
  40474. export class NavigationHelpButton {
  40475. constructor(options: {
  40476. container: Element | string;
  40477. instructionsInitiallyVisible?: boolean;
  40478. });
  40479. /**
  40480. * Gets the parent container.
  40481. */
  40482. container: Element;
  40483. /**
  40484. * Gets the view model.
  40485. */
  40486. viewModel: NavigationHelpButtonViewModel;
  40487. /**
  40488. * @returns true if the object has been destroyed, false otherwise.
  40489. */
  40490. isDestroyed(): boolean;
  40491. /**
  40492. * Destroys the widget. Should be called if permanently
  40493. removing the widget from layout.
  40494. */
  40495. destroy(): void;
  40496. }
  40497. /**
  40498. * The view model for {@link NavigationHelpButton}.
  40499. */
  40500. export class NavigationHelpButtonViewModel {
  40501. constructor();
  40502. /**
  40503. * Gets or sets whether the instructions are currently shown. This property is observable.
  40504. */
  40505. showInstructions: boolean;
  40506. /**
  40507. * Gets or sets the tooltip. This property is observable.
  40508. */
  40509. tooltip: string;
  40510. /**
  40511. * Gets the Command that is executed when the button is clicked.
  40512. */
  40513. command: Command;
  40514. /**
  40515. * Gets the Command that is executed when the mouse instructions should be shown.
  40516. */
  40517. showClick: Command;
  40518. /**
  40519. * Gets the Command that is executed when the touch instructions should be shown.
  40520. */
  40521. showTouch: Command;
  40522. }
  40523. /**
  40524. * Monitors performance of the application and displays a message if poor performance is detected.
  40525. * @param [options] - Object with the following properties:
  40526. * @param options.container - The DOM element or ID that will contain the widget.
  40527. * @param options.scene - The {@link Scene} for which to monitor performance.
  40528. * @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
  40529. message to display when a low frame rate is detected. The message is interpeted as HTML, so make sure
  40530. it comes from a trusted source so that your application is not vulnerable to cross-site scripting attacks.
  40531. */
  40532. export class PerformanceWatchdog {
  40533. constructor(options?: {
  40534. container: Element | string;
  40535. scene: Scene;
  40536. lowFrameRateMessage?: string;
  40537. });
  40538. /**
  40539. * Gets the parent container.
  40540. */
  40541. container: Element;
  40542. /**
  40543. * Gets the view model.
  40544. */
  40545. viewModel: PerformanceWatchdogViewModel;
  40546. /**
  40547. * @returns true if the object has been destroyed, false otherwise.
  40548. */
  40549. isDestroyed(): boolean;
  40550. /**
  40551. * Destroys the widget. Should be called if permanently
  40552. removing the widget from layout.
  40553. */
  40554. destroy(): void;
  40555. }
  40556. /**
  40557. * The view model for {@link PerformanceWatchdog}.
  40558. * @param [options] - Object with the following properties:
  40559. * @param options.scene - The Scene instance for which to monitor performance.
  40560. * @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
  40561. message to display when a low frame rate is detected. The message is interpeted as HTML, so make sure
  40562. it comes from a trusted source so that your application is not vulnerable to cross-site scripting attacks.
  40563. */
  40564. export class PerformanceWatchdogViewModel {
  40565. constructor(options?: {
  40566. scene: Scene;
  40567. lowFrameRateMessage?: string;
  40568. });
  40569. /**
  40570. * Gets or sets the message to display when a low frame rate is detected. This string will be interpreted as HTML.
  40571. */
  40572. lowFrameRateMessage: string;
  40573. /**
  40574. * Gets or sets a value indicating whether the low frame rate message has previously been dismissed by the user. If it has
  40575. been dismissed, the message will not be redisplayed, no matter the frame rate.
  40576. */
  40577. lowFrameRateMessageDismissed: boolean;
  40578. /**
  40579. * Gets or sets a value indicating whether the low frame rate message is currently being displayed.
  40580. */
  40581. showingLowFrameRateMessage: boolean;
  40582. /**
  40583. * Gets the {@link Scene} instance for which to monitor performance.
  40584. */
  40585. scene: Scene;
  40586. /**
  40587. * Gets a command that dismisses the low frame rate message. Once it is dismissed, the message
  40588. will not be redisplayed.
  40589. */
  40590. dismissMessage: Command;
  40591. }
  40592. /**
  40593. * The ProjectionPicker is a single button widget for switching between perspective and orthographic projections.
  40594. * @example
  40595. * // In HTML head, include a link to the ProjectionPicker.css stylesheet,
  40596. // and in the body, include: <div id="projectionPickerContainer"></div>
  40597. // Note: This code assumes you already have a Scene instance.
  40598. var projectionPicker = new Cesium.ProjectionPicker('projectionPickerContainer', scene);
  40599. * @param container - The DOM element or ID that will contain the widget.
  40600. * @param scene - The Scene instance to use.
  40601. */
  40602. export class ProjectionPicker {
  40603. constructor(container: Element | string, scene: Scene);
  40604. /**
  40605. * Gets the parent container.
  40606. */
  40607. container: Element;
  40608. /**
  40609. * Gets the view model.
  40610. */
  40611. viewModel: ProjectionPickerViewModel;
  40612. /**
  40613. * @returns true if the object has been destroyed, false otherwise.
  40614. */
  40615. isDestroyed(): boolean;
  40616. /**
  40617. * Destroys the widget. Should be called if permanently
  40618. removing the widget from layout.
  40619. */
  40620. destroy(): void;
  40621. }
  40622. /**
  40623. * The view model for {@link ProjectionPicker}.
  40624. * @param scene - The Scene to switch projections.
  40625. */
  40626. export class ProjectionPickerViewModel {
  40627. constructor(scene: Scene);
  40628. /**
  40629. * Gets or sets whether the button drop-down is currently visible. This property is observable.
  40630. */
  40631. dropDownVisible: boolean;
  40632. /**
  40633. * Gets or sets the perspective projection tooltip. This property is observable.
  40634. */
  40635. tooltipPerspective: string;
  40636. /**
  40637. * Gets or sets the orthographic projection tooltip. This property is observable.
  40638. */
  40639. tooltipOrthographic: string;
  40640. /**
  40641. * Gets the currently active tooltip. This property is observable.
  40642. */
  40643. selectedTooltip: string;
  40644. /**
  40645. * Gets or sets the current SceneMode. This property is observable.
  40646. */
  40647. sceneMode: SceneMode;
  40648. /**
  40649. * Gets the scene
  40650. */
  40651. scene: Scene;
  40652. /**
  40653. * Gets the command to toggle the drop down box.
  40654. */
  40655. toggleDropDown: Command;
  40656. /**
  40657. * Gets the command to switch to a perspective projection.
  40658. */
  40659. switchToPerspective: Command;
  40660. /**
  40661. * Gets the command to switch to orthographic projection.
  40662. */
  40663. switchToOrthographic: Command;
  40664. /**
  40665. * Gets whether the scene is currently using an orthographic projection.
  40666. */
  40667. isOrthographicProjection: Command;
  40668. /**
  40669. * @returns true if the object has been destroyed, false otherwise.
  40670. */
  40671. isDestroyed(): boolean;
  40672. /**
  40673. * Destroys the view model.
  40674. */
  40675. destroy(): void;
  40676. }
  40677. /**
  40678. * <img src="Images/sceneModePicker.png" style="float: left; margin-right: 10px;" width="44" height="116" />
  40679. <p>The SceneModePicker is a single button widget for switching between scene modes;
  40680. shown to the left in its expanded state. Programatic switching of scene modes will
  40681. be automatically reflected in the widget as long as the specified Scene
  40682. is used to perform the change.</p><p style="clear: both;"></p><br/>
  40683. * @example
  40684. * // In HTML head, include a link to the SceneModePicker.css stylesheet,
  40685. // and in the body, include: <div id="sceneModePickerContainer"></div>
  40686. // Note: This code assumes you already have a Scene instance.
  40687. var sceneModePicker = new Cesium.SceneModePicker('sceneModePickerContainer', scene);
  40688. * @param container - The DOM element or ID that will contain the widget.
  40689. * @param scene - The Scene instance to use.
  40690. * @param [duration = 2.0] - The time, in seconds, it takes for the scene to transition.
  40691. */
  40692. export class SceneModePicker {
  40693. constructor(container: Element | string, scene: Scene, duration?: number);
  40694. /**
  40695. * Gets the parent container.
  40696. */
  40697. container: Element;
  40698. /**
  40699. * Gets the view model.
  40700. */
  40701. viewModel: SceneModePickerViewModel;
  40702. /**
  40703. * @returns true if the object has been destroyed, false otherwise.
  40704. */
  40705. isDestroyed(): boolean;
  40706. /**
  40707. * Destroys the widget. Should be called if permanently
  40708. removing the widget from layout.
  40709. */
  40710. destroy(): void;
  40711. }
  40712. /**
  40713. * The view model for {@link SceneModePicker}.
  40714. * @param scene - The Scene to morph
  40715. * @param [duration = 2.0] - The duration of scene morph animations, in seconds
  40716. */
  40717. export class SceneModePickerViewModel {
  40718. constructor(scene: Scene, duration?: number);
  40719. /**
  40720. * Gets or sets the current SceneMode. This property is observable.
  40721. */
  40722. sceneMode: SceneMode;
  40723. /**
  40724. * Gets or sets whether the button drop-down is currently visible. This property is observable.
  40725. */
  40726. dropDownVisible: boolean;
  40727. /**
  40728. * Gets or sets the 2D tooltip. This property is observable.
  40729. */
  40730. tooltip2D: string;
  40731. /**
  40732. * Gets or sets the 3D tooltip. This property is observable.
  40733. */
  40734. tooltip3D: string;
  40735. /**
  40736. * Gets or sets the Columbus View tooltip. This property is observable.
  40737. */
  40738. tooltipColumbusView: string;
  40739. /**
  40740. * Gets the currently active tooltip. This property is observable.
  40741. */
  40742. selectedTooltip: string;
  40743. /**
  40744. * Gets the scene
  40745. */
  40746. scene: Scene;
  40747. /**
  40748. * Gets or sets the the duration of scene mode transition animations in seconds.
  40749. A value of zero causes the scene to instantly change modes.
  40750. */
  40751. duration: number;
  40752. /**
  40753. * Gets the command to toggle the drop down box.
  40754. */
  40755. toggleDropDown: Command;
  40756. /**
  40757. * Gets the command to morph to 2D.
  40758. */
  40759. morphTo2D: Command;
  40760. /**
  40761. * Gets the command to morph to 3D.
  40762. */
  40763. morphTo3D: Command;
  40764. /**
  40765. * Gets the command to morph to Columbus View.
  40766. */
  40767. morphToColumbusView: Command;
  40768. /**
  40769. * @returns true if the object has been destroyed, false otherwise.
  40770. */
  40771. isDestroyed(): boolean;
  40772. /**
  40773. * Destroys the view model.
  40774. */
  40775. destroy(): void;
  40776. }
  40777. /**
  40778. * A widget for displaying an indicator on a selected object.
  40779. * @param container - The DOM element or ID that will contain the widget.
  40780. * @param scene - The Scene instance to use.
  40781. */
  40782. export class SelectionIndicator {
  40783. constructor(container: Element | string, scene: Scene);
  40784. /**
  40785. * Gets the parent container.
  40786. */
  40787. container: Element;
  40788. /**
  40789. * Gets the view model.
  40790. */
  40791. viewModel: SelectionIndicatorViewModel;
  40792. /**
  40793. * @returns true if the object has been destroyed, false otherwise.
  40794. */
  40795. isDestroyed(): boolean;
  40796. /**
  40797. * Destroys the widget. Should be called if permanently
  40798. removing the widget from layout.
  40799. */
  40800. destroy(): void;
  40801. }
  40802. /**
  40803. * The view model for {@link SelectionIndicator}.
  40804. * @param scene - The scene instance to use for screen-space coordinate conversion.
  40805. * @param selectionIndicatorElement - The element containing all elements that make up the selection indicator.
  40806. * @param container - The DOM element that contains the widget.
  40807. */
  40808. export class SelectionIndicatorViewModel {
  40809. constructor(scene: Scene, selectionIndicatorElement: Element, container: Element);
  40810. /**
  40811. * Gets or sets the world position of the object for which to display the selection indicator.
  40812. */
  40813. position: Cartesian3;
  40814. /**
  40815. * Gets or sets the visibility of the selection indicator.
  40816. */
  40817. showSelection: boolean;
  40818. /**
  40819. * Gets the visibility of the position indicator. This can be false even if an
  40820. object is selected, when the selected object has no position.
  40821. */
  40822. isVisible: boolean;
  40823. /**
  40824. * Gets or sets the function for converting the world position of the object to the screen space position.
  40825. * @example
  40826. * selectionIndicatorViewModel.computeScreenSpacePosition = function(position, result) {
  40827. return Cesium.SceneTransforms.wgs84ToWindowCoordinates(scene, position, result);
  40828. };
  40829. */
  40830. computeScreenSpacePosition: SelectionIndicatorViewModel.ComputeScreenSpacePosition;
  40831. /**
  40832. * Updates the view of the selection indicator to match the position and content properties of the view model.
  40833. This function should be called as part of the render loop.
  40834. */
  40835. update(): void;
  40836. /**
  40837. * Animate the indicator to draw attention to the selection.
  40838. */
  40839. animateAppear(): void;
  40840. /**
  40841. * Animate the indicator to release the selection.
  40842. */
  40843. animateDepart(): void;
  40844. /**
  40845. * Gets the HTML element containing the selection indicator.
  40846. */
  40847. container: Element;
  40848. /**
  40849. * Gets the HTML element that holds the selection indicator.
  40850. */
  40851. selectionIndicatorElement: Element;
  40852. /**
  40853. * Gets the scene being used.
  40854. */
  40855. scene: Scene;
  40856. }
  40857. export namespace SelectionIndicatorViewModel {
  40858. /**
  40859. * A function that converts the world position of an object to a screen space position.
  40860. * @param position - The position in WGS84 (world) coordinates.
  40861. * @param result - An object to return the input position transformed to window coordinates.
  40862. */
  40863. type ComputeScreenSpacePosition = (position: Cartesian3, result: Cartesian2) => Cartesian2;
  40864. }
  40865. /**
  40866. * A Knockout binding handler that creates a DOM element for a single SVG path.
  40867. This binding handler will be registered as cesiumSvgPath.
  40868. <p>
  40869. The parameter to this binding is an object with the following properties:
  40870. </p>
  40871. <ul>
  40872. <li>path: The SVG path as a string.</li>
  40873. <li>width: The width of the SVG path with no transformations applied.</li>
  40874. <li>height: The height of the SVG path with no transformations applied.</li>
  40875. <li>css: Optional. A string containing additional CSS classes to apply to the SVG. 'cesium-svgPath-svg' is always applied.</li>
  40876. </ul>
  40877. * @example
  40878. * // Create an SVG as a child of a div
  40879. <div data-bind="cesiumSvgPath: { path: 'M 100 100 L 300 100 L 200 300 z', width: 28, height: 28 }"></div>
  40880. // parameters can be observable from the view model
  40881. <div data-bind="cesiumSvgPath: { path: currentPath, width: currentWidth, height: currentHeight }"></div>
  40882. // or the whole object can be observable from the view model
  40883. <div data-bind="cesiumSvgPath: svgPathOptions"></div>
  40884. */
  40885. export namespace SvgPathBindingHandler {
  40886. function register(): void;
  40887. }
  40888. /**
  40889. * The Timeline is a widget for displaying and controlling the current scene time.
  40890. * @param container - The parent HTML container node for this widget.
  40891. * @param clock - The clock to use.
  40892. */
  40893. export class Timeline {
  40894. constructor(container: Element, clock: Clock);
  40895. /**
  40896. * Gets the parent container.
  40897. */
  40898. container: Element;
  40899. /**
  40900. * @returns true if the object has been destroyed, false otherwise.
  40901. */
  40902. isDestroyed(): boolean;
  40903. /**
  40904. * Destroys the widget. Should be called if permanently
  40905. removing the widget from layout.
  40906. */
  40907. destroy(): void;
  40908. /**
  40909. * Sets the view to the provided times.
  40910. * @param startTime - The start time.
  40911. * @param stopTime - The stop time.
  40912. */
  40913. zoomTo(startTime: JulianDate, stopTime: JulianDate): void;
  40914. /**
  40915. * Resizes the widget to match the container size.
  40916. */
  40917. resize(): void;
  40918. }
  40919. /**
  40920. * A view model which exposes the properties of a toggle button.
  40921. * @param command - The command which will be executed when the button is toggled.
  40922. * @param [options] - Object with the following properties:
  40923. * @param [options.toggled = false] - A boolean indicating whether the button should be initially toggled.
  40924. * @param [options.tooltip = ''] - A string containing the button's tooltip.
  40925. */
  40926. export class ToggleButtonViewModel {
  40927. constructor(command: Command, options?: {
  40928. toggled?: boolean;
  40929. tooltip?: string;
  40930. });
  40931. /**
  40932. * Gets or sets whether the button is currently toggled. This property is observable.
  40933. */
  40934. toggled: boolean;
  40935. /**
  40936. * Gets or sets the button's tooltip. This property is observable.
  40937. */
  40938. tooltip: string;
  40939. /**
  40940. * Gets the command which will be executed when the button is toggled.
  40941. */
  40942. command: Command;
  40943. }
  40944. export namespace Viewer {
  40945. /**
  40946. * Initialization options for the Viewer constructor
  40947. * @property [animation = true] - If set to false, the Animation widget will not be created.
  40948. * @property [baseLayerPicker = true] - If set to false, the BaseLayerPicker widget will not be created.
  40949. * @property [fullscreenButton = true] - If set to false, the FullscreenButton widget will not be created.
  40950. * @property [vrButton = false] - If set to true, the VRButton widget will be created.
  40951. * @property [geocoder = true] - If set to false, the Geocoder widget will not be created.
  40952. * @property [homeButton = true] - If set to false, the HomeButton widget will not be created.
  40953. * @property [infoBox = true] - If set to false, the InfoBox widget will not be created.
  40954. * @property [sceneModePicker = true] - If set to false, the SceneModePicker widget will not be created.
  40955. * @property [selectionIndicator = true] - If set to false, the SelectionIndicator widget will not be created.
  40956. * @property [timeline = true] - If set to false, the Timeline widget will not be created.
  40957. * @property [navigationHelpButton = true] - If set to false, the navigation help button will not be created.
  40958. * @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.
  40959. * @property [scene3DOnly = false] - When <code>true</code>, each geometry instance will only be rendered in 3D to save GPU memory.
  40960. * @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}.
  40961. * @property [clockViewModel = new ClockViewModel(clock)] - The clock view model to use to control current time.
  40962. * @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.
  40963. * @property [imageryProviderViewModels = createDefaultImageryProviderViewModels()] - The array of ProviderViewModels to be selectable from the BaseLayerPicker. This value is only valid if `baseLayerPicker` is set to true.
  40964. * @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.
  40965. * @property [terrainProviderViewModels = createDefaultTerrainProviderViewModels()] - The array of ProviderViewModels to be selectable from the BaseLayerPicker. This value is only valid if `baseLayerPicker` is set to true.
  40966. * @property [imageryProvider = createWorldImagery()] - The imagery provider to use. This value is only valid if `baseLayerPicker` is set to false.
  40967. * @property [terrainProvider = new EllipsoidTerrainProvider()] - The terrain provider to use
  40968. * @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.
  40969. * @property [skyAtmosphere] - Blue sky, and the glow around the Earth's limb. Set to <code>false</code> to turn it off.
  40970. * @property [fullscreenElement = document.body] - The element or id to be placed into fullscreen mode when the full screen button is pressed.
  40971. * @property [useDefaultRenderLoop = true] - True if this widget should control the render loop, false otherwise.
  40972. * @property [targetFrameRate] - The target frame rate when using the default render loop.
  40973. * @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.
  40974. * @property [useBrowserRecommendedResolution = true] - If true, render at the browser's recommended resolution and ignore <code>window.devicePixelRatio</code>.
  40975. * @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.
  40976. * @property [contextOptions] - Context and WebGL creation properties corresponding to <code>options</code> passed to {@link Scene}.
  40977. * @property [sceneMode = SceneMode.SCENE3D] - The initial scene mode.
  40978. * @property [mapProjection = new GeographicProjection()] - The map projection to use in 2D and Columbus View modes.
  40979. * @property [globe = new Globe(mapProjection.ellipsoid)] - The globe to use in the scene. If set to <code>false</code>, no globe will be added.
  40980. * @property [orderIndependentTranslucency = true] - If true and the configuration supports it, use order independent translucency.
  40981. * @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.
  40982. * @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.
  40983. * @property [dataSources = new DataSourceCollection()] - The collection of data sources visualized by the widget. If this parameter is provided,
  40984. the instance is assumed to be owned by the caller and will not be destroyed when the viewer is destroyed.
  40985. * @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.
  40986. * @property [shadows = false] - Determines if shadows are cast by light sources.
  40987. * @property [terrainShadows = ShadowMode.RECEIVE_ONLY] - Determines if the terrain casts or receives shadows from light sources.
  40988. * @property [mapMode2D = MapMode2D.INFINITE_SCROLL] - Determines if the 2D map is rotatable or can be scrolled infinitely in the horizontal direction.
  40989. * @property [projectionPicker = false] - If set to true, the ProjectionPicker widget will be created.
  40990. * @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}.
  40991. * @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}.
  40992. */
  40993. type ConstructorOptions = {
  40994. animation?: boolean;
  40995. baseLayerPicker?: boolean;
  40996. fullscreenButton?: boolean;
  40997. vrButton?: boolean;
  40998. geocoder?: boolean | GeocoderService[];
  40999. homeButton?: boolean;
  41000. infoBox?: boolean;
  41001. sceneModePicker?: boolean;
  41002. selectionIndicator?: boolean;
  41003. timeline?: boolean;
  41004. navigationHelpButton?: boolean;
  41005. navigationInstructionsInitiallyVisible?: boolean;
  41006. scene3DOnly?: boolean;
  41007. shouldAnimate?: boolean;
  41008. clockViewModel?: ClockViewModel;
  41009. selectedImageryProviderViewModel?: ProviderViewModel;
  41010. imageryProviderViewModels?: ProviderViewModel[];
  41011. selectedTerrainProviderViewModel?: ProviderViewModel;
  41012. terrainProviderViewModels?: ProviderViewModel[];
  41013. imageryProvider?: ImageryProvider;
  41014. terrainProvider?: TerrainProvider;
  41015. skyBox?: SkyBox | false;
  41016. skyAtmosphere?: SkyAtmosphere | false;
  41017. fullscreenElement?: Element | string;
  41018. useDefaultRenderLoop?: boolean;
  41019. targetFrameRate?: number;
  41020. showRenderLoopErrors?: boolean;
  41021. useBrowserRecommendedResolution?: boolean;
  41022. automaticallyTrackDataSourceClocks?: boolean;
  41023. contextOptions?: any;
  41024. sceneMode?: SceneMode;
  41025. mapProjection?: MapProjection;
  41026. globe?: Globe | false;
  41027. orderIndependentTranslucency?: boolean;
  41028. creditContainer?: Element | string;
  41029. creditViewport?: Element | string;
  41030. dataSources?: DataSourceCollection;
  41031. terrainExaggeration?: number;
  41032. shadows?: boolean;
  41033. terrainShadows?: ShadowMode;
  41034. mapMode2D?: MapMode2D;
  41035. projectionPicker?: boolean;
  41036. requestRenderMode?: boolean;
  41037. maximumRenderTimeChange?: number;
  41038. };
  41039. /**
  41040. * A function that augments a Viewer instance with additional functionality.
  41041. * @param viewer - The viewer instance.
  41042. * @param options - Options object to be passed to the mixin function.
  41043. */
  41044. type ViewerMixin = (viewer: Viewer, options: any) => void;
  41045. }
  41046. /**
  41047. * A base widget for building applications. It composites all of the standard Cesium widgets into one reusable package.
  41048. The widget can always be extended by using mixins, which add functionality useful for a variety of applications.
  41049. * @example
  41050. * //Initialize the viewer widget with several custom options and mixins.
  41051. var viewer = new Cesium.Viewer('cesiumContainer', {
  41052. //Start in Columbus Viewer
  41053. sceneMode : Cesium.SceneMode.COLUMBUS_VIEW,
  41054. //Use Cesium World Terrain
  41055. terrainProvider : Cesium.createWorldTerrain(),
  41056. //Hide the base layer picker
  41057. baseLayerPicker : false,
  41058. //Use OpenStreetMaps
  41059. imageryProvider : new Cesium.OpenStreetMapImageryProvider({
  41060. url : 'https://a.tile.openstreetmap.org/'
  41061. }),
  41062. skyBox : new Cesium.SkyBox({
  41063. sources : {
  41064. positiveX : 'stars/TychoSkymapII.t3_08192x04096_80_px.jpg',
  41065. negativeX : 'stars/TychoSkymapII.t3_08192x04096_80_mx.jpg',
  41066. positiveY : 'stars/TychoSkymapII.t3_08192x04096_80_py.jpg',
  41067. negativeY : 'stars/TychoSkymapII.t3_08192x04096_80_my.jpg',
  41068. positiveZ : 'stars/TychoSkymapII.t3_08192x04096_80_pz.jpg',
  41069. negativeZ : 'stars/TychoSkymapII.t3_08192x04096_80_mz.jpg'
  41070. }
  41071. }),
  41072. // Show Columbus View map with Web Mercator projection
  41073. mapProjection : new Cesium.WebMercatorProjection()
  41074. });
  41075. //Add basic drag and drop functionality
  41076. viewer.extend(Cesium.viewerDragDropMixin);
  41077. //Show a pop-up alert if we encounter an error when processing a dropped file
  41078. viewer.dropError.addEventListener(function(dropHandler, name, error) {
  41079. console.log(error);
  41080. window.alert(error);
  41081. });
  41082. * @param container - The DOM element or ID that will contain the widget.
  41083. * @param [options] - Object describing initialization options
  41084. */
  41085. export class Viewer {
  41086. constructor(container: Element | string, options?: Viewer.ConstructorOptions);
  41087. /**
  41088. * Gets the parent container.
  41089. */
  41090. readonly container: Element;
  41091. /**
  41092. * Gets the DOM element for the area at the bottom of the window containing the
  41093. {@link CreditDisplay} and potentially other things.
  41094. */
  41095. readonly bottomContainer: Element;
  41096. /**
  41097. * Gets the CesiumWidget.
  41098. */
  41099. readonly cesiumWidget: CesiumWidget;
  41100. /**
  41101. * Gets the selection indicator.
  41102. */
  41103. readonly selectionIndicator: SelectionIndicator;
  41104. /**
  41105. * Gets the info box.
  41106. */
  41107. readonly infoBox: InfoBox;
  41108. /**
  41109. * Gets the Geocoder.
  41110. */
  41111. readonly geocoder: Geocoder;
  41112. /**
  41113. * Gets the HomeButton.
  41114. */
  41115. readonly homeButton: HomeButton;
  41116. /**
  41117. * Gets the SceneModePicker.
  41118. */
  41119. readonly sceneModePicker: SceneModePicker;
  41120. /**
  41121. * Gets the ProjectionPicker.
  41122. */
  41123. readonly projectionPicker: ProjectionPicker;
  41124. /**
  41125. * Gets the BaseLayerPicker.
  41126. */
  41127. readonly baseLayerPicker: BaseLayerPicker;
  41128. /**
  41129. * Gets the NavigationHelpButton.
  41130. */
  41131. readonly navigationHelpButton: NavigationHelpButton;
  41132. /**
  41133. * Gets the Animation widget.
  41134. */
  41135. readonly animation: Animation;
  41136. /**
  41137. * Gets the Timeline widget.
  41138. */
  41139. readonly timeline: Timeline;
  41140. /**
  41141. * Gets the FullscreenButton.
  41142. */
  41143. readonly fullscreenButton: FullscreenButton;
  41144. /**
  41145. * Gets the VRButton.
  41146. */
  41147. readonly vrButton: VRButton;
  41148. /**
  41149. * Gets the display used for {@link DataSource} visualization.
  41150. */
  41151. readonly dataSourceDisplay: DataSourceDisplay;
  41152. /**
  41153. * Gets the collection of entities not tied to a particular data source.
  41154. This is a shortcut to [dataSourceDisplay.defaultDataSource.entities]{@link Viewer#dataSourceDisplay}.
  41155. */
  41156. readonly entities: EntityCollection;
  41157. /**
  41158. * Gets the set of {@link DataSource} instances to be visualized.
  41159. */
  41160. readonly dataSources: DataSourceCollection;
  41161. /**
  41162. * Gets the canvas.
  41163. */
  41164. readonly canvas: HTMLCanvasElement;
  41165. /**
  41166. * Gets the scene.
  41167. */
  41168. readonly scene: Scene;
  41169. /**
  41170. * Determines if shadows are cast by light sources.
  41171. */
  41172. shadows: boolean;
  41173. /**
  41174. * Determines if the terrain casts or shadows from light sources.
  41175. */
  41176. terrainShadows: ShadowMode;
  41177. /**
  41178. * Get the scene's shadow map
  41179. */
  41180. readonly shadowMap: ShadowMap;
  41181. /**
  41182. * Gets the collection of image layers that will be rendered on the globe.
  41183. */
  41184. readonly imageryLayers: ImageryLayerCollection;
  41185. /**
  41186. * The terrain provider providing surface geometry for the globe.
  41187. */
  41188. terrainProvider: TerrainProvider;
  41189. /**
  41190. * Gets the camera.
  41191. */
  41192. readonly camera: Camera;
  41193. /**
  41194. * Gets the post-process stages.
  41195. */
  41196. readonly postProcessStages: PostProcessStageCollection;
  41197. /**
  41198. * Gets the clock.
  41199. */
  41200. readonly clock: Clock;
  41201. /**
  41202. * Gets the clock view model.
  41203. */
  41204. readonly clockViewModel: ClockViewModel;
  41205. /**
  41206. * Gets the screen space event handler.
  41207. */
  41208. readonly screenSpaceEventHandler: ScreenSpaceEventHandler;
  41209. /**
  41210. * Gets or sets the target frame rate of the widget when <code>useDefaultRenderLoop</code>
  41211. is true. If undefined, the browser's {@link requestAnimationFrame} implementation
  41212. determines the frame rate. If defined, this value must be greater than 0. A value higher
  41213. than the underlying requestAnimationFrame implementation will have no effect.
  41214. */
  41215. targetFrameRate: number;
  41216. /**
  41217. * Gets or sets whether or not this widget should control the render loop.
  41218. If set to true the widget will use {@link requestAnimationFrame} to
  41219. perform rendering and resizing of the widget, as well as drive the
  41220. simulation clock. If set to false, you must manually call the
  41221. <code>resize</code>, <code>render</code> methods
  41222. as part of a custom render loop. If an error occurs during rendering, {@link Scene}'s
  41223. <code>renderError</code> event will be raised and this property
  41224. will be set to false. It must be set back to true to continue rendering
  41225. after the error.
  41226. */
  41227. useDefaultRenderLoop: boolean;
  41228. /**
  41229. * Gets or sets a scaling factor for rendering resolution. Values less than 1.0 can improve
  41230. performance on less powerful devices while values greater than 1.0 will render at a higher
  41231. resolution and then scale down, resulting in improved visual fidelity.
  41232. For example, if the widget is laid out at a size of 640x480, setting this value to 0.5
  41233. will cause the scene to be rendered at 320x240 and then scaled up while setting
  41234. it to 2.0 will cause the scene to be rendered at 1280x960 and then scaled down.
  41235. */
  41236. resolutionScale: number;
  41237. /**
  41238. * Boolean flag indicating if the browser's recommended resolution is used.
  41239. If true, the browser's device pixel ratio is ignored and 1.0 is used instead,
  41240. effectively rendering based on CSS pixels instead of device pixels. This can improve
  41241. performance on less powerful devices that have high pixel density. When false, rendering
  41242. will be in device pixels. {@link Viewer#resolutionScale} will still take effect whether
  41243. this flag is true or false.
  41244. */
  41245. useBrowserRecommendedResolution: boolean;
  41246. /**
  41247. * Gets or sets whether or not data sources can temporarily pause
  41248. animation in order to avoid showing an incomplete picture to the user.
  41249. For example, if asynchronous primitives are being processed in the
  41250. background, the clock will not advance until the geometry is ready.
  41251. */
  41252. allowDataSourcesToSuspendAnimation: boolean;
  41253. /**
  41254. * Gets or sets the Entity instance currently being tracked by the camera.
  41255. */
  41256. trackedEntity: Entity | undefined;
  41257. /**
  41258. * Gets or sets the object instance for which to display a selection indicator.
  41259. If a user interactively picks a Cesium3DTilesFeature instance, then this property
  41260. will contain a transient Entity instance with a property named "feature" that is
  41261. the instance that was picked.
  41262. */
  41263. selectedEntity: Entity | undefined;
  41264. /**
  41265. * Gets the event that is raised when the selected entity changes.
  41266. */
  41267. readonly selectedEntityChanged: Event;
  41268. /**
  41269. * Gets the event that is raised when the tracked entity changes.
  41270. */
  41271. readonly trackedEntityChanged: Event;
  41272. /**
  41273. * Gets or sets the data source to track with the viewer's clock.
  41274. */
  41275. clockTrackedDataSource: DataSource;
  41276. /**
  41277. * Extends the base viewer functionality with the provided mixin.
  41278. A mixin may add additional properties, functions, or other behavior
  41279. to the provided viewer instance.
  41280. * @param mixin - The Viewer mixin to add to this instance.
  41281. * @param [options] - The options object to be passed to the mixin function.
  41282. */
  41283. extend(mixin: Viewer.ViewerMixin, options?: any): void;
  41284. /**
  41285. * Resizes the widget to match the container size.
  41286. This function is called automatically as needed unless
  41287. <code>useDefaultRenderLoop</code> is set to false.
  41288. */
  41289. resize(): void;
  41290. /**
  41291. * This forces the widget to re-think its layout, including
  41292. widget sizes and credit placement.
  41293. */
  41294. forceResize(): void;
  41295. /**
  41296. * Renders the scene. This function is called automatically
  41297. unless <code>useDefaultRenderLoop</code> is set to false;
  41298. */
  41299. render(): void;
  41300. /**
  41301. * @returns true if the object has been destroyed, false otherwise.
  41302. */
  41303. isDestroyed(): boolean;
  41304. /**
  41305. * Destroys the widget. Should be called if permanently
  41306. removing the widget from layout.
  41307. */
  41308. destroy(): void;
  41309. /**
  41310. * Asynchronously sets the camera to view the provided entity, entities, or data source.
  41311. If the data source is still in the process of loading or the visualization is otherwise still loading,
  41312. this method waits for the data to be ready before performing the zoom.
  41313. <p>The offset is heading/pitch/range in the local east-north-up reference frame centered at the center of the bounding sphere.
  41314. The heading and the pitch angles are defined in the local east-north-up reference frame.
  41315. The heading is the angle from y axis and increasing towards the x axis. Pitch is the rotation from the xy-plane. Positive pitch
  41316. angles are above the plane. Negative pitch angles are below the plane. The range is the distance from the center. If the range is
  41317. zero, a range will be computed such that the whole bounding sphere is visible.</p>
  41318. <p>In 2D, there must be a top down view. The camera will be placed above the target looking down. The height above the
  41319. target will be the range. The heading will be determined from the offset. If the heading cannot be
  41320. determined from the offset, the heading will be north.</p>
  41321. * @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.
  41322. * @param [offset] - The offset from the center of the entity in the local east-north-up reference frame.
  41323. * @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.
  41324. */
  41325. zoomTo(target: Entity | Entity[] | EntityCollection | DataSource | ImageryLayer | Cesium3DTileset | TimeDynamicPointCloud | Promise<Entity | Entity[] | EntityCollection | DataSource | ImageryLayer | Cesium3DTileset | TimeDynamicPointCloud>, offset?: HeadingPitchRange): Promise<boolean>;
  41326. /**
  41327. * Flies the camera to the provided entity, entities, or data source.
  41328. If the data source is still in the process of loading or the visualization is otherwise still loading,
  41329. this method waits for the data to be ready before performing the flight.
  41330. <p>The offset is heading/pitch/range in the local east-north-up reference frame centered at the center of the bounding sphere.
  41331. The heading and the pitch angles are defined in the local east-north-up reference frame.
  41332. The heading is the angle from y axis and increasing towards the x axis. Pitch is the rotation from the xy-plane. Positive pitch
  41333. angles are above the plane. Negative pitch angles are below the plane. The range is the distance from the center. If the range is
  41334. zero, a range will be computed such that the whole bounding sphere is visible.</p>
  41335. <p>In 2D, there must be a top down view. The camera will be placed above the target looking down. The height above the
  41336. target will be the range. The heading will be determined from the offset. If the heading cannot be
  41337. determined from the offset, the heading will be north.</p>
  41338. * @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.
  41339. * @param [options] - Object with the following properties:
  41340. * @param [options.duration = 3.0] - The duration of the flight in seconds.
  41341. * @param [options.maximumHeight] - The maximum height at the peak of the flight.
  41342. * @param [options.offset] - The offset from the target in the local east-north-up reference frame centered at the target.
  41343. * @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
  41344. */
  41345. flyTo(target: Entity | Entity[] | EntityCollection | DataSource | ImageryLayer | Cesium3DTileset | TimeDynamicPointCloud | Promise<Entity | Entity[] | EntityCollection | DataSource | ImageryLayer | Cesium3DTileset | TimeDynamicPointCloud>, options?: {
  41346. duration?: number;
  41347. maximumHeight?: number;
  41348. offset?: HeadingPitchRange;
  41349. }): Promise<boolean>;
  41350. }
  41351. /**
  41352. * A mixin which adds the {@link Cesium3DTilesInspector} widget to the {@link Viewer} widget.
  41353. Rather than being called directly, this function is normally passed as
  41354. a parameter to {@link Viewer#extend}, as shown in the example below.
  41355. * @example
  41356. * var viewer = new Cesium.Viewer('cesiumContainer');
  41357. viewer.extend(Cesium.viewerCesium3DTilesInspectorMixin);
  41358. * @param viewer - The viewer instance.
  41359. */
  41360. export function viewerCesium3DTilesInspectorMixin(viewer: Viewer): void;
  41361. /**
  41362. * A mixin which adds the CesiumInspector widget to the Viewer widget.
  41363. Rather than being called directly, this function is normally passed as
  41364. a parameter to {@link Viewer#extend}, as shown in the example below.
  41365. * @example
  41366. * var viewer = new Cesium.Viewer('cesiumContainer');
  41367. viewer.extend(Cesium.viewerCesiumInspectorMixin);
  41368. * @param viewer - The viewer instance.
  41369. */
  41370. export function viewerCesiumInspectorMixin(viewer: Viewer): void;
  41371. /**
  41372. * A mixin which adds default drag and drop support for CZML files to the Viewer widget.
  41373. Rather than being called directly, this function is normally passed as
  41374. a parameter to {@link Viewer#extend}, as shown in the example below.
  41375. * @example
  41376. * // Add basic drag and drop support and pop up an alert window on error.
  41377. var viewer = new Cesium.Viewer('cesiumContainer');
  41378. viewer.extend(Cesium.viewerDragDropMixin);
  41379. viewer.dropError.addEventListener(function(viewerArg, source, error) {
  41380. window.alert('Error processing ' + source + ':' + error);
  41381. });
  41382. * @param viewer - The viewer instance.
  41383. * @param [options] - Object with the following properties:
  41384. * @param [options.dropTarget = viewer.container] - The DOM element which will serve as the drop target.
  41385. * @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.
  41386. * @param [options.flyToOnDrop = true] - When true, dropping files will fly to the data source once it is loaded.
  41387. * @param [options.clampToGround = true] - When true, datasources are clamped to the ground.
  41388. * @param [options.proxy] - The proxy to be used for KML network links.
  41389. */
  41390. export function viewerDragDropMixin(viewer: Viewer, options?: {
  41391. dropTarget?: Element | string;
  41392. clearOnDrop?: boolean;
  41393. flyToOnDrop?: boolean;
  41394. clampToGround?: boolean;
  41395. proxy?: Proxy;
  41396. }): void;
  41397. /**
  41398. * A mixin which adds the {@link PerformanceWatchdog} widget to the {@link Viewer} widget.
  41399. Rather than being called directly, this function is normally passed as
  41400. a parameter to {@link Viewer#extend}, as shown in the example below.
  41401. * @example
  41402. * var viewer = new Cesium.Viewer('cesiumContainer');
  41403. viewer.extend(Cesium.viewerPerformanceWatchdogMixin, {
  41404. lowFrameRateMessage : 'Why is this going so <em>slowly</em>?'
  41405. });
  41406. * @param viewer - The viewer instance.
  41407. * @param [options] - An object with properties.
  41408. * @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
  41409. message to display when a low frame rate is detected. The message is interpeted as HTML, so make sure
  41410. it comes from a trusted source so that your application is not vulnerable to cross-site scripting attacks.
  41411. */
  41412. export function viewerPerformanceWatchdogMixin(viewer: Viewer, options?: {
  41413. lowFrameRateMessage?: string;
  41414. }): void;
  41415. /**
  41416. * A single button widget for toggling vr mode.
  41417. * @param container - The DOM element or ID that will contain the widget.
  41418. * @param scene - The scene.
  41419. * @param [vrElement = document.body] - The element or id to be placed into vr mode.
  41420. */
  41421. export class VRButton {
  41422. constructor(container: Element | string, scene: Scene, vrElement?: Element | string);
  41423. /**
  41424. * Gets the parent container.
  41425. */
  41426. container: Element;
  41427. /**
  41428. * Gets the view model.
  41429. */
  41430. viewModel: VRButtonViewModel;
  41431. /**
  41432. * @returns true if the object has been destroyed, false otherwise.
  41433. */
  41434. isDestroyed(): boolean;
  41435. /**
  41436. * Destroys the widget. Should be called if permanently
  41437. removing the widget from layout.
  41438. */
  41439. destroy(): void;
  41440. }
  41441. /**
  41442. * The view model for {@link VRButton}.
  41443. * @param scene - The scene.
  41444. * @param [vrElement = document.body] - The element or id to be placed into VR mode.
  41445. */
  41446. export class VRButtonViewModel {
  41447. constructor(scene: Scene, vrElement?: Element | string);
  41448. /**
  41449. * Gets whether or not VR mode is active.
  41450. */
  41451. isVRMode: boolean;
  41452. /**
  41453. * Gets or sets whether or not VR functionality should be enabled.
  41454. */
  41455. isVREnabled: boolean;
  41456. /**
  41457. * Gets the tooltip. This property is observable.
  41458. */
  41459. tooltip: string;
  41460. /**
  41461. * Gets or sets the HTML element to place into VR mode when the
  41462. corresponding button is pressed.
  41463. */
  41464. vrElement: Element;
  41465. /**
  41466. * Gets the Command to toggle VR mode.
  41467. */
  41468. command: Command;
  41469. /**
  41470. * @returns true if the object has been destroyed, false otherwise.
  41471. */
  41472. isDestroyed(): boolean;
  41473. /**
  41474. * Destroys the view model. Should be called to
  41475. properly clean up the view model when it is no longer needed.
  41476. */
  41477. destroy(): void;
  41478. }
  41479. }
  41480. declare module "cesium/Source/Core/ArcGISTiledElevationTerrainProvider" { import { ArcGISTiledElevationTerrainProvider } from 'cesium'; export default ArcGISTiledElevationTerrainProvider; }
  41481. declare module "cesium/Source/Core/ArcType" { import { ArcType } from 'cesium'; export default ArcType; }
  41482. declare module "cesium/Source/Core/AssociativeArray" { import { AssociativeArray } from 'cesium'; export default AssociativeArray; }
  41483. declare module "cesium/Source/Core/AxisAlignedBoundingBox" { import { AxisAlignedBoundingBox } from 'cesium'; export default AxisAlignedBoundingBox; }
  41484. declare module "cesium/Source/Core/barycentricCoordinates" { import { barycentricCoordinates } from 'cesium'; export default barycentricCoordinates; }
  41485. declare module "cesium/Source/Core/binarySearch" { import { binarySearch } from 'cesium'; export default binarySearch; }
  41486. declare module "cesium/Source/Core/BingMapsGeocoderService" { import { BingMapsGeocoderService } from 'cesium'; export default BingMapsGeocoderService; }
  41487. declare module "cesium/Source/Core/BoundingRectangle" { import { BoundingRectangle } from 'cesium'; export default BoundingRectangle; }
  41488. declare module "cesium/Source/Core/BoundingSphere" { import { BoundingSphere } from 'cesium'; export default BoundingSphere; }
  41489. declare module "cesium/Source/Core/BoxGeometry" { import { BoxGeometry } from 'cesium'; export default BoxGeometry; }
  41490. declare module "cesium/Source/Core/BoxOutlineGeometry" { import { BoxOutlineGeometry } from 'cesium'; export default BoxOutlineGeometry; }
  41491. declare module "cesium/Source/Core/buildModuleUrl" { import { buildModuleUrl } from 'cesium'; export default buildModuleUrl; }
  41492. declare module "cesium/Source/Core/cancelAnimationFrame" { import { cancelAnimationFrame } from 'cesium'; export default cancelAnimationFrame; }
  41493. declare module "cesium/Source/Core/Cartesian2" { import { Cartesian2 } from 'cesium'; export default Cartesian2; }
  41494. declare module "cesium/Source/Core/Cartesian3" { import { Cartesian3 } from 'cesium'; export default Cartesian3; }
  41495. declare module "cesium/Source/Core/Cartesian4" { import { Cartesian4 } from 'cesium'; export default Cartesian4; }
  41496. declare module "cesium/Source/Core/Cartographic" { import { Cartographic } from 'cesium'; export default Cartographic; }
  41497. declare module "cesium/Source/Core/CartographicGeocoderService" { import { CartographicGeocoderService } from 'cesium'; export default CartographicGeocoderService; }
  41498. declare module "cesium/Source/Core/CatmullRomSpline" { import { CatmullRomSpline } from 'cesium'; export default CatmullRomSpline; }
  41499. declare module "cesium/Source/Core/CesiumTerrainProvider" { import { CesiumTerrainProvider } from 'cesium'; export default CesiumTerrainProvider; }
  41500. declare module "cesium/Source/Core/CircleGeometry" { import { CircleGeometry } from 'cesium'; export default CircleGeometry; }
  41501. declare module "cesium/Source/Core/CircleOutlineGeometry" { import { CircleOutlineGeometry } from 'cesium'; export default CircleOutlineGeometry; }
  41502. declare module "cesium/Source/Core/Clock" { import { Clock } from 'cesium'; export default Clock; }
  41503. declare module "cesium/Source/Core/ClockRange" { import { ClockRange } from 'cesium'; export default ClockRange; }
  41504. declare module "cesium/Source/Core/ClockStep" { import { ClockStep } from 'cesium'; export default ClockStep; }
  41505. declare module "cesium/Source/Core/clone" { import { clone } from 'cesium'; export default clone; }
  41506. declare module "cesium/Source/Core/Color" { import { Color } from 'cesium'; export default Color; }
  41507. declare module "cesium/Source/Core/ColorGeometryInstanceAttribute" { import { ColorGeometryInstanceAttribute } from 'cesium'; export default ColorGeometryInstanceAttribute; }
  41508. declare module "cesium/Source/Core/combine" { import { combine } from 'cesium'; export default combine; }
  41509. declare module "cesium/Source/Core/ComponentDatatype" { import { ComponentDatatype } from 'cesium'; export default ComponentDatatype; }
  41510. declare module "cesium/Source/Core/CompressedTextureBuffer" { import { CompressedTextureBuffer } from 'cesium'; export default CompressedTextureBuffer; }
  41511. declare module "cesium/Source/Core/CoplanarPolygonGeometry" { import { CoplanarPolygonGeometry } from 'cesium'; export default CoplanarPolygonGeometry; }
  41512. declare module "cesium/Source/Core/CoplanarPolygonOutlineGeometry" { import { CoplanarPolygonOutlineGeometry } from 'cesium'; export default CoplanarPolygonOutlineGeometry; }
  41513. declare module "cesium/Source/Core/CornerType" { import { CornerType } from 'cesium'; export default CornerType; }
  41514. declare module "cesium/Source/Core/CorridorGeometry" { import { CorridorGeometry } from 'cesium'; export default CorridorGeometry; }
  41515. declare module "cesium/Source/Core/CorridorOutlineGeometry" { import { CorridorOutlineGeometry } from 'cesium'; export default CorridorOutlineGeometry; }
  41516. declare module "cesium/Source/Core/createGuid" { import { createGuid } from 'cesium'; export default createGuid; }
  41517. declare module "cesium/Source/Core/createWorldTerrain" { import { createWorldTerrain } from 'cesium'; export default createWorldTerrain; }
  41518. declare module "cesium/Source/Core/Credit" { import { Credit } from 'cesium'; export default Credit; }
  41519. declare module "cesium/Source/Core/CubicRealPolynomial" { import { CubicRealPolynomial } from 'cesium'; export default CubicRealPolynomial; }
  41520. declare module "cesium/Source/Core/CullingVolume" { import { CullingVolume } from 'cesium'; export default CullingVolume; }
  41521. declare module "cesium/Source/Core/CylinderGeometry" { import { CylinderGeometry } from 'cesium'; export default CylinderGeometry; }
  41522. declare module "cesium/Source/Core/CylinderOutlineGeometry" { import { CylinderOutlineGeometry } from 'cesium'; export default CylinderOutlineGeometry; }
  41523. declare module "cesium/Source/Core/DefaultProxy" { import { DefaultProxy } from 'cesium'; export default DefaultProxy; }
  41524. declare module "cesium/Source/Core/defaultValue" { import { defaultValue } from 'cesium'; export default defaultValue; }
  41525. declare module "cesium/Source/Core/defined" { import { defined } from 'cesium'; export default defined; }
  41526. declare module "cesium/Source/Core/destroyObject" { import { destroyObject } from 'cesium'; export default destroyObject; }
  41527. declare module "cesium/Source/Core/DeveloperError" { import { DeveloperError } from 'cesium'; export default DeveloperError; }
  41528. declare module "cesium/Source/Core/DistanceDisplayCondition" { import { DistanceDisplayCondition } from 'cesium'; export default DistanceDisplayCondition; }
  41529. declare module "cesium/Source/Core/DistanceDisplayConditionGeometryInstanceAttribute" { import { DistanceDisplayConditionGeometryInstanceAttribute } from 'cesium'; export default DistanceDisplayConditionGeometryInstanceAttribute; }
  41530. declare module "cesium/Source/Core/EasingFunction" { import { EasingFunction } from 'cesium'; export default EasingFunction; }
  41531. declare module "cesium/Source/Core/EllipseGeometry" { import { EllipseGeometry } from 'cesium'; export default EllipseGeometry; }
  41532. declare module "cesium/Source/Core/EllipseOutlineGeometry" { import { EllipseOutlineGeometry } from 'cesium'; export default EllipseOutlineGeometry; }
  41533. declare module "cesium/Source/Core/Ellipsoid" { import { Ellipsoid } from 'cesium'; export default Ellipsoid; }
  41534. declare module "cesium/Source/Core/EllipsoidGeodesic" { import { EllipsoidGeodesic } from 'cesium'; export default EllipsoidGeodesic; }
  41535. declare module "cesium/Source/Core/EllipsoidGeometry" { import { EllipsoidGeometry } from 'cesium'; export default EllipsoidGeometry; }
  41536. declare module "cesium/Source/Core/EllipsoidOutlineGeometry" { import { EllipsoidOutlineGeometry } from 'cesium'; export default EllipsoidOutlineGeometry; }
  41537. declare module "cesium/Source/Core/EllipsoidRhumbLine" { import { EllipsoidRhumbLine } from 'cesium'; export default EllipsoidRhumbLine; }
  41538. declare module "cesium/Source/Core/EllipsoidTangentPlane" { import { EllipsoidTangentPlane } from 'cesium'; export default EllipsoidTangentPlane; }
  41539. declare module "cesium/Source/Core/EllipsoidTerrainProvider" { import { EllipsoidTerrainProvider } from 'cesium'; export default EllipsoidTerrainProvider; }
  41540. declare module "cesium/Source/Core/Event" { import { Event } from 'cesium'; export default Event; }
  41541. declare module "cesium/Source/Core/EventHelper" { import { EventHelper } from 'cesium'; export default EventHelper; }
  41542. declare module "cesium/Source/Core/ExtrapolationType" { import { ExtrapolationType } from 'cesium'; export default ExtrapolationType; }
  41543. declare module "cesium/Source/Core/FeatureDetection" { import { FeatureDetection } from 'cesium'; export default FeatureDetection; }
  41544. declare module "cesium/Source/Core/formatError" { import { formatError } from 'cesium'; export default formatError; }
  41545. declare module "cesium/Source/Core/FrustumGeometry" { import { FrustumGeometry } from 'cesium'; export default FrustumGeometry; }
  41546. declare module "cesium/Source/Core/FrustumOutlineGeometry" { import { FrustumOutlineGeometry } from 'cesium'; export default FrustumOutlineGeometry; }
  41547. declare module "cesium/Source/Core/Fullscreen" { import { Fullscreen } from 'cesium'; export default Fullscreen; }
  41548. declare module "cesium/Source/Core/GeocoderService" { import { GeocoderService } from 'cesium'; export default GeocoderService; }
  41549. declare module "cesium/Source/Core/GeocodeType" { import { GeocodeType } from 'cesium'; export default GeocodeType; }
  41550. declare module "cesium/Source/Core/GeographicProjection" { import { GeographicProjection } from 'cesium'; export default GeographicProjection; }
  41551. declare module "cesium/Source/Core/GeographicTilingScheme" { import { GeographicTilingScheme } from 'cesium'; export default GeographicTilingScheme; }
  41552. declare module "cesium/Source/Core/Geometry" { import { Geometry } from 'cesium'; export default Geometry; }
  41553. declare module "cesium/Source/Core/GeometryAttribute" { import { GeometryAttribute } from 'cesium'; export default GeometryAttribute; }
  41554. declare module "cesium/Source/Core/GeometryAttributes" { import { GeometryAttributes } from 'cesium'; export default GeometryAttributes; }
  41555. declare module "cesium/Source/Core/GeometryFactory" { import { GeometryFactory } from 'cesium'; export default GeometryFactory; }
  41556. declare module "cesium/Source/Core/GeometryInstance" { import { GeometryInstance } from 'cesium'; export default GeometryInstance; }
  41557. declare module "cesium/Source/Core/GeometryInstanceAttribute" { import { GeometryInstanceAttribute } from 'cesium'; export default GeometryInstanceAttribute; }
  41558. declare module "cesium/Source/Core/GeometryPipeline" { import { GeometryPipeline } from 'cesium'; export default GeometryPipeline; }
  41559. declare module "cesium/Source/Core/getAbsoluteUri" { import { getAbsoluteUri } from 'cesium'; export default getAbsoluteUri; }
  41560. declare module "cesium/Source/Core/getBaseUri" { import { getBaseUri } from 'cesium'; export default getBaseUri; }
  41561. declare module "cesium/Source/Core/getExtensionFromUri" { import { getExtensionFromUri } from 'cesium'; export default getExtensionFromUri; }
  41562. declare module "cesium/Source/Core/getFilenameFromUri" { import { getFilenameFromUri } from 'cesium'; export default getFilenameFromUri; }
  41563. declare module "cesium/Source/Core/getImagePixels" { import { getImagePixels } from 'cesium'; export default getImagePixels; }
  41564. declare module "cesium/Source/Core/getTimestamp" { import { getTimestamp } from 'cesium'; export default getTimestamp; }
  41565. declare module "cesium/Source/Core/GoogleEarthEnterpriseMetadata" { import { GoogleEarthEnterpriseMetadata } from 'cesium'; export default GoogleEarthEnterpriseMetadata; }
  41566. declare module "cesium/Source/Core/GoogleEarthEnterpriseTerrainData" { import { GoogleEarthEnterpriseTerrainData } from 'cesium'; export default GoogleEarthEnterpriseTerrainData; }
  41567. declare module "cesium/Source/Core/GoogleEarthEnterpriseTerrainProvider" { import { GoogleEarthEnterpriseTerrainProvider } from 'cesium'; export default GoogleEarthEnterpriseTerrainProvider; }
  41568. declare module "cesium/Source/Core/GregorianDate" { import { GregorianDate } from 'cesium'; export default GregorianDate; }
  41569. declare module "cesium/Source/Core/GroundPolylineGeometry" { import { GroundPolylineGeometry } from 'cesium'; export default GroundPolylineGeometry; }
  41570. declare module "cesium/Source/Core/HeadingPitchRange" { import { HeadingPitchRange } from 'cesium'; export default HeadingPitchRange; }
  41571. declare module "cesium/Source/Core/HeadingPitchRoll" { import { HeadingPitchRoll } from 'cesium'; export default HeadingPitchRoll; }
  41572. declare module "cesium/Source/Core/HeightmapEncoding" { import { HeightmapEncoding } from 'cesium'; export default HeightmapEncoding; }
  41573. declare module "cesium/Source/Core/HeightmapTerrainData" { import { HeightmapTerrainData } from 'cesium'; export default HeightmapTerrainData; }
  41574. declare module "cesium/Source/Core/HermitePolynomialApproximation" { import { HermitePolynomialApproximation } from 'cesium'; export default HermitePolynomialApproximation; }
  41575. declare module "cesium/Source/Core/HermiteSpline" { import { HermiteSpline } from 'cesium'; export default HermiteSpline; }
  41576. declare module "cesium/Source/Core/IndexDatatype" { import { IndexDatatype } from 'cesium'; export default IndexDatatype; }
  41577. declare module "cesium/Source/Core/InterpolationAlgorithm" { import { InterpolationAlgorithm } from 'cesium'; export default InterpolationAlgorithm; }
  41578. declare module "cesium/Source/Core/Intersect" { import { Intersect } from 'cesium'; export default Intersect; }
  41579. declare module "cesium/Source/Core/Intersections2D" { import { Intersections2D } from 'cesium'; export default Intersections2D; }
  41580. declare module "cesium/Source/Core/IntersectionTests" { import { IntersectionTests } from 'cesium'; export default IntersectionTests; }
  41581. declare module "cesium/Source/Core/Interval" { import { Interval } from 'cesium'; export default Interval; }
  41582. declare module "cesium/Source/Core/Ion" { import { Ion } from 'cesium'; export default Ion; }
  41583. declare module "cesium/Source/Core/IonGeocoderService" { import { IonGeocoderService } from 'cesium'; export default IonGeocoderService; }
  41584. declare module "cesium/Source/Core/IonResource" { import { IonResource } from 'cesium'; export default IonResource; }
  41585. declare module "cesium/Source/Core/isLeapYear" { import { isLeapYear } from 'cesium'; export default isLeapYear; }
  41586. declare module "cesium/Source/Core/Iso8601" { import { Iso8601 } from 'cesium'; export default Iso8601; }
  41587. declare module "cesium/Source/Core/JulianDate" { import { JulianDate } from 'cesium'; export default JulianDate; }
  41588. declare module "cesium/Source/Core/KeyboardEventModifier" { import { KeyboardEventModifier } from 'cesium'; export default KeyboardEventModifier; }
  41589. declare module "cesium/Source/Core/LagrangePolynomialApproximation" { import { LagrangePolynomialApproximation } from 'cesium'; export default LagrangePolynomialApproximation; }
  41590. declare module "cesium/Source/Core/LeapSecond" { import { LeapSecond } from 'cesium'; export default LeapSecond; }
  41591. declare module "cesium/Source/Core/LinearApproximation" { import { LinearApproximation } from 'cesium'; export default LinearApproximation; }
  41592. declare module "cesium/Source/Core/LinearSpline" { import { LinearSpline } from 'cesium'; export default LinearSpline; }
  41593. declare module "cesium/Source/Core/loadBASIS" { import { loadBASIS } from 'cesium'; export default loadBASIS; }
  41594. declare module "cesium/Source/Core/loadCRN" { import { loadCRN } from 'cesium'; export default loadCRN; }
  41595. declare module "cesium/Source/Core/loadKTX" { import { loadKTX } from 'cesium'; export default loadKTX; }
  41596. declare module "cesium/Source/Core/MapProjection" { import { MapProjection } from 'cesium'; export default MapProjection; }
  41597. declare module "cesium/Source/Core/Math" { import { Math } from 'cesium'; export default Math; }
  41598. declare module "cesium/Source/Core/Matrix2" { import { Matrix2 } from 'cesium'; export default Matrix2; }
  41599. declare module "cesium/Source/Core/Matrix3" { import { Matrix3 } from 'cesium'; export default Matrix3; }
  41600. declare module "cesium/Source/Core/Matrix4" { import { Matrix4 } from 'cesium'; export default Matrix4; }
  41601. declare module "cesium/Source/Core/mergeSort" { import { mergeSort } from 'cesium'; export default mergeSort; }
  41602. declare module "cesium/Source/Core/NearFarScalar" { import { NearFarScalar } from 'cesium'; export default NearFarScalar; }
  41603. declare module "cesium/Source/Core/objectToQuery" { import { objectToQuery } from 'cesium'; export default objectToQuery; }
  41604. declare module "cesium/Source/Core/Occluder" { import { Occluder } from 'cesium'; export default Occluder; }
  41605. declare module "cesium/Source/Core/OpenCageGeocoderService" { import { OpenCageGeocoderService } from 'cesium'; export default OpenCageGeocoderService; }
  41606. declare module "cesium/Source/Core/OrientedBoundingBox" { import { OrientedBoundingBox } from 'cesium'; export default OrientedBoundingBox; }
  41607. declare module "cesium/Source/Core/OrthographicFrustum" { import { OrthographicFrustum } from 'cesium'; export default OrthographicFrustum; }
  41608. declare module "cesium/Source/Core/OrthographicOffCenterFrustum" { import { OrthographicOffCenterFrustum } from 'cesium'; export default OrthographicOffCenterFrustum; }
  41609. declare module "cesium/Source/Core/Packable" { import { Packable } from 'cesium'; export default Packable; }
  41610. declare module "cesium/Source/Core/PackableForInterpolation" { import { PackableForInterpolation } from 'cesium'; export default PackableForInterpolation; }
  41611. declare module "cesium/Source/Core/PeliasGeocoderService" { import { PeliasGeocoderService } from 'cesium'; export default PeliasGeocoderService; }
  41612. declare module "cesium/Source/Core/PerspectiveFrustum" { import { PerspectiveFrustum } from 'cesium'; export default PerspectiveFrustum; }
  41613. declare module "cesium/Source/Core/PerspectiveOffCenterFrustum" { import { PerspectiveOffCenterFrustum } from 'cesium'; export default PerspectiveOffCenterFrustum; }
  41614. declare module "cesium/Source/Core/PinBuilder" { import { PinBuilder } from 'cesium'; export default PinBuilder; }
  41615. declare module "cesium/Source/Core/PixelFormat" { import { PixelFormat } from 'cesium'; export default PixelFormat; }
  41616. declare module "cesium/Source/Core/Plane" { import { Plane } from 'cesium'; export default Plane; }
  41617. declare module "cesium/Source/Core/PlaneGeometry" { import { PlaneGeometry } from 'cesium'; export default PlaneGeometry; }
  41618. declare module "cesium/Source/Core/PlaneOutlineGeometry" { import { PlaneOutlineGeometry } from 'cesium'; export default PlaneOutlineGeometry; }
  41619. declare module "cesium/Source/Core/pointInsideTriangle" { import { pointInsideTriangle } from 'cesium'; export default pointInsideTriangle; }
  41620. declare module "cesium/Source/Core/PolygonGeometry" { import { PolygonGeometry } from 'cesium'; export default PolygonGeometry; }
  41621. declare module "cesium/Source/Core/PolygonHierarchy" { import { PolygonHierarchy } from 'cesium'; export default PolygonHierarchy; }
  41622. declare module "cesium/Source/Core/PolygonOutlineGeometry" { import { PolygonOutlineGeometry } from 'cesium'; export default PolygonOutlineGeometry; }
  41623. declare module "cesium/Source/Core/PolylineGeometry" { import { PolylineGeometry } from 'cesium'; export default PolylineGeometry; }
  41624. declare module "cesium/Source/Core/PolylineVolumeGeometry" { import { PolylineVolumeGeometry } from 'cesium'; export default PolylineVolumeGeometry; }
  41625. declare module "cesium/Source/Core/PolylineVolumeOutlineGeometry" { import { PolylineVolumeOutlineGeometry } from 'cesium'; export default PolylineVolumeOutlineGeometry; }
  41626. declare module "cesium/Source/Core/PrimitiveType" { import { PrimitiveType } from 'cesium'; export default PrimitiveType; }
  41627. declare module "cesium/Source/Core/Proxy" { import { Proxy } from 'cesium'; export default Proxy; }
  41628. declare module "cesium/Source/Core/QuadraticRealPolynomial" { import { QuadraticRealPolynomial } from 'cesium'; export default QuadraticRealPolynomial; }
  41629. declare module "cesium/Source/Core/QuantizedMeshTerrainData" { import { QuantizedMeshTerrainData } from 'cesium'; export default QuantizedMeshTerrainData; }
  41630. declare module "cesium/Source/Core/QuarticRealPolynomial" { import { QuarticRealPolynomial } from 'cesium'; export default QuarticRealPolynomial; }
  41631. declare module "cesium/Source/Core/Quaternion" { import { Quaternion } from 'cesium'; export default Quaternion; }
  41632. declare module "cesium/Source/Core/QuaternionSpline" { import { QuaternionSpline } from 'cesium'; export default QuaternionSpline; }
  41633. declare module "cesium/Source/Core/queryToObject" { import { queryToObject } from 'cesium'; export default queryToObject; }
  41634. declare module "cesium/Source/Core/Queue" { import { Queue } from 'cesium'; export default Queue; }
  41635. declare module "cesium/Source/Core/Ray" { import { Ray } from 'cesium'; export default Ray; }
  41636. declare module "cesium/Source/Core/Rectangle" { import { Rectangle } from 'cesium'; export default Rectangle; }
  41637. declare module "cesium/Source/Core/RectangleGeometry" { import { RectangleGeometry } from 'cesium'; export default RectangleGeometry; }
  41638. declare module "cesium/Source/Core/RectangleOutlineGeometry" { import { RectangleOutlineGeometry } from 'cesium'; export default RectangleOutlineGeometry; }
  41639. declare module "cesium/Source/Core/ReferenceFrame" { import { ReferenceFrame } from 'cesium'; export default ReferenceFrame; }
  41640. declare module "cesium/Source/Core/Request" { import { Request } from 'cesium'; export default Request; }
  41641. declare module "cesium/Source/Core/requestAnimationFrame" { import { requestAnimationFrame } from 'cesium'; export default requestAnimationFrame; }
  41642. declare module "cesium/Source/Core/RequestErrorEvent" { import { RequestErrorEvent } from 'cesium'; export default RequestErrorEvent; }
  41643. declare module "cesium/Source/Core/RequestScheduler" { import { RequestScheduler } from 'cesium'; export default RequestScheduler; }
  41644. declare module "cesium/Source/Core/RequestState" { import { RequestState } from 'cesium'; export default RequestState; }
  41645. declare module "cesium/Source/Core/RequestType" { import { RequestType } from 'cesium'; export default RequestType; }
  41646. declare module "cesium/Source/Core/Resource" { import { Resource } from 'cesium'; export default Resource; }
  41647. declare module "cesium/Source/Core/RuntimeError" { import { RuntimeError } from 'cesium'; export default RuntimeError; }
  41648. declare module "cesium/Source/Core/sampleTerrain" { import { sampleTerrain } from 'cesium'; export default sampleTerrain; }
  41649. declare module "cesium/Source/Core/sampleTerrainMostDetailed" { import { sampleTerrainMostDetailed } from 'cesium'; export default sampleTerrainMostDetailed; }
  41650. declare module "cesium/Source/Core/ScreenSpaceEventHandler" { import { ScreenSpaceEventHandler } from 'cesium'; export default ScreenSpaceEventHandler; }
  41651. declare module "cesium/Source/Core/ScreenSpaceEventType" { import { ScreenSpaceEventType } from 'cesium'; export default ScreenSpaceEventType; }
  41652. declare module "cesium/Source/Core/ShowGeometryInstanceAttribute" { import { ShowGeometryInstanceAttribute } from 'cesium'; export default ShowGeometryInstanceAttribute; }
  41653. declare module "cesium/Source/Core/Simon1994PlanetaryPositions" { import { Simon1994PlanetaryPositions } from 'cesium'; export default Simon1994PlanetaryPositions; }
  41654. declare module "cesium/Source/Core/SimplePolylineGeometry" { import { SimplePolylineGeometry } from 'cesium'; export default SimplePolylineGeometry; }
  41655. declare module "cesium/Source/Core/SphereGeometry" { import { SphereGeometry } from 'cesium'; export default SphereGeometry; }
  41656. declare module "cesium/Source/Core/SphereOutlineGeometry" { import { SphereOutlineGeometry } from 'cesium'; export default SphereOutlineGeometry; }
  41657. declare module "cesium/Source/Core/Spherical" { import { Spherical } from 'cesium'; export default Spherical; }
  41658. declare module "cesium/Source/Core/Spline" { import { Spline } from 'cesium'; export default Spline; }
  41659. declare module "cesium/Source/Core/subdivideArray" { import { subdivideArray } from 'cesium'; export default subdivideArray; }
  41660. declare module "cesium/Source/Core/TaskProcessor" { import { TaskProcessor } from 'cesium'; export default TaskProcessor; }
  41661. declare module "cesium/Source/Core/TerrainData" { import { TerrainData } from 'cesium'; export default TerrainData; }
  41662. declare module "cesium/Source/Core/TerrainProvider" { import { TerrainProvider } from 'cesium'; export default TerrainProvider; }
  41663. declare module "cesium/Source/Core/TileAvailability" { import { TileAvailability } from 'cesium'; export default TileAvailability; }
  41664. declare module "cesium/Source/Core/TileProviderError" { import { TileProviderError } from 'cesium'; export default TileProviderError; }
  41665. declare module "cesium/Source/Core/TilingScheme" { import { TilingScheme } from 'cesium'; export default TilingScheme; }
  41666. declare module "cesium/Source/Core/TimeInterval" { import { TimeInterval } from 'cesium'; export default TimeInterval; }
  41667. declare module "cesium/Source/Core/TimeIntervalCollection" { import { TimeIntervalCollection } from 'cesium'; export default TimeIntervalCollection; }
  41668. declare module "cesium/Source/Core/TimeStandard" { import { TimeStandard } from 'cesium'; export default TimeStandard; }
  41669. declare module "cesium/Source/Core/Transforms" { import { Transforms } from 'cesium'; export default Transforms; }
  41670. declare module "cesium/Source/Core/TranslationRotationScale" { import { TranslationRotationScale } from 'cesium'; export default TranslationRotationScale; }
  41671. declare module "cesium/Source/Core/TridiagonalSystemSolver" { import { TridiagonalSystemSolver } from 'cesium'; export default TridiagonalSystemSolver; }
  41672. declare module "cesium/Source/Core/TrustedServers" { import { TrustedServers } from 'cesium'; export default TrustedServers; }
  41673. declare module "cesium/Source/Core/VertexFormat" { import { VertexFormat } from 'cesium'; export default VertexFormat; }
  41674. declare module "cesium/Source/Core/VideoSynchronizer" { import { VideoSynchronizer } from 'cesium'; export default VideoSynchronizer; }
  41675. declare module "cesium/Source/Core/Visibility" { import { Visibility } from 'cesium'; export default Visibility; }
  41676. declare module "cesium/Source/Core/VRTheWorldTerrainProvider" { import { VRTheWorldTerrainProvider } from 'cesium'; export default VRTheWorldTerrainProvider; }
  41677. declare module "cesium/Source/Core/WallGeometry" { import { WallGeometry } from 'cesium'; export default WallGeometry; }
  41678. declare module "cesium/Source/Core/WallOutlineGeometry" { import { WallOutlineGeometry } from 'cesium'; export default WallOutlineGeometry; }
  41679. declare module "cesium/Source/Core/WebGLConstants" { import { WebGLConstants } from 'cesium'; export default WebGLConstants; }
  41680. declare module "cesium/Source/Core/WebMercatorProjection" { import { WebMercatorProjection } from 'cesium'; export default WebMercatorProjection; }
  41681. declare module "cesium/Source/Core/WebMercatorTilingScheme" { import { WebMercatorTilingScheme } from 'cesium'; export default WebMercatorTilingScheme; }
  41682. declare module "cesium/Source/Core/WeightSpline" { import { WeightSpline } from 'cesium'; export default WeightSpline; }
  41683. declare module "cesium/Source/Core/WindingOrder" { import { WindingOrder } from 'cesium'; export default WindingOrder; }
  41684. declare module "cesium/Source/Core/writeTextToCanvas" { import { writeTextToCanvas } from 'cesium'; export default writeTextToCanvas; }
  41685. declare module "cesium/Source/DataSources/BillboardGraphics" { import { BillboardGraphics } from 'cesium'; export default BillboardGraphics; }
  41686. declare module "cesium/Source/DataSources/BillboardVisualizer" { import { BillboardVisualizer } from 'cesium'; export default BillboardVisualizer; }
  41687. declare module "cesium/Source/DataSources/BoxGeometryUpdater" { import { BoxGeometryUpdater } from 'cesium'; export default BoxGeometryUpdater; }
  41688. declare module "cesium/Source/DataSources/BoxGraphics" { import { BoxGraphics } from 'cesium'; export default BoxGraphics; }
  41689. declare module "cesium/Source/DataSources/CallbackProperty" { import { CallbackProperty } from 'cesium'; export default CallbackProperty; }
  41690. declare module "cesium/Source/DataSources/Cesium3DTilesetGraphics" { import { Cesium3DTilesetGraphics } from 'cesium'; export default Cesium3DTilesetGraphics; }
  41691. declare module "cesium/Source/DataSources/Cesium3DTilesetVisualizer" { import { Cesium3DTilesetVisualizer } from 'cesium'; export default Cesium3DTilesetVisualizer; }
  41692. declare module "cesium/Source/DataSources/CheckerboardMaterialProperty" { import { CheckerboardMaterialProperty } from 'cesium'; export default CheckerboardMaterialProperty; }
  41693. declare module "cesium/Source/DataSources/ColorMaterialProperty" { import { ColorMaterialProperty } from 'cesium'; export default ColorMaterialProperty; }
  41694. declare module "cesium/Source/DataSources/CompositeEntityCollection" { import { CompositeEntityCollection } from 'cesium'; export default CompositeEntityCollection; }
  41695. declare module "cesium/Source/DataSources/CompositeMaterialProperty" { import { CompositeMaterialProperty } from 'cesium'; export default CompositeMaterialProperty; }
  41696. declare module "cesium/Source/DataSources/CompositePositionProperty" { import { CompositePositionProperty } from 'cesium'; export default CompositePositionProperty; }
  41697. declare module "cesium/Source/DataSources/CompositeProperty" { import { CompositeProperty } from 'cesium'; export default CompositeProperty; }
  41698. declare module "cesium/Source/DataSources/ConstantPositionProperty" { import { ConstantPositionProperty } from 'cesium'; export default ConstantPositionProperty; }
  41699. declare module "cesium/Source/DataSources/ConstantProperty" { import { ConstantProperty } from 'cesium'; export default ConstantProperty; }
  41700. declare module "cesium/Source/DataSources/CorridorGeometryUpdater" { import { CorridorGeometryUpdater } from 'cesium'; export default CorridorGeometryUpdater; }
  41701. declare module "cesium/Source/DataSources/CorridorGraphics" { import { CorridorGraphics } from 'cesium'; export default CorridorGraphics; }
  41702. declare module "cesium/Source/DataSources/CustomDataSource" { import { CustomDataSource } from 'cesium'; export default CustomDataSource; }
  41703. declare module "cesium/Source/DataSources/CylinderGeometryUpdater" { import { CylinderGeometryUpdater } from 'cesium'; export default CylinderGeometryUpdater; }
  41704. declare module "cesium/Source/DataSources/CylinderGraphics" { import { CylinderGraphics } from 'cesium'; export default CylinderGraphics; }
  41705. declare module "cesium/Source/DataSources/CzmlDataSource" { import { CzmlDataSource } from 'cesium'; export default CzmlDataSource; }
  41706. declare module "cesium/Source/DataSources/DataSource" { import { DataSource } from 'cesium'; export default DataSource; }
  41707. declare module "cesium/Source/DataSources/DataSourceClock" { import { DataSourceClock } from 'cesium'; export default DataSourceClock; }
  41708. declare module "cesium/Source/DataSources/DataSourceCollection" { import { DataSourceCollection } from 'cesium'; export default DataSourceCollection; }
  41709. declare module "cesium/Source/DataSources/DataSourceDisplay" { import { DataSourceDisplay } from 'cesium'; export default DataSourceDisplay; }
  41710. declare module "cesium/Source/DataSources/EllipseGeometryUpdater" { import { EllipseGeometryUpdater } from 'cesium'; export default EllipseGeometryUpdater; }
  41711. declare module "cesium/Source/DataSources/EllipseGraphics" { import { EllipseGraphics } from 'cesium'; export default EllipseGraphics; }
  41712. declare module "cesium/Source/DataSources/EllipsoidGeometryUpdater" { import { EllipsoidGeometryUpdater } from 'cesium'; export default EllipsoidGeometryUpdater; }
  41713. declare module "cesium/Source/DataSources/EllipsoidGraphics" { import { EllipsoidGraphics } from 'cesium'; export default EllipsoidGraphics; }
  41714. declare module "cesium/Source/DataSources/Entity" { import { Entity } from 'cesium'; export default Entity; }
  41715. declare module "cesium/Source/DataSources/EntityCluster" { import { EntityCluster } from 'cesium'; export default EntityCluster; }
  41716. declare module "cesium/Source/DataSources/EntityCollection" { import { EntityCollection } from 'cesium'; export default EntityCollection; }
  41717. declare module "cesium/Source/DataSources/EntityView" { import { EntityView } from 'cesium'; export default EntityView; }
  41718. declare module "cesium/Source/DataSources/exportKml" { import { exportKml } from 'cesium'; export default exportKml; }
  41719. declare module "cesium/Source/DataSources/GeoJsonDataSource" { import { GeoJsonDataSource } from 'cesium'; export default GeoJsonDataSource; }
  41720. declare module "cesium/Source/DataSources/GeometryUpdater" { import { GeometryUpdater } from 'cesium'; export default GeometryUpdater; }
  41721. declare module "cesium/Source/DataSources/GeometryVisualizer" { import { GeometryVisualizer } from 'cesium'; export default GeometryVisualizer; }
  41722. declare module "cesium/Source/DataSources/GridMaterialProperty" { import { GridMaterialProperty } from 'cesium'; export default GridMaterialProperty; }
  41723. declare module "cesium/Source/DataSources/GroundGeometryUpdater" { import { GroundGeometryUpdater } from 'cesium'; export default GroundGeometryUpdater; }
  41724. declare module "cesium/Source/DataSources/ImageMaterialProperty" { import { ImageMaterialProperty } from 'cesium'; export default ImageMaterialProperty; }
  41725. declare module "cesium/Source/DataSources/KmlCamera" { import { KmlCamera } from 'cesium'; export default KmlCamera; }
  41726. declare module "cesium/Source/DataSources/KmlDataSource" { import { KmlDataSource } from 'cesium'; export default KmlDataSource; }
  41727. declare module "cesium/Source/DataSources/KmlLookAt" { import { KmlLookAt } from 'cesium'; export default KmlLookAt; }
  41728. declare module "cesium/Source/DataSources/KmlTour" { import { KmlTour } from 'cesium'; export default KmlTour; }
  41729. declare module "cesium/Source/DataSources/KmlTourFlyTo" { import { KmlTourFlyTo } from 'cesium'; export default KmlTourFlyTo; }
  41730. declare module "cesium/Source/DataSources/KmlTourWait" { import { KmlTourWait } from 'cesium'; export default KmlTourWait; }
  41731. declare module "cesium/Source/DataSources/LabelGraphics" { import { LabelGraphics } from 'cesium'; export default LabelGraphics; }
  41732. declare module "cesium/Source/DataSources/LabelVisualizer" { import { LabelVisualizer } from 'cesium'; export default LabelVisualizer; }
  41733. declare module "cesium/Source/DataSources/MaterialProperty" { import { MaterialProperty } from 'cesium'; export default MaterialProperty; }
  41734. declare module "cesium/Source/DataSources/ModelGraphics" { import { ModelGraphics } from 'cesium'; export default ModelGraphics; }
  41735. declare module "cesium/Source/DataSources/ModelVisualizer" { import { ModelVisualizer } from 'cesium'; export default ModelVisualizer; }
  41736. declare module "cesium/Source/DataSources/NodeTransformationProperty" { import { NodeTransformationProperty } from 'cesium'; export default NodeTransformationProperty; }
  41737. declare module "cesium/Source/DataSources/PathGraphics" { import { PathGraphics } from 'cesium'; export default PathGraphics; }
  41738. declare module "cesium/Source/DataSources/PathVisualizer" { import { PathVisualizer } from 'cesium'; export default PathVisualizer; }
  41739. declare module "cesium/Source/DataSources/PlaneGeometryUpdater" { import { PlaneGeometryUpdater } from 'cesium'; export default PlaneGeometryUpdater; }
  41740. declare module "cesium/Source/DataSources/PlaneGraphics" { import { PlaneGraphics } from 'cesium'; export default PlaneGraphics; }
  41741. declare module "cesium/Source/DataSources/PointGraphics" { import { PointGraphics } from 'cesium'; export default PointGraphics; }
  41742. declare module "cesium/Source/DataSources/PointVisualizer" { import { PointVisualizer } from 'cesium'; export default PointVisualizer; }
  41743. declare module "cesium/Source/DataSources/PolygonGeometryUpdater" { import { PolygonGeometryUpdater } from 'cesium'; export default PolygonGeometryUpdater; }
  41744. declare module "cesium/Source/DataSources/PolygonGraphics" { import { PolygonGraphics } from 'cesium'; export default PolygonGraphics; }
  41745. declare module "cesium/Source/DataSources/PolylineArrowMaterialProperty" { import { PolylineArrowMaterialProperty } from 'cesium'; export default PolylineArrowMaterialProperty; }
  41746. declare module "cesium/Source/DataSources/PolylineDashMaterialProperty" { import { PolylineDashMaterialProperty } from 'cesium'; export default PolylineDashMaterialProperty; }
  41747. declare module "cesium/Source/DataSources/PolylineGeometryUpdater" { import { PolylineGeometryUpdater } from 'cesium'; export default PolylineGeometryUpdater; }
  41748. declare module "cesium/Source/DataSources/PolylineGlowMaterialProperty" { import { PolylineGlowMaterialProperty } from 'cesium'; export default PolylineGlowMaterialProperty; }
  41749. declare module "cesium/Source/DataSources/PolylineGraphics" { import { PolylineGraphics } from 'cesium'; export default PolylineGraphics; }
  41750. declare module "cesium/Source/DataSources/PolylineOutlineMaterialProperty" { import { PolylineOutlineMaterialProperty } from 'cesium'; export default PolylineOutlineMaterialProperty; }
  41751. declare module "cesium/Source/DataSources/PolylineVisualizer" { import { PolylineVisualizer } from 'cesium'; export default PolylineVisualizer; }
  41752. declare module "cesium/Source/DataSources/PolylineVolumeGeometryUpdater" { import { PolylineVolumeGeometryUpdater } from 'cesium'; export default PolylineVolumeGeometryUpdater; }
  41753. declare module "cesium/Source/DataSources/PolylineVolumeGraphics" { import { PolylineVolumeGraphics } from 'cesium'; export default PolylineVolumeGraphics; }
  41754. declare module "cesium/Source/DataSources/PositionProperty" { import { PositionProperty } from 'cesium'; export default PositionProperty; }
  41755. declare module "cesium/Source/DataSources/PositionPropertyArray" { import { PositionPropertyArray } from 'cesium'; export default PositionPropertyArray; }
  41756. declare module "cesium/Source/DataSources/Property" { import { Property } from 'cesium'; export default Property; }
  41757. declare module "cesium/Source/DataSources/PropertyArray" { import { PropertyArray } from 'cesium'; export default PropertyArray; }
  41758. declare module "cesium/Source/DataSources/PropertyBag" { import { PropertyBag } from 'cesium'; export default PropertyBag; }
  41759. declare module "cesium/Source/DataSources/RectangleGeometryUpdater" { import { RectangleGeometryUpdater } from 'cesium'; export default RectangleGeometryUpdater; }
  41760. declare module "cesium/Source/DataSources/RectangleGraphics" { import { RectangleGraphics } from 'cesium'; export default RectangleGraphics; }
  41761. declare module "cesium/Source/DataSources/ReferenceProperty" { import { ReferenceProperty } from 'cesium'; export default ReferenceProperty; }
  41762. declare module "cesium/Source/DataSources/Rotation" { import { Rotation } from 'cesium'; export default Rotation; }
  41763. declare module "cesium/Source/DataSources/SampledPositionProperty" { import { SampledPositionProperty } from 'cesium'; export default SampledPositionProperty; }
  41764. declare module "cesium/Source/DataSources/SampledProperty" { import { SampledProperty } from 'cesium'; export default SampledProperty; }
  41765. declare module "cesium/Source/DataSources/StripeMaterialProperty" { import { StripeMaterialProperty } from 'cesium'; export default StripeMaterialProperty; }
  41766. declare module "cesium/Source/DataSources/StripeOrientation" { import { StripeOrientation } from 'cesium'; export default StripeOrientation; }
  41767. declare module "cesium/Source/DataSources/TimeIntervalCollectionPositionProperty" { import { TimeIntervalCollectionPositionProperty } from 'cesium'; export default TimeIntervalCollectionPositionProperty; }
  41768. declare module "cesium/Source/DataSources/TimeIntervalCollectionProperty" { import { TimeIntervalCollectionProperty } from 'cesium'; export default TimeIntervalCollectionProperty; }
  41769. declare module "cesium/Source/DataSources/VelocityOrientationProperty" { import { VelocityOrientationProperty } from 'cesium'; export default VelocityOrientationProperty; }
  41770. declare module "cesium/Source/DataSources/VelocityVectorProperty" { import { VelocityVectorProperty } from 'cesium'; export default VelocityVectorProperty; }
  41771. declare module "cesium/Source/DataSources/Visualizer" { import { Visualizer } from 'cesium'; export default Visualizer; }
  41772. declare module "cesium/Source/DataSources/WallGeometryUpdater" { import { WallGeometryUpdater } from 'cesium'; export default WallGeometryUpdater; }
  41773. declare module "cesium/Source/DataSources/WallGraphics" { import { WallGraphics } from 'cesium'; export default WallGraphics; }
  41774. declare module "cesium/Source/Renderer/PixelDatatype" { import { PixelDatatype } from 'cesium'; export default PixelDatatype; }
  41775. declare module "cesium/Source/Renderer/TextureMagnificationFilter" { import { TextureMagnificationFilter } from 'cesium'; export default TextureMagnificationFilter; }
  41776. declare module "cesium/Source/Renderer/TextureMinificationFilter" { import { TextureMinificationFilter } from 'cesium'; export default TextureMinificationFilter; }
  41777. declare module "cesium/Source/Scene/Appearance" { import { Appearance } from 'cesium'; export default Appearance; }
  41778. declare module "cesium/Source/Scene/ArcGisMapServerImageryProvider" { import { ArcGisMapServerImageryProvider } from 'cesium'; export default ArcGisMapServerImageryProvider; }
  41779. declare module "cesium/Source/Scene/Axis" { import { Axis } from 'cesium'; export default Axis; }
  41780. declare module "cesium/Source/Scene/Billboard" { import { Billboard } from 'cesium'; export default Billboard; }
  41781. declare module "cesium/Source/Scene/BillboardCollection" { import { BillboardCollection } from 'cesium'; export default BillboardCollection; }
  41782. declare module "cesium/Source/Scene/BingMapsImageryProvider" { import { BingMapsImageryProvider } from 'cesium'; export default BingMapsImageryProvider; }
  41783. declare module "cesium/Source/Scene/BingMapsStyle" { import { BingMapsStyle } from 'cesium'; export default BingMapsStyle; }
  41784. declare module "cesium/Source/Scene/BlendEquation" { import { BlendEquation } from 'cesium'; export default BlendEquation; }
  41785. declare module "cesium/Source/Scene/BlendFunction" { import { BlendFunction } from 'cesium'; export default BlendFunction; }
  41786. declare module "cesium/Source/Scene/BlendingState" { import { BlendingState } from 'cesium'; export default BlendingState; }
  41787. declare module "cesium/Source/Scene/BlendOption" { import { BlendOption } from 'cesium'; export default BlendOption; }
  41788. declare module "cesium/Source/Scene/BoxEmitter" { import { BoxEmitter } from 'cesium'; export default BoxEmitter; }
  41789. declare module "cesium/Source/Scene/Camera" { import { Camera } from 'cesium'; export default Camera; }
  41790. declare module "cesium/Source/Scene/CameraEventAggregator" { import { CameraEventAggregator } from 'cesium'; export default CameraEventAggregator; }
  41791. declare module "cesium/Source/Scene/CameraEventType" { import { CameraEventType } from 'cesium'; export default CameraEventType; }
  41792. declare module "cesium/Source/Scene/Cesium3DTile" { import { Cesium3DTile } from 'cesium'; export default Cesium3DTile; }
  41793. declare module "cesium/Source/Scene/Cesium3DTileColorBlendMode" { import { Cesium3DTileColorBlendMode } from 'cesium'; export default Cesium3DTileColorBlendMode; }
  41794. declare module "cesium/Source/Scene/Cesium3DTileContent" { import { Cesium3DTileContent } from 'cesium'; export default Cesium3DTileContent; }
  41795. declare module "cesium/Source/Scene/Cesium3DTileFeature" { import { Cesium3DTileFeature } from 'cesium'; export default Cesium3DTileFeature; }
  41796. declare module "cesium/Source/Scene/Cesium3DTilePointFeature" { import { Cesium3DTilePointFeature } from 'cesium'; export default Cesium3DTilePointFeature; }
  41797. declare module "cesium/Source/Scene/Cesium3DTileset" { import { Cesium3DTileset } from 'cesium'; export default Cesium3DTileset; }
  41798. declare module "cesium/Source/Scene/Cesium3DTileStyle" { import { Cesium3DTileStyle } from 'cesium'; export default Cesium3DTileStyle; }
  41799. declare module "cesium/Source/Scene/CircleEmitter" { import { CircleEmitter } from 'cesium'; export default CircleEmitter; }
  41800. declare module "cesium/Source/Scene/ClassificationPrimitive" { import { ClassificationPrimitive } from 'cesium'; export default ClassificationPrimitive; }
  41801. declare module "cesium/Source/Scene/ClassificationType" { import { ClassificationType } from 'cesium'; export default ClassificationType; }
  41802. declare module "cesium/Source/Scene/ClippingPlane" { import { ClippingPlane } from 'cesium'; export default ClippingPlane; }
  41803. declare module "cesium/Source/Scene/ClippingPlaneCollection" { import { ClippingPlaneCollection } from 'cesium'; export default ClippingPlaneCollection; }
  41804. declare module "cesium/Source/Scene/ColorBlendMode" { import { ColorBlendMode } from 'cesium'; export default ColorBlendMode; }
  41805. declare module "cesium/Source/Scene/ConditionsExpression" { import { ConditionsExpression } from 'cesium'; export default ConditionsExpression; }
  41806. declare module "cesium/Source/Scene/ConeEmitter" { import { ConeEmitter } from 'cesium'; export default ConeEmitter; }
  41807. declare module "cesium/Source/Scene/createOsmBuildings" { import { createOsmBuildings } from 'cesium'; export default createOsmBuildings; }
  41808. declare module "cesium/Source/Scene/createTangentSpaceDebugPrimitive" { import { createTangentSpaceDebugPrimitive } from 'cesium'; export default createTangentSpaceDebugPrimitive; }
  41809. declare module "cesium/Source/Scene/createWorldImagery" { import { createWorldImagery } from 'cesium'; export default createWorldImagery; }
  41810. declare module "cesium/Source/Scene/CreditDisplay" { import { CreditDisplay } from 'cesium'; export default CreditDisplay; }
  41811. declare module "cesium/Source/Scene/CullFace" { import { CullFace } from 'cesium'; export default CullFace; }
  41812. declare module "cesium/Source/Scene/DebugAppearance" { import { DebugAppearance } from 'cesium'; export default DebugAppearance; }
  41813. declare module "cesium/Source/Scene/DebugCameraPrimitive" { import { DebugCameraPrimitive } from 'cesium'; export default DebugCameraPrimitive; }
  41814. declare module "cesium/Source/Scene/DebugModelMatrixPrimitive" { import { DebugModelMatrixPrimitive } from 'cesium'; export default DebugModelMatrixPrimitive; }
  41815. declare module "cesium/Source/Scene/DepthFunction" { import { DepthFunction } from 'cesium'; export default DepthFunction; }
  41816. declare module "cesium/Source/Scene/DirectionalLight" { import { DirectionalLight } from 'cesium'; export default DirectionalLight; }
  41817. declare module "cesium/Source/Scene/DiscardEmptyTileImagePolicy" { import { DiscardEmptyTileImagePolicy } from 'cesium'; export default DiscardEmptyTileImagePolicy; }
  41818. declare module "cesium/Source/Scene/DiscardMissingTileImagePolicy" { import { DiscardMissingTileImagePolicy } from 'cesium'; export default DiscardMissingTileImagePolicy; }
  41819. declare module "cesium/Source/Scene/EllipsoidSurfaceAppearance" { import { EllipsoidSurfaceAppearance } from 'cesium'; export default EllipsoidSurfaceAppearance; }
  41820. declare module "cesium/Source/Scene/Expression" { import { Expression } from 'cesium'; export default Expression; }
  41821. declare module "cesium/Source/Scene/Fog" { import { Fog } from 'cesium'; export default Fog; }
  41822. declare module "cesium/Source/Scene/FrameRateMonitor" { import { FrameRateMonitor } from 'cesium'; export default FrameRateMonitor; }
  41823. declare module "cesium/Source/Scene/GetFeatureInfoFormat" { import { GetFeatureInfoFormat } from 'cesium'; export default GetFeatureInfoFormat; }
  41824. declare module "cesium/Source/Scene/Globe" { import { Globe } from 'cesium'; export default Globe; }
  41825. declare module "cesium/Source/Scene/GlobeTranslucency" { import { GlobeTranslucency } from 'cesium'; export default GlobeTranslucency; }
  41826. declare module "cesium/Source/Scene/GoogleEarthEnterpriseImageryProvider" { import { GoogleEarthEnterpriseImageryProvider } from 'cesium'; export default GoogleEarthEnterpriseImageryProvider; }
  41827. declare module "cesium/Source/Scene/GoogleEarthEnterpriseMapsProvider" { import { GoogleEarthEnterpriseMapsProvider } from 'cesium'; export default GoogleEarthEnterpriseMapsProvider; }
  41828. declare module "cesium/Source/Scene/GridImageryProvider" { import { GridImageryProvider } from 'cesium'; export default GridImageryProvider; }
  41829. declare module "cesium/Source/Scene/GroundPolylinePrimitive" { import { GroundPolylinePrimitive } from 'cesium'; export default GroundPolylinePrimitive; }
  41830. declare module "cesium/Source/Scene/GroundPrimitive" { import { GroundPrimitive } from 'cesium'; export default GroundPrimitive; }
  41831. declare module "cesium/Source/Scene/HeightReference" { import { HeightReference } from 'cesium'; export default HeightReference; }
  41832. declare module "cesium/Source/Scene/HorizontalOrigin" { import { HorizontalOrigin } from 'cesium'; export default HorizontalOrigin; }
  41833. declare module "cesium/Source/Scene/ImageryLayer" { import { ImageryLayer } from 'cesium'; export default ImageryLayer; }
  41834. declare module "cesium/Source/Scene/ImageryLayerCollection" { import { ImageryLayerCollection } from 'cesium'; export default ImageryLayerCollection; }
  41835. declare module "cesium/Source/Scene/ImageryLayerFeatureInfo" { import { ImageryLayerFeatureInfo } from 'cesium'; export default ImageryLayerFeatureInfo; }
  41836. declare module "cesium/Source/Scene/ImageryProvider" { import { ImageryProvider } from 'cesium'; export default ImageryProvider; }
  41837. declare module "cesium/Source/Scene/ImagerySplitDirection" { import { ImagerySplitDirection } from 'cesium'; export default ImagerySplitDirection; }
  41838. declare module "cesium/Source/Scene/IonImageryProvider" { import { IonImageryProvider } from 'cesium'; export default IonImageryProvider; }
  41839. declare module "cesium/Source/Scene/IonWorldImageryStyle" { import { IonWorldImageryStyle } from 'cesium'; export default IonWorldImageryStyle; }
  41840. declare module "cesium/Source/Scene/Label" { import { Label } from 'cesium'; export default Label; }
  41841. declare module "cesium/Source/Scene/LabelCollection" { import { LabelCollection } from 'cesium'; export default LabelCollection; }
  41842. declare module "cesium/Source/Scene/LabelStyle" { import { LabelStyle } from 'cesium'; export default LabelStyle; }
  41843. declare module "cesium/Source/Scene/Light" { import { Light } from 'cesium'; export default Light; }
  41844. declare module "cesium/Source/Scene/MapboxImageryProvider" { import { MapboxImageryProvider } from 'cesium'; export default MapboxImageryProvider; }
  41845. declare module "cesium/Source/Scene/MapboxStyleImageryProvider" { import { MapboxStyleImageryProvider } from 'cesium'; export default MapboxStyleImageryProvider; }
  41846. declare module "cesium/Source/Scene/MapMode2D" { import { MapMode2D } from 'cesium'; export default MapMode2D; }
  41847. declare module "cesium/Source/Scene/Material" { import { Material } from 'cesium'; export default Material; }
  41848. declare module "cesium/Source/Scene/MaterialAppearance" { import { MaterialAppearance } from 'cesium'; export default MaterialAppearance; }
  41849. declare module "cesium/Source/Scene/Model" { import { Model } from 'cesium'; export default Model; }
  41850. declare module "cesium/Source/Scene/ModelAnimation" { import { ModelAnimation } from 'cesium'; export default ModelAnimation; }
  41851. declare module "cesium/Source/Scene/ModelAnimationCollection" { import { ModelAnimationCollection } from 'cesium'; export default ModelAnimationCollection; }
  41852. declare module "cesium/Source/Scene/ModelAnimationLoop" { import { ModelAnimationLoop } from 'cesium'; export default ModelAnimationLoop; }
  41853. declare module "cesium/Source/Scene/ModelMaterial" { import { ModelMaterial } from 'cesium'; export default ModelMaterial; }
  41854. declare module "cesium/Source/Scene/ModelMesh" { import { ModelMesh } from 'cesium'; export default ModelMesh; }
  41855. declare module "cesium/Source/Scene/ModelNode" { import { ModelNode } from 'cesium'; export default ModelNode; }
  41856. declare module "cesium/Source/Scene/Moon" { import { Moon } from 'cesium'; export default Moon; }
  41857. declare module "cesium/Source/Scene/NeverTileDiscardPolicy" { import { NeverTileDiscardPolicy } from 'cesium'; export default NeverTileDiscardPolicy; }
  41858. declare module "cesium/Source/Scene/OpenStreetMapImageryProvider" { import { OpenStreetMapImageryProvider } from 'cesium'; export default OpenStreetMapImageryProvider; }
  41859. declare module "cesium/Source/Scene/Particle" { import { Particle } from 'cesium'; export default Particle; }
  41860. declare module "cesium/Source/Scene/ParticleBurst" { import { ParticleBurst } from 'cesium'; export default ParticleBurst; }
  41861. declare module "cesium/Source/Scene/ParticleEmitter" { import { ParticleEmitter } from 'cesium'; export default ParticleEmitter; }
  41862. declare module "cesium/Source/Scene/ParticleSystem" { import { ParticleSystem } from 'cesium'; export default ParticleSystem; }
  41863. declare module "cesium/Source/Scene/PerInstanceColorAppearance" { import { PerInstanceColorAppearance } from 'cesium'; export default PerInstanceColorAppearance; }
  41864. declare module "cesium/Source/Scene/PointCloudShading" { import { PointCloudShading } from 'cesium'; export default PointCloudShading; }
  41865. declare module "cesium/Source/Scene/PointPrimitive" { import { PointPrimitive } from 'cesium'; export default PointPrimitive; }
  41866. declare module "cesium/Source/Scene/PointPrimitiveCollection" { import { PointPrimitiveCollection } from 'cesium'; export default PointPrimitiveCollection; }
  41867. declare module "cesium/Source/Scene/Polyline" { import { Polyline } from 'cesium'; export default Polyline; }
  41868. declare module "cesium/Source/Scene/PolylineCollection" { import { PolylineCollection } from 'cesium'; export default PolylineCollection; }
  41869. declare module "cesium/Source/Scene/PolylineColorAppearance" { import { PolylineColorAppearance } from 'cesium'; export default PolylineColorAppearance; }
  41870. declare module "cesium/Source/Scene/PolylineMaterialAppearance" { import { PolylineMaterialAppearance } from 'cesium'; export default PolylineMaterialAppearance; }
  41871. declare module "cesium/Source/Scene/PostProcessStage" { import { PostProcessStage } from 'cesium'; export default PostProcessStage; }
  41872. declare module "cesium/Source/Scene/PostProcessStageCollection" { import { PostProcessStageCollection } from 'cesium'; export default PostProcessStageCollection; }
  41873. declare module "cesium/Source/Scene/PostProcessStageComposite" { import { PostProcessStageComposite } from 'cesium'; export default PostProcessStageComposite; }
  41874. declare module "cesium/Source/Scene/PostProcessStageLibrary" { import { PostProcessStageLibrary } from 'cesium'; export default PostProcessStageLibrary; }
  41875. declare module "cesium/Source/Scene/PostProcessStageSampleMode" { import { PostProcessStageSampleMode } from 'cesium'; export default PostProcessStageSampleMode; }
  41876. declare module "cesium/Source/Scene/Primitive" { import { Primitive } from 'cesium'; export default Primitive; }
  41877. declare module "cesium/Source/Scene/PrimitiveCollection" { import { PrimitiveCollection } from 'cesium'; export default PrimitiveCollection; }
  41878. declare module "cesium/Source/Scene/Scene" { import { Scene } from 'cesium'; export default Scene; }
  41879. declare module "cesium/Source/Scene/SceneMode" { import { SceneMode } from 'cesium'; export default SceneMode; }
  41880. declare module "cesium/Source/Scene/SceneTransforms" { import { SceneTransforms } from 'cesium'; export default SceneTransforms; }
  41881. declare module "cesium/Source/Scene/ScreenSpaceCameraController" { import { ScreenSpaceCameraController } from 'cesium'; export default ScreenSpaceCameraController; }
  41882. declare module "cesium/Source/Scene/ShadowMap" { import { ShadowMap } from 'cesium'; export default ShadowMap; }
  41883. declare module "cesium/Source/Scene/ShadowMode" { import { ShadowMode } from 'cesium'; export default ShadowMode; }
  41884. declare module "cesium/Source/Scene/SingleTileImageryProvider" { import { SingleTileImageryProvider } from 'cesium'; export default SingleTileImageryProvider; }
  41885. declare module "cesium/Source/Scene/SkyAtmosphere" { import { SkyAtmosphere } from 'cesium'; export default SkyAtmosphere; }
  41886. declare module "cesium/Source/Scene/SkyBox" { import { SkyBox } from 'cesium'; export default SkyBox; }
  41887. declare module "cesium/Source/Scene/SphereEmitter" { import { SphereEmitter } from 'cesium'; export default SphereEmitter; }
  41888. declare module "cesium/Source/Scene/StencilFunction" { import { StencilFunction } from 'cesium'; export default StencilFunction; }
  41889. declare module "cesium/Source/Scene/StencilOperation" { import { StencilOperation } from 'cesium'; export default StencilOperation; }
  41890. declare module "cesium/Source/Scene/StyleExpression" { import { StyleExpression } from 'cesium'; export default StyleExpression; }
  41891. declare module "cesium/Source/Scene/Sun" { import { Sun } from 'cesium'; export default Sun; }
  41892. declare module "cesium/Source/Scene/SunLight" { import { SunLight } from 'cesium'; export default SunLight; }
  41893. declare module "cesium/Source/Scene/TileCoordinatesImageryProvider" { import { TileCoordinatesImageryProvider } from 'cesium'; export default TileCoordinatesImageryProvider; }
  41894. declare module "cesium/Source/Scene/TileDiscardPolicy" { import { TileDiscardPolicy } from 'cesium'; export default TileDiscardPolicy; }
  41895. declare module "cesium/Source/Scene/TileMapServiceImageryProvider" { import { TileMapServiceImageryProvider } from 'cesium'; export default TileMapServiceImageryProvider; }
  41896. declare module "cesium/Source/Scene/TimeDynamicImagery" { import { TimeDynamicImagery } from 'cesium'; export default TimeDynamicImagery; }
  41897. declare module "cesium/Source/Scene/TimeDynamicPointCloud" { import { TimeDynamicPointCloud } from 'cesium'; export default TimeDynamicPointCloud; }
  41898. declare module "cesium/Source/Scene/UrlTemplateImageryProvider" { import { UrlTemplateImageryProvider } from 'cesium'; export default UrlTemplateImageryProvider; }
  41899. declare module "cesium/Source/Scene/VerticalOrigin" { import { VerticalOrigin } from 'cesium'; export default VerticalOrigin; }
  41900. declare module "cesium/Source/Scene/ViewportQuad" { import { ViewportQuad } from 'cesium'; export default ViewportQuad; }
  41901. declare module "cesium/Source/Scene/WebMapServiceImageryProvider" { import { WebMapServiceImageryProvider } from 'cesium'; export default WebMapServiceImageryProvider; }
  41902. declare module "cesium/Source/Scene/WebMapTileServiceImageryProvider" { import { WebMapTileServiceImageryProvider } from 'cesium'; export default WebMapTileServiceImageryProvider; }
  41903. declare module "cesium/Source/Widgets/ClockViewModel" { import { ClockViewModel } from 'cesium'; export default ClockViewModel; }
  41904. declare module "cesium/Source/Widgets/Command" { import { Command } from 'cesium'; export default Command; }
  41905. declare module "cesium/Source/Widgets/createCommand" { import { createCommand } from 'cesium'; export default createCommand; }
  41906. declare module "cesium/Source/Widgets/SvgPathBindingHandler" { import { SvgPathBindingHandler } from 'cesium'; export default SvgPathBindingHandler; }
  41907. declare module "cesium/Source/Widgets/ToggleButtonViewModel" { import { ToggleButtonViewModel } from 'cesium'; export default ToggleButtonViewModel; }
  41908. declare module "cesium/Source/Widgets/Animation/Animation" { import { Animation } from 'cesium'; export default Animation; }
  41909. declare module "cesium/Source/Widgets/Animation/AnimationViewModel" { import { AnimationViewModel } from 'cesium'; export default AnimationViewModel; }
  41910. declare module "cesium/Source/Widgets/BaseLayerPicker/BaseLayerPicker" { import { BaseLayerPicker } from 'cesium'; export default BaseLayerPicker; }
  41911. declare module "cesium/Source/Widgets/BaseLayerPicker/BaseLayerPickerViewModel" { import { BaseLayerPickerViewModel } from 'cesium'; export default BaseLayerPickerViewModel; }
  41912. declare module "cesium/Source/Widgets/BaseLayerPicker/ProviderViewModel" { import { ProviderViewModel } from 'cesium'; export default ProviderViewModel; }
  41913. declare module "cesium/Source/Widgets/Cesium3DTilesInspector/Cesium3DTilesInspector" { import { Cesium3DTilesInspector } from 'cesium'; export default Cesium3DTilesInspector; }
  41914. declare module "cesium/Source/Widgets/Cesium3DTilesInspector/Cesium3DTilesInspectorViewModel" { import { Cesium3DTilesInspectorViewModel } from 'cesium'; export default Cesium3DTilesInspectorViewModel; }
  41915. declare module "cesium/Source/Widgets/CesiumInspector/CesiumInspector" { import { CesiumInspector } from 'cesium'; export default CesiumInspector; }
  41916. declare module "cesium/Source/Widgets/CesiumInspector/CesiumInspectorViewModel" { import { CesiumInspectorViewModel } from 'cesium'; export default CesiumInspectorViewModel; }
  41917. declare module "cesium/Source/Widgets/CesiumWidget/CesiumWidget" { import { CesiumWidget } from 'cesium'; export default CesiumWidget; }
  41918. declare module "cesium/Source/Widgets/FullscreenButton/FullscreenButton" { import { FullscreenButton } from 'cesium'; export default FullscreenButton; }
  41919. declare module "cesium/Source/Widgets/FullscreenButton/FullscreenButtonViewModel" { import { FullscreenButtonViewModel } from 'cesium'; export default FullscreenButtonViewModel; }
  41920. declare module "cesium/Source/Widgets/Geocoder/Geocoder" { import { Geocoder } from 'cesium'; export default Geocoder; }
  41921. declare module "cesium/Source/Widgets/Geocoder/GeocoderViewModel" { import { GeocoderViewModel } from 'cesium'; export default GeocoderViewModel; }
  41922. declare module "cesium/Source/Widgets/HomeButton/HomeButton" { import { HomeButton } from 'cesium'; export default HomeButton; }
  41923. declare module "cesium/Source/Widgets/HomeButton/HomeButtonViewModel" { import { HomeButtonViewModel } from 'cesium'; export default HomeButtonViewModel; }
  41924. declare module "cesium/Source/Widgets/InfoBox/InfoBox" { import { InfoBox } from 'cesium'; export default InfoBox; }
  41925. declare module "cesium/Source/Widgets/InfoBox/InfoBoxViewModel" { import { InfoBoxViewModel } from 'cesium'; export default InfoBoxViewModel; }
  41926. declare module "cesium/Source/Widgets/NavigationHelpButton/NavigationHelpButton" { import { NavigationHelpButton } from 'cesium'; export default NavigationHelpButton; }
  41927. declare module "cesium/Source/Widgets/NavigationHelpButton/NavigationHelpButtonViewModel" { import { NavigationHelpButtonViewModel } from 'cesium'; export default NavigationHelpButtonViewModel; }
  41928. declare module "cesium/Source/Widgets/PerformanceWatchdog/PerformanceWatchdog" { import { PerformanceWatchdog } from 'cesium'; export default PerformanceWatchdog; }
  41929. declare module "cesium/Source/Widgets/PerformanceWatchdog/PerformanceWatchdogViewModel" { import { PerformanceWatchdogViewModel } from 'cesium'; export default PerformanceWatchdogViewModel; }
  41930. declare module "cesium/Source/Widgets/ProjectionPicker/ProjectionPicker" { import { ProjectionPicker } from 'cesium'; export default ProjectionPicker; }
  41931. declare module "cesium/Source/Widgets/ProjectionPicker/ProjectionPickerViewModel" { import { ProjectionPickerViewModel } from 'cesium'; export default ProjectionPickerViewModel; }
  41932. declare module "cesium/Source/Widgets/SceneModePicker/SceneModePicker" { import { SceneModePicker } from 'cesium'; export default SceneModePicker; }
  41933. declare module "cesium/Source/Widgets/SceneModePicker/SceneModePickerViewModel" { import { SceneModePickerViewModel } from 'cesium'; export default SceneModePickerViewModel; }
  41934. declare module "cesium/Source/Widgets/SelectionIndicator/SelectionIndicator" { import { SelectionIndicator } from 'cesium'; export default SelectionIndicator; }
  41935. declare module "cesium/Source/Widgets/SelectionIndicator/SelectionIndicatorViewModel" { import { SelectionIndicatorViewModel } from 'cesium'; export default SelectionIndicatorViewModel; }
  41936. declare module "cesium/Source/Widgets/Timeline/Timeline" { import { Timeline } from 'cesium'; export default Timeline; }
  41937. declare module "cesium/Source/Widgets/Viewer/Viewer" { import { Viewer } from 'cesium'; export default Viewer; }
  41938. declare module "cesium/Source/Widgets/Viewer/viewerCesium3DTilesInspectorMixin" { import { viewerCesium3DTilesInspectorMixin } from 'cesium'; export default viewerCesium3DTilesInspectorMixin; }
  41939. declare module "cesium/Source/Widgets/Viewer/viewerCesiumInspectorMixin" { import { viewerCesiumInspectorMixin } from 'cesium'; export default viewerCesiumInspectorMixin; }
  41940. declare module "cesium/Source/Widgets/Viewer/viewerDragDropMixin" { import { viewerDragDropMixin } from 'cesium'; export default viewerDragDropMixin; }
  41941. declare module "cesium/Source/Widgets/Viewer/viewerPerformanceWatchdogMixin" { import { viewerPerformanceWatchdogMixin } from 'cesium'; export default viewerPerformanceWatchdogMixin; }
  41942. declare module "cesium/Source/Widgets/VRButton/VRButton" { import { VRButton } from 'cesium'; export default VRButton; }
  41943. declare module "cesium/Source/Widgets/VRButton/VRButtonViewModel" { import { VRButtonViewModel } from 'cesium'; export default VRButtonViewModel; }