Cesium-es6.d.ts 1.3 MB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613161416151616161716181619162016211622162316241625162616271628162916301631163216331634163516361637163816391640164116421643164416451646164716481649165016511652165316541655165616571658165916601661166216631664166516661667166816691670167116721673167416751676167716781679168016811682168316841685168616871688168916901691169216931694169516961697169816991700170117021703170417051706170717081709171017111712171317141715171617171718171917201721172217231724172517261727172817291730173117321733173417351736173717381739174017411742174317441745174617471748174917501751175217531754175517561757175817591760176117621763176417651766176717681769177017711772177317741775177617771778177917801781178217831784178517861787178817891790179117921793179417951796179717981799180018011802180318041805180618071808180918101811181218131814181518161817181818191820182118221823182418251826182718281829183018311832183318341835183618371838183918401841184218431844184518461847184818491850185118521853185418551856185718581859186018611862186318641865186618671868186918701871187218731874187518761877187818791880188118821883188418851886188718881889189018911892189318941895189618971898189919001901190219031904190519061907190819091910191119121913191419151916191719181919192019211922192319241925192619271928192919301931193219331934193519361937193819391940194119421943194419451946194719481949195019511952195319541955195619571958195919601961196219631964196519661967196819691970197119721973197419751976197719781979198019811982198319841985198619871988198919901991199219931994199519961997199819992000200120022003200420052006200720082009201020112012201320142015201620172018201920202021202220232024202520262027202820292030203120322033203420352036203720382039204020412042204320442045204620472048204920502051205220532054205520562057205820592060206120622063206420652066206720682069207020712072207320742075207620772078207920802081208220832084208520862087208820892090209120922093209420952096209720982099210021012102210321042105210621072108210921102111211221132114211521162117211821192120212121222123212421252126212721282129213021312132213321342135213621372138213921402141214221432144214521462147214821492150215121522153215421552156215721582159216021612162216321642165216621672168216921702171217221732174217521762177217821792180218121822183218421852186218721882189219021912192219321942195219621972198219922002201220222032204220522062207220822092210221122122213221422152216221722182219222022212222222322242225222622272228222922302231223222332234223522362237223822392240224122422243224422452246224722482249225022512252225322542255225622572258225922602261226222632264226522662267226822692270227122722273227422752276227722782279228022812282228322842285228622872288228922902291229222932294229522962297229822992300230123022303230423052306230723082309231023112312231323142315231623172318231923202321232223232324232523262327232823292330233123322333233423352336233723382339234023412342234323442345234623472348234923502351235223532354235523562357235823592360236123622363236423652366236723682369237023712372237323742375237623772378237923802381238223832384238523862387238823892390239123922393239423952396239723982399240024012402240324042405240624072408240924102411241224132414241524162417241824192420242124222423242424252426242724282429243024312432243324342435243624372438243924402441244224432444244524462447244824492450245124522453245424552456245724582459246024612462246324642465246624672468246924702471247224732474247524762477247824792480248124822483248424852486248724882489249024912492249324942495249624972498249925002501250225032504250525062507250825092510251125122513251425152516251725182519252025212522252325242525252625272528252925302531253225332534253525362537253825392540254125422543254425452546254725482549255025512552255325542555255625572558255925602561256225632564256525662567256825692570257125722573257425752576257725782579258025812582258325842585258625872588258925902591259225932594259525962597259825992600260126022603260426052606260726082609261026112612261326142615261626172618261926202621262226232624262526262627262826292630263126322633263426352636263726382639264026412642264326442645264626472648264926502651265226532654265526562657265826592660266126622663266426652666266726682669267026712672267326742675267626772678267926802681268226832684268526862687268826892690269126922693269426952696269726982699270027012702270327042705270627072708270927102711271227132714271527162717271827192720272127222723272427252726272727282729273027312732273327342735273627372738273927402741274227432744274527462747274827492750275127522753275427552756275727582759276027612762276327642765276627672768276927702771277227732774277527762777277827792780278127822783278427852786278727882789279027912792279327942795279627972798279928002801280228032804280528062807280828092810281128122813281428152816281728182819282028212822282328242825282628272828282928302831283228332834283528362837283828392840284128422843284428452846284728482849285028512852285328542855285628572858285928602861286228632864286528662867286828692870287128722873287428752876287728782879288028812882288328842885288628872888288928902891289228932894289528962897289828992900290129022903290429052906290729082909291029112912291329142915291629172918291929202921292229232924292529262927292829292930293129322933293429352936293729382939294029412942294329442945294629472948294929502951295229532954295529562957295829592960296129622963296429652966296729682969297029712972297329742975297629772978297929802981298229832984298529862987298829892990299129922993299429952996299729982999300030013002300330043005300630073008300930103011301230133014301530163017301830193020302130223023302430253026302730283029303030313032303330343035303630373038303930403041304230433044304530463047304830493050305130523053305430553056305730583059306030613062306330643065306630673068306930703071307230733074307530763077307830793080308130823083308430853086308730883089309030913092309330943095309630973098309931003101310231033104310531063107310831093110311131123113311431153116311731183119312031213122312331243125312631273128312931303131313231333134313531363137313831393140314131423143314431453146314731483149315031513152315331543155315631573158315931603161316231633164316531663167316831693170317131723173317431753176317731783179318031813182318331843185318631873188318931903191319231933194319531963197319831993200320132023203320432053206320732083209321032113212321332143215321632173218321932203221322232233224322532263227322832293230323132323233323432353236323732383239324032413242324332443245324632473248324932503251325232533254325532563257325832593260326132623263326432653266326732683269327032713272327332743275327632773278327932803281328232833284328532863287328832893290329132923293329432953296329732983299330033013302330333043305330633073308330933103311331233133314331533163317331833193320332133223323332433253326332733283329333033313332333333343335333633373338333933403341334233433344334533463347334833493350335133523353335433553356335733583359336033613362336333643365336633673368336933703371337233733374337533763377337833793380338133823383338433853386338733883389339033913392339333943395339633973398339934003401340234033404340534063407340834093410341134123413341434153416341734183419342034213422342334243425342634273428342934303431343234333434343534363437343834393440344134423443344434453446344734483449345034513452345334543455345634573458345934603461346234633464346534663467346834693470347134723473347434753476347734783479348034813482348334843485348634873488348934903491349234933494349534963497349834993500350135023503350435053506350735083509351035113512351335143515351635173518351935203521352235233524352535263527352835293530353135323533353435353536353735383539354035413542354335443545354635473548354935503551355235533554355535563557355835593560356135623563356435653566356735683569357035713572357335743575357635773578357935803581358235833584358535863587358835893590359135923593359435953596359735983599360036013602360336043605360636073608360936103611361236133614361536163617361836193620362136223623362436253626362736283629363036313632363336343635363636373638363936403641364236433644364536463647364836493650365136523653365436553656365736583659366036613662366336643665366636673668366936703671367236733674367536763677367836793680368136823683368436853686368736883689369036913692369336943695369636973698369937003701370237033704370537063707370837093710371137123713371437153716371737183719372037213722372337243725372637273728372937303731373237333734373537363737373837393740374137423743374437453746374737483749375037513752375337543755375637573758375937603761376237633764376537663767376837693770377137723773377437753776377737783779378037813782378337843785378637873788378937903791379237933794379537963797379837993800380138023803380438053806380738083809381038113812381338143815381638173818381938203821382238233824382538263827382838293830383138323833383438353836383738383839384038413842384338443845384638473848384938503851385238533854385538563857385838593860386138623863386438653866386738683869387038713872387338743875387638773878387938803881388238833884388538863887388838893890389138923893389438953896389738983899390039013902390339043905390639073908390939103911391239133914391539163917391839193920392139223923392439253926392739283929393039313932393339343935393639373938393939403941394239433944394539463947394839493950395139523953395439553956395739583959396039613962396339643965396639673968396939703971397239733974397539763977397839793980398139823983398439853986398739883989399039913992399339943995399639973998399940004001400240034004400540064007400840094010401140124013401440154016401740184019402040214022402340244025402640274028402940304031403240334034403540364037403840394040404140424043404440454046404740484049405040514052405340544055405640574058405940604061406240634064406540664067406840694070407140724073407440754076407740784079408040814082408340844085408640874088408940904091409240934094409540964097409840994100410141024103410441054106410741084109411041114112411341144115411641174118411941204121412241234124412541264127412841294130413141324133413441354136413741384139414041414142414341444145414641474148414941504151415241534154415541564157415841594160416141624163416441654166416741684169417041714172417341744175417641774178417941804181418241834184418541864187418841894190419141924193419441954196419741984199420042014202420342044205420642074208420942104211421242134214421542164217421842194220422142224223422442254226422742284229423042314232423342344235423642374238423942404241424242434244424542464247424842494250425142524253425442554256425742584259426042614262426342644265426642674268426942704271427242734274427542764277427842794280428142824283428442854286428742884289429042914292429342944295429642974298429943004301430243034304430543064307430843094310431143124313431443154316431743184319432043214322432343244325432643274328432943304331433243334334433543364337433843394340434143424343434443454346434743484349435043514352435343544355435643574358435943604361436243634364436543664367436843694370437143724373437443754376437743784379438043814382438343844385438643874388438943904391439243934394439543964397439843994400440144024403440444054406440744084409441044114412441344144415441644174418441944204421442244234424442544264427442844294430443144324433443444354436443744384439444044414442444344444445444644474448444944504451445244534454445544564457445844594460446144624463446444654466446744684469447044714472447344744475447644774478447944804481448244834484448544864487448844894490449144924493449444954496449744984499450045014502450345044505450645074508450945104511451245134514451545164517451845194520452145224523452445254526452745284529453045314532453345344535453645374538453945404541454245434544454545464547454845494550455145524553455445554556455745584559456045614562456345644565456645674568456945704571457245734574457545764577457845794580458145824583458445854586458745884589459045914592459345944595459645974598459946004601460246034604460546064607460846094610461146124613461446154616461746184619462046214622462346244625462646274628462946304631463246334634463546364637463846394640464146424643464446454646464746484649465046514652465346544655465646574658465946604661466246634664466546664667466846694670467146724673467446754676467746784679468046814682468346844685468646874688468946904691469246934694469546964697469846994700470147024703470447054706470747084709471047114712471347144715471647174718471947204721472247234724472547264727472847294730473147324733473447354736473747384739474047414742474347444745474647474748474947504751475247534754475547564757475847594760476147624763476447654766476747684769477047714772477347744775477647774778477947804781478247834784478547864787478847894790479147924793479447954796479747984799480048014802480348044805480648074808480948104811481248134814481548164817481848194820482148224823482448254826482748284829483048314832483348344835483648374838483948404841484248434844484548464847484848494850485148524853485448554856485748584859486048614862486348644865486648674868486948704871487248734874487548764877487848794880488148824883488448854886488748884889489048914892489348944895489648974898489949004901490249034904490549064907490849094910491149124913491449154916491749184919492049214922492349244925492649274928492949304931493249334934493549364937493849394940494149424943494449454946494749484949495049514952495349544955495649574958495949604961496249634964496549664967496849694970497149724973497449754976497749784979498049814982498349844985498649874988498949904991499249934994499549964997499849995000500150025003500450055006500750085009501050115012501350145015501650175018501950205021502250235024502550265027502850295030503150325033503450355036503750385039504050415042504350445045504650475048504950505051505250535054505550565057505850595060506150625063506450655066506750685069507050715072507350745075507650775078507950805081508250835084508550865087508850895090509150925093509450955096509750985099510051015102510351045105510651075108510951105111511251135114511551165117511851195120512151225123512451255126512751285129513051315132513351345135513651375138513951405141514251435144514551465147514851495150515151525153515451555156515751585159516051615162516351645165516651675168516951705171517251735174517551765177517851795180518151825183518451855186518751885189519051915192519351945195519651975198519952005201520252035204520552065207520852095210521152125213521452155216521752185219522052215222522352245225522652275228522952305231523252335234523552365237523852395240524152425243524452455246524752485249525052515252525352545255525652575258525952605261526252635264526552665267526852695270527152725273527452755276527752785279528052815282528352845285528652875288528952905291529252935294529552965297529852995300530153025303530453055306530753085309531053115312531353145315531653175318531953205321532253235324532553265327532853295330533153325333533453355336533753385339534053415342534353445345534653475348534953505351535253535354535553565357535853595360536153625363536453655366536753685369537053715372537353745375537653775378537953805381538253835384538553865387538853895390539153925393539453955396539753985399540054015402540354045405540654075408540954105411541254135414541554165417541854195420542154225423542454255426542754285429543054315432543354345435543654375438543954405441544254435444544554465447544854495450545154525453545454555456545754585459546054615462546354645465546654675468546954705471547254735474547554765477547854795480548154825483548454855486548754885489549054915492549354945495549654975498549955005501550255035504550555065507550855095510551155125513551455155516551755185519552055215522552355245525552655275528552955305531553255335534553555365537553855395540554155425543554455455546554755485549555055515552555355545555555655575558555955605561556255635564556555665567556855695570557155725573557455755576557755785579558055815582558355845585558655875588558955905591559255935594559555965597559855995600560156025603560456055606560756085609561056115612561356145615561656175618561956205621562256235624562556265627562856295630563156325633563456355636563756385639564056415642564356445645564656475648564956505651565256535654565556565657565856595660566156625663566456655666566756685669567056715672567356745675567656775678567956805681568256835684568556865687568856895690569156925693569456955696569756985699570057015702570357045705570657075708570957105711571257135714571557165717571857195720572157225723572457255726572757285729573057315732573357345735573657375738573957405741574257435744574557465747574857495750575157525753575457555756575757585759576057615762576357645765576657675768576957705771577257735774577557765777577857795780578157825783578457855786578757885789579057915792579357945795579657975798579958005801580258035804580558065807580858095810581158125813581458155816581758185819582058215822582358245825582658275828582958305831583258335834583558365837583858395840584158425843584458455846584758485849585058515852585358545855585658575858585958605861586258635864586558665867586858695870587158725873587458755876587758785879588058815882588358845885588658875888588958905891589258935894589558965897589858995900590159025903590459055906590759085909591059115912591359145915591659175918591959205921592259235924592559265927592859295930593159325933593459355936593759385939594059415942594359445945594659475948594959505951595259535954595559565957595859595960596159625963596459655966596759685969597059715972597359745975597659775978597959805981598259835984598559865987598859895990599159925993599459955996599759985999600060016002600360046005600660076008600960106011601260136014601560166017601860196020602160226023602460256026602760286029603060316032603360346035603660376038603960406041604260436044604560466047604860496050605160526053605460556056605760586059606060616062606360646065606660676068606960706071607260736074607560766077607860796080608160826083608460856086608760886089609060916092609360946095609660976098609961006101610261036104610561066107610861096110611161126113611461156116611761186119612061216122612361246125612661276128612961306131613261336134613561366137613861396140614161426143614461456146614761486149615061516152615361546155615661576158615961606161616261636164616561666167616861696170617161726173617461756176617761786179618061816182618361846185618661876188618961906191619261936194619561966197619861996200620162026203620462056206620762086209621062116212621362146215621662176218621962206221622262236224622562266227622862296230623162326233623462356236623762386239624062416242624362446245624662476248624962506251625262536254625562566257625862596260626162626263626462656266626762686269627062716272627362746275627662776278627962806281628262836284628562866287628862896290629162926293629462956296629762986299630063016302630363046305630663076308630963106311631263136314631563166317631863196320632163226323632463256326632763286329633063316332633363346335633663376338633963406341634263436344634563466347634863496350635163526353635463556356635763586359636063616362636363646365636663676368636963706371637263736374637563766377637863796380638163826383638463856386638763886389639063916392639363946395639663976398639964006401640264036404640564066407640864096410641164126413641464156416641764186419642064216422642364246425642664276428642964306431643264336434643564366437643864396440644164426443644464456446644764486449645064516452645364546455645664576458645964606461646264636464646564666467646864696470647164726473647464756476647764786479648064816482648364846485648664876488648964906491649264936494649564966497649864996500650165026503650465056506650765086509651065116512651365146515651665176518651965206521652265236524652565266527652865296530653165326533653465356536653765386539654065416542654365446545654665476548654965506551655265536554655565566557655865596560656165626563656465656566656765686569657065716572657365746575657665776578657965806581658265836584658565866587658865896590659165926593659465956596659765986599660066016602660366046605660666076608660966106611661266136614661566166617661866196620662166226623662466256626662766286629663066316632663366346635663666376638663966406641664266436644664566466647664866496650665166526653665466556656665766586659666066616662666366646665666666676668666966706671667266736674667566766677667866796680668166826683668466856686668766886689669066916692669366946695669666976698669967006701670267036704670567066707670867096710671167126713671467156716671767186719672067216722672367246725672667276728672967306731673267336734673567366737673867396740674167426743674467456746674767486749675067516752675367546755675667576758675967606761676267636764676567666767676867696770677167726773677467756776677767786779678067816782678367846785678667876788678967906791679267936794679567966797679867996800680168026803680468056806680768086809681068116812681368146815681668176818681968206821682268236824682568266827682868296830683168326833683468356836683768386839684068416842684368446845684668476848684968506851685268536854685568566857685868596860686168626863686468656866686768686869687068716872687368746875687668776878687968806881688268836884688568866887688868896890689168926893689468956896689768986899690069016902690369046905690669076908690969106911691269136914691569166917691869196920692169226923692469256926692769286929693069316932693369346935693669376938693969406941694269436944694569466947694869496950695169526953695469556956695769586959696069616962696369646965696669676968696969706971697269736974697569766977697869796980698169826983698469856986698769886989699069916992699369946995699669976998699970007001700270037004700570067007700870097010701170127013701470157016701770187019702070217022702370247025702670277028702970307031703270337034703570367037703870397040704170427043704470457046704770487049705070517052705370547055705670577058705970607061706270637064706570667067706870697070707170727073707470757076707770787079708070817082708370847085708670877088708970907091709270937094709570967097709870997100710171027103710471057106710771087109711071117112711371147115711671177118711971207121712271237124712571267127712871297130713171327133713471357136713771387139714071417142714371447145714671477148714971507151715271537154715571567157715871597160716171627163716471657166716771687169717071717172717371747175717671777178717971807181718271837184718571867187718871897190719171927193719471957196719771987199720072017202720372047205720672077208720972107211721272137214721572167217721872197220722172227223722472257226722772287229723072317232723372347235723672377238723972407241724272437244724572467247724872497250725172527253725472557256725772587259726072617262726372647265726672677268726972707271727272737274727572767277727872797280728172827283728472857286728772887289729072917292729372947295729672977298729973007301730273037304730573067307730873097310731173127313731473157316731773187319732073217322732373247325732673277328732973307331733273337334733573367337733873397340734173427343734473457346734773487349735073517352735373547355735673577358735973607361736273637364736573667367736873697370737173727373737473757376737773787379738073817382738373847385738673877388738973907391739273937394739573967397739873997400740174027403740474057406740774087409741074117412741374147415741674177418741974207421742274237424742574267427742874297430743174327433743474357436743774387439744074417442744374447445744674477448744974507451745274537454745574567457745874597460746174627463746474657466746774687469747074717472747374747475747674777478747974807481748274837484748574867487748874897490749174927493749474957496749774987499750075017502750375047505750675077508750975107511751275137514751575167517751875197520752175227523752475257526752775287529753075317532753375347535753675377538753975407541754275437544754575467547754875497550755175527553755475557556755775587559756075617562756375647565756675677568756975707571757275737574757575767577757875797580758175827583758475857586758775887589759075917592759375947595759675977598759976007601760276037604760576067607760876097610761176127613761476157616761776187619762076217622762376247625762676277628762976307631763276337634763576367637763876397640764176427643764476457646764776487649765076517652765376547655765676577658765976607661766276637664766576667667766876697670767176727673767476757676767776787679768076817682768376847685768676877688768976907691769276937694769576967697769876997700770177027703770477057706770777087709771077117712771377147715771677177718771977207721772277237724772577267727772877297730773177327733773477357736773777387739774077417742774377447745774677477748774977507751775277537754775577567757775877597760776177627763776477657766776777687769777077717772777377747775777677777778777977807781778277837784778577867787778877897790779177927793779477957796779777987799780078017802780378047805780678077808780978107811781278137814781578167817781878197820782178227823782478257826782778287829783078317832783378347835783678377838783978407841784278437844784578467847784878497850785178527853785478557856785778587859786078617862786378647865786678677868786978707871787278737874787578767877787878797880788178827883788478857886788778887889789078917892789378947895789678977898789979007901790279037904790579067907790879097910791179127913791479157916791779187919792079217922792379247925792679277928792979307931793279337934793579367937793879397940794179427943794479457946794779487949795079517952795379547955795679577958795979607961796279637964796579667967796879697970797179727973797479757976797779787979798079817982798379847985798679877988798979907991799279937994799579967997799879998000800180028003800480058006800780088009801080118012801380148015801680178018801980208021802280238024802580268027802880298030803180328033803480358036803780388039804080418042804380448045804680478048804980508051805280538054805580568057805880598060806180628063806480658066806780688069807080718072807380748075807680778078807980808081808280838084808580868087808880898090809180928093809480958096809780988099810081018102810381048105810681078108810981108111811281138114811581168117811881198120812181228123812481258126812781288129813081318132813381348135813681378138813981408141814281438144814581468147814881498150815181528153815481558156815781588159816081618162816381648165816681678168816981708171817281738174817581768177817881798180818181828183818481858186818781888189819081918192819381948195819681978198819982008201820282038204820582068207820882098210821182128213821482158216821782188219822082218222822382248225822682278228822982308231823282338234823582368237823882398240824182428243824482458246824782488249825082518252825382548255825682578258825982608261826282638264826582668267826882698270827182728273827482758276827782788279828082818282828382848285828682878288828982908291829282938294829582968297829882998300830183028303830483058306830783088309831083118312831383148315831683178318831983208321832283238324832583268327832883298330833183328333833483358336833783388339834083418342834383448345834683478348834983508351835283538354835583568357835883598360836183628363836483658366836783688369837083718372837383748375837683778378837983808381838283838384838583868387838883898390839183928393839483958396839783988399840084018402840384048405840684078408840984108411841284138414841584168417841884198420842184228423842484258426842784288429843084318432843384348435843684378438843984408441844284438444844584468447844884498450845184528453845484558456845784588459846084618462846384648465846684678468846984708471847284738474847584768477847884798480848184828483848484858486848784888489849084918492849384948495849684978498849985008501850285038504850585068507850885098510851185128513851485158516851785188519852085218522852385248525852685278528852985308531853285338534853585368537853885398540854185428543854485458546854785488549855085518552855385548555855685578558855985608561856285638564856585668567856885698570857185728573857485758576857785788579858085818582858385848585858685878588858985908591859285938594859585968597859885998600860186028603860486058606860786088609861086118612861386148615861686178618861986208621862286238624862586268627862886298630863186328633863486358636863786388639864086418642864386448645864686478648864986508651865286538654865586568657865886598660866186628663866486658666866786688669867086718672867386748675867686778678867986808681868286838684868586868687868886898690869186928693869486958696869786988699870087018702870387048705870687078708870987108711871287138714871587168717871887198720872187228723872487258726872787288729873087318732873387348735873687378738873987408741874287438744874587468747874887498750875187528753875487558756875787588759876087618762876387648765876687678768876987708771877287738774877587768777877887798780878187828783878487858786878787888789879087918792879387948795879687978798879988008801880288038804880588068807880888098810881188128813881488158816881788188819882088218822882388248825882688278828882988308831883288338834883588368837883888398840884188428843884488458846884788488849885088518852885388548855885688578858885988608861886288638864886588668867886888698870887188728873887488758876887788788879888088818882888388848885888688878888888988908891889288938894889588968897889888998900890189028903890489058906890789088909891089118912891389148915891689178918891989208921892289238924892589268927892889298930893189328933893489358936893789388939894089418942894389448945894689478948894989508951895289538954895589568957895889598960896189628963896489658966896789688969897089718972897389748975897689778978897989808981898289838984898589868987898889898990899189928993899489958996899789988999900090019002900390049005900690079008900990109011901290139014901590169017901890199020902190229023902490259026902790289029903090319032903390349035903690379038903990409041904290439044904590469047904890499050905190529053905490559056905790589059906090619062906390649065906690679068906990709071907290739074907590769077907890799080908190829083908490859086908790889089909090919092909390949095909690979098909991009101910291039104910591069107910891099110911191129113911491159116911791189119912091219122912391249125912691279128912991309131913291339134913591369137913891399140914191429143914491459146914791489149915091519152915391549155915691579158915991609161916291639164916591669167916891699170917191729173917491759176917791789179918091819182918391849185918691879188918991909191919291939194919591969197919891999200920192029203920492059206920792089209921092119212921392149215921692179218921992209221922292239224922592269227922892299230923192329233923492359236923792389239924092419242924392449245924692479248924992509251925292539254925592569257925892599260926192629263926492659266926792689269927092719272927392749275927692779278927992809281928292839284928592869287928892899290929192929293929492959296929792989299930093019302930393049305930693079308930993109311931293139314931593169317931893199320932193229323932493259326932793289329933093319332933393349335933693379338933993409341934293439344934593469347934893499350935193529353935493559356935793589359936093619362936393649365936693679368936993709371937293739374937593769377937893799380938193829383938493859386938793889389939093919392939393949395939693979398939994009401940294039404940594069407940894099410941194129413941494159416941794189419942094219422942394249425942694279428942994309431943294339434943594369437943894399440944194429443944494459446944794489449945094519452945394549455945694579458945994609461946294639464946594669467946894699470947194729473947494759476947794789479948094819482948394849485948694879488948994909491949294939494949594969497949894999500950195029503950495059506950795089509951095119512951395149515951695179518951995209521952295239524952595269527952895299530953195329533953495359536953795389539954095419542954395449545954695479548954995509551955295539554955595569557955895599560956195629563956495659566956795689569957095719572957395749575957695779578957995809581958295839584958595869587958895899590959195929593959495959596959795989599960096019602960396049605960696079608960996109611961296139614961596169617961896199620962196229623962496259626962796289629963096319632963396349635963696379638963996409641964296439644964596469647964896499650965196529653965496559656965796589659966096619662966396649665966696679668966996709671967296739674967596769677967896799680968196829683968496859686968796889689969096919692969396949695969696979698969997009701970297039704970597069707970897099710971197129713971497159716971797189719972097219722972397249725972697279728972997309731973297339734973597369737973897399740974197429743974497459746974797489749975097519752975397549755975697579758975997609761976297639764976597669767976897699770977197729773977497759776977797789779978097819782978397849785978697879788978997909791979297939794979597969797979897999800980198029803980498059806980798089809981098119812981398149815981698179818981998209821982298239824982598269827982898299830983198329833983498359836983798389839984098419842984398449845984698479848984998509851985298539854985598569857985898599860986198629863986498659866986798689869987098719872987398749875987698779878987998809881988298839884988598869887988898899890989198929893989498959896989798989899990099019902990399049905990699079908990999109911991299139914991599169917991899199920992199229923992499259926992799289929993099319932993399349935993699379938993999409941994299439944994599469947994899499950995199529953995499559956995799589959996099619962996399649965996699679968996999709971997299739974997599769977997899799980998199829983998499859986998799889989999099919992999399949995999699979998999910000100011000210003100041000510006100071000810009100101001110012100131001410015100161001710018100191002010021100221002310024100251002610027100281002910030100311003210033100341003510036100371003810039100401004110042100431004410045100461004710048100491005010051100521005310054100551005610057100581005910060100611006210063100641006510066100671006810069100701007110072100731007410075100761007710078100791008010081100821008310084100851008610087100881008910090100911009210093100941009510096100971009810099101001010110102101031010410105101061010710108101091011010111101121011310114101151011610117101181011910120101211012210123101241012510126101271012810129101301013110132101331013410135101361013710138101391014010141101421014310144101451014610147101481014910150101511015210153101541015510156101571015810159101601016110162101631016410165101661016710168101691017010171101721017310174101751017610177101781017910180101811018210183101841018510186101871018810189101901019110192101931019410195101961019710198101991020010201102021020310204102051020610207102081020910210102111021210213102141021510216102171021810219102201022110222102231022410225102261022710228102291023010231102321023310234102351023610237102381023910240102411024210243102441024510246102471024810249102501025110252102531025410255102561025710258102591026010261102621026310264102651026610267102681026910270102711027210273102741027510276102771027810279102801028110282102831028410285102861028710288102891029010291102921029310294102951029610297102981029910300103011030210303103041030510306103071030810309103101031110312103131031410315103161031710318103191032010321103221032310324103251032610327103281032910330103311033210333103341033510336103371033810339103401034110342103431034410345103461034710348103491035010351103521035310354103551035610357103581035910360103611036210363103641036510366103671036810369103701037110372103731037410375103761037710378103791038010381103821038310384103851038610387103881038910390103911039210393103941039510396103971039810399104001040110402104031040410405104061040710408104091041010411104121041310414104151041610417104181041910420104211042210423104241042510426104271042810429104301043110432104331043410435104361043710438104391044010441104421044310444104451044610447104481044910450104511045210453104541045510456104571045810459104601046110462104631046410465104661046710468104691047010471104721047310474104751047610477104781047910480104811048210483104841048510486104871048810489104901049110492104931049410495104961049710498104991050010501105021050310504105051050610507105081050910510105111051210513105141051510516105171051810519105201052110522105231052410525105261052710528105291053010531105321053310534105351053610537105381053910540105411054210543105441054510546105471054810549105501055110552105531055410555105561055710558105591056010561105621056310564105651056610567105681056910570105711057210573105741057510576105771057810579105801058110582105831058410585105861058710588105891059010591105921059310594105951059610597105981059910600106011060210603106041060510606106071060810609106101061110612106131061410615106161061710618106191062010621106221062310624106251062610627106281062910630106311063210633106341063510636106371063810639106401064110642106431064410645106461064710648106491065010651106521065310654106551065610657106581065910660106611066210663106641066510666106671066810669106701067110672106731067410675106761067710678106791068010681106821068310684106851068610687106881068910690106911069210693106941069510696106971069810699107001070110702107031070410705107061070710708107091071010711107121071310714107151071610717107181071910720107211072210723107241072510726107271072810729107301073110732107331073410735107361073710738107391074010741107421074310744107451074610747107481074910750107511075210753107541075510756107571075810759107601076110762107631076410765107661076710768107691077010771107721077310774107751077610777107781077910780107811078210783107841078510786107871078810789107901079110792107931079410795107961079710798107991080010801108021080310804108051080610807108081080910810108111081210813108141081510816108171081810819108201082110822108231082410825108261082710828108291083010831108321083310834108351083610837108381083910840108411084210843108441084510846108471084810849108501085110852108531085410855108561085710858108591086010861108621086310864108651086610867108681086910870108711087210873108741087510876108771087810879108801088110882108831088410885108861088710888108891089010891108921089310894108951089610897108981089910900109011090210903109041090510906109071090810909109101091110912109131091410915109161091710918109191092010921109221092310924109251092610927109281092910930109311093210933109341093510936109371093810939109401094110942109431094410945109461094710948109491095010951109521095310954109551095610957109581095910960109611096210963109641096510966109671096810969109701097110972109731097410975109761097710978109791098010981109821098310984109851098610987109881098910990109911099210993109941099510996109971099810999110001100111002110031100411005110061100711008110091101011011110121101311014110151101611017110181101911020110211102211023110241102511026110271102811029110301103111032110331103411035110361103711038110391104011041110421104311044110451104611047110481104911050110511105211053110541105511056110571105811059110601106111062110631106411065110661106711068110691107011071110721107311074110751107611077110781107911080110811108211083110841108511086110871108811089110901109111092110931109411095110961109711098110991110011101111021110311104111051110611107111081110911110111111111211113111141111511116111171111811119111201112111122111231112411125111261112711128111291113011131111321113311134111351113611137111381113911140111411114211143111441114511146111471114811149111501115111152111531115411155111561115711158111591116011161111621116311164111651116611167111681116911170111711117211173111741117511176111771117811179111801118111182111831118411185111861118711188111891119011191111921119311194111951119611197111981119911200112011120211203112041120511206112071120811209112101121111212112131121411215112161121711218112191122011221112221122311224112251122611227112281122911230112311123211233112341123511236112371123811239112401124111242112431124411245112461124711248112491125011251112521125311254112551125611257112581125911260112611126211263112641126511266112671126811269112701127111272112731127411275112761127711278112791128011281112821128311284112851128611287112881128911290112911129211293112941129511296112971129811299113001130111302113031130411305113061130711308113091131011311113121131311314113151131611317113181131911320113211132211323113241132511326113271132811329113301133111332113331133411335113361133711338113391134011341113421134311344113451134611347113481134911350113511135211353113541135511356113571135811359113601136111362113631136411365113661136711368113691137011371113721137311374113751137611377113781137911380113811138211383113841138511386113871138811389113901139111392113931139411395113961139711398113991140011401114021140311404114051140611407114081140911410114111141211413114141141511416114171141811419114201142111422114231142411425114261142711428114291143011431114321143311434114351143611437114381143911440114411144211443114441144511446114471144811449114501145111452114531145411455114561145711458114591146011461114621146311464114651146611467114681146911470114711147211473114741147511476114771147811479114801148111482114831148411485114861148711488114891149011491114921149311494114951149611497114981149911500115011150211503115041150511506115071150811509115101151111512115131151411515115161151711518115191152011521115221152311524115251152611527115281152911530115311153211533115341153511536115371153811539115401154111542115431154411545115461154711548115491155011551115521155311554115551155611557115581155911560115611156211563115641156511566115671156811569115701157111572115731157411575115761157711578115791158011581115821158311584115851158611587115881158911590115911159211593115941159511596115971159811599116001160111602116031160411605116061160711608116091161011611116121161311614116151161611617116181161911620116211162211623116241162511626116271162811629116301163111632116331163411635116361163711638116391164011641116421164311644116451164611647116481164911650116511165211653116541165511656116571165811659116601166111662116631166411665116661166711668116691167011671116721167311674116751167611677116781167911680116811168211683116841168511686116871168811689116901169111692116931169411695116961169711698116991170011701117021170311704117051170611707117081170911710117111171211713117141171511716117171171811719117201172111722117231172411725117261172711728117291173011731117321173311734117351173611737117381173911740117411174211743117441174511746117471174811749117501175111752117531175411755117561175711758117591176011761117621176311764117651176611767117681176911770117711177211773117741177511776117771177811779117801178111782117831178411785117861178711788117891179011791117921179311794117951179611797117981179911800118011180211803118041180511806118071180811809118101181111812118131181411815118161181711818118191182011821118221182311824118251182611827118281182911830118311183211833118341183511836118371183811839118401184111842118431184411845118461184711848118491185011851118521185311854118551185611857118581185911860118611186211863118641186511866118671186811869118701187111872118731187411875118761187711878118791188011881118821188311884118851188611887118881188911890118911189211893118941189511896118971189811899119001190111902119031190411905119061190711908119091191011911119121191311914119151191611917119181191911920119211192211923119241192511926119271192811929119301193111932119331193411935119361193711938119391194011941119421194311944119451194611947119481194911950119511195211953119541195511956119571195811959119601196111962119631196411965119661196711968119691197011971119721197311974119751197611977119781197911980119811198211983119841198511986119871198811989119901199111992119931199411995119961199711998119991200012001120021200312004120051200612007120081200912010120111201212013120141201512016120171201812019120201202112022120231202412025120261202712028120291203012031120321203312034120351203612037120381203912040120411204212043120441204512046120471204812049120501205112052120531205412055120561205712058120591206012061120621206312064120651206612067120681206912070120711207212073120741207512076120771207812079120801208112082120831208412085120861208712088120891209012091120921209312094120951209612097120981209912100121011210212103121041210512106121071210812109121101211112112121131211412115121161211712118121191212012121121221212312124121251212612127121281212912130121311213212133121341213512136121371213812139121401214112142121431214412145121461214712148121491215012151121521215312154121551215612157121581215912160121611216212163121641216512166121671216812169121701217112172121731217412175121761217712178121791218012181121821218312184121851218612187121881218912190121911219212193121941219512196121971219812199122001220112202122031220412205122061220712208122091221012211122121221312214122151221612217122181221912220122211222212223122241222512226122271222812229122301223112232122331223412235122361223712238122391224012241122421224312244122451224612247122481224912250122511225212253122541225512256122571225812259122601226112262122631226412265122661226712268122691227012271122721227312274122751227612277122781227912280122811228212283122841228512286122871228812289122901229112292122931229412295122961229712298122991230012301123021230312304123051230612307123081230912310123111231212313123141231512316123171231812319123201232112322123231232412325123261232712328123291233012331123321233312334123351233612337123381233912340123411234212343123441234512346123471234812349123501235112352123531235412355123561235712358123591236012361123621236312364123651236612367123681236912370123711237212373123741237512376123771237812379123801238112382123831238412385123861238712388123891239012391123921239312394123951239612397123981239912400124011240212403124041240512406124071240812409124101241112412124131241412415124161241712418124191242012421124221242312424124251242612427124281242912430124311243212433124341243512436124371243812439124401244112442124431244412445124461244712448124491245012451124521245312454124551245612457124581245912460124611246212463124641246512466124671246812469124701247112472124731247412475124761247712478124791248012481124821248312484124851248612487124881248912490124911249212493124941249512496124971249812499125001250112502125031250412505125061250712508125091251012511125121251312514125151251612517125181251912520125211252212523125241252512526125271252812529125301253112532125331253412535125361253712538125391254012541125421254312544125451254612547125481254912550125511255212553125541255512556125571255812559125601256112562125631256412565125661256712568125691257012571125721257312574125751257612577125781257912580125811258212583125841258512586125871258812589125901259112592125931259412595125961259712598125991260012601126021260312604126051260612607126081260912610126111261212613126141261512616126171261812619126201262112622126231262412625126261262712628126291263012631126321263312634126351263612637126381263912640126411264212643126441264512646126471264812649126501265112652126531265412655126561265712658126591266012661126621266312664126651266612667126681266912670126711267212673126741267512676126771267812679126801268112682126831268412685126861268712688126891269012691126921269312694126951269612697126981269912700127011270212703127041270512706127071270812709127101271112712127131271412715127161271712718127191272012721127221272312724127251272612727127281272912730127311273212733127341273512736127371273812739127401274112742127431274412745127461274712748127491275012751127521275312754127551275612757127581275912760127611276212763127641276512766127671276812769127701277112772127731277412775127761277712778127791278012781127821278312784127851278612787127881278912790127911279212793127941279512796127971279812799128001280112802128031280412805128061280712808128091281012811128121281312814128151281612817128181281912820128211282212823128241282512826128271282812829128301283112832128331283412835128361283712838128391284012841128421284312844128451284612847128481284912850128511285212853128541285512856128571285812859128601286112862128631286412865128661286712868128691287012871128721287312874128751287612877128781287912880128811288212883128841288512886128871288812889128901289112892128931289412895128961289712898128991290012901129021290312904129051290612907129081290912910129111291212913129141291512916129171291812919129201292112922129231292412925129261292712928129291293012931129321293312934129351293612937129381293912940129411294212943129441294512946129471294812949129501295112952129531295412955129561295712958129591296012961129621296312964129651296612967129681296912970129711297212973129741297512976129771297812979129801298112982129831298412985129861298712988129891299012991129921299312994129951299612997129981299913000130011300213003130041300513006130071300813009130101301113012130131301413015130161301713018130191302013021130221302313024130251302613027130281302913030130311303213033130341303513036130371303813039130401304113042130431304413045130461304713048130491305013051130521305313054130551305613057130581305913060130611306213063130641306513066130671306813069130701307113072130731307413075130761307713078130791308013081130821308313084130851308613087130881308913090130911309213093130941309513096130971309813099131001310113102131031310413105131061310713108131091311013111131121311313114131151311613117131181311913120131211312213123131241312513126131271312813129131301313113132131331313413135131361313713138131391314013141131421314313144131451314613147131481314913150131511315213153131541315513156131571315813159131601316113162131631316413165131661316713168131691317013171131721317313174131751317613177131781317913180131811318213183131841318513186131871318813189131901319113192131931319413195131961319713198131991320013201132021320313204132051320613207132081320913210132111321213213132141321513216132171321813219132201322113222132231322413225132261322713228132291323013231132321323313234132351323613237132381323913240132411324213243132441324513246132471324813249132501325113252132531325413255132561325713258132591326013261132621326313264132651326613267132681326913270132711327213273132741327513276132771327813279132801328113282132831328413285132861328713288132891329013291132921329313294132951329613297132981329913300133011330213303133041330513306133071330813309133101331113312133131331413315133161331713318133191332013321133221332313324133251332613327133281332913330133311333213333133341333513336133371333813339133401334113342133431334413345133461334713348133491335013351133521335313354133551335613357133581335913360133611336213363133641336513366133671336813369133701337113372133731337413375133761337713378133791338013381133821338313384133851338613387133881338913390133911339213393133941339513396133971339813399134001340113402134031340413405134061340713408134091341013411134121341313414134151341613417134181341913420134211342213423134241342513426134271342813429134301343113432134331343413435134361343713438134391344013441134421344313444134451344613447134481344913450134511345213453134541345513456134571345813459134601346113462134631346413465134661346713468134691347013471134721347313474134751347613477134781347913480134811348213483134841348513486134871348813489134901349113492134931349413495134961349713498134991350013501135021350313504135051350613507135081350913510135111351213513135141351513516135171351813519135201352113522135231352413525135261352713528135291353013531135321353313534135351353613537135381353913540135411354213543135441354513546135471354813549135501355113552135531355413555135561355713558135591356013561135621356313564135651356613567135681356913570135711357213573135741357513576135771357813579135801358113582135831358413585135861358713588135891359013591135921359313594135951359613597135981359913600136011360213603136041360513606136071360813609136101361113612136131361413615136161361713618136191362013621136221362313624136251362613627136281362913630136311363213633136341363513636136371363813639136401364113642136431364413645136461364713648136491365013651136521365313654136551365613657136581365913660136611366213663136641366513666136671366813669136701367113672136731367413675136761367713678136791368013681136821368313684136851368613687136881368913690136911369213693136941369513696136971369813699137001370113702137031370413705137061370713708137091371013711137121371313714137151371613717137181371913720137211372213723137241372513726137271372813729137301373113732137331373413735137361373713738137391374013741137421374313744137451374613747137481374913750137511375213753137541375513756137571375813759137601376113762137631376413765137661376713768137691377013771137721377313774137751377613777137781377913780137811378213783137841378513786137871378813789137901379113792137931379413795137961379713798137991380013801138021380313804138051380613807138081380913810138111381213813138141381513816138171381813819138201382113822138231382413825138261382713828138291383013831138321383313834138351383613837138381383913840138411384213843138441384513846138471384813849138501385113852138531385413855138561385713858138591386013861138621386313864138651386613867138681386913870138711387213873138741387513876138771387813879138801388113882138831388413885138861388713888138891389013891138921389313894138951389613897138981389913900139011390213903139041390513906139071390813909139101391113912139131391413915139161391713918139191392013921139221392313924139251392613927139281392913930139311393213933139341393513936139371393813939139401394113942139431394413945139461394713948139491395013951139521395313954139551395613957139581395913960139611396213963139641396513966139671396813969139701397113972139731397413975139761397713978139791398013981139821398313984139851398613987139881398913990139911399213993139941399513996139971399813999140001400114002140031400414005140061400714008140091401014011140121401314014140151401614017140181401914020140211402214023140241402514026140271402814029140301403114032140331403414035140361403714038140391404014041140421404314044140451404614047140481404914050140511405214053140541405514056140571405814059140601406114062140631406414065140661406714068140691407014071140721407314074140751407614077140781407914080140811408214083140841408514086140871408814089140901409114092140931409414095140961409714098140991410014101141021410314104141051410614107141081410914110141111411214113141141411514116141171411814119141201412114122141231412414125141261412714128141291413014131141321413314134141351413614137141381413914140141411414214143141441414514146141471414814149141501415114152141531415414155141561415714158141591416014161141621416314164141651416614167141681416914170141711417214173141741417514176141771417814179141801418114182141831418414185141861418714188141891419014191141921419314194141951419614197141981419914200142011420214203142041420514206142071420814209142101421114212142131421414215142161421714218142191422014221142221422314224142251422614227142281422914230142311423214233142341423514236142371423814239142401424114242142431424414245142461424714248142491425014251142521425314254142551425614257142581425914260142611426214263142641426514266142671426814269142701427114272142731427414275142761427714278142791428014281142821428314284142851428614287142881428914290142911429214293142941429514296142971429814299143001430114302143031430414305143061430714308143091431014311143121431314314143151431614317143181431914320143211432214323143241432514326143271432814329143301433114332143331433414335143361433714338143391434014341143421434314344143451434614347143481434914350143511435214353143541435514356143571435814359143601436114362143631436414365143661436714368143691437014371143721437314374143751437614377143781437914380143811438214383143841438514386143871438814389143901439114392143931439414395143961439714398143991440014401144021440314404144051440614407144081440914410144111441214413144141441514416144171441814419144201442114422144231442414425144261442714428144291443014431144321443314434144351443614437144381443914440144411444214443144441444514446144471444814449144501445114452144531445414455144561445714458144591446014461144621446314464144651446614467144681446914470144711447214473144741447514476144771447814479144801448114482144831448414485144861448714488144891449014491144921449314494144951449614497144981449914500145011450214503145041450514506145071450814509145101451114512145131451414515145161451714518145191452014521145221452314524145251452614527145281452914530145311453214533145341453514536145371453814539145401454114542145431454414545145461454714548145491455014551145521455314554145551455614557145581455914560145611456214563145641456514566145671456814569145701457114572145731457414575145761457714578145791458014581145821458314584145851458614587145881458914590145911459214593145941459514596145971459814599146001460114602146031460414605146061460714608146091461014611146121461314614146151461614617146181461914620146211462214623146241462514626146271462814629146301463114632146331463414635146361463714638146391464014641146421464314644146451464614647146481464914650146511465214653146541465514656146571465814659146601466114662146631466414665146661466714668146691467014671146721467314674146751467614677146781467914680146811468214683146841468514686146871468814689146901469114692146931469414695146961469714698146991470014701147021470314704147051470614707147081470914710147111471214713147141471514716147171471814719147201472114722147231472414725147261472714728147291473014731147321473314734147351473614737147381473914740147411474214743147441474514746147471474814749147501475114752147531475414755147561475714758147591476014761147621476314764147651476614767147681476914770147711477214773147741477514776147771477814779147801478114782147831478414785147861478714788147891479014791147921479314794147951479614797147981479914800148011480214803148041480514806148071480814809148101481114812148131481414815148161481714818148191482014821148221482314824148251482614827148281482914830148311483214833148341483514836148371483814839148401484114842148431484414845148461484714848148491485014851148521485314854148551485614857148581485914860148611486214863148641486514866148671486814869148701487114872148731487414875148761487714878148791488014881148821488314884148851488614887148881488914890148911489214893148941489514896148971489814899149001490114902149031490414905149061490714908149091491014911149121491314914149151491614917149181491914920149211492214923149241492514926149271492814929149301493114932149331493414935149361493714938149391494014941149421494314944149451494614947149481494914950149511495214953149541495514956149571495814959149601496114962149631496414965149661496714968149691497014971149721497314974149751497614977149781497914980149811498214983149841498514986149871498814989149901499114992149931499414995149961499714998149991500015001150021500315004150051500615007150081500915010150111501215013150141501515016150171501815019150201502115022150231502415025150261502715028150291503015031150321503315034150351503615037150381503915040150411504215043150441504515046150471504815049150501505115052150531505415055150561505715058150591506015061150621506315064150651506615067150681506915070150711507215073150741507515076150771507815079150801508115082150831508415085150861508715088150891509015091150921509315094150951509615097150981509915100151011510215103151041510515106151071510815109151101511115112151131511415115151161511715118151191512015121151221512315124151251512615127151281512915130151311513215133151341513515136151371513815139151401514115142151431514415145151461514715148151491515015151151521515315154151551515615157151581515915160151611516215163151641516515166151671516815169151701517115172151731517415175151761517715178151791518015181151821518315184151851518615187151881518915190151911519215193151941519515196151971519815199152001520115202152031520415205152061520715208152091521015211152121521315214152151521615217152181521915220152211522215223152241522515226152271522815229152301523115232152331523415235152361523715238152391524015241152421524315244152451524615247152481524915250152511525215253152541525515256152571525815259152601526115262152631526415265152661526715268152691527015271152721527315274152751527615277152781527915280152811528215283152841528515286152871528815289152901529115292152931529415295152961529715298152991530015301153021530315304153051530615307153081530915310153111531215313153141531515316153171531815319153201532115322153231532415325153261532715328153291533015331153321533315334153351533615337153381533915340153411534215343153441534515346153471534815349153501535115352153531535415355153561535715358153591536015361153621536315364153651536615367153681536915370153711537215373153741537515376153771537815379153801538115382153831538415385153861538715388153891539015391153921539315394153951539615397153981539915400154011540215403154041540515406154071540815409154101541115412154131541415415154161541715418154191542015421154221542315424154251542615427154281542915430154311543215433154341543515436154371543815439154401544115442154431544415445154461544715448154491545015451154521545315454154551545615457154581545915460154611546215463154641546515466154671546815469154701547115472154731547415475154761547715478154791548015481154821548315484154851548615487154881548915490154911549215493154941549515496154971549815499155001550115502155031550415505155061550715508155091551015511155121551315514155151551615517155181551915520155211552215523155241552515526155271552815529155301553115532155331553415535155361553715538155391554015541155421554315544155451554615547155481554915550155511555215553155541555515556155571555815559155601556115562155631556415565155661556715568155691557015571155721557315574155751557615577155781557915580155811558215583155841558515586155871558815589155901559115592155931559415595155961559715598155991560015601156021560315604156051560615607156081560915610156111561215613156141561515616156171561815619156201562115622156231562415625156261562715628156291563015631156321563315634156351563615637156381563915640156411564215643156441564515646156471564815649156501565115652156531565415655156561565715658156591566015661156621566315664156651566615667156681566915670156711567215673156741567515676156771567815679156801568115682156831568415685156861568715688156891569015691156921569315694156951569615697156981569915700157011570215703157041570515706157071570815709157101571115712157131571415715157161571715718157191572015721157221572315724157251572615727157281572915730157311573215733157341573515736157371573815739157401574115742157431574415745157461574715748157491575015751157521575315754157551575615757157581575915760157611576215763157641576515766157671576815769157701577115772157731577415775157761577715778157791578015781157821578315784157851578615787157881578915790157911579215793157941579515796157971579815799158001580115802158031580415805158061580715808158091581015811158121581315814158151581615817158181581915820158211582215823158241582515826158271582815829158301583115832158331583415835158361583715838158391584015841158421584315844158451584615847158481584915850158511585215853158541585515856158571585815859158601586115862158631586415865158661586715868158691587015871158721587315874158751587615877158781587915880158811588215883158841588515886158871588815889158901589115892158931589415895158961589715898158991590015901159021590315904159051590615907159081590915910159111591215913159141591515916159171591815919159201592115922159231592415925159261592715928159291593015931159321593315934159351593615937159381593915940159411594215943159441594515946159471594815949159501595115952159531595415955159561595715958159591596015961159621596315964159651596615967159681596915970159711597215973159741597515976159771597815979159801598115982159831598415985159861598715988159891599015991159921599315994159951599615997159981599916000160011600216003160041600516006160071600816009160101601116012160131601416015160161601716018160191602016021160221602316024160251602616027160281602916030160311603216033160341603516036160371603816039160401604116042160431604416045160461604716048160491605016051160521605316054160551605616057160581605916060160611606216063160641606516066160671606816069160701607116072160731607416075160761607716078160791608016081160821608316084160851608616087160881608916090160911609216093160941609516096160971609816099161001610116102161031610416105161061610716108161091611016111161121611316114161151611616117161181611916120161211612216123161241612516126161271612816129161301613116132161331613416135161361613716138161391614016141161421614316144161451614616147161481614916150161511615216153161541615516156161571615816159161601616116162161631616416165161661616716168161691617016171161721617316174161751617616177161781617916180161811618216183161841618516186161871618816189161901619116192161931619416195161961619716198161991620016201162021620316204162051620616207162081620916210162111621216213162141621516216162171621816219162201622116222162231622416225162261622716228162291623016231162321623316234162351623616237162381623916240162411624216243162441624516246162471624816249162501625116252162531625416255162561625716258162591626016261162621626316264162651626616267162681626916270162711627216273162741627516276162771627816279162801628116282162831628416285162861628716288162891629016291162921629316294162951629616297162981629916300163011630216303163041630516306163071630816309163101631116312163131631416315163161631716318163191632016321163221632316324163251632616327163281632916330163311633216333163341633516336163371633816339163401634116342163431634416345163461634716348163491635016351163521635316354163551635616357163581635916360163611636216363163641636516366163671636816369163701637116372163731637416375163761637716378163791638016381163821638316384163851638616387163881638916390163911639216393163941639516396163971639816399164001640116402164031640416405164061640716408164091641016411164121641316414164151641616417164181641916420164211642216423164241642516426164271642816429164301643116432164331643416435164361643716438164391644016441164421644316444164451644616447164481644916450164511645216453164541645516456164571645816459164601646116462164631646416465164661646716468164691647016471164721647316474164751647616477164781647916480164811648216483164841648516486164871648816489164901649116492164931649416495164961649716498164991650016501165021650316504165051650616507165081650916510165111651216513165141651516516165171651816519165201652116522165231652416525165261652716528165291653016531165321653316534165351653616537165381653916540165411654216543165441654516546165471654816549165501655116552165531655416555165561655716558165591656016561165621656316564165651656616567165681656916570165711657216573165741657516576165771657816579165801658116582165831658416585165861658716588165891659016591165921659316594165951659616597165981659916600166011660216603166041660516606166071660816609166101661116612166131661416615166161661716618166191662016621166221662316624166251662616627166281662916630166311663216633166341663516636166371663816639166401664116642166431664416645166461664716648166491665016651166521665316654166551665616657166581665916660166611666216663166641666516666166671666816669166701667116672166731667416675166761667716678166791668016681166821668316684166851668616687166881668916690166911669216693166941669516696166971669816699167001670116702167031670416705167061670716708167091671016711167121671316714167151671616717167181671916720167211672216723167241672516726167271672816729167301673116732167331673416735167361673716738167391674016741167421674316744167451674616747167481674916750167511675216753167541675516756167571675816759167601676116762167631676416765167661676716768167691677016771167721677316774167751677616777167781677916780167811678216783167841678516786167871678816789167901679116792167931679416795167961679716798167991680016801168021680316804168051680616807168081680916810168111681216813168141681516816168171681816819168201682116822168231682416825168261682716828168291683016831168321683316834168351683616837168381683916840168411684216843168441684516846168471684816849168501685116852168531685416855168561685716858168591686016861168621686316864168651686616867168681686916870168711687216873168741687516876168771687816879168801688116882168831688416885168861688716888168891689016891168921689316894168951689616897168981689916900169011690216903169041690516906169071690816909169101691116912169131691416915169161691716918169191692016921169221692316924169251692616927169281692916930169311693216933169341693516936169371693816939169401694116942169431694416945169461694716948169491695016951169521695316954169551695616957169581695916960169611696216963169641696516966169671696816969169701697116972169731697416975169761697716978169791698016981169821698316984169851698616987169881698916990169911699216993169941699516996169971699816999170001700117002170031700417005170061700717008170091701017011170121701317014170151701617017170181701917020170211702217023170241702517026170271702817029170301703117032170331703417035170361703717038170391704017041170421704317044170451704617047170481704917050170511705217053170541705517056170571705817059170601706117062170631706417065170661706717068170691707017071170721707317074170751707617077170781707917080170811708217083170841708517086170871708817089170901709117092170931709417095170961709717098170991710017101171021710317104171051710617107171081710917110171111711217113171141711517116171171711817119171201712117122171231712417125171261712717128171291713017131171321713317134171351713617137171381713917140171411714217143171441714517146171471714817149171501715117152171531715417155171561715717158171591716017161171621716317164171651716617167171681716917170171711717217173171741717517176171771717817179171801718117182171831718417185171861718717188171891719017191171921719317194171951719617197171981719917200172011720217203172041720517206172071720817209172101721117212172131721417215172161721717218172191722017221172221722317224172251722617227172281722917230172311723217233172341723517236172371723817239172401724117242172431724417245172461724717248172491725017251172521725317254172551725617257172581725917260172611726217263172641726517266172671726817269172701727117272172731727417275172761727717278172791728017281172821728317284172851728617287172881728917290172911729217293172941729517296172971729817299173001730117302173031730417305173061730717308173091731017311173121731317314173151731617317173181731917320173211732217323173241732517326173271732817329173301733117332173331733417335173361733717338173391734017341173421734317344173451734617347173481734917350173511735217353173541735517356173571735817359173601736117362173631736417365173661736717368173691737017371173721737317374173751737617377173781737917380173811738217383173841738517386173871738817389173901739117392173931739417395173961739717398173991740017401174021740317404174051740617407174081740917410174111741217413174141741517416174171741817419174201742117422174231742417425174261742717428174291743017431174321743317434174351743617437174381743917440174411744217443174441744517446174471744817449174501745117452174531745417455174561745717458174591746017461174621746317464174651746617467174681746917470174711747217473174741747517476174771747817479174801748117482174831748417485174861748717488174891749017491174921749317494174951749617497174981749917500175011750217503175041750517506175071750817509175101751117512175131751417515175161751717518175191752017521175221752317524175251752617527175281752917530175311753217533175341753517536175371753817539175401754117542175431754417545175461754717548175491755017551175521755317554175551755617557175581755917560175611756217563175641756517566175671756817569175701757117572175731757417575175761757717578175791758017581175821758317584175851758617587175881758917590175911759217593175941759517596175971759817599176001760117602176031760417605176061760717608176091761017611176121761317614176151761617617176181761917620176211762217623176241762517626176271762817629176301763117632176331763417635176361763717638176391764017641176421764317644176451764617647176481764917650176511765217653176541765517656176571765817659176601766117662176631766417665176661766717668176691767017671176721767317674176751767617677176781767917680176811768217683176841768517686176871768817689176901769117692176931769417695176961769717698176991770017701177021770317704177051770617707177081770917710177111771217713177141771517716177171771817719177201772117722177231772417725177261772717728177291773017731177321773317734177351773617737177381773917740177411774217743177441774517746177471774817749177501775117752177531775417755177561775717758177591776017761177621776317764177651776617767177681776917770177711777217773177741777517776177771777817779177801778117782177831778417785177861778717788177891779017791177921779317794177951779617797177981779917800178011780217803178041780517806178071780817809178101781117812178131781417815178161781717818178191782017821178221782317824178251782617827178281782917830178311783217833178341783517836178371783817839178401784117842178431784417845178461784717848178491785017851178521785317854178551785617857178581785917860178611786217863178641786517866178671786817869178701787117872178731787417875178761787717878178791788017881178821788317884178851788617887178881788917890178911789217893178941789517896178971789817899179001790117902179031790417905179061790717908179091791017911179121791317914179151791617917179181791917920179211792217923179241792517926179271792817929179301793117932179331793417935179361793717938179391794017941179421794317944179451794617947179481794917950179511795217953179541795517956179571795817959179601796117962179631796417965179661796717968179691797017971179721797317974179751797617977179781797917980179811798217983179841798517986179871798817989179901799117992179931799417995179961799717998179991800018001180021800318004180051800618007180081800918010180111801218013180141801518016180171801818019180201802118022180231802418025180261802718028180291803018031180321803318034180351803618037180381803918040180411804218043180441804518046180471804818049180501805118052180531805418055180561805718058180591806018061180621806318064180651806618067180681806918070180711807218073180741807518076180771807818079180801808118082180831808418085180861808718088180891809018091180921809318094180951809618097180981809918100181011810218103181041810518106181071810818109181101811118112181131811418115181161811718118181191812018121181221812318124181251812618127181281812918130181311813218133181341813518136181371813818139181401814118142181431814418145181461814718148181491815018151181521815318154181551815618157181581815918160181611816218163181641816518166181671816818169181701817118172181731817418175181761817718178181791818018181181821818318184181851818618187181881818918190181911819218193181941819518196181971819818199182001820118202182031820418205182061820718208182091821018211182121821318214182151821618217182181821918220182211822218223182241822518226182271822818229182301823118232182331823418235182361823718238182391824018241182421824318244182451824618247182481824918250182511825218253182541825518256182571825818259182601826118262182631826418265182661826718268182691827018271182721827318274182751827618277182781827918280182811828218283182841828518286182871828818289182901829118292182931829418295182961829718298182991830018301183021830318304183051830618307183081830918310183111831218313183141831518316183171831818319183201832118322183231832418325183261832718328183291833018331183321833318334183351833618337183381833918340183411834218343183441834518346183471834818349183501835118352183531835418355183561835718358183591836018361183621836318364183651836618367183681836918370183711837218373183741837518376183771837818379183801838118382183831838418385183861838718388183891839018391183921839318394183951839618397183981839918400184011840218403184041840518406184071840818409184101841118412184131841418415184161841718418184191842018421184221842318424184251842618427184281842918430184311843218433184341843518436184371843818439184401844118442184431844418445184461844718448184491845018451184521845318454184551845618457184581845918460184611846218463184641846518466184671846818469184701847118472184731847418475184761847718478184791848018481184821848318484184851848618487184881848918490184911849218493184941849518496184971849818499185001850118502185031850418505185061850718508185091851018511185121851318514185151851618517185181851918520185211852218523185241852518526185271852818529185301853118532185331853418535185361853718538185391854018541185421854318544185451854618547185481854918550185511855218553185541855518556185571855818559185601856118562185631856418565185661856718568185691857018571185721857318574185751857618577185781857918580185811858218583185841858518586185871858818589185901859118592185931859418595185961859718598185991860018601186021860318604186051860618607186081860918610186111861218613186141861518616186171861818619186201862118622186231862418625186261862718628186291863018631186321863318634186351863618637186381863918640186411864218643186441864518646186471864818649186501865118652186531865418655186561865718658186591866018661186621866318664186651866618667186681866918670186711867218673186741867518676186771867818679186801868118682186831868418685186861868718688186891869018691186921869318694186951869618697186981869918700187011870218703187041870518706187071870818709187101871118712187131871418715187161871718718187191872018721187221872318724187251872618727187281872918730187311873218733187341873518736187371873818739187401874118742187431874418745187461874718748187491875018751187521875318754187551875618757187581875918760187611876218763187641876518766187671876818769187701877118772187731877418775187761877718778187791878018781187821878318784187851878618787187881878918790187911879218793187941879518796187971879818799188001880118802188031880418805188061880718808188091881018811188121881318814188151881618817188181881918820188211882218823188241882518826188271882818829188301883118832188331883418835188361883718838188391884018841188421884318844188451884618847188481884918850188511885218853188541885518856188571885818859188601886118862188631886418865188661886718868188691887018871188721887318874188751887618877188781887918880188811888218883188841888518886188871888818889188901889118892188931889418895188961889718898188991890018901189021890318904189051890618907189081890918910189111891218913189141891518916189171891818919189201892118922189231892418925189261892718928189291893018931189321893318934189351893618937189381893918940189411894218943189441894518946189471894818949189501895118952189531895418955189561895718958189591896018961189621896318964189651896618967189681896918970189711897218973189741897518976189771897818979189801898118982189831898418985189861898718988189891899018991189921899318994189951899618997189981899919000190011900219003190041900519006190071900819009190101901119012190131901419015190161901719018190191902019021190221902319024190251902619027190281902919030190311903219033190341903519036190371903819039190401904119042190431904419045190461904719048190491905019051190521905319054190551905619057190581905919060190611906219063190641906519066190671906819069190701907119072190731907419075190761907719078190791908019081190821908319084190851908619087190881908919090190911909219093190941909519096190971909819099191001910119102191031910419105191061910719108191091911019111191121911319114191151911619117191181911919120191211912219123191241912519126191271912819129191301913119132191331913419135191361913719138191391914019141191421914319144191451914619147191481914919150191511915219153191541915519156191571915819159191601916119162191631916419165191661916719168191691917019171191721917319174191751917619177191781917919180191811918219183191841918519186191871918819189191901919119192191931919419195191961919719198191991920019201192021920319204192051920619207192081920919210192111921219213192141921519216192171921819219192201922119222192231922419225192261922719228192291923019231192321923319234192351923619237192381923919240192411924219243192441924519246192471924819249192501925119252192531925419255192561925719258192591926019261192621926319264192651926619267192681926919270192711927219273192741927519276192771927819279192801928119282192831928419285192861928719288192891929019291192921929319294192951929619297192981929919300193011930219303193041930519306193071930819309193101931119312193131931419315193161931719318193191932019321193221932319324193251932619327193281932919330193311933219333193341933519336193371933819339193401934119342193431934419345193461934719348193491935019351193521935319354193551935619357193581935919360193611936219363193641936519366193671936819369193701937119372193731937419375193761937719378193791938019381193821938319384193851938619387193881938919390193911939219393193941939519396193971939819399194001940119402194031940419405194061940719408194091941019411194121941319414194151941619417194181941919420194211942219423194241942519426194271942819429194301943119432194331943419435194361943719438194391944019441194421944319444194451944619447194481944919450194511945219453194541945519456194571945819459194601946119462194631946419465194661946719468194691947019471194721947319474194751947619477194781947919480194811948219483194841948519486194871948819489194901949119492194931949419495194961949719498194991950019501195021950319504195051950619507195081950919510195111951219513195141951519516195171951819519195201952119522195231952419525195261952719528195291953019531195321953319534195351953619537195381953919540195411954219543195441954519546195471954819549195501955119552195531955419555195561955719558195591956019561195621956319564195651956619567195681956919570195711957219573195741957519576195771957819579195801958119582195831958419585195861958719588195891959019591195921959319594195951959619597195981959919600196011960219603196041960519606196071960819609196101961119612196131961419615196161961719618196191962019621196221962319624196251962619627196281962919630196311963219633196341963519636196371963819639196401964119642196431964419645196461964719648196491965019651196521965319654196551965619657196581965919660196611966219663196641966519666196671966819669196701967119672196731967419675196761967719678196791968019681196821968319684196851968619687196881968919690196911969219693196941969519696196971969819699197001970119702197031970419705197061970719708197091971019711197121971319714197151971619717197181971919720197211972219723197241972519726197271972819729197301973119732197331973419735197361973719738197391974019741197421974319744197451974619747197481974919750197511975219753197541975519756197571975819759197601976119762197631976419765197661976719768197691977019771197721977319774197751977619777197781977919780197811978219783197841978519786197871978819789197901979119792197931979419795197961979719798197991980019801198021980319804198051980619807198081980919810198111981219813198141981519816198171981819819198201982119822198231982419825198261982719828198291983019831198321983319834198351983619837198381983919840198411984219843198441984519846198471984819849198501985119852198531985419855198561985719858198591986019861198621986319864198651986619867198681986919870198711987219873198741987519876198771987819879198801988119882198831988419885198861988719888198891989019891198921989319894198951989619897198981989919900199011990219903199041990519906199071990819909199101991119912199131991419915199161991719918199191992019921199221992319924199251992619927199281992919930199311993219933199341993519936199371993819939199401994119942199431994419945199461994719948199491995019951199521995319954199551995619957199581995919960199611996219963199641996519966199671996819969199701997119972199731997419975199761997719978199791998019981199821998319984199851998619987199881998919990199911999219993199941999519996199971999819999200002000120002200032000420005200062000720008200092001020011200122001320014200152001620017200182001920020200212002220023200242002520026200272002820029200302003120032200332003420035200362003720038200392004020041200422004320044200452004620047200482004920050200512005220053200542005520056200572005820059200602006120062200632006420065200662006720068200692007020071200722007320074200752007620077200782007920080200812008220083200842008520086200872008820089200902009120092200932009420095200962009720098200992010020101201022010320104201052010620107201082010920110201112011220113201142011520116201172011820119201202012120122201232012420125201262012720128201292013020131201322013320134201352013620137201382013920140201412014220143201442014520146201472014820149201502015120152201532015420155201562015720158201592016020161201622016320164201652016620167201682016920170201712017220173201742017520176201772017820179201802018120182201832018420185201862018720188201892019020191201922019320194201952019620197201982019920200202012020220203202042020520206202072020820209202102021120212202132021420215202162021720218202192022020221202222022320224202252022620227202282022920230202312023220233202342023520236202372023820239202402024120242202432024420245202462024720248202492025020251202522025320254202552025620257202582025920260202612026220263202642026520266202672026820269202702027120272202732027420275202762027720278202792028020281202822028320284202852028620287202882028920290202912029220293202942029520296202972029820299203002030120302203032030420305203062030720308203092031020311203122031320314203152031620317203182031920320203212032220323203242032520326203272032820329203302033120332203332033420335203362033720338203392034020341203422034320344203452034620347203482034920350203512035220353203542035520356203572035820359203602036120362203632036420365203662036720368203692037020371203722037320374203752037620377203782037920380203812038220383203842038520386203872038820389203902039120392203932039420395203962039720398203992040020401204022040320404204052040620407204082040920410204112041220413204142041520416204172041820419204202042120422204232042420425204262042720428204292043020431204322043320434204352043620437204382043920440204412044220443204442044520446204472044820449204502045120452204532045420455204562045720458204592046020461204622046320464204652046620467204682046920470204712047220473204742047520476204772047820479204802048120482204832048420485204862048720488204892049020491204922049320494204952049620497204982049920500205012050220503205042050520506205072050820509205102051120512205132051420515205162051720518205192052020521205222052320524205252052620527205282052920530205312053220533205342053520536205372053820539205402054120542205432054420545205462054720548205492055020551205522055320554205552055620557205582055920560205612056220563205642056520566205672056820569205702057120572205732057420575205762057720578205792058020581205822058320584205852058620587205882058920590205912059220593205942059520596205972059820599206002060120602206032060420605206062060720608206092061020611206122061320614206152061620617206182061920620206212062220623206242062520626206272062820629206302063120632206332063420635206362063720638206392064020641206422064320644206452064620647206482064920650206512065220653206542065520656206572065820659206602066120662206632066420665206662066720668206692067020671206722067320674206752067620677206782067920680206812068220683206842068520686206872068820689206902069120692206932069420695206962069720698206992070020701207022070320704207052070620707207082070920710207112071220713207142071520716207172071820719207202072120722207232072420725207262072720728207292073020731207322073320734207352073620737207382073920740207412074220743207442074520746207472074820749207502075120752207532075420755207562075720758207592076020761207622076320764207652076620767207682076920770207712077220773207742077520776207772077820779207802078120782207832078420785207862078720788207892079020791207922079320794207952079620797207982079920800208012080220803208042080520806208072080820809208102081120812208132081420815208162081720818208192082020821208222082320824208252082620827208282082920830208312083220833208342083520836208372083820839208402084120842208432084420845208462084720848208492085020851208522085320854208552085620857208582085920860208612086220863208642086520866208672086820869208702087120872208732087420875208762087720878208792088020881208822088320884208852088620887208882088920890208912089220893208942089520896208972089820899209002090120902209032090420905209062090720908209092091020911209122091320914209152091620917209182091920920209212092220923209242092520926209272092820929209302093120932209332093420935209362093720938209392094020941209422094320944209452094620947209482094920950209512095220953209542095520956209572095820959209602096120962209632096420965209662096720968209692097020971209722097320974209752097620977209782097920980209812098220983209842098520986209872098820989209902099120992209932099420995209962099720998209992100021001210022100321004210052100621007210082100921010210112101221013210142101521016210172101821019210202102121022210232102421025210262102721028210292103021031210322103321034210352103621037210382103921040210412104221043210442104521046210472104821049210502105121052210532105421055210562105721058210592106021061210622106321064210652106621067210682106921070210712107221073210742107521076210772107821079210802108121082210832108421085210862108721088210892109021091210922109321094210952109621097210982109921100211012110221103211042110521106211072110821109211102111121112211132111421115211162111721118211192112021121211222112321124211252112621127211282112921130211312113221133211342113521136211372113821139211402114121142211432114421145211462114721148211492115021151211522115321154211552115621157211582115921160211612116221163211642116521166211672116821169211702117121172211732117421175211762117721178211792118021181211822118321184211852118621187211882118921190211912119221193211942119521196211972119821199212002120121202212032120421205212062120721208212092121021211212122121321214212152121621217212182121921220212212122221223212242122521226212272122821229212302123121232212332123421235212362123721238212392124021241212422124321244212452124621247212482124921250212512125221253212542125521256212572125821259212602126121262212632126421265212662126721268212692127021271212722127321274212752127621277212782127921280212812128221283212842128521286212872128821289212902129121292212932129421295212962129721298212992130021301213022130321304213052130621307213082130921310213112131221313213142131521316213172131821319213202132121322213232132421325213262132721328213292133021331213322133321334213352133621337213382133921340213412134221343213442134521346213472134821349213502135121352213532135421355213562135721358213592136021361213622136321364213652136621367213682136921370213712137221373213742137521376213772137821379213802138121382213832138421385213862138721388213892139021391213922139321394213952139621397213982139921400214012140221403214042140521406214072140821409214102141121412214132141421415214162141721418214192142021421214222142321424214252142621427214282142921430214312143221433214342143521436214372143821439214402144121442214432144421445214462144721448214492145021451214522145321454214552145621457214582145921460214612146221463214642146521466214672146821469214702147121472214732147421475214762147721478214792148021481214822148321484214852148621487214882148921490214912149221493214942149521496214972149821499215002150121502215032150421505215062150721508215092151021511215122151321514215152151621517215182151921520215212152221523215242152521526215272152821529215302153121532215332153421535215362153721538215392154021541215422154321544215452154621547215482154921550215512155221553215542155521556215572155821559215602156121562215632156421565215662156721568215692157021571215722157321574215752157621577215782157921580215812158221583215842158521586215872158821589215902159121592215932159421595215962159721598215992160021601216022160321604216052160621607216082160921610216112161221613216142161521616216172161821619216202162121622216232162421625216262162721628216292163021631216322163321634216352163621637216382163921640216412164221643216442164521646216472164821649216502165121652216532165421655216562165721658216592166021661216622166321664216652166621667216682166921670216712167221673216742167521676216772167821679216802168121682216832168421685216862168721688216892169021691216922169321694216952169621697216982169921700217012170221703217042170521706217072170821709217102171121712217132171421715217162171721718217192172021721217222172321724217252172621727217282172921730217312173221733217342173521736217372173821739217402174121742217432174421745217462174721748217492175021751217522175321754217552175621757217582175921760217612176221763217642176521766217672176821769217702177121772217732177421775217762177721778217792178021781217822178321784217852178621787217882178921790217912179221793217942179521796217972179821799218002180121802218032180421805218062180721808218092181021811218122181321814218152181621817218182181921820218212182221823218242182521826218272182821829218302183121832218332183421835218362183721838218392184021841218422184321844218452184621847218482184921850218512185221853218542185521856218572185821859218602186121862218632186421865218662186721868218692187021871218722187321874218752187621877218782187921880218812188221883218842188521886218872188821889218902189121892218932189421895218962189721898218992190021901219022190321904219052190621907219082190921910219112191221913219142191521916219172191821919219202192121922219232192421925219262192721928219292193021931219322193321934219352193621937219382193921940219412194221943219442194521946219472194821949219502195121952219532195421955219562195721958219592196021961219622196321964219652196621967219682196921970219712197221973219742197521976219772197821979219802198121982219832198421985219862198721988219892199021991219922199321994219952199621997219982199922000220012200222003220042200522006220072200822009220102201122012220132201422015220162201722018220192202022021220222202322024220252202622027220282202922030220312203222033220342203522036220372203822039220402204122042220432204422045220462204722048220492205022051220522205322054220552205622057220582205922060220612206222063220642206522066220672206822069220702207122072220732207422075220762207722078220792208022081220822208322084220852208622087220882208922090220912209222093220942209522096220972209822099221002210122102221032210422105221062210722108221092211022111221122211322114221152211622117221182211922120221212212222123221242212522126221272212822129221302213122132221332213422135221362213722138221392214022141221422214322144221452214622147221482214922150221512215222153221542215522156221572215822159221602216122162221632216422165221662216722168221692217022171221722217322174221752217622177221782217922180221812218222183221842218522186221872218822189221902219122192221932219422195221962219722198221992220022201222022220322204222052220622207222082220922210222112221222213222142221522216222172221822219222202222122222222232222422225222262222722228222292223022231222322223322234222352223622237222382223922240222412224222243222442224522246222472224822249222502225122252222532225422255222562225722258222592226022261222622226322264222652226622267222682226922270222712227222273222742227522276222772227822279222802228122282222832228422285222862228722288222892229022291222922229322294222952229622297222982229922300223012230222303223042230522306223072230822309223102231122312223132231422315223162231722318223192232022321223222232322324223252232622327223282232922330223312233222333223342233522336223372233822339223402234122342223432234422345223462234722348223492235022351223522235322354223552235622357223582235922360223612236222363223642236522366223672236822369223702237122372223732237422375223762237722378223792238022381223822238322384223852238622387223882238922390223912239222393223942239522396223972239822399224002240122402224032240422405224062240722408224092241022411224122241322414224152241622417224182241922420224212242222423224242242522426224272242822429224302243122432224332243422435224362243722438224392244022441224422244322444224452244622447224482244922450224512245222453224542245522456224572245822459224602246122462224632246422465224662246722468224692247022471224722247322474224752247622477224782247922480224812248222483224842248522486224872248822489224902249122492224932249422495224962249722498224992250022501225022250322504225052250622507225082250922510225112251222513225142251522516225172251822519225202252122522225232252422525225262252722528225292253022531225322253322534225352253622537225382253922540225412254222543225442254522546225472254822549225502255122552225532255422555225562255722558225592256022561225622256322564225652256622567225682256922570225712257222573225742257522576225772257822579225802258122582225832258422585225862258722588225892259022591225922259322594225952259622597225982259922600226012260222603226042260522606226072260822609226102261122612226132261422615226162261722618226192262022621226222262322624226252262622627226282262922630226312263222633226342263522636226372263822639226402264122642226432264422645226462264722648226492265022651226522265322654226552265622657226582265922660226612266222663226642266522666226672266822669226702267122672226732267422675226762267722678226792268022681226822268322684226852268622687226882268922690226912269222693226942269522696226972269822699227002270122702227032270422705227062270722708227092271022711227122271322714227152271622717227182271922720227212272222723227242272522726227272272822729227302273122732227332273422735227362273722738227392274022741227422274322744227452274622747227482274922750227512275222753227542275522756227572275822759227602276122762227632276422765227662276722768227692277022771227722277322774227752277622777227782277922780227812278222783227842278522786227872278822789227902279122792227932279422795227962279722798227992280022801228022280322804228052280622807228082280922810228112281222813228142281522816228172281822819228202282122822228232282422825228262282722828228292283022831228322283322834228352283622837228382283922840228412284222843228442284522846228472284822849228502285122852228532285422855228562285722858228592286022861228622286322864228652286622867228682286922870228712287222873228742287522876228772287822879228802288122882228832288422885228862288722888228892289022891228922289322894228952289622897228982289922900229012290222903229042290522906229072290822909229102291122912229132291422915229162291722918229192292022921229222292322924229252292622927229282292922930229312293222933229342293522936229372293822939229402294122942229432294422945229462294722948229492295022951229522295322954229552295622957229582295922960229612296222963229642296522966229672296822969229702297122972229732297422975229762297722978229792298022981229822298322984229852298622987229882298922990229912299222993229942299522996229972299822999230002300123002230032300423005230062300723008230092301023011230122301323014230152301623017230182301923020230212302223023230242302523026230272302823029230302303123032230332303423035230362303723038230392304023041230422304323044230452304623047230482304923050230512305223053230542305523056230572305823059230602306123062230632306423065230662306723068230692307023071230722307323074230752307623077230782307923080230812308223083230842308523086230872308823089230902309123092230932309423095230962309723098230992310023101231022310323104231052310623107231082310923110231112311223113231142311523116231172311823119231202312123122231232312423125231262312723128231292313023131231322313323134231352313623137231382313923140231412314223143231442314523146231472314823149231502315123152231532315423155231562315723158231592316023161231622316323164231652316623167231682316923170231712317223173231742317523176231772317823179231802318123182231832318423185231862318723188231892319023191231922319323194231952319623197231982319923200232012320223203232042320523206232072320823209232102321123212232132321423215232162321723218232192322023221232222322323224232252322623227232282322923230232312323223233232342323523236232372323823239232402324123242232432324423245232462324723248232492325023251232522325323254232552325623257232582325923260232612326223263232642326523266232672326823269232702327123272232732327423275232762327723278232792328023281232822328323284232852328623287232882328923290232912329223293232942329523296232972329823299233002330123302233032330423305233062330723308233092331023311233122331323314233152331623317233182331923320233212332223323233242332523326233272332823329233302333123332233332333423335233362333723338233392334023341233422334323344233452334623347233482334923350233512335223353233542335523356233572335823359233602336123362233632336423365233662336723368233692337023371233722337323374233752337623377233782337923380233812338223383233842338523386233872338823389233902339123392233932339423395233962339723398233992340023401234022340323404234052340623407234082340923410234112341223413234142341523416234172341823419234202342123422234232342423425234262342723428234292343023431234322343323434234352343623437234382343923440234412344223443234442344523446234472344823449234502345123452234532345423455234562345723458234592346023461234622346323464234652346623467234682346923470234712347223473234742347523476234772347823479234802348123482234832348423485234862348723488234892349023491234922349323494234952349623497234982349923500235012350223503235042350523506235072350823509235102351123512235132351423515235162351723518235192352023521235222352323524235252352623527235282352923530235312353223533235342353523536235372353823539235402354123542235432354423545235462354723548235492355023551235522355323554235552355623557235582355923560235612356223563235642356523566235672356823569235702357123572235732357423575235762357723578235792358023581235822358323584235852358623587235882358923590235912359223593235942359523596235972359823599236002360123602236032360423605236062360723608236092361023611236122361323614236152361623617236182361923620236212362223623236242362523626236272362823629236302363123632236332363423635236362363723638236392364023641236422364323644236452364623647236482364923650236512365223653236542365523656236572365823659236602366123662236632366423665236662366723668236692367023671236722367323674236752367623677236782367923680236812368223683236842368523686236872368823689236902369123692236932369423695236962369723698236992370023701237022370323704237052370623707237082370923710237112371223713237142371523716237172371823719237202372123722237232372423725237262372723728237292373023731237322373323734237352373623737237382373923740237412374223743237442374523746237472374823749237502375123752237532375423755237562375723758237592376023761237622376323764237652376623767237682376923770237712377223773237742377523776237772377823779237802378123782237832378423785237862378723788237892379023791237922379323794237952379623797237982379923800238012380223803238042380523806238072380823809238102381123812238132381423815238162381723818238192382023821238222382323824238252382623827238282382923830238312383223833238342383523836238372383823839238402384123842238432384423845238462384723848238492385023851238522385323854238552385623857238582385923860238612386223863238642386523866238672386823869238702387123872238732387423875238762387723878238792388023881238822388323884238852388623887238882388923890238912389223893238942389523896238972389823899239002390123902239032390423905239062390723908239092391023911239122391323914239152391623917239182391923920239212392223923239242392523926239272392823929239302393123932239332393423935239362393723938239392394023941239422394323944239452394623947239482394923950239512395223953239542395523956239572395823959239602396123962239632396423965239662396723968239692397023971239722397323974239752397623977239782397923980239812398223983239842398523986239872398823989239902399123992239932399423995239962399723998239992400024001240022400324004240052400624007240082400924010240112401224013240142401524016240172401824019240202402124022240232402424025240262402724028240292403024031240322403324034240352403624037240382403924040240412404224043240442404524046240472404824049240502405124052240532405424055240562405724058240592406024061240622406324064240652406624067240682406924070240712407224073240742407524076240772407824079240802408124082240832408424085240862408724088240892409024091240922409324094240952409624097240982409924100241012410224103241042410524106241072410824109241102411124112241132411424115241162411724118241192412024121241222412324124241252412624127241282412924130241312413224133241342413524136241372413824139241402414124142241432414424145241462414724148241492415024151241522415324154241552415624157241582415924160241612416224163241642416524166241672416824169241702417124172241732417424175241762417724178241792418024181241822418324184241852418624187241882418924190241912419224193241942419524196241972419824199242002420124202242032420424205242062420724208242092421024211242122421324214242152421624217242182421924220242212422224223242242422524226242272422824229242302423124232242332423424235242362423724238242392424024241242422424324244242452424624247242482424924250242512425224253242542425524256242572425824259242602426124262242632426424265242662426724268242692427024271242722427324274242752427624277242782427924280242812428224283242842428524286242872428824289242902429124292242932429424295242962429724298242992430024301243022430324304243052430624307243082430924310243112431224313243142431524316243172431824319243202432124322243232432424325243262432724328243292433024331243322433324334243352433624337243382433924340243412434224343243442434524346243472434824349243502435124352243532435424355243562435724358243592436024361243622436324364243652436624367243682436924370243712437224373243742437524376243772437824379243802438124382243832438424385243862438724388243892439024391243922439324394243952439624397243982439924400244012440224403244042440524406244072440824409244102441124412244132441424415244162441724418244192442024421244222442324424244252442624427244282442924430244312443224433244342443524436244372443824439244402444124442244432444424445244462444724448244492445024451244522445324454244552445624457244582445924460244612446224463244642446524466244672446824469244702447124472244732447424475244762447724478244792448024481244822448324484244852448624487244882448924490244912449224493244942449524496244972449824499245002450124502245032450424505245062450724508245092451024511245122451324514245152451624517245182451924520245212452224523245242452524526245272452824529245302453124532245332453424535245362453724538245392454024541245422454324544245452454624547245482454924550245512455224553245542455524556245572455824559245602456124562245632456424565245662456724568245692457024571245722457324574245752457624577245782457924580245812458224583245842458524586245872458824589245902459124592245932459424595245962459724598245992460024601246022460324604246052460624607246082460924610246112461224613246142461524616246172461824619246202462124622246232462424625246262462724628246292463024631246322463324634246352463624637246382463924640246412464224643246442464524646246472464824649246502465124652246532465424655246562465724658246592466024661246622466324664246652466624667246682466924670246712467224673246742467524676246772467824679246802468124682246832468424685246862468724688246892469024691246922469324694246952469624697246982469924700247012470224703247042470524706247072470824709247102471124712247132471424715247162471724718247192472024721247222472324724247252472624727247282472924730247312473224733247342473524736247372473824739247402474124742247432474424745247462474724748247492475024751247522475324754247552475624757247582475924760247612476224763247642476524766247672476824769247702477124772247732477424775247762477724778247792478024781247822478324784247852478624787247882478924790247912479224793247942479524796247972479824799248002480124802248032480424805248062480724808248092481024811248122481324814248152481624817248182481924820248212482224823248242482524826248272482824829248302483124832248332483424835248362483724838248392484024841248422484324844248452484624847248482484924850248512485224853248542485524856248572485824859248602486124862248632486424865248662486724868248692487024871248722487324874248752487624877248782487924880248812488224883248842488524886248872488824889248902489124892248932489424895248962489724898248992490024901249022490324904249052490624907249082490924910249112491224913249142491524916249172491824919249202492124922249232492424925249262492724928249292493024931249322493324934249352493624937249382493924940249412494224943249442494524946249472494824949249502495124952249532495424955249562495724958249592496024961249622496324964249652496624967249682496924970249712497224973249742497524976249772497824979249802498124982249832498424985249862498724988249892499024991249922499324994249952499624997249982499925000250012500225003250042500525006250072500825009250102501125012250132501425015250162501725018250192502025021250222502325024250252502625027250282502925030250312503225033250342503525036250372503825039250402504125042250432504425045250462504725048250492505025051250522505325054250552505625057250582505925060250612506225063250642506525066250672506825069250702507125072250732507425075250762507725078250792508025081250822508325084250852508625087250882508925090250912509225093250942509525096250972509825099251002510125102251032510425105251062510725108251092511025111251122511325114251152511625117251182511925120251212512225123251242512525126251272512825129251302513125132251332513425135251362513725138251392514025141251422514325144251452514625147251482514925150251512515225153251542515525156251572515825159251602516125162251632516425165251662516725168251692517025171251722517325174251752517625177251782517925180251812518225183251842518525186251872518825189251902519125192251932519425195251962519725198251992520025201252022520325204252052520625207252082520925210252112521225213252142521525216252172521825219252202522125222252232522425225252262522725228252292523025231252322523325234252352523625237252382523925240252412524225243252442524525246252472524825249252502525125252252532525425255252562525725258252592526025261252622526325264252652526625267252682526925270252712527225273252742527525276252772527825279252802528125282252832528425285252862528725288252892529025291252922529325294252952529625297252982529925300253012530225303253042530525306253072530825309253102531125312253132531425315253162531725318253192532025321253222532325324253252532625327253282532925330253312533225333253342533525336253372533825339253402534125342253432534425345253462534725348253492535025351253522535325354253552535625357253582535925360253612536225363253642536525366253672536825369253702537125372253732537425375253762537725378253792538025381253822538325384253852538625387253882538925390253912539225393253942539525396253972539825399254002540125402254032540425405254062540725408254092541025411254122541325414254152541625417254182541925420254212542225423254242542525426254272542825429254302543125432254332543425435254362543725438254392544025441254422544325444254452544625447254482544925450254512545225453254542545525456254572545825459254602546125462254632546425465254662546725468254692547025471254722547325474254752547625477254782547925480254812548225483254842548525486254872548825489254902549125492254932549425495254962549725498254992550025501255022550325504255052550625507255082550925510255112551225513255142551525516255172551825519255202552125522255232552425525255262552725528255292553025531255322553325534255352553625537255382553925540255412554225543255442554525546255472554825549255502555125552255532555425555255562555725558255592556025561255622556325564255652556625567255682556925570255712557225573255742557525576255772557825579255802558125582255832558425585255862558725588255892559025591255922559325594255952559625597255982559925600256012560225603256042560525606256072560825609256102561125612256132561425615256162561725618256192562025621256222562325624256252562625627256282562925630256312563225633256342563525636256372563825639256402564125642256432564425645256462564725648256492565025651256522565325654256552565625657256582565925660256612566225663256642566525666256672566825669256702567125672256732567425675256762567725678256792568025681256822568325684256852568625687256882568925690256912569225693256942569525696256972569825699257002570125702257032570425705257062570725708257092571025711257122571325714257152571625717257182571925720257212572225723257242572525726257272572825729257302573125732257332573425735257362573725738257392574025741257422574325744257452574625747257482574925750257512575225753257542575525756257572575825759257602576125762257632576425765257662576725768257692577025771257722577325774257752577625777257782577925780257812578225783257842578525786257872578825789257902579125792257932579425795257962579725798257992580025801258022580325804258052580625807258082580925810258112581225813258142581525816258172581825819258202582125822258232582425825258262582725828258292583025831258322583325834258352583625837258382583925840258412584225843258442584525846258472584825849258502585125852258532585425855258562585725858258592586025861258622586325864258652586625867258682586925870258712587225873258742587525876258772587825879258802588125882258832588425885258862588725888258892589025891258922589325894258952589625897258982589925900259012590225903259042590525906259072590825909259102591125912259132591425915259162591725918259192592025921259222592325924259252592625927259282592925930259312593225933259342593525936259372593825939259402594125942259432594425945259462594725948259492595025951259522595325954259552595625957259582595925960259612596225963259642596525966259672596825969259702597125972259732597425975259762597725978259792598025981259822598325984259852598625987259882598925990259912599225993259942599525996259972599825999260002600126002260032600426005260062600726008260092601026011260122601326014260152601626017260182601926020260212602226023260242602526026260272602826029260302603126032260332603426035260362603726038260392604026041260422604326044260452604626047260482604926050260512605226053260542605526056260572605826059260602606126062260632606426065260662606726068260692607026071260722607326074260752607626077260782607926080260812608226083260842608526086260872608826089260902609126092260932609426095260962609726098260992610026101261022610326104261052610626107261082610926110261112611226113261142611526116261172611826119261202612126122261232612426125261262612726128261292613026131261322613326134261352613626137261382613926140261412614226143261442614526146261472614826149261502615126152261532615426155261562615726158261592616026161261622616326164261652616626167261682616926170261712617226173261742617526176261772617826179261802618126182261832618426185261862618726188261892619026191261922619326194261952619626197261982619926200262012620226203262042620526206262072620826209262102621126212262132621426215262162621726218262192622026221262222622326224262252622626227262282622926230262312623226233262342623526236262372623826239262402624126242262432624426245262462624726248262492625026251262522625326254262552625626257262582625926260262612626226263262642626526266262672626826269262702627126272262732627426275262762627726278262792628026281262822628326284262852628626287262882628926290262912629226293262942629526296262972629826299263002630126302263032630426305263062630726308263092631026311263122631326314263152631626317263182631926320263212632226323263242632526326263272632826329263302633126332263332633426335263362633726338263392634026341263422634326344263452634626347263482634926350263512635226353263542635526356263572635826359263602636126362263632636426365263662636726368263692637026371263722637326374263752637626377263782637926380263812638226383263842638526386263872638826389263902639126392263932639426395263962639726398263992640026401264022640326404264052640626407264082640926410264112641226413264142641526416264172641826419264202642126422264232642426425264262642726428264292643026431264322643326434264352643626437264382643926440264412644226443264442644526446264472644826449264502645126452264532645426455264562645726458264592646026461264622646326464264652646626467264682646926470264712647226473264742647526476264772647826479264802648126482264832648426485264862648726488264892649026491264922649326494264952649626497264982649926500265012650226503265042650526506265072650826509265102651126512265132651426515265162651726518265192652026521265222652326524265252652626527265282652926530265312653226533265342653526536265372653826539265402654126542265432654426545265462654726548265492655026551265522655326554265552655626557265582655926560265612656226563265642656526566265672656826569265702657126572265732657426575265762657726578265792658026581265822658326584265852658626587265882658926590265912659226593265942659526596265972659826599266002660126602266032660426605266062660726608266092661026611266122661326614266152661626617266182661926620266212662226623266242662526626266272662826629266302663126632266332663426635266362663726638266392664026641266422664326644266452664626647266482664926650266512665226653266542665526656266572665826659266602666126662266632666426665266662666726668266692667026671266722667326674266752667626677266782667926680266812668226683266842668526686266872668826689266902669126692266932669426695266962669726698266992670026701267022670326704267052670626707267082670926710267112671226713267142671526716267172671826719267202672126722267232672426725267262672726728267292673026731267322673326734267352673626737267382673926740267412674226743267442674526746267472674826749267502675126752267532675426755267562675726758267592676026761267622676326764267652676626767267682676926770267712677226773267742677526776267772677826779267802678126782267832678426785267862678726788267892679026791267922679326794267952679626797267982679926800268012680226803268042680526806268072680826809268102681126812268132681426815268162681726818268192682026821268222682326824268252682626827268282682926830268312683226833268342683526836268372683826839268402684126842268432684426845268462684726848268492685026851268522685326854268552685626857268582685926860268612686226863268642686526866268672686826869268702687126872268732687426875268762687726878268792688026881268822688326884268852688626887268882688926890268912689226893268942689526896268972689826899269002690126902269032690426905269062690726908269092691026911269122691326914269152691626917269182691926920269212692226923269242692526926269272692826929269302693126932269332693426935269362693726938269392694026941269422694326944269452694626947269482694926950269512695226953269542695526956269572695826959269602696126962269632696426965269662696726968269692697026971269722697326974269752697626977269782697926980269812698226983269842698526986269872698826989269902699126992269932699426995269962699726998269992700027001270022700327004270052700627007270082700927010270112701227013270142701527016270172701827019270202702127022270232702427025270262702727028270292703027031270322703327034270352703627037270382703927040270412704227043270442704527046270472704827049270502705127052270532705427055270562705727058270592706027061270622706327064270652706627067270682706927070270712707227073270742707527076270772707827079270802708127082270832708427085270862708727088270892709027091270922709327094270952709627097270982709927100271012710227103271042710527106271072710827109271102711127112271132711427115271162711727118271192712027121271222712327124271252712627127271282712927130271312713227133271342713527136271372713827139271402714127142271432714427145271462714727148271492715027151271522715327154271552715627157271582715927160271612716227163271642716527166271672716827169271702717127172271732717427175271762717727178271792718027181271822718327184271852718627187271882718927190271912719227193271942719527196271972719827199272002720127202272032720427205272062720727208272092721027211272122721327214272152721627217272182721927220272212722227223272242722527226272272722827229272302723127232272332723427235272362723727238272392724027241272422724327244272452724627247272482724927250272512725227253272542725527256272572725827259272602726127262272632726427265272662726727268272692727027271272722727327274272752727627277272782727927280272812728227283272842728527286272872728827289272902729127292272932729427295272962729727298272992730027301273022730327304273052730627307273082730927310273112731227313273142731527316273172731827319273202732127322273232732427325273262732727328273292733027331273322733327334273352733627337273382733927340273412734227343273442734527346273472734827349273502735127352273532735427355273562735727358273592736027361273622736327364273652736627367273682736927370273712737227373273742737527376273772737827379273802738127382273832738427385273862738727388273892739027391273922739327394273952739627397273982739927400274012740227403274042740527406274072740827409274102741127412274132741427415274162741727418274192742027421274222742327424274252742627427274282742927430274312743227433274342743527436274372743827439274402744127442274432744427445274462744727448274492745027451274522745327454274552745627457274582745927460274612746227463274642746527466274672746827469274702747127472274732747427475274762747727478274792748027481274822748327484274852748627487274882748927490274912749227493274942749527496274972749827499275002750127502275032750427505275062750727508275092751027511275122751327514275152751627517275182751927520275212752227523275242752527526275272752827529275302753127532275332753427535275362753727538275392754027541275422754327544275452754627547275482754927550275512755227553275542755527556275572755827559275602756127562275632756427565275662756727568275692757027571275722757327574275752757627577275782757927580275812758227583275842758527586275872758827589275902759127592275932759427595275962759727598275992760027601276022760327604276052760627607276082760927610276112761227613276142761527616276172761827619276202762127622276232762427625276262762727628276292763027631276322763327634276352763627637276382763927640276412764227643276442764527646276472764827649276502765127652276532765427655276562765727658276592766027661276622766327664276652766627667276682766927670276712767227673276742767527676276772767827679276802768127682276832768427685276862768727688276892769027691276922769327694276952769627697276982769927700277012770227703277042770527706277072770827709277102771127712277132771427715277162771727718277192772027721277222772327724277252772627727277282772927730277312773227733277342773527736277372773827739277402774127742277432774427745277462774727748277492775027751277522775327754277552775627757277582775927760277612776227763277642776527766277672776827769277702777127772277732777427775277762777727778277792778027781277822778327784277852778627787277882778927790277912779227793277942779527796277972779827799278002780127802278032780427805278062780727808278092781027811278122781327814278152781627817278182781927820278212782227823278242782527826278272782827829278302783127832278332783427835278362783727838278392784027841278422784327844278452784627847278482784927850278512785227853278542785527856278572785827859278602786127862278632786427865278662786727868278692787027871278722787327874278752787627877278782787927880278812788227883278842788527886278872788827889278902789127892278932789427895278962789727898278992790027901279022790327904279052790627907279082790927910279112791227913279142791527916279172791827919279202792127922279232792427925279262792727928279292793027931279322793327934279352793627937279382793927940279412794227943279442794527946279472794827949279502795127952279532795427955279562795727958279592796027961279622796327964279652796627967279682796927970279712797227973279742797527976279772797827979279802798127982279832798427985279862798727988279892799027991279922799327994279952799627997279982799928000280012800228003280042800528006280072800828009280102801128012280132801428015280162801728018280192802028021280222802328024280252802628027280282802928030280312803228033280342803528036280372803828039280402804128042280432804428045280462804728048280492805028051280522805328054280552805628057280582805928060280612806228063280642806528066280672806828069280702807128072280732807428075280762807728078280792808028081280822808328084280852808628087280882808928090280912809228093280942809528096280972809828099281002810128102281032810428105281062810728108281092811028111281122811328114281152811628117281182811928120281212812228123281242812528126281272812828129281302813128132281332813428135281362813728138281392814028141281422814328144281452814628147281482814928150281512815228153281542815528156281572815828159281602816128162281632816428165281662816728168281692817028171281722817328174281752817628177281782817928180281812818228183281842818528186281872818828189281902819128192281932819428195281962819728198281992820028201282022820328204282052820628207282082820928210282112821228213282142821528216282172821828219282202822128222282232822428225282262822728228282292823028231282322823328234282352823628237282382823928240282412824228243282442824528246282472824828249282502825128252282532825428255282562825728258282592826028261282622826328264282652826628267282682826928270282712827228273282742827528276282772827828279282802828128282282832828428285282862828728288282892829028291282922829328294282952829628297282982829928300283012830228303283042830528306283072830828309283102831128312283132831428315283162831728318283192832028321283222832328324283252832628327283282832928330283312833228333283342833528336283372833828339283402834128342283432834428345283462834728348283492835028351283522835328354283552835628357283582835928360283612836228363283642836528366283672836828369283702837128372283732837428375283762837728378283792838028381283822838328384283852838628387283882838928390283912839228393283942839528396283972839828399284002840128402284032840428405284062840728408284092841028411284122841328414284152841628417284182841928420284212842228423284242842528426284272842828429284302843128432284332843428435284362843728438284392844028441284422844328444284452844628447284482844928450284512845228453284542845528456284572845828459284602846128462284632846428465284662846728468284692847028471284722847328474284752847628477284782847928480284812848228483284842848528486284872848828489284902849128492284932849428495284962849728498284992850028501285022850328504285052850628507285082850928510285112851228513285142851528516285172851828519285202852128522285232852428525285262852728528285292853028531285322853328534285352853628537285382853928540285412854228543285442854528546285472854828549285502855128552285532855428555285562855728558285592856028561285622856328564285652856628567285682856928570285712857228573285742857528576285772857828579285802858128582285832858428585285862858728588285892859028591285922859328594285952859628597285982859928600286012860228603286042860528606286072860828609286102861128612286132861428615286162861728618286192862028621286222862328624286252862628627286282862928630286312863228633286342863528636286372863828639286402864128642286432864428645286462864728648286492865028651286522865328654286552865628657286582865928660286612866228663286642866528666286672866828669286702867128672286732867428675286762867728678286792868028681286822868328684286852868628687286882868928690286912869228693286942869528696286972869828699287002870128702287032870428705287062870728708287092871028711287122871328714287152871628717287182871928720287212872228723287242872528726287272872828729287302873128732287332873428735287362873728738287392874028741287422874328744287452874628747287482874928750287512875228753287542875528756287572875828759287602876128762287632876428765287662876728768287692877028771287722877328774287752877628777287782877928780287812878228783287842878528786287872878828789287902879128792287932879428795287962879728798287992880028801288022880328804288052880628807288082880928810288112881228813288142881528816288172881828819288202882128822288232882428825288262882728828288292883028831288322883328834288352883628837288382883928840288412884228843288442884528846288472884828849288502885128852288532885428855288562885728858288592886028861288622886328864288652886628867288682886928870288712887228873288742887528876288772887828879288802888128882288832888428885288862888728888288892889028891288922889328894288952889628897288982889928900289012890228903289042890528906289072890828909289102891128912289132891428915289162891728918289192892028921289222892328924289252892628927289282892928930289312893228933289342893528936289372893828939289402894128942289432894428945289462894728948289492895028951289522895328954289552895628957289582895928960289612896228963289642896528966289672896828969289702897128972289732897428975289762897728978289792898028981289822898328984289852898628987289882898928990289912899228993289942899528996289972899828999290002900129002290032900429005290062900729008290092901029011290122901329014290152901629017290182901929020290212902229023290242902529026290272902829029290302903129032290332903429035290362903729038290392904029041290422904329044290452904629047290482904929050290512905229053290542905529056290572905829059290602906129062290632906429065290662906729068290692907029071290722907329074290752907629077290782907929080290812908229083290842908529086290872908829089290902909129092290932909429095290962909729098290992910029101291022910329104291052910629107291082910929110291112911229113291142911529116291172911829119291202912129122291232912429125291262912729128291292913029131291322913329134291352913629137291382913929140291412914229143291442914529146291472914829149291502915129152291532915429155291562915729158291592916029161291622916329164291652916629167291682916929170291712917229173291742917529176291772917829179291802918129182291832918429185291862918729188291892919029191291922919329194291952919629197291982919929200292012920229203292042920529206292072920829209292102921129212292132921429215292162921729218292192922029221292222922329224292252922629227292282922929230292312923229233292342923529236292372923829239292402924129242292432924429245292462924729248292492925029251292522925329254292552925629257292582925929260292612926229263292642926529266292672926829269292702927129272292732927429275292762927729278292792928029281292822928329284292852928629287292882928929290292912929229293292942929529296292972929829299293002930129302293032930429305293062930729308293092931029311293122931329314293152931629317293182931929320293212932229323293242932529326293272932829329293302933129332293332933429335293362933729338293392934029341293422934329344293452934629347293482934929350293512935229353293542935529356293572935829359293602936129362293632936429365293662936729368293692937029371293722937329374293752937629377293782937929380293812938229383293842938529386293872938829389293902939129392293932939429395293962939729398293992940029401294022940329404294052940629407294082940929410294112941229413294142941529416294172941829419294202942129422294232942429425294262942729428294292943029431294322943329434294352943629437294382943929440294412944229443294442944529446294472944829449294502945129452294532945429455294562945729458294592946029461294622946329464294652946629467294682946929470294712947229473294742947529476294772947829479294802948129482294832948429485294862948729488294892949029491294922949329494294952949629497294982949929500295012950229503295042950529506295072950829509295102951129512295132951429515295162951729518295192952029521295222952329524295252952629527295282952929530295312953229533295342953529536295372953829539295402954129542295432954429545295462954729548295492955029551295522955329554295552955629557295582955929560295612956229563295642956529566295672956829569295702957129572295732957429575295762957729578295792958029581295822958329584295852958629587295882958929590295912959229593295942959529596295972959829599296002960129602296032960429605296062960729608296092961029611296122961329614296152961629617296182961929620296212962229623296242962529626296272962829629296302963129632296332963429635296362963729638296392964029641296422964329644296452964629647296482964929650296512965229653296542965529656296572965829659296602966129662296632966429665296662966729668296692967029671296722967329674296752967629677296782967929680296812968229683296842968529686296872968829689296902969129692296932969429695296962969729698296992970029701297022970329704297052970629707297082970929710297112971229713297142971529716297172971829719297202972129722297232972429725297262972729728297292973029731297322973329734297352973629737297382973929740297412974229743297442974529746297472974829749297502975129752297532975429755297562975729758297592976029761297622976329764297652976629767297682976929770297712977229773297742977529776297772977829779297802978129782297832978429785297862978729788297892979029791297922979329794297952979629797297982979929800298012980229803298042980529806298072980829809298102981129812298132981429815298162981729818298192982029821298222982329824298252982629827298282982929830298312983229833298342983529836298372983829839298402984129842298432984429845298462984729848298492985029851298522985329854298552985629857298582985929860298612986229863298642986529866298672986829869298702987129872298732987429875298762987729878298792988029881298822988329884298852988629887298882988929890298912989229893298942989529896298972989829899299002990129902299032990429905299062990729908299092991029911299122991329914299152991629917299182991929920299212992229923299242992529926299272992829929299302993129932299332993429935299362993729938299392994029941299422994329944299452994629947299482994929950299512995229953299542995529956299572995829959299602996129962299632996429965299662996729968299692997029971299722997329974299752997629977299782997929980299812998229983299842998529986299872998829989299902999129992299932999429995299962999729998299993000030001300023000330004300053000630007300083000930010300113001230013300143001530016300173001830019300203002130022300233002430025300263002730028300293003030031300323003330034300353003630037300383003930040300413004230043300443004530046300473004830049300503005130052300533005430055300563005730058300593006030061300623006330064300653006630067300683006930070300713007230073300743007530076300773007830079300803008130082300833008430085300863008730088300893009030091300923009330094300953009630097300983009930100301013010230103301043010530106301073010830109301103011130112301133011430115301163011730118301193012030121301223012330124301253012630127301283012930130301313013230133301343013530136301373013830139301403014130142301433014430145301463014730148301493015030151301523015330154301553015630157301583015930160301613016230163301643016530166301673016830169301703017130172301733017430175301763017730178301793018030181301823018330184301853018630187301883018930190301913019230193301943019530196301973019830199302003020130202302033020430205302063020730208302093021030211302123021330214302153021630217302183021930220302213022230223302243022530226302273022830229302303023130232302333023430235302363023730238302393024030241302423024330244302453024630247302483024930250302513025230253302543025530256302573025830259302603026130262302633026430265302663026730268302693027030271302723027330274302753027630277302783027930280302813028230283302843028530286302873028830289302903029130292302933029430295302963029730298302993030030301303023030330304303053030630307303083030930310303113031230313303143031530316303173031830319303203032130322303233032430325303263032730328303293033030331303323033330334303353033630337303383033930340303413034230343303443034530346303473034830349303503035130352303533035430355303563035730358303593036030361303623036330364303653036630367303683036930370303713037230373303743037530376303773037830379303803038130382303833038430385303863038730388303893039030391303923039330394303953039630397303983039930400304013040230403304043040530406304073040830409304103041130412304133041430415304163041730418304193042030421304223042330424304253042630427304283042930430304313043230433304343043530436304373043830439304403044130442304433044430445304463044730448304493045030451304523045330454304553045630457304583045930460304613046230463304643046530466304673046830469304703047130472304733047430475304763047730478304793048030481304823048330484304853048630487304883048930490304913049230493304943049530496304973049830499305003050130502305033050430505305063050730508305093051030511305123051330514305153051630517305183051930520305213052230523305243052530526305273052830529305303053130532305333053430535305363053730538305393054030541305423054330544305453054630547305483054930550305513055230553305543055530556305573055830559305603056130562305633056430565305663056730568305693057030571305723057330574305753057630577305783057930580305813058230583305843058530586305873058830589305903059130592305933059430595305963059730598305993060030601306023060330604306053060630607306083060930610306113061230613306143061530616306173061830619306203062130622306233062430625306263062730628306293063030631306323063330634306353063630637306383063930640306413064230643306443064530646306473064830649306503065130652306533065430655306563065730658306593066030661306623066330664306653066630667306683066930670306713067230673306743067530676306773067830679306803068130682306833068430685306863068730688306893069030691306923069330694306953069630697306983069930700307013070230703307043070530706307073070830709307103071130712307133071430715307163071730718307193072030721307223072330724307253072630727307283072930730307313073230733307343073530736307373073830739307403074130742307433074430745307463074730748307493075030751307523075330754307553075630757307583075930760307613076230763307643076530766307673076830769307703077130772307733077430775307763077730778307793078030781307823078330784307853078630787307883078930790307913079230793307943079530796307973079830799308003080130802308033080430805308063080730808308093081030811308123081330814308153081630817308183081930820308213082230823308243082530826308273082830829308303083130832308333083430835308363083730838308393084030841308423084330844308453084630847308483084930850308513085230853308543085530856308573085830859308603086130862308633086430865308663086730868308693087030871308723087330874308753087630877308783087930880308813088230883308843088530886308873088830889308903089130892308933089430895308963089730898308993090030901309023090330904309053090630907309083090930910309113091230913309143091530916309173091830919309203092130922309233092430925309263092730928309293093030931309323093330934309353093630937309383093930940309413094230943309443094530946309473094830949309503095130952309533095430955309563095730958309593096030961309623096330964309653096630967309683096930970309713097230973309743097530976309773097830979309803098130982309833098430985309863098730988309893099030991309923099330994309953099630997309983099931000310013100231003310043100531006310073100831009310103101131012310133101431015310163101731018310193102031021310223102331024310253102631027310283102931030310313103231033310343103531036310373103831039310403104131042310433104431045310463104731048310493105031051310523105331054310553105631057310583105931060310613106231063310643106531066310673106831069310703107131072310733107431075310763107731078310793108031081310823108331084310853108631087310883108931090310913109231093310943109531096310973109831099311003110131102311033110431105311063110731108311093111031111311123111331114311153111631117311183111931120311213112231123311243112531126311273112831129311303113131132311333113431135311363113731138311393114031141311423114331144311453114631147311483114931150311513115231153311543115531156311573115831159311603116131162311633116431165311663116731168311693117031171311723117331174311753117631177311783117931180311813118231183311843118531186311873118831189311903119131192311933119431195311963119731198311993120031201312023120331204312053120631207312083120931210312113121231213312143121531216312173121831219312203122131222312233122431225312263122731228312293123031231312323123331234312353123631237312383123931240312413124231243312443124531246312473124831249312503125131252312533125431255312563125731258312593126031261312623126331264312653126631267312683126931270312713127231273312743127531276312773127831279312803128131282312833128431285312863128731288312893129031291312923129331294312953129631297312983129931300313013130231303313043130531306313073130831309313103131131312313133131431315313163131731318313193132031321313223132331324313253132631327313283132931330313313133231333313343133531336313373133831339313403134131342313433134431345313463134731348313493135031351313523135331354313553135631357313583135931360313613136231363313643136531366313673136831369313703137131372313733137431375313763137731378313793138031381313823138331384313853138631387313883138931390313913139231393313943139531396313973139831399314003140131402314033140431405314063140731408314093141031411314123141331414314153141631417314183141931420314213142231423314243142531426314273142831429314303143131432314333143431435314363143731438314393144031441314423144331444314453144631447314483144931450314513145231453314543145531456314573145831459314603146131462314633146431465314663146731468314693147031471314723147331474314753147631477314783147931480314813148231483314843148531486314873148831489314903149131492314933149431495314963149731498314993150031501315023150331504315053150631507315083150931510315113151231513315143151531516315173151831519315203152131522315233152431525315263152731528315293153031531315323153331534315353153631537315383153931540315413154231543315443154531546315473154831549315503155131552315533155431555315563155731558315593156031561315623156331564315653156631567315683156931570315713157231573315743157531576315773157831579315803158131582315833158431585315863158731588315893159031591315923159331594315953159631597315983159931600316013160231603316043160531606316073160831609316103161131612316133161431615316163161731618316193162031621316223162331624316253162631627316283162931630316313163231633316343163531636316373163831639316403164131642316433164431645316463164731648316493165031651316523165331654316553165631657316583165931660316613166231663316643166531666316673166831669316703167131672316733167431675316763167731678316793168031681316823168331684316853168631687316883168931690316913169231693316943169531696316973169831699317003170131702317033170431705317063170731708317093171031711317123171331714317153171631717317183171931720317213172231723317243172531726317273172831729317303173131732317333173431735317363173731738317393174031741317423174331744317453174631747317483174931750317513175231753317543175531756317573175831759317603176131762317633176431765317663176731768317693177031771317723177331774317753177631777317783177931780317813178231783317843178531786317873178831789317903179131792317933179431795317963179731798317993180031801318023180331804318053180631807318083180931810318113181231813318143181531816318173181831819318203182131822318233182431825318263182731828318293183031831318323183331834318353183631837318383183931840318413184231843318443184531846318473184831849318503185131852318533185431855318563185731858318593186031861318623186331864318653186631867318683186931870318713187231873318743187531876318773187831879318803188131882318833188431885318863188731888318893189031891318923189331894318953189631897318983189931900319013190231903319043190531906319073190831909319103191131912319133191431915319163191731918319193192031921319223192331924319253192631927319283192931930319313193231933319343193531936319373193831939319403194131942319433194431945319463194731948319493195031951319523195331954319553195631957319583195931960319613196231963319643196531966319673196831969319703197131972319733197431975319763197731978319793198031981319823198331984319853198631987319883198931990319913199231993319943199531996319973199831999320003200132002320033200432005320063200732008320093201032011320123201332014320153201632017320183201932020320213202232023320243202532026320273202832029320303203132032320333203432035320363203732038320393204032041320423204332044320453204632047320483204932050320513205232053320543205532056320573205832059320603206132062320633206432065320663206732068320693207032071320723207332074320753207632077320783207932080320813208232083320843208532086320873208832089320903209132092320933209432095320963209732098320993210032101321023210332104321053210632107321083210932110321113211232113321143211532116321173211832119321203212132122321233212432125321263212732128321293213032131321323213332134321353213632137321383213932140321413214232143321443214532146321473214832149321503215132152321533215432155321563215732158321593216032161321623216332164321653216632167321683216932170321713217232173321743217532176321773217832179321803218132182321833218432185321863218732188321893219032191321923219332194321953219632197321983219932200322013220232203322043220532206322073220832209322103221132212322133221432215322163221732218322193222032221322223222332224322253222632227322283222932230322313223232233322343223532236322373223832239322403224132242322433224432245322463224732248322493225032251322523225332254322553225632257322583225932260322613226232263322643226532266322673226832269322703227132272322733227432275322763227732278322793228032281322823228332284322853228632287322883228932290322913229232293322943229532296322973229832299323003230132302323033230432305323063230732308323093231032311323123231332314323153231632317323183231932320323213232232323323243232532326323273232832329323303233132332323333233432335323363233732338323393234032341323423234332344323453234632347323483234932350323513235232353323543235532356323573235832359323603236132362323633236432365323663236732368323693237032371323723237332374323753237632377323783237932380323813238232383323843238532386323873238832389323903239132392323933239432395323963239732398323993240032401324023240332404324053240632407324083240932410324113241232413324143241532416324173241832419324203242132422324233242432425324263242732428324293243032431324323243332434324353243632437324383243932440324413244232443324443244532446324473244832449324503245132452324533245432455324563245732458324593246032461324623246332464324653246632467324683246932470324713247232473324743247532476324773247832479324803248132482324833248432485324863248732488324893249032491324923249332494324953249632497324983249932500325013250232503325043250532506325073250832509325103251132512325133251432515325163251732518325193252032521325223252332524325253252632527325283252932530325313253232533325343253532536325373253832539325403254132542325433254432545325463254732548325493255032551325523255332554325553255632557325583255932560325613256232563325643256532566325673256832569325703257132572325733257432575325763257732578325793258032581325823258332584325853258632587325883258932590325913259232593325943259532596
  1. export namespace Viewer {
  2. /**
  3. * Initialization options for the Viewer constructor
  4. * @property [animation = true] - If set to false, the Animation widget will not be created.
  5. * @property [baseLayerPicker = true] - If set to false, the BaseLayerPicker widget will not be created.
  6. * @property [fullscreenButton = true] - If set to false, the FullscreenButton widget will not be created.
  7. * @property [vrButton = false] - If set to true, the VRButton widget will be created.
  8. * @property [geocoder = true] - If set to false, the Geocoder widget will not be created.
  9. * @property [homeButton = true] - If set to false, the HomeButton widget will not be created.
  10. * @property [infoBox = true] - If set to false, the InfoBox widget will not be created.
  11. * @property [sceneModePicker = true] - If set to false, the SceneModePicker widget will not be created.
  12. * @property [selectionIndicator = true] - If set to false, the SelectionIndicator widget will not be created.
  13. * @property [timeline = true] - If set to false, the Timeline widget will not be created.
  14. * @property [navigationHelpButton = true] - If set to false, the navigation help button will not be created.
  15. * @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.
  16. * @property [scene3DOnly = false] - When <code>true</code>, each geometry instance will only be rendered in 3D to save GPU memory.
  17. * @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}.
  18. * @property [clockViewModel = new ClockViewModel(clock)] - The clock view model to use to control current time.
  19. * @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.
  20. * @property [imageryProviderViewModels = createDefaultImageryProviderViewModels()] - The array of ProviderViewModels to be selectable from the BaseLayerPicker. This value is only valid if `baseLayerPicker` is set to true.
  21. * @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.
  22. * @property [terrainProviderViewModels = createDefaultTerrainProviderViewModels()] - The array of ProviderViewModels to be selectable from the BaseLayerPicker. This value is only valid if `baseLayerPicker` is set to true.
  23. * @property [imageryProvider = createWorldImagery()] - The imagery provider to use. This value is only valid if `baseLayerPicker` is set to false.
  24. * @property [terrainProvider = new EllipsoidTerrainProvider()] - The terrain provider to use
  25. * @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.
  26. * @property [skyAtmosphere] - Blue sky, and the glow around the Earth's limb. Set to <code>false</code> to turn it off.
  27. * @property [fullscreenElement = document.body] - The element or id to be placed into fullscreen mode when the full screen button is pressed.
  28. * @property [useDefaultRenderLoop = true] - True if this widget should control the render loop, false otherwise.
  29. * @property [targetFrameRate] - The target frame rate when using the default render loop.
  30. * @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.
  31. * @property [useBrowserRecommendedResolution = true] - If true, render at the browser's recommended resolution and ignore <code>window.devicePixelRatio</code>.
  32. * @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.
  33. * @property [contextOptions] - Context and WebGL creation properties corresponding to <code>options</code> passed to {@link Scene}.
  34. * @property [sceneMode = SceneMode.SCENE3D] - The initial scene mode.
  35. * @property [mapProjection = new GeographicProjection()] - The map projection to use in 2D and Columbus View modes.
  36. * @property [globe = new Globe(mapProjection.ellipsoid)] - The globe to use in the scene. If set to <code>false</code>, no globe will be added.
  37. * @property [orderIndependentTranslucency = true] - If true and the configuration supports it, use order independent translucency.
  38. * @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.
  39. * @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.
  40. * @property [dataSources = new DataSourceCollection()] - The collection of data sources visualized by the widget. If this parameter is provided,
  41. * the instance is assumed to be owned by the caller and will not be destroyed when the viewer is destroyed.
  42. * @property [shadows = false] - Determines if shadows are cast by light sources.
  43. * @property [terrainShadows = ShadowMode.RECEIVE_ONLY] - Determines if the terrain casts or receives shadows from light sources.
  44. * @property [mapMode2D = MapMode2D.INFINITE_SCROLL] - Determines if the 2D map is rotatable or can be scrolled infinitely in the horizontal direction.
  45. * @property [projectionPicker = false] - If set to true, the ProjectionPicker widget will be created.
  46. * @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.
  47. * @property [maximumRenderTimeChange = 0.0] - If requestRenderMode is true, this value defines the maximum change in simulation time allowed before a render is requested.
  48. * @property [depthPlaneEllipsoidOffset = 0.0] - Adjust the DepthPlane to address rendering artefacts below ellipsoid zero elevation.
  49. * @property [msaaSamples = 1] - If provided, this value controls the rate of multisample antialiasing. Typical multisampling rates are 2, 4, and sometimes 8 samples per pixel. Higher sampling rates of MSAA may impact performance in exchange for improved visual quality. This value only applies to WebGL2 contexts that support multisample render targets.
  50. */
  51. type ConstructorOptions = {
  52. animation?: boolean;
  53. baseLayerPicker?: boolean;
  54. fullscreenButton?: boolean;
  55. vrButton?: boolean;
  56. geocoder?: boolean | GeocoderService[];
  57. homeButton?: boolean;
  58. infoBox?: boolean;
  59. sceneModePicker?: boolean;
  60. selectionIndicator?: boolean;
  61. timeline?: boolean;
  62. navigationHelpButton?: boolean;
  63. navigationInstructionsInitiallyVisible?: boolean;
  64. scene3DOnly?: boolean;
  65. shouldAnimate?: boolean;
  66. clockViewModel?: ClockViewModel;
  67. selectedImageryProviderViewModel?: ProviderViewModel;
  68. imageryProviderViewModels?: ProviderViewModel[];
  69. selectedTerrainProviderViewModel?: ProviderViewModel;
  70. terrainProviderViewModels?: ProviderViewModel[];
  71. imageryProvider?: ImageryProvider;
  72. terrainProvider?: TerrainProvider;
  73. skyBox?: SkyBox | false;
  74. skyAtmosphere?: SkyAtmosphere | false;
  75. fullscreenElement?: Element | string;
  76. useDefaultRenderLoop?: boolean;
  77. targetFrameRate?: number;
  78. showRenderLoopErrors?: boolean;
  79. useBrowserRecommendedResolution?: boolean;
  80. automaticallyTrackDataSourceClocks?: boolean;
  81. contextOptions?: any;
  82. sceneMode?: SceneMode;
  83. mapProjection?: MapProjection;
  84. globe?: Globe | false;
  85. orderIndependentTranslucency?: boolean;
  86. creditContainer?: Element | string;
  87. creditViewport?: Element | string;
  88. dataSources?: DataSourceCollection;
  89. shadows?: boolean;
  90. terrainShadows?: ShadowMode;
  91. mapMode2D?: MapMode2D;
  92. projectionPicker?: boolean;
  93. requestRenderMode?: boolean;
  94. maximumRenderTimeChange?: number;
  95. depthPlaneEllipsoidOffset?: number;
  96. msaaSamples?: number;
  97. };
  98. /**
  99. * A function that augments a Viewer instance with additional functionality.
  100. * @param viewer - The viewer instance.
  101. * @param options - Options object to be passed to the mixin function.
  102. */
  103. type ViewerMixin = (viewer: Viewer, options: any) => void;
  104. }
  105. /**
  106. * 用于构建应用程序的基本小部件. 它将所有标准的Cesium小部件组合成一个可重用的包.
  107. * 小部件总是可以通过使用mixin进行扩展,mixin为各种应用程序添加了有用的功能.
  108. * @example
  109. * //使用几个自定义选项和mixins初始化查看器小部件.
  110. * const viewer = new Cesium.Viewer('CesiumContainer', {
  111. * sceneMode : Cesium.SceneMode.COLUMBUS_VIEW,
  112. * terrainProvider : Cesium.createWorldTerrain(),
  113. * baseLayerPicker : false,
  114. * imageryProvider : new Cesium.OpenStreetMapImageryProvider({
  115. * url : 'https://a.tile.openstreetmap.org/'
  116. * }),
  117. * skyBox : new Cesium.SkyBox({
  118. * sources : {
  119. * positiveX : 'stars/TychoSkymapII.t3_08192x04096_80_px.jpg',
  120. * negativeX : 'stars/TychoSkymapII.t3_08192x04096_80_mx.jpg',
  121. * positiveY : 'stars/TychoSkymapII.t3_08192x04096_80_py.jpg',
  122. * negativeY : 'stars/TychoSkymapII.t3_08192x04096_80_my.jpg',
  123. * positiveZ : 'stars/TychoSkymapII.t3_08192x04096_80_pz.jpg',
  124. * negativeZ : 'stars/TychoSkymapII.t3_08192x04096_80_mz.jpg'
  125. * }
  126. * }),
  127. * });
  128. * @param container - 包含Widget的DOM元素或ID
  129. * @param [options] - 对象描述初始化选项
  130. */
  131. export class Viewer {
  132. constructor(container: Element | string, options?: Viewer.ConstructorOptions);
  133. /**
  134. * Gets the parent container.
  135. */
  136. readonly container: Element;
  137. /**
  138. * Gets the DOM element for the area at the bottom of the window containing the
  139. * {@link CreditDisplay} and potentially other things.
  140. */
  141. readonly bottomContainer: Element;
  142. /**
  143. * Gets the CesiumWidget.
  144. */
  145. readonly CesiumWidget: CesiumWidget;
  146. /**
  147. * Gets the selection indicator.
  148. */
  149. readonly selectionIndicator: SelectionIndicator;
  150. /**
  151. * Gets the info box.
  152. */
  153. readonly infoBox: InfoBox;
  154. /**
  155. * Gets the Geocoder.
  156. */
  157. readonly geocoder: Geocoder;
  158. /**
  159. * Gets the HomeButton.
  160. */
  161. readonly homeButton: HomeButton;
  162. /**
  163. * Gets the SceneModePicker.
  164. */
  165. readonly sceneModePicker: SceneModePicker;
  166. /**
  167. * Gets the ProjectionPicker.
  168. */
  169. readonly projectionPicker: ProjectionPicker;
  170. /**
  171. * Gets the BaseLayerPicker.
  172. */
  173. readonly baseLayerPicker: BaseLayerPicker;
  174. /**
  175. * Gets the NavigationHelpButton.
  176. */
  177. readonly navigationHelpButton: NavigationHelpButton;
  178. /**
  179. * Gets the Animation widget.
  180. */
  181. readonly animation: Animation;
  182. /**
  183. * Gets the Timeline widget.
  184. */
  185. readonly timeline: Timeline;
  186. /**
  187. * Gets the FullscreenButton.
  188. */
  189. readonly fullscreenButton: FullscreenButton;
  190. /**
  191. * Gets the VRButton.
  192. */
  193. readonly vrButton: VRButton;
  194. /**
  195. * Gets the display used for {@link DataSource} visualization.
  196. */
  197. readonly dataSourceDisplay: DataSourceDisplay;
  198. /**
  199. * Gets the collection of entities not tied to a particular data source.
  200. * This is a shortcut to [dataSourceDisplay.defaultDataSource.entities]{@link Viewer#dataSourceDisplay}.
  201. */
  202. readonly entities: EntityCollection;
  203. /**
  204. * Gets the set of {@link DataSource} instances to be visualized.
  205. */
  206. readonly dataSources: DataSourceCollection;
  207. /**
  208. * Gets the canvas.
  209. */
  210. readonly canvas: HTMLCanvasElement;
  211. /**
  212. * Gets the scene.
  213. */
  214. readonly scene: Scene;
  215. /**
  216. * Determines if shadows are cast by light sources.
  217. */
  218. shadows: boolean;
  219. /**
  220. * Determines if the terrain casts or shadows from light sources.
  221. */
  222. terrainShadows: ShadowMode;
  223. /**
  224. * Get the scene's shadow map
  225. */
  226. readonly shadowMap: ShadowMap;
  227. /**
  228. * Gets the collection of image layers that will be rendered on the globe.
  229. */
  230. readonly imageryLayers: ImageryLayerCollection;
  231. /**
  232. * The terrain provider providing surface geometry for the globe.
  233. */
  234. terrainProvider: TerrainProvider;
  235. /**
  236. * Gets the camera.
  237. */
  238. readonly camera: Camera;
  239. /**
  240. * Gets the post-process stages.
  241. */
  242. readonly postProcessStages: PostProcessStageCollection;
  243. /**
  244. * Gets the clock.
  245. */
  246. readonly clock: Clock;
  247. /**
  248. * Gets the clock view model.
  249. */
  250. readonly clockViewModel: ClockViewModel;
  251. /**
  252. * Gets the screen space event handler.
  253. */
  254. readonly screenSpaceEventHandler: ScreenSpaceEventHandler;
  255. /**
  256. * Gets or sets the target frame rate of the widget when <code>useDefaultRenderLoop</code>
  257. * is true. If undefined, the browser's {@link requestAnimationFrame} implementation
  258. * determines the frame rate. If defined, this value must be greater than 0. A value higher
  259. * than the underlying requestAnimationFrame implementation will have no effect.
  260. */
  261. targetFrameRate: number;
  262. /**
  263. * Gets or sets whether or not this widget should control the render loop.
  264. * If set to true the widget will use {@link requestAnimationFrame} to
  265. * perform rendering and resizing of the widget, as well as drive the
  266. * simulation clock. If set to false, you must manually call the
  267. * <code>resize</code>, <code>render</code> methods
  268. * as part of a custom render loop. If an error occurs during rendering, {@link Scene}'s
  269. * <code>renderError</code> event will be raised and this property
  270. * will be set to false. It must be set back to true to continue rendering
  271. * after the error.
  272. */
  273. useDefaultRenderLoop: boolean;
  274. /**
  275. * Gets or sets a scaling factor for rendering resolution. Values less than 1.0 can improve
  276. * performance on less powerful devices while values greater than 1.0 will render at a higher
  277. * resolution and then scale down, resulting in improved visual fidelity.
  278. * For example, if the widget is laid out at a size of 640x480, setting this value to 0.5
  279. * will cause the scene to be rendered at 320x240 and then scaled up while setting
  280. * it to 2.0 will cause the scene to be rendered at 1280x960 and then scaled down.
  281. */
  282. resolutionScale: number;
  283. /**
  284. * Boolean flag indicating if the browser's recommended resolution is used.
  285. * If true, the browser's device pixel ratio is ignored and 1.0 is used instead,
  286. * effectively rendering based on CSS pixels instead of device pixels. This can improve
  287. * performance on less powerful devices that have high pixel density. When false, rendering
  288. * will be in device pixels. {@link Viewer#resolutionScale} will still take effect whether
  289. * this flag is true or false.
  290. */
  291. useBrowserRecommendedResolution: boolean;
  292. /**
  293. * Gets or sets whether or not data sources can temporarily pause
  294. * animation in order to avoid showing an incomplete picture to the user.
  295. * For example, if asynchronous primitives are being processed in the
  296. * background, the clock will not advance until the geometry is ready.
  297. */
  298. allowDataSourcesToSuspendAnimation: boolean;
  299. /**
  300. * Gets or sets the Entity instance currently being tracked by the camera.
  301. */
  302. trackedEntity: Entity | undefined;
  303. /**
  304. * Gets or sets the object instance for which to display a selection indicator.
  305. *
  306. * If a user interactively picks a Cesium3DTilesFeature instance, then this property
  307. * will contain a transient Entity instance with a property named "feature" that is
  308. * the instance that was picked.
  309. */
  310. selectedEntity: Entity | undefined;
  311. /**
  312. * Gets the event that is raised when the selected entity changes.
  313. */
  314. readonly selectedEntityChanged: Event;
  315. /**
  316. * Gets the event that is raised when the tracked entity changes.
  317. */
  318. readonly trackedEntityChanged: Event;
  319. /**
  320. * Gets or sets the data source to track with the viewer's clock.
  321. */
  322. clockTrackedDataSource: DataSource;
  323. /**
  324. * Extends the base viewer functionality with the provided mixin.
  325. * A mixin may add additional properties, functions, or other behavior
  326. * to the provided viewer instance.
  327. * @param mixin - The Viewer mixin to add to this instance.
  328. * @param [options] - The options object to be passed to the mixin function.
  329. */
  330. extend(mixin: Viewer.ViewerMixin, options?: any): void;
  331. /**
  332. * Resizes the widget to match the container size.
  333. * This function is called automatically as needed unless
  334. * <code>useDefaultRenderLoop</code> is set to false.
  335. */
  336. resize(): void;
  337. /**
  338. * This forces the widget to re-think its layout, including
  339. * widget sizes and credit placement.
  340. */
  341. forceResize(): void;
  342. /**
  343. * Renders the scene. This function is called automatically
  344. * unless <code>useDefaultRenderLoop</code> is set to false;
  345. */
  346. render(): void;
  347. /**
  348. * @returns true if the object has been destroyed, false otherwise.
  349. */
  350. isDestroyed(): boolean;
  351. /**
  352. * Destroys the widget. Should be called if permanently
  353. * removing the widget from layout.
  354. */
  355. destroy(): void;
  356. /**
  357. * Asynchronously sets the camera to view the provided entity, entities, or data source.
  358. * If the data source is still in the process of loading or the visualization is otherwise still loading,
  359. * this method waits for the data to be ready before performing the zoom.
  360. *
  361. * <p>The offset is heading/pitch/range in the local east-north-up reference frame centered at the center of the bounding sphere.
  362. * The heading and the pitch angles are defined in the local east-north-up reference frame.
  363. * The heading is the angle from y axis and increasing towards the x axis. Pitch is the rotation from the xy-plane. Positive pitch
  364. * angles are above the plane. Negative pitch angles are below the plane. The range is the distance from the center. If the range is
  365. * zero, a range will be computed such that the whole bounding sphere is visible.</p>
  366. *
  367. * <p>In 2D, there must be a top down view. The camera will be placed above the target looking down. The height above the
  368. * target will be the range. The heading will be determined from the offset. If the heading cannot be
  369. * determined from the offset, the heading will be north.</p>
  370. * @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.
  371. * @param [offset] - The offset from the center of the entity in the local east-north-up reference frame.
  372. * @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.
  373. */
  374. // zoomTo(target: Entity | Entity[] | EntityCollection | DataSource | ImageryLayer | Cesium3DTileset | TimeDynamicPointCloud | Promise<Entity | Entity[] | EntityCollection | DataSource | ImageryLayer | Cesium3DTileset | TimeDynamicPointCloud>, offset?: HeadingPitchRange): Promise<boolean>;
  375. /**
  376. * Flies the camera to the provided entity, entities, or data source.
  377. * If the data source is still in the process of loading or the visualization is otherwise still loading,
  378. * this method waits for the data to be ready before performing the flight.
  379. *
  380. * <p>The offset is heading/pitch/range in the local east-north-up reference frame centered at the center of the bounding sphere.
  381. * The heading and the pitch angles are defined in the local east-north-up reference frame.
  382. * The heading is the angle from y axis and increasing towards the x axis. Pitch is the rotation from the xy-plane. Positive pitch
  383. * angles are above the plane. Negative pitch angles are below the plane. The range is the distance from the center. If the range is
  384. * zero, a range will be computed such that the whole bounding sphere is visible.</p>
  385. *
  386. * <p>In 2D, there must be a top down view. The camera will be placed above the target looking down. The height above the
  387. * target will be the range. The heading will be determined from the offset. If the heading cannot be
  388. * determined from the offset, the heading will be north.</p>
  389. * @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.
  390. * @param [options] - Object with the following properties:
  391. * @param [options.duration = 3.0] - The duration of the flight in seconds.
  392. * @param [options.maximumHeight] - The maximum height at the peak of the flight.
  393. * @param [options.offset] - The offset from the target in the local east-north-up reference frame centered at the target.
  394. * @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
  395. */
  396. // flyTo(target: Entity | Entity[] | EntityCollection | DataSource | ImageryLayer | Cesium3DTileset | TimeDynamicPointCloud | Promise<Entity | Entity[] | EntityCollection | DataSource | ImageryLayer | Cesium3DTileset | TimeDynamicPointCloud>, options?: {
  397. // duration?: number;
  398. // maximumHeight?: number;
  399. // offset?: HeadingPitchRange;
  400. // }): Promise<boolean>;
  401. }
  402. type Scene = {
  403. /**
  404. * 获取场景的泛光效果,包括泛光强度值,泛光亮度阈值等
  405. */
  406. bloomEffect : BloomEffect,
  407. /**
  408. * 获取当前场景的相机对象
  409. */
  410. camera : Camera
  411. /**
  412. * 获取scene绑定的canvas元素
  413. */
  414. canvas : Element
  415. /**
  416. * 创建颜色校正对象
  417. */
  418. colorCorrection: any
  419. /**
  420. * 该属性仅用于调试,不用于生产。当为true时,绘制轮廓线展示相机平台的范围
  421. */
  422. debugShowFrustums : boolean
  423. /**
  424. * 获取场景的景深效果
  425. */
  426. depthOfFieldEffect : DepthOfFieldEffect
  427. /**
  428. * GL绘制缓冲区高度
  429. */
  430. drawingBufferHeight : number
  431. /**
  432. * GL绘制缓冲区宽度
  433. */
  434. drawingBufferWidth : number
  435. /**
  436. * 获取或者设置是否将场景绘制成图片。当关闭时,直接绘制到颜色缓冲区,画面效果更佳,但一些分析功能不可用。默认值为true
  437. */
  438. enableCompositor : boolean
  439. /**
  440. * 当前场景是否开启遮挡剔除
  441. */
  442. enableOcclude: boolean
  443. /**
  444. * The eye separation distance in meters for use with cardboard or WebVR
  445. */
  446. eyeSeparation : number
  447. /**
  448. * The focal length for use when with cardboard or WebVR.
  449. */
  450. focalLength : number
  451. /**
  452. * 设置视锥体容限值,默认值为0.0,最大值为0.5
  453. */
  454. frustumTolerance : Number
  455. /**
  456. * 获取地球对象
  457. */
  458. globe : Globe
  459. /**
  460. * 设置或获取当前场景的卷帘位置,有效值为0.0~1.0 Gets or sets the position of the globe splitter within the viewport. Valid values are between 0.0 and 1.0.
  461. */
  462. globeSplitPosition : Cartesian2
  463. /**
  464. * 获取所有贴地图元集合
  465. */
  466. groundPrimitives : PrimitiveCollection
  467. /**
  468. * 当前场景是否开启hdr
  469. */
  470. hdrEnabled:boolean
  471. /**
  472. * 获取当前场景的id
  473. */
  474. id : string
  475. /**
  476. * 获取当前场景影像图层集合
  477. */
  478. imageryLayers : ImageryLayerCollection
  479. /**
  480. * 设置或获取当前场景的影像分隔条位置
  481. */
  482. imagerySplitPosition : number
  483. /**
  484. * When false, 3D Tiles will render normally. When true, classified 3D Tile geometry will render normally and unclassified 3D Tile geometry will render with the color multiplied by Scene#invertClassificationColor.
  485. */
  486. invertClassification : boolean
  487. /**
  488. * The highlight color of unclassified 3D Tile geometry when Scene#invertClassification is true.
  489. * 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.
  490. * Also, when the color's alpha is less than 1.0, the WEBGL_depth_texture and EXT_frag_depth WebGL extensions must be supported.
  491. */
  492. invertClassificationColor : Color
  493. /**
  494. * 获取当前场景的三维切片缓存图层集合
  495. */
  496. layers : Layers
  497. /**
  498. * 获取当前场景中的光源
  499. */
  500. lightSource : LightSource
  501. /**
  502. * 获取或者设置是否使用对数深度缓冲区。当设置为true时,将会在混合多截锥中使用较少的截锥,详情可参见Cesium官网的说明
  503. */
  504. logarithmicDepthBuffer : boolean
  505. /**
  506. * 获取地图投影对象,用于2D或者Columbus View模式,默认为经纬度投影
  507. */
  508. mapProjection : MapProjection
  509. /**
  510. * 通过设置相机视角距离禁止布告板、标签和点对象的深度测试。例如,为了防止剪切地形数据,将距离设置为0则深度测试一直有效,将距离设置为小于0则深度测试失效。通过设置布告板、标签和点对象的disableDepthTestDistance属性修改距离值
  511. */
  512. minimumDisableDepthTestDistance : Number
  513. /**
  514. * 获取当前场景的模式
  515. */
  516. mode : SceneMode
  517. /**
  518. * 获取或者设置当前场景的多视口模式,默认单视口
  519. */
  520. MultiViewportMode : number
  521. /**
  522. * 设置度带偏移,加载有度带偏移的地图
  523. */
  524. originOffset : Cartesian2
  525. /**
  526. * 设置图层的避让参数。 可设置的参数为:allowIconWithTextDisplay,设置是否开启图标图层跟随文字图层避让。默认为true.
  527. */
  528. overlapDisplayOptions : object
  529. /**
  530. * 开启顶点捕捉功能,默认false,设置为true,则开启捕捉
  531. */
  532. pickPointEnabled : boolean
  533. /**
  534. * 设置点云捕捉的时间间隔
  535. */
  536. pickPointInterval : number
  537. /**
  538. * 当为true时,支持使用深度缓冲区拾取半透明的几何图形。Scene#useDepthPicking也必须为true,支持拾取深度缓冲区。使用时性能有所下降,对于半透明的几何图形,将调用额外的绘图命令写入深度
  539. */
  540. pickTranslucentDepth : boolean
  541. /**
  542. * 获取当前场景每帧渲染结束时的事件,监听该事件在每帧渲染结束时触发
  543. */
  544. postRender : Event
  545. /**
  546. * 获取当前场景每帧渲染前的事件,监听该事件在每帧渲染之前触发
  547. */
  548. preRender : Event
  549. /**
  550. * 获取所有图元集合
  551. */
  552. primitives : PrimitiveCollection
  553. /**
  554. * 获取实时栅格化对象
  555. */
  556. rasterVectorCollection : object
  557. /**
  558. * 获取场景的扫描线效果
  559. */
  560. scanEffect : ScanEffect
  561. /**
  562. * 获取当前场景的相机操作对象
  563. */
  564. screenSpaceCameraController : ScreenSpaceCameraController
  565. /**
  566. * 场景中的阴影贴图。启用时,模型、图元和地球可以投射和接收阴影。默认情况下,阴影贴图的光源是太阳
  567. */
  568. shadowMap : ShadowMap
  569. /**
  570. * The SkyBox used to draw the stars
  571. */
  572. skyBox : SkyBox
  573. /**
  574. * The url to the KTX file containing the specular environment map and convoluted mipmaps for image-based lighting of PBR models
  575. */
  576. specularEnvironmentMaps : string
  577. /**
  578. * The spherical harmonic coefficients for image-based lighting of PBR models.
  579. */
  580. sphericalHarmonicCoefficients : array
  581. sun : Sun
  582. /**
  583. * 获取或者设置当前场景的地形服务provider对象
  584. */
  585. terrainProvider : TerrainProvider
  586. /**
  587. * 获取当前场景地形服务provider改变事件
  588. */
  589. terrainProviderChanged : Event
  590. /**
  591. * 当前场景是否开启toneMapping
  592. */
  593. toneMappingEnabled: boolean
  594. /**
  595. * 获取地下球
  596. */
  597. underGlobe : UnderGlobe
  598. /**
  599. * 获取或者设置地下场景深度,默认1000米(单位:米)
  600. */
  601. undergroundDepth : number
  602. /**
  603. * 获取或者设置是否开启地下场景
  604. */
  605. undergroundMode : Boolean
  606. /**
  607. * 获取或者设置相机模式
  608. */
  609. walkingMode : number
  610. /**
  611. * 根据url路径添加场数据图层
  612. * @param url 场数据的url路径
  613. * @example
  614. * var promise = viewer.scene.addFieldLayer("../data.nc");
  615. Cesium.when(promise,function(fieldLayer){
  616. fieldLayer.particleVelocityFieldEffect.velocityScale = 100.0;
  617. fieldLayer.particleVelocityFieldEffect.particleSize = 2;
  618. fieldLayer.particleVelocityFieldEffect.paricleCountPerDegree = 1.5;
  619. scene.primitives.add(fieldLayer);
  620. fieldLayer.particleVelocityFieldEffect.colorTable = colorTable;
  621. var options = {
  622. longitude:'lon',
  623. latitude:'lat',
  624. uwnd:'uwnd',
  625. vwnd:'uwnd'
  626. }
  627. fieldLayer.NetCDFData = options;
  628. })
  629. * @returns 返回场数据图层FieldLayer3D,异步创建场图层对象
  630. */
  631. addFieldLayer(url: string) : Promise
  632. /**
  633. * 添加场景图层服务
  634. * @param url 图层服务的url路径
  635. * @param sceneName 场景名称
  636. * @param layerName 图层名称
  637. */
  638. addLayerService(url: string, sceneName: string, layerName: string): void
  639. /**
  640. * 添加光源
  641. * @param lightSource
  642. * @returns 添加点光源后后的场景
  643. */
  644. addLightSource(lightSource: LightSource ) : Scene
  645. /**
  646. * 添加S3M分组图层
  647. * @param url iserver中发布的配置文件地址
  648. * @param options 图层所需属性对象
  649. * @param index 索引
  650. */
  651. addS3MGroupLayer(url: string, options: object, index: number) : Promise
  652. /**
  653. * 添加三维切片缓存图层(S3M、S3MB)
  654. * @param url iserver中发布的配置文件地址
  655. * @param options
  656. * @param index 索引
  657. * @example
  658. * var promise = scene.addS3MTilesLayerByScp('http://localhost:8090/iserver/services/3D-zj/rest/realspace/datas/zj/config', {name : 'base'});
  659. * promise.then(function(layer){
  660. * layer.visible = false;
  661. * });
  662. * //子域用法
  663. * var config = {
  664. * subdomainConfig: {
  665. * urlScheme: "http://{s}.supermap.com:8090/iserver/services/3D-BIM/rest/realspace",
  666. * subdomains: ['t1', 't2']
  667. * },
  668. * name: "BIM"
  669. * };
  670. * var promise = scene.addS3MTilesLayerByScp('http://localhost:8090/iserver/services/3D-BIM/rest/realspace/datas/BIM/config', config);
  671. */
  672. addS3MTilesLayerByScp(url: string, options: {
  673. subdomains: Array,
  674. autoSetView: boolean,
  675. name: string,
  676. cullEnabled: boolean
  677. }, index: number) : Promise
  678. /**
  679. * 添加矢量瓦片图层服务。为了保证版本的稳定性,采用该接口创建的MVT图层依然保持原来的使用和实现方式,但不支持VectorTileMap中新增的接口,推荐使用新的实现方式addVectorTilesMap
  680. * @param options.url 适用于通过SuperMap桌面软件生成mvt数据,经iServer发布为rest风格的地图服务,只需提供服务地址
  681. * @param options.url 服务地址,适用于第三方发布的WMTS服务
  682. * @param options.layer 图层名称,适用于第三方发布的WMTS服务
  683. * @param options.canvasWidth 用来绘制矢量的纹理边长。默认是512,越大越精细,越小性能越高
  684. * @param options.tileWidth 瓦片宽度,适用于第三方发布的WMTS服务
  685. * @param options.tileHeight 瓦片高度,适用于第三方发布的WMTS服务
  686. * @param options.format 适用于第三方发布的WMTS服务
  687. * @param options.tilematrxset 切片矩阵集名称,适用于第三方发布的WMTS服务
  688. * @param options.maximumLevel 数据的最大层级。适用于第三方发布的WMTS服务,默认根据服务参数计算
  689. * @param options.minimumLevel 数据的最小层级。适用于第三方发布的WMTS服务,默认根据服务参数计算
  690. * @param options.mapboxStyle 使用的mapBox风格
  691. * @param options.maximumTerrainLevel 允许加载MVT图层的最大地形层号(如果未定义则所有层都加载)
  692. * @param options.minimumTerrainLevel 允许加载MVT图层的最小地形层号(如果未定义则所有层都加载)
  693. * @param options.simplifyTolerance 进行几何简化的坐标容限,单位为切片坐标系,值域为0-4096。值越大简化得越厉害,默认是0,不简化
  694. * @param options.viewer 设置将要添加到的地球
  695. * @example
  696. * var layer = scene.addVectorTilesLayer({
  697. * url:"http://localhost:8090/iserver/services/map-mvt-test/....../maps/test"//地图服务
  698. * });
  699. */
  700. addVectorTilesLayer(options: {
  701. url: string,
  702. url: string,
  703. layer:string ,
  704. canvasWidth: number,
  705. tileWidth: string,
  706. tileHeight: string,
  707. format: string,
  708. tilematrxset: string,
  709. maximumLevel: number,
  710. minimumLevel: number,
  711. mapboxStyle: Object,
  712. maximumTerrainLevel: number,
  713. minimumTerrainLevel: number,
  714. simplifyTolerance: number,
  715. viewer: Object
  716. }): void
  717. /**
  718. * 新建一个矢量瓦片地图
  719. * @param options.url 适用于通过SuperMap桌面软件生成mvt数据,经iServer发布为rest风格的地图服务,只需提供服务地址
  720. * @param options.layer 图层名称,适用于第三方发布的WMTS服务
  721. * @param options.canvasWidth 用来绘制矢量的纹理边长。默认是512,越大越精细,越小性能越高
  722. * @param options.tileWidth 瓦片宽度,适用于第三方发布的WMTS服务
  723. * @param options.tileHeight 瓦片高度,适用于第三方发布的WMTS服务
  724. * @param options.tilematrxset 适用于第三方发布的WMTS服务
  725. * @param options.maximumLevel 切片矩阵集名称,适用于第三方发布的WMTS服务
  726. * @param options.minimumLevel 数据的最大层级。适用于第三方发布的WMTS服务,默认根据服务参数计算
  727. * @param options.mapboxStyle 数据的最小层级。适用于第三方发布的WMTS服务,默认根据服务参数计算
  728. * @param options.maximumTerrainLevel 允许加载MVT图层的最大地形层号(如果未定义则所有层都加载)
  729. * @param options.labelScaleByDistance 设置文字随距离缩放
  730. * @param options.customRequestHeaders 设置自定义请求头
  731. * @param options.realtime 设置是否实时栅格化
  732. * @param options.swipeEnabled 设置是否卷帘
  733. * @param options.swipeRegion 设置卷帘区域
  734. * @param options.billboardMode 设置文字标签样式
  735. * @param options.labelDepthTestEnabled 用于控制MVT文字/图标是否做深度检测。默认为true,开启深度检测,反之则关闭深度检测
  736. * @param options.viewer 设置将要添加到的地球
  737. */
  738. addVectorTilesMap(options: {
  739. url: string,
  740. layer: string,
  741. canvasWidth: number,
  742. tileWidth: string,
  743. tileHeight: string,
  744. format: string,
  745. tilematrxset: string,
  746. maximumLevel: number,
  747. minimumLevel: number,
  748. mapboxStyle: object,
  749. maximumTerrainLevel: number,
  750. minimumTerrainLevel: number,
  751. labelScaleByDistance: number,
  752. customRequestHeaders: object,
  753. realtime: boolean,
  754. swipeEnabled: boolean,
  755. swipeRegion: object,
  756. billboardMode: BillboardMode,
  757. labelDepthTestEnabled: boolean,
  758. viewer: object
  759. }): void
  760. /**
  761. * 转换三维空间坐标到canvas坐标(窗口坐标)。
  762. * @param options 三维空间坐标
  763. * @param result 窗口坐标,用于保存结果
  764. * @example
  765. * //随着鼠标移动输出经纬度为(0,0)的窗口坐标。
  766. * var scene = widget.scene;
  767. * var ellipsoid = scene.globe.ellipsoid;
  768. * var position = Cesium.Cartesian3.fromDegrees(0.0, 0.0);
  769. * var handler = new Cesium.ScreenSpaceEventHandler(scene.canvas);
  770. * handler.setInputAction(function(movement) {
  771. * console.log(scene.cartesianToCanvasCoordinates(position));
  772. * }, Cesium.ScreenSpaceEventType.MOUSE_MOVE);
  773. */
  774. cartesianToCanvasCoordinates(position:Cartesian3 , result: Cartesian2) : Cartesian2
  775. /**
  776. * 当前场景是否支持纹理压缩格式
  777. * @param format 纹理格式。格式名称或WebGL扩展名。例如:s3tc 或 WEBGL_compressed_texture_s3tc
  778. * @returns 该格式是否被支持
  779. */
  780. getCompressedTextureFormatSupported(format) : boolean
  781. /**
  782. * 根据经纬度坐标获取对应高度
  783. */
  784. getHeight(lon: number, lat: number) : number
  785. /**
  786. * 获取选中ID。返回的是对象数组,每个对象包含图层ID(layerID)和选中对象ID(ids)
  787. */
  788. getPickRectIDs() : array
  789. /**
  790. * 根据指定名称获取矢量瓦片地图
  791. * @param name 矢量瓦片地图的名称
  792. */
  793. getVectorTilesMap(name: string) : Layer
  794. /**
  795. * 根据窗口坐标,获取当前场景视口
  796. * @param windowPosition
  797. */
  798. getViewport(windowPosition: Cartesian2) : BoundingRectangle
  799. /**
  800. * 打开iserver场景服务下所有图层
  801. * @param url 服务url
  802. * @param sceneName 工作空间中有多个场景,需要指定场景名称;设置为undefined,默认打开第一个
  803. * @param options.subdomains 用于子域,例如:['t1','t2']
  804. * @param options.autoSetView 是否自动定位到场景
  805. * @example
  806. * var promise = scene.open('http://localhost:8090/iserver/services/3D-BIM3/rest/realspace');
  807. * promise.then(function(layers){});
  808. * //子域和不自动定位用法
  809. * var promise = scene.open('http://{s}.supermap.com:8090/iserver/services/3D-BIM3/rest/realspace',undefined,{
  810. * subdomains: ['t1', 't2'],//子域
  811. * autoSetView : false //不自动定位
  812. * });
  813. * promise.then(function(layers){});
  814. */
  815. open(url: string, sceneName: string, options: {
  816. subdomains: array,
  817. autoSetView: boolean
  818. }) : Promise
  819. /**
  820. * 将当前场景输出Base64编码
  821. * @example
  822. * var promise = scene.outputSceneToFile();
  823. * Cesium.when(promise,function(base64data){
  824. * $("#ID").css("background","url(" + base64data +")");
  825. * })
  826. */
  827. outputSceneToFile() :Promise
  828. /**
  829. * 解析PBR材质参数
  830. * @example
  831. * scene.parsePBRFromJson(urls);
  832. * var conditions=[
  833. * ['${id}<=80',0],
  834. * ['${id}<=90',1],
  835. * ['${id}<=100',2],
  836. * ];
  837. */
  838. parsePBRFromJson() : void
  839. /**
  840. * 场景拾取,返回在场景中该窗口位置对应的第一个图元对象,如果该位置没有任何物体则返回undefined
  841. * @param windowPosition 窗口坐标
  842. * @param width 拾取矩形宽度
  843. * @param height 拾取矩形高度
  844. */
  845. pick(windowPosition: Cartesian2, width: number, height: number) : object
  846. /**
  847. * 用于拾取法线,传入屏幕坐标,返回法线。结合选中偏移可以实现沿法线方向偏移的效果
  848. */
  849. pickNormal(windowPosition: Cartesian2) : Cartesian3
  850. /**
  851. * 位置拾取,根据窗口坐标,从场景的深度缓冲区中拾取相应的位置,返回笛卡尔坐标,需要支持深度纹理
  852. * @param windowPosition 窗口坐标
  853. * @param result 笛卡尔坐标,保存返回结果
  854. */
  855. pickPosition(windowPosition: Cartesian2, result: Cartesian3) : Cartesian3
  856. /**
  857. * 框选
  858. * @param startPoint 框选起始点
  859. * @param endPoint 框选终止点
  860. */
  861. pickRect(startPoint: object, endPoint: object) : number
  862. /**
  863. * 删除光源
  864. * @param lightSource 光源
  865. */
  866. removeLightSource(lightSource: LightSource) : Scene
  867. /**
  868. * 按指定名称移除矢量瓦片地图
  869. * @param name 指定拟移除的矢量瓦片地图的名称
  870. */
  871. removeVectorTilesMap(name) : boolean
  872. /**
  873. * 设置MVT的显示层级控制
  874. * @param control 是否对MVT的显示层级进行控制
  875. * @param level 从当前视角由近及远,总共显示的层级数。例如设置为3,则只显示距离相机最近的前三层,第4层及以后的不会显示
  876. */
  877. setVectorTilesLayersControl(control, level): void
  878. /**
  879. * @param name
  880. */
  881. find(name: string) : Layer
  882. }
  883. /**
  884. * A 2D Cartesian point.
  885. * @param [x = 0.0] - The X component.
  886. * @param [y = 0.0] - The Y component.
  887. */
  888. export class Cartesian2 {
  889. constructor(x?: number, y?: number);
  890. /**
  891. * The X component.
  892. */
  893. x: number;
  894. /**
  895. * The Y component.
  896. */
  897. y: number;
  898. /**
  899. * Creates a Cartesian2 instance from x and y coordinates.
  900. * @param x - The x coordinate.
  901. * @param y - The y coordinate.
  902. * @param [result] - The object onto which to store the result.
  903. * @returns The modified result parameter or a new Cartesian2 instance if one was not provided.
  904. */
  905. fromElements(x: number, y: number, result?: Cartesian2): Cartesian2;
  906. /**
  907. * Duplicates a Cartesian2 instance.
  908. * @param cartesian - The Cartesian to duplicate.
  909. * @param [result] - The object onto which to store the result.
  910. * @returns The modified result parameter or a new Cartesian2 instance if one was not provided. (Returns undefined if cartesian is undefined)
  911. */
  912. clone(cartesian: Cartesian2, result?: Cartesian2): Cartesian2;
  913. /**
  914. * Creates a Cartesian2 instance from an existing Cartesian3. This simply takes the
  915. * x and y properties of the Cartesian3 and drops z.
  916. * @param cartesian - The Cartesian3 instance to create a Cartesian2 instance from.
  917. * @param [result] - The object onto which to store the result.
  918. * @returns The modified result parameter or a new Cartesian2 instance if one was not provided.
  919. */
  920. fromCartesian3(cartesian: Cartesian3, result?: Cartesian2): Cartesian2;
  921. /**
  922. * Creates a Cartesian2 instance from an existing Cartesian4. This simply takes the
  923. * x and y properties of the Cartesian4 and drops z and w.
  924. * @param cartesian - The Cartesian4 instance to create a Cartesian2 instance from.
  925. * @param [result] - The object onto which to store the result.
  926. * @returns The modified result parameter or a new Cartesian2 instance if one was not provided.
  927. */
  928. fromCartesian4(cartesian: Cartesian4, result?: Cartesian2): Cartesian2;
  929. /**
  930. * The number of elements used to pack the object into an array.
  931. */
  932. packedLength: number;
  933. /**
  934. * Stores the provided instance into the provided array.
  935. * @param value - The value to pack.
  936. * @param array - The array to pack into.
  937. * @param [startingIndex = 0] - The index into the array at which to start packing the elements.
  938. * @returns The array that was packed into
  939. */
  940. pack(value: Cartesian2, array: number[], startingIndex?: number): number[];
  941. /**
  942. * Retrieves an instance from a packed array.
  943. * @param array - The packed array.
  944. * @param [startingIndex = 0] - The starting index of the element to be unpacked.
  945. * @param [result] - The object into which to store the result.
  946. * @returns The modified result parameter or a new Cartesian2 instance if one was not provided.
  947. */
  948. unpack(array: number[], startingIndex?: number, result?: Cartesian2): Cartesian2;
  949. /**
  950. * Flattens an array of Cartesian2s into an array of components.
  951. * @param array - The array of cartesians to pack.
  952. * @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.
  953. * @returns The packed array.
  954. */
  955. packArray(array: Cartesian2[], result?: number[]): number[];
  956. /**
  957. * Unpacks an array of cartesian components into an array of Cartesian2s.
  958. * @param array - The array of components to unpack.
  959. * @param [result] - The array onto which to store the result.
  960. * @returns The unpacked array.
  961. */
  962. unpackArray(array: number[], result?: Cartesian2[]): Cartesian2[];
  963. /**
  964. * Creates a Cartesian2 from two consecutive elements in an array.
  965. * @example
  966. * // Create a Cartesian2 with (1.0, 2.0)
  967. * const v = [1.0, 2.0];
  968. * const p = Cesium.Cartesian2.fromArray(v);
  969. *
  970. * // Create a Cartesian2 with (1.0, 2.0) using an offset into an array
  971. * const v2 = [0.0, 0.0, 1.0, 2.0];
  972. * const p2 = Cesium.Cartesian2.fromArray(v2, 2);
  973. * @param array - The array whose two consecutive elements correspond to the x and y components, respectively.
  974. * @param [startingIndex = 0] - The offset into the array of the first element, which corresponds to the x component.
  975. * @param [result] - The object onto which to store the result.
  976. * @returns The modified result parameter or a new Cartesian2 instance if one was not provided.
  977. */
  978. fromArray(array: number[], startingIndex?: number, result?: Cartesian2): Cartesian2;
  979. /**
  980. * Computes the value of the maximum component for the supplied Cartesian.
  981. * @param cartesian - The cartesian to use.
  982. * @returns The value of the maximum component.
  983. */
  984. maximumComponent(cartesian: Cartesian2): number;
  985. /**
  986. * Computes the value of the minimum component for the supplied Cartesian.
  987. * @param cartesian - The cartesian to use.
  988. * @returns The value of the minimum component.
  989. */
  990. minimumComponent(cartesian: Cartesian2): number;
  991. /**
  992. * Compares two Cartesians and computes a Cartesian which contains the minimum components of the supplied Cartesians.
  993. * @param first - A cartesian to compare.
  994. * @param second - A cartesian to compare.
  995. * @param result - The object into which to store the result.
  996. * @returns A cartesian with the minimum components.
  997. */
  998. minimumByComponent(first: Cartesian2, second: Cartesian2, result: Cartesian2): Cartesian2;
  999. /**
  1000. * Compares two Cartesians and computes a Cartesian which contains the maximum components of the supplied Cartesians.
  1001. * @param first - A cartesian to compare.
  1002. * @param second - A cartesian to compare.
  1003. * @param result - The object into which to store the result.
  1004. * @returns A cartesian with the maximum components.
  1005. */
  1006. maximumByComponent(first: Cartesian2, second: Cartesian2, result: Cartesian2): Cartesian2;
  1007. /**
  1008. * Constrain a value to lie between two values.
  1009. * @param value - The value to clamp.
  1010. * @param min - The minimum bound.
  1011. * @param max - The maximum bound.
  1012. * @param result - The object into which to store the result.
  1013. * @returns The clamped value such that min <= result <= max.
  1014. */
  1015. clamp(value: Cartesian2, min: Cartesian2, max: Cartesian2, result: Cartesian2): Cartesian2;
  1016. /**
  1017. * Computes the provided Cartesian's squared magnitude.
  1018. * @param cartesian - The Cartesian instance whose squared magnitude is to be computed.
  1019. * @returns The squared magnitude.
  1020. */
  1021. magnitudeSquared(cartesian: Cartesian2): number;
  1022. /**
  1023. * Computes the Cartesian's magnitude (length).
  1024. * @param cartesian - The Cartesian instance whose magnitude is to be computed.
  1025. * @returns The magnitude.
  1026. */
  1027. magnitude(cartesian: Cartesian2): number;
  1028. /**
  1029. * Computes the distance between two points.
  1030. * @example
  1031. * // Returns 1.0
  1032. * const d = Cesium.Cartesian2.distance(new Cesium.Cartesian2(1.0, 0.0), new Cesium.Cartesian2(2.0, 0.0));
  1033. * @param left - The first point to compute the distance from.
  1034. * @param right - The second point to compute the distance to.
  1035. * @returns The distance between two points.
  1036. */
  1037. distance(left: Cartesian2, right: Cartesian2): number;
  1038. /**
  1039. * Computes the squared distance between two points. Comparing squared distances
  1040. * using this function is more efficient than comparing distances using {@link Cartesian2#distance}.
  1041. * @example
  1042. * // Returns 4.0, not 2.0
  1043. * const d = Cesium.Cartesian2.distance(new Cesium.Cartesian2(1.0, 0.0), new Cesium.Cartesian2(3.0, 0.0));
  1044. * @param left - The first point to compute the distance from.
  1045. * @param right - The second point to compute the distance to.
  1046. * @returns The distance between two points.
  1047. */
  1048. distanceSquared(left: Cartesian2, right: Cartesian2): number;
  1049. /**
  1050. * Computes the normalized form of the supplied Cartesian.
  1051. * @param cartesian - The Cartesian to be normalized.
  1052. * @param result - The object onto which to store the result.
  1053. * @returns The modified result parameter.
  1054. */
  1055. normalize(cartesian: Cartesian2, result: Cartesian2): Cartesian2;
  1056. /**
  1057. * Computes the dot (scalar) product of two Cartesians.
  1058. * @param left - The first Cartesian.
  1059. * @param right - The second Cartesian.
  1060. * @returns The dot product.
  1061. */
  1062. dot(left: Cartesian2, right: Cartesian2): number;
  1063. /**
  1064. * Computes the magnitude of the cross product that would result from implicitly setting the Z coordinate of the input vectors to 0
  1065. * @param left - The first Cartesian.
  1066. * @param right - The second Cartesian.
  1067. * @returns The cross product.
  1068. */
  1069. cross(left: Cartesian2, right: Cartesian2): number;
  1070. /**
  1071. * Computes the componentwise product of two Cartesians.
  1072. * @param left - The first Cartesian.
  1073. * @param right - The second Cartesian.
  1074. * @param result - The object onto which to store the result.
  1075. * @returns The modified result parameter.
  1076. */
  1077. multiplyComponents(left: Cartesian2, right: Cartesian2, result: Cartesian2): Cartesian2;
  1078. /**
  1079. * Computes the componentwise quotient of two Cartesians.
  1080. * @param left - The first Cartesian.
  1081. * @param right - The second Cartesian.
  1082. * @param result - The object onto which to store the result.
  1083. * @returns The modified result parameter.
  1084. */
  1085. divideComponents(left: Cartesian2, right: Cartesian2, result: Cartesian2): Cartesian2;
  1086. /**
  1087. * Computes the componentwise sum of two Cartesians.
  1088. * @param left - The first Cartesian.
  1089. * @param right - The second Cartesian.
  1090. * @param result - The object onto which to store the result.
  1091. * @returns The modified result parameter.
  1092. */
  1093. add(left: Cartesian2, right: Cartesian2, result: Cartesian2): Cartesian2;
  1094. /**
  1095. * Computes the componentwise difference of two Cartesians.
  1096. * @param left - The first Cartesian.
  1097. * @param right - The second Cartesian.
  1098. * @param result - The object onto which to store the result.
  1099. * @returns The modified result parameter.
  1100. */
  1101. subtract(left: Cartesian2, right: Cartesian2, result: Cartesian2): Cartesian2;
  1102. /**
  1103. * Multiplies the provided Cartesian componentwise by the provided scalar.
  1104. * @param cartesian - The Cartesian to be scaled.
  1105. * @param scalar - The scalar to multiply with.
  1106. * @param result - The object onto which to store the result.
  1107. * @returns The modified result parameter.
  1108. */
  1109. multiplyByScalar(cartesian: Cartesian2, scalar: number, result: Cartesian2): Cartesian2;
  1110. /**
  1111. * Divides the provided Cartesian componentwise by the provided scalar.
  1112. * @param cartesian - The Cartesian to be divided.
  1113. * @param scalar - The scalar to divide by.
  1114. * @param result - The object onto which to store the result.
  1115. * @returns The modified result parameter.
  1116. */
  1117. divideByScalar(cartesian: Cartesian2, scalar: number, result: Cartesian2): Cartesian2;
  1118. /**
  1119. * Negates the provided Cartesian.
  1120. * @param cartesian - The Cartesian to be negated.
  1121. * @param result - The object onto which to store the result.
  1122. * @returns The modified result parameter.
  1123. */
  1124. negate(cartesian: Cartesian2, result: Cartesian2): Cartesian2;
  1125. /**
  1126. * Computes the absolute value of the provided Cartesian.
  1127. * @param cartesian - The Cartesian whose absolute value is to be computed.
  1128. * @param result - The object onto which to store the result.
  1129. * @returns The modified result parameter.
  1130. */
  1131. abs(cartesian: Cartesian2, result: Cartesian2): Cartesian2;
  1132. /**
  1133. * Computes the linear interpolation or extrapolation at t using the provided cartesians.
  1134. * @param start - The value corresponding to t at 0.0.
  1135. * @param end - The value corresponding to t at 1.0.
  1136. * @param t - The point along t at which to interpolate.
  1137. * @param result - The object onto which to store the result.
  1138. * @returns The modified result parameter.
  1139. */
  1140. lerp(start: Cartesian2, end: Cartesian2, t: number, result: Cartesian2): Cartesian2;
  1141. /**
  1142. * Returns the angle, in radians, between the provided Cartesians.
  1143. * @param left - The first Cartesian.
  1144. * @param right - The second Cartesian.
  1145. * @returns The angle between the Cartesians.
  1146. */
  1147. angleBetween(left: Cartesian2, right: Cartesian2): number;
  1148. /**
  1149. * Returns the axis that is most orthogonal to the provided Cartesian.
  1150. * @param cartesian - The Cartesian on which to find the most orthogonal axis.
  1151. * @param result - The object onto which to store the result.
  1152. * @returns The most orthogonal axis.
  1153. */
  1154. mostOrthogonalAxis(cartesian: Cartesian2, result: Cartesian2): Cartesian2;
  1155. /**
  1156. * Compares the provided Cartesians componentwise and returns
  1157. * <code>true</code> if they are equal, <code>false</code> otherwise.
  1158. * @param [left] - The first Cartesian.
  1159. * @param [right] - The second Cartesian.
  1160. * @returns <code>true</code> if left and right are equal, <code>false</code> otherwise.
  1161. */
  1162. equals(left?: Cartesian2, right?: Cartesian2): boolean;
  1163. /**
  1164. * Compares the provided Cartesians componentwise and returns
  1165. * <code>true</code> if they pass an absolute or relative tolerance test,
  1166. * <code>false</code> otherwise.
  1167. * @param [left] - The first Cartesian.
  1168. * @param [right] - The second Cartesian.
  1169. * @param [relativeEpsilon = 0] - The relative epsilon tolerance to use for equality testing.
  1170. * @param [absoluteEpsilon = relativeEpsilon] - The absolute epsilon tolerance to use for equality testing.
  1171. * @returns <code>true</code> if left and right are within the provided epsilon, <code>false</code> otherwise.
  1172. */
  1173. equalsEpsilon(left?: Cartesian2, right?: Cartesian2, relativeEpsilon?: number, absoluteEpsilon?: number): boolean;
  1174. /**
  1175. * An immutable Cartesian2 instance initialized to (0.0, 0.0).
  1176. */
  1177. readonly ZERO: Cartesian2;
  1178. /**
  1179. * An immutable Cartesian2 instance initialized to (1.0, 1.0).
  1180. */
  1181. readonly ONE: Cartesian2;
  1182. /**
  1183. * An immutable Cartesian2 instance initialized to (1.0, 0.0).
  1184. */
  1185. readonly UNIT_X: Cartesian2;
  1186. /**
  1187. * An immutable Cartesian2 instance initialized to (0.0, 1.0).
  1188. */
  1189. readonly UNIT_Y: Cartesian2;
  1190. /**
  1191. * Duplicates this Cartesian2 instance.
  1192. * @param [result] - The object onto which to store the result.
  1193. * @returns The modified result parameter or a new Cartesian2 instance if one was not provided.
  1194. */
  1195. clone(result?: Cartesian2): Cartesian2;
  1196. /**
  1197. * Compares this Cartesian against the provided Cartesian componentwise and returns
  1198. * <code>true</code> if they are equal, <code>false</code> otherwise.
  1199. * @param [right] - The right hand side Cartesian.
  1200. * @returns <code>true</code> if they are equal, <code>false</code> otherwise.
  1201. */
  1202. equals(right?: Cartesian2): boolean;
  1203. /**
  1204. * Compares this Cartesian against the provided Cartesian componentwise and returns
  1205. * <code>true</code> if they pass an absolute or relative tolerance test,
  1206. * <code>false</code> otherwise.
  1207. * @param [right] - The right hand side Cartesian.
  1208. * @param [relativeEpsilon = 0] - The relative epsilon tolerance to use for equality testing.
  1209. * @param [absoluteEpsilon = relativeEpsilon] - The absolute epsilon tolerance to use for equality testing.
  1210. * @returns <code>true</code> if they are within the provided epsilon, <code>false</code> otherwise.
  1211. */
  1212. equalsEpsilon(right?: Cartesian2, relativeEpsilon?: number, absoluteEpsilon?: number): boolean;
  1213. /**
  1214. * Creates a string representing this Cartesian in the format '(x, y)'.
  1215. * @returns A string representing the provided Cartesian in the format '(x, y)'.
  1216. */
  1217. toString(): string;
  1218. }
  1219. /**
  1220. * A 3D Cartesian point.
  1221. * @param [x = 0.0] - The X component.
  1222. * @param [y = 0.0] - The Y component.
  1223. * @param [z = 0.0] - The Z component.
  1224. */
  1225. export class Cartesian3 {
  1226. constructor(x?: number, y?: number, z?: number);
  1227. /**
  1228. * The X component.
  1229. */
  1230. x: number;
  1231. /**
  1232. * The Y component.
  1233. */
  1234. y: number;
  1235. /**
  1236. * The Z component.
  1237. */
  1238. z: number;
  1239. /**
  1240. * Converts the provided Spherical into Cartesian3 coordinates.
  1241. * @param spherical - The Spherical to be converted to Cartesian3.
  1242. * @param [result] - The object onto which to store the result.
  1243. * @returns The modified result parameter or a new Cartesian3 instance if one was not provided.
  1244. */
  1245. fromSpherical(spherical: Spherical, result?: Cartesian3): Cartesian3;
  1246. /**
  1247. * Creates a Cartesian3 instance from x, y and z coordinates.
  1248. * @param x - The x coordinate.
  1249. * @param y - The y coordinate.
  1250. * @param z - The z coordinate.
  1251. * @param [result] - The object onto which to store the result.
  1252. * @returns The modified result parameter or a new Cartesian3 instance if one was not provided.
  1253. */
  1254. fromElements(x: number, y: number, z: number, result?: Cartesian3): Cartesian3;
  1255. /**
  1256. * Duplicates a Cartesian3 instance.
  1257. * @param cartesian - The Cartesian to duplicate.
  1258. * @param [result] - The object onto which to store the result.
  1259. * @returns The modified result parameter or a new Cartesian3 instance if one was not provided. (Returns undefined if cartesian is undefined)
  1260. */
  1261. clone(cartesian: Cartesian3, result?: Cartesian3): Cartesian3;
  1262. /**
  1263. * Creates a Cartesian3 instance from an existing Cartesian4. This simply takes the
  1264. * x, y, and z properties of the Cartesian4 and drops w.
  1265. * @param cartesian - The Cartesian4 instance to create a Cartesian3 instance from.
  1266. * @param [result] - The object onto which to store the result.
  1267. * @returns The modified result parameter or a new Cartesian3 instance if one was not provided.
  1268. */
  1269. fromCartesian4(cartesian: Cartesian4, result?: Cartesian3): Cartesian3;
  1270. /**
  1271. * The number of elements used to pack the object into an array.
  1272. */
  1273. packedLength: number;
  1274. /**
  1275. * Stores the provided instance into the provided array.
  1276. * @param value - The value to pack.
  1277. * @param array - The array to pack into.
  1278. * @param [startingIndex = 0] - The index into the array at which to start packing the elements.
  1279. * @returns The array that was packed into
  1280. */
  1281. pack(value: Cartesian3, array: number[], startingIndex?: number): number[];
  1282. /**
  1283. * Retrieves an instance from a packed array.
  1284. * @param array - The packed array.
  1285. * @param [startingIndex = 0] - The starting index of the element to be unpacked.
  1286. * @param [result] - The object into which to store the result.
  1287. * @returns The modified result parameter or a new Cartesian3 instance if one was not provided.
  1288. */
  1289. unpack(array: number[], startingIndex?: number, result?: Cartesian3): Cartesian3;
  1290. /**
  1291. * Flattens an array of Cartesian3s into an array of components.
  1292. * @param array - The array of cartesians to pack.
  1293. * @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.
  1294. * @returns The packed array.
  1295. */
  1296. packArray(array: Cartesian3[], result?: number[]): number[];
  1297. /**
  1298. * Unpacks an array of cartesian components into an array of Cartesian3s.
  1299. * @param array - The array of components to unpack.
  1300. * @param [result] - The array onto which to store the result.
  1301. * @returns The unpacked array.
  1302. */
  1303. unpackArray(array: number[], result?: Cartesian3[]): Cartesian3[];
  1304. /**
  1305. * Creates a Cartesian3 from three consecutive elements in an array.
  1306. * @example
  1307. * // Create a Cartesian3 with (1.0, 2.0, 3.0)
  1308. * const v = [1.0, 2.0, 3.0];
  1309. * const p = Cesium.Cartesian3.fromArray(v);
  1310. *
  1311. * // Create a Cartesian3 with (1.0, 2.0, 3.0) using an offset into an array
  1312. * const v2 = [0.0, 0.0, 1.0, 2.0, 3.0];
  1313. * const p2 = Cesium.Cartesian3.fromArray(v2, 2);
  1314. * @param array - The array whose three consecutive elements correspond to the x, y, and z components, respectively.
  1315. * @param [startingIndex = 0] - The offset into the array of the first element, which corresponds to the x component.
  1316. * @param [result] - The object onto which to store the result.
  1317. * @returns The modified result parameter or a new Cartesian3 instance if one was not provided.
  1318. */
  1319. fromArray(array: number[], startingIndex?: number, result?: Cartesian3): Cartesian3;
  1320. /**
  1321. * Computes the value of the maximum component for the supplied Cartesian.
  1322. * @param cartesian - The cartesian to use.
  1323. * @returns The value of the maximum component.
  1324. */
  1325. maximumComponent(cartesian: Cartesian3): number;
  1326. /**
  1327. * Computes the value of the minimum component for the supplied Cartesian.
  1328. * @param cartesian - The cartesian to use.
  1329. * @returns The value of the minimum component.
  1330. */
  1331. minimumComponent(cartesian: Cartesian3): number;
  1332. /**
  1333. * Compares two Cartesians and computes a Cartesian which contains the minimum components of the supplied Cartesians.
  1334. * @param first - A cartesian to compare.
  1335. * @param second - A cartesian to compare.
  1336. * @param result - The object into which to store the result.
  1337. * @returns A cartesian with the minimum components.
  1338. */
  1339. minimumByComponent(first: Cartesian3, second: Cartesian3, result: Cartesian3): Cartesian3;
  1340. /**
  1341. * Compares two Cartesians and computes a Cartesian which contains the maximum components of the supplied Cartesians.
  1342. * @param first - A cartesian to compare.
  1343. * @param second - A cartesian to compare.
  1344. * @param result - The object into which to store the result.
  1345. * @returns A cartesian with the maximum components.
  1346. */
  1347. maximumByComponent(first: Cartesian3, second: Cartesian3, result: Cartesian3): Cartesian3;
  1348. /**
  1349. * Constrain a value to lie between two values.
  1350. * @param cartesian - The value to clamp.
  1351. * @param min - The minimum bound.
  1352. * @param max - The maximum bound.
  1353. * @param result - The object into which to store the result.
  1354. * @returns The clamped value such that min <= value <= max.
  1355. */
  1356. clamp(cartesian: Cartesian3, min: Cartesian3, max: Cartesian3, result: Cartesian3): Cartesian3;
  1357. /**
  1358. * Computes the provided Cartesian's squared magnitude.
  1359. * @param cartesian - The Cartesian instance whose squared magnitude is to be computed.
  1360. * @returns The squared magnitude.
  1361. */
  1362. magnitudeSquared(cartesian: Cartesian3): number;
  1363. /**
  1364. * Computes the Cartesian's magnitude (length).
  1365. * @param cartesian - The Cartesian instance whose magnitude is to be computed.
  1366. * @returns The magnitude.
  1367. */
  1368. magnitude(cartesian: Cartesian3): number;
  1369. /**
  1370. * Computes the distance between two points.
  1371. * @example
  1372. * // Returns 1.0
  1373. * const d = Cesium.Cartesian3.distance(new Cesium.Cartesian3(1.0, 0.0, 0.0), new Cesium.Cartesian3(2.0, 0.0, 0.0));
  1374. * @param left - The first point to compute the distance from.
  1375. * @param right - The second point to compute the distance to.
  1376. * @returns The distance between two points.
  1377. */
  1378. distance(left: Cartesian3, right: Cartesian3): number;
  1379. /**
  1380. * Computes the squared distance between two points. Comparing squared distances
  1381. * using this function is more efficient than comparing distances using {@link Cartesian3#distance}.
  1382. * @example
  1383. * // Returns 4.0, not 2.0
  1384. * const d = Cesium.Cartesian3.distanceSquared(new Cesium.Cartesian3(1.0, 0.0, 0.0), new Cesium.Cartesian3(3.0, 0.0, 0.0));
  1385. * @param left - The first point to compute the distance from.
  1386. * @param right - The second point to compute the distance to.
  1387. * @returns The distance between two points.
  1388. */
  1389. distanceSquared(left: Cartesian3, right: Cartesian3): number;
  1390. /**
  1391. * Computes the normalized form of the supplied Cartesian.
  1392. * @param cartesian - The Cartesian to be normalized.
  1393. * @param result - The object onto which to store the result.
  1394. * @returns The modified result parameter.
  1395. */
  1396. normalize(cartesian: Cartesian3, result: Cartesian3): Cartesian3;
  1397. /**
  1398. * Computes the dot (scalar) product of two Cartesians.
  1399. * @param left - The first Cartesian.
  1400. * @param right - The second Cartesian.
  1401. * @returns The dot product.
  1402. */
  1403. dot(left: Cartesian3, right: Cartesian3): number;
  1404. /**
  1405. * Computes the componentwise product of two Cartesians.
  1406. * @param left - The first Cartesian.
  1407. * @param right - The second Cartesian.
  1408. * @param result - The object onto which to store the result.
  1409. * @returns The modified result parameter.
  1410. */
  1411. multiplyComponents(left: Cartesian3, right: Cartesian3, result: Cartesian3): Cartesian3;
  1412. /**
  1413. * Computes the componentwise quotient of two Cartesians.
  1414. * @param left - The first Cartesian.
  1415. * @param right - The second Cartesian.
  1416. * @param result - The object onto which to store the result.
  1417. * @returns The modified result parameter.
  1418. */
  1419. divideComponents(left: Cartesian3, right: Cartesian3, result: Cartesian3): Cartesian3;
  1420. /**
  1421. * Computes the componentwise sum of two Cartesians.
  1422. * @param left - The first Cartesian.
  1423. * @param right - The second Cartesian.
  1424. * @param result - The object onto which to store the result.
  1425. * @returns The modified result parameter.
  1426. */
  1427. add(left: Cartesian3, right: Cartesian3, result: Cartesian3): Cartesian3;
  1428. /**
  1429. * Computes the componentwise difference of two Cartesians.
  1430. * @param left - The first Cartesian.
  1431. * @param right - The second Cartesian.
  1432. * @param result - The object onto which to store the result.
  1433. * @returns The modified result parameter.
  1434. */
  1435. subtract(left: Cartesian3, right: Cartesian3, result: Cartesian3): Cartesian3;
  1436. /**
  1437. * Multiplies the provided Cartesian componentwise by the provided scalar.
  1438. * @param cartesian - The Cartesian to be scaled.
  1439. * @param scalar - The scalar to multiply with.
  1440. * @param result - The object onto which to store the result.
  1441. * @returns The modified result parameter.
  1442. */
  1443. multiplyByScalar(cartesian: Cartesian3, scalar: number, result: Cartesian3): Cartesian3;
  1444. /**
  1445. * Divides the provided Cartesian componentwise by the provided scalar.
  1446. * @param cartesian - The Cartesian to be divided.
  1447. * @param scalar - The scalar to divide by.
  1448. * @param result - The object onto which to store the result.
  1449. * @returns The modified result parameter.
  1450. */
  1451. divideByScalar(cartesian: Cartesian3, scalar: number, result: Cartesian3): Cartesian3;
  1452. /**
  1453. * Negates the provided Cartesian.
  1454. * @param cartesian - The Cartesian to be negated.
  1455. * @param result - The object onto which to store the result.
  1456. * @returns The modified result parameter.
  1457. */
  1458. negate(cartesian: Cartesian3, result: Cartesian3): Cartesian3;
  1459. /**
  1460. * Computes the absolute value of the provided Cartesian.
  1461. * @param cartesian - The Cartesian whose absolute value is to be computed.
  1462. * @param result - The object onto which to store the result.
  1463. * @returns The modified result parameter.
  1464. */
  1465. abs(cartesian: Cartesian3, result: Cartesian3): Cartesian3;
  1466. /**
  1467. * Computes the linear interpolation or extrapolation at t using the provided cartesians.
  1468. * @param start - The value corresponding to t at 0.0.
  1469. * @param end - The value corresponding to t at 1.0.
  1470. * @param t - The point along t at which to interpolate.
  1471. * @param result - The object onto which to store the result.
  1472. * @returns The modified result parameter.
  1473. */
  1474. lerp(start: Cartesian3, end: Cartesian3, t: number, result: Cartesian3): Cartesian3;
  1475. /**
  1476. * Returns the angle, in radians, between the provided Cartesians.
  1477. * @param left - The first Cartesian.
  1478. * @param right - The second Cartesian.
  1479. * @returns The angle between the Cartesians.
  1480. */
  1481. angleBetween(left: Cartesian3, right: Cartesian3): number;
  1482. /**
  1483. * Returns the axis that is most orthogonal to the provided Cartesian.
  1484. * @param cartesian - The Cartesian on which to find the most orthogonal axis.
  1485. * @param result - The object onto which to store the result.
  1486. * @returns The most orthogonal axis.
  1487. */
  1488. mostOrthogonalAxis(cartesian: Cartesian3, result: Cartesian3): Cartesian3;
  1489. /**
  1490. * Projects vector a onto vector b
  1491. * @param a - The vector that needs projecting
  1492. * @param b - The vector to project onto
  1493. * @param result - The result cartesian
  1494. * @returns The modified result parameter
  1495. */
  1496. projectVector(a: Cartesian3, b: Cartesian3, result: Cartesian3): Cartesian3;
  1497. /**
  1498. * Compares the provided Cartesians componentwise and returns
  1499. * <code>true</code> if they are equal, <code>false</code> otherwise.
  1500. * @param [left] - The first Cartesian.
  1501. * @param [right] - The second Cartesian.
  1502. * @returns <code>true</code> if left and right are equal, <code>false</code> otherwise.
  1503. */
  1504. equals(left?: Cartesian3, right?: Cartesian3): boolean;
  1505. /**
  1506. * Compares the provided Cartesians componentwise and returns
  1507. * <code>true</code> if they pass an absolute or relative tolerance test,
  1508. * <code>false</code> otherwise.
  1509. * @param [left] - The first Cartesian.
  1510. * @param [right] - The second Cartesian.
  1511. * @param [relativeEpsilon = 0] - The relative epsilon tolerance to use for equality testing.
  1512. * @param [absoluteEpsilon = relativeEpsilon] - The absolute epsilon tolerance to use for equality testing.
  1513. * @returns <code>true</code> if left and right are within the provided epsilon, <code>false</code> otherwise.
  1514. */
  1515. equalsEpsilon(left?: Cartesian3, right?: Cartesian3, relativeEpsilon?: number, absoluteEpsilon?: number): boolean;
  1516. /**
  1517. * Computes the cross (outer) product of two Cartesians.
  1518. * @param left - The first Cartesian.
  1519. * @param right - The second Cartesian.
  1520. * @param result - The object onto which to store the result.
  1521. * @returns The cross product.
  1522. */
  1523. cross(left: Cartesian3, right: Cartesian3, result: Cartesian3): Cartesian3;
  1524. /**
  1525. * Computes the midpoint between the right and left Cartesian.
  1526. * @param left - The first Cartesian.
  1527. * @param right - The second Cartesian.
  1528. * @param result - The object onto which to store the result.
  1529. * @returns The midpoint.
  1530. */
  1531. midpoint(left: Cartesian3, right: Cartesian3, result: Cartesian3): Cartesian3;
  1532. /**
  1533. * Returns a Cartesian3 position from longitude and latitude values given in degrees.
  1534. * @example
  1535. * const position = Cesium.Cartesian3.fromDegrees(-115.0, 37.0);
  1536. * @param longitude - The longitude, in degrees
  1537. * @param latitude - The latitude, in degrees
  1538. * @param [height = 0.0] - The height, in meters, above the ellipsoid.
  1539. * @param [ellipsoid = Ellipsoid.WGS84] - The ellipsoid on which the position lies.
  1540. * @param [result] - The object onto which to store the result.
  1541. * @returns The position
  1542. */
  1543. fromDegrees(longitude: number, latitude: number, height?: number, ellipsoid?: Ellipsoid, result?: Cartesian3): Cartesian3;
  1544. /**
  1545. * Returns a Cartesian3 position from longitude and latitude values given in radians.
  1546. * @example
  1547. * const position = Cesium.Cartesian3.fromRadians(-2.007, 0.645);
  1548. * @param longitude - The longitude, in radians
  1549. * @param latitude - The latitude, in radians
  1550. * @param [height = 0.0] - The height, in meters, above the ellipsoid.
  1551. * @param [ellipsoid = Ellipsoid.WGS84] - The ellipsoid on which the position lies.
  1552. * @param [result] - The object onto which to store the result.
  1553. * @returns The position
  1554. */
  1555. fromRadians(longitude: number, latitude: number, height?: number, ellipsoid?: Ellipsoid, result?: Cartesian3): Cartesian3;
  1556. /**
  1557. * Returns an array of Cartesian3 positions given an array of longitude and latitude values given in degrees.
  1558. * @example
  1559. * const positions = Cesium.Cartesian3.fromDegreesArray([-115.0, 37.0, -107.0, 33.0]);
  1560. * @param coordinates - A list of longitude and latitude values. Values alternate [longitude, latitude, longitude, latitude...].
  1561. * @param [ellipsoid = Ellipsoid.WGS84] - The ellipsoid on which the coordinates lie.
  1562. * @param [result] - An array of Cartesian3 objects to store the result.
  1563. * @returns The array of positions.
  1564. */
  1565. fromDegreesArray(coordinates: number[], ellipsoid?: Ellipsoid, result?: Cartesian3[]): Cartesian3[];
  1566. /**
  1567. * Returns an array of Cartesian3 positions given an array of longitude and latitude values given in radians.
  1568. * @example
  1569. * const positions = Cesium.Cartesian3.fromRadiansArray([-2.007, 0.645, -1.867, .575]);
  1570. * @param coordinates - A list of longitude and latitude values. Values alternate [longitude, latitude, longitude, latitude...].
  1571. * @param [ellipsoid = Ellipsoid.WGS84] - The ellipsoid on which the coordinates lie.
  1572. * @param [result] - An array of Cartesian3 objects to store the result.
  1573. * @returns The array of positions.
  1574. */
  1575. fromRadiansArray(coordinates: number[], ellipsoid?: Ellipsoid, result?: Cartesian3[]): Cartesian3[];
  1576. /**
  1577. * Returns an array of Cartesian3 positions given an array of longitude, latitude and height values where longitude and latitude are given in degrees.
  1578. * @example
  1579. * const positions = Cesium.Cartesian3.fromDegreesArrayHeights([-115.0, 37.0, 100000.0, -107.0, 33.0, 150000.0]);
  1580. * @param coordinates - A list of longitude, latitude and height values. Values alternate [longitude, latitude, height, longitude, latitude, height...].
  1581. * @param [ellipsoid = Ellipsoid.WGS84] - The ellipsoid on which the position lies.
  1582. * @param [result] - An array of Cartesian3 objects to store the result.
  1583. * @returns The array of positions.
  1584. */
  1585. fromDegreesArrayHeights(coordinates: number[], ellipsoid?: Ellipsoid, result?: Cartesian3[]): Cartesian3[];
  1586. /**
  1587. * Returns an array of Cartesian3 positions given an array of longitude, latitude and height values where longitude and latitude are given in radians.
  1588. * @example
  1589. * const positions = Cesium.Cartesian3.fromRadiansArrayHeights([-2.007, 0.645, 100000.0, -1.867, .575, 150000.0]);
  1590. * @param coordinates - A list of longitude, latitude and height values. Values alternate [longitude, latitude, height, longitude, latitude, height...].
  1591. * @param [ellipsoid = Ellipsoid.WGS84] - The ellipsoid on which the position lies.
  1592. * @param [result] - An array of Cartesian3 objects to store the result.
  1593. * @returns The array of positions.
  1594. */
  1595. fromRadiansArrayHeights(coordinates: number[], ellipsoid?: Ellipsoid, result?: Cartesian3[]): Cartesian3[];
  1596. /**
  1597. * An immutable Cartesian3 instance initialized to (0.0, 0.0, 0.0).
  1598. */
  1599. readonly ZERO: Cartesian3;
  1600. /**
  1601. * An immutable Cartesian3 instance initialized to (1.0, 1.0, 1.0).
  1602. */
  1603. readonly ONE: Cartesian3;
  1604. /**
  1605. * An immutable Cartesian3 instance initialized to (1.0, 0.0, 0.0).
  1606. */
  1607. readonly UNIT_X: Cartesian3;
  1608. /**
  1609. * An immutable Cartesian3 instance initialized to (0.0, 1.0, 0.0).
  1610. */
  1611. readonly UNIT_Y: Cartesian3;
  1612. /**
  1613. * An immutable Cartesian3 instance initialized to (0.0, 0.0, 1.0).
  1614. */
  1615. readonly UNIT_Z: Cartesian3;
  1616. /**
  1617. * Duplicates this Cartesian3 instance.
  1618. * @param [result] - The object onto which to store the result.
  1619. * @returns The modified result parameter or a new Cartesian3 instance if one was not provided.
  1620. */
  1621. clone(result?: Cartesian3): Cartesian3;
  1622. /**
  1623. * Compares this Cartesian against the provided Cartesian componentwise and returns
  1624. * <code>true</code> if they are equal, <code>false</code> otherwise.
  1625. * @param [right] - The right hand side Cartesian.
  1626. * @returns <code>true</code> if they are equal, <code>false</code> otherwise.
  1627. */
  1628. equals(right?: Cartesian3): boolean;
  1629. /**
  1630. * Compares this Cartesian against the provided Cartesian componentwise and returns
  1631. * <code>true</code> if they pass an absolute or relative tolerance test,
  1632. * <code>false</code> otherwise.
  1633. * @param [right] - The right hand side Cartesian.
  1634. * @param [relativeEpsilon = 0] - The relative epsilon tolerance to use for equality testing.
  1635. * @param [absoluteEpsilon = relativeEpsilon] - The absolute epsilon tolerance to use for equality testing.
  1636. * @returns <code>true</code> if they are within the provided epsilon, <code>false</code> otherwise.
  1637. */
  1638. equalsEpsilon(right?: Cartesian3, relativeEpsilon?: number, absoluteEpsilon?: number): boolean;
  1639. /**
  1640. * Creates a string representing this Cartesian in the format '(x, y, z)'.
  1641. * @returns A string representing this Cartesian in the format '(x, y, z)'.
  1642. */
  1643. toString(): string;
  1644. }
  1645. /**
  1646. * A 4D Cartesian point.
  1647. * @param [x = 0.0] - The X component.
  1648. * @param [y = 0.0] - The Y component.
  1649. * @param [z = 0.0] - The Z component.
  1650. * @param [w = 0.0] - The W component.
  1651. */
  1652. export class Cartesian4 {
  1653. constructor(x?: number, y?: number, z?: number, w?: number);
  1654. /**
  1655. * The X component.
  1656. */
  1657. x: number;
  1658. /**
  1659. * The Y component.
  1660. */
  1661. y: number;
  1662. /**
  1663. * The Z component.
  1664. */
  1665. z: number;
  1666. /**
  1667. * The W component.
  1668. */
  1669. w: number;
  1670. /**
  1671. * Creates a Cartesian4 instance from x, y, z and w coordinates.
  1672. * @param x - The x coordinate.
  1673. * @param y - The y coordinate.
  1674. * @param z - The z coordinate.
  1675. * @param w - The w coordinate.
  1676. * @param [result] - The object onto which to store the result.
  1677. * @returns The modified result parameter or a new Cartesian4 instance if one was not provided.
  1678. */
  1679. fromElements(x: number, y: number, z: number, w: number, result?: Cartesian4): Cartesian4;
  1680. /**
  1681. * Creates a Cartesian4 instance from a {@link Color}. <code>red</code>, <code>green</code>, <code>blue</code>,
  1682. * and <code>alpha</code> map to <code>x</code>, <code>y</code>, <code>z</code>, and <code>w</code>, respectively.
  1683. * @param color - The source color.
  1684. * @param [result] - The object onto which to store the result.
  1685. * @returns The modified result parameter or a new Cartesian4 instance if one was not provided.
  1686. */
  1687. fromColor(color: Color, result?: Cartesian4): Cartesian4;
  1688. /**
  1689. * Duplicates a Cartesian4 instance.
  1690. * @param cartesian - The Cartesian to duplicate.
  1691. * @param [result] - The object onto which to store the result.
  1692. * @returns The modified result parameter or a new Cartesian4 instance if one was not provided. (Returns undefined if cartesian is undefined)
  1693. */
  1694. clone(cartesian: Cartesian4, result?: Cartesian4): Cartesian4;
  1695. /**
  1696. * The number of elements used to pack the object into an array.
  1697. */
  1698. packedLength: number;
  1699. /**
  1700. * Stores the provided instance into the provided array.
  1701. * @param value - The value to pack.
  1702. * @param array - The array to pack into.
  1703. * @param [startingIndex = 0] - The index into the array at which to start packing the elements.
  1704. * @returns The array that was packed into
  1705. */
  1706. pack(value: Cartesian4, array: number[], startingIndex?: number): number[];
  1707. /**
  1708. * Retrieves an instance from a packed array.
  1709. * @param array - The packed array.
  1710. * @param [startingIndex = 0] - The starting index of the element to be unpacked.
  1711. * @param [result] - The object into which to store the result.
  1712. * @returns The modified result parameter or a new Cartesian4 instance if one was not provided.
  1713. */
  1714. unpack(array: number[], startingIndex?: number, result?: Cartesian4): Cartesian4;
  1715. /**
  1716. * Flattens an array of Cartesian4s into an array of components.
  1717. * @param array - The array of cartesians to pack.
  1718. * @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.
  1719. * @returns The packed array.
  1720. */
  1721. packArray(array: Cartesian4[], result?: number[]): number[];
  1722. /**
  1723. * Unpacks an array of cartesian components into an array of Cartesian4s.
  1724. * @param array - The array of components to unpack.
  1725. * @param [result] - The array onto which to store the result.
  1726. * @returns The unpacked array.
  1727. */
  1728. unpackArray(array: number[], result?: Cartesian4[]): Cartesian4[];
  1729. /**
  1730. * Creates a Cartesian4 from four consecutive elements in an array.
  1731. * @example
  1732. * // Create a Cartesian4 with (1.0, 2.0, 3.0, 4.0)
  1733. * const v = [1.0, 2.0, 3.0, 4.0];
  1734. * const p = Cesium.Cartesian4.fromArray(v);
  1735. *
  1736. * // Create a Cartesian4 with (1.0, 2.0, 3.0, 4.0) using an offset into an array
  1737. * const v2 = [0.0, 0.0, 1.0, 2.0, 3.0, 4.0];
  1738. * const p2 = Cesium.Cartesian4.fromArray(v2, 2);
  1739. * @param array - The array whose four consecutive elements correspond to the x, y, z, and w components, respectively.
  1740. * @param [startingIndex = 0] - The offset into the array of the first element, which corresponds to the x component.
  1741. * @param [result] - The object onto which to store the result.
  1742. * @returns The modified result parameter or a new Cartesian4 instance if one was not provided.
  1743. */
  1744. fromArray(array: number[], startingIndex?: number, result?: Cartesian4): Cartesian4;
  1745. /**
  1746. * Computes the value of the maximum component for the supplied Cartesian.
  1747. * @param cartesian - The cartesian to use.
  1748. * @returns The value of the maximum component.
  1749. */
  1750. maximumComponent(cartesian: Cartesian4): number;
  1751. /**
  1752. * Computes the value of the minimum component for the supplied Cartesian.
  1753. * @param cartesian - The cartesian to use.
  1754. * @returns The value of the minimum component.
  1755. */
  1756. minimumComponent(cartesian: Cartesian4): number;
  1757. /**
  1758. * Compares two Cartesians and computes a Cartesian which contains the minimum components of the supplied Cartesians.
  1759. * @param first - A cartesian to compare.
  1760. * @param second - A cartesian to compare.
  1761. * @param result - The object into which to store the result.
  1762. * @returns A cartesian with the minimum components.
  1763. */
  1764. minimumByComponent(first: Cartesian4, second: Cartesian4, result: Cartesian4): Cartesian4;
  1765. /**
  1766. * Compares two Cartesians and computes a Cartesian which contains the maximum components of the supplied Cartesians.
  1767. * @param first - A cartesian to compare.
  1768. * @param second - A cartesian to compare.
  1769. * @param result - The object into which to store the result.
  1770. * @returns A cartesian with the maximum components.
  1771. */
  1772. maximumByComponent(first: Cartesian4, second: Cartesian4, result: Cartesian4): Cartesian4;
  1773. /**
  1774. * Constrain a value to lie between two values.
  1775. * @param value - The value to clamp.
  1776. * @param min - The minimum bound.
  1777. * @param max - The maximum bound.
  1778. * @param result - The object into which to store the result.
  1779. * @returns The clamped value such that min <= result <= max.
  1780. */
  1781. clamp(value: Cartesian4, min: Cartesian4, max: Cartesian4, result: Cartesian4): Cartesian4;
  1782. /**
  1783. * Computes the provided Cartesian's squared magnitude.
  1784. * @param cartesian - The Cartesian instance whose squared magnitude is to be computed.
  1785. * @returns The squared magnitude.
  1786. */
  1787. magnitudeSquared(cartesian: Cartesian4): number;
  1788. /**
  1789. * Computes the Cartesian's magnitude (length).
  1790. * @param cartesian - The Cartesian instance whose magnitude is to be computed.
  1791. * @returns The magnitude.
  1792. */
  1793. magnitude(cartesian: Cartesian4): number;
  1794. /**
  1795. * Computes the 4-space distance between two points.
  1796. * @example
  1797. * // Returns 1.0
  1798. * const d = Cesium.Cartesian4.distance(
  1799. * new Cesium.Cartesian4(1.0, 0.0, 0.0, 0.0),
  1800. * new Cesium.Cartesian4(2.0, 0.0, 0.0, 0.0));
  1801. * @param left - The first point to compute the distance from.
  1802. * @param right - The second point to compute the distance to.
  1803. * @returns The distance between two points.
  1804. */
  1805. distance(left: Cartesian4, right: Cartesian4): number;
  1806. /**
  1807. * Computes the squared distance between two points. Comparing squared distances
  1808. * using this function is more efficient than comparing distances using {@link Cartesian4#distance}.
  1809. * @example
  1810. * // Returns 4.0, not 2.0
  1811. * const d = Cesium.Cartesian4.distance(
  1812. * new Cesium.Cartesian4(1.0, 0.0, 0.0, 0.0),
  1813. * new Cesium.Cartesian4(3.0, 0.0, 0.0, 0.0));
  1814. * @param left - The first point to compute the distance from.
  1815. * @param right - The second point to compute the distance to.
  1816. * @returns The distance between two points.
  1817. */
  1818. distanceSquared(left: Cartesian4, right: Cartesian4): number;
  1819. /**
  1820. * Computes the normalized form of the supplied Cartesian.
  1821. * @param cartesian - The Cartesian to be normalized.
  1822. * @param result - The object onto which to store the result.
  1823. * @returns The modified result parameter.
  1824. */
  1825. normalize(cartesian: Cartesian4, result: Cartesian4): Cartesian4;
  1826. /**
  1827. * Computes the dot (scalar) product of two Cartesians.
  1828. * @param left - The first Cartesian.
  1829. * @param right - The second Cartesian.
  1830. * @returns The dot product.
  1831. */
  1832. dot(left: Cartesian4, right: Cartesian4): number;
  1833. /**
  1834. * Computes the componentwise product of two Cartesians.
  1835. * @param left - The first Cartesian.
  1836. * @param right - The second Cartesian.
  1837. * @param result - The object onto which to store the result.
  1838. * @returns The modified result parameter.
  1839. */
  1840. multiplyComponents(left: Cartesian4, right: Cartesian4, result: Cartesian4): Cartesian4;
  1841. /**
  1842. * Computes the componentwise quotient of two Cartesians.
  1843. * @param left - The first Cartesian.
  1844. * @param right - The second Cartesian.
  1845. * @param result - The object onto which to store the result.
  1846. * @returns The modified result parameter.
  1847. */
  1848. divideComponents(left: Cartesian4, right: Cartesian4, result: Cartesian4): Cartesian4;
  1849. /**
  1850. * Computes the componentwise sum of two Cartesians.
  1851. * @param left - The first Cartesian.
  1852. * @param right - The second Cartesian.
  1853. * @param result - The object onto which to store the result.
  1854. * @returns The modified result parameter.
  1855. */
  1856. add(left: Cartesian4, right: Cartesian4, result: Cartesian4): Cartesian4;
  1857. /**
  1858. * Computes the componentwise difference of two Cartesians.
  1859. * @param left - The first Cartesian.
  1860. * @param right - The second Cartesian.
  1861. * @param result - The object onto which to store the result.
  1862. * @returns The modified result parameter.
  1863. */
  1864. subtract(left: Cartesian4, right: Cartesian4, result: Cartesian4): Cartesian4;
  1865. /**
  1866. * Multiplies the provided Cartesian componentwise by the provided scalar.
  1867. * @param cartesian - The Cartesian to be scaled.
  1868. * @param scalar - The scalar to multiply with.
  1869. * @param result - The object onto which to store the result.
  1870. * @returns The modified result parameter.
  1871. */
  1872. multiplyByScalar(cartesian: Cartesian4, scalar: number, result: Cartesian4): Cartesian4;
  1873. /**
  1874. * Divides the provided Cartesian componentwise by the provided scalar.
  1875. * @param cartesian - The Cartesian to be divided.
  1876. * @param scalar - The scalar to divide by.
  1877. * @param result - The object onto which to store the result.
  1878. * @returns The modified result parameter.
  1879. */
  1880. divideByScalar(cartesian: Cartesian4, scalar: number, result: Cartesian4): Cartesian4;
  1881. /**
  1882. * Negates the provided Cartesian.
  1883. * @param cartesian - The Cartesian to be negated.
  1884. * @param result - The object onto which to store the result.
  1885. * @returns The modified result parameter.
  1886. */
  1887. negate(cartesian: Cartesian4, result: Cartesian4): Cartesian4;
  1888. /**
  1889. * Computes the absolute value of the provided Cartesian.
  1890. * @param cartesian - The Cartesian whose absolute value is to be computed.
  1891. * @param result - The object onto which to store the result.
  1892. * @returns The modified result parameter.
  1893. */
  1894. abs(cartesian: Cartesian4, result: Cartesian4): Cartesian4;
  1895. /**
  1896. * Computes the linear interpolation or extrapolation at t using the provided cartesians.
  1897. * @param start - The value corresponding to t at 0.0.
  1898. * @param end - The value corresponding to t at 1.0.
  1899. * @param t - The point along t at which to interpolate.
  1900. * @param result - The object onto which to store the result.
  1901. * @returns The modified result parameter.
  1902. */
  1903. lerp(start: Cartesian4, end: Cartesian4, t: number, result: Cartesian4): Cartesian4;
  1904. /**
  1905. * Returns the axis that is most orthogonal to the provided Cartesian.
  1906. * @param cartesian - The Cartesian on which to find the most orthogonal axis.
  1907. * @param result - The object onto which to store the result.
  1908. * @returns The most orthogonal axis.
  1909. */
  1910. mostOrthogonalAxis(cartesian: Cartesian4, result: Cartesian4): Cartesian4;
  1911. /**
  1912. * Compares the provided Cartesians componentwise and returns
  1913. * <code>true</code> if they are equal, <code>false</code> otherwise.
  1914. * @param [left] - The first Cartesian.
  1915. * @param [right] - The second Cartesian.
  1916. * @returns <code>true</code> if left and right are equal, <code>false</code> otherwise.
  1917. */
  1918. equals(left?: Cartesian4, right?: Cartesian4): boolean;
  1919. /**
  1920. * Compares the provided Cartesians componentwise and returns
  1921. * <code>true</code> if they pass an absolute or relative tolerance test,
  1922. * <code>false</code> otherwise.
  1923. * @param [left] - The first Cartesian.
  1924. * @param [right] - The second Cartesian.
  1925. * @param [relativeEpsilon = 0] - The relative epsilon tolerance to use for equality testing.
  1926. * @param [absoluteEpsilon = relativeEpsilon] - The absolute epsilon tolerance to use for equality testing.
  1927. * @returns <code>true</code> if left and right are within the provided epsilon, <code>false</code> otherwise.
  1928. */
  1929. equalsEpsilon(left?: Cartesian4, right?: Cartesian4, relativeEpsilon?: number, absoluteEpsilon?: number): boolean;
  1930. /**
  1931. * An immutable Cartesian4 instance initialized to (0.0, 0.0, 0.0, 0.0).
  1932. */
  1933. readonly ZERO: Cartesian4;
  1934. /**
  1935. * An immutable Cartesian4 instance initialized to (1.0, 1.0, 1.0, 1.0).
  1936. */
  1937. readonly ONE: Cartesian4;
  1938. /**
  1939. * An immutable Cartesian4 instance initialized to (1.0, 0.0, 0.0, 0.0).
  1940. */
  1941. readonly UNIT_X: Cartesian4;
  1942. /**
  1943. * An immutable Cartesian4 instance initialized to (0.0, 1.0, 0.0, 0.0).
  1944. */
  1945. readonly UNIT_Y: Cartesian4;
  1946. /**
  1947. * An immutable Cartesian4 instance initialized to (0.0, 0.0, 1.0, 0.0).
  1948. */
  1949. readonly UNIT_Z: Cartesian4;
  1950. /**
  1951. * An immutable Cartesian4 instance initialized to (0.0, 0.0, 0.0, 1.0).
  1952. */
  1953. readonly UNIT_W: Cartesian4;
  1954. /**
  1955. * Duplicates this Cartesian4 instance.
  1956. * @param [result] - The object onto which to store the result.
  1957. * @returns The modified result parameter or a new Cartesian4 instance if one was not provided.
  1958. */
  1959. clone(result?: Cartesian4): Cartesian4;
  1960. /**
  1961. * Compares this Cartesian against the provided Cartesian componentwise and returns
  1962. * <code>true</code> if they are equal, <code>false</code> otherwise.
  1963. * @param [right] - The right hand side Cartesian.
  1964. * @returns <code>true</code> if they are equal, <code>false</code> otherwise.
  1965. */
  1966. equals(right?: Cartesian4): boolean;
  1967. /**
  1968. * Compares this Cartesian against the provided Cartesian componentwise and returns
  1969. * <code>true</code> if they pass an absolute or relative tolerance test,
  1970. * <code>false</code> otherwise.
  1971. * @param [right] - The right hand side Cartesian.
  1972. * @param [relativeEpsilon = 0] - The relative epsilon tolerance to use for equality testing.
  1973. * @param [absoluteEpsilon = relativeEpsilon] - The absolute epsilon tolerance to use for equality testing.
  1974. * @returns <code>true</code> if they are within the provided epsilon, <code>false</code> otherwise.
  1975. */
  1976. equalsEpsilon(right?: Cartesian4, relativeEpsilon?: number, absoluteEpsilon?: number): boolean;
  1977. /**
  1978. * Creates a string representing this Cartesian in the format '(x, y, z, w)'.
  1979. * @returns A string representing the provided Cartesian in the format '(x, y, z, w)'.
  1980. */
  1981. toString(): string;
  1982. /**
  1983. * Packs an arbitrary floating point value to 4 values representable using uint8.
  1984. * @param value - A floating point number.
  1985. * @param [result] - The Cartesian4 that will contain the packed float.
  1986. * @returns A Cartesian4 representing the float packed to values in x, y, z, and w.
  1987. */
  1988. packFloat(value: number, result?: Cartesian4): Cartesian4;
  1989. }
  1990. /**
  1991. * A position defined by longitude, latitude, and height.
  1992. * @param [longitude = 0.0] - The longitude, in radians.
  1993. * @param [latitude = 0.0] - The latitude, in radians.
  1994. * @param [height = 0.0] - The height, in meters, above the ellipsoid.
  1995. */
  1996. export class Cartographic {
  1997. constructor(longitude?: number, latitude?: number, height?: number);
  1998. /**
  1999. * The longitude, in radians.
  2000. */
  2001. longitude: number;
  2002. /**
  2003. * The latitude, in radians.
  2004. */
  2005. latitude: number;
  2006. /**
  2007. * The height, in meters, above the ellipsoid.
  2008. */
  2009. height: number;
  2010. /**
  2011. * Creates a new Cartographic instance from longitude and latitude
  2012. * specified in radians.
  2013. * @param longitude - The longitude, in radians.
  2014. * @param latitude - The latitude, in radians.
  2015. * @param [height = 0.0] - The height, in meters, above the ellipsoid.
  2016. * @param [result] - The object onto which to store the result.
  2017. * @returns The modified result parameter or a new Cartographic instance if one was not provided.
  2018. */
  2019. fromRadians(longitude: number, latitude: number, height?: number, result?: Cartographic): Cartographic;
  2020. /**
  2021. * Creates a new Cartographic instance from Flongitude and latitude
  2022. * specified in degrees. The values in the resulting object will
  2023. * be in radians.
  2024. * @param longitude - The longitude, in degrees.
  2025. * @param latitude - The latitude, in degrees.
  2026. * @param [height = 0.0] - The height, in meters, above the ellipsoid.
  2027. * @param [result] - The object onto which to store the result.
  2028. * @returns The modified result parameter or a new Cartographic instance if one was not provided.
  2029. */
  2030. fromDegrees(longitude: number, latitude: number, height?: number, result?: Cartographic): Cartographic;
  2031. /**
  2032. * Creates a new Cartographic instance from a Cartesian position. The values in the
  2033. * resulting object will be in radians.
  2034. * @param cartesian - The Cartesian position to convert to cartographic representation.
  2035. * @param [ellipsoid = Ellipsoid.WGS84] - The ellipsoid on which the position lies.
  2036. * @param [result] - The object onto which to store the result.
  2037. * @returns The modified result parameter, new Cartographic instance if none was provided, or undefined if the cartesian is at the center of the ellipsoid.
  2038. */
  2039. fromCartesian(cartesian: Cartesian3, ellipsoid?: Ellipsoid, result?: Cartographic): Cartographic;
  2040. /**
  2041. * Creates a new Cartesian3 instance from a Cartographic input. The values in the inputted
  2042. * object should be in radians.
  2043. * @param cartographic - Input to be converted into a Cartesian3 output.
  2044. * @param [ellipsoid = Ellipsoid.WGS84] - The ellipsoid on which the position lies.
  2045. * @param [result] - The object onto which to store the result.
  2046. * @returns The position
  2047. */
  2048. toCartesian(cartographic: Cartographic, ellipsoid?: Ellipsoid, result?: Cartesian3): Cartesian3;
  2049. /**
  2050. * Duplicates a Cartographic instance.
  2051. * @param cartographic - The cartographic to duplicate.
  2052. * @param [result] - The object onto which to store the result.
  2053. * @returns The modified result parameter or a new Cartographic instance if one was not provided. (Returns undefined if cartographic is undefined)
  2054. */
  2055. clone(cartographic: Cartographic, result?: Cartographic): Cartographic;
  2056. /**
  2057. * Compares the provided cartographics componentwise and returns
  2058. * <code>true</code> if they are equal, <code>false</code> otherwise.
  2059. * @param [left] - The first cartographic.
  2060. * @param [right] - The second cartographic.
  2061. * @returns <code>true</code> if left and right are equal, <code>false</code> otherwise.
  2062. */
  2063. equals(left?: Cartographic, right?: Cartographic): boolean;
  2064. /**
  2065. * Compares the provided cartographics componentwise and returns
  2066. * <code>true</code> if they are within the provided epsilon,
  2067. * <code>false</code> otherwise.
  2068. * @param [left] - The first cartographic.
  2069. * @param [right] - The second cartographic.
  2070. * @param [epsilon = 0] - The epsilon to use for equality testing.
  2071. * @returns <code>true</code> if left and right are within the provided epsilon, <code>false</code> otherwise.
  2072. */
  2073. equalsEpsilon(left?: Cartographic, right?: Cartographic, epsilon?: number): boolean;
  2074. /**
  2075. * An immutable Cartographic instance initialized to (0.0, 0.0, 0.0).
  2076. */
  2077. readonly ZERO: Cartographic;
  2078. /**
  2079. * Duplicates this instance.
  2080. * @param [result] - The object onto which to store the result.
  2081. * @returns The modified result parameter or a new Cartographic instance if one was not provided.
  2082. */
  2083. clone(result?: Cartographic): Cartographic;
  2084. /**
  2085. * Compares the provided against this cartographic componentwise and returns
  2086. * <code>true</code> if they are equal, <code>false</code> otherwise.
  2087. * @param [right] - The second cartographic.
  2088. * @returns <code>true</code> if left and right are equal, <code>false</code> otherwise.
  2089. */
  2090. equals(right?: Cartographic): boolean;
  2091. /**
  2092. * Compares the provided against this cartographic componentwise and returns
  2093. * <code>true</code> if they are within the provided epsilon,
  2094. * <code>false</code> otherwise.
  2095. * @param [right] - The second cartographic.
  2096. * @param [epsilon = 0] - The epsilon to use for equality testing.
  2097. * @returns <code>true</code> if left and right are within the provided epsilon, <code>false</code> otherwise.
  2098. */
  2099. equalsEpsilon(right?: Cartographic, epsilon?: number): boolean;
  2100. /**
  2101. * Creates a string representing this cartographic in the format '(longitude, latitude, height)'.
  2102. * @returns A string representing the provided cartographic in the format '(longitude, latitude, height)'.
  2103. */
  2104. toString(): string;
  2105. }
  2106. /**
  2107. * Geocodes queries containing longitude and latitude coordinates and an optional height.
  2108. * Query format: `longitude latitude (height)` with longitude/latitude in degrees and height in meters.
  2109. */
  2110. export class CartographicGeocoderService {
  2111. constructor();
  2112. /**
  2113. * @param query - The query to be sent to the geocoder service
  2114. */
  2115. geocode(query: string): Promise<GeocoderService.Result[]>;
  2116. }
  2117. /**
  2118. * A Catmull-Rom spline is a cubic spline where the tangent at control points,
  2119. * except the first and last, are computed using the previous and next control points.
  2120. * Catmull-Rom splines are in the class C<sup>1</sup>.
  2121. * @example
  2122. * // spline above the earth from Philadelphia to Los Angeles
  2123. * const spline = new SuperMap.CatmullRomSpline({
  2124. * times : [ 0.0, 1.5, 3.0, 4.5, 6.0 ],
  2125. * points : [
  2126. * new SuperMap.Cartesian3(1235398.0, -4810983.0, 4146266.0),
  2127. * new SuperMap.Cartesian3(1372574.0, -5345182.0, 4606657.0),
  2128. * new SuperMap.Cartesian3(-757983.0, -5542796.0, 4514323.0),
  2129. * new SuperMap.Cartesian3(-2821260.0, -5248423.0, 4021290.0),
  2130. * new SuperMap.Cartesian3(-2539788.0, -4724797.0, 3620093.0)
  2131. * ]
  2132. * });
  2133. *
  2134. * const p0 = spline.evaluate(times[i]); // equal to positions[i]
  2135. * const p1 = spline.evaluate(times[i] + delta); // interpolated value when delta < times[i + 1] - times[i]
  2136. * @param options - Object with the following properties:
  2137. * @param options.times - An array of strictly increasing, unit-less, floating-point times at each point.
  2138. * The values are in no way connected to the clock time. They are the parameterization for the curve.
  2139. * @param options.points - The array of {@link Cartesian3} control points.
  2140. * @param [options.firstTangent] - The tangent of the curve at the first control point.
  2141. * If the tangent is not given, it will be estimated.
  2142. * @param [options.lastTangent] - The tangent of the curve at the last control point.
  2143. * If the tangent is not given, it will be estimated.
  2144. */
  2145. export class CatmullRomSpline {
  2146. constructor(options: {
  2147. times: number[];
  2148. points: Cartesian3[];
  2149. firstTangent?: Cartesian3;
  2150. lastTangent?: Cartesian3;
  2151. });
  2152. /**
  2153. * An array of times for the control points.
  2154. */
  2155. readonly times: number[];
  2156. /**
  2157. * An array of {@link Cartesian3} control points.
  2158. */
  2159. readonly points: Cartesian3[];
  2160. /**
  2161. * The tangent at the first control point.
  2162. */
  2163. readonly firstTangent: Cartesian3;
  2164. /**
  2165. * The tangent at the last control point.
  2166. */
  2167. readonly lastTangent: Cartesian3;
  2168. /**
  2169. * Finds an index <code>i</code> in <code>times</code> such that the parameter
  2170. * <code>time</code> is in the interval <code>[times[i], times[i + 1]]</code>.
  2171. * @param time - The time.
  2172. * @returns The index for the element at the start of the interval.
  2173. */
  2174. findTimeInterval(time: number): number;
  2175. /**
  2176. * Wraps the given time to the period covered by the spline.
  2177. * @param time - The time.
  2178. * @returns The time, wrapped around to the updated animation.
  2179. */
  2180. wrapTime(time: number): number;
  2181. /**
  2182. * Clamps the given time to the period covered by the spline.
  2183. * @param time - The time.
  2184. * @returns The time, clamped to the animation period.
  2185. */
  2186. clampTime(time: number): number;
  2187. /**
  2188. * Evaluates the curve at a given time.
  2189. * @param time - The time at which to evaluate the curve.
  2190. * @param [result] - The object onto which to store the result.
  2191. * @returns The modified result parameter or a new instance of the point on the curve at the given time.
  2192. */
  2193. evaluate(time: number, result?: Cartesian3): Cartesian3;
  2194. }
  2195. /**
  2196. * A {@link TerrainProvider} 以supermap地形格式访问地形数据.
  2197. * @example
  2198. * // 创建带有法线的 Arctic DEM terrain.
  2199. * const viewer = new SuperMap.Viewer('CesiumContainer', {
  2200. * terrainProvider : new SuperMap.SuperMapTerrainProvider({
  2201. * url : SuperMap.IonResource.fromAssetId(3956),
  2202. * requestVertexNormals : true
  2203. * })
  2204. * });
  2205. * @param options - 具有以下属性的对象:
  2206. * @param options.url - SuperMap terrain server的url.
  2207. * @param [options.requestVertexNormals = false] - 指示客户端是否应该从服务器请求额外的照明信息,如果可用,以每个顶点法线的形式.
  2208. * @param [options.requestWaterMask = false] - 指示客户端是否应该向服务器请求每个瓦片水掩码(如果可用的话).
  2209. * @param [options.requestMetadata = true] - 指示客户端是否应该向服务器请求每个tile元数据(如果可用的话).
  2210. * @param [options.ellipsoid] - 椭球。如果未指定,则使用WGS84椭球.
  2211. * @param [options.credit] - 数据源的信用,它显示在画布上.
  2212. */
  2213. export class SuperMapTerrainProvider {
  2214. constructor(options: {
  2215. url: Resource | string | Promise<Resource> | Promise<string>;
  2216. requestVertexNormals?: boolean;
  2217. requestWaterMask?: boolean;
  2218. requestMetadata?: boolean;
  2219. ellipsoid?: Ellipsoid;
  2220. credit?: Credit | string;
  2221. });
  2222. /**
  2223. * Requests the geometry for a given tile. This function should not be called before
  2224. * {@link SuperMapTerrainProvider#ready} returns true. The result must include terrain data and
  2225. * may optionally include a water mask and an indication of which child tiles are available.
  2226. * @param x - The X coordinate of the tile for which to request geometry.
  2227. * @param y - The Y coordinate of the tile for which to request geometry.
  2228. * @param level - The level of the tile for which to request geometry.
  2229. * @param [request] - The request object. Intended for internal use only.
  2230. * @returns A promise for the requested geometry. If this method
  2231. * returns undefined instead of a promise, it is an indication that too many requests are already
  2232. * pending and the request will be retried later.
  2233. */
  2234. requestTileGeometry(x: number, y: number, level: number, request?: Request): Promise<TerrainData> | undefined;
  2235. /**
  2236. * Gets an event that is raised when the terrain provider encounters an asynchronous error. By subscribing
  2237. * to the event, you will be notified of the error and can potentially recover from it. Event listeners
  2238. * are passed an instance of {@link TileProviderError}.
  2239. */
  2240. readonly errorEvent: Event;
  2241. /**
  2242. * Gets the credit to display when this terrain provider is active. Typically this is used to credit
  2243. * the source of the terrain. This function should not be called before {@link SuperMapTerrainProvider#ready} returns true.
  2244. */
  2245. readonly credit: Credit;
  2246. /**
  2247. * Gets the tiling scheme used by this provider. This function should
  2248. * not be called before {@link SuperMapTerrainProvider#ready} returns true.
  2249. */
  2250. readonly tilingScheme: GeographicTilingScheme;
  2251. /**
  2252. * Gets a value indicating whether or not the provider is ready for use.
  2253. */
  2254. readonly ready: boolean;
  2255. /**
  2256. * Gets a promise that resolves to true when the provider is ready for use.
  2257. */
  2258. readonly readyPromise: Promise<boolean>;
  2259. /**
  2260. * Gets a value indicating whether or not the provider includes a water mask. The water mask
  2261. * indicates which areas of the globe are water rather than land, so they can be rendered
  2262. * as a reflective surface with animated waves. This function should not be
  2263. * called before {@link SuperMapTerrainProvider#ready} returns true.
  2264. */
  2265. readonly hasWaterMask: boolean;
  2266. /**
  2267. * Gets a value indicating whether or not the requested tiles include vertex normals.
  2268. * This function should not be called before {@link SuperMapTerrainProvider#ready} returns true.
  2269. */
  2270. readonly hasVertexNormals: boolean;
  2271. /**
  2272. * Gets a value indicating whether or not the requested tiles include metadata.
  2273. * This function should not be called before {@link SuperMapTerrainProvider#ready} returns true.
  2274. */
  2275. readonly hasMetadata: boolean;
  2276. /**
  2277. * Boolean flag that indicates if the client should request vertex normals from the server.
  2278. * Vertex normals data is appended to the standard tile mesh data only if the client requests the vertex normals and
  2279. * if the server provides vertex normals.
  2280. */
  2281. readonly requestVertexNormals: boolean;
  2282. /**
  2283. * Boolean flag that indicates if the client should request a watermask from the server.
  2284. * Watermask data is appended to the standard tile mesh data only if the client requests the watermask and
  2285. * if the server provides a watermask.
  2286. */
  2287. readonly requestWaterMask: boolean;
  2288. /**
  2289. * Boolean flag that indicates if the client should request metadata from the server.
  2290. * Metadata is appended to the standard tile mesh data only if the client requests the metadata and
  2291. * if the server provides a metadata.
  2292. */
  2293. readonly requestMetadata: boolean;
  2294. /**
  2295. * Gets an object that can be used to determine availability of terrain from this provider, such as
  2296. * at points and in rectangles. This function should not be called before
  2297. * {@link SuperMapTerrainProvider#ready} returns true. This property may be undefined if availability
  2298. * information is not available. Note that this reflects tiles that are known to be available currently.
  2299. * Additional tiles may be discovered to be available in the future, e.g. if availability information
  2300. * exists deeper in the tree rather than it all being discoverable at the root. However, a tile that
  2301. * is available now will not become unavailable in the future.
  2302. */
  2303. readonly availability: TileAvailability;
  2304. /**
  2305. * Gets the maximum geometric error allowed in a tile at a given level.
  2306. * @param level - The tile level for which to get the maximum geometric error.
  2307. * @returns The maximum geometric error.
  2308. */
  2309. getLevelMaximumGeometricError(level: number): number;
  2310. /**
  2311. * Determines whether data for a tile is available to be loaded.
  2312. * @param x - The X coordinate of the tile for which to request geometry.
  2313. * @param y - The Y coordinate of the tile for which to request geometry.
  2314. * @param level - The level of the tile for which to request geometry.
  2315. * @returns Undefined if not supported or availability is unknown, otherwise true or false.
  2316. */
  2317. getTileDataAvailable(x: number, y: number, level: number): boolean | undefined;
  2318. /**
  2319. * Makes sure we load availability data for a tile
  2320. * @param x - The X coordinate of the tile for which to request geometry.
  2321. * @param y - The Y coordinate of the tile for which to request geometry.
  2322. * @param level - The level of the tile for which to request geometry.
  2323. * @returns Undefined if nothing need to be loaded or a Promise that resolves when all required tiles are loaded
  2324. */
  2325. loadTileDataAvailability(x: number, y: number, level: number): undefined | Promise<void>;
  2326. }
  2327. /**
  2328. * A description of a circle on the ellipsoid. Circle geometry can be rendered with both {@link Primitive} and {@link GroundPrimitive}.
  2329. * @example
  2330. * // Create a circle.
  2331. * const circle = new SuperMap.CircleGeometry({
  2332. * center : SuperMap.Cartesian3.fromDegrees(-75.59777, 40.03883),
  2333. * radius : 100000.0
  2334. * });
  2335. * const geometry = SuperMap.CircleGeometry.createGeometry(circle);
  2336. * @param options - Object with the following properties:
  2337. * @param options.center - The circle's center point in the fixed frame.
  2338. * @param options.radius - The radius in meters.
  2339. * @param [options.ellipsoid = Ellipsoid.WGS84] - The ellipsoid the circle will be on.
  2340. * @param [options.height = 0.0] - The distance in meters between the circle and the ellipsoid surface.
  2341. * @param [options.granularity = 0.02] - The angular distance between points on the circle in radians.
  2342. * @param [options.vertexFormat = VertexFormat.DEFAULT] - The vertex attributes to be computed.
  2343. * @param [options.extrudedHeight = 0.0] - The distance in meters between the circle's extruded face and the ellipsoid surface.
  2344. * @param [options.stRotation = 0.0] - The rotation of the texture coordinates, in radians. A positive rotation is counter-clockwise.
  2345. */
  2346. export class CircleGeometry {
  2347. constructor(options: {
  2348. center: Cartesian3;
  2349. radius: number;
  2350. ellipsoid?: Ellipsoid;
  2351. height?: number;
  2352. granularity?: number;
  2353. vertexFormat?: VertexFormat;
  2354. extrudedHeight?: number;
  2355. stRotation?: number;
  2356. });
  2357. /**
  2358. * The number of elements used to pack the object into an array.
  2359. */
  2360. packedLength: number;
  2361. /**
  2362. * Stores the provided instance into the provided array.
  2363. * @param value - The value to pack.
  2364. * @param array - The array to pack into.
  2365. * @param [startingIndex = 0] - The index into the array at which to start packing the elements.
  2366. * @returns The array that was packed into
  2367. */
  2368. pack(value: CircleGeometry, array: number[], startingIndex?: number): number[];
  2369. /**
  2370. * Retrieves an instance from a packed array.
  2371. * @param array - The packed array.
  2372. * @param [startingIndex = 0] - The starting index of the element to be unpacked.
  2373. * @param [result] - The object into which to store the result.
  2374. * @returns The modified result parameter or a new CircleGeometry instance if one was not provided.
  2375. */
  2376. unpack(array: number[], startingIndex?: number, result?: CircleGeometry): CircleGeometry;
  2377. /**
  2378. * Computes the geometric representation of a circle on an ellipsoid, including its vertices, indices, and a bounding sphere.
  2379. * @param circleGeometry - A description of the circle.
  2380. * @returns The computed vertices and indices.
  2381. */
  2382. createGeometry(circleGeometry: CircleGeometry): Geometry | undefined;
  2383. }
  2384. /**
  2385. * A description of the outline of a circle on the ellipsoid.
  2386. * @example
  2387. * // Create a circle.
  2388. * const circle = new SuperMap.CircleOutlineGeometry({
  2389. * center : SuperMap.Cartesian3.fromDegrees(-75.59777, 40.03883),
  2390. * radius : 100000.0
  2391. * });
  2392. * const geometry = SuperMap.CircleOutlineGeometry.createGeometry(circle);
  2393. * @param options - Object with the following properties:
  2394. * @param options.center - The circle's center point in the fixed frame.
  2395. * @param options.radius - The radius in meters.
  2396. * @param [options.ellipsoid = Ellipsoid.WGS84] - The ellipsoid the circle will be on.
  2397. * @param [options.height = 0.0] - The distance in meters between the circle and the ellipsoid surface.
  2398. * @param [options.granularity = 0.02] - The angular distance between points on the circle in radians.
  2399. * @param [options.extrudedHeight = 0.0] - The distance in meters between the circle's extruded face and the ellipsoid surface.
  2400. * @param [options.numberOfVerticalLines = 16] - Number of lines to draw between the top and bottom of an extruded circle.
  2401. */
  2402. export class CircleOutlineGeometry {
  2403. constructor(options: {
  2404. center: Cartesian3;
  2405. radius: number;
  2406. ellipsoid?: Ellipsoid;
  2407. height?: number;
  2408. granularity?: number;
  2409. extrudedHeight?: number;
  2410. numberOfVerticalLines?: number;
  2411. });
  2412. /**
  2413. * The number of elements used to pack the object into an array.
  2414. */
  2415. packedLength: number;
  2416. /**
  2417. * Stores the provided instance into the provided array.
  2418. * @param value - The value to pack.
  2419. * @param array - The array to pack into.
  2420. * @param [startingIndex = 0] - The index into the array at which to start packing the elements.
  2421. * @returns The array that was packed into
  2422. */
  2423. pack(value: CircleOutlineGeometry, array: number[], startingIndex?: number): number[];
  2424. /**
  2425. * Retrieves an instance from a packed array.
  2426. * @param array - The packed array.
  2427. * @param [startingIndex = 0] - The starting index of the element to be unpacked.
  2428. * @param [result] - The object into which to store the result.
  2429. * @returns The modified result parameter or a new CircleOutlineGeometry instance if one was not provided.
  2430. */
  2431. unpack(array: number[], startingIndex?: number, result?: CircleOutlineGeometry): CircleOutlineGeometry;
  2432. /**
  2433. * Computes the geometric representation of an outline of a circle on an ellipsoid, including its vertices, indices, and a bounding sphere.
  2434. * @param circleGeometry - A description of the circle.
  2435. * @returns The computed vertices and indices.
  2436. */
  2437. createGeometry(circleGeometry: CircleOutlineGeometry): Geometry | undefined;
  2438. }
  2439. /**
  2440. * A simple clock for keeping track of simulated time.
  2441. * @example
  2442. * // Create a clock that loops on Christmas day 2013 and runs in real-time.
  2443. * const clock = new SuperMap.Clock({
  2444. * startTime : SuperMap.JulianDate.fromIso8601("2013-12-25"),
  2445. * currentTime : SuperMap.JulianDate.fromIso8601("2013-12-25"),
  2446. * stopTime : SuperMap.JulianDate.fromIso8601("2013-12-26"),
  2447. * clockRange : SuperMap.ClockRange.LOOP_STOP,
  2448. * clockStep : SuperMap.ClockStep.SYSTEM_CLOCK_MULTIPLIER
  2449. * });
  2450. * @param [options] - Object with the following properties:
  2451. * @param [options.startTime] - The start time of the clock.
  2452. * @param [options.stopTime] - The stop time of the clock.
  2453. * @param [options.currentTime] - The current time.
  2454. * @param [options.multiplier = 1.0] - Determines how much time advances when {@link Clock#tick} is called, negative values allow for advancing backwards.
  2455. * @param [options.clockStep = ClockStep.SYSTEM_CLOCK_MULTIPLIER] - Determines if calls to {@link Clock#tick} are frame dependent or system clock dependent.
  2456. * @param [options.clockRange = ClockRange.UNBOUNDED] - Determines how the clock should behave when {@link Clock#startTime} or {@link Clock#stopTime} is reached.
  2457. * @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.
  2458. * @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.
  2459. */
  2460. export class Clock {
  2461. constructor(options?: {
  2462. startTime?: JulianDate;
  2463. stopTime?: JulianDate;
  2464. currentTime?: JulianDate;
  2465. multiplier?: number;
  2466. clockStep?: ClockStep;
  2467. clockRange?: ClockRange;
  2468. canAnimate?: boolean;
  2469. shouldAnimate?: boolean;
  2470. });
  2471. /**
  2472. * The start time of the clock.
  2473. */
  2474. startTime: JulianDate;
  2475. /**
  2476. * The stop time of the clock.
  2477. */
  2478. stopTime: JulianDate;
  2479. /**
  2480. * Determines how the clock should behave when
  2481. * {@link Clock#startTime} or {@link Clock#stopTime}
  2482. * is reached.
  2483. */
  2484. clockRange: ClockRange;
  2485. /**
  2486. * Indicates whether {@link Clock#tick} can advance time. This could be false if data is being buffered,
  2487. * for example. The clock will only advance time when both
  2488. * {@link Clock#canAnimate} and {@link Clock#shouldAnimate} are true.
  2489. */
  2490. canAnimate: boolean;
  2491. /**
  2492. * An {@link Event} that is fired whenever {@link Clock#tick} is called.
  2493. */
  2494. onTick: Event;
  2495. /**
  2496. * An {@link Event} that is fired whenever {@link Clock#stopTime} is reached.
  2497. */
  2498. onStop: Event;
  2499. /**
  2500. * The current time.
  2501. * Changing this property will change
  2502. * {@link Clock#clockStep} from {@link ClockStep.SYSTEM_CLOCK} to
  2503. * {@link ClockStep.SYSTEM_CLOCK_MULTIPLIER}.
  2504. */
  2505. currentTime: JulianDate;
  2506. /**
  2507. * Gets or sets how much time advances when {@link Clock#tick} is called. Negative values allow for advancing backwards.
  2508. * If {@link Clock#clockStep} is set to {@link ClockStep.TICK_DEPENDENT}, this is the number of seconds to advance.
  2509. * If {@link Clock#clockStep} is set to {@link ClockStep.SYSTEM_CLOCK_MULTIPLIER}, this value is multiplied by the
  2510. * elapsed system time since the last call to {@link Clock#tick}.
  2511. * Changing this property will change
  2512. * {@link Clock#clockStep} from {@link ClockStep.SYSTEM_CLOCK} to
  2513. * {@link ClockStep.SYSTEM_CLOCK_MULTIPLIER}.
  2514. */
  2515. multiplier: number;
  2516. /**
  2517. * Determines if calls to {@link Clock#tick} are frame dependent or system clock dependent.
  2518. * Changing this property to {@link ClockStep.SYSTEM_CLOCK} will set
  2519. * {@link Clock#multiplier} to 1.0, {@link Clock#shouldAnimate} to true, and
  2520. * {@link Clock#currentTime} to the current system clock time.
  2521. */
  2522. clockStep: ClockStep;
  2523. /**
  2524. * Indicates whether {@link Clock#tick} should attempt to advance time.
  2525. * The clock will only advance time when both
  2526. * {@link Clock#canAnimate} and {@link Clock#shouldAnimate} are true.
  2527. * Changing this property will change
  2528. * {@link Clock#clockStep} from {@link ClockStep.SYSTEM_CLOCK} to
  2529. * {@link ClockStep.SYSTEM_CLOCK_MULTIPLIER}.
  2530. */
  2531. shouldAnimate: boolean;
  2532. /**
  2533. * Advances the clock from the current time based on the current configuration options.
  2534. * tick should be called every frame, regardless of whether animation is taking place
  2535. * or not. To control animation, use the {@link Clock#shouldAnimate} property.
  2536. * @returns The new value of the {@link Clock#currentTime} property.
  2537. */
  2538. tick(): JulianDate;
  2539. }
  2540. /**
  2541. * Constants used by {@link Clock#tick} to determine behavior
  2542. * when {@link Clock#startTime} or {@link Clock#stopTime} is reached.
  2543. */
  2544. export enum ClockRange {
  2545. /**
  2546. * {@link Clock#tick} will always advances the clock in its current direction.
  2547. */
  2548. UNBOUNDED = 0,
  2549. /**
  2550. * When {@link Clock#startTime} or {@link Clock#stopTime} is reached,
  2551. * {@link Clock#tick} will not advance {@link Clock#currentTime} any further.
  2552. */
  2553. CLAMPED = 1,
  2554. /**
  2555. * When {@link Clock#stopTime} is reached, {@link Clock#tick} will advance
  2556. * {@link Clock#currentTime} to the opposite end of the interval. When
  2557. * time is moving backwards, {@link Clock#tick} will not advance past
  2558. * {@link Clock#startTime}
  2559. */
  2560. LOOP_STOP = 2
  2561. }
  2562. /**
  2563. * Constants to determine how much time advances with each call
  2564. * to {@link Clock#tick}.
  2565. */
  2566. export enum ClockStep {
  2567. /**
  2568. * {@link Clock#tick} advances the current time by a fixed step,
  2569. * which is the number of seconds specified by {@link Clock#multiplier}.
  2570. */
  2571. TICK_DEPENDENT = 0,
  2572. /**
  2573. * {@link Clock#tick} advances the current time by the amount of system
  2574. * time elapsed since the previous call multiplied by {@link Clock#multiplier}.
  2575. */
  2576. SYSTEM_CLOCK_MULTIPLIER = 1,
  2577. /**
  2578. * {@link Clock#tick} sets the clock to the current system time;
  2579. * ignoring all other settings.
  2580. */
  2581. SYSTEM_CLOCK = 2
  2582. }
  2583. /**
  2584. * A color, specified using red, green, blue, and alpha values,
  2585. * which range from <code>0</code> (no intensity) to <code>1.0</code> (full intensity).
  2586. * @param [red = 1.0] - The red component.
  2587. * @param [green = 1.0] - The green component.
  2588. * @param [blue = 1.0] - The blue component.
  2589. * @param [alpha = 1.0] - The alpha component.
  2590. */
  2591. export class Color {
  2592. constructor(red?: number, green?: number, blue?: number, alpha?: number);
  2593. /**
  2594. * The red component.
  2595. */
  2596. red: number;
  2597. /**
  2598. * The green component.
  2599. */
  2600. green: number;
  2601. /**
  2602. * The blue component.
  2603. */
  2604. blue: number;
  2605. /**
  2606. * The alpha component.
  2607. */
  2608. alpha: number;
  2609. /**
  2610. * Creates a Color instance from a {@link Cartesian4}. <code>x</code>, <code>y</code>, <code>z</code>,
  2611. * and <code>w</code> map to <code>red</code>, <code>green</code>, <code>blue</code>, and <code>alpha</code>, respectively.
  2612. * @param cartesian - The source cartesian.
  2613. * @param [result] - The object onto which to store the result.
  2614. * @returns The modified result parameter or a new Color instance if one was not provided.
  2615. */
  2616. fromCartesian4(cartesian: Cartesian4, result?: Color): Color;
  2617. /**
  2618. * Creates a new Color specified using red, green, blue, and alpha values
  2619. * that are in the range of 0 to 255, converting them internally to a range of 0.0 to 1.0.
  2620. * @param [red = 255] - The red component.
  2621. * @param [green = 255] - The green component.
  2622. * @param [blue = 255] - The blue component.
  2623. * @param [alpha = 255] - The alpha component.
  2624. * @param [result] - The object onto which to store the result.
  2625. * @returns The modified result parameter or a new Color instance if one was not provided.
  2626. */
  2627. fromBytes(red?: number, green?: number, blue?: number, alpha?: number, result?: Color): Color;
  2628. /**
  2629. * Creates a new Color that has the same red, green, and blue components
  2630. * of the specified color, but with the specified alpha value.
  2631. * @example
  2632. * const translucentRed = SuperMap.Color.fromAlpha(SuperMap.Color.RED, 0.9);
  2633. * @param color - The base color
  2634. * @param alpha - The new alpha component.
  2635. * @param [result] - The object onto which to store the result.
  2636. * @returns The modified result parameter or a new Color instance if one was not provided.
  2637. */
  2638. fromAlpha(color: Color, alpha: number, result?: Color): Color;
  2639. /**
  2640. * Creates a new Color from a single numeric unsigned 32-bit RGBA value, using the endianness
  2641. * of the system.
  2642. * @example
  2643. * const color = SuperMap.Color.fromRgba(0x67ADDFFF);
  2644. * @param rgba - A single numeric unsigned 32-bit RGBA value.
  2645. * @param [result] - The object to store the result in, if undefined a new instance will be created.
  2646. * @returns The color object.
  2647. */
  2648. fromRgba(rgba: number, result?: Color): Color;
  2649. /**
  2650. * Creates a Color instance from hue, saturation, and lightness.
  2651. * @param [hue = 0] - The hue angle 0...1
  2652. * @param [saturation = 0] - The saturation value 0...1
  2653. * @param [lightness = 0] - The lightness value 0...1
  2654. * @param [alpha = 1.0] - The alpha component 0...1
  2655. * @param [result] - The object to store the result in, if undefined a new instance will be created.
  2656. * @returns The color object.
  2657. */
  2658. fromHsl(hue?: number, saturation?: number, lightness?: number, alpha?: number, result?: Color): Color;
  2659. /**
  2660. * Creates a random color using the provided options. For reproducible random colors, you should
  2661. * call {@link Math#setRandomNumberSeed} once at the beginning of your application.
  2662. * @example
  2663. * //Create a completely random color
  2664. * const color = SuperMap.Color.fromRandom();
  2665. *
  2666. * //Create a random shade of yellow.
  2667. * const color1 = SuperMap.Color.fromRandom({
  2668. * red : 1.0,
  2669. * green : 1.0,
  2670. * alpha : 1.0
  2671. * });
  2672. *
  2673. * //Create a random bright color.
  2674. * const color2 = SuperMap.Color.fromRandom({
  2675. * minimumRed : 0.75,
  2676. * minimumGreen : 0.75,
  2677. * minimumBlue : 0.75,
  2678. * alpha : 1.0
  2679. * });
  2680. * @param [options] - Object with the following properties:
  2681. * @param [options.red] - If specified, the red component to use instead of a randomized value.
  2682. * @param [options.minimumRed = 0.0] - The maximum red value to generate if none was specified.
  2683. * @param [options.maximumRed = 1.0] - The minimum red value to generate if none was specified.
  2684. * @param [options.green] - If specified, the green component to use instead of a randomized value.
  2685. * @param [options.minimumGreen = 0.0] - The maximum green value to generate if none was specified.
  2686. * @param [options.maximumGreen = 1.0] - The minimum green value to generate if none was specified.
  2687. * @param [options.blue] - If specified, the blue component to use instead of a randomized value.
  2688. * @param [options.minimumBlue = 0.0] - The maximum blue value to generate if none was specified.
  2689. * @param [options.maximumBlue = 1.0] - The minimum blue value to generate if none was specified.
  2690. * @param [options.alpha] - If specified, the alpha component to use instead of a randomized value.
  2691. * @param [options.minimumAlpha = 0.0] - The maximum alpha value to generate if none was specified.
  2692. * @param [options.maximumAlpha = 1.0] - The minimum alpha value to generate if none was specified.
  2693. * @param [result] - The object to store the result in, if undefined a new instance will be created.
  2694. * @returns The modified result parameter or a new instance if result was undefined.
  2695. */
  2696. fromRandom(options?: {
  2697. red?: number;
  2698. minimumRed?: number;
  2699. maximumRed?: number;
  2700. green?: number;
  2701. minimumGreen?: number;
  2702. maximumGreen?: number;
  2703. blue?: number;
  2704. minimumBlue?: number;
  2705. maximumBlue?: number;
  2706. alpha?: number;
  2707. minimumAlpha?: number;
  2708. maximumAlpha?: number;
  2709. }, result?: Color): Color;
  2710. /**
  2711. * Creates a Color instance from a CSS color value.
  2712. * @example
  2713. * const CesiumBlue = SuperMap.Color.fromCssColorString('#67ADDF');
  2714. * const green = SuperMap.Color.fromCssColorString('green');
  2715. * @param color - The CSS color value in #rgb, #rgba, #rrggbb, #rrggbbaa, rgb(), rgba(), hsl(), or hsla() format.
  2716. * @param [result] - The object to store the result in, if undefined a new instance will be created.
  2717. * @returns The color object, or undefined if the string was not a valid CSS color.
  2718. */
  2719. fromCssColorString(color: string, result?: Color): Color;
  2720. /**
  2721. * The number of elements used to pack the object into an array.
  2722. */
  2723. packedLength: number;
  2724. /**
  2725. * Stores the provided instance into the provided array.
  2726. * @param value - The value to pack.
  2727. * @param array - The array to pack into.
  2728. * @param [startingIndex = 0] - The index into the array at which to start packing the elements.
  2729. * @returns The array that was packed into
  2730. */
  2731. pack(value: Color, array: number[], startingIndex?: number): number[];
  2732. /**
  2733. * Retrieves an instance from a packed array.
  2734. * @param array - The packed array.
  2735. * @param [startingIndex = 0] - The starting index of the element to be unpacked.
  2736. * @param [result] - The object into which to store the result.
  2737. * @returns The modified result parameter or a new Color instance if one was not provided.
  2738. */
  2739. unpack(array: number[], startingIndex?: number, result?: Color): Color;
  2740. /**
  2741. * Converts a 'byte' color component in the range of 0 to 255 into
  2742. * a 'float' color component in the range of 0 to 1.0.
  2743. * @param number - The number to be converted.
  2744. * @returns The converted number.
  2745. */
  2746. byteToFloat(number: number): number;
  2747. /**
  2748. * Converts a 'float' color component in the range of 0 to 1.0 into
  2749. * a 'byte' color component in the range of 0 to 255.
  2750. * @param number - The number to be converted.
  2751. * @returns The converted number.
  2752. */
  2753. floatToByte(number: number): number;
  2754. /**
  2755. * Duplicates a Color.
  2756. * @param color - The Color to duplicate.
  2757. * @param [result] - The object to store the result in, if undefined a new instance will be created.
  2758. * @returns The modified result parameter or a new instance if result was undefined. (Returns undefined if color is undefined)
  2759. */
  2760. clone(color: Color, result?: Color): Color;
  2761. /**
  2762. * Returns true if the first Color equals the second color.
  2763. * @param left - The first Color to compare for equality.
  2764. * @param right - The second Color to compare for equality.
  2765. * @returns <code>true</code> if the Colors are equal; otherwise, <code>false</code>.
  2766. */
  2767. equals(left: Color, right: Color): boolean;
  2768. /**
  2769. * Returns a duplicate of a Color instance.
  2770. * @param [result] - The object to store the result in, if undefined a new instance will be created.
  2771. * @returns The modified result parameter or a new instance if result was undefined.
  2772. */
  2773. clone(result?: Color): Color;
  2774. /**
  2775. * Returns true if this Color equals other.
  2776. * @param other - The Color to compare for equality.
  2777. * @returns <code>true</code> if the Colors are equal; otherwise, <code>false</code>.
  2778. */
  2779. equals(other: Color): boolean;
  2780. /**
  2781. * Returns <code>true</code> if this Color equals other componentwise within the specified epsilon.
  2782. * @param other - The Color to compare for equality.
  2783. * @param [epsilon = 0.0] - The epsilon to use for equality testing.
  2784. * @returns <code>true</code> if the Colors are equal within the specified epsilon; otherwise, <code>false</code>.
  2785. */
  2786. equalsEpsilon(other: Color, epsilon?: number): boolean;
  2787. /**
  2788. * Creates a string representing this Color in the format '(red, green, blue, alpha)'.
  2789. * @returns A string representing this Color in the format '(red, green, blue, alpha)'.
  2790. */
  2791. toString(): string;
  2792. /**
  2793. * Creates a string containing the CSS color value for this color.
  2794. * @returns The CSS equivalent of this color.
  2795. */
  2796. toCssColorString(): string;
  2797. /**
  2798. * Creates a string containing CSS hex string color value for this color.
  2799. * @returns The CSS hex string equivalent of this color.
  2800. */
  2801. toCssHexString(): string;
  2802. /**
  2803. * Converts this color to an array of red, green, blue, and alpha values
  2804. * that are in the range of 0 to 255.
  2805. * @param [result] - The array to store the result in, if undefined a new instance will be created.
  2806. * @returns The modified result parameter or a new instance if result was undefined.
  2807. */
  2808. toBytes(result?: number[]): number[];
  2809. /**
  2810. * Converts this color to a single numeric unsigned 32-bit RGBA value, using the endianness
  2811. * of the system.
  2812. * @example
  2813. * const rgba = SuperMap.Color.BLUE.toRgba();
  2814. * @returns A single numeric unsigned 32-bit RGBA value.
  2815. */
  2816. toRgba(): number;
  2817. /**
  2818. * Brightens this color by the provided magnitude.
  2819. * @example
  2820. * const brightBlue = SuperMap.Color.BLUE.brighten(0.5, new SuperMap.Color());
  2821. * @param magnitude - A positive number indicating the amount to brighten.
  2822. * @param result - The object onto which to store the result.
  2823. * @returns The modified result parameter.
  2824. */
  2825. brighten(magnitude: number, result: Color): Color;
  2826. /**
  2827. * Darkens this color by the provided magnitude.
  2828. * @example
  2829. * const darkBlue = SuperMap.Color.BLUE.darken(0.5, new SuperMap.Color());
  2830. * @param magnitude - A positive number indicating the amount to darken.
  2831. * @param result - The object onto which to store the result.
  2832. * @returns The modified result parameter.
  2833. */
  2834. darken(magnitude: number, result: Color): Color;
  2835. /**
  2836. * Creates a new Color that has the same red, green, and blue components
  2837. * as this Color, but with the specified alpha value.
  2838. * @example
  2839. * const translucentRed = SuperMap.Color.RED.withAlpha(0.9);
  2840. * @param alpha - The new alpha component.
  2841. * @param [result] - The object onto which to store the result.
  2842. * @returns The modified result parameter or a new Color instance if one was not provided.
  2843. */
  2844. withAlpha(alpha: number, result?: Color): Color;
  2845. /**
  2846. * Computes the componentwise sum of two Colors.
  2847. * @param left - The first Color.
  2848. * @param right - The second Color.
  2849. * @param result - The object onto which to store the result.
  2850. * @returns The modified result parameter.
  2851. */
  2852. add(left: Color, right: Color, result: Color): Color;
  2853. /**
  2854. * Computes the componentwise difference of two Colors.
  2855. * @param left - The first Color.
  2856. * @param right - The second Color.
  2857. * @param result - The object onto which to store the result.
  2858. * @returns The modified result parameter.
  2859. */
  2860. subtract(left: Color, right: Color, result: Color): Color;
  2861. /**
  2862. * Computes the componentwise product of two Colors.
  2863. * @param left - The first Color.
  2864. * @param right - The second Color.
  2865. * @param result - The object onto which to store the result.
  2866. * @returns The modified result parameter.
  2867. */
  2868. multiply(left: Color, right: Color, result: Color): Color;
  2869. /**
  2870. * Computes the componentwise quotient of two Colors.
  2871. * @param left - The first Color.
  2872. * @param right - The second Color.
  2873. * @param result - The object onto which to store the result.
  2874. * @returns The modified result parameter.
  2875. */
  2876. divide(left: Color, right: Color, result: Color): Color;
  2877. /**
  2878. * Computes the componentwise modulus of two Colors.
  2879. * @param left - The first Color.
  2880. * @param right - The second Color.
  2881. * @param result - The object onto which to store the result.
  2882. * @returns The modified result parameter.
  2883. */
  2884. mod(left: Color, right: Color, result: Color): Color;
  2885. /**
  2886. * Computes the linear interpolation or extrapolation at t between the provided colors.
  2887. * @param start - The color corresponding to t at 0.0.
  2888. * @param end - The color corresponding to t at 1.0.
  2889. * @param t - The point along t at which to interpolate.
  2890. * @param result - The object onto which to store the result.
  2891. * @returns The modified result parameter.
  2892. */
  2893. lerp(start: Color, end: Color, t: number, result: Color): Color;
  2894. /**
  2895. * Multiplies the provided Color componentwise by the provided scalar.
  2896. * @param color - The Color to be scaled.
  2897. * @param scalar - The scalar to multiply with.
  2898. * @param result - The object onto which to store the result.
  2899. * @returns The modified result parameter.
  2900. */
  2901. multiplyByScalar(color: Color, scalar: number, result: Color): Color;
  2902. /**
  2903. * Divides the provided Color componentwise by the provided scalar.
  2904. * @param color - The Color to be divided.
  2905. * @param scalar - The scalar to divide with.
  2906. * @param result - The object onto which to store the result.
  2907. * @returns The modified result parameter.
  2908. */
  2909. divideByScalar(color: Color, scalar: number, result: Color): Color;
  2910. /**
  2911. * An immutable Color instance initialized to CSS color #F0F8FF
  2912. * <span class="colorSwath" style="background: #F0F8FF;"></span>
  2913. */
  2914. readonly ALICEBLUE: Color;
  2915. /**
  2916. * An immutable Color instance initialized to CSS color #FAEBD7
  2917. * <span class="colorSwath" style="background: #FAEBD7;"></span>
  2918. */
  2919. readonly ANTIQUEWHITE: Color;
  2920. /**
  2921. * An immutable Color instance initialized to CSS color #00FFFF
  2922. * <span class="colorSwath" style="background: #00FFFF;"></span>
  2923. */
  2924. readonly AQUA: Color;
  2925. /**
  2926. * An immutable Color instance initialized to CSS color #7FFFD4
  2927. * <span class="colorSwath" style="background: #7FFFD4;"></span>
  2928. */
  2929. readonly AQUAMARINE: Color;
  2930. /**
  2931. * An immutable Color instance initialized to CSS color #F0FFFF
  2932. * <span class="colorSwath" style="background: #F0FFFF;"></span>
  2933. */
  2934. readonly AZURE: Color;
  2935. /**
  2936. * An immutable Color instance initialized to CSS color #F5F5DC
  2937. * <span class="colorSwath" style="background: #F5F5DC;"></span>
  2938. */
  2939. readonly BEIGE: Color;
  2940. /**
  2941. * An immutable Color instance initialized to CSS color #FFE4C4
  2942. * <span class="colorSwath" style="background: #FFE4C4;"></span>
  2943. */
  2944. readonly BISQUE: Color;
  2945. /**
  2946. * An immutable Color instance initialized to CSS color #000000
  2947. * <span class="colorSwath" style="background: #000000;"></span>
  2948. */
  2949. readonly BLACK: Color;
  2950. /**
  2951. * An immutable Color instance initialized to CSS color #FFEBCD
  2952. * <span class="colorSwath" style="background: #FFEBCD;"></span>
  2953. */
  2954. readonly BLANCHEDALMOND: Color;
  2955. /**
  2956. * An immutable Color instance initialized to CSS color #0000FF
  2957. * <span class="colorSwath" style="background: #0000FF;"></span>
  2958. */
  2959. readonly BLUE: Color;
  2960. /**
  2961. * An immutable Color instance initialized to CSS color #8A2BE2
  2962. * <span class="colorSwath" style="background: #8A2BE2;"></span>
  2963. */
  2964. readonly BLUEVIOLET: Color;
  2965. /**
  2966. * An immutable Color instance initialized to CSS color #A52A2A
  2967. * <span class="colorSwath" style="background: #A52A2A;"></span>
  2968. */
  2969. readonly BROWN: Color;
  2970. /**
  2971. * An immutable Color instance initialized to CSS color #DEB887
  2972. * <span class="colorSwath" style="background: #DEB887;"></span>
  2973. */
  2974. readonly BURLYWOOD: Color;
  2975. /**
  2976. * An immutable Color instance initialized to CSS color #5F9EA0
  2977. * <span class="colorSwath" style="background: #5F9EA0;"></span>
  2978. */
  2979. readonly CADETBLUE: Color;
  2980. /**
  2981. * An immutable Color instance initialized to CSS color #7FFF00
  2982. * <span class="colorSwath" style="background: #7FFF00;"></span>
  2983. */
  2984. readonly CHARTREUSE: Color;
  2985. /**
  2986. * An immutable Color instance initialized to CSS color #D2691E
  2987. * <span class="colorSwath" style="background: #D2691E;"></span>
  2988. */
  2989. readonly CHOCOLATE: Color;
  2990. /**
  2991. * An immutable Color instance initialized to CSS color #FF7F50
  2992. * <span class="colorSwath" style="background: #FF7F50;"></span>
  2993. */
  2994. readonly CORAL: Color;
  2995. /**
  2996. * An immutable Color instance initialized to CSS color #6495ED
  2997. * <span class="colorSwath" style="background: #6495ED;"></span>
  2998. */
  2999. readonly CORNFLOWERBLUE: Color;
  3000. /**
  3001. * An immutable Color instance initialized to CSS color #FFF8DC
  3002. * <span class="colorSwath" style="background: #FFF8DC;"></span>
  3003. */
  3004. readonly CORNSILK: Color;
  3005. /**
  3006. * An immutable Color instance initialized to CSS color #DC143C
  3007. * <span class="colorSwath" style="background: #DC143C;"></span>
  3008. */
  3009. readonly CRIMSON: Color;
  3010. /**
  3011. * An immutable Color instance initialized to CSS color #00FFFF
  3012. * <span class="colorSwath" style="background: #00FFFF;"></span>
  3013. */
  3014. readonly CYAN: Color;
  3015. /**
  3016. * An immutable Color instance initialized to CSS color #00008B
  3017. * <span class="colorSwath" style="background: #00008B;"></span>
  3018. */
  3019. readonly DARKBLUE: Color;
  3020. /**
  3021. * An immutable Color instance initialized to CSS color #008B8B
  3022. * <span class="colorSwath" style="background: #008B8B;"></span>
  3023. */
  3024. readonly DARKCYAN: Color;
  3025. /**
  3026. * An immutable Color instance initialized to CSS color #B8860B
  3027. * <span class="colorSwath" style="background: #B8860B;"></span>
  3028. */
  3029. readonly DARKGOLDENROD: Color;
  3030. /**
  3031. * An immutable Color instance initialized to CSS color #A9A9A9
  3032. * <span class="colorSwath" style="background: #A9A9A9;"></span>
  3033. */
  3034. readonly DARKGRAY: Color;
  3035. /**
  3036. * An immutable Color instance initialized to CSS color #006400
  3037. * <span class="colorSwath" style="background: #006400;"></span>
  3038. */
  3039. readonly DARKGREEN: Color;
  3040. /**
  3041. * An immutable Color instance initialized to CSS color #A9A9A9
  3042. * <span class="colorSwath" style="background: #A9A9A9;"></span>
  3043. */
  3044. readonly DARKGREY: Color;
  3045. /**
  3046. * An immutable Color instance initialized to CSS color #BDB76B
  3047. * <span class="colorSwath" style="background: #BDB76B;"></span>
  3048. */
  3049. readonly DARKKHAKI: Color;
  3050. /**
  3051. * An immutable Color instance initialized to CSS color #8B008B
  3052. * <span class="colorSwath" style="background: #8B008B;"></span>
  3053. */
  3054. readonly DARKMAGENTA: Color;
  3055. /**
  3056. * An immutable Color instance initialized to CSS color #556B2F
  3057. * <span class="colorSwath" style="background: #556B2F;"></span>
  3058. */
  3059. readonly DARKOLIVEGREEN: Color;
  3060. /**
  3061. * An immutable Color instance initialized to CSS color #FF8C00
  3062. * <span class="colorSwath" style="background: #FF8C00;"></span>
  3063. */
  3064. readonly DARKORANGE: Color;
  3065. /**
  3066. * An immutable Color instance initialized to CSS color #9932CC
  3067. * <span class="colorSwath" style="background: #9932CC;"></span>
  3068. */
  3069. readonly DARKORCHID: Color;
  3070. /**
  3071. * An immutable Color instance initialized to CSS color #8B0000
  3072. * <span class="colorSwath" style="background: #8B0000;"></span>
  3073. */
  3074. readonly DARKRED: Color;
  3075. /**
  3076. * An immutable Color instance initialized to CSS color #E9967A
  3077. * <span class="colorSwath" style="background: #E9967A;"></span>
  3078. */
  3079. readonly DARKSALMON: Color;
  3080. /**
  3081. * An immutable Color instance initialized to CSS color #8FBC8F
  3082. * <span class="colorSwath" style="background: #8FBC8F;"></span>
  3083. */
  3084. readonly DARKSEAGREEN: Color;
  3085. /**
  3086. * An immutable Color instance initialized to CSS color #483D8B
  3087. * <span class="colorSwath" style="background: #483D8B;"></span>
  3088. */
  3089. readonly DARKSLATEBLUE: Color;
  3090. /**
  3091. * An immutable Color instance initialized to CSS color #2F4F4F
  3092. * <span class="colorSwath" style="background: #2F4F4F;"></span>
  3093. */
  3094. readonly DARKSLATEGRAY: Color;
  3095. /**
  3096. * An immutable Color instance initialized to CSS color #2F4F4F
  3097. * <span class="colorSwath" style="background: #2F4F4F;"></span>
  3098. */
  3099. readonly DARKSLATEGREY: Color;
  3100. /**
  3101. * An immutable Color instance initialized to CSS color #00CED1
  3102. * <span class="colorSwath" style="background: #00CED1;"></span>
  3103. */
  3104. readonly DARKTURQUOISE: Color;
  3105. /**
  3106. * An immutable Color instance initialized to CSS color #9400D3
  3107. * <span class="colorSwath" style="background: #9400D3;"></span>
  3108. */
  3109. readonly DARKVIOLET: Color;
  3110. /**
  3111. * An immutable Color instance initialized to CSS color #FF1493
  3112. * <span class="colorSwath" style="background: #FF1493;"></span>
  3113. */
  3114. readonly DEEPPINK: Color;
  3115. /**
  3116. * An immutable Color instance initialized to CSS color #00BFFF
  3117. * <span class="colorSwath" style="background: #00BFFF;"></span>
  3118. */
  3119. readonly DEEPSKYBLUE: Color;
  3120. /**
  3121. * An immutable Color instance initialized to CSS color #696969
  3122. * <span class="colorSwath" style="background: #696969;"></span>
  3123. */
  3124. readonly DIMGRAY: Color;
  3125. /**
  3126. * An immutable Color instance initialized to CSS color #696969
  3127. * <span class="colorSwath" style="background: #696969;"></span>
  3128. */
  3129. readonly DIMGREY: Color;
  3130. /**
  3131. * An immutable Color instance initialized to CSS color #1E90FF
  3132. * <span class="colorSwath" style="background: #1E90FF;"></span>
  3133. */
  3134. readonly DODGERBLUE: Color;
  3135. /**
  3136. * An immutable Color instance initialized to CSS color #B22222
  3137. * <span class="colorSwath" style="background: #B22222;"></span>
  3138. */
  3139. readonly FIREBRICK: Color;
  3140. /**
  3141. * An immutable Color instance initialized to CSS color #FFFAF0
  3142. * <span class="colorSwath" style="background: #FFFAF0;"></span>
  3143. */
  3144. readonly FLORALWHITE: Color;
  3145. /**
  3146. * An immutable Color instance initialized to CSS color #228B22
  3147. * <span class="colorSwath" style="background: #228B22;"></span>
  3148. */
  3149. readonly FORESTGREEN: Color;
  3150. /**
  3151. * An immutable Color instance initialized to CSS color #FF00FF
  3152. * <span class="colorSwath" style="background: #FF00FF;"></span>
  3153. */
  3154. readonly FUCHSIA: Color;
  3155. /**
  3156. * An immutable Color instance initialized to CSS color #DCDCDC
  3157. * <span class="colorSwath" style="background: #DCDCDC;"></span>
  3158. */
  3159. readonly GAINSBORO: Color;
  3160. /**
  3161. * An immutable Color instance initialized to CSS color #F8F8FF
  3162. * <span class="colorSwath" style="background: #F8F8FF;"></span>
  3163. */
  3164. readonly GHOSTWHITE: Color;
  3165. /**
  3166. * An immutable Color instance initialized to CSS color #FFD700
  3167. * <span class="colorSwath" style="background: #FFD700;"></span>
  3168. */
  3169. readonly GOLD: Color;
  3170. /**
  3171. * An immutable Color instance initialized to CSS color #DAA520
  3172. * <span class="colorSwath" style="background: #DAA520;"></span>
  3173. */
  3174. readonly GOLDENROD: Color;
  3175. /**
  3176. * An immutable Color instance initialized to CSS color #808080
  3177. * <span class="colorSwath" style="background: #808080;"></span>
  3178. */
  3179. readonly GRAY: Color;
  3180. /**
  3181. * An immutable Color instance initialized to CSS color #008000
  3182. * <span class="colorSwath" style="background: #008000;"></span>
  3183. */
  3184. readonly GREEN: Color;
  3185. /**
  3186. * An immutable Color instance initialized to CSS color #ADFF2F
  3187. * <span class="colorSwath" style="background: #ADFF2F;"></span>
  3188. */
  3189. readonly GREENYELLOW: Color;
  3190. /**
  3191. * An immutable Color instance initialized to CSS color #808080
  3192. * <span class="colorSwath" style="background: #808080;"></span>
  3193. */
  3194. readonly GREY: Color;
  3195. /**
  3196. * An immutable Color instance initialized to CSS color #F0FFF0
  3197. * <span class="colorSwath" style="background: #F0FFF0;"></span>
  3198. */
  3199. readonly HONEYDEW: Color;
  3200. /**
  3201. * An immutable Color instance initialized to CSS color #FF69B4
  3202. * <span class="colorSwath" style="background: #FF69B4;"></span>
  3203. */
  3204. readonly HOTPINK: Color;
  3205. /**
  3206. * An immutable Color instance initialized to CSS color #CD5C5C
  3207. * <span class="colorSwath" style="background: #CD5C5C;"></span>
  3208. */
  3209. readonly INDIANRED: Color;
  3210. /**
  3211. * An immutable Color instance initialized to CSS color #4B0082
  3212. * <span class="colorSwath" style="background: #4B0082;"></span>
  3213. */
  3214. readonly INDIGO: Color;
  3215. /**
  3216. * An immutable Color instance initialized to CSS color #FFFFF0
  3217. * <span class="colorSwath" style="background: #FFFFF0;"></span>
  3218. */
  3219. readonly IVORY: Color;
  3220. /**
  3221. * An immutable Color instance initialized to CSS color #F0E68C
  3222. * <span class="colorSwath" style="background: #F0E68C;"></span>
  3223. */
  3224. readonly KHAKI: Color;
  3225. /**
  3226. * An immutable Color instance initialized to CSS color #E6E6FA
  3227. * <span class="colorSwath" style="background: #E6E6FA;"></span>
  3228. */
  3229. readonly LAVENDER: Color;
  3230. /**
  3231. * An immutable Color instance initialized to CSS color #FFF0F5
  3232. * <span class="colorSwath" style="background: #FFF0F5;"></span>
  3233. */
  3234. readonly LAVENDAR_BLUSH: Color;
  3235. /**
  3236. * An immutable Color instance initialized to CSS color #7CFC00
  3237. * <span class="colorSwath" style="background: #7CFC00;"></span>
  3238. */
  3239. readonly LAWNGREEN: Color;
  3240. /**
  3241. * An immutable Color instance initialized to CSS color #FFFACD
  3242. * <span class="colorSwath" style="background: #FFFACD;"></span>
  3243. */
  3244. readonly LEMONCHIFFON: Color;
  3245. /**
  3246. * An immutable Color instance initialized to CSS color #ADD8E6
  3247. * <span class="colorSwath" style="background: #ADD8E6;"></span>
  3248. */
  3249. readonly LIGHTBLUE: Color;
  3250. /**
  3251. * An immutable Color instance initialized to CSS color #F08080
  3252. * <span class="colorSwath" style="background: #F08080;"></span>
  3253. */
  3254. readonly LIGHTCORAL: Color;
  3255. /**
  3256. * An immutable Color instance initialized to CSS color #E0FFFF
  3257. * <span class="colorSwath" style="background: #E0FFFF;"></span>
  3258. */
  3259. readonly LIGHTCYAN: Color;
  3260. /**
  3261. * An immutable Color instance initialized to CSS color #FAFAD2
  3262. * <span class="colorSwath" style="background: #FAFAD2;"></span>
  3263. */
  3264. readonly LIGHTGOLDENRODYELLOW: Color;
  3265. /**
  3266. * An immutable Color instance initialized to CSS color #D3D3D3
  3267. * <span class="colorSwath" style="background: #D3D3D3;"></span>
  3268. */
  3269. readonly LIGHTGRAY: Color;
  3270. /**
  3271. * An immutable Color instance initialized to CSS color #90EE90
  3272. * <span class="colorSwath" style="background: #90EE90;"></span>
  3273. */
  3274. readonly LIGHTGREEN: Color;
  3275. /**
  3276. * An immutable Color instance initialized to CSS color #D3D3D3
  3277. * <span class="colorSwath" style="background: #D3D3D3;"></span>
  3278. */
  3279. readonly LIGHTGREY: Color;
  3280. /**
  3281. * An immutable Color instance initialized to CSS color #FFB6C1
  3282. * <span class="colorSwath" style="background: #FFB6C1;"></span>
  3283. */
  3284. readonly LIGHTPINK: Color;
  3285. /**
  3286. * An immutable Color instance initialized to CSS color #20B2AA
  3287. * <span class="colorSwath" style="background: #20B2AA;"></span>
  3288. */
  3289. readonly LIGHTSEAGREEN: Color;
  3290. /**
  3291. * An immutable Color instance initialized to CSS color #87CEFA
  3292. * <span class="colorSwath" style="background: #87CEFA;"></span>
  3293. */
  3294. readonly LIGHTSKYBLUE: Color;
  3295. /**
  3296. * An immutable Color instance initialized to CSS color #778899
  3297. * <span class="colorSwath" style="background: #778899;"></span>
  3298. */
  3299. readonly LIGHTSLATEGRAY: Color;
  3300. /**
  3301. * An immutable Color instance initialized to CSS color #778899
  3302. * <span class="colorSwath" style="background: #778899;"></span>
  3303. */
  3304. readonly LIGHTSLATEGREY: Color;
  3305. /**
  3306. * An immutable Color instance initialized to CSS color #B0C4DE
  3307. * <span class="colorSwath" style="background: #B0C4DE;"></span>
  3308. */
  3309. readonly LIGHTSTEELBLUE: Color;
  3310. /**
  3311. * An immutable Color instance initialized to CSS color #FFFFE0
  3312. * <span class="colorSwath" style="background: #FFFFE0;"></span>
  3313. */
  3314. readonly LIGHTYELLOW: Color;
  3315. /**
  3316. * An immutable Color instance initialized to CSS color #00FF00
  3317. * <span class="colorSwath" style="background: #00FF00;"></span>
  3318. */
  3319. readonly LIME: Color;
  3320. /**
  3321. * An immutable Color instance initialized to CSS color #32CD32
  3322. * <span class="colorSwath" style="background: #32CD32;"></span>
  3323. */
  3324. readonly LIMEGREEN: Color;
  3325. /**
  3326. * An immutable Color instance initialized to CSS color #FAF0E6
  3327. * <span class="colorSwath" style="background: #FAF0E6;"></span>
  3328. */
  3329. readonly LINEN: Color;
  3330. /**
  3331. * An immutable Color instance initialized to CSS color #FF00FF
  3332. * <span class="colorSwath" style="background: #FF00FF;"></span>
  3333. */
  3334. readonly MAGENTA: Color;
  3335. /**
  3336. * An immutable Color instance initialized to CSS color #800000
  3337. * <span class="colorSwath" style="background: #800000;"></span>
  3338. */
  3339. readonly MAROON: Color;
  3340. /**
  3341. * An immutable Color instance initialized to CSS color #66CDAA
  3342. * <span class="colorSwath" style="background: #66CDAA;"></span>
  3343. */
  3344. readonly MEDIUMAQUAMARINE: Color;
  3345. /**
  3346. * An immutable Color instance initialized to CSS color #0000CD
  3347. * <span class="colorSwath" style="background: #0000CD;"></span>
  3348. */
  3349. readonly MEDIUMBLUE: Color;
  3350. /**
  3351. * An immutable Color instance initialized to CSS color #BA55D3
  3352. * <span class="colorSwath" style="background: #BA55D3;"></span>
  3353. */
  3354. readonly MEDIUMORCHID: Color;
  3355. /**
  3356. * An immutable Color instance initialized to CSS color #9370DB
  3357. * <span class="colorSwath" style="background: #9370DB;"></span>
  3358. */
  3359. readonly MEDIUMPURPLE: Color;
  3360. /**
  3361. * An immutable Color instance initialized to CSS color #3CB371
  3362. * <span class="colorSwath" style="background: #3CB371;"></span>
  3363. */
  3364. readonly MEDIUMSEAGREEN: Color;
  3365. /**
  3366. * An immutable Color instance initialized to CSS color #7B68EE
  3367. * <span class="colorSwath" style="background: #7B68EE;"></span>
  3368. */
  3369. readonly MEDIUMSLATEBLUE: Color;
  3370. /**
  3371. * An immutable Color instance initialized to CSS color #00FA9A
  3372. * <span class="colorSwath" style="background: #00FA9A;"></span>
  3373. */
  3374. readonly MEDIUMSPRINGGREEN: Color;
  3375. /**
  3376. * An immutable Color instance initialized to CSS color #48D1CC
  3377. * <span class="colorSwath" style="background: #48D1CC;"></span>
  3378. */
  3379. readonly MEDIUMTURQUOISE: Color;
  3380. /**
  3381. * An immutable Color instance initialized to CSS color #C71585
  3382. * <span class="colorSwath" style="background: #C71585;"></span>
  3383. */
  3384. readonly MEDIUMVIOLETRED: Color;
  3385. /**
  3386. * An immutable Color instance initialized to CSS color #191970
  3387. * <span class="colorSwath" style="background: #191970;"></span>
  3388. */
  3389. readonly MIDNIGHTBLUE: Color;
  3390. /**
  3391. * An immutable Color instance initialized to CSS color #F5FFFA
  3392. * <span class="colorSwath" style="background: #F5FFFA;"></span>
  3393. */
  3394. readonly MINTCREAM: Color;
  3395. /**
  3396. * An immutable Color instance initialized to CSS color #FFE4E1
  3397. * <span class="colorSwath" style="background: #FFE4E1;"></span>
  3398. */
  3399. readonly MISTYROSE: Color;
  3400. /**
  3401. * An immutable Color instance initialized to CSS color #FFE4B5
  3402. * <span class="colorSwath" style="background: #FFE4B5;"></span>
  3403. */
  3404. readonly MOCCASIN: Color;
  3405. /**
  3406. * An immutable Color instance initialized to CSS color #FFDEAD
  3407. * <span class="colorSwath" style="background: #FFDEAD;"></span>
  3408. */
  3409. readonly NAVAJOWHITE: Color;
  3410. /**
  3411. * An immutable Color instance initialized to CSS color #000080
  3412. * <span class="colorSwath" style="background: #000080;"></span>
  3413. */
  3414. readonly NAVY: Color;
  3415. /**
  3416. * An immutable Color instance initialized to CSS color #FDF5E6
  3417. * <span class="colorSwath" style="background: #FDF5E6;"></span>
  3418. */
  3419. readonly OLDLACE: Color;
  3420. /**
  3421. * An immutable Color instance initialized to CSS color #808000
  3422. * <span class="colorSwath" style="background: #808000;"></span>
  3423. */
  3424. readonly OLIVE: Color;
  3425. /**
  3426. * An immutable Color instance initialized to CSS color #6B8E23
  3427. * <span class="colorSwath" style="background: #6B8E23;"></span>
  3428. */
  3429. readonly OLIVEDRAB: Color;
  3430. /**
  3431. * An immutable Color instance initialized to CSS color #FFA500
  3432. * <span class="colorSwath" style="background: #FFA500;"></span>
  3433. */
  3434. readonly ORANGE: Color;
  3435. /**
  3436. * An immutable Color instance initialized to CSS color #FF4500
  3437. * <span class="colorSwath" style="background: #FF4500;"></span>
  3438. */
  3439. readonly ORANGERED: Color;
  3440. /**
  3441. * An immutable Color instance initialized to CSS color #DA70D6
  3442. * <span class="colorSwath" style="background: #DA70D6;"></span>
  3443. */
  3444. readonly ORCHID: Color;
  3445. /**
  3446. * An immutable Color instance initialized to CSS color #EEE8AA
  3447. * <span class="colorSwath" style="background: #EEE8AA;"></span>
  3448. */
  3449. readonly PALEGOLDENROD: Color;
  3450. /**
  3451. * An immutable Color instance initialized to CSS color #98FB98
  3452. * <span class="colorSwath" style="background: #98FB98;"></span>
  3453. */
  3454. readonly PALEGREEN: Color;
  3455. /**
  3456. * An immutable Color instance initialized to CSS color #AFEEEE
  3457. * <span class="colorSwath" style="background: #AFEEEE;"></span>
  3458. */
  3459. readonly PALETURQUOISE: Color;
  3460. /**
  3461. * An immutable Color instance initialized to CSS color #DB7093
  3462. * <span class="colorSwath" style="background: #DB7093;"></span>
  3463. */
  3464. readonly PALEVIOLETRED: Color;
  3465. /**
  3466. * An immutable Color instance initialized to CSS color #FFEFD5
  3467. * <span class="colorSwath" style="background: #FFEFD5;"></span>
  3468. */
  3469. readonly PAPAYAWHIP: Color;
  3470. /**
  3471. * An immutable Color instance initialized to CSS color #FFDAB9
  3472. * <span class="colorSwath" style="background: #FFDAB9;"></span>
  3473. */
  3474. readonly PEACHPUFF: Color;
  3475. /**
  3476. * An immutable Color instance initialized to CSS color #CD853F
  3477. * <span class="colorSwath" style="background: #CD853F;"></span>
  3478. */
  3479. readonly PERU: Color;
  3480. /**
  3481. * An immutable Color instance initialized to CSS color #FFC0CB
  3482. * <span class="colorSwath" style="background: #FFC0CB;"></span>
  3483. */
  3484. readonly PINK: Color;
  3485. /**
  3486. * An immutable Color instance initialized to CSS color #DDA0DD
  3487. * <span class="colorSwath" style="background: #DDA0DD;"></span>
  3488. */
  3489. readonly PLUM: Color;
  3490. /**
  3491. * An immutable Color instance initialized to CSS color #B0E0E6
  3492. * <span class="colorSwath" style="background: #B0E0E6;"></span>
  3493. */
  3494. readonly POWDERBLUE: Color;
  3495. /**
  3496. * An immutable Color instance initialized to CSS color #800080
  3497. * <span class="colorSwath" style="background: #800080;"></span>
  3498. */
  3499. readonly PURPLE: Color;
  3500. /**
  3501. * An immutable Color instance initialized to CSS color #FF0000
  3502. * <span class="colorSwath" style="background: #FF0000;"></span>
  3503. */
  3504. readonly RED: Color;
  3505. /**
  3506. * An immutable Color instance initialized to CSS color #BC8F8F
  3507. * <span class="colorSwath" style="background: #BC8F8F;"></span>
  3508. */
  3509. readonly ROSYBROWN: Color;
  3510. /**
  3511. * An immutable Color instance initialized to CSS color #4169E1
  3512. * <span class="colorSwath" style="background: #4169E1;"></span>
  3513. */
  3514. readonly ROYALBLUE: Color;
  3515. /**
  3516. * An immutable Color instance initialized to CSS color #8B4513
  3517. * <span class="colorSwath" style="background: #8B4513;"></span>
  3518. */
  3519. readonly SADDLEBROWN: Color;
  3520. /**
  3521. * An immutable Color instance initialized to CSS color #FA8072
  3522. * <span class="colorSwath" style="background: #FA8072;"></span>
  3523. */
  3524. readonly SALMON: Color;
  3525. /**
  3526. * An immutable Color instance initialized to CSS color #F4A460
  3527. * <span class="colorSwath" style="background: #F4A460;"></span>
  3528. */
  3529. readonly SANDYBROWN: Color;
  3530. /**
  3531. * An immutable Color instance initialized to CSS color #2E8B57
  3532. * <span class="colorSwath" style="background: #2E8B57;"></span>
  3533. */
  3534. readonly SEAGREEN: Color;
  3535. /**
  3536. * An immutable Color instance initialized to CSS color #FFF5EE
  3537. * <span class="colorSwath" style="background: #FFF5EE;"></span>
  3538. */
  3539. readonly SEASHELL: Color;
  3540. /**
  3541. * An immutable Color instance initialized to CSS color #A0522D
  3542. * <span class="colorSwath" style="background: #A0522D;"></span>
  3543. */
  3544. readonly SIENNA: Color;
  3545. /**
  3546. * An immutable Color instance initialized to CSS color #C0C0C0
  3547. * <span class="colorSwath" style="background: #C0C0C0;"></span>
  3548. */
  3549. readonly SILVER: Color;
  3550. /**
  3551. * An immutable Color instance initialized to CSS color #87CEEB
  3552. * <span class="colorSwath" style="background: #87CEEB;"></span>
  3553. */
  3554. readonly SKYBLUE: Color;
  3555. /**
  3556. * An immutable Color instance initialized to CSS color #6A5ACD
  3557. * <span class="colorSwath" style="background: #6A5ACD;"></span>
  3558. */
  3559. readonly SLATEBLUE: Color;
  3560. /**
  3561. * An immutable Color instance initialized to CSS color #708090
  3562. * <span class="colorSwath" style="background: #708090;"></span>
  3563. */
  3564. readonly SLATEGRAY: Color;
  3565. /**
  3566. * An immutable Color instance initialized to CSS color #708090
  3567. * <span class="colorSwath" style="background: #708090;"></span>
  3568. */
  3569. readonly SLATEGREY: Color;
  3570. /**
  3571. * An immutable Color instance initialized to CSS color #FFFAFA
  3572. * <span class="colorSwath" style="background: #FFFAFA;"></span>
  3573. */
  3574. readonly SNOW: Color;
  3575. /**
  3576. * An immutable Color instance initialized to CSS color #00FF7F
  3577. * <span class="colorSwath" style="background: #00FF7F;"></span>
  3578. */
  3579. readonly SPRINGGREEN: Color;
  3580. /**
  3581. * An immutable Color instance initialized to CSS color #4682B4
  3582. * <span class="colorSwath" style="background: #4682B4;"></span>
  3583. */
  3584. readonly STEELBLUE: Color;
  3585. /**
  3586. * An immutable Color instance initialized to CSS color #D2B48C
  3587. * <span class="colorSwath" style="background: #D2B48C;"></span>
  3588. */
  3589. readonly TAN: Color;
  3590. /**
  3591. * An immutable Color instance initialized to CSS color #008080
  3592. * <span class="colorSwath" style="background: #008080;"></span>
  3593. */
  3594. readonly TEAL: Color;
  3595. /**
  3596. * An immutable Color instance initialized to CSS color #D8BFD8
  3597. * <span class="colorSwath" style="background: #D8BFD8;"></span>
  3598. */
  3599. readonly THISTLE: Color;
  3600. /**
  3601. * An immutable Color instance initialized to CSS color #FF6347
  3602. * <span class="colorSwath" style="background: #FF6347;"></span>
  3603. */
  3604. readonly TOMATO: Color;
  3605. /**
  3606. * An immutable Color instance initialized to CSS color #40E0D0
  3607. * <span class="colorSwath" style="background: #40E0D0;"></span>
  3608. */
  3609. readonly TURQUOISE: Color;
  3610. /**
  3611. * An immutable Color instance initialized to CSS color #EE82EE
  3612. * <span class="colorSwath" style="background: #EE82EE;"></span>
  3613. */
  3614. readonly VIOLET: Color;
  3615. /**
  3616. * An immutable Color instance initialized to CSS color #F5DEB3
  3617. * <span class="colorSwath" style="background: #F5DEB3;"></span>
  3618. */
  3619. readonly WHEAT: Color;
  3620. /**
  3621. * An immutable Color instance initialized to CSS color #FFFFFF
  3622. * <span class="colorSwath" style="background: #FFFFFF;"></span>
  3623. */
  3624. readonly WHITE: Color;
  3625. /**
  3626. * An immutable Color instance initialized to CSS color #F5F5F5
  3627. * <span class="colorSwath" style="background: #F5F5F5;"></span>
  3628. */
  3629. readonly WHITESMOKE: Color;
  3630. /**
  3631. * An immutable Color instance initialized to CSS color #FFFF00
  3632. * <span class="colorSwath" style="background: #FFFF00;"></span>
  3633. */
  3634. readonly YELLOW: Color;
  3635. /**
  3636. * An immutable Color instance initialized to CSS color #9ACD32
  3637. * <span class="colorSwath" style="background: #9ACD32;"></span>
  3638. */
  3639. readonly YELLOWGREEN: Color;
  3640. /**
  3641. * An immutable Color instance initialized to CSS transparent.
  3642. * <span class="colorSwath" style="background: transparent;"></span>
  3643. */
  3644. readonly TRANSPARENT: Color;
  3645. }
  3646. /**
  3647. * Value and type information for per-instance geometry color.
  3648. * @example
  3649. * const instance = new SuperMap.GeometryInstance({
  3650. * geometry : SuperMap.BoxGeometry.fromDimensions({
  3651. * dimensions : new SuperMap.Cartesian3(1000000.0, 1000000.0, 500000.0)
  3652. * }),
  3653. * modelMatrix : SuperMap.Matrix4.multiplyByTranslation(SuperMap.Transforms.eastNorthUpToFixedFrame(
  3654. * SuperMap.Cartesian3.fromDegrees(0.0, 0.0)), new SuperMap.Cartesian3(0.0, 0.0, 1000000.0), new SuperMap.Matrix4()),
  3655. * id : 'box',
  3656. * attributes : {
  3657. * color : new SuperMap.ColorGeometryInstanceAttribute(red, green, blue, alpha)
  3658. * }
  3659. * });
  3660. * @param [red = 1.0] - The red component.
  3661. * @param [green = 1.0] - The green component.
  3662. * @param [blue = 1.0] - The blue component.
  3663. * @param [alpha = 1.0] - The alpha component.
  3664. */
  3665. export class ColorGeometryInstanceAttribute {
  3666. constructor(red?: number, green?: number, blue?: number, alpha?: number);
  3667. /**
  3668. * The values for the attributes stored in a typed array.
  3669. */
  3670. value: Uint8Array;
  3671. /**
  3672. * The datatype of each component in the attribute, e.g., individual elements in
  3673. * {@link ColorGeometryInstanceAttribute#value}.
  3674. */
  3675. readonly componentDatatype: ComponentDatatype;
  3676. /**
  3677. * The number of components in the attributes, i.e., {@link ColorGeometryInstanceAttribute#value}.
  3678. */
  3679. readonly componentsPerAttribute: number;
  3680. /**
  3681. * When <code>true</code> and <code>componentDatatype</code> is an integer format,
  3682. * indicate that the components should be mapped to the range [0, 1] (unsigned)
  3683. * or [-1, 1] (signed) when they are accessed as floating-point for rendering.
  3684. */
  3685. readonly normalize: boolean;
  3686. /**
  3687. * Creates a new {@link ColorGeometryInstanceAttribute} instance given the provided {@link Color}.
  3688. * @example
  3689. * const instance = new SuperMap.GeometryInstance({
  3690. * geometry : geometry,
  3691. * attributes : {
  3692. * color : SuperMap.ColorGeometryInstanceAttribute.fromColor(SuperMap.Color.CORNFLOWERBLUE),
  3693. * }
  3694. * });
  3695. * @param color - The color.
  3696. * @returns The new {@link ColorGeometryInstanceAttribute} instance.
  3697. */
  3698. fromColor(color: Color): ColorGeometryInstanceAttribute;
  3699. /**
  3700. * Converts a color to a typed array that can be used to assign a color attribute.
  3701. * @example
  3702. * const attributes = primitive.getGeometryInstanceAttributes('an id');
  3703. * attributes.color = SuperMap.ColorGeometryInstanceAttribute.toValue(SuperMap.Color.AQUA, attributes.color);
  3704. * @param color - The color.
  3705. * @param [result] - The array to store the result in, if undefined a new instance will be created.
  3706. * @returns The modified result parameter or a new instance if result was undefined.
  3707. */
  3708. toValue(color: Color, result?: Uint8Array): Uint8Array;
  3709. /**
  3710. * Compares the provided ColorGeometryInstanceAttributes and returns
  3711. * <code>true</code> if they are equal, <code>false</code> otherwise.
  3712. * @param [left] - The first ColorGeometryInstanceAttribute.
  3713. * @param [right] - The second ColorGeometryInstanceAttribute.
  3714. * @returns <code>true</code> if left and right are equal, <code>false</code> otherwise.
  3715. */
  3716. equals(left?: ColorGeometryInstanceAttribute, right?: ColorGeometryInstanceAttribute): boolean;
  3717. }
  3718. /**
  3719. * WebGL component datatypes. Components are intrinsics,
  3720. * which form attributes, which form vertices.
  3721. */
  3722. export enum ComponentDatatype {
  3723. /**
  3724. * 8-bit signed byte corresponding to <code>gl.BYTE</code> and the type
  3725. * of an element in <code>Int8Array</code>.
  3726. */
  3727. BYTE = WebGLConstants.BYTE,
  3728. /**
  3729. * 8-bit unsigned byte corresponding to <code>UNSIGNED_BYTE</code> and the type
  3730. * of an element in <code>Uint8Array</code>.
  3731. */
  3732. UNSIGNED_BYTE = WebGLConstants.UNSIGNED_BYTE,
  3733. /**
  3734. * 16-bit signed short corresponding to <code>SHORT</code> and the type
  3735. * of an element in <code>Int16Array</code>.
  3736. */
  3737. SHORT = WebGLConstants.SHORT,
  3738. /**
  3739. * 16-bit unsigned short corresponding to <code>UNSIGNED_SHORT</code> and the type
  3740. * of an element in <code>Uint16Array</code>.
  3741. */
  3742. UNSIGNED_SHORT = WebGLConstants.UNSIGNED_SHORT,
  3743. /**
  3744. * 32-bit signed int corresponding to <code>INT</code> and the type
  3745. * of an element in <code>Int32Array</code>.
  3746. */
  3747. INT = WebGLConstants.INT,
  3748. /**
  3749. * 32-bit unsigned int corresponding to <code>UNSIGNED_INT</code> and the type
  3750. * of an element in <code>Uint32Array</code>.
  3751. */
  3752. UNSIGNED_INT = WebGLConstants.UNSIGNED_INT,
  3753. /**
  3754. * 32-bit floating-point corresponding to <code>FLOAT</code> and the type
  3755. * of an element in <code>Float32Array</code>.
  3756. */
  3757. FLOAT = WebGLConstants.FLOAT,
  3758. /**
  3759. * 64-bit floating-point corresponding to <code>gl.DOUBLE</code> (in Desktop OpenGL;
  3760. * this is not supported in WebGL, and is emulated in SuperMap via {@link GeometryPipeline.encodeAttribute})
  3761. * and the type of an element in <code>Float64Array</code>.
  3762. */
  3763. DOUBLE = WebGLConstants.DOUBLE
  3764. }
  3765. /**
  3766. * Describes a compressed texture and contains a compressed texture buffer.
  3767. * @param internalFormat - The pixel format of the compressed texture.
  3768. * @param pixelDatatype - The pixel datatype of the compressed texture.
  3769. * @param width - The width of the texture.
  3770. * @param height - The height of the texture.
  3771. * @param buffer - The compressed texture buffer.
  3772. */
  3773. export class CompressedTextureBuffer {
  3774. constructor(internalFormat: PixelFormat, pixelDatatype: PixelDatatype, width: number, height: number, buffer: Uint8Array);
  3775. /**
  3776. * The format of the compressed texture.
  3777. */
  3778. readonly internalFormat: PixelFormat;
  3779. /**
  3780. * The datatype of the compressed texture.
  3781. */
  3782. readonly pixelDatatype: PixelDatatype;
  3783. /**
  3784. * The width of the texture.
  3785. */
  3786. readonly width: number;
  3787. /**
  3788. * The height of the texture.
  3789. */
  3790. readonly height: number;
  3791. /**
  3792. * The compressed texture buffer.
  3793. */
  3794. readonly bufferView: Uint8Array;
  3795. /**
  3796. * Creates a shallow clone of a compressed texture buffer.
  3797. * @param object - The compressed texture buffer to be cloned.
  3798. * @returns A shallow clone of the compressed texture buffer.
  3799. */
  3800. clone(object: CompressedTextureBuffer): CompressedTextureBuffer;
  3801. /**
  3802. * Creates a shallow clone of this compressed texture buffer.
  3803. * @returns A shallow clone of the compressed texture buffer.
  3804. */
  3805. clone(): CompressedTextureBuffer;
  3806. }
  3807. /**
  3808. * A description of a polygon composed of arbitrary coplanar positions.
  3809. * @example
  3810. * const polygonGeometry = new SuperMap.CoplanarPolygonGeometry({
  3811. * polygonHierarchy: new SuperMap.PolygonHierarchy(
  3812. * SuperMap.Cartesian3.fromDegreesArrayHeights([
  3813. * -90.0, 30.0, 0.0,
  3814. * -90.0, 30.0, 300000.0,
  3815. * -80.0, 30.0, 300000.0,
  3816. * -80.0, 30.0, 0.0
  3817. * ]))
  3818. * });
  3819. * @param options - Object with the following properties:
  3820. * @param options.polygonHierarchy - A polygon hierarchy that can include holes.
  3821. * @param [options.stRotation = 0.0] - The rotation of the texture coordinates, in radians. A positive rotation is counter-clockwise.
  3822. * @param [options.vertexFormat = VertexFormat.DEFAULT] - The vertex attributes to be computed.
  3823. * @param [options.ellipsoid = Ellipsoid.WGS84] - The ellipsoid to be used as a reference.
  3824. * @param [options.textureCoordinates] - Texture coordinates as a {@link PolygonHierarchy} of {@link Cartesian2} points.
  3825. */
  3826. export class CoplanarPolygonGeometry {
  3827. constructor(options: {
  3828. polygonHierarchy: PolygonHierarchy;
  3829. stRotation?: number;
  3830. vertexFormat?: VertexFormat;
  3831. ellipsoid?: Ellipsoid;
  3832. textureCoordinates?: PolygonHierarchy;
  3833. });
  3834. /**
  3835. * The number of elements used to pack the object into an array.
  3836. */
  3837. packedLength: number;
  3838. /**
  3839. * A description of a coplanar polygon from an array of positions.
  3840. * @example
  3841. * // create a polygon from points
  3842. * const polygon = SuperMap.CoplanarPolygonGeometry.fromPositions({
  3843. * positions : SuperMap.Cartesian3.fromDegreesArray([
  3844. * -72.0, 40.0,
  3845. * -70.0, 35.0,
  3846. * -75.0, 30.0,
  3847. * -70.0, 30.0,
  3848. * -68.0, 40.0
  3849. * ])
  3850. * });
  3851. * const geometry = SuperMap.PolygonGeometry.createGeometry(polygon);
  3852. * @param options - Object with the following properties:
  3853. * @param options.positions - An array of positions that defined the corner points of the polygon.
  3854. * @param [options.vertexFormat = VertexFormat.DEFAULT] - The vertex attributes to be computed.
  3855. * @param [options.stRotation = 0.0] - The rotation of the texture coordinates, in radians. A positive rotation is counter-clockwise.
  3856. * @param [options.ellipsoid = Ellipsoid.WGS84] - The ellipsoid to be used as a reference.
  3857. * @param [options.textureCoordinates] - Texture coordinates as a {@link PolygonHierarchy} of {@link Cartesian2} points.
  3858. */
  3859. fromPositions(options: {
  3860. positions: Cartesian3[];
  3861. vertexFormat?: VertexFormat;
  3862. stRotation?: number;
  3863. ellipsoid?: Ellipsoid;
  3864. textureCoordinates?: PolygonHierarchy;
  3865. }): CoplanarPolygonGeometry;
  3866. /**
  3867. * Stores the provided instance into the provided array.
  3868. * @param value - The value to pack.
  3869. * @param array - The array to pack into.
  3870. * @param [startingIndex = 0] - The index into the array at which to start packing the elements.
  3871. * @returns The array that was packed into
  3872. */
  3873. pack(value: CoplanarPolygonGeometry, array: number[], startingIndex?: number): number[];
  3874. /**
  3875. * Retrieves an instance from a packed array.
  3876. * @param array - The packed array.
  3877. * @param [startingIndex = 0] - The starting index of the element to be unpacked.
  3878. * @param [result] - The object into which to store the result.
  3879. * @returns The modified result parameter or a new CoplanarPolygonGeometry instance if one was not provided.
  3880. */
  3881. unpack(array: number[], startingIndex?: number, result?: CoplanarPolygonGeometry): CoplanarPolygonGeometry;
  3882. /**
  3883. * Computes the geometric representation of an arbitrary coplanar polygon, including its vertices, indices, and a bounding sphere.
  3884. * @param polygonGeometry - A description of the polygon.
  3885. * @returns The computed vertices and indices.
  3886. */
  3887. createGeometry(polygonGeometry: CoplanarPolygonGeometry): Geometry | undefined;
  3888. }
  3889. /**
  3890. * A description of the outline of a polygon composed of arbitrary coplanar positions.
  3891. * @example
  3892. * const polygonOutline = new SuperMap.CoplanarPolygonOutlineGeometry({
  3893. * positions : SuperMap.Cartesian3.fromDegreesArrayHeights([
  3894. * -90.0, 30.0, 0.0,
  3895. * -90.0, 30.0, 1000.0,
  3896. * -80.0, 30.0, 1000.0,
  3897. * -80.0, 30.0, 0.0
  3898. * ])
  3899. * });
  3900. * const geometry = SuperMap.CoplanarPolygonOutlineGeometry.createGeometry(polygonOutline);
  3901. * @param options - Object with the following properties:
  3902. * @param options.polygonHierarchy - A polygon hierarchy that can include holes.
  3903. */
  3904. export class CoplanarPolygonOutlineGeometry {
  3905. constructor(options: {
  3906. polygonHierarchy: PolygonHierarchy;
  3907. });
  3908. /**
  3909. * The number of elements used to pack the object into an array.
  3910. */
  3911. packedLength: number;
  3912. /**
  3913. * A description of a coplanar polygon outline from an array of positions.
  3914. * @param options - Object with the following properties:
  3915. * @param options.positions - An array of positions that defined the corner points of the polygon.
  3916. */
  3917. fromPositions(options: {
  3918. positions: Cartesian3[];
  3919. }): CoplanarPolygonOutlineGeometry;
  3920. /**
  3921. * Stores the provided instance into the provided array.
  3922. * @param value - The value to pack.
  3923. * @param array - The array to pack into.
  3924. * @param [startingIndex = 0] - The index into the array at which to start packing the elements.
  3925. * @returns The array that was packed into
  3926. */
  3927. pack(value: CoplanarPolygonOutlineGeometry, array: number[], startingIndex?: number): number[];
  3928. /**
  3929. * Retrieves an instance from a packed array.
  3930. * @param array - The packed array.
  3931. * @param [startingIndex = 0] - The starting index of the element to be unpacked.
  3932. * @param [result] - The object into which to store the result.
  3933. * @returns The modified result parameter or a new CoplanarPolygonOutlineGeometry instance if one was not provided.
  3934. */
  3935. unpack(array: number[], startingIndex?: number, result?: CoplanarPolygonOutlineGeometry): CoplanarPolygonOutlineGeometry;
  3936. /**
  3937. * Computes the geometric representation of an arbitrary coplanar polygon, including its vertices, indices, and a bounding sphere.
  3938. * @param polygonGeometry - A description of the polygon.
  3939. * @returns The computed vertices and indices.
  3940. */
  3941. createGeometry(polygonGeometry: CoplanarPolygonOutlineGeometry): Geometry | undefined;
  3942. }
  3943. /**
  3944. * Style options for corners.
  3945. */
  3946. export enum CornerType {
  3947. /**
  3948. * <img src="Images/CornerTypeRounded.png" style="vertical-align: middle;" width="186" height="189" />
  3949. *
  3950. * Corner has a smooth edge.
  3951. */
  3952. ROUNDED = 0,
  3953. /**
  3954. * <img src="Images/CornerTypeMitered.png" style="vertical-align: middle;" width="186" height="189" />
  3955. *
  3956. * Corner point is the intersection of adjacent edges.
  3957. */
  3958. MITERED = 1,
  3959. /**
  3960. * <img src="Images/CornerTypeBeveled.png" style="vertical-align: middle;" width="186" height="189" />
  3961. *
  3962. * Corner is clipped.
  3963. */
  3964. BEVELED = 2
  3965. }
  3966. /**
  3967. * A description of a corridor. Corridor geometry can be rendered with both {@link Primitive} and {@link GroundPrimitive}.
  3968. * @example
  3969. * const corridor = new SuperMap.CorridorGeometry({
  3970. * vertexFormat : SuperMap.VertexFormat.POSITION_ONLY,
  3971. * positions : SuperMap.Cartesian3.fromDegreesArray([-72.0, 40.0, -70.0, 35.0]),
  3972. * width : 100000
  3973. * });
  3974. * @param options - Object with the following properties:
  3975. * @param options.positions - An array of positions that define the center of the corridor.
  3976. * @param options.width - The distance between the edges of the corridor in meters.
  3977. * @param [options.ellipsoid = Ellipsoid.WGS84] - The ellipsoid to be used as a reference.
  3978. * @param [options.granularity = Math.RADIANS_PER_DEGREE] - The distance, in radians, between each latitude and longitude. Determines the number of positions in the buffer.
  3979. * @param [options.height = 0] - The distance in meters between the ellipsoid surface and the positions.
  3980. * @param [options.extrudedHeight] - The distance in meters between the ellipsoid surface and the extruded face.
  3981. * @param [options.vertexFormat = VertexFormat.DEFAULT] - The vertex attributes to be computed.
  3982. * @param [options.cornerType = CornerType.ROUNDED] - Determines the style of the corners.
  3983. */
  3984. export class CorridorGeometry {
  3985. constructor(options: {
  3986. positions: Cartesian3[];
  3987. width: number;
  3988. ellipsoid?: Ellipsoid;
  3989. granularity?: number;
  3990. height?: number;
  3991. extrudedHeight?: number;
  3992. vertexFormat?: VertexFormat;
  3993. cornerType?: CornerType;
  3994. });
  3995. /**
  3996. * The number of elements used to pack the object into an array.
  3997. */
  3998. packedLength: number;
  3999. /**
  4000. * Stores the provided instance into the provided array.
  4001. * @param value - The value to pack.
  4002. * @param array - The array to pack into.
  4003. * @param [startingIndex = 0] - The index into the array at which to start packing the elements.
  4004. * @returns The array that was packed into
  4005. */
  4006. pack(value: CorridorGeometry, array: number[], startingIndex?: number): number[];
  4007. /**
  4008. * Retrieves an instance from a packed array.
  4009. * @param array - The packed array.
  4010. * @param [startingIndex = 0] - The starting index of the element to be unpacked.
  4011. * @param [result] - The object into which to store the result.
  4012. * @returns The modified result parameter or a new CorridorGeometry instance if one was not provided.
  4013. */
  4014. unpack(array: number[], startingIndex?: number, result?: CorridorGeometry): CorridorGeometry;
  4015. /**
  4016. * Computes the bounding rectangle given the provided options
  4017. * @param options - Object with the following properties:
  4018. * @param options.positions - An array of positions that define the center of the corridor.
  4019. * @param options.width - The distance between the edges of the corridor in meters.
  4020. * @param [options.ellipsoid = Ellipsoid.WGS84] - The ellipsoid to be used as a reference.
  4021. * @param [options.cornerType = CornerType.ROUNDED] - Determines the style of the corners.
  4022. * @param [result] - An object in which to store the result.
  4023. * @returns The result rectangle.
  4024. */
  4025. computeRectangle(options: {
  4026. positions: Cartesian3[];
  4027. width: number;
  4028. ellipsoid?: Ellipsoid;
  4029. cornerType?: CornerType;
  4030. }, result?: Rectangle): Rectangle;
  4031. /**
  4032. * Computes the geometric representation of a corridor, including its vertices, indices, and a bounding sphere.
  4033. * @param corridorGeometry - A description of the corridor.
  4034. * @returns The computed vertices and indices.
  4035. */
  4036. createGeometry(corridorGeometry: CorridorGeometry): Geometry | undefined;
  4037. }
  4038. /**
  4039. * A description of a corridor outline.
  4040. * @example
  4041. * const corridor = new SuperMap.CorridorOutlineGeometry({
  4042. * positions : SuperMap.Cartesian3.fromDegreesArray([-72.0, 40.0, -70.0, 35.0]),
  4043. * width : 100000
  4044. * });
  4045. * @param options - Object with the following properties:
  4046. * @param options.positions - An array of positions that define the center of the corridor outline.
  4047. * @param options.width - The distance between the edges of the corridor outline.
  4048. * @param [options.ellipsoid = Ellipsoid.WGS84] - The ellipsoid to be used as a reference.
  4049. * @param [options.granularity = Math.RADIANS_PER_DEGREE] - The distance, in radians, between each latitude and longitude. Determines the number of positions in the buffer.
  4050. * @param [options.height = 0] - The distance in meters between the positions and the ellipsoid surface.
  4051. * @param [options.extrudedHeight] - The distance in meters between the extruded face and the ellipsoid surface.
  4052. * @param [options.cornerType = CornerType.ROUNDED] - Determines the style of the corners.
  4053. */
  4054. export class CorridorOutlineGeometry {
  4055. constructor(options: {
  4056. positions: Cartesian3[];
  4057. width: number;
  4058. ellipsoid?: Ellipsoid;
  4059. granularity?: number;
  4060. height?: number;
  4061. extrudedHeight?: number;
  4062. cornerType?: CornerType;
  4063. });
  4064. /**
  4065. * The number of elements used to pack the object into an array.
  4066. */
  4067. packedLength: number;
  4068. /**
  4069. * Stores the provided instance into the provided array.
  4070. * @param value - The value to pack.
  4071. * @param array - The array to pack into.
  4072. * @param [startingIndex = 0] - The index into the array at which to start packing the elements.
  4073. * @returns The array that was packed into
  4074. */
  4075. pack(value: CorridorOutlineGeometry, array: number[], startingIndex?: number): number[];
  4076. /**
  4077. * Retrieves an instance from a packed array.
  4078. * @param array - The packed array.
  4079. * @param [startingIndex = 0] - The starting index of the element to be unpacked.
  4080. * @param [result] - The object into which to store the result.
  4081. * @returns The modified result parameter or a new CorridorOutlineGeometry instance if one was not provided.
  4082. */
  4083. unpack(array: number[], startingIndex?: number, result?: CorridorOutlineGeometry): CorridorOutlineGeometry;
  4084. /**
  4085. * Computes the geometric representation of a corridor, including its vertices, indices, and a bounding sphere.
  4086. * @param corridorOutlineGeometry - A description of the corridor.
  4087. * @returns The computed vertices and indices.
  4088. */
  4089. createGeometry(corridorOutlineGeometry: CorridorOutlineGeometry): Geometry | undefined;
  4090. }
  4091. /**
  4092. * A credit contains data pertaining to how to display attributions/credits for certain content on the screen.
  4093. * @example
  4094. * //Create a credit with a tooltip, image and link
  4095. * @param html - An string representing an html code snippet
  4096. * @param [showOnScreen = false] - If true, the credit will be visible in the main credit container. Otherwise, it will appear in a popover
  4097. */
  4098. export class Credit {
  4099. constructor(html: string, showOnScreen?: boolean);
  4100. /**
  4101. * The credit content
  4102. */
  4103. readonly html: string;
  4104. /**
  4105. * Whether the credit should be displayed on screen or in a lightbox
  4106. */
  4107. showOnScreen: boolean;
  4108. /**
  4109. * Gets the credit element
  4110. */
  4111. readonly element: HTMLElement;
  4112. /**
  4113. * Returns true if the credits are equal
  4114. * @param left - The first credit
  4115. * @param right - The second credit
  4116. * @returns <code>true</code> if left and right are equal, <code>false</code> otherwise.
  4117. */
  4118. equals(left: Credit, right: Credit): boolean;
  4119. /**
  4120. * Returns true if the credits are equal
  4121. * @param credit - The credit to compare to.
  4122. * @returns <code>true</code> if left and right are equal, <code>false</code> otherwise.
  4123. */
  4124. equals(credit: Credit): boolean;
  4125. /**
  4126. * Duplicates a Credit instance.
  4127. * @param [credit] - The Credit to duplicate.
  4128. * @returns A new Credit instance that is a duplicate of the one provided. (Returns undefined if the credit is undefined)
  4129. */
  4130. clone(credit?: Credit): Credit;
  4131. }
  4132. /**
  4133. * Defines functions for 3rd order polynomial functions of one variable with only real coefficients.
  4134. */
  4135. export namespace CubicRealPolynomial {
  4136. /**
  4137. * Provides the discriminant of the cubic equation from the supplied coefficients.
  4138. * @param a - The coefficient of the 3rd order monomial.
  4139. * @param b - The coefficient of the 2nd order monomial.
  4140. * @param c - The coefficient of the 1st order monomial.
  4141. * @param d - The coefficient of the 0th order monomial.
  4142. * @returns The value of the discriminant.
  4143. */
  4144. function computeDiscriminant(a: number, b: number, c: number, d: number): number;
  4145. /**
  4146. * Provides the real valued roots of the cubic polynomial with the provided coefficients.
  4147. * @param a - The coefficient of the 3rd order monomial.
  4148. * @param b - The coefficient of the 2nd order monomial.
  4149. * @param c - The coefficient of the 1st order monomial.
  4150. * @param d - The coefficient of the 0th order monomial.
  4151. * @returns The real valued roots.
  4152. */
  4153. function computeRealRoots(a: number, b: number, c: number, d: number): number[];
  4154. }
  4155. /**
  4156. * The culling volume defined by planes.
  4157. * @param [planes] - An array of clipping planes.
  4158. */
  4159. export class CullingVolume {
  4160. constructor(planes?: Cartesian4[]);
  4161. /**
  4162. * Each plane is represented by a Cartesian4 object, where the x, y, and z components
  4163. * define the unit vector normal to the plane, and the w component is the distance of the
  4164. * plane from the origin.
  4165. */
  4166. planes: Cartesian4[];
  4167. /**
  4168. * Constructs a culling volume from a bounding sphere. Creates six planes that create a box containing the sphere.
  4169. * The planes are aligned to the x, y, and z axes in world coordinates.
  4170. * @param boundingSphere - The bounding sphere used to create the culling volume.
  4171. * @param [result] - The object onto which to store the result.
  4172. * @returns The culling volume created from the bounding sphere.
  4173. */
  4174. fromBoundingSphere(boundingSphere: BoundingSphere, result?: CullingVolume): CullingVolume;
  4175. /**
  4176. * Determines whether a bounding volume intersects the culling volume.
  4177. * @param boundingVolume - The bounding volume whose intersection with the culling volume is to be tested.
  4178. * @returns Intersect.OUTSIDE, Intersect.INTERSECTING, or Intersect.INSIDE.
  4179. */
  4180. computeVisibility(boundingVolume: any): Intersect;
  4181. }
  4182. /**
  4183. * A description of a cylinder.
  4184. * @example
  4185. * // create cylinder geometry
  4186. * const cylinder = new SuperMap.CylinderGeometry({
  4187. * length: 200000,
  4188. * topRadius: 80000,
  4189. * bottomRadius: 200000,
  4190. * });
  4191. * const geometry = SuperMap.CylinderGeometry.createGeometry(cylinder);
  4192. * @param options - Object with the following properties:
  4193. * @param options.length - The length of the cylinder.
  4194. * @param options.topRadius - The radius of the top of the cylinder.
  4195. * @param options.bottomRadius - The radius of the bottom of the cylinder.
  4196. * @param [options.slices = 128] - The number of edges around the perimeter of the cylinder.
  4197. * @param [options.vertexFormat = VertexFormat.DEFAULT] - The vertex attributes to be computed.
  4198. */
  4199. export class CylinderGeometry {
  4200. constructor(options: {
  4201. length: number;
  4202. topRadius: number;
  4203. bottomRadius: number;
  4204. slices?: number;
  4205. vertexFormat?: VertexFormat;
  4206. });
  4207. /**
  4208. * The number of elements used to pack the object into an array.
  4209. */
  4210. packedLength: number;
  4211. /**
  4212. * Stores the provided instance into the provided array.
  4213. * @param value - The value to pack.
  4214. * @param array - The array to pack into.
  4215. * @param [startingIndex = 0] - The index into the array at which to start packing the elements.
  4216. * @returns The array that was packed into
  4217. */
  4218. pack(value: CylinderGeometry, array: number[], startingIndex?: number): number[];
  4219. /**
  4220. * Retrieves an instance from a packed array.
  4221. * @param array - The packed array.
  4222. * @param [startingIndex = 0] - The starting index of the element to be unpacked.
  4223. * @param [result] - The object into which to store the result.
  4224. * @returns The modified result parameter or a new CylinderGeometry instance if one was not provided.
  4225. */
  4226. unpack(array: number[], startingIndex?: number, result?: CylinderGeometry): CylinderGeometry;
  4227. /**
  4228. * Computes the geometric representation of a cylinder, including its vertices, indices, and a bounding sphere.
  4229. * @param cylinderGeometry - A description of the cylinder.
  4230. * @returns The computed vertices and indices.
  4231. */
  4232. createGeometry(cylinderGeometry: CylinderGeometry): Geometry | undefined;
  4233. }
  4234. /**
  4235. * A description of the outline of a cylinder.
  4236. * @example
  4237. * // create cylinder geometry
  4238. * const cylinder = new SuperMap.CylinderOutlineGeometry({
  4239. * length: 200000,
  4240. * topRadius: 80000,
  4241. * bottomRadius: 200000,
  4242. * });
  4243. * const geometry = SuperMap.CylinderOutlineGeometry.createGeometry(cylinder);
  4244. * @param options - Object with the following properties:
  4245. * @param options.length - The length of the cylinder.
  4246. * @param options.topRadius - The radius of the top of the cylinder.
  4247. * @param options.bottomRadius - The radius of the bottom of the cylinder.
  4248. * @param [options.slices = 128] - The number of edges around the perimeter of the cylinder.
  4249. * @param [options.numberOfVerticalLines = 16] - Number of lines to draw between the top and bottom surfaces of the cylinder.
  4250. */
  4251. export class CylinderOutlineGeometry {
  4252. constructor(options: {
  4253. length: number;
  4254. topRadius: number;
  4255. bottomRadius: number;
  4256. slices?: number;
  4257. numberOfVerticalLines?: number;
  4258. });
  4259. /**
  4260. * The number of elements used to pack the object into an array.
  4261. */
  4262. packedLength: number;
  4263. /**
  4264. * Stores the provided instance into the provided array.
  4265. * @param value - The value to pack.
  4266. * @param array - The array to pack into.
  4267. * @param [startingIndex = 0] - The index into the array at which to start packing the elements.
  4268. * @returns The array that was packed into
  4269. */
  4270. pack(value: CylinderOutlineGeometry, array: number[], startingIndex?: number): number[];
  4271. /**
  4272. * Retrieves an instance from a packed array.
  4273. * @param array - The packed array.
  4274. * @param [startingIndex = 0] - The starting index of the element to be unpacked.
  4275. * @param [result] - The object into which to store the result.
  4276. * @returns The modified result parameter or a new CylinderOutlineGeometry instance if one was not provided.
  4277. */
  4278. unpack(array: number[], startingIndex?: number, result?: CylinderOutlineGeometry): CylinderOutlineGeometry;
  4279. /**
  4280. * Computes the geometric representation of an outline of a cylinder, including its vertices, indices, and a bounding sphere.
  4281. * @param cylinderGeometry - A description of the cylinder outline.
  4282. * @returns The computed vertices and indices.
  4283. */
  4284. createGeometry(cylinderGeometry: CylinderOutlineGeometry): Geometry | undefined;
  4285. }
  4286. /**
  4287. * A simple proxy that appends the desired resource as the sole query parameter
  4288. * to the given proxy URL.
  4289. * @param proxy - The proxy URL that will be used to requests all resources.
  4290. */
  4291. export class DefaultProxy extends Proxy {
  4292. constructor(proxy: string);
  4293. /**
  4294. * Get the final URL to use to request a given resource.
  4295. * @param resource - The resource to request.
  4296. * @returns proxied resource
  4297. */
  4298. getURL(resource: string): string;
  4299. }
  4300. /**
  4301. * Constructs an exception object that is thrown due to a developer error, e.g., invalid argument,
  4302. * argument out of range, etc. This exception should only be thrown during development;
  4303. * it usually indicates a bug in the calling code. This exception should never be
  4304. * caught; instead the calling code should strive not to generate it.
  4305. * <br /><br />
  4306. * On the other hand, a {@link RuntimeError} indicates an exception that may
  4307. * be thrown at runtime, e.g., out of memory, that the calling code should be prepared
  4308. * to catch.
  4309. * @param [message] - The error message for this exception.
  4310. */
  4311. export class DeveloperError extends Error {
  4312. constructor(message?: string);
  4313. /**
  4314. * 'DeveloperError' indicating that this exception was thrown due to a developer error.
  4315. */
  4316. readonly name: string;
  4317. /**
  4318. * The explanation for why this exception was thrown.
  4319. */
  4320. readonly message: string;
  4321. /**
  4322. * The stack trace of this exception, if available.
  4323. */
  4324. readonly stack: string;
  4325. }
  4326. /**
  4327. * Determines visibility based on the distance to the camera.
  4328. * @example
  4329. * // Make a billboard that is only visible when the distance to the camera is between 10 and 20 meters.
  4330. * billboard.distanceDisplayCondition = new SuperMap.DistanceDisplayCondition(10.0, 20.0);
  4331. * @param [near = 0.0] - The smallest distance in the interval where the object is visible.
  4332. * @param [far = Number.MAX_VALUE] - The largest distance in the interval where the object is visible.
  4333. */
  4334. export class DistanceDisplayCondition {
  4335. constructor(near?: number, far?: number);
  4336. /**
  4337. * The smallest distance in the interval where the object is visible.
  4338. */
  4339. near: number;
  4340. /**
  4341. * The largest distance in the interval where the object is visible.
  4342. */
  4343. far: number;
  4344. /**
  4345. * The number of elements used to pack the object into an array.
  4346. */
  4347. packedLength: number;
  4348. /**
  4349. * Stores the provided instance into the provided array.
  4350. * @param value - The value to pack.
  4351. * @param array - The array to pack into.
  4352. * @param [startingIndex = 0] - The index into the array at which to start packing the elements.
  4353. * @returns The array that was packed into
  4354. */
  4355. pack(value: DistanceDisplayCondition, array: number[], startingIndex?: number): number[];
  4356. /**
  4357. * Retrieves an instance from a packed array.
  4358. * @param array - The packed array.
  4359. * @param [startingIndex = 0] - The starting index of the element to be unpacked.
  4360. * @param [result] - The object into which to store the result.
  4361. * @returns The modified result parameter or a new DistanceDisplayCondition instance if one was not provided.
  4362. */
  4363. unpack(array: number[], startingIndex?: number, result?: DistanceDisplayCondition): DistanceDisplayCondition;
  4364. /**
  4365. * Determines if two distance display conditions are equal.
  4366. * @param left - A distance display condition.
  4367. * @param right - Another distance display condition.
  4368. * @returns Whether the two distance display conditions are equal.
  4369. */
  4370. equals(left: DistanceDisplayCondition, right: DistanceDisplayCondition): boolean;
  4371. /**
  4372. * Duplicates a distance display condition instance.
  4373. * @param [value] - The distance display condition to duplicate.
  4374. * @param [result] - The result onto which to store the result.
  4375. * @returns The duplicated instance.
  4376. */
  4377. clone(value?: DistanceDisplayCondition, result?: DistanceDisplayCondition): DistanceDisplayCondition;
  4378. /**
  4379. * Duplicates this instance.
  4380. * @param [result] - The result onto which to store the result.
  4381. * @returns The duplicated instance.
  4382. */
  4383. clone(result?: DistanceDisplayCondition): DistanceDisplayCondition;
  4384. /**
  4385. * Determines if this distance display condition is equal to another.
  4386. * @param other - Another distance display condition.
  4387. * @returns Whether this distance display condition is equal to the other.
  4388. */
  4389. equals(other: DistanceDisplayCondition): boolean;
  4390. }
  4391. /**
  4392. * Value and type information for per-instance geometry attribute that determines if the geometry instance has a distance display condition.
  4393. * @example
  4394. * const instance = new SuperMap.GeometryInstance({
  4395. * geometry : new SuperMap.BoxGeometry({
  4396. * vertexFormat : SuperMap.VertexFormat.POSITION_AND_NORMAL,
  4397. * minimum : new SuperMap.Cartesian3(-250000.0, -250000.0, -250000.0),
  4398. * maximum : new SuperMap.Cartesian3(250000.0, 250000.0, 250000.0)
  4399. * }),
  4400. * modelMatrix : SuperMap.Matrix4.multiplyByTranslation(SuperMap.Transforms.eastNorthUpToFixedFrame(
  4401. * SuperMap.Cartesian3.fromDegrees(-75.59777, 40.03883)), new SuperMap.Cartesian3(0.0, 0.0, 1000000.0), new SuperMap.Matrix4()),
  4402. * id : 'box',
  4403. * attributes : {
  4404. * distanceDisplayCondition : new SuperMap.DistanceDisplayConditionGeometryInstanceAttribute(100.0, 10000.0)
  4405. * }
  4406. * });
  4407. * @param [near = 0.0] - The near distance.
  4408. * @param [far = Number.MAX_VALUE] - The far distance.
  4409. */
  4410. export class DistanceDisplayConditionGeometryInstanceAttribute {
  4411. constructor(near?: number, far?: number);
  4412. /**
  4413. * The values for the attributes stored in a typed array.
  4414. */
  4415. value: Float32Array;
  4416. /**
  4417. * The datatype of each component in the attribute, e.g., individual elements in
  4418. * {@link DistanceDisplayConditionGeometryInstanceAttribute#value}.
  4419. */
  4420. readonly componentDatatype: ComponentDatatype;
  4421. /**
  4422. * The number of components in the attributes, i.e., {@link DistanceDisplayConditionGeometryInstanceAttribute#value}.
  4423. */
  4424. readonly componentsPerAttribute: number;
  4425. /**
  4426. * When <code>true</code> and <code>componentDatatype</code> is an integer format,
  4427. * indicate that the components should be mapped to the range [0, 1] (unsigned)
  4428. * or [-1, 1] (signed) when they are accessed as floating-point for rendering.
  4429. */
  4430. readonly normalize: boolean;
  4431. /**
  4432. * Creates a new {@link DistanceDisplayConditionGeometryInstanceAttribute} instance given the provided an enabled flag and {@link DistanceDisplayCondition}.
  4433. * @example
  4434. * const distanceDisplayCondition = new SuperMap.DistanceDisplayCondition(100.0, 10000.0);
  4435. * const instance = new SuperMap.GeometryInstance({
  4436. * geometry : geometry,
  4437. * attributes : {
  4438. * distanceDisplayCondition : SuperMap.DistanceDisplayConditionGeometryInstanceAttribute.fromDistanceDisplayCondition(distanceDisplayCondition)
  4439. * }
  4440. * });
  4441. * @param distanceDisplayCondition - The distance display condition.
  4442. * @returns The new {@link DistanceDisplayConditionGeometryInstanceAttribute} instance.
  4443. */
  4444. fromDistanceDisplayCondition(distanceDisplayCondition: DistanceDisplayCondition): DistanceDisplayConditionGeometryInstanceAttribute;
  4445. /**
  4446. * Converts a distance display condition to a typed array that can be used to assign a distance display condition attribute.
  4447. * @example
  4448. * const attributes = primitive.getGeometryInstanceAttributes('an id');
  4449. * attributes.distanceDisplayCondition = SuperMap.DistanceDisplayConditionGeometryInstanceAttribute.toValue(distanceDisplayCondition, attributes.distanceDisplayCondition);
  4450. * @param distanceDisplayCondition - The distance display condition value.
  4451. * @param [result] - The array to store the result in, if undefined a new instance will be created.
  4452. * @returns The modified result parameter or a new instance if result was undefined.
  4453. */
  4454. toValue(distanceDisplayCondition: DistanceDisplayCondition, result?: Float32Array): Float32Array;
  4455. }
  4456. /**
  4457. * Easing functions for use with TweenCollection. These function are from
  4458. */
  4459. export namespace EasingFunction {
  4460. /**
  4461. * Linear easing.
  4462. */
  4463. const LINEAR_NONE: EasingFunction.Callback;
  4464. /**
  4465. * Quadratic in.
  4466. */
  4467. const QUADRATIC_IN: EasingFunction.Callback;
  4468. /**
  4469. * Quadratic out.
  4470. */
  4471. const QUADRATIC_OUT: EasingFunction.Callback;
  4472. /**
  4473. * Quadratic in then out.
  4474. */
  4475. const QUADRATIC_IN_OUT: EasingFunction.Callback;
  4476. /**
  4477. * Cubic in.
  4478. */
  4479. const CUBIC_IN: EasingFunction.Callback;
  4480. /**
  4481. * Cubic out.
  4482. */
  4483. const CUBIC_OUT: EasingFunction.Callback;
  4484. /**
  4485. * Cubic in then out.
  4486. */
  4487. const CUBIC_IN_OUT: EasingFunction.Callback;
  4488. /**
  4489. * Quartic in.
  4490. */
  4491. const QUARTIC_IN: EasingFunction.Callback;
  4492. /**
  4493. * Quartic out.
  4494. */
  4495. const QUARTIC_OUT: EasingFunction.Callback;
  4496. /**
  4497. * Quartic in then out.
  4498. */
  4499. const QUARTIC_IN_OUT: EasingFunction.Callback;
  4500. /**
  4501. * Quintic in.
  4502. */
  4503. const QUINTIC_IN: EasingFunction.Callback;
  4504. /**
  4505. * Quintic out.
  4506. */
  4507. const QUINTIC_OUT: EasingFunction.Callback;
  4508. /**
  4509. * Quintic in then out.
  4510. */
  4511. const QUINTIC_IN_OUT: EasingFunction.Callback;
  4512. /**
  4513. * Sinusoidal in.
  4514. */
  4515. const SINUSOIDAL_IN: EasingFunction.Callback;
  4516. /**
  4517. * Sinusoidal out.
  4518. */
  4519. const SINUSOIDAL_OUT: EasingFunction.Callback;
  4520. /**
  4521. * Sinusoidal in then out.
  4522. */
  4523. const SINUSOIDAL_IN_OUT: EasingFunction.Callback;
  4524. /**
  4525. * Exponential in.
  4526. */
  4527. const EXPONENTIAL_IN: EasingFunction.Callback;
  4528. /**
  4529. * Exponential out.
  4530. */
  4531. const EXPONENTIAL_OUT: EasingFunction.Callback;
  4532. /**
  4533. * Exponential in then out.
  4534. */
  4535. const EXPONENTIAL_IN_OUT: EasingFunction.Callback;
  4536. /**
  4537. * Circular in.
  4538. */
  4539. const CIRCULAR_IN: EasingFunction.Callback;
  4540. /**
  4541. * Circular out.
  4542. */
  4543. const CIRCULAR_OUT: EasingFunction.Callback;
  4544. /**
  4545. * Circular in then out.
  4546. */
  4547. const CIRCULAR_IN_OUT: EasingFunction.Callback;
  4548. /**
  4549. * Elastic in.
  4550. */
  4551. const ELASTIC_IN: EasingFunction.Callback;
  4552. /**
  4553. * Elastic out.
  4554. */
  4555. const ELASTIC_OUT: EasingFunction.Callback;
  4556. /**
  4557. * Elastic in then out.
  4558. */
  4559. const ELASTIC_IN_OUT: EasingFunction.Callback;
  4560. /**
  4561. * Back in.
  4562. */
  4563. const BACK_IN: EasingFunction.Callback;
  4564. /**
  4565. * Back out.
  4566. */
  4567. const BACK_OUT: EasingFunction.Callback;
  4568. /**
  4569. * Back in then out.
  4570. */
  4571. const BACK_IN_OUT: EasingFunction.Callback;
  4572. /**
  4573. * Bounce in.
  4574. */
  4575. const BOUNCE_IN: EasingFunction.Callback;
  4576. /**
  4577. * Bounce out.
  4578. */
  4579. const BOUNCE_OUT: EasingFunction.Callback;
  4580. /**
  4581. * Bounce in then out.
  4582. */
  4583. const BOUNCE_IN_OUT: EasingFunction.Callback;
  4584. /**
  4585. * Function interface for implementing a custom easing function.
  4586. * @example
  4587. * function quadraticIn(time) {
  4588. * return time * time;
  4589. * }
  4590. * @example
  4591. * function quadraticOut(time) {
  4592. * return time * (2.0 - time);
  4593. * }
  4594. * @param time - The time in the range <code>[0, 1]</code>.
  4595. */
  4596. type Callback = (time: number) => number;
  4597. }
  4598. /**
  4599. * A description of an ellipse on an ellipsoid. Ellipse geometry can be rendered with both {@link Primitive} and {@link GroundPrimitive}.
  4600. * @example
  4601. * // Create an ellipse.
  4602. * const ellipse = new SuperMap.EllipseGeometry({
  4603. * center : SuperMap.Cartesian3.fromDegrees(-75.59777, 40.03883),
  4604. * semiMajorAxis : 500000.0,
  4605. * semiMinorAxis : 300000.0,
  4606. * rotation : SuperMap.Math.toRadians(60.0)
  4607. * });
  4608. * const geometry = SuperMap.EllipseGeometry.createGeometry(ellipse);
  4609. * @param options - Object with the following properties:
  4610. * @param options.center - The ellipse's center point in the fixed frame.
  4611. * @param options.semiMajorAxis - The length of the ellipse's semi-major axis in meters.
  4612. * @param options.semiMinorAxis - The length of the ellipse's semi-minor axis in meters.
  4613. * @param [options.ellipsoid = Ellipsoid.WGS84] - The ellipsoid the ellipse will be on.
  4614. * @param [options.height = 0.0] - The distance in meters between the ellipse and the ellipsoid surface.
  4615. * @param [options.extrudedHeight] - The distance in meters between the ellipse's extruded face and the ellipsoid surface.
  4616. * @param [options.rotation = 0.0] - The angle of rotation counter-clockwise from north.
  4617. * @param [options.stRotation = 0.0] - The rotation of the texture coordinates counter-clockwise from north.
  4618. * @param [options.granularity = Math.RADIANS_PER_DEGREE] - The angular distance between points on the ellipse in radians.
  4619. * @param [options.vertexFormat = VertexFormat.DEFAULT] - The vertex attributes to be computed.
  4620. */
  4621. export class EllipseGeometry {
  4622. constructor(options: {
  4623. center: Cartesian3;
  4624. semiMajorAxis: number;
  4625. semiMinorAxis: number;
  4626. ellipsoid?: Ellipsoid;
  4627. height?: number;
  4628. extrudedHeight?: number;
  4629. rotation?: number;
  4630. stRotation?: number;
  4631. granularity?: number;
  4632. vertexFormat?: VertexFormat;
  4633. });
  4634. /**
  4635. * The number of elements used to pack the object into an array.
  4636. */
  4637. packedLength: number;
  4638. /**
  4639. * Stores the provided instance into the provided array.
  4640. * @param value - The value to pack.
  4641. * @param array - The array to pack into.
  4642. * @param [startingIndex = 0] - The index into the array at which to start packing the elements.
  4643. * @returns The array that was packed into
  4644. */
  4645. pack(value: EllipseGeometry, array: number[], startingIndex?: number): number[];
  4646. /**
  4647. * Retrieves an instance from a packed array.
  4648. * @param array - The packed array.
  4649. * @param [startingIndex = 0] - The starting index of the element to be unpacked.
  4650. * @param [result] - The object into which to store the result.
  4651. * @returns The modified result parameter or a new EllipseGeometry instance if one was not provided.
  4652. */
  4653. unpack(array: number[], startingIndex?: number, result?: EllipseGeometry): EllipseGeometry;
  4654. /**
  4655. * Computes the bounding rectangle based on the provided options
  4656. * @param options - Object with the following properties:
  4657. * @param options.center - The ellipse's center point in the fixed frame.
  4658. * @param options.semiMajorAxis - The length of the ellipse's semi-major axis in meters.
  4659. * @param options.semiMinorAxis - The length of the ellipse's semi-minor axis in meters.
  4660. * @param [options.ellipsoid = Ellipsoid.WGS84] - The ellipsoid the ellipse will be on.
  4661. * @param [options.rotation = 0.0] - The angle of rotation counter-clockwise from north.
  4662. * @param [options.granularity = Math.RADIANS_PER_DEGREE] - The angular distance between points on the ellipse in radians.
  4663. * @param [result] - An object in which to store the result
  4664. * @returns The result rectangle
  4665. */
  4666. computeRectangle(options: {
  4667. center: Cartesian3;
  4668. semiMajorAxis: number;
  4669. semiMinorAxis: number;
  4670. ellipsoid?: Ellipsoid;
  4671. rotation?: number;
  4672. granularity?: number;
  4673. }, result?: Rectangle): Rectangle;
  4674. /**
  4675. * Computes the geometric representation of a ellipse on an ellipsoid, including its vertices, indices, and a bounding sphere.
  4676. * @param ellipseGeometry - A description of the ellipse.
  4677. * @returns The computed vertices and indices.
  4678. */
  4679. createGeometry(ellipseGeometry: EllipseGeometry): Geometry | undefined;
  4680. }
  4681. /**
  4682. * A description of the outline of an ellipse on an ellipsoid.
  4683. * @example
  4684. * const ellipse = new SuperMap.EllipseOutlineGeometry({
  4685. * center : SuperMap.Cartesian3.fromDegrees(-75.59777, 40.03883),
  4686. * semiMajorAxis : 500000.0,
  4687. * semiMinorAxis : 300000.0,
  4688. * rotation : SuperMap.Math.toRadians(60.0)
  4689. * });
  4690. * const geometry = SuperMap.EllipseOutlineGeometry.createGeometry(ellipse);
  4691. * @param options - Object with the following properties:
  4692. * @param options.center - The ellipse's center point in the fixed frame.
  4693. * @param options.semiMajorAxis - The length of the ellipse's semi-major axis in meters.
  4694. * @param options.semiMinorAxis - The length of the ellipse's semi-minor axis in meters.
  4695. * @param [options.ellipsoid = Ellipsoid.WGS84] - The ellipsoid the ellipse will be on.
  4696. * @param [options.height = 0.0] - The distance in meters between the ellipse and the ellipsoid surface.
  4697. * @param [options.extrudedHeight] - The distance in meters between the ellipse's extruded face and the ellipsoid surface.
  4698. * @param [options.rotation = 0.0] - The angle from north (counter-clockwise) in radians.
  4699. * @param [options.granularity = 0.02] - The angular distance between points on the ellipse in radians.
  4700. * @param [options.numberOfVerticalLines = 16] - Number of lines to draw between the top and bottom surface of an extruded ellipse.
  4701. */
  4702. export class EllipseOutlineGeometry {
  4703. constructor(options: {
  4704. center: Cartesian3;
  4705. semiMajorAxis: number;
  4706. semiMinorAxis: number;
  4707. ellipsoid?: Ellipsoid;
  4708. height?: number;
  4709. extrudedHeight?: number;
  4710. rotation?: number;
  4711. granularity?: number;
  4712. numberOfVerticalLines?: number;
  4713. });
  4714. /**
  4715. * The number of elements used to pack the object into an array.
  4716. */
  4717. packedLength: number;
  4718. /**
  4719. * Stores the provided instance into the provided array.
  4720. * @param value - The value to pack.
  4721. * @param array - The array to pack into.
  4722. * @param [startingIndex = 0] - The index into the array at which to start packing the elements.
  4723. * @returns The array that was packed into
  4724. */
  4725. pack(value: EllipseOutlineGeometry, array: number[], startingIndex?: number): number[];
  4726. /**
  4727. * Retrieves an instance from a packed array.
  4728. * @param array - The packed array.
  4729. * @param [startingIndex = 0] - The starting index of the element to be unpacked.
  4730. * @param [result] - The object into which to store the result.
  4731. * @returns The modified result parameter or a new EllipseOutlineGeometry instance if one was not provided.
  4732. */
  4733. unpack(array: number[], startingIndex?: number, result?: EllipseOutlineGeometry): EllipseOutlineGeometry;
  4734. /**
  4735. * Computes the geometric representation of an outline of an ellipse on an ellipsoid, including its vertices, indices, and a bounding sphere.
  4736. * @param ellipseGeometry - A description of the ellipse.
  4737. * @returns The computed vertices and indices.
  4738. */
  4739. createGeometry(ellipseGeometry: EllipseOutlineGeometry): Geometry | undefined;
  4740. }
  4741. /**
  4742. * A quadratic surface defined in Cartesian coordinates by the equation
  4743. * <code>(x / a)^2 + (y / b)^2 + (z / c)^2 = 1</code>. Primarily used
  4744. * by SuperMap to represent the shape of planetary bodies.
  4745. *
  4746. * Rather than constructing this object directly, one of the provided
  4747. * constants is normally used.
  4748. * @param [x = 0] - The radius in the x direction.
  4749. * @param [y = 0] - The radius in the y direction.
  4750. * @param [z = 0] - The radius in the z direction.
  4751. */
  4752. export class Ellipsoid {
  4753. constructor(x?: number, y?: number, z?: number);
  4754. /**
  4755. * Gets the radii of the ellipsoid.
  4756. */
  4757. readonly radii: Cartesian3;
  4758. /**
  4759. * Gets the squared radii of the ellipsoid.
  4760. */
  4761. readonly radiiSquared: Cartesian3;
  4762. /**
  4763. * Gets the radii of the ellipsoid raise to the fourth power.
  4764. */
  4765. readonly radiiToTheFourth: Cartesian3;
  4766. /**
  4767. * Gets one over the radii of the ellipsoid.
  4768. */
  4769. readonly oneOverRadii: Cartesian3;
  4770. /**
  4771. * Gets one over the squared radii of the ellipsoid.
  4772. */
  4773. readonly oneOverRadiiSquared: Cartesian3;
  4774. /**
  4775. * Gets the minimum radius of the ellipsoid.
  4776. */
  4777. readonly minimumRadius: number;
  4778. /**
  4779. * Gets the maximum radius of the ellipsoid.
  4780. */
  4781. readonly maximumRadius: number;
  4782. /**
  4783. * Duplicates an Ellipsoid instance.
  4784. * @param ellipsoid - The ellipsoid to duplicate.
  4785. * @param [result] - The object onto which to store the result, or undefined if a new
  4786. * instance should be created.
  4787. * @returns The cloned Ellipsoid. (Returns undefined if ellipsoid is undefined)
  4788. */
  4789. clone(ellipsoid: Ellipsoid, result?: Ellipsoid): Ellipsoid;
  4790. /**
  4791. * Computes an Ellipsoid from a Cartesian specifying the radii in x, y, and z directions.
  4792. * @param [cartesian = Cartesian3.ZERO] - The ellipsoid's radius in the x, y, and z directions.
  4793. * @param [result] - The object onto which to store the result, or undefined if a new
  4794. * instance should be created.
  4795. * @returns A new Ellipsoid instance.
  4796. */
  4797. fromCartesian3(cartesian?: Cartesian3, result?: Ellipsoid): Ellipsoid;
  4798. /**
  4799. * An Ellipsoid instance initialized to the WGS84 standard.
  4800. */
  4801. readonly WGS84: Ellipsoid;
  4802. /**
  4803. * An Ellipsoid instance initialized to radii of (1.0, 1.0, 1.0).
  4804. */
  4805. readonly UNIT_SPHERE: Ellipsoid;
  4806. /**
  4807. * An Ellipsoid instance initialized to a sphere with the lunar radius.
  4808. */
  4809. readonly MOON: Ellipsoid;
  4810. /**
  4811. * Duplicates an Ellipsoid instance.
  4812. * @param [result] - The object onto which to store the result, or undefined if a new
  4813. * instance should be created.
  4814. * @returns The cloned Ellipsoid.
  4815. */
  4816. clone(result?: Ellipsoid): Ellipsoid;
  4817. /**
  4818. * The number of elements used to pack the object into an array.
  4819. */
  4820. packedLength: number;
  4821. /**
  4822. * Stores the provided instance into the provided array.
  4823. * @param value - The value to pack.
  4824. * @param array - The array to pack into.
  4825. * @param [startingIndex = 0] - The index into the array at which to start packing the elements.
  4826. * @returns The array that was packed into
  4827. */
  4828. pack(value: Ellipsoid, array: number[], startingIndex?: number): number[];
  4829. /**
  4830. * Retrieves an instance from a packed array.
  4831. * @param array - The packed array.
  4832. * @param [startingIndex = 0] - The starting index of the element to be unpacked.
  4833. * @param [result] - The object into which to store the result.
  4834. * @returns The modified result parameter or a new Ellipsoid instance if one was not provided.
  4835. */
  4836. unpack(array: number[], startingIndex?: number, result?: Ellipsoid): Ellipsoid;
  4837. /**
  4838. * Computes the unit vector directed from the center of this ellipsoid toward the provided Cartesian position.
  4839. * @param cartesian - The Cartesian for which to to determine the geocentric normal.
  4840. * @param [result] - The object onto which to store the result.
  4841. * @returns The modified result parameter or a new Cartesian3 instance if none was provided.
  4842. */
  4843. geocentricSurfaceNormal(cartesian: Cartesian3, result?: Cartesian3): Cartesian3;
  4844. /**
  4845. * Computes the normal of the plane tangent to the surface of the ellipsoid at the provided position.
  4846. * @param cartographic - The cartographic position for which to to determine the geodetic normal.
  4847. * @param [result] - The object onto which to store the result.
  4848. * @returns The modified result parameter or a new Cartesian3 instance if none was provided.
  4849. */
  4850. geodeticSurfaceNormalCartographic(cartographic: Cartographic, result?: Cartesian3): Cartesian3;
  4851. /**
  4852. * Computes the normal of the plane tangent to the surface of the ellipsoid at the provided position.
  4853. * @param cartesian - The Cartesian position for which to to determine the surface normal.
  4854. * @param [result] - The object onto which to store the result.
  4855. * @returns The modified result parameter or a new Cartesian3 instance if none was provided, or undefined if a normal cannot be found.
  4856. */
  4857. geodeticSurfaceNormal(cartesian: Cartesian3, result?: Cartesian3): Cartesian3;
  4858. /**
  4859. * Converts the provided cartographic to Cartesian representation.
  4860. * @example
  4861. * //Create a Cartographic and determine it's Cartesian representation on a WGS84 ellipsoid.
  4862. * const position = new SuperMap.Cartographic(SuperMap.Math.toRadians(21), SuperMap.Math.toRadians(78), 5000);
  4863. * const cartesianPosition = SuperMap.Ellipsoid.WGS84.cartographicToCartesian(position);
  4864. * @param cartographic - The cartographic position.
  4865. * @param [result] - The object onto which to store the result.
  4866. * @returns The modified result parameter or a new Cartesian3 instance if none was provided.
  4867. */
  4868. cartographicToCartesian(cartographic: Cartographic, result?: Cartesian3): Cartesian3;
  4869. /**
  4870. * Converts the provided array of cartographics to an array of Cartesians.
  4871. * @example
  4872. * //Convert an array of Cartographics and determine their Cartesian representation on a WGS84 ellipsoid.
  4873. * const positions = [new SuperMap.Cartographic(SuperMap.Math.toRadians(21), SuperMap.Math.toRadians(78), 0),
  4874. * new SuperMap.Cartographic(SuperMap.Math.toRadians(21.321), SuperMap.Math.toRadians(78.123), 100),
  4875. * new SuperMap.Cartographic(SuperMap.Math.toRadians(21.645), SuperMap.Math.toRadians(78.456), 250)];
  4876. * const cartesianPositions = SuperMap.Ellipsoid.WGS84.cartographicArrayToCartesianArray(positions);
  4877. * @param cartographics - An array of cartographic positions.
  4878. * @param [result] - The object onto which to store the result.
  4879. * @returns The modified result parameter or a new Array instance if none was provided.
  4880. */
  4881. cartographicArrayToCartesianArray(cartographics: Cartographic[], result?: Cartesian3[]): Cartesian3[];
  4882. /**
  4883. * Converts the provided cartesian to cartographic representation.
  4884. * The cartesian is undefined at the center of the ellipsoid.
  4885. * @example
  4886. * //Create a Cartesian and determine it's Cartographic representation on a WGS84 ellipsoid.
  4887. * const position = new SuperMap.Cartesian3(17832.12, 83234.52, 952313.73);
  4888. * const cartographicPosition = SuperMap.Ellipsoid.WGS84.cartesianToCartographic(position);
  4889. * @param cartesian - The Cartesian position to convert to cartographic representation.
  4890. * @param [result] - The object onto which to store the result.
  4891. * @returns The modified result parameter, new Cartographic instance if none was provided, or undefined if the cartesian is at the center of the ellipsoid.
  4892. */
  4893. cartesianToCartographic(cartesian: Cartesian3, result?: Cartographic): Cartographic;
  4894. /**
  4895. * Converts the provided array of cartesians to an array of cartographics.
  4896. * @example
  4897. * //Create an array of Cartesians and determine their Cartographic representation on a WGS84 ellipsoid.
  4898. * const positions = [new SuperMap.Cartesian3(17832.12, 83234.52, 952313.73),
  4899. * new SuperMap.Cartesian3(17832.13, 83234.53, 952313.73),
  4900. * new SuperMap.Cartesian3(17832.14, 83234.54, 952313.73)]
  4901. * const cartographicPositions = SuperMap.Ellipsoid.WGS84.cartesianArrayToCartographicArray(positions);
  4902. * @param cartesians - An array of Cartesian positions.
  4903. * @param [result] - The object onto which to store the result.
  4904. * @returns The modified result parameter or a new Array instance if none was provided.
  4905. */
  4906. cartesianArrayToCartographicArray(cartesians: Cartesian3[], result?: Cartographic[]): Cartographic[];
  4907. /**
  4908. * Scales the provided Cartesian position along the geodetic surface normal
  4909. * so that it is on the surface of this ellipsoid. If the position is
  4910. * at the center of the ellipsoid, this function returns undefined.
  4911. * @param cartesian - The Cartesian position to scale.
  4912. * @param [result] - The object onto which to store the result.
  4913. * @returns The modified result parameter, a new Cartesian3 instance if none was provided, or undefined if the position is at the center.
  4914. */
  4915. scaleToGeodeticSurface(cartesian: Cartesian3, result?: Cartesian3): Cartesian3;
  4916. /**
  4917. * Scales the provided Cartesian position along the geocentric surface normal
  4918. * so that it is on the surface of this ellipsoid.
  4919. * @param cartesian - The Cartesian position to scale.
  4920. * @param [result] - The object onto which to store the result.
  4921. * @returns The modified result parameter or a new Cartesian3 instance if none was provided.
  4922. */
  4923. scaleToGeocentricSurface(cartesian: Cartesian3, result?: Cartesian3): Cartesian3;
  4924. /**
  4925. * Transforms a Cartesian X, Y, Z position to the ellipsoid-scaled space by multiplying
  4926. * its components by the result of {@link Ellipsoid#oneOverRadii}.
  4927. * @param position - The position to transform.
  4928. * @param [result] - The position to which to copy the result, or undefined to create and
  4929. * return a new instance.
  4930. * @returns The position expressed in the scaled space. The returned instance is the
  4931. * one passed as the result parameter if it is not undefined, or a new instance of it is.
  4932. */
  4933. transformPositionToScaledSpace(position: Cartesian3, result?: Cartesian3): Cartesian3;
  4934. /**
  4935. * Transforms a Cartesian X, Y, Z position from the ellipsoid-scaled space by multiplying
  4936. * its components by the result of {@link Ellipsoid#radii}.
  4937. * @param position - The position to transform.
  4938. * @param [result] - The position to which to copy the result, or undefined to create and
  4939. * return a new instance.
  4940. * @returns The position expressed in the unscaled space. The returned instance is the
  4941. * one passed as the result parameter if it is not undefined, or a new instance of it is.
  4942. */
  4943. transformPositionFromScaledSpace(position: Cartesian3, result?: Cartesian3): Cartesian3;
  4944. /**
  4945. * Compares this Ellipsoid against the provided Ellipsoid componentwise and returns
  4946. * <code>true</code> if they are equal, <code>false</code> otherwise.
  4947. * @param [right] - The other Ellipsoid.
  4948. * @returns <code>true</code> if they are equal, <code>false</code> otherwise.
  4949. */
  4950. equals(right?: Ellipsoid): boolean;
  4951. /**
  4952. * Creates a string representing this Ellipsoid in the format '(radii.x, radii.y, radii.z)'.
  4953. * @returns A string representing this ellipsoid in the format '(radii.x, radii.y, radii.z)'.
  4954. */
  4955. toString(): string;
  4956. /**
  4957. * Computes a point which is the intersection of the surface normal with the z-axis.
  4958. * @param position - the position. must be on the surface of the ellipsoid.
  4959. * @param [buffer = 0.0] - A buffer to subtract from the ellipsoid size when checking if the point is inside the ellipsoid.
  4960. * 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.
  4961. * In WGS84 datum, intersection point is at max z = +-42841.31151331382 (0.673% of z-axis).
  4962. * Intersection point could be outside the ellipsoid if the ratio of MajorAxis / AxisOfRotation is bigger than the square root of 2
  4963. * @param [result] - The cartesian to which to copy the result, or undefined to create and
  4964. * return a new instance.
  4965. * @returns the intersection point if it's inside the ellipsoid, undefined otherwise
  4966. */
  4967. getSurfaceNormalIntersectionWithZAxis(position: Cartesian3, buffer?: number, result?: Cartesian3): Cartesian3 | undefined;
  4968. /**
  4969. * Computes an approximation of the surface area of a rectangle on the surface of an ellipsoid using
  4970. * Gauss-Legendre 10th order quadrature.
  4971. * @param rectangle - The rectangle used for computing the surface area.
  4972. * @returns The approximate area of the rectangle on the surface of this ellipsoid.
  4973. */
  4974. surfaceArea(rectangle: Rectangle): number;
  4975. }
  4976. /**
  4977. * Initializes a geodesic on the ellipsoid connecting the two provided planetodetic points.
  4978. * @param [start] - The initial planetodetic point on the path.
  4979. * @param [end] - The final planetodetic point on the path.
  4980. * @param [ellipsoid = Ellipsoid.WGS84] - The ellipsoid on which the geodesic lies.
  4981. */
  4982. export class EllipsoidGeodesic {
  4983. constructor(start?: Cartographic, end?: Cartographic, ellipsoid?: Ellipsoid);
  4984. /**
  4985. * Gets the ellipsoid.
  4986. */
  4987. readonly ellipsoid: Ellipsoid;
  4988. /**
  4989. * Gets the surface distance between the start and end point
  4990. */
  4991. readonly surfaceDistance: number;
  4992. /**
  4993. * Gets the initial planetodetic point on the path.
  4994. */
  4995. readonly start: Cartographic;
  4996. /**
  4997. * Gets the final planetodetic point on the path.
  4998. */
  4999. readonly end: Cartographic;
  5000. /**
  5001. * Gets the heading at the initial point.
  5002. */
  5003. readonly startHeading: number;
  5004. /**
  5005. * Gets the heading at the final point.
  5006. */
  5007. readonly endHeading: number;
  5008. /**
  5009. * Sets the start and end points of the geodesic
  5010. * @param start - The initial planetodetic point on the path.
  5011. * @param end - The final planetodetic point on the path.
  5012. */
  5013. setEndPoints(start: Cartographic, end: Cartographic): void;
  5014. /**
  5015. * Provides the location of a point at the indicated portion along the geodesic.
  5016. * @param fraction - The portion of the distance between the initial and final points.
  5017. * @param [result] - The object in which to store the result.
  5018. * @returns The location of the point along the geodesic.
  5019. */
  5020. interpolateUsingFraction(fraction: number, result?: Cartographic): Cartographic;
  5021. /**
  5022. * Provides the location of a point at the indicated distance along the geodesic.
  5023. * @param distance - The distance from the inital point to the point of interest along the geodesic
  5024. * @param [result] - The object in which to store the result.
  5025. * @returns The location of the point along the geodesic.
  5026. */
  5027. interpolateUsingSurfaceDistance(distance: number, result?: Cartographic): Cartographic;
  5028. }
  5029. /**
  5030. * A description of an ellipsoid centered at the origin.
  5031. * @example
  5032. * const ellipsoid = new SuperMap.EllipsoidGeometry({
  5033. * vertexFormat : SuperMap.VertexFormat.POSITION_ONLY,
  5034. * radii : new SuperMap.Cartesian3(1000000.0, 500000.0, 500000.0)
  5035. * });
  5036. * const geometry = SuperMap.EllipsoidGeometry.createGeometry(ellipsoid);
  5037. * @param [options] - Object with the following properties:
  5038. * @param [options.radii = Cartesian3(1.0, 1.0, 1.0)] - The radii of the ellipsoid in the x, y, and z directions.
  5039. * @param [options.innerRadii = options.radii] - The inner radii of the ellipsoid in the x, y, and z directions.
  5040. * @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.
  5041. * @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.
  5042. * @param [options.minimumCone = 0.0] - The minimum angle measured from the positive z-axis and toward the negative z-axis.
  5043. * @param [options.maximumCone = PI] - The maximum angle measured from the positive z-axis and toward the negative z-axis.
  5044. * @param [options.stackPartitions = 64] - The number of times to partition the ellipsoid into stacks.
  5045. * @param [options.slicePartitions = 64] - The number of times to partition the ellipsoid into radial slices.
  5046. * @param [options.vertexFormat = VertexFormat.DEFAULT] - The vertex attributes to be computed.
  5047. */
  5048. export class EllipsoidGeometry {
  5049. constructor(options?: {
  5050. radii?: Cartesian3;
  5051. innerRadii?: Cartesian3;
  5052. minimumClock?: number;
  5053. maximumClock?: number;
  5054. minimumCone?: number;
  5055. maximumCone?: number;
  5056. stackPartitions?: number;
  5057. slicePartitions?: number;
  5058. vertexFormat?: VertexFormat;
  5059. });
  5060. /**
  5061. * The number of elements used to pack the object into an array.
  5062. */
  5063. packedLength: number;
  5064. /**
  5065. * Stores the provided instance into the provided array.
  5066. * @param value - The value to pack.
  5067. * @param array - The array to pack into.
  5068. * @param [startingIndex = 0] - The index into the array at which to start packing the elements.
  5069. * @returns The array that was packed into
  5070. */
  5071. pack(value: EllipsoidGeometry, array: number[], startingIndex?: number): number[];
  5072. /**
  5073. * Retrieves an instance from a packed array.
  5074. * @param array - The packed array.
  5075. * @param [startingIndex = 0] - The starting index of the element to be unpacked.
  5076. * @param [result] - The object into which to store the result.
  5077. * @returns The modified result parameter or a new EllipsoidGeometry instance if one was not provided.
  5078. */
  5079. unpack(array: number[], startingIndex?: number, result?: EllipsoidGeometry): EllipsoidGeometry;
  5080. /**
  5081. * Computes the geometric representation of an ellipsoid, including its vertices, indices, and a bounding sphere.
  5082. * @param ellipsoidGeometry - A description of the ellipsoid.
  5083. * @returns The computed vertices and indices.
  5084. */
  5085. createGeometry(ellipsoidGeometry: EllipsoidGeometry): Geometry | undefined;
  5086. }
  5087. /**
  5088. * A description of the outline of an ellipsoid centered at the origin.
  5089. * @example
  5090. * const ellipsoid = new SuperMap.EllipsoidOutlineGeometry({
  5091. * radii : new SuperMap.Cartesian3(1000000.0, 500000.0, 500000.0),
  5092. * stackPartitions: 6,
  5093. * slicePartitions: 5
  5094. * });
  5095. * const geometry = SuperMap.EllipsoidOutlineGeometry.createGeometry(ellipsoid);
  5096. * @param [options] - Object with the following properties:
  5097. * @param [options.radii = Cartesian3(1.0, 1.0, 1.0)] - The radii of the ellipsoid in the x, y, and z directions.
  5098. * @param [options.innerRadii = options.radii] - The inner radii of the ellipsoid in the x, y, and z directions.
  5099. * @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.
  5100. * @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.
  5101. * @param [options.minimumCone = 0.0] - The minimum angle measured from the positive z-axis and toward the negative z-axis.
  5102. * @param [options.maximumCone = PI] - The maximum angle measured from the positive z-axis and toward the negative z-axis.
  5103. * @param [options.stackPartitions = 10] - The count of stacks for the ellipsoid (1 greater than the number of parallel lines).
  5104. * @param [options.slicePartitions = 8] - The count of slices for the ellipsoid (Equal to the number of radial lines).
  5105. * @param [options.subdivisions = 128] - The number of points per line, determining the granularity of the curvature.
  5106. */
  5107. export class EllipsoidOutlineGeometry {
  5108. constructor(options?: {
  5109. radii?: Cartesian3;
  5110. innerRadii?: Cartesian3;
  5111. minimumClock?: number;
  5112. maximumClock?: number;
  5113. minimumCone?: number;
  5114. maximumCone?: number;
  5115. stackPartitions?: number;
  5116. slicePartitions?: number;
  5117. subdivisions?: number;
  5118. });
  5119. /**
  5120. * The number of elements used to pack the object into an array.
  5121. */
  5122. packedLength: number;
  5123. /**
  5124. * Stores the provided instance into the provided array.
  5125. * @param value - The value to pack.
  5126. * @param array - The array to pack into.
  5127. * @param [startingIndex = 0] - The index into the array at which to start packing the elements.
  5128. * @returns The array that was packed into
  5129. */
  5130. pack(value: EllipsoidOutlineGeometry, array: number[], startingIndex?: number): number[];
  5131. /**
  5132. * Retrieves an instance from a packed array.
  5133. * @param array - The packed array.
  5134. * @param [startingIndex = 0] - The starting index of the element to be unpacked.
  5135. * @param [result] - The object into which to store the result.
  5136. * @returns The modified result parameter or a new EllipsoidOutlineGeometry instance if one was not provided.
  5137. */
  5138. unpack(array: number[], startingIndex?: number, result?: EllipsoidOutlineGeometry): EllipsoidOutlineGeometry;
  5139. /**
  5140. * Computes the geometric representation of an outline of an ellipsoid, including its vertices, indices, and a bounding sphere.
  5141. * @param ellipsoidGeometry - A description of the ellipsoid outline.
  5142. * @returns The computed vertices and indices.
  5143. */
  5144. createGeometry(ellipsoidGeometry: EllipsoidOutlineGeometry): Geometry | undefined;
  5145. }
  5146. /**
  5147. * Initializes a rhumb line on the ellipsoid connecting the two provided planetodetic points.
  5148. * @param [start] - The initial planetodetic point on the path.
  5149. * @param [end] - The final planetodetic point on the path.
  5150. * @param [ellipsoid = Ellipsoid.WGS84] - The ellipsoid on which the rhumb line lies.
  5151. */
  5152. export class EllipsoidRhumbLine {
  5153. constructor(start?: Cartographic, end?: Cartographic, ellipsoid?: Ellipsoid);
  5154. /**
  5155. * Gets the ellipsoid.
  5156. */
  5157. readonly ellipsoid: Ellipsoid;
  5158. /**
  5159. * Gets the surface distance between the start and end point
  5160. */
  5161. readonly surfaceDistance: number;
  5162. /**
  5163. * Gets the initial planetodetic point on the path.
  5164. */
  5165. readonly start: Cartographic;
  5166. /**
  5167. * Gets the final planetodetic point on the path.
  5168. */
  5169. readonly end: Cartographic;
  5170. /**
  5171. * Gets the heading from the start point to the end point.
  5172. */
  5173. readonly heading: number;
  5174. /**
  5175. * Create a rhumb line using an initial position with a heading and distance.
  5176. * @param start - The initial planetodetic point on the path.
  5177. * @param heading - The heading in radians.
  5178. * @param distance - The rhumb line distance between the start and end point.
  5179. * @param [ellipsoid = Ellipsoid.WGS84] - The ellipsoid on which the rhumb line lies.
  5180. * @param [result] - The object in which to store the result.
  5181. * @returns The EllipsoidRhumbLine object.
  5182. */
  5183. fromStartHeadingDistance(start: Cartographic, heading: number, distance: number, ellipsoid?: Ellipsoid, result?: EllipsoidRhumbLine): EllipsoidRhumbLine;
  5184. /**
  5185. * Sets the start and end points of the rhumb line.
  5186. * @param start - The initial planetodetic point on the path.
  5187. * @param end - The final planetodetic point on the path.
  5188. */
  5189. setEndPoints(start: Cartographic, end: Cartographic): void;
  5190. /**
  5191. * Provides the location of a point at the indicated portion along the rhumb line.
  5192. * @param fraction - The portion of the distance between the initial and final points.
  5193. * @param [result] - The object in which to store the result.
  5194. * @returns The location of the point along the rhumb line.
  5195. */
  5196. interpolateUsingFraction(fraction: number, result?: Cartographic): Cartographic;
  5197. /**
  5198. * Provides the location of a point at the indicated distance along the rhumb line.
  5199. * @param distance - The distance from the inital point to the point of interest along the rhumbLine.
  5200. * @param [result] - The object in which to store the result.
  5201. * @returns The location of the point along the rhumb line.
  5202. */
  5203. interpolateUsingSurfaceDistance(distance: number, result?: Cartographic): Cartographic;
  5204. /**
  5205. * Provides the location of a point at the indicated longitude along the rhumb line.
  5206. * 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.
  5207. * @param intersectionLongitude - The longitude, in radians, at which to find the intersection point from the starting point using the heading.
  5208. * @param [result] - The object in which to store the result.
  5209. * @returns The location of the intersection point along the rhumb line, undefined if there is no intersection or infinite intersections.
  5210. */
  5211. findIntersectionWithLongitude(intersectionLongitude: number, result?: Cartographic): Cartographic;
  5212. /**
  5213. * Provides the location of a point at the indicated latitude along the rhumb line.
  5214. * 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.
  5215. * @param intersectionLatitude - The latitude, in radians, at which to find the intersection point from the starting point using the heading.
  5216. * @param [result] - The object in which to store the result.
  5217. * @returns The location of the intersection point along the rhumb line, undefined if there is no intersection or infinite intersections.
  5218. */
  5219. findIntersectionWithLatitude(intersectionLatitude: number, result?: Cartographic): Cartographic;
  5220. }
  5221. /**
  5222. * A plane tangent to the provided ellipsoid at the provided origin.
  5223. * If origin is not on the surface of the ellipsoid, it's surface projection will be used.
  5224. * If origin is at the center of the ellipsoid, an exception will be thrown.
  5225. * @param origin - The point on the surface of the ellipsoid where the tangent plane touches.
  5226. * @param [ellipsoid = Ellipsoid.WGS84] - The ellipsoid to use.
  5227. */
  5228. export class EllipsoidTangentPlane {
  5229. constructor(origin: Cartesian3, ellipsoid?: Ellipsoid);
  5230. /**
  5231. * Gets the ellipsoid.
  5232. */
  5233. ellipsoid: Ellipsoid;
  5234. /**
  5235. * Gets the origin.
  5236. */
  5237. origin: Cartesian3;
  5238. /**
  5239. * Gets the plane which is tangent to the ellipsoid.
  5240. */
  5241. readonly plane: Plane;
  5242. /**
  5243. * Gets the local X-axis (east) of the tangent plane.
  5244. */
  5245. readonly xAxis: Cartesian3;
  5246. /**
  5247. * Gets the local Y-axis (north) of the tangent plane.
  5248. */
  5249. readonly yAxis: Cartesian3;
  5250. /**
  5251. * Gets the local Z-axis (up) of the tangent plane.
  5252. */
  5253. readonly zAxis: Cartesian3;
  5254. /**
  5255. * Creates a new instance from the provided ellipsoid and the center
  5256. * point of the provided Cartesians.
  5257. * @param cartesians - The list of positions surrounding the center point.
  5258. * @param [ellipsoid = Ellipsoid.WGS84] - The ellipsoid to use.
  5259. * @returns The new instance of EllipsoidTangentPlane.
  5260. */
  5261. fromPoints(cartesians: Cartesian3[], ellipsoid?: Ellipsoid): EllipsoidTangentPlane;
  5262. /**
  5263. * Computes the projection of the provided 3D position onto the 2D plane, radially outward from the {@link EllipsoidTangentPlane.ellipsoid} coordinate system origin.
  5264. * @param cartesian - The point to project.
  5265. * @param [result] - The object onto which to store the result.
  5266. * @returns The modified result parameter or a new Cartesian2 instance if none was provided. Undefined if there is no intersection point
  5267. */
  5268. projectPointOntoPlane(cartesian: Cartesian3, result?: Cartesian2): Cartesian2;
  5269. /**
  5270. * Computes the projection of the provided 3D positions onto the 2D plane (where possible), radially outward from the global origin.
  5271. * The resulting array may be shorter than the input array - if a single projection is impossible it will not be included.
  5272. * @param cartesians - The array of points to project.
  5273. * @param [result] - The array of Cartesian2 instances onto which to store results.
  5274. * @returns The modified result parameter or a new array of Cartesian2 instances if none was provided.
  5275. */
  5276. projectPointsOntoPlane(cartesians: Cartesian3[], result?: Cartesian2[]): Cartesian2[];
  5277. /**
  5278. * Computes the projection of the provided 3D position onto the 2D plane, along the plane normal.
  5279. * @param cartesian - The point to project.
  5280. * @param [result] - The object onto which to store the result.
  5281. * @returns The modified result parameter or a new Cartesian2 instance if none was provided.
  5282. */
  5283. projectPointToNearestOnPlane(cartesian: Cartesian3, result?: Cartesian2): Cartesian2;
  5284. /**
  5285. * Computes the projection of the provided 3D positions onto the 2D plane, along the plane normal.
  5286. * @param cartesians - The array of points to project.
  5287. * @param [result] - The array of Cartesian2 instances onto which to store results.
  5288. * @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>.
  5289. */
  5290. projectPointsToNearestOnPlane(cartesians: Cartesian3[], result?: Cartesian2[]): Cartesian2[];
  5291. /**
  5292. * Computes the projection of the provided 2D position onto the 3D ellipsoid.
  5293. * @param cartesian - The points to project.
  5294. * @param [result] - The Cartesian3 instance to store result.
  5295. * @returns The modified result parameter or a new Cartesian3 instance if none was provided.
  5296. */
  5297. projectPointOntoEllipsoid(cartesian: Cartesian2, result?: Cartesian3): Cartesian3;
  5298. /**
  5299. * Computes the projection of the provided 2D positions onto the 3D ellipsoid.
  5300. * @param cartesians - The array of points to project.
  5301. * @param [result] - The array of Cartesian3 instances onto which to store results.
  5302. * @returns The modified result parameter or a new array of Cartesian3 instances if none was provided.
  5303. */
  5304. projectPointsOntoEllipsoid(cartesians: Cartesian2[], result?: Cartesian3[]): Cartesian3[];
  5305. }
  5306. /**
  5307. * A very simple {@link TerrainProvider} that produces geometry by tessellating an ellipsoidal
  5308. * surface.
  5309. * @param [options] - Object with the following properties:
  5310. * @param [options.tilingScheme] - The tiling scheme specifying how the ellipsoidal
  5311. * surface is broken into tiles. If this parameter is not provided, a {@link GeographicTilingScheme}
  5312. * is used.
  5313. * @param [options.ellipsoid] - The ellipsoid. If the tilingScheme is specified,
  5314. * this parameter is ignored and the tiling scheme's ellipsoid is used instead. If neither
  5315. * parameter is specified, the WGS84 ellipsoid is used.
  5316. */
  5317. export class EllipsoidTerrainProvider {
  5318. constructor(options?: {
  5319. tilingScheme?: TilingScheme;
  5320. ellipsoid?: Ellipsoid;
  5321. });
  5322. /**
  5323. * Gets an event that is raised when the terrain provider encounters an asynchronous error. By subscribing
  5324. * to the event, you will be notified of the error and can potentially recover from it. Event listeners
  5325. * are passed an instance of {@link TileProviderError}.
  5326. */
  5327. readonly errorEvent: Event;
  5328. /**
  5329. * Gets the credit to display when this terrain provider is active. Typically this is used to credit
  5330. * the source of the terrain. This function should not be called before {@link EllipsoidTerrainProvider#ready} returns true.
  5331. */
  5332. readonly credit: Credit;
  5333. /**
  5334. * Gets the tiling scheme used by this provider. This function should
  5335. * not be called before {@link EllipsoidTerrainProvider#ready} returns true.
  5336. */
  5337. readonly tilingScheme: GeographicTilingScheme;
  5338. /**
  5339. * Gets a value indicating whether or not the provider is ready for use.
  5340. */
  5341. readonly ready: boolean;
  5342. /**
  5343. * Gets a promise that resolves to true when the provider is ready for use.
  5344. */
  5345. readonly readyPromise: Promise<boolean>;
  5346. /**
  5347. * Gets a value indicating whether or not the provider includes a water mask. The water mask
  5348. * indicates which areas of the globe are water rather than land, so they can be rendered
  5349. * as a reflective surface with animated waves. This function should not be
  5350. * called before {@link EllipsoidTerrainProvider#ready} returns true.
  5351. */
  5352. readonly hasWaterMask: boolean;
  5353. /**
  5354. * Gets a value indicating whether or not the requested tiles include vertex normals.
  5355. * This function should not be called before {@link EllipsoidTerrainProvider#ready} returns true.
  5356. */
  5357. readonly hasVertexNormals: boolean;
  5358. /**
  5359. * Gets an object that can be used to determine availability of terrain from this provider, such as
  5360. * at points and in rectangles. This function should not be called before
  5361. * {@link TerrainProvider#ready} returns true. This property may be undefined if availability
  5362. * information is not available.
  5363. */
  5364. readonly availability: TileAvailability;
  5365. /**
  5366. * Requests the geometry for a given tile. This function should not be called before
  5367. * {@link TerrainProvider#ready} returns true. The result includes terrain
  5368. * data and indicates that all child tiles are available.
  5369. * @param x - The X coordinate of the tile for which to request geometry.
  5370. * @param y - The Y coordinate of the tile for which to request geometry.
  5371. * @param level - The level of the tile for which to request geometry.
  5372. * @param [request] - The request object. Intended for internal use only.
  5373. * @returns A promise for the requested geometry. If this method
  5374. * returns undefined instead of a promise, it is an indication that too many requests are already
  5375. * pending and the request will be retried later.
  5376. */
  5377. requestTileGeometry(x: number, y: number, level: number, request?: Request): Promise<TerrainData> | undefined;
  5378. /**
  5379. * Gets the maximum geometric error allowed in a tile at a given level.
  5380. * @param level - The tile level for which to get the maximum geometric error.
  5381. * @returns The maximum geometric error.
  5382. */
  5383. getLevelMaximumGeometricError(level: number): number;
  5384. /**
  5385. * Determines whether data for a tile is available to be loaded.
  5386. * @param x - The X coordinate of the tile for which to request geometry.
  5387. * @param y - The Y coordinate of the tile for which to request geometry.
  5388. * @param level - The level of the tile for which to request geometry.
  5389. * @returns Undefined if not supported, otherwise true or false.
  5390. */
  5391. getTileDataAvailable(x: number, y: number, level: number): boolean | undefined;
  5392. /**
  5393. * Makes sure we load availability data for a tile
  5394. * @param x - The X coordinate of the tile for which to request geometry.
  5395. * @param y - The Y coordinate of the tile for which to request geometry.
  5396. * @param level - The level of the tile for which to request geometry.
  5397. * @returns This provider does not support loading availability.
  5398. */
  5399. loadTileDataAvailability(x: number, y: number, level: number): undefined;
  5400. }
  5401. /**
  5402. * A generic utility class for managing subscribers for a particular event.
  5403. * This class is usually instantiated inside of a container class and
  5404. * exposed as a property for others to subscribe to.
  5405. * @example
  5406. * MyObject.prototype.myListener = function(arg1, arg2) {
  5407. * this.myArg1Copy = arg1;
  5408. * this.myArg2Copy = arg2;
  5409. * }
  5410. *
  5411. * const myObjectInstance = new MyObject();
  5412. * const evt = new SuperMap.Event();
  5413. * evt.addEventListener(MyObject.prototype.myListener, myObjectInstance);
  5414. * evt.raiseEvent('1', '2');
  5415. * evt.removeEventListener(MyObject.prototype.myListener);
  5416. */
  5417. export class Event<Listener extends (...args: any[]) => void = (...args: any[]) => void> {
  5418. constructor();
  5419. /**
  5420. * The number of listeners currently subscribed to the event.
  5421. */
  5422. readonly numberOfListeners: number;
  5423. /**
  5424. * Registers a callback function to be executed whenever the event is raised.
  5425. * An optional scope can be provided to serve as the <code>this</code> pointer
  5426. * in which the function will execute.
  5427. * @param listener - The function to be executed when the event is raised.
  5428. * @param [scope] - An optional object scope to serve as the <code>this</code>
  5429. * pointer in which the listener function will execute.
  5430. * @returns A function that will remove this event listener when invoked.
  5431. */
  5432. addEventListener(listener: Listener, scope?: any): Event.RemoveCallback;
  5433. /**
  5434. * Unregisters a previously registered callback.
  5435. * @param listener - The function to be unregistered.
  5436. * @param [scope] - The scope that was originally passed to addEventListener.
  5437. * @returns <code>true</code> if the listener was removed; <code>false</code> if the listener and scope are not registered with the event.
  5438. */
  5439. removeEventListener(listener: Listener, scope?: any): boolean;
  5440. /**
  5441. * Raises the event by calling each registered listener with all supplied arguments.
  5442. * @param arguments - This method takes any number of parameters and passes them through to the listener functions.
  5443. */
  5444. raiseEvent(...arguments: Parameters<Listener>[]): void;
  5445. }
  5446. export namespace Event {
  5447. /**
  5448. * A function that removes a listener.
  5449. */
  5450. type RemoveCallback = () => void;
  5451. }
  5452. /**
  5453. * A convenience object that simplifies the common pattern of attaching event listeners
  5454. * to several events, then removing all those listeners at once later, for example, in
  5455. * a destroy method.
  5456. * @example
  5457. * const helper = new SuperMap.EventHelper();
  5458. *
  5459. * helper.add(someObject.event, listener1, this);
  5460. * helper.add(otherObject.event, listener2, this);
  5461. *
  5462. * // later...
  5463. * helper.removeAll();
  5464. */
  5465. export class EventHelper {
  5466. constructor();
  5467. /**
  5468. * Adds a listener to an event, and records the registration to be cleaned up later.
  5469. * @param event - The event to attach to.
  5470. * @param listener - The function to be executed when the event is raised.
  5471. * @param [scope] - An optional object scope to serve as the <code>this</code>
  5472. * pointer in which the listener function will execute.
  5473. * @returns A function that will remove this event listener when invoked.
  5474. */
  5475. add(event: Event, listener: (...params: any[]) => any, scope?: any): EventHelper.RemoveCallback;
  5476. /**
  5477. * Unregisters all previously added listeners.
  5478. */
  5479. removeAll(): void;
  5480. }
  5481. export namespace EventHelper {
  5482. /**
  5483. * A function that removes a listener.
  5484. */
  5485. type RemoveCallback = () => void;
  5486. }
  5487. /**
  5488. * Constants to determine how an interpolated value is extrapolated
  5489. * when querying outside the bounds of available data.
  5490. */
  5491. export enum ExtrapolationType {
  5492. /**
  5493. * No extrapolation occurs.
  5494. */
  5495. NONE = 0,
  5496. /**
  5497. * The first or last value is used when outside the range of sample data.
  5498. */
  5499. HOLD = 1,
  5500. /**
  5501. * The value is extrapolated.
  5502. */
  5503. EXTRAPOLATE = 2
  5504. }
  5505. /**
  5506. * A set of functions to detect whether the current browser supports
  5507. * various features.
  5508. */
  5509. export namespace FeatureDetection {
  5510. /**
  5511. * Detects whether the current browser supports Basis Universal textures and the web assembly modules needed to transcode them.
  5512. * @returns true if the browser supports web assembly modules and the scene supports Basis Universal textures, false if not.
  5513. */
  5514. function supportsBasis(scene: Scene): boolean;
  5515. /**
  5516. * Detects whether the current browser supports the full screen standard.
  5517. * @returns true if the browser supports the full screen standard, false if not.
  5518. */
  5519. function supportsFullscreen(): boolean;
  5520. /**
  5521. * Detects whether the current browser supports typed arrays.
  5522. * @returns true if the browser supports typed arrays, false if not.
  5523. */
  5524. function supportsTypedArrays(): boolean;
  5525. /**
  5526. * Detects whether the current browser supports BigInt64Array typed arrays.
  5527. * @returns true if the browser supports BigInt64Array typed arrays, false if not.
  5528. */
  5529. function supportsBigInt64Array(): boolean;
  5530. /**
  5531. * Detects whether the current browser supports BigUint64Array typed arrays.
  5532. * @returns true if the browser supports BigUint64Array typed arrays, false if not.
  5533. */
  5534. function supportsBigUint64Array(): boolean;
  5535. /**
  5536. * Detects whether the current browser supports BigInt.
  5537. * @returns true if the browser supports BigInt, false if not.
  5538. */
  5539. function supportsBigInt(): boolean;
  5540. /**
  5541. * Detects whether the current browser supports Web Workers.
  5542. * @returns true if the browsers supports Web Workers, false if not.
  5543. */
  5544. function supportsWebWorkers(): boolean;
  5545. /**
  5546. * Detects whether the current browser supports Web Assembly.
  5547. * @returns true if the browsers supports Web Assembly, false if not.
  5548. */
  5549. function supportsWebAssembly(): boolean;
  5550. }
  5551. /**
  5552. * Describes a frustum at the given the origin and orientation.
  5553. * @param options - Object with the following properties:
  5554. * @param options.frustum - The frustum.
  5555. * @param options.origin - The origin of the frustum.
  5556. * @param options.orientation - The orientation of the frustum.
  5557. * @param [options.vertexFormat = VertexFormat.DEFAULT] - The vertex attributes to be computed.
  5558. */
  5559. export class FrustumGeometry {
  5560. constructor(options: {
  5561. frustum: PerspectiveFrustum | OrthographicFrustum;
  5562. origin: Cartesian3;
  5563. orientation: Quaternion;
  5564. vertexFormat?: VertexFormat;
  5565. });
  5566. /**
  5567. * The number of elements used to pack the object into an array.
  5568. */
  5569. packedLength: number;
  5570. /**
  5571. * Stores the provided instance into the provided array.
  5572. * @param value - The value to pack.
  5573. * @param array - The array to pack into.
  5574. * @param [startingIndex = 0] - The index into the array at which to start packing the elements.
  5575. * @returns The array that was packed into
  5576. */
  5577. pack(value: FrustumGeometry, array: number[], startingIndex?: number): number[];
  5578. /**
  5579. * Retrieves an instance from a packed array.
  5580. * @param array - The packed array.
  5581. * @param [startingIndex = 0] - The starting index of the element to be unpacked.
  5582. * @param [result] - The object into which to store the result.
  5583. */
  5584. unpack(array: number[], startingIndex?: number, result?: FrustumGeometry): void;
  5585. /**
  5586. * Computes the geometric representation of a frustum, including its vertices, indices, and a bounding sphere.
  5587. * @param frustumGeometry - A description of the frustum.
  5588. * @returns The computed vertices and indices.
  5589. */
  5590. createGeometry(frustumGeometry: FrustumGeometry): Geometry | undefined;
  5591. }
  5592. /**
  5593. * A description of the outline of a frustum with the given the origin and orientation.
  5594. * @param options - Object with the following properties:
  5595. * @param options.frustum - The frustum.
  5596. * @param options.origin - The origin of the frustum.
  5597. * @param options.orientation - The orientation of the frustum.
  5598. */
  5599. export class FrustumOutlineGeometry {
  5600. constructor(options: {
  5601. frustum: PerspectiveFrustum | OrthographicFrustum;
  5602. origin: Cartesian3;
  5603. orientation: Quaternion;
  5604. });
  5605. /**
  5606. * The number of elements used to pack the object into an array.
  5607. */
  5608. packedLength: number;
  5609. /**
  5610. * Stores the provided instance into the provided array.
  5611. * @param value - The value to pack.
  5612. * @param array - The array to pack into.
  5613. * @param [startingIndex = 0] - The index into the array at which to start packing the elements.
  5614. * @returns The array that was packed into
  5615. */
  5616. pack(value: FrustumOutlineGeometry, array: number[], startingIndex?: number): number[];
  5617. /**
  5618. * Retrieves an instance from a packed array.
  5619. * @param array - The packed array.
  5620. * @param [startingIndex = 0] - The starting index of the element to be unpacked.
  5621. * @param [result] - The object into which to store the result.
  5622. */
  5623. unpack(array: number[], startingIndex?: number, result?: FrustumOutlineGeometry): void;
  5624. /**
  5625. * Computes the geometric representation of a frustum outline, including its vertices, indices, and a bounding sphere.
  5626. * @param frustumGeometry - A description of the frustum.
  5627. * @returns The computed vertices and indices.
  5628. */
  5629. createGeometry(frustumGeometry: FrustumOutlineGeometry): Geometry | undefined;
  5630. }
  5631. /**
  5632. * Browser-independent functions for working with the standard fullscreen API.
  5633. */
  5634. export namespace Fullscreen {
  5635. /**
  5636. * The element that is currently fullscreen, if any. To simply check if the
  5637. * browser is in fullscreen mode or not, use {@link Fullscreen#fullscreen}.
  5638. */
  5639. const element: any;
  5640. /**
  5641. * The name of the event on the document that is fired when fullscreen is
  5642. * entered or exited. This event name is intended for use with addEventListener.
  5643. * In your event handler, to determine if the browser is in fullscreen mode or not,
  5644. * use {@link Fullscreen#fullscreen}.
  5645. */
  5646. const changeEventName: string;
  5647. /**
  5648. * The name of the event that is fired when a fullscreen error
  5649. * occurs. This event name is intended for use with addEventListener.
  5650. */
  5651. const errorEventName: string;
  5652. /**
  5653. * Determine whether the browser will allow an element to be made fullscreen, or not.
  5654. * For example, by default, iframes cannot go fullscreen unless the containing page
  5655. * adds an "allowfullscreen" attribute (or prefixed equivalent).
  5656. */
  5657. const enabled: boolean;
  5658. /**
  5659. * Determines if the browser is currently in fullscreen mode.
  5660. */
  5661. const fullscreen: boolean;
  5662. /**
  5663. * Detects whether the browser supports the standard fullscreen API.
  5664. * @returns <code>true</code> if the browser supports the standard fullscreen API,
  5665. * <code>false</code> otherwise.
  5666. */
  5667. function supportsFullscreen(): boolean;
  5668. /**
  5669. * Asynchronously requests the browser to enter fullscreen mode on the given element.
  5670. * If fullscreen mode is not supported by the browser, does nothing.
  5671. * @example
  5672. * // Put the entire page into fullscreen.
  5673. * SuperMap.Fullscreen.requestFullscreen(document.body)
  5674. *
  5675. * // Place only the SuperMap canvas into fullscreen.
  5676. * SuperMap.Fullscreen.requestFullscreen(scene.canvas)
  5677. * @param element - The HTML element which will be placed into fullscreen mode.
  5678. * @param [vrDevice] - The HMDVRDevice device.
  5679. */
  5680. function requestFullscreen(element: any, vrDevice?: any): void;
  5681. /**
  5682. * Asynchronously exits fullscreen mode. If the browser is not currently
  5683. * in fullscreen, or if fullscreen mode is not supported by the browser, does nothing.
  5684. */
  5685. function exitFullscreen(): void;
  5686. }
  5687. /**
  5688. * The type of geocoding to be performed by a {@link GeocoderService}.
  5689. */
  5690. export enum GeocodeType {
  5691. /**
  5692. * Perform a search where the input is considered complete.
  5693. */
  5694. SEARCH = 0,
  5695. /**
  5696. * Perform an auto-complete using partial input, typically
  5697. * reserved for providing possible results as a user is typing.
  5698. */
  5699. AUTOCOMPLETE = 1
  5700. }
  5701. export namespace GeocoderService {
  5702. /**
  5703. * @property displayName - The display name for a location
  5704. * @property destination - The bounding box for a location
  5705. */
  5706. type Result = {
  5707. displayName: string;
  5708. destination: Rectangle | Cartesian3;
  5709. };
  5710. }
  5711. /**
  5712. * Provides geocoding through an external service. This type describes an interface and
  5713. * is not intended to be used.
  5714. */
  5715. export class GeocoderService {
  5716. constructor();
  5717. /**
  5718. * @param query - The query to be sent to the geocoder service
  5719. * @param [type = GeocodeType.SEARCH] - The type of geocode to perform.
  5720. */
  5721. geocode(query: string, type?: GeocodeType): Promise<GeocoderService.Result[]>;
  5722. }
  5723. /**
  5724. * A simple map projection where longitude and latitude are linearly mapped to X and Y by multiplying
  5725. * them by the {@link Ellipsoid#maximumRadius}. This projection
  5726. * is commonly known as geographic, equirectangular, equidistant cylindrical, or plate carrée. It
  5727. * is also known as EPSG:4326.
  5728. * @param [ellipsoid = Ellipsoid.WGS84] - The ellipsoid.
  5729. */
  5730. export class GeographicProjection {
  5731. constructor(ellipsoid?: Ellipsoid);
  5732. /**
  5733. * Gets the {@link Ellipsoid}.
  5734. */
  5735. readonly ellipsoid: Ellipsoid;
  5736. /**
  5737. * Projects a set of {@link Cartographic} coordinates, in radians, to map coordinates, in meters.
  5738. * X and Y are the longitude and latitude, respectively, multiplied by the maximum radius of the
  5739. * ellipsoid. Z is the unmodified height.
  5740. * @param cartographic - The coordinates to project.
  5741. * @param [result] - An instance into which to copy the result. If this parameter is
  5742. * undefined, a new instance is created and returned.
  5743. * @returns The projected coordinates. If the result parameter is not undefined, the
  5744. * coordinates are copied there and that instance is returned. Otherwise, a new instance is
  5745. * created and returned.
  5746. */
  5747. project(cartographic: Cartographic, result?: Cartesian3): Cartesian3;
  5748. /**
  5749. * Unprojects a set of projected {@link Cartesian3} coordinates, in meters, to {@link Cartographic}
  5750. * coordinates, in radians. Longitude and Latitude are the X and Y coordinates, respectively,
  5751. * divided by the maximum radius of the ellipsoid. Height is the unmodified Z coordinate.
  5752. * @param cartesian - The Cartesian position to unproject with height (z) in meters.
  5753. * @param [result] - An instance into which to copy the result. If this parameter is
  5754. * undefined, a new instance is created and returned.
  5755. * @returns The unprojected coordinates. If the result parameter is not undefined, the
  5756. * coordinates are copied there and that instance is returned. Otherwise, a new instance is
  5757. * created and returned.
  5758. */
  5759. unproject(cartesian: Cartesian3, result?: Cartographic): Cartographic;
  5760. }
  5761. /**
  5762. * A tiling scheme for geometry referenced to a simple {@link GeographicProjection} where
  5763. * longitude and latitude are directly mapped to X and Y. This projection is commonly
  5764. * known as geographic, equirectangular, equidistant cylindrical, or plate carrée.
  5765. * @param [options] - Object with the following properties:
  5766. * @param [options.ellipsoid = Ellipsoid.WGS84] - The ellipsoid whose surface is being tiled. Defaults to
  5767. * the WGS84 ellipsoid.
  5768. * @param [options.rectangle = Rectangle.MAX_VALUE] - The rectangle, in radians, covered by the tiling scheme.
  5769. * @param [options.numberOfLevelZeroTilesX = 2] - The number of tiles in the X direction at level zero of
  5770. * the tile tree.
  5771. * @param [options.numberOfLevelZeroTilesY = 1] - The number of tiles in the Y direction at level zero of
  5772. * the tile tree.
  5773. */
  5774. export class GeographicTilingScheme {
  5775. constructor(options?: {
  5776. ellipsoid?: Ellipsoid;
  5777. rectangle?: Rectangle;
  5778. numberOfLevelZeroTilesX?: number;
  5779. numberOfLevelZeroTilesY?: number;
  5780. });
  5781. /**
  5782. * Gets the ellipsoid that is tiled by this tiling scheme.
  5783. */
  5784. ellipsoid: Ellipsoid;
  5785. /**
  5786. * Gets the rectangle, in radians, covered by this tiling scheme.
  5787. */
  5788. rectangle: Rectangle;
  5789. /**
  5790. * Gets the map projection used by this tiling scheme.
  5791. */
  5792. projection: MapProjection;
  5793. /**
  5794. * Gets the total number of tiles in the X direction at a specified level-of-detail.
  5795. * @param level - The level-of-detail.
  5796. * @returns The number of tiles in the X direction at the given level.
  5797. */
  5798. getNumberOfXTilesAtLevel(level: number): number;
  5799. /**
  5800. * Gets the total number of tiles in the Y direction at a specified level-of-detail.
  5801. * @param level - The level-of-detail.
  5802. * @returns The number of tiles in the Y direction at the given level.
  5803. */
  5804. getNumberOfYTilesAtLevel(level: number): number;
  5805. /**
  5806. * Transforms a rectangle specified in geodetic radians to the native coordinate system
  5807. * of this tiling scheme.
  5808. * @param rectangle - The rectangle to transform.
  5809. * @param [result] - The instance to which to copy the result, or undefined if a new instance
  5810. * should be created.
  5811. * @returns The specified 'result', or a new object containing the native rectangle if 'result'
  5812. * is undefined.
  5813. */
  5814. rectangleToNativeRectangle(rectangle: Rectangle, result?: Rectangle): Rectangle;
  5815. /**
  5816. * Converts tile x, y coordinates and level to a rectangle expressed in the native coordinates
  5817. * of the tiling scheme.
  5818. * @param x - The integer x coordinate of the tile.
  5819. * @param y - The integer y coordinate of the tile.
  5820. * @param level - The tile level-of-detail. Zero is the least detailed.
  5821. * @param [result] - The instance to which to copy the result, or undefined if a new instance
  5822. * should be created.
  5823. * @returns The specified 'result', or a new object containing the rectangle
  5824. * if 'result' is undefined.
  5825. */
  5826. tileXYToNativeRectangle(x: number, y: number, level: number, result?: any): Rectangle;
  5827. /**
  5828. * Converts tile x, y coordinates and level to a cartographic rectangle in radians.
  5829. * @param x - The integer x coordinate of the tile.
  5830. * @param y - The integer y coordinate of the tile.
  5831. * @param level - The tile level-of-detail. Zero is the least detailed.
  5832. * @param [result] - The instance to which to copy the result, or undefined if a new instance
  5833. * should be created.
  5834. * @returns The specified 'result', or a new object containing the rectangle
  5835. * if 'result' is undefined.
  5836. */
  5837. tileXYToRectangle(x: number, y: number, level: number, result?: any): Rectangle;
  5838. /**
  5839. * Calculates the tile x, y coordinates of the tile containing
  5840. * a given cartographic position.
  5841. * @param position - The position.
  5842. * @param level - The tile level-of-detail. Zero is the least detailed.
  5843. * @param [result] - The instance to which to copy the result, or undefined if a new instance
  5844. * should be created.
  5845. * @returns The specified 'result', or a new object containing the tile x, y coordinates
  5846. * if 'result' is undefined.
  5847. */
  5848. positionToTileXY(position: Cartographic, level: number, result?: Cartesian2): Cartesian2;
  5849. }
  5850. /**
  5851. * A geometry representation with attributes forming vertices and optional index data
  5852. * defining primitives. Geometries and an {@link Appearance}, which describes the shading,
  5853. * can be assigned to a {@link Primitive} for visualization. A <code>Primitive</code> can
  5854. * be created from many heterogeneous - in many cases - geometries for performance.
  5855. * <p>
  5856. * Geometries can be transformed and optimized using functions in {@link GeometryPipeline}.
  5857. * </p>
  5858. * @example
  5859. * // Create geometry with a position attribute and indexed lines.
  5860. * const positions = new Float64Array([
  5861. * 0.0, 0.0, 0.0,
  5862. * 7500000.0, 0.0, 0.0,
  5863. * 0.0, 7500000.0, 0.0
  5864. * ]);
  5865. *
  5866. * const geometry = new SuperMap.Geometry({
  5867. * attributes : {
  5868. * position : new SuperMap.GeometryAttribute({
  5869. * componentDatatype : SuperMap.ComponentDatatype.DOUBLE,
  5870. * componentsPerAttribute : 3,
  5871. * values : positions
  5872. * })
  5873. * },
  5874. * indices : new Uint16Array([0, 1, 1, 2, 2, 0]),
  5875. * primitiveType : SuperMap.PrimitiveType.LINES,
  5876. * boundingSphere : SuperMap.BoundingSphere.fromVertices(positions)
  5877. * });
  5878. * @param options - Object with the following properties:
  5879. * @param options.attributes - Attributes, which make up the geometry's vertices.
  5880. * @param [options.primitiveType = PrimitiveType.TRIANGLES] - The type of primitives in the geometry.
  5881. * @param [options.indices] - Optional index data that determines the primitives in the geometry.
  5882. * @param [options.boundingSphere] - An optional bounding sphere that fully enclosed the geometry.
  5883. */
  5884. export class Geometry {
  5885. constructor(options: {
  5886. attributes: GeometryAttributes;
  5887. primitiveType?: PrimitiveType;
  5888. indices?: Uint16Array | Uint32Array;
  5889. boundingSphere?: BoundingSphere;
  5890. });
  5891. /**
  5892. * Attributes, which make up the geometry's vertices. Each property in this object corresponds to a
  5893. * {@link GeometryAttribute} containing the attribute's data.
  5894. * <p>
  5895. * Attributes are always stored non-interleaved in a Geometry.
  5896. * </p>
  5897. * <p>
  5898. * There are reserved attribute names with well-known semantics. The following attributes
  5899. * are created by a Geometry (depending on the provided {@link VertexFormat}.
  5900. * <ul>
  5901. * <li><code>position</code> - 3D vertex position. 64-bit floating-point (for precision). 3 components per attribute. See {@link VertexFormat#position}.</li>
  5902. * <li><code>normal</code> - Normal (normalized), commonly used for lighting. 32-bit floating-point. 3 components per attribute. See {@link VertexFormat#normal}.</li>
  5903. * <li><code>st</code> - 2D texture coordinate. 32-bit floating-point. 2 components per attribute. See {@link VertexFormat#st}.</li>
  5904. * <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>
  5905. * <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>
  5906. * </ul>
  5907. * </p>
  5908. * <p>
  5909. * The following attribute names are generally not created by a Geometry, but are added
  5910. * to a Geometry by a {@link Primitive} or {@link GeometryPipeline} functions to prepare
  5911. * the geometry for rendering.
  5912. * <ul>
  5913. * <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>
  5914. * <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>
  5915. * <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>
  5916. * <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>
  5917. * <li><code>color</code> - RGBA color (normalized) usually from {@link GeometryInstance#color}. 32-bit floating-point. 4 components per attribute.</li>
  5918. * <li><code>pickColor</code> - RGBA color used for picking. 32-bit floating-point. 4 components per attribute.</li>
  5919. * </ul>
  5920. * </p>
  5921. * @example
  5922. * geometry.attributes.position = new SuperMap.GeometryAttribute({
  5923. * componentDatatype : SuperMap.ComponentDatatype.FLOAT,
  5924. * componentsPerAttribute : 3,
  5925. * values : new Float32Array(0)
  5926. * });
  5927. */
  5928. attributes: GeometryAttributes;
  5929. /**
  5930. * Optional index data that - along with {@link Geometry#primitiveType} -
  5931. * determines the primitives in the geometry.
  5932. */
  5933. indices: any[];
  5934. /**
  5935. * The type of primitives in the geometry. This is most often {@link PrimitiveType.TRIANGLES},
  5936. * but can varying based on the specific geometry.
  5937. */
  5938. primitiveType: PrimitiveType;
  5939. /**
  5940. * An optional bounding sphere that fully encloses the geometry. This is
  5941. * commonly used for culling.
  5942. */
  5943. boundingSphere: BoundingSphere;
  5944. /**
  5945. * Computes the number of vertices in a geometry. The runtime is linear with
  5946. * respect to the number of attributes in a vertex, not the number of vertices.
  5947. * @example
  5948. * const numVertices = SuperMap.Geometry.computeNumberOfVertices(geometry);
  5949. * @param geometry - The geometry.
  5950. * @returns The number of vertices in the geometry.
  5951. */
  5952. computeNumberOfVertices(geometry: Geometry): number;
  5953. }
  5954. /**
  5955. * Values and type information for geometry attributes. A {@link Geometry}
  5956. * generally contains one or more attributes. All attributes together form
  5957. * the geometry's vertices.
  5958. * @example
  5959. * const geometry = new SuperMap.Geometry({
  5960. * attributes : {
  5961. * position : new SuperMap.GeometryAttribute({
  5962. * componentDatatype : SuperMap.ComponentDatatype.FLOAT,
  5963. * componentsPerAttribute : 3,
  5964. * values : new Float32Array([
  5965. * 0.0, 0.0, 0.0,
  5966. * 7500000.0, 0.0, 0.0,
  5967. * 0.0, 7500000.0, 0.0
  5968. * ])
  5969. * })
  5970. * },
  5971. * primitiveType : SuperMap.PrimitiveType.LINE_LOOP
  5972. * });
  5973. * @param [options] - Object with the following properties:
  5974. * @param [options.componentDatatype] - The datatype of each component in the attribute, e.g., individual elements in values.
  5975. * @param [options.componentsPerAttribute] - A number between 1 and 4 that defines the number of components in an attributes.
  5976. * @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.
  5977. * @param [options.values] - The values for the attributes stored in a typed array.
  5978. */
  5979. export class GeometryAttribute {
  5980. constructor(options?: {
  5981. componentDatatype?: ComponentDatatype;
  5982. componentsPerAttribute?: number;
  5983. normalize?: boolean;
  5984. values?: number[] | Int8Array | Uint8Array | Int16Array | Uint16Array | Int32Array | Uint32Array | Float32Array | Float64Array;
  5985. });
  5986. /**
  5987. * The datatype of each component in the attribute, e.g., individual elements in
  5988. * {@link GeometryAttribute#values}.
  5989. */
  5990. componentDatatype: ComponentDatatype;
  5991. /**
  5992. * A number between 1 and 4 that defines the number of components in an attributes.
  5993. * For example, a position attribute with x, y, and z components would have 3 as
  5994. * shown in the code example.
  5995. * @example
  5996. * attribute.componentDatatype = SuperMap.ComponentDatatype.FLOAT;
  5997. * attribute.componentsPerAttribute = 3;
  5998. * attribute.values = new Float32Array([
  5999. * 0.0, 0.0, 0.0,
  6000. * 7500000.0, 0.0, 0.0,
  6001. * 0.0, 7500000.0, 0.0
  6002. * ]);
  6003. */
  6004. componentsPerAttribute: number;
  6005. /**
  6006. * When <code>true</code> and <code>componentDatatype</code> is an integer format,
  6007. * indicate that the components should be mapped to the range [0, 1] (unsigned)
  6008. * or [-1, 1] (signed) when they are accessed as floating-point for rendering.
  6009. * <p>
  6010. * This is commonly used when storing colors using {@link ComponentDatatype.UNSIGNED_BYTE}.
  6011. * </p>
  6012. * @example
  6013. * attribute.componentDatatype = SuperMap.ComponentDatatype.UNSIGNED_BYTE;
  6014. * attribute.componentsPerAttribute = 4;
  6015. * attribute.normalize = true;
  6016. * attribute.values = new Uint8Array([
  6017. * SuperMap.Color.floatToByte(color.red),
  6018. * SuperMap.Color.floatToByte(color.green),
  6019. * SuperMap.Color.floatToByte(color.blue),
  6020. * SuperMap.Color.floatToByte(color.alpha)
  6021. * ]);
  6022. */
  6023. normalize: boolean;
  6024. /**
  6025. * The values for the attributes stored in a typed array. In the code example,
  6026. * every three elements in <code>values</code> defines one attributes since
  6027. * <code>componentsPerAttribute</code> is 3.
  6028. * @example
  6029. * attribute.componentDatatype = SuperMap.ComponentDatatype.FLOAT;
  6030. * attribute.componentsPerAttribute = 3;
  6031. * attribute.values = new Float32Array([
  6032. * 0.0, 0.0, 0.0,
  6033. * 7500000.0, 0.0, 0.0,
  6034. * 0.0, 7500000.0, 0.0
  6035. * ]);
  6036. */
  6037. values: number[] | Int8Array | Uint8Array | Int16Array | Uint16Array | Int32Array | Uint32Array | Float32Array | Float64Array;
  6038. }
  6039. /**
  6040. * Attributes, which make up a geometry's vertices. Each property in this object corresponds to a
  6041. * {@link GeometryAttribute} containing the attribute's data.
  6042. * <p>
  6043. * Attributes are always stored non-interleaved in a Geometry.
  6044. * </p>
  6045. */
  6046. export class GeometryAttributes {
  6047. constructor();
  6048. /**
  6049. * The 3D position attribute.
  6050. * <p>
  6051. * 64-bit floating-point (for precision). 3 components per attribute.
  6052. * </p>
  6053. */
  6054. position: GeometryAttribute;
  6055. /**
  6056. * The normal attribute (normalized), which is commonly used for lighting.
  6057. * <p>
  6058. * 32-bit floating-point. 3 components per attribute.
  6059. * </p>
  6060. */
  6061. normal: GeometryAttribute;
  6062. /**
  6063. * The 2D texture coordinate attribute.
  6064. * <p>
  6065. * 32-bit floating-point. 2 components per attribute
  6066. * </p>
  6067. */
  6068. st: GeometryAttribute;
  6069. /**
  6070. * The bitangent attribute (normalized), which is used for tangent-space effects like bump mapping.
  6071. * <p>
  6072. * 32-bit floating-point. 3 components per attribute.
  6073. * </p>
  6074. */
  6075. bitangent: GeometryAttribute;
  6076. /**
  6077. * The tangent attribute (normalized), which is used for tangent-space effects like bump mapping.
  6078. * <p>
  6079. * 32-bit floating-point. 3 components per attribute.
  6080. * </p>
  6081. */
  6082. tangent: GeometryAttribute;
  6083. /**
  6084. * The color attribute.
  6085. * <p>
  6086. * 8-bit unsigned integer. 4 components per attribute.
  6087. * </p>
  6088. */
  6089. color: GeometryAttribute;
  6090. }
  6091. /**
  6092. * Geometry instancing allows one {@link Geometry} object to be positions in several
  6093. * different locations and colored uniquely. For example, one {@link BoxGeometry} can
  6094. * be instanced several times, each with a different <code>modelMatrix</code> to change
  6095. * its position, rotation, and scale.
  6096. * @example
  6097. * // Create geometry for a box, and two instances that refer to it.
  6098. * // One instance positions the box on the bottom and colored aqua.
  6099. * // The other instance positions the box on the top and color white.
  6100. * const geometry = SuperMap.BoxGeometry.fromDimensions({
  6101. * vertexFormat : SuperMap.VertexFormat.POSITION_AND_NORMAL,
  6102. * dimensions : new SuperMap.Cartesian3(1000000.0, 1000000.0, 500000.0)
  6103. * });
  6104. * const instanceBottom = new SuperMap.GeometryInstance({
  6105. * geometry : geometry,
  6106. * modelMatrix : SuperMap.Matrix4.multiplyByTranslation(SuperMap.Transforms.eastNorthUpToFixedFrame(
  6107. * SuperMap.Cartesian3.fromDegrees(-75.59777, 40.03883)), new SuperMap.Cartesian3(0.0, 0.0, 1000000.0), new SuperMap.Matrix4()),
  6108. * attributes : {
  6109. * color : SuperMap.ColorGeometryInstanceAttribute.fromColor(SuperMap.Color.AQUA)
  6110. * },
  6111. * id : 'bottom'
  6112. * });
  6113. * const instanceTop = new SuperMap.GeometryInstance({
  6114. * geometry : geometry,
  6115. * modelMatrix : SuperMap.Matrix4.multiplyByTranslation(SuperMap.Transforms.eastNorthUpToFixedFrame(
  6116. * SuperMap.Cartesian3.fromDegrees(-75.59777, 40.03883)), new SuperMap.Cartesian3(0.0, 0.0, 3000000.0), new SuperMap.Matrix4()),
  6117. * attributes : {
  6118. * color : SuperMap.ColorGeometryInstanceAttribute.fromColor(SuperMap.Color.AQUA)
  6119. * },
  6120. * id : 'top'
  6121. * });
  6122. * @param options - Object with the following properties:
  6123. * @param options.geometry - The geometry to instance.
  6124. * @param [options.modelMatrix = Matrix4.IDENTITY] - The model matrix that transforms to transform the geometry from model to world coordinates.
  6125. * @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}.
  6126. * @param [options.attributes] - Per-instance attributes like a show or color attribute shown in the example below.
  6127. */
  6128. export class GeometryInstance {
  6129. constructor(options: {
  6130. geometry: Geometry | GeometryFactory;
  6131. modelMatrix?: Matrix4;
  6132. id?: any;
  6133. attributes?: any;
  6134. });
  6135. /**
  6136. * The geometry being instanced.
  6137. */
  6138. geometry: Geometry;
  6139. /**
  6140. * The 4x4 transformation matrix that transforms the geometry from model to world coordinates.
  6141. * When this is the identity matrix, the geometry is drawn in world coordinates, i.e., Earth's WGS84 coordinates.
  6142. * Local reference frames can be used by providing a different transformation matrix, like that returned
  6143. * by {@link Transforms.eastNorthUpToFixedFrame}.
  6144. */
  6145. modelMatrix: Matrix4;
  6146. /**
  6147. * User-defined object returned when the instance is picked or used to get/set per-instance attributes.
  6148. */
  6149. id: any;
  6150. /**
  6151. * Per-instance attributes like {@link ColorGeometryInstanceAttribute} or {@link ShowGeometryInstanceAttribute}.
  6152. * {@link Geometry} attributes varying per vertex; these attributes are constant for the entire instance.
  6153. */
  6154. attributes: any;
  6155. }
  6156. /**
  6157. * Values and type information for per-instance geometry attributes.
  6158. * @example
  6159. * const instance = new SuperMap.GeometryInstance({
  6160. * geometry : SuperMap.BoxGeometry.fromDimensions({
  6161. * dimensions : new SuperMap.Cartesian3(1000000.0, 1000000.0, 500000.0)
  6162. * }),
  6163. * modelMatrix : SuperMap.Matrix4.multiplyByTranslation(SuperMap.Transforms.eastNorthUpToFixedFrame(
  6164. * SuperMap.Cartesian3.fromDegrees(0.0, 0.0)), new SuperMap.Cartesian3(0.0, 0.0, 1000000.0), new SuperMap.Matrix4()),
  6165. * id : 'box',
  6166. * attributes : {
  6167. * color : new SuperMap.GeometryInstanceAttribute({
  6168. * componentDatatype : SuperMap.ComponentDatatype.UNSIGNED_BYTE,
  6169. * componentsPerAttribute : 4,
  6170. * normalize : true,
  6171. * value : [255, 255, 0, 255]
  6172. * })
  6173. * }
  6174. * });
  6175. * @param options - Object with the following properties:
  6176. * @param options.componentDatatype - The datatype of each component in the attribute, e.g., individual elements in values.
  6177. * @param options.componentsPerAttribute - A number between 1 and 4 that defines the number of components in an attributes.
  6178. * @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.
  6179. * @param options.value - The value for the attribute.
  6180. */
  6181. export class GeometryInstanceAttribute {
  6182. constructor(options: {
  6183. componentDatatype: ComponentDatatype;
  6184. componentsPerAttribute: number;
  6185. normalize?: boolean;
  6186. value: number[];
  6187. });
  6188. /**
  6189. * The datatype of each component in the attribute, e.g., individual elements in
  6190. * {@link GeometryInstanceAttribute#value}.
  6191. */
  6192. componentDatatype: ComponentDatatype;
  6193. /**
  6194. * A number between 1 and 4 that defines the number of components in an attributes.
  6195. * For example, a position attribute with x, y, and z components would have 3 as
  6196. * shown in the code example.
  6197. * @example
  6198. * show : new SuperMap.GeometryInstanceAttribute({
  6199. * componentDatatype : SuperMap.ComponentDatatype.UNSIGNED_BYTE,
  6200. * componentsPerAttribute : 1,
  6201. * normalize : true,
  6202. * value : [1.0]
  6203. * })
  6204. */
  6205. componentsPerAttribute: number;
  6206. /**
  6207. * When <code>true</code> and <code>componentDatatype</code> is an integer format,
  6208. * indicate that the components should be mapped to the range [0, 1] (unsigned)
  6209. * or [-1, 1] (signed) when they are accessed as floating-point for rendering.
  6210. * <p>
  6211. * This is commonly used when storing colors using {@link ComponentDatatype.UNSIGNED_BYTE}.
  6212. * </p>
  6213. * @example
  6214. * attribute.componentDatatype = SuperMap.ComponentDatatype.UNSIGNED_BYTE;
  6215. * attribute.componentsPerAttribute = 4;
  6216. * attribute.normalize = true;
  6217. * attribute.value = [
  6218. * SuperMap.Color.floatToByte(color.red),
  6219. * SuperMap.Color.floatToByte(color.green),
  6220. * SuperMap.Color.floatToByte(color.blue),
  6221. * SuperMap.Color.floatToByte(color.alpha)
  6222. * ];
  6223. */
  6224. normalize: boolean;
  6225. /**
  6226. * The values for the attributes stored in a typed array. In the code example,
  6227. * every three elements in <code>values</code> defines one attributes since
  6228. * <code>componentsPerAttribute</code> is 3.
  6229. * @example
  6230. * show : new SuperMap.GeometryInstanceAttribute({
  6231. * componentDatatype : SuperMap.ComponentDatatype.UNSIGNED_BYTE,
  6232. * componentsPerAttribute : 1,
  6233. * normalize : true,
  6234. * value : [1.0]
  6235. * })
  6236. */
  6237. value: number[];
  6238. }
  6239. /**
  6240. * Content pipeline functions for geometries.
  6241. */
  6242. export namespace GeometryPipeline {
  6243. /**
  6244. * Converts a geometry's triangle indices to line indices. If the geometry has an <code>indices</code>
  6245. * and its <code>primitiveType</code> is <code>TRIANGLES</code>, <code>TRIANGLE_STRIP</code>,
  6246. * <code>TRIANGLE_FAN</code>, it is converted to <code>LINES</code>; otherwise, the geometry is not changed.
  6247. * <p>
  6248. * This is commonly used to create a wireframe geometry for visual debugging.
  6249. * </p>
  6250. * @example
  6251. * geometry = SuperMap.GeometryPipeline.toWireframe(geometry);
  6252. * @param geometry - The geometry to modify.
  6253. * @returns The modified <code>geometry</code> argument, with its triangle indices converted to lines.
  6254. */
  6255. function toWireframe(geometry: Geometry): Geometry;
  6256. /**
  6257. * Creates a new {@link Geometry} with <code>LINES</code> representing the provided
  6258. * attribute (<code>attributeName</code>) for the provided geometry. This is used to
  6259. * visualize vector attributes like normals, tangents, and bitangents.
  6260. * @example
  6261. * const geometry = SuperMap.GeometryPipeline.createLineSegmentsForVectors(instance.geometry, 'bitangent', 100000.0);
  6262. * @param geometry - The <code>Geometry</code> instance with the attribute.
  6263. * @param [attributeName = 'normal'] - The name of the attribute.
  6264. * @param [length = 10000.0] - The length of each line segment in meters. This can be negative to point the vector in the opposite direction.
  6265. * @returns A new <code>Geometry</code> instance with line segments for the vector.
  6266. */
  6267. function createLineSegmentsForVectors(geometry: Geometry, attributeName?: string, length?: number): Geometry;
  6268. /**
  6269. * Creates an object that maps attribute names to unique locations (indices)
  6270. * for matching vertex attributes and shader programs.
  6271. * @example
  6272. * const attributeLocations = SuperMap.GeometryPipeline.createAttributeLocations(geometry);
  6273. * // Example output
  6274. * // {
  6275. * // 'position' : 0,
  6276. * // 'normal' : 1
  6277. * // }
  6278. * @param geometry - The geometry, which is not modified, to create the object for.
  6279. * @returns An object with attribute name / index pairs.
  6280. */
  6281. function createAttributeLocations(geometry: Geometry): any;
  6282. /**
  6283. * Reorders a geometry's attributes and <code>indices</code> to achieve better performance from the GPU's pre-vertex-shader cache.
  6284. * @example
  6285. * geometry = SuperMap.GeometryPipeline.reorderForPreVertexCache(geometry);
  6286. * @param geometry - The geometry to modify.
  6287. * @returns The modified <code>geometry</code> argument, with its attributes and indices reordered for the GPU's pre-vertex-shader cache.
  6288. */
  6289. function reorderForPreVertexCache(geometry: Geometry): Geometry;
  6290. /**
  6291. * Reorders a geometry's <code>indices</code> to achieve better performance from the GPU's
  6292. * post vertex-shader cache by using the Tipsify algorithm. If the geometry <code>primitiveType</code>
  6293. * is not <code>TRIANGLES</code> or the geometry does not have an <code>indices</code>, this function has no effect.
  6294. * @example
  6295. * geometry = SuperMap.GeometryPipeline.reorderForPostVertexCache(geometry);
  6296. * @param geometry - The geometry to modify.
  6297. * @param [cacheCapacity = 24] - The number of vertices that can be held in the GPU's vertex cache.
  6298. * @returns The modified <code>geometry</code> argument, with its indices reordered for the post-vertex-shader cache.
  6299. */
  6300. function reorderForPostVertexCache(geometry: Geometry, cacheCapacity?: number): Geometry;
  6301. /**
  6302. * Splits a geometry into multiple geometries, if necessary, to ensure that indices in the
  6303. * <code>indices</code> fit into unsigned shorts. This is used to meet the WebGL requirements
  6304. * when unsigned int indices are not supported.
  6305. * <p>
  6306. * If the geometry does not have any <code>indices</code>, this function has no effect.
  6307. * </p>
  6308. * @example
  6309. * const geometries = SuperMap.GeometryPipeline.fitToUnsignedShortIndices(geometry);
  6310. * @param geometry - The geometry to be split into multiple geometries.
  6311. * @returns An array of geometries, each with indices that fit into unsigned shorts.
  6312. */
  6313. function fitToUnsignedShortIndices(geometry: Geometry): Geometry[];
  6314. /**
  6315. * Projects a geometry's 3D <code>position</code> attribute to 2D, replacing the <code>position</code>
  6316. * attribute with separate <code>position3D</code> and <code>position2D</code> attributes.
  6317. * <p>
  6318. * If the geometry does not have a <code>position</code>, this function has no effect.
  6319. * </p>
  6320. * @example
  6321. * geometry = SuperMap.GeometryPipeline.projectTo2D(geometry, 'position', 'position3D', 'position2D');
  6322. * @param geometry - The geometry to modify.
  6323. * @param attributeName - The name of the attribute.
  6324. * @param attributeName3D - The name of the attribute in 3D.
  6325. * @param attributeName2D - The name of the attribute in 2D.
  6326. * @param [projection = new GeographicProjection()] - The projection to use.
  6327. * @returns The modified <code>geometry</code> argument with <code>position3D</code> and <code>position2D</code> attributes.
  6328. */
  6329. function projectTo2D(geometry: Geometry, attributeName: string, attributeName3D: string, attributeName2D: string, projection?: any): Geometry;
  6330. /**
  6331. * Encodes floating-point geometry attribute values as two separate attributes to improve
  6332. * rendering precision.
  6333. * <p>
  6334. * This is commonly used to create high-precision position vertex attributes.
  6335. * </p>
  6336. * @example
  6337. * geometry = SuperMap.GeometryPipeline.encodeAttribute(geometry, 'position3D', 'position3DHigh', 'position3DLow');
  6338. * @param geometry - The geometry to modify.
  6339. * @param attributeName - The name of the attribute.
  6340. * @param attributeHighName - The name of the attribute for the encoded high bits.
  6341. * @param attributeLowName - The name of the attribute for the encoded low bits.
  6342. * @returns The modified <code>geometry</code> argument, with its encoded attribute.
  6343. */
  6344. function encodeAttribute(geometry: Geometry, attributeName: string, attributeHighName: string, attributeLowName: string): Geometry;
  6345. /**
  6346. * Transforms a geometry instance to world coordinates. This changes
  6347. * the instance's <code>modelMatrix</code> to {@link Matrix4.IDENTITY} and transforms the
  6348. * following attributes if they are present: <code>position</code>, <code>normal</code>,
  6349. * <code>tangent</code>, and <code>bitangent</code>.
  6350. * @example
  6351. * SuperMap.GeometryPipeline.transformToWorldCoordinates(instance);
  6352. * @param instance - The geometry instance to modify.
  6353. * @returns The modified <code>instance</code> argument, with its attributes transforms to world coordinates.
  6354. */
  6355. function transformToWorldCoordinates(instance: GeometryInstance): GeometryInstance;
  6356. /**
  6357. * Computes per-vertex normals for a geometry containing <code>TRIANGLES</code> by averaging the normals of
  6358. * all triangles incident to the vertex. The result is a new <code>normal</code> attribute added to the geometry.
  6359. * This assumes a counter-clockwise winding order.
  6360. * @example
  6361. * SuperMap.GeometryPipeline.computeNormal(geometry);
  6362. * @param geometry - The geometry to modify.
  6363. * @returns The modified <code>geometry</code> argument with the computed <code>normal</code> attribute.
  6364. */
  6365. function computeNormal(geometry: Geometry): Geometry;
  6366. /**
  6367. * Computes per-vertex tangents and bitangents for a geometry containing <code>TRIANGLES</code>.
  6368. * The result is new <code>tangent</code> and <code>bitangent</code> attributes added to the geometry.
  6369. * This assumes a counter-clockwise winding order.
  6370. * @example
  6371. * SuperMap.GeometryPipeline.computeTangentAndBiTangent(geometry);
  6372. * @param geometry - The geometry to modify.
  6373. * @returns The modified <code>geometry</code> argument with the computed <code>tangent</code> and <code>bitangent</code> attributes.
  6374. */
  6375. function computeTangentAndBitangent(geometry: Geometry): Geometry;
  6376. /**
  6377. * Compresses and packs geometry normal attribute values to save memory.
  6378. * @example
  6379. * geometry = SuperMap.GeometryPipeline.compressVertices(geometry);
  6380. * @param geometry - The geometry to modify.
  6381. * @returns The modified <code>geometry</code> argument, with its normals compressed and packed.
  6382. */
  6383. function compressVertices(geometry: Geometry): Geometry;
  6384. }
  6385. /**
  6386. * Provides metadata using the Google Earth Enterprise REST API. This is used by the GoogleEarthEnterpriseImageryProvider
  6387. * and GoogleEarthEnterpriseTerrainProvider to share metadata requests.
  6388. * @param resourceOrUrl - The url of the Google Earth Enterprise server hosting the imagery
  6389. */
  6390. export class GoogleEarthEnterpriseMetadata {
  6391. constructor(resourceOrUrl: Resource | string);
  6392. /**
  6393. * True if imagery is available.
  6394. */
  6395. imageryPresent: boolean;
  6396. /**
  6397. * True if imagery is sent as a protocol buffer, false if sent as plain images. If undefined we will try both.
  6398. */
  6399. protoImagery: boolean;
  6400. /**
  6401. * True if terrain is available.
  6402. */
  6403. terrainPresent: boolean;
  6404. /**
  6405. * Exponent used to compute constant to calculate negative height values.
  6406. */
  6407. negativeAltitudeExponentBias: number;
  6408. /**
  6409. * Threshold where any numbers smaller are actually negative values. They are multiplied by -2^negativeAltitudeExponentBias.
  6410. */
  6411. negativeAltitudeThreshold: number;
  6412. /**
  6413. * Dictionary of provider id to copyright strings.
  6414. */
  6415. providers: any;
  6416. /**
  6417. * Key used to decode packets
  6418. */
  6419. key: ArrayBuffer;
  6420. /**
  6421. * Gets the name of the Google Earth Enterprise server.
  6422. */
  6423. readonly url: string;
  6424. /**
  6425. * Gets the proxy used for metadata requests.
  6426. */
  6427. readonly proxy: Proxy;
  6428. /**
  6429. * Gets the resource used for metadata requests.
  6430. */
  6431. readonly resource: Resource;
  6432. /**
  6433. * Gets a promise that resolves to true when the metadata is ready for use.
  6434. */
  6435. readonly readyPromise: Promise<boolean>;
  6436. /**
  6437. * Converts a tiles (x, y, level) position into a quadkey used to request an image
  6438. * from a Google Earth Enterprise server.
  6439. * @param x - The tile's x coordinate.
  6440. * @param y - The tile's y coordinate.
  6441. * @param level - The tile's zoom level.
  6442. */
  6443. tileXYToQuadKey(x: number, y: number, level: number): void;
  6444. /**
  6445. * Converts a tile's quadkey used to request an image from a Google Earth Enterprise server into the
  6446. * (x, y, level) position.
  6447. * @param quadkey - The tile's quad key
  6448. */
  6449. quadKeyToTileXY(quadkey: string): void;
  6450. }
  6451. /**
  6452. * Terrain data for a single tile from a Google Earth Enterprise server.
  6453. * @example
  6454. * const buffer = ...
  6455. * const childTileMask = ...
  6456. * const terrainData = new SuperMap.GoogleEarthEnterpriseTerrainData({
  6457. * buffer : heightBuffer,
  6458. * childTileMask : childTileMask
  6459. * });
  6460. * @param options - Object with the following properties:
  6461. * @param options.buffer - The buffer containing terrain data.
  6462. * @param options.negativeAltitudeExponentBias - Multiplier for negative terrain heights that are encoded as very small positive values.
  6463. * @param options.negativeElevationThreshold - Threshold for negative values
  6464. * @param [options.childTileMask = 15] - A bit mask indicating which of this tile's four children exist.
  6465. * If a child's bit is set, geometry will be requested for that tile as well when it
  6466. * is needed. If the bit is cleared, the child tile is not requested and geometry is
  6467. * instead upsampled from the parent. The bit values are as follows:
  6468. * <table>
  6469. * <tr><th>Bit Position</th><th>Bit Value</th><th>Child Tile</th></tr>
  6470. * <tr><td>0</td><td>1</td><td>Southwest</td></tr>
  6471. * <tr><td>1</td><td>2</td><td>Southeast</td></tr>
  6472. * <tr><td>2</td><td>4</td><td>Northeast</td></tr>
  6473. * <tr><td>3</td><td>8</td><td>Northwest</td></tr>
  6474. * </table>
  6475. * @param [options.createdByUpsampling = false] - True if this instance was created by upsampling another instance;
  6476. * otherwise, false.
  6477. * @param [options.credits] - Array of credits for this tile.
  6478. */
  6479. export class GoogleEarthEnterpriseTerrainData {
  6480. constructor(options: {
  6481. buffer: ArrayBuffer;
  6482. negativeAltitudeExponentBias: number;
  6483. negativeElevationThreshold: number;
  6484. childTileMask?: number;
  6485. createdByUpsampling?: boolean;
  6486. credits?: Credit[];
  6487. });
  6488. /**
  6489. * An array of credits for this tile
  6490. */
  6491. credits: Credit[];
  6492. /**
  6493. * The water mask included in this terrain data, if any. A water mask is a rectangular
  6494. * Uint8Array or image where a value of 255 indicates water and a value of 0 indicates land.
  6495. * Values in between 0 and 255 are allowed as well to smoothly blend between land and water.
  6496. */
  6497. waterMask: Uint8Array | HTMLImageElement | HTMLCanvasElement;
  6498. /**
  6499. * Computes the terrain height at a specified longitude and latitude.
  6500. * @param rectangle - The rectangle covered by this terrain data.
  6501. * @param longitude - The longitude in radians.
  6502. * @param latitude - The latitude in radians.
  6503. * @returns The terrain height at the specified position. If the position
  6504. * is outside the rectangle, this method will extrapolate the height, which is likely to be wildly
  6505. * incorrect for positions far outside the rectangle.
  6506. */
  6507. interpolateHeight(rectangle: Rectangle, longitude: number, latitude: number): number;
  6508. /**
  6509. * Upsamples this terrain data for use by a descendant tile. The resulting instance will contain a subset of the
  6510. * height samples in this instance, interpolated if necessary.
  6511. * @param tilingScheme - The tiling scheme of this terrain data.
  6512. * @param thisX - The X coordinate of this tile in the tiling scheme.
  6513. * @param thisY - The Y coordinate of this tile in the tiling scheme.
  6514. * @param thisLevel - The level of this tile in the tiling scheme.
  6515. * @param descendantX - The X coordinate within the tiling scheme of the descendant tile for which we are upsampling.
  6516. * @param descendantY - The Y coordinate within the tiling scheme of the descendant tile for which we are upsampling.
  6517. * @param descendantLevel - The level within the tiling scheme of the descendant tile for which we are upsampling.
  6518. * @returns A promise for upsampled heightmap terrain data for the descendant tile,
  6519. * or undefined if too many asynchronous upsample operations are in progress and the request has been
  6520. * deferred.
  6521. */
  6522. upsample(tilingScheme: TilingScheme, thisX: number, thisY: number, thisLevel: number, descendantX: number, descendantY: number, descendantLevel: number): Promise<HeightmapTerrainData> | undefined;
  6523. /**
  6524. * Determines if a given child tile is available, based on the
  6525. * {@link HeightmapTerrainData.childTileMask}. The given child tile coordinates are assumed
  6526. * to be one of the four children of this tile. If non-child tile coordinates are
  6527. * given, the availability of the southeast child tile is returned.
  6528. * @param thisX - The tile X coordinate of this (the parent) tile.
  6529. * @param thisY - The tile Y coordinate of this (the parent) tile.
  6530. * @param childX - The tile X coordinate of the child tile to check for availability.
  6531. * @param childY - The tile Y coordinate of the child tile to check for availability.
  6532. * @returns True if the child tile is available; otherwise, false.
  6533. */
  6534. isChildAvailable(thisX: number, thisY: number, childX: number, childY: number): boolean;
  6535. /**
  6536. * Gets a value indicating whether or not this terrain data was created by upsampling lower resolution
  6537. * terrain data. If this value is false, the data was obtained from some other source, such
  6538. * as by downloading it from a remote server. This method should return true for instances
  6539. * returned from a call to {@link HeightmapTerrainData#upsample}.
  6540. * @returns True if this instance was created by upsampling; otherwise, false.
  6541. */
  6542. wasCreatedByUpsampling(): boolean;
  6543. }
  6544. /**
  6545. * Provides tiled terrain using the Google Earth Enterprise REST API.
  6546. * @example
  6547. * const geeMetadata = new GoogleEarthEnterpriseMetadata('http://www.earthenterprise.org/3d');
  6548. * const gee = new SuperMap.GoogleEarthEnterpriseTerrainProvider({
  6549. * metadata : geeMetadata
  6550. * });
  6551. * @param options - Object with the following properties:
  6552. * @param options.url - The url of the Google Earth Enterprise server hosting the imagery.
  6553. * @param options.metadata - A metadata object that can be used to share metadata requests with a GoogleEarthEnterpriseImageryProvider.
  6554. * @param [options.ellipsoid] - The ellipsoid. If not specified, the WGS84 ellipsoid is used.
  6555. * @param [options.credit] - A credit for the data source, which is displayed on the canvas.
  6556. */
  6557. export class GoogleEarthEnterpriseTerrainProvider {
  6558. constructor(options: {
  6559. url: Resource | string;
  6560. metadata: GoogleEarthEnterpriseMetadata;
  6561. ellipsoid?: Ellipsoid;
  6562. credit?: Credit | string;
  6563. });
  6564. /**
  6565. * Gets the name of the Google Earth Enterprise server url hosting the imagery.
  6566. */
  6567. readonly url: string;
  6568. /**
  6569. * Gets the proxy used by this provider.
  6570. */
  6571. readonly proxy: Proxy;
  6572. /**
  6573. * Gets the tiling scheme used by this provider. This function should
  6574. * not be called before {@link GoogleEarthEnterpriseTerrainProvider#ready} returns true.
  6575. */
  6576. readonly tilingScheme: TilingScheme;
  6577. /**
  6578. * Gets an event that is raised when the imagery provider encounters an asynchronous error. By subscribing
  6579. * to the event, you will be notified of the error and can potentially recover from it. Event listeners
  6580. * are passed an instance of {@link TileProviderError}.
  6581. */
  6582. readonly errorEvent: Event;
  6583. /**
  6584. * Gets a value indicating whether or not the provider is ready for use.
  6585. */
  6586. readonly ready: boolean;
  6587. /**
  6588. * Gets a promise that resolves to true when the provider is ready for use.
  6589. */
  6590. readonly readyPromise: Promise<boolean>;
  6591. /**
  6592. * Gets the credit to display when this terrain provider is active. Typically this is used to credit
  6593. * the source of the terrain. This function should not be called before {@link GoogleEarthEnterpriseTerrainProvider#ready} returns true.
  6594. */
  6595. readonly credit: Credit;
  6596. /**
  6597. * Gets a value indicating whether or not the provider includes a water mask. The water mask
  6598. * indicates which areas of the globe are water rather than land, so they can be rendered
  6599. * as a reflective surface with animated waves. This function should not be
  6600. * called before {@link GoogleEarthEnterpriseTerrainProvider#ready} returns true.
  6601. */
  6602. readonly hasWaterMask: boolean;
  6603. /**
  6604. * Gets a value indicating whether or not the requested tiles include vertex normals.
  6605. * This function should not be called before {@link GoogleEarthEnterpriseTerrainProvider#ready} returns true.
  6606. */
  6607. readonly hasVertexNormals: boolean;
  6608. /**
  6609. * Gets an object that can be used to determine availability of terrain from this provider, such as
  6610. * at points and in rectangles. This function should not be called before
  6611. * {@link GoogleEarthEnterpriseTerrainProvider#ready} returns true. This property may be undefined if availability
  6612. * information is not available.
  6613. */
  6614. readonly availability: TileAvailability;
  6615. /**
  6616. * Requests the geometry for a given tile. This function should not be called before
  6617. * {@link GoogleEarthEnterpriseTerrainProvider#ready} returns true. The result must include terrain data and
  6618. * may optionally include a water mask and an indication of which child tiles are available.
  6619. * @param x - The X coordinate of the tile for which to request geometry.
  6620. * @param y - The Y coordinate of the tile for which to request geometry.
  6621. * @param level - The level of the tile for which to request geometry.
  6622. * @param [request] - The request object. Intended for internal use only.
  6623. * @returns A promise for the requested geometry. If this method
  6624. * returns undefined instead of a promise, it is an indication that too many requests are already
  6625. * pending and the request will be retried later.
  6626. */
  6627. requestTileGeometry(x: number, y: number, level: number, request?: Request): Promise<TerrainData> | undefined;
  6628. /**
  6629. * Gets the maximum geometric error allowed in a tile at a given level.
  6630. * @param level - The tile level for which to get the maximum geometric error.
  6631. * @returns The maximum geometric error.
  6632. */
  6633. getLevelMaximumGeometricError(level: number): number;
  6634. /**
  6635. * Determines whether data for a tile is available to be loaded.
  6636. * @param x - The X coordinate of the tile for which to request geometry.
  6637. * @param y - The Y coordinate of the tile for which to request geometry.
  6638. * @param level - The level of the tile for which to request geometry.
  6639. * @returns Undefined if not supported, otherwise true or false.
  6640. */
  6641. getTileDataAvailable(x: number, y: number, level: number): boolean | undefined;
  6642. /**
  6643. * Makes sure we load availability data for a tile
  6644. * @param x - The X coordinate of the tile for which to request geometry.
  6645. * @param y - The Y coordinate of the tile for which to request geometry.
  6646. * @param level - The level of the tile for which to request geometry.
  6647. */
  6648. loadTileDataAvailability(x: number, y: number, level: number): undefined;
  6649. }
  6650. /**
  6651. * Represents a Gregorian date in a more precise format than the JavaScript Date object.
  6652. * In addition to submillisecond precision, this object can also represent leap seconds.
  6653. * @param [year] - The year as a whole number.
  6654. * @param [month] - The month as a whole number with range [1, 12].
  6655. * @param [day] - The day of the month as a whole number starting at 1.
  6656. * @param [hour] - The hour as a whole number with range [0, 23].
  6657. * @param [minute] - The minute of the hour as a whole number with range [0, 59].
  6658. * @param [second] - The second of the minute as a whole number with range [0, 60], with 60 representing a leap second.
  6659. * @param [millisecond] - The millisecond of the second as a floating point number with range [0.0, 1000.0).
  6660. * @param [isLeapSecond] - Whether this time is during a leap second.
  6661. */
  6662. export class GregorianDate {
  6663. constructor(year?: number, month?: number, day?: number, hour?: number, minute?: number, second?: number, millisecond?: number, isLeapSecond?: boolean);
  6664. /**
  6665. * Gets or sets the year as a whole number.
  6666. */
  6667. year: number;
  6668. /**
  6669. * Gets or sets the month as a whole number with range [1, 12].
  6670. */
  6671. month: number;
  6672. /**
  6673. * Gets or sets the day of the month as a whole number starting at 1.
  6674. */
  6675. day: number;
  6676. /**
  6677. * Gets or sets the hour as a whole number with range [0, 23].
  6678. */
  6679. hour: number;
  6680. /**
  6681. * Gets or sets the minute of the hour as a whole number with range [0, 59].
  6682. */
  6683. minute: number;
  6684. /**
  6685. * Gets or sets the second of the minute as a whole number with range [0, 60], with 60 representing a leap second.
  6686. */
  6687. second: number;
  6688. /**
  6689. * Gets or sets the millisecond of the second as a floating point number with range [0.0, 1000.0).
  6690. */
  6691. millisecond: number;
  6692. /**
  6693. * Gets or sets whether this time is during a leap second.
  6694. */
  6695. isLeapSecond: boolean;
  6696. }
  6697. /**
  6698. * A description of a polyline on terrain or 3D Tiles. Only to be used with {@link GroundPolylinePrimitive}.
  6699. * @example
  6700. * const positions = SuperMap.Cartesian3.fromDegreesArray([
  6701. * -112.1340164450331, 36.05494287836128,
  6702. * -112.08821010582645, 36.097804071380715,
  6703. * -112.13296079730024, 36.168769146801104
  6704. * ]);
  6705. *
  6706. * const geometry = new SuperMap.GroundPolylineGeometry({
  6707. * positions : positions
  6708. * });
  6709. * @param options - Options with the following properties:
  6710. * @param options.positions - An array of {@link Cartesian3} defining the polyline's points. Heights above the ellipsoid will be ignored.
  6711. * @param [options.width = 1.0] - The screen space width in pixels.
  6712. * @param [options.granularity = 9999.0] - The distance interval in meters used for interpolating options.points. Defaults to 9999.0 meters. Zero indicates no interpolation.
  6713. * @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.
  6714. * @param [options.arcType = ArcType.GEODESIC] - The type of line the polyline segments must follow. Valid options are {@link ArcType.GEODESIC} and {@link ArcType.RHUMB}.
  6715. */
  6716. export class GroundPolylineGeometry {
  6717. constructor(options: {
  6718. positions: Cartesian3[];
  6719. width?: number;
  6720. granularity?: number;
  6721. loop?: boolean;
  6722. arcType?: ArcType;
  6723. });
  6724. /**
  6725. * The screen space width in pixels.
  6726. */
  6727. width: number;
  6728. /**
  6729. * The distance interval used for interpolating options.points. Zero indicates no interpolation.
  6730. * Default of 9999.0 allows centimeter accuracy with 32 bit floating point.
  6731. */
  6732. granularity: boolean;
  6733. /**
  6734. * Whether during geometry creation a line segment will be added between the last and first line positions to make this Polyline a loop.
  6735. * If the geometry has two positions this parameter will be ignored.
  6736. */
  6737. loop: boolean;
  6738. /**
  6739. * The type of path the polyline must follow. Valid options are {@link ArcType.GEODESIC} and {@link ArcType.RHUMB}.
  6740. */
  6741. arcType: ArcType;
  6742. /**
  6743. * Stores the provided instance into the provided array.
  6744. * @param value - The value to pack.
  6745. * @param array - The array to pack into.
  6746. * @param [startingIndex = 0] - The index into the array at which to start packing the elements.
  6747. * @returns The array that was packed into
  6748. */
  6749. pack(value: PolygonGeometry, array: number[], startingIndex?: number): number[];
  6750. /**
  6751. * Retrieves an instance from a packed array.
  6752. * @param array - The packed array.
  6753. * @param [startingIndex = 0] - The starting index of the element to be unpacked.
  6754. * @param [result] - The object into which to store the result.
  6755. */
  6756. unpack(array: number[], startingIndex?: number, result?: PolygonGeometry): void;
  6757. }
  6758. /**
  6759. * Defines a heading angle, pitch angle, and range in a local frame.
  6760. * Heading is the rotation from the local north direction where a positive angle is increasing eastward.
  6761. * Pitch is the rotation from the local xy-plane. Positive pitch angles are above the plane. Negative pitch
  6762. * angles are below the plane. Range is the distance from the center of the frame.
  6763. * @param [heading = 0.0] - The heading angle in radians.
  6764. * @param [pitch = 0.0] - The pitch angle in radians.
  6765. * @param [range = 0.0] - The distance from the center in meters.
  6766. */
  6767. export class HeadingPitchRange {
  6768. constructor(heading?: number, pitch?: number, range?: number);
  6769. /**
  6770. * Heading is the rotation from the local north direction where a positive angle is increasing eastward.
  6771. */
  6772. heading: number;
  6773. /**
  6774. * Pitch is the rotation from the local xy-plane. Positive pitch angles
  6775. * are above the plane. Negative pitch angles are below the plane.
  6776. */
  6777. pitch: number;
  6778. /**
  6779. * Range is the distance from the center of the local frame.
  6780. */
  6781. range: number;
  6782. /**
  6783. * Duplicates a HeadingPitchRange instance.
  6784. * @param hpr - The HeadingPitchRange to duplicate.
  6785. * @param [result] - The object onto which to store the result.
  6786. * @returns The modified result parameter or a new HeadingPitchRange instance if one was not provided. (Returns undefined if hpr is undefined)
  6787. */
  6788. clone(hpr: HeadingPitchRange, result?: HeadingPitchRange): HeadingPitchRange;
  6789. }
  6790. /**
  6791. * A rotation expressed as a heading, pitch, and roll. Heading is the rotation about the
  6792. * negative z axis. Pitch is the rotation about the negative y axis. Roll is the rotation about
  6793. * the positive x axis.
  6794. * @param [heading = 0.0] - The heading component in radians.
  6795. * @param [pitch = 0.0] - The pitch component in radians.
  6796. * @param [roll = 0.0] - The roll component in radians.
  6797. */
  6798. export class HeadingPitchRoll {
  6799. constructor(heading?: number, pitch?: number, roll?: number);
  6800. /**
  6801. * Gets or sets the heading.
  6802. */
  6803. heading: number;
  6804. /**
  6805. * Gets or sets the pitch.
  6806. */
  6807. pitch: number;
  6808. /**
  6809. * Gets or sets the roll.
  6810. */
  6811. roll: number;
  6812. /**
  6813. * @param quaternion - The quaternion from which to retrieve heading, pitch, and roll, all expressed in radians.
  6814. * @param [result] - The object in which to store the result. If not provided, a new instance is created and returned.
  6815. * @returns The modified result parameter or a new HeadingPitchRoll instance if one was not provided.
  6816. */
  6817. fromQuaternion(quaternion: Quaternion, result?: HeadingPitchRoll): HeadingPitchRoll;
  6818. /**
  6819. * Returns a new HeadingPitchRoll instance from angles given in degrees.
  6820. * @param heading - the heading in degrees
  6821. * @param pitch - the pitch in degrees
  6822. * @param roll - the heading in degrees
  6823. * @param [result] - The object in which to store the result. If not provided, a new instance is created and returned.
  6824. * @returns A new HeadingPitchRoll instance
  6825. */
  6826. fromDegrees(heading: number, pitch: number, roll: number, result?: HeadingPitchRoll): HeadingPitchRoll;
  6827. /**
  6828. * Duplicates a HeadingPitchRoll instance.
  6829. * @param headingPitchRoll - The HeadingPitchRoll to duplicate.
  6830. * @param [result] - The object onto which to store the result.
  6831. * @returns The modified result parameter or a new HeadingPitchRoll instance if one was not provided. (Returns undefined if headingPitchRoll is undefined)
  6832. */
  6833. clone(headingPitchRoll: HeadingPitchRoll, result?: HeadingPitchRoll): HeadingPitchRoll;
  6834. /**
  6835. * Compares the provided HeadingPitchRolls componentwise and returns
  6836. * <code>true</code> if they are equal, <code>false</code> otherwise.
  6837. * @param [left] - The first HeadingPitchRoll.
  6838. * @param [right] - The second HeadingPitchRoll.
  6839. * @returns <code>true</code> if left and right are equal, <code>false</code> otherwise.
  6840. */
  6841. equals(left?: HeadingPitchRoll, right?: HeadingPitchRoll): boolean;
  6842. /**
  6843. * Compares the provided HeadingPitchRolls componentwise and returns
  6844. * <code>true</code> if they pass an absolute or relative tolerance test,
  6845. * <code>false</code> otherwise.
  6846. * @param [left] - The first HeadingPitchRoll.
  6847. * @param [right] - The second HeadingPitchRoll.
  6848. * @param [relativeEpsilon = 0] - The relative epsilon tolerance to use for equality testing.
  6849. * @param [absoluteEpsilon = relativeEpsilon] - The absolute epsilon tolerance to use for equality testing.
  6850. * @returns <code>true</code> if left and right are within the provided epsilon, <code>false</code> otherwise.
  6851. */
  6852. equalsEpsilon(left?: HeadingPitchRoll, right?: HeadingPitchRoll, relativeEpsilon?: number, absoluteEpsilon?: number): boolean;
  6853. /**
  6854. * Duplicates this HeadingPitchRoll instance.
  6855. * @param [result] - The object onto which to store the result.
  6856. * @returns The modified result parameter or a new HeadingPitchRoll instance if one was not provided.
  6857. */
  6858. clone(result?: HeadingPitchRoll): HeadingPitchRoll;
  6859. /**
  6860. * Compares this HeadingPitchRoll against the provided HeadingPitchRoll componentwise and returns
  6861. * <code>true</code> if they are equal, <code>false</code> otherwise.
  6862. * @param [right] - The right hand side HeadingPitchRoll.
  6863. * @returns <code>true</code> if they are equal, <code>false</code> otherwise.
  6864. */
  6865. equals(right?: HeadingPitchRoll): boolean;
  6866. /**
  6867. * Compares this HeadingPitchRoll against the provided HeadingPitchRoll componentwise and returns
  6868. * <code>true</code> if they pass an absolute or relative tolerance test,
  6869. * <code>false</code> otherwise.
  6870. * @param [right] - The right hand side HeadingPitchRoll.
  6871. * @param [relativeEpsilon = 0] - The relative epsilon tolerance to use for equality testing.
  6872. * @param [absoluteEpsilon = relativeEpsilon] - The absolute epsilon tolerance to use for equality testing.
  6873. * @returns <code>true</code> if they are within the provided epsilon, <code>false</code> otherwise.
  6874. */
  6875. equalsEpsilon(right?: HeadingPitchRoll, relativeEpsilon?: number, absoluteEpsilon?: number): boolean;
  6876. /**
  6877. * Creates a string representing this HeadingPitchRoll in the format '(heading, pitch, roll)' in radians.
  6878. * @returns A string representing the provided HeadingPitchRoll in the format '(heading, pitch, roll)'.
  6879. */
  6880. toString(): string;
  6881. }
  6882. /**
  6883. * The encoding that is used for a heightmap
  6884. */
  6885. export enum HeightmapEncoding {
  6886. /**
  6887. * No encoding
  6888. */
  6889. NONE = 0,
  6890. /**
  6891. * LERC encoding
  6892. */
  6893. LERC = 1
  6894. }
  6895. /**
  6896. * Terrain data for a single tile where the terrain data is represented as a heightmap. A heightmap
  6897. * is a rectangular array of heights in row-major order from north to south and west to east.
  6898. * @example
  6899. * const buffer = ...
  6900. * const heightBuffer = new Uint16Array(buffer, 0, that._heightmapWidth * that._heightmapWidth);
  6901. * const childTileMask = new Uint8Array(buffer, heightBuffer.byteLength, 1)[0];
  6902. * const waterMask = new Uint8Array(buffer, heightBuffer.byteLength + 1, buffer.byteLength - heightBuffer.byteLength - 1);
  6903. * const terrainData = new SuperMap.HeightmapTerrainData({
  6904. * buffer : heightBuffer,
  6905. * width : 65,
  6906. * height : 65,
  6907. * childTileMask : childTileMask,
  6908. * waterMask : waterMask
  6909. * });
  6910. * @param options - Object with the following properties:
  6911. * @param options.buffer - The buffer containing height data.
  6912. * @param options.width - The width (longitude direction) of the heightmap, in samples.
  6913. * @param options.height - The height (latitude direction) of the heightmap, in samples.
  6914. * @param [options.childTileMask = 15] - A bit mask indicating which of this tile's four children exist.
  6915. * If a child's bit is set, geometry will be requested for that tile as well when it
  6916. * is needed. If the bit is cleared, the child tile is not requested and geometry is
  6917. * instead upsampled from the parent. The bit values are as follows:
  6918. * <table>
  6919. * <tr><th>Bit Position</th><th>Bit Value</th><th>Child Tile</th></tr>
  6920. * <tr><td>0</td><td>1</td><td>Southwest</td></tr>
  6921. * <tr><td>1</td><td>2</td><td>Southeast</td></tr>
  6922. * <tr><td>2</td><td>4</td><td>Northwest</td></tr>
  6923. * <tr><td>3</td><td>8</td><td>Northeast</td></tr>
  6924. * </table>
  6925. * @param [options.waterMask] - The water mask included in this terrain data, if any. A water mask is a square
  6926. * Uint8Array or image where a value of 255 indicates water and a value of 0 indicates land.
  6927. * Values in between 0 and 255 are allowed as well to smoothly blend between land and water.
  6928. * @param [options.structure] - An object describing the structure of the height data.
  6929. * @param [options.structure.heightScale = 1.0] - The factor by which to multiply height samples in order to obtain
  6930. * the height above the heightOffset, in meters. The heightOffset is added to the resulting
  6931. * height after multiplying by the scale.
  6932. * @param [options.structure.heightOffset = 0.0] - The offset to add to the scaled height to obtain the final
  6933. * height in meters. The offset is added after the height sample is multiplied by the
  6934. * heightScale.
  6935. * @param [options.structure.elementsPerHeight = 1] - The number of elements in the buffer that make up a single height
  6936. * sample. This is usually 1, indicating that each element is a separate height sample. If
  6937. * it is greater than 1, that number of elements together form the height sample, which is
  6938. * computed according to the structure.elementMultiplier and structure.isBigEndian properties.
  6939. * @param [options.structure.stride = 1] - The number of elements to skip to get from the first element of
  6940. * one height to the first element of the next height.
  6941. * @param [options.structure.elementMultiplier = 256.0] - The multiplier used to compute the height value when the
  6942. * stride property is greater than 1. For example, if the stride is 4 and the strideMultiplier
  6943. * is 256, the height is computed as follows:
  6944. * `height = buffer[index] + buffer[index + 1] * 256 + buffer[index + 2] * 256 * 256 + buffer[index + 3] * 256 * 256 * 256`
  6945. * This is assuming that the isBigEndian property is false. If it is true, the order of the
  6946. * elements is reversed.
  6947. * @param [options.structure.isBigEndian = false] - Indicates endianness of the elements in the buffer when the
  6948. * stride property is greater than 1. If this property is false, the first element is the
  6949. * low-order element. If it is true, the first element is the high-order element.
  6950. * @param [options.structure.lowestEncodedHeight] - The lowest value that can be stored in the height buffer. Any heights that are lower
  6951. * than this value after encoding with the `heightScale` and `heightOffset` are clamped to this value. For example, if the height
  6952. * buffer is a `Uint16Array`, this value should be 0 because a `Uint16Array` cannot store negative numbers. If this parameter is
  6953. * not specified, no minimum value is enforced.
  6954. * @param [options.structure.highestEncodedHeight] - The highest value that can be stored in the height buffer. Any heights that are higher
  6955. * than this value after encoding with the `heightScale` and `heightOffset` are clamped to this value. For example, if the height
  6956. * buffer is a `Uint16Array`, this value should be `256 * 256 - 1` or 65535 because a `Uint16Array` cannot store numbers larger
  6957. * than 65535. If this parameter is not specified, no maximum value is enforced.
  6958. * @param [options.encoding = HeightmapEncoding.NONE] - The encoding that is used on the buffer.
  6959. * @param [options.createdByUpsampling = false] - True if this instance was created by upsampling another instance;
  6960. * otherwise, false.
  6961. */
  6962. export class HeightmapTerrainData {
  6963. constructor(options: {
  6964. buffer: Int8Array | Uint8Array | Int16Array | Uint16Array | Int32Array | Uint32Array | Float32Array | Float64Array;
  6965. width: number;
  6966. height: number;
  6967. childTileMask?: number;
  6968. waterMask?: Uint8Array;
  6969. structure?: {
  6970. heightScale?: number;
  6971. heightOffset?: number;
  6972. elementsPerHeight?: number;
  6973. stride?: number;
  6974. elementMultiplier?: number;
  6975. isBigEndian?: boolean;
  6976. lowestEncodedHeight?: number;
  6977. highestEncodedHeight?: number;
  6978. };
  6979. encoding?: HeightmapEncoding;
  6980. createdByUpsampling?: boolean;
  6981. });
  6982. /**
  6983. * An array of credits for this tile.
  6984. */
  6985. credits: Credit[];
  6986. /**
  6987. * The water mask included in this terrain data, if any. A water mask is a square
  6988. * Uint8Array or image where a value of 255 indicates water and a value of 0 indicates land.
  6989. * Values in between 0 and 255 are allowed as well to smoothly blend between land and water.
  6990. */
  6991. waterMask: Uint8Array | HTMLImageElement | HTMLCanvasElement;
  6992. /**
  6993. * Computes the terrain height at a specified longitude and latitude.
  6994. * @param rectangle - The rectangle covered by this terrain data.
  6995. * @param longitude - The longitude in radians.
  6996. * @param latitude - The latitude in radians.
  6997. * @returns The terrain height at the specified position. If the position
  6998. * is outside the rectangle, this method will extrapolate the height, which is likely to be wildly
  6999. * incorrect for positions far outside the rectangle.
  7000. */
  7001. interpolateHeight(rectangle: Rectangle, longitude: number, latitude: number): number;
  7002. /**
  7003. * Upsamples this terrain data for use by a descendant tile. The resulting instance will contain a subset of the
  7004. * height samples in this instance, interpolated if necessary.
  7005. * @param tilingScheme - The tiling scheme of this terrain data.
  7006. * @param thisX - The X coordinate of this tile in the tiling scheme.
  7007. * @param thisY - The Y coordinate of this tile in the tiling scheme.
  7008. * @param thisLevel - The level of this tile in the tiling scheme.
  7009. * @param descendantX - The X coordinate within the tiling scheme of the descendant tile for which we are upsampling.
  7010. * @param descendantY - The Y coordinate within the tiling scheme of the descendant tile for which we are upsampling.
  7011. * @param descendantLevel - The level within the tiling scheme of the descendant tile for which we are upsampling.
  7012. * @returns A promise for upsampled heightmap terrain data for the descendant tile,
  7013. * or undefined if the mesh is unavailable.
  7014. */
  7015. upsample(tilingScheme: TilingScheme, thisX: number, thisY: number, thisLevel: number, descendantX: number, descendantY: number, descendantLevel: number): Promise<HeightmapTerrainData> | undefined;
  7016. /**
  7017. * Determines if a given child tile is available, based on the
  7018. * {@link HeightmapTerrainData.childTileMask}. The given child tile coordinates are assumed
  7019. * to be one of the four children of this tile. If non-child tile coordinates are
  7020. * given, the availability of the southeast child tile is returned.
  7021. * @param thisX - The tile X coordinate of this (the parent) tile.
  7022. * @param thisY - The tile Y coordinate of this (the parent) tile.
  7023. * @param childX - The tile X coordinate of the child tile to check for availability.
  7024. * @param childY - The tile Y coordinate of the child tile to check for availability.
  7025. * @returns True if the child tile is available; otherwise, false.
  7026. */
  7027. isChildAvailable(thisX: number, thisY: number, childX: number, childY: number): boolean;
  7028. /**
  7029. * Gets a value indicating whether or not this terrain data was created by upsampling lower resolution
  7030. * terrain data. If this value is false, the data was obtained from some other source, such
  7031. * as by downloading it from a remote server. This method should return true for instances
  7032. * returned from a call to {@link HeightmapTerrainData#upsample}.
  7033. * @returns True if this instance was created by upsampling; otherwise, false.
  7034. */
  7035. wasCreatedByUpsampling(): boolean;
  7036. }
  7037. /**
  7038. * An {@link InterpolationAlgorithm} for performing Hermite interpolation.
  7039. */
  7040. export namespace HermitePolynomialApproximation {
  7041. /**
  7042. * Given the desired degree, returns the number of data points required for interpolation.
  7043. * @param degree - The desired degree of interpolation.
  7044. * @param [inputOrder = 0] - The order of the inputs (0 means just the data, 1 means the data and its derivative, etc).
  7045. * @returns The number of required data points needed for the desired degree of interpolation.
  7046. */
  7047. function getRequiredDataPoints(degree: number, inputOrder?: number): number;
  7048. /**
  7049. * Interpolates values using Hermite Polynomial Approximation.
  7050. * @param x - The independent variable for which the dependent variables will be interpolated.
  7051. * @param xTable - The array of independent variables to use to interpolate. The values
  7052. * in this array must be in increasing order and the same value must not occur twice in the array.
  7053. * @param yTable - The array of dependent variables to use to interpolate. For a set of three
  7054. * dependent values (p,q,w) at time 1 and time 2 this should be as follows: {p1, q1, w1, p2, q2, w2}.
  7055. * @param yStride - The number of dependent variable values in yTable corresponding to
  7056. * each independent variable value in xTable.
  7057. * @param [result] - An existing array into which to store the result.
  7058. * @returns The array of interpolated values, or the result parameter if one was provided.
  7059. */
  7060. function interpolateOrderZero(x: number, xTable: number[], yTable: number[], yStride: number, result?: number[]): number[];
  7061. /**
  7062. * Interpolates values using Hermite Polynomial Approximation.
  7063. * @param x - The independent variable for which the dependent variables will be interpolated.
  7064. * @param xTable - The array of independent variables to use to interpolate. The values
  7065. * in this array must be in increasing order and the same value must not occur twice in the array.
  7066. * @param yTable - The array of dependent variables to use to interpolate. For a set of three
  7067. * dependent values (p,q,w) at time 1 and time 2 this should be as follows: {p1, q1, w1, p2, q2, w2}.
  7068. * @param yStride - The number of dependent variable values in yTable corresponding to
  7069. * each independent variable value in xTable.
  7070. * @param inputOrder - The number of derivatives supplied for input.
  7071. * @param outputOrder - The number of derivatives desired for output.
  7072. * @param [result] - An existing array into which to store the result.
  7073. * @returns The array of interpolated values, or the result parameter if one was provided.
  7074. */
  7075. function interpolate(x: number, xTable: number[], yTable: number[], yStride: number, inputOrder: number, outputOrder: number, result?: number[]): number[];
  7076. }
  7077. /**
  7078. * A Hermite spline is a cubic interpolating spline. Points, incoming tangents, outgoing tangents, and times
  7079. * must be defined for each control point. The outgoing tangents are defined for points [0, n - 2] and the incoming
  7080. * tangents are defined for points [1, n - 1]. For example, when interpolating a segment of the curve between <code>points[i]</code> and
  7081. * <code>points[i + 1]</code>, the tangents at the points will be <code>outTangents[i]</code> and <code>inTangents[i]</code>,
  7082. * respectively.
  7083. * @example
  7084. * // Create a G<sup>1</sup> continuous Hermite spline
  7085. * const times = [ 0.0, 1.5, 3.0, 4.5, 6.0 ];
  7086. * const spline = new SuperMap.HermiteSpline({
  7087. * times : times,
  7088. * points : [
  7089. * new SuperMap.Cartesian3(1235398.0, -4810983.0, 4146266.0),
  7090. * new SuperMap.Cartesian3(1372574.0, -5345182.0, 4606657.0),
  7091. * new SuperMap.Cartesian3(-757983.0, -5542796.0, 4514323.0),
  7092. * new SuperMap.Cartesian3(-2821260.0, -5248423.0, 4021290.0),
  7093. * new SuperMap.Cartesian3(-2539788.0, -4724797.0, 3620093.0)
  7094. * ],
  7095. * outTangents : [
  7096. * new SuperMap.Cartesian3(1125196, -161816, 270551),
  7097. * new SuperMap.Cartesian3(-996690.5, -365906.5, 184028.5),
  7098. * new SuperMap.Cartesian3(-2096917, 48379.5, -292683.5),
  7099. * new SuperMap.Cartesian3(-890902.5, 408999.5, -447115)
  7100. * ],
  7101. * inTangents : [
  7102. * new SuperMap.Cartesian3(-1993381, -731813, 368057),
  7103. * new SuperMap.Cartesian3(-4193834, 96759, -585367),
  7104. * new SuperMap.Cartesian3(-1781805, 817999, -894230),
  7105. * new SuperMap.Cartesian3(1165345, 112641, 47281)
  7106. * ]
  7107. * });
  7108. *
  7109. * const p0 = spline.evaluate(times[0]);
  7110. * @param options - Object with the following properties:
  7111. * @param options.times - An array of strictly increasing, unit-less, floating-point times at each point.
  7112. * The values are in no way connected to the clock time. They are the parameterization for the curve.
  7113. * @param options.points - The array of control points.
  7114. * @param options.inTangents - The array of incoming tangents at each control point.
  7115. * @param options.outTangents - The array of outgoing tangents at each control point.
  7116. */
  7117. export class HermiteSpline {
  7118. constructor(options: {
  7119. times: number[];
  7120. points: Cartesian3[];
  7121. inTangents: Cartesian3[];
  7122. outTangents: Cartesian3[];
  7123. });
  7124. /**
  7125. * An array of times for the control points.
  7126. */
  7127. readonly times: number[];
  7128. /**
  7129. * An array of control points.
  7130. */
  7131. readonly points: Cartesian3[];
  7132. /**
  7133. * An array of incoming tangents at each control point.
  7134. */
  7135. readonly inTangents: Cartesian3[];
  7136. /**
  7137. * An array of outgoing tangents at each control point.
  7138. */
  7139. readonly outTangents: Cartesian3[];
  7140. /**
  7141. * Creates a spline where the tangents at each control point are the same.
  7142. * The curves are guaranteed to be at least in the class C<sup>1</sup>.
  7143. * @example
  7144. * const points = [
  7145. * new SuperMap.Cartesian3(1235398.0, -4810983.0, 4146266.0),
  7146. * new SuperMap.Cartesian3(1372574.0, -5345182.0, 4606657.0),
  7147. * new SuperMap.Cartesian3(-757983.0, -5542796.0, 4514323.0),
  7148. * new SuperMap.Cartesian3(-2821260.0, -5248423.0, 4021290.0),
  7149. * new SuperMap.Cartesian3(-2539788.0, -4724797.0, 3620093.0)
  7150. * ];
  7151. *
  7152. * // Add tangents
  7153. * const tangents = new Array(points.length);
  7154. * tangents[0] = new SuperMap.Cartesian3(1125196, -161816, 270551);
  7155. * const temp = new SuperMap.Cartesian3();
  7156. * for (let i = 1; i < tangents.length - 1; ++i) {
  7157. * tangents[i] = SuperMap.Cartesian3.multiplyByScalar(SuperMap.Cartesian3.subtract(points[i + 1], points[i - 1], temp), 0.5, new SuperMap.Cartesian3());
  7158. * }
  7159. * tangents[tangents.length - 1] = new SuperMap.Cartesian3(1165345, 112641, 47281);
  7160. *
  7161. * const spline = SuperMap.HermiteSpline.createC1({
  7162. * times : times,
  7163. * points : points,
  7164. * tangents : tangents
  7165. * });
  7166. * @param options - Object with the following properties:
  7167. * @param options.times - The array of control point times.
  7168. * @param options.points - The array of control points.
  7169. * @param options.tangents - The array of tangents at the control points.
  7170. * @returns A hermite spline.
  7171. */
  7172. createC1(options: {
  7173. times: number[];
  7174. points: Cartesian3[];
  7175. tangents: Cartesian3[];
  7176. }): HermiteSpline;
  7177. /**
  7178. * Creates a natural cubic spline. The tangents at the control points are generated
  7179. * to create a curve in the class C<sup>2</sup>.
  7180. * @example
  7181. * // Create a natural cubic spline above the earth from Philadelphia to Los Angeles.
  7182. * const spline = SuperMap.HermiteSpline.createNaturalCubic({
  7183. * times : [ 0.0, 1.5, 3.0, 4.5, 6.0 ],
  7184. * points : [
  7185. * new SuperMap.Cartesian3(1235398.0, -4810983.0, 4146266.0),
  7186. * new SuperMap.Cartesian3(1372574.0, -5345182.0, 4606657.0),
  7187. * new SuperMap.Cartesian3(-757983.0, -5542796.0, 4514323.0),
  7188. * new SuperMap.Cartesian3(-2821260.0, -5248423.0, 4021290.0),
  7189. * new SuperMap.Cartesian3(-2539788.0, -4724797.0, 3620093.0)
  7190. * ]
  7191. * });
  7192. * @param options - Object with the following properties:
  7193. * @param options.times - The array of control point times.
  7194. * @param options.points - The array of control points.
  7195. * @returns A hermite spline, or a linear spline if less than 3 control points were given.
  7196. */
  7197. createNaturalCubic(options: {
  7198. times: number[];
  7199. points: Cartesian3[];
  7200. }): HermiteSpline | LinearSpline;
  7201. /**
  7202. * Creates a clamped cubic spline. The tangents at the interior control points are generated
  7203. * to create a curve in the class C<sup>2</sup>.
  7204. * @example
  7205. * // Create a clamped cubic spline above the earth from Philadelphia to Los Angeles.
  7206. * const spline = SuperMap.HermiteSpline.createClampedCubic({
  7207. * times : [ 0.0, 1.5, 3.0, 4.5, 6.0 ],
  7208. * points : [
  7209. * new SuperMap.Cartesian3(1235398.0, -4810983.0, 4146266.0),
  7210. * new SuperMap.Cartesian3(1372574.0, -5345182.0, 4606657.0),
  7211. * new SuperMap.Cartesian3(-757983.0, -5542796.0, 4514323.0),
  7212. * new SuperMap.Cartesian3(-2821260.0, -5248423.0, 4021290.0),
  7213. * new SuperMap.Cartesian3(-2539788.0, -4724797.0, 3620093.0)
  7214. * ],
  7215. * firstTangent : new SuperMap.Cartesian3(1125196, -161816, 270551),
  7216. * lastTangent : new SuperMap.Cartesian3(1165345, 112641, 47281)
  7217. * });
  7218. * @param options - Object with the following properties:
  7219. * @param options.times - The array of control point times.
  7220. * @param options.points - The array of control points.
  7221. * @param options.firstTangent - The outgoing tangent of the first control point.
  7222. * @param options.lastTangent - The incoming tangent of the last control point.
  7223. * @returns A hermite spline, or a linear spline if less than 3 control points were given.
  7224. */
  7225. createClampedCubic(options: {
  7226. times: number[];
  7227. points: number[] | Cartesian3[];
  7228. firstTangent: Cartesian3;
  7229. lastTangent: Cartesian3;
  7230. }): HermiteSpline | LinearSpline;
  7231. /**
  7232. * Finds an index <code>i</code> in <code>times</code> such that the parameter
  7233. * <code>time</code> is in the interval <code>[times[i], times[i + 1]]</code>.
  7234. * @param time - The time.
  7235. * @returns The index for the element at the start of the interval.
  7236. */
  7237. findTimeInterval(time: number): number;
  7238. /**
  7239. * Wraps the given time to the period covered by the spline.
  7240. * @param time - The time.
  7241. * @returns The time, wrapped around to the updated animation.
  7242. */
  7243. wrapTime(time: number): number;
  7244. /**
  7245. * Clamps the given time to the period covered by the spline.
  7246. * @param time - The time.
  7247. * @returns The time, clamped to the animation period.
  7248. */
  7249. clampTime(time: number): number;
  7250. /**
  7251. * Evaluates the curve at a given time.
  7252. * @param time - The time at which to evaluate the curve.
  7253. * @param [result] - The object onto which to store the result.
  7254. * @returns The modified result parameter or a new instance of the point on the curve at the given time.
  7255. */
  7256. evaluate(time: number, result?: Cartesian3): Cartesian3;
  7257. }
  7258. /**
  7259. * Constants for WebGL index datatypes. These corresponds to the
  7260. * <code>type</code> parameter of {@link http://www.khronos.org/opengles/sdk/docs/man/xhtml/glDrawElements.xml|drawElements}.
  7261. */
  7262. export enum IndexDatatype {
  7263. /**
  7264. * 8-bit unsigned byte corresponding to <code>UNSIGNED_BYTE</code> and the type
  7265. * of an element in <code>Uint8Array</code>.
  7266. */
  7267. UNSIGNED_BYTE = WebGLConstants.UNSIGNED_BYTE,
  7268. /**
  7269. * 16-bit unsigned short corresponding to <code>UNSIGNED_SHORT</code> and the type
  7270. * of an element in <code>Uint16Array</code>.
  7271. */
  7272. UNSIGNED_SHORT = WebGLConstants.UNSIGNED_SHORT,
  7273. /**
  7274. * 32-bit unsigned int corresponding to <code>UNSIGNED_INT</code> and the type
  7275. * of an element in <code>Uint32Array</code>.
  7276. */
  7277. UNSIGNED_INT = WebGLConstants.UNSIGNED_INT
  7278. }
  7279. export namespace InterpolationAlgorithm {
  7280. /**
  7281. * Gets the name of this interpolation algorithm.
  7282. */
  7283. var type: string;
  7284. /**
  7285. * Given the desired degree, returns the number of data points required for interpolation.
  7286. * @param degree - The desired degree of interpolation.
  7287. * @returns The number of required data points needed for the desired degree of interpolation.
  7288. */
  7289. function getRequiredDataPoints(degree: number): number;
  7290. /**
  7291. * Performs zero order interpolation.
  7292. * @param x - The independent variable for which the dependent variables will be interpolated.
  7293. * @param xTable - The array of independent variables to use to interpolate. The values
  7294. * in this array must be in increasing order and the same value must not occur twice in the array.
  7295. * @param yTable - The array of dependent variables to use to interpolate. For a set of three
  7296. * dependent values (p,q,w) at time 1 and time 2 this should be as follows: {p1, q1, w1, p2, q2, w2}.
  7297. * @param yStride - The number of dependent variable values in yTable corresponding to
  7298. * each independent variable value in xTable.
  7299. * @param [result] - An existing array into which to store the result.
  7300. * @returns The array of interpolated values, or the result parameter if one was provided.
  7301. */
  7302. function interpolateOrderZero(x: number, xTable: number[], yTable: number[], yStride: number, result?: number[]): number[];
  7303. /**
  7304. * Performs higher order interpolation. Not all interpolators need to support high-order interpolation,
  7305. * if this function remains undefined on implementing objects, interpolateOrderZero will be used instead.
  7306. * @param x - The independent variable for which the dependent variables will be interpolated.
  7307. * @param xTable - The array of independent variables to use to interpolate. The values
  7308. * in this array must be in increasing order and the same value must not occur twice in the array.
  7309. * @param yTable - The array of dependent variables to use to interpolate. For a set of three
  7310. * dependent values (p,q,w) at time 1 and time 2 this should be as follows: {p1, q1, w1, p2, q2, w2}.
  7311. * @param yStride - The number of dependent variable values in yTable corresponding to
  7312. * each independent variable value in xTable.
  7313. * @param inputOrder - The number of derivatives supplied for input.
  7314. * @param outputOrder - The number of derivatives desired for output.
  7315. * @param [result] - An existing array into which to store the result.
  7316. * @returns The array of interpolated values, or the result parameter if one was provided.
  7317. */
  7318. function interpolate(x: number, xTable: number[], yTable: number[], yStride: number, inputOrder: number, outputOrder: number, result?: number[]): number[];
  7319. }
  7320. /**
  7321. * The interface for interpolation algorithms.
  7322. */
  7323. export interface InterpolationAlgorithm {
  7324. }
  7325. /**
  7326. * This enumerated type is used in determining where, relative to the frustum, an
  7327. * object is located. The object can either be fully contained within the frustum (INSIDE),
  7328. * partially inside the frustum and partially outside (INTERSECTING), or somewhere entirely
  7329. * outside of the frustum's 6 planes (OUTSIDE).
  7330. */
  7331. export enum Intersect {
  7332. /**
  7333. * Represents that an object is not contained within the frustum.
  7334. */
  7335. OUTSIDE = -1,
  7336. /**
  7337. * Represents that an object intersects one of the frustum's planes.
  7338. */
  7339. INTERSECTING = 0,
  7340. /**
  7341. * Represents that an object is fully within the frustum.
  7342. */
  7343. INSIDE = 1
  7344. }
  7345. /**
  7346. * Functions for computing the intersection between geometries such as rays, planes, triangles, and ellipsoids.
  7347. */
  7348. export namespace IntersectionTests {
  7349. /**
  7350. * Computes the intersection of a ray and a plane.
  7351. * @param ray - The ray.
  7352. * @param plane - The plane.
  7353. * @param [result] - The object onto which to store the result.
  7354. * @returns The intersection point or undefined if there is no intersections.
  7355. */
  7356. function rayPlane(ray: Ray, plane: Plane, result?: Cartesian3): Cartesian3;
  7357. /**
  7358. * 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.
  7359. *
  7360. * Implements {@link https://cadxfem.org/inf/Fast%20MinimumStorage%20RayTriangle%20Intersection.pdf|
  7361. * Fast Minimum Storage Ray/Triangle Intersection} by Tomas Moller and Ben Trumbore.
  7362. * @param ray - The ray.
  7363. * @param p0 - The first vertex of the triangle.
  7364. * @param p1 - The second vertex of the triangle.
  7365. * @param p2 - The third vertex of the triangle.
  7366. * @param [cullBackFaces = false] - If <code>true</code>, will only compute an intersection with the front face of the triangle
  7367. * and return undefined for intersections with the back face.
  7368. * @returns The intersection as a parametric distance along the ray, or undefined if there is no intersection.
  7369. */
  7370. function rayTriangleParametric(ray: Ray, p0: Cartesian3, p1: Cartesian3, p2: Cartesian3, cullBackFaces?: boolean): number;
  7371. /**
  7372. * Computes the intersection of a ray and a triangle as a Cartesian3 coordinate.
  7373. *
  7374. * Implements {@link https://cadxfem.org/inf/Fast%20MinimumStorage%20RayTriangle%20Intersection.pdf|
  7375. * Fast Minimum Storage Ray/Triangle Intersection} by Tomas Moller and Ben Trumbore.
  7376. * @param ray - The ray.
  7377. * @param p0 - The first vertex of the triangle.
  7378. * @param p1 - The second vertex of the triangle.
  7379. * @param p2 - The third vertex of the triangle.
  7380. * @param [cullBackFaces = false] - If <code>true</code>, will only compute an intersection with the front face of the triangle
  7381. * and return undefined for intersections with the back face.
  7382. * @param [result] - The <code>Cartesian3</code> onto which to store the result.
  7383. * @returns The intersection point or undefined if there is no intersections.
  7384. */
  7385. function rayTriangle(ray: Ray, p0: Cartesian3, p1: Cartesian3, p2: Cartesian3, cullBackFaces?: boolean, result?: Cartesian3): Cartesian3;
  7386. /**
  7387. * Computes the intersection of a line segment and a triangle.
  7388. * @param v0 - The an end point of the line segment.
  7389. * @param v1 - The other end point of the line segment.
  7390. * @param p0 - The first vertex of the triangle.
  7391. * @param p1 - The second vertex of the triangle.
  7392. * @param p2 - The third vertex of the triangle.
  7393. * @param [cullBackFaces = false] - If <code>true</code>, will only compute an intersection with the front face of the triangle
  7394. * and return undefined for intersections with the back face.
  7395. * @param [result] - The <code>Cartesian3</code> onto which to store the result.
  7396. * @returns The intersection point or undefined if there is no intersections.
  7397. */
  7398. function lineSegmentTriangle(v0: Cartesian3, v1: Cartesian3, p0: Cartesian3, p1: Cartesian3, p2: Cartesian3, cullBackFaces?: boolean, result?: Cartesian3): Cartesian3;
  7399. /**
  7400. * Computes the intersection points of a ray with a sphere.
  7401. * @param ray - The ray.
  7402. * @param sphere - The sphere.
  7403. * @param [result] - The result onto which to store the result.
  7404. * @returns The interval containing scalar points along the ray or undefined if there are no intersections.
  7405. */
  7406. function raySphere(ray: Ray, sphere: BoundingSphere, result?: Interval): Interval;
  7407. /**
  7408. * Computes the intersection points of a line segment with a sphere.
  7409. * @param p0 - An end point of the line segment.
  7410. * @param p1 - The other end point of the line segment.
  7411. * @param sphere - The sphere.
  7412. * @param [result] - The result onto which to store the result.
  7413. * @returns The interval containing scalar points along the ray or undefined if there are no intersections.
  7414. */
  7415. function lineSegmentSphere(p0: Cartesian3, p1: Cartesian3, sphere: BoundingSphere, result?: Interval): Interval;
  7416. /**
  7417. * Computes the intersection points of a ray with an ellipsoid.
  7418. * @param ray - The ray.
  7419. * @param ellipsoid - The ellipsoid.
  7420. * @returns The interval containing scalar points along the ray or undefined if there are no intersections.
  7421. */
  7422. function rayEllipsoid(ray: Ray, ellipsoid: Ellipsoid): Interval;
  7423. /**
  7424. * Provides the point along the ray which is nearest to the ellipsoid.
  7425. * @param ray - The ray.
  7426. * @param ellipsoid - The ellipsoid.
  7427. * @returns The nearest planetodetic point on the ray.
  7428. */
  7429. function grazingAltitudeLocation(ray: Ray, ellipsoid: Ellipsoid): Cartesian3;
  7430. /**
  7431. * Computes the intersection of a line segment and a plane.
  7432. * @example
  7433. * const origin = SuperMap.Cartesian3.fromDegrees(-75.59777, 40.03883);
  7434. * const normal = ellipsoid.geodeticSurfaceNormal(origin);
  7435. * const plane = SuperMap.Plane.fromPointNormal(origin, normal);
  7436. *
  7437. * const p0 = new SuperMap.Cartesian3(...);
  7438. * const p1 = new SuperMap.Cartesian3(...);
  7439. *
  7440. * // find the intersection of the line segment from p0 to p1 and the tangent plane at origin.
  7441. * const intersection = SuperMap.IntersectionTests.lineSegmentPlane(p0, p1, plane);
  7442. * @param endPoint0 - An end point of the line segment.
  7443. * @param endPoint1 - The other end point of the line segment.
  7444. * @param plane - The plane.
  7445. * @param [result] - The object onto which to store the result.
  7446. * @returns The intersection point or undefined if there is no intersection.
  7447. */
  7448. function lineSegmentPlane(endPoint0: Cartesian3, endPoint1: Cartesian3, plane: Plane, result?: Cartesian3): Cartesian3;
  7449. /**
  7450. * Computes the intersection of a triangle and a plane
  7451. * @example
  7452. * const origin = SuperMap.Cartesian3.fromDegrees(-75.59777, 40.03883);
  7453. * const normal = ellipsoid.geodeticSurfaceNormal(origin);
  7454. * const plane = SuperMap.Plane.fromPointNormal(origin, normal);
  7455. *
  7456. * const p0 = new SuperMap.Cartesian3(...);
  7457. * const p1 = new SuperMap.Cartesian3(...);
  7458. * const p2 = new SuperMap.Cartesian3(...);
  7459. *
  7460. * // convert the triangle composed of points (p0, p1, p2) to three triangles that don't cross the plane
  7461. * const triangles = SuperMap.IntersectionTests.trianglePlaneIntersection(p0, p1, p2, plane);
  7462. * @param p0 - First point of the triangle
  7463. * @param p1 - Second point of the triangle
  7464. * @param p2 - Third point of the triangle
  7465. * @param plane - Intersection plane
  7466. * @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)
  7467. */
  7468. function trianglePlaneIntersection(p0: Cartesian3, p1: Cartesian3, p2: Cartesian3, plane: Plane): any;
  7469. }
  7470. /**
  7471. * Contains functions for operating on 2D triangles.
  7472. */
  7473. export namespace Intersections2D {
  7474. /**
  7475. * Splits a 2D triangle at given axis-aligned threshold value and returns the resulting
  7476. * polygon on a given side of the threshold. The resulting polygon may have 0, 1, 2,
  7477. * 3, or 4 vertices.
  7478. * @example
  7479. * const result = SuperMap.Intersections2D.clipTriangleAtAxisAlignedThreshold(0.5, false, 0.2, 0.6, 0.4);
  7480. * // result === [2, 0, -1, 1, 0, 0.25, -1, 1, 2, 0.5]
  7481. * @param threshold - The threshold coordinate value at which to clip the triangle.
  7482. * @param keepAbove - true to keep the portion of the triangle above the threshold, or false
  7483. * to keep the portion below.
  7484. * @param u0 - The coordinate of the first vertex in the triangle, in counter-clockwise order.
  7485. * @param u1 - The coordinate of the second vertex in the triangle, in counter-clockwise order.
  7486. * @param u2 - The coordinate of the third vertex in the triangle, in counter-clockwise order.
  7487. * @param [result] - The array into which to copy the result. If this parameter is not supplied,
  7488. * a new array is constructed and returned.
  7489. * @returns The polygon that results after the clip, specified as a list of
  7490. * vertices. The vertices are specified in counter-clockwise order.
  7491. * Each vertex is either an index from the existing list (identified as
  7492. * a 0, 1, or 2) or -1 indicating a new vertex not in the original triangle.
  7493. * For new vertices, the -1 is followed by three additional numbers: the
  7494. * index of each of the two original vertices forming the line segment that
  7495. * the new vertex lies on, and the fraction of the distance from the first
  7496. * vertex to the second one.
  7497. */
  7498. function clipTriangleAtAxisAlignedThreshold(threshold: number, keepAbove: boolean, u0: number, u1: number, u2: number, result?: number[]): number[];
  7499. /**
  7500. * Compute the barycentric coordinates of a 2D position within a 2D triangle.
  7501. * @example
  7502. * const result = SuperMap.Intersections2D.computeBarycentricCoordinates(0.0, 0.0, 0.0, 1.0, -1, -0.5, 1, -0.5);
  7503. * // result === new SuperMap.Cartesian3(1.0 / 3.0, 1.0 / 3.0, 1.0 / 3.0);
  7504. * @param x - The x coordinate of the position for which to find the barycentric coordinates.
  7505. * @param y - The y coordinate of the position for which to find the barycentric coordinates.
  7506. * @param x1 - The x coordinate of the triangle's first vertex.
  7507. * @param y1 - The y coordinate of the triangle's first vertex.
  7508. * @param x2 - The x coordinate of the triangle's second vertex.
  7509. * @param y2 - The y coordinate of the triangle's second vertex.
  7510. * @param x3 - The x coordinate of the triangle's third vertex.
  7511. * @param y3 - The y coordinate of the triangle's third vertex.
  7512. * @param [result] - The instance into to which to copy the result. If this parameter
  7513. * is undefined, a new instance is created and returned.
  7514. * @returns The barycentric coordinates of the position within the triangle.
  7515. */
  7516. function computeBarycentricCoordinates(x: number, y: number, x1: number, y1: number, x2: number, y2: number, x3: number, y3: number, result?: Cartesian3): Cartesian3;
  7517. /**
  7518. * Compute the intersection between 2 line segments
  7519. * @example
  7520. * const result = SuperMap.Intersections2D.computeLineSegmentLineSegmentIntersection(0.0, 0.0, 0.0, 2.0, -1, 1, 1, 1);
  7521. * // result === new SuperMap.Cartesian2(0.0, 1.0);
  7522. * @param x00 - The x coordinate of the first line's first vertex.
  7523. * @param y00 - The y coordinate of the first line's first vertex.
  7524. * @param x01 - The x coordinate of the first line's second vertex.
  7525. * @param y01 - The y coordinate of the first line's second vertex.
  7526. * @param x10 - The x coordinate of the second line's first vertex.
  7527. * @param y10 - The y coordinate of the second line's first vertex.
  7528. * @param x11 - The x coordinate of the second line's second vertex.
  7529. * @param y11 - The y coordinate of the second line's second vertex.
  7530. * @param [result] - The instance into to which to copy the result. If this parameter
  7531. * is undefined, a new instance is created and returned.
  7532. * @returns The intersection point, undefined if there is no intersection point or lines are coincident.
  7533. */
  7534. function computeLineSegmentLineSegmentIntersection(x00: number, y00: number, x01: number, y01: number, x10: number, y10: number, x11: number, y11: number, result?: Cartesian2): Cartesian2;
  7535. }
  7536. /**
  7537. * Represents the closed interval [start, stop].
  7538. * @param [start = 0.0] - The beginning of the interval.
  7539. * @param [stop = 0.0] - The end of the interval.
  7540. */
  7541. export class Interval {
  7542. constructor(start?: number, stop?: number);
  7543. /**
  7544. * The beginning of the interval.
  7545. */
  7546. start: number;
  7547. /**
  7548. * The end of the interval.
  7549. */
  7550. stop: number;
  7551. }
  7552. /**
  7553. * Constants related to ISO8601 support.
  7554. */
  7555. export namespace Iso8601 {
  7556. /**
  7557. * A {@link JulianDate} representing the earliest time representable by an ISO8601 date.
  7558. * This is equivalent to the date string '0000-01-01T00:00:00Z'
  7559. */
  7560. const MINIMUM_VALUE: JulianDate;
  7561. /**
  7562. * A {@link JulianDate} representing the latest time representable by an ISO8601 date.
  7563. * This is equivalent to the date string '9999-12-31T24:00:00Z'
  7564. */
  7565. const MAXIMUM_VALUE: JulianDate;
  7566. /**
  7567. * A {@link TimeInterval} representing the largest interval representable by an ISO8601 interval.
  7568. * This is equivalent to the interval string '0000-01-01T00:00:00Z/9999-12-31T24:00:00Z'
  7569. */
  7570. const MAXIMUM_INTERVAL: TimeInterval;
  7571. }
  7572. /**
  7573. * Represents an astronomical Julian date, which is the number of days since noon on January 1, -4712 (4713 BC).
  7574. * For increased precision, this class stores the whole number part of the date and the seconds
  7575. * part of the date in separate components. In order to be safe for arithmetic and represent
  7576. * leap seconds, the date is always stored in the International Atomic Time standard
  7577. * {@link TimeStandard.TAI}.
  7578. * @param [julianDayNumber = 0.0] - The Julian Day Number representing the number of whole days. Fractional days will also be handled correctly.
  7579. * @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.
  7580. * @param [timeStandard = TimeStandard.UTC] - The time standard in which the first two parameters are defined.
  7581. */
  7582. export class JulianDate {
  7583. constructor(julianDayNumber?: number, secondsOfDay?: number, timeStandard?: TimeStandard);
  7584. /**
  7585. * Gets or sets the number of whole days.
  7586. */
  7587. dayNumber: number;
  7588. /**
  7589. * Gets or sets the number of seconds into the current day.
  7590. */
  7591. secondsOfDay: number;
  7592. /**
  7593. * Creates a new instance from a GregorianDate.
  7594. * @param date - A GregorianDate.
  7595. * @param [result] - An existing instance to use for the result.
  7596. * @returns The modified result parameter or a new instance if none was provided.
  7597. */
  7598. fromGregorianDate(date: GregorianDate, result?: JulianDate): JulianDate;
  7599. /**
  7600. * Creates a new instance from a JavaScript Date.
  7601. * @param date - A JavaScript Date.
  7602. * @param [result] - An existing instance to use for the result.
  7603. * @returns The modified result parameter or a new instance if none was provided.
  7604. */
  7605. fromDate(date: Date, result?: JulianDate): JulianDate;
  7606. /**
  7607. * Creates a new instance from a from an {@link http://en.wikipedia.org/wiki/ISO_8601|ISO 8601} date.
  7608. * This method is superior to <code>Date.parse</code> because it will handle all valid formats defined by the ISO 8601
  7609. * specification, including leap seconds and sub-millisecond times, which discarded by most JavaScript implementations.
  7610. * @param iso8601String - An ISO 8601 date.
  7611. * @param [result] - An existing instance to use for the result.
  7612. * @returns The modified result parameter or a new instance if none was provided.
  7613. */
  7614. fromIso8601(iso8601String: string, result?: JulianDate): JulianDate;
  7615. /**
  7616. * Creates a new instance that represents the current system time.
  7617. * This is equivalent to calling <code>JulianDate.fromDate(new Date());</code>.
  7618. * @param [result] - An existing instance to use for the result.
  7619. * @returns The modified result parameter or a new instance if none was provided.
  7620. */
  7621. now(result?: JulianDate): JulianDate;
  7622. /**
  7623. * Creates a {@link GregorianDate} from the provided instance.
  7624. * @param julianDate - The date to be converted.
  7625. * @param [result] - An existing instance to use for the result.
  7626. * @returns The modified result parameter or a new instance if none was provided.
  7627. */
  7628. toGregorianDate(julianDate: JulianDate, result?: GregorianDate): GregorianDate;
  7629. /**
  7630. * Creates a JavaScript Date from the provided instance.
  7631. * Since JavaScript dates are only accurate to the nearest millisecond and
  7632. * cannot represent a leap second, consider using {@link JulianDate.toGregorianDate} instead.
  7633. * If the provided JulianDate is during a leap second, the previous second is used.
  7634. * @param julianDate - The date to be converted.
  7635. * @returns A new instance representing the provided date.
  7636. */
  7637. toDate(julianDate: JulianDate): Date;
  7638. /**
  7639. * Creates an ISO8601 representation of the provided date.
  7640. * @param julianDate - The date to be converted.
  7641. * @param [precision] - The number of fractional digits used to represent the seconds component. By default, the most precise representation is used.
  7642. * @returns The ISO8601 representation of the provided date.
  7643. */
  7644. toIso8601(julianDate: JulianDate, precision?: number): string;
  7645. /**
  7646. * Duplicates a JulianDate instance.
  7647. * @param julianDate - The date to duplicate.
  7648. * @param [result] - An existing instance to use for the result.
  7649. * @returns The modified result parameter or a new instance if none was provided. Returns undefined if julianDate is undefined.
  7650. */
  7651. clone(julianDate: JulianDate, result?: JulianDate): JulianDate;
  7652. /**
  7653. * Compares two instances.
  7654. * @param left - The first instance.
  7655. * @param right - The second instance.
  7656. * @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.
  7657. */
  7658. compare(left: JulianDate, right: JulianDate): number;
  7659. /**
  7660. * Compares two instances and returns <code>true</code> if they are equal, <code>false</code> otherwise.
  7661. * @param [left] - The first instance.
  7662. * @param [right] - The second instance.
  7663. * @returns <code>true</code> if the dates are equal; otherwise, <code>false</code>.
  7664. */
  7665. equals(left?: JulianDate, right?: JulianDate): boolean;
  7666. /**
  7667. * Compares two instances and returns <code>true</code> if they are within <code>epsilon</code> seconds of
  7668. * each other. That is, in order for the dates to be considered equal (and for
  7669. * this function to return <code>true</code>), the absolute value of the difference between them, in
  7670. * seconds, must be less than <code>epsilon</code>.
  7671. * @param [left] - The first instance.
  7672. * @param [right] - The second instance.
  7673. * @param [epsilon = 0] - The maximum number of seconds that should separate the two instances.
  7674. * @returns <code>true</code> if the two dates are within <code>epsilon</code> seconds of each other; otherwise <code>false</code>.
  7675. */
  7676. equalsEpsilon(left?: JulianDate, right?: JulianDate, epsilon?: number): boolean;
  7677. /**
  7678. * Computes the total number of whole and fractional days represented by the provided instance.
  7679. * @param julianDate - The date.
  7680. * @returns The Julian date as single floating point number.
  7681. */
  7682. totalDays(julianDate: JulianDate): number;
  7683. /**
  7684. * Computes the difference in seconds between the provided instance.
  7685. * @param left - The first instance.
  7686. * @param right - The second instance.
  7687. * @returns The difference, in seconds, when subtracting <code>right</code> from <code>left</code>.
  7688. */
  7689. secondsDifference(left: JulianDate, right: JulianDate): number;
  7690. /**
  7691. * Computes the difference in days between the provided instance.
  7692. * @param left - The first instance.
  7693. * @param right - The second instance.
  7694. * @returns The difference, in days, when subtracting <code>right</code> from <code>left</code>.
  7695. */
  7696. daysDifference(left: JulianDate, right: JulianDate): number;
  7697. /**
  7698. * Computes the number of seconds the provided instance is ahead of UTC.
  7699. * @param julianDate - The date.
  7700. * @returns The number of seconds the provided instance is ahead of UTC
  7701. */
  7702. computeTaiMinusUtc(julianDate: JulianDate): number;
  7703. /**
  7704. * Adds the provided number of seconds to the provided date instance.
  7705. * @param julianDate - The date.
  7706. * @param seconds - The number of seconds to add or subtract.
  7707. * @param result - An existing instance to use for the result.
  7708. * @returns The modified result parameter.
  7709. */
  7710. addSeconds(julianDate: JulianDate, seconds: number, result: JulianDate): JulianDate;
  7711. /**
  7712. * Adds the provided number of minutes to the provided date instance.
  7713. * @param julianDate - The date.
  7714. * @param minutes - The number of minutes to add or subtract.
  7715. * @param result - An existing instance to use for the result.
  7716. * @returns The modified result parameter.
  7717. */
  7718. addMinutes(julianDate: JulianDate, minutes: number, result: JulianDate): JulianDate;
  7719. /**
  7720. * Adds the provided number of hours to the provided date instance.
  7721. * @param julianDate - The date.
  7722. * @param hours - The number of hours to add or subtract.
  7723. * @param result - An existing instance to use for the result.
  7724. * @returns The modified result parameter.
  7725. */
  7726. addHours(julianDate: JulianDate, hours: number, result: JulianDate): JulianDate;
  7727. /**
  7728. * Adds the provided number of days to the provided date instance.
  7729. * @param julianDate - The date.
  7730. * @param days - The number of days to add or subtract.
  7731. * @param result - An existing instance to use for the result.
  7732. * @returns The modified result parameter.
  7733. */
  7734. addDays(julianDate: JulianDate, days: number, result: JulianDate): JulianDate;
  7735. /**
  7736. * Compares the provided instances and returns <code>true</code> if <code>left</code> is earlier than <code>right</code>, <code>false</code> otherwise.
  7737. * @param left - The first instance.
  7738. * @param right - The second instance.
  7739. * @returns <code>true</code> if <code>left</code> is earlier than <code>right</code>, <code>false</code> otherwise.
  7740. */
  7741. lessThan(left: JulianDate, right: JulianDate): boolean;
  7742. /**
  7743. * 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.
  7744. * @param left - The first instance.
  7745. * @param right - The second instance.
  7746. * @returns <code>true</code> if <code>left</code> is earlier than or equal to <code>right</code>, <code>false</code> otherwise.
  7747. */
  7748. lessThanOrEquals(left: JulianDate, right: JulianDate): boolean;
  7749. /**
  7750. * Compares the provided instances and returns <code>true</code> if <code>left</code> is later than <code>right</code>, <code>false</code> otherwise.
  7751. * @param left - The first instance.
  7752. * @param right - The second instance.
  7753. * @returns <code>true</code> if <code>left</code> is later than <code>right</code>, <code>false</code> otherwise.
  7754. */
  7755. greaterThan(left: JulianDate, right: JulianDate): boolean;
  7756. /**
  7757. * 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.
  7758. * @param left - The first instance.
  7759. * @param right - The second instance.
  7760. * @returns <code>true</code> if <code>left</code> is later than or equal to <code>right</code>, <code>false</code> otherwise.
  7761. */
  7762. greaterThanOrEquals(left: JulianDate, right: JulianDate): boolean;
  7763. /**
  7764. * Duplicates this instance.
  7765. * @param [result] - An existing instance to use for the result.
  7766. * @returns The modified result parameter or a new instance if none was provided.
  7767. */
  7768. clone(result?: JulianDate): JulianDate;
  7769. /**
  7770. * Compares this and the provided instance and returns <code>true</code> if they are equal, <code>false</code> otherwise.
  7771. * @param [right] - The second instance.
  7772. * @returns <code>true</code> if the dates are equal; otherwise, <code>false</code>.
  7773. */
  7774. equals(right?: JulianDate): boolean;
  7775. /**
  7776. * Compares this and the provided instance and returns <code>true</code> if they are within <code>epsilon</code> seconds of
  7777. * each other. That is, in order for the dates to be considered equal (and for
  7778. * this function to return <code>true</code>), the absolute value of the difference between them, in
  7779. * seconds, must be less than <code>epsilon</code>.
  7780. * @param [right] - The second instance.
  7781. * @param [epsilon = 0] - The maximum number of seconds that should separate the two instances.
  7782. * @returns <code>true</code> if the two dates are within <code>epsilon</code> seconds of each other; otherwise <code>false</code>.
  7783. */
  7784. equalsEpsilon(right?: JulianDate, epsilon?: number): boolean;
  7785. /**
  7786. * Creates a string representing this date in ISO8601 format.
  7787. * @returns A string representing this date in ISO8601 format.
  7788. */
  7789. toString(): string;
  7790. /**
  7791. * Gets or sets the list of leap seconds used throughout SuperMap.
  7792. */
  7793. leapSeconds: LeapSecond[];
  7794. }
  7795. /**
  7796. * This enumerated type is for representing keyboard modifiers. These are keys
  7797. * that are held down in addition to other event types.
  7798. */
  7799. export enum KeyboardEventModifier {
  7800. /**
  7801. * Represents the shift key being held down.
  7802. */
  7803. SHIFT = 0,
  7804. /**
  7805. * Represents the control key being held down.
  7806. */
  7807. CTRL = 1,
  7808. /**
  7809. * Represents the alt key being held down.
  7810. */
  7811. ALT = 2
  7812. }
  7813. /**
  7814. * An {@link InterpolationAlgorithm} for performing Lagrange interpolation.
  7815. */
  7816. export namespace LagrangePolynomialApproximation {
  7817. /**
  7818. * Given the desired degree, returns the number of data points required for interpolation.
  7819. * @param degree - The desired degree of interpolation.
  7820. * @returns The number of required data points needed for the desired degree of interpolation.
  7821. */
  7822. function getRequiredDataPoints(degree: number): number;
  7823. /**
  7824. * Interpolates values using Lagrange Polynomial Approximation.
  7825. * @param x - The independent variable for which the dependent variables will be interpolated.
  7826. * @param xTable - The array of independent variables to use to interpolate. The values
  7827. * in this array must be in increasing order and the same value must not occur twice in the array.
  7828. * @param yTable - The array of dependent variables to use to interpolate. For a set of three
  7829. * dependent values (p,q,w) at time 1 and time 2 this should be as follows: {p1, q1, w1, p2, q2, w2}.
  7830. * @param yStride - The number of dependent variable values in yTable corresponding to
  7831. * each independent variable value in xTable.
  7832. * @param [result] - An existing array into which to store the result.
  7833. * @returns The array of interpolated values, or the result parameter if one was provided.
  7834. */
  7835. function interpolateOrderZero(x: number, xTable: number[], yTable: number[], yStride: number, result?: number[]): number[];
  7836. }
  7837. /**
  7838. * Describes a single leap second, which is constructed from a {@link JulianDate} and a
  7839. * numerical offset representing the number of seconds TAI is ahead of the UTC time standard.
  7840. * @param [date] - A Julian date representing the time of the leap second.
  7841. * @param [offset] - The cumulative number of seconds that TAI is ahead of UTC at the provided date.
  7842. */
  7843. export class LeapSecond {
  7844. constructor(date?: JulianDate, offset?: number);
  7845. /**
  7846. * Gets or sets the date at which this leap second occurs.
  7847. */
  7848. julianDate: JulianDate;
  7849. /**
  7850. * Gets or sets the cumulative number of seconds between the UTC and TAI time standards at the time
  7851. * of this leap second.
  7852. */
  7853. offset: number;
  7854. }
  7855. /**
  7856. * An {@link InterpolationAlgorithm} for performing linear interpolation.
  7857. */
  7858. export namespace LinearApproximation {
  7859. /**
  7860. * Given the desired degree, returns the number of data points required for interpolation.
  7861. * Since linear interpolation can only generate a first degree polynomial, this function
  7862. * always returns 2.
  7863. * @param degree - The desired degree of interpolation.
  7864. * @returns This function always returns 2.
  7865. */
  7866. function getRequiredDataPoints(degree: number): number;
  7867. /**
  7868. * Interpolates values using linear approximation.
  7869. * @param x - The independent variable for which the dependent variables will be interpolated.
  7870. * @param xTable - The array of independent variables to use to interpolate. The values
  7871. * in this array must be in increasing order and the same value must not occur twice in the array.
  7872. * @param yTable - The array of dependent variables to use to interpolate. For a set of three
  7873. * dependent values (p,q,w) at time 1 and time 2 this should be as follows: {p1, q1, w1, p2, q2, w2}.
  7874. * @param yStride - The number of dependent variable values in yTable corresponding to
  7875. * each independent variable value in xTable.
  7876. * @param [result] - An existing array into which to store the result.
  7877. * @returns The array of interpolated values, or the result parameter if one was provided.
  7878. */
  7879. function interpolateOrderZero(x: number, xTable: number[], yTable: number[], yStride: number, result?: number[]): number[];
  7880. }
  7881. /**
  7882. * A spline that uses piecewise linear interpolation to create a curve.
  7883. * @example
  7884. * const times = [ 0.0, 1.5, 3.0, 4.5, 6.0 ];
  7885. * const spline = new SuperMap.LinearSpline({
  7886. * times : times,
  7887. * points : [
  7888. * new SuperMap.Cartesian3(1235398.0, -4810983.0, 4146266.0),
  7889. * new SuperMap.Cartesian3(1372574.0, -5345182.0, 4606657.0),
  7890. * new SuperMap.Cartesian3(-757983.0, -5542796.0, 4514323.0),
  7891. * new SuperMap.Cartesian3(-2821260.0, -5248423.0, 4021290.0),
  7892. * new SuperMap.Cartesian3(-2539788.0, -4724797.0, 3620093.0)
  7893. * ]
  7894. * });
  7895. *
  7896. * const p0 = spline.evaluate(times[0]);
  7897. * @param options - Object with the following properties:
  7898. * @param options.times - An array of strictly increasing, unit-less, floating-point times at each point.
  7899. * The values are in no way connected to the clock time. They are the parameterization for the curve.
  7900. * @param options.points - The array of control points.
  7901. */
  7902. export class LinearSpline {
  7903. constructor(options: {
  7904. times: number[];
  7905. points: number[] | Cartesian3[];
  7906. });
  7907. /**
  7908. * An array of times for the control points.
  7909. */
  7910. readonly times: number[];
  7911. /**
  7912. * An array of {@link Cartesian3} control points.
  7913. */
  7914. readonly points: number[] | Cartesian3[];
  7915. /**
  7916. * Finds an index <code>i</code> in <code>times</code> such that the parameter
  7917. * <code>time</code> is in the interval <code>[times[i], times[i + 1]]</code>.
  7918. * @param time - The time.
  7919. * @returns The index for the element at the start of the interval.
  7920. */
  7921. findTimeInterval(time: number): number;
  7922. /**
  7923. * Wraps the given time to the period covered by the spline.
  7924. * @param time - The time.
  7925. * @returns The time, wrapped around to the updated animation.
  7926. */
  7927. wrapTime(time: number): number;
  7928. /**
  7929. * Clamps the given time to the period covered by the spline.
  7930. * @param time - The time.
  7931. * @returns The time, clamped to the animation period.
  7932. */
  7933. clampTime(time: number): number;
  7934. /**
  7935. * Evaluates the curve at a given time.
  7936. * @param time - The time at which to evaluate the curve.
  7937. * @param [result] - The object onto which to store the result.
  7938. * @returns The modified result parameter or a new instance of the point on the curve at the given time.
  7939. */
  7940. evaluate(time: number, result?: Cartesian3): number | Cartesian3;
  7941. }
  7942. /**
  7943. * Defines how geodetic ellipsoid coordinates ({@link Cartographic}) project to a
  7944. * flat map like SuperMap's 2D and Columbus View modes.
  7945. */
  7946. export class MapProjection {
  7947. constructor();
  7948. /**
  7949. * Gets the {@link Ellipsoid}.
  7950. */
  7951. readonly ellipsoid: Ellipsoid;
  7952. /**
  7953. * Projects {@link Cartographic} coordinates, in radians, to projection-specific map coordinates, in meters.
  7954. * @param cartographic - The coordinates to project.
  7955. * @param [result] - An instance into which to copy the result. If this parameter is
  7956. * undefined, a new instance is created and returned.
  7957. * @returns The projected coordinates. If the result parameter is not undefined, the
  7958. * coordinates are copied there and that instance is returned. Otherwise, a new instance is
  7959. * created and returned.
  7960. */
  7961. project(cartographic: Cartographic, result?: Cartesian3): Cartesian3;
  7962. /**
  7963. * Unprojects projection-specific map {@link Cartesian3} coordinates, in meters, to {@link Cartographic}
  7964. * coordinates, in radians.
  7965. * @param cartesian - The Cartesian position to unproject with height (z) in meters.
  7966. * @param [result] - An instance into which to copy the result. If this parameter is
  7967. * undefined, a new instance is created and returned.
  7968. * @returns The unprojected coordinates. If the result parameter is not undefined, the
  7969. * coordinates are copied there and that instance is returned. Otherwise, a new instance is
  7970. * created and returned.
  7971. */
  7972. unproject(cartesian: Cartesian3, result?: Cartographic): Cartographic;
  7973. }
  7974. /**
  7975. * Math functions.
  7976. */
  7977. export namespace Math {
  7978. /**
  7979. * 0.1
  7980. */
  7981. const EPSILON1 = 0.1;
  7982. /**
  7983. * 0.01
  7984. */
  7985. const EPSILON2 = 0.01;
  7986. /**
  7987. * 0.001
  7988. */
  7989. const EPSILON3 = 0.001;
  7990. /**
  7991. * 0.0001
  7992. */
  7993. const EPSILON4 = 0.0001;
  7994. /**
  7995. * 0.00001
  7996. */
  7997. const EPSILON5 = 0.00001;
  7998. /**
  7999. * 0.000001
  8000. */
  8001. const EPSILON6 = 0.000001;
  8002. /**
  8003. * 0.0000001
  8004. */
  8005. const EPSILON7 = 1e-7;
  8006. /**
  8007. * 0.00000001
  8008. */
  8009. const EPSILON8 = 1e-8;
  8010. /**
  8011. * 0.000000001
  8012. */
  8013. const EPSILON9 = 1e-9;
  8014. /**
  8015. * 0.0000000001
  8016. */
  8017. const EPSILON10 = 1e-10;
  8018. /**
  8019. * 0.00000000001
  8020. */
  8021. const EPSILON11 = 1e-11;
  8022. /**
  8023. * 0.000000000001
  8024. */
  8025. const EPSILON12 = 1e-12;
  8026. /**
  8027. * 0.0000000000001
  8028. */
  8029. const EPSILON13 = 1e-13;
  8030. /**
  8031. * 0.00000000000001
  8032. */
  8033. const EPSILON14 = 1e-14;
  8034. /**
  8035. * 0.000000000000001
  8036. */
  8037. const EPSILON15 = 1e-15;
  8038. /**
  8039. * 0.0000000000000001
  8040. */
  8041. const EPSILON16 = 1e-16;
  8042. /**
  8043. * 0.00000000000000001
  8044. */
  8045. const EPSILON17 = 1e-17;
  8046. /**
  8047. * 0.000000000000000001
  8048. */
  8049. const EPSILON18 = 1e-18;
  8050. /**
  8051. * 0.0000000000000000001
  8052. */
  8053. const EPSILON19 = 1e-19;
  8054. /**
  8055. * 0.00000000000000000001
  8056. */
  8057. const EPSILON20 = 1e-20;
  8058. /**
  8059. * 0.000000000000000000001
  8060. */
  8061. const EPSILON21 = 1e-21;
  8062. /**
  8063. * The gravitational parameter of the Earth in meters cubed
  8064. * per second squared as defined by the WGS84 model: 3.986004418e14
  8065. */
  8066. const GRAVITATIONALPARAMETER = 398600441800000;
  8067. /**
  8068. * Radius of the sun in meters: 6.955e8
  8069. */
  8070. const SOLAR_RADIUS = 695500000;
  8071. /**
  8072. * The mean radius of the moon, according to the "Report of the IAU/IAG Working Group on
  8073. * Cartographic Coordinates and Rotational Elements of the Planets and satellites: 2000",
  8074. * Celestial Mechanics 82: 83-110, 2002.
  8075. */
  8076. const LUNAR_RADIUS = 1737400;
  8077. /**
  8078. * 64 * 1024
  8079. */
  8080. const SIXTY_FOUR_KILOBYTES: number;
  8081. /**
  8082. * 4 * 1024 * 1024 * 1024
  8083. */
  8084. const FOUR_GIGABYTES: number;
  8085. /**
  8086. * Returns the sign of the value; 1 if the value is positive, -1 if the value is
  8087. * negative, or 0 if the value is 0.
  8088. * @param value - The value to return the sign of.
  8089. * @returns The sign of value.
  8090. */
  8091. function sign(value: number): number;
  8092. /**
  8093. * Returns 1.0 if the given value is positive or zero, and -1.0 if it is negative.
  8094. * This is similar to {@link Math#sign} except that returns 1.0 instead of
  8095. * 0.0 when the input value is 0.0.
  8096. * @param value - The value to return the sign of.
  8097. * @returns The sign of value.
  8098. */
  8099. function signNotZero(value: number): number;
  8100. /**
  8101. * Converts a scalar value in the range [-1.0, 1.0] to a SNORM in the range [0, rangeMaximum]
  8102. * @param value - The scalar value in the range [-1.0, 1.0]
  8103. * @param [rangeMaximum = 255] - The maximum value in the mapped range, 255 by default.
  8104. * @returns A SNORM value, where 0 maps to -1.0 and rangeMaximum maps to 1.0.
  8105. */
  8106. function toSNorm(value: number, rangeMaximum?: number): number;
  8107. /**
  8108. * Converts a SNORM value in the range [0, rangeMaximum] to a scalar in the range [-1.0, 1.0].
  8109. * @param value - SNORM value in the range [0, rangeMaximum]
  8110. * @param [rangeMaximum = 255] - The maximum value in the SNORM range, 255 by default.
  8111. * @returns Scalar in the range [-1.0, 1.0].
  8112. */
  8113. function fromSNorm(value: number, rangeMaximum?: number): number;
  8114. /**
  8115. * Converts a scalar value in the range [rangeMinimum, rangeMaximum] to a scalar in the range [0.0, 1.0]
  8116. * @param value - The scalar value in the range [rangeMinimum, rangeMaximum]
  8117. * @param rangeMinimum - The minimum value in the mapped range.
  8118. * @param rangeMaximum - The maximum value in the mapped range.
  8119. * @returns A scalar value, where rangeMinimum maps to 0.0 and rangeMaximum maps to 1.0.
  8120. */
  8121. function normalize(value: number, rangeMinimum: number, rangeMaximum: number): number;
  8122. /**
  8123. * Returns the hyperbolic sine of a number.
  8124. * The hyperbolic sine of <em>value</em> is defined to be
  8125. * (<em>e<sup>x</sup>&nbsp;-&nbsp;e<sup>-x</sup></em>)/2.0
  8126. * where <i>e</i> is Euler's number, approximately 2.71828183.
  8127. *
  8128. * <p>Special cases:
  8129. * <ul>
  8130. * <li>If the argument is NaN, then the result is NaN.</li>
  8131. *
  8132. * <li>If the argument is infinite, then the result is an infinity
  8133. * with the same sign as the argument.</li>
  8134. *
  8135. * <li>If the argument is zero, then the result is a zero with the
  8136. * same sign as the argument.</li>
  8137. * </ul>
  8138. * </p>
  8139. * @param value - The number whose hyperbolic sine is to be returned.
  8140. * @returns The hyperbolic sine of <code>value</code>.
  8141. */
  8142. function sinh(value: number): number;
  8143. /**
  8144. * Returns the hyperbolic cosine of a number.
  8145. * The hyperbolic cosine of <strong>value</strong> is defined to be
  8146. * (<em>e<sup>x</sup>&nbsp;+&nbsp;e<sup>-x</sup></em>)/2.0
  8147. * where <i>e</i> is Euler's number, approximately 2.71828183.
  8148. *
  8149. * <p>Special cases:
  8150. * <ul>
  8151. * <li>If the argument is NaN, then the result is NaN.</li>
  8152. *
  8153. * <li>If the argument is infinite, then the result is positive infinity.</li>
  8154. *
  8155. * <li>If the argument is zero, then the result is 1.0.</li>
  8156. * </ul>
  8157. * </p>
  8158. * @param value - The number whose hyperbolic cosine is to be returned.
  8159. * @returns The hyperbolic cosine of <code>value</code>.
  8160. */
  8161. function cosh(value: number): number;
  8162. /**
  8163. * Computes the linear interpolation of two values.
  8164. * @example
  8165. * const n = SuperMap.Math.lerp(0.0, 2.0, 0.5); // returns 1.0
  8166. * @param p - The start value to interpolate.
  8167. * @param q - The end value to interpolate.
  8168. * @param time - The time of interpolation generally in the range <code>[0.0, 1.0]</code>.
  8169. * @returns The linearly interpolated value.
  8170. */
  8171. function lerp(p: number, q: number, time: number): number;
  8172. /**
  8173. * pi
  8174. */
  8175. const PI: number;
  8176. /**
  8177. * 1/pi
  8178. */
  8179. const ONE_OVER_PI: number;
  8180. /**
  8181. * pi/2
  8182. */
  8183. const PI_OVER_TWO: number;
  8184. /**
  8185. * pi/3
  8186. */
  8187. const PI_OVER_THREE: number;
  8188. /**
  8189. * pi/4
  8190. */
  8191. const PI_OVER_FOUR: number;
  8192. /**
  8193. * pi/6
  8194. */
  8195. const PI_OVER_SIX: number;
  8196. /**
  8197. * 3pi/2
  8198. */
  8199. const THREE_PI_OVER_TWO: number;
  8200. /**
  8201. * 2pi
  8202. */
  8203. const TWO_PI: number;
  8204. /**
  8205. * 1/2pi
  8206. */
  8207. const ONE_OVER_TWO_PI: number;
  8208. /**
  8209. * The number of radians in a degree.
  8210. */
  8211. const RADIANS_PER_DEGREE: number;
  8212. /**
  8213. * The number of degrees in a radian.
  8214. */
  8215. const DEGREES_PER_RADIAN: number;
  8216. /**
  8217. * The number of radians in an arc second.
  8218. */
  8219. const RADIANS_PER_ARCSECOND: number;
  8220. /**
  8221. * Converts degrees to radians.
  8222. * @param degrees - The angle to convert in degrees.
  8223. * @returns The corresponding angle in radians.
  8224. */
  8225. function toRadians(degrees: number): number;
  8226. /**
  8227. * Converts radians to degrees.
  8228. * @param radians - The angle to convert in radians.
  8229. * @returns The corresponding angle in degrees.
  8230. */
  8231. function toDegrees(radians: number): number;
  8232. /**
  8233. * Converts a longitude value, in radians, to the range [<code>-Math.PI</code>, <code>Math.PI</code>).
  8234. * @example
  8235. * // Convert 270 degrees to -90 degrees longitude
  8236. * const longitude = SuperMap.Math.convertLongitudeRange(SuperMap.Math.toRadians(270.0));
  8237. * @param angle - The longitude value, in radians, to convert to the range [<code>-Math.PI</code>, <code>Math.PI</code>).
  8238. * @returns The equivalent longitude value in the range [<code>-Math.PI</code>, <code>Math.PI</code>).
  8239. */
  8240. function convertLongitudeRange(angle: number): number;
  8241. /**
  8242. * Convenience function that clamps a latitude value, in radians, to the range [<code>-Math.PI/2</code>, <code>Math.PI/2</code>).
  8243. * Useful for sanitizing data before use in objects requiring correct range.
  8244. * @example
  8245. * // Clamp 108 degrees latitude to 90 degrees latitude
  8246. * const latitude = SuperMap.Math.clampToLatitudeRange(SuperMap.Math.toRadians(108.0));
  8247. * @param angle - The latitude value, in radians, to clamp to the range [<code>-Math.PI/2</code>, <code>Math.PI/2</code>).
  8248. * @returns The latitude value clamped to the range [<code>-Math.PI/2</code>, <code>Math.PI/2</code>).
  8249. */
  8250. function clampToLatitudeRange(angle: number): number;
  8251. /**
  8252. * Produces an angle in the range -Pi <= angle <= Pi which is equivalent to the provided angle.
  8253. * @param angle - in radians
  8254. * @returns The angle in the range [<code>-Math.PI</code>, <code>Math.PI</code>].
  8255. */
  8256. function negativePiToPi(angle: number): number;
  8257. /**
  8258. * Produces an angle in the range 0 <= angle <= 2Pi which is equivalent to the provided angle.
  8259. * @param angle - in radians
  8260. * @returns The angle in the range [0, <code>Math.TWO_PI</code>].
  8261. */
  8262. function zeroToTwoPi(angle: number): number;
  8263. /**
  8264. * The modulo operation that also works for negative dividends.
  8265. * @param m - The dividend.
  8266. * @param n - The divisor.
  8267. * @returns The remainder.
  8268. */
  8269. function mod(m: number, n: number): number;
  8270. /**
  8271. * Determines if two values are equal using an absolute or relative tolerance test. This is useful
  8272. * to avoid problems due to roundoff error when comparing floating-point values directly. The values are
  8273. * first compared using an absolute tolerance test. If that fails, a relative tolerance test is performed.
  8274. * Use this test if you are unsure of the magnitudes of left and right.
  8275. * @example
  8276. * const a = SuperMap.Math.equalsEpsilon(0.0, 0.01, SuperMap.Math.EPSILON2); // true
  8277. * const b = SuperMap.Math.equalsEpsilon(0.0, 0.1, SuperMap.Math.EPSILON2); // false
  8278. * const c = SuperMap.Math.equalsEpsilon(3699175.1634344, 3699175.2, SuperMap.Math.EPSILON7); // true
  8279. * const d = SuperMap.Math.equalsEpsilon(3699175.1634344, 3699175.2, SuperMap.Math.EPSILON9); // false
  8280. * @param left - The first value to compare.
  8281. * @param right - The other value to compare.
  8282. * @param [relativeEpsilon = 0] - The maximum inclusive delta between <code>left</code> and <code>right</code> for the relative tolerance test.
  8283. * @param [absoluteEpsilon = relativeEpsilon] - The maximum inclusive delta between <code>left</code> and <code>right</code> for the absolute tolerance test.
  8284. * @returns <code>true</code> if the values are equal within the epsilon; otherwise, <code>false</code>.
  8285. */
  8286. function equalsEpsilon(left: number, right: number, relativeEpsilon?: number, absoluteEpsilon?: number): boolean;
  8287. /**
  8288. * Determines if the left value is less than the right value. If the two values are within
  8289. * <code>absoluteEpsilon</code> of each other, they are considered equal and this function returns false.
  8290. * @param left - The first number to compare.
  8291. * @param right - The second number to compare.
  8292. * @param absoluteEpsilon - The absolute epsilon to use in comparison.
  8293. * @returns <code>true</code> if <code>left</code> is less than <code>right</code> by more than
  8294. * <code>absoluteEpsilon<code>. <code>false</code> if <code>left</code> is greater or if the two
  8295. * values are nearly equal.
  8296. */
  8297. function lessThan(left: number, right: number, absoluteEpsilon: number): boolean;
  8298. /**
  8299. * Determines if the left value is less than or equal to the right value. If the two values are within
  8300. * <code>absoluteEpsilon</code> of each other, they are considered equal and this function returns true.
  8301. * @param left - The first number to compare.
  8302. * @param right - The second number to compare.
  8303. * @param absoluteEpsilon - The absolute epsilon to use in comparison.
  8304. * @returns <code>true</code> if <code>left</code> is less than <code>right</code> or if the
  8305. * the values are nearly equal.
  8306. */
  8307. function lessThanOrEquals(left: number, right: number, absoluteEpsilon: number): boolean;
  8308. /**
  8309. * Determines if the left value is greater the right value. If the two values are within
  8310. * <code>absoluteEpsilon</code> of each other, they are considered equal and this function returns false.
  8311. * @param left - The first number to compare.
  8312. * @param right - The second number to compare.
  8313. * @param absoluteEpsilon - The absolute epsilon to use in comparison.
  8314. * @returns <code>true</code> if <code>left</code> is greater than <code>right</code> by more than
  8315. * <code>absoluteEpsilon<code>. <code>false</code> if <code>left</code> is less or if the two
  8316. * values are nearly equal.
  8317. */
  8318. function greaterThan(left: number, right: number, absoluteEpsilon: number): boolean;
  8319. /**
  8320. * Determines if the left value is greater than or equal to the right value. If the two values are within
  8321. * <code>absoluteEpsilon</code> of each other, they are considered equal and this function returns true.
  8322. * @param left - The first number to compare.
  8323. * @param right - The second number to compare.
  8324. * @param absoluteEpsilon - The absolute epsilon to use in comparison.
  8325. * @returns <code>true</code> if <code>left</code> is greater than <code>right</code> or if the
  8326. * the values are nearly equal.
  8327. */
  8328. function greaterThanOrEquals(left: number, right: number, absoluteEpsilon: number): boolean;
  8329. /**
  8330. * Computes the factorial of the provided number.
  8331. * @example
  8332. * //Compute 7!, which is equal to 5040
  8333. * const computedFactorial = SuperMap.Math.factorial(7);
  8334. * @param n - The number whose factorial is to be computed.
  8335. * @returns The factorial of the provided number or undefined if the number is less than 0.
  8336. */
  8337. function factorial(n: number): number;
  8338. /**
  8339. * Increments a number with a wrapping to a minimum value if the number exceeds the maximum value.
  8340. * @example
  8341. * const n = SuperMap.Math.incrementWrap(5, 10, 0); // returns 6
  8342. * const m = SuperMap.Math.incrementWrap(10, 10, 0); // returns 0
  8343. * @param [n] - The number to be incremented.
  8344. * @param [maximumValue] - The maximum incremented value before rolling over to the minimum value.
  8345. * @param [minimumValue = 0.0] - The number reset to after the maximum value has been exceeded.
  8346. * @returns The incremented number.
  8347. */
  8348. function incrementWrap(n?: number, maximumValue?: number, minimumValue?: number): number;
  8349. /**
  8350. * Determines if a non-negative integer is a power of two.
  8351. * The maximum allowed input is (2^32)-1 due to 32-bit bitwise operator limitation in Javascript.
  8352. * @example
  8353. * const t = SuperMap.Math.isPowerOfTwo(16); // true
  8354. * const f = SuperMap.Math.isPowerOfTwo(20); // false
  8355. * @param n - The integer to test in the range [0, (2^32)-1].
  8356. * @returns <code>true</code> if the number if a power of two; otherwise, <code>false</code>.
  8357. */
  8358. function isPowerOfTwo(n: number): boolean;
  8359. /**
  8360. * Computes the next power-of-two integer greater than or equal to the provided non-negative integer.
  8361. * The maximum allowed input is 2^31 due to 32-bit bitwise operator limitation in Javascript.
  8362. * @example
  8363. * const n = SuperMap.Math.nextPowerOfTwo(29); // 32
  8364. * const m = SuperMap.Math.nextPowerOfTwo(32); // 32
  8365. * @param n - The integer to test in the range [0, 2^31].
  8366. * @returns The next power-of-two integer.
  8367. */
  8368. function nextPowerOfTwo(n: number): number;
  8369. /**
  8370. * Computes the previous power-of-two integer less than or equal to the provided non-negative integer.
  8371. * The maximum allowed input is (2^32)-1 due to 32-bit bitwise operator limitation in Javascript.
  8372. * @example
  8373. * const n = SuperMap.Math.previousPowerOfTwo(29); // 16
  8374. * const m = SuperMap.Math.previousPowerOfTwo(32); // 32
  8375. * @param n - The integer to test in the range [0, (2^32)-1].
  8376. * @returns The previous power-of-two integer.
  8377. */
  8378. function previousPowerOfTwo(n: number): number;
  8379. /**
  8380. * Constraint a value to lie between two values.
  8381. * @param value - The value to clamp.
  8382. * @param min - The minimum value.
  8383. * @param max - The maximum value.
  8384. * @returns The clamped value such that min <= result <= max.
  8385. */
  8386. function clamp(value: number, min: number, max: number): number;
  8387. /**
  8388. * Sets the seed used by the random number generator
  8389. * in {@link Math#nextRandomNumber}.
  8390. * @param seed - An integer used as the seed.
  8391. */
  8392. function setRandomNumberSeed(seed: number): void;
  8393. /**
  8394. * Generates a random floating point number in the range of [0.0, 1.0)
  8395. * using a Mersenne twister.
  8396. * @returns A random number in the range of [0.0, 1.0).
  8397. */
  8398. function nextRandomNumber(): number;
  8399. /**
  8400. * Generates a random number between two numbers.
  8401. * @param min - The minimum value.
  8402. * @param max - The maximum value.
  8403. * @returns A random number between the min and max.
  8404. */
  8405. function randomBetween(min: number, max: number): number;
  8406. /**
  8407. * Computes <code>Math.acos(value)</code>, but first clamps <code>value</code> to the range [-1.0, 1.0]
  8408. * so that the function will never return NaN.
  8409. * @param value - The value for which to compute acos.
  8410. * @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,
  8411. * whichever is closer, if the value is outside the range.
  8412. */
  8413. function acosClamped(value: number): number;
  8414. /**
  8415. * Computes <code>Math.asin(value)</code>, but first clamps <code>value</code> to the range [-1.0, 1.0]
  8416. * so that the function will never return NaN.
  8417. * @param value - The value for which to compute asin.
  8418. * @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,
  8419. * whichever is closer, if the value is outside the range.
  8420. */
  8421. function asinClamped(value: number): number;
  8422. /**
  8423. * Finds the chord length between two points given the circle's radius and the angle between the points.
  8424. * @param angle - The angle between the two points.
  8425. * @param radius - The radius of the circle.
  8426. * @returns The chord length.
  8427. */
  8428. function chordLength(angle: number, radius: number): number;
  8429. /**
  8430. * Finds the logarithm of a number to a base.
  8431. * @param number - The number.
  8432. * @param base - The base.
  8433. * @returns The result.
  8434. */
  8435. function logBase(number: number, base: number): number;
  8436. /**
  8437. * Finds the cube root of a number.
  8438. * Returns NaN if <code>number</code> is not provided.
  8439. * @param [number] - The number.
  8440. * @returns The result.
  8441. */
  8442. function cbrt(number?: number): number;
  8443. /**
  8444. * Finds the base 2 logarithm of a number.
  8445. * @param number - The number.
  8446. * @returns The result.
  8447. */
  8448. function log2(number: number): number;
  8449. /**
  8450. * Computes a fast approximation of Atan for input in the range [-1, 1].
  8451. *
  8452. * Based on Michal Drobot's approximation from ShaderFastLibs,
  8453. * which in turn is based on "Efficient approximations for the arctangent function,"
  8454. * Rajan, S. Sichun Wang Inkol, R. Joyal, A., May 2006.
  8455. * Adapted from ShaderFastLibs under MIT License.
  8456. * @param x - An input number in the range [-1, 1]
  8457. * @returns An approximation of atan(x)
  8458. */
  8459. function fastApproximateAtan(x: number): number;
  8460. /**
  8461. * Computes a fast approximation of Atan2(x, y) for arbitrary input scalars.
  8462. *
  8463. * Range reduction math based on nvidia's cg reference implementation: http://developer.download.nvidia.com/cg/atan2.html
  8464. * @param x - An input number that isn't zero if y is zero.
  8465. * @param y - An input number that isn't zero if x is zero.
  8466. * @returns An approximation of atan2(x, y)
  8467. */
  8468. function fastApproximateAtan2(x: number, y: number): number;
  8469. }
  8470. export interface Matrix2 extends ArrayLike<number> {
  8471. }
  8472. /**
  8473. * A 2x2 matrix, indexable as a column-major order array.
  8474. * Constructor parameters are in row-major order for code readability.
  8475. * @param [column0Row0 = 0.0] - The value for column 0, row 0.
  8476. * @param [column1Row0 = 0.0] - The value for column 1, row 0.
  8477. * @param [column0Row1 = 0.0] - The value for column 0, row 1.
  8478. * @param [column1Row1 = 0.0] - The value for column 1, row 1.
  8479. */
  8480. export class Matrix2 implements ArrayLike<number> {
  8481. constructor(column0Row0?: number, column1Row0?: number, column0Row1?: number, column1Row1?: number);
  8482. /**
  8483. * The number of elements used to pack the object into an array.
  8484. */
  8485. packedLength: number;
  8486. /**
  8487. * Stores the provided instance into the provided array.
  8488. * @param value - The value to pack.
  8489. * @param array - The array to pack into.
  8490. * @param [startingIndex = 0] - The index into the array at which to start packing the elements.
  8491. * @returns The array that was packed into
  8492. */
  8493. pack(value: Matrix2, array: number[], startingIndex?: number): number[];
  8494. /**
  8495. * Retrieves an instance from a packed array.
  8496. * @param array - The packed array.
  8497. * @param [startingIndex = 0] - The starting index of the element to be unpacked.
  8498. * @param [result] - The object into which to store the result.
  8499. * @returns The modified result parameter or a new Matrix2 instance if one was not provided.
  8500. */
  8501. unpack(array: number[], startingIndex?: number, result?: Matrix2): Matrix2;
  8502. /**
  8503. * Flattens an array of Matrix2s into an array of components. The components
  8504. * are stored in column-major order.
  8505. * @param array - The array of matrices to pack.
  8506. * @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.
  8507. * @returns The packed array.
  8508. */
  8509. packArray(array: Matrix2[], result?: number[]): number[];
  8510. /**
  8511. * Unpacks an array of column-major matrix components into an array of Matrix2s.
  8512. * @param array - The array of components to unpack.
  8513. * @param [result] - The array onto which to store the result.
  8514. * @returns The unpacked array.
  8515. */
  8516. unpackArray(array: number[], result?: Matrix2[]): Matrix2[];
  8517. /**
  8518. * Duplicates a Matrix2 instance.
  8519. * @param matrix - The matrix to duplicate.
  8520. * @param [result] - The object onto which to store the result.
  8521. * @returns The modified result parameter or a new Matrix2 instance if one was not provided. (Returns undefined if matrix is undefined)
  8522. */
  8523. clone(matrix: Matrix2, result?: Matrix2): Matrix2;
  8524. /**
  8525. * Creates a Matrix2 from 4 consecutive elements in an array.
  8526. * @example
  8527. * // Create the Matrix2:
  8528. * // [1.0, 2.0]
  8529. * // [1.0, 2.0]
  8530. *
  8531. * const v = [1.0, 1.0, 2.0, 2.0];
  8532. * const m = SuperMap.Matrix2.fromArray(v);
  8533. *
  8534. * // Create same Matrix2 with using an offset into an array
  8535. * const v2 = [0.0, 0.0, 1.0, 1.0, 2.0, 2.0];
  8536. * const m2 = SuperMap.Matrix2.fromArray(v2, 2);
  8537. * @param array - The array whose 4 consecutive elements correspond to the positions of the matrix. Assumes column-major order.
  8538. * @param [startingIndex = 0] - The offset into the array of the first element, which corresponds to first column first row position in the matrix.
  8539. * @param [result] - The object onto which to store the result.
  8540. * @returns The modified result parameter or a new Matrix2 instance if one was not provided.
  8541. */
  8542. fromArray(array: number[], startingIndex?: number, result?: Matrix2): Matrix2;
  8543. /**
  8544. * Creates a Matrix2 instance from a column-major order array.
  8545. * @param values - The column-major order array.
  8546. * @param [result] - The object in which the result will be stored, if undefined a new instance will be created.
  8547. * @returns The modified result parameter, or a new Matrix2 instance if one was not provided.
  8548. */
  8549. fromColumnMajorArray(values: number[], result?: Matrix2): Matrix2;
  8550. /**
  8551. * Creates a Matrix2 instance from a row-major order array.
  8552. * The resulting matrix will be in column-major order.
  8553. * @param values - The row-major order array.
  8554. * @param [result] - The object in which the result will be stored, if undefined a new instance will be created.
  8555. * @returns The modified result parameter, or a new Matrix2 instance if one was not provided.
  8556. */
  8557. fromRowMajorArray(values: number[], result?: Matrix2): Matrix2;
  8558. /**
  8559. * Computes a Matrix2 instance representing a non-uniform scale.
  8560. * @example
  8561. * // Creates
  8562. * // [7.0, 0.0]
  8563. * // [0.0, 8.0]
  8564. * const m = SuperMap.Matrix2.fromScale(new SuperMap.Cartesian2(7.0, 8.0));
  8565. * @param scale - The x and y scale factors.
  8566. * @param [result] - The object in which the result will be stored, if undefined a new instance will be created.
  8567. * @returns The modified result parameter, or a new Matrix2 instance if one was not provided.
  8568. */
  8569. fromScale(scale: Cartesian2, result?: Matrix2): Matrix2;
  8570. /**
  8571. * Computes a Matrix2 instance representing a uniform scale.
  8572. * @example
  8573. * // Creates
  8574. * // [2.0, 0.0]
  8575. * // [0.0, 2.0]
  8576. * const m = SuperMap.Matrix2.fromUniformScale(2.0);
  8577. * @param scale - The uniform scale factor.
  8578. * @param [result] - The object in which the result will be stored, if undefined a new instance will be created.
  8579. * @returns The modified result parameter, or a new Matrix2 instance if one was not provided.
  8580. */
  8581. fromUniformScale(scale: number, result?: Matrix2): Matrix2;
  8582. /**
  8583. * Creates a rotation matrix.
  8584. * @example
  8585. * // Rotate a point 45 degrees counterclockwise.
  8586. * const p = new SuperMap.Cartesian2(5, 6);
  8587. * const m = SuperMap.Matrix2.fromRotation(SuperMap.Math.toRadians(45.0));
  8588. * const rotated = SuperMap.Matrix2.multiplyByVector(m, p, new SuperMap.Cartesian2());
  8589. * @param angle - The angle, in radians, of the rotation. Positive angles are counterclockwise.
  8590. * @param [result] - The object in which the result will be stored, if undefined a new instance will be created.
  8591. * @returns The modified result parameter, or a new Matrix2 instance if one was not provided.
  8592. */
  8593. fromRotation(angle: number, result?: Matrix2): Matrix2;
  8594. /**
  8595. * Creates an Array from the provided Matrix2 instance.
  8596. * The array will be in column-major order.
  8597. * @param matrix - The matrix to use..
  8598. * @param [result] - The Array onto which to store the result.
  8599. * @returns The modified Array parameter or a new Array instance if one was not provided.
  8600. */
  8601. toArray(matrix: Matrix2, result?: number[]): number[];
  8602. /**
  8603. * Computes the array index of the element at the provided row and column.
  8604. * @example
  8605. * const myMatrix = new SuperMap.Matrix2();
  8606. * const column1Row0Index = SuperMap.Matrix2.getElementIndex(1, 0);
  8607. * const column1Row0 = myMatrix[column1Row0Index]
  8608. * myMatrix[column1Row0Index] = 10.0;
  8609. * @param row - The zero-based index of the row.
  8610. * @param column - The zero-based index of the column.
  8611. * @returns The index of the element at the provided row and column.
  8612. */
  8613. getElementIndex(row: number, column: number): number;
  8614. /**
  8615. * Retrieves a copy of the matrix column at the provided index as a Cartesian2 instance.
  8616. * @param matrix - The matrix to use.
  8617. * @param index - The zero-based index of the column to retrieve.
  8618. * @param result - The object onto which to store the result.
  8619. * @returns The modified result parameter.
  8620. */
  8621. getColumn(matrix: Matrix2, index: number, result: Cartesian2): Cartesian2;
  8622. /**
  8623. * Computes a new matrix that replaces the specified column in the provided matrix with the provided Cartesian2 instance.
  8624. * @param matrix - The matrix to use.
  8625. * @param index - The zero-based index of the column to set.
  8626. * @param cartesian - The Cartesian whose values will be assigned to the specified column.
  8627. * @param result - The object onto which to store the result.
  8628. * @returns The modified result parameter.
  8629. */
  8630. setColumn(matrix: Matrix2, index: number, cartesian: Cartesian2, result: Cartesian2): Matrix2;
  8631. /**
  8632. * Retrieves a copy of the matrix row at the provided index as a Cartesian2 instance.
  8633. * @param matrix - The matrix to use.
  8634. * @param index - The zero-based index of the row to retrieve.
  8635. * @param result - The object onto which to store the result.
  8636. * @returns The modified result parameter.
  8637. */
  8638. getRow(matrix: Matrix2, index: number, result: Cartesian2): Cartesian2;
  8639. /**
  8640. * Computes a new matrix that replaces the specified row in the provided matrix with the provided Cartesian2 instance.
  8641. * @param matrix - The matrix to use.
  8642. * @param index - The zero-based index of the row to set.
  8643. * @param cartesian - The Cartesian whose values will be assigned to the specified row.
  8644. * @param result - The object onto which to store the result.
  8645. * @returns The modified result parameter.
  8646. */
  8647. setRow(matrix: Matrix2, index: number, cartesian: Cartesian2, result: Matrix2): Matrix2;
  8648. /**
  8649. * Computes a new matrix that replaces the scale with the provided scale.
  8650. * This assumes the matrix is an affine transformation.
  8651. * @param matrix - The matrix to use.
  8652. * @param scale - The scale that replaces the scale of the provided matrix.
  8653. * @param result - The object onto which to store the result.
  8654. * @returns The modified result parameter.
  8655. */
  8656. setScale(matrix: Matrix2, scale: Cartesian2, result: Matrix2): Matrix2;
  8657. /**
  8658. * Computes a new matrix that replaces the scale with the provided uniform scale.
  8659. * This assumes the matrix is an affine transformation.
  8660. * @param matrix - The matrix to use.
  8661. * @param scale - The uniform scale that replaces the scale of the provided matrix.
  8662. * @param result - The object onto which to store the result.
  8663. * @returns The modified result parameter.
  8664. */
  8665. setUniformScale(matrix: Matrix2, scale: number, result: Matrix2): Matrix2;
  8666. /**
  8667. * Extracts the non-uniform scale assuming the matrix is an affine transformation.
  8668. * @param matrix - The matrix.
  8669. * @param result - The object onto which to store the result.
  8670. * @returns The modified result parameter.
  8671. */
  8672. getScale(matrix: Matrix2, result: Cartesian2): Cartesian2;
  8673. /**
  8674. * Computes the maximum scale assuming the matrix is an affine transformation.
  8675. * The maximum scale is the maximum length of the column vectors.
  8676. * @param matrix - The matrix.
  8677. * @returns The maximum scale.
  8678. */
  8679. getMaximumScale(matrix: Matrix2): number;
  8680. /**
  8681. * Sets the rotation assuming the matrix is an affine transformation.
  8682. * @param matrix - The matrix.
  8683. * @param rotation - The rotation matrix.
  8684. * @returns The modified result parameter.
  8685. */
  8686. setRotation(matrix: Matrix2, rotation: Matrix2): Matrix2;
  8687. /**
  8688. * Extracts the rotation matrix assuming the matrix is an affine transformation.
  8689. * @param matrix - The matrix.
  8690. * @param result - The object onto which to store the result.
  8691. * @returns The modified result parameter.
  8692. */
  8693. getRotation(matrix: Matrix2, result: Matrix2): Matrix2;
  8694. /**
  8695. * Computes the product of two matrices.
  8696. * @param left - The first matrix.
  8697. * @param right - The second matrix.
  8698. * @param result - The object onto which to store the result.
  8699. * @returns The modified result parameter.
  8700. */
  8701. multiply(left: Matrix2, right: Matrix2, result: Matrix2): Matrix2;
  8702. /**
  8703. * Computes the sum of two matrices.
  8704. * @param left - The first matrix.
  8705. * @param right - The second matrix.
  8706. * @param result - The object onto which to store the result.
  8707. * @returns The modified result parameter.
  8708. */
  8709. add(left: Matrix2, right: Matrix2, result: Matrix2): Matrix2;
  8710. /**
  8711. * Computes the difference of two matrices.
  8712. * @param left - The first matrix.
  8713. * @param right - The second matrix.
  8714. * @param result - The object onto which to store the result.
  8715. * @returns The modified result parameter.
  8716. */
  8717. subtract(left: Matrix2, right: Matrix2, result: Matrix2): Matrix2;
  8718. /**
  8719. * Computes the product of a matrix and a column vector.
  8720. * @param matrix - The matrix.
  8721. * @param cartesian - The column.
  8722. * @param result - The object onto which to store the result.
  8723. * @returns The modified result parameter.
  8724. */
  8725. multiplyByVector(matrix: Matrix2, cartesian: Cartesian2, result: Cartesian2): Cartesian2;
  8726. /**
  8727. * Computes the product of a matrix and a scalar.
  8728. * @param matrix - The matrix.
  8729. * @param scalar - The number to multiply by.
  8730. * @param result - The object onto which to store the result.
  8731. * @returns The modified result parameter.
  8732. */
  8733. multiplyByScalar(matrix: Matrix2, scalar: number, result: Matrix2): Matrix2;
  8734. /**
  8735. * Computes the product of a matrix times a (non-uniform) scale, as if the scale were a scale matrix.
  8736. * @example
  8737. * // Instead of SuperMap.Matrix2.multiply(m, SuperMap.Matrix2.fromScale(scale), m);
  8738. * SuperMap.Matrix2.multiplyByScale(m, scale, m);
  8739. * @param matrix - The matrix on the left-hand side.
  8740. * @param scale - The non-uniform scale on the right-hand side.
  8741. * @param result - The object onto which to store the result.
  8742. * @returns The modified result parameter.
  8743. */
  8744. multiplyByScale(matrix: Matrix2, scale: number, result: Matrix2): Matrix2;
  8745. /**
  8746. * Computes the product of a matrix times a uniform scale, as if the scale were a scale matrix.
  8747. * @example
  8748. * // Instead of SuperMap.Matrix2.multiply(m, SuperMap.Matrix2.fromUniformScale(scale), m);
  8749. * SuperMap.Matrix2.multiplyByUniformScale(m, scale, m);
  8750. * @param matrix - The matrix on the left-hand side.
  8751. * @param scale - The uniform scale on the right-hand side.
  8752. * @param result - The object onto which to store the result.
  8753. * @returns The modified result parameter.
  8754. */
  8755. multiplyByUniformScale(matrix: Matrix2, scale: number, result: Matrix2): Matrix2;
  8756. /**
  8757. * Creates a negated copy of the provided matrix.
  8758. * @param matrix - The matrix to negate.
  8759. * @param result - The object onto which to store the result.
  8760. * @returns The modified result parameter.
  8761. */
  8762. negate(matrix: Matrix2, result: Matrix2): Matrix2;
  8763. /**
  8764. * Computes the transpose of the provided matrix.
  8765. * @param matrix - The matrix to transpose.
  8766. * @param result - The object onto which to store the result.
  8767. * @returns The modified result parameter.
  8768. */
  8769. transpose(matrix: Matrix2, result: Matrix2): Matrix2;
  8770. /**
  8771. * Computes a matrix, which contains the absolute (unsigned) values of the provided matrix's elements.
  8772. * @param matrix - The matrix with signed elements.
  8773. * @param result - The object onto which to store the result.
  8774. * @returns The modified result parameter.
  8775. */
  8776. abs(matrix: Matrix2, result: Matrix2): Matrix2;
  8777. /**
  8778. * Compares the provided matrices componentwise and returns
  8779. * <code>true</code> if they are equal, <code>false</code> otherwise.
  8780. * @param [left] - The first matrix.
  8781. * @param [right] - The second matrix.
  8782. * @returns <code>true</code> if left and right are equal, <code>false</code> otherwise.
  8783. */
  8784. equals(left?: Matrix2, right?: Matrix2): boolean;
  8785. /**
  8786. * Compares the provided matrices componentwise and returns
  8787. * <code>true</code> if they are within the provided epsilon,
  8788. * <code>false</code> otherwise.
  8789. * @param [left] - The first matrix.
  8790. * @param [right] - The second matrix.
  8791. * @param [epsilon = 0] - The epsilon to use for equality testing.
  8792. * @returns <code>true</code> if left and right are within the provided epsilon, <code>false</code> otherwise.
  8793. */
  8794. equalsEpsilon(left?: Matrix2, right?: Matrix2, epsilon?: number): boolean;
  8795. /**
  8796. * An immutable Matrix2 instance initialized to the identity matrix.
  8797. */
  8798. readonly IDENTITY: Matrix2;
  8799. /**
  8800. * An immutable Matrix2 instance initialized to the zero matrix.
  8801. */
  8802. readonly ZERO: Matrix2;
  8803. /**
  8804. * The index into Matrix2 for column 0, row 0.
  8805. * @example
  8806. * const matrix = new SuperMap.Matrix2();
  8807. * matrix[SuperMap.Matrix2.COLUMN0ROW0] = 5.0; // set column 0, row 0 to 5.0
  8808. */
  8809. readonly COLUMN0ROW0: number;
  8810. /**
  8811. * The index into Matrix2 for column 0, row 1.
  8812. * @example
  8813. * const matrix = new SuperMap.Matrix2();
  8814. * matrix[SuperMap.Matrix2.COLUMN0ROW1] = 5.0; // set column 0, row 1 to 5.0
  8815. */
  8816. readonly COLUMN0ROW1: number;
  8817. /**
  8818. * The index into Matrix2 for column 1, row 0.
  8819. * @example
  8820. * const matrix = new SuperMap.Matrix2();
  8821. * matrix[SuperMap.Matrix2.COLUMN1ROW0] = 5.0; // set column 1, row 0 to 5.0
  8822. */
  8823. readonly COLUMN1ROW0: number;
  8824. /**
  8825. * The index into Matrix2 for column 1, row 1.
  8826. * @example
  8827. * const matrix = new SuperMap.Matrix2();
  8828. * matrix[SuperMap.Matrix2.COLUMN1ROW1] = 5.0; // set column 1, row 1 to 5.0
  8829. */
  8830. readonly COLUMN1ROW1: number;
  8831. /**
  8832. * Gets the number of items in the collection.
  8833. */
  8834. length: number;
  8835. /**
  8836. * Duplicates the provided Matrix2 instance.
  8837. * @param [result] - The object onto which to store the result.
  8838. * @returns The modified result parameter or a new Matrix2 instance if one was not provided.
  8839. */
  8840. clone(result?: Matrix2): Matrix2;
  8841. /**
  8842. * Compares this matrix to the provided matrix componentwise and returns
  8843. * <code>true</code> if they are equal, <code>false</code> otherwise.
  8844. * @param [right] - The right hand side matrix.
  8845. * @returns <code>true</code> if they are equal, <code>false</code> otherwise.
  8846. */
  8847. equals(right?: Matrix2): boolean;
  8848. /**
  8849. * Compares this matrix to the provided matrix componentwise and returns
  8850. * <code>true</code> if they are within the provided epsilon,
  8851. * <code>false</code> otherwise.
  8852. * @param [right] - The right hand side matrix.
  8853. * @param [epsilon = 0] - The epsilon to use for equality testing.
  8854. * @returns <code>true</code> if they are within the provided epsilon, <code>false</code> otherwise.
  8855. */
  8856. equalsEpsilon(right?: Matrix2, epsilon?: number): boolean;
  8857. /**
  8858. * Creates a string representing this Matrix with each row being
  8859. * on a separate line and in the format '(column0, column1)'.
  8860. * @returns A string representing the provided Matrix with each row being on a separate line and in the format '(column0, column1)'.
  8861. */
  8862. toString(): string;
  8863. }
  8864. export interface Matrix3 extends ArrayLike<number> {
  8865. }
  8866. /**
  8867. * A 3x3 matrix, indexable as a column-major order array.
  8868. * Constructor parameters are in row-major order for code readability.
  8869. * @param [column0Row0 = 0.0] - The value for column 0, row 0.
  8870. * @param [column1Row0 = 0.0] - The value for column 1, row 0.
  8871. * @param [column2Row0 = 0.0] - The value for column 2, row 0.
  8872. * @param [column0Row1 = 0.0] - The value for column 0, row 1.
  8873. * @param [column1Row1 = 0.0] - The value for column 1, row 1.
  8874. * @param [column2Row1 = 0.0] - The value for column 2, row 1.
  8875. * @param [column0Row2 = 0.0] - The value for column 0, row 2.
  8876. * @param [column1Row2 = 0.0] - The value for column 1, row 2.
  8877. * @param [column2Row2 = 0.0] - The value for column 2, row 2.
  8878. */
  8879. export class Matrix3 implements ArrayLike<number> {
  8880. constructor(column0Row0?: number, column1Row0?: number, column2Row0?: number, column0Row1?: number, column1Row1?: number, column2Row1?: number, column0Row2?: number, column1Row2?: number, column2Row2?: number);
  8881. /**
  8882. * The number of elements used to pack the object into an array.
  8883. */
  8884. packedLength: number;
  8885. /**
  8886. * Stores the provided instance into the provided array.
  8887. * @param value - The value to pack.
  8888. * @param array - The array to pack into.
  8889. * @param [startingIndex = 0] - The index into the array at which to start packing the elements.
  8890. * @returns The array that was packed into
  8891. */
  8892. pack(value: Matrix3, array: number[], startingIndex?: number): number[];
  8893. /**
  8894. * Retrieves an instance from a packed array.
  8895. * @param array - The packed array.
  8896. * @param [startingIndex = 0] - The starting index of the element to be unpacked.
  8897. * @param [result] - The object into which to store the result.
  8898. * @returns The modified result parameter or a new Matrix3 instance if one was not provided.
  8899. */
  8900. unpack(array: number[], startingIndex?: number, result?: Matrix3): Matrix3;
  8901. /**
  8902. * Flattens an array of Matrix3s into an array of components. The components
  8903. * are stored in column-major order.
  8904. * @param array - The array of matrices to pack.
  8905. * @param [result] - The array onto which to store the result. If this is a typed array, it must have array.length * 9 components, else a {@link DeveloperError} will be thrown. If it is a regular array, it will be resized to have (array.length * 9) elements.
  8906. * @returns The packed array.
  8907. */
  8908. packArray(array: Matrix3[], result?: number[]): number[];
  8909. /**
  8910. * Unpacks an array of column-major matrix components into an array of Matrix3s.
  8911. * @param array - The array of components to unpack.
  8912. * @param [result] - The array onto which to store the result.
  8913. * @returns The unpacked array.
  8914. */
  8915. unpackArray(array: number[], result?: Matrix3[]): Matrix3[];
  8916. /**
  8917. * Duplicates a Matrix3 instance.
  8918. * @param matrix - The matrix to duplicate.
  8919. * @param [result] - The object onto which to store the result.
  8920. * @returns The modified result parameter or a new Matrix3 instance if one was not provided. (Returns undefined if matrix is undefined)
  8921. */
  8922. clone(matrix: Matrix3, result?: Matrix3): Matrix3;
  8923. /**
  8924. * Creates a Matrix3 from 9 consecutive elements in an array.
  8925. * @example
  8926. * // Create the Matrix3:
  8927. * // [1.0, 2.0, 3.0]
  8928. * // [1.0, 2.0, 3.0]
  8929. * // [1.0, 2.0, 3.0]
  8930. *
  8931. * const v = [1.0, 1.0, 1.0, 2.0, 2.0, 2.0, 3.0, 3.0, 3.0];
  8932. * const m = SuperMap.Matrix3.fromArray(v);
  8933. *
  8934. * // Create same Matrix3 with using an offset into an array
  8935. * const v2 = [0.0, 0.0, 1.0, 1.0, 1.0, 2.0, 2.0, 2.0, 3.0, 3.0, 3.0];
  8936. * const m2 = SuperMap.Matrix3.fromArray(v2, 2);
  8937. * @param array - The array whose 9 consecutive elements correspond to the positions of the matrix. Assumes column-major order.
  8938. * @param [startingIndex = 0] - The offset into the array of the first element, which corresponds to first column first row position in the matrix.
  8939. * @param [result] - The object onto which to store the result.
  8940. * @returns The modified result parameter or a new Matrix3 instance if one was not provided.
  8941. */
  8942. fromArray(array: number[], startingIndex?: number, result?: Matrix3): Matrix3;
  8943. /**
  8944. * Creates a Matrix3 instance from a column-major order array.
  8945. * @param values - The column-major order array.
  8946. * @param [result] - The object in which the result will be stored, if undefined a new instance will be created.
  8947. * @returns The modified result parameter, or a new Matrix3 instance if one was not provided.
  8948. */
  8949. fromColumnMajorArray(values: number[], result?: Matrix3): Matrix3;
  8950. /**
  8951. * Creates a Matrix3 instance from a row-major order array.
  8952. * The resulting matrix will be in column-major order.
  8953. * @param values - The row-major order array.
  8954. * @param [result] - The object in which the result will be stored, if undefined a new instance will be created.
  8955. * @returns The modified result parameter, or a new Matrix3 instance if one was not provided.
  8956. */
  8957. fromRowMajorArray(values: number[], result?: Matrix3): Matrix3;
  8958. /**
  8959. * Computes a 3x3 rotation matrix from the provided quaternion.
  8960. * @param quaternion - the quaternion to use.
  8961. * @param [result] - The object in which the result will be stored, if undefined a new instance will be created.
  8962. * @returns The 3x3 rotation matrix from this quaternion.
  8963. */
  8964. fromQuaternion(quaternion: Quaternion, result?: Matrix3): Matrix3;
  8965. /**
  8966. * Computes a 3x3 rotation matrix from the provided headingPitchRoll. (see http://en.wikipedia.org/wiki/Conversion_between_quaternions_and_Euler_angles )
  8967. * @param headingPitchRoll - the headingPitchRoll to use.
  8968. * @param [result] - The object in which the result will be stored, if undefined a new instance will be created.
  8969. * @returns The 3x3 rotation matrix from this headingPitchRoll.
  8970. */
  8971. fromHeadingPitchRoll(headingPitchRoll: HeadingPitchRoll, result?: Matrix3): Matrix3;
  8972. /**
  8973. * Computes a Matrix3 instance representing a non-uniform scale.
  8974. * @example
  8975. * // Creates
  8976. * // [7.0, 0.0, 0.0]
  8977. * // [0.0, 8.0, 0.0]
  8978. * // [0.0, 0.0, 9.0]
  8979. * const m = SuperMap.Matrix3.fromScale(new SuperMap.Cartesian3(7.0, 8.0, 9.0));
  8980. * @param scale - The x, y, and z scale factors.
  8981. * @param [result] - The object in which the result will be stored, if undefined a new instance will be created.
  8982. * @returns The modified result parameter, or a new Matrix3 instance if one was not provided.
  8983. */
  8984. fromScale(scale: Cartesian3, result?: Matrix3): Matrix3;
  8985. /**
  8986. * Computes a Matrix3 instance representing a uniform scale.
  8987. * @example
  8988. * // Creates
  8989. * // [2.0, 0.0, 0.0]
  8990. * // [0.0, 2.0, 0.0]
  8991. * // [0.0, 0.0, 2.0]
  8992. * const m = SuperMap.Matrix3.fromUniformScale(2.0);
  8993. * @param scale - The uniform scale factor.
  8994. * @param [result] - The object in which the result will be stored, if undefined a new instance will be created.
  8995. * @returns The modified result parameter, or a new Matrix3 instance if one was not provided.
  8996. */
  8997. fromUniformScale(scale: number, result?: Matrix3): Matrix3;
  8998. /**
  8999. * Computes a Matrix3 instance representing the cross product equivalent matrix of a Cartesian3 vector.
  9000. * @example
  9001. * // Creates
  9002. * // [0.0, -9.0, 8.0]
  9003. * // [9.0, 0.0, -7.0]
  9004. * // [-8.0, 7.0, 0.0]
  9005. * const m = SuperMap.Matrix3.fromCrossProduct(new SuperMap.Cartesian3(7.0, 8.0, 9.0));
  9006. * @param vector - the vector on the left hand side of the cross product operation.
  9007. * @param [result] - The object in which the result will be stored, if undefined a new instance will be created.
  9008. * @returns The modified result parameter, or a new Matrix3 instance if one was not provided.
  9009. */
  9010. fromCrossProduct(vector: Cartesian3, result?: Matrix3): Matrix3;
  9011. /**
  9012. * Creates a rotation matrix around the x-axis.
  9013. * @example
  9014. * // Rotate a point 45 degrees counterclockwise around the x-axis.
  9015. * const p = new SuperMap.Cartesian3(5, 6, 7);
  9016. * const m = SuperMap.Matrix3.fromRotationX(SuperMap.Math.toRadians(45.0));
  9017. * const rotated = SuperMap.Matrix3.multiplyByVector(m, p, new SuperMap.Cartesian3());
  9018. * @param angle - The angle, in radians, of the rotation. Positive angles are counterclockwise.
  9019. * @param [result] - The object in which the result will be stored, if undefined a new instance will be created.
  9020. * @returns The modified result parameter, or a new Matrix3 instance if one was not provided.
  9021. */
  9022. fromRotationX(angle: number, result?: Matrix3): Matrix3;
  9023. /**
  9024. * Creates a rotation matrix around the y-axis.
  9025. * @example
  9026. * // Rotate a point 45 degrees counterclockwise around the y-axis.
  9027. * const p = new SuperMap.Cartesian3(5, 6, 7);
  9028. * const m = SuperMap.Matrix3.fromRotationY(SuperMap.Math.toRadians(45.0));
  9029. * const rotated = SuperMap.Matrix3.multiplyByVector(m, p, new SuperMap.Cartesian3());
  9030. * @param angle - The angle, in radians, of the rotation. Positive angles are counterclockwise.
  9031. * @param [result] - The object in which the result will be stored, if undefined a new instance will be created.
  9032. * @returns The modified result parameter, or a new Matrix3 instance if one was not provided.
  9033. */
  9034. fromRotationY(angle: number, result?: Matrix3): Matrix3;
  9035. /**
  9036. * Creates a rotation matrix around the z-axis.
  9037. * @example
  9038. * // Rotate a point 45 degrees counterclockwise around the z-axis.
  9039. * const p = new SuperMap.Cartesian3(5, 6, 7);
  9040. * const m = SuperMap.Matrix3.fromRotationZ(SuperMap.Math.toRadians(45.0));
  9041. * const rotated = SuperMap.Matrix3.multiplyByVector(m, p, new SuperMap.Cartesian3());
  9042. * @param angle - The angle, in radians, of the rotation. Positive angles are counterclockwise.
  9043. * @param [result] - The object in which the result will be stored, if undefined a new instance will be created.
  9044. * @returns The modified result parameter, or a new Matrix3 instance if one was not provided.
  9045. */
  9046. fromRotationZ(angle: number, result?: Matrix3): Matrix3;
  9047. /**
  9048. * Creates an Array from the provided Matrix3 instance.
  9049. * The array will be in column-major order.
  9050. * @param matrix - The matrix to use..
  9051. * @param [result] - The Array onto which to store the result.
  9052. * @returns The modified Array parameter or a new Array instance if one was not provided.
  9053. */
  9054. toArray(matrix: Matrix3, result?: number[]): number[];
  9055. /**
  9056. * Computes the array index of the element at the provided row and column.
  9057. * @example
  9058. * const myMatrix = new SuperMap.Matrix3();
  9059. * const column1Row0Index = SuperMap.Matrix3.getElementIndex(1, 0);
  9060. * const column1Row0 = myMatrix[column1Row0Index]
  9061. * myMatrix[column1Row0Index] = 10.0;
  9062. * @param column - The zero-based index of the column.
  9063. * @param row - The zero-based index of the row.
  9064. * @returns The index of the element at the provided row and column.
  9065. */
  9066. getElementIndex(column: number, row: number): number;
  9067. /**
  9068. * Retrieves a copy of the matrix column at the provided index as a Cartesian3 instance.
  9069. * @param matrix - The matrix to use.
  9070. * @param index - The zero-based index of the column to retrieve.
  9071. * @param result - The object onto which to store the result.
  9072. * @returns The modified result parameter.
  9073. */
  9074. getColumn(matrix: Matrix3, index: number, result: Cartesian3): Cartesian3;
  9075. /**
  9076. * Computes a new matrix that replaces the specified column in the provided matrix with the provided Cartesian3 instance.
  9077. * @param matrix - The matrix to use.
  9078. * @param index - The zero-based index of the column to set.
  9079. * @param cartesian - The Cartesian whose values will be assigned to the specified column.
  9080. * @param result - The object onto which to store the result.
  9081. * @returns The modified result parameter.
  9082. */
  9083. setColumn(matrix: Matrix3, index: number, cartesian: Cartesian3, result: Matrix3): Matrix3;
  9084. /**
  9085. * Retrieves a copy of the matrix row at the provided index as a Cartesian3 instance.
  9086. * @param matrix - The matrix to use.
  9087. * @param index - The zero-based index of the row to retrieve.
  9088. * @param result - The object onto which to store the result.
  9089. * @returns The modified result parameter.
  9090. */
  9091. getRow(matrix: Matrix3, index: number, result: Cartesian3): Cartesian3;
  9092. /**
  9093. * Computes a new matrix that replaces the specified row in the provided matrix with the provided Cartesian3 instance.
  9094. * @param matrix - The matrix to use.
  9095. * @param index - The zero-based index of the row to set.
  9096. * @param cartesian - The Cartesian whose values will be assigned to the specified row.
  9097. * @param result - The object onto which to store the result.
  9098. * @returns The modified result parameter.
  9099. */
  9100. setRow(matrix: Matrix3, index: number, cartesian: Cartesian3, result: Matrix3): Matrix3;
  9101. /**
  9102. * Computes a new matrix that replaces the scale with the provided scale.
  9103. * This assumes the matrix is an affine transformation.
  9104. * @param matrix - The matrix to use.
  9105. * @param scale - The scale that replaces the scale of the provided matrix.
  9106. * @param result - The object onto which to store the result.
  9107. * @returns The modified result parameter.
  9108. */
  9109. setScale(matrix: Matrix3, scale: Cartesian3, result: Matrix3): Matrix3;
  9110. /**
  9111. * Computes a new matrix that replaces the scale with the provided uniform scale.
  9112. * This assumes the matrix is an affine transformation.
  9113. * @param matrix - The matrix to use.
  9114. * @param scale - The uniform scale that replaces the scale of the provided matrix.
  9115. * @param result - The object onto which to store the result.
  9116. * @returns The modified result parameter.
  9117. */
  9118. setUniformScale(matrix: Matrix3, scale: number, result: Matrix3): Matrix3;
  9119. /**
  9120. * Extracts the non-uniform scale assuming the matrix is an affine transformation.
  9121. * @param matrix - The matrix.
  9122. * @param result - The object onto which to store the result.
  9123. * @returns The modified result parameter.
  9124. */
  9125. getScale(matrix: Matrix3, result: Cartesian3): Cartesian3;
  9126. /**
  9127. * Computes the maximum scale assuming the matrix is an affine transformation.
  9128. * The maximum scale is the maximum length of the column vectors.
  9129. * @param matrix - The matrix.
  9130. * @returns The maximum scale.
  9131. */
  9132. getMaximumScale(matrix: Matrix3): number;
  9133. /**
  9134. * Sets the rotation assuming the matrix is an affine transformation.
  9135. * @param matrix - The matrix.
  9136. * @param rotation - The rotation matrix.
  9137. * @returns The modified result parameter.
  9138. */
  9139. setRotation(matrix: Matrix3, rotation: Matrix3): Matrix3;
  9140. /**
  9141. * Extracts the rotation matrix assuming the matrix is an affine transformation.
  9142. * @param matrix - The matrix.
  9143. * @param result - The object onto which to store the result.
  9144. * @returns The modified result parameter.
  9145. */
  9146. getRotation(matrix: Matrix3, result: Matrix3): Matrix3;
  9147. /**
  9148. * Computes the product of two matrices.
  9149. * @param left - The first matrix.
  9150. * @param right - The second matrix.
  9151. * @param result - The object onto which to store the result.
  9152. * @returns The modified result parameter.
  9153. */
  9154. multiply(left: Matrix3, right: Matrix3, result: Matrix3): Matrix3;
  9155. /**
  9156. * Computes the sum of two matrices.
  9157. * @param left - The first matrix.
  9158. * @param right - The second matrix.
  9159. * @param result - The object onto which to store the result.
  9160. * @returns The modified result parameter.
  9161. */
  9162. add(left: Matrix3, right: Matrix3, result: Matrix3): Matrix3;
  9163. /**
  9164. * Computes the difference of two matrices.
  9165. * @param left - The first matrix.
  9166. * @param right - The second matrix.
  9167. * @param result - The object onto which to store the result.
  9168. * @returns The modified result parameter.
  9169. */
  9170. subtract(left: Matrix3, right: Matrix3, result: Matrix3): Matrix3;
  9171. /**
  9172. * Computes the product of a matrix and a column vector.
  9173. * @param matrix - The matrix.
  9174. * @param cartesian - The column.
  9175. * @param result - The object onto which to store the result.
  9176. * @returns The modified result parameter.
  9177. */
  9178. multiplyByVector(matrix: Matrix3, cartesian: Cartesian3, result: Cartesian3): Cartesian3;
  9179. /**
  9180. * Computes the product of a matrix and a scalar.
  9181. * @param matrix - The matrix.
  9182. * @param scalar - The number to multiply by.
  9183. * @param result - The object onto which to store the result.
  9184. * @returns The modified result parameter.
  9185. */
  9186. multiplyByScalar(matrix: Matrix3, scalar: number, result: Matrix3): Matrix3;
  9187. /**
  9188. * Computes the product of a matrix times a (non-uniform) scale, as if the scale were a scale matrix.
  9189. * @example
  9190. * // Instead of SuperMap.Matrix3.multiply(m, SuperMap.Matrix3.fromScale(scale), m);
  9191. * SuperMap.Matrix3.multiplyByScale(m, scale, m);
  9192. * @param matrix - The matrix on the left-hand side.
  9193. * @param scale - The non-uniform scale on the right-hand side.
  9194. * @param result - The object onto which to store the result.
  9195. * @returns The modified result parameter.
  9196. */
  9197. multiplyByScale(matrix: Matrix3, scale: number, result: Matrix3): Matrix3;
  9198. /**
  9199. * Computes the product of a matrix times a uniform scale, as if the scale were a scale matrix.
  9200. * @example
  9201. * // Instead of SuperMap.Matrix3.multiply(m, SuperMap.Matrix3.fromUniformScale(scale), m);
  9202. * SuperMap.Matrix3.multiplyByUniformScale(m, scale, m);
  9203. * @param matrix - The matrix on the left-hand side.
  9204. * @param scale - The uniform scale on the right-hand side.
  9205. * @param result - The object onto which to store the result.
  9206. * @returns The modified result parameter.
  9207. */
  9208. multiplyByUniformScale(matrix: Matrix3, scale: number, result: Matrix3): Matrix3;
  9209. /**
  9210. * Creates a negated copy of the provided matrix.
  9211. * @param matrix - The matrix to negate.
  9212. * @param result - The object onto which to store the result.
  9213. * @returns The modified result parameter.
  9214. */
  9215. negate(matrix: Matrix3, result: Matrix3): Matrix3;
  9216. /**
  9217. * Computes the transpose of the provided matrix.
  9218. * @param matrix - The matrix to transpose.
  9219. * @param result - The object onto which to store the result.
  9220. * @returns The modified result parameter.
  9221. */
  9222. transpose(matrix: Matrix3, result: Matrix3): Matrix3;
  9223. /**
  9224. * Computes the eigenvectors and eigenvalues of a symmetric matrix.
  9225. * <p>
  9226. * Returns a diagonal matrix and unitary matrix such that:
  9227. * <code>matrix = unitary matrix * diagonal matrix * transpose(unitary matrix)</code>
  9228. * </p>
  9229. * <p>
  9230. * The values along the diagonal of the diagonal matrix are the eigenvalues. The columns
  9231. * of the unitary matrix are the corresponding eigenvectors.
  9232. * </p>
  9233. * @example
  9234. * const a = //... symetric matrix
  9235. * const result = {
  9236. * unitary : new SuperMap.Matrix3(),
  9237. * diagonal : new SuperMap.Matrix3()
  9238. * };
  9239. * SuperMap.Matrix3.computeEigenDecomposition(a, result);
  9240. *
  9241. * const unitaryTranspose = SuperMap.Matrix3.transpose(result.unitary, new SuperMap.Matrix3());
  9242. * const b = SuperMap.Matrix3.multiply(result.unitary, result.diagonal, new SuperMap.Matrix3());
  9243. * SuperMap.Matrix3.multiply(b, unitaryTranspose, b); // b is now equal to a
  9244. *
  9245. * const lambda = SuperMap.Matrix3.getColumn(result.diagonal, 0, new SuperMap.Cartesian3()).x; // first eigenvalue
  9246. * const v = SuperMap.Matrix3.getColumn(result.unitary, 0, new SuperMap.Cartesian3()); // first eigenvector
  9247. * const c = SuperMap.Cartesian3.multiplyByScalar(v, lambda, new SuperMap.Cartesian3()); // equal to SuperMap.Matrix3.multiplyByVector(a, v)
  9248. * @param matrix - The matrix to decompose into diagonal and unitary matrix. Expected to be symmetric.
  9249. * @param [result] - An object with unitary and diagonal properties which are matrices onto which to store the result.
  9250. * @returns An object with unitary and diagonal properties which are the unitary and diagonal matrices, respectively.
  9251. */
  9252. computeEigenDecomposition(matrix: Matrix3, result?: any): any;
  9253. /**
  9254. * Computes a matrix, which contains the absolute (unsigned) values of the provided matrix's elements.
  9255. * @param matrix - The matrix with signed elements.
  9256. * @param result - The object onto which to store the result.
  9257. * @returns The modified result parameter.
  9258. */
  9259. abs(matrix: Matrix3, result: Matrix3): Matrix3;
  9260. /**
  9261. * Computes the determinant of the provided matrix.
  9262. * @param matrix - The matrix to use.
  9263. * @returns The value of the determinant of the matrix.
  9264. */
  9265. determinant(matrix: Matrix3): number;
  9266. /**
  9267. * Computes the inverse of the provided matrix.
  9268. * @param matrix - The matrix to invert.
  9269. * @param result - The object onto which to store the result.
  9270. * @returns The modified result parameter.
  9271. */
  9272. inverse(matrix: Matrix3, result: Matrix3): Matrix3;
  9273. /**
  9274. * Computes the inverse transpose of a matrix.
  9275. * @param matrix - The matrix to transpose and invert.
  9276. * @param result - The object onto which to store the result.
  9277. * @returns The modified result parameter.
  9278. */
  9279. inverseTranspose(matrix: Matrix3, result: Matrix3): Matrix3;
  9280. /**
  9281. * Compares the provided matrices componentwise and returns
  9282. * <code>true</code> if they are equal, <code>false</code> otherwise.
  9283. * @param [left] - The first matrix.
  9284. * @param [right] - The second matrix.
  9285. * @returns <code>true</code> if left and right are equal, <code>false</code> otherwise.
  9286. */
  9287. equals(left?: Matrix3, right?: Matrix3): boolean;
  9288. /**
  9289. * Compares the provided matrices componentwise and returns
  9290. * <code>true</code> if they are within the provided epsilon,
  9291. * <code>false</code> otherwise.
  9292. * @param [left] - The first matrix.
  9293. * @param [right] - The second matrix.
  9294. * @param [epsilon = 0] - The epsilon to use for equality testing.
  9295. * @returns <code>true</code> if left and right are within the provided epsilon, <code>false</code> otherwise.
  9296. */
  9297. equalsEpsilon(left?: Matrix3, right?: Matrix3, epsilon?: number): boolean;
  9298. /**
  9299. * An immutable Matrix3 instance initialized to the identity matrix.
  9300. */
  9301. readonly IDENTITY: Matrix3;
  9302. /**
  9303. * An immutable Matrix3 instance initialized to the zero matrix.
  9304. */
  9305. readonly ZERO: Matrix3;
  9306. /**
  9307. * The index into Matrix3 for column 0, row 0.
  9308. */
  9309. readonly COLUMN0ROW0: number;
  9310. /**
  9311. * The index into Matrix3 for column 0, row 1.
  9312. */
  9313. readonly COLUMN0ROW1: number;
  9314. /**
  9315. * The index into Matrix3 for column 0, row 2.
  9316. */
  9317. readonly COLUMN0ROW2: number;
  9318. /**
  9319. * The index into Matrix3 for column 1, row 0.
  9320. */
  9321. readonly COLUMN1ROW0: number;
  9322. /**
  9323. * The index into Matrix3 for column 1, row 1.
  9324. */
  9325. readonly COLUMN1ROW1: number;
  9326. /**
  9327. * The index into Matrix3 for column 1, row 2.
  9328. */
  9329. readonly COLUMN1ROW2: number;
  9330. /**
  9331. * The index into Matrix3 for column 2, row 0.
  9332. */
  9333. readonly COLUMN2ROW0: number;
  9334. /**
  9335. * The index into Matrix3 for column 2, row 1.
  9336. */
  9337. readonly COLUMN2ROW1: number;
  9338. /**
  9339. * The index into Matrix3 for column 2, row 2.
  9340. */
  9341. readonly COLUMN2ROW2: number;
  9342. /**
  9343. * Gets the number of items in the collection.
  9344. */
  9345. length: number;
  9346. /**
  9347. * Duplicates the provided Matrix3 instance.
  9348. * @param [result] - The object onto which to store the result.
  9349. * @returns The modified result parameter or a new Matrix3 instance if one was not provided.
  9350. */
  9351. clone(result?: Matrix3): Matrix3;
  9352. /**
  9353. * Compares this matrix to the provided matrix componentwise and returns
  9354. * <code>true</code> if they are equal, <code>false</code> otherwise.
  9355. * @param [right] - The right hand side matrix.
  9356. * @returns <code>true</code> if they are equal, <code>false</code> otherwise.
  9357. */
  9358. equals(right?: Matrix3): boolean;
  9359. /**
  9360. * Compares this matrix to the provided matrix componentwise and returns
  9361. * <code>true</code> if they are within the provided epsilon,
  9362. * <code>false</code> otherwise.
  9363. * @param [right] - The right hand side matrix.
  9364. * @param [epsilon = 0] - The epsilon to use for equality testing.
  9365. * @returns <code>true</code> if they are within the provided epsilon, <code>false</code> otherwise.
  9366. */
  9367. equalsEpsilon(right?: Matrix3, epsilon?: number): boolean;
  9368. /**
  9369. * Creates a string representing this Matrix with each row being
  9370. * on a separate line and in the format '(column0, column1, column2)'.
  9371. * @returns A string representing the provided Matrix with each row being on a separate line and in the format '(column0, column1, column2)'.
  9372. */
  9373. toString(): string;
  9374. }
  9375. export interface Matrix4 extends ArrayLike<number> {
  9376. }
  9377. /**
  9378. * A 4x4 matrix, indexable as a column-major order array.
  9379. * Constructor parameters are in row-major order for code readability.
  9380. * @param [column0Row0 = 0.0] - The value for column 0, row 0.
  9381. * @param [column1Row0 = 0.0] - The value for column 1, row 0.
  9382. * @param [column2Row0 = 0.0] - The value for column 2, row 0.
  9383. * @param [column3Row0 = 0.0] - The value for column 3, row 0.
  9384. * @param [column0Row1 = 0.0] - The value for column 0, row 1.
  9385. * @param [column1Row1 = 0.0] - The value for column 1, row 1.
  9386. * @param [column2Row1 = 0.0] - The value for column 2, row 1.
  9387. * @param [column3Row1 = 0.0] - The value for column 3, row 1.
  9388. * @param [column0Row2 = 0.0] - The value for column 0, row 2.
  9389. * @param [column1Row2 = 0.0] - The value for column 1, row 2.
  9390. * @param [column2Row2 = 0.0] - The value for column 2, row 2.
  9391. * @param [column3Row2 = 0.0] - The value for column 3, row 2.
  9392. * @param [column0Row3 = 0.0] - The value for column 0, row 3.
  9393. * @param [column1Row3 = 0.0] - The value for column 1, row 3.
  9394. * @param [column2Row3 = 0.0] - The value for column 2, row 3.
  9395. * @param [column3Row3 = 0.0] - The value for column 3, row 3.
  9396. */
  9397. export class Matrix4 implements ArrayLike<number> {
  9398. 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);
  9399. /**
  9400. * The number of elements used to pack the object into an array.
  9401. */
  9402. packedLength: number;
  9403. /**
  9404. * Stores the provided instance into the provided array.
  9405. * @param value - The value to pack.
  9406. * @param array - The array to pack into.
  9407. * @param [startingIndex = 0] - The index into the array at which to start packing the elements.
  9408. * @returns The array that was packed into
  9409. */
  9410. pack(value: Matrix4, array: number[], startingIndex?: number): number[];
  9411. /**
  9412. * Retrieves an instance from a packed array.
  9413. * @param array - The packed array.
  9414. * @param [startingIndex = 0] - The starting index of the element to be unpacked.
  9415. * @param [result] - The object into which to store the result.
  9416. * @returns The modified result parameter or a new Matrix4 instance if one was not provided.
  9417. */
  9418. unpack(array: number[], startingIndex?: number, result?: Matrix4): Matrix4;
  9419. /**
  9420. * Flattens an array of Matrix4s into an array of components. The components
  9421. * are stored in column-major order.
  9422. * @param array - The array of matrices to pack.
  9423. * @param [result] - The array onto which to store the result. If this is a typed array, it must have array.length * 16 components, else a {@link DeveloperError} will be thrown. If it is a regular array, it will be resized to have (array.length * 16) elements.
  9424. * @returns The packed array.
  9425. */
  9426. packArray(array: Matrix4[], result?: number[]): number[];
  9427. /**
  9428. * Unpacks an array of column-major matrix components into an array of Matrix4s.
  9429. * @param array - The array of components to unpack.
  9430. * @param [result] - The array onto which to store the result.
  9431. * @returns The unpacked array.
  9432. */
  9433. unpackArray(array: number[], result?: Matrix4[]): Matrix4[];
  9434. /**
  9435. * Duplicates a Matrix4 instance.
  9436. * @param matrix - The matrix to duplicate.
  9437. * @param [result] - The object onto which to store the result.
  9438. * @returns The modified result parameter or a new Matrix4 instance if one was not provided. (Returns undefined if matrix is undefined)
  9439. */
  9440. clone(matrix: Matrix4, result?: Matrix4): Matrix4;
  9441. /**
  9442. * Creates a Matrix4 from 16 consecutive elements in an array.
  9443. * @example
  9444. * // Create the Matrix4:
  9445. * // [1.0, 2.0, 3.0, 4.0]
  9446. * // [1.0, 2.0, 3.0, 4.0]
  9447. * // [1.0, 2.0, 3.0, 4.0]
  9448. * // [1.0, 2.0, 3.0, 4.0]
  9449. *
  9450. * const v = [1.0, 1.0, 1.0, 1.0, 2.0, 2.0, 2.0, 2.0, 3.0, 3.0, 3.0, 3.0, 4.0, 4.0, 4.0, 4.0];
  9451. * const m = SuperMap.Matrix4.fromArray(v);
  9452. *
  9453. * // Create same Matrix4 with using an offset into an array
  9454. * const v2 = [0.0, 0.0, 1.0, 1.0, 1.0, 1.0, 2.0, 2.0, 2.0, 2.0, 3.0, 3.0, 3.0, 3.0, 4.0, 4.0, 4.0, 4.0];
  9455. * const m2 = SuperMap.Matrix4.fromArray(v2, 2);
  9456. * @param array - The array whose 16 consecutive elements correspond to the positions of the matrix. Assumes column-major order.
  9457. * @param [startingIndex = 0] - The offset into the array of the first element, which corresponds to first column first row position in the matrix.
  9458. * @param [result] - The object onto which to store the result.
  9459. * @returns The modified result parameter or a new Matrix4 instance if one was not provided.
  9460. */
  9461. fromArray(array: number[], startingIndex?: number, result?: Matrix4): Matrix4;
  9462. /**
  9463. * Computes a Matrix4 instance from a column-major order array.
  9464. * @param values - The column-major order array.
  9465. * @param [result] - The object in which the result will be stored, if undefined a new instance will be created.
  9466. * @returns The modified result parameter, or a new Matrix4 instance if one was not provided.
  9467. */
  9468. fromColumnMajorArray(values: number[], result?: Matrix4): Matrix4;
  9469. /**
  9470. * Computes a Matrix4 instance from a row-major order array.
  9471. * The resulting matrix will be in column-major order.
  9472. * @param values - The row-major order array.
  9473. * @param [result] - The object in which the result will be stored, if undefined a new instance will be created.
  9474. * @returns The modified result parameter, or a new Matrix4 instance if one was not provided.
  9475. */
  9476. fromRowMajorArray(values: number[], result?: Matrix4): Matrix4;
  9477. /**
  9478. * Computes a Matrix4 instance from a Matrix3 representing the rotation
  9479. * and a Cartesian3 representing the translation.
  9480. * @param rotation - The upper left portion of the matrix representing the rotation.
  9481. * @param [translation = Cartesian3.ZERO] - The upper right portion of the matrix representing the translation.
  9482. * @param [result] - The object in which the result will be stored, if undefined a new instance will be created.
  9483. * @returns The modified result parameter, or a new Matrix4 instance if one was not provided.
  9484. */
  9485. fromRotationTranslation(rotation: Matrix3, translation?: Cartesian3, result?: Matrix4): Matrix4;
  9486. /**
  9487. * Computes a Matrix4 instance from a translation, rotation, and scale (TRS)
  9488. * representation with the rotation represented as a quaternion.
  9489. * @example
  9490. * const result = SuperMap.Matrix4.fromTranslationQuaternionRotationScale(
  9491. * new SuperMap.Cartesian3(1.0, 2.0, 3.0), // translation
  9492. * SuperMap.Quaternion.IDENTITY, // rotation
  9493. * new SuperMap.Cartesian3(7.0, 8.0, 9.0), // scale
  9494. * result);
  9495. * @param translation - The translation transformation.
  9496. * @param rotation - The rotation transformation.
  9497. * @param scale - The non-uniform scale transformation.
  9498. * @param [result] - The object in which the result will be stored, if undefined a new instance will be created.
  9499. * @returns The modified result parameter, or a new Matrix4 instance if one was not provided.
  9500. */
  9501. fromTranslationQuaternionRotationScale(translation: Cartesian3, rotation: Quaternion, scale: Cartesian3, result?: Matrix4): Matrix4;
  9502. /**
  9503. * Creates a Matrix4 instance from a {@link TranslationRotationScale} instance.
  9504. * @param translationRotationScale - The instance.
  9505. * @param [result] - The object in which the result will be stored, if undefined a new instance will be created.
  9506. * @returns The modified result parameter, or a new Matrix4 instance if one was not provided.
  9507. */
  9508. fromTranslationRotationScale(translationRotationScale: TranslationRotationScale, result?: Matrix4): Matrix4;
  9509. /**
  9510. * Creates a Matrix4 instance from a Cartesian3 representing the translation.
  9511. * @param translation - The upper right portion of the matrix representing the translation.
  9512. * @param [result] - The object in which the result will be stored, if undefined a new instance will be created.
  9513. * @returns The modified result parameter, or a new Matrix4 instance if one was not provided.
  9514. */
  9515. fromTranslation(translation: Cartesian3, result?: Matrix4): Matrix4;
  9516. /**
  9517. * Computes a Matrix4 instance representing a non-uniform scale.
  9518. * @example
  9519. * // Creates
  9520. * // [7.0, 0.0, 0.0, 0.0]
  9521. * // [0.0, 8.0, 0.0, 0.0]
  9522. * // [0.0, 0.0, 9.0, 0.0]
  9523. * // [0.0, 0.0, 0.0, 1.0]
  9524. * const m = SuperMap.Matrix4.fromScale(new SuperMap.Cartesian3(7.0, 8.0, 9.0));
  9525. * @param scale - The x, y, and z scale factors.
  9526. * @param [result] - The object in which the result will be stored, if undefined a new instance will be created.
  9527. * @returns The modified result parameter, or a new Matrix4 instance if one was not provided.
  9528. */
  9529. fromScale(scale: Cartesian3, result?: Matrix4): Matrix4;
  9530. /**
  9531. * Computes a Matrix4 instance representing a uniform scale.
  9532. * @example
  9533. * // Creates
  9534. * // [2.0, 0.0, 0.0, 0.0]
  9535. * // [0.0, 2.0, 0.0, 0.0]
  9536. * // [0.0, 0.0, 2.0, 0.0]
  9537. * // [0.0, 0.0, 0.0, 1.0]
  9538. * const m = SuperMap.Matrix4.fromUniformScale(2.0);
  9539. * @param scale - The uniform scale factor.
  9540. * @param [result] - The object in which the result will be stored, if undefined a new instance will be created.
  9541. * @returns The modified result parameter, or a new Matrix4 instance if one was not provided.
  9542. */
  9543. fromUniformScale(scale: number, result?: Matrix4): Matrix4;
  9544. /**
  9545. * Creates a rotation matrix.
  9546. * @param rotation - The rotation matrix.
  9547. * @param [result] - The object in which the result will be stored, if undefined a new instance will be created.
  9548. * @returns The modified result parameter, or a new Matrix4 instance if one was not provided.
  9549. */
  9550. fromRotation(rotation: Matrix3, result?: Matrix4): Matrix4;
  9551. /**
  9552. * Computes a Matrix4 instance from a Camera.
  9553. * @param camera - The camera to use.
  9554. * @param [result] - The object in which the result will be stored, if undefined a new instance will be created.
  9555. * @returns The modified result parameter, or a new Matrix4 instance if one was not provided.
  9556. */
  9557. fromCamera(camera: Camera, result?: Matrix4): Matrix4;
  9558. /**
  9559. * Computes a Matrix4 instance representing a perspective transformation matrix.
  9560. * @param fovY - The field of view along the Y axis in radians.
  9561. * @param aspectRatio - The aspect ratio.
  9562. * @param near - The distance to the near plane in meters.
  9563. * @param far - The distance to the far plane in meters.
  9564. * @param result - The object in which the result will be stored.
  9565. * @returns The modified result parameter.
  9566. */
  9567. computePerspectiveFieldOfView(fovY: number, aspectRatio: number, near: number, far: number, result: Matrix4): Matrix4;
  9568. /**
  9569. * Computes a Matrix4 instance representing an orthographic transformation matrix.
  9570. * @param left - The number of meters to the left of the camera that will be in view.
  9571. * @param right - The number of meters to the right of the camera that will be in view.
  9572. * @param bottom - The number of meters below of the camera that will be in view.
  9573. * @param top - The number of meters above of the camera that will be in view.
  9574. * @param near - The distance to the near plane in meters.
  9575. * @param far - The distance to the far plane in meters.
  9576. * @param result - The object in which the result will be stored.
  9577. * @returns The modified result parameter.
  9578. */
  9579. computeOrthographicOffCenter(left: number, right: number, bottom: number, top: number, near: number, far: number, result: Matrix4): Matrix4;
  9580. /**
  9581. * Computes a Matrix4 instance representing an off center perspective transformation.
  9582. * @param left - The number of meters to the left of the camera that will be in view.
  9583. * @param right - The number of meters to the right of the camera that will be in view.
  9584. * @param bottom - The number of meters below of the camera that will be in view.
  9585. * @param top - The number of meters above of the camera that will be in view.
  9586. * @param near - The distance to the near plane in meters.
  9587. * @param far - The distance to the far plane in meters.
  9588. * @param result - The object in which the result will be stored.
  9589. * @returns The modified result parameter.
  9590. */
  9591. computePerspectiveOffCenter(left: number, right: number, bottom: number, top: number, near: number, far: number, result: Matrix4): Matrix4;
  9592. /**
  9593. * Computes a Matrix4 instance representing an infinite off center perspective transformation.
  9594. * @param left - The number of meters to the left of the camera that will be in view.
  9595. * @param right - The number of meters to the right of the camera that will be in view.
  9596. * @param bottom - The number of meters below of the camera that will be in view.
  9597. * @param top - The number of meters above of the camera that will be in view.
  9598. * @param near - The distance to the near plane in meters.
  9599. * @param result - The object in which the result will be stored.
  9600. * @returns The modified result parameter.
  9601. */
  9602. computeInfinitePerspectiveOffCenter(left: number, right: number, bottom: number, top: number, near: number, result: Matrix4): Matrix4;
  9603. /**
  9604. * Computes a Matrix4 instance that transforms from normalized device coordinates to window coordinates.
  9605. * @example
  9606. * // Create viewport transformation using an explicit viewport and depth range.
  9607. * const m = SuperMap.Matrix4.computeViewportTransformation({
  9608. * x : 0.0,
  9609. * y : 0.0,
  9610. * width : 1024.0,
  9611. * height : 768.0
  9612. * }, 0.0, 1.0, new SuperMap.Matrix4());
  9613. * @param [viewport = { x : 0.0, y : 0.0, width : 0.0, height : 0.0 }] - The viewport's corners as shown in Example 1.
  9614. * @param [nearDepthRange = 0.0] - The near plane distance in window coordinates.
  9615. * @param [farDepthRange = 1.0] - The far plane distance in window coordinates.
  9616. * @param [result] - The object in which the result will be stored.
  9617. * @returns The modified result parameter.
  9618. */
  9619. computeViewportTransformation(viewport?: any, nearDepthRange?: number, farDepthRange?: number, result?: Matrix4): Matrix4;
  9620. /**
  9621. * Computes a Matrix4 instance that transforms from world space to view space.
  9622. * @param position - The position of the camera.
  9623. * @param direction - The forward direction.
  9624. * @param up - The up direction.
  9625. * @param right - The right direction.
  9626. * @param result - The object in which the result will be stored.
  9627. * @returns The modified result parameter.
  9628. */
  9629. computeView(position: Cartesian3, direction: Cartesian3, up: Cartesian3, right: Cartesian3, result: Matrix4): Matrix4;
  9630. /**
  9631. * Computes an Array from the provided Matrix4 instance.
  9632. * The array will be in column-major order.
  9633. * @example
  9634. * //create an array from an instance of Matrix4
  9635. * // m = [10.0, 14.0, 18.0, 22.0]
  9636. * // [11.0, 15.0, 19.0, 23.0]
  9637. * // [12.0, 16.0, 20.0, 24.0]
  9638. * // [13.0, 17.0, 21.0, 25.0]
  9639. * const a = SuperMap.Matrix4.toArray(m);
  9640. *
  9641. * // m remains the same
  9642. * //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]
  9643. * @param matrix - The matrix to use..
  9644. * @param [result] - The Array onto which to store the result.
  9645. * @returns The modified Array parameter or a new Array instance if one was not provided.
  9646. */
  9647. toArray(matrix: Matrix4, result?: number[]): number[];
  9648. /**
  9649. * Computes the array index of the element at the provided row and column.
  9650. * @example
  9651. * const myMatrix = new SuperMap.Matrix4();
  9652. * const column1Row0Index = SuperMap.Matrix4.getElementIndex(1, 0);
  9653. * const column1Row0 = myMatrix[column1Row0Index];
  9654. * myMatrix[column1Row0Index] = 10.0;
  9655. * @param row - The zero-based index of the row.
  9656. * @param column - The zero-based index of the column.
  9657. * @returns The index of the element at the provided row and column.
  9658. */
  9659. getElementIndex(row: number, column: number): number;
  9660. /**
  9661. * Retrieves a copy of the matrix column at the provided index as a Cartesian4 instance.
  9662. * @example
  9663. * //returns a Cartesian4 instance with values from the specified column
  9664. * // m = [10.0, 11.0, 12.0, 13.0]
  9665. * // [14.0, 15.0, 16.0, 17.0]
  9666. * // [18.0, 19.0, 20.0, 21.0]
  9667. * // [22.0, 23.0, 24.0, 25.0]
  9668. *
  9669. * //Example 1: Creates an instance of Cartesian
  9670. * const a = SuperMap.Matrix4.getColumn(m, 2, new SuperMap.Cartesian4());
  9671. * @example
  9672. * //Example 2: Sets values for Cartesian instance
  9673. * const a = new SuperMap.Cartesian4();
  9674. * SuperMap.Matrix4.getColumn(m, 2, a);
  9675. *
  9676. * // a.x = 12.0; a.y = 16.0; a.z = 20.0; a.w = 24.0;
  9677. * @param matrix - The matrix to use.
  9678. * @param index - The zero-based index of the column to retrieve.
  9679. * @param result - The object onto which to store the result.
  9680. * @returns The modified result parameter.
  9681. */
  9682. getColumn(matrix: Matrix4, index: number, result: Cartesian4): Cartesian4;
  9683. /**
  9684. * Computes a new matrix that replaces the specified column in the provided matrix with the provided Cartesian4 instance.
  9685. * @example
  9686. * //creates a new Matrix4 instance with new column values from the Cartesian4 instance
  9687. * // m = [10.0, 11.0, 12.0, 13.0]
  9688. * // [14.0, 15.0, 16.0, 17.0]
  9689. * // [18.0, 19.0, 20.0, 21.0]
  9690. * // [22.0, 23.0, 24.0, 25.0]
  9691. *
  9692. * const a = SuperMap.Matrix4.setColumn(m, 2, new SuperMap.Cartesian4(99.0, 98.0, 97.0, 96.0), new SuperMap.Matrix4());
  9693. *
  9694. * // m remains the same
  9695. * // a = [10.0, 11.0, 99.0, 13.0]
  9696. * // [14.0, 15.0, 98.0, 17.0]
  9697. * // [18.0, 19.0, 97.0, 21.0]
  9698. * // [22.0, 23.0, 96.0, 25.0]
  9699. * @param matrix - The matrix to use.
  9700. * @param index - The zero-based index of the column to set.
  9701. * @param cartesian - The Cartesian whose values will be assigned to the specified column.
  9702. * @param result - The object onto which to store the result.
  9703. * @returns The modified result parameter.
  9704. */
  9705. setColumn(matrix: Matrix4, index: number, cartesian: Cartesian4, result: Matrix4): Matrix4;
  9706. /**
  9707. * Retrieves a copy of the matrix row at the provided index as a Cartesian4 instance.
  9708. * @example
  9709. * //returns a Cartesian4 instance with values from the specified column
  9710. * // m = [10.0, 11.0, 12.0, 13.0]
  9711. * // [14.0, 15.0, 16.0, 17.0]
  9712. * // [18.0, 19.0, 20.0, 21.0]
  9713. * // [22.0, 23.0, 24.0, 25.0]
  9714. *
  9715. * //Example 1: Returns an instance of Cartesian
  9716. * const a = SuperMap.Matrix4.getRow(m, 2, new SuperMap.Cartesian4());
  9717. * @example
  9718. * //Example 2: Sets values for a Cartesian instance
  9719. * const a = new SuperMap.Cartesian4();
  9720. * SuperMap.Matrix4.getRow(m, 2, a);
  9721. *
  9722. * // a.x = 18.0; a.y = 19.0; a.z = 20.0; a.w = 21.0;
  9723. * @param matrix - The matrix to use.
  9724. * @param index - The zero-based index of the row to retrieve.
  9725. * @param result - The object onto which to store the result.
  9726. * @returns The modified result parameter.
  9727. */
  9728. getRow(matrix: Matrix4, index: number, result: Cartesian4): Cartesian4;
  9729. /**
  9730. * Computes a new matrix that replaces the specified row in the provided matrix with the provided Cartesian4 instance.
  9731. * @example
  9732. * //create a new Matrix4 instance with new row values from the Cartesian4 instance
  9733. * // m = [10.0, 11.0, 12.0, 13.0]
  9734. * // [14.0, 15.0, 16.0, 17.0]
  9735. * // [18.0, 19.0, 20.0, 21.0]
  9736. * // [22.0, 23.0, 24.0, 25.0]
  9737. *
  9738. * const a = SuperMap.Matrix4.setRow(m, 2, new SuperMap.Cartesian4(99.0, 98.0, 97.0, 96.0), new SuperMap.Matrix4());
  9739. *
  9740. * // m remains the same
  9741. * // a = [10.0, 11.0, 12.0, 13.0]
  9742. * // [14.0, 15.0, 16.0, 17.0]
  9743. * // [99.0, 98.0, 97.0, 96.0]
  9744. * // [22.0, 23.0, 24.0, 25.0]
  9745. * @param matrix - The matrix to use.
  9746. * @param index - The zero-based index of the row to set.
  9747. * @param cartesian - The Cartesian whose values will be assigned to the specified row.
  9748. * @param result - The object onto which to store the result.
  9749. * @returns The modified result parameter.
  9750. */
  9751. setRow(matrix: Matrix4, index: number, cartesian: Cartesian4, result: Matrix4): Matrix4;
  9752. /**
  9753. * Computes a new matrix that replaces the translation in the rightmost column of the provided
  9754. * matrix with the provided translation. This assumes the matrix is an affine transformation.
  9755. * @param matrix - The matrix to use.
  9756. * @param translation - The translation that replaces the translation of the provided matrix.
  9757. * @param result - The object onto which to store the result.
  9758. * @returns The modified result parameter.
  9759. */
  9760. setTranslation(matrix: Matrix4, translation: Cartesian3, result: Matrix4): Matrix4;
  9761. /**
  9762. * Computes a new matrix that replaces the scale with the provided scale.
  9763. * This assumes the matrix is an affine transformation.
  9764. * @param matrix - The matrix to use.
  9765. * @param scale - The scale that replaces the scale of the provided matrix.
  9766. * @param result - The object onto which to store the result.
  9767. * @returns The modified result parameter.
  9768. */
  9769. setScale(matrix: Matrix4, scale: Cartesian3, result: Matrix4): Matrix4;
  9770. /**
  9771. * Computes a new matrix that replaces the scale with the provided uniform scale.
  9772. * This assumes the matrix is an affine transformation.
  9773. * @param matrix - The matrix to use.
  9774. * @param scale - The uniform scale that replaces the scale of the provided matrix.
  9775. * @param result - The object onto which to store the result.
  9776. * @returns The modified result parameter.
  9777. */
  9778. setUniformScale(matrix: Matrix4, scale: number, result: Matrix4): Matrix4;
  9779. /**
  9780. * Extracts the non-uniform scale assuming the matrix is an affine transformation.
  9781. * @param matrix - The matrix.
  9782. * @param result - The object onto which to store the result.
  9783. * @returns The modified result parameter
  9784. */
  9785. getScale(matrix: Matrix4, result: Cartesian3): Cartesian3;
  9786. /**
  9787. * Computes the maximum scale assuming the matrix is an affine transformation.
  9788. * The maximum scale is the maximum length of the column vectors in the upper-left
  9789. * 3x3 matrix.
  9790. * @param matrix - The matrix.
  9791. * @returns The maximum scale.
  9792. */
  9793. getMaximumScale(matrix: Matrix4): number;
  9794. /**
  9795. * Sets the rotation assuming the matrix is an affine transformation.
  9796. * @param matrix - The matrix.
  9797. * @param rotation - The rotation matrix.
  9798. * @returns The modified result parameter.
  9799. */
  9800. setRotation(matrix: Matrix4, rotation: Matrix4): Matrix4;
  9801. /**
  9802. * Extracts the rotation matrix assuming the matrix is an affine transformation.
  9803. * @param matrix - The matrix.
  9804. * @param result - The object onto which to store the result.
  9805. * @returns The modified result parameter.
  9806. */
  9807. getRotation(matrix: Matrix4, result: Matrix4): Matrix4;
  9808. /**
  9809. * Computes the product of two matrices.
  9810. * @param left - The first matrix.
  9811. * @param right - The second matrix.
  9812. * @param result - The object onto which to store the result.
  9813. * @returns The modified result parameter.
  9814. */
  9815. multiply(left: Matrix4, right: Matrix4, result: Matrix4): Matrix4;
  9816. /**
  9817. * Computes the sum of two matrices.
  9818. * @param left - The first matrix.
  9819. * @param right - The second matrix.
  9820. * @param result - The object onto which to store the result.
  9821. * @returns The modified result parameter.
  9822. */
  9823. add(left: Matrix4, right: Matrix4, result: Matrix4): Matrix4;
  9824. /**
  9825. * Computes the difference of two matrices.
  9826. * @param left - The first matrix.
  9827. * @param right - The second matrix.
  9828. * @param result - The object onto which to store the result.
  9829. * @returns The modified result parameter.
  9830. */
  9831. subtract(left: Matrix4, right: Matrix4, result: Matrix4): Matrix4;
  9832. /**
  9833. * Computes the product of two matrices assuming the matrices are affine transformation matrices,
  9834. * where the upper left 3x3 elements are any matrix, and
  9835. * the upper three elements in the fourth column are the translation.
  9836. * The bottom row is assumed to be [0, 0, 0, 1].
  9837. * The matrix is not verified to be in the proper form.
  9838. * This method is faster than computing the product for general 4x4
  9839. * matrices using {@link Matrix4.multiply}.
  9840. * @example
  9841. * const m1 = new SuperMap.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);
  9842. * const m2 = SuperMap.Transforms.eastNorthUpToFixedFrame(new SuperMap.Cartesian3(1.0, 1.0, 1.0));
  9843. * const m3 = SuperMap.Matrix4.multiplyTransformation(m1, m2, new SuperMap.Matrix4());
  9844. * @param left - The first matrix.
  9845. * @param right - The second matrix.
  9846. * @param result - The object onto which to store the result.
  9847. * @returns The modified result parameter.
  9848. */
  9849. multiplyTransformation(left: Matrix4, right: Matrix4, result: Matrix4): Matrix4;
  9850. /**
  9851. * Multiplies a transformation matrix (with a bottom row of <code>[0.0, 0.0, 0.0, 1.0]</code>)
  9852. * by a 3x3 rotation matrix. This is an optimization
  9853. * for <code>Matrix4.multiply(m, Matrix4.fromRotationTranslation(rotation), m);</code> with less allocations and arithmetic operations.
  9854. * @example
  9855. * // Instead of SuperMap.Matrix4.multiply(m, SuperMap.Matrix4.fromRotationTranslation(rotation), m);
  9856. * SuperMap.Matrix4.multiplyByMatrix3(m, rotation, m);
  9857. * @param matrix - The matrix on the left-hand side.
  9858. * @param rotation - The 3x3 rotation matrix on the right-hand side.
  9859. * @param result - The object onto which to store the result.
  9860. * @returns The modified result parameter.
  9861. */
  9862. multiplyByMatrix3(matrix: Matrix4, rotation: Matrix3, result: Matrix4): Matrix4;
  9863. /**
  9864. * Multiplies a transformation matrix (with a bottom row of <code>[0.0, 0.0, 0.0, 1.0]</code>)
  9865. * by an implicit translation matrix defined by a {@link Cartesian3}. This is an optimization
  9866. * for <code>Matrix4.multiply(m, Matrix4.fromTranslation(position), m);</code> with less allocations and arithmetic operations.
  9867. * @example
  9868. * // Instead of SuperMap.Matrix4.multiply(m, SuperMap.Matrix4.fromTranslation(position), m);
  9869. * SuperMap.Matrix4.multiplyByTranslation(m, position, m);
  9870. * @param matrix - The matrix on the left-hand side.
  9871. * @param translation - The translation on the right-hand side.
  9872. * @param result - The object onto which to store the result.
  9873. * @returns The modified result parameter.
  9874. */
  9875. multiplyByTranslation(matrix: Matrix4, translation: Cartesian3, result: Matrix4): Matrix4;
  9876. /**
  9877. * Multiplies an affine transformation matrix (with a bottom row of <code>[0.0, 0.0, 0.0, 1.0]</code>)
  9878. * by an implicit non-uniform scale matrix. This is an optimization
  9879. * for <code>Matrix4.multiply(m, Matrix4.fromUniformScale(scale), m);</code>, where
  9880. * <code>m</code> must be an affine matrix.
  9881. * This function performs fewer allocations and arithmetic operations.
  9882. * @example
  9883. * // Instead of SuperMap.Matrix4.multiply(m, SuperMap.Matrix4.fromScale(scale), m);
  9884. * SuperMap.Matrix4.multiplyByScale(m, scale, m);
  9885. * @param matrix - The affine matrix on the left-hand side.
  9886. * @param scale - The non-uniform scale on the right-hand side.
  9887. * @param result - The object onto which to store the result.
  9888. * @returns The modified result parameter.
  9889. */
  9890. multiplyByScale(matrix: Matrix4, scale: Cartesian3, result: Matrix4): Matrix4;
  9891. /**
  9892. * Computes the product of a matrix times a uniform scale, as if the scale were a scale matrix.
  9893. * @example
  9894. * // Instead of SuperMap.Matrix4.multiply(m, SuperMap.Matrix4.fromUniformScale(scale), m);
  9895. * SuperMap.Matrix4.multiplyByUniformScale(m, scale, m);
  9896. * @param matrix - The matrix on the left-hand side.
  9897. * @param scale - The uniform scale on the right-hand side.
  9898. * @param result - The object onto which to store the result.
  9899. * @returns The modified result parameter.
  9900. */
  9901. multiplyByUniformScale(matrix: Matrix4, scale: number, result: Matrix4): Matrix4;
  9902. /**
  9903. * Computes the product of a matrix and a column vector.
  9904. * @param matrix - The matrix.
  9905. * @param cartesian - The vector.
  9906. * @param result - The object onto which to store the result.
  9907. * @returns The modified result parameter.
  9908. */
  9909. multiplyByVector(matrix: Matrix4, cartesian: Cartesian4, result: Cartesian4): Cartesian4;
  9910. /**
  9911. * Computes the product of a matrix and a {@link Cartesian3}. This is equivalent to calling {@link Matrix4.multiplyByVector}
  9912. * with a {@link Cartesian4} with a <code>w</code> component of zero.
  9913. * @example
  9914. * const p = new SuperMap.Cartesian3(1.0, 2.0, 3.0);
  9915. * const result = SuperMap.Matrix4.multiplyByPointAsVector(matrix, p, new SuperMap.Cartesian3());
  9916. * // A shortcut for
  9917. * // Cartesian3 p = ...
  9918. * // SuperMap.Matrix4.multiplyByVector(matrix, new SuperMap.Cartesian4(p.x, p.y, p.z, 0.0), result);
  9919. * @param matrix - The matrix.
  9920. * @param cartesian - The point.
  9921. * @param result - The object onto which to store the result.
  9922. * @returns The modified result parameter.
  9923. */
  9924. multiplyByPointAsVector(matrix: Matrix4, cartesian: Cartesian3, result: Cartesian3): Cartesian3;
  9925. /**
  9926. * Computes the product of a matrix and a {@link Cartesian3}. This is equivalent to calling {@link Matrix4.multiplyByVector}
  9927. * with a {@link Cartesian4} with a <code>w</code> component of 1, but returns a {@link Cartesian3} instead of a {@link Cartesian4}.
  9928. * @example
  9929. * const p = new SuperMap.Cartesian3(1.0, 2.0, 3.0);
  9930. * const result = SuperMap.Matrix4.multiplyByPoint(matrix, p, new SuperMap.Cartesian3());
  9931. * @param matrix - The matrix.
  9932. * @param cartesian - The point.
  9933. * @param result - The object onto which to store the result.
  9934. * @returns The modified result parameter.
  9935. */
  9936. multiplyByPoint(matrix: Matrix4, cartesian: Cartesian3, result: Cartesian3): Cartesian3;
  9937. /**
  9938. * Computes the product of a matrix and a scalar.
  9939. * @example
  9940. * //create a Matrix4 instance which is a scaled version of the supplied Matrix4
  9941. * // m = [10.0, 11.0, 12.0, 13.0]
  9942. * // [14.0, 15.0, 16.0, 17.0]
  9943. * // [18.0, 19.0, 20.0, 21.0]
  9944. * // [22.0, 23.0, 24.0, 25.0]
  9945. *
  9946. * const a = SuperMap.Matrix4.multiplyByScalar(m, -2, new SuperMap.Matrix4());
  9947. *
  9948. * // m remains the same
  9949. * // a = [-20.0, -22.0, -24.0, -26.0]
  9950. * // [-28.0, -30.0, -32.0, -34.0]
  9951. * // [-36.0, -38.0, -40.0, -42.0]
  9952. * // [-44.0, -46.0, -48.0, -50.0]
  9953. * @param matrix - The matrix.
  9954. * @param scalar - The number to multiply by.
  9955. * @param result - The object onto which to store the result.
  9956. * @returns The modified result parameter.
  9957. */
  9958. multiplyByScalar(matrix: Matrix4, scalar: number, result: Matrix4): Matrix4;
  9959. /**
  9960. * Computes a negated copy of the provided matrix.
  9961. * @example
  9962. * //create a new Matrix4 instance which is a negation of a Matrix4
  9963. * // m = [10.0, 11.0, 12.0, 13.0]
  9964. * // [14.0, 15.0, 16.0, 17.0]
  9965. * // [18.0, 19.0, 20.0, 21.0]
  9966. * // [22.0, 23.0, 24.0, 25.0]
  9967. *
  9968. * const a = SuperMap.Matrix4.negate(m, new SuperMap.Matrix4());
  9969. *
  9970. * // m remains the same
  9971. * // a = [-10.0, -11.0, -12.0, -13.0]
  9972. * // [-14.0, -15.0, -16.0, -17.0]
  9973. * // [-18.0, -19.0, -20.0, -21.0]
  9974. * // [-22.0, -23.0, -24.0, -25.0]
  9975. * @param matrix - The matrix to negate.
  9976. * @param result - The object onto which to store the result.
  9977. * @returns The modified result parameter.
  9978. */
  9979. negate(matrix: Matrix4, result: Matrix4): Matrix4;
  9980. /**
  9981. * Computes the transpose of the provided matrix.
  9982. * @example
  9983. * //returns transpose of a Matrix4
  9984. * // m = [10.0, 11.0, 12.0, 13.0]
  9985. * // [14.0, 15.0, 16.0, 17.0]
  9986. * // [18.0, 19.0, 20.0, 21.0]
  9987. * // [22.0, 23.0, 24.0, 25.0]
  9988. *
  9989. * const a = SuperMap.Matrix4.transpose(m, new SuperMap.Matrix4());
  9990. *
  9991. * // m remains the same
  9992. * // a = [10.0, 14.0, 18.0, 22.0]
  9993. * // [11.0, 15.0, 19.0, 23.0]
  9994. * // [12.0, 16.0, 20.0, 24.0]
  9995. * // [13.0, 17.0, 21.0, 25.0]
  9996. * @param matrix - The matrix to transpose.
  9997. * @param result - The object onto which to store the result.
  9998. * @returns The modified result parameter.
  9999. */
  10000. transpose(matrix: Matrix4, result: Matrix4): Matrix4;
  10001. /**
  10002. * Computes a matrix, which contains the absolute (unsigned) values of the provided matrix's elements.
  10003. * @param matrix - The matrix with signed elements.
  10004. * @param result - The object onto which to store the result.
  10005. * @returns The modified result parameter.
  10006. */
  10007. abs(matrix: Matrix4, result: Matrix4): Matrix4;
  10008. /**
  10009. * Compares the provided matrices componentwise and returns
  10010. * <code>true</code> if they are equal, <code>false</code> otherwise.
  10011. * @example
  10012. * //compares two Matrix4 instances
  10013. *
  10014. * // a = [10.0, 14.0, 18.0, 22.0]
  10015. * // [11.0, 15.0, 19.0, 23.0]
  10016. * // [12.0, 16.0, 20.0, 24.0]
  10017. * // [13.0, 17.0, 21.0, 25.0]
  10018. *
  10019. * // b = [10.0, 14.0, 18.0, 22.0]
  10020. * // [11.0, 15.0, 19.0, 23.0]
  10021. * // [12.0, 16.0, 20.0, 24.0]
  10022. * // [13.0, 17.0, 21.0, 25.0]
  10023. *
  10024. * if(SuperMap.Matrix4.equals(a,b)) {
  10025. * console.log("Both matrices are equal");
  10026. * } else {
  10027. * console.log("They are not equal");
  10028. * }
  10029. *
  10030. * //Prints "Both matrices are equal" on the console
  10031. * @param [left] - The first matrix.
  10032. * @param [right] - The second matrix.
  10033. * @returns <code>true</code> if left and right are equal, <code>false</code> otherwise.
  10034. */
  10035. equals(left?: Matrix4, right?: Matrix4): boolean;
  10036. /**
  10037. * Compares the provided matrices componentwise and returns
  10038. * <code>true</code> if they are within the provided epsilon,
  10039. * <code>false</code> otherwise.
  10040. * @example
  10041. * //compares two Matrix4 instances
  10042. *
  10043. * // a = [10.5, 14.5, 18.5, 22.5]
  10044. * // [11.5, 15.5, 19.5, 23.5]
  10045. * // [12.5, 16.5, 20.5, 24.5]
  10046. * // [13.5, 17.5, 21.5, 25.5]
  10047. *
  10048. * // b = [10.0, 14.0, 18.0, 22.0]
  10049. * // [11.0, 15.0, 19.0, 23.0]
  10050. * // [12.0, 16.0, 20.0, 24.0]
  10051. * // [13.0, 17.0, 21.0, 25.0]
  10052. *
  10053. * if(SuperMap.Matrix4.equalsEpsilon(a,b,0.1)){
  10054. * console.log("Difference between both the matrices is less than 0.1");
  10055. * } else {
  10056. * console.log("Difference between both the matrices is not less than 0.1");
  10057. * }
  10058. *
  10059. * //Prints "Difference between both the matrices is not less than 0.1" on the console
  10060. * @param [left] - The first matrix.
  10061. * @param [right] - The second matrix.
  10062. * @param [epsilon = 0] - The epsilon to use for equality testing.
  10063. * @returns <code>true</code> if left and right are within the provided epsilon, <code>false</code> otherwise.
  10064. */
  10065. equalsEpsilon(left?: Matrix4, right?: Matrix4, epsilon?: number): boolean;
  10066. /**
  10067. * Gets the translation portion of the provided matrix, assuming the matrix is an affine transformation matrix.
  10068. * @param matrix - The matrix to use.
  10069. * @param result - The object onto which to store the result.
  10070. * @returns The modified result parameter.
  10071. */
  10072. getTranslation(matrix: Matrix4, result: Cartesian3): Cartesian3;
  10073. /**
  10074. * Gets the upper left 3x3 matrix of the provided matrix.
  10075. * @example
  10076. * // returns a Matrix3 instance from a Matrix4 instance
  10077. *
  10078. * // m = [10.0, 14.0, 18.0, 22.0]
  10079. * // [11.0, 15.0, 19.0, 23.0]
  10080. * // [12.0, 16.0, 20.0, 24.0]
  10081. * // [13.0, 17.0, 21.0, 25.0]
  10082. *
  10083. * const b = new SuperMap.Matrix3();
  10084. * SuperMap.Matrix4.getMatrix3(m,b);
  10085. *
  10086. * // b = [10.0, 14.0, 18.0]
  10087. * // [11.0, 15.0, 19.0]
  10088. * // [12.0, 16.0, 20.0]
  10089. * @param matrix - The matrix to use.
  10090. * @param result - The object onto which to store the result.
  10091. * @returns The modified result parameter.
  10092. */
  10093. getMatrix3(matrix: Matrix4, result: Matrix3): Matrix3;
  10094. /**
  10095. * Computes the inverse of the provided matrix using Cramers Rule.
  10096. * If the determinant is zero, the matrix can not be inverted, and an exception is thrown.
  10097. * If the matrix is a proper rigid transformation, it is more efficient
  10098. * to invert it with {@link Matrix4.inverseTransformation}.
  10099. * @param matrix - The matrix to invert.
  10100. * @param result - The object onto which to store the result.
  10101. * @returns The modified result parameter.
  10102. */
  10103. inverse(matrix: Matrix4, result: Matrix4): Matrix4;
  10104. /**
  10105. * Computes the inverse of the provided matrix assuming it is a proper rigid matrix,
  10106. * where the upper left 3x3 elements are a rotation matrix,
  10107. * and the upper three elements in the fourth column are the translation.
  10108. * The bottom row is assumed to be [0, 0, 0, 1].
  10109. * The matrix is not verified to be in the proper form.
  10110. * This method is faster than computing the inverse for a general 4x4
  10111. * matrix using {@link Matrix4.inverse}.
  10112. * @param matrix - The matrix to invert.
  10113. * @param result - The object onto which to store the result.
  10114. * @returns The modified result parameter.
  10115. */
  10116. inverseTransformation(matrix: Matrix4, result: Matrix4): Matrix4;
  10117. /**
  10118. * Computes the inverse transpose of a matrix.
  10119. * @param matrix - The matrix to transpose and invert.
  10120. * @param result - The object onto which to store the result.
  10121. * @returns The modified result parameter.
  10122. */
  10123. inverseTranspose(matrix: Matrix4, result: Matrix4): Matrix4;
  10124. /**
  10125. * An immutable Matrix4 instance initialized to the identity matrix.
  10126. */
  10127. readonly IDENTITY: Matrix4;
  10128. /**
  10129. * An immutable Matrix4 instance initialized to the zero matrix.
  10130. */
  10131. readonly ZERO: Matrix4;
  10132. /**
  10133. * The index into Matrix4 for column 0, row 0.
  10134. */
  10135. readonly COLUMN0ROW0: number;
  10136. /**
  10137. * The index into Matrix4 for column 0, row 1.
  10138. */
  10139. readonly COLUMN0ROW1: number;
  10140. /**
  10141. * The index into Matrix4 for column 0, row 2.
  10142. */
  10143. readonly COLUMN0ROW2: number;
  10144. /**
  10145. * The index into Matrix4 for column 0, row 3.
  10146. */
  10147. readonly COLUMN0ROW3: number;
  10148. /**
  10149. * The index into Matrix4 for column 1, row 0.
  10150. */
  10151. readonly COLUMN1ROW0: number;
  10152. /**
  10153. * The index into Matrix4 for column 1, row 1.
  10154. */
  10155. readonly COLUMN1ROW1: number;
  10156. /**
  10157. * The index into Matrix4 for column 1, row 2.
  10158. */
  10159. readonly COLUMN1ROW2: number;
  10160. /**
  10161. * The index into Matrix4 for column 1, row 3.
  10162. */
  10163. readonly COLUMN1ROW3: number;
  10164. /**
  10165. * The index into Matrix4 for column 2, row 0.
  10166. */
  10167. readonly COLUMN2ROW0: number;
  10168. /**
  10169. * The index into Matrix4 for column 2, row 1.
  10170. */
  10171. readonly COLUMN2ROW1: number;
  10172. /**
  10173. * The index into Matrix4 for column 2, row 2.
  10174. */
  10175. readonly COLUMN2ROW2: number;
  10176. /**
  10177. * The index into Matrix4 for column 2, row 3.
  10178. */
  10179. readonly COLUMN2ROW3: number;
  10180. /**
  10181. * The index into Matrix4 for column 3, row 0.
  10182. */
  10183. readonly COLUMN3ROW0: number;
  10184. /**
  10185. * The index into Matrix4 for column 3, row 1.
  10186. */
  10187. readonly COLUMN3ROW1: number;
  10188. /**
  10189. * The index into Matrix4 for column 3, row 2.
  10190. */
  10191. readonly COLUMN3ROW2: number;
  10192. /**
  10193. * The index into Matrix4 for column 3, row 3.
  10194. */
  10195. readonly COLUMN3ROW3: number;
  10196. /**
  10197. * Gets the number of items in the collection.
  10198. */
  10199. length: number;
  10200. /**
  10201. * Duplicates the provided Matrix4 instance.
  10202. * @param [result] - The object onto which to store the result.
  10203. * @returns The modified result parameter or a new Matrix4 instance if one was not provided.
  10204. */
  10205. clone(result?: Matrix4): Matrix4;
  10206. /**
  10207. * Compares this matrix to the provided matrix componentwise and returns
  10208. * <code>true</code> if they are equal, <code>false</code> otherwise.
  10209. * @param [right] - The right hand side matrix.
  10210. * @returns <code>true</code> if they are equal, <code>false</code> otherwise.
  10211. */
  10212. equals(right?: Matrix4): boolean;
  10213. /**
  10214. * Compares this matrix to the provided matrix componentwise and returns
  10215. * <code>true</code> if they are within the provided epsilon,
  10216. * <code>false</code> otherwise.
  10217. * @param [right] - The right hand side matrix.
  10218. * @param [epsilon = 0] - The epsilon to use for equality testing.
  10219. * @returns <code>true</code> if they are within the provided epsilon, <code>false</code> otherwise.
  10220. */
  10221. equalsEpsilon(right?: Matrix4, epsilon?: number): boolean;
  10222. /**
  10223. * Computes a string representing this Matrix with each row being
  10224. * on a separate line and in the format '(column0, column1, column2, column3)'.
  10225. * @returns A string representing the provided Matrix with each row being on a separate line and in the format '(column0, column1, column2, column3)'.
  10226. */
  10227. toString(): string;
  10228. }
  10229. /**
  10230. * Represents a scalar value's lower and upper bound at a near distance and far distance in eye space.
  10231. * @param [near = 0.0] - The lower bound of the camera range.
  10232. * @param [nearValue = 0.0] - The value at the lower bound of the camera range.
  10233. * @param [far = 1.0] - The upper bound of the camera range.
  10234. * @param [farValue = 0.0] - The value at the upper bound of the camera range.
  10235. */
  10236. export class NearFarScalar {
  10237. constructor(near?: number, nearValue?: number, far?: number, farValue?: number);
  10238. /**
  10239. * The lower bound of the camera range.
  10240. */
  10241. near: number;
  10242. /**
  10243. * The value at the lower bound of the camera range.
  10244. */
  10245. nearValue: number;
  10246. /**
  10247. * The upper bound of the camera range.
  10248. */
  10249. far: number;
  10250. /**
  10251. * The value at the upper bound of the camera range.
  10252. */
  10253. farValue: number;
  10254. /**
  10255. * Duplicates a NearFarScalar instance.
  10256. * @param nearFarScalar - The NearFarScalar to duplicate.
  10257. * @param [result] - The object onto which to store the result.
  10258. * @returns The modified result parameter or a new NearFarScalar instance if one was not provided. (Returns undefined if nearFarScalar is undefined)
  10259. */
  10260. clone(nearFarScalar: NearFarScalar, result?: NearFarScalar): NearFarScalar;
  10261. /**
  10262. * The number of elements used to pack the object into an array.
  10263. */
  10264. packedLength: number;
  10265. /**
  10266. * Stores the provided instance into the provided array.
  10267. * @param value - The value to pack.
  10268. * @param array - The array to pack into.
  10269. * @param [startingIndex = 0] - The index into the array at which to start packing the elements.
  10270. * @returns The array that was packed into
  10271. */
  10272. pack(value: NearFarScalar, array: number[], startingIndex?: number): number[];
  10273. /**
  10274. * Retrieves an instance from a packed array.
  10275. * @param array - The packed array.
  10276. * @param [startingIndex = 0] - The starting index of the element to be unpacked.
  10277. * @param [result] - The object into which to store the result.
  10278. * @returns The modified result parameter or a new NearFarScalar instance if one was not provided.
  10279. */
  10280. unpack(array: number[], startingIndex?: number, result?: NearFarScalar): NearFarScalar;
  10281. /**
  10282. * Compares the provided NearFarScalar and returns <code>true</code> if they are equal,
  10283. * <code>false</code> otherwise.
  10284. * @param [left] - The first NearFarScalar.
  10285. * @param [right] - The second NearFarScalar.
  10286. * @returns <code>true</code> if left and right are equal; otherwise <code>false</code>.
  10287. */
  10288. equals(left?: NearFarScalar, right?: NearFarScalar): boolean;
  10289. /**
  10290. * Duplicates this instance.
  10291. * @param [result] - The object onto which to store the result.
  10292. * @returns The modified result parameter or a new NearFarScalar instance if one was not provided.
  10293. */
  10294. clone(result?: NearFarScalar): NearFarScalar;
  10295. /**
  10296. * Compares this instance to the provided NearFarScalar and returns <code>true</code> if they are equal,
  10297. * <code>false</code> otherwise.
  10298. * @param [right] - The right hand side NearFarScalar.
  10299. * @returns <code>true</code> if left and right are equal; otherwise <code>false</code>.
  10300. */
  10301. equals(right?: NearFarScalar): boolean;
  10302. }
  10303. /**
  10304. * Creates an Occluder derived from an object's position and radius, as well as the camera position.
  10305. * The occluder can be used to determine whether or not other objects are visible or hidden behind the
  10306. * visible horizon defined by the occluder and camera position.
  10307. * @example
  10308. * // Construct an occluder one unit away from the origin with a radius of one.
  10309. * const cameraPosition = SuperMap.Cartesian3.ZERO;
  10310. * const occluderBoundingSphere = new SuperMap.BoundingSphere(new SuperMap.Cartesian3(0, 0, -1), 1);
  10311. * const occluder = new SuperMap.Occluder(occluderBoundingSphere, cameraPosition);
  10312. * @param occluderBoundingSphere - The bounding sphere surrounding the occluder.
  10313. * @param cameraPosition - The coordinate of the viewer/camera.
  10314. */
  10315. export class Occluder {
  10316. constructor(occluderBoundingSphere: BoundingSphere, cameraPosition: Cartesian3);
  10317. /**
  10318. * The position of the occluder.
  10319. */
  10320. position: Cartesian3;
  10321. /**
  10322. * The radius of the occluder.
  10323. */
  10324. radius: number;
  10325. /**
  10326. * The position of the camera.
  10327. */
  10328. cameraPosition: Cartesian3;
  10329. /**
  10330. * Creates an occluder from a bounding sphere and the camera position.
  10331. * @param occluderBoundingSphere - The bounding sphere surrounding the occluder.
  10332. * @param cameraPosition - The coordinate of the viewer/camera.
  10333. * @param [result] - The object onto which to store the result.
  10334. * @returns The occluder derived from an object's position and radius, as well as the camera position.
  10335. */
  10336. fromBoundingSphere(occluderBoundingSphere: BoundingSphere, cameraPosition: Cartesian3, result?: Occluder): Occluder;
  10337. /**
  10338. * Determines whether or not a point, the <code>occludee</code>, is hidden from view by the occluder.
  10339. * @example
  10340. * const cameraPosition = new SuperMap.Cartesian3(0, 0, 0);
  10341. * const littleSphere = new SuperMap.BoundingSphere(new SuperMap.Cartesian3(0, 0, -1), 0.25);
  10342. * const occluder = new SuperMap.Occluder(littleSphere, cameraPosition);
  10343. * const point = new SuperMap.Cartesian3(0, 0, -3);
  10344. * occluder.isPointVisible(point); //returns true
  10345. * @param occludee - The point surrounding the occludee object.
  10346. * @returns <code>true</code> if the occludee is visible; otherwise <code>false</code>.
  10347. */
  10348. isPointVisible(occludee: Cartesian3): boolean;
  10349. /**
  10350. * Determines whether or not a sphere, the <code>occludee</code>, is hidden from view by the occluder.
  10351. * @example
  10352. * const cameraPosition = new SuperMap.Cartesian3(0, 0, 0);
  10353. * const littleSphere = new SuperMap.BoundingSphere(new SuperMap.Cartesian3(0, 0, -1), 0.25);
  10354. * const occluder = new SuperMap.Occluder(littleSphere, cameraPosition);
  10355. * const bigSphere = new SuperMap.BoundingSphere(new SuperMap.Cartesian3(0, 0, -3), 1);
  10356. * occluder.isBoundingSphereVisible(bigSphere); //returns true
  10357. * @param occludee - The bounding sphere surrounding the occludee object.
  10358. * @returns <code>true</code> if the occludee is visible; otherwise <code>false</code>.
  10359. */
  10360. isBoundingSphereVisible(occludee: BoundingSphere): boolean;
  10361. /**
  10362. * Determine to what extent an occludee is visible (not visible, partially visible, or fully visible).
  10363. * @example
  10364. * const sphere1 = new SuperMap.BoundingSphere(new SuperMap.Cartesian3(0, 0, -1.5), 0.5);
  10365. * const sphere2 = new SuperMap.BoundingSphere(new SuperMap.Cartesian3(0, 0, -2.5), 0.5);
  10366. * const cameraPosition = new SuperMap.Cartesian3(0, 0, 0);
  10367. * const occluder = new SuperMap.Occluder(sphere1, cameraPosition);
  10368. * occluder.computeVisibility(sphere2); //returns Visibility.NONE
  10369. * @param occludeeBS - The bounding sphere of the occludee.
  10370. * @returns Visibility.NONE if the occludee is not visible,
  10371. * Visibility.PARTIAL if the occludee is partially visible, or
  10372. * Visibility.FULL if the occludee is fully visible.
  10373. */
  10374. computeVisibility(occludeeBS: BoundingSphere): Visibility;
  10375. /**
  10376. * Computes a point that can be used as the occludee position to the visibility functions.
  10377. * Use a radius of zero for the occludee radius. Typically, a user computes a bounding sphere around
  10378. * an object that is used for visibility; however it is also possible to compute a point that if
  10379. * seen/not seen would also indicate if an object is visible/not visible. This function is better
  10380. * called for objects that do not move relative to the occluder and is large, such as a chunk of
  10381. * terrain. You are better off not calling this and using the object's bounding sphere for objects
  10382. * such as a satellite or ground vehicle.
  10383. * @example
  10384. * const cameraPosition = new SuperMap.Cartesian3(0, 0, 0);
  10385. * const occluderBoundingSphere = new SuperMap.BoundingSphere(new SuperMap.Cartesian3(0, 0, -8), 2);
  10386. * const occluder = new SuperMap.Occluder(occluderBoundingSphere, cameraPosition);
  10387. * const positions = [new SuperMap.Cartesian3(-0.25, 0, -5.3), new SuperMap.Cartesian3(0.25, 0, -5.3)];
  10388. * const tileOccluderSphere = SuperMap.BoundingSphere.fromPoints(positions);
  10389. * const occludeePosition = tileOccluderSphere.center;
  10390. * const occludeePt = SuperMap.Occluder.computeOccludeePoint(occluderBoundingSphere, occludeePosition, positions);
  10391. * @param occluderBoundingSphere - The bounding sphere surrounding the occluder.
  10392. * @param occludeePosition - The point where the occludee (bounding sphere of radius 0) is located.
  10393. * @param positions - List of altitude points on the horizon near the surface of the occluder.
  10394. * @returns An object containing two attributes: <code>occludeePoint</code> and <code>valid</code>
  10395. * which is a boolean value.
  10396. */
  10397. computeOccludeePoint(occluderBoundingSphere: BoundingSphere, occludeePosition: Cartesian3, positions: Cartesian3[]): any;
  10398. /**
  10399. * Computes a point that can be used as the occludee position to the visibility functions from a rectangle.
  10400. * @param rectangle - The rectangle used to create a bounding sphere.
  10401. * @param [ellipsoid = Ellipsoid.WGS84] - The ellipsoid used to determine positions of the rectangle.
  10402. * @returns An object containing two attributes: <code>occludeePoint</code> and <code>valid</code>
  10403. * which is a boolean value.
  10404. */
  10405. computeOccludeePointFromRectangle(rectangle: Rectangle, ellipsoid?: Ellipsoid): any;
  10406. }
  10407. /**
  10408. * Provides geocoding via a {@link https://opencagedata.com/|OpenCage} server.
  10409. * @example
  10410. * // Configure a Viewer to use the OpenCage Geocoder
  10411. * const viewer = new SuperMap.Viewer('CesiumContainer', {
  10412. * geocoder: new SuperMap.OpenCageGeocoderService('https://api.opencagedata.com/geocode/v1/', '<API key>')
  10413. * });
  10414. * @param url - The endpoint to the OpenCage server.
  10415. * @param apiKey - The OpenCage API Key.
  10416. * @param [params] - An object with the following properties (See https://opencagedata.com/api#forward-opt):
  10417. * @param [params.abbrv] - When set to 1 we attempt to abbreviate and shorten the formatted string we return.
  10418. * @param [options.add_request] - When set to 1 the various request parameters are added to the response for ease of debugging.
  10419. * @param [options.bounds] - Provides the geocoder with a hint to the region that the query resides in.
  10420. * @param [options.countrycode] - Restricts the results to the specified country or countries (as defined by the ISO 3166-1 Alpha 2 standard).
  10421. * @param [options.jsonp] - Wraps the returned JSON with a function name.
  10422. * @param [options.language] - An IETF format language code.
  10423. * @param [options.limit] - The maximum number of results we should return.
  10424. * @param [options.min_confidence] - An integer from 1-10. Only results with at least this confidence will be returned.
  10425. * @param [options.no_annotations] - When set to 1 results will not contain annotations.
  10426. * @param [options.no_dedupe] - When set to 1 results will not be deduplicated.
  10427. * @param [options.no_record] - When set to 1 the query contents are not logged.
  10428. * @param [options.pretty] - When set to 1 results are 'pretty' printed for easier reading. Useful for debugging.
  10429. * @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).
  10430. */
  10431. export class OpenCageGeocoderService {
  10432. constructor(url: Resource | string, apiKey: string, params?: {
  10433. abbrv?: number;
  10434. });
  10435. /**
  10436. * The Resource used to access the OpenCage endpoint.
  10437. */
  10438. readonly url: Resource;
  10439. /**
  10440. * Optional params passed to OpenCage in order to customize geocoding
  10441. */
  10442. readonly params: any;
  10443. /**
  10444. * @param query - The query to be sent to the geocoder service
  10445. */
  10446. geocode(query: string): Promise<GeocoderService.Result[]>;
  10447. }
  10448. /**
  10449. * Creates an instance of an OrientedBoundingBox.
  10450. * 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.
  10451. * @example
  10452. * // Create an OrientedBoundingBox using a transformation matrix, a position where the box will be translated, and a scale.
  10453. * const center = new SuperMap.Cartesian3(1.0, 0.0, 0.0);
  10454. * const halfAxes = SuperMap.Matrix3.fromScale(new SuperMap.Cartesian3(1.0, 3.0, 2.0), new SuperMap.Matrix3());
  10455. *
  10456. * const obb = new SuperMap.OrientedBoundingBox(center, halfAxes);
  10457. * @param [center = Cartesian3.ZERO] - The center of the box.
  10458. * @param [halfAxes = Matrix3.ZERO] - The three orthogonal half-axes of the bounding box.
  10459. * Equivalently, the transformation matrix, to rotate and scale a 0x0x0
  10460. * cube centered at the origin.
  10461. */
  10462. export class OrientedBoundingBox {
  10463. constructor(center?: Cartesian3, halfAxes?: Matrix3);
  10464. /**
  10465. * The center of the box.
  10466. */
  10467. center: Cartesian3;
  10468. /**
  10469. * The transformation matrix, to rotate the box to the right position.
  10470. */
  10471. halfAxes: Matrix3;
  10472. /**
  10473. * The number of elements used to pack the object into an array.
  10474. */
  10475. packedLength: number;
  10476. /**
  10477. * Stores the provided instance into the provided array.
  10478. * @param value - The value to pack.
  10479. * @param array - The array to pack into.
  10480. * @param [startingIndex = 0] - The index into the array at which to start packing the elements.
  10481. * @returns The array that was packed into
  10482. */
  10483. pack(value: OrientedBoundingBox, array: number[], startingIndex?: number): number[];
  10484. /**
  10485. * Retrieves an instance from a packed array.
  10486. * @param array - The packed array.
  10487. * @param [startingIndex = 0] - The starting index of the element to be unpacked.
  10488. * @param [result] - The object into which to store the result.
  10489. * @returns The modified result parameter or a new OrientedBoundingBox instance if one was not provided.
  10490. */
  10491. unpack(array: number[], startingIndex?: number, result?: OrientedBoundingBox): OrientedBoundingBox;
  10492. /**
  10493. * Computes an instance of an OrientedBoundingBox of the given positions.
  10494. * This is an implementation of Stefan Gottschalk's Collision Queries using Oriented Bounding Boxes solution (PHD thesis).
  10495. * Reference: http://gamma.cs.unc.edu/users/gottschalk/main.pdf
  10496. * @example
  10497. * // Compute an object oriented bounding box enclosing two points.
  10498. * const box = SuperMap.OrientedBoundingBox.fromPoints([new SuperMap.Cartesian3(2, 0, 0), new SuperMap.Cartesian3(-2, 0, 0)]);
  10499. * @param [positions] - List of {@link Cartesian3} points that the bounding box will enclose.
  10500. * @param [result] - The object onto which to store the result.
  10501. * @returns The modified result parameter or a new OrientedBoundingBox instance if one was not provided.
  10502. */
  10503. fromPoints(positions?: Cartesian3[], result?: OrientedBoundingBox): OrientedBoundingBox;
  10504. /**
  10505. * Computes an OrientedBoundingBox that bounds a {@link Rectangle} on the surface of an {@link Ellipsoid}.
  10506. * There are no guarantees about the orientation of the bounding box.
  10507. * @param rectangle - The cartographic rectangle on the surface of the ellipsoid.
  10508. * @param [minimumHeight = 0.0] - The minimum height (elevation) within the tile.
  10509. * @param [maximumHeight = 0.0] - The maximum height (elevation) within the tile.
  10510. * @param [ellipsoid = Ellipsoid.WGS84] - The ellipsoid on which the rectangle is defined.
  10511. * @param [result] - The object onto which to store the result.
  10512. * @returns The modified result parameter or a new OrientedBoundingBox instance if none was provided.
  10513. */
  10514. fromRectangle(rectangle: Rectangle, minimumHeight?: number, maximumHeight?: number, ellipsoid?: Ellipsoid, result?: OrientedBoundingBox): OrientedBoundingBox;
  10515. /**
  10516. * Computes an OrientedBoundingBox that bounds an affine transformation.
  10517. * @param transformation - The affine transformation.
  10518. * @param [result] - The object onto which to store the result.
  10519. * @returns The modified result parameter or a new OrientedBoundingBox instance if none was provided.
  10520. */
  10521. fromTransformation(transformation: Matrix4, result?: OrientedBoundingBox): OrientedBoundingBox;
  10522. /**
  10523. * Duplicates a OrientedBoundingBox instance.
  10524. * @param box - The bounding box to duplicate.
  10525. * @param [result] - The object onto which to store the result.
  10526. * @returns The modified result parameter or a new OrientedBoundingBox instance if none was provided. (Returns undefined if box is undefined)
  10527. */
  10528. clone(box: OrientedBoundingBox, result?: OrientedBoundingBox): OrientedBoundingBox;
  10529. /**
  10530. * Determines which side of a plane the oriented bounding box is located.
  10531. * @param box - The oriented bounding box to test.
  10532. * @param plane - The plane to test against.
  10533. * @returns {@link Intersect.INSIDE} if the entire box is on the side of the plane
  10534. * the normal is pointing, {@link Intersect.OUTSIDE} if the entire box is
  10535. * on the opposite side, and {@link Intersect.INTERSECTING} if the box
  10536. * intersects the plane.
  10537. */
  10538. intersectPlane(box: OrientedBoundingBox, plane: Plane): Intersect;
  10539. /**
  10540. * Computes the estimated distance squared from the closest point on a bounding box to a point.
  10541. * @example
  10542. * // Sort bounding boxes from back to front
  10543. * boxes.sort(function(a, b) {
  10544. * return SuperMap.OrientedBoundingBox.distanceSquaredTo(b, camera.positionWC) - SuperMap.OrientedBoundingBox.distanceSquaredTo(a, camera.positionWC);
  10545. * });
  10546. * @param box - The box.
  10547. * @param cartesian - The point
  10548. * @returns The distance squared from the oriented bounding box to the point. Returns 0 if the point is inside the box.
  10549. */
  10550. distanceSquaredTo(box: OrientedBoundingBox, cartesian: Cartesian3): number;
  10551. /**
  10552. * The distances calculated by the vector from the center of the bounding box to position projected onto direction.
  10553. * <br>
  10554. * If you imagine the infinite number of planes with normal direction, this computes the smallest distance to the
  10555. * closest and farthest planes from position that intersect the bounding box.
  10556. * @param box - The bounding box to calculate the distance to.
  10557. * @param position - The position to calculate the distance from.
  10558. * @param direction - The direction from position.
  10559. * @param [result] - A Interval to store the nearest and farthest distances.
  10560. * @returns The nearest and farthest distances on the bounding box from position in direction.
  10561. */
  10562. computePlaneDistances(box: OrientedBoundingBox, position: Cartesian3, direction: Cartesian3, result?: Interval): Interval;
  10563. /**
  10564. * Computes the eight corners of an oriented bounding box. The corners are ordered by (-X, -Y, -Z), (-X, -Y, +Z), (-X, +Y, -Z), (-X, +Y, +Z), (+X, -Y, -Z), (+X, -Y, +Z), (+X, +Y, -Z), (+X, +Y, +Z).
  10565. * @param box - The oriented bounding box.
  10566. * @param [result] - An array of eight {@link Cartesian3} instances onto which to store the corners.
  10567. * @returns The modified result parameter or a new array if none was provided.
  10568. */
  10569. computeCorners(box: OrientedBoundingBox, result?: Cartesian3[]): Cartesian3[];
  10570. /**
  10571. * Computes a transformation matrix from an oriented bounding box.
  10572. * @param box - The oriented bounding box.
  10573. * @param result - The object onto which to store the result.
  10574. * @returns The modified result parameter or a new {@link Matrix4} instance if none was provided.
  10575. */
  10576. computeTransformation(box: OrientedBoundingBox, result: Matrix4): Matrix4;
  10577. /**
  10578. * Determines whether or not a bounding box is hidden from view by the occluder.
  10579. * @param box - The bounding box surrounding the occludee object.
  10580. * @param occluder - The occluder.
  10581. * @returns <code>true</code> if the box is not visible; otherwise <code>false</code>.
  10582. */
  10583. isOccluded(box: OrientedBoundingBox, occluder: Occluder): boolean;
  10584. /**
  10585. * Determines which side of a plane the oriented bounding box is located.
  10586. * @param plane - The plane to test against.
  10587. * @returns {@link Intersect.INSIDE} if the entire box is on the side of the plane
  10588. * the normal is pointing, {@link Intersect.OUTSIDE} if the entire box is
  10589. * on the opposite side, and {@link Intersect.INTERSECTING} if the box
  10590. * intersects the plane.
  10591. */
  10592. intersectPlane(plane: Plane): Intersect;
  10593. /**
  10594. * Computes the estimated distance squared from the closest point on a bounding box to a point.
  10595. * @example
  10596. * // Sort bounding boxes from back to front
  10597. * boxes.sort(function(a, b) {
  10598. * return b.distanceSquaredTo(camera.positionWC) - a.distanceSquaredTo(camera.positionWC);
  10599. * });
  10600. * @param cartesian - The point
  10601. * @returns The estimated distance squared from the bounding sphere to the point.
  10602. */
  10603. distanceSquaredTo(cartesian: Cartesian3): number;
  10604. /**
  10605. * The distances calculated by the vector from the center of the bounding box to position projected onto direction.
  10606. * <br>
  10607. * If you imagine the infinite number of planes with normal direction, this computes the smallest distance to the
  10608. * closest and farthest planes from position that intersect the bounding box.
  10609. * @param position - The position to calculate the distance from.
  10610. * @param direction - The direction from position.
  10611. * @param [result] - A Interval to store the nearest and farthest distances.
  10612. * @returns The nearest and farthest distances on the bounding box from position in direction.
  10613. */
  10614. computePlaneDistances(position: Cartesian3, direction: Cartesian3, result?: Interval): Interval;
  10615. /**
  10616. * Computes the eight corners of an oriented bounding box. The corners are ordered by (-X, -Y, -Z), (-X, -Y, +Z), (-X, +Y, -Z), (-X, +Y, +Z), (+X, -Y, -Z), (+X, -Y, +Z), (+X, +Y, -Z), (+X, +Y, +Z).
  10617. * @param [result] - An array of eight {@link Cartesian3} instances onto which to store the corners.
  10618. * @returns The modified result parameter or a new array if none was provided.
  10619. */
  10620. computeCorners(result?: Cartesian3[]): Cartesian3[];
  10621. /**
  10622. * Computes a transformation matrix from an oriented bounding box.
  10623. * @param result - The object onto which to store the result.
  10624. * @returns The modified result parameter or a new {@link Matrix4} instance if none was provided.
  10625. */
  10626. computeTransformation(result: Matrix4): Matrix4;
  10627. /**
  10628. * Determines whether or not a bounding box is hidden from view by the occluder.
  10629. * @param occluder - The occluder.
  10630. * @returns <code>true</code> if the sphere is not visible; otherwise <code>false</code>.
  10631. */
  10632. isOccluded(occluder: Occluder): boolean;
  10633. /**
  10634. * Compares the provided OrientedBoundingBox componentwise and returns
  10635. * <code>true</code> if they are equal, <code>false</code> otherwise.
  10636. * @param left - The first OrientedBoundingBox.
  10637. * @param right - The second OrientedBoundingBox.
  10638. * @returns <code>true</code> if left and right are equal, <code>false</code> otherwise.
  10639. */
  10640. equals(left: OrientedBoundingBox, right: OrientedBoundingBox): boolean;
  10641. /**
  10642. * Duplicates this OrientedBoundingBox instance.
  10643. * @param [result] - The object onto which to store the result.
  10644. * @returns The modified result parameter or a new OrientedBoundingBox instance if one was not provided.
  10645. */
  10646. clone(result?: OrientedBoundingBox): OrientedBoundingBox;
  10647. /**
  10648. * Compares this OrientedBoundingBox against the provided OrientedBoundingBox componentwise and returns
  10649. * <code>true</code> if they are equal, <code>false</code> otherwise.
  10650. * @param [right] - The right hand side OrientedBoundingBox.
  10651. * @returns <code>true</code> if they are equal, <code>false</code> otherwise.
  10652. */
  10653. equals(right?: OrientedBoundingBox): boolean;
  10654. }
  10655. /**
  10656. * The viewing frustum is defined by 6 planes.
  10657. * Each plane is represented by a {@link Cartesian4} object, where the x, y, and z components
  10658. * define the unit vector normal to the plane, and the w component is the distance of the
  10659. * plane from the origin/camera position.
  10660. * @example
  10661. * const maxRadii = ellipsoid.maximumRadius;
  10662. *
  10663. * const frustum = new SuperMap.OrthographicFrustum();
  10664. * frustum.near = 0.01 * maxRadii;
  10665. * frustum.far = 50.0 * maxRadii;
  10666. * @param [options] - An object with the following properties:
  10667. * @param [options.width] - The width of the frustum in meters.
  10668. * @param [options.aspectRatio] - The aspect ratio of the frustum's width to it's height.
  10669. * @param [options.near = 1.0] - The distance of the near plane.
  10670. * @param [options.far = 500000000.0] - The distance of the far plane.
  10671. */
  10672. export class OrthographicFrustum {
  10673. constructor(options?: {
  10674. width?: number;
  10675. aspectRatio?: number;
  10676. near?: number;
  10677. far?: number;
  10678. });
  10679. /**
  10680. * The horizontal width of the frustum in meters.
  10681. */
  10682. width: number;
  10683. /**
  10684. * The aspect ratio of the frustum's width to it's height.
  10685. */
  10686. aspectRatio: number;
  10687. /**
  10688. * The distance of the near plane.
  10689. */
  10690. near: number;
  10691. /**
  10692. * The distance of the far plane.
  10693. */
  10694. far: number;
  10695. /**
  10696. * The number of elements used to pack the object into an array.
  10697. */
  10698. packedLength: number;
  10699. /**
  10700. * Stores the provided instance into the provided array.
  10701. * @param value - The value to pack.
  10702. * @param array - The array to pack into.
  10703. * @param [startingIndex = 0] - The index into the array at which to start packing the elements.
  10704. * @returns The array that was packed into
  10705. */
  10706. pack(value: OrthographicFrustum, array: number[], startingIndex?: number): number[];
  10707. /**
  10708. * Retrieves an instance from a packed array.
  10709. * @param array - The packed array.
  10710. * @param [startingIndex = 0] - The starting index of the element to be unpacked.
  10711. * @param [result] - The object into which to store the result.
  10712. * @returns The modified result parameter or a new OrthographicFrustum instance if one was not provided.
  10713. */
  10714. unpack(array: number[], startingIndex?: number, result?: OrthographicFrustum): OrthographicFrustum;
  10715. /**
  10716. * Gets the orthographic projection matrix computed from the view frustum.
  10717. */
  10718. readonly projectionMatrix: Matrix4;
  10719. /**
  10720. * Creates a culling volume for this frustum.
  10721. * @example
  10722. * // Check if a bounding volume intersects the frustum.
  10723. * const cullingVolume = frustum.computeCullingVolume(cameraPosition, cameraDirection, cameraUp);
  10724. * const intersect = cullingVolume.computeVisibility(boundingVolume);
  10725. * @param position - The eye position.
  10726. * @param direction - The view direction.
  10727. * @param up - The up direction.
  10728. * @returns A culling volume at the given position and orientation.
  10729. */
  10730. computeCullingVolume(position: Cartesian3, direction: Cartesian3, up: Cartesian3): CullingVolume;
  10731. /**
  10732. * Returns the pixel's width and height in meters.
  10733. * @example
  10734. * // Example 1
  10735. * // Get the width and height of a pixel.
  10736. * const pixelSize = camera.frustum.getPixelDimensions(scene.drawingBufferWidth, scene.drawingBufferHeight, 0.0, scene.pixelRatio, new SuperMap.Cartesian2());
  10737. * @param drawingBufferWidth - The width of the drawing buffer.
  10738. * @param drawingBufferHeight - The height of the drawing buffer.
  10739. * @param distance - The distance to the near plane in meters.
  10740. * @param pixelRatio - The scaling factor from pixel space to coordinate space.
  10741. * @param result - The object onto which to store the result.
  10742. * @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.
  10743. */
  10744. getPixelDimensions(drawingBufferWidth: number, drawingBufferHeight: number, distance: number, pixelRatio: number, result: Cartesian2): Cartesian2;
  10745. /**
  10746. * Returns a duplicate of a OrthographicFrustum instance.
  10747. * @param [result] - The object onto which to store the result.
  10748. * @returns The modified result parameter or a new OrthographicFrustum instance if one was not provided.
  10749. */
  10750. clone(result?: OrthographicFrustum): OrthographicFrustum;
  10751. /**
  10752. * Compares the provided OrthographicFrustum componentwise and returns
  10753. * <code>true</code> if they are equal, <code>false</code> otherwise.
  10754. * @param [other] - The right hand side OrthographicFrustum.
  10755. * @returns <code>true</code> if they are equal, <code>false</code> otherwise.
  10756. */
  10757. equals(other?: OrthographicFrustum): boolean;
  10758. /**
  10759. * Compares the provided OrthographicFrustum componentwise and returns
  10760. * <code>true</code> if they pass an absolute or relative tolerance test,
  10761. * <code>false</code> otherwise.
  10762. * @param other - The right hand side OrthographicFrustum.
  10763. * @param relativeEpsilon - The relative epsilon tolerance to use for equality testing.
  10764. * @param [absoluteEpsilon = relativeEpsilon] - The absolute epsilon tolerance to use for equality testing.
  10765. * @returns <code>true</code> if this and other are within the provided epsilon, <code>false</code> otherwise.
  10766. */
  10767. equalsEpsilon(other: OrthographicFrustum, relativeEpsilon: number, absoluteEpsilon?: number): boolean;
  10768. }
  10769. /**
  10770. * The viewing frustum is defined by 6 planes.
  10771. * Each plane is represented by a {@link Cartesian4} object, where the x, y, and z components
  10772. * define the unit vector normal to the plane, and the w component is the distance of the
  10773. * plane from the origin/camera position.
  10774. * @example
  10775. * const maxRadii = ellipsoid.maximumRadius;
  10776. *
  10777. * const frustum = new SuperMap.OrthographicOffCenterFrustum();
  10778. * frustum.right = maxRadii * SuperMap.Math.PI;
  10779. * frustum.left = -c.frustum.right;
  10780. * frustum.top = c.frustum.right * (canvas.clientHeight / canvas.clientWidth);
  10781. * frustum.bottom = -c.frustum.top;
  10782. * frustum.near = 0.01 * maxRadii;
  10783. * frustum.far = 50.0 * maxRadii;
  10784. * @param [options] - An object with the following properties:
  10785. * @param [options.left] - The left clipping plane distance.
  10786. * @param [options.right] - The right clipping plane distance.
  10787. * @param [options.top] - The top clipping plane distance.
  10788. * @param [options.bottom] - The bottom clipping plane distance.
  10789. * @param [options.near = 1.0] - The near clipping plane distance.
  10790. * @param [options.far = 500000000.0] - The far clipping plane distance.
  10791. */
  10792. export class OrthographicOffCenterFrustum {
  10793. constructor(options?: {
  10794. left?: number;
  10795. right?: number;
  10796. top?: number;
  10797. bottom?: number;
  10798. near?: number;
  10799. far?: number;
  10800. });
  10801. /**
  10802. * The left clipping plane.
  10803. */
  10804. left: number;
  10805. /**
  10806. * The right clipping plane.
  10807. */
  10808. right: number;
  10809. /**
  10810. * The top clipping plane.
  10811. */
  10812. top: number;
  10813. /**
  10814. * The bottom clipping plane.
  10815. */
  10816. bottom: number;
  10817. /**
  10818. * The distance of the near plane.
  10819. */
  10820. near: number;
  10821. /**
  10822. * The distance of the far plane.
  10823. */
  10824. far: number;
  10825. /**
  10826. * Gets the orthographic projection matrix computed from the view frustum.
  10827. */
  10828. readonly projectionMatrix: Matrix4;
  10829. /**
  10830. * Creates a culling volume for this frustum.
  10831. * @example
  10832. * // Check if a bounding volume intersects the frustum.
  10833. * const cullingVolume = frustum.computeCullingVolume(cameraPosition, cameraDirection, cameraUp);
  10834. * const intersect = cullingVolume.computeVisibility(boundingVolume);
  10835. * @param position - The eye position.
  10836. * @param direction - The view direction.
  10837. * @param up - The up direction.
  10838. * @returns A culling volume at the given position and orientation.
  10839. */
  10840. computeCullingVolume(position: Cartesian3, direction: Cartesian3, up: Cartesian3): CullingVolume;
  10841. /**
  10842. * Returns the pixel's width and height in meters.
  10843. * @example
  10844. * // Example 1
  10845. * // Get the width and height of a pixel.
  10846. * const pixelSize = camera.frustum.getPixelDimensions(scene.drawingBufferWidth, scene.drawingBufferHeight, 0.0, scene.pixelRatio, new SuperMap.Cartesian2());
  10847. * @param drawingBufferWidth - The width of the drawing buffer.
  10848. * @param drawingBufferHeight - The height of the drawing buffer.
  10849. * @param distance - The distance to the near plane in meters.
  10850. * @param pixelRatio - The scaling factor from pixel space to coordinate space.
  10851. * @param result - The object onto which to store the result.
  10852. * @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.
  10853. */
  10854. getPixelDimensions(drawingBufferWidth: number, drawingBufferHeight: number, distance: number, pixelRatio: number, result: Cartesian2): Cartesian2;
  10855. /**
  10856. * Returns a duplicate of a OrthographicOffCenterFrustum instance.
  10857. * @param [result] - The object onto which to store the result.
  10858. * @returns The modified result parameter or a new OrthographicOffCenterFrustum instance if one was not provided.
  10859. */
  10860. clone(result?: OrthographicOffCenterFrustum): OrthographicOffCenterFrustum;
  10861. /**
  10862. * Compares the provided OrthographicOffCenterFrustum componentwise and returns
  10863. * <code>true</code> if they are equal, <code>false</code> otherwise.
  10864. * @param [other] - The right hand side OrthographicOffCenterFrustum.
  10865. * @returns <code>true</code> if they are equal, <code>false</code> otherwise.
  10866. */
  10867. equals(other?: OrthographicOffCenterFrustum): boolean;
  10868. /**
  10869. * Compares the provided OrthographicOffCenterFrustum componentwise and returns
  10870. * <code>true</code> if they pass an absolute or relative tolerance test,
  10871. * <code>false</code> otherwise.
  10872. * @param other - The right hand side OrthographicOffCenterFrustum.
  10873. * @param relativeEpsilon - The relative epsilon tolerance to use for equality testing.
  10874. * @param [absoluteEpsilon = relativeEpsilon] - The absolute epsilon tolerance to use for equality testing.
  10875. * @returns <code>true</code> if this and other are within the provided epsilon, <code>false</code> otherwise.
  10876. */
  10877. equalsEpsilon(other: OrthographicOffCenterFrustum, relativeEpsilon: number, absoluteEpsilon?: number): boolean;
  10878. }
  10879. export namespace Packable {
  10880. /**
  10881. * The number of elements used to pack the object into an array.
  10882. */
  10883. var packedLength: number;
  10884. /**
  10885. * Stores the provided instance into the provided array.
  10886. * @param value - The value to pack.
  10887. * @param array - The array to pack into.
  10888. * @param [startingIndex = 0] - The index into the array at which to start packing the elements.
  10889. */
  10890. function pack(value: any, array: number[], startingIndex?: number): void;
  10891. /**
  10892. * Retrieves an instance from a packed array.
  10893. * @param array - The packed array.
  10894. * @param [startingIndex = 0] - The starting index of the element to be unpacked.
  10895. * @param [result] - The object into which to store the result.
  10896. * @returns The modified result parameter or a new Object instance if one was not provided.
  10897. */
  10898. function unpack(array: number[], startingIndex?: number, result?: any): any;
  10899. }
  10900. /**
  10901. * Static interface for types which can store their values as packed
  10902. * elements in an array. These methods and properties are expected to be
  10903. * defined on a constructor function.
  10904. */
  10905. export interface Packable {
  10906. }
  10907. /**
  10908. * Static interface for {@link Packable} types which are interpolated in a
  10909. * different representation than their packed value. These methods and
  10910. * properties are expected to be defined on a constructor function.
  10911. */
  10912. export namespace PackableForInterpolation {
  10913. /**
  10914. * The number of elements used to store the object into an array in its interpolatable form.
  10915. */
  10916. var packedInterpolationLength: number;
  10917. /**
  10918. * Converts a packed array into a form suitable for interpolation.
  10919. * @param packedArray - The packed array.
  10920. * @param [startingIndex = 0] - The index of the first element to be converted.
  10921. * @param [lastIndex = packedArray.length] - The index of the last element to be converted.
  10922. * @param [result] - The object into which to store the result.
  10923. */
  10924. function convertPackedArrayForInterpolation(packedArray: number[], startingIndex?: number, lastIndex?: number, result?: number[]): void;
  10925. /**
  10926. * Retrieves an instance from a packed array converted with {@link PackableForInterpolation.convertPackedArrayForInterpolation}.
  10927. * @param array - The array previously packed for interpolation.
  10928. * @param sourceArray - The original packed array.
  10929. * @param [startingIndex = 0] - The startingIndex used to convert the array.
  10930. * @param [lastIndex = packedArray.length] - The lastIndex used to convert the array.
  10931. * @param [result] - The object into which to store the result.
  10932. * @returns The modified result parameter or a new Object instance if one was not provided.
  10933. */
  10934. function unpackInterpolationResult(array: number[], sourceArray: number[], startingIndex?: number, lastIndex?: number, result?: any): any;
  10935. }
  10936. /**
  10937. * Provides geocoding via a {@link https://pelias.io/|Pelias} server.
  10938. * @example
  10939. * // Configure a Viewer to use the Pelias server hosted by https://geocode.earth/
  10940. * const viewer = new SuperMap.Viewer('CesiumContainer', {
  10941. * geocoder: new SuperMap.PeliasGeocoderService(new SuperMap.Resource({
  10942. * url: 'https://api.geocode.earth/v1/',
  10943. * queryParameters: {
  10944. * api_key: '<Your geocode.earth API key>'
  10945. * }
  10946. * }))
  10947. * });
  10948. * @param url - The endpoint to the Pelias server.
  10949. */
  10950. export class PeliasGeocoderService {
  10951. constructor(url: Resource | string);
  10952. /**
  10953. * The Resource used to access the Pelias endpoint.
  10954. */
  10955. readonly url: Resource;
  10956. /**
  10957. * @param query - The query to be sent to the geocoder service
  10958. * @param [type = GeocodeType.SEARCH] - The type of geocode to perform.
  10959. */
  10960. geocode(query: string, type?: GeocodeType): Promise<GeocoderService.Result[]>;
  10961. }
  10962. /**
  10963. * The viewing frustum is defined by 6 planes.
  10964. * Each plane is represented by a {@link Cartesian4} object, where the x, y, and z components
  10965. * define the unit vector normal to the plane, and the w component is the distance of the
  10966. * plane from the origin/camera position.
  10967. * @example
  10968. * const frustum = new SuperMap.PerspectiveFrustum({
  10969. * fov : SuperMap.Math.PI_OVER_THREE,
  10970. * aspectRatio : canvas.clientWidth / canvas.clientHeight
  10971. * near : 1.0,
  10972. * far : 1000.0
  10973. * });
  10974. * @param [options] - An object with the following properties:
  10975. * @param [options.fov] - The angle of the field of view (FOV), in radians.
  10976. * @param [options.aspectRatio] - The aspect ratio of the frustum's width to it's height.
  10977. * @param [options.near = 1.0] - The distance of the near plane.
  10978. * @param [options.far = 500000000.0] - The distance of the far plane.
  10979. * @param [options.xOffset = 0.0] - The offset in the x direction.
  10980. * @param [options.yOffset = 0.0] - The offset in the y direction.
  10981. */
  10982. export class PerspectiveFrustum {
  10983. constructor(options?: {
  10984. fov?: number;
  10985. aspectRatio?: number;
  10986. near?: number;
  10987. far?: number;
  10988. xOffset?: number;
  10989. yOffset?: number;
  10990. });
  10991. /**
  10992. * The angle of the field of view (FOV), in radians. This angle will be used
  10993. * as the horizontal FOV if the width is greater than the height, otherwise
  10994. * it will be the vertical FOV.
  10995. */
  10996. fov: number;
  10997. /**
  10998. * The aspect ratio of the frustum's width to it's height.
  10999. */
  11000. aspectRatio: number;
  11001. /**
  11002. * The distance of the near plane.
  11003. */
  11004. near: number;
  11005. /**
  11006. * The distance of the far plane.
  11007. */
  11008. far: number;
  11009. /**
  11010. * Offsets the frustum in the x direction.
  11011. */
  11012. xOffset: number;
  11013. /**
  11014. * Offsets the frustum in the y direction.
  11015. */
  11016. yOffset: number;
  11017. /**
  11018. * The number of elements used to pack the object into an array.
  11019. */
  11020. packedLength: number;
  11021. /**
  11022. * Stores the provided instance into the provided array.
  11023. * @param value - The value to pack.
  11024. * @param array - The array to pack into.
  11025. * @param [startingIndex = 0] - The index into the array at which to start packing the elements.
  11026. * @returns The array that was packed into
  11027. */
  11028. pack(value: PerspectiveFrustum, array: number[], startingIndex?: number): number[];
  11029. /**
  11030. * Retrieves an instance from a packed array.
  11031. * @param array - The packed array.
  11032. * @param [startingIndex = 0] - The starting index of the element to be unpacked.
  11033. * @param [result] - The object into which to store the result.
  11034. * @returns The modified result parameter or a new PerspectiveFrustum instance if one was not provided.
  11035. */
  11036. unpack(array: number[], startingIndex?: number, result?: PerspectiveFrustum): PerspectiveFrustum;
  11037. /**
  11038. * Gets the perspective projection matrix computed from the view frustum.
  11039. */
  11040. readonly projectionMatrix: Matrix4;
  11041. /**
  11042. * The perspective projection matrix computed from the view frustum with an infinite far plane.
  11043. */
  11044. readonly infiniteProjectionMatrix: Matrix4;
  11045. /**
  11046. * Gets the angle of the vertical field of view, in radians.
  11047. */
  11048. readonly fovy: number;
  11049. /**
  11050. * Creates a culling volume for this frustum.
  11051. * @example
  11052. * // Check if a bounding volume intersects the frustum.
  11053. * const cullingVolume = frustum.computeCullingVolume(cameraPosition, cameraDirection, cameraUp);
  11054. * const intersect = cullingVolume.computeVisibility(boundingVolume);
  11055. * @param position - The eye position.
  11056. * @param direction - The view direction.
  11057. * @param up - The up direction.
  11058. * @returns A culling volume at the given position and orientation.
  11059. */
  11060. computeCullingVolume(position: Cartesian3, direction: Cartesian3, up: Cartesian3): CullingVolume;
  11061. /**
  11062. * Returns the pixel's width and height in meters.
  11063. * @example
  11064. * // Example 1
  11065. * // Get the width and height of a pixel.
  11066. * const pixelSize = camera.frustum.getPixelDimensions(scene.drawingBufferWidth, scene.drawingBufferHeight, 1.0, scene.pixelRatio, new SuperMap.Cartesian2());
  11067. * @example
  11068. * // Example 2
  11069. * // Get the width and height of a pixel if the near plane was set to 'distance'.
  11070. * // For example, get the size of a pixel of an image on a billboard.
  11071. * const position = camera.position;
  11072. * const direction = camera.direction;
  11073. * const toCenter = SuperMap.Cartesian3.subtract(primitive.boundingVolume.center, position, new SuperMap.Cartesian3()); // vector from camera to a primitive
  11074. * const toCenterProj = SuperMap.Cartesian3.multiplyByScalar(direction, SuperMap.Cartesian3.dot(direction, toCenter), new SuperMap.Cartesian3()); // project vector onto camera direction vector
  11075. * const distance = SuperMap.Cartesian3.magnitude(toCenterProj);
  11076. * const pixelSize = camera.frustum.getPixelDimensions(scene.drawingBufferWidth, scene.drawingBufferHeight, distance, scene.pixelRatio, new SuperMap.Cartesian2());
  11077. * @param drawingBufferWidth - The width of the drawing buffer.
  11078. * @param drawingBufferHeight - The height of the drawing buffer.
  11079. * @param distance - The distance to the near plane in meters.
  11080. * @param pixelRatio - The scaling factor from pixel space to coordinate space.
  11081. * @param result - The object onto which to store the result.
  11082. * @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.
  11083. */
  11084. getPixelDimensions(drawingBufferWidth: number, drawingBufferHeight: number, distance: number, pixelRatio: number, result: Cartesian2): Cartesian2;
  11085. /**
  11086. * Returns a duplicate of a PerspectiveFrustum instance.
  11087. * @param [result] - The object onto which to store the result.
  11088. * @returns The modified result parameter or a new PerspectiveFrustum instance if one was not provided.
  11089. */
  11090. clone(result?: PerspectiveFrustum): PerspectiveFrustum;
  11091. /**
  11092. * Compares the provided PerspectiveFrustum componentwise and returns
  11093. * <code>true</code> if they are equal, <code>false</code> otherwise.
  11094. * @param [other] - The right hand side PerspectiveFrustum.
  11095. * @returns <code>true</code> if they are equal, <code>false</code> otherwise.
  11096. */
  11097. equals(other?: PerspectiveFrustum): boolean;
  11098. /**
  11099. * Compares the provided PerspectiveFrustum componentwise and returns
  11100. * <code>true</code> if they pass an absolute or relative tolerance test,
  11101. * <code>false</code> otherwise.
  11102. * @param other - The right hand side PerspectiveFrustum.
  11103. * @param relativeEpsilon - The relative epsilon tolerance to use for equality testing.
  11104. * @param [absoluteEpsilon = relativeEpsilon] - The absolute epsilon tolerance to use for equality testing.
  11105. * @returns <code>true</code> if this and other are within the provided epsilon, <code>false</code> otherwise.
  11106. */
  11107. equalsEpsilon(other: PerspectiveFrustum, relativeEpsilon: number, absoluteEpsilon?: number): boolean;
  11108. }
  11109. /**
  11110. * The viewing frustum is defined by 6 planes.
  11111. * Each plane is represented by a {@link Cartesian4} object, where the x, y, and z components
  11112. * define the unit vector normal to the plane, and the w component is the distance of the
  11113. * plane from the origin/camera position.
  11114. * @example
  11115. * const frustum = new SuperMap.PerspectiveOffCenterFrustum({
  11116. * left : -1.0,
  11117. * right : 1.0,
  11118. * top : 1.0,
  11119. * bottom : -1.0,
  11120. * near : 1.0,
  11121. * far : 100.0
  11122. * });
  11123. * @param [options] - An object with the following properties:
  11124. * @param [options.left] - The left clipping plane distance.
  11125. * @param [options.right] - The right clipping plane distance.
  11126. * @param [options.top] - The top clipping plane distance.
  11127. * @param [options.bottom] - The bottom clipping plane distance.
  11128. * @param [options.near = 1.0] - The near clipping plane distance.
  11129. * @param [options.far = 500000000.0] - The far clipping plane distance.
  11130. */
  11131. export class PerspectiveOffCenterFrustum {
  11132. constructor(options?: {
  11133. left?: number;
  11134. right?: number;
  11135. top?: number;
  11136. bottom?: number;
  11137. near?: number;
  11138. far?: number;
  11139. });
  11140. /**
  11141. * Defines the left clipping plane.
  11142. */
  11143. left: number;
  11144. /**
  11145. * Defines the right clipping plane.
  11146. */
  11147. right: number;
  11148. /**
  11149. * Defines the top clipping plane.
  11150. */
  11151. top: number;
  11152. /**
  11153. * Defines the bottom clipping plane.
  11154. */
  11155. bottom: number;
  11156. /**
  11157. * The distance of the near plane.
  11158. */
  11159. near: number;
  11160. /**
  11161. * The distance of the far plane.
  11162. */
  11163. far: number;
  11164. /**
  11165. * Gets the perspective projection matrix computed from the view frustum.
  11166. */
  11167. readonly projectionMatrix: Matrix4;
  11168. /**
  11169. * Gets the perspective projection matrix computed from the view frustum with an infinite far plane.
  11170. */
  11171. readonly infiniteProjectionMatrix: Matrix4;
  11172. /**
  11173. * Creates a culling volume for this frustum.
  11174. * @example
  11175. * // Check if a bounding volume intersects the frustum.
  11176. * const cullingVolume = frustum.computeCullingVolume(cameraPosition, cameraDirection, cameraUp);
  11177. * const intersect = cullingVolume.computeVisibility(boundingVolume);
  11178. * @param position - The eye position.
  11179. * @param direction - The view direction.
  11180. * @param up - The up direction.
  11181. * @returns A culling volume at the given position and orientation.
  11182. */
  11183. computeCullingVolume(position: Cartesian3, direction: Cartesian3, up: Cartesian3): CullingVolume;
  11184. /**
  11185. * Returns the pixel's width and height in meters.
  11186. * @example
  11187. * // Example 1
  11188. * // Get the width and height of a pixel.
  11189. * const pixelSize = camera.frustum.getPixelDimensions(scene.drawingBufferWidth, scene.drawingBufferHeight, 1.0, scene.pixelRatio, new SuperMap.Cartesian2());
  11190. * @example
  11191. * // Example 2
  11192. * // Get the width and height of a pixel if the near plane was set to 'distance'.
  11193. * // For example, get the size of a pixel of an image on a billboard.
  11194. * const position = camera.position;
  11195. * const direction = camera.direction;
  11196. * const toCenter = SuperMap.Cartesian3.subtract(primitive.boundingVolume.center, position, new SuperMap.Cartesian3()); // vector from camera to a primitive
  11197. * const toCenterProj = SuperMap.Cartesian3.multiplyByScalar(direction, SuperMap.Cartesian3.dot(direction, toCenter), new SuperMap.Cartesian3()); // project vector onto camera direction vector
  11198. * const distance = SuperMap.Cartesian3.magnitude(toCenterProj);
  11199. * const pixelSize = camera.frustum.getPixelDimensions(scene.drawingBufferWidth, scene.drawingBufferHeight, distance, scene.pixelRatio, new SuperMap.Cartesian2());
  11200. * @param drawingBufferWidth - The width of the drawing buffer.
  11201. * @param drawingBufferHeight - The height of the drawing buffer.
  11202. * @param distance - The distance to the near plane in meters.
  11203. * @param pixelRatio - The scaling factor from pixel space to coordinate space.
  11204. * @param result - The object onto which to store the result.
  11205. * @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.
  11206. */
  11207. getPixelDimensions(drawingBufferWidth: number, drawingBufferHeight: number, distance: number, pixelRatio: number, result: Cartesian2): Cartesian2;
  11208. /**
  11209. * Returns a duplicate of a PerspectiveOffCenterFrustum instance.
  11210. * @param [result] - The object onto which to store the result.
  11211. * @returns The modified result parameter or a new PerspectiveFrustum instance if one was not provided.
  11212. */
  11213. clone(result?: PerspectiveOffCenterFrustum): PerspectiveOffCenterFrustum;
  11214. /**
  11215. * Compares the provided PerspectiveOffCenterFrustum componentwise and returns
  11216. * <code>true</code> if they are equal, <code>false</code> otherwise.
  11217. * @param [other] - The right hand side PerspectiveOffCenterFrustum.
  11218. * @returns <code>true</code> if they are equal, <code>false</code> otherwise.
  11219. */
  11220. equals(other?: PerspectiveOffCenterFrustum): boolean;
  11221. /**
  11222. * Compares the provided PerspectiveOffCenterFrustum componentwise and returns
  11223. * <code>true</code> if they pass an absolute or relative tolerance test,
  11224. * <code>false</code> otherwise.
  11225. * @param other - The right hand side PerspectiveOffCenterFrustum.
  11226. * @param relativeEpsilon - The relative epsilon tolerance to use for equality testing.
  11227. * @param [absoluteEpsilon = relativeEpsilon] - The absolute epsilon tolerance to use for equality testing.
  11228. * @returns <code>true</code> if this and other are within the provided epsilon, <code>false</code> otherwise.
  11229. */
  11230. equalsEpsilon(other: PerspectiveOffCenterFrustum, relativeEpsilon: number, absoluteEpsilon?: number): boolean;
  11231. }
  11232. /**
  11233. * A utility class for generating custom map pins as canvas elements.
  11234. * <br /><br />
  11235. * <div align='center'>
  11236. * <img src='Images/PinBuilder.png' width='500'/><br />
  11237. * Example pins generated using both the maki icon set, which ships with SuperMap, and single character text.
  11238. * </div>
  11239. */
  11240. export class PinBuilder {
  11241. constructor();
  11242. /**
  11243. * Creates an empty pin of the specified color and size.
  11244. * @param color - The color of the pin.
  11245. * @param size - The size of the pin, in pixels.
  11246. * @returns The canvas element that represents the generated pin.
  11247. */
  11248. fromColor(color: Color, size: number): HTMLCanvasElement;
  11249. /**
  11250. * Creates a pin with the specified icon, color, and size.
  11251. * @param url - The url of the image to be stamped onto the pin.
  11252. * @param color - The color of the pin.
  11253. * @param size - The size of the pin, in pixels.
  11254. * @returns The canvas element or a Promise to the canvas element that represents the generated pin.
  11255. */
  11256. fromUrl(url: Resource | string, color: Color, size: number): HTMLCanvasElement | Promise<HTMLCanvasElement>;
  11257. /**
  11258. * Creates a pin with the specified {@link https://www.mapbox.com/maki/|maki} icon identifier, color, and size.
  11259. * @param id - The id of the maki icon to be stamped onto the pin.
  11260. * @param color - The color of the pin.
  11261. * @param size - The size of the pin, in pixels.
  11262. * @returns The canvas element or a Promise to the canvas element that represents the generated pin.
  11263. */
  11264. fromMakiIconId(id: string, color: Color, size: number): HTMLCanvasElement | Promise<HTMLCanvasElement>;
  11265. /**
  11266. * Creates a pin with the specified text, color, and size. The text will be sized to be as large as possible
  11267. * while still being contained completely within the pin.
  11268. * @param text - The text to be stamped onto the pin.
  11269. * @param color - The color of the pin.
  11270. * @param size - The size of the pin, in pixels.
  11271. * @returns The canvas element that represents the generated pin.
  11272. */
  11273. fromText(text: string, color: Color, size: number): HTMLCanvasElement;
  11274. }
  11275. /**
  11276. * The format of a pixel, i.e., the number of components it has and what they represent.
  11277. */
  11278. export enum PixelFormat {
  11279. /**
  11280. * A pixel format containing a depth value.
  11281. */
  11282. DEPTH_COMPONENT = WebGLConstants.DEPTH_COMPONENT,
  11283. /**
  11284. * A pixel format containing a depth and stencil value, most often used with {@link PixelDatatype.UNSIGNED_INT_24_8}.
  11285. */
  11286. DEPTH_STENCIL = WebGLConstants.DEPTH_STENCIL,
  11287. /**
  11288. * A pixel format containing an alpha channel.
  11289. */
  11290. ALPHA = WebGLConstants.ALPHA,
  11291. /**
  11292. * A pixel format containing red, green, and blue channels.
  11293. */
  11294. RGB = WebGLConstants.RGB,
  11295. /**
  11296. * A pixel format containing red, green, blue, and alpha channels.
  11297. */
  11298. RGBA = WebGLConstants.RGBA,
  11299. /**
  11300. * A pixel format containing a luminance (intensity) channel.
  11301. */
  11302. LUMINANCE = WebGLConstants.LUMINANCE,
  11303. /**
  11304. * A pixel format containing luminance (intensity) and alpha channels.
  11305. */
  11306. LUMINANCE_ALPHA = WebGLConstants.LUMINANCE_ALPHA,
  11307. /**
  11308. * A pixel format containing red, green, and blue channels that is DXT1 compressed.
  11309. */
  11310. RGB_DXT1 = WebGLConstants.COMPRESSED_RGB_S3TC_DXT1_EXT,
  11311. /**
  11312. * A pixel format containing red, green, blue, and alpha channels that is DXT1 compressed.
  11313. */
  11314. RGBA_DXT1 = WebGLConstants.COMPRESSED_RGBA_S3TC_DXT1_EXT,
  11315. /**
  11316. * A pixel format containing red, green, blue, and alpha channels that is DXT3 compressed.
  11317. */
  11318. RGBA_DXT3 = WebGLConstants.COMPRESSED_RGBA_S3TC_DXT3_EXT,
  11319. /**
  11320. * A pixel format containing red, green, blue, and alpha channels that is DXT5 compressed.
  11321. */
  11322. RGBA_DXT5 = WebGLConstants.COMPRESSED_RGBA_S3TC_DXT5_EXT,
  11323. /**
  11324. * A pixel format containing red, green, and blue channels that is PVR 4bpp compressed.
  11325. */
  11326. RGB_PVRTC_4BPPV1 = WebGLConstants.COMPRESSED_RGB_PVRTC_4BPPV1_IMG,
  11327. /**
  11328. * A pixel format containing red, green, and blue channels that is PVR 2bpp compressed.
  11329. */
  11330. RGB_PVRTC_2BPPV1 = WebGLConstants.COMPRESSED_RGB_PVRTC_2BPPV1_IMG,
  11331. /**
  11332. * A pixel format containing red, green, blue, and alpha channels that is PVR 4bpp compressed.
  11333. */
  11334. RGBA_PVRTC_4BPPV1 = WebGLConstants.COMPRESSED_RGBA_PVRTC_4BPPV1_IMG,
  11335. /**
  11336. * A pixel format containing red, green, blue, and alpha channels that is PVR 2bpp compressed.
  11337. */
  11338. RGBA_PVRTC_2BPPV1 = WebGLConstants.COMPRESSED_RGBA_PVRTC_2BPPV1_IMG,
  11339. /**
  11340. * A pixel format containing red, green, blue, and alpha channels that is ASTC compressed.
  11341. */
  11342. RGBA_ASTC = WebGLConstants.COMPRESSED_RGBA_ASTC_4x4_WEBGL,
  11343. /**
  11344. * A pixel format containing red, green, and blue channels that is ETC1 compressed.
  11345. */
  11346. RGB_ETC1 = WebGLConstants.COMPRESSED_RGB_ETC1_WEBGL,
  11347. /**
  11348. * A pixel format containing red, green, and blue channels that is ETC2 compressed.
  11349. */
  11350. RGB8_ETC2 = WebGLConstants.COMPRESSED_RGB8_ETC2,
  11351. /**
  11352. * A pixel format containing red, green, blue, and alpha channels that is ETC2 compressed.
  11353. */
  11354. RGBA8_ETC2_EAC = WebGLConstants.COMPRESSED_RGBA8_ETC2_EAC,
  11355. /**
  11356. * A pixel format containing red, green, blue, and alpha channels that is BC7 compressed.
  11357. */
  11358. RGBA_BC7 = WebGLConstants.COMPRESSED_RGBA_BPTC_UNORM
  11359. }
  11360. /**
  11361. * A plane in Hessian Normal Form defined by
  11362. * <pre>
  11363. * ax + by + cz + d = 0
  11364. * </pre>
  11365. * where (a, b, c) is the plane's <code>normal</code>, d is the signed
  11366. * <code>distance</code> to the plane, and (x, y, z) is any point on
  11367. * the plane.
  11368. * @example
  11369. * // The plane x=0
  11370. * const plane = new SuperMap.Plane(SuperMap.Cartesian3.UNIT_X, 0.0);
  11371. * @param normal - The plane's normal (normalized).
  11372. * @param distance - The shortest distance from the origin to the plane. The sign of
  11373. * <code>distance</code> determines which side of the plane the origin
  11374. * is on. If <code>distance</code> is positive, the origin is in the half-space
  11375. * in the direction of the normal; if negative, the origin is in the half-space
  11376. * opposite to the normal; if zero, the plane passes through the origin.
  11377. */
  11378. export class Plane {
  11379. constructor(normal: Cartesian3, distance: number);
  11380. /**
  11381. * The plane's normal.
  11382. */
  11383. normal: Cartesian3;
  11384. /**
  11385. * The shortest distance from the origin to the plane. The sign of
  11386. * <code>distance</code> determines which side of the plane the origin
  11387. * is on. If <code>distance</code> is positive, the origin is in the half-space
  11388. * in the direction of the normal; if negative, the origin is in the half-space
  11389. * opposite to the normal; if zero, the plane passes through the origin.
  11390. */
  11391. distance: number;
  11392. /**
  11393. * Creates a plane from a normal and a point on the plane.
  11394. * @example
  11395. * const point = SuperMap.Cartesian3.fromDegrees(-72.0, 40.0);
  11396. * const normal = ellipsoid.geodeticSurfaceNormal(point);
  11397. * const tangentPlane = SuperMap.Plane.fromPointNormal(point, normal);
  11398. * @param point - The point on the plane.
  11399. * @param normal - The plane's normal (normalized).
  11400. * @param [result] - The object onto which to store the result.
  11401. * @returns A new plane instance or the modified result parameter.
  11402. */
  11403. fromPointNormal(point: Cartesian3, normal: Cartesian3, result?: Plane): Plane;
  11404. /**
  11405. * Creates a plane from the general equation
  11406. * @param coefficients - The plane's normal (normalized).
  11407. * @param [result] - The object onto which to store the result.
  11408. * @returns A new plane instance or the modified result parameter.
  11409. */
  11410. fromCartesian4(coefficients: Cartesian4, result?: Plane): Plane;
  11411. /**
  11412. * Computes the signed shortest distance of a point to a plane.
  11413. * The sign of the distance determines which side of the plane the point
  11414. * is on. If the distance is positive, the point is in the half-space
  11415. * in the direction of the normal; if negative, the point is in the half-space
  11416. * opposite to the normal; if zero, the plane passes through the point.
  11417. * @param plane - The plane.
  11418. * @param point - The point.
  11419. * @returns The signed shortest distance of the point to the plane.
  11420. */
  11421. getPointDistance(plane: Plane, point: Cartesian3): number;
  11422. /**
  11423. * Projects a point onto the plane.
  11424. * @param plane - The plane to project the point onto
  11425. * @param point - The point to project onto the plane
  11426. * @param [result] - The result point. If undefined, a new Cartesian3 will be created.
  11427. * @returns The modified result parameter or a new Cartesian3 instance if one was not provided.
  11428. */
  11429. projectPointOntoPlane(plane: Plane, point: Cartesian3, result?: Cartesian3): Cartesian3;
  11430. /**
  11431. * Transforms the plane by the given transformation matrix.
  11432. * @param plane - The plane.
  11433. * @param transform - The transformation matrix.
  11434. * @param [result] - The object into which to store the result.
  11435. * @returns The plane transformed by the given transformation matrix.
  11436. */
  11437. transform(plane: Plane, transform: Matrix4, result?: Plane): Plane;
  11438. /**
  11439. * Duplicates a Plane instance.
  11440. * @param plane - The plane to duplicate.
  11441. * @param [result] - The object onto which to store the result.
  11442. * @returns The modified result parameter or a new Plane instance if one was not provided.
  11443. */
  11444. clone(plane: Plane, result?: Plane): Plane;
  11445. /**
  11446. * Compares the provided Planes by normal and distance and returns
  11447. * <code>true</code> if they are equal, <code>false</code> otherwise.
  11448. * @param left - The first plane.
  11449. * @param right - The second plane.
  11450. * @returns <code>true</code> if left and right are equal, <code>false</code> otherwise.
  11451. */
  11452. equals(left: Plane, right: Plane): boolean;
  11453. /**
  11454. * A constant initialized to the XY plane passing through the origin, with normal in positive Z.
  11455. */
  11456. readonly ORIGIN_XY_PLANE: Plane;
  11457. /**
  11458. * A constant initialized to the YZ plane passing through the origin, with normal in positive X.
  11459. */
  11460. readonly ORIGIN_YZ_PLANE: Plane;
  11461. /**
  11462. * A constant initialized to the ZX plane passing through the origin, with normal in positive Y.
  11463. */
  11464. readonly ORIGIN_ZX_PLANE: Plane;
  11465. }
  11466. /**
  11467. * Describes geometry representing a plane centered at the origin, with a unit width and length.
  11468. * @example
  11469. * const planeGeometry = new SuperMap.PlaneGeometry({
  11470. * vertexFormat : SuperMap.VertexFormat.POSITION_ONLY
  11471. * });
  11472. * @param [options] - Object with the following properties:
  11473. * @param [options.vertexFormat = VertexFormat.DEFAULT] - The vertex attributes to be computed.
  11474. */
  11475. export class PlaneGeometry {
  11476. constructor(options?: {
  11477. vertexFormat?: VertexFormat;
  11478. });
  11479. /**
  11480. * The number of elements used to pack the object into an array.
  11481. */
  11482. packedLength: number;
  11483. /**
  11484. * Stores the provided instance into the provided array.
  11485. * @param value - The value to pack.
  11486. * @param array - The array to pack into.
  11487. * @param [startingIndex = 0] - The index into the array at which to start packing the elements.
  11488. * @returns The array that was packed into
  11489. */
  11490. pack(value: PlaneGeometry, array: number[], startingIndex?: number): number[];
  11491. /**
  11492. * Retrieves an instance from a packed array.
  11493. * @param array - The packed array.
  11494. * @param [startingIndex = 0] - The starting index of the element to be unpacked.
  11495. * @param [result] - The object into which to store the result.
  11496. * @returns The modified result parameter or a new PlaneGeometry instance if one was not provided.
  11497. */
  11498. unpack(array: number[], startingIndex?: number, result?: PlaneGeometry): PlaneGeometry;
  11499. /**
  11500. * Computes the geometric representation of a plane, including its vertices, indices, and a bounding sphere.
  11501. * @param planeGeometry - A description of the plane.
  11502. * @returns The computed vertices and indices.
  11503. */
  11504. createGeometry(planeGeometry: PlaneGeometry): Geometry | undefined;
  11505. }
  11506. /**
  11507. * Describes geometry representing the outline of a plane centered at the origin, with a unit width and length.
  11508. */
  11509. export class PlaneOutlineGeometry {
  11510. constructor();
  11511. /**
  11512. * The number of elements used to pack the object into an array.
  11513. */
  11514. packedLength: number;
  11515. /**
  11516. * Stores the provided instance into the provided array.
  11517. * @param value - The value to pack.
  11518. * @param array - The array to pack into.
  11519. * @returns The array that was packed into
  11520. */
  11521. pack(value: PlaneOutlineGeometry, array: number[]): number[];
  11522. /**
  11523. * Retrieves an instance from a packed array.
  11524. * @param array - The packed array.
  11525. * @param [startingIndex = 0] - The starting index of the element to be unpacked.
  11526. * @param [result] - The object into which to store the result.
  11527. * @returns The modified result parameter or a new PlaneOutlineGeometry instance if one was not provided.
  11528. */
  11529. unpack(array: number[], startingIndex?: number, result?: PlaneOutlineGeometry): PlaneOutlineGeometry;
  11530. /**
  11531. * Computes the geometric representation of an outline of a plane, including its vertices, indices, and a bounding sphere.
  11532. * @returns The computed vertices and indices.
  11533. */
  11534. createGeometry(): Geometry | undefined;
  11535. }
  11536. /**
  11537. * 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}.
  11538. * @example
  11539. * // 1. create a polygon from points
  11540. * const polygon = new SuperMap.PolygonGeometry({
  11541. * polygonHierarchy : new SuperMap.PolygonHierarchy(
  11542. * SuperMap.Cartesian3.fromDegreesArray([
  11543. * -72.0, 40.0,
  11544. * -70.0, 35.0,
  11545. * -75.0, 30.0,
  11546. * -70.0, 30.0,
  11547. * -68.0, 40.0
  11548. * ])
  11549. * )
  11550. * });
  11551. * const geometry = SuperMap.PolygonGeometry.createGeometry(polygon);
  11552. *
  11553. * // 2. create a nested polygon with holes
  11554. * const polygonWithHole = new SuperMap.PolygonGeometry({
  11555. * polygonHierarchy : new SuperMap.PolygonHierarchy(
  11556. * SuperMap.Cartesian3.fromDegreesArray([
  11557. * -109.0, 30.0,
  11558. * -95.0, 30.0,
  11559. * -95.0, 40.0,
  11560. * -109.0, 40.0
  11561. * ]),
  11562. * [new SuperMap.PolygonHierarchy(
  11563. * SuperMap.Cartesian3.fromDegreesArray([
  11564. * -107.0, 31.0,
  11565. * -107.0, 39.0,
  11566. * -97.0, 39.0,
  11567. * -97.0, 31.0
  11568. * ]),
  11569. * [new SuperMap.PolygonHierarchy(
  11570. * SuperMap.Cartesian3.fromDegreesArray([
  11571. * -105.0, 33.0,
  11572. * -99.0, 33.0,
  11573. * -99.0, 37.0,
  11574. * -105.0, 37.0
  11575. * ]),
  11576. * [new SuperMap.PolygonHierarchy(
  11577. * SuperMap.Cartesian3.fromDegreesArray([
  11578. * -103.0, 34.0,
  11579. * -101.0, 34.0,
  11580. * -101.0, 36.0,
  11581. * -103.0, 36.0
  11582. * ])
  11583. * )]
  11584. * )]
  11585. * )]
  11586. * )
  11587. * });
  11588. * const geometry = SuperMap.PolygonGeometry.createGeometry(polygonWithHole);
  11589. *
  11590. * // 3. create extruded polygon
  11591. * const extrudedPolygon = new SuperMap.PolygonGeometry({
  11592. * polygonHierarchy : new SuperMap.PolygonHierarchy(
  11593. * SuperMap.Cartesian3.fromDegreesArray([
  11594. * -72.0, 40.0,
  11595. * -70.0, 35.0,
  11596. * -75.0, 30.0,
  11597. * -70.0, 30.0,
  11598. * -68.0, 40.0
  11599. * ])
  11600. * ),
  11601. * extrudedHeight: 300000
  11602. * });
  11603. * const geometry = SuperMap.PolygonGeometry.createGeometry(extrudedPolygon);
  11604. * @param options - Object with the following properties:
  11605. * @param options.polygonHierarchy - A polygon hierarchy that can include holes.
  11606. * @param [options.height = 0.0] - The distance in meters between the polygon and the ellipsoid surface.
  11607. * @param [options.extrudedHeight] - The distance in meters between the polygon's extruded face and the ellipsoid surface.
  11608. * @param [options.vertexFormat = VertexFormat.DEFAULT] - The vertex attributes to be computed.
  11609. * @param [options.stRotation = 0.0] - The rotation of the texture coordinates, in radians. A positive rotation is counter-clockwise.
  11610. * @param [options.ellipsoid = Ellipsoid.WGS84] - The ellipsoid to be used as a reference.
  11611. * @param [options.granularity = Math.RADIANS_PER_DEGREE] - The distance, in radians, between each latitude and longitude. Determines the number of positions in the buffer.
  11612. * @param [options.perPositionHeight = false] - Use the height of options.positions for each position instead of using options.height to determine the height.
  11613. * @param [options.closeTop = true] - When false, leaves off the top of an extruded polygon open.
  11614. * @param [options.closeBottom = true] - When false, leaves off the bottom of an extruded polygon open.
  11615. * @param [options.arcType = ArcType.GEODESIC] - The type of line the polygon edges must follow. Valid options are {@link ArcType.GEODESIC} and {@link ArcType.RHUMB}.
  11616. * @param [options.textureCoordinates] - Texture coordinates as a {@link PolygonHierarchy} of {@link Cartesian2} points. Has no effect for ground primitives.
  11617. */
  11618. export class PolygonGeometry {
  11619. constructor(options: {
  11620. polygonHierarchy: PolygonHierarchy;
  11621. height?: number;
  11622. extrudedHeight?: number;
  11623. vertexFormat?: VertexFormat;
  11624. stRotation?: number;
  11625. ellipsoid?: Ellipsoid;
  11626. granularity?: number;
  11627. perPositionHeight?: boolean;
  11628. closeTop?: boolean;
  11629. closeBottom?: boolean;
  11630. arcType?: ArcType;
  11631. textureCoordinates?: PolygonHierarchy;
  11632. });
  11633. /**
  11634. * The number of elements used to pack the object into an array.
  11635. */
  11636. packedLength: number;
  11637. /**
  11638. * A description of a polygon from an array of positions. Polygon geometry can be rendered with both {@link Primitive} and {@link GroundPrimitive}.
  11639. * @example
  11640. * // create a polygon from points
  11641. * const polygon = SuperMap.PolygonGeometry.fromPositions({
  11642. * positions : SuperMap.Cartesian3.fromDegreesArray([
  11643. * -72.0, 40.0,
  11644. * -70.0, 35.0,
  11645. * -75.0, 30.0,
  11646. * -70.0, 30.0,
  11647. * -68.0, 40.0
  11648. * ])
  11649. * });
  11650. * const geometry = SuperMap.PolygonGeometry.createGeometry(polygon);
  11651. * @param options - Object with the following properties:
  11652. * @param options.positions - An array of positions that defined the corner points of the polygon.
  11653. * @param [options.height = 0.0] - The height of the polygon.
  11654. * @param [options.extrudedHeight] - The height of the polygon extrusion.
  11655. * @param [options.vertexFormat = VertexFormat.DEFAULT] - The vertex attributes to be computed.
  11656. * @param [options.stRotation = 0.0] - The rotation of the texture coordinates, in radians. A positive rotation is counter-clockwise.
  11657. * @param [options.ellipsoid = Ellipsoid.WGS84] - The ellipsoid to be used as a reference.
  11658. * @param [options.granularity = Math.RADIANS_PER_DEGREE] - The distance, in radians, between each latitude and longitude. Determines the number of positions in the buffer.
  11659. * @param [options.perPositionHeight = false] - Use the height of options.positions for each position instead of using options.height to determine the height.
  11660. * @param [options.closeTop = true] - When false, leaves off the top of an extruded polygon open.
  11661. * @param [options.closeBottom = true] - When false, leaves off the bottom of an extruded polygon open.
  11662. * @param [options.arcType = ArcType.GEODESIC] - The type of line the polygon edges must follow. Valid options are {@link ArcType.GEODESIC} and {@link ArcType.RHUMB}.
  11663. * @param [options.textureCoordinates] - Texture coordinates as a {@link PolygonHierarchy} of {@link Cartesian2} points. Has no effect for ground primitives.
  11664. */
  11665. fromPositions(options: {
  11666. positions: Cartesian3[];
  11667. height?: number;
  11668. extrudedHeight?: number;
  11669. vertexFormat?: VertexFormat;
  11670. stRotation?: number;
  11671. ellipsoid?: Ellipsoid;
  11672. granularity?: number;
  11673. perPositionHeight?: boolean;
  11674. closeTop?: boolean;
  11675. closeBottom?: boolean;
  11676. arcType?: ArcType;
  11677. textureCoordinates?: PolygonHierarchy;
  11678. }): PolygonGeometry;
  11679. /**
  11680. * Stores the provided instance into the provided array.
  11681. * @param value - The value to pack.
  11682. * @param array - The array to pack into.
  11683. * @param [startingIndex = 0] - The index into the array at which to start packing the elements.
  11684. * @returns The array that was packed into
  11685. */
  11686. pack(value: PolygonGeometry, array: number[], startingIndex?: number): number[];
  11687. /**
  11688. * Retrieves an instance from a packed array.
  11689. * @param array - The packed array.
  11690. * @param [startingIndex = 0] - The starting index of the element to be unpacked.
  11691. * @param [result] - The object into which to store the result.
  11692. */
  11693. unpack(array: number[], startingIndex?: number, result?: PolygonGeometry): void;
  11694. /**
  11695. * Returns the bounding rectangle given the provided options
  11696. * @param options - Object with the following properties:
  11697. * @param options.polygonHierarchy - A polygon hierarchy that can include holes.
  11698. * @param [options.granularity = Math.RADIANS_PER_DEGREE] - The distance, in radians, between each latitude and longitude. Determines the number of positions sampled.
  11699. * @param [options.arcType = ArcType.GEODESIC] - The type of line the polygon edges must follow. Valid options are {@link ArcType.GEODESIC} and {@link ArcType.RHUMB}.
  11700. * @param [options.ellipsoid = Ellipsoid.WGS84] - The ellipsoid to be used as a reference.
  11701. * @param [result] - An object in which to store the result.
  11702. * @returns The result rectangle
  11703. */
  11704. computeRectangle(options: {
  11705. polygonHierarchy: PolygonHierarchy;
  11706. granularity?: number;
  11707. arcType?: ArcType;
  11708. ellipsoid?: Ellipsoid;
  11709. }, result?: Rectangle): Rectangle;
  11710. /**
  11711. * Computes the geometric representation of a polygon, including its vertices, indices, and a bounding sphere.
  11712. * @param polygonGeometry - A description of the polygon.
  11713. * @returns The computed vertices and indices.
  11714. */
  11715. createGeometry(polygonGeometry: PolygonGeometry): Geometry | undefined;
  11716. }
  11717. /**
  11718. * An hierarchy of linear rings which define a polygon and its holes.
  11719. * The holes themselves may also have holes which nest inner polygons.
  11720. * @param [positions] - A linear ring defining the outer boundary of the polygon or hole.
  11721. * @param [holes] - An array of polygon hierarchies defining holes in the polygon.
  11722. */
  11723. export class PolygonHierarchy {
  11724. constructor(positions?: Cartesian3[], holes?: PolygonHierarchy[]);
  11725. /**
  11726. * A linear ring defining the outer boundary of the polygon or hole.
  11727. */
  11728. positions: Cartesian3[];
  11729. /**
  11730. * An array of polygon hierarchies defining holes in the polygon.
  11731. */
  11732. holes: PolygonHierarchy[];
  11733. }
  11734. /**
  11735. * A description of the outline of a polygon on the ellipsoid. The polygon is defined by a polygon hierarchy.
  11736. * @example
  11737. * // 1. create a polygon outline from points
  11738. * const polygon = new SuperMap.PolygonOutlineGeometry({
  11739. * polygonHierarchy : new SuperMap.PolygonHierarchy(
  11740. * SuperMap.Cartesian3.fromDegreesArray([
  11741. * -72.0, 40.0,
  11742. * -70.0, 35.0,
  11743. * -75.0, 30.0,
  11744. * -70.0, 30.0,
  11745. * -68.0, 40.0
  11746. * ])
  11747. * )
  11748. * });
  11749. * const geometry = SuperMap.PolygonOutlineGeometry.createGeometry(polygon);
  11750. *
  11751. * // 2. create a nested polygon with holes outline
  11752. * const polygonWithHole = new SuperMap.PolygonOutlineGeometry({
  11753. * polygonHierarchy : new SuperMap.PolygonHierarchy(
  11754. * SuperMap.Cartesian3.fromDegreesArray([
  11755. * -109.0, 30.0,
  11756. * -95.0, 30.0,
  11757. * -95.0, 40.0,
  11758. * -109.0, 40.0
  11759. * ]),
  11760. * [new SuperMap.PolygonHierarchy(
  11761. * SuperMap.Cartesian3.fromDegreesArray([
  11762. * -107.0, 31.0,
  11763. * -107.0, 39.0,
  11764. * -97.0, 39.0,
  11765. * -97.0, 31.0
  11766. * ]),
  11767. * [new SuperMap.PolygonHierarchy(
  11768. * SuperMap.Cartesian3.fromDegreesArray([
  11769. * -105.0, 33.0,
  11770. * -99.0, 33.0,
  11771. * -99.0, 37.0,
  11772. * -105.0, 37.0
  11773. * ]),
  11774. * [new SuperMap.PolygonHierarchy(
  11775. * SuperMap.Cartesian3.fromDegreesArray([
  11776. * -103.0, 34.0,
  11777. * -101.0, 34.0,
  11778. * -101.0, 36.0,
  11779. * -103.0, 36.0
  11780. * ])
  11781. * )]
  11782. * )]
  11783. * )]
  11784. * )
  11785. * });
  11786. * const geometry = SuperMap.PolygonOutlineGeometry.createGeometry(polygonWithHole);
  11787. *
  11788. * // 3. create extruded polygon outline
  11789. * const extrudedPolygon = new SuperMap.PolygonOutlineGeometry({
  11790. * polygonHierarchy : new SuperMap.PolygonHierarchy(
  11791. * SuperMap.Cartesian3.fromDegreesArray([
  11792. * -72.0, 40.0,
  11793. * -70.0, 35.0,
  11794. * -75.0, 30.0,
  11795. * -70.0, 30.0,
  11796. * -68.0, 40.0
  11797. * ])
  11798. * ),
  11799. * extrudedHeight: 300000
  11800. * });
  11801. * const geometry = SuperMap.PolygonOutlineGeometry.createGeometry(extrudedPolygon);
  11802. * @param options - Object with the following properties:
  11803. * @param options.polygonHierarchy - A polygon hierarchy that can include holes.
  11804. * @param [options.height = 0.0] - The distance in meters between the polygon and the ellipsoid surface.
  11805. * @param [options.extrudedHeight] - The distance in meters between the polygon's extruded face and the ellipsoid surface.
  11806. * @param [options.vertexFormat = VertexFormat.DEFAULT] - The vertex attributes to be computed.
  11807. * @param [options.ellipsoid = Ellipsoid.WGS84] - The ellipsoid to be used as a reference.
  11808. * @param [options.granularity = Math.RADIANS_PER_DEGREE] - The distance, in radians, between each latitude and longitude. Determines the number of positions in the buffer.
  11809. * @param [options.perPositionHeight = false] - Use the height of options.positions for each position instead of using options.height to determine the height.
  11810. * @param [options.arcType = ArcType.GEODESIC] - The type of path the outline must follow. Valid options are {@link ArcType.GEODESIC} and {@link ArcType.RHUMB}.
  11811. */
  11812. export class PolygonOutlineGeometry {
  11813. constructor(options: {
  11814. polygonHierarchy: PolygonHierarchy;
  11815. height?: number;
  11816. extrudedHeight?: number;
  11817. vertexFormat?: VertexFormat;
  11818. ellipsoid?: Ellipsoid;
  11819. granularity?: number;
  11820. perPositionHeight?: boolean;
  11821. arcType?: ArcType;
  11822. });
  11823. /**
  11824. * The number of elements used to pack the object into an array.
  11825. */
  11826. packedLength: number;
  11827. /**
  11828. * Stores the provided instance into the provided array.
  11829. * @param value - The value to pack.
  11830. * @param array - The array to pack into.
  11831. * @param [startingIndex = 0] - The index into the array at which to start packing the elements.
  11832. * @returns The array that was packed into
  11833. */
  11834. pack(value: PolygonOutlineGeometry, array: number[], startingIndex?: number): number[];
  11835. /**
  11836. * Retrieves an instance from a packed array.
  11837. * @param array - The packed array.
  11838. * @param [startingIndex = 0] - The starting index of the element to be unpacked.
  11839. * @param [result] - The object into which to store the result.
  11840. * @returns The modified result parameter or a new PolygonOutlineGeometry instance if one was not provided.
  11841. */
  11842. unpack(array: number[], startingIndex?: number, result?: PolygonOutlineGeometry): PolygonOutlineGeometry;
  11843. /**
  11844. * A description of a polygon outline from an array of positions.
  11845. * @example
  11846. * // create a polygon from points
  11847. * const polygon = SuperMap.PolygonOutlineGeometry.fromPositions({
  11848. * positions : SuperMap.Cartesian3.fromDegreesArray([
  11849. * -72.0, 40.0,
  11850. * -70.0, 35.0,
  11851. * -75.0, 30.0,
  11852. * -70.0, 30.0,
  11853. * -68.0, 40.0
  11854. * ])
  11855. * });
  11856. * const geometry = SuperMap.PolygonOutlineGeometry.createGeometry(polygon);
  11857. * @param options - Object with the following properties:
  11858. * @param options.positions - An array of positions that defined the corner points of the polygon.
  11859. * @param [options.height = 0.0] - The height of the polygon.
  11860. * @param [options.extrudedHeight] - The height of the polygon extrusion.
  11861. * @param [options.ellipsoid = Ellipsoid.WGS84] - The ellipsoid to be used as a reference.
  11862. * @param [options.granularity = Math.RADIANS_PER_DEGREE] - The distance, in radians, between each latitude and longitude. Determines the number of positions in the buffer.
  11863. * @param [options.perPositionHeight = false] - Use the height of options.positions for each position instead of using options.height to determine the height.
  11864. * @param [options.arcType = ArcType.GEODESIC] - The type of path the outline must follow. Valid options are {@link LinkType.GEODESIC} and {@link ArcType.RHUMB}.
  11865. */
  11866. fromPositions(options: {
  11867. positions: Cartesian3[];
  11868. height?: number;
  11869. extrudedHeight?: number;
  11870. ellipsoid?: Ellipsoid;
  11871. granularity?: number;
  11872. perPositionHeight?: boolean;
  11873. arcType?: ArcType;
  11874. }): PolygonOutlineGeometry;
  11875. /**
  11876. * Computes the geometric representation of a polygon outline, including its vertices, indices, and a bounding sphere.
  11877. * @param polygonGeometry - A description of the polygon outline.
  11878. * @returns The computed vertices and indices.
  11879. */
  11880. createGeometry(polygonGeometry: PolygonOutlineGeometry): Geometry | undefined;
  11881. }
  11882. /**
  11883. * A description of a polyline modeled as a line strip; the first two positions define a line segment,
  11884. * and each additional position defines a line segment from the previous position. The polyline is capable of
  11885. * displaying with a material.
  11886. * @example
  11887. * // A polyline with two connected line segments
  11888. * const polyline = new SuperMap.PolylineGeometry({
  11889. * positions : SuperMap.Cartesian3.fromDegreesArray([
  11890. * 0.0, 0.0,
  11891. * 5.0, 0.0,
  11892. * 5.0, 5.0
  11893. * ]),
  11894. * width : 10.0
  11895. * });
  11896. * const geometry = SuperMap.PolylineGeometry.createGeometry(polyline);
  11897. * @param options - Object with the following properties:
  11898. * @param options.positions - An array of {@link Cartesian3} defining the positions in the polyline as a line strip.
  11899. * @param [options.width = 1.0] - The width in pixels.
  11900. * @param [options.colors] - An Array of {@link Color} defining the per vertex or per segment colors.
  11901. * @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.
  11902. * @param [options.arcType = ArcType.GEODESIC] - The type of line the polyline segments must follow.
  11903. * @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.
  11904. * @param [options.vertexFormat = VertexFormat.DEFAULT] - The vertex attributes to be computed.
  11905. * @param [options.ellipsoid = Ellipsoid.WGS84] - The ellipsoid to be used as a reference.
  11906. */
  11907. export class PolylineGeometry {
  11908. constructor(options: {
  11909. positions: Cartesian3[];
  11910. width?: number;
  11911. colors?: Color[];
  11912. colorsPerVertex?: boolean;
  11913. arcType?: ArcType;
  11914. granularity?: number;
  11915. vertexFormat?: VertexFormat;
  11916. ellipsoid?: Ellipsoid;
  11917. });
  11918. /**
  11919. * The number of elements used to pack the object into an array.
  11920. */
  11921. packedLength: number;
  11922. /**
  11923. * Stores the provided instance into the provided array.
  11924. * @param value - The value to pack.
  11925. * @param array - The array to pack into.
  11926. * @param [startingIndex = 0] - The index into the array at which to start packing the elements.
  11927. * @returns The array that was packed into
  11928. */
  11929. pack(value: PolylineGeometry, array: number[], startingIndex?: number): number[];
  11930. /**
  11931. * Retrieves an instance from a packed array.
  11932. * @param array - The packed array.
  11933. * @param [startingIndex = 0] - The starting index of the element to be unpacked.
  11934. * @param [result] - The object into which to store the result.
  11935. * @returns The modified result parameter or a new PolylineGeometry instance if one was not provided.
  11936. */
  11937. unpack(array: number[], startingIndex?: number, result?: PolylineGeometry): PolylineGeometry;
  11938. /**
  11939. * Computes the geometric representation of a polyline, including its vertices, indices, and a bounding sphere.
  11940. * @param polylineGeometry - A description of the polyline.
  11941. * @returns The computed vertices and indices.
  11942. */
  11943. createGeometry(polylineGeometry: PolylineGeometry): Geometry | undefined;
  11944. }
  11945. /**
  11946. * A description of a polyline with a volume (a 2D shape extruded along a polyline).
  11947. * @example
  11948. * function computeCircle(radius) {
  11949. * const positions = [];
  11950. * for (let i = 0; i < 360; i++) {
  11951. * const radians = SuperMap.Math.toRadians(i);
  11952. * positions.push(new SuperMap.Cartesian2(radius * Math.cos(radians), radius * Math.sin(radians)));
  11953. * }
  11954. * return positions;
  11955. * }
  11956. *
  11957. * const volume = new SuperMap.PolylineVolumeGeometry({
  11958. * vertexFormat : SuperMap.VertexFormat.POSITION_ONLY,
  11959. * polylinePositions : SuperMap.Cartesian3.fromDegreesArray([
  11960. * -72.0, 40.0,
  11961. * -70.0, 35.0
  11962. * ]),
  11963. * shapePositions : computeCircle(100000.0)
  11964. * });
  11965. * @param options - Object with the following properties:
  11966. * @param options.polylinePositions - An array of {@link Cartesian3} positions that define the center of the polyline volume.
  11967. * @param options.shapePositions - An array of {@link Cartesian2} positions that define the shape to be extruded along the polyline
  11968. * @param [options.ellipsoid = Ellipsoid.WGS84] - The ellipsoid to be used as a reference.
  11969. * @param [options.granularity = Math.RADIANS_PER_DEGREE] - The distance, in radians, between each latitude and longitude. Determines the number of positions in the buffer.
  11970. * @param [options.vertexFormat = VertexFormat.DEFAULT] - The vertex attributes to be computed.
  11971. * @param [options.cornerType = CornerType.ROUNDED] - Determines the style of the corners.
  11972. */
  11973. export class PolylineVolumeGeometry {
  11974. constructor(options: {
  11975. polylinePositions: Cartesian3[];
  11976. shapePositions: Cartesian2[];
  11977. ellipsoid?: Ellipsoid;
  11978. granularity?: number;
  11979. vertexFormat?: VertexFormat;
  11980. cornerType?: CornerType;
  11981. });
  11982. /**
  11983. * The number of elements used to pack the object into an array.
  11984. */
  11985. packedLength: number;
  11986. /**
  11987. * Stores the provided instance into the provided array.
  11988. * @param value - The value to pack.
  11989. * @param array - The array to pack into.
  11990. * @param [startingIndex = 0] - The index into the array at which to start packing the elements.
  11991. * @returns The array that was packed into
  11992. */
  11993. pack(value: PolylineVolumeGeometry, array: number[], startingIndex?: number): number[];
  11994. /**
  11995. * Retrieves an instance from a packed array.
  11996. * @param array - The packed array.
  11997. * @param [startingIndex = 0] - The starting index of the element to be unpacked.
  11998. * @param [result] - The object into which to store the result.
  11999. * @returns The modified result parameter or a new PolylineVolumeGeometry instance if one was not provided.
  12000. */
  12001. unpack(array: number[], startingIndex?: number, result?: PolylineVolumeGeometry): PolylineVolumeGeometry;
  12002. /**
  12003. * Computes the geometric representation of a polyline with a volume, including its vertices, indices, and a bounding sphere.
  12004. * @param polylineVolumeGeometry - A description of the polyline volume.
  12005. * @returns The computed vertices and indices.
  12006. */
  12007. createGeometry(polylineVolumeGeometry: PolylineVolumeGeometry): Geometry | undefined;
  12008. }
  12009. /**
  12010. * A description of a polyline with a volume (a 2D shape extruded along a polyline).
  12011. * @example
  12012. * function computeCircle(radius) {
  12013. * const positions = [];
  12014. * for (let i = 0; i < 360; i++) {
  12015. * const radians = SuperMap.Math.toRadians(i);
  12016. * positions.push(new SuperMap.Cartesian2(radius * Math.cos(radians), radius * Math.sin(radians)));
  12017. * }
  12018. * return positions;
  12019. * }
  12020. *
  12021. * const volumeOutline = new SuperMap.PolylineVolumeOutlineGeometry({
  12022. * polylinePositions : SuperMap.Cartesian3.fromDegreesArray([
  12023. * -72.0, 40.0,
  12024. * -70.0, 35.0
  12025. * ]),
  12026. * shapePositions : computeCircle(100000.0)
  12027. * });
  12028. * @param options - Object with the following properties:
  12029. * @param options.polylinePositions - An array of positions that define the center of the polyline volume.
  12030. * @param options.shapePositions - An array of positions that define the shape to be extruded along the polyline
  12031. * @param [options.ellipsoid = Ellipsoid.WGS84] - The ellipsoid to be used as a reference.
  12032. * @param [options.granularity = Math.RADIANS_PER_DEGREE] - The distance, in radians, between each latitude and longitude. Determines the number of positions in the buffer.
  12033. * @param [options.cornerType = CornerType.ROUNDED] - Determines the style of the corners.
  12034. */
  12035. export class PolylineVolumeOutlineGeometry {
  12036. constructor(options: {
  12037. polylinePositions: Cartesian3[];
  12038. shapePositions: Cartesian2[];
  12039. ellipsoid?: Ellipsoid;
  12040. granularity?: number;
  12041. cornerType?: CornerType;
  12042. });
  12043. /**
  12044. * The number of elements used to pack the object into an array.
  12045. */
  12046. packedLength: number;
  12047. /**
  12048. * Stores the provided instance into the provided array.
  12049. * @param value - The value to pack.
  12050. * @param array - The array to pack into.
  12051. * @param [startingIndex = 0] - The index into the array at which to start packing the elements.
  12052. * @returns The array that was packed into
  12053. */
  12054. pack(value: PolylineVolumeOutlineGeometry, array: number[], startingIndex?: number): number[];
  12055. /**
  12056. * Retrieves an instance from a packed array.
  12057. * @param array - The packed array.
  12058. * @param [startingIndex = 0] - The starting index of the element to be unpacked.
  12059. * @param [result] - The object into which to store the result.
  12060. * @returns The modified result parameter or a new PolylineVolumeOutlineGeometry instance if one was not provided.
  12061. */
  12062. unpack(array: number[], startingIndex?: number, result?: PolylineVolumeOutlineGeometry): PolylineVolumeOutlineGeometry;
  12063. /**
  12064. * Computes the geometric representation of the outline of a polyline with a volume, including its vertices, indices, and a bounding sphere.
  12065. * @param polylineVolumeOutlineGeometry - A description of the polyline volume outline.
  12066. * @returns The computed vertices and indices.
  12067. */
  12068. createGeometry(polylineVolumeOutlineGeometry: PolylineVolumeOutlineGeometry): Geometry | undefined;
  12069. }
  12070. /**
  12071. * The type of a geometric primitive, i.e., points, lines, and triangles.
  12072. */
  12073. export enum PrimitiveType {
  12074. /**
  12075. * Points primitive where each vertex (or index) is a separate point.
  12076. */
  12077. POINTS = WebGLConstants.POINTS,
  12078. /**
  12079. * Lines primitive where each two vertices (or indices) is a line segment. Line segments are not necessarily connected.
  12080. */
  12081. LINES = WebGLConstants.LINES,
  12082. /**
  12083. * Line loop primitive where each vertex (or index) after the first connects a line to
  12084. * the previous vertex, and the last vertex implicitly connects to the first.
  12085. */
  12086. LINE_LOOP = WebGLConstants.LINE_LOOP,
  12087. /**
  12088. * Line strip primitive where each vertex (or index) after the first connects a line to the previous vertex.
  12089. */
  12090. LINE_STRIP = WebGLConstants.LINE_STRIP,
  12091. /**
  12092. * Triangles primitive where each three vertices (or indices) is a triangle. Triangles do not necessarily share edges.
  12093. */
  12094. TRIANGLES = WebGLConstants.TRIANGLES,
  12095. /**
  12096. * Triangle strip primitive where each vertex (or index) after the first two connect to
  12097. * the previous two vertices forming a triangle. For example, this can be used to model a wall.
  12098. */
  12099. TRIANGLE_STRIP = WebGLConstants.TRIANGLE_STRIP,
  12100. /**
  12101. * Triangle fan primitive where each vertex (or index) after the first two connect to
  12102. * the previous vertex and the first vertex forming a triangle. For example, this can be used
  12103. * to model a cone or circle.
  12104. */
  12105. TRIANGLE_FAN = WebGLConstants.TRIANGLE_FAN
  12106. }
  12107. /**
  12108. * Defines functions for 2nd order polynomial functions of one variable with only real coefficients.
  12109. */
  12110. export namespace QuadraticRealPolynomial {
  12111. /**
  12112. * Provides the discriminant of the quadratic equation from the supplied coefficients.
  12113. * @param a - The coefficient of the 2nd order monomial.
  12114. * @param b - The coefficient of the 1st order monomial.
  12115. * @param c - The coefficient of the 0th order monomial.
  12116. * @returns The value of the discriminant.
  12117. */
  12118. function computeDiscriminant(a: number, b: number, c: number): number;
  12119. /**
  12120. * Provides the real valued roots of the quadratic polynomial with the provided coefficients.
  12121. * @param a - The coefficient of the 2nd order monomial.
  12122. * @param b - The coefficient of the 1st order monomial.
  12123. * @param c - The coefficient of the 0th order monomial.
  12124. * @returns The real valued roots.
  12125. */
  12126. function computeRealRoots(a: number, b: number, c: number): number[];
  12127. }
  12128. /**
  12129. * Terrain data for a single tile where the terrain data is represented as a quantized mesh. A quantized
  12130. * mesh consists of three vertex attributes, longitude, latitude, and height. All attributes are expressed
  12131. * as 16-bit values in the range 0 to 32767. Longitude and latitude are zero at the southwest corner
  12132. * of the tile and 32767 at the northeast corner. Height is zero at the minimum height in the tile
  12133. * and 32767 at the maximum height in the tile.
  12134. * @example
  12135. * const data = new SuperMap.QuantizedMeshTerrainData({
  12136. * minimumHeight : -100,
  12137. * maximumHeight : 2101,
  12138. * quantizedVertices : new Uint16Array([// order is SW NW SE NE
  12139. * // longitude
  12140. * 0, 0, 32767, 32767,
  12141. * // latitude
  12142. * 0, 32767, 0, 32767,
  12143. * // heights
  12144. * 16384, 0, 32767, 16384]),
  12145. * indices : new Uint16Array([0, 3, 1,
  12146. * 0, 2, 3]),
  12147. * boundingSphere : new SuperMap.BoundingSphere(new SuperMap.Cartesian3(1.0, 2.0, 3.0), 10000),
  12148. * orientedBoundingBox : new SuperMap.OrientedBoundingBox(new SuperMap.Cartesian3(1.0, 2.0, 3.0), SuperMap.Matrix3.fromRotationX(SuperMap.Math.PI, new SuperMap.Matrix3())),
  12149. * horizonOcclusionPoint : new SuperMap.Cartesian3(3.0, 2.0, 1.0),
  12150. * westIndices : [0, 1],
  12151. * southIndices : [0, 1],
  12152. * eastIndices : [2, 3],
  12153. * northIndices : [1, 3],
  12154. * westSkirtHeight : 1.0,
  12155. * southSkirtHeight : 1.0,
  12156. * eastSkirtHeight : 1.0,
  12157. * northSkirtHeight : 1.0
  12158. * });
  12159. * @param options - Object with the following properties:
  12160. * @param options.quantizedVertices - The buffer containing the quantized mesh.
  12161. * @param options.indices - The indices specifying how the quantized vertices are linked
  12162. * together into triangles. Each three indices specifies one triangle.
  12163. * @param options.minimumHeight - The minimum terrain height within the tile, in meters above the ellipsoid.
  12164. * @param options.maximumHeight - The maximum terrain height within the tile, in meters above the ellipsoid.
  12165. * @param options.boundingSphere - A sphere bounding all of the vertices in the mesh.
  12166. * @param [options.orientedBoundingBox] - An OrientedBoundingBox bounding all of the vertices in the mesh.
  12167. * @param options.horizonOcclusionPoint - The horizon occlusion point of the mesh. If this point
  12168. * is below the horizon, the entire tile is assumed to be below the horizon as well.
  12169. * The point is expressed in ellipsoid-scaled coordinates.
  12170. * @param options.westIndices - The indices of the vertices on the western edge of the tile.
  12171. * @param options.southIndices - The indices of the vertices on the southern edge of the tile.
  12172. * @param options.eastIndices - The indices of the vertices on the eastern edge of the tile.
  12173. * @param options.northIndices - The indices of the vertices on the northern edge of the tile.
  12174. * @param options.westSkirtHeight - The height of the skirt to add on the western edge of the tile.
  12175. * @param options.southSkirtHeight - The height of the skirt to add on the southern edge of the tile.
  12176. * @param options.eastSkirtHeight - The height of the skirt to add on the eastern edge of the tile.
  12177. * @param options.northSkirtHeight - The height of the skirt to add on the northern edge of the tile.
  12178. * @param [options.childTileMask = 15] - A bit mask indicating which of this tile's four children exist.
  12179. * If a child's bit is set, geometry will be requested for that tile as well when it
  12180. * is needed. If the bit is cleared, the child tile is not requested and geometry is
  12181. * instead upsampled from the parent. The bit values are as follows:
  12182. * <table>
  12183. * <tr><th>Bit Position</th><th>Bit Value</th><th>Child Tile</th></tr>
  12184. * <tr><td>0</td><td>1</td><td>Southwest</td></tr>
  12185. * <tr><td>1</td><td>2</td><td>Southeast</td></tr>
  12186. * <tr><td>2</td><td>4</td><td>Northwest</td></tr>
  12187. * <tr><td>3</td><td>8</td><td>Northeast</td></tr>
  12188. * </table>
  12189. * @param [options.createdByUpsampling = false] - True if this instance was created by upsampling another instance;
  12190. * otherwise, false.
  12191. * @param [options.encodedNormals] - The buffer containing per vertex normals, encoded using 'oct' encoding
  12192. * @param [options.waterMask] - The buffer containing the watermask.
  12193. * @param [options.credits] - Array of credits for this tile.
  12194. */
  12195. export class QuantizedMeshTerrainData {
  12196. constructor(options: {
  12197. quantizedVertices: Uint16Array;
  12198. indices: Uint16Array | Uint32Array;
  12199. minimumHeight: number;
  12200. maximumHeight: number;
  12201. boundingSphere: BoundingSphere;
  12202. orientedBoundingBox?: OrientedBoundingBox;
  12203. horizonOcclusionPoint: Cartesian3;
  12204. westIndices: number[];
  12205. southIndices: number[];
  12206. eastIndices: number[];
  12207. northIndices: number[];
  12208. westSkirtHeight: number;
  12209. southSkirtHeight: number;
  12210. eastSkirtHeight: number;
  12211. northSkirtHeight: number;
  12212. childTileMask?: number;
  12213. createdByUpsampling?: boolean;
  12214. encodedNormals?: Uint8Array;
  12215. waterMask?: Uint8Array;
  12216. credits?: Credit[];
  12217. });
  12218. /**
  12219. * An array of credits for this tile.
  12220. */
  12221. credits: Credit[];
  12222. /**
  12223. * The water mask included in this terrain data, if any. A water mask is a rectangular
  12224. * Uint8Array or image where a value of 255 indicates water and a value of 0 indicates land.
  12225. * Values in between 0 and 255 are allowed as well to smoothly blend between land and water.
  12226. */
  12227. waterMask: Uint8Array | HTMLImageElement | HTMLCanvasElement;
  12228. /**
  12229. * Upsamples this terrain data for use by a descendant tile. The resulting instance will contain a subset of the
  12230. * vertices in this instance, interpolated if necessary.
  12231. * @param tilingScheme - The tiling scheme of this terrain data.
  12232. * @param thisX - The X coordinate of this tile in the tiling scheme.
  12233. * @param thisY - The Y coordinate of this tile in the tiling scheme.
  12234. * @param thisLevel - The level of this tile in the tiling scheme.
  12235. * @param descendantX - The X coordinate within the tiling scheme of the descendant tile for which we are upsampling.
  12236. * @param descendantY - The Y coordinate within the tiling scheme of the descendant tile for which we are upsampling.
  12237. * @param descendantLevel - The level within the tiling scheme of the descendant tile for which we are upsampling.
  12238. * @returns A promise for upsampled heightmap terrain data for the descendant tile,
  12239. * or undefined if too many asynchronous upsample operations are in progress and the request has been
  12240. * deferred.
  12241. */
  12242. upsample(tilingScheme: TilingScheme, thisX: number, thisY: number, thisLevel: number, descendantX: number, descendantY: number, descendantLevel: number): Promise<QuantizedMeshTerrainData> | undefined;
  12243. /**
  12244. * Computes the terrain height at a specified longitude and latitude.
  12245. * @param rectangle - The rectangle covered by this terrain data.
  12246. * @param longitude - The longitude in radians.
  12247. * @param latitude - The latitude in radians.
  12248. * @returns The terrain height at the specified position. The position is clamped to
  12249. * the rectangle, so expect incorrect results for positions far outside the rectangle.
  12250. */
  12251. interpolateHeight(rectangle: Rectangle, longitude: number, latitude: number): number;
  12252. /**
  12253. * Determines if a given child tile is available, based on the
  12254. * {@link HeightmapTerrainData.childTileMask}. The given child tile coordinates are assumed
  12255. * to be one of the four children of this tile. If non-child tile coordinates are
  12256. * given, the availability of the southeast child tile is returned.
  12257. * @param thisX - The tile X coordinate of this (the parent) tile.
  12258. * @param thisY - The tile Y coordinate of this (the parent) tile.
  12259. * @param childX - The tile X coordinate of the child tile to check for availability.
  12260. * @param childY - The tile Y coordinate of the child tile to check for availability.
  12261. * @returns True if the child tile is available; otherwise, false.
  12262. */
  12263. isChildAvailable(thisX: number, thisY: number, childX: number, childY: number): boolean;
  12264. /**
  12265. * Gets a value indicating whether or not this terrain data was created by upsampling lower resolution
  12266. * terrain data. If this value is false, the data was obtained from some other source, such
  12267. * as by downloading it from a remote server. This method should return true for instances
  12268. * returned from a call to {@link HeightmapTerrainData#upsample}.
  12269. * @returns True if this instance was created by upsampling; otherwise, false.
  12270. */
  12271. wasCreatedByUpsampling(): boolean;
  12272. }
  12273. /**
  12274. * Defines functions for 4th order polynomial functions of one variable with only real coefficients.
  12275. */
  12276. export namespace QuarticRealPolynomial {
  12277. /**
  12278. * Provides the discriminant of the quartic equation from the supplied coefficients.
  12279. * @param a - The coefficient of the 4th order monomial.
  12280. * @param b - The coefficient of the 3rd order monomial.
  12281. * @param c - The coefficient of the 2nd order monomial.
  12282. * @param d - The coefficient of the 1st order monomial.
  12283. * @param e - The coefficient of the 0th order monomial.
  12284. * @returns The value of the discriminant.
  12285. */
  12286. function computeDiscriminant(a: number, b: number, c: number, d: number, e: number): number;
  12287. /**
  12288. * Provides the real valued roots of the quartic polynomial with the provided coefficients.
  12289. * @param a - The coefficient of the 4th order monomial.
  12290. * @param b - The coefficient of the 3rd order monomial.
  12291. * @param c - The coefficient of the 2nd order monomial.
  12292. * @param d - The coefficient of the 1st order monomial.
  12293. * @param e - The coefficient of the 0th order monomial.
  12294. * @returns The real valued roots.
  12295. */
  12296. function computeRealRoots(a: number, b: number, c: number, d: number, e: number): number[];
  12297. }
  12298. /**
  12299. * A set of 4-dimensional coordinates used to represent rotation in 3-dimensional space.
  12300. * @param [x = 0.0] - The X component.
  12301. * @param [y = 0.0] - The Y component.
  12302. * @param [z = 0.0] - The Z component.
  12303. * @param [w = 0.0] - The W component.
  12304. */
  12305. export class Quaternion {
  12306. constructor(x?: number, y?: number, z?: number, w?: number);
  12307. /**
  12308. * The X component.
  12309. */
  12310. x: number;
  12311. /**
  12312. * The Y component.
  12313. */
  12314. y: number;
  12315. /**
  12316. * The Z component.
  12317. */
  12318. z: number;
  12319. /**
  12320. * The W component.
  12321. */
  12322. w: number;
  12323. /**
  12324. * Computes a quaternion representing a rotation around an axis.
  12325. * @param axis - The axis of rotation.
  12326. * @param angle - The angle in radians to rotate around the axis.
  12327. * @param [result] - The object onto which to store the result.
  12328. * @returns The modified result parameter or a new Quaternion instance if one was not provided.
  12329. */
  12330. fromAxisAngle(axis: Cartesian3, angle: number, result?: Quaternion): Quaternion;
  12331. /**
  12332. * Computes a Quaternion from the provided Matrix3 instance.
  12333. * @param matrix - The rotation matrix.
  12334. * @param [result] - The object onto which to store the result.
  12335. * @returns The modified result parameter or a new Quaternion instance if one was not provided.
  12336. */
  12337. fromRotationMatrix(matrix: Matrix3, result?: Quaternion): Quaternion;
  12338. /**
  12339. * Computes a rotation from the given heading, pitch and roll angles. Heading is the rotation about the
  12340. * negative z axis. Pitch is the rotation about the negative y axis. Roll is the rotation about
  12341. * the positive x axis.
  12342. * @param headingPitchRoll - The rotation expressed as a heading, pitch and roll.
  12343. * @param [result] - The object onto which to store the result.
  12344. * @returns The modified result parameter or a new Quaternion instance if none was provided.
  12345. */
  12346. fromHeadingPitchRoll(headingPitchRoll: HeadingPitchRoll, result?: Quaternion): Quaternion;
  12347. /**
  12348. * The number of elements used to pack the object into an array.
  12349. */
  12350. packedLength: number;
  12351. /**
  12352. * Stores the provided instance into the provided array.
  12353. * @param value - The value to pack.
  12354. * @param array - The array to pack into.
  12355. * @param [startingIndex = 0] - The index into the array at which to start packing the elements.
  12356. * @returns The array that was packed into
  12357. */
  12358. pack(value: Quaternion, array: number[], startingIndex?: number): number[];
  12359. /**
  12360. * Retrieves an instance from a packed array.
  12361. * @param array - The packed array.
  12362. * @param [startingIndex = 0] - The starting index of the element to be unpacked.
  12363. * @param [result] - The object into which to store the result.
  12364. * @returns The modified result parameter or a new Quaternion instance if one was not provided.
  12365. */
  12366. unpack(array: number[], startingIndex?: number, result?: Quaternion): Quaternion;
  12367. /**
  12368. * The number of elements used to store the object into an array in its interpolatable form.
  12369. */
  12370. packedInterpolationLength: number;
  12371. /**
  12372. * Converts a packed array into a form suitable for interpolation.
  12373. * @param packedArray - The packed array.
  12374. * @param [startingIndex = 0] - The index of the first element to be converted.
  12375. * @param [lastIndex = packedArray.length] - The index of the last element to be converted.
  12376. * @param [result] - The object into which to store the result.
  12377. */
  12378. convertPackedArrayForInterpolation(packedArray: number[], startingIndex?: number, lastIndex?: number, result?: number[]): void;
  12379. /**
  12380. * Retrieves an instance from a packed array converted with {@link convertPackedArrayForInterpolation}.
  12381. * @param array - The array previously packed for interpolation.
  12382. * @param sourceArray - The original packed array.
  12383. * @param [firstIndex = 0] - The firstIndex used to convert the array.
  12384. * @param [lastIndex = packedArray.length] - The lastIndex used to convert the array.
  12385. * @param [result] - The object into which to store the result.
  12386. * @returns The modified result parameter or a new Quaternion instance if one was not provided.
  12387. */
  12388. unpackInterpolationResult(array: number[], sourceArray: number[], firstIndex?: number, lastIndex?: number, result?: Quaternion): Quaternion;
  12389. /**
  12390. * Duplicates a Quaternion instance.
  12391. * @param quaternion - The quaternion to duplicate.
  12392. * @param [result] - The object onto which to store the result.
  12393. * @returns The modified result parameter or a new Quaternion instance if one was not provided. (Returns undefined if quaternion is undefined)
  12394. */
  12395. clone(quaternion: Quaternion, result?: Quaternion): Quaternion;
  12396. /**
  12397. * Computes the conjugate of the provided quaternion.
  12398. * @param quaternion - The quaternion to conjugate.
  12399. * @param result - The object onto which to store the result.
  12400. * @returns The modified result parameter.
  12401. */
  12402. conjugate(quaternion: Quaternion, result: Quaternion): Quaternion;
  12403. /**
  12404. * Computes magnitude squared for the provided quaternion.
  12405. * @param quaternion - The quaternion to conjugate.
  12406. * @returns The magnitude squared.
  12407. */
  12408. magnitudeSquared(quaternion: Quaternion): number;
  12409. /**
  12410. * Computes magnitude for the provided quaternion.
  12411. * @param quaternion - The quaternion to conjugate.
  12412. * @returns The magnitude.
  12413. */
  12414. magnitude(quaternion: Quaternion): number;
  12415. /**
  12416. * Computes the normalized form of the provided quaternion.
  12417. * @param quaternion - The quaternion to normalize.
  12418. * @param result - The object onto which to store the result.
  12419. * @returns The modified result parameter.
  12420. */
  12421. normalize(quaternion: Quaternion, result: Quaternion): Quaternion;
  12422. /**
  12423. * Computes the inverse of the provided quaternion.
  12424. * @param quaternion - The quaternion to normalize.
  12425. * @param result - The object onto which to store the result.
  12426. * @returns The modified result parameter.
  12427. */
  12428. inverse(quaternion: Quaternion, result: Quaternion): Quaternion;
  12429. /**
  12430. * Computes the componentwise sum of two quaternions.
  12431. * @param left - The first quaternion.
  12432. * @param right - The second quaternion.
  12433. * @param result - The object onto which to store the result.
  12434. * @returns The modified result parameter.
  12435. */
  12436. add(left: Quaternion, right: Quaternion, result: Quaternion): Quaternion;
  12437. /**
  12438. * Computes the componentwise difference of two quaternions.
  12439. * @param left - The first quaternion.
  12440. * @param right - The second quaternion.
  12441. * @param result - The object onto which to store the result.
  12442. * @returns The modified result parameter.
  12443. */
  12444. subtract(left: Quaternion, right: Quaternion, result: Quaternion): Quaternion;
  12445. /**
  12446. * Negates the provided quaternion.
  12447. * @param quaternion - The quaternion to be negated.
  12448. * @param result - The object onto which to store the result.
  12449. * @returns The modified result parameter.
  12450. */
  12451. negate(quaternion: Quaternion, result: Quaternion): Quaternion;
  12452. /**
  12453. * Computes the dot (scalar) product of two quaternions.
  12454. * @param left - The first quaternion.
  12455. * @param right - The second quaternion.
  12456. * @returns The dot product.
  12457. */
  12458. dot(left: Quaternion, right: Quaternion): number;
  12459. /**
  12460. * Computes the product of two quaternions.
  12461. * @param left - The first quaternion.
  12462. * @param right - The second quaternion.
  12463. * @param result - The object onto which to store the result.
  12464. * @returns The modified result parameter.
  12465. */
  12466. multiply(left: Quaternion, right: Quaternion, result: Quaternion): Quaternion;
  12467. /**
  12468. * Multiplies the provided quaternion componentwise by the provided scalar.
  12469. * @param quaternion - The quaternion to be scaled.
  12470. * @param scalar - The scalar to multiply with.
  12471. * @param result - The object onto which to store the result.
  12472. * @returns The modified result parameter.
  12473. */
  12474. multiplyByScalar(quaternion: Quaternion, scalar: number, result: Quaternion): Quaternion;
  12475. /**
  12476. * Divides the provided quaternion componentwise by the provided scalar.
  12477. * @param quaternion - The quaternion to be divided.
  12478. * @param scalar - The scalar to divide by.
  12479. * @param result - The object onto which to store the result.
  12480. * @returns The modified result parameter.
  12481. */
  12482. divideByScalar(quaternion: Quaternion, scalar: number, result: Quaternion): Quaternion;
  12483. /**
  12484. * Computes the axis of rotation of the provided quaternion.
  12485. * @param quaternion - The quaternion to use.
  12486. * @param result - The object onto which to store the result.
  12487. * @returns The modified result parameter.
  12488. */
  12489. computeAxis(quaternion: Quaternion, result: Cartesian3): Cartesian3;
  12490. /**
  12491. * Computes the angle of rotation of the provided quaternion.
  12492. * @param quaternion - The quaternion to use.
  12493. * @returns The angle of rotation.
  12494. */
  12495. computeAngle(quaternion: Quaternion): number;
  12496. /**
  12497. * Computes the linear interpolation or extrapolation at t using the provided quaternions.
  12498. * @param start - The value corresponding to t at 0.0.
  12499. * @param end - The value corresponding to t at 1.0.
  12500. * @param t - The point along t at which to interpolate.
  12501. * @param result - The object onto which to store the result.
  12502. * @returns The modified result parameter.
  12503. */
  12504. lerp(start: Quaternion, end: Quaternion, t: number, result: Quaternion): Quaternion;
  12505. /**
  12506. * Computes the spherical linear interpolation or extrapolation at t using the provided quaternions.
  12507. * @param start - The value corresponding to t at 0.0.
  12508. * @param end - The value corresponding to t at 1.0.
  12509. * @param t - The point along t at which to interpolate.
  12510. * @param result - The object onto which to store the result.
  12511. * @returns The modified result parameter.
  12512. */
  12513. slerp(start: Quaternion, end: Quaternion, t: number, result: Quaternion): Quaternion;
  12514. /**
  12515. * The logarithmic quaternion function.
  12516. * @param quaternion - The unit quaternion.
  12517. * @param result - The object onto which to store the result.
  12518. * @returns The modified result parameter.
  12519. */
  12520. log(quaternion: Quaternion, result: Cartesian3): Cartesian3;
  12521. /**
  12522. * The exponential quaternion function.
  12523. * @param cartesian - The cartesian.
  12524. * @param result - The object onto which to store the result.
  12525. * @returns The modified result parameter.
  12526. */
  12527. exp(cartesian: Cartesian3, result: Quaternion): Quaternion;
  12528. /**
  12529. * Computes an inner quadrangle point.
  12530. * <p>This will compute quaternions that ensure a squad curve is C<sup>1</sup>.</p>
  12531. * @param q0 - The first quaternion.
  12532. * @param q1 - The second quaternion.
  12533. * @param q2 - The third quaternion.
  12534. * @param result - The object onto which to store the result.
  12535. * @returns The modified result parameter.
  12536. */
  12537. computeInnerQuadrangle(q0: Quaternion, q1: Quaternion, q2: Quaternion, result: Quaternion): Quaternion;
  12538. /**
  12539. * Computes the spherical quadrangle interpolation between quaternions.
  12540. * @example
  12541. * // 1. compute the squad interpolation between two quaternions on a curve
  12542. * const s0 = SuperMap.Quaternion.computeInnerQuadrangle(quaternions[i - 1], quaternions[i], quaternions[i + 1], new SuperMap.Quaternion());
  12543. * const s1 = SuperMap.Quaternion.computeInnerQuadrangle(quaternions[i], quaternions[i + 1], quaternions[i + 2], new SuperMap.Quaternion());
  12544. * const q = SuperMap.Quaternion.squad(quaternions[i], quaternions[i + 1], s0, s1, t, new SuperMap.Quaternion());
  12545. *
  12546. * // 2. compute the squad interpolation as above but where the first quaternion is a end point.
  12547. * const s1 = SuperMap.Quaternion.computeInnerQuadrangle(quaternions[0], quaternions[1], quaternions[2], new SuperMap.Quaternion());
  12548. * const q = SuperMap.Quaternion.squad(quaternions[0], quaternions[1], quaternions[0], s1, t, new SuperMap.Quaternion());
  12549. * @param q0 - The first quaternion.
  12550. * @param q1 - The second quaternion.
  12551. * @param s0 - The first inner quadrangle.
  12552. * @param s1 - The second inner quadrangle.
  12553. * @param t - The time in [0,1] used to interpolate.
  12554. * @param result - The object onto which to store the result.
  12555. * @returns The modified result parameter.
  12556. */
  12557. squad(q0: Quaternion, q1: Quaternion, s0: Quaternion, s1: Quaternion, t: number, result: Quaternion): Quaternion;
  12558. /**
  12559. * Computes the spherical linear interpolation or extrapolation at t using the provided quaternions.
  12560. * This implementation is faster than {@link Quaternion#slerp}, but is only accurate up to 10<sup>-6</sup>.
  12561. * @param start - The value corresponding to t at 0.0.
  12562. * @param end - The value corresponding to t at 1.0.
  12563. * @param t - The point along t at which to interpolate.
  12564. * @param result - The object onto which to store the result.
  12565. * @returns The modified result parameter.
  12566. */
  12567. fastSlerp(start: Quaternion, end: Quaternion, t: number, result: Quaternion): Quaternion;
  12568. /**
  12569. * Computes the spherical quadrangle interpolation between quaternions.
  12570. * An implementation that is faster than {@link Quaternion#squad}, but less accurate.
  12571. * @param q0 - The first quaternion.
  12572. * @param q1 - The second quaternion.
  12573. * @param s0 - The first inner quadrangle.
  12574. * @param s1 - The second inner quadrangle.
  12575. * @param t - The time in [0,1] used to interpolate.
  12576. * @param result - The object onto which to store the result.
  12577. * @returns The modified result parameter or a new instance if none was provided.
  12578. */
  12579. fastSquad(q0: Quaternion, q1: Quaternion, s0: Quaternion, s1: Quaternion, t: number, result: Quaternion): Quaternion;
  12580. /**
  12581. * Compares the provided quaternions componentwise and returns
  12582. * <code>true</code> if they are equal, <code>false</code> otherwise.
  12583. * @param [left] - The first quaternion.
  12584. * @param [right] - The second quaternion.
  12585. * @returns <code>true</code> if left and right are equal, <code>false</code> otherwise.
  12586. */
  12587. equals(left?: Quaternion, right?: Quaternion): boolean;
  12588. /**
  12589. * Compares the provided quaternions componentwise and returns
  12590. * <code>true</code> if they are within the provided epsilon,
  12591. * <code>false</code> otherwise.
  12592. * @param [left] - The first quaternion.
  12593. * @param [right] - The second quaternion.
  12594. * @param [epsilon = 0] - The epsilon to use for equality testing.
  12595. * @returns <code>true</code> if left and right are within the provided epsilon, <code>false</code> otherwise.
  12596. */
  12597. equalsEpsilon(left?: Quaternion, right?: Quaternion, epsilon?: number): boolean;
  12598. /**
  12599. * An immutable Quaternion instance initialized to (0.0, 0.0, 0.0, 0.0).
  12600. */
  12601. readonly ZERO: Quaternion;
  12602. /**
  12603. * An immutable Quaternion instance initialized to (0.0, 0.0, 0.0, 1.0).
  12604. */
  12605. readonly IDENTITY: Quaternion;
  12606. /**
  12607. * Duplicates this Quaternion instance.
  12608. * @param [result] - The object onto which to store the result.
  12609. * @returns The modified result parameter or a new Quaternion instance if one was not provided.
  12610. */
  12611. clone(result?: Quaternion): Quaternion;
  12612. /**
  12613. * Compares this and the provided quaternion componentwise and returns
  12614. * <code>true</code> if they are equal, <code>false</code> otherwise.
  12615. * @param [right] - The right hand side quaternion.
  12616. * @returns <code>true</code> if left and right are equal, <code>false</code> otherwise.
  12617. */
  12618. equals(right?: Quaternion): boolean;
  12619. /**
  12620. * Compares this and the provided quaternion componentwise and returns
  12621. * <code>true</code> if they are within the provided epsilon,
  12622. * <code>false</code> otherwise.
  12623. * @param [right] - The right hand side quaternion.
  12624. * @param [epsilon = 0] - The epsilon to use for equality testing.
  12625. * @returns <code>true</code> if left and right are within the provided epsilon, <code>false</code> otherwise.
  12626. */
  12627. equalsEpsilon(right?: Quaternion, epsilon?: number): boolean;
  12628. /**
  12629. * Returns a string representing this quaternion in the format (x, y, z, w).
  12630. * @returns A string representing this Quaternion.
  12631. */
  12632. toString(): string;
  12633. }
  12634. /**
  12635. * A spline that uses spherical linear (slerp) interpolation to create a quaternion curve.
  12636. * The generated curve is in the class C<sup>1</sup>.
  12637. * @param options - Object with the following properties:
  12638. * @param options.times - An array of strictly increasing, unit-less, floating-point times at each point.
  12639. * The values are in no way connected to the clock time. They are the parameterization for the curve.
  12640. * @param options.points - The array of {@link Quaternion} control points.
  12641. */
  12642. export class QuaternionSpline {
  12643. constructor(options: {
  12644. times: number[];
  12645. points: Quaternion[];
  12646. });
  12647. /**
  12648. * An array of times for the control points.
  12649. */
  12650. readonly times: number[];
  12651. /**
  12652. * An array of {@link Quaternion} control points.
  12653. */
  12654. readonly points: Quaternion[];
  12655. /**
  12656. * Finds an index <code>i</code> in <code>times</code> such that the parameter
  12657. * <code>time</code> is in the interval <code>[times[i], times[i + 1]]</code>.
  12658. * @param time - The time.
  12659. * @returns The index for the element at the start of the interval.
  12660. */
  12661. findTimeInterval(time: number): number;
  12662. /**
  12663. * Wraps the given time to the period covered by the spline.
  12664. * @param time - The time.
  12665. * @returns The time, wrapped around to the updated animation.
  12666. */
  12667. wrapTime(time: number): number;
  12668. /**
  12669. * Clamps the given time to the period covered by the spline.
  12670. * @param time - The time.
  12671. * @returns The time, clamped to the animation period.
  12672. */
  12673. clampTime(time: number): number;
  12674. /**
  12675. * Evaluates the curve at a given time.
  12676. * @param time - The time at which to evaluate the curve.
  12677. * @param [result] - The object onto which to store the result.
  12678. * @returns The modified result parameter or a new instance of the point on the curve at the given time.
  12679. */
  12680. evaluate(time: number, result?: Quaternion): Quaternion;
  12681. }
  12682. /**
  12683. * A queue that can enqueue items at the end, and dequeue items from the front.
  12684. */
  12685. export class Queue {
  12686. constructor();
  12687. /**
  12688. * The length of the queue.
  12689. */
  12690. readonly length: number;
  12691. /**
  12692. * Enqueues the specified item.
  12693. * @param item - The item to enqueue.
  12694. */
  12695. enqueue(item: any): void;
  12696. /**
  12697. * Dequeues an item. Returns undefined if the queue is empty.
  12698. * @returns The the dequeued item.
  12699. */
  12700. dequeue(): any;
  12701. /**
  12702. * Returns the item at the front of the queue. Returns undefined if the queue is empty.
  12703. * @returns The item at the front of the queue.
  12704. */
  12705. peek(): any;
  12706. /**
  12707. * Check whether this queue contains the specified item.
  12708. * @param item - The item to search for.
  12709. */
  12710. contains(item: any): void;
  12711. /**
  12712. * Remove all items from the queue.
  12713. */
  12714. clear(): void;
  12715. /**
  12716. * Sort the items in the queue in-place.
  12717. * @param compareFunction - A function that defines the sort order.
  12718. */
  12719. sort(compareFunction: Queue.Comparator): void;
  12720. }
  12721. export namespace Queue {
  12722. /**
  12723. * A function used to compare two items while sorting a queue.
  12724. * @example
  12725. * function compareNumbers(a, b) {
  12726. * return a - b;
  12727. * }
  12728. * @param a - An item in the array.
  12729. * @param b - An item in the array.
  12730. */
  12731. type Comparator = (a: any, b: any) => number;
  12732. }
  12733. /**
  12734. * Represents a ray that extends infinitely from the provided origin in the provided direction.
  12735. * @param [origin = Cartesian3.ZERO] - The origin of the ray.
  12736. * @param [direction = Cartesian3.ZERO] - The direction of the ray.
  12737. */
  12738. export class Ray {
  12739. constructor(origin?: Cartesian3, direction?: Cartesian3);
  12740. /**
  12741. * The origin of the ray.
  12742. */
  12743. origin: Cartesian3;
  12744. /**
  12745. * The direction of the ray.
  12746. */
  12747. direction: Cartesian3;
  12748. /**
  12749. * Duplicates a Ray instance.
  12750. * @param ray - The ray to duplicate.
  12751. * @param [result] - The object onto which to store the result.
  12752. * @returns The modified result parameter or a new Ray instance if one was not provided. (Returns undefined if ray is undefined)
  12753. */
  12754. clone(ray: Ray, result?: Ray): Ray;
  12755. /**
  12756. * Computes the point along the ray given by r(t) = o + t*d,
  12757. * where o is the origin of the ray and d is the direction.
  12758. * @example
  12759. * //Get the first intersection point of a ray and an ellipsoid.
  12760. * const intersection = SuperMap.IntersectionTests.rayEllipsoid(ray, ellipsoid);
  12761. * const point = SuperMap.Ray.getPoint(ray, intersection.start);
  12762. * @param ray - The ray.
  12763. * @param t - A scalar value.
  12764. * @param [result] - The object in which the result will be stored.
  12765. * @returns The modified result parameter, or a new instance if none was provided.
  12766. */
  12767. getPoint(ray: Ray, t: number, result?: Cartesian3): Cartesian3;
  12768. }
  12769. /**
  12770. * A two dimensional region specified as longitude and latitude coordinates.
  12771. * @param [west = 0.0] - The westernmost longitude, in radians, in the range [-Pi, Pi].
  12772. * @param [south = 0.0] - The southernmost latitude, in radians, in the range [-Pi/2, Pi/2].
  12773. * @param [east = 0.0] - The easternmost longitude, in radians, in the range [-Pi, Pi].
  12774. * @param [north = 0.0] - The northernmost latitude, in radians, in the range [-Pi/2, Pi/2].
  12775. */
  12776. export class Rectangle {
  12777. constructor(west?: number, south?: number, east?: number, north?: number);
  12778. /**
  12779. * The westernmost longitude in radians in the range [-Pi, Pi].
  12780. */
  12781. west: number;
  12782. /**
  12783. * The southernmost latitude in radians in the range [-Pi/2, Pi/2].
  12784. */
  12785. south: number;
  12786. /**
  12787. * The easternmost longitude in radians in the range [-Pi, Pi].
  12788. */
  12789. east: number;
  12790. /**
  12791. * The northernmost latitude in radians in the range [-Pi/2, Pi/2].
  12792. */
  12793. north: number;
  12794. /**
  12795. * Gets the width of the rectangle in radians.
  12796. */
  12797. readonly width: number;
  12798. /**
  12799. * Gets the height of the rectangle in radians.
  12800. */
  12801. readonly height: number;
  12802. /**
  12803. * The number of elements used to pack the object into an array.
  12804. */
  12805. packedLength: number;
  12806. /**
  12807. * Stores the provided instance into the provided array.
  12808. * @param value - The value to pack.
  12809. * @param array - The array to pack into.
  12810. * @param [startingIndex = 0] - The index into the array at which to start packing the elements.
  12811. * @returns The array that was packed into
  12812. */
  12813. pack(value: Rectangle, array: number[], startingIndex?: number): number[];
  12814. /**
  12815. * Retrieves an instance from a packed array.
  12816. * @param array - The packed array.
  12817. * @param [startingIndex = 0] - The starting index of the element to be unpacked.
  12818. * @param [result] - The object into which to store the result.
  12819. * @returns The modified result parameter or a new Rectangle instance if one was not provided.
  12820. */
  12821. unpack(array: number[], startingIndex?: number, result?: Rectangle): Rectangle;
  12822. /**
  12823. * Computes the width of a rectangle in radians.
  12824. * @param rectangle - The rectangle to compute the width of.
  12825. * @returns The width.
  12826. */
  12827. computeWidth(rectangle: Rectangle): number;
  12828. /**
  12829. * Computes the height of a rectangle in radians.
  12830. * @param rectangle - The rectangle to compute the height of.
  12831. * @returns The height.
  12832. */
  12833. computeHeight(rectangle: Rectangle): number;
  12834. /**
  12835. * Creates a rectangle given the boundary longitude and latitude in degrees.
  12836. * @example
  12837. * const rectangle = SuperMap.Rectangle.fromDegrees(0.0, 20.0, 10.0, 30.0);
  12838. * @param [west = 0.0] - The westernmost longitude in degrees in the range [-180.0, 180.0].
  12839. * @param [south = 0.0] - The southernmost latitude in degrees in the range [-90.0, 90.0].
  12840. * @param [east = 0.0] - The easternmost longitude in degrees in the range [-180.0, 180.0].
  12841. * @param [north = 0.0] - The northernmost latitude in degrees in the range [-90.0, 90.0].
  12842. * @param [result] - The object onto which to store the result, or undefined if a new instance should be created.
  12843. * @returns The modified result parameter or a new Rectangle instance if none was provided.
  12844. */
  12845. fromDegrees(west?: number, south?: number, east?: number, north?: number, result?: Rectangle): Rectangle;
  12846. /**
  12847. * Creates a rectangle given the boundary longitude and latitude in radians.
  12848. * @example
  12849. * const rectangle = SuperMap.Rectangle.fromRadians(0.0, Math.PI/4, Math.PI/8, 3*Math.PI/4);
  12850. * @param [west = 0.0] - The westernmost longitude in radians in the range [-Math.PI, Math.PI].
  12851. * @param [south = 0.0] - The southernmost latitude in radians in the range [-Math.PI/2, Math.PI/2].
  12852. * @param [east = 0.0] - The easternmost longitude in radians in the range [-Math.PI, Math.PI].
  12853. * @param [north = 0.0] - The northernmost latitude in radians in the range [-Math.PI/2, Math.PI/2].
  12854. * @param [result] - The object onto which to store the result, or undefined if a new instance should be created.
  12855. * @returns The modified result parameter or a new Rectangle instance if none was provided.
  12856. */
  12857. fromRadians(west?: number, south?: number, east?: number, north?: number, result?: Rectangle): Rectangle;
  12858. /**
  12859. * Creates the smallest possible Rectangle that encloses all positions in the provided array.
  12860. * @param cartographics - The list of Cartographic instances.
  12861. * @param [result] - The object onto which to store the result, or undefined if a new instance should be created.
  12862. * @returns The modified result parameter or a new Rectangle instance if none was provided.
  12863. */
  12864. fromCartographicArray(cartographics: Cartographic[], result?: Rectangle): Rectangle;
  12865. /**
  12866. * Creates the smallest possible Rectangle that encloses all positions in the provided array.
  12867. * @param cartesians - The list of Cartesian instances.
  12868. * @param [ellipsoid = Ellipsoid.WGS84] - The ellipsoid the cartesians are on.
  12869. * @param [result] - The object onto which to store the result, or undefined if a new instance should be created.
  12870. * @returns The modified result parameter or a new Rectangle instance if none was provided.
  12871. */
  12872. fromCartesianArray(cartesians: Cartesian3[], ellipsoid?: Ellipsoid, result?: Rectangle): Rectangle;
  12873. /**
  12874. * Duplicates a Rectangle.
  12875. * @param rectangle - The rectangle to clone.
  12876. * @param [result] - The object onto which to store the result, or undefined if a new instance should be created.
  12877. * @returns The modified result parameter or a new Rectangle instance if none was provided. (Returns undefined if rectangle is undefined)
  12878. */
  12879. clone(rectangle: Rectangle, result?: Rectangle): Rectangle;
  12880. /**
  12881. * Compares the provided Rectangles componentwise and returns
  12882. * <code>true</code> if they pass an absolute or relative tolerance test,
  12883. * <code>false</code> otherwise.
  12884. * @param [left] - The first Rectangle.
  12885. * @param [right] - The second Rectangle.
  12886. * @param [absoluteEpsilon = 0] - The absolute epsilon tolerance to use for equality testing.
  12887. * @returns <code>true</code> if left and right are within the provided epsilon, <code>false</code> otherwise.
  12888. */
  12889. equalsEpsilon(left?: Rectangle, right?: Rectangle, absoluteEpsilon?: number): boolean;
  12890. /**
  12891. * Duplicates this Rectangle.
  12892. * @param [result] - The object onto which to store the result.
  12893. * @returns The modified result parameter or a new Rectangle instance if none was provided.
  12894. */
  12895. clone(result?: Rectangle): Rectangle;
  12896. /**
  12897. * Compares the provided Rectangle with this Rectangle componentwise and returns
  12898. * <code>true</code> if they are equal, <code>false</code> otherwise.
  12899. * @param [other] - The Rectangle to compare.
  12900. * @returns <code>true</code> if the Rectangles are equal, <code>false</code> otherwise.
  12901. */
  12902. equals(other?: Rectangle): boolean;
  12903. /**
  12904. * Compares the provided rectangles and returns <code>true</code> if they are equal,
  12905. * <code>false</code> otherwise.
  12906. * @param [left] - The first Rectangle.
  12907. * @param [right] - The second Rectangle.
  12908. * @returns <code>true</code> if left and right are equal; otherwise <code>false</code>.
  12909. */
  12910. equals(left?: Rectangle, right?: Rectangle): boolean;
  12911. /**
  12912. * Compares the provided Rectangle with this Rectangle componentwise and returns
  12913. * <code>true</code> if they are within the provided epsilon,
  12914. * <code>false</code> otherwise.
  12915. * @param [other] - The Rectangle to compare.
  12916. * @param [epsilon = 0] - The epsilon to use for equality testing.
  12917. * @returns <code>true</code> if the Rectangles are within the provided epsilon, <code>false</code> otherwise.
  12918. */
  12919. equalsEpsilon(other?: Rectangle, epsilon?: number): boolean;
  12920. /**
  12921. * Checks a Rectangle's properties and throws if they are not in valid ranges.
  12922. * @param rectangle - The rectangle to validate
  12923. */
  12924. validate(rectangle: Rectangle): void;
  12925. /**
  12926. * Computes the southwest corner of a rectangle.
  12927. * @param rectangle - The rectangle for which to find the corner
  12928. * @param [result] - The object onto which to store the result.
  12929. * @returns The modified result parameter or a new Cartographic instance if none was provided.
  12930. */
  12931. southwest(rectangle: Rectangle, result?: Cartographic): Cartographic;
  12932. /**
  12933. * Computes the northwest corner of a rectangle.
  12934. * @param rectangle - The rectangle for which to find the corner
  12935. * @param [result] - The object onto which to store the result.
  12936. * @returns The modified result parameter or a new Cartographic instance if none was provided.
  12937. */
  12938. northwest(rectangle: Rectangle, result?: Cartographic): Cartographic;
  12939. /**
  12940. * Computes the northeast corner of a rectangle.
  12941. * @param rectangle - The rectangle for which to find the corner
  12942. * @param [result] - The object onto which to store the result.
  12943. * @returns The modified result parameter or a new Cartographic instance if none was provided.
  12944. */
  12945. northeast(rectangle: Rectangle, result?: Cartographic): Cartographic;
  12946. /**
  12947. * Computes the southeast corner of a rectangle.
  12948. * @param rectangle - The rectangle for which to find the corner
  12949. * @param [result] - The object onto which to store the result.
  12950. * @returns The modified result parameter or a new Cartographic instance if none was provided.
  12951. */
  12952. southeast(rectangle: Rectangle, result?: Cartographic): Cartographic;
  12953. /**
  12954. * Computes the center of a rectangle.
  12955. * @param rectangle - The rectangle for which to find the center
  12956. * @param [result] - The object onto which to store the result.
  12957. * @returns The modified result parameter or a new Cartographic instance if none was provided.
  12958. */
  12959. center(rectangle: Rectangle, result?: Cartographic): Cartographic;
  12960. /**
  12961. * Computes the intersection of two rectangles. This function assumes that the rectangle's coordinates are
  12962. * latitude and longitude in radians and produces a correct intersection, taking into account the fact that
  12963. * the same angle can be represented with multiple values as well as the wrapping of longitude at the
  12964. * anti-meridian. For a simple intersection that ignores these factors and can be used with projected
  12965. * coordinates, see {@link Rectangle.simpleIntersection}.
  12966. * @param rectangle - On rectangle to find an intersection
  12967. * @param otherRectangle - Another rectangle to find an intersection
  12968. * @param [result] - The object onto which to store the result.
  12969. * @returns The modified result parameter, a new Rectangle instance if none was provided or undefined if there is no intersection.
  12970. */
  12971. intersection(rectangle: Rectangle, otherRectangle: Rectangle, result?: Rectangle): Rectangle | undefined;
  12972. /**
  12973. * Computes a simple intersection of two rectangles. Unlike {@link Rectangle.intersection}, this function
  12974. * does not attempt to put the angular coordinates into a consistent range or to account for crossing the
  12975. * anti-meridian. As such, it can be used for rectangles where the coordinates are not simply latitude
  12976. * and longitude (i.e. projected coordinates).
  12977. * @param rectangle - On rectangle to find an intersection
  12978. * @param otherRectangle - Another rectangle to find an intersection
  12979. * @param [result] - The object onto which to store the result.
  12980. * @returns The modified result parameter, a new Rectangle instance if none was provided or undefined if there is no intersection.
  12981. */
  12982. simpleIntersection(rectangle: Rectangle, otherRectangle: Rectangle, result?: Rectangle): Rectangle | undefined;
  12983. /**
  12984. * Computes a rectangle that is the union of two rectangles.
  12985. * @param rectangle - A rectangle to enclose in rectangle.
  12986. * @param otherRectangle - A rectangle to enclose in a rectangle.
  12987. * @param [result] - The object onto which to store the result.
  12988. * @returns The modified result parameter or a new Rectangle instance if none was provided.
  12989. */
  12990. union(rectangle: Rectangle, otherRectangle: Rectangle, result?: Rectangle): Rectangle;
  12991. /**
  12992. * Computes a rectangle by enlarging the provided rectangle until it contains the provided cartographic.
  12993. * @param rectangle - A rectangle to expand.
  12994. * @param cartographic - A cartographic to enclose in a rectangle.
  12995. * @param [result] - The object onto which to store the result.
  12996. * @returns The modified result parameter or a new Rectangle instance if one was not provided.
  12997. */
  12998. expand(rectangle: Rectangle, cartographic: Cartographic, result?: Rectangle): Rectangle;
  12999. /**
  13000. * Returns true if the cartographic is on or inside the rectangle, false otherwise.
  13001. * @param rectangle - The rectangle
  13002. * @param cartographic - The cartographic to test.
  13003. * @returns true if the provided cartographic is inside the rectangle, false otherwise.
  13004. */
  13005. contains(rectangle: Rectangle, cartographic: Cartographic): boolean;
  13006. /**
  13007. * Samples a rectangle so that it includes a list of Cartesian points suitable for passing to
  13008. * {@link BoundingSphere#fromPoints}. Sampling is necessary to account
  13009. * for rectangles that cover the poles or cross the equator.
  13010. * @param rectangle - The rectangle to subsample.
  13011. * @param [ellipsoid = Ellipsoid.WGS84] - The ellipsoid to use.
  13012. * @param [surfaceHeight = 0.0] - The height of the rectangle above the ellipsoid.
  13013. * @param [result] - The array of Cartesians onto which to store the result.
  13014. * @returns The modified result parameter or a new Array of Cartesians instances if none was provided.
  13015. */
  13016. subsample(rectangle: Rectangle, ellipsoid?: Ellipsoid, surfaceHeight?: number, result?: Cartesian3[]): Cartesian3[];
  13017. /**
  13018. * Computes a subsection of a rectangle from normalized coordinates in the range [0.0, 1.0].
  13019. * @param rectangle - The rectangle to subsection.
  13020. * @param westLerp - The west interpolation factor in the range [0.0, 1.0]. Must be less than or equal to eastLerp.
  13021. * @param southLerp - The south interpolation factor in the range [0.0, 1.0]. Must be less than or equal to northLerp.
  13022. * @param eastLerp - The east interpolation factor in the range [0.0, 1.0]. Must be greater than or equal to westLerp.
  13023. * @param northLerp - The north interpolation factor in the range [0.0, 1.0]. Must be greater than or equal to southLerp.
  13024. * @param [result] - The object onto which to store the result.
  13025. * @returns The modified result parameter or a new Rectangle instance if none was provided.
  13026. */
  13027. subsection(rectangle: Rectangle, westLerp: number, southLerp: number, eastLerp: number, northLerp: number, result?: Rectangle): Rectangle;
  13028. /**
  13029. * The largest possible rectangle.
  13030. */
  13031. readonly MAX_VALUE: Rectangle;
  13032. }
  13033. /**
  13034. * 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}.
  13035. * @example
  13036. * // 1. create a rectangle
  13037. * const rectangle = new SuperMap.RectangleGeometry({
  13038. * ellipsoid : SuperMap.Ellipsoid.WGS84,
  13039. * rectangle : SuperMap.Rectangle.fromDegrees(-80.0, 39.0, -74.0, 42.0),
  13040. * height : 10000.0
  13041. * });
  13042. * const geometry = SuperMap.RectangleGeometry.createGeometry(rectangle);
  13043. *
  13044. * // 2. create an extruded rectangle without a top
  13045. * const rectangle = new SuperMap.RectangleGeometry({
  13046. * ellipsoid : SuperMap.Ellipsoid.WGS84,
  13047. * rectangle : SuperMap.Rectangle.fromDegrees(-80.0, 39.0, -74.0, 42.0),
  13048. * height : 10000.0,
  13049. * extrudedHeight: 300000
  13050. * });
  13051. * const geometry = SuperMap.RectangleGeometry.createGeometry(rectangle);
  13052. * @param options - Object with the following properties:
  13053. * @param options.rectangle - A cartographic rectangle with north, south, east and west properties in radians.
  13054. * @param [options.vertexFormat = VertexFormat.DEFAULT] - The vertex attributes to be computed.
  13055. * @param [options.ellipsoid = Ellipsoid.WGS84] - The ellipsoid on which the rectangle lies.
  13056. * @param [options.granularity = Math.RADIANS_PER_DEGREE] - The distance, in radians, between each latitude and longitude. Determines the number of positions in the buffer.
  13057. * @param [options.height = 0.0] - The distance in meters between the rectangle and the ellipsoid surface.
  13058. * @param [options.rotation = 0.0] - The rotation of the rectangle, in radians. A positive rotation is counter-clockwise.
  13059. * @param [options.stRotation = 0.0] - The rotation of the texture coordinates, in radians. A positive rotation is counter-clockwise.
  13060. * @param [options.extrudedHeight] - The distance in meters between the rectangle's extruded face and the ellipsoid surface.
  13061. */
  13062. export class RectangleGeometry {
  13063. constructor(options: {
  13064. rectangle: Rectangle;
  13065. vertexFormat?: VertexFormat;
  13066. ellipsoid?: Ellipsoid;
  13067. granularity?: number;
  13068. height?: number;
  13069. rotation?: number;
  13070. stRotation?: number;
  13071. extrudedHeight?: number;
  13072. });
  13073. /**
  13074. * The number of elements used to pack the object into an array.
  13075. */
  13076. packedLength: number;
  13077. /**
  13078. * Stores the provided instance into the provided array.
  13079. * @param value - The value to pack.
  13080. * @param array - The array to pack into.
  13081. * @param [startingIndex = 0] - The index into the array at which to start packing the elements.
  13082. * @returns The array that was packed into
  13083. */
  13084. pack(value: RectangleGeometry, array: number[], startingIndex?: number): number[];
  13085. /**
  13086. * Retrieves an instance from a packed array.
  13087. * @param array - The packed array.
  13088. * @param [startingIndex = 0] - The starting index of the element to be unpacked.
  13089. * @param [result] - The object into which to store the result.
  13090. * @returns The modified result parameter or a new RectangleGeometry instance if one was not provided.
  13091. */
  13092. unpack(array: number[], startingIndex?: number, result?: RectangleGeometry): RectangleGeometry;
  13093. /**
  13094. * Computes the bounding rectangle based on the provided options
  13095. * @param options - Object with the following properties:
  13096. * @param options.rectangle - A cartographic rectangle with north, south, east and west properties in radians.
  13097. * @param [options.ellipsoid = Ellipsoid.WGS84] - The ellipsoid on which the rectangle lies.
  13098. * @param [options.granularity = Math.RADIANS_PER_DEGREE] - The distance, in radians, between each latitude and longitude. Determines the number of positions in the buffer.
  13099. * @param [options.rotation = 0.0] - The rotation of the rectangle, in radians. A positive rotation is counter-clockwise.
  13100. * @param [result] - An object in which to store the result.
  13101. * @returns The result rectangle
  13102. */
  13103. computeRectangle(options: {
  13104. rectangle: Rectangle;
  13105. ellipsoid?: Ellipsoid;
  13106. granularity?: number;
  13107. rotation?: number;
  13108. }, result?: Rectangle): Rectangle;
  13109. /**
  13110. * Computes the geometric representation of a rectangle, including its vertices, indices, and a bounding sphere.
  13111. * @param rectangleGeometry - A description of the rectangle.
  13112. * @returns The computed vertices and indices.
  13113. */
  13114. createGeometry(rectangleGeometry: RectangleGeometry): Geometry | undefined;
  13115. }
  13116. /**
  13117. * A description of the outline of a a cartographic rectangle on an ellipsoid centered at the origin.
  13118. * @example
  13119. * const rectangle = new SuperMap.RectangleOutlineGeometry({
  13120. * ellipsoid : SuperMap.Ellipsoid.WGS84,
  13121. * rectangle : SuperMap.Rectangle.fromDegrees(-80.0, 39.0, -74.0, 42.0),
  13122. * height : 10000.0
  13123. * });
  13124. * const geometry = SuperMap.RectangleOutlineGeometry.createGeometry(rectangle);
  13125. * @param options - Object with the following properties:
  13126. * @param options.rectangle - A cartographic rectangle with north, south, east and west properties in radians.
  13127. * @param [options.ellipsoid = Ellipsoid.WGS84] - The ellipsoid on which the rectangle lies.
  13128. * @param [options.granularity = Math.RADIANS_PER_DEGREE] - The distance, in radians, between each latitude and longitude. Determines the number of positions in the buffer.
  13129. * @param [options.height = 0.0] - The distance in meters between the rectangle and the ellipsoid surface.
  13130. * @param [options.rotation = 0.0] - The rotation of the rectangle, in radians. A positive rotation is counter-clockwise.
  13131. * @param [options.extrudedHeight] - The distance in meters between the rectangle's extruded face and the ellipsoid surface.
  13132. */
  13133. export class RectangleOutlineGeometry {
  13134. constructor(options: {
  13135. rectangle: Rectangle;
  13136. ellipsoid?: Ellipsoid;
  13137. granularity?: number;
  13138. height?: number;
  13139. rotation?: number;
  13140. extrudedHeight?: number;
  13141. });
  13142. /**
  13143. * The number of elements used to pack the object into an array.
  13144. */
  13145. packedLength: number;
  13146. /**
  13147. * Stores the provided instance into the provided array.
  13148. * @param value - The value to pack.
  13149. * @param array - The array to pack into.
  13150. * @param [startingIndex = 0] - The index into the array at which to start packing the elements.
  13151. * @returns The array that was packed into
  13152. */
  13153. pack(value: RectangleOutlineGeometry, array: number[], startingIndex?: number): number[];
  13154. /**
  13155. * Retrieves an instance from a packed array.
  13156. * @param array - The packed array.
  13157. * @param [startingIndex = 0] - The starting index of the element to be unpacked.
  13158. * @param [result] - The object into which to store the result.
  13159. * @returns The modified result parameter or a new Quaternion instance if one was not provided.
  13160. */
  13161. unpack(array: number[], startingIndex?: number, result?: RectangleOutlineGeometry): RectangleOutlineGeometry;
  13162. /**
  13163. * Computes the geometric representation of an outline of a rectangle, including its vertices, indices, and a bounding sphere.
  13164. * @param rectangleGeometry - A description of the rectangle outline.
  13165. * @returns The computed vertices and indices.
  13166. */
  13167. createGeometry(rectangleGeometry: RectangleOutlineGeometry): Geometry | undefined;
  13168. }
  13169. /**
  13170. * Constants for identifying well-known reference frames.
  13171. */
  13172. export enum ReferenceFrame {
  13173. /**
  13174. * The fixed frame.
  13175. */
  13176. FIXED = 0,
  13177. /**
  13178. * The inertial frame.
  13179. */
  13180. INERTIAL = 1
  13181. }
  13182. /**
  13183. * Stores information for making a request. In general this does not need to be constructed directly.
  13184. * @param [options] - An object with the following properties:
  13185. * @param [options.url] - The url to request.
  13186. * @param [options.requestFunction] - The function that makes the actual data request.
  13187. * @param [options.cancelFunction] - The function that is called when the request is cancelled.
  13188. * @param [options.priorityFunction] - The function that is called to update the request's priority, which occurs once per frame.
  13189. * @param [options.priority = 0.0] - The initial priority of the request.
  13190. * @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.
  13191. * @param [options.throttleByServer = false] - Whether to throttle the request by server.
  13192. * @param [options.type = RequestType.OTHER] - The type of request.
  13193. */
  13194. export class Request {
  13195. constructor(options?: {
  13196. url?: string;
  13197. requestFunction?: Request.RequestCallback;
  13198. cancelFunction?: Request.CancelCallback;
  13199. priorityFunction?: Request.PriorityCallback;
  13200. priority?: number;
  13201. throttle?: boolean;
  13202. throttleByServer?: boolean;
  13203. type?: RequestType;
  13204. });
  13205. /**
  13206. * The URL to request.
  13207. */
  13208. url: string;
  13209. /**
  13210. * The function that makes the actual data request.
  13211. */
  13212. requestFunction: Request.RequestCallback;
  13213. /**
  13214. * The function that is called when the request is cancelled.
  13215. */
  13216. cancelFunction: Request.CancelCallback;
  13217. /**
  13218. * The function that is called to update the request's priority, which occurs once per frame.
  13219. */
  13220. priorityFunction: Request.PriorityCallback;
  13221. /**
  13222. * Priority is a unit-less value where lower values represent higher priority.
  13223. * For world-based objects, this is usually the distance from the camera.
  13224. * A request that does not have a priority function defaults to a priority of 0.
  13225. *
  13226. * If priorityFunction is defined, this value is updated every frame with the result of that call.
  13227. */
  13228. priority: number;
  13229. /**
  13230. * Whether to throttle and prioritize the request. If false, the request will be sent immediately. If true, the
  13231. * request will be throttled and sent based on priority.
  13232. */
  13233. readonly throttle: boolean;
  13234. /**
  13235. * Whether to throttle the request by server. Browsers typically support about 6-8 parallel connections
  13236. * for HTTP/1 servers, and an unlimited amount of connections for HTTP/2 servers. Setting this value
  13237. * to <code>true</code> is preferable for requests going through HTTP/1 servers.
  13238. */
  13239. readonly throttleByServer: boolean;
  13240. /**
  13241. * Type of request.
  13242. */
  13243. readonly type: RequestType;
  13244. /**
  13245. * The current state of the request.
  13246. */
  13247. readonly state: RequestState;
  13248. /**
  13249. * Duplicates a Request instance.
  13250. * @param [result] - The object onto which to store the result.
  13251. * @returns The modified result parameter or a new Resource instance if one was not provided.
  13252. */
  13253. clone(result?: Request): Request;
  13254. }
  13255. export namespace Request {
  13256. /**
  13257. * The function that makes the actual data request.
  13258. */
  13259. type RequestCallback = () => Promise<void>;
  13260. /**
  13261. * The function that is called when the request is cancelled.
  13262. */
  13263. type CancelCallback = () => void;
  13264. /**
  13265. * The function that is called to update the request's priority, which occurs once per frame.
  13266. */
  13267. type PriorityCallback = () => number;
  13268. }
  13269. /**
  13270. * An event that is raised when a request encounters an error.
  13271. * @param [statusCode] - The HTTP error status code, such as 404.
  13272. * @param [response] - The response included along with the error.
  13273. * @param [responseHeaders] - The response headers, represented either as an object literal or as a
  13274. * string in the format returned by XMLHttpRequest's getAllResponseHeaders() function.
  13275. */
  13276. export class RequestErrorEvent {
  13277. constructor(statusCode?: number, response?: any, responseHeaders?: string | any);
  13278. /**
  13279. * The HTTP error status code, such as 404. If the error does not have a particular
  13280. * HTTP code, this property will be undefined.
  13281. */
  13282. statusCode: number;
  13283. /**
  13284. * The response included along with the error. If the error does not include a response,
  13285. * this property will be undefined.
  13286. */
  13287. response: any;
  13288. /**
  13289. * The headers included in the response, represented as an object literal of key/value pairs.
  13290. * If the error does not include any headers, this property will be undefined.
  13291. */
  13292. responseHeaders: any;
  13293. /**
  13294. * Creates a string representing this RequestErrorEvent.
  13295. * @returns A string representing the provided RequestErrorEvent.
  13296. */
  13297. toString(): string;
  13298. }
  13299. /**
  13300. * The request scheduler is used to track and constrain the number of active requests in order to prioritize incoming requests. The ability
  13301. * to retain control over the number of requests in CesiumJS is important because due to events such as changes in the camera position,
  13302. * a lot of new requests may be generated and a lot of in-flight requests may become redundant. The request scheduler manually constrains the
  13303. * 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.
  13304. */
  13305. export namespace RequestScheduler {
  13306. /**
  13307. * The maximum number of simultaneous active requests. Un-throttled requests do not observe this limit.
  13308. */
  13309. var maximumRequests: number;
  13310. /**
  13311. * The maximum number of simultaneous active requests per server. Un-throttled requests or servers specifically
  13312. * listed in {@link requestsByServer} do not observe this limit.
  13313. */
  13314. var maximumRequestsPerServer: number;
  13315. /**
  13316. * A per server key list of overrides to use for throttling instead of <code>maximumRequestsPerServer</code>
  13317. */
  13318. var requestsByServer: any;
  13319. /**
  13320. * Specifies if the request scheduler should throttle incoming requests, or let the browser queue requests under its control.
  13321. */
  13322. var throttleRequests: boolean;
  13323. }
  13324. /**
  13325. * State of the request.
  13326. */
  13327. export enum RequestState {
  13328. /**
  13329. * Initial unissued state.
  13330. */
  13331. UNISSUED = 0,
  13332. /**
  13333. * Issued but not yet active. Will become active when open slots are available.
  13334. */
  13335. ISSUED = 1,
  13336. /**
  13337. * Actual http request has been sent.
  13338. */
  13339. ACTIVE = 2,
  13340. /**
  13341. * Request completed successfully.
  13342. */
  13343. RECEIVED = 3,
  13344. /**
  13345. * Request was cancelled, either explicitly or automatically because of low priority.
  13346. */
  13347. CANCELLED = 4,
  13348. /**
  13349. * Request failed.
  13350. */
  13351. FAILED = 5
  13352. }
  13353. /**
  13354. * An enum identifying the type of request. Used for finer grained logging and priority sorting.
  13355. */
  13356. export enum RequestType {
  13357. /**
  13358. * Terrain request.
  13359. */
  13360. TERRAIN = 0,
  13361. /**
  13362. * Imagery request.
  13363. */
  13364. IMAGERY = 1,
  13365. /**
  13366. * 3D Tiles request.
  13367. */
  13368. TILES3D = 2,
  13369. /**
  13370. * Other request.
  13371. */
  13372. OTHER = 3
  13373. }
  13374. export namespace Resource {
  13375. /**
  13376. * Initialization options for the Resource constructor
  13377. * @property url - The url of the resource.
  13378. * @property [queryParameters] - An object containing query parameters that will be sent when retrieving the resource.
  13379. * @property [templateValues] - Key/Value pairs that are used to replace template values (eg. {x}).
  13380. * @property [headers = {}] - Additional HTTP headers that will be sent.
  13381. * @property [proxy] - A proxy to be used when loading the resource.
  13382. * @property [retryCallback] - The Function to call when a request for this resource fails. If it returns true, the request will be retried.
  13383. * @property [retryAttempts = 0] - The number of times the retryCallback should be called before giving up.
  13384. * @property [request] - A Request object that will be used. Intended for internal use only.
  13385. */
  13386. type ConstructorOptions = {
  13387. url: string;
  13388. queryParameters?: any;
  13389. templateValues?: any;
  13390. headers?: any;
  13391. proxy?: Proxy;
  13392. retryCallback?: Resource.RetryCallback;
  13393. retryAttempts?: number;
  13394. request?: Request;
  13395. };
  13396. /**
  13397. * A function that returns the value of the property.
  13398. * @param [resource] - The resource that failed to load.
  13399. * @param [error] - The error that occurred during the loading of the resource.
  13400. */
  13401. type RetryCallback = (resource?: Resource, error?: Error) => boolean | Promise<boolean>;
  13402. }
  13403. /**
  13404. * 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.
  13405. * @example
  13406. * function refreshTokenRetryCallback(resource, error) {
  13407. * if (error.statusCode === 403) {
  13408. * // 403 status code means a new token should be generated
  13409. * return getNewAccessToken()
  13410. * .then(function(token) {
  13411. * resource.queryParameters.access_token = token;
  13412. * return true;
  13413. * })
  13414. * .catch(function() {
  13415. * return false;
  13416. * });
  13417. * }
  13418. *
  13419. * return false;
  13420. * }
  13421. *
  13422. * const resource = new Resource({
  13423. * url: 'http://server.com/path/to/resource.json',
  13424. * proxy: new DefaultProxy('/proxy/'),
  13425. * headers: {
  13426. * 'X-My-Header': 'valueOfHeader'
  13427. * },
  13428. * queryParameters: {
  13429. * 'access_token': '123-435-456-000'
  13430. * },
  13431. * retryCallback: refreshTokenRetryCallback,
  13432. * retryAttempts: 1
  13433. * });
  13434. * @param options - A url or an object describing initialization options
  13435. */
  13436. export class Resource {
  13437. constructor(options: string | Resource.ConstructorOptions);
  13438. /**
  13439. * Additional HTTP headers that will be sent with the request.
  13440. */
  13441. headers: any;
  13442. /**
  13443. * A Request object that will be used. Intended for internal use only.
  13444. */
  13445. request: Request;
  13446. /**
  13447. * A proxy to be used when loading the resource.
  13448. */
  13449. proxy: Proxy;
  13450. /**
  13451. * 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.
  13452. */
  13453. retryCallback: (...params: any[]) => any;
  13454. /**
  13455. * The number of times the retryCallback should be called before giving up.
  13456. */
  13457. retryAttempts: number;
  13458. /**
  13459. * Returns true if blobs are supported.
  13460. */
  13461. readonly isBlobSupported: boolean;
  13462. /**
  13463. * Query parameters appended to the url.
  13464. */
  13465. readonly queryParameters: any;
  13466. /**
  13467. * The key/value pairs used to replace template parameters in the url.
  13468. */
  13469. readonly templateValues: any;
  13470. /**
  13471. * The url to the resource with template values replaced, query string appended and encoded by proxy if one was set.
  13472. */
  13473. url: string;
  13474. /**
  13475. * The file extension of the resource.
  13476. */
  13477. readonly extension: string;
  13478. /**
  13479. * True if the Resource refers to a data URI.
  13480. */
  13481. isDataUri: boolean;
  13482. /**
  13483. * True if the Resource refers to a blob URI.
  13484. */
  13485. isBlobUri: boolean;
  13486. /**
  13487. * True if the Resource refers to a cross origin URL.
  13488. */
  13489. isCrossOriginUrl: boolean;
  13490. /**
  13491. * True if the Resource has request headers. This is equivalent to checking if the headers property has any keys.
  13492. */
  13493. hasHeaders: boolean;
  13494. /**
  13495. * Override Object#toString so that implicit string conversion gives the
  13496. * complete URL represented by this Resource.
  13497. * @returns The URL represented by this Resource
  13498. */
  13499. toString(): string;
  13500. /**
  13501. * Returns the url, optional with the query string and processed by a proxy.
  13502. * @param [query = false] - If true, the query string is included.
  13503. * @param [proxy = false] - If true, the url is processed by the proxy object, if defined.
  13504. * @returns The url with all the requested components.
  13505. */
  13506. getUrlComponent(query?: boolean, proxy?: boolean): string;
  13507. /**
  13508. * Combines the specified object and the existing query parameters. This allows you to add many parameters at once,
  13509. * 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.
  13510. * @param params - The query parameters
  13511. * @param [useAsDefault = false] - If true the params will be used as the default values, so they will only be set if they are undefined.
  13512. */
  13513. setQueryParameters(params: any, useAsDefault?: boolean): void;
  13514. /**
  13515. * Combines the specified object and the existing query parameters. This allows you to add many parameters at once,
  13516. * as opposed to adding them one at a time to the queryParameters property.
  13517. * @param params - The query parameters
  13518. */
  13519. appendQueryParameters(params: any): void;
  13520. /**
  13521. * Combines the specified object and the existing template values. This allows you to add many values at once,
  13522. * 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.
  13523. * @param template - The template values
  13524. * @param [useAsDefault = false] - If true the values will be used as the default values, so they will only be set if they are undefined.
  13525. */
  13526. setTemplateValues(template: any, useAsDefault?: boolean): void;
  13527. /**
  13528. * Returns a resource relative to the current instance. All properties remain the same as the current instance unless overridden in options.
  13529. * @param options - An object with the following properties
  13530. * @param [options.url] - The url that will be resolved relative to the url of the current instance.
  13531. * @param [options.queryParameters] - An object containing query parameters that will be combined with those of the current instance.
  13532. * @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.
  13533. * @param [options.headers = {}] - Additional HTTP headers that will be sent.
  13534. * @param [options.proxy] - A proxy to be used when loading the resource.
  13535. * @param [options.retryCallback] - The function to call when loading the resource fails.
  13536. * @param [options.retryAttempts] - The number of times the retryCallback should be called before giving up.
  13537. * @param [options.request] - A Request object that will be used. Intended for internal use only.
  13538. * @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.
  13539. * @returns The resource derived from the current one.
  13540. */
  13541. getDerivedResource(options: {
  13542. url?: string;
  13543. queryParameters?: any;
  13544. templateValues?: any;
  13545. headers?: any;
  13546. proxy?: Proxy;
  13547. retryCallback?: Resource.RetryCallback;
  13548. retryAttempts?: number;
  13549. request?: Request;
  13550. preserveQueryParameters?: boolean;
  13551. }): Resource;
  13552. /**
  13553. * Duplicates a Resource instance.
  13554. * @param [result] - The object onto which to store the result.
  13555. * @returns The modified result parameter or a new Resource instance if one was not provided.
  13556. */
  13557. clone(result?: Resource): Resource;
  13558. /**
  13559. * Returns the base path of the Resource.
  13560. * @param [includeQuery = false] - Whether or not to include the query string and fragment form the uri
  13561. * @returns The base URI of the resource
  13562. */
  13563. getBaseUri(includeQuery?: boolean): string;
  13564. /**
  13565. * Appends a forward slash to the URL.
  13566. */
  13567. appendForwardSlash(): void;
  13568. /**
  13569. * Asynchronously loads the resource as raw binary data. Returns a promise that will resolve to
  13570. * an ArrayBuffer once loaded, or reject if the resource failed to load. The data is loaded
  13571. * using XMLHttpRequest, which means that in order to make requests to another origin,
  13572. * the server must have Cross-Origin Resource Sharing (CORS) headers enabled.
  13573. * @example
  13574. * // load a single URL asynchronously
  13575. * resource.fetchArrayBuffer().then(function(arrayBuffer) {
  13576. * // use the data
  13577. * }).catch(function(error) {
  13578. * // an error occurred
  13579. * });
  13580. * @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.
  13581. */
  13582. fetchArrayBuffer(): Promise<ArrayBuffer> | undefined;
  13583. /**
  13584. * Creates a Resource and calls fetchArrayBuffer() on it.
  13585. * @param options - A url or an object with the following properties
  13586. * @param options.url - The url of the resource.
  13587. * @param [options.queryParameters] - An object containing query parameters that will be sent when retrieving the resource.
  13588. * @param [options.templateValues] - Key/Value pairs that are used to replace template values (eg. {x}).
  13589. * @param [options.headers = {}] - Additional HTTP headers that will be sent.
  13590. * @param [options.proxy] - A proxy to be used when loading the resource.
  13591. * @param [options.retryCallback] - The Function to call when a request for this resource fails. If it returns true, the request will be retried.
  13592. * @param [options.retryAttempts = 0] - The number of times the retryCallback should be called before giving up.
  13593. * @param [options.request] - A Request object that will be used. Intended for internal use only.
  13594. * @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.
  13595. */
  13596. fetchArrayBuffer(options: {
  13597. url: string;
  13598. queryParameters?: any;
  13599. templateValues?: any;
  13600. headers?: any;
  13601. proxy?: Proxy;
  13602. retryCallback?: Resource.RetryCallback;
  13603. retryAttempts?: number;
  13604. request?: Request;
  13605. }): Promise<ArrayBuffer> | undefined;
  13606. /**
  13607. * Asynchronously loads the given resource as a blob. Returns a promise that will resolve to
  13608. * a Blob once loaded, or reject if the resource failed to load. The data is loaded
  13609. * using XMLHttpRequest, which means that in order to make requests to another origin,
  13610. * the server must have Cross-Origin Resource Sharing (CORS) headers enabled.
  13611. * @example
  13612. * // load a single URL asynchronously
  13613. * resource.fetchBlob().then(function(blob) {
  13614. * // use the data
  13615. * }).catch(function(error) {
  13616. * // an error occurred
  13617. * });
  13618. * @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.
  13619. */
  13620. fetchBlob(): Promise<Blob> | undefined;
  13621. /**
  13622. * Creates a Resource and calls fetchBlob() on it.
  13623. * @param options - A url or an object with the following properties
  13624. * @param options.url - The url of the resource.
  13625. * @param [options.queryParameters] - An object containing query parameters that will be sent when retrieving the resource.
  13626. * @param [options.templateValues] - Key/Value pairs that are used to replace template values (eg. {x}).
  13627. * @param [options.headers = {}] - Additional HTTP headers that will be sent.
  13628. * @param [options.proxy] - A proxy to be used when loading the resource.
  13629. * @param [options.retryCallback] - The Function to call when a request for this resource fails. If it returns true, the request will be retried.
  13630. * @param [options.retryAttempts = 0] - The number of times the retryCallback should be called before giving up.
  13631. * @param [options.request] - A Request object that will be used. Intended for internal use only.
  13632. * @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.
  13633. */
  13634. fetchBlob(options: {
  13635. url: string;
  13636. queryParameters?: any;
  13637. templateValues?: any;
  13638. headers?: any;
  13639. proxy?: Proxy;
  13640. retryCallback?: Resource.RetryCallback;
  13641. retryAttempts?: number;
  13642. request?: Request;
  13643. }): Promise<Blob> | undefined;
  13644. /**
  13645. * Asynchronously loads the given image resource. Returns a promise that will resolve to
  13646. * 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
  13647. * {@link https://developer.mozilla.org/en-US/docs/Web/API/HTMLImageElement|Image} once loaded, or reject if the image failed to load.
  13648. * @example
  13649. * // load a single image asynchronously
  13650. * resource.fetchImage().then(function(image) {
  13651. * // use the loaded image
  13652. * }).catch(function(error) {
  13653. * // an error occurred
  13654. * });
  13655. *
  13656. * // load several images in parallel
  13657. * Promise.all([resource1.fetchImage(), resource2.fetchImage()]).then(function(images) {
  13658. * // images is an array containing all the loaded images
  13659. * });
  13660. * @param [options] - An object with the following properties.
  13661. * @param [options.preferBlob = false] - If true, we will load the image via a blob.
  13662. * @param [options.preferImageBitmap = false] - If true, image will be decoded during fetch and an <code>ImageBitmap</code> is returned.
  13663. * @param [options.flipY = false] - If true, image will be vertically flipped during decode. Only applies if the browser supports <code>createImageBitmap</code>.
  13664. * @param [options.skipColorSpaceConversion = false] - If true, any custom gamma or color profiles in the image will be ignored. Only applies if the browser supports <code>createImageBitmap</code>.
  13665. * @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.
  13666. */
  13667. fetchImage(options?: {
  13668. preferBlob?: boolean;
  13669. preferImageBitmap?: boolean;
  13670. flipY?: boolean;
  13671. skipColorSpaceConversion?: boolean;
  13672. }): Promise<ImageBitmap | HTMLImageElement> | undefined;
  13673. /**
  13674. * Creates a Resource and calls fetchImage() on it.
  13675. * @param options - A url or an object with the following properties
  13676. * @param options.url - The url of the resource.
  13677. * @param [options.queryParameters] - An object containing query parameters that will be sent when retrieving the resource.
  13678. * @param [options.templateValues] - Key/Value pairs that are used to replace template values (eg. {x}).
  13679. * @param [options.headers = {}] - Additional HTTP headers that will be sent.
  13680. * @param [options.proxy] - A proxy to be used when loading the resource.
  13681. * @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>.
  13682. * @param [options.retryCallback] - The Function to call when a request for this resource fails. If it returns true, the request will be retried.
  13683. * @param [options.retryAttempts = 0] - The number of times the retryCallback should be called before giving up.
  13684. * @param [options.request] - A Request object that will be used. Intended for internal use only.
  13685. * @param [options.preferBlob = false] - If true, we will load the image via a blob.
  13686. * @param [options.preferImageBitmap = false] - If true, image will be decoded during fetch and an <code>ImageBitmap</code> is returned.
  13687. * @param [options.skipColorSpaceConversion = false] - If true, any custom gamma or color profiles in the image will be ignored. Only applies when requesting an image and the browser supports <code>createImageBitmap</code>.
  13688. * @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.
  13689. */
  13690. fetchImage(options: {
  13691. url: string;
  13692. queryParameters?: any;
  13693. templateValues?: any;
  13694. headers?: any;
  13695. proxy?: Proxy;
  13696. flipY?: boolean;
  13697. retryCallback?: Resource.RetryCallback;
  13698. retryAttempts?: number;
  13699. request?: Request;
  13700. preferBlob?: boolean;
  13701. preferImageBitmap?: boolean;
  13702. skipColorSpaceConversion?: boolean;
  13703. }): Promise<ImageBitmap | HTMLImageElement> | undefined;
  13704. /**
  13705. * Asynchronously loads the given resource as text. Returns a promise that will resolve to
  13706. * a String once loaded, or reject if the resource failed to load. The data is loaded
  13707. * using XMLHttpRequest, which means that in order to make requests to another origin,
  13708. * the server must have Cross-Origin Resource Sharing (CORS) headers enabled.
  13709. * @example
  13710. * // load text from a URL, setting a custom header
  13711. * const resource = new Resource({
  13712. * url: 'http://someUrl.com/someJson.txt',
  13713. * headers: {
  13714. * 'X-Custom-Header' : 'some value'
  13715. * }
  13716. * });
  13717. * resource.fetchText().then(function(text) {
  13718. * // Do something with the text
  13719. * }).catch(function(error) {
  13720. * // an error occurred
  13721. * });
  13722. * @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.
  13723. */
  13724. fetchText(): Promise<string> | undefined;
  13725. /**
  13726. * Creates a Resource and calls fetchText() on it.
  13727. * @param options - A url or an object with the following properties
  13728. * @param options.url - The url of the resource.
  13729. * @param [options.queryParameters] - An object containing query parameters that will be sent when retrieving the resource.
  13730. * @param [options.templateValues] - Key/Value pairs that are used to replace template values (eg. {x}).
  13731. * @param [options.headers = {}] - Additional HTTP headers that will be sent.
  13732. * @param [options.proxy] - A proxy to be used when loading the resource.
  13733. * @param [options.retryCallback] - The Function to call when a request for this resource fails. If it returns true, the request will be retried.
  13734. * @param [options.retryAttempts = 0] - The number of times the retryCallback should be called before giving up.
  13735. * @param [options.request] - A Request object that will be used. Intended for internal use only.
  13736. * @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.
  13737. */
  13738. fetchText(options: {
  13739. url: string;
  13740. queryParameters?: any;
  13741. templateValues?: any;
  13742. headers?: any;
  13743. proxy?: Proxy;
  13744. retryCallback?: Resource.RetryCallback;
  13745. retryAttempts?: number;
  13746. request?: Request;
  13747. }): Promise<string> | undefined;
  13748. /**
  13749. * Asynchronously loads the given resource as JSON. Returns a promise that will resolve to
  13750. * a JSON object once loaded, or reject if the resource failed to load. The data is loaded
  13751. * using XMLHttpRequest, which means that in order to make requests to another origin,
  13752. * the server must have Cross-Origin Resource Sharing (CORS) headers enabled. This function
  13753. * adds 'Accept: application/json,&#42;&#47;&#42;;q=0.01' to the request headers, if not
  13754. * already specified.
  13755. * @example
  13756. * resource.fetchJson().then(function(jsonData) {
  13757. * // Do something with the JSON object
  13758. * }).catch(function(error) {
  13759. * // an error occurred
  13760. * });
  13761. * @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.
  13762. */
  13763. fetchJson(): Promise<any> | undefined;
  13764. /**
  13765. * Creates a Resource and calls fetchJson() on it.
  13766. * @param options - A url or an object with the following properties
  13767. * @param options.url - The url of the resource.
  13768. * @param [options.queryParameters] - An object containing query parameters that will be sent when retrieving the resource.
  13769. * @param [options.templateValues] - Key/Value pairs that are used to replace template values (eg. {x}).
  13770. * @param [options.headers = {}] - Additional HTTP headers that will be sent.
  13771. * @param [options.proxy] - A proxy to be used when loading the resource.
  13772. * @param [options.retryCallback] - The Function to call when a request for this resource fails. If it returns true, the request will be retried.
  13773. * @param [options.retryAttempts = 0] - The number of times the retryCallback should be called before giving up.
  13774. * @param [options.request] - A Request object that will be used. Intended for internal use only.
  13775. * @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.
  13776. */
  13777. fetchJson(options: {
  13778. url: string;
  13779. queryParameters?: any;
  13780. templateValues?: any;
  13781. headers?: any;
  13782. proxy?: Proxy;
  13783. retryCallback?: Resource.RetryCallback;
  13784. retryAttempts?: number;
  13785. request?: Request;
  13786. }): Promise<any> | undefined;
  13787. /**
  13788. * Asynchronously loads the given resource as XML. Returns a promise that will resolve to
  13789. * an XML Document once loaded, or reject if the resource failed to load. The data is loaded
  13790. * using XMLHttpRequest, which means that in order to make requests to another origin,
  13791. * the server must have Cross-Origin Resource Sharing (CORS) headers enabled.
  13792. * @example
  13793. * // load XML from a URL, setting a custom header
  13794. * SuperMap.loadXML('http://someUrl.com/someXML.xml', {
  13795. * 'X-Custom-Header' : 'some value'
  13796. * }).then(function(document) {
  13797. * // Do something with the document
  13798. * }).catch(function(error) {
  13799. * // an error occurred
  13800. * });
  13801. * @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.
  13802. */
  13803. fetchXML(): Promise<XMLDocument> | undefined;
  13804. /**
  13805. * Creates a Resource and calls fetchXML() on it.
  13806. * @param options - A url or an object with the following properties
  13807. * @param options.url - The url of the resource.
  13808. * @param [options.queryParameters] - An object containing query parameters that will be sent when retrieving the resource.
  13809. * @param [options.templateValues] - Key/Value pairs that are used to replace template values (eg. {x}).
  13810. * @param [options.headers = {}] - Additional HTTP headers that will be sent.
  13811. * @param [options.proxy] - A proxy to be used when loading the resource.
  13812. * @param [options.retryCallback] - The Function to call when a request for this resource fails. If it returns true, the request will be retried.
  13813. * @param [options.retryAttempts = 0] - The number of times the retryCallback should be called before giving up.
  13814. * @param [options.request] - A Request object that will be used. Intended for internal use only.
  13815. * @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.
  13816. */
  13817. fetchXML(options: {
  13818. url: string;
  13819. queryParameters?: any;
  13820. templateValues?: any;
  13821. headers?: any;
  13822. proxy?: Proxy;
  13823. retryCallback?: Resource.RetryCallback;
  13824. retryAttempts?: number;
  13825. request?: Request;
  13826. }): Promise<XMLDocument> | undefined;
  13827. /**
  13828. * Requests a resource using JSONP.
  13829. * @example
  13830. * // load a data asynchronously
  13831. * resource.fetchJsonp().then(function(data) {
  13832. * // use the loaded data
  13833. * }).catch(function(error) {
  13834. * // an error occurred
  13835. * });
  13836. * @param [callbackParameterName = 'callback'] - The callback parameter name that the server expects.
  13837. * @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.
  13838. */
  13839. fetchJsonp(callbackParameterName?: string): Promise<any> | undefined;
  13840. /**
  13841. * Creates a Resource from a URL and calls fetchJsonp() on it.
  13842. * @param options - A url or an object with the following properties
  13843. * @param options.url - The url of the resource.
  13844. * @param [options.queryParameters] - An object containing query parameters that will be sent when retrieving the resource.
  13845. * @param [options.templateValues] - Key/Value pairs that are used to replace template values (eg. {x}).
  13846. * @param [options.headers = {}] - Additional HTTP headers that will be sent.
  13847. * @param [options.proxy] - A proxy to be used when loading the resource.
  13848. * @param [options.retryCallback] - The Function to call when a request for this resource fails. If it returns true, the request will be retried.
  13849. * @param [options.retryAttempts = 0] - The number of times the retryCallback should be called before giving up.
  13850. * @param [options.request] - A Request object that will be used. Intended for internal use only.
  13851. * @param [options.callbackParameterName = 'callback'] - The callback parameter name that the server expects.
  13852. * @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.
  13853. */
  13854. fetchJsonp(options: {
  13855. url: string;
  13856. queryParameters?: any;
  13857. templateValues?: any;
  13858. headers?: any;
  13859. proxy?: Proxy;
  13860. retryCallback?: Resource.RetryCallback;
  13861. retryAttempts?: number;
  13862. request?: Request;
  13863. callbackParameterName?: string;
  13864. }): Promise<any> | undefined;
  13865. /**
  13866. * Asynchronously loads the given resource. Returns a promise that will resolve to
  13867. * the result once loaded, or reject if the resource failed to load. The data is loaded
  13868. * using XMLHttpRequest, which means that in order to make requests to another origin,
  13869. * the server must have Cross-Origin Resource Sharing (CORS) headers enabled. It's recommended that you use
  13870. * the more specific functions eg. fetchJson, fetchBlob, etc.
  13871. * @example
  13872. * resource.fetch()
  13873. * .then(function(body) {
  13874. * // use the data
  13875. * }).catch(function(error) {
  13876. * // an error occurred
  13877. * });
  13878. * @param [options] - Object with the following properties:
  13879. * @param [options.responseType] - The type of response. This controls the type of item returned.
  13880. * @param [options.headers] - Additional HTTP headers to send with the request, if any.
  13881. * @param [options.overrideMimeType] - Overrides the MIME type returned by the server.
  13882. * @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.
  13883. */
  13884. fetch(options?: {
  13885. responseType?: string;
  13886. headers?: any;
  13887. overrideMimeType?: string;
  13888. }): Promise<any> | undefined;
  13889. /**
  13890. * Creates a Resource from a URL and calls fetch() on it.
  13891. * @param options - A url or an object with the following properties
  13892. * @param options.url - The url of the resource.
  13893. * @param [options.queryParameters] - An object containing query parameters that will be sent when retrieving the resource.
  13894. * @param [options.templateValues] - Key/Value pairs that are used to replace template values (eg. {x}).
  13895. * @param [options.headers = {}] - Additional HTTP headers that will be sent.
  13896. * @param [options.proxy] - A proxy to be used when loading the resource.
  13897. * @param [options.retryCallback] - The Function to call when a request for this resource fails. If it returns true, the request will be retried.
  13898. * @param [options.retryAttempts = 0] - The number of times the retryCallback should be called before giving up.
  13899. * @param [options.request] - A Request object that will be used. Intended for internal use only.
  13900. * @param [options.responseType] - The type of response. This controls the type of item returned.
  13901. * @param [options.overrideMimeType] - Overrides the MIME type returned by the server.
  13902. * @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.
  13903. */
  13904. fetch(options: {
  13905. url: string;
  13906. queryParameters?: any;
  13907. templateValues?: any;
  13908. headers?: any;
  13909. proxy?: Proxy;
  13910. retryCallback?: Resource.RetryCallback;
  13911. retryAttempts?: number;
  13912. request?: Request;
  13913. responseType?: string;
  13914. overrideMimeType?: string;
  13915. }): Promise<any> | undefined;
  13916. /**
  13917. * Asynchronously deletes the given resource. Returns a promise that will resolve to
  13918. * the result once loaded, or reject if the resource failed to load. The data is loaded
  13919. * using XMLHttpRequest, which means that in order to make requests to another origin,
  13920. * the server must have Cross-Origin Resource Sharing (CORS) headers enabled.
  13921. * @example
  13922. * resource.delete()
  13923. * .then(function(body) {
  13924. * // use the data
  13925. * }).catch(function(error) {
  13926. * // an error occurred
  13927. * });
  13928. * @param [options] - Object with the following properties:
  13929. * @param [options.responseType] - The type of response. This controls the type of item returned.
  13930. * @param [options.headers] - Additional HTTP headers to send with the request, if any.
  13931. * @param [options.overrideMimeType] - Overrides the MIME type returned by the server.
  13932. * @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.
  13933. */
  13934. delete(options?: {
  13935. responseType?: string;
  13936. headers?: any;
  13937. overrideMimeType?: string;
  13938. }): Promise<any> | undefined;
  13939. /**
  13940. * Creates a Resource from a URL and calls delete() on it.
  13941. * @param options - A url or an object with the following properties
  13942. * @param options.url - The url of the resource.
  13943. * @param [options.data] - Data that is posted with the resource.
  13944. * @param [options.queryParameters] - An object containing query parameters that will be sent when retrieving the resource.
  13945. * @param [options.templateValues] - Key/Value pairs that are used to replace template values (eg. {x}).
  13946. * @param [options.headers = {}] - Additional HTTP headers that will be sent.
  13947. * @param [options.proxy] - A proxy to be used when loading the resource.
  13948. * @param [options.retryCallback] - The Function to call when a request for this resource fails. If it returns true, the request will be retried.
  13949. * @param [options.retryAttempts = 0] - The number of times the retryCallback should be called before giving up.
  13950. * @param [options.request] - A Request object that will be used. Intended for internal use only.
  13951. * @param [options.responseType] - The type of response. This controls the type of item returned.
  13952. * @param [options.overrideMimeType] - Overrides the MIME type returned by the server.
  13953. * @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.
  13954. */
  13955. delete(options: {
  13956. url: string;
  13957. data?: any;
  13958. queryParameters?: any;
  13959. templateValues?: any;
  13960. headers?: any;
  13961. proxy?: Proxy;
  13962. retryCallback?: Resource.RetryCallback;
  13963. retryAttempts?: number;
  13964. request?: Request;
  13965. responseType?: string;
  13966. overrideMimeType?: string;
  13967. }): Promise<any> | undefined;
  13968. /**
  13969. * Asynchronously gets headers the given resource. Returns a promise that will resolve to
  13970. * the result once loaded, or reject if the resource failed to load. The data is loaded
  13971. * using XMLHttpRequest, which means that in order to make requests to another origin,
  13972. * the server must have Cross-Origin Resource Sharing (CORS) headers enabled.
  13973. * @example
  13974. * resource.head()
  13975. * .then(function(headers) {
  13976. * // use the data
  13977. * }).catch(function(error) {
  13978. * // an error occurred
  13979. * });
  13980. * @param [options] - Object with the following properties:
  13981. * @param [options.responseType] - The type of response. This controls the type of item returned.
  13982. * @param [options.headers] - Additional HTTP headers to send with the request, if any.
  13983. * @param [options.overrideMimeType] - Overrides the MIME type returned by the server.
  13984. * @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.
  13985. */
  13986. head(options?: {
  13987. responseType?: string;
  13988. headers?: any;
  13989. overrideMimeType?: string;
  13990. }): Promise<any> | undefined;
  13991. /**
  13992. * Creates a Resource from a URL and calls head() on it.
  13993. * @param options - A url or an object with the following properties
  13994. * @param options.url - The url of the resource.
  13995. * @param [options.queryParameters] - An object containing query parameters that will be sent when retrieving the resource.
  13996. * @param [options.templateValues] - Key/Value pairs that are used to replace template values (eg. {x}).
  13997. * @param [options.headers = {}] - Additional HTTP headers that will be sent.
  13998. * @param [options.proxy] - A proxy to be used when loading the resource.
  13999. * @param [options.retryCallback] - The Function to call when a request for this resource fails. If it returns true, the request will be retried.
  14000. * @param [options.retryAttempts = 0] - The number of times the retryCallback should be called before giving up.
  14001. * @param [options.request] - A Request object that will be used. Intended for internal use only.
  14002. * @param [options.responseType] - The type of response. This controls the type of item returned.
  14003. * @param [options.overrideMimeType] - Overrides the MIME type returned by the server.
  14004. * @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.
  14005. */
  14006. head(options: {
  14007. url: string;
  14008. queryParameters?: any;
  14009. templateValues?: any;
  14010. headers?: any;
  14011. proxy?: Proxy;
  14012. retryCallback?: Resource.RetryCallback;
  14013. retryAttempts?: number;
  14014. request?: Request;
  14015. responseType?: string;
  14016. overrideMimeType?: string;
  14017. }): Promise<any> | undefined;
  14018. /**
  14019. * Asynchronously gets options the given resource. Returns a promise that will resolve to
  14020. * the result once loaded, or reject if the resource failed to load. The data is loaded
  14021. * using XMLHttpRequest, which means that in order to make requests to another origin,
  14022. * the server must have Cross-Origin Resource Sharing (CORS) headers enabled.
  14023. * @example
  14024. * resource.options()
  14025. * .then(function(headers) {
  14026. * // use the data
  14027. * }).catch(function(error) {
  14028. * // an error occurred
  14029. * });
  14030. * @param [options] - Object with the following properties:
  14031. * @param [options.responseType] - The type of response. This controls the type of item returned.
  14032. * @param [options.headers] - Additional HTTP headers to send with the request, if any.
  14033. * @param [options.overrideMimeType] - Overrides the MIME type returned by the server.
  14034. * @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.
  14035. */
  14036. options(options?: {
  14037. responseType?: string;
  14038. headers?: any;
  14039. overrideMimeType?: string;
  14040. }): Promise<any> | undefined;
  14041. /**
  14042. * Creates a Resource from a URL and calls options() on it.
  14043. * @param options - A url or an object with the following properties
  14044. * @param options.url - The url of the resource.
  14045. * @param [options.queryParameters] - An object containing query parameters that will be sent when retrieving the resource.
  14046. * @param [options.templateValues] - Key/Value pairs that are used to replace template values (eg. {x}).
  14047. * @param [options.headers = {}] - Additional HTTP headers that will be sent.
  14048. * @param [options.proxy] - A proxy to be used when loading the resource.
  14049. * @param [options.retryCallback] - The Function to call when a request for this resource fails. If it returns true, the request will be retried.
  14050. * @param [options.retryAttempts = 0] - The number of times the retryCallback should be called before giving up.
  14051. * @param [options.request] - A Request object that will be used. Intended for internal use only.
  14052. * @param [options.responseType] - The type of response. This controls the type of item returned.
  14053. * @param [options.overrideMimeType] - Overrides the MIME type returned by the server.
  14054. * @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.
  14055. */
  14056. options(options: {
  14057. url: string;
  14058. queryParameters?: any;
  14059. templateValues?: any;
  14060. headers?: any;
  14061. proxy?: Proxy;
  14062. retryCallback?: Resource.RetryCallback;
  14063. retryAttempts?: number;
  14064. request?: Request;
  14065. responseType?: string;
  14066. overrideMimeType?: string;
  14067. }): Promise<any> | undefined;
  14068. /**
  14069. * Asynchronously posts data to the given resource. Returns a promise that will resolve to
  14070. * the result once loaded, or reject if the resource failed to load. The data is loaded
  14071. * using XMLHttpRequest, which means that in order to make requests to another origin,
  14072. * the server must have Cross-Origin Resource Sharing (CORS) headers enabled.
  14073. * @example
  14074. * resource.post(data)
  14075. * .then(function(result) {
  14076. * // use the result
  14077. * }).catch(function(error) {
  14078. * // an error occurred
  14079. * });
  14080. * @param data - Data that is posted with the resource.
  14081. * @param [options] - Object with the following properties:
  14082. * @param [options.data] - Data that is posted with the resource.
  14083. * @param [options.responseType] - The type of response. This controls the type of item returned.
  14084. * @param [options.headers] - Additional HTTP headers to send with the request, if any.
  14085. * @param [options.overrideMimeType] - Overrides the MIME type returned by the server.
  14086. * @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.
  14087. */
  14088. post(data: any, options?: {
  14089. data?: any;
  14090. responseType?: string;
  14091. headers?: any;
  14092. overrideMimeType?: string;
  14093. }): Promise<any> | undefined;
  14094. /**
  14095. * Creates a Resource from a URL and calls post() on it.
  14096. * @param options - A url or an object with the following properties
  14097. * @param options.url - The url of the resource.
  14098. * @param options.data - Data that is posted with the resource.
  14099. * @param [options.queryParameters] - An object containing query parameters that will be sent when retrieving the resource.
  14100. * @param [options.templateValues] - Key/Value pairs that are used to replace template values (eg. {x}).
  14101. * @param [options.headers = {}] - Additional HTTP headers that will be sent.
  14102. * @param [options.proxy] - A proxy to be used when loading the resource.
  14103. * @param [options.retryCallback] - The Function to call when a request for this resource fails. If it returns true, the request will be retried.
  14104. * @param [options.retryAttempts = 0] - The number of times the retryCallback should be called before giving up.
  14105. * @param [options.request] - A Request object that will be used. Intended for internal use only.
  14106. * @param [options.responseType] - The type of response. This controls the type of item returned.
  14107. * @param [options.overrideMimeType] - Overrides the MIME type returned by the server.
  14108. * @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.
  14109. */
  14110. post(options: {
  14111. url: string;
  14112. data: any;
  14113. queryParameters?: any;
  14114. templateValues?: any;
  14115. headers?: any;
  14116. proxy?: Proxy;
  14117. retryCallback?: Resource.RetryCallback;
  14118. retryAttempts?: number;
  14119. request?: Request;
  14120. responseType?: string;
  14121. overrideMimeType?: string;
  14122. }): Promise<any> | undefined;
  14123. /**
  14124. * Asynchronously puts data to the given resource. Returns a promise that will resolve to
  14125. * the result once loaded, or reject if the resource failed to load. The data is loaded
  14126. * using XMLHttpRequest, which means that in order to make requests to another origin,
  14127. * the server must have Cross-Origin Resource Sharing (CORS) headers enabled.
  14128. * @example
  14129. * resource.put(data)
  14130. * .then(function(result) {
  14131. * // use the result
  14132. * }).catch(function(error) {
  14133. * // an error occurred
  14134. * });
  14135. * @param data - Data that is posted with the resource.
  14136. * @param [options] - Object with the following properties:
  14137. * @param [options.responseType] - The type of response. This controls the type of item returned.
  14138. * @param [options.headers] - Additional HTTP headers to send with the request, if any.
  14139. * @param [options.overrideMimeType] - Overrides the MIME type returned by the server.
  14140. * @returns a promise that will resolve to the requested data when loaded. Returns undefined if <code>request.throttle</code> is true and the request does not have high enough priority.
  14141. */
  14142. put(data: any, options?: {
  14143. responseType?: string;
  14144. headers?: any;
  14145. overrideMimeType?: string;
  14146. }): Promise<any> | undefined;
  14147. /**
  14148. * Creates a Resource from a URL and calls put() on it.
  14149. * @param options - A url or an object with the following properties
  14150. * @param options.url - The url of the resource.
  14151. * @param options.data - Data that is posted with the resource.
  14152. * @param [options.queryParameters] - An object containing query parameters that will be sent when retrieving the resource.
  14153. * @param [options.templateValues] - Key/Value pairs that are used to replace template values (eg. {x}).
  14154. * @param [options.headers = {}] - Additional HTTP headers that will be sent.
  14155. * @param [options.proxy] - A proxy to be used when loading the resource.
  14156. * @param [options.retryCallback] - The Function to call when a request for this resource fails. If it returns true, the request will be retried.
  14157. * @param [options.retryAttempts = 0] - The number of times the retryCallback should be called before giving up.
  14158. * @param [options.request] - A Request object that will be used. Intended for internal use only.
  14159. * @param [options.responseType] - The type of response. This controls the type of item returned.
  14160. * @param [options.overrideMimeType] - Overrides the MIME type returned by the server.
  14161. * @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.
  14162. */
  14163. put(options: {
  14164. url: string;
  14165. data: any;
  14166. queryParameters?: any;
  14167. templateValues?: any;
  14168. headers?: any;
  14169. proxy?: Proxy;
  14170. retryCallback?: Resource.RetryCallback;
  14171. retryAttempts?: number;
  14172. request?: Request;
  14173. responseType?: string;
  14174. overrideMimeType?: string;
  14175. }): Promise<any> | undefined;
  14176. /**
  14177. * Asynchronously patches data to the given resource. Returns a promise that will resolve to
  14178. * the result once loaded, or reject if the resource failed to load. The data is loaded
  14179. * using XMLHttpRequest, which means that in order to make requests to another origin,
  14180. * the server must have Cross-Origin Resource Sharing (CORS) headers enabled.
  14181. * @example
  14182. * resource.patch(data)
  14183. * .then(function(result) {
  14184. * // use the result
  14185. * }).catch(function(error) {
  14186. * // an error occurred
  14187. * });
  14188. * @param data - Data that is posted with the resource.
  14189. * @param [options] - Object with the following properties:
  14190. * @param [options.responseType] - The type of response. This controls the type of item returned.
  14191. * @param [options.headers] - Additional HTTP headers to send with the request, if any.
  14192. * @param [options.overrideMimeType] - Overrides the MIME type returned by the server.
  14193. * @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.
  14194. */
  14195. patch(data: any, options?: {
  14196. responseType?: string;
  14197. headers?: any;
  14198. overrideMimeType?: string;
  14199. }): Promise<any> | undefined;
  14200. /**
  14201. * Creates a Resource from a URL and calls patch() on it.
  14202. * @param options - A url or an object with the following properties
  14203. * @param options.url - The url of the resource.
  14204. * @param options.data - Data that is posted with the resource.
  14205. * @param [options.queryParameters] - An object containing query parameters that will be sent when retrieving the resource.
  14206. * @param [options.templateValues] - Key/Value pairs that are used to replace template values (eg. {x}).
  14207. * @param [options.headers = {}] - Additional HTTP headers that will be sent.
  14208. * @param [options.proxy] - A proxy to be used when loading the resource.
  14209. * @param [options.retryCallback] - The Function to call when a request for this resource fails. If it returns true, the request will be retried.
  14210. * @param [options.retryAttempts = 0] - The number of times the retryCallback should be called before giving up.
  14211. * @param [options.request] - A Request object that will be used. Intended for internal use only.
  14212. * @param [options.responseType] - The type of response. This controls the type of item returned.
  14213. * @param [options.overrideMimeType] - Overrides the MIME type returned by the server.
  14214. * @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.
  14215. */
  14216. patch(options: {
  14217. url: string;
  14218. data: any;
  14219. queryParameters?: any;
  14220. templateValues?: any;
  14221. headers?: any;
  14222. proxy?: Proxy;
  14223. retryCallback?: Resource.RetryCallback;
  14224. retryAttempts?: number;
  14225. request?: Request;
  14226. responseType?: string;
  14227. overrideMimeType?: string;
  14228. }): Promise<any> | undefined;
  14229. /**
  14230. * A resource instance initialized to the current browser location
  14231. */
  14232. readonly DEFAULT: Resource;
  14233. }
  14234. /**
  14235. * Constructs an exception object that is thrown due to an error that can occur at runtime, e.g.,
  14236. * out of memory, could not compile shader, etc. If a function may throw this
  14237. * exception, the calling code should be prepared to catch it.
  14238. * <br /><br />
  14239. * On the other hand, a {@link DeveloperError} indicates an exception due
  14240. * to a developer error, e.g., invalid argument, that usually indicates a bug in the
  14241. * calling code.
  14242. * @param [message] - The error message for this exception.
  14243. */
  14244. export class RuntimeError extends Error {
  14245. constructor(message?: string);
  14246. /**
  14247. * 'RuntimeError' indicating that this exception was thrown due to a runtime error.
  14248. */
  14249. readonly name: string;
  14250. /**
  14251. * The explanation for why this exception was thrown.
  14252. */
  14253. readonly message: string;
  14254. /**
  14255. * The stack trace of this exception, if available.
  14256. */
  14257. readonly stack: string;
  14258. }
  14259. export namespace ScreenSpaceEventHandler {
  14260. /**
  14261. * An Event that occurs at a single position on screen.
  14262. */
  14263. type PositionedEvent = {
  14264. position: Cartesian2;
  14265. };
  14266. /**
  14267. * @param event - The event which triggered the listener
  14268. */
  14269. type PositionedEventCallback = (event: ScreenSpaceEventHandler.PositionedEvent) => void;
  14270. /**
  14271. * An Event that starts at one position and ends at another.
  14272. */
  14273. type MotionEvent = {
  14274. startPosition: Cartesian2;
  14275. endPosition: Cartesian2;
  14276. };
  14277. /**
  14278. * @param event - The event which triggered the listener
  14279. */
  14280. type MotionEventCallback = (event: ScreenSpaceEventHandler.MotionEvent) => void;
  14281. /**
  14282. * An Event that occurs at a two positions on screen.
  14283. */
  14284. type TwoPointEvent = {
  14285. position1: Cartesian2;
  14286. position2: Cartesian2;
  14287. };
  14288. /**
  14289. * @param event - The event which triggered the listener
  14290. */
  14291. type TwoPointEventCallback = (event: ScreenSpaceEventHandler.TwoPointEvent) => void;
  14292. /**
  14293. * An Event that starts at a two positions on screen and moves to two other positions.
  14294. */
  14295. type TwoPointMotionEvent = {
  14296. position1: Cartesian2;
  14297. position2: Cartesian2;
  14298. previousPosition1: Cartesian2;
  14299. previousPosition2: Cartesian2;
  14300. };
  14301. /**
  14302. * @param event - The event which triggered the listener
  14303. */
  14304. type TwoPointMotionEventCallback = (event: ScreenSpaceEventHandler.TwoPointMotionEvent) => void;
  14305. /**
  14306. * @param delta - The amount that the mouse wheel moved
  14307. */
  14308. type WheelEventCallback = (delta: number) => void;
  14309. }
  14310. /**
  14311. * Handles user input events. Custom functions can be added to be executed on
  14312. * when the user enters input.
  14313. * @param [element = document] - The element to add events to.
  14314. */
  14315. export class ScreenSpaceEventHandler {
  14316. constructor(element?: HTMLCanvasElement);
  14317. /**
  14318. * Set a function to be executed on an input event.
  14319. * @param action - Function to be executed when the input event occurs.
  14320. * @param type - The ScreenSpaceEventType of input event.
  14321. * @param [modifier] - A KeyboardEventModifier key that is held when a <code>type</code>
  14322. * event occurs.
  14323. */
  14324. setInputAction(action: ScreenSpaceEventHandler.PositionedEventCallback | ScreenSpaceEventHandler.MotionEventCallback | ScreenSpaceEventHandler.WheelEventCallback | ScreenSpaceEventHandler.TwoPointEventCallback | ScreenSpaceEventHandler.TwoPointMotionEventCallback, type: ScreenSpaceEventType, modifier?: KeyboardEventModifier): void;
  14325. /**
  14326. * Returns the function to be executed on an input event.
  14327. * @param type - The ScreenSpaceEventType of input event.
  14328. * @param [modifier] - A KeyboardEventModifier key that is held when a <code>type</code>
  14329. * event occurs.
  14330. * @returns The function to be executed on an input event.
  14331. */
  14332. getInputAction(type: ScreenSpaceEventType, modifier?: KeyboardEventModifier): ScreenSpaceEventHandler.PositionedEventCallback | ScreenSpaceEventHandler.MotionEventCallback | ScreenSpaceEventHandler.WheelEventCallback | ScreenSpaceEventHandler.TwoPointEventCallback | ScreenSpaceEventHandler.TwoPointMotionEventCallback;
  14333. /**
  14334. * Removes the function to be executed on an input event.
  14335. * @param type - The ScreenSpaceEventType of input event.
  14336. * @param [modifier] - A KeyboardEventModifier key that is held when a <code>type</code>
  14337. * event occurs.
  14338. */
  14339. removeInputAction(type: ScreenSpaceEventType, modifier?: KeyboardEventModifier): void;
  14340. /**
  14341. * Returns true if this object was destroyed; otherwise, false.
  14342. * <br /><br />
  14343. * If this object was destroyed, it should not be used; calling any function other than
  14344. * <code>isDestroyed</code> will result in a {@link DeveloperError} exception.
  14345. * @returns <code>true</code> if this object was destroyed; otherwise, <code>false</code>.
  14346. */
  14347. isDestroyed(): boolean;
  14348. /**
  14349. * Removes listeners held by this object.
  14350. * <br /><br />
  14351. * Once an object is destroyed, it should not be used; calling any function other than
  14352. * <code>isDestroyed</code> will result in a {@link DeveloperError} exception. Therefore,
  14353. * assign the return value (<code>undefined</code>) to the object as done in the example.
  14354. * @example
  14355. * handler = handler && handler.destroy();
  14356. */
  14357. destroy(): void;
  14358. /**
  14359. * The amount of time, in milliseconds, that mouse events will be disabled after
  14360. * receiving any touch events, such that any emulated mouse events will be ignored.
  14361. */
  14362. mouseEmulationIgnoreMilliseconds: number;
  14363. /**
  14364. * The amount of time, in milliseconds, before a touch on the screen becomes a
  14365. * touch and hold.
  14366. */
  14367. touchHoldDelayMilliseconds: number;
  14368. }
  14369. /**
  14370. * This enumerated type is for classifying mouse events: down, up, click, double click, move and move while a button is held down.
  14371. */
  14372. export enum ScreenSpaceEventType {
  14373. /**
  14374. * Represents a mouse left button down event.
  14375. */
  14376. LEFT_DOWN = 0,
  14377. /**
  14378. * Represents a mouse left button up event.
  14379. */
  14380. LEFT_UP = 1,
  14381. /**
  14382. * Represents a mouse left click event.
  14383. */
  14384. LEFT_CLICK = 2,
  14385. /**
  14386. * Represents a mouse left double click event.
  14387. */
  14388. LEFT_DOUBLE_CLICK = 3,
  14389. /**
  14390. * Represents a mouse left button down event.
  14391. */
  14392. RIGHT_DOWN = 5,
  14393. /**
  14394. * Represents a mouse right button up event.
  14395. */
  14396. RIGHT_UP = 6,
  14397. /**
  14398. * Represents a mouse right click event.
  14399. */
  14400. RIGHT_CLICK = 7,
  14401. /**
  14402. * Represents a mouse middle button down event.
  14403. */
  14404. MIDDLE_DOWN = 10,
  14405. /**
  14406. * Represents a mouse middle button up event.
  14407. */
  14408. MIDDLE_UP = 11,
  14409. /**
  14410. * Represents a mouse middle click event.
  14411. */
  14412. MIDDLE_CLICK = 12,
  14413. /**
  14414. * Represents a mouse move event.
  14415. */
  14416. MOUSE_MOVE = 15,
  14417. /**
  14418. * Represents a mouse wheel event.
  14419. */
  14420. WHEEL = 16,
  14421. /**
  14422. * Represents the start of a two-finger event on a touch surface.
  14423. */
  14424. PINCH_START = 17,
  14425. /**
  14426. * Represents the end of a two-finger event on a touch surface.
  14427. */
  14428. PINCH_END = 18,
  14429. /**
  14430. * Represents a change of a two-finger event on a touch surface.
  14431. */
  14432. PINCH_MOVE = 19
  14433. }
  14434. /**
  14435. * Value and type information for per-instance geometry attribute that determines if the geometry instance will be shown.
  14436. * @example
  14437. * const instance = new SuperMap.GeometryInstance({
  14438. * geometry : new SuperMap.BoxGeometry({
  14439. * vertexFormat : SuperMap.VertexFormat.POSITION_AND_NORMAL,
  14440. * minimum : new SuperMap.Cartesian3(-250000.0, -250000.0, -250000.0),
  14441. * maximum : new SuperMap.Cartesian3(250000.0, 250000.0, 250000.0)
  14442. * }),
  14443. * modelMatrix : SuperMap.Matrix4.multiplyByTranslation(SuperMap.Transforms.eastNorthUpToFixedFrame(
  14444. * SuperMap.Cartesian3.fromDegrees(-75.59777, 40.03883)), new SuperMap.Cartesian3(0.0, 0.0, 1000000.0), new SuperMap.Matrix4()),
  14445. * id : 'box',
  14446. * attributes : {
  14447. * show : new SuperMap.ShowGeometryInstanceAttribute(false)
  14448. * }
  14449. * });
  14450. * @param [show = true] - Determines if the geometry instance will be shown.
  14451. */
  14452. export class ShowGeometryInstanceAttribute {
  14453. constructor(show?: boolean);
  14454. /**
  14455. * The values for the attributes stored in a typed array.
  14456. */
  14457. value: Uint8Array;
  14458. /**
  14459. * The datatype of each component in the attribute, e.g., individual elements in
  14460. * {@link ColorGeometryInstanceAttribute#value}.
  14461. */
  14462. readonly componentDatatype: ComponentDatatype;
  14463. /**
  14464. * The number of components in the attributes, i.e., {@link ColorGeometryInstanceAttribute#value}.
  14465. */
  14466. readonly componentsPerAttribute: number;
  14467. /**
  14468. * When <code>true</code> and <code>componentDatatype</code> is an integer format,
  14469. * indicate that the components should be mapped to the range [0, 1] (unsigned)
  14470. * or [-1, 1] (signed) when they are accessed as floating-point for rendering.
  14471. */
  14472. readonly normalize: boolean;
  14473. /**
  14474. * Converts a boolean show to a typed array that can be used to assign a show attribute.
  14475. * @example
  14476. * const attributes = primitive.getGeometryInstanceAttributes('an id');
  14477. * attributes.show = SuperMap.ShowGeometryInstanceAttribute.toValue(true, attributes.show);
  14478. * @param show - The show value.
  14479. * @param [result] - The array to store the result in, if undefined a new instance will be created.
  14480. * @returns The modified result parameter or a new instance if result was undefined.
  14481. */
  14482. toValue(show: boolean, result?: Uint8Array): Uint8Array;
  14483. }
  14484. /**
  14485. * Contains functions for finding the Cartesian coordinates of the sun and the moon in the
  14486. * Earth-centered inertial frame.
  14487. */
  14488. export namespace Simon1994PlanetaryPositions {
  14489. /**
  14490. * Computes the position of the Sun in the Earth-centered inertial frame
  14491. * @param [julianDate] - The time at which to compute the Sun's position, if not provided the current system time is used.
  14492. * @param [result] - The object onto which to store the result.
  14493. * @returns Calculated sun position
  14494. */
  14495. function computeSunPositionInEarthInertialFrame(julianDate?: JulianDate, result?: Cartesian3): Cartesian3;
  14496. /**
  14497. * Computes the position of the Moon in the Earth-centered inertial frame
  14498. * @param [julianDate] - The time at which to compute the Sun's position, if not provided the current system time is used.
  14499. * @param [result] - The object onto which to store the result.
  14500. * @returns Calculated moon position
  14501. */
  14502. function computeMoonPositionInEarthInertialFrame(julianDate?: JulianDate, result?: Cartesian3): Cartesian3;
  14503. }
  14504. /**
  14505. * A description of a polyline modeled as a line strip; the first two positions define a line segment,
  14506. * and each additional position defines a line segment from the previous position.
  14507. * @example
  14508. * // A polyline with two connected line segments
  14509. * const polyline = new SuperMap.SimplePolylineGeometry({
  14510. * positions : SuperMap.Cartesian3.fromDegreesArray([
  14511. * 0.0, 0.0,
  14512. * 5.0, 0.0,
  14513. * 5.0, 5.0
  14514. * ])
  14515. * });
  14516. * const geometry = SuperMap.SimplePolylineGeometry.createGeometry(polyline);
  14517. * @param options - Object with the following properties:
  14518. * @param options.positions - An array of {@link Cartesian3} defining the positions in the polyline as a line strip.
  14519. * @param [options.colors] - An Array of {@link Color} defining the per vertex or per segment colors.
  14520. * @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.
  14521. * @param [options.arcType = ArcType.GEODESIC] - The type of line the polyline segments must follow.
  14522. * @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.
  14523. * @param [options.ellipsoid = Ellipsoid.WGS84] - The ellipsoid to be used as a reference.
  14524. */
  14525. export class SimplePolylineGeometry {
  14526. constructor(options: {
  14527. positions: Cartesian3[];
  14528. colors?: Color[];
  14529. colorsPerVertex?: boolean;
  14530. arcType?: ArcType;
  14531. granularity?: number;
  14532. ellipsoid?: Ellipsoid;
  14533. });
  14534. /**
  14535. * The number of elements used to pack the object into an array.
  14536. */
  14537. packedLength: number;
  14538. /**
  14539. * Stores the provided instance into the provided array.
  14540. * @param value - The value to pack.
  14541. * @param array - The array to pack into.
  14542. * @param [startingIndex = 0] - The index into the array at which to start packing the elements.
  14543. * @returns The array that was packed into
  14544. */
  14545. pack(value: SimplePolylineGeometry, array: number[], startingIndex?: number): number[];
  14546. /**
  14547. * Retrieves an instance from a packed array.
  14548. * @param array - The packed array.
  14549. * @param [startingIndex = 0] - The starting index of the element to be unpacked.
  14550. * @param [result] - The object into which to store the result.
  14551. * @returns The modified result parameter or a new SimplePolylineGeometry instance if one was not provided.
  14552. */
  14553. unpack(array: number[], startingIndex?: number, result?: SimplePolylineGeometry): SimplePolylineGeometry;
  14554. /**
  14555. * Computes the geometric representation of a simple polyline, including its vertices, indices, and a bounding sphere.
  14556. * @param simplePolylineGeometry - A description of the polyline.
  14557. * @returns The computed vertices and indices.
  14558. */
  14559. createGeometry(simplePolylineGeometry: SimplePolylineGeometry): Geometry | undefined;
  14560. }
  14561. /**
  14562. * A description of a sphere centered at the origin.
  14563. * @example
  14564. * const sphere = new SuperMap.SphereGeometry({
  14565. * radius : 100.0,
  14566. * vertexFormat : SuperMap.VertexFormat.POSITION_ONLY
  14567. * });
  14568. * const geometry = SuperMap.SphereGeometry.createGeometry(sphere);
  14569. * @param [options] - Object with the following properties:
  14570. * @param [options.radius = 1.0] - The radius of the sphere.
  14571. * @param [options.stackPartitions = 64] - The number of times to partition the ellipsoid into stacks.
  14572. * @param [options.slicePartitions = 64] - The number of times to partition the ellipsoid into radial slices.
  14573. * @param [options.vertexFormat = VertexFormat.DEFAULT] - The vertex attributes to be computed.
  14574. */
  14575. export class SphereGeometry {
  14576. constructor(options?: {
  14577. radius?: number;
  14578. stackPartitions?: number;
  14579. slicePartitions?: number;
  14580. vertexFormat?: VertexFormat;
  14581. });
  14582. /**
  14583. * The number of elements used to pack the object into an array.
  14584. */
  14585. packedLength: number;
  14586. /**
  14587. * Stores the provided instance into the provided array.
  14588. * @param value - The value to pack.
  14589. * @param array - The array to pack into.
  14590. * @param [startingIndex = 0] - The index into the array at which to start packing the elements.
  14591. * @returns The array that was packed into
  14592. */
  14593. pack(value: SphereGeometry, array: number[], startingIndex?: number): number[];
  14594. /**
  14595. * Retrieves an instance from a packed array.
  14596. * @param array - The packed array.
  14597. * @param [startingIndex = 0] - The starting index of the element to be unpacked.
  14598. * @param [result] - The object into which to store the result.
  14599. * @returns The modified result parameter or a new SphereGeometry instance if one was not provided.
  14600. */
  14601. unpack(array: number[], startingIndex?: number, result?: SphereGeometry): SphereGeometry;
  14602. /**
  14603. * Computes the geometric representation of a sphere, including its vertices, indices, and a bounding sphere.
  14604. * @param sphereGeometry - A description of the sphere.
  14605. * @returns The computed vertices and indices.
  14606. */
  14607. createGeometry(sphereGeometry: SphereGeometry): Geometry | undefined;
  14608. }
  14609. /**
  14610. * A description of the outline of a sphere.
  14611. * @example
  14612. * const sphere = new SuperMap.SphereOutlineGeometry({
  14613. * radius : 100.0,
  14614. * stackPartitions : 6,
  14615. * slicePartitions: 5
  14616. * });
  14617. * const geometry = SuperMap.SphereOutlineGeometry.createGeometry(sphere);
  14618. * @param [options] - Object with the following properties:
  14619. * @param [options.radius = 1.0] - The radius of the sphere.
  14620. * @param [options.stackPartitions = 10] - The count of stacks for the sphere (1 greater than the number of parallel lines).
  14621. * @param [options.slicePartitions = 8] - The count of slices for the sphere (Equal to the number of radial lines).
  14622. * @param [options.subdivisions = 200] - The number of points per line, determining the granularity of the curvature .
  14623. */
  14624. export class SphereOutlineGeometry {
  14625. constructor(options?: {
  14626. radius?: number;
  14627. stackPartitions?: number;
  14628. slicePartitions?: number;
  14629. subdivisions?: number;
  14630. });
  14631. /**
  14632. * The number of elements used to pack the object into an array.
  14633. */
  14634. packedLength: number;
  14635. /**
  14636. * Stores the provided instance into the provided array.
  14637. * @param value - The value to pack.
  14638. * @param array - The array to pack into.
  14639. * @param [startingIndex = 0] - The index into the array at which to start packing the elements.
  14640. * @returns The array that was packed into
  14641. */
  14642. pack(value: SphereOutlineGeometry, array: number[], startingIndex?: number): number[];
  14643. /**
  14644. * Retrieves an instance from a packed array.
  14645. * @param array - The packed array.
  14646. * @param [startingIndex = 0] - The starting index of the element to be unpacked.
  14647. * @param [result] - The object into which to store the result.
  14648. * @returns The modified result parameter or a new SphereOutlineGeometry instance if one was not provided.
  14649. */
  14650. unpack(array: number[], startingIndex?: number, result?: SphereOutlineGeometry): SphereOutlineGeometry;
  14651. /**
  14652. * Computes the geometric representation of an outline of a sphere, including its vertices, indices, and a bounding sphere.
  14653. * @param sphereGeometry - A description of the sphere outline.
  14654. * @returns The computed vertices and indices.
  14655. */
  14656. createGeometry(sphereGeometry: SphereOutlineGeometry): Geometry | undefined;
  14657. }
  14658. /**
  14659. * A set of curvilinear 3-dimensional coordinates.
  14660. * @param [clock = 0.0] - The angular coordinate lying in the xy-plane measured from the positive x-axis and toward the positive y-axis.
  14661. * @param [cone = 0.0] - The angular coordinate measured from the positive z-axis and toward the negative z-axis.
  14662. * @param [magnitude = 1.0] - The linear coordinate measured from the origin.
  14663. */
  14664. export class Spherical {
  14665. constructor(clock?: number, cone?: number, magnitude?: number);
  14666. /**
  14667. * The clock component.
  14668. */
  14669. clock: number;
  14670. /**
  14671. * The cone component.
  14672. */
  14673. cone: number;
  14674. /**
  14675. * The magnitude component.
  14676. */
  14677. magnitude: number;
  14678. /**
  14679. * Converts the provided Cartesian3 into Spherical coordinates.
  14680. * @param cartesian3 - The Cartesian3 to be converted to Spherical.
  14681. * @param [result] - The object in which the result will be stored, if undefined a new instance will be created.
  14682. * @returns The modified result parameter, or a new instance if one was not provided.
  14683. */
  14684. fromCartesian3(cartesian3: Cartesian3, result?: Spherical): Spherical;
  14685. /**
  14686. * Creates a duplicate of a Spherical.
  14687. * @param spherical - The spherical to clone.
  14688. * @param [result] - The object to store the result into, if undefined a new instance will be created.
  14689. * @returns The modified result parameter or a new instance if result was undefined. (Returns undefined if spherical is undefined)
  14690. */
  14691. clone(spherical: Spherical, result?: Spherical): Spherical;
  14692. /**
  14693. * Computes the normalized version of the provided spherical.
  14694. * @param spherical - The spherical to be normalized.
  14695. * @param [result] - The object to store the result into, if undefined a new instance will be created.
  14696. * @returns The modified result parameter or a new instance if result was undefined.
  14697. */
  14698. normalize(spherical: Spherical, result?: Spherical): Spherical;
  14699. /**
  14700. * Returns true if the first spherical is equal to the second spherical, false otherwise.
  14701. * @param left - The first Spherical to be compared.
  14702. * @param right - The second Spherical to be compared.
  14703. * @returns true if the first spherical is equal to the second spherical, false otherwise.
  14704. */
  14705. equals(left: Spherical, right: Spherical): boolean;
  14706. /**
  14707. * Returns true if the first spherical is within the provided epsilon of the second spherical, false otherwise.
  14708. * @param left - The first Spherical to be compared.
  14709. * @param right - The second Spherical to be compared.
  14710. * @param [epsilon = 0.0] - The epsilon to compare against.
  14711. * @returns true if the first spherical is within the provided epsilon of the second spherical, false otherwise.
  14712. */
  14713. equalsEpsilon(left: Spherical, right: Spherical, epsilon?: number): boolean;
  14714. /**
  14715. * Returns true if this spherical is equal to the provided spherical, false otherwise.
  14716. * @param other - The Spherical to be compared.
  14717. * @returns true if this spherical is equal to the provided spherical, false otherwise.
  14718. */
  14719. equals(other: Spherical): boolean;
  14720. /**
  14721. * Creates a duplicate of this Spherical.
  14722. * @param [result] - The object to store the result into, if undefined a new instance will be created.
  14723. * @returns The modified result parameter or a new instance if result was undefined.
  14724. */
  14725. clone(result?: Spherical): Spherical;
  14726. /**
  14727. * Returns true if this spherical is within the provided epsilon of the provided spherical, false otherwise.
  14728. * @param other - The Spherical to be compared.
  14729. * @param epsilon - The epsilon to compare against.
  14730. * @returns true if this spherical is within the provided epsilon of the provided spherical, false otherwise.
  14731. */
  14732. equalsEpsilon(other: Spherical, epsilon: number): boolean;
  14733. /**
  14734. * Returns a string representing this instance in the format (clock, cone, magnitude).
  14735. * @returns A string representing this instance.
  14736. */
  14737. toString(): string;
  14738. }
  14739. /**
  14740. * Creates a curve parameterized and evaluated by time. This type describes an interface
  14741. * and is not intended to be instantiated directly.
  14742. */
  14743. export class Spline {
  14744. constructor();
  14745. /**
  14746. * An array of times for the control points.
  14747. */
  14748. times: number[];
  14749. /**
  14750. * An array of control points.
  14751. */
  14752. points: Cartesian3[] | Quaternion[];
  14753. /**
  14754. * Evaluates the curve at a given time.
  14755. * @param time - The time at which to evaluate the curve.
  14756. * @param [result] - The object onto which to store the result.
  14757. * @returns The modified result parameter or a new instance of the point on the curve at the given time.
  14758. */
  14759. evaluate(time: number, result?: Cartesian3 | Quaternion | number[]): Cartesian3 | Quaternion | number[];
  14760. /**
  14761. * Finds an index <code>i</code> in <code>times</code> such that the parameter
  14762. * <code>time</code> is in the interval <code>[times[i], times[i + 1]]</code>.
  14763. * @param time - The time.
  14764. * @param startIndex - The index from which to start the search.
  14765. * @returns The index for the element at the start of the interval.
  14766. */
  14767. findTimeInterval(time: number, startIndex: number): number;
  14768. /**
  14769. * Wraps the given time to the period covered by the spline.
  14770. * @param time - The time.
  14771. * @returns The time, wrapped around the animation period.
  14772. */
  14773. wrapTime(time: number): number;
  14774. /**
  14775. * Clamps the given time to the period covered by the spline.
  14776. * @param time - The time.
  14777. * @returns The time, clamped to the animation period.
  14778. */
  14779. clampTime(time: number): number;
  14780. }
  14781. /**
  14782. * A wrapper around a web worker that allows scheduling tasks for a given worker,
  14783. * returning results asynchronously via a promise.
  14784. *
  14785. * The Worker is not constructed until a task is scheduled.
  14786. * @param workerPath - The Url to the worker. This can either be an absolute path or relative to the SuperMap Workers folder.
  14787. * @param [maximumActiveTasks = Number.POSITIVE_INFINITY] - The maximum number of active tasks. Once exceeded,
  14788. * scheduleTask will not queue any more tasks, allowing
  14789. * work to be rescheduled in future frames.
  14790. */
  14791. export class TaskProcessor {
  14792. constructor(workerPath: string, maximumActiveTasks?: number);
  14793. /**
  14794. * Schedule a task to be processed by the web worker asynchronously. If there are currently more
  14795. * tasks active than the maximum set by the constructor, will immediately return undefined.
  14796. * Otherwise, returns a promise that will resolve to the result posted back by the worker when
  14797. * finished.
  14798. * @example
  14799. * const taskProcessor = new SuperMap.TaskProcessor('myWorkerPath');
  14800. * const promise = taskProcessor.scheduleTask({
  14801. * someParameter : true,
  14802. * another : 'hello'
  14803. * });
  14804. * if (!SuperMap.defined(promise)) {
  14805. * // too many active tasks - try again later
  14806. * } else {
  14807. * promise.then(function(result) {
  14808. * // use the result of the task
  14809. * });
  14810. * }
  14811. * @param parameters - Any input data that will be posted to the worker.
  14812. * @param [transferableObjects] - An array of objects contained in parameters that should be
  14813. * transferred to the worker instead of copied.
  14814. * @returns Either a promise that will resolve to the result when available, or undefined
  14815. * if there are too many active tasks,
  14816. */
  14817. scheduleTask(parameters: any, transferableObjects?: object[]): Promise<object> | undefined;
  14818. /**
  14819. * Posts a message to a web worker with configuration to initialize loading
  14820. * and compiling a web assembly module asychronously, as well as an optional
  14821. * fallback JavaScript module to use if Web Assembly is not supported.
  14822. * @param [webAssemblyOptions] - An object with the following properties:
  14823. * @param [webAssemblyOptions.modulePath] - The path of the web assembly JavaScript wrapper module.
  14824. * @param [webAssemblyOptions.wasmBinaryFile] - The path of the web assembly binary file.
  14825. * @param [webAssemblyOptions.fallbackModulePath] - The path of the fallback JavaScript module to use if web assembly is not supported.
  14826. * @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.
  14827. */
  14828. initWebAssemblyModule(webAssemblyOptions?: {
  14829. modulePath?: string;
  14830. wasmBinaryFile?: string;
  14831. fallbackModulePath?: string;
  14832. }): Promise<object>;
  14833. /**
  14834. * Returns true if this object was destroyed; otherwise, false.
  14835. * <br /><br />
  14836. * If this object was destroyed, it should not be used; calling any function other than
  14837. * <code>isDestroyed</code> will result in a {@link DeveloperError} exception.
  14838. * @returns True if this object was destroyed; otherwise, false.
  14839. */
  14840. isDestroyed(): boolean;
  14841. /**
  14842. * Destroys this object. This will immediately terminate the Worker.
  14843. * <br /><br />
  14844. * Once an object is destroyed, it should not be used; calling any function other than
  14845. * <code>isDestroyed</code> will result in a {@link DeveloperError} exception.
  14846. */
  14847. destroy(): void;
  14848. }
  14849. /**
  14850. * Terrain data for a single tile. This type describes an
  14851. * interface and is not intended to be instantiated directly.
  14852. */
  14853. export class TerrainData {
  14854. constructor();
  14855. /**
  14856. * An array of credits for this tile.
  14857. */
  14858. credits: Credit[];
  14859. /**
  14860. * The water mask included in this terrain data, if any. A water mask is a rectangular
  14861. * Uint8Array or image where a value of 255 indicates water and a value of 0 indicates land.
  14862. * Values in between 0 and 255 are allowed as well to smoothly blend between land and water.
  14863. */
  14864. waterMask: Uint8Array | HTMLImageElement | HTMLCanvasElement;
  14865. /**
  14866. * Computes the terrain height at a specified longitude and latitude.
  14867. * @param rectangle - The rectangle covered by this terrain data.
  14868. * @param longitude - The longitude in radians.
  14869. * @param latitude - The latitude in radians.
  14870. * @returns The terrain height at the specified position. If the position
  14871. * is outside the rectangle, this method will extrapolate the height, which is likely to be wildly
  14872. * incorrect for positions far outside the rectangle.
  14873. */
  14874. interpolateHeight(rectangle: Rectangle, longitude: number, latitude: number): number;
  14875. /**
  14876. * Determines if a given child tile is available, based on the
  14877. * {@link TerrainData#childTileMask}. The given child tile coordinates are assumed
  14878. * to be one of the four children of this tile. If non-child tile coordinates are
  14879. * given, the availability of the southeast child tile is returned.
  14880. * @param thisX - The tile X coordinate of this (the parent) tile.
  14881. * @param thisY - The tile Y coordinate of this (the parent) tile.
  14882. * @param childX - The tile X coordinate of the child tile to check for availability.
  14883. * @param childY - The tile Y coordinate of the child tile to check for availability.
  14884. * @returns True if the child tile is available; otherwise, false.
  14885. */
  14886. isChildAvailable(thisX: number, thisY: number, childX: number, childY: number): boolean;
  14887. /**
  14888. * Upsamples this terrain data for use by a descendant tile.
  14889. * @param tilingScheme - The tiling scheme of this terrain data.
  14890. * @param thisX - The X coordinate of this tile in the tiling scheme.
  14891. * @param thisY - The Y coordinate of this tile in the tiling scheme.
  14892. * @param thisLevel - The level of this tile in the tiling scheme.
  14893. * @param descendantX - The X coordinate within the tiling scheme of the descendant tile for which we are upsampling.
  14894. * @param descendantY - The Y coordinate within the tiling scheme of the descendant tile for which we are upsampling.
  14895. * @param descendantLevel - The level within the tiling scheme of the descendant tile for which we are upsampling.
  14896. * @returns A promise for upsampled terrain data for the descendant tile,
  14897. * or undefined if too many asynchronous upsample operations are in progress and the request has been
  14898. * deferred.
  14899. */
  14900. upsample(tilingScheme: TilingScheme, thisX: number, thisY: number, thisLevel: number, descendantX: number, descendantY: number, descendantLevel: number): Promise<TerrainData> | undefined;
  14901. /**
  14902. * Gets a value indicating whether or not this terrain data was created by upsampling lower resolution
  14903. * terrain data. If this value is false, the data was obtained from some other source, such
  14904. * as by downloading it from a remote server. This method should return true for instances
  14905. * returned from a call to {@link TerrainData#upsample}.
  14906. * @returns True if this instance was created by upsampling; otherwise, false.
  14907. */
  14908. wasCreatedByUpsampling(): boolean;
  14909. }
  14910. export namespace TerrainProvider {
  14911. /**
  14912. * A function that is called when an error occurs.
  14913. * @param err - An object holding details about the error that occurred.
  14914. */
  14915. type ErrorEvent = (this: TerrainProvider, err: TileProviderError) => void;
  14916. }
  14917. /**
  14918. * Provides terrain or other geometry for the surface of an ellipsoid. The surface geometry is
  14919. * organized into a pyramid of tiles according to a {@link TilingScheme}. This type describes an
  14920. * interface and is not intended to be instantiated directly.
  14921. */
  14922. export class TerrainProvider {
  14923. constructor();
  14924. /**
  14925. * Gets an event that is raised when the terrain provider encounters an asynchronous error.. By subscribing
  14926. * to the event, you will be notified of the error and can potentially recover from it. Event listeners
  14927. * are passed an instance of {@link TileProviderError}.
  14928. */
  14929. readonly errorEvent: Event<TerrainProvider.ErrorEvent>;
  14930. /**
  14931. * Gets the credit to display when this terrain provider is active. Typically this is used to credit
  14932. * the source of the terrain. This function should
  14933. * not be called before {@link TerrainProvider#ready} returns true.
  14934. */
  14935. readonly credit: Credit;
  14936. /**
  14937. * Gets the tiling scheme used by the provider. This function should
  14938. * not be called before {@link TerrainProvider#ready} returns true.
  14939. */
  14940. readonly tilingScheme: TilingScheme;
  14941. /**
  14942. * Gets a value indicating whether or not the provider is ready for use.
  14943. */
  14944. readonly ready: boolean;
  14945. /**
  14946. * Gets a promise that resolves to true when the provider is ready for use.
  14947. */
  14948. readonly readyPromise: Promise<boolean>;
  14949. /**
  14950. * Gets a value indicating whether or not the provider includes a water mask. The water mask
  14951. * indicates which areas of the globe are water rather than land, so they can be rendered
  14952. * as a reflective surface with animated waves. This function should not be
  14953. * called before {@link TerrainProvider#ready} returns true.
  14954. */
  14955. readonly hasWaterMask: boolean;
  14956. /**
  14957. * Gets a value indicating whether or not the requested tiles include vertex normals.
  14958. * This function should not be called before {@link TerrainProvider#ready} returns true.
  14959. */
  14960. readonly hasVertexNormals: boolean;
  14961. /**
  14962. * Gets an object that can be used to determine availability of terrain from this provider, such as
  14963. * at points and in rectangles. This function should not be called before
  14964. * {@link TerrainProvider#ready} returns true. This property may be undefined if availability
  14965. * information is not available.
  14966. */
  14967. readonly availability: TileAvailability;
  14968. /**
  14969. * Gets a list of indices for a triangle mesh representing a regular grid. Calling
  14970. * this function multiple times with the same grid width and height returns the
  14971. * same list of indices. The total number of vertices must be less than or equal
  14972. * to 65536.
  14973. * @param width - The number of vertices in the regular grid in the horizontal direction.
  14974. * @param height - The number of vertices in the regular grid in the vertical direction.
  14975. * @returns The list of indices. Uint16Array gets returned for 64KB or less and Uint32Array for 4GB or less.
  14976. */
  14977. getRegularGridIndices(width: number, height: number): Uint16Array | Uint32Array;
  14978. /**
  14979. * Specifies the quality of terrain created from heightmaps. A value of 1.0 will
  14980. * ensure that adjacent heightmap vertices are separated by no more than
  14981. * {@link Globe.maximumScreenSpaceError} screen pixels and will probably go very slowly.
  14982. * A value of 0.5 will cut the estimated level zero geometric error in half, allowing twice the
  14983. * screen pixels between adjacent heightmap vertices and thus rendering more quickly.
  14984. */
  14985. heightmapTerrainQuality: number;
  14986. /**
  14987. * Determines an appropriate geometric error estimate when the geometry comes from a heightmap.
  14988. * @param ellipsoid - The ellipsoid to which the terrain is attached.
  14989. * @param tileImageWidth - The width, in pixels, of the heightmap associated with a single tile.
  14990. * @param numberOfTilesAtLevelZero - The number of tiles in the horizontal direction at tile level zero.
  14991. * @returns An estimated geometric error.
  14992. */
  14993. getEstimatedLevelZeroGeometricErrorForAHeightmap(ellipsoid: Ellipsoid, tileImageWidth: number, numberOfTilesAtLevelZero: number): number;
  14994. /**
  14995. * Requests the geometry for a given tile. This function should not be called before
  14996. * {@link TerrainProvider#ready} returns true. The result must include terrain data and
  14997. * may optionally include a water mask and an indication of which child tiles are available.
  14998. * @param x - The X coordinate of the tile for which to request geometry.
  14999. * @param y - The Y coordinate of the tile for which to request geometry.
  15000. * @param level - The level of the tile for which to request geometry.
  15001. * @param [request] - The request object. Intended for internal use only.
  15002. * @returns A promise for the requested geometry. If this method
  15003. * returns undefined instead of a promise, it is an indication that too many requests are already
  15004. * pending and the request will be retried later.
  15005. */
  15006. requestTileGeometry(x: number, y: number, level: number, request?: Request): Promise<TerrainData> | undefined;
  15007. /**
  15008. * Gets the maximum geometric error allowed in a tile at a given level. This function should not be
  15009. * called before {@link TerrainProvider#ready} returns true.
  15010. * @param level - The tile level for which to get the maximum geometric error.
  15011. * @returns The maximum geometric error.
  15012. */
  15013. getLevelMaximumGeometricError(level: number): number;
  15014. /**
  15015. * Determines whether data for a tile is available to be loaded.
  15016. * @param x - The X coordinate of the tile for which to request geometry.
  15017. * @param y - The Y coordinate of the tile for which to request geometry.
  15018. * @param level - The level of the tile for which to request geometry.
  15019. * @returns Undefined if not supported by the terrain provider, otherwise true or false.
  15020. */
  15021. getTileDataAvailable(x: number, y: number, level: number): boolean | undefined;
  15022. /**
  15023. * Makes sure we load availability data for a tile
  15024. * @param x - The X coordinate of the tile for which to request geometry.
  15025. * @param y - The Y coordinate of the tile for which to request geometry.
  15026. * @param level - The level of the tile for which to request geometry.
  15027. * @returns Undefined if nothing need to be loaded or a Promise that resolves when all required tiles are loaded
  15028. */
  15029. loadTileDataAvailability(x: number, y: number, level: number): undefined | Promise<void>;
  15030. }
  15031. /**
  15032. * Reports the availability of tiles in a {@link TilingScheme}.
  15033. * @param tilingScheme - The tiling scheme in which to report availability.
  15034. * @param maximumLevel - The maximum tile level that is potentially available.
  15035. */
  15036. export class TileAvailability {
  15037. constructor(tilingScheme: TilingScheme, maximumLevel: number);
  15038. /**
  15039. * Marks a rectangular range of tiles in a particular level as being available. For best performance,
  15040. * add your ranges in order of increasing level.
  15041. * @param level - The level.
  15042. * @param startX - The X coordinate of the first available tiles at the level.
  15043. * @param startY - The Y coordinate of the first available tiles at the level.
  15044. * @param endX - The X coordinate of the last available tiles at the level.
  15045. * @param endY - The Y coordinate of the last available tiles at the level.
  15046. */
  15047. addAvailableTileRange(level: number, startX: number, startY: number, endX: number, endY: number): void;
  15048. /**
  15049. * Determines the level of the most detailed tile covering the position. This function
  15050. * usually completes in time logarithmic to the number of rectangles added with
  15051. * {@link TileAvailability#addAvailableTileRange}.
  15052. * @param position - The position for which to determine the maximum available level. The height component is ignored.
  15053. * @returns The level of the most detailed tile covering the position.
  15054. */
  15055. computeMaximumLevelAtPosition(position: Cartographic): number;
  15056. /**
  15057. * Finds the most detailed level that is available _everywhere_ within a given rectangle. More detailed
  15058. * tiles may be available in parts of the rectangle, but not the whole thing. The return value of this
  15059. * function may be safely passed to {@link sampleTerrain} for any position within the rectangle. This function
  15060. * usually completes in time logarithmic to the number of rectangles added with
  15061. * {@link TileAvailability#addAvailableTileRange}.
  15062. * @param rectangle - The rectangle.
  15063. * @returns The best available level for the entire rectangle.
  15064. */
  15065. computeBestAvailableLevelOverRectangle(rectangle: Rectangle): number;
  15066. /**
  15067. * Determines if a particular tile is available.
  15068. * @param level - The tile level to check.
  15069. * @param x - The X coordinate of the tile to check.
  15070. * @param y - The Y coordinate of the tile to check.
  15071. * @returns True if the tile is available; otherwise, false.
  15072. */
  15073. isTileAvailable(level: number, x: number, y: number): boolean;
  15074. /**
  15075. * Computes a bit mask indicating which of a tile's four children exist.
  15076. * If a child's bit is set, a tile is available for that child. If it is cleared,
  15077. * the tile is not available. The bit values are as follows:
  15078. * <table>
  15079. * <tr><th>Bit Position</th><th>Bit Value</th><th>Child Tile</th></tr>
  15080. * <tr><td>0</td><td>1</td><td>Southwest</td></tr>
  15081. * <tr><td>1</td><td>2</td><td>Southeast</td></tr>
  15082. * <tr><td>2</td><td>4</td><td>Northwest</td></tr>
  15083. * <tr><td>3</td><td>8</td><td>Northeast</td></tr>
  15084. * </table>
  15085. * @param level - The level of the parent tile.
  15086. * @param x - The X coordinate of the parent tile.
  15087. * @param y - The Y coordinate of the parent tile.
  15088. * @returns The bit mask indicating child availability.
  15089. */
  15090. computeChildMaskForTile(level: number, x: number, y: number): number;
  15091. }
  15092. /**
  15093. * Provides details about an error that occurred in an {@link ImageryProvider} or a {@link TerrainProvider}.
  15094. * @param provider - The imagery or terrain provider that experienced the error.
  15095. * @param message - A message describing the error.
  15096. * @param [x] - The X coordinate of the tile that experienced the error, or undefined if the error
  15097. * is not specific to a particular tile.
  15098. * @param [y] - The Y coordinate of the tile that experienced the error, or undefined if the error
  15099. * is not specific to a particular tile.
  15100. * @param [level] - The level of the tile that experienced the error, or undefined if the error
  15101. * is not specific to a particular tile.
  15102. * @param [timesRetried = 0] - The number of times this operation has been retried.
  15103. * @param [error] - The error or exception that occurred, if any.
  15104. */
  15105. export class TileProviderError {
  15106. constructor(provider: ImageryProvider | TerrainProvider, message: string, x?: number, y?: number, level?: number, timesRetried?: number, error?: Error);
  15107. /**
  15108. * The {@link ImageryProvider} or {@link TerrainProvider} that experienced the error.
  15109. */
  15110. provider: ImageryProvider | TerrainProvider;
  15111. /**
  15112. * The message describing the error.
  15113. */
  15114. message: string;
  15115. /**
  15116. * The X coordinate of the tile that experienced the error. If the error is not specific
  15117. * to a particular tile, this property will be undefined.
  15118. */
  15119. x: number;
  15120. /**
  15121. * The Y coordinate of the tile that experienced the error. If the error is not specific
  15122. * to a particular tile, this property will be undefined.
  15123. */
  15124. y: number;
  15125. /**
  15126. * The level-of-detail of the tile that experienced the error. If the error is not specific
  15127. * to a particular tile, this property will be undefined.
  15128. */
  15129. level: number;
  15130. /**
  15131. * The number of times this operation has been retried.
  15132. */
  15133. timesRetried: number;
  15134. /**
  15135. * True if the failed operation should be retried; otherwise, false. The imagery or terrain provider
  15136. * will set the initial value of this property before raising the event, but any listeners
  15137. * can change it. The value after the last listener is invoked will be acted upon.
  15138. */
  15139. retry: boolean;
  15140. /**
  15141. * The error or exception that occurred, if any.
  15142. */
  15143. error: Error;
  15144. /**
  15145. * Handles an error in an {@link ImageryProvider} or {@link TerrainProvider} by raising an event if it has any listeners, or by
  15146. * logging the error to the console if the event has no listeners. This method also tracks the number
  15147. * of times the operation has been retried and will automatically retry if requested to do so by the
  15148. * event listeners.
  15149. * @param previousError - The error instance returned by this function the last
  15150. * time it was called for this error, or undefined if this is the first time this error has
  15151. * occurred.
  15152. * @param provider - The imagery or terrain provider that encountered the error.
  15153. * @param event - The event to raise to inform listeners of the error.
  15154. * @param message - The message describing the error.
  15155. * @param x - The X coordinate of the tile that experienced the error, or undefined if the
  15156. * error is not specific to a particular tile.
  15157. * @param y - The Y coordinate of the tile that experienced the error, or undefined if the
  15158. * error is not specific to a particular tile.
  15159. * @param level - The level-of-detail of the tile that experienced the error, or undefined if the
  15160. * error is not specific to a particular tile.
  15161. * @param retryFunction - The function to call to retry the operation. If undefined, the
  15162. * operation will not be retried.
  15163. * @param [errorDetails] - The error or exception that occurred, if any.
  15164. * @returns The error instance that was passed to the event listeners and that
  15165. * should be passed to this function the next time it is called for the same error in order
  15166. * to track retry counts.
  15167. */
  15168. handleError(previousError: TileProviderError, provider: ImageryProvider | TerrainProvider, event: Event, message: string, x: number, y: number, level: number, retryFunction: TileProviderError.RetryFunction, errorDetails?: Error): TileProviderError;
  15169. /**
  15170. * Handles success of an operation by resetting the retry count of a previous error, if any. This way,
  15171. * if the error occurs again in the future, the listeners will be informed that it has not yet been retried.
  15172. * @param previousError - The previous error, or undefined if this operation has
  15173. * not previously resulted in an error.
  15174. */
  15175. handleSuccess(previousError: TileProviderError): void;
  15176. }
  15177. export namespace TileProviderError {
  15178. /**
  15179. * A function that will be called to retry the operation.
  15180. */
  15181. type RetryFunction = () => void;
  15182. }
  15183. /**
  15184. * A tiling scheme for geometry or imagery on the surface of an ellipsoid. At level-of-detail zero,
  15185. * the coarsest, least-detailed level, the number of tiles is configurable.
  15186. * At level of detail one, each of the level zero tiles has four children, two in each direction.
  15187. * At level of detail two, each of the level one tiles has four children, two in each direction.
  15188. * This continues for as many levels as are present in the geometry or imagery source.
  15189. */
  15190. export class TilingScheme {
  15191. constructor();
  15192. /**
  15193. * Gets the ellipsoid that is tiled by the tiling scheme.
  15194. */
  15195. ellipsoid: Ellipsoid;
  15196. /**
  15197. * Gets the rectangle, in radians, covered by this tiling scheme.
  15198. */
  15199. rectangle: Rectangle;
  15200. /**
  15201. * Gets the map projection used by the tiling scheme.
  15202. */
  15203. projection: MapProjection;
  15204. /**
  15205. * Gets the total number of tiles in the X direction at a specified level-of-detail.
  15206. * @param level - The level-of-detail.
  15207. * @returns The number of tiles in the X direction at the given level.
  15208. */
  15209. getNumberOfXTilesAtLevel(level: number): number;
  15210. /**
  15211. * Gets the total number of tiles in the Y direction at a specified level-of-detail.
  15212. * @param level - The level-of-detail.
  15213. * @returns The number of tiles in the Y direction at the given level.
  15214. */
  15215. getNumberOfYTilesAtLevel(level: number): number;
  15216. /**
  15217. * Transforms a rectangle specified in geodetic radians to the native coordinate system
  15218. * of this tiling scheme.
  15219. * @param rectangle - The rectangle to transform.
  15220. * @param [result] - The instance to which to copy the result, or undefined if a new instance
  15221. * should be created.
  15222. * @returns The specified 'result', or a new object containing the native rectangle if 'result'
  15223. * is undefined.
  15224. */
  15225. rectangleToNativeRectangle(rectangle: Rectangle, result?: Rectangle): Rectangle;
  15226. /**
  15227. * Converts tile x, y coordinates and level to a rectangle expressed in the native coordinates
  15228. * of the tiling scheme.
  15229. * @param x - The integer x coordinate of the tile.
  15230. * @param y - The integer y coordinate of the tile.
  15231. * @param level - The tile level-of-detail. Zero is the least detailed.
  15232. * @param [result] - The instance to which to copy the result, or undefined if a new instance
  15233. * should be created.
  15234. * @returns The specified 'result', or a new object containing the rectangle
  15235. * if 'result' is undefined.
  15236. */
  15237. tileXYToNativeRectangle(x: number, y: number, level: number, result?: any): Rectangle;
  15238. /**
  15239. * Converts tile x, y coordinates and level to a cartographic rectangle in radians.
  15240. * @param x - The integer x coordinate of the tile.
  15241. * @param y - The integer y coordinate of the tile.
  15242. * @param level - The tile level-of-detail. Zero is the least detailed.
  15243. * @param [result] - The instance to which to copy the result, or undefined if a new instance
  15244. * should be created.
  15245. * @returns The specified 'result', or a new object containing the rectangle
  15246. * if 'result' is undefined.
  15247. */
  15248. tileXYToRectangle(x: number, y: number, level: number, result?: any): Rectangle;
  15249. /**
  15250. * Calculates the tile x, y coordinates of the tile containing
  15251. * a given cartographic position.
  15252. * @param position - The position.
  15253. * @param level - The tile level-of-detail. Zero is the least detailed.
  15254. * @param [result] - The instance to which to copy the result, or undefined if a new instance
  15255. * should be created.
  15256. * @returns The specified 'result', or a new object containing the tile x, y coordinates
  15257. * if 'result' is undefined.
  15258. */
  15259. positionToTileXY(position: Cartographic, level: number, result?: Cartesian2): Cartesian2;
  15260. }
  15261. /**
  15262. * An interval defined by a start and a stop time; optionally including those times as part of the interval.
  15263. * Arbitrary data can optionally be associated with each instance for used with {@link TimeIntervalCollection}.
  15264. * @example
  15265. * // Create an instance that spans August 1st, 1980 and is associated
  15266. * // with a Cartesian position.
  15267. * const timeInterval = new SuperMap.TimeInterval({
  15268. * start : SuperMap.JulianDate.fromIso8601('1980-08-01T00:00:00Z'),
  15269. * stop : SuperMap.JulianDate.fromIso8601('1980-08-02T00:00:00Z'),
  15270. * isStartIncluded : true,
  15271. * isStopIncluded : false,
  15272. * data : SuperMap.Cartesian3.fromDegrees(39.921037, -75.170082)
  15273. * });
  15274. * @example
  15275. * // Create two instances from ISO 8601 intervals with associated numeric data
  15276. * // then compute their intersection, summing the data they contain.
  15277. * const left = SuperMap.TimeInterval.fromIso8601({
  15278. * iso8601 : '2000/2010',
  15279. * data : 2
  15280. * });
  15281. *
  15282. * const right = SuperMap.TimeInterval.fromIso8601({
  15283. * iso8601 : '1995/2005',
  15284. * data : 3
  15285. * });
  15286. *
  15287. * //The result of the below intersection will be an interval equivalent to
  15288. * //const intersection = SuperMap.TimeInterval.fromIso8601({
  15289. * // iso8601 : '2000/2005',
  15290. * // data : 5
  15291. * //});
  15292. * const intersection = new SuperMap.TimeInterval();
  15293. * SuperMap.TimeInterval.intersect(left, right, intersection, function(leftData, rightData) {
  15294. * return leftData + rightData;
  15295. * });
  15296. * @example
  15297. * // Check if an interval contains a specific time.
  15298. * const dateToCheck = SuperMap.JulianDate.fromIso8601('1982-09-08T11:30:00Z');
  15299. * const containsDate = SuperMap.TimeInterval.contains(timeInterval, dateToCheck);
  15300. * @param [options] - Object with the following properties:
  15301. * @param [options.start = new JulianDate()] - The start time of the interval.
  15302. * @param [options.stop = new JulianDate()] - The stop time of the interval.
  15303. * @param [options.isStartIncluded = true] - <code>true</code> if <code>options.start</code> is included in the interval, <code>false</code> otherwise.
  15304. * @param [options.isStopIncluded = true] - <code>true</code> if <code>options.stop</code> is included in the interval, <code>false</code> otherwise.
  15305. * @param [options.data] - Arbitrary data associated with this interval.
  15306. */
  15307. export class TimeInterval {
  15308. constructor(options?: {
  15309. start?: JulianDate;
  15310. stop?: JulianDate;
  15311. isStartIncluded?: boolean;
  15312. isStopIncluded?: boolean;
  15313. data?: any;
  15314. });
  15315. /**
  15316. * Gets or sets the start time of this interval.
  15317. */
  15318. start: JulianDate;
  15319. /**
  15320. * Gets or sets the stop time of this interval.
  15321. */
  15322. stop: JulianDate;
  15323. /**
  15324. * Gets or sets the data associated with this interval.
  15325. */
  15326. data: any;
  15327. /**
  15328. * Gets or sets whether or not the start time is included in this interval.
  15329. */
  15330. isStartIncluded: boolean;
  15331. /**
  15332. * Gets or sets whether or not the stop time is included in this interval.
  15333. */
  15334. isStopIncluded: boolean;
  15335. /**
  15336. * Gets whether or not this interval is empty.
  15337. */
  15338. readonly isEmpty: boolean;
  15339. /**
  15340. * Creates a new instance from a {@link http://en.wikipedia.org/wiki/ISO_8601|ISO 8601} interval.
  15341. * @param options - Object with the following properties:
  15342. * @param options.iso8601 - An ISO 8601 interval.
  15343. * @param [options.isStartIncluded = true] - <code>true</code> if <code>options.start</code> is included in the interval, <code>false</code> otherwise.
  15344. * @param [options.isStopIncluded = true] - <code>true</code> if <code>options.stop</code> is included in the interval, <code>false</code> otherwise.
  15345. * @param [options.data] - Arbitrary data associated with this interval.
  15346. * @param [result] - An existing instance to use for the result.
  15347. * @returns The modified result parameter or a new instance if none was provided.
  15348. */
  15349. fromIso8601(options: {
  15350. iso8601: string;
  15351. isStartIncluded?: boolean;
  15352. isStopIncluded?: boolean;
  15353. data?: any;
  15354. }, result?: TimeInterval): TimeInterval;
  15355. /**
  15356. * Creates an ISO8601 representation of the provided interval.
  15357. * @param timeInterval - The interval to be converted.
  15358. * @param [precision] - The number of fractional digits used to represent the seconds component. By default, the most precise representation is used.
  15359. * @returns The ISO8601 representation of the provided interval.
  15360. */
  15361. toIso8601(timeInterval: TimeInterval, precision?: number): string;
  15362. /**
  15363. * Duplicates the provided instance.
  15364. * @param [timeInterval] - The instance to clone.
  15365. * @param [result] - An existing instance to use for the result.
  15366. * @returns The modified result parameter or a new instance if none was provided.
  15367. */
  15368. clone(timeInterval?: TimeInterval, result?: TimeInterval): TimeInterval;
  15369. /**
  15370. * Compares two instances and returns <code>true</code> if they are equal, <code>false</code> otherwise.
  15371. * @param [left] - The first instance.
  15372. * @param [right] - The second instance.
  15373. * @param [dataComparer] - A function which compares the data of the two intervals. If omitted, reference equality is used.
  15374. * @returns <code>true</code> if the dates are equal; otherwise, <code>false</code>.
  15375. */
  15376. equals(left?: TimeInterval, right?: TimeInterval, dataComparer?: TimeInterval.DataComparer): boolean;
  15377. /**
  15378. * Compares two instances and returns <code>true</code> if they are within <code>epsilon</code> seconds of
  15379. * each other. That is, in order for the dates to be considered equal (and for
  15380. * this function to return <code>true</code>), the absolute value of the difference between them, in
  15381. * seconds, must be less than <code>epsilon</code>.
  15382. * @param [left] - The first instance.
  15383. * @param [right] - The second instance.
  15384. * @param [epsilon = 0] - The maximum number of seconds that should separate the two instances.
  15385. * @param [dataComparer] - A function which compares the data of the two intervals. If omitted, reference equality is used.
  15386. * @returns <code>true</code> if the two dates are within <code>epsilon</code> seconds of each other; otherwise <code>false</code>.
  15387. */
  15388. equalsEpsilon(left?: TimeInterval, right?: TimeInterval, epsilon?: number, dataComparer?: TimeInterval.DataComparer): boolean;
  15389. /**
  15390. * Computes the intersection of two intervals, optionally merging their data.
  15391. * @param left - The first interval.
  15392. * @param [right] - The second interval.
  15393. * @param [result] - An existing instance to use for the result.
  15394. * @param [mergeCallback] - A function which merges the data of the two intervals. If omitted, the data from the left interval will be used.
  15395. * @returns The modified result parameter.
  15396. */
  15397. intersect(left: TimeInterval, right?: TimeInterval, result?: TimeInterval, mergeCallback?: TimeInterval.MergeCallback): TimeInterval;
  15398. /**
  15399. * Checks if the specified date is inside the provided interval.
  15400. * @param timeInterval - The interval.
  15401. * @param julianDate - The date to check.
  15402. * @returns <code>true</code> if the interval contains the specified date, <code>false</code> otherwise.
  15403. */
  15404. contains(timeInterval: TimeInterval, julianDate: JulianDate): boolean;
  15405. /**
  15406. * Duplicates this instance.
  15407. * @param [result] - An existing instance to use for the result.
  15408. * @returns The modified result parameter or a new instance if none was provided.
  15409. */
  15410. clone(result?: TimeInterval): TimeInterval;
  15411. /**
  15412. * Compares this instance against the provided instance componentwise and returns
  15413. * <code>true</code> if they are equal, <code>false</code> otherwise.
  15414. * @param [right] - The right hand side interval.
  15415. * @param [dataComparer] - A function which compares the data of the two intervals. If omitted, reference equality is used.
  15416. * @returns <code>true</code> if they are equal, <code>false</code> otherwise.
  15417. */
  15418. equals(right?: TimeInterval, dataComparer?: TimeInterval.DataComparer): boolean;
  15419. /**
  15420. * Compares this instance against the provided instance componentwise and returns
  15421. * <code>true</code> if they are within the provided epsilon,
  15422. * <code>false</code> otherwise.
  15423. * @param [right] - The right hand side interval.
  15424. * @param [epsilon = 0] - The epsilon to use for equality testing.
  15425. * @param [dataComparer] - A function which compares the data of the two intervals. If omitted, reference equality is used.
  15426. * @returns <code>true</code> if they are within the provided epsilon, <code>false</code> otherwise.
  15427. */
  15428. equalsEpsilon(right?: TimeInterval, epsilon?: number, dataComparer?: TimeInterval.DataComparer): boolean;
  15429. /**
  15430. * Creates a string representing this TimeInterval in ISO8601 format.
  15431. * @returns A string representing this TimeInterval in ISO8601 format.
  15432. */
  15433. toString(): string;
  15434. /**
  15435. * An immutable empty interval.
  15436. */
  15437. readonly EMPTY: TimeInterval;
  15438. }
  15439. export namespace TimeInterval {
  15440. /**
  15441. * Function interface for merging interval data.
  15442. * @param leftData - The first data instance.
  15443. * @param rightData - The second data instance.
  15444. */
  15445. type MergeCallback = (leftData: any, rightData: any) => any;
  15446. /**
  15447. * Function interface for comparing interval data.
  15448. * @param leftData - The first data instance.
  15449. * @param rightData - The second data instance.
  15450. */
  15451. type DataComparer = (leftData: any, rightData: any) => boolean;
  15452. }
  15453. /**
  15454. * A non-overlapping collection of {@link TimeInterval} instances sorted by start time.
  15455. * @param [intervals] - An array of intervals to add to the collection.
  15456. */
  15457. export class TimeIntervalCollection {
  15458. constructor(intervals?: TimeInterval[]);
  15459. /**
  15460. * Gets an event that is raised whenever the collection of intervals change.
  15461. */
  15462. readonly changedEvent: Event;
  15463. /**
  15464. * Gets the start time of the collection.
  15465. */
  15466. readonly start: JulianDate;
  15467. /**
  15468. * Gets whether or not the start time is included in the collection.
  15469. */
  15470. readonly isStartIncluded: boolean;
  15471. /**
  15472. * Gets the stop time of the collection.
  15473. */
  15474. readonly stop: JulianDate;
  15475. /**
  15476. * Gets whether or not the stop time is included in the collection.
  15477. */
  15478. readonly isStopIncluded: boolean;
  15479. /**
  15480. * Gets the number of intervals in the collection.
  15481. */
  15482. readonly length: number;
  15483. /**
  15484. * Gets whether or not the collection is empty.
  15485. */
  15486. readonly isEmpty: boolean;
  15487. /**
  15488. * Compares this instance against the provided instance componentwise and returns
  15489. * <code>true</code> if they are equal, <code>false</code> otherwise.
  15490. * @param [right] - The right hand side collection.
  15491. * @param [dataComparer] - A function which compares the data of the two intervals. If omitted, reference equality is used.
  15492. * @returns <code>true</code> if they are equal, <code>false</code> otherwise.
  15493. */
  15494. equals(right?: TimeIntervalCollection, dataComparer?: TimeInterval.DataComparer): boolean;
  15495. /**
  15496. * Gets the interval at the specified index.
  15497. * @param index - The index of the interval to retrieve.
  15498. * @returns The interval at the specified index, or <code>undefined</code> if no interval exists as that index.
  15499. */
  15500. get(index: number): TimeInterval | undefined;
  15501. /**
  15502. * Removes all intervals from the collection.
  15503. */
  15504. removeAll(): void;
  15505. /**
  15506. * Finds and returns the interval that contains the specified date.
  15507. * @param date - The date to search for.
  15508. * @returns The interval containing the specified date, <code>undefined</code> if no such interval exists.
  15509. */
  15510. findIntervalContainingDate(date: JulianDate): TimeInterval | undefined;
  15511. /**
  15512. * Finds and returns the data for the interval that contains the specified date.
  15513. * @param date - The date to search for.
  15514. * @returns The data for the interval containing the specified date, or <code>undefined</code> if no such interval exists.
  15515. */
  15516. findDataForIntervalContainingDate(date: JulianDate): any;
  15517. /**
  15518. * Checks if the specified date is inside this collection.
  15519. * @param julianDate - The date to check.
  15520. * @returns <code>true</code> if the collection contains the specified date, <code>false</code> otherwise.
  15521. */
  15522. contains(julianDate: JulianDate): boolean;
  15523. /**
  15524. * Finds and returns the index of the interval in the collection that contains the specified date.
  15525. * @param date - The date to search for.
  15526. * @returns The index of the interval that contains the specified date, if no such interval exists,
  15527. * it returns a negative number which is the bitwise complement of the index of the next interval that
  15528. * starts after the date, or if no interval starts after the specified date, the bitwise complement of
  15529. * the length of the collection.
  15530. */
  15531. indexOf(date: JulianDate): number;
  15532. /**
  15533. * Returns the first interval in the collection that matches the specified parameters.
  15534. * All parameters are optional and <code>undefined</code> parameters are treated as a don't care condition.
  15535. * @param [options] - Object with the following properties:
  15536. * @param [options.start] - The start time of the interval.
  15537. * @param [options.stop] - The stop time of the interval.
  15538. * @param [options.isStartIncluded] - <code>true</code> if <code>options.start</code> is included in the interval, <code>false</code> otherwise.
  15539. * @param [options.isStopIncluded] - <code>true</code> if <code>options.stop</code> is included in the interval, <code>false</code> otherwise.
  15540. * @returns The first interval in the collection that matches the specified parameters.
  15541. */
  15542. findInterval(options?: {
  15543. start?: JulianDate;
  15544. stop?: JulianDate;
  15545. isStartIncluded?: boolean;
  15546. isStopIncluded?: boolean;
  15547. }): TimeInterval | undefined;
  15548. /**
  15549. * Adds an interval to the collection, merging intervals that contain the same data and
  15550. * splitting intervals of different data as needed in order to maintain a non-overlapping collection.
  15551. * The data in the new interval takes precedence over any existing intervals in the collection.
  15552. * @param interval - The interval to add.
  15553. * @param [dataComparer] - A function which compares the data of the two intervals. If omitted, reference equality is used.
  15554. */
  15555. addInterval(interval: TimeInterval, dataComparer?: TimeInterval.DataComparer): void;
  15556. /**
  15557. * Removes the specified interval from this interval collection, creating a hole over the specified interval.
  15558. * The data property of the input interval is ignored.
  15559. * @param interval - The interval to remove.
  15560. * @returns <code>true</code> if the interval was removed, <code>false</code> if no part of the interval was in the collection.
  15561. */
  15562. removeInterval(interval: TimeInterval): boolean;
  15563. /**
  15564. * Creates a new instance that is the intersection of this collection and the provided collection.
  15565. * @param other - The collection to intersect with.
  15566. * @param [dataComparer] - A function which compares the data of the two intervals. If omitted, reference equality is used.
  15567. * @param [mergeCallback] - A function which merges the data of the two intervals. If omitted, the data from the left interval will be used.
  15568. * @returns A new TimeIntervalCollection which is the intersection of this collection and the provided collection.
  15569. */
  15570. intersect(other: TimeIntervalCollection, dataComparer?: TimeInterval.DataComparer, mergeCallback?: TimeInterval.MergeCallback): TimeIntervalCollection;
  15571. /**
  15572. * Creates a new instance from a JulianDate array.
  15573. * @param options - Object with the following properties:
  15574. * @param options.julianDates - An array of ISO 8601 dates.
  15575. * @param [options.isStartIncluded = true] - <code>true</code> if start time is included in the interval, <code>false</code> otherwise.
  15576. * @param [options.isStopIncluded = true] - <code>true</code> if stop time is included in the interval, <code>false</code> otherwise.
  15577. * @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.
  15578. * @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.
  15579. * @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.
  15580. * @param [result] - An existing instance to use for the result.
  15581. * @returns The modified result parameter or a new instance if none was provided.
  15582. */
  15583. fromJulianDateArray(options: {
  15584. julianDates: JulianDate[];
  15585. isStartIncluded?: boolean;
  15586. isStopIncluded?: boolean;
  15587. leadingInterval?: boolean;
  15588. trailingInterval?: boolean;
  15589. dataCallback?: (...params: any[]) => any;
  15590. }, result?: TimeIntervalCollection): TimeIntervalCollection;
  15591. /**
  15592. * Creates a new instance from an {@link http://en.wikipedia.org/wiki/ISO_8601|ISO 8601} time interval (start/end/duration).
  15593. * @param options - Object with the following properties:
  15594. * @param options.iso8601 - An ISO 8601 interval.
  15595. * @param [options.isStartIncluded = true] - <code>true</code> if start time is included in the interval, <code>false</code> otherwise.
  15596. * @param [options.isStopIncluded = true] - <code>true</code> if stop time is included in the interval, <code>false</code> otherwise.
  15597. * @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.
  15598. * @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.
  15599. * @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.
  15600. * @param [result] - An existing instance to use for the result.
  15601. * @returns The modified result parameter or a new instance if none was provided.
  15602. */
  15603. fromIso8601(options: {
  15604. iso8601: string;
  15605. isStartIncluded?: boolean;
  15606. isStopIncluded?: boolean;
  15607. leadingInterval?: boolean;
  15608. trailingInterval?: boolean;
  15609. dataCallback?: (...params: any[]) => any;
  15610. }, result?: TimeIntervalCollection): TimeIntervalCollection;
  15611. /**
  15612. * Creates a new instance from a {@link http://en.wikipedia.org/wiki/ISO_8601|ISO 8601} date array.
  15613. * @param options - Object with the following properties:
  15614. * @param options.iso8601Dates - An array of ISO 8601 dates.
  15615. * @param [options.isStartIncluded = true] - <code>true</code> if start time is included in the interval, <code>false</code> otherwise.
  15616. * @param [options.isStopIncluded = true] - <code>true</code> if stop time is included in the interval, <code>false</code> otherwise.
  15617. * @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.
  15618. * @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.
  15619. * @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.
  15620. * @param [result] - An existing instance to use for the result.
  15621. * @returns The modified result parameter or a new instance if none was provided.
  15622. */
  15623. fromIso8601DateArray(options: {
  15624. iso8601Dates: string[];
  15625. isStartIncluded?: boolean;
  15626. isStopIncluded?: boolean;
  15627. leadingInterval?: boolean;
  15628. trailingInterval?: boolean;
  15629. dataCallback?: (...params: any[]) => any;
  15630. }, result?: TimeIntervalCollection): TimeIntervalCollection;
  15631. /**
  15632. * Creates a new instance from a {@link http://en.wikipedia.org/wiki/ISO_8601|ISO 8601} duration array.
  15633. * @param options - Object with the following properties:
  15634. * @param options.epoch - An date that the durations are relative to.
  15635. * @param options.iso8601Durations - An array of ISO 8601 durations.
  15636. * @param [options.relativeToPrevious = false] - <code>true</code> if durations are relative to previous date, <code>false</code> if always relative to the epoch.
  15637. * @param [options.isStartIncluded = true] - <code>true</code> if start time is included in the interval, <code>false</code> otherwise.
  15638. * @param [options.isStopIncluded = true] - <code>true</code> if stop time is included in the interval, <code>false</code> otherwise.
  15639. * @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.
  15640. * @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.
  15641. * @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.
  15642. * @param [result] - An existing instance to use for the result.
  15643. * @returns The modified result parameter or a new instance if none was provided.
  15644. */
  15645. fromIso8601DurationArray(options: {
  15646. epoch: JulianDate;
  15647. iso8601Durations: string;
  15648. relativeToPrevious?: boolean;
  15649. isStartIncluded?: boolean;
  15650. isStopIncluded?: boolean;
  15651. leadingInterval?: boolean;
  15652. trailingInterval?: boolean;
  15653. dataCallback?: (...params: any[]) => any;
  15654. }, result?: TimeIntervalCollection): TimeIntervalCollection;
  15655. }
  15656. /**
  15657. * Provides the type of time standards which JulianDate can take as input.
  15658. */
  15659. export enum TimeStandard {
  15660. /**
  15661. * Represents the coordinated Universal Time (UTC) time standard.
  15662. *
  15663. * UTC is related to TAI according to the relationship
  15664. * <code>UTC = TAI - deltaT</code> where <code>deltaT</code> is the number of leap
  15665. * seconds which have been introduced as of the time in TAI.
  15666. */
  15667. UTC = 0,
  15668. /**
  15669. * Represents the International Atomic Time (TAI) time standard.
  15670. * TAI is the principal time standard to which the other time standards are related.
  15671. */
  15672. TAI = 1
  15673. }
  15674. /**
  15675. * Contains functions for transforming positions to various reference frames.
  15676. */
  15677. export namespace Transforms {
  15678. /**
  15679. * Generates a function that computes a 4x4 transformation matrix from a reference frame
  15680. * centered at the provided origin to the provided ellipsoid's fixed reference frame.
  15681. * @param firstAxis - name of the first axis of the local reference frame. Must be
  15682. * 'east', 'north', 'up', 'west', 'south' or 'down'.
  15683. * @param secondAxis - name of the second axis of the local reference frame. Must be
  15684. * 'east', 'north', 'up', 'west', 'south' or 'down'.
  15685. * @returns The function that will computes a
  15686. * 4x4 transformation matrix from a reference frame, with first axis and second axis compliant with the parameters,
  15687. */
  15688. function localFrameToFixedFrameGenerator(firstAxis: string, secondAxis: string): Transforms.LocalFrameToFixedFrame;
  15689. /**
  15690. * Computes a 4x4 transformation matrix from a reference frame
  15691. * centered at the provided origin to the provided ellipsoid's fixed reference frame.
  15692. * @param origin - The center point of the local reference frame.
  15693. * @param [ellipsoid = Ellipsoid.WGS84] - The ellipsoid whose fixed frame is used in the transformation.
  15694. * @param [result] - The object onto which to store the result.
  15695. */
  15696. type LocalFrameToFixedFrame = (origin: Cartesian3, ellipsoid?: Ellipsoid, result?: Matrix4) => Matrix4;
  15697. /**
  15698. * Computes a 4x4 transformation matrix from a reference frame with an east-north-up axes
  15699. * centered at the provided origin to the provided ellipsoid's fixed reference frame.
  15700. * The local axes are defined as:
  15701. * <ul>
  15702. * <li>The <code>x</code> axis points in the local east direction.</li>
  15703. * <li>The <code>y</code> axis points in the local north direction.</li>
  15704. * <li>The <code>z</code> axis points in the direction of the ellipsoid surface normal which passes through the position.</li>
  15705. * </ul>
  15706. * @example
  15707. * // Get the transform from local east-north-up at cartographic (0.0, 0.0) to Earth's fixed frame.
  15708. * const center = SuperMap.Cartesian3.fromDegrees(0.0, 0.0);
  15709. * const transform = SuperMap.Transforms.eastNorthUpToFixedFrame(center);
  15710. * @param origin - The center point of the local reference frame.
  15711. * @param [ellipsoid = Ellipsoid.WGS84] - The ellipsoid whose fixed frame is used in the transformation.
  15712. * @param [result] - The object onto which to store the result.
  15713. * @returns The modified result parameter or a new Matrix4 instance if none was provided.
  15714. */
  15715. function eastNorthUpToFixedFrame(origin: Cartesian3, ellipsoid?: Ellipsoid, result?: Matrix4): Matrix4;
  15716. /**
  15717. * Computes a 4x4 transformation matrix from a reference frame with an north-east-down axes
  15718. * centered at the provided origin to the provided ellipsoid's fixed reference frame.
  15719. * The local axes are defined as:
  15720. * <ul>
  15721. * <li>The <code>x</code> axis points in the local north direction.</li>
  15722. * <li>The <code>y</code> axis points in the local east direction.</li>
  15723. * <li>The <code>z</code> axis points in the opposite direction of the ellipsoid surface normal which passes through the position.</li>
  15724. * </ul>
  15725. * @example
  15726. * // Get the transform from local north-east-down at cartographic (0.0, 0.0) to Earth's fixed frame.
  15727. * const center = SuperMap.Cartesian3.fromDegrees(0.0, 0.0);
  15728. * const transform = SuperMap.Transforms.northEastDownToFixedFrame(center);
  15729. * @param origin - The center point of the local reference frame.
  15730. * @param [ellipsoid = Ellipsoid.WGS84] - The ellipsoid whose fixed frame is used in the transformation.
  15731. * @param [result] - The object onto which to store the result.
  15732. * @returns The modified result parameter or a new Matrix4 instance if none was provided.
  15733. */
  15734. function northEastDownToFixedFrame(origin: Cartesian3, ellipsoid?: Ellipsoid, result?: Matrix4): Matrix4;
  15735. /**
  15736. * Computes a 4x4 transformation matrix from a reference frame with an north-up-east axes
  15737. * centered at the provided origin to the provided ellipsoid's fixed reference frame.
  15738. * The local axes are defined as:
  15739. * <ul>
  15740. * <li>The <code>x</code> axis points in the local north direction.</li>
  15741. * <li>The <code>y</code> axis points in the direction of the ellipsoid surface normal which passes through the position.</li>
  15742. * <li>The <code>z</code> axis points in the local east direction.</li>
  15743. * </ul>
  15744. * @example
  15745. * // Get the transform from local north-up-east at cartographic (0.0, 0.0) to Earth's fixed frame.
  15746. * const center = SuperMap.Cartesian3.fromDegrees(0.0, 0.0);
  15747. * const transform = SuperMap.Transforms.northUpEastToFixedFrame(center);
  15748. * @param origin - The center point of the local reference frame.
  15749. * @param [ellipsoid = Ellipsoid.WGS84] - The ellipsoid whose fixed frame is used in the transformation.
  15750. * @param [result] - The object onto which to store the result.
  15751. * @returns The modified result parameter or a new Matrix4 instance if none was provided.
  15752. */
  15753. function northUpEastToFixedFrame(origin: Cartesian3, ellipsoid?: Ellipsoid, result?: Matrix4): Matrix4;
  15754. /**
  15755. * Computes a 4x4 transformation matrix from a reference frame with an north-west-up axes
  15756. * centered at the provided origin to the provided ellipsoid's fixed reference frame.
  15757. * The local axes are defined as:
  15758. * <ul>
  15759. * <li>The <code>x</code> axis points in the local north direction.</li>
  15760. * <li>The <code>y</code> axis points in the local west direction.</li>
  15761. * <li>The <code>z</code> axis points in the direction of the ellipsoid surface normal which passes through the position.</li>
  15762. * </ul>
  15763. * @example
  15764. * // Get the transform from local north-West-Up at cartographic (0.0, 0.0) to Earth's fixed frame.
  15765. * const center = SuperMap.Cartesian3.fromDegrees(0.0, 0.0);
  15766. * const transform = SuperMap.Transforms.northWestUpToFixedFrame(center);
  15767. * @param origin - The center point of the local reference frame.
  15768. * @param [ellipsoid = Ellipsoid.WGS84] - The ellipsoid whose fixed frame is used in the transformation.
  15769. * @param [result] - The object onto which to store the result.
  15770. * @returns The modified result parameter or a new Matrix4 instance if none was provided.
  15771. */
  15772. function northWestUpToFixedFrame(origin: Cartesian3, ellipsoid?: Ellipsoid, result?: Matrix4): Matrix4;
  15773. /**
  15774. * Computes a 4x4 transformation matrix from a reference frame with axes computed from the heading-pitch-roll angles
  15775. * centered at the provided origin to the provided ellipsoid's fixed reference frame. Heading is the rotation from the local north
  15776. * direction where a positive angle is increasing eastward. Pitch is the rotation from the local east-north plane. Positive pitch angles
  15777. * are above the plane. Negative pitch angles are below the plane. Roll is the first rotation applied about the local east axis.
  15778. * @example
  15779. * // Get the transform from local heading-pitch-roll at cartographic (0.0, 0.0) to Earth's fixed frame.
  15780. * const center = SuperMap.Cartesian3.fromDegrees(0.0, 0.0);
  15781. * const heading = -SuperMap.Math.PI_OVER_TWO;
  15782. * const pitch = SuperMap.Math.PI_OVER_FOUR;
  15783. * const roll = 0.0;
  15784. * const hpr = new SuperMap.HeadingPitchRoll(heading, pitch, roll);
  15785. * const transform = SuperMap.Transforms.headingPitchRollToFixedFrame(center, hpr);
  15786. * @param origin - The center point of the local reference frame.
  15787. * @param headingPitchRoll - The heading, pitch, and roll.
  15788. * @param [ellipsoid = Ellipsoid.WGS84] - The ellipsoid whose fixed frame is used in the transformation.
  15789. * @param [fixedFrameTransform = Transforms.eastNorthUpToFixedFrame] - A 4x4 transformation
  15790. * matrix from a reference frame to the provided ellipsoid's fixed reference frame
  15791. * @param [result] - The object onto which to store the result.
  15792. * @returns The modified result parameter or a new Matrix4 instance if none was provided.
  15793. */
  15794. function headingPitchRollToFixedFrame(origin: Cartesian3, headingPitchRoll: HeadingPitchRoll, ellipsoid?: Ellipsoid, fixedFrameTransform?: Transforms.LocalFrameToFixedFrame, result?: Matrix4): Matrix4;
  15795. /**
  15796. * Computes a quaternion from a reference frame with axes computed from the heading-pitch-roll angles
  15797. * centered at the provided origin. Heading is the rotation from the local north
  15798. * direction where a positive angle is increasing eastward. Pitch is the rotation from the local east-north plane. Positive pitch angles
  15799. * are above the plane. Negative pitch angles are below the plane. Roll is the first rotation applied about the local east axis.
  15800. * @example
  15801. * // Get the quaternion from local heading-pitch-roll at cartographic (0.0, 0.0) to Earth's fixed frame.
  15802. * const center = SuperMap.Cartesian3.fromDegrees(0.0, 0.0);
  15803. * const heading = -SuperMap.Math.PI_OVER_TWO;
  15804. * const pitch = SuperMap.Math.PI_OVER_FOUR;
  15805. * const roll = 0.0;
  15806. * const hpr = new HeadingPitchRoll(heading, pitch, roll);
  15807. * const quaternion = SuperMap.Transforms.headingPitchRollQuaternion(center, hpr);
  15808. * @param origin - The center point of the local reference frame.
  15809. * @param headingPitchRoll - The heading, pitch, and roll.
  15810. * @param [ellipsoid = Ellipsoid.WGS84] - The ellipsoid whose fixed frame is used in the transformation.
  15811. * @param [fixedFrameTransform = Transforms.eastNorthUpToFixedFrame] - A 4x4 transformation
  15812. * matrix from a reference frame to the provided ellipsoid's fixed reference frame
  15813. * @param [result] - The object onto which to store the result.
  15814. * @returns The modified result parameter or a new Quaternion instance if none was provided.
  15815. */
  15816. function headingPitchRollQuaternion(origin: Cartesian3, headingPitchRoll: HeadingPitchRoll, ellipsoid?: Ellipsoid, fixedFrameTransform?: Transforms.LocalFrameToFixedFrame, result?: Quaternion): Quaternion;
  15817. /**
  15818. * Computes heading-pitch-roll angles from a transform in a particular reference frame. Heading is the rotation from the local north
  15819. * direction where a positive angle is increasing eastward. Pitch is the rotation from the local east-north plane. Positive pitch angles
  15820. * are above the plane. Negative pitch angles are below the plane. Roll is the first rotation applied about the local east axis.
  15821. * @param transform - The transform
  15822. * @param [ellipsoid = Ellipsoid.WGS84] - The ellipsoid whose fixed frame is used in the transformation.
  15823. * @param [fixedFrameTransform = Transforms.eastNorthUpToFixedFrame] - A 4x4 transformation
  15824. * matrix from a reference frame to the provided ellipsoid's fixed reference frame
  15825. * @param [result] - The object onto which to store the result.
  15826. * @returns The modified result parameter or a new HeadingPitchRoll instance if none was provided.
  15827. */
  15828. function fixedFrameToHeadingPitchRoll(transform: Matrix4, ellipsoid?: Ellipsoid, fixedFrameTransform?: Transforms.LocalFrameToFixedFrame, result?: HeadingPitchRoll): HeadingPitchRoll;
  15829. /**
  15830. * Computes a rotation matrix to transform a point or vector from True Equator Mean Equinox (TEME) axes to the
  15831. * pseudo-fixed axes at a given time. This method treats the UT1 time standard as equivalent to UTC.
  15832. * @example
  15833. * //Set the view to the inertial frame.
  15834. * scene.postUpdate.addEventListener(function(scene, time) {
  15835. * const now = SuperMap.JulianDate.now();
  15836. * const offset = SuperMap.Matrix4.multiplyByPoint(camera.transform, camera.position, new SuperMap.Cartesian3());
  15837. * const transform = SuperMap.Matrix4.fromRotationTranslation(SuperMap.Transforms.computeTemeToPseudoFixedMatrix(now));
  15838. * const inverseTransform = SuperMap.Matrix4.inverseTransformation(transform, new SuperMap.Matrix4());
  15839. * SuperMap.Matrix4.multiplyByPoint(inverseTransform, offset, offset);
  15840. * camera.lookAtTransform(transform, offset);
  15841. * });
  15842. * @param date - The time at which to compute the rotation matrix.
  15843. * @param [result] - The object onto which to store the result.
  15844. * @returns The modified result parameter or a new Matrix3 instance if none was provided.
  15845. */
  15846. function computeTemeToPseudoFixedMatrix(date: JulianDate, result?: Matrix3): Matrix3;
  15847. /**
  15848. * Preloads the data necessary to transform between the ICRF and Fixed axes, in either
  15849. * direction, over a given interval. This function returns a promise that, when resolved,
  15850. * indicates that the preload has completed.
  15851. * @example
  15852. * const interval = new SuperMap.TimeInterval(...);
  15853. * Promise.resolve(SuperMap.Transforms.preloadIcrfFixed(interval)).then(function() {
  15854. * // the data is now loaded
  15855. * });
  15856. * @param timeInterval - The interval to preload.
  15857. * @returns A promise that, when resolved, indicates that the preload has completed
  15858. * and evaluation of the transformation between the fixed and ICRF axes will
  15859. * no longer return undefined for a time inside the interval.
  15860. */
  15861. function preloadIcrfFixed(timeInterval: TimeInterval): Promise<void>;
  15862. /**
  15863. * Computes a rotation matrix to transform a point or vector from the International Celestial
  15864. * Reference Frame (GCRF/ICRF) inertial frame axes to the Earth-Fixed frame axes (ITRF)
  15865. * at a given time. This function may return undefined if the data necessary to
  15866. * do the transformation is not yet loaded.
  15867. * @example
  15868. * scene.postUpdate.addEventListener(function(scene, time) {
  15869. * // View in ICRF.
  15870. * const icrfToFixed = SuperMap.Transforms.computeIcrfToFixedMatrix(time);
  15871. * if (SuperMap.defined(icrfToFixed)) {
  15872. * const offset = SuperMap.Cartesian3.clone(camera.position);
  15873. * const transform = SuperMap.Matrix4.fromRotationTranslation(icrfToFixed);
  15874. * camera.lookAtTransform(transform, offset);
  15875. * }
  15876. * });
  15877. * @param date - The time at which to compute the rotation matrix.
  15878. * @param [result] - The object onto which to store the result. If this parameter is
  15879. * not specified, a new instance is created and returned.
  15880. * @returns The rotation matrix, or undefined if the data necessary to do the
  15881. * transformation is not yet loaded.
  15882. */
  15883. function computeIcrfToFixedMatrix(date: JulianDate, result?: Matrix3): Matrix3;
  15884. /**
  15885. * Computes a rotation matrix to transform a point or vector from the Earth-Fixed frame axes (ITRF)
  15886. * to the International Celestial Reference Frame (GCRF/ICRF) inertial frame axes
  15887. * at a given time. This function may return undefined if the data necessary to
  15888. * do the transformation is not yet loaded.
  15889. * @example
  15890. * // Transform a point from the ICRF axes to the Fixed axes.
  15891. * const now = SuperMap.JulianDate.now();
  15892. * const pointInFixed = SuperMap.Cartesian3.fromDegrees(0.0, 0.0);
  15893. * const fixedToIcrf = SuperMap.Transforms.computeIcrfToFixedMatrix(now);
  15894. * let pointInInertial = new SuperMap.Cartesian3();
  15895. * if (SuperMap.defined(fixedToIcrf)) {
  15896. * pointInInertial = SuperMap.Matrix3.multiplyByVector(fixedToIcrf, pointInFixed, pointInInertial);
  15897. * }
  15898. * @param date - The time at which to compute the rotation matrix.
  15899. * @param [result] - The object onto which to store the result. If this parameter is
  15900. * not specified, a new instance is created and returned.
  15901. * @returns The rotation matrix, or undefined if the data necessary to do the
  15902. * transformation is not yet loaded.
  15903. */
  15904. function computeFixedToIcrfMatrix(date: JulianDate, result?: Matrix3): Matrix3;
  15905. /**
  15906. * Transform a point from model coordinates to window coordinates.
  15907. * @param modelViewProjectionMatrix - The 4x4 model-view-projection matrix.
  15908. * @param viewportTransformation - The 4x4 viewport transformation.
  15909. * @param point - The point to transform.
  15910. * @param [result] - The object onto which to store the result.
  15911. * @returns The modified result parameter or a new Cartesian2 instance if none was provided.
  15912. */
  15913. function pointToWindowCoordinates(modelViewProjectionMatrix: Matrix4, viewportTransformation: Matrix4, point: Cartesian3, result?: Cartesian2): Cartesian2;
  15914. /**
  15915. * Transform a position and velocity to a rotation matrix.
  15916. * @param position - The position to transform.
  15917. * @param velocity - The velocity vector to transform.
  15918. * @param [ellipsoid = Ellipsoid.WGS84] - The ellipsoid whose fixed frame is used in the transformation.
  15919. * @param [result] - The object onto which to store the result.
  15920. * @returns The modified result parameter or a new Matrix3 instance if none was provided.
  15921. */
  15922. function rotationMatrixFromPositionVelocity(position: Cartesian3, velocity: Cartesian3, ellipsoid?: Ellipsoid, result?: Matrix3): Matrix3;
  15923. }
  15924. /**
  15925. * An affine transformation defined by a translation, rotation, and scale.
  15926. * @param [translation = Cartesian3.ZERO] - A {@link Cartesian3} specifying the (x, y, z) translation to apply to the node.
  15927. * @param [rotation = Quaternion.IDENTITY] - A {@link Quaternion} specifying the (x, y, z, w) rotation to apply to the node.
  15928. * @param [scale = new Cartesian3(1.0, 1.0, 1.0)] - A {@link Cartesian3} specifying the (x, y, z) scaling to apply to the node.
  15929. */
  15930. export class TranslationRotationScale {
  15931. constructor(translation?: Cartesian3, rotation?: Quaternion, scale?: Cartesian3);
  15932. /**
  15933. * Gets or sets the (x, y, z) translation to apply to the node.
  15934. */
  15935. translation: Cartesian3;
  15936. /**
  15937. * Gets or sets the (x, y, z, w) rotation to apply to the node.
  15938. */
  15939. rotation: Quaternion;
  15940. /**
  15941. * Gets or sets the (x, y, z) scaling to apply to the node.
  15942. */
  15943. scale: Cartesian3;
  15944. /**
  15945. * Compares this instance against the provided instance and returns
  15946. * <code>true</code> if they are equal, <code>false</code> otherwise.
  15947. * @param [right] - The right hand side TranslationRotationScale.
  15948. * @returns <code>true</code> if they are equal, <code>false</code> otherwise.
  15949. */
  15950. equals(right?: TranslationRotationScale): boolean;
  15951. }
  15952. /**
  15953. * Uses the Tridiagonal Matrix Algorithm, also known as the Thomas Algorithm, to solve
  15954. * a system of linear equations where the coefficient matrix is a tridiagonal matrix.
  15955. */
  15956. export namespace TridiagonalSystemSolver {
  15957. /**
  15958. * Solves a tridiagonal system of linear equations.
  15959. * @example
  15960. * const lowerDiagonal = [1.0, 1.0, 1.0, 1.0];
  15961. * const diagonal = [2.0, 4.0, 4.0, 4.0, 2.0];
  15962. * const upperDiagonal = [1.0, 1.0, 1.0, 1.0];
  15963. * const rightHandSide = [
  15964. * new SuperMap.Cartesian3(410757.0, -1595711.0, 1375302.0),
  15965. * new SuperMap.Cartesian3(-5986705.0, -2190640.0, 1099600.0),
  15966. * new SuperMap.Cartesian3(-12593180.0, 288588.0, -1755549.0),
  15967. * new SuperMap.Cartesian3(-5349898.0, 2457005.0, -2685438.0),
  15968. * new SuperMap.Cartesian3(845820.0, 1573488.0, -1205591.0)
  15969. * ];
  15970. *
  15971. * const solution = SuperMap.TridiagonalSystemSolver.solve(lowerDiagonal, diagonal, upperDiagonal, rightHandSide);
  15972. * @param diagonal - An array with length <code>n</code> that contains the diagonal of the coefficient matrix.
  15973. * @param lower - An array with length <code>n - 1</code> that contains the lower diagonal of the coefficient matrix.
  15974. * @param upper - An array with length <code>n - 1</code> that contains the upper diagonal of the coefficient matrix.
  15975. * @param right - An array of Cartesians with length <code>n</code> that is the right side of the system of equations.
  15976. * @returns An array of Cartesians with length <code>n</code> that is the solution to the tridiagonal system of equations.
  15977. */
  15978. function solve(diagonal: number[], lower: number[], upper: number[], right: Cartesian3[]): Cartesian3[];
  15979. }
  15980. /**
  15981. * A singleton that contains all of the servers that are trusted. Credentials will be sent with
  15982. * any requests to these servers.
  15983. */
  15984. export namespace TrustedServers {
  15985. /**
  15986. * Adds a trusted server to the registry
  15987. * @example
  15988. * // Add a trusted server
  15989. * TrustedServers.add('my.server.com', 80);
  15990. * @param host - The host to be added.
  15991. * @param port - The port used to access the host.
  15992. */
  15993. function add(host: string, port: number): void;
  15994. /**
  15995. * Removes a trusted server from the registry
  15996. * @example
  15997. * // Remove a trusted server
  15998. * TrustedServers.remove('my.server.com', 80);
  15999. * @param host - The host to be removed.
  16000. * @param port - The port used to access the host.
  16001. */
  16002. function remove(host: string, port: number): void;
  16003. /**
  16004. * Tests whether a server is trusted or not. The server must have been added with the port if it is included in the url.
  16005. * @example
  16006. * // Add server
  16007. * TrustedServers.add('my.server.com', 81);
  16008. *
  16009. * // Check if server is trusted
  16010. * if (TrustedServers.contains('https://my.server.com:81/path/to/file.png')) {
  16011. * // my.server.com:81 is trusted
  16012. * }
  16013. * if (TrustedServers.contains('https://my.server.com/path/to/file.png')) {
  16014. * // my.server.com isn't trusted
  16015. * }
  16016. * @param url - The url to be tested against the trusted list
  16017. * @returns Returns true if url is trusted, false otherwise.
  16018. */
  16019. function contains(url: string): boolean;
  16020. /**
  16021. * Clears the registry
  16022. * @example
  16023. * // Remove a trusted server
  16024. * TrustedServers.clear();
  16025. */
  16026. function clear(): void;
  16027. }
  16028. /**
  16029. * A vertex format defines what attributes make up a vertex. A VertexFormat can be provided
  16030. * to a {@link Geometry} to request that certain properties be computed, e.g., just position,
  16031. * position and normal, etc.
  16032. * @example
  16033. * // Create a vertex format with position and 2D texture coordinate attributes.
  16034. * const format = new SuperMap.VertexFormat({
  16035. * position : true,
  16036. * st : true
  16037. * });
  16038. * @param [options] - An object with boolean properties corresponding to VertexFormat properties as shown in the code example.
  16039. */
  16040. export class VertexFormat {
  16041. constructor(options?: any);
  16042. /**
  16043. * When <code>true</code>, the vertex has a 3D position attribute.
  16044. * <p>
  16045. * 64-bit floating-point (for precision). 3 components per attribute.
  16046. * </p>
  16047. */
  16048. position: boolean;
  16049. /**
  16050. * When <code>true</code>, the vertex has a normal attribute (normalized), which is commonly used for lighting.
  16051. * <p>
  16052. * 32-bit floating-point. 3 components per attribute.
  16053. * </p>
  16054. */
  16055. normal: boolean;
  16056. /**
  16057. * When <code>true</code>, the vertex has a 2D texture coordinate attribute.
  16058. * <p>
  16059. * 32-bit floating-point. 2 components per attribute
  16060. * </p>
  16061. */
  16062. st: boolean;
  16063. /**
  16064. * When <code>true</code>, the vertex has a bitangent attribute (normalized), which is used for tangent-space effects like bump mapping.
  16065. * <p>
  16066. * 32-bit floating-point. 3 components per attribute.
  16067. * </p>
  16068. */
  16069. bitangent: boolean;
  16070. /**
  16071. * When <code>true</code>, the vertex has a tangent attribute (normalized), which is used for tangent-space effects like bump mapping.
  16072. * <p>
  16073. * 32-bit floating-point. 3 components per attribute.
  16074. * </p>
  16075. */
  16076. tangent: boolean;
  16077. /**
  16078. * When <code>true</code>, the vertex has an RGB color attribute.
  16079. * <p>
  16080. * 8-bit unsigned byte. 3 components per attribute.
  16081. * </p>
  16082. */
  16083. color: boolean;
  16084. /**
  16085. * An immutable vertex format with only a position attribute.
  16086. */
  16087. readonly POSITION_ONLY: VertexFormat;
  16088. /**
  16089. * An immutable vertex format with position and normal attributes.
  16090. * This is compatible with per-instance color appearances like {@link PerInstanceColorAppearance}.
  16091. */
  16092. readonly POSITION_AND_NORMAL: VertexFormat;
  16093. /**
  16094. * An immutable vertex format with position, normal, and st attributes.
  16095. * This is compatible with {@link MaterialAppearance} when {@link MaterialAppearance#materialSupport}
  16096. * is <code>TEXTURED/code>.
  16097. */
  16098. readonly POSITION_NORMAL_AND_ST: VertexFormat;
  16099. /**
  16100. * An immutable vertex format with position and st attributes.
  16101. * This is compatible with {@link EllipsoidSurfaceAppearance}.
  16102. */
  16103. readonly POSITION_AND_ST: VertexFormat;
  16104. /**
  16105. * An immutable vertex format with position and color attributes.
  16106. */
  16107. readonly POSITION_AND_COLOR: VertexFormat;
  16108. /**
  16109. * An immutable vertex format with well-known attributes: position, normal, st, tangent, and bitangent.
  16110. */
  16111. readonly ALL: VertexFormat;
  16112. /**
  16113. * An immutable vertex format with position, normal, and st attributes.
  16114. * This is compatible with most appearances and materials; however
  16115. * normal and st attributes are not always required. When this is
  16116. * known in advance, another <code>VertexFormat</code> should be used.
  16117. */
  16118. readonly DEFAULT: VertexFormat;
  16119. /**
  16120. * The number of elements used to pack the object into an array.
  16121. */
  16122. packedLength: number;
  16123. /**
  16124. * Stores the provided instance into the provided array.
  16125. * @param value - The value to pack.
  16126. * @param array - The array to pack into.
  16127. * @param [startingIndex = 0] - The index into the array at which to start packing the elements.
  16128. * @returns The array that was packed into
  16129. */
  16130. pack(value: VertexFormat, array: number[], startingIndex?: number): number[];
  16131. /**
  16132. * Retrieves an instance from a packed array.
  16133. * @param array - The packed array.
  16134. * @param [startingIndex = 0] - The starting index of the element to be unpacked.
  16135. * @param [result] - The object into which to store the result.
  16136. * @returns The modified result parameter or a new VertexFormat instance if one was not provided.
  16137. */
  16138. unpack(array: number[], startingIndex?: number, result?: VertexFormat): VertexFormat;
  16139. /**
  16140. * Duplicates a VertexFormat instance.
  16141. * @param vertexFormat - The vertex format to duplicate.
  16142. * @param [result] - The object onto which to store the result.
  16143. * @returns The modified result parameter or a new VertexFormat instance if one was not provided. (Returns undefined if vertexFormat is undefined)
  16144. */
  16145. clone(vertexFormat: VertexFormat, result?: VertexFormat): VertexFormat;
  16146. }
  16147. /**
  16148. * Synchronizes a video element with a simulation clock.
  16149. * @param [options] - Object with the following properties:
  16150. * @param [options.clock] - The clock instance used to drive the video.
  16151. * @param [options.element] - The video element to be synchronized.
  16152. * @param [options.epoch = Iso8601.MINIMUM_VALUE] - The simulation time that marks the start of the video.
  16153. * @param [options.tolerance = 1.0] - The maximum amount of time, in seconds, that the clock and video can diverge.
  16154. */
  16155. export class VideoSynchronizer {
  16156. constructor(options?: {
  16157. clock?: Clock;
  16158. element?: HTMLVideoElement;
  16159. epoch?: JulianDate;
  16160. tolerance?: number;
  16161. });
  16162. /**
  16163. * Gets or sets the simulation time that marks the start of the video.
  16164. */
  16165. epoch: JulianDate;
  16166. /**
  16167. * Gets or sets the amount of time in seconds the video's currentTime
  16168. * and the clock's currentTime can diverge before a video seek is performed.
  16169. * Lower values make the synchronization more accurate but video
  16170. * performance might suffer. Higher values provide better performance
  16171. * but at the cost of accuracy.
  16172. */
  16173. tolerance: number;
  16174. /**
  16175. * Gets or sets the clock used to drive the video element.
  16176. */
  16177. clock: Clock;
  16178. /**
  16179. * Gets or sets the video element to synchronize.
  16180. */
  16181. element: HTMLVideoElement;
  16182. /**
  16183. * Destroys and resources used by the object. Once an object is destroyed, it should not be used.
  16184. */
  16185. destroy(): void;
  16186. /**
  16187. * Returns true if this object was destroyed; otherwise, false.
  16188. * @returns True if this object was destroyed; otherwise, false.
  16189. */
  16190. isDestroyed(): boolean;
  16191. }
  16192. /**
  16193. * This enumerated type is used in determining to what extent an object, the occludee,
  16194. * is visible during horizon culling. An occluder may fully block an occludee, in which case
  16195. * it has no visibility, may partially block an occludee from view, or may not block it at all,
  16196. * leading to full visibility.
  16197. */
  16198. export enum Visibility {
  16199. /**
  16200. * Represents that no part of an object is visible.
  16201. */
  16202. NONE = -1,
  16203. /**
  16204. * Represents that part, but not all, of an object is visible
  16205. */
  16206. PARTIAL = 0,
  16207. /**
  16208. * Represents that an object is visible in its entirety.
  16209. */
  16210. FULL = 1
  16211. }
  16212. /**
  16213. * A description of a wall, which is similar to a KML line string. A wall is defined by a series of points,
  16214. * which extrude down to the ground. Optionally, they can extrude downwards to a specified height.
  16215. * @example
  16216. * // create a wall that spans from ground level to 10000 meters
  16217. * const wall = new SuperMap.WallGeometry({
  16218. * positions : SuperMap.Cartesian3.fromDegreesArrayHeights([
  16219. * 19.0, 47.0, 10000.0,
  16220. * 19.0, 48.0, 10000.0,
  16221. * 20.0, 48.0, 10000.0,
  16222. * 20.0, 47.0, 10000.0,
  16223. * 19.0, 47.0, 10000.0
  16224. * ])
  16225. * });
  16226. * const geometry = SuperMap.WallGeometry.createGeometry(wall);
  16227. * @param options - Object with the following properties:
  16228. * @param options.positions - An array of Cartesian objects, which are the points of the wall.
  16229. * @param [options.granularity = Math.RADIANS_PER_DEGREE] - The distance, in radians, between each latitude and longitude. Determines the number of positions in the buffer.
  16230. * @param [options.maximumHeights] - An array parallel to <code>positions</code> that give the maximum height of the
  16231. * wall at <code>positions</code>. If undefined, the height of each position in used.
  16232. * @param [options.minimumHeights] - An array parallel to <code>positions</code> that give the minimum height of the
  16233. * wall at <code>positions</code>. If undefined, the height at each position is 0.0.
  16234. * @param [options.ellipsoid = Ellipsoid.WGS84] - The ellipsoid for coordinate manipulation
  16235. * @param [options.vertexFormat = VertexFormat.DEFAULT] - The vertex attributes to be computed.
  16236. */
  16237. export class WallGeometry {
  16238. constructor(options: {
  16239. positions: Cartesian3[];
  16240. granularity?: number;
  16241. maximumHeights?: number[];
  16242. minimumHeights?: number[];
  16243. ellipsoid?: Ellipsoid;
  16244. vertexFormat?: VertexFormat;
  16245. });
  16246. /**
  16247. * The number of elements used to pack the object into an array.
  16248. */
  16249. packedLength: number;
  16250. /**
  16251. * Stores the provided instance into the provided array.
  16252. * @param value - The value to pack.
  16253. * @param array - The array to pack into.
  16254. * @param [startingIndex = 0] - The index into the array at which to start packing the elements.
  16255. * @returns The array that was packed into
  16256. */
  16257. pack(value: WallGeometry, array: number[], startingIndex?: number): number[];
  16258. /**
  16259. * Retrieves an instance from a packed array.
  16260. * @param array - The packed array.
  16261. * @param [startingIndex = 0] - The starting index of the element to be unpacked.
  16262. * @param [result] - The object into which to store the result.
  16263. * @returns The modified result parameter or a new WallGeometry instance if one was not provided.
  16264. */
  16265. unpack(array: number[], startingIndex?: number, result?: WallGeometry): WallGeometry;
  16266. /**
  16267. * A description of a wall, which is similar to a KML line string. A wall is defined by a series of points,
  16268. * which extrude down to the ground. Optionally, they can extrude downwards to a specified height.
  16269. * @example
  16270. * // create a wall that spans from 10000 meters to 20000 meters
  16271. * const wall = SuperMap.WallGeometry.fromConstantHeights({
  16272. * positions : SuperMap.Cartesian3.fromDegreesArray([
  16273. * 19.0, 47.0,
  16274. * 19.0, 48.0,
  16275. * 20.0, 48.0,
  16276. * 20.0, 47.0,
  16277. * 19.0, 47.0,
  16278. * ]),
  16279. * minimumHeight : 20000.0,
  16280. * maximumHeight : 10000.0
  16281. * });
  16282. * const geometry = SuperMap.WallGeometry.createGeometry(wall);
  16283. * @param options - Object with the following properties:
  16284. * @param options.positions - An array of Cartesian objects, which are the points of the wall.
  16285. * @param [options.maximumHeight] - A constant that defines the maximum height of the
  16286. * wall at <code>positions</code>. If undefined, the height of each position in used.
  16287. * @param [options.minimumHeight] - A constant that defines the minimum height of the
  16288. * wall at <code>positions</code>. If undefined, the height at each position is 0.0.
  16289. * @param [options.ellipsoid = Ellipsoid.WGS84] - The ellipsoid for coordinate manipulation
  16290. * @param [options.vertexFormat = VertexFormat.DEFAULT] - The vertex attributes to be computed.
  16291. */
  16292. fromConstantHeights(options: {
  16293. positions: Cartesian3[];
  16294. maximumHeight?: number;
  16295. minimumHeight?: number;
  16296. ellipsoid?: Ellipsoid;
  16297. vertexFormat?: VertexFormat;
  16298. }): WallGeometry;
  16299. /**
  16300. * Computes the geometric representation of a wall, including its vertices, indices, and a bounding sphere.
  16301. * @param wallGeometry - A description of the wall.
  16302. * @returns The computed vertices and indices.
  16303. */
  16304. createGeometry(wallGeometry: WallGeometry): Geometry | undefined;
  16305. }
  16306. /**
  16307. * A description of a wall outline. A wall is defined by a series of points,
  16308. * which extrude down to the ground. Optionally, they can extrude downwards to a specified height.
  16309. * @example
  16310. * // create a wall outline that spans from ground level to 10000 meters
  16311. * const wall = new SuperMap.WallOutlineGeometry({
  16312. * positions : SuperMap.Cartesian3.fromDegreesArrayHeights([
  16313. * 19.0, 47.0, 10000.0,
  16314. * 19.0, 48.0, 10000.0,
  16315. * 20.0, 48.0, 10000.0,
  16316. * 20.0, 47.0, 10000.0,
  16317. * 19.0, 47.0, 10000.0
  16318. * ])
  16319. * });
  16320. * const geometry = SuperMap.WallOutlineGeometry.createGeometry(wall);
  16321. * @param options - Object with the following properties:
  16322. * @param options.positions - An array of Cartesian objects, which are the points of the wall.
  16323. * @param [options.granularity = Math.RADIANS_PER_DEGREE] - The distance, in radians, between each latitude and longitude. Determines the number of positions in the buffer.
  16324. * @param [options.maximumHeights] - An array parallel to <code>positions</code> that give the maximum height of the
  16325. * wall at <code>positions</code>. If undefined, the height of each position in used.
  16326. * @param [options.minimumHeights] - An array parallel to <code>positions</code> that give the minimum height of the
  16327. * wall at <code>positions</code>. If undefined, the height at each position is 0.0.
  16328. * @param [options.ellipsoid = Ellipsoid.WGS84] - The ellipsoid for coordinate manipulation
  16329. */
  16330. export class WallOutlineGeometry {
  16331. constructor(options: {
  16332. positions: Cartesian3[];
  16333. granularity?: number;
  16334. maximumHeights?: number[];
  16335. minimumHeights?: number[];
  16336. ellipsoid?: Ellipsoid;
  16337. });
  16338. /**
  16339. * The number of elements used to pack the object into an array.
  16340. */
  16341. packedLength: number;
  16342. /**
  16343. * Stores the provided instance into the provided array.
  16344. * @param value - The value to pack.
  16345. * @param array - The array to pack into.
  16346. * @param [startingIndex = 0] - The index into the array at which to start packing the elements.
  16347. * @returns The array that was packed into
  16348. */
  16349. pack(value: WallOutlineGeometry, array: number[], startingIndex?: number): number[];
  16350. /**
  16351. * Retrieves an instance from a packed array.
  16352. * @param array - The packed array.
  16353. * @param [startingIndex = 0] - The starting index of the element to be unpacked.
  16354. * @param [result] - The object into which to store the result.
  16355. * @returns The modified result parameter or a new WallOutlineGeometry instance if one was not provided.
  16356. */
  16357. unpack(array: number[], startingIndex?: number, result?: WallOutlineGeometry): WallOutlineGeometry;
  16358. /**
  16359. * A description of a walloutline. A wall is defined by a series of points,
  16360. * which extrude down to the ground. Optionally, they can extrude downwards to a specified height.
  16361. * @example
  16362. * // create a wall that spans from 10000 meters to 20000 meters
  16363. * const wall = SuperMap.WallOutlineGeometry.fromConstantHeights({
  16364. * positions : SuperMap.Cartesian3.fromDegreesArray([
  16365. * 19.0, 47.0,
  16366. * 19.0, 48.0,
  16367. * 20.0, 48.0,
  16368. * 20.0, 47.0,
  16369. * 19.0, 47.0,
  16370. * ]),
  16371. * minimumHeight : 20000.0,
  16372. * maximumHeight : 10000.0
  16373. * });
  16374. * const geometry = SuperMap.WallOutlineGeometry.createGeometry(wall);
  16375. * @param options - Object with the following properties:
  16376. * @param options.positions - An array of Cartesian objects, which are the points of the wall.
  16377. * @param [options.maximumHeight] - A constant that defines the maximum height of the
  16378. * wall at <code>positions</code>. If undefined, the height of each position in used.
  16379. * @param [options.minimumHeight] - A constant that defines the minimum height of the
  16380. * wall at <code>positions</code>. If undefined, the height at each position is 0.0.
  16381. * @param [options.ellipsoid = Ellipsoid.WGS84] - The ellipsoid for coordinate manipulation
  16382. */
  16383. fromConstantHeights(options: {
  16384. positions: Cartesian3[];
  16385. maximumHeight?: number;
  16386. minimumHeight?: number;
  16387. ellipsoid?: Ellipsoid;
  16388. }): WallOutlineGeometry;
  16389. /**
  16390. * Computes the geometric representation of a wall outline, including its vertices, indices, and a bounding sphere.
  16391. * @param wallGeometry - A description of the wall outline.
  16392. * @returns The computed vertices and indices.
  16393. */
  16394. createGeometry(wallGeometry: WallOutlineGeometry): Geometry | undefined;
  16395. }
  16396. /**
  16397. * The map projection used by Google Maps, Bing Maps, and most of ArcGIS Online, EPSG:3857. This
  16398. * projection use longitude and latitude expressed with the WGS84 and transforms them to Mercator using
  16399. * the spherical (rather than ellipsoidal) equations.
  16400. * @param [ellipsoid = Ellipsoid.WGS84] - The ellipsoid.
  16401. */
  16402. export class WebMercatorProjection {
  16403. constructor(ellipsoid?: Ellipsoid);
  16404. /**
  16405. * Gets the {@link Ellipsoid}.
  16406. */
  16407. readonly ellipsoid: Ellipsoid;
  16408. /**
  16409. * Converts a Mercator angle, in the range -PI to PI, to a geodetic latitude
  16410. * in the range -PI/2 to PI/2.
  16411. * @param mercatorAngle - The angle to convert.
  16412. * @returns The geodetic latitude in radians.
  16413. */
  16414. mercatorAngleToGeodeticLatitude(mercatorAngle: number): number;
  16415. /**
  16416. * Converts a geodetic latitude in radians, in the range -PI/2 to PI/2, to a Mercator
  16417. * angle in the range -PI to PI.
  16418. * @param latitude - The geodetic latitude in radians.
  16419. * @returns The Mercator angle.
  16420. */
  16421. geodeticLatitudeToMercatorAngle(latitude: number): number;
  16422. /**
  16423. * The maximum latitude (both North and South) supported by a Web Mercator
  16424. * (EPSG:3857) projection. Technically, the Mercator projection is defined
  16425. * for any latitude up to (but not including) 90 degrees, but it makes sense
  16426. * to cut it off sooner because it grows exponentially with increasing latitude.
  16427. * The logic behind this particular cutoff value, which is the one used by
  16428. * Google Maps, Bing Maps, and Esri, is that it makes the projection
  16429. * square. That is, the rectangle is equal in the X and Y directions.
  16430. *
  16431. * The constant value is computed by calling:
  16432. * WebMercatorProjection.mercatorAngleToGeodeticLatitude(Math.PI)
  16433. */
  16434. MaximumLatitude: number;
  16435. /**
  16436. * Converts geodetic ellipsoid coordinates, in radians, to the equivalent Web Mercator
  16437. * X, Y, Z coordinates expressed in meters and returned in a {@link Cartesian3}. The height
  16438. * is copied unmodified to the Z coordinate.
  16439. * @param cartographic - The cartographic coordinates in radians.
  16440. * @param [result] - The instance to which to copy the result, or undefined if a
  16441. * new instance should be created.
  16442. * @returns The equivalent web mercator X, Y, Z coordinates, in meters.
  16443. */
  16444. project(cartographic: Cartographic, result?: Cartesian3): Cartesian3;
  16445. /**
  16446. * Converts Web Mercator X, Y coordinates, expressed in meters, to a {@link Cartographic}
  16447. * containing geodetic ellipsoid coordinates. The Z coordinate is copied unmodified to the
  16448. * height.
  16449. * @param cartesian - The web mercator Cartesian position to unrproject with height (z) in meters.
  16450. * @param [result] - The instance to which to copy the result, or undefined if a
  16451. * new instance should be created.
  16452. * @returns The equivalent cartographic coordinates.
  16453. */
  16454. unproject(cartesian: Cartesian3, result?: Cartographic): Cartographic;
  16455. }
  16456. /**
  16457. * A tiling scheme for geometry referenced to a {@link WebMercatorProjection}, EPSG:3857. This is
  16458. * the tiling scheme used by Google Maps, Microsoft Bing Maps, and most of ESRI ArcGIS Online.
  16459. * @param [options] - Object with the following properties:
  16460. * @param [options.ellipsoid = Ellipsoid.WGS84] - The ellipsoid whose surface is being tiled. Defaults to
  16461. * the WGS84 ellipsoid.
  16462. * @param [options.numberOfLevelZeroTilesX = 1] - The number of tiles in the X direction at level zero of
  16463. * the tile tree.
  16464. * @param [options.numberOfLevelZeroTilesY = 1] - The number of tiles in the Y direction at level zero of
  16465. * the tile tree.
  16466. * @param [options.rectangleSouthwestInMeters] - The southwest corner of the rectangle covered by the
  16467. * tiling scheme, in meters. If this parameter or rectangleNortheastInMeters is not specified, the entire
  16468. * globe is covered in the longitude direction and an equal distance is covered in the latitude
  16469. * direction, resulting in a square projection.
  16470. * @param [options.rectangleNortheastInMeters] - The northeast corner of the rectangle covered by the
  16471. * tiling scheme, in meters. If this parameter or rectangleSouthwestInMeters is not specified, the entire
  16472. * globe is covered in the longitude direction and an equal distance is covered in the latitude
  16473. * direction, resulting in a square projection.
  16474. */
  16475. export class WebMercatorTilingScheme {
  16476. constructor(options?: {
  16477. ellipsoid?: Ellipsoid;
  16478. numberOfLevelZeroTilesX?: number;
  16479. numberOfLevelZeroTilesY?: number;
  16480. rectangleSouthwestInMeters?: Cartesian2;
  16481. rectangleNortheastInMeters?: Cartesian2;
  16482. });
  16483. /**
  16484. * Gets the ellipsoid that is tiled by this tiling scheme.
  16485. */
  16486. ellipsoid: Ellipsoid;
  16487. /**
  16488. * Gets the rectangle, in radians, covered by this tiling scheme.
  16489. */
  16490. rectangle: Rectangle;
  16491. /**
  16492. * Gets the map projection used by this tiling scheme.
  16493. */
  16494. projection: MapProjection;
  16495. /**
  16496. * Gets the total number of tiles in the X direction at a specified level-of-detail.
  16497. * @param level - The level-of-detail.
  16498. * @returns The number of tiles in the X direction at the given level.
  16499. */
  16500. getNumberOfXTilesAtLevel(level: number): number;
  16501. /**
  16502. * Gets the total number of tiles in the Y direction at a specified level-of-detail.
  16503. * @param level - The level-of-detail.
  16504. * @returns The number of tiles in the Y direction at the given level.
  16505. */
  16506. getNumberOfYTilesAtLevel(level: number): number;
  16507. /**
  16508. * Transforms a rectangle specified in geodetic radians to the native coordinate system
  16509. * of this tiling scheme.
  16510. * @param rectangle - The rectangle to transform.
  16511. * @param [result] - The instance to which to copy the result, or undefined if a new instance
  16512. * should be created.
  16513. * @returns The specified 'result', or a new object containing the native rectangle if 'result'
  16514. * is undefined.
  16515. */
  16516. rectangleToNativeRectangle(rectangle: Rectangle, result?: Rectangle): Rectangle;
  16517. /**
  16518. * Converts tile x, y coordinates and level to a rectangle expressed in the native coordinates
  16519. * of the tiling scheme.
  16520. * @param x - The integer x coordinate of the tile.
  16521. * @param y - The integer y coordinate of the tile.
  16522. * @param level - The tile level-of-detail. Zero is the least detailed.
  16523. * @param [result] - The instance to which to copy the result, or undefined if a new instance
  16524. * should be created.
  16525. * @returns The specified 'result', or a new object containing the rectangle
  16526. * if 'result' is undefined.
  16527. */
  16528. tileXYToNativeRectangle(x: number, y: number, level: number, result?: any): Rectangle;
  16529. /**
  16530. * Converts tile x, y coordinates and level to a cartographic rectangle in radians.
  16531. * @param x - The integer x coordinate of the tile.
  16532. * @param y - The integer y coordinate of the tile.
  16533. * @param level - The tile level-of-detail. Zero is the least detailed.
  16534. * @param [result] - The instance to which to copy the result, or undefined if a new instance
  16535. * should be created.
  16536. * @returns The specified 'result', or a new object containing the rectangle
  16537. * if 'result' is undefined.
  16538. */
  16539. tileXYToRectangle(x: number, y: number, level: number, result?: any): Rectangle;
  16540. /**
  16541. * Calculates the tile x, y coordinates of the tile containing
  16542. * a given cartographic position.
  16543. * @param position - The position.
  16544. * @param level - The tile level-of-detail. Zero is the least detailed.
  16545. * @param [result] - The instance to which to copy the result, or undefined if a new instance
  16546. * should be created.
  16547. * @returns The specified 'result', or a new object containing the tile x, y coordinates
  16548. * if 'result' is undefined.
  16549. */
  16550. positionToTileXY(position: Cartographic, level: number, result?: Cartesian2): Cartesian2;
  16551. }
  16552. /**
  16553. * Winding order defines the order of vertices for a triangle to be considered front-facing.
  16554. */
  16555. export enum WindingOrder {
  16556. /**
  16557. * Vertices are in clockwise order.
  16558. */
  16559. CLOCKWISE = WebGLConstants.CW,
  16560. /**
  16561. * Vertices are in counter-clockwise order.
  16562. */
  16563. COUNTER_CLOCKWISE = WebGLConstants.CCW
  16564. }
  16565. /**
  16566. * Computes the barycentric coordinates for a point with respect to a triangle.
  16567. * @example
  16568. * // Returns Cartesian3.UNIT_X
  16569. * const p = new SuperMap.Cartesian3(-1.0, 0.0, 0.0);
  16570. * const b = SuperMap.barycentricCoordinates(p,
  16571. * new SuperMap.Cartesian3(-1.0, 0.0, 0.0),
  16572. * new SuperMap.Cartesian3( 1.0, 0.0, 0.0),
  16573. * new SuperMap.Cartesian3( 0.0, 1.0, 1.0));
  16574. * @param point - The point to test.
  16575. * @param p0 - The first point of the triangle, corresponding to the barycentric x-axis.
  16576. * @param p1 - The second point of the triangle, corresponding to the barycentric y-axis.
  16577. * @param p2 - The third point of the triangle, corresponding to the barycentric z-axis.
  16578. * @param [result] - The object onto which to store the result.
  16579. * @returns The modified result parameter or a new Cartesian3 instance if one was not provided. If the triangle is degenerate the function will return undefined.
  16580. */
  16581. export function barycentricCoordinates(point: Cartesian2 | Cartesian3, p0: Cartesian2 | Cartesian3, p1: Cartesian2 | Cartesian3, p2: Cartesian2 | Cartesian3, result?: Cartesian3): Cartesian3 | undefined;
  16582. /**
  16583. * Finds an item in a sorted array.
  16584. * @example
  16585. * // Create a comparator function to search through an array of numbers.
  16586. * function comparator(a, b) {
  16587. * return a - b;
  16588. * };
  16589. * const numbers = [0, 2, 4, 6, 8];
  16590. * const index = SuperMap.binarySearch(numbers, 6, comparator); // 3
  16591. * @param array - The sorted array to search.
  16592. * @param itemToFind - The item to find in the array.
  16593. * @param comparator - The function to use to compare the item to
  16594. * elements in the array.
  16595. * @returns The index of <code>itemToFind</code> in the array, if it exists. If <code>itemToFind</code>
  16596. * does not exist, the return value is a negative number which is the bitwise complement (~)
  16597. * of the index before which the itemToFind should be inserted in order to maintain the
  16598. * sorted order of the array.
  16599. */
  16600. export function binarySearch(array: any[], itemToFind: any, comparator: binarySearchComparator): number;
  16601. /**
  16602. * A function used to compare two items while performing a binary search.
  16603. * @example
  16604. * function compareNumbers(a, b) {
  16605. * return a - b;
  16606. * }
  16607. * @param a - An item in the array.
  16608. * @param b - The item being searched for.
  16609. */
  16610. export type binarySearchComparator = (a: any, b: any) => number;
  16611. /**
  16612. * Given a relative URL under the SuperMap base URL, returns an absolute URL.
  16613. * @example
  16614. * const viewer = new SuperMap.Viewer("CesiumContainer", {
  16615. * imageryProvider: new SuperMap.TileMapServiceImageryProvider({
  16616. * url: SuperMap.buildModuleUrl("Assets/Textures/NaturalEarthII"),
  16617. * }),
  16618. * baseLayerPicker: false,
  16619. * });
  16620. * @param relativeUrl - The relative path.
  16621. * @returns The absolutely URL representation of the provided path.
  16622. */
  16623. export function buildModuleUrl(relativeUrl: string): string;
  16624. /**
  16625. * A browser-independent function to cancel an animation frame requested using {@link requestAnimationFrame}.
  16626. * @param requestID - The value returned by {@link requestAnimationFrame}.
  16627. */
  16628. export function cancelAnimationFrame(requestID: number): void;
  16629. /**
  16630. * Clones an object, returning a new object containing the same properties.
  16631. * @param object - The object to clone.
  16632. * @param [deep = false] - If true, all properties will be deep cloned recursively.
  16633. * @returns The cloned object.
  16634. */
  16635. export function clone(object: any, deep?: boolean): any;
  16636. /**
  16637. * Merges two objects, copying their properties onto a new combined object. When two objects have the same
  16638. * property, the value of the property on the first object is used. If either object is undefined,
  16639. * it will be treated as an empty object.
  16640. * @example
  16641. * const object1 = {
  16642. * propOne : 1,
  16643. * propTwo : {
  16644. * value1 : 10
  16645. * }
  16646. * }
  16647. * const object2 = {
  16648. * propTwo : 2
  16649. * }
  16650. * const final = SuperMap.combine(object1, object2);
  16651. *
  16652. * // final === {
  16653. * // propOne : 1,
  16654. * // propTwo : {
  16655. * // value1 : 10
  16656. * // }
  16657. * // }
  16658. * @param [object1] - The first object to merge.
  16659. * @param [object2] - The second object to merge.
  16660. * @param [deep = false] - Perform a recursive merge.
  16661. * @returns The combined object containing all properties from both objects.
  16662. */
  16663. export function combine(object1?: any, object2?: any, deep?: boolean): any;
  16664. /**
  16665. * Creates a Globally unique identifier (GUID) string. A GUID is 128 bits long, and can guarantee uniqueness across space and time.
  16666. * @example
  16667. * this.guid = SuperMap.createGuid();
  16668. */
  16669. export function createGuid(): string;
  16670. /**
  16671. * Returns the first parameter if not undefined, otherwise the second parameter.
  16672. * Useful for setting a default value for a parameter.
  16673. * @example
  16674. * param = SuperMap.defaultValue(param, 'default');
  16675. * @returns Returns the first parameter if not undefined, otherwise the second parameter.
  16676. */
  16677. export function defaultValue(a: any, b: any): any;
  16678. /**
  16679. * @example
  16680. * if (SuperMap.defined(positions)) {
  16681. * doSomething();
  16682. * } else {
  16683. * doSomethingElse();
  16684. * }
  16685. * @param value - The object.
  16686. * @returns Returns true if the object is defined, returns false otherwise.
  16687. */
  16688. export function defined(value: any): boolean;
  16689. /**
  16690. * Destroys an object. Each of the object's functions, including functions in its prototype,
  16691. * is replaced with a function that throws a {@link DeveloperError}, except for the object's
  16692. * <code>isDestroyed</code> function, which is set to a function that returns <code>true</code>.
  16693. * The object's properties are removed with <code>delete</code>.
  16694. * <br /><br />
  16695. * This function is used by objects that hold native resources, e.g., WebGL resources, which
  16696. * need to be explicitly released. Client code calls an object's <code>destroy</code> function,
  16697. * which then releases the native resource and calls <code>destroyObject</code> to put itself
  16698. * in a destroyed state.
  16699. * @example
  16700. * // How a texture would destroy itself.
  16701. * this.destroy = function () {
  16702. * _gl.deleteTexture(_texture);
  16703. * return SuperMap.destroyObject(this);
  16704. * };
  16705. * @param object - The object to destroy.
  16706. * @param [message] - The message to include in the exception that is thrown if
  16707. * a destroyed object's function is called.
  16708. */
  16709. export function destroyObject(object: any, message?: string): void;
  16710. /**
  16711. * Formats an error object into a String. If available, uses name, message, and stack
  16712. * properties, otherwise, falls back on toString().
  16713. * @param object - The item to find in the array.
  16714. * @returns A string containing the formatted error.
  16715. */
  16716. export function formatError(object: any): string;
  16717. /**
  16718. * Given a relative Uri and a base Uri, returns the absolute Uri of the relative Uri.
  16719. * @example
  16720. * //absolute Uri will be "https://test.com/awesome.png";
  16721. * const absoluteUri = SuperMap.getAbsoluteUri('awesome.png', 'https://test.com');
  16722. * @param relative - The relative Uri.
  16723. * @param [base] - The base Uri.
  16724. * @returns The absolute Uri of the given relative Uri.
  16725. */
  16726. export function getAbsoluteUri(relative: string, base?: string): string;
  16727. /**
  16728. * Given a URI, returns the base path of the URI.
  16729. * @example
  16730. * // basePath will be "/Gallery/";
  16731. * const basePath = SuperMap.getBaseUri('/Gallery/simple.czml?value=true&example=false');
  16732. *
  16733. * // basePath will be "/Gallery/?value=true&example=false";
  16734. * const basePath = SuperMap.getBaseUri('/Gallery/simple.czml?value=true&example=false', true);
  16735. * @param uri - The Uri.
  16736. * @param [includeQuery = false] - Whether or not to include the query string and fragment form the uri
  16737. * @returns The base path of the Uri.
  16738. */
  16739. export function getBaseUri(uri: string, includeQuery?: boolean): string;
  16740. /**
  16741. * Given a URI, returns the extension of the URI.
  16742. * @example
  16743. * //extension will be "czml";
  16744. * const extension = SuperMap.getExtensionFromUri('/Gallery/simple.czml?value=true&example=false');
  16745. * @param uri - The Uri.
  16746. * @returns The extension of the Uri.
  16747. */
  16748. export function getExtensionFromUri(uri: string): string;
  16749. /**
  16750. * Given a URI, returns the last segment of the URI, removing any path or query information.
  16751. * @example
  16752. * //fileName will be"simple.czml";
  16753. * const fileName = SuperMap.getFilenameFromUri('/Gallery/simple.czml?value=true&example=false');
  16754. * @param uri - The Uri.
  16755. * @returns The last segment of the Uri.
  16756. */
  16757. export function getFilenameFromUri(uri: string): string;
  16758. /**
  16759. * Extract a pixel array from a loaded image. Draws the image
  16760. * into a canvas so it can read the pixels back.
  16761. * @param image - The image to extract pixels from.
  16762. * @param width - The width of the image. If not defined, then image.width is assigned.
  16763. * @param height - The height of the image. If not defined, then image.height is assigned.
  16764. * @returns The pixels of the image.
  16765. */
  16766. export function getImagePixels(image: HTMLImageElement | ImageBitmap, width: number, height: number): ImageData;
  16767. /**
  16768. * Gets a timestamp that can be used in measuring the time between events. Timestamps
  16769. * are expressed in milliseconds, but it is not specified what the milliseconds are
  16770. * measured from. This function uses performance.now() if it is available, or Date.now()
  16771. * otherwise.
  16772. * @returns The timestamp in milliseconds since some unspecified reference time.
  16773. */
  16774. export function getTimestamp(): number;
  16775. /**
  16776. * Determines if a given date is a leap year.
  16777. * @example
  16778. * const leapYear = SuperMap.isLeapYear(2000); // true
  16779. * @param year - The year to be tested.
  16780. * @returns True if <code>year</code> is a leap year.
  16781. */
  16782. export function isLeapYear(year: number): boolean;
  16783. /**
  16784. * A stable merge sort.
  16785. * @example
  16786. * // Assume array contains BoundingSpheres in world coordinates.
  16787. * // Sort them in ascending order of distance from the camera.
  16788. * const position = camera.positionWC;
  16789. * SuperMap.mergeSort(array, function(a, b, position) {
  16790. * return SuperMap.BoundingSphere.distanceSquaredTo(b, position) - SuperMap.BoundingSphere.distanceSquaredTo(a, position);
  16791. * }, position);
  16792. * @param array - The array to sort.
  16793. * @param comparator - The function to use to compare elements in the array.
  16794. * @param [userDefinedObject] - Any item to pass as the third parameter to <code>comparator</code>.
  16795. */
  16796. export function mergeSort(array: any[], comparator: mergeSortComparator, userDefinedObject?: any): void;
  16797. /**
  16798. * Converts an object representing a set of name/value pairs into a query string,
  16799. * with names and values encoded properly for use in a URL. Values that are arrays
  16800. * will produce multiple values with the same name.
  16801. * @example
  16802. * const str = SuperMap.objectToQuery({
  16803. * key1 : 'some value',
  16804. * key2 : 'a/b',
  16805. * key3 : ['x', 'y']
  16806. * });
  16807. * @param obj - The object containing data to encode.
  16808. * @returns An encoded query string.
  16809. */
  16810. export function objectToQuery(obj: any): string;
  16811. /**
  16812. * Determines if a point is inside a triangle.
  16813. * @example
  16814. * // Returns true
  16815. * const p = new SuperMap.Cartesian2(0.25, 0.25);
  16816. * const b = SuperMap.pointInsideTriangle(p,
  16817. * new SuperMap.Cartesian2(0.0, 0.0),
  16818. * new SuperMap.Cartesian2(1.0, 0.0),
  16819. * new SuperMap.Cartesian2(0.0, 1.0));
  16820. * @param point - The point to test.
  16821. * @param p0 - The first point of the triangle.
  16822. * @param p1 - The second point of the triangle.
  16823. * @param p2 - The third point of the triangle.
  16824. * @returns <code>true</code> if the point is inside the triangle; otherwise, <code>false</code>.
  16825. */
  16826. export function pointInsideTriangle(point: Cartesian2 | Cartesian3, p0: Cartesian2 | Cartesian3, p1: Cartesian2 | Cartesian3, p2: Cartesian2 | Cartesian3): boolean;
  16827. /**
  16828. * Parses a query string into an object, where the keys and values of the object are the
  16829. * name/value pairs from the query string, decoded. If a name appears multiple times,
  16830. * the value in the object will be an array of values.
  16831. * @example
  16832. * const obj = SuperMap.queryToObject('key1=some%20value&key2=a%2Fb&key3=x&key3=y');
  16833. * // obj will be:
  16834. * // {
  16835. * // key1 : 'some value',
  16836. * // key2 : 'a/b',
  16837. * // key3 : ['x', 'y']
  16838. * // }
  16839. * @param queryString - The query string.
  16840. * @returns An object containing the parameters parsed from the query string.
  16841. */
  16842. export function queryToObject(queryString: string): any;
  16843. /**
  16844. * A browser-independent function to request a new animation frame. This is used to create
  16845. * an application's draw loop as shown in the example below.
  16846. * @example
  16847. * // Create a draw loop using requestAnimationFrame. The
  16848. * // tick callback function is called for every animation frame.
  16849. * function tick() {
  16850. * scene.render();
  16851. * SuperMap.requestAnimationFrame(tick);
  16852. * }
  16853. * tick();
  16854. * @param callback - The function to call when the next frame should be drawn.
  16855. * @returns An ID that can be passed to {@link cancelAnimationFrame} to cancel the request.
  16856. */
  16857. export function requestAnimationFrame(callback: requestAnimationFrameCallback): number;
  16858. /**
  16859. * Initiates a terrain height query for an array of {@link Cartographic} positions by
  16860. * requesting tiles from a terrain provider, sampling, and interpolating. The interpolation
  16861. * matches the triangles used to render the terrain at the specified level. The query
  16862. * happens asynchronously, so this function returns a promise that is resolved when
  16863. * the query completes. Each point height is modified in place. If a height can not be
  16864. * determined because no terrain data is available for the specified level at that location,
  16865. * or another error occurs, the height is set to undefined. As is typical of the
  16866. * {@link Cartographic} type, the supplied height is a height above the reference ellipsoid
  16867. * (such as {@link Ellipsoid.WGS84}) rather than an altitude above mean sea level. In other
  16868. * words, it will not necessarily be 0.0 if sampled in the ocean. This function needs the
  16869. * terrain level of detail as input, if you need to get the altitude of the terrain as precisely
  16870. * as possible (i.e. with maximum level of detail) use {@link sampleTerrainMostDetailed}.
  16871. * @example
  16872. * // Query the terrain height of two Cartographic positions
  16873. * const terrainProvider = SuperMap.createWorldTerrain();
  16874. * const positions = [
  16875. * SuperMap.Cartographic.fromDegrees(86.925145, 27.988257),
  16876. * SuperMap.Cartographic.fromDegrees(87.0, 28.0)
  16877. * ];
  16878. * const promise = SuperMap.sampleTerrain(terrainProvider, 11, positions);
  16879. * Promise.resolve(promise).then(function(updatedPositions) {
  16880. * // positions[0].height and positions[1].height have been updated.
  16881. * // updatedPositions is just a reference to positions.
  16882. * });
  16883. * @param terrainProvider - The terrain provider from which to query heights.
  16884. * @param level - The terrain level-of-detail from which to query terrain heights.
  16885. * @param positions - The positions to update with terrain heights.
  16886. * @returns A promise that resolves to the provided list of positions when terrain the query has completed.
  16887. */
  16888. export function sampleTerrain(terrainProvider: TerrainProvider, level: number, positions: Cartographic[]): Promise<Cartographic[]>;
  16889. /**
  16890. * Initiates a sampleTerrain() request at the maximum available tile level for a terrain dataset.
  16891. * @example
  16892. * // Query the terrain height of two Cartographic positions
  16893. * const terrainProvider = SuperMap.createWorldTerrain();
  16894. * const positions = [
  16895. * SuperMap.Cartographic.fromDegrees(86.925145, 27.988257),
  16896. * SuperMap.Cartographic.fromDegrees(87.0, 28.0)
  16897. * ];
  16898. * const promise = SuperMap.sampleTerrainMostDetailed(terrainProvider, positions);
  16899. * Promise.resolve(promise).then(function(updatedPositions) {
  16900. * // positions[0].height and positions[1].height have been updated.
  16901. * // updatedPositions is just a reference to positions.
  16902. * });
  16903. * @param terrainProvider - The terrain provider from which to query heights.
  16904. * @param positions - The positions to update with terrain heights.
  16905. * @returns A promise that resolves to the provided list of positions when terrain the query has completed. This
  16906. * promise will reject if the terrain provider's `availability` property is undefined.
  16907. */
  16908. export function sampleTerrainMostDetailed(terrainProvider: TerrainProvider, positions: Cartographic[]): Promise<Cartographic[]>;
  16909. /**
  16910. * Subdivides an array into a number of smaller, equal sized arrays.
  16911. * @param array - The array to divide.
  16912. * @param numberOfArrays - The number of arrays to divide the provided array into.
  16913. */
  16914. export function subdivideArray(array: any[], numberOfArrays: number): void;
  16915. /**
  16916. * Writes the given text into a new canvas. The canvas will be sized to fit the text.
  16917. * If text is blank, returns undefined.
  16918. * @param text - The text to write.
  16919. * @param [options] - Object with the following properties:
  16920. * @param [options.font = '10px sans-serif'] - The CSS font to use.
  16921. * @param [options.textBaseline = 'bottom'] - The baseline of the text.
  16922. * @param [options.fill = true] - Whether to fill the text.
  16923. * @param [options.stroke = false] - Whether to stroke the text.
  16924. * @param [options.fillColor = Color.WHITE] - The fill color.
  16925. * @param [options.strokeColor = Color.BLACK] - The stroke color.
  16926. * @param [options.strokeWidth = 1] - The stroke width.
  16927. * @param [options.backgroundColor = Color.TRANSPARENT] - The background color of the canvas.
  16928. * @param [options.padding = 0] - The pixel size of the padding to add around the text.
  16929. * @returns A new canvas with the given text drawn into it. The dimensions object
  16930. * from measureText will also be added to the returned canvas. If text is
  16931. * blank, returns undefined.
  16932. */
  16933. export function writeTextToCanvas(text: string, options?: {
  16934. font?: string;
  16935. textBaseline?: string;
  16936. fill?: boolean;
  16937. stroke?: boolean;
  16938. fillColor?: Color;
  16939. strokeColor?: Color;
  16940. strokeWidth?: number;
  16941. backgroundColor?: Color;
  16942. padding?: number;
  16943. }): HTMLCanvasElement | undefined;
  16944. export namespace BillboardGraphics {
  16945. /**
  16946. * Initialization options for the BillboardGraphics constructor
  16947. * @property [show = true] - A boolean Property specifying the visibility of the billboard.
  16948. * @property [image] - A Property specifying the Image, URI, or Canvas to use for the billboard.
  16949. * @property [scale = 1.0] - A numeric Property specifying the scale to apply to the image size.
  16950. * @property [pixelOffset = Cartesian2.ZERO] - A {@link Cartesian2} Property specifying the pixel offset.
  16951. * @property [eyeOffset = Cartesian3.ZERO] - A {@link Cartesian3} Property specifying the eye offset.
  16952. * @property [horizontalOrigin = HorizontalOrigin.CENTER] - A Property specifying the {@link HorizontalOrigin}.
  16953. * @property [verticalOrigin = VerticalOrigin.CENTER] - A Property specifying the {@link VerticalOrigin}.
  16954. * @property [heightReference = HeightReference.NONE] - A Property specifying what the height is relative to.
  16955. * @property [color = Color.WHITE] - A Property specifying the tint {@link Color} of the image.
  16956. * @property [rotation = 0] - A numeric Property specifying the rotation about the alignedAxis.
  16957. * @property [alignedAxis = Cartesian3.ZERO] - A {@link Cartesian3} Property specifying the unit vector axis of rotation.
  16958. * @property [sizeInMeters] - A boolean Property specifying whether this billboard's size should be measured in meters.
  16959. * @property [width] - A numeric Property specifying the width of the billboard in pixels, overriding the native size.
  16960. * @property [height] - A numeric Property specifying the height of the billboard in pixels, overriding the native size.
  16961. * @property [scaleByDistance] - A {@link NearFarScalar} Property used to scale the point based on distance from the camera.
  16962. * @property [translucencyByDistance] - A {@link NearFarScalar} Property used to set translucency based on distance from the camera.
  16963. * @property [pixelOffsetScaleByDistance] - A {@link NearFarScalar} Property used to set pixelOffset based on distance from the camera.
  16964. * @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.
  16965. * @property [distanceDisplayCondition] - A Property specifying at what distance from the camera that this billboard will be displayed.
  16966. * @property [disableDepthTestDistance] - A Property specifying the distance from the camera at which to disable the depth test to.
  16967. */
  16968. type ConstructorOptions = {
  16969. show?: Property | boolean;
  16970. image?: Property | string | HTMLCanvasElement;
  16971. scale?: Property | number;
  16972. pixelOffset?: Property | Cartesian2;
  16973. eyeOffset?: Property | Cartesian3;
  16974. horizontalOrigin?: Property | HorizontalOrigin;
  16975. verticalOrigin?: Property | VerticalOrigin;
  16976. heightReference?: Property | HeightReference;
  16977. color?: Property | Color;
  16978. rotation?: Property | number;
  16979. alignedAxis?: Property | Cartesian3;
  16980. sizeInMeters?: Property | boolean;
  16981. width?: Property | number;
  16982. height?: Property | number;
  16983. scaleByDistance?: Property | NearFarScalar;
  16984. translucencyByDistance?: Property | NearFarScalar;
  16985. pixelOffsetScaleByDistance?: Property | NearFarScalar;
  16986. imageSubRegion?: Property | BoundingRectangle;
  16987. distanceDisplayCondition?: Property | DistanceDisplayCondition;
  16988. disableDepthTestDistance?: Property | number;
  16989. };
  16990. }
  16991. /**
  16992. * Describes a two dimensional icon located at the position of the containing {@link Entity}.
  16993. * <p>
  16994. * <div align='center'>
  16995. * <img src='Images/Billboard.png' width='400' height='300' /><br />
  16996. * Example billboards
  16997. * </div>
  16998. * </p>
  16999. * @param [options] - Object describing initialization options
  17000. */
  17001. export class BillboardGraphics {
  17002. constructor(options?: BillboardGraphics.ConstructorOptions);
  17003. /**
  17004. * Gets the event that is raised whenever a property or sub-property is changed or modified.
  17005. */
  17006. readonly definitionChanged: Event;
  17007. /**
  17008. * Gets or sets the boolean Property specifying the visibility of the billboard.
  17009. */
  17010. show: Property | undefined;
  17011. /**
  17012. * Gets or sets the Property specifying the Image, URI, or Canvas to use for the billboard.
  17013. */
  17014. image: Property | undefined;
  17015. /**
  17016. * Gets or sets the numeric Property specifying the uniform scale to apply to the image.
  17017. * A scale greater than <code>1.0</code> enlarges the billboard while a scale less than <code>1.0</code> shrinks it.
  17018. * <p>
  17019. * <div align='center'>
  17020. * <img src='Images/Billboard.setScale.png' width='400' height='300' /><br/>
  17021. * From left to right in the above image, the scales are <code>0.5</code>, <code>1.0</code>, and <code>2.0</code>.
  17022. * </div>
  17023. * </p>
  17024. */
  17025. scale: Property | undefined;
  17026. /**
  17027. * Gets or sets the {@link Cartesian2} Property specifying the billboard's pixel offset in screen space
  17028. * from the origin of this billboard. This is commonly used to align multiple billboards and labels at
  17029. * the same position, e.g., an image and text. The screen space origin is the top, left corner of the
  17030. * canvas; <code>x</code> increases from left to right, and <code>y</code> increases from top to bottom.
  17031. * <p>
  17032. * <div align='center'>
  17033. * <table border='0' cellpadding='5'><tr>
  17034. * <td align='center'><code>default</code><br/><img src='Images/Billboard.setPixelOffset.default.png' width='250' height='188' /></td>
  17035. * <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>
  17036. * </tr></table>
  17037. * The billboard's origin is indicated by the yellow point.
  17038. * </div>
  17039. * </p>
  17040. */
  17041. pixelOffset: Property | undefined;
  17042. /**
  17043. * Gets or sets the {@link Cartesian3} Property specifying the billboard's offset in eye coordinates.
  17044. * Eye coordinates is a left-handed coordinate system, where <code>x</code> points towards the viewer's
  17045. * right, <code>y</code> points up, and <code>z</code> points into the screen.
  17046. * <p>
  17047. * An eye offset is commonly used to arrange multiple billboards or objects at the same position, e.g., to
  17048. * arrange a billboard above its corresponding 3D model.
  17049. * </p>
  17050. * Below, the billboard is positioned at the center of the Earth but an eye offset makes it always
  17051. * appear on top of the Earth regardless of the viewer's or Earth's orientation.
  17052. * <p>
  17053. * <div align='center'>
  17054. * <table border='0' cellpadding='5'><tr>
  17055. * <td align='center'><img src='Images/Billboard.setEyeOffset.one.png' width='250' height='188' /></td>
  17056. * <td align='center'><img src='Images/Billboard.setEyeOffset.two.png' width='250' height='188' /></td>
  17057. * </tr></table>
  17058. * <code>b.eyeOffset = new Cartesian3(0.0, 8000000.0, 0.0);</code>
  17059. * </div>
  17060. * </p>
  17061. */
  17062. eyeOffset: Property | undefined;
  17063. /**
  17064. * Gets or sets the Property specifying the {@link HorizontalOrigin}.
  17065. */
  17066. horizontalOrigin: Property | undefined;
  17067. /**
  17068. * Gets or sets the Property specifying the {@link VerticalOrigin}.
  17069. */
  17070. verticalOrigin: Property | undefined;
  17071. /**
  17072. * Gets or sets the Property specifying the {@link HeightReference}.
  17073. */
  17074. heightReference: Property | undefined;
  17075. /**
  17076. * Gets or sets the Property specifying the {@link Color} that is multiplied with the <code>image</code>.
  17077. * This has two common use cases. First, the same white texture may be used by many different billboards,
  17078. * each with a different color, to create colored billboards. Second, the color's alpha component can be
  17079. * used to make the billboard translucent as shown below. An alpha of <code>0.0</code> makes the billboard
  17080. * transparent, and <code>1.0</code> makes the billboard opaque.
  17081. * <p>
  17082. * <div align='center'>
  17083. * <table border='0' cellpadding='5'><tr>
  17084. * <td align='center'><code>default</code><br/><img src='Images/Billboard.setColor.Alpha255.png' width='250' height='188' /></td>
  17085. * <td align='center'><code>alpha : 0.5</code><br/><img src='Images/Billboard.setColor.Alpha127.png' width='250' height='188' /></td>
  17086. * </tr></table>
  17087. * </div>
  17088. * </p>
  17089. */
  17090. color: Property | undefined;
  17091. /**
  17092. * Gets or sets the numeric Property specifying the rotation of the image
  17093. * counter clockwise from the <code>alignedAxis</code>.
  17094. */
  17095. rotation: Property | undefined;
  17096. /**
  17097. * Gets or sets the {@link Cartesian3} Property specifying the unit vector axis of rotation
  17098. * in the fixed frame. When set to Cartesian3.ZERO the rotation is from the top of the screen.
  17099. */
  17100. alignedAxis: Property | undefined;
  17101. /**
  17102. * Gets or sets the boolean Property specifying if this billboard's size will be measured in meters.
  17103. */
  17104. sizeInMeters: Property | undefined;
  17105. /**
  17106. * Gets or sets the numeric Property specifying the width of the billboard in pixels.
  17107. * When undefined, the native width is used.
  17108. */
  17109. width: Property | undefined;
  17110. /**
  17111. * Gets or sets the numeric Property specifying the height of the billboard in pixels.
  17112. * When undefined, the native height is used.
  17113. */
  17114. height: Property | undefined;
  17115. /**
  17116. * Gets or sets {@link NearFarScalar} Property specifying the scale of the billboard based on the distance from the camera.
  17117. * A billboard's scale will interpolate between the {@link NearFarScalar#nearValue} and
  17118. * {@link NearFarScalar#farValue} while the camera distance falls within the lower and upper bounds
  17119. * of the specified {@link NearFarScalar#near} and {@link NearFarScalar#far}.
  17120. * Outside of these ranges the billboard's scale remains clamped to the nearest bound.
  17121. */
  17122. scaleByDistance: Property | undefined;
  17123. /**
  17124. * Gets or sets {@link NearFarScalar} Property specifying the translucency of the billboard based on the distance from the camera.
  17125. * A billboard's translucency will interpolate between the {@link NearFarScalar#nearValue} and
  17126. * {@link NearFarScalar#farValue} while the camera distance falls within the lower and upper bounds
  17127. * of the specified {@link NearFarScalar#near} and {@link NearFarScalar#far}.
  17128. * Outside of these ranges the billboard's translucency remains clamped to the nearest bound.
  17129. */
  17130. translucencyByDistance: Property | undefined;
  17131. /**
  17132. * Gets or sets {@link NearFarScalar} Property specifying the pixel offset of the billboard based on the distance from the camera.
  17133. * A billboard's pixel offset will interpolate between the {@link NearFarScalar#nearValue} and
  17134. * {@link NearFarScalar#farValue} while the camera distance falls within the lower and upper bounds
  17135. * of the specified {@link NearFarScalar#near} and {@link NearFarScalar#far}.
  17136. * Outside of these ranges the billboard's pixel offset remains clamped to the nearest bound.
  17137. */
  17138. pixelOffsetScaleByDistance: Property | undefined;
  17139. /**
  17140. * Gets or sets the Property specifying a {@link BoundingRectangle} that defines a
  17141. * sub-region of the <code>image</code> to use for the billboard, rather than the entire image,
  17142. * measured in pixels from the bottom-left.
  17143. */
  17144. imageSubRegion: Property | undefined;
  17145. /**
  17146. * Gets or sets the {@link DistanceDisplayCondition} Property specifying at what distance from the camera that this billboard will be displayed.
  17147. */
  17148. distanceDisplayCondition: Property | undefined;
  17149. /**
  17150. * Gets or sets the distance from the camera at which to disable the depth test to, for example, prevent clipping against terrain.
  17151. * When set to zero, the depth test is always applied. When set to Number.POSITIVE_INFINITY, the depth test is never applied.
  17152. */
  17153. disableDepthTestDistance: Property | undefined;
  17154. /**
  17155. * Duplicates this instance.
  17156. * @param [result] - The object onto which to store the result.
  17157. * @returns The modified result parameter or a new instance if one was not provided.
  17158. */
  17159. clone(result?: BillboardGraphics): BillboardGraphics;
  17160. /**
  17161. * Assigns each unassigned property on this object to the value
  17162. * of the same property on the provided source object.
  17163. * @param source - The object to be merged into this object.
  17164. */
  17165. merge(source: BillboardGraphics): void;
  17166. }
  17167. /**
  17168. * A {@link Visualizer} which maps {@link Entity#billboard} to a {@link Billboard}.
  17169. * @param entityCluster - The entity cluster to manage the collection of billboards and optionally cluster with other entities.
  17170. * @param entityCollection - The entityCollection to visualize.
  17171. */
  17172. export class BillboardVisualizer {
  17173. constructor(entityCluster: EntityCluster, entityCollection: EntityCollection);
  17174. /**
  17175. * Updates the primitives created by this visualizer to match their
  17176. * Entity counterpart at the given time.
  17177. * @param time - The time to update to.
  17178. * @returns This function always returns true.
  17179. */
  17180. update(time: JulianDate): boolean;
  17181. /**
  17182. * Returns true if this object was destroyed; otherwise, false.
  17183. * @returns True if this object was destroyed; otherwise, false.
  17184. */
  17185. isDestroyed(): boolean;
  17186. /**
  17187. * Removes and destroys all primitives created by this instance.
  17188. */
  17189. destroy(): void;
  17190. }
  17191. /**
  17192. * A {@link GeometryUpdater} for boxes.
  17193. * Clients do not normally create this class directly, but instead rely on {@link DataSourceDisplay}.
  17194. * @param entity - The entity containing the geometry to be visualized.
  17195. * @param scene - The scene where visualization is taking place.
  17196. */
  17197. export class BoxGeometryUpdater {
  17198. constructor(entity: Entity, scene: Scene);
  17199. /**
  17200. * Creates the geometry instance which represents the fill of the geometry.
  17201. * @param time - The time to use when retrieving initial attribute values.
  17202. * @returns The geometry instance representing the filled portion of the geometry.
  17203. */
  17204. createFillGeometryInstance(time: JulianDate): GeometryInstance;
  17205. /**
  17206. * Creates the geometry instance which represents the outline of the geometry.
  17207. * @param time - The time to use when retrieving initial attribute values.
  17208. * @returns The geometry instance representing the outline portion of the geometry.
  17209. */
  17210. createOutlineGeometryInstance(time: JulianDate): GeometryInstance;
  17211. }
  17212. export namespace BoxGraphics {
  17213. /**
  17214. * Initialization options for the BoxGraphics constructor
  17215. * @property [show = true] - A boolean Property specifying the visibility of the box.
  17216. * @property [dimensions] - A {@link Cartesian3} Property specifying the length, width, and height of the box.
  17217. * @property [heightReference = HeightReference.NONE] - A Property specifying what the height from the entity position is relative to.
  17218. * @property [fill = true] - A boolean Property specifying whether the box is filled with the provided material.
  17219. * @property [material = Color.WHITE] - A Property specifying the material used to fill the box.
  17220. * @property [outline = false] - A boolean Property specifying whether the box is outlined.
  17221. * @property [outlineColor = Color.BLACK] - A Property specifying the {@link Color} of the outline.
  17222. * @property [outlineWidth = 1.0] - A numeric Property specifying the width of the outline.
  17223. * @property [shadows = ShadowMode.DISABLED] - An enum Property specifying whether the box casts or receives shadows from light sources.
  17224. * @property [distanceDisplayCondition] - A Property specifying at what distance from the camera that this box will be displayed.
  17225. */
  17226. type ConstructorOptions = {
  17227. show?: Property | boolean;
  17228. dimensions?: Property | Cartesian3;
  17229. heightReference?: Property | HeightReference;
  17230. fill?: Property | boolean;
  17231. material?: MaterialProperty | Color;
  17232. outline?: Property | boolean;
  17233. outlineColor?: Property | Color;
  17234. outlineWidth?: Property | number;
  17235. shadows?: Property | ShadowMode;
  17236. distanceDisplayCondition?: Property | DistanceDisplayCondition;
  17237. };
  17238. }
  17239. /**
  17240. * Describes a box. The center position and orientation are determined by the containing {@link Entity}.
  17241. * @param [options] - Object describing initialization options
  17242. */
  17243. export class BoxGraphics {
  17244. constructor(options?: BoxGraphics.ConstructorOptions);
  17245. /**
  17246. * Gets the event that is raised whenever a property or sub-property is changed or modified.
  17247. */
  17248. readonly definitionChanged: Event;
  17249. /**
  17250. * Gets or sets the boolean Property specifying the visibility of the box.
  17251. */
  17252. show: Property | undefined;
  17253. /**
  17254. * Gets or sets {@link Cartesian3} Property property specifying the length, width, and height of the box.
  17255. */
  17256. dimensions: Property | undefined;
  17257. /**
  17258. * Gets or sets the Property specifying the {@link HeightReference}.
  17259. */
  17260. heightReference: Property | undefined;
  17261. /**
  17262. * Gets or sets the boolean Property specifying whether the box is filled with the provided material.
  17263. */
  17264. fill: Property | undefined;
  17265. /**
  17266. * Gets or sets the material used to fill the box.
  17267. */
  17268. material: MaterialProperty | undefined;
  17269. /**
  17270. * Gets or sets the Property specifying whether the box is outlined.
  17271. */
  17272. outline: Property | undefined;
  17273. /**
  17274. * Gets or sets the Property specifying the {@link Color} of the outline.
  17275. */
  17276. outlineColor: Property | undefined;
  17277. /**
  17278. * Gets or sets the numeric Property specifying the width of the outline.
  17279. */
  17280. outlineWidth: Property | undefined;
  17281. /**
  17282. * Get or sets the enum Property specifying whether the box
  17283. * casts or receives shadows from light sources.
  17284. */
  17285. shadows: Property | undefined;
  17286. /**
  17287. * Gets or sets the {@link DistanceDisplayCondition} Property specifying at what distance from the camera that this box will be displayed.
  17288. */
  17289. distanceDisplayCondition: Property | undefined;
  17290. /**
  17291. * Duplicates this instance.
  17292. * @param [result] - The object onto which to store the result.
  17293. * @returns The modified result parameter or a new instance if one was not provided.
  17294. */
  17295. clone(result?: BoxGraphics): BoxGraphics;
  17296. /**
  17297. * Assigns each unassigned property on this object to the value
  17298. * of the same property on the provided source object.
  17299. * @param source - The object to be merged into this object.
  17300. */
  17301. merge(source: BoxGraphics): void;
  17302. }
  17303. /**
  17304. * A {@link Property} whose value is lazily evaluated by a callback function.
  17305. * @param callback - The function to be called when the property is evaluated.
  17306. * @param isConstant - <code>true</code> when the callback function returns the same value every time, <code>false</code> if the value will change.
  17307. */
  17308. export class CallbackProperty {
  17309. constructor(callback: CallbackProperty.Callback, isConstant: boolean);
  17310. /**
  17311. * Gets a value indicating if this property is constant.
  17312. */
  17313. readonly isConstant: boolean;
  17314. /**
  17315. * Gets the event that is raised whenever the definition of this property changes.
  17316. * The definition is changed whenever setCallback is called.
  17317. */
  17318. readonly definitionChanged: Event;
  17319. /**
  17320. * Gets the value of the property.
  17321. * @param time - The time for which to retrieve the value.
  17322. * @param [result] - The object to store the value into, if omitted, a new instance is created and returned.
  17323. * @returns The modified result parameter or a new instance if the result parameter was not supplied or is unsupported.
  17324. */
  17325. getValue(time: JulianDate, result?: any): any;
  17326. /**
  17327. * Sets the callback to be used.
  17328. * @param callback - The function to be called when the property is evaluated.
  17329. * @param isConstant - <code>true</code> when the callback function returns the same value every time, <code>false</code> if the value will change.
  17330. */
  17331. setCallback(callback: CallbackProperty.Callback, isConstant: boolean): void;
  17332. /**
  17333. * Compares this property to the provided property and returns
  17334. * <code>true</code> if they are equal, <code>false</code> otherwise.
  17335. * @param [other] - The other property.
  17336. * @returns <code>true</code> if left and right are equal, <code>false</code> otherwise.
  17337. */
  17338. equals(other?: Property): boolean;
  17339. }
  17340. export namespace CallbackProperty {
  17341. /**
  17342. * A function that returns the value of the property.
  17343. * @param time - The time for which to retrieve the value.
  17344. * @param [result] - The object to store the value into. If omitted, the function must create and return a new instance.
  17345. */
  17346. type Callback = (time: JulianDate, result?: any) => any;
  17347. }
  17348. /**
  17349. * A {@link MaterialProperty} that maps to solid color {@link Material} uniforms.
  17350. * @param [color = Color.WHITE] - The {@link Color} Property to be used.
  17351. */
  17352. export class ColorMaterialProperty {
  17353. constructor(color?: Property | Color);
  17354. /**
  17355. * Gets a value indicating if this property is constant. A property is considered
  17356. * constant if getValue always returns the same result for the current definition.
  17357. */
  17358. readonly isConstant: boolean;
  17359. /**
  17360. * Gets the event that is raised whenever the definition of this property changes.
  17361. * The definition is considered to have changed if a call to getValue would return
  17362. * a different result for the same time.
  17363. */
  17364. readonly definitionChanged: Event;
  17365. /**
  17366. * Gets or sets the {@link Color} {@link Property}.
  17367. */
  17368. color: Property | undefined;
  17369. /**
  17370. * Gets the {@link Material} type at the provided time.
  17371. * @param time - The time for which to retrieve the type.
  17372. * @returns The type of material.
  17373. */
  17374. getType(time: JulianDate): string;
  17375. /**
  17376. * Gets the value of the property at the provided time.
  17377. * @param time - The time for which to retrieve the value.
  17378. * @param [result] - The object to store the value into, if omitted, a new instance is created and returned.
  17379. * @returns The modified result parameter or a new instance if the result parameter was not supplied.
  17380. */
  17381. getValue(time: JulianDate, result?: any): any;
  17382. /**
  17383. * Compares this property to the provided property and returns
  17384. * <code>true</code> if they are equal, <code>false</code> otherwise.
  17385. * @param [other] - The other property.
  17386. * @returns <code>true</code> if left and right are equal, <code>false</code> otherwise.
  17387. */
  17388. equals(other?: Property): boolean;
  17389. }
  17390. /**
  17391. * A {@link CompositeProperty} which is also a {@link PositionProperty}.
  17392. * @param [referenceFrame = ReferenceFrame.FIXED] - The reference frame in which the position is defined.
  17393. */
  17394. export class CompositePositionProperty {
  17395. constructor(referenceFrame?: ReferenceFrame);
  17396. /**
  17397. * Gets a value indicating if this property is constant. A property is considered
  17398. * constant if getValue always returns the same result for the current definition.
  17399. */
  17400. readonly isConstant: boolean;
  17401. /**
  17402. * Gets the event that is raised whenever the definition of this property changes.
  17403. * The definition is changed whenever setValue is called with data different
  17404. * than the current value.
  17405. */
  17406. readonly definitionChanged: Event;
  17407. /**
  17408. * Gets the interval collection.
  17409. */
  17410. intervals: TimeIntervalCollection;
  17411. /**
  17412. * Gets or sets the reference frame which this position presents itself as.
  17413. * Each PositionProperty making up this object has it's own reference frame,
  17414. * so this property merely exposes a "preferred" reference frame for clients
  17415. * to use.
  17416. */
  17417. referenceFrame: ReferenceFrame;
  17418. /**
  17419. * Gets the value of the property at the provided time in the fixed frame.
  17420. * @param time - The time for which to retrieve the value.
  17421. * @param [result] - The object to store the value into, if omitted, a new instance is created and returned.
  17422. * @returns The modified result parameter or a new instance if the result parameter was not supplied.
  17423. */
  17424. getValue(time: JulianDate, result?: Cartesian3): Cartesian3 | undefined;
  17425. /**
  17426. * Gets the value of the property at the provided time and in the provided reference frame.
  17427. * @param time - The time for which to retrieve the value.
  17428. * @param referenceFrame - The desired referenceFrame of the result.
  17429. * @param [result] - The object to store the value into, if omitted, a new instance is created and returned.
  17430. * @returns The modified result parameter or a new instance if the result parameter was not supplied.
  17431. */
  17432. getValueInReferenceFrame(time: JulianDate, referenceFrame: ReferenceFrame, result?: Cartesian3): Cartesian3 | undefined;
  17433. /**
  17434. * Compares this property to the provided property and returns
  17435. * <code>true</code> if they are equal, <code>false</code> otherwise.
  17436. * @param [other] - The other property.
  17437. * @returns <code>true</code> if left and right are equal, <code>false</code> otherwise.
  17438. */
  17439. equals(other?: Property): boolean;
  17440. }
  17441. /**
  17442. * A {@link Property} which is defined by a {@link TimeIntervalCollection}, where the
  17443. * data property of each {@link TimeInterval} is another Property instance which is
  17444. * evaluated at the provided time.
  17445. * @example
  17446. * const constantProperty = ...;
  17447. * const sampledProperty = ...;
  17448. *
  17449. * //Create a composite property from two previously defined properties
  17450. * //where the property is valid on August 1st, 2012 and uses a constant
  17451. * //property for the first half of the day and a sampled property for the
  17452. * //remaining half.
  17453. * const composite = new SuperMap.CompositeProperty();
  17454. * composite.intervals.addInterval(SuperMap.TimeInterval.fromIso8601({
  17455. * iso8601 : '2012-08-01T00:00:00.00Z/2012-08-01T12:00:00.00Z',
  17456. * data : constantProperty
  17457. * }));
  17458. * composite.intervals.addInterval(SuperMap.TimeInterval.fromIso8601({
  17459. * iso8601 : '2012-08-01T12:00:00.00Z/2012-08-02T00:00:00.00Z',
  17460. * isStartIncluded : false,
  17461. * isStopIncluded : false,
  17462. * data : sampledProperty
  17463. * }));
  17464. */
  17465. export class CompositeProperty {
  17466. constructor();
  17467. /**
  17468. * Gets a value indicating if this property is constant. A property is considered
  17469. * constant if getValue always returns the same result for the current definition.
  17470. */
  17471. readonly isConstant: boolean;
  17472. /**
  17473. * Gets the event that is raised whenever the definition of this property changes.
  17474. * The definition is changed whenever setValue is called with data different
  17475. * than the current value.
  17476. */
  17477. readonly definitionChanged: Event;
  17478. /**
  17479. * Gets the interval collection.
  17480. */
  17481. intervals: TimeIntervalCollection;
  17482. /**
  17483. * Gets the value of the property at the provided time.
  17484. * @param time - The time for which to retrieve the value.
  17485. * @param [result] - The object to store the value into, if omitted, a new instance is created and returned.
  17486. * @returns The modified result parameter or a new instance if the result parameter was not supplied.
  17487. */
  17488. getValue(time: JulianDate, result?: any): any;
  17489. /**
  17490. * Compares this property to the provided property and returns
  17491. * <code>true</code> if they are equal, <code>false</code> otherwise.
  17492. * @param [other] - The other property.
  17493. * @returns <code>true</code> if left and right are equal, <code>false</code> otherwise.
  17494. */
  17495. equals(other?: Property): boolean;
  17496. }
  17497. /**
  17498. * A {@link PositionProperty} whose value does not change in respect to the
  17499. * {@link ReferenceFrame} in which is it defined.
  17500. * @param [value] - The property value.
  17501. * @param [referenceFrame = ReferenceFrame.FIXED] - The reference frame in which the position is defined.
  17502. */
  17503. export class ConstantPositionProperty {
  17504. constructor(value?: Cartesian3, referenceFrame?: ReferenceFrame);
  17505. /**
  17506. * Gets a value indicating if this property is constant. A property is considered
  17507. * constant if getValue always returns the same result for the current definition.
  17508. */
  17509. readonly isConstant: boolean;
  17510. /**
  17511. * Gets the event that is raised whenever the definition of this property changes.
  17512. * The definition is considered to have changed if a call to getValue would return
  17513. * a different result for the same time.
  17514. */
  17515. readonly definitionChanged: Event;
  17516. /**
  17517. * Gets the reference frame in which the position is defined.
  17518. */
  17519. referenceFrame: ReferenceFrame;
  17520. /**
  17521. * Gets the value of the property at the provided time in the fixed frame.
  17522. * @param time - The time for which to retrieve the value.
  17523. * @param [result] - The object to store the value into, if omitted, a new instance is created and returned.
  17524. * @returns The modified result parameter or a new instance if the result parameter was not supplied.
  17525. */
  17526. getValue(time: JulianDate, result?: any): any;
  17527. /**
  17528. * Sets the value of the property.
  17529. * @param value - The property value.
  17530. * @param [referenceFrame = this.referenceFrame] - The reference frame in which the position is defined.
  17531. */
  17532. setValue(value: Cartesian3, referenceFrame?: ReferenceFrame): void;
  17533. /**
  17534. * Gets the value of the property at the provided time and in the provided reference frame.
  17535. * @param time - The time for which to retrieve the value.
  17536. * @param referenceFrame - The desired referenceFrame of the result.
  17537. * @param [result] - The object to store the value into, if omitted, a new instance is created and returned.
  17538. * @returns The modified result parameter or a new instance if the result parameter was not supplied.
  17539. */
  17540. getValueInReferenceFrame(time: JulianDate, referenceFrame: ReferenceFrame, result?: Cartesian3): Cartesian3;
  17541. /**
  17542. * Compares this property to the provided property and returns
  17543. * <code>true</code> if they are equal, <code>false</code> otherwise.
  17544. * @param [other] - The other property.
  17545. * @returns <code>true</code> if left and right are equal, <code>false</code> otherwise.
  17546. */
  17547. equals(other?: Property): boolean;
  17548. }
  17549. /**
  17550. * A {@link Property} whose value does not change with respect to simulation time.
  17551. * @param [value] - The property value.
  17552. */
  17553. export class ConstantProperty {
  17554. constructor(value?: any);
  17555. /**
  17556. * Gets a value indicating if this property is constant.
  17557. * This property always returns <code>true</code>.
  17558. */
  17559. readonly isConstant: boolean;
  17560. /**
  17561. * Gets the event that is raised whenever the definition of this property changes.
  17562. * The definition is changed whenever setValue is called with data different
  17563. * than the current value.
  17564. */
  17565. readonly definitionChanged: Event;
  17566. /**
  17567. * Gets the value of the property.
  17568. * @param [time] - The time for which to retrieve the value. This parameter is unused since the value does not change with respect to time.
  17569. * @param [result] - The object to store the value into, if omitted, a new instance is created and returned.
  17570. * @returns The modified result parameter or a new instance if the result parameter was not supplied.
  17571. */
  17572. getValue(time?: JulianDate, result?: any): any;
  17573. /**
  17574. * Sets the value of the property.
  17575. * @param value - The property value.
  17576. */
  17577. setValue(value: any): void;
  17578. /**
  17579. * Compares this property to the provided property and returns
  17580. * <code>true</code> if they are equal, <code>false</code> otherwise.
  17581. * @param [other] - The other property.
  17582. * @returns <code>true</code> if left and right are equal, <code>false</code> otherwise.
  17583. */
  17584. equals(other?: Property): boolean;
  17585. /**
  17586. * Gets this property's value.
  17587. * @returns This property's value.
  17588. */
  17589. valueOf(): any;
  17590. /**
  17591. * Creates a string representing this property's value.
  17592. * @returns A string representing the property's value.
  17593. */
  17594. toString(): string;
  17595. }
  17596. /**
  17597. * Defines the interface for data sources, which turn arbitrary data into a
  17598. * {@link EntityCollection} for generic consumption. This object is an interface
  17599. * for documentation purposes and is not intended to be instantiated directly.
  17600. */
  17601. export class DataSource {
  17602. constructor();
  17603. /**
  17604. * Gets a human-readable name for this instance.
  17605. */
  17606. name: string;
  17607. /**
  17608. * Gets the preferred clock settings for this data source.
  17609. */
  17610. clock: DataSourceClock;
  17611. /**
  17612. * Gets the collection of {@link Entity} instances.
  17613. */
  17614. entities: EntityCollection;
  17615. /**
  17616. * Gets a value indicating if the data source is currently loading data.
  17617. */
  17618. isLoading: boolean;
  17619. /**
  17620. * Gets an event that will be raised when the underlying data changes.
  17621. */
  17622. changedEvent: Event;
  17623. /**
  17624. * Gets an event that will be raised if an error is encountered during processing.
  17625. */
  17626. errorEvent: Event<(arg0: this, arg1: RequestErrorEvent) => void>;
  17627. /**
  17628. * Gets an event that will be raised when the value of isLoading changes.
  17629. */
  17630. loadingEvent: Event<(arg0: this, arg1: boolean) => void>;
  17631. /**
  17632. * Gets whether or not this data source should be displayed.
  17633. */
  17634. show: boolean;
  17635. /**
  17636. * Gets or sets the clustering options for this data source. This object can be shared between multiple data sources.
  17637. */
  17638. clustering: EntityCluster;
  17639. /**
  17640. * Updates the data source to the provided time. This function is optional and
  17641. * is not required to be implemented. It is provided for data sources which
  17642. * retrieve data based on the current animation time or scene state.
  17643. * If implemented, update will be called by {@link DataSourceDisplay} once a frame.
  17644. * @param time - The simulation time.
  17645. * @returns True if this data source is ready to be displayed at the provided time, false otherwise.
  17646. */
  17647. update(time: JulianDate): boolean;
  17648. }
  17649. /**
  17650. * Represents desired clock settings for a particular {@link DataSource}. These settings may be applied
  17651. * to the {@link Clock} when the DataSource is loaded.
  17652. */
  17653. export class DataSourceClock {
  17654. constructor();
  17655. /**
  17656. * Gets the event that is raised whenever a new property is assigned.
  17657. */
  17658. readonly definitionChanged: Event;
  17659. /**
  17660. * Gets or sets the desired start time of the clock.
  17661. * See {@link Clock#startTime}.
  17662. */
  17663. startTime: JulianDate;
  17664. /**
  17665. * Gets or sets the desired stop time of the clock.
  17666. * See {@link Clock#stopTime}.
  17667. */
  17668. stopTime: JulianDate;
  17669. /**
  17670. * Gets or sets the desired current time when this data source is loaded.
  17671. * See {@link Clock#currentTime}.
  17672. */
  17673. currentTime: JulianDate;
  17674. /**
  17675. * Gets or sets the desired clock range setting.
  17676. * See {@link Clock#clockRange}.
  17677. */
  17678. clockRange: ClockRange;
  17679. /**
  17680. * Gets or sets the desired clock step setting.
  17681. * See {@link Clock#clockStep}.
  17682. */
  17683. clockStep: ClockStep;
  17684. /**
  17685. * Gets or sets the desired clock multiplier.
  17686. * See {@link Clock#multiplier}.
  17687. */
  17688. multiplier: number;
  17689. /**
  17690. * Duplicates a DataSourceClock instance.
  17691. * @param [result] - The object onto which to store the result.
  17692. * @returns The modified result parameter or a new instance if one was not provided.
  17693. */
  17694. clone(result?: DataSourceClock): DataSourceClock;
  17695. /**
  17696. * Returns true if this DataSourceClock is equivalent to the other
  17697. * @param other - The other DataSourceClock to compare to.
  17698. * @returns <code>true</code> if the DataSourceClocks are equal; otherwise, <code>false</code>.
  17699. */
  17700. equals(other: DataSourceClock): boolean;
  17701. /**
  17702. * Assigns each unassigned property on this object to the value
  17703. * of the same property on the provided source object.
  17704. * @param source - The object to be merged into this object.
  17705. */
  17706. merge(source: DataSourceClock): void;
  17707. /**
  17708. * Gets the value of this clock instance as a {@link Clock} object.
  17709. * @returns The modified result parameter or a new instance if one was not provided.
  17710. */
  17711. getValue(): Clock;
  17712. }
  17713. /**
  17714. * Defines how screen space objects (billboards, points, labels) are clustered.
  17715. * @param [options] - An object with the following properties:
  17716. * @param [options.enabled = false] - Whether or not to enable clustering.
  17717. * @param [options.pixelRange = 80] - The pixel range to extend the screen space bounding box.
  17718. * @param [options.minimumClusterSize = 2] - The minimum number of screen space objects that can be clustered.
  17719. * @param [options.clusterBillboards = true] - Whether or not to cluster the billboards of an entity.
  17720. * @param [options.clusterLabels = true] - Whether or not to cluster the labels of an entity.
  17721. * @param [options.clusterPoints = true] - Whether or not to cluster the points of an entity.
  17722. * @param [options.show = true] - Determines if the entities in the cluster will be shown.
  17723. */
  17724. export class EntityCluster {
  17725. constructor(options?: {
  17726. enabled?: boolean;
  17727. pixelRange?: number;
  17728. minimumClusterSize?: number;
  17729. clusterBillboards?: boolean;
  17730. clusterLabels?: boolean;
  17731. clusterPoints?: boolean;
  17732. show?: boolean;
  17733. });
  17734. /**
  17735. * Determines if entities in this collection will be shown.
  17736. */
  17737. show: boolean;
  17738. /**
  17739. * Gets or sets whether clustering is enabled.
  17740. */
  17741. enabled: boolean;
  17742. /**
  17743. * Gets or sets the pixel range to extend the screen space bounding box.
  17744. */
  17745. pixelRange: number;
  17746. /**
  17747. * Gets or sets the minimum number of screen space objects that can be clustered.
  17748. */
  17749. minimumClusterSize: number;
  17750. /**
  17751. * Gets the event that will be raised when a new cluster will be displayed. The signature of the event listener is {@link EntityCluster.newClusterCallback}.
  17752. */
  17753. clusterEvent: Event<EntityCluster.newClusterCallback>;
  17754. /**
  17755. * Gets or sets whether clustering billboard entities is enabled.
  17756. */
  17757. clusterBillboards: boolean;
  17758. /**
  17759. * Gets or sets whether clustering labels entities is enabled.
  17760. */
  17761. clusterLabels: boolean;
  17762. /**
  17763. * Gets or sets whether clustering point entities is enabled.
  17764. */
  17765. clusterPoints: boolean;
  17766. /**
  17767. * Destroys the WebGL resources held by this object. Destroying an object allows for deterministic
  17768. * release of WebGL resources, instead of relying on the garbage collector to destroy this object.
  17769. * <p>
  17770. * Unlike other objects that use WebGL resources, this object can be reused. For example, if a data source is removed
  17771. * from a data source collection and added to another.
  17772. * </p>
  17773. */
  17774. destroy(): void;
  17775. }
  17776. export namespace EntityCluster {
  17777. /**
  17778. * A event listener function used to style clusters.
  17779. * @example
  17780. * // The default cluster values.
  17781. * dataSource.clustering.clusterEvent.addEventListener(function(entities, cluster) {
  17782. * cluster.label.show = true;
  17783. * cluster.label.text = entities.length.toLocaleString();
  17784. * });
  17785. * @param clusteredEntities - An array of the entities contained in the cluster.
  17786. * @param cluster - An object containing the Billboard, Label, and Point
  17787. * primitives that represent this cluster of entities.
  17788. */
  17789. type newClusterCallback = (clusteredEntities: Entity[], cluster: {
  17790. billboard: Billboard;
  17791. label: Label;
  17792. point: PointPrimitive;
  17793. }) => void;
  17794. }
  17795. /**
  17796. * An abstract class for updating geometry entities.
  17797. * @param options - An object with the following properties:
  17798. * @param options.entity - The entity containing the geometry to be visualized.
  17799. * @param options.scene - The scene where visualization is taking place.
  17800. * @param options.geometryOptions - Options for the geometry
  17801. * @param options.geometryPropertyName - The geometry property name
  17802. * @param options.observedPropertyNames - The entity properties this geometry cares about
  17803. */
  17804. export class GeometryUpdater {
  17805. constructor(options: {
  17806. entity: Entity;
  17807. scene: Scene;
  17808. geometryOptions: any;
  17809. geometryPropertyName: string;
  17810. observedPropertyNames: string[];
  17811. });
  17812. /**
  17813. * Gets the unique ID associated with this updater
  17814. */
  17815. readonly id: string;
  17816. /**
  17817. * Gets the entity associated with this geometry.
  17818. */
  17819. readonly entity: Entity;
  17820. /**
  17821. * Gets a value indicating if the geometry has a fill component.
  17822. */
  17823. readonly fillEnabled: boolean;
  17824. /**
  17825. * Gets a value indicating if fill visibility varies with simulation time.
  17826. */
  17827. readonly hasConstantFill: boolean;
  17828. /**
  17829. * Gets the material property used to fill the geometry.
  17830. */
  17831. readonly fillMaterialProperty: MaterialProperty;
  17832. /**
  17833. * Gets a value indicating if the geometry has an outline component.
  17834. */
  17835. readonly outlineEnabled: boolean;
  17836. /**
  17837. * Gets a value indicating if the geometry has an outline component.
  17838. */
  17839. readonly hasConstantOutline: boolean;
  17840. /**
  17841. * Gets the {@link Color} property for the geometry outline.
  17842. */
  17843. readonly outlineColorProperty: Property;
  17844. /**
  17845. * Gets the constant with of the geometry outline, in pixels.
  17846. * This value is only valid if isDynamic is false.
  17847. */
  17848. readonly outlineWidth: number;
  17849. /**
  17850. * Gets the property specifying whether the geometry
  17851. * casts or receives shadows from light sources.
  17852. */
  17853. readonly shadowsProperty: Property;
  17854. /**
  17855. * Gets or sets the {@link DistanceDisplayCondition} Property specifying at what distance from the camera that this geometry will be displayed.
  17856. */
  17857. readonly distanceDisplayConditionProperty: Property;
  17858. /**
  17859. * Gets or sets the {@link ClassificationType} Property specifying if this geometry will classify terrain, 3D Tiles, or both when on the ground.
  17860. */
  17861. readonly classificationTypeProperty: Property;
  17862. /**
  17863. * Gets a value indicating if the geometry is time-varying.
  17864. * If true, all visualization is delegated to a DynamicGeometryUpdater
  17865. * returned by GeometryUpdater#createDynamicUpdater.
  17866. */
  17867. readonly isDynamic: boolean;
  17868. /**
  17869. * Gets a value indicating if the geometry is closed.
  17870. * This property is only valid for geometry.
  17871. */
  17872. readonly isClosed: boolean;
  17873. /**
  17874. * Gets an event that is raised whenever the public properties
  17875. * of this updater change.
  17876. */
  17877. readonly geometryChanged: boolean;
  17878. /**
  17879. * Checks if the geometry is outlined at the provided time.
  17880. * @param time - The time for which to retrieve visibility.
  17881. * @returns true if geometry is outlined at the provided time, false otherwise.
  17882. */
  17883. isOutlineVisible(time: JulianDate): boolean;
  17884. /**
  17885. * Checks if the geometry is filled at the provided time.
  17886. * @param time - The time for which to retrieve visibility.
  17887. * @returns true if geometry is filled at the provided time, false otherwise.
  17888. */
  17889. isFilled(time: JulianDate): boolean;
  17890. /**
  17891. * Creates the geometry instance which represents the fill of the geometry.
  17892. * @param time - The time to use when retrieving initial attribute values.
  17893. * @returns The geometry instance representing the filled portion of the geometry.
  17894. */
  17895. createFillGeometryInstance(time: JulianDate): GeometryInstance;
  17896. /**
  17897. * Creates the geometry instance which represents the outline of the geometry.
  17898. * @param time - The time to use when retrieving initial attribute values.
  17899. * @returns The geometry instance representing the outline portion of the geometry.
  17900. */
  17901. createOutlineGeometryInstance(time: JulianDate): GeometryInstance;
  17902. /**
  17903. * Returns true if this object was destroyed; otherwise, false.
  17904. * @returns True if this object was destroyed; otherwise, false.
  17905. */
  17906. isDestroyed(): boolean;
  17907. /**
  17908. * Destroys and resources used by the object. Once an object is destroyed, it should not be used.
  17909. */
  17910. destroy(): void;
  17911. }
  17912. /**
  17913. * A general purpose visualizer for geometry represented by {@link Primitive} instances.
  17914. * @param scene - The scene the primitives will be rendered in.
  17915. * @param entityCollection - The entityCollection to visualize.
  17916. * @param [primitives = scene.primitives] - A collection to add primitives related to the entities
  17917. * @param [groundPrimitives = scene.groundPrimitives] - A collection to add ground primitives related to the entities
  17918. */
  17919. export class GeometryVisualizer {
  17920. constructor(scene: Scene, entityCollection: EntityCollection, primitives?: PrimitiveCollection, groundPrimitives?: PrimitiveCollection);
  17921. /**
  17922. * Updates all of the primitives created by this visualizer to match their
  17923. * Entity counterpart at the given time.
  17924. * @param time - The time to update to.
  17925. * @returns True if the visualizer successfully updated to the provided time,
  17926. * false if the visualizer is waiting for asynchronous primitives to be created.
  17927. */
  17928. update(time: JulianDate): boolean;
  17929. /**
  17930. * Returns true if this object was destroyed; otherwise, false.
  17931. * @returns True if this object was destroyed; otherwise, false.
  17932. */
  17933. isDestroyed(): boolean;
  17934. /**
  17935. * Removes and destroys all primitives created by this instance.
  17936. */
  17937. destroy(): void;
  17938. }
  17939. /**
  17940. * An abstract class for updating ground geometry entities.
  17941. * @param options - An object with the following properties:
  17942. * @param options.entity - The entity containing the geometry to be visualized.
  17943. * @param options.scene - The scene where visualization is taking place.
  17944. * @param options.geometryOptions - Options for the geometry
  17945. * @param options.geometryPropertyName - The geometry property name
  17946. * @param options.observedPropertyNames - The entity properties this geometry cares about
  17947. */
  17948. export class GroundGeometryUpdater {
  17949. constructor(options: {
  17950. entity: Entity;
  17951. scene: Scene;
  17952. geometryOptions: any;
  17953. geometryPropertyName: string;
  17954. observedPropertyNames: string[];
  17955. });
  17956. /**
  17957. * Gets the zindex
  17958. */
  17959. readonly zIndex: number;
  17960. /**
  17961. * Destroys and resources used by the object. Once an object is destroyed, it should not be used.
  17962. */
  17963. destroy(): void;
  17964. }
  17965. /**
  17966. * A {@link MaterialProperty} that maps to image {@link Material} uniforms.
  17967. * @param [options] - Object with the following properties:
  17968. * @param [options.image] - A Property specifying the Image, URL, Canvas, or Video.
  17969. * @param [options.repeat = new Cartesian2(1.0, 1.0)] - A {@link Cartesian2} Property specifying the number of times the image repeats in each direction.
  17970. * @param [options.color = Color.WHITE] - The color applied to the image
  17971. * @param [options.transparent = false] - Set to true when the image has transparency (for example, when a png has transparent sections)
  17972. */
  17973. export class ImageMaterialProperty {
  17974. constructor(options?: {
  17975. image?: Property | string | HTMLImageElement | HTMLCanvasElement | HTMLVideoElement;
  17976. repeat?: Property | Cartesian2;
  17977. color?: Property | Color;
  17978. transparent?: Property | boolean;
  17979. });
  17980. /**
  17981. * Gets a value indicating if this property is constant. A property is considered
  17982. * constant if getValue always returns the same result for the current definition.
  17983. */
  17984. readonly isConstant: boolean;
  17985. /**
  17986. * Gets the event that is raised whenever the definition of this property changes.
  17987. * The definition is considered to have changed if a call to getValue would return
  17988. * a different result for the same time.
  17989. */
  17990. readonly definitionChanged: Event;
  17991. /**
  17992. * Gets or sets the Property specifying Image, URL, Canvas, or Video to use.
  17993. */
  17994. image: Property | undefined;
  17995. /**
  17996. * Gets or sets the {@link Cartesian2} Property specifying the number of times the image repeats in each direction.
  17997. */
  17998. repeat: Property | undefined;
  17999. /**
  18000. * Gets or sets the Color Property specifying the desired color applied to the image.
  18001. */
  18002. color: Property | undefined;
  18003. /**
  18004. * Gets or sets the Boolean Property specifying whether the image has transparency
  18005. */
  18006. transparent: Property | undefined;
  18007. /**
  18008. * Gets the {@link Material} type at the provided time.
  18009. * @param time - The time for which to retrieve the type.
  18010. * @returns The type of material.
  18011. */
  18012. getType(time: JulianDate): string;
  18013. /**
  18014. * Gets the value of the property at the provided time.
  18015. * @param time - The time for which to retrieve the value.
  18016. * @param [result] - The object to store the value into, if omitted, a new instance is created and returned.
  18017. * @returns The modified result parameter or a new instance if the result parameter was not supplied.
  18018. */
  18019. getValue(time: JulianDate, result?: any): any;
  18020. /**
  18021. * Compares this property to the provided property and returns
  18022. * <code>true</code> if they are equal, <code>false</code> otherwise.
  18023. * @param [other] - The other property.
  18024. * @returns <code>true</code> if left and right are equal, <code>false</code> otherwise.
  18025. */
  18026. equals(other?: Property): boolean;
  18027. }
  18028. /**
  18029. * Representation of <Camera> from KML
  18030. * @param position - camera position
  18031. * @param headingPitchRoll - camera orientation
  18032. */
  18033. export class KmlCamera {
  18034. constructor(position: Cartesian3, headingPitchRoll: HeadingPitchRoll);
  18035. }
  18036. export namespace KmlDataSource {
  18037. /**
  18038. * Initialization options for the `load` method.
  18039. * @property [sourceUri] - Overrides the url to use for resolving relative links and other KML network features.
  18040. * @property [clampToGround = false] - true if we want the geometry features (Polygons, LineStrings and LinearRings) clamped to the ground.
  18041. * @property [ellipsoid = Ellipsoid.WGS84] - The global ellipsoid used for geographical calculations.
  18042. * @property [screenOverlayContainer] - A container for ScreenOverlay images.
  18043. */
  18044. type LoadOptions = {
  18045. sourceUri?: string;
  18046. clampToGround?: boolean;
  18047. ellipsoid?: Ellipsoid;
  18048. screenOverlayContainer?: Element | string;
  18049. };
  18050. /**
  18051. * Options for constructing a new KmlDataSource, or calling the `load` method.
  18052. * @property [camera] - The camera that is used for viewRefreshModes and sending camera properties to network links.
  18053. * @property [canvas] - The canvas that is used for sending viewer properties to network links.
  18054. * @property [credit] - A credit for the data source, which is displayed on the canvas.
  18055. * @property [sourceUri] - Overrides the url to use for resolving relative links and other KML network features.
  18056. * @property [clampToGround = false] - true if we want the geometry features (Polygons, LineStrings and LinearRings) clamped to the ground.
  18057. * @property [ellipsoid = Ellipsoid.WGS84] - The global ellipsoid used for geographical calculations.
  18058. * @property [screenOverlayContainer] - A container for ScreenOverlay images.
  18059. */
  18060. type ConstructorOptions = {
  18061. camera?: Camera;
  18062. canvas?: HTMLCanvasElement;
  18063. credit?: Credit | string;
  18064. sourceUri?: string;
  18065. clampToGround?: boolean;
  18066. ellipsoid?: Ellipsoid;
  18067. screenOverlayContainer?: Element | string;
  18068. };
  18069. }
  18070. /**
  18071. * A {@link DataSource} which processes Keyhole Markup Language 2.2 (KML).
  18072. * <p>
  18073. * Non visual feature data, such as <code>atom:author</code> and <code>ExtendedData</code>
  18074. * is exposed via an instance of {@link KmlFeatureData}, which is added to each {@link Entity}
  18075. * under the <code>kml</code> property.
  18076. * </p>
  18077. * @example
  18078. * const viewer = new SuperMap.Viewer('CesiumContainer');
  18079. * viewer.dataSources.add(SuperMap.KmlDataSource.load('../../SampleData/facilities.kmz',
  18080. * {
  18081. * camera: viewer.scene.camera,
  18082. * canvas: viewer.scene.canvas
  18083. * })
  18084. * );
  18085. * @param [options] - Object describing initialization options
  18086. */
  18087. export class KmlDataSource {
  18088. constructor(options?: KmlDataSource.ConstructorOptions);
  18089. /**
  18090. * The current size of this Canvas will be used to populate the Link parameters
  18091. * for client height and width.
  18092. */
  18093. canvas: HTMLCanvasElement | undefined;
  18094. /**
  18095. * The position and orientation of this {@link Camera} will be used to
  18096. * populate various camera parameters when making network requests.
  18097. * Camera movement will determine when to trigger NetworkLink refresh if
  18098. * <code>viewRefreshMode</code> is <code>onStop</code>.
  18099. */
  18100. camera: Camera | undefined;
  18101. /**
  18102. * Creates a Promise to a new instance loaded with the provided KML data.
  18103. * @param data - A url, parsed KML document, or Blob containing binary KMZ data or a parsed KML document.
  18104. * @param [options] - An object specifying configuration options
  18105. * @returns A promise that will resolve to a new KmlDataSource instance once the KML is loaded.
  18106. */
  18107. load(data: Resource | string | Document | Blob, options?: KmlDataSource.ConstructorOptions): Promise<KmlDataSource>;
  18108. /**
  18109. * Gets or sets a human-readable name for this instance.
  18110. * This will be automatically be set to the KML document name on load.
  18111. */
  18112. name: string;
  18113. /**
  18114. * Gets the clock settings defined by the loaded KML. This represents the total
  18115. * availability interval for all time-dynamic data. If the KML does not contain
  18116. * time-dynamic data, this value is undefined.
  18117. */
  18118. clock: DataSourceClock;
  18119. /**
  18120. * Gets the collection of {@link Entity} instances.
  18121. */
  18122. entities: EntityCollection;
  18123. /**
  18124. * Gets a value indicating if the data source is currently loading data.
  18125. */
  18126. isLoading: boolean;
  18127. /**
  18128. * Gets an event that will be raised when the underlying data changes.
  18129. */
  18130. changedEvent: Event;
  18131. /**
  18132. * Gets an event that will be raised if an error is encountered during processing.
  18133. */
  18134. errorEvent: Event;
  18135. /**
  18136. * Gets an event that will be raised when the data source either starts or stops loading.
  18137. */
  18138. loadingEvent: Event;
  18139. /**
  18140. * Gets an event that will be raised when the data source refreshes a network link.
  18141. */
  18142. refreshEvent: Event;
  18143. /**
  18144. * Gets an event that will be raised when the data source finds an unsupported node type.
  18145. */
  18146. unsupportedNodeEvent: Event;
  18147. /**
  18148. * Gets whether or not this data source should be displayed.
  18149. */
  18150. show: boolean;
  18151. /**
  18152. * Gets or sets the clustering options for this data source. This object can be shared between multiple data sources.
  18153. */
  18154. clustering: EntityCluster;
  18155. /**
  18156. * Gets the credit that will be displayed for the data source
  18157. */
  18158. credit: Credit;
  18159. /**
  18160. * Gets the KML Tours that are used to guide the camera to specified destinations on given time intervals.
  18161. */
  18162. kmlTours: KmlTour[];
  18163. /**
  18164. * Asynchronously loads the provided KML data, replacing any existing data.
  18165. * @param data - A url, parsed KML document, or Blob containing binary KMZ data or a parsed KML document.
  18166. * @param [options] - An object specifying configuration options
  18167. * @returns A promise that will resolve to this instances once the KML is loaded.
  18168. */
  18169. load(data: Resource | string | Document | Blob, options?: KmlDataSource.LoadOptions): Promise<KmlDataSource>;
  18170. /**
  18171. * Cleans up any non-entity elements created by the data source. Currently this only affects ScreenOverlay elements.
  18172. */
  18173. destroy(): void;
  18174. /**
  18175. * Updates any NetworkLink that require updating.
  18176. * @param time - The simulation time.
  18177. * @returns True if this data source is ready to be displayed at the provided time, false otherwise.
  18178. */
  18179. update(time: JulianDate): boolean;
  18180. }
  18181. /**
  18182. * @param position - camera position
  18183. * @param headingPitchRange - camera orientation
  18184. */
  18185. export class KmlLookAt {
  18186. constructor(position: Cartesian3, headingPitchRange: HeadingPitchRange);
  18187. }
  18188. /**
  18189. * Describes a KmlTour, which uses KmlTourFlyTo, and KmlTourWait to
  18190. * guide the camera to a specified destinations on given time intervals.
  18191. * @param name - name parsed from KML
  18192. * @param id - id parsed from KML
  18193. * @param playlist - array with KmlTourFlyTos and KmlTourWaits
  18194. */
  18195. export class KmlTour {
  18196. constructor(name: string, id: string, playlist: any[]);
  18197. /**
  18198. * Id of kml gx:Tour entry
  18199. */
  18200. id: string;
  18201. /**
  18202. * Tour name
  18203. */
  18204. name: string;
  18205. /**
  18206. * Index of current entry from playlist
  18207. */
  18208. playlistIndex: number;
  18209. /**
  18210. * Array of playlist entries
  18211. */
  18212. playlist: any[];
  18213. /**
  18214. * Event will be called when tour starts to play,
  18215. * before any playlist entry starts to play.
  18216. */
  18217. tourStart: Event;
  18218. /**
  18219. * Event will be called when all playlist entries are
  18220. * played, or tour playback being canceled.
  18221. *
  18222. * If tour playback was terminated, event callback will
  18223. * be called with terminated=true parameter.
  18224. */
  18225. tourEnd: Event;
  18226. /**
  18227. * Event will be called when entry from playlist starts to play.
  18228. *
  18229. * Event callback will be called with curent entry as first parameter.
  18230. */
  18231. entryStart: Event;
  18232. /**
  18233. * Event will be called when entry from playlist ends to play.
  18234. *
  18235. * Event callback will be called with following parameters:
  18236. * 1. entry - entry
  18237. * 2. terminated - true if playback was terminated by calling {@link KmlTour#stop}
  18238. */
  18239. entryEnd: Event;
  18240. /**
  18241. * Add entry to this tour playlist.
  18242. * @param entry - an entry to add to the playlist.
  18243. */
  18244. addPlaylistEntry(entry: KmlTourFlyTo | KmlTourWait): void;
  18245. /**
  18246. * Play this tour.
  18247. * @param viewer - viewer widget.
  18248. * @param [cameraOptions] - these options will be merged with {@link Camera#flyTo}
  18249. * options for FlyTo playlist entries.
  18250. */
  18251. play(viewer: Viewer, cameraOptions?: any): void;
  18252. /**
  18253. * Stop curently playing tour.
  18254. */
  18255. stop(): void;
  18256. }
  18257. /**
  18258. * Transitions the KmlTour to the next destination. This transition is facilitated
  18259. * using a specified flyToMode over a given number of seconds.
  18260. * @param duration - entry duration
  18261. * @param flyToMode - KML fly to mode: bounce, smooth, etc
  18262. * @param view - KmlCamera or KmlLookAt
  18263. */
  18264. export class KmlTourFlyTo {
  18265. constructor(duration: number, flyToMode: string, view: KmlCamera | KmlLookAt);
  18266. /**
  18267. * Play this playlist entry
  18268. * @param done - function which will be called when playback ends
  18269. * @param camera - SuperMap camera
  18270. * @param [cameraOptions] - which will be merged with camera flyTo options. See {@link Camera#flyTo}
  18271. */
  18272. play(done: KmlTourFlyTo.DoneCallback, camera: Camera, cameraOptions?: any): void;
  18273. /**
  18274. * Stop execution of curent entry. Cancel camera flyTo
  18275. */
  18276. stop(): void;
  18277. /**
  18278. * Returns options for {@link Camera#flyTo} or {@link Camera#flyToBoundingSphere}
  18279. * depends on this.view type.
  18280. * @param cameraOptions - options to merge with generated. See {@link Camera#flyTo}
  18281. * @returns {@link Camera#flyTo} or {@link Camera#flyToBoundingSphere} options
  18282. */
  18283. getCameraOptions(cameraOptions: any): any;
  18284. }
  18285. export namespace KmlTourFlyTo {
  18286. /**
  18287. * A function that will be executed when the flight completes.
  18288. * @param terminated - true if {@link KmlTourFlyTo#stop} was
  18289. * called before entry done playback.
  18290. */
  18291. type DoneCallback = (terminated: boolean) => void;
  18292. }
  18293. /**
  18294. * Pauses the KmlTour for a given number of seconds.
  18295. * @param duration - entry duration
  18296. */
  18297. export class KmlTourWait {
  18298. constructor(duration: number);
  18299. /**
  18300. * Play this playlist entry
  18301. * @param done - function which will be called when playback ends
  18302. */
  18303. play(done: KmlTourWait.DoneCallback): void;
  18304. /**
  18305. * Stop execution of curent entry, cancel curent timeout
  18306. */
  18307. stop(): void;
  18308. }
  18309. export namespace KmlTourWait {
  18310. /**
  18311. * A function which will be called when playback ends.
  18312. * @param terminated - true if {@link KmlTourWait#stop} was
  18313. * called before entry done playback.
  18314. */
  18315. type DoneCallback = (terminated: boolean) => void;
  18316. }
  18317. export namespace LabelGraphics {
  18318. /**
  18319. * Initialization options for the LabelGraphics constructor
  18320. * @property [show = true] - A boolean Property specifying the visibility of the label.
  18321. * @property [text] - A Property specifying the text. Explicit newlines '\n' are supported.
  18322. * @property [font = '30px sans-serif'] - A Property specifying the CSS font.
  18323. * @property [style = LabelStyle.FILL] - A Property specifying the {@link LabelStyle}.
  18324. * @property [scale = 1.0] - A numeric Property specifying the scale to apply to the text.
  18325. * @property [showBackground = false] - A boolean Property specifying the visibility of the background behind the label.
  18326. * @property [backgroundColor = new Color(0.165, 0.165, 0.165, 0.8)] - A Property specifying the background {@link Color}.
  18327. * @property [backgroundPadding = new Cartesian2(7, 5)] - A {@link Cartesian2} Property specifying the horizontal and vertical background padding in pixels.
  18328. * @property [pixelOffset = Cartesian2.ZERO] - A {@link Cartesian2} Property specifying the pixel offset.
  18329. * @property [eyeOffset = Cartesian3.ZERO] - A {@link Cartesian3} Property specifying the eye offset.
  18330. * @property [horizontalOrigin = HorizontalOrigin.CENTER] - A Property specifying the {@link HorizontalOrigin}.
  18331. * @property [verticalOrigin = VerticalOrigin.CENTER] - A Property specifying the {@link VerticalOrigin}.
  18332. * @property [heightReference = HeightReference.NONE] - A Property specifying what the height is relative to.
  18333. * @property [fillColor = Color.WHITE] - A Property specifying the fill {@link Color}.
  18334. * @property [outlineColor = Color.BLACK] - A Property specifying the outline {@link Color}.
  18335. * @property [outlineWidth = 1.0] - A numeric Property specifying the outline width.
  18336. * @property [translucencyByDistance] - A {@link NearFarScalar} Property used to set translucency based on distance from the camera.
  18337. * @property [pixelOffsetScaleByDistance] - A {@link NearFarScalar} Property used to set pixelOffset based on distance from the camera.
  18338. * @property [scaleByDistance] - A {@link NearFarScalar} Property used to set scale based on distance from the camera.
  18339. * @property [distanceDisplayCondition] - A Property specifying at what distance from the camera that this label will be displayed.
  18340. * @property [disableDepthTestDistance] - A Property specifying the distance from the camera at which to disable the depth test to.
  18341. */
  18342. type ConstructorOptions = {
  18343. show?: Property | boolean;
  18344. text?: Property | string;
  18345. font?: Property | string;
  18346. style?: Property | LabelStyle;
  18347. scale?: Property | number;
  18348. showBackground?: Property | boolean;
  18349. backgroundColor?: Property | Color;
  18350. backgroundPadding?: Property | Cartesian2;
  18351. pixelOffset?: Property | Cartesian2;
  18352. eyeOffset?: Property | Cartesian3;
  18353. horizontalOrigin?: Property | HorizontalOrigin;
  18354. verticalOrigin?: Property | VerticalOrigin;
  18355. heightReference?: Property | HeightReference;
  18356. fillColor?: Property | Color;
  18357. outlineColor?: Property | Color;
  18358. outlineWidth?: Property | number;
  18359. translucencyByDistance?: Property | NearFarScalar;
  18360. pixelOffsetScaleByDistance?: Property | NearFarScalar;
  18361. scaleByDistance?: Property | NearFarScalar;
  18362. distanceDisplayCondition?: Property | DistanceDisplayCondition;
  18363. disableDepthTestDistance?: Property | number;
  18364. };
  18365. }
  18366. /**
  18367. * Describes a two dimensional label located at the position of the containing {@link Entity}.
  18368. * <p>
  18369. * <div align='center'>
  18370. * <img src='Images/Label.png' width='400' height='300' /><br />
  18371. * Example labels
  18372. * </div>
  18373. * </p>
  18374. * @param [options] - Object describing initialization options
  18375. */
  18376. export class LabelGraphics {
  18377. constructor(options?: LabelGraphics.ConstructorOptions);
  18378. /**
  18379. * Gets the event that is raised whenever a property or sub-property is changed or modified.
  18380. */
  18381. readonly definitionChanged: Event;
  18382. /**
  18383. * Gets or sets the boolean Property specifying the visibility of the label.
  18384. */
  18385. show: Property | undefined;
  18386. /**
  18387. * Gets or sets the string Property specifying the text of the label.
  18388. * Explicit newlines '\n' are supported.
  18389. */
  18390. text: Property | undefined;
  18391. /**
  18392. * Gets or sets the string Property specifying the font in CSS syntax.
  18393. */
  18394. font: Property | undefined;
  18395. /**
  18396. * Gets or sets the Property specifying the {@link LabelStyle}.
  18397. */
  18398. style: Property | undefined;
  18399. /**
  18400. * Gets or sets the numeric Property specifying the uniform scale to apply to the image.
  18401. * A scale greater than <code>1.0</code> enlarges the label while a scale less than <code>1.0</code> shrinks it.
  18402. * <p>
  18403. * <div align='center'>
  18404. * <img src='Images/Label.setScale.png' width='400' height='300' /><br/>
  18405. * From left to right in the above image, the scales are <code>0.5</code>, <code>1.0</code>,
  18406. * and <code>2.0</code>.
  18407. * </div>
  18408. * </p>
  18409. */
  18410. scale: Property | undefined;
  18411. /**
  18412. * Gets or sets the boolean Property specifying the visibility of the background behind the label.
  18413. */
  18414. showBackground: Property | undefined;
  18415. /**
  18416. * Gets or sets the Property specifying the background {@link Color}.
  18417. */
  18418. backgroundColor: Property | undefined;
  18419. /**
  18420. * Gets or sets the {@link Cartesian2} Property specifying the label's horizontal and vertical
  18421. * background padding in pixels.
  18422. */
  18423. backgroundPadding: Property | undefined;
  18424. /**
  18425. * Gets or sets the {@link Cartesian2} Property specifying the label's pixel offset in screen space
  18426. * from the origin of this label. This is commonly used to align multiple labels and labels at
  18427. * the same position, e.g., an image and text. The screen space origin is the top, left corner of the
  18428. * canvas; <code>x</code> increases from left to right, and <code>y</code> increases from top to bottom.
  18429. * <p>
  18430. * <div align='center'>
  18431. * <table border='0' cellpadding='5'><tr>
  18432. * <td align='center'><code>default</code><br/><img src='Images/Label.setPixelOffset.default.png' width='250' height='188' /></td>
  18433. * <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>
  18434. * </tr></table>
  18435. * The label's origin is indicated by the yellow point.
  18436. * </div>
  18437. * </p>
  18438. */
  18439. pixelOffset: Property | undefined;
  18440. /**
  18441. * Gets or sets the {@link Cartesian3} Property specifying the label's offset in eye coordinates.
  18442. * Eye coordinates is a left-handed coordinate system, where <code>x</code> points towards the viewer's
  18443. * right, <code>y</code> points up, and <code>z</code> points into the screen.
  18444. * <p>
  18445. * An eye offset is commonly used to arrange multiple labels or objects at the same position, e.g., to
  18446. * arrange a label above its corresponding 3D model.
  18447. * </p>
  18448. * Below, the label is positioned at the center of the Earth but an eye offset makes it always
  18449. * appear on top of the Earth regardless of the viewer's or Earth's orientation.
  18450. * <p>
  18451. * <div align='center'>
  18452. * <table border='0' cellpadding='5'><tr>
  18453. * <td align='center'><img src='Images/Billboard.setEyeOffset.one.png' width='250' height='188' /></td>
  18454. * <td align='center'><img src='Images/Billboard.setEyeOffset.two.png' width='250' height='188' /></td>
  18455. * </tr></table>
  18456. * <code>l.eyeOffset = new Cartesian3(0.0, 8000000.0, 0.0);</code><br /><br />
  18457. * </div>
  18458. * </p>
  18459. */
  18460. eyeOffset: Property | undefined;
  18461. /**
  18462. * Gets or sets the Property specifying the {@link HorizontalOrigin}.
  18463. */
  18464. horizontalOrigin: Property | undefined;
  18465. /**
  18466. * Gets or sets the Property specifying the {@link VerticalOrigin}.
  18467. */
  18468. verticalOrigin: Property | undefined;
  18469. /**
  18470. * Gets or sets the Property specifying the {@link HeightReference}.
  18471. */
  18472. heightReference: Property | undefined;
  18473. /**
  18474. * Gets or sets the Property specifying the fill {@link Color}.
  18475. */
  18476. fillColor: Property | undefined;
  18477. /**
  18478. * Gets or sets the Property specifying the outline {@link Color}.
  18479. */
  18480. outlineColor: Property | undefined;
  18481. /**
  18482. * Gets or sets the numeric Property specifying the outline width.
  18483. */
  18484. outlineWidth: Property | undefined;
  18485. /**
  18486. * Gets or sets {@link NearFarScalar} Property specifying the translucency of the label based on the distance from the camera.
  18487. * A label's translucency will interpolate between the {@link NearFarScalar#nearValue} and
  18488. * {@link NearFarScalar#farValue} while the camera distance falls within the lower and upper bounds
  18489. * of the specified {@link NearFarScalar#near} and {@link NearFarScalar#far}.
  18490. * Outside of these ranges the label's translucency remains clamped to the nearest bound.
  18491. */
  18492. translucencyByDistance: Property | undefined;
  18493. /**
  18494. * Gets or sets {@link NearFarScalar} Property specifying the pixel offset of the label based on the distance from the camera.
  18495. * A label's pixel offset will interpolate between the {@link NearFarScalar#nearValue} and
  18496. * {@link NearFarScalar#farValue} while the camera distance falls within the lower and upper bounds
  18497. * of the specified {@link NearFarScalar#near} and {@link NearFarScalar#far}.
  18498. * Outside of these ranges the label's pixel offset remains clamped to the nearest bound.
  18499. */
  18500. pixelOffsetScaleByDistance: Property | undefined;
  18501. /**
  18502. * Gets or sets near and far scaling properties of a Label based on the label's distance from the camera.
  18503. * A label's scale will interpolate between the {@link NearFarScalar#nearValue} and
  18504. * {@link NearFarScalar#farValue} while the camera distance falls within the lower and upper bounds
  18505. * of the specified {@link NearFarScalar#near} and {@link NearFarScalar#far}.
  18506. * Outside of these ranges the label's scale remains clamped to the nearest bound. If undefined,
  18507. * scaleByDistance will be disabled.
  18508. */
  18509. scaleByDistance: Property | undefined;
  18510. /**
  18511. * Gets or sets the {@link DistanceDisplayCondition} Property specifying at what distance from the camera that this label will be displayed.
  18512. */
  18513. distanceDisplayCondition: Property | undefined;
  18514. /**
  18515. * Gets or sets the distance from the camera at which to disable the depth test to, for example, prevent clipping against terrain.
  18516. * When set to zero, the depth test is always applied. When set to Number.POSITIVE_INFINITY, the depth test is never applied.
  18517. */
  18518. disableDepthTestDistance: Property | undefined;
  18519. /**
  18520. * Duplicates this instance.
  18521. * @param [result] - The object onto which to store the result.
  18522. * @returns The modified result parameter or a new instance if one was not provided.
  18523. */
  18524. clone(result?: LabelGraphics): LabelGraphics;
  18525. /**
  18526. * Assigns each unassigned property on this object to the value
  18527. * of the same property on the provided source object.
  18528. * @param source - The object to be merged into this object.
  18529. */
  18530. merge(source: LabelGraphics): void;
  18531. }
  18532. /**
  18533. * A {@link Visualizer} which maps the {@link LabelGraphics} instance
  18534. * in {@link Entity#label} to a {@link Label}.
  18535. * @param entityCluster - The entity cluster to manage the collection of billboards and optionally cluster with other entities.
  18536. * @param entityCollection - The entityCollection to visualize.
  18537. */
  18538. export class LabelVisualizer {
  18539. constructor(entityCluster: EntityCluster, entityCollection: EntityCollection);
  18540. /**
  18541. * Updates the primitives created by this visualizer to match their
  18542. * Entity counterpart at the given time.
  18543. * @param time - The time to update to.
  18544. * @returns This function always returns true.
  18545. */
  18546. update(time: JulianDate): boolean;
  18547. /**
  18548. * Returns true if this object was destroyed; otherwise, false.
  18549. * @returns True if this object was destroyed; otherwise, false.
  18550. */
  18551. isDestroyed(): boolean;
  18552. /**
  18553. * Removes and destroys all primitives created by this instance.
  18554. */
  18555. destroy(): void;
  18556. }
  18557. /**
  18558. * The interface for all {@link Property} objects that represent {@link Material} uniforms.
  18559. * This type defines an interface and cannot be instantiated directly.
  18560. */
  18561. export class MaterialProperty {
  18562. constructor();
  18563. /**
  18564. * Gets a value indicating if this property is constant. A property is considered
  18565. * constant if getValue always returns the same result for the current definition.
  18566. */
  18567. readonly isConstant: boolean;
  18568. /**
  18569. * Gets the event that is raised whenever the definition of this property changes.
  18570. * The definition is considered to have changed if a call to getValue would return
  18571. * a different result for the same time.
  18572. */
  18573. readonly definitionChanged: Event;
  18574. /**
  18575. * Gets the {@link Material} type at the provided time.
  18576. * @param time - The time for which to retrieve the type.
  18577. * @returns The type of material.
  18578. */
  18579. getType(time: JulianDate): string;
  18580. /**
  18581. * Gets the value of the property at the provided time.
  18582. * @param time - The time for which to retrieve the value.
  18583. * @param [result] - The object to store the value into, if omitted, a new instance is created and returned.
  18584. * @returns The modified result parameter or a new instance if the result parameter was not supplied.
  18585. */
  18586. getValue(time: JulianDate, result?: any): any;
  18587. /**
  18588. * Compares this property to the provided property and returns
  18589. * <code>true</code> if they are equal, <code>false</code> otherwise.
  18590. * @param [other] - The other property.
  18591. * @returns <code>true</code> if left and right are equal, <code>false</code> otherwise.
  18592. */
  18593. equals(other?: Property): boolean;
  18594. }
  18595. export namespace PointGraphics {
  18596. /**
  18597. * Initialization options for the PointGraphics constructor
  18598. * @property [show = true] - A boolean Property specifying the visibility of the point.
  18599. * @property [pixelSize = 1] - A numeric Property specifying the size in pixels.
  18600. * @property [heightReference = HeightReference.NONE] - A Property specifying what the height is relative to.
  18601. * @property [color = Color.WHITE] - A Property specifying the {@link Color} of the point.
  18602. * @property [outlineColor = Color.BLACK] - A Property specifying the {@link Color} of the outline.
  18603. * @property [outlineWidth = 0] - A numeric Property specifying the the outline width in pixels.
  18604. * @property [scaleByDistance] - A {@link NearFarScalar} Property used to scale the point based on distance.
  18605. * @property [translucencyByDistance] - A {@link NearFarScalar} Property used to set translucency based on distance from the camera.
  18606. * @property [distanceDisplayCondition] - A Property specifying at what distance from the camera that this point will be displayed.
  18607. * @property [disableDepthTestDistance] - A Property specifying the distance from the camera at which to disable the depth test to.
  18608. */
  18609. type ConstructorOptions = {
  18610. show?: Property | boolean;
  18611. pixelSize?: Property | number;
  18612. heightReference?: Property | HeightReference;
  18613. color?: Property | Color;
  18614. outlineColor?: Property | Color;
  18615. outlineWidth?: Property | number;
  18616. scaleByDistance?: Property | NearFarScalar;
  18617. translucencyByDistance?: Property | NearFarScalar;
  18618. distanceDisplayCondition?: Property | DistanceDisplayCondition;
  18619. disableDepthTestDistance?: Property | number;
  18620. };
  18621. }
  18622. /**
  18623. * Describes a graphical point located at the position of the containing {@link Entity}.
  18624. * @param [options] - Object describing initialization options
  18625. */
  18626. export class PointGraphics {
  18627. constructor(options?: PointGraphics.ConstructorOptions);
  18628. /**
  18629. * Gets the event that is raised whenever a property or sub-property is changed or modified.
  18630. */
  18631. readonly definitionChanged: Event;
  18632. /**
  18633. * Gets or sets the boolean Property specifying the visibility of the point.
  18634. */
  18635. show: Property | undefined;
  18636. /**
  18637. * Gets or sets the numeric Property specifying the size in pixels.
  18638. */
  18639. pixelSize: Property | undefined;
  18640. /**
  18641. * Gets or sets the Property specifying the {@link HeightReference}.
  18642. */
  18643. heightReference: Property | undefined;
  18644. /**
  18645. * Gets or sets the Property specifying the {@link Color} of the point.
  18646. */
  18647. color: Property | undefined;
  18648. /**
  18649. * Gets or sets the Property specifying the {@link Color} of the outline.
  18650. */
  18651. outlineColor: Property | undefined;
  18652. /**
  18653. * Gets or sets the numeric Property specifying the the outline width in pixels.
  18654. */
  18655. outlineWidth: Property | undefined;
  18656. /**
  18657. * Gets or sets the {@link NearFarScalar} Property used to scale the point based on distance.
  18658. * If undefined, a constant size is used.
  18659. */
  18660. scaleByDistance: Property | undefined;
  18661. /**
  18662. * Gets or sets {@link NearFarScalar} Property specifying the translucency of the point based on the distance from the camera.
  18663. * A point's translucency will interpolate between the {@link NearFarScalar#nearValue} and
  18664. * {@link NearFarScalar#farValue} while the camera distance falls within the lower and upper bounds
  18665. * of the specified {@link NearFarScalar#near} and {@link NearFarScalar#far}.
  18666. * Outside of these ranges the points's translucency remains clamped to the nearest bound.
  18667. */
  18668. translucencyByDistance: Property | undefined;
  18669. /**
  18670. * Gets or sets the {@link DistanceDisplayCondition} Property specifying at what distance from the camera that this point will be displayed.
  18671. */
  18672. distanceDisplayCondition: Property | undefined;
  18673. /**
  18674. * Gets or sets the distance from the camera at which to disable the depth test to, for example, prevent clipping against terrain.
  18675. * When set to zero, the depth test is always applied. When set to Number.POSITIVE_INFINITY, the depth test is never applied.
  18676. */
  18677. disableDepthTestDistance: Property | undefined;
  18678. /**
  18679. * Duplicates this instance.
  18680. * @param [result] - The object onto which to store the result.
  18681. * @returns The modified result parameter or a new instance if one was not provided.
  18682. */
  18683. clone(result?: PointGraphics): PointGraphics;
  18684. /**
  18685. * Assigns each unassigned property on this object to the value
  18686. * of the same property on the provided source object.
  18687. * @param source - The object to be merged into this object.
  18688. */
  18689. merge(source: PointGraphics): void;
  18690. }
  18691. /**
  18692. * A {@link Visualizer} which maps {@link Entity#point} to a {@link PointPrimitive}.
  18693. * @param entityCluster - The entity cluster to manage the collection of billboards and optionally cluster with other entities.
  18694. * @param entityCollection - The entityCollection to visualize.
  18695. */
  18696. export class PointVisualizer {
  18697. constructor(entityCluster: EntityCluster, entityCollection: EntityCollection);
  18698. /**
  18699. * Updates the primitives created by this visualizer to match their
  18700. * Entity counterpart at the given time.
  18701. * @param time - The time to update to.
  18702. * @returns This function always returns true.
  18703. */
  18704. update(time: JulianDate): boolean;
  18705. /**
  18706. * Returns true if this object was destroyed; otherwise, false.
  18707. * @returns True if this object was destroyed; otherwise, false.
  18708. */
  18709. isDestroyed(): boolean;
  18710. /**
  18711. * Removes and destroys all primitives created by this instance.
  18712. */
  18713. destroy(): void;
  18714. }
  18715. /**
  18716. * A {@link GeometryUpdater} for polygons.
  18717. * Clients do not normally create this class directly, but instead rely on {@link DataSourceDisplay}.
  18718. * @param entity - The entity containing the geometry to be visualized.
  18719. * @param scene - The scene where visualization is taking place.
  18720. */
  18721. export class PolygonGeometryUpdater {
  18722. constructor(entity: Entity, scene: Scene);
  18723. /**
  18724. * Creates the geometry instance which represents the fill of the geometry.
  18725. * @param time - The time to use when retrieving initial attribute values.
  18726. * @returns The geometry instance representing the filled portion of the geometry.
  18727. */
  18728. createFillGeometryInstance(time: JulianDate): GeometryInstance;
  18729. /**
  18730. * Creates the geometry instance which represents the outline of the geometry.
  18731. * @param time - The time to use when retrieving initial attribute values.
  18732. * @returns The geometry instance representing the outline portion of the geometry.
  18733. */
  18734. createOutlineGeometryInstance(time: JulianDate): GeometryInstance;
  18735. }
  18736. export namespace PolygonGraphics {
  18737. /**
  18738. * Initialization options for the PolygonGraphics constructor
  18739. * @property [show = true] - A boolean Property specifying the visibility of the polygon.
  18740. * @property [hierarchy] - A Property specifying the {@link PolygonHierarchy}.
  18741. * @property [height = 0] - A numeric Property specifying the altitude of the polygon relative to the ellipsoid surface.
  18742. * @property [heightReference = HeightReference.NONE] - A Property specifying what the height is relative to.
  18743. * @property [extrudedHeight] - A numeric Property specifying the altitude of the polygon's extruded face relative to the ellipsoid surface.
  18744. * @property [extrudedHeightReference = HeightReference.NONE] - A Property specifying what the extrudedHeight is relative to.
  18745. * @property [stRotation = 0.0] - A numeric property specifying the rotation of the polygon texture counter-clockwise from north. Only has an effect if textureCoordinates is not defined.
  18746. * @property [granularity = SuperMap.Math.RADIANS_PER_DEGREE] - A numeric Property specifying the angular distance between each latitude and longitude point.
  18747. * @property [fill = true] - A boolean Property specifying whether the polygon is filled with the provided material.
  18748. * @property [material = Color.WHITE] - A Property specifying the material used to fill the polygon.
  18749. * @property [outline = false] - A boolean Property specifying whether the polygon is outlined.
  18750. * @property [outlineColor = Color.BLACK] - A Property specifying the {@link Color} of the outline.
  18751. * @property [outlineWidth = 1.0] - A numeric Property specifying the width of the outline.
  18752. * @property [perPositionHeight = false] - A boolean specifying whether or not the height of each position is used.
  18753. * @property [closeTop = true] - When false, leaves off the top of an extruded polygon open.
  18754. * @property [closeBottom = true] - When false, leaves off the bottom of an extruded polygon open.
  18755. * @property [arcType = ArcType.GEODESIC] - The type of line the polygon edges must follow.
  18756. * @property [shadows = ShadowMode.DISABLED] - An enum Property specifying whether the polygon casts or receives shadows from light sources.
  18757. * @property [distanceDisplayCondition] - A Property specifying at what distance from the camera that this polygon will be displayed.
  18758. * @property [classificationType = ClassificationType.BOTH] - An enum Property specifying whether this polygon will classify terrain, 3D Tiles, or both when on the ground.
  18759. * @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.
  18760. * @property [textureCoordinates] - A Property specifying texture coordinates as a {@link PolygonHierarchy} of {@link Cartesian2} points. Has no effect for ground primitives.
  18761. */
  18762. type ConstructorOptions = {
  18763. show?: Property | boolean;
  18764. hierarchy?: Property | PolygonHierarchy;
  18765. height?: Property | number;
  18766. heightReference?: Property | HeightReference;
  18767. extrudedHeight?: Property | number;
  18768. extrudedHeightReference?: Property | HeightReference;
  18769. stRotation?: Property | number;
  18770. granularity?: Property | number;
  18771. fill?: Property | boolean;
  18772. material?: MaterialProperty | Color;
  18773. outline?: Property | boolean;
  18774. outlineColor?: Property | Color;
  18775. outlineWidth?: Property | number;
  18776. perPositionHeight?: Property | boolean;
  18777. closeTop?: boolean | boolean;
  18778. closeBottom?: boolean | boolean;
  18779. arcType?: Property | ArcType;
  18780. shadows?: Property | ShadowMode;
  18781. distanceDisplayCondition?: Property | DistanceDisplayCondition;
  18782. classificationType?: Property | ClassificationType;
  18783. zIndex?: ConstantProperty | number;
  18784. textureCoordinates?: Property | PolygonHierarchy;
  18785. };
  18786. }
  18787. /**
  18788. * Describes a polygon defined by an hierarchy of linear rings which make up the outer shape and any nested holes.
  18789. * The polygon conforms to the curvature of the globe and can be placed on the surface or
  18790. * at altitude and can optionally be extruded into a volume.
  18791. * @param [options] - Object describing initialization options
  18792. */
  18793. export class PolygonGraphics {
  18794. constructor(options?: PolygonGraphics.ConstructorOptions);
  18795. /**
  18796. * Gets the event that is raised whenever a property or sub-property is changed or modified.
  18797. */
  18798. readonly definitionChanged: Event;
  18799. /**
  18800. * Gets or sets the boolean Property specifying the visibility of the polygon.
  18801. */
  18802. show: Property | undefined;
  18803. /**
  18804. * Gets or sets the Property specifying the {@link PolygonHierarchy}.
  18805. */
  18806. hierarchy: Property | undefined;
  18807. /**
  18808. * Gets or sets the numeric Property specifying the constant altitude of the polygon.
  18809. */
  18810. height: Property | undefined;
  18811. /**
  18812. * Gets or sets the Property specifying the {@link HeightReference}.
  18813. */
  18814. heightReference: Property | undefined;
  18815. /**
  18816. * Gets or sets the numeric Property specifying the altitude of the polygon extrusion.
  18817. * If {@link PolygonGraphics#perPositionHeight} is false, the volume starts at {@link PolygonGraphics#height} and ends at this altitude.
  18818. * If {@link PolygonGraphics#perPositionHeight} is true, the volume starts at the height of each {@link PolygonGraphics#hierarchy} position and ends at this altitude.
  18819. */
  18820. extrudedHeight: Property | undefined;
  18821. /**
  18822. * Gets or sets the Property specifying the extruded {@link HeightReference}.
  18823. */
  18824. extrudedHeightReference: Property | undefined;
  18825. /**
  18826. * Gets or sets the numeric property specifying the rotation of the polygon texture counter-clockwise from north. Only has an effect if textureCoordinates is not defined.
  18827. */
  18828. stRotation: Property | undefined;
  18829. /**
  18830. * Gets or sets the numeric Property specifying the angular distance between points on the polygon.
  18831. */
  18832. granularity: Property | undefined;
  18833. /**
  18834. * Gets or sets the boolean Property specifying whether the polygon is filled with the provided material.
  18835. */
  18836. fill: Property | undefined;
  18837. /**
  18838. * Gets or sets the Property specifying the material used to fill the polygon.
  18839. */
  18840. material: MaterialProperty;
  18841. /**
  18842. * Gets or sets the Property specifying whether the polygon is outlined.
  18843. */
  18844. outline: Property | undefined;
  18845. /**
  18846. * Gets or sets the Property specifying the {@link Color} of the outline.
  18847. */
  18848. outlineColor: Property | undefined;
  18849. /**
  18850. * Gets or sets the numeric Property specifying the width of the outline.
  18851. */
  18852. outlineWidth: Property | undefined;
  18853. /**
  18854. * Gets or sets the boolean specifying whether or not the the height of each position is used.
  18855. * If true, the shape will have non-uniform altitude defined by the height of each {@link PolygonGraphics#hierarchy} position.
  18856. * If false, the shape will have a constant altitude as specified by {@link PolygonGraphics#height}.
  18857. */
  18858. perPositionHeight: Property | undefined;
  18859. /**
  18860. * Gets or sets a boolean specifying whether or not the top of an extruded polygon is included.
  18861. */
  18862. closeTop: Property | undefined;
  18863. /**
  18864. * Gets or sets a boolean specifying whether or not the bottom of an extruded polygon is included.
  18865. */
  18866. closeBottom: Property | undefined;
  18867. /**
  18868. * Gets or sets the {@link ArcType} Property specifying the type of lines the polygon edges use.
  18869. */
  18870. arcType: Property | undefined;
  18871. /**
  18872. * Get or sets the enum Property specifying whether the polygon
  18873. * casts or receives shadows from light sources.
  18874. */
  18875. shadows: Property | undefined;
  18876. /**
  18877. * Gets or sets the {@link DistanceDisplayCondition} Property specifying at what distance from the camera that this polygon will be displayed.
  18878. */
  18879. distanceDisplayCondition: Property | undefined;
  18880. /**
  18881. * Gets or sets the {@link ClassificationType} Property specifying whether this polygon will classify terrain, 3D Tiles, or both when on the ground.
  18882. */
  18883. classificationType: Property | undefined;
  18884. /**
  18885. * 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.
  18886. */
  18887. zIndex: ConstantProperty | undefined;
  18888. /**
  18889. * A Property specifying texture coordinates as a {@link PolygonHierarchy} of {@link Cartesian2} points. Has no effect for ground primitives.
  18890. */
  18891. textureCoordinates: Property | undefined;
  18892. /**
  18893. * Duplicates this instance.
  18894. * @param [result] - The object onto which to store the result.
  18895. * @returns The modified result parameter or a new instance if one was not provided.
  18896. */
  18897. clone(result?: PolygonGraphics): PolygonGraphics;
  18898. /**
  18899. * Assigns each unassigned property on this object to the value
  18900. * of the same property on the provided source object.
  18901. * @param source - The object to be merged into this object.
  18902. */
  18903. merge(source: PolygonGraphics): void;
  18904. }
  18905. /**
  18906. * A {@link MaterialProperty} that maps to PolylineArrow {@link Material} uniforms.
  18907. * @param [color = Color.WHITE] - The {@link Color} Property to be used.
  18908. */
  18909. export class PolylineArrowMaterialProperty {
  18910. constructor(color?: Property | Color);
  18911. /**
  18912. * Gets a value indicating if this property is constant. A property is considered
  18913. * constant if getValue always returns the same result for the current definition.
  18914. */
  18915. readonly isConstant: boolean;
  18916. /**
  18917. * Gets the event that is raised whenever the definition of this property changes.
  18918. * The definition is considered to have changed if a call to getValue would return
  18919. * a different result for the same time.
  18920. */
  18921. readonly definitionChanged: Event;
  18922. /**
  18923. * Gets or sets the {@link Color} {@link Property}.
  18924. */
  18925. color: Property | undefined;
  18926. /**
  18927. * Gets the {@link Material} type at the provided time.
  18928. * @param time - The time for which to retrieve the type.
  18929. * @returns The type of material.
  18930. */
  18931. getType(time: JulianDate): string;
  18932. /**
  18933. * Gets the value of the property at the provided time.
  18934. * @param time - The time for which to retrieve the value.
  18935. * @param [result] - The object to store the value into, if omitted, a new instance is created and returned.
  18936. * @returns The modified result parameter or a new instance if the result parameter was not supplied.
  18937. */
  18938. getValue(time: JulianDate, result?: any): any;
  18939. /**
  18940. * Compares this property to the provided property and returns
  18941. * <code>true</code> if they are equal, <code>false</code> otherwise.
  18942. * @param [other] - The other property.
  18943. * @returns <code>true</code> if left and right are equal, <code>false</code> otherwise.
  18944. */
  18945. equals(other?: Property): boolean;
  18946. }
  18947. /**
  18948. * A {@link MaterialProperty} that maps to polyline dash {@link Material} uniforms.
  18949. * @param [options] - Object with the following properties:
  18950. * @param [options.color = Color.WHITE] - A Property specifying the {@link Color} of the line.
  18951. * @param [options.gapColor = Color.TRANSPARENT] - A Property specifying the {@link Color} of the gaps in the line.
  18952. * @param [options.dashLength = 16.0] - A numeric Property specifying the length of the dash pattern in pixels.
  18953. * @param [options.dashPattern = 255.0] - A numeric Property specifying a 16 bit pattern for the dash
  18954. */
  18955. export class PolylineDashMaterialProperty {
  18956. constructor(options?: {
  18957. color?: Property | Color;
  18958. gapColor?: Property | Color;
  18959. dashLength?: Property | number;
  18960. dashPattern?: Property | number;
  18961. });
  18962. /**
  18963. * Gets a value indicating if this property is constant. A property is considered
  18964. * constant if getValue always returns the same result for the current definition.
  18965. */
  18966. readonly isConstant: boolean;
  18967. /**
  18968. * Gets the event that is raised whenever the definition of this property changes.
  18969. * The definition is considered to have changed if a call to getValue would return
  18970. * a different result for the same time.
  18971. */
  18972. readonly definitionChanged: Event;
  18973. /**
  18974. * Gets or sets the Property specifying the {@link Color} of the line.
  18975. */
  18976. color: Property | undefined;
  18977. /**
  18978. * Gets or sets the Property specifying the {@link Color} of the gaps in the line.
  18979. */
  18980. gapColor: Property | undefined;
  18981. /**
  18982. * Gets or sets the numeric Property specifying the length of a dash cycle
  18983. */
  18984. dashLength: Property | undefined;
  18985. /**
  18986. * Gets or sets the numeric Property specifying a dash pattern
  18987. */
  18988. dashPattern: Property | undefined;
  18989. /**
  18990. * Gets the {@link Material} type at the provided time.
  18991. * @param time - The time for which to retrieve the type.
  18992. * @returns The type of material.
  18993. */
  18994. getType(time: JulianDate): string;
  18995. /**
  18996. * Gets the value of the property at the provided time.
  18997. * @param time - The time for which to retrieve the value.
  18998. * @param [result] - The object to store the value into, if omitted, a new instance is created and returned.
  18999. * @returns The modified result parameter or a new instance if the result parameter was not supplied.
  19000. */
  19001. getValue(time: JulianDate, result?: any): any;
  19002. /**
  19003. * Compares this property to the provided property and returns
  19004. * <code>true</code> if they are equal, <code>false</code> otherwise.
  19005. * @param [other] - The other property.
  19006. * @returns <code>true</code> if left and right are equal, <code>false</code> otherwise.
  19007. */
  19008. equals(other?: Property): boolean;
  19009. }
  19010. /**
  19011. * A {@link GeometryUpdater} for polylines.
  19012. * Clients do not normally create this class directly, but instead rely on {@link DataSourceDisplay}.
  19013. * @param entity - The entity containing the geometry to be visualized.
  19014. * @param scene - The scene where visualization is taking place.
  19015. */
  19016. export class PolylineGeometryUpdater {
  19017. constructor(entity: Entity, scene: Scene);
  19018. /**
  19019. * Gets the unique ID associated with this updater
  19020. */
  19021. readonly id: string;
  19022. /**
  19023. * Gets the entity associated with this geometry.
  19024. */
  19025. readonly entity: Entity;
  19026. /**
  19027. * Gets a value indicating if the geometry has a fill component.
  19028. */
  19029. readonly fillEnabled: boolean;
  19030. /**
  19031. * Gets a value indicating if fill visibility varies with simulation time.
  19032. */
  19033. readonly hasConstantFill: boolean;
  19034. /**
  19035. * Gets the material property used to fill the geometry.
  19036. */
  19037. readonly fillMaterialProperty: MaterialProperty;
  19038. /**
  19039. * Gets the material property used to fill the geometry when it fails the depth test.
  19040. */
  19041. readonly depthFailMaterialProperty: MaterialProperty;
  19042. /**
  19043. * Gets a value indicating if the geometry has an outline component.
  19044. */
  19045. readonly outlineEnabled: boolean;
  19046. /**
  19047. * Gets a value indicating if outline visibility varies with simulation time.
  19048. */
  19049. readonly hasConstantOutline: boolean;
  19050. /**
  19051. * Gets the {@link Color} property for the geometry outline.
  19052. */
  19053. readonly outlineColorProperty: Property;
  19054. /**
  19055. * Gets the property specifying whether the geometry
  19056. * casts or receives shadows from light sources.
  19057. */
  19058. readonly shadowsProperty: Property;
  19059. /**
  19060. * Gets or sets the {@link DistanceDisplayCondition} Property specifying at what distance from the camera that this geometry will be displayed.
  19061. */
  19062. readonly distanceDisplayConditionProperty: Property;
  19063. /**
  19064. * Gets or sets the {@link ClassificationType} Property specifying if this geometry will classify terrain, 3D Tiles, or both when on the ground.
  19065. */
  19066. readonly classificationTypeProperty: Property;
  19067. /**
  19068. * Gets a value indicating if the geometry is time-varying.
  19069. * If true, all visualization is delegated to the {@link DynamicGeometryUpdater}
  19070. * returned by GeometryUpdater#createDynamicUpdater.
  19071. */
  19072. readonly isDynamic: boolean;
  19073. /**
  19074. * Gets a value indicating if the geometry is closed.
  19075. * This property is only valid for geometry.
  19076. */
  19077. readonly isClosed: boolean;
  19078. /**
  19079. * Gets an event that is raised whenever the public properties
  19080. * of this updater change.
  19081. */
  19082. readonly geometryChanged: boolean;
  19083. /**
  19084. * Gets a value indicating if the path of the line.
  19085. */
  19086. readonly arcType: ArcType;
  19087. /**
  19088. * Gets a value indicating if the geometry is clamped to the ground.
  19089. * Returns false if polylines on terrain is not supported.
  19090. */
  19091. readonly clampToGround: boolean;
  19092. /**
  19093. * Gets the zindex
  19094. */
  19095. readonly zIndex: number;
  19096. /**
  19097. * Checks if the geometry is outlined at the provided time.
  19098. * @param time - The time for which to retrieve visibility.
  19099. * @returns true if geometry is outlined at the provided time, false otherwise.
  19100. */
  19101. isOutlineVisible(time: JulianDate): boolean;
  19102. /**
  19103. * Checks if the geometry is filled at the provided time.
  19104. * @param time - The time for which to retrieve visibility.
  19105. * @returns true if geometry is filled at the provided time, false otherwise.
  19106. */
  19107. isFilled(time: JulianDate): boolean;
  19108. /**
  19109. * Creates the geometry instance which represents the fill of the geometry.
  19110. * @param time - The time to use when retrieving initial attribute values.
  19111. * @returns The geometry instance representing the filled portion of the geometry.
  19112. */
  19113. createFillGeometryInstance(time: JulianDate): GeometryInstance;
  19114. /**
  19115. * Creates the geometry instance which represents the outline of the geometry.
  19116. * @param time - The time to use when retrieving initial attribute values.
  19117. * @returns The geometry instance representing the outline portion of the geometry.
  19118. */
  19119. createOutlineGeometryInstance(time: JulianDate): GeometryInstance;
  19120. /**
  19121. * Returns true if this object was destroyed; otherwise, false.
  19122. * @returns True if this object was destroyed; otherwise, false.
  19123. */
  19124. isDestroyed(): boolean;
  19125. /**
  19126. * Destroys and resources used by the object. Once an object is destroyed, it should not be used.
  19127. */
  19128. destroy(): void;
  19129. }
  19130. /**
  19131. * A {@link MaterialProperty} that maps to polyline glow {@link Material} uniforms.
  19132. * @param [options] - Object with the following properties:
  19133. * @param [options.color = Color.WHITE] - A Property specifying the {@link Color} of the line.
  19134. * @param [options.glowPower = 0.25] - A numeric Property specifying the strength of the glow, as a percentage of the total line width.
  19135. * @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.
  19136. */
  19137. export class PolylineGlowMaterialProperty {
  19138. constructor(options?: {
  19139. color?: Property | Color;
  19140. glowPower?: Property | number;
  19141. taperPower?: Property | number;
  19142. });
  19143. /**
  19144. * Gets a value indicating if this property is constant. A property is considered
  19145. * constant if getValue always returns the same result for the current definition.
  19146. */
  19147. readonly isConstant: boolean;
  19148. /**
  19149. * Gets the event that is raised whenever the definition of this property changes.
  19150. * The definition is considered to have changed if a call to getValue would return
  19151. * a different result for the same time.
  19152. */
  19153. readonly definitionChanged: Event;
  19154. /**
  19155. * Gets or sets the Property specifying the {@link Color} of the line.
  19156. */
  19157. color: Property | undefined;
  19158. /**
  19159. * Gets or sets the numeric Property specifying the strength of the glow, as a percentage of the total line width (less than 1.0).
  19160. */
  19161. glowPower: Property | undefined;
  19162. /**
  19163. * 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.
  19164. */
  19165. taperPower: Property | undefined;
  19166. /**
  19167. * Gets the {@link Material} type at the provided time.
  19168. * @param time - The time for which to retrieve the type.
  19169. * @returns The type of material.
  19170. */
  19171. getType(time: JulianDate): string;
  19172. /**
  19173. * Gets the value of the property at the provided time.
  19174. * @param time - The time for which to retrieve the value.
  19175. * @param [result] - The object to store the value into, if omitted, a new instance is created and returned.
  19176. * @returns The modified result parameter or a new instance if the result parameter was not supplied.
  19177. */
  19178. getValue(time: JulianDate, result?: any): any;
  19179. /**
  19180. * Compares this property to the provided property and returns
  19181. * <code>true</code> if they are equal, <code>false</code> otherwise.
  19182. * @param [other] - The other property.
  19183. * @returns <code>true</code> if left and right are equal, <code>false</code> otherwise.
  19184. */
  19185. equals(other?: Property): boolean;
  19186. }
  19187. export namespace PolylineGraphics {
  19188. /**
  19189. * Initialization options for the PolylineGraphics constructor
  19190. * @property [show = true] - A boolean Property specifying the visibility of the polyline.
  19191. * @property [positions] - A Property specifying the array of {@link Cartesian3} positions that define the line strip.
  19192. * @property [width = 1.0] - A numeric Property specifying the width in pixels.
  19193. * @property [granularity = SuperMap.Math.RADIANS_PER_DEGREE] - A numeric Property specifying the angular distance between each latitude and longitude if arcType is not ArcType.NONE.
  19194. * @property [material = Color.WHITE] - A Property specifying the material used to draw the polyline.
  19195. * @property [depthFailMaterial] - A property specifying the material used to draw the polyline when it is below the terrain.
  19196. * @property [arcType = ArcType.GEODESIC] - The type of line the polyline segments must follow.
  19197. * @property [clampToGround = false] - A boolean Property specifying whether the Polyline should be clamped to the ground.
  19198. * @property [shadows = ShadowMode.DISABLED] - An enum Property specifying whether the polyline casts or receives shadows from light sources.
  19199. * @property [distanceDisplayCondition] - A Property specifying at what distance from the camera that this polyline will be displayed.
  19200. * @property [classificationType = ClassificationType.BOTH] - An enum Property specifying whether this polyline will classify terrain, 3D Tiles, or both when on the ground.
  19201. * @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.
  19202. */
  19203. type ConstructorOptions = {
  19204. show?: Property | boolean;
  19205. positions?: Property | Cartesian3[];
  19206. width?: Property | number;
  19207. granularity?: Property | number;
  19208. material?: MaterialProperty | Color;
  19209. depthFailMaterial?: MaterialProperty | Color;
  19210. arcType?: Property | ArcType;
  19211. clampToGround?: Property | boolean;
  19212. shadows?: Property | ShadowMode;
  19213. distanceDisplayCondition?: Property | DistanceDisplayCondition;
  19214. classificationType?: Property | ClassificationType;
  19215. zIndex?: Property | number;
  19216. };
  19217. }
  19218. /**
  19219. * Describes a polyline. The first two positions define a line segment,
  19220. * and each additional position defines a line segment from the previous position. The segments
  19221. * can be linear connected points, great arcs, or clamped to terrain.
  19222. * @param [options] - Object describing initialization options
  19223. */
  19224. export class PolylineGraphics {
  19225. constructor(options?: PolylineGraphics.ConstructorOptions);
  19226. /**
  19227. * Gets the event that is raised whenever a property or sub-property is changed or modified.
  19228. */
  19229. readonly definitionChanged: Event;
  19230. /**
  19231. * Gets or sets the boolean Property specifying the visibility of the polyline.
  19232. */
  19233. show: Property | undefined;
  19234. /**
  19235. * Gets or sets the Property specifying the array of {@link Cartesian3}
  19236. * positions that define the line strip.
  19237. */
  19238. positions: Property | undefined;
  19239. /**
  19240. * Gets or sets the numeric Property specifying the width in pixels.
  19241. */
  19242. width: Property | undefined;
  19243. /**
  19244. * 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.
  19245. */
  19246. granularity: Property | undefined;
  19247. /**
  19248. * Gets or sets the Property specifying the material used to draw the polyline.
  19249. */
  19250. material: MaterialProperty;
  19251. /**
  19252. * Gets or sets the Property specifying the material used to draw the polyline when it fails the depth test.
  19253. * <p>
  19254. * Requires the EXT_frag_depth WebGL extension to render properly. If the extension is not supported,
  19255. * there may be artifacts.
  19256. * </p>
  19257. */
  19258. depthFailMaterial: MaterialProperty;
  19259. /**
  19260. * Gets or sets the {@link ArcType} Property specifying whether the line segments should be great arcs, rhumb lines or linearly connected.
  19261. */
  19262. arcType: Property | undefined;
  19263. /**
  19264. * Gets or sets the boolean Property specifying whether the polyline
  19265. * should be clamped to the ground.
  19266. */
  19267. clampToGround: Property | undefined;
  19268. /**
  19269. * Get or sets the enum Property specifying whether the polyline
  19270. * casts or receives shadows from light sources.
  19271. */
  19272. shadows: Property | undefined;
  19273. /**
  19274. * Gets or sets the {@link DistanceDisplayCondition} Property specifying at what distance from the camera that this polyline will be displayed.
  19275. */
  19276. distanceDisplayCondition: Property | undefined;
  19277. /**
  19278. * Gets or sets the {@link ClassificationType} Property specifying whether this polyline will classify terrain, 3D Tiles, or both when on the ground.
  19279. */
  19280. classificationType: Property | undefined;
  19281. /**
  19282. * 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.
  19283. */
  19284. zIndex: ConstantProperty | undefined;
  19285. /**
  19286. * Duplicates this instance.
  19287. * @param [result] - The object onto which to store the result.
  19288. * @returns The modified result parameter or a new instance if one was not provided.
  19289. */
  19290. clone(result?: PolylineGraphics): PolylineGraphics;
  19291. /**
  19292. * Assigns each unassigned property on this object to the value
  19293. * of the same property on the provided source object.
  19294. * @param source - The object to be merged into this object.
  19295. */
  19296. merge(source: PolylineGraphics): void;
  19297. }
  19298. /**
  19299. * A {@link MaterialProperty} that maps to polyline outline {@link Material} uniforms.
  19300. * @param [options] - Object with the following properties:
  19301. * @param [options.color = Color.WHITE] - A Property specifying the {@link Color} of the line.
  19302. * @param [options.outlineColor = Color.BLACK] - A Property specifying the {@link Color} of the outline.
  19303. * @param [options.outlineWidth = 1.0] - A numeric Property specifying the width of the outline, in pixels.
  19304. */
  19305. export class PolylineOutlineMaterialProperty {
  19306. constructor(options?: {
  19307. color?: Property | Color;
  19308. outlineColor?: Property | Color;
  19309. outlineWidth?: Property | number;
  19310. });
  19311. /**
  19312. * Gets a value indicating if this property is constant. A property is considered
  19313. * constant if getValue always returns the same result for the current definition.
  19314. */
  19315. readonly isConstant: boolean;
  19316. /**
  19317. * Gets the event that is raised whenever the definition of this property changes.
  19318. * The definition is considered to have changed if a call to getValue would return
  19319. * a different result for the same time.
  19320. */
  19321. readonly definitionChanged: Event;
  19322. /**
  19323. * Gets or sets the Property specifying the {@link Color} of the line.
  19324. */
  19325. color: Property | undefined;
  19326. /**
  19327. * Gets or sets the Property specifying the {@link Color} of the outline.
  19328. */
  19329. outlineColor: Property | undefined;
  19330. /**
  19331. * Gets or sets the numeric Property specifying the width of the outline.
  19332. */
  19333. outlineWidth: Property | undefined;
  19334. /**
  19335. * Gets the {@link Material} type at the provided time.
  19336. * @param time - The time for which to retrieve the type.
  19337. * @returns The type of material.
  19338. */
  19339. getType(time: JulianDate): string;
  19340. /**
  19341. * Gets the value of the property at the provided time.
  19342. * @param time - The time for which to retrieve the value.
  19343. * @param [result] - The object to store the value into, if omitted, a new instance is created and returned.
  19344. * @returns The modified result parameter or a new instance if the result parameter was not supplied.
  19345. */
  19346. getValue(time: JulianDate, result?: any): any;
  19347. /**
  19348. * Compares this property to the provided property and returns
  19349. * <code>true</code> if they are equal, <code>false</code> otherwise.
  19350. * @param [other] - The other property.
  19351. * @returns <code>true</code> if left and right are equal, <code>false</code> otherwise.
  19352. */
  19353. equals(other?: Property): boolean;
  19354. }
  19355. /**
  19356. * A visualizer for polylines represented by {@link Primitive} instances.
  19357. * @param scene - The scene the primitives will be rendered in.
  19358. * @param entityCollection - The entityCollection to visualize.
  19359. * @param [primitives = scene.primitives] - A collection to add primitives related to the entities
  19360. * @param [groundPrimitives = scene.groundPrimitives] - A collection to add ground primitives related to the entities
  19361. */
  19362. export class PolylineVisualizer {
  19363. constructor(scene: Scene, entityCollection: EntityCollection, primitives?: PrimitiveCollection, groundPrimitives?: PrimitiveCollection);
  19364. /**
  19365. * Updates all of the primitives created by this visualizer to match their
  19366. * Entity counterpart at the given time.
  19367. * @param time - The time to update to.
  19368. * @returns True if the visualizer successfully updated to the provided time,
  19369. * false if the visualizer is waiting for asynchronous primitives to be created.
  19370. */
  19371. update(time: JulianDate): boolean;
  19372. /**
  19373. * Returns true if this object was destroyed; otherwise, false.
  19374. * @returns True if this object was destroyed; otherwise, false.
  19375. */
  19376. isDestroyed(): boolean;
  19377. /**
  19378. * Removes and destroys all primitives created by this instance.
  19379. */
  19380. destroy(): void;
  19381. }
  19382. /**
  19383. * A {@link GeometryUpdater} for polyline volumes.
  19384. * Clients do not normally create this class directly, but instead rely on {@link DataSourceDisplay}.
  19385. * @param entity - The entity containing the geometry to be visualized.
  19386. * @param scene - The scene where visualization is taking place.
  19387. */
  19388. export class PolylineVolumeGeometryUpdater {
  19389. constructor(entity: Entity, scene: Scene);
  19390. /**
  19391. * Creates the geometry instance which represents the fill of the geometry.
  19392. * @param time - The time to use when retrieving initial attribute values.
  19393. * @returns The geometry instance representing the filled portion of the geometry.
  19394. */
  19395. createFillGeometryInstance(time: JulianDate): GeometryInstance;
  19396. /**
  19397. * Creates the geometry instance which represents the outline of the geometry.
  19398. * @param time - The time to use when retrieving initial attribute values.
  19399. * @returns The geometry instance representing the outline portion of the geometry.
  19400. */
  19401. createOutlineGeometryInstance(time: JulianDate): GeometryInstance;
  19402. }
  19403. /**
  19404. * The interface for all {@link Property} objects that define a world
  19405. * location as a {@link Cartesian3} with an associated {@link ReferenceFrame}.
  19406. * This type defines an interface and cannot be instantiated directly.
  19407. */
  19408. export class PositionProperty {
  19409. constructor();
  19410. /**
  19411. * Gets a value indicating if this property is constant. A property is considered
  19412. * constant if getValue always returns the same result for the current definition.
  19413. */
  19414. readonly isConstant: boolean;
  19415. /**
  19416. * Gets the event that is raised whenever the definition of this property changes.
  19417. * The definition is considered to have changed if a call to getValue would return
  19418. * a different result for the same time.
  19419. */
  19420. readonly definitionChanged: Event;
  19421. /**
  19422. * Gets the reference frame that the position is defined in.
  19423. */
  19424. referenceFrame: ReferenceFrame;
  19425. /**
  19426. * Gets the value of the property at the provided time in the fixed frame.
  19427. * @param time - The time for which to retrieve the value.
  19428. * @param [result] - The object to store the value into, if omitted, a new instance is created and returned.
  19429. * @returns The modified result parameter or a new instance if the result parameter was not supplied.
  19430. */
  19431. getValue(time: JulianDate, result?: Cartesian3): Cartesian3 | undefined;
  19432. /**
  19433. * Gets the value of the property at the provided time and in the provided reference frame.
  19434. * @param time - The time for which to retrieve the value.
  19435. * @param referenceFrame - The desired referenceFrame of the result.
  19436. * @param [result] - The object to store the value into, if omitted, a new instance is created and returned.
  19437. * @returns The modified result parameter or a new instance if the result parameter was not supplied.
  19438. */
  19439. getValueInReferenceFrame(time: JulianDate, referenceFrame: ReferenceFrame, result?: Cartesian3): Cartesian3 | undefined;
  19440. /**
  19441. * Compares this property to the provided property and returns
  19442. * <code>true</code> if they are equal, <code>false</code> otherwise.
  19443. * @param [other] - The other property.
  19444. * @returns <code>true</code> if left and right are equal, <code>false</code> otherwise.
  19445. */
  19446. equals(other?: Property): boolean;
  19447. }
  19448. /**
  19449. * A {@link Property} whose value is an array whose items are the computed value
  19450. * of other PositionProperty instances.
  19451. * @param [value] - An array of Property instances.
  19452. * @param [referenceFrame = ReferenceFrame.FIXED] - The reference frame in which the position is defined.
  19453. */
  19454. export class PositionPropertyArray {
  19455. constructor(value?: Property[], referenceFrame?: ReferenceFrame);
  19456. /**
  19457. * Gets a value indicating if this property is constant. This property
  19458. * is considered constant if all property items in the array are constant.
  19459. */
  19460. readonly isConstant: boolean;
  19461. /**
  19462. * Gets the event that is raised whenever the definition of this property changes.
  19463. * The definition is changed whenever setValue is called with data different
  19464. * than the current value or one of the properties in the array also changes.
  19465. */
  19466. readonly definitionChanged: Event;
  19467. /**
  19468. * Gets the reference frame in which the position is defined.
  19469. */
  19470. referenceFrame: ReferenceFrame;
  19471. /**
  19472. * Gets the value of the property.
  19473. * @param time - The time for which to retrieve the value.
  19474. * @param [result] - The object to store the value into, if omitted, a new instance is created and returned.
  19475. * @returns The modified result parameter or a new instance if the result parameter was not supplied.
  19476. */
  19477. getValue(time: JulianDate, result?: Cartesian3[]): Cartesian3[];
  19478. /**
  19479. * Gets the value of the property at the provided time and in the provided reference frame.
  19480. * @param time - The time for which to retrieve the value.
  19481. * @param referenceFrame - The desired referenceFrame of the result.
  19482. * @param [result] - The object to store the value into, if omitted, a new instance is created and returned.
  19483. * @returns The modified result parameter or a new instance if the result parameter was not supplied.
  19484. */
  19485. getValueInReferenceFrame(time: JulianDate, referenceFrame: ReferenceFrame, result?: Cartesian3[]): Cartesian3[];
  19486. /**
  19487. * Sets the value of the property.
  19488. * @param value - An array of Property instances.
  19489. */
  19490. setValue(value: Property[]): void;
  19491. /**
  19492. * Compares this property to the provided property and returns
  19493. * <code>true</code> if they are equal, <code>false</code> otherwise.
  19494. * @param [other] - The other property.
  19495. * @returns <code>true</code> if left and right are equal, <code>false</code> otherwise.
  19496. */
  19497. equals(other?: Property): boolean;
  19498. }
  19499. /**
  19500. * The interface for all properties, which represent a value that can optionally vary over time.
  19501. * This type defines an interface and cannot be instantiated directly.
  19502. */
  19503. export class Property {
  19504. constructor();
  19505. /**
  19506. * Gets a value indicating if this property is constant. A property is considered
  19507. * constant if getValue always returns the same result for the current definition.
  19508. */
  19509. readonly isConstant: boolean;
  19510. /**
  19511. * Gets the event that is raised whenever the definition of this property changes.
  19512. * The definition is considered to have changed if a call to getValue would return
  19513. * a different result for the same time.
  19514. */
  19515. readonly definitionChanged: Event;
  19516. /**
  19517. * Gets the value of the property at the provided time.
  19518. * @param time - The time for which to retrieve the value.
  19519. * @param [result] - The object to store the value into, if omitted, a new instance is created and returned.
  19520. * @returns The modified result parameter or a new instance if the result parameter was not supplied.
  19521. */
  19522. getValue(time: JulianDate, result?: any): any;
  19523. /**
  19524. * Compares this property to the provided property and returns
  19525. * <code>true</code> if they are equal, <code>false</code> otherwise.
  19526. * @param [other] - The other property.
  19527. * @returns <code>true</code> if left and right are equal, <code>false</code> otherwise.
  19528. */
  19529. equals(other?: Property): boolean;
  19530. }
  19531. export interface PropertyBag extends Record<string, any> {
  19532. }
  19533. /**
  19534. * A {@link Property} whose value is a key-value mapping of property names to the computed value of other properties.
  19535. * @param [value] - An object, containing key-value mapping of property names to properties.
  19536. * @param [createPropertyCallback] - A function that will be called when the value of any of the properties in value are not a Property.
  19537. */
  19538. export class PropertyBag implements Record<string, any> {
  19539. constructor(value?: any, createPropertyCallback?: (...params: any[]) => any);
  19540. /**
  19541. * Gets the names of all properties registered on this instance.
  19542. */
  19543. propertyNames: any[];
  19544. /**
  19545. * Gets a value indicating if this property is constant. This property
  19546. * is considered constant if all property items in this object are constant.
  19547. */
  19548. readonly isConstant: boolean;
  19549. /**
  19550. * Gets the event that is raised whenever the set of properties contained in this
  19551. * object changes, or one of the properties itself changes.
  19552. */
  19553. readonly definitionChanged: Event;
  19554. /**
  19555. * Determines if this object has defined a property with the given name.
  19556. * @param propertyName - The name of the property to check for.
  19557. * @returns True if this object has defined a property with the given name, false otherwise.
  19558. */
  19559. hasProperty(propertyName: string): boolean;
  19560. /**
  19561. * Adds a property to this object.
  19562. * @param propertyName - The name of the property to add.
  19563. * @param [value] - The value of the new property, if provided.
  19564. * @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.
  19565. */
  19566. addProperty(propertyName: string, value?: any, createPropertyCallback?: (...params: any[]) => any): void;
  19567. /**
  19568. * Removed a property previously added with addProperty.
  19569. * @param propertyName - The name of the property to remove.
  19570. */
  19571. removeProperty(propertyName: string): void;
  19572. /**
  19573. * Gets the value of this property. Each contained property will be evaluated at the given time, and the overall
  19574. * result will be an object, mapping property names to those values.
  19575. * @param time - The time for which to retrieve the value.
  19576. * @param [result] - The object to store the value into, if omitted, a new instance is created and returned.
  19577. * Note that any properties in result which are not part of this PropertyBag will be left as-is.
  19578. * @returns The modified result parameter or a new instance if the result parameter was not supplied.
  19579. */
  19580. getValue(time: JulianDate, result?: any): any;
  19581. /**
  19582. * Assigns each unassigned property on this object to the value
  19583. * of the same property on the provided source object.
  19584. * @param source - The object to be merged into this object.
  19585. * @param [createPropertyCallback] - A function that will be called when the value of any of the properties in value are not a Property.
  19586. */
  19587. merge(source: any, createPropertyCallback?: (...params: any[]) => any): void;
  19588. /**
  19589. * Compares this property to the provided property and returns
  19590. * <code>true</code> if they are equal, <code>false</code> otherwise.
  19591. * @param [other] - The other property.
  19592. * @returns <code>true</code> if left and right are equal, <code>false</code> otherwise.
  19593. */
  19594. equals(other?: Property): boolean;
  19595. }
  19596. /**
  19597. * A {@link GeometryUpdater} for rectangles.
  19598. * Clients do not normally create this class directly, but instead rely on {@link DataSourceDisplay}.
  19599. * @param entity - The entity containing the geometry to be visualized.
  19600. * @param scene - The scene where visualization is taking place.
  19601. */
  19602. export class RectangleGeometryUpdater {
  19603. constructor(entity: Entity, scene: Scene);
  19604. /**
  19605. * Creates the geometry instance which represents the fill of the geometry.
  19606. * @param time - The time to use when retrieving initial attribute values.
  19607. * @returns The geometry instance representing the filled portion of the geometry.
  19608. */
  19609. createFillGeometryInstance(time: JulianDate): GeometryInstance;
  19610. /**
  19611. * Creates the geometry instance which represents the outline of the geometry.
  19612. * @param time - The time to use when retrieving initial attribute values.
  19613. * @returns The geometry instance representing the outline portion of the geometry.
  19614. */
  19615. createOutlineGeometryInstance(time: JulianDate): GeometryInstance;
  19616. }
  19617. /**
  19618. * A {@link Property} whose value is interpolated for a given time from the
  19619. * provided set of samples and specified interpolation algorithm and degree.
  19620. * @example
  19621. * //Create a linearly interpolated Cartesian2
  19622. * const property = new Cesium.SampledProperty(Cesium.Cartesian2);
  19623. *
  19624. * //Populate it with data
  19625. * property.addSample(Cesium.JulianDate.fromIso8601('2012-08-01T00:00:00.00Z'), new Cesium.Cartesian2(0, 0));
  19626. * property.addSample(Cesium.JulianDate.fromIso8601('2012-08-02T00:00:00.00Z'), new Cesium.Cartesian2(4, 7));
  19627. *
  19628. * //Retrieve an interpolated value
  19629. * const result = property.getValue(Cesium.JulianDate.fromIso8601('2012-08-01T12:00:00.00Z'));
  19630. * @example
  19631. * //Create a simple numeric SampledProperty that uses third degree Hermite Polynomial Approximation
  19632. * const property = new Cesium.SampledProperty(Number);
  19633. * property.setInterpolationOptions({
  19634. * interpolationDegree : 3,
  19635. * interpolationAlgorithm : Cesium.HermitePolynomialApproximation
  19636. * });
  19637. *
  19638. * //Populate it with data
  19639. * property.addSample(Cesium.JulianDate.fromIso8601('2012-08-01T00:00:00.00Z'), 1.0);
  19640. * property.addSample(Cesium.JulianDate.fromIso8601('2012-08-01T00:01:00.00Z'), 6.0);
  19641. * property.addSample(Cesium.JulianDate.fromIso8601('2012-08-01T00:02:00.00Z'), 12.0);
  19642. * property.addSample(Cesium.JulianDate.fromIso8601('2012-08-01T00:03:30.00Z'), 5.0);
  19643. * property.addSample(Cesium.JulianDate.fromIso8601('2012-08-01T00:06:30.00Z'), 2.0);
  19644. *
  19645. * //Samples can be added in any order.
  19646. * property.addSample(Cesium.JulianDate.fromIso8601('2012-08-01T00:00:30.00Z'), 6.2);
  19647. *
  19648. * //Retrieve an interpolated value
  19649. * const result = property.getValue(Cesium.JulianDate.fromIso8601('2012-08-01T00:02:34.00Z'));
  19650. * @param type - The type of property.
  19651. * @param [derivativeTypes] - When supplied, indicates that samples will contain derivative information of the specified types.
  19652. */
  19653. export class SampledProperty {
  19654. constructor(type: number | Packable, derivativeTypes?: Packable[]);
  19655. /**
  19656. * Gets a value indicating if this property is constant. A property is considered
  19657. * constant if getValue always returns the same result for the current definition.
  19658. */
  19659. readonly isConstant: boolean;
  19660. /**
  19661. * Gets the event that is raised whenever the definition of this property changes.
  19662. * The definition is considered to have changed if a call to getValue would return
  19663. * a different result for the same time.
  19664. */
  19665. readonly definitionChanged: Event;
  19666. /**
  19667. * Gets the type of property.
  19668. */
  19669. type: any;
  19670. /**
  19671. * Gets the derivative types used by this property.
  19672. */
  19673. derivativeTypes: Packable[];
  19674. /**
  19675. * Gets the degree of interpolation to perform when retrieving a value.
  19676. */
  19677. interpolationDegree: number;
  19678. /**
  19679. * Gets the interpolation algorithm to use when retrieving a value.
  19680. */
  19681. interpolationAlgorithm: InterpolationAlgorithm;
  19682. /**
  19683. * Gets or sets the type of extrapolation to perform when a value
  19684. * is requested at a time after any available samples.
  19685. */
  19686. forwardExtrapolationType: ExtrapolationType;
  19687. /**
  19688. * Gets or sets the amount of time to extrapolate forward before
  19689. * the property becomes undefined. A value of 0 will extrapolate forever.
  19690. */
  19691. forwardExtrapolationDuration: number;
  19692. /**
  19693. * Gets or sets the type of extrapolation to perform when a value
  19694. * is requested at a time before any available samples.
  19695. */
  19696. backwardExtrapolationType: ExtrapolationType;
  19697. /**
  19698. * Gets or sets the amount of time to extrapolate backward
  19699. * before the property becomes undefined. A value of 0 will extrapolate forever.
  19700. */
  19701. backwardExtrapolationDuration: number;
  19702. /**
  19703. * Gets the value of the property at the provided time.
  19704. * @param time - The time for which to retrieve the value.
  19705. * @param [result] - The object to store the value into, if omitted, a new instance is created and returned.
  19706. * @returns The modified result parameter or a new instance if the result parameter was not supplied.
  19707. */
  19708. getValue(time: JulianDate, result?: any): any;
  19709. /**
  19710. * Sets the algorithm and degree to use when interpolating a value.
  19711. * @param [options] - Object with the following properties:
  19712. * @param [options.interpolationAlgorithm] - The new interpolation algorithm. If undefined, the existing property will be unchanged.
  19713. * @param [options.interpolationDegree] - The new interpolation degree. If undefined, the existing property will be unchanged.
  19714. */
  19715. setInterpolationOptions(options?: {
  19716. interpolationAlgorithm?: InterpolationAlgorithm;
  19717. interpolationDegree?: number;
  19718. }): void;
  19719. /**
  19720. * Adds a new sample.
  19721. * @param time - The sample time.
  19722. * @param value - The value at the provided time.
  19723. * @param [derivatives] - The array of derivatives at the provided time.
  19724. */
  19725. addSample(time: JulianDate, value: Packable, derivatives?: Packable[]): void;
  19726. /**
  19727. * Adds an array of samples.
  19728. * @param times - An array of JulianDate instances where each index is a sample time.
  19729. * @param values - The array of values, where each value corresponds to the provided times index.
  19730. * @param [derivativeValues] - An array where each item is the array of derivatives at the equivalent time index.
  19731. */
  19732. addSamples(times: JulianDate[], values: Packable[], derivativeValues?: any[][]): void;
  19733. /**
  19734. * Adds samples as a single packed array where each new sample is represented as a date,
  19735. * followed by the packed representation of the corresponding value and derivatives.
  19736. * @param packedSamples - The array of packed samples.
  19737. * @param [epoch] - If any of the dates in packedSamples are numbers, they are considered an offset from this epoch, in seconds.
  19738. */
  19739. addSamplesPackedArray(packedSamples: number[], epoch?: JulianDate): void;
  19740. /**
  19741. * Removes a sample at the given time, if present.
  19742. * @param time - The sample time.
  19743. * @returns <code>true</code> if a sample at time was removed, <code>false</code> otherwise.
  19744. */
  19745. removeSample(time: JulianDate): boolean;
  19746. /**
  19747. * Removes all samples for the given time interval.
  19748. * @param time - The time interval for which to remove all samples.
  19749. */
  19750. removeSamples(time: TimeInterval): void;
  19751. /**
  19752. * Compares this property to the provided property and returns
  19753. * <code>true</code> if they are equal, <code>false</code> otherwise.
  19754. * @param [other] - The other property.
  19755. * @returns <code>true</code> if left and right are equal, <code>false</code> otherwise.
  19756. */
  19757. equals(other?: Property): boolean;
  19758. }
  19759. /**
  19760. * A {@link Property} which is defined by a {@link TimeIntervalCollection}, where the
  19761. * data property of each {@link TimeInterval} represents the value at time.
  19762. * @example
  19763. * //Create a Cartesian2 interval property which contains data on August 1st, 2012
  19764. * //and uses a different value every 6 hours.
  19765. * const composite = new Cesium.TimeIntervalCollectionProperty();
  19766. * composite.intervals.addInterval(Cesium.TimeInterval.fromIso8601({
  19767. * iso8601 : '2012-08-01T00:00:00.00Z/2012-08-01T06:00:00.00Z',
  19768. * isStartIncluded : true,
  19769. * isStopIncluded : false,
  19770. * data : new Cesium.Cartesian2(2.0, 3.4)
  19771. * }));
  19772. * composite.intervals.addInterval(Cesium.TimeInterval.fromIso8601({
  19773. * iso8601 : '2012-08-01T06:00:00.00Z/2012-08-01T12:00:00.00Z',
  19774. * isStartIncluded : true,
  19775. * isStopIncluded : false,
  19776. * data : new Cesium.Cartesian2(12.0, 2.7)
  19777. * }));
  19778. * composite.intervals.addInterval(Cesium.TimeInterval.fromIso8601({
  19779. * iso8601 : '2012-08-01T12:00:00.00Z/2012-08-01T18:00:00.00Z',
  19780. * isStartIncluded : true,
  19781. * isStopIncluded : false,
  19782. * data : new Cesium.Cartesian2(5.0, 12.4)
  19783. * }));
  19784. * composite.intervals.addInterval(Cesium.TimeInterval.fromIso8601({
  19785. * iso8601 : '2012-08-01T18:00:00.00Z/2012-08-02T00:00:00.00Z',
  19786. * isStartIncluded : true,
  19787. * isStopIncluded : true,
  19788. * data : new Cesium.Cartesian2(85.0, 4.1)
  19789. * }));
  19790. */
  19791. export class TimeIntervalCollectionProperty {
  19792. constructor();
  19793. /**
  19794. * Gets a value indicating if this property is constant. A property is considered
  19795. * constant if getValue always returns the same result for the current definition.
  19796. */
  19797. readonly isConstant: boolean;
  19798. /**
  19799. * Gets the event that is raised whenever the definition of this property changes.
  19800. * The definition is changed whenever setValue is called with data different
  19801. * than the current value.
  19802. */
  19803. readonly definitionChanged: Event;
  19804. /**
  19805. * Gets the interval collection.
  19806. */
  19807. readonly intervals: TimeIntervalCollection;
  19808. /**
  19809. * Gets the value of the property at the provided time.
  19810. * @param time - The time for which to retrieve the value.
  19811. * @param [result] - The object to store the value into, if omitted, a new instance is created and returned.
  19812. * @returns The modified result parameter or a new instance if the result parameter was not supplied.
  19813. */
  19814. getValue(time: JulianDate, result?: any): any;
  19815. /**
  19816. * Compares this property to the provided property and returns
  19817. * <code>true</code> if they are equal, <code>false</code> otherwise.
  19818. * @param [other] - The other property.
  19819. * @returns <code>true</code> if left and right are equal, <code>false</code> otherwise.
  19820. */
  19821. equals(other?: Property): boolean;
  19822. }
  19823. /**
  19824. * A {@link Property} which evaluates to a {@link Quaternion} rotation
  19825. * based on the velocity of the provided {@link PositionProperty}.
  19826. * @example
  19827. * //Create an entity with position and orientation.
  19828. * const position = new Cesium.SampledProperty();
  19829. * position.addSamples(...);
  19830. * const entity = viewer.entities.add({
  19831. * position : position,
  19832. * orientation : new Cesium.VelocityOrientationProperty(position)
  19833. * }));
  19834. * @param [position] - The position property used to compute the orientation.
  19835. * @param [ellipsoid = Ellipsoid.WGS84] - The ellipsoid used to determine which way is up.
  19836. */
  19837. export class VelocityOrientationProperty {
  19838. constructor(position?: PositionProperty, ellipsoid?: Ellipsoid);
  19839. /**
  19840. * Gets a value indicating if this property is constant.
  19841. */
  19842. readonly isConstant: boolean;
  19843. /**
  19844. * Gets the event that is raised whenever the definition of this property changes.
  19845. */
  19846. readonly definitionChanged: Event;
  19847. /**
  19848. * Gets or sets the position property used to compute orientation.
  19849. */
  19850. position: Property | undefined;
  19851. /**
  19852. * Gets or sets the ellipsoid used to determine which way is up.
  19853. */
  19854. ellipsoid: Property | undefined;
  19855. /**
  19856. * Gets the value of the property at the provided time.
  19857. * @param [time] - The time for which to retrieve the value.
  19858. * @param [result] - The object to store the value into, if omitted, a new instance is created and returned.
  19859. * @returns The modified result parameter or a new instance if the result parameter was not supplied.
  19860. */
  19861. getValue(time?: JulianDate, result?: Quaternion): Quaternion;
  19862. /**
  19863. * Compares this property to the provided property and returns
  19864. * <code>true</code> if they are equal, <code>false</code> otherwise.
  19865. * @param [other] - The other property.
  19866. * @returns <code>true</code> if left and right are equal, <code>false</code> otherwise.
  19867. */
  19868. equals(other?: Property): boolean;
  19869. }
  19870. /**
  19871. * A {@link Property} which evaluates to a {@link Cartesian3} vector
  19872. * based on the velocity of the provided {@link PositionProperty}.
  19873. * @example
  19874. * //Create an entity with a billboard rotated to match its velocity.
  19875. * const position = new Cesium.SampledProperty();
  19876. * position.addSamples(...);
  19877. * const entity = viewer.entities.add({
  19878. * position : position,
  19879. * billboard : {
  19880. * image : 'image.png',
  19881. * alignedAxis : new Cesium.VelocityVectorProperty(position, true) // alignedAxis must be a unit vector
  19882. * }
  19883. * }));
  19884. * @param [position] - The position property used to compute the velocity.
  19885. * @param [normalize = true] - Whether to normalize the computed velocity vector.
  19886. */
  19887. export class VelocityVectorProperty {
  19888. constructor(position?: PositionProperty, normalize?: boolean);
  19889. /**
  19890. * Gets a value indicating if this property is constant.
  19891. */
  19892. readonly isConstant: boolean;
  19893. /**
  19894. * Gets the event that is raised whenever the definition of this property changes.
  19895. */
  19896. readonly definitionChanged: Event;
  19897. /**
  19898. * Gets or sets the position property used to compute the velocity vector.
  19899. */
  19900. position: Property | undefined;
  19901. /**
  19902. * Gets or sets whether the vector produced by this property
  19903. * will be normalized or not.
  19904. */
  19905. normalize: boolean;
  19906. /**
  19907. * Gets the value of the property at the provided time.
  19908. * @param [time] - The time for which to retrieve the value.
  19909. * @param [result] - The object to store the value into, if omitted, a new instance is created and returned.
  19910. * @returns The modified result parameter or a new instance if the result parameter was not supplied.
  19911. */
  19912. getValue(time?: JulianDate, result?: Cartesian3): Cartesian3;
  19913. /**
  19914. * Compares this property to the provided property and returns
  19915. * <code>true</code> if they are equal, <code>false</code> otherwise.
  19916. * @param [other] - The other property.
  19917. * @returns <code>true</code> if left and right are equal, <code>false</code> otherwise.
  19918. */
  19919. equals(other?: Property): boolean;
  19920. }
  19921. /**
  19922. * The data type of a pixel.
  19923. */
  19924. export enum PixelDatatype {
  19925. UNSIGNED_BYTE = WebGLConstants.UNSIGNED_BYTE,
  19926. UNSIGNED_SHORT = WebGLConstants.UNSIGNED_SHORT,
  19927. UNSIGNED_INT = WebGLConstants.UNSIGNED_INT,
  19928. FLOAT = WebGLConstants.FLOAT,
  19929. HALF_FLOAT = WebGLConstants.HALF_FLOAT_OES,
  19930. UNSIGNED_INT_24_8 = WebGLConstants.UNSIGNED_INT_24_8,
  19931. UNSIGNED_SHORT_4_4_4_4 = WebGLConstants.UNSIGNED_SHORT_4_4_4_4,
  19932. UNSIGNED_SHORT_5_5_5_1 = WebGLConstants.UNSIGNED_SHORT_5_5_5_1,
  19933. UNSIGNED_SHORT_5_6_5 = WebGLConstants.UNSIGNED_SHORT_5_6_5
  19934. }
  19935. /**
  19936. * Enumerates all possible filters used when magnifying WebGL textures.
  19937. */
  19938. export enum TextureMagnificationFilter {
  19939. /**
  19940. * Samples the texture by returning the closest pixel.
  19941. */
  19942. NEAREST = WebGLConstants.NEAREST,
  19943. /**
  19944. * Samples the texture through bi-linear interpolation of the four nearest pixels. This produces smoother results than <code>NEAREST</code> filtering.
  19945. */
  19946. LINEAR = WebGLConstants.LINEAR
  19947. }
  19948. /**
  19949. * Enumerates all possible filters used when minifying WebGL textures.
  19950. */
  19951. export enum TextureMinificationFilter {
  19952. /**
  19953. * Samples the texture by returning the closest pixel.
  19954. */
  19955. NEAREST = WebGLConstants.NEAREST,
  19956. /**
  19957. * Samples the texture through bi-linear interpolation of the four nearest pixels. This produces smoother results than <code>NEAREST</code> filtering.
  19958. */
  19959. LINEAR = WebGLConstants.LINEAR,
  19960. /**
  19961. * Selects the nearest mip level and applies nearest sampling within that level.
  19962. * <p>
  19963. * Requires that the texture has a mipmap. The mip level is chosen by the view angle and screen-space size of the texture.
  19964. * </p>
  19965. */
  19966. NEAREST_MIPMAP_NEAREST = WebGLConstants.NEAREST_MIPMAP_NEAREST,
  19967. /**
  19968. * Selects the nearest mip level and applies linear sampling within that level.
  19969. * <p>
  19970. * Requires that the texture has a mipmap. The mip level is chosen by the view angle and screen-space size of the texture.
  19971. * </p>
  19972. */
  19973. LINEAR_MIPMAP_NEAREST = WebGLConstants.LINEAR_MIPMAP_NEAREST,
  19974. /**
  19975. * Read texture values with nearest sampling from two adjacent mip levels and linearly interpolate the results.
  19976. * <p>
  19977. * This option provides a good balance of visual quality and speed when sampling from a mipmapped texture.
  19978. * </p>
  19979. * <p>
  19980. * Requires that the texture has a mipmap. The mip level is chosen by the view angle and screen-space size of the texture.
  19981. * </p>
  19982. */
  19983. NEAREST_MIPMAP_LINEAR = WebGLConstants.NEAREST_MIPMAP_LINEAR,
  19984. /**
  19985. * Read texture values with linear sampling from two adjacent mip levels and linearly interpolate the results.
  19986. * <p>
  19987. * This option provides a good balance of visual quality and speed when sampling from a mipmapped texture.
  19988. * </p>
  19989. * <p>
  19990. * Requires that the texture has a mipmap. The mip level is chosen by the view angle and screen-space size of the texture.
  19991. * </p>
  19992. */
  19993. LINEAR_MIPMAP_LINEAR = WebGLConstants.LINEAR_MIPMAP_LINEAR
  19994. }
  19995. /**
  19996. * An appearance defines the full GLSL vertex and fragment shaders and the
  19997. * render state used to draw a {@link Primitive}. All appearances implement
  19998. * this base <code>Appearance</code> interface.
  19999. * @param [options] - Object with the following properties:
  20000. * @param [options.translucent = true] - When <code>true</code>, the geometry is expected to appear translucent so {@link Appearance#renderState} has alpha blending enabled.
  20001. * @param [options.closed = false] - When <code>true</code>, the geometry is expected to be closed so {@link Appearance#renderState} has backface culling enabled.
  20002. * @param [options.material = Material.ColorType] - The material used to determine the fragment color.
  20003. * @param [options.vertexShaderSource] - Optional GLSL vertex shader source to override the default vertex shader.
  20004. * @param [options.fragmentShaderSource] - Optional GLSL fragment shader source to override the default fragment shader.
  20005. * @param [options.renderState] - Optional render state to override the default render state.
  20006. */
  20007. export class Appearance {
  20008. constructor(options?: {
  20009. translucent?: boolean;
  20010. closed?: boolean;
  20011. material?: Material;
  20012. vertexShaderSource?: string;
  20013. fragmentShaderSource?: string;
  20014. renderState?: any;
  20015. });
  20016. /**
  20017. * The material used to determine the fragment color. Unlike other {@link Appearance}
  20018. * properties, this is not read-only, so an appearance's material can change on the fly.
  20019. */
  20020. material: Material;
  20021. /**
  20022. * When <code>true</code>, the geometry is expected to appear translucent.
  20023. */
  20024. translucent: boolean;
  20025. /**
  20026. * The GLSL source code for the vertex shader.
  20027. */
  20028. readonly vertexShaderSource: string;
  20029. /**
  20030. * The GLSL source code for the fragment shader. The full fragment shader
  20031. * source is built procedurally taking into account the {@link Appearance#material}.
  20032. * Use {@link Appearance#getFragmentShaderSource} to get the full source.
  20033. */
  20034. readonly fragmentShaderSource: string;
  20035. /**
  20036. * The WebGL fixed-function state to use when rendering the geometry.
  20037. */
  20038. readonly renderState: any;
  20039. /**
  20040. * When <code>true</code>, the geometry is expected to be closed.
  20041. */
  20042. readonly closed: boolean;
  20043. /**
  20044. * Procedurally creates the full GLSL fragment shader source for this appearance
  20045. * taking into account {@link Appearance#fragmentShaderSource} and {@link Appearance#material}.
  20046. * @returns The full GLSL fragment shader source.
  20047. */
  20048. getFragmentShaderSource(): string;
  20049. /**
  20050. * Determines if the geometry is translucent based on {@link Appearance#translucent} and {@link Material#isTranslucent}.
  20051. * @returns <code>true</code> if the appearance is translucent.
  20052. */
  20053. isTranslucent(): boolean;
  20054. /**
  20055. * Creates a render state. This is not the final render state instance; instead,
  20056. * it can contain a subset of render state properties identical to the render state
  20057. * created in the context.
  20058. * @returns The render state.
  20059. */
  20060. getRenderState(): any;
  20061. }
  20062. /**
  20063. * A viewport-aligned image positioned in the 3D scene, that is created
  20064. * and rendered using a {@link BillboardCollection}. A billboard is created and its initial
  20065. * properties are set by calling {@link BillboardCollection#add}.
  20066. * <br /><br />
  20067. * <div align='center'>
  20068. * <img src='Images/Billboard.png' width='400' height='300' /><br />
  20069. * Example billboards
  20070. * </div>
  20071. */
  20072. export class Billboard {
  20073. constructor();
  20074. /**
  20075. * Determines if this billboard will be shown. Use this to hide or show a billboard, instead
  20076. * of removing it and re-adding it to the collection.
  20077. */
  20078. show: boolean;
  20079. /**
  20080. * Gets or sets the Cartesian position of this billboard.
  20081. */
  20082. position: Cartesian3;
  20083. /**
  20084. * Gets or sets the height reference of this billboard.
  20085. */
  20086. heightReference: HeightReference;
  20087. /**
  20088. * Gets or sets the pixel offset in screen space from the origin of this billboard. This is commonly used
  20089. * to align multiple billboards and labels at the same position, e.g., an image and text. The
  20090. * screen space origin is the top, left corner of the canvas; <code>x</code> increases from
  20091. * left to right, and <code>y</code> increases from top to bottom.
  20092. * <br /><br />
  20093. * <div align='center'>
  20094. * <table border='0' cellpadding='5'><tr>
  20095. * <td align='center'><code>default</code><br/><img src='Images/Billboard.setPixelOffset.default.png' width='250' height='188' /></td>
  20096. * <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>
  20097. * </tr></table>
  20098. * The billboard's origin is indicated by the yellow point.
  20099. * </div>
  20100. */
  20101. pixelOffset: Cartesian2;
  20102. /**
  20103. * Gets or sets near and far scaling properties of a Billboard based on the billboard's distance from the camera.
  20104. * A billboard's scale will interpolate between the {@link NearFarScalar#nearValue} and
  20105. * {@link NearFarScalar#farValue} while the camera distance falls within the lower and upper bounds
  20106. * of the specified {@link NearFarScalar#near} and {@link NearFarScalar#far}.
  20107. * Outside of these ranges the billboard's scale remains clamped to the nearest bound. If undefined,
  20108. * scaleByDistance will be disabled.
  20109. * @example
  20110. * // Example 1.
  20111. * // Set a billboard's scaleByDistance to scale by 1.5 when the
  20112. * // camera is 1500 meters from the billboard and disappear as
  20113. * // the camera distance approaches 8.0e6 meters.
  20114. * b.scaleByDistance = new Cesium.NearFarScalar(1.5e2, 1.5, 8.0e6, 0.0);
  20115. * @example
  20116. * // Example 2.
  20117. * // disable scaling by distance
  20118. * b.scaleByDistance = undefined;
  20119. */
  20120. scaleByDistance: NearFarScalar;
  20121. /**
  20122. * Gets or sets near and far translucency properties of a Billboard based on the billboard's distance from the camera.
  20123. * A billboard's translucency will interpolate between the {@link NearFarScalar#nearValue} and
  20124. * {@link NearFarScalar#farValue} while the camera distance falls within the lower and upper bounds
  20125. * of the specified {@link NearFarScalar#near} and {@link NearFarScalar#far}.
  20126. * Outside of these ranges the billboard's translucency remains clamped to the nearest bound. If undefined,
  20127. * translucencyByDistance will be disabled.
  20128. * @example
  20129. * // Example 1.
  20130. * // Set a billboard's translucency to 1.0 when the
  20131. * // camera is 1500 meters from the billboard and disappear as
  20132. * // the camera distance approaches 8.0e6 meters.
  20133. * b.translucencyByDistance = new Cesium.NearFarScalar(1.5e2, 1.0, 8.0e6, 0.0);
  20134. * @example
  20135. * // Example 2.
  20136. * // disable translucency by distance
  20137. * b.translucencyByDistance = undefined;
  20138. */
  20139. translucencyByDistance: NearFarScalar;
  20140. /**
  20141. * Gets or sets near and far pixel offset scaling properties of a Billboard based on the billboard's distance from the camera.
  20142. * A billboard's pixel offset will be scaled between the {@link NearFarScalar#nearValue} and
  20143. * {@link NearFarScalar#farValue} while the camera distance falls within the lower and upper bounds
  20144. * of the specified {@link NearFarScalar#near} and {@link NearFarScalar#far}.
  20145. * Outside of these ranges the billboard's pixel offset scale remains clamped to the nearest bound. If undefined,
  20146. * pixelOffsetScaleByDistance will be disabled.
  20147. * @example
  20148. * // Example 1.
  20149. * // Set a billboard's pixel offset scale to 0.0 when the
  20150. * // camera is 1500 meters from the billboard and scale pixel offset to 10.0 pixels
  20151. * // in the y direction the camera distance approaches 8.0e6 meters.
  20152. * b.pixelOffset = new Cesium.Cartesian2(0.0, 1.0);
  20153. * b.pixelOffsetScaleByDistance = new Cesium.NearFarScalar(1.5e2, 0.0, 8.0e6, 10.0);
  20154. * @example
  20155. * // Example 2.
  20156. * // disable pixel offset by distance
  20157. * b.pixelOffsetScaleByDistance = undefined;
  20158. */
  20159. pixelOffsetScaleByDistance: NearFarScalar;
  20160. /**
  20161. * Gets or sets the 3D Cartesian offset applied to this billboard in eye coordinates. Eye coordinates is a left-handed
  20162. * coordinate system, where <code>x</code> points towards the viewer's right, <code>y</code> points up, and
  20163. * <code>z</code> points into the screen. Eye coordinates use the same scale as world and model coordinates,
  20164. * which is typically meters.
  20165. * <br /><br />
  20166. * An eye offset is commonly used to arrange multiple billboards or objects at the same position, e.g., to
  20167. * arrange a billboard above its corresponding 3D model.
  20168. * <br /><br />
  20169. * Below, the billboard is positioned at the center of the Earth but an eye offset makes it always
  20170. * appear on top of the Earth regardless of the viewer's or Earth's orientation.
  20171. * <br /><br />
  20172. * <div align='center'>
  20173. * <table border='0' cellpadding='5'><tr>
  20174. * <td align='center'><img src='Images/Billboard.setEyeOffset.one.png' width='250' height='188' /></td>
  20175. * <td align='center'><img src='Images/Billboard.setEyeOffset.two.png' width='250' height='188' /></td>
  20176. * </tr></table>
  20177. * <code>b.eyeOffset = new Cartesian3(0.0, 8000000.0, 0.0);</code><br /><br />
  20178. * </div>
  20179. */
  20180. eyeOffset: Cartesian3;
  20181. /**
  20182. * Gets or sets the horizontal origin of this billboard, which determines if the billboard is
  20183. * to the left, center, or right of its anchor position.
  20184. * <br /><br />
  20185. * <div align='center'>
  20186. * <img src='Images/Billboard.setHorizontalOrigin.png' width='648' height='196' /><br />
  20187. * </div>
  20188. * @example
  20189. * // Use a bottom, left origin
  20190. * b.horizontalOrigin = Cesium.HorizontalOrigin.LEFT;
  20191. * b.verticalOrigin = Cesium.VerticalOrigin.BOTTOM;
  20192. */
  20193. horizontalOrigin: HorizontalOrigin;
  20194. /**
  20195. * Gets or sets the vertical origin of this billboard, which determines if the billboard is
  20196. * to the above, below, or at the center of its anchor position.
  20197. * <br /><br />
  20198. * <div align='center'>
  20199. * <img src='Images/Billboard.setVerticalOrigin.png' width='695' height='175' /><br />
  20200. * </div>
  20201. * @example
  20202. * // Use a bottom, left origin
  20203. * b.horizontalOrigin = Cesium.HorizontalOrigin.LEFT;
  20204. * b.verticalOrigin = Cesium.VerticalOrigin.BOTTOM;
  20205. */
  20206. verticalOrigin: VerticalOrigin;
  20207. /**
  20208. * Gets or sets the uniform scale that is multiplied with the billboard's image size in pixels.
  20209. * A scale of <code>1.0</code> does not change the size of the billboard; a scale greater than
  20210. * <code>1.0</code> enlarges the billboard; a positive scale less than <code>1.0</code> shrinks
  20211. * the billboard.
  20212. * <br /><br />
  20213. * <div align='center'>
  20214. * <img src='Images/Billboard.setScale.png' width='400' height='300' /><br/>
  20215. * From left to right in the above image, the scales are <code>0.5</code>, <code>1.0</code>,
  20216. * and <code>2.0</code>.
  20217. * </div>
  20218. */
  20219. scale: number;
  20220. /**
  20221. * Gets or sets the color that is multiplied with the billboard's texture. This has two common use cases. First,
  20222. * the same white texture may be used by many different billboards, each with a different color, to create
  20223. * colored billboards. Second, the color's alpha component can be used to make the billboard translucent as shown below.
  20224. * An alpha of <code>0.0</code> makes the billboard transparent, and <code>1.0</code> makes the billboard opaque.
  20225. * <br /><br />
  20226. * <div align='center'>
  20227. * <table border='0' cellpadding='5'><tr>
  20228. * <td align='center'><code>default</code><br/><img src='Images/Billboard.setColor.Alpha255.png' width='250' height='188' /></td>
  20229. * <td align='center'><code>alpha : 0.5</code><br/><img src='Images/Billboard.setColor.Alpha127.png' width='250' height='188' /></td>
  20230. * </tr></table>
  20231. * </div>
  20232. * <br />
  20233. * The red, green, blue, and alpha values are indicated by <code>value</code>'s <code>red</code>, <code>green</code>,
  20234. * <code>blue</code>, and <code>alpha</code> properties as shown in Example 1. These components range from <code>0.0</code>
  20235. * (no intensity) to <code>1.0</code> (full intensity).
  20236. * @example
  20237. * // Example 1. Assign yellow.
  20238. * b.color = Cesium.Color.YELLOW;
  20239. * @example
  20240. * // Example 2. Make a billboard 50% translucent.
  20241. * b.color = new Cesium.Color(1.0, 1.0, 1.0, 0.5);
  20242. */
  20243. color: Color;
  20244. /**
  20245. * Gets or sets the rotation angle in radians.
  20246. */
  20247. rotation: number;
  20248. /**
  20249. * Gets or sets the aligned axis in world space. The aligned axis is the unit vector that the billboard up vector points towards.
  20250. * The default is the zero vector, which means the billboard is aligned to the screen up vector.
  20251. * @example
  20252. * // Example 1.
  20253. * // Have the billboard up vector point north
  20254. * billboard.alignedAxis = Cesium.Cartesian3.UNIT_Z;
  20255. * @example
  20256. * // Example 2.
  20257. * // Have the billboard point east.
  20258. * billboard.alignedAxis = Cesium.Cartesian3.UNIT_Z;
  20259. * billboard.rotation = -Cesium.Math.PI_OVER_TWO;
  20260. * @example
  20261. * // Example 3.
  20262. * // Reset the aligned axis
  20263. * billboard.alignedAxis = Cesium.Cartesian3.ZERO;
  20264. */
  20265. alignedAxis: Cartesian3;
  20266. /**
  20267. * Gets or sets a width for the billboard. If undefined, the image width will be used.
  20268. */
  20269. width: number;
  20270. /**
  20271. * Gets or sets a height for the billboard. If undefined, the image height will be used.
  20272. */
  20273. height: number;
  20274. /**
  20275. * Gets or sets if the billboard size is in meters or pixels. <code>true</code> to size the billboard in meters;
  20276. * otherwise, the size is in pixels.
  20277. */
  20278. sizeInMeters: boolean;
  20279. /**
  20280. * Gets or sets the condition specifying at what distance from the camera that this billboard will be displayed.
  20281. */
  20282. distanceDisplayCondition: DistanceDisplayCondition;
  20283. /**
  20284. * Gets or sets the distance from the camera at which to disable the depth test to, for example, prevent clipping against terrain.
  20285. * When set to zero, the depth test is always applied. When set to Number.POSITIVE_INFINITY, the depth test is never applied.
  20286. */
  20287. disableDepthTestDistance: number;
  20288. /**
  20289. * Gets or sets the user-defined object returned when the billboard is picked.
  20290. */
  20291. id: any;
  20292. /**
  20293. * <p>
  20294. * Gets or sets the image to be used for this billboard. If a texture has already been created for the
  20295. * given image, the existing texture is used.
  20296. * </p>
  20297. * <p>
  20298. * This property can be set to a loaded Image, a URL which will be loaded as an Image automatically,
  20299. * a canvas, or another billboard's image property (from the same billboard collection).
  20300. * </p>
  20301. * @example
  20302. * // load an image from a URL
  20303. * b.image = 'some/image/url.png';
  20304. *
  20305. * // assuming b1 and b2 are billboards in the same billboard collection,
  20306. * // use the same image for both billboards.
  20307. * b2.image = b1.image;
  20308. */
  20309. image: string;
  20310. /**
  20311. * When <code>true</code>, this billboard is ready to render, i.e., the image
  20312. * has been downloaded and the WebGL resources are created.
  20313. */
  20314. readonly ready: boolean;
  20315. /**
  20316. * <p>
  20317. * Sets the image to be used for this billboard. If a texture has already been created for the
  20318. * given id, the existing texture is used.
  20319. * </p>
  20320. * <p>
  20321. * This function is useful for dynamically creating textures that are shared across many billboards.
  20322. * Only the first billboard will actually call the function and create the texture, while subsequent
  20323. * billboards created with the same id will simply re-use the existing texture.
  20324. * </p>
  20325. * <p>
  20326. * To load an image from a URL, setting the {@link Billboard#image} property is more convenient.
  20327. * </p>
  20328. * @example
  20329. * // create a billboard image dynamically
  20330. * function drawImage(id) {
  20331. * // create and draw an image using a canvas
  20332. * const canvas = document.createElement('canvas');
  20333. * const context2D = canvas.getContext('2d');
  20334. * // ... draw image
  20335. * return canvas;
  20336. * }
  20337. * // drawImage will be called to create the texture
  20338. * b.setImage('myImage', drawImage);
  20339. *
  20340. * // subsequent billboards created in the same collection using the same id will use the existing
  20341. * // texture, without the need to create the canvas or draw the image
  20342. * b2.setImage('myImage', drawImage);
  20343. * @param id - The id of the image. This can be any string that uniquely identifies the image.
  20344. * @param image - The image to load. This parameter
  20345. * can either be a loaded Image or Canvas, a URL which will be loaded as an Image automatically,
  20346. * or a function which will be called to create the image if it hasn't been loaded already.
  20347. */
  20348. setImage(id: string, image: HTMLImageElement | HTMLCanvasElement | string | Resource | Billboard.CreateImageCallback): void;
  20349. /**
  20350. * Uses a sub-region of the image with the given id as the image for this billboard,
  20351. * measured in pixels from the bottom-left.
  20352. * @param id - The id of the image to use.
  20353. * @param subRegion - The sub-region of the image.
  20354. */
  20355. setImageSubRegion(id: string, subRegion: BoundingRectangle): void;
  20356. /**
  20357. * Computes the screen-space position of the billboard's origin, taking into account eye and pixel offsets.
  20358. * The screen space origin is the top, left corner of the canvas; <code>x</code> increases from
  20359. * left to right, and <code>y</code> increases from top to bottom.
  20360. * @example
  20361. * console.log(b.computeScreenSpacePosition(scene).toString());
  20362. * @param scene - The scene.
  20363. * @param [result] - The object onto which to store the result.
  20364. * @returns The screen-space position of the billboard.
  20365. */
  20366. computeScreenSpacePosition(scene: Scene, result?: Cartesian2): Cartesian2;
  20367. /**
  20368. * Determines if this billboard equals another billboard. Billboards are equal if all their properties
  20369. * are equal. Billboards in different collections can be equal.
  20370. * @param other - The billboard to compare for equality.
  20371. * @returns <code>true</code> if the billboards are equal; otherwise, <code>false</code>.
  20372. */
  20373. equals(other: Billboard): boolean;
  20374. }
  20375. export namespace Billboard {
  20376. /**
  20377. * A function that creates an image.
  20378. * @param id - The identifier of the image to load.
  20379. */
  20380. type CreateImageCallback = (id: string) => HTMLImageElement | HTMLCanvasElement | Promise<HTMLImageElement | HTMLCanvasElement>;
  20381. }
  20382. /**
  20383. * A renderable collection of billboards. Billboards are viewport-aligned
  20384. * images positioned in the 3D scene.
  20385. * <br /><br />
  20386. * <div align='center'>
  20387. * <img src='Images/Billboard.png' width='400' height='300' /><br />
  20388. * Example billboards
  20389. * </div>
  20390. * <br /><br />
  20391. * Billboards are added and removed from the collection using {@link BillboardCollection#add}
  20392. * and {@link BillboardCollection#remove}. Billboards in a collection automatically share textures
  20393. * for images with the same identifier.
  20394. * @example
  20395. * // Create a billboard collection with two billboards
  20396. * const billboards = scene.primitives.add(new Cesium.BillboardCollection());
  20397. * billboards.add({
  20398. * position : new Cesium.Cartesian3(1.0, 2.0, 3.0),
  20399. * image : 'url/to/image'
  20400. * });
  20401. * billboards.add({
  20402. * position : new Cesium.Cartesian3(4.0, 5.0, 6.0),
  20403. * image : 'url/to/another/image'
  20404. * });
  20405. * @param [options] - Object with the following properties:
  20406. * @param [options.modelMatrix = Matrix4.IDENTITY] - The 4x4 transformation matrix that transforms each billboard from model to world coordinates.
  20407. * @param [options.debugShowBoundingVolume = false] - For debugging only. Determines if this primitive's commands' bounding spheres are shown.
  20408. * @param [options.scene] - Must be passed in for billboards that use the height reference property or will be depth tested against the globe.
  20409. * @param [options.blendOption = BlendOption.OPAQUE_AND_TRANSLUCENT] - The billboard blending option. The default
  20410. * is used for rendering both opaque and translucent billboards. However, if either all of the billboards are completely opaque or all are completely translucent,
  20411. * setting the technique to BlendOption.OPAQUE or BlendOption.TRANSLUCENT can improve performance by up to 2x.
  20412. * @param [options.show = true] - Determines if the billboards in the collection will be shown.
  20413. */
  20414. export class BillboardCollection {
  20415. constructor(options?: {
  20416. modelMatrix?: Matrix4;
  20417. debugShowBoundingVolume?: boolean;
  20418. scene?: Scene;
  20419. blendOption?: BlendOption;
  20420. show?: boolean;
  20421. });
  20422. /**
  20423. * Determines if billboards in this collection will be shown.
  20424. */
  20425. show: boolean;
  20426. /**
  20427. * The 4x4 transformation matrix that transforms each billboard in this collection from model to world coordinates.
  20428. * When this is the identity matrix, the billboards are drawn in world coordinates, i.e., Earth's WGS84 coordinates.
  20429. * Local reference frames can be used by providing a different transformation matrix, like that returned
  20430. * by {@link Transforms.eastNorthUpToFixedFrame}.
  20431. * @example
  20432. * const center = Cesium.Cartesian3.fromDegrees(-75.59777, 40.03883);
  20433. * billboards.modelMatrix = Cesium.Transforms.eastNorthUpToFixedFrame(center);
  20434. * billboards.add({
  20435. * image : 'url/to/image',
  20436. * position : new Cesium.Cartesian3(0.0, 0.0, 0.0) // center
  20437. * });
  20438. * billboards.add({
  20439. * image : 'url/to/image',
  20440. * position : new Cesium.Cartesian3(1000000.0, 0.0, 0.0) // east
  20441. * });
  20442. * billboards.add({
  20443. * image : 'url/to/image',
  20444. * position : new Cesium.Cartesian3(0.0, 1000000.0, 0.0) // north
  20445. * });
  20446. * billboards.add({
  20447. * image : 'url/to/image',
  20448. * position : new Cesium.Cartesian3(0.0, 0.0, 1000000.0) // up
  20449. * });
  20450. */
  20451. modelMatrix: Matrix4;
  20452. /**
  20453. * This property is for debugging only; it is not for production use nor is it optimized.
  20454. * <p>
  20455. * Draws the bounding sphere for each draw command in the primitive.
  20456. * </p>
  20457. */
  20458. debugShowBoundingVolume: boolean;
  20459. /**
  20460. * This property is for debugging only; it is not for production use nor is it optimized.
  20461. * <p>
  20462. * Draws the texture atlas for this BillboardCollection as a fullscreen quad.
  20463. * </p>
  20464. */
  20465. debugShowTextureAtlas: boolean;
  20466. /**
  20467. * The billboard blending option. The default is used for rendering both opaque and translucent billboards.
  20468. * However, if either all of the billboards are completely opaque or all are completely translucent,
  20469. * setting the technique to BlendOption.OPAQUE or BlendOption.TRANSLUCENT can improve
  20470. * performance by up to 2x.
  20471. */
  20472. blendOption: BlendOption;
  20473. /**
  20474. * Returns the number of billboards in this collection. This is commonly used with
  20475. * {@link BillboardCollection#get} to iterate over all the billboards
  20476. * in the collection.
  20477. */
  20478. length: number;
  20479. /**
  20480. * Creates and adds a billboard with the specified initial properties to the collection.
  20481. * The added billboard is returned so it can be modified or removed from the collection later.
  20482. * @example
  20483. * // Example 1: Add a billboard, specifying all the default values.
  20484. * const b = billboards.add({
  20485. * show : true,
  20486. * position : Cesium.Cartesian3.ZERO,
  20487. * pixelOffset : Cesium.Cartesian2.ZERO,
  20488. * eyeOffset : Cesium.Cartesian3.ZERO,
  20489. * heightReference : Cesium.HeightReference.NONE,
  20490. * horizontalOrigin : Cesium.HorizontalOrigin.CENTER,
  20491. * verticalOrigin : Cesium.VerticalOrigin.CENTER,
  20492. * scale : 1.0,
  20493. * image : 'url/to/image',
  20494. * imageSubRegion : undefined,
  20495. * color : Cesium.Color.WHITE,
  20496. * id : undefined,
  20497. * rotation : 0.0,
  20498. * alignedAxis : Cesium.Cartesian3.ZERO,
  20499. * width : undefined,
  20500. * height : undefined,
  20501. * scaleByDistance : undefined,
  20502. * translucencyByDistance : undefined,
  20503. * pixelOffsetScaleByDistance : undefined,
  20504. * sizeInMeters : false,
  20505. * distanceDisplayCondition : undefined
  20506. * });
  20507. * @example
  20508. * // Example 2: Specify only the billboard's cartographic position.
  20509. * const b = billboards.add({
  20510. * position : Cesium.Cartesian3.fromDegrees(longitude, latitude, height)
  20511. * });
  20512. * @param [options] - A template describing the billboard's properties as shown in Example 1.
  20513. * @returns The billboard that was added to the collection.
  20514. */
  20515. add(options?: any): Billboard;
  20516. /**
  20517. * Removes a billboard from the collection.
  20518. * @example
  20519. * const b = billboards.add(...);
  20520. * billboards.remove(b); // Returns true
  20521. * @param billboard - The billboard to remove.
  20522. * @returns <code>true</code> if the billboard was removed; <code>false</code> if the billboard was not found in the collection.
  20523. */
  20524. remove(billboard: Billboard): boolean;
  20525. /**
  20526. * Removes all billboards from the collection.
  20527. * @example
  20528. * billboards.add(...);
  20529. * billboards.add(...);
  20530. * billboards.removeAll();
  20531. */
  20532. removeAll(): void;
  20533. /**
  20534. * Check whether this collection contains a given billboard.
  20535. * @param [billboard] - The billboard to check for.
  20536. * @returns true if this collection contains the billboard, false otherwise.
  20537. */
  20538. contains(billboard?: Billboard): boolean;
  20539. /**
  20540. * Returns the billboard in the collection at the specified index. Indices are zero-based
  20541. * and increase as billboards are added. Removing a billboard shifts all billboards after
  20542. * it to the left, changing their indices. This function is commonly used with
  20543. * {@link BillboardCollection#length} to iterate over all the billboards
  20544. * in the collection.
  20545. * @example
  20546. * // Toggle the show property of every billboard in the collection
  20547. * const len = billboards.length;
  20548. * for (let i = 0; i < len; ++i) {
  20549. * const b = billboards.get(i);
  20550. * b.show = !b.show;
  20551. * }
  20552. * @param index - The zero-based index of the billboard.
  20553. * @returns The billboard at the specified index.
  20554. */
  20555. get(index: number): Billboard;
  20556. /**
  20557. * Called when {@link Viewer} or {@link CesiumWidget} render the scene to
  20558. * get the draw commands needed to render this primitive.
  20559. * <p>
  20560. * Do not call this function directly. This is documented just to
  20561. * list the exceptions that may be propagated when the scene is rendered:
  20562. * </p>
  20563. */
  20564. update(): void;
  20565. /**
  20566. * Returns true if this object was destroyed; otherwise, false.
  20567. * <br /><br />
  20568. * If this object was destroyed, it should not be used; calling any function other than
  20569. * <code>isDestroyed</code> will result in a {@link DeveloperError} exception.
  20570. * @returns <code>true</code> if this object was destroyed; otherwise, <code>false</code>.
  20571. */
  20572. isDestroyed(): boolean;
  20573. /**
  20574. * Destroys the WebGL resources held by this object. Destroying an object allows for deterministic
  20575. * release of WebGL resources, instead of relying on the garbage collector to destroy this object.
  20576. * <br /><br />
  20577. * Once an object is destroyed, it should not be used; calling any function other than
  20578. * <code>isDestroyed</code> will result in a {@link DeveloperError} exception. Therefore,
  20579. * assign the return value (<code>undefined</code>) to the object as done in the example.
  20580. * @example
  20581. * billboards = billboards && billboards.destroy();
  20582. */
  20583. destroy(): void;
  20584. }
  20585. export namespace BingMapsImageryProvider {
  20586. /**
  20587. * Initialization options for the BingMapsImageryProvider constructor
  20588. * @property url - The url of the Bing Maps server hosting the imagery.
  20589. * @property key - The Bing Maps key for your application, which can be
  20590. * created at {@link https://www.bingmapsportal.com/}.
  20591. * @property [tileProtocol] - The protocol to use when loading tiles, e.g. 'http' or 'https'.
  20592. * By default, tiles are loaded using the same protocol as the page.
  20593. * @property [mapStyle = BingMapsStyle.AERIAL] - The type of Bing Maps imagery to load.
  20594. * @property [culture = ''] - The culture to use when requesting Bing Maps imagery. Not
  20595. * all cultures are supported. See {@link http://msdn.microsoft.com/en-us/library/hh441729.aspx}
  20596. * for information on the supported cultures.
  20597. * @property [ellipsoid] - The ellipsoid. If not specified, the WGS84 ellipsoid is used.
  20598. * @property [tileDiscardPolicy] - The policy that determines if a tile
  20599. * is invalid and should be discarded. By default, a {@link DiscardEmptyTileImagePolicy}
  20600. * will be used, with the expectation that the Bing Maps server will send a zero-length response for missing tiles.
  20601. * To ensure that no tiles are discarded, construct and pass a {@link NeverTileDiscardPolicy} for this parameter.
  20602. */
  20603. type ConstructorOptions = {
  20604. url: Resource | string;
  20605. key: string;
  20606. tileProtocol?: string;
  20607. mapStyle?: BingMapsStyle;
  20608. culture?: string;
  20609. ellipsoid?: Ellipsoid;
  20610. tileDiscardPolicy?: TileDiscardPolicy;
  20611. };
  20612. }
  20613. /**
  20614. * Provides tiled imagery using the Bing Maps Imagery REST API.
  20615. * @example
  20616. * const bing = new Cesium.BingMapsImageryProvider({
  20617. * url : 'https://dev.virtualearth.net',
  20618. * key : 'get-yours-at-https://www.bingmapsportal.com/',
  20619. * mapStyle : Cesium.BingMapsStyle.AERIAL
  20620. * });
  20621. * @param options - Object describing initialization options
  20622. */
  20623. export class BingMapsImageryProvider {
  20624. constructor(options: BingMapsImageryProvider.ConstructorOptions);
  20625. /**
  20626. * The default alpha blending value of this provider, with 0.0 representing fully transparent and
  20627. * 1.0 representing fully opaque.
  20628. */
  20629. defaultAlpha: number | undefined;
  20630. /**
  20631. * The default alpha blending value on the night side of the globe of this provider, with 0.0 representing fully transparent and
  20632. * 1.0 representing fully opaque.
  20633. */
  20634. defaultNightAlpha: number | undefined;
  20635. /**
  20636. * The default alpha blending value on the day side of the globe of this provider, with 0.0 representing fully transparent and
  20637. * 1.0 representing fully opaque.
  20638. */
  20639. defaultDayAlpha: number | undefined;
  20640. /**
  20641. * The default brightness of this provider. 1.0 uses the unmodified imagery color. Less than 1.0
  20642. * makes the imagery darker while greater than 1.0 makes it brighter.
  20643. */
  20644. defaultBrightness: number | undefined;
  20645. /**
  20646. * The default contrast of this provider. 1.0 uses the unmodified imagery color. Less than 1.0 reduces
  20647. * the contrast while greater than 1.0 increases it.
  20648. */
  20649. defaultContrast: number | undefined;
  20650. /**
  20651. * The default hue of this provider in radians. 0.0 uses the unmodified imagery color.
  20652. */
  20653. defaultHue: number | undefined;
  20654. /**
  20655. * The default saturation of this provider. 1.0 uses the unmodified imagery color. Less than 1.0 reduces the
  20656. * saturation while greater than 1.0 increases it.
  20657. */
  20658. defaultSaturation: number | undefined;
  20659. /**
  20660. * The default gamma correction to apply to this provider. 1.0 uses the unmodified imagery color.
  20661. */
  20662. defaultGamma: number | undefined;
  20663. /**
  20664. * The default texture minification filter to apply to this provider.
  20665. */
  20666. defaultMinificationFilter: TextureMinificationFilter;
  20667. /**
  20668. * The default texture magnification filter to apply to this provider.
  20669. */
  20670. defaultMagnificationFilter: TextureMagnificationFilter;
  20671. /**
  20672. * Gets the name of the BingMaps server url hosting the imagery.
  20673. */
  20674. readonly url: string;
  20675. /**
  20676. * Gets the proxy used by this provider.
  20677. */
  20678. readonly proxy: Proxy;
  20679. /**
  20680. * Gets the Bing Maps key.
  20681. */
  20682. readonly key: string;
  20683. /**
  20684. * Gets the type of Bing Maps imagery to load.
  20685. */
  20686. readonly mapStyle: BingMapsStyle;
  20687. /**
  20688. * The culture to use when requesting Bing Maps imagery. Not
  20689. * all cultures are supported. See {@link http://msdn.microsoft.com/en-us/library/hh441729.aspx}
  20690. * for information on the supported cultures.
  20691. */
  20692. readonly culture: string;
  20693. /**
  20694. * Gets the width of each tile, in pixels. This function should
  20695. * not be called before {@link BingMapsImageryProvider#ready} returns true.
  20696. */
  20697. readonly tileWidth: number;
  20698. /**
  20699. * Gets the height of each tile, in pixels. This function should
  20700. * not be called before {@link BingMapsImageryProvider#ready} returns true.
  20701. */
  20702. readonly tileHeight: number;
  20703. /**
  20704. * Gets the maximum level-of-detail that can be requested. This function should
  20705. * not be called before {@link BingMapsImageryProvider#ready} returns true.
  20706. */
  20707. readonly maximumLevel: number | undefined;
  20708. /**
  20709. * Gets the minimum level-of-detail that can be requested. This function should
  20710. * not be called before {@link BingMapsImageryProvider#ready} returns true.
  20711. */
  20712. readonly minimumLevel: number;
  20713. /**
  20714. * Gets the tiling scheme used by this provider. This function should
  20715. * not be called before {@link BingMapsImageryProvider#ready} returns true.
  20716. */
  20717. readonly tilingScheme: TilingScheme;
  20718. /**
  20719. * Gets the rectangle, in radians, of the imagery provided by this instance. This function should
  20720. * not be called before {@link BingMapsImageryProvider#ready} returns true.
  20721. */
  20722. readonly rectangle: Rectangle;
  20723. /**
  20724. * Gets the tile discard policy. If not undefined, the discard policy is responsible
  20725. * for filtering out "missing" tiles via its shouldDiscardImage function. If this function
  20726. * returns undefined, no tiles are filtered. This function should
  20727. * not be called before {@link BingMapsImageryProvider#ready} returns true.
  20728. */
  20729. readonly tileDiscardPolicy: TileDiscardPolicy;
  20730. /**
  20731. * Gets an event that is raised when the imagery provider encounters an asynchronous error. By subscribing
  20732. * to the event, you will be notified of the error and can potentially recover from it. Event listeners
  20733. * are passed an instance of {@link TileProviderError}.
  20734. */
  20735. readonly errorEvent: Event;
  20736. /**
  20737. * Gets a value indicating whether or not the provider is ready for use.
  20738. */
  20739. readonly ready: boolean;
  20740. /**
  20741. * Gets a promise that resolves to true when the provider is ready for use.
  20742. */
  20743. readonly readyPromise: Promise<boolean>;
  20744. /**
  20745. * Gets the credit to display when this imagery provider is active. Typically this is used to credit
  20746. * the source of the imagery. This function should not be called before {@link BingMapsImageryProvider#ready} returns true.
  20747. */
  20748. readonly credit: Credit;
  20749. /**
  20750. * Gets a value indicating whether or not the images provided by this imagery provider
  20751. * include an alpha channel. If this property is false, an alpha channel, if present, will
  20752. * be ignored. If this property is true, any images without an alpha channel will be treated
  20753. * as if their alpha is 1.0 everywhere. Setting this property to false reduces memory usage
  20754. * and texture upload time.
  20755. */
  20756. readonly hasAlphaChannel: boolean;
  20757. /**
  20758. * Gets the credits to be displayed when a given tile is displayed.
  20759. * @param x - The tile X coordinate.
  20760. * @param y - The tile Y coordinate.
  20761. * @param level - The tile level;
  20762. * @returns The credits to be displayed when the tile is displayed.
  20763. */
  20764. getTileCredits(x: number, y: number, level: number): Credit[];
  20765. /**
  20766. * Requests the image for a given tile. This function should
  20767. * not be called before {@link BingMapsImageryProvider#ready} returns true.
  20768. * @param x - The tile X coordinate.
  20769. * @param y - The tile Y coordinate.
  20770. * @param level - The tile level.
  20771. * @param [request] - The request object. Intended for internal use only.
  20772. * @returns A promise for the image that will resolve when the image is available, or
  20773. * undefined if there are too many active requests to the server, and the request should be retried later.
  20774. */
  20775. requestImage(x: number, y: number, level: number, request?: Request): Promise<ImageryTypes> | undefined;
  20776. /**
  20777. * Picking features is not currently supported by this imagery provider, so this function simply returns
  20778. * undefined.
  20779. * @param x - The tile X coordinate.
  20780. * @param y - The tile Y coordinate.
  20781. * @param level - The tile level.
  20782. * @param longitude - The longitude at which to pick features.
  20783. * @param latitude - The latitude at which to pick features.
  20784. * @returns Undefined since picking is not supported.
  20785. */
  20786. pickFeatures(x: number, y: number, level: number, longitude: number, latitude: number): undefined;
  20787. /**
  20788. * Converts a tiles (x, y, level) position into a quadkey used to request an image
  20789. * from a Bing Maps server.
  20790. * @param x - The tile's x coordinate.
  20791. * @param y - The tile's y coordinate.
  20792. * @param level - The tile's zoom level.
  20793. */
  20794. tileXYToQuadKey(x: number, y: number, level: number): void;
  20795. /**
  20796. * Converts a tile's quadkey used to request an image from a Bing Maps server into the
  20797. * (x, y, level) position.
  20798. * @param quadkey - The tile's quad key
  20799. */
  20800. quadKeyToTileXY(quadkey: string): void;
  20801. /**
  20802. * Gets or sets the URL to the Bing logo for display in the credit.
  20803. */
  20804. logoUrl: string;
  20805. }
  20806. /**
  20807. * The types of imagery provided by Bing Maps.
  20808. */
  20809. export enum BingMapsStyle {
  20810. /**
  20811. * Aerial imagery.
  20812. */
  20813. AERIAL = "Aerial",
  20814. /**
  20815. * Aerial imagery with a road overlay.
  20816. */
  20817. AERIAL_WITH_LABELS = "AerialWithLabels",
  20818. /**
  20819. * Aerial imagery with a road overlay.
  20820. */
  20821. AERIAL_WITH_LABELS_ON_DEMAND = "AerialWithLabelsOnDemand",
  20822. /**
  20823. * Roads without additional imagery.
  20824. */
  20825. ROAD = "Road",
  20826. /**
  20827. * Roads without additional imagery.
  20828. */
  20829. ROAD_ON_DEMAND = "RoadOnDemand",
  20830. /**
  20831. * A dark version of the road maps.
  20832. */
  20833. CANVAS_DARK = "CanvasDark",
  20834. /**
  20835. * A lighter version of the road maps.
  20836. */
  20837. CANVAS_LIGHT = "CanvasLight",
  20838. /**
  20839. * A grayscale version of the road maps.
  20840. */
  20841. CANVAS_GRAY = "CanvasGray",
  20842. /**
  20843. * Ordnance Survey imagery. This imagery is visible only for the London, UK area.
  20844. */
  20845. ORDNANCE_SURVEY = "OrdnanceSurvey",
  20846. /**
  20847. * Collins Bart imagery.
  20848. */
  20849. COLLINS_BART = "CollinsBart"
  20850. }
  20851. /**
  20852. * Determines how two pixels' values are combined.
  20853. */
  20854. export enum BlendEquation {
  20855. /**
  20856. * Pixel values are added componentwise. This is used in additive blending for translucency.
  20857. */
  20858. ADD = WebGLConstants.FUNC_ADD,
  20859. /**
  20860. * Pixel values are subtracted componentwise (source - destination). This is used in alpha blending for translucency.
  20861. */
  20862. SUBTRACT = WebGLConstants.FUNC_SUBTRACT,
  20863. /**
  20864. * Pixel values are subtracted componentwise (destination - source).
  20865. */
  20866. REVERSE_SUBTRACT = WebGLConstants.FUNC_REVERSE_SUBTRACT,
  20867. /**
  20868. * Pixel values are given to the minimum function (min(source, destination)).
  20869. *
  20870. * This equation operates on each pixel color component.
  20871. */
  20872. MIN = WebGLConstants.MIN,
  20873. /**
  20874. * Pixel values are given to the maximum function (max(source, destination)).
  20875. *
  20876. * This equation operates on each pixel color component.
  20877. */
  20878. MAX = WebGLConstants.MAX
  20879. }
  20880. /**
  20881. * Determines how blending factors are computed.
  20882. */
  20883. export enum BlendFunction {
  20884. /**
  20885. * The blend factor is zero.
  20886. */
  20887. ZERO = WebGLConstants.ZERO,
  20888. /**
  20889. * The blend factor is one.
  20890. */
  20891. ONE = WebGLConstants.ONE,
  20892. /**
  20893. * The blend factor is the source color.
  20894. */
  20895. SOURCE_COLOR = WebGLConstants.SRC_COLOR,
  20896. /**
  20897. * The blend factor is one minus the source color.
  20898. */
  20899. ONE_MINUS_SOURCE_COLOR = WebGLConstants.ONE_MINUS_SRC_COLOR,
  20900. /**
  20901. * The blend factor is the destination color.
  20902. */
  20903. DESTINATION_COLOR = WebGLConstants.DST_COLOR,
  20904. /**
  20905. * The blend factor is one minus the destination color.
  20906. */
  20907. ONE_MINUS_DESTINATION_COLOR = WebGLConstants.ONE_MINUS_DST_COLOR,
  20908. /**
  20909. * The blend factor is the source alpha.
  20910. */
  20911. SOURCE_ALPHA = WebGLConstants.SRC_ALPHA,
  20912. /**
  20913. * The blend factor is one minus the source alpha.
  20914. */
  20915. ONE_MINUS_SOURCE_ALPHA = WebGLConstants.ONE_MINUS_SRC_ALPHA,
  20916. /**
  20917. * The blend factor is the destination alpha.
  20918. */
  20919. DESTINATION_ALPHA = WebGLConstants.DST_ALPHA,
  20920. /**
  20921. * The blend factor is one minus the destination alpha.
  20922. */
  20923. ONE_MINUS_DESTINATION_ALPHA = WebGLConstants.ONE_MINUS_DST_ALPHA,
  20924. /**
  20925. * The blend factor is the constant color.
  20926. */
  20927. CONSTANT_COLOR = WebGLConstants.CONSTANT_COLOR,
  20928. /**
  20929. * The blend factor is one minus the constant color.
  20930. */
  20931. ONE_MINUS_CONSTANT_COLOR = WebGLConstants.ONE_MINUS_CONSTANT_COLOR,
  20932. /**
  20933. * The blend factor is the constant alpha.
  20934. */
  20935. CONSTANT_ALPHA = WebGLConstants.CONSTANT_ALPHA,
  20936. /**
  20937. * The blend factor is one minus the constant alpha.
  20938. */
  20939. ONE_MINUS_CONSTANT_ALPHA = WebGLConstants.ONE_MINUS_CONSTANT_ALPHA,
  20940. /**
  20941. * The blend factor is the saturated source alpha.
  20942. */
  20943. SOURCE_ALPHA_SATURATE = WebGLConstants.SRC_ALPHA_SATURATE
  20944. }
  20945. /**
  20946. * Determines how opaque and translucent parts of billboards, points, and labels are blended with the scene.
  20947. */
  20948. export enum BlendOption {
  20949. /**
  20950. * The billboards, points, or labels in the collection are completely opaque.
  20951. */
  20952. OPAQUE = 0,
  20953. /**
  20954. * The billboards, points, or labels in the collection are completely translucent.
  20955. */
  20956. TRANSLUCENT = 1,
  20957. /**
  20958. * The billboards, points, or labels in the collection are both opaque and translucent.
  20959. */
  20960. OPAQUE_AND_TRANSLUCENT = 2
  20961. }
  20962. /**
  20963. * The blending state combines {@link BlendEquation} and {@link BlendFunction} and the
  20964. * <code>enabled</code> flag to define the full blending state for combining source and
  20965. * destination fragments when rendering.
  20966. * <p>
  20967. * This is a helper when using custom render states with {@link Appearance#renderState}.
  20968. * </p>
  20969. */
  20970. export namespace BlendingState {
  20971. /**
  20972. * Blending is disabled.
  20973. */
  20974. const DISABLED: any;
  20975. /**
  20976. * Blending is enabled using alpha blending, <code>source(source.alpha) + destination(1 - source.alpha)</code>.
  20977. */
  20978. const ALPHA_BLEND: any;
  20979. /**
  20980. * Blending is enabled using alpha blending with premultiplied alpha, <code>source + destination(1 - source.alpha)</code>.
  20981. */
  20982. const PRE_MULTIPLIED_ALPHA_BLEND: any;
  20983. /**
  20984. * Blending is enabled using additive blending, <code>source(source.alpha) + destination</code>.
  20985. */
  20986. const ADDITIVE_BLEND: any;
  20987. }
  20988. /**
  20989. * The camera is defined by a position, orientation, and view frustum.
  20990. * <br /><br />
  20991. * The orientation forms an orthonormal basis with a view, up and right = view x up unit vectors.
  20992. * <br /><br />
  20993. * The viewing frustum is defined by 6 planes.
  20994. * Each plane is represented by a {@link Cartesian4} object, where the x, y, and z components
  20995. * define the unit vector normal to the plane, and the w component is the distance of the
  20996. * plane from the origin/camera position.
  20997. * @example
  20998. * // Create a camera looking down the negative z-axis, positioned at the origin,
  20999. * // with a field of view of 60 degrees, and 1:1 aspect ratio.
  21000. * const camera = new Cesium.Camera(scene);
  21001. * camera.position = new Cesium.Cartesian3();
  21002. * camera.direction = Cesium.Cartesian3.negate(Cesium.Cartesian3.UNIT_Z, new Cesium.Cartesian3());
  21003. * camera.up = Cesium.Cartesian3.clone(Cesium.Cartesian3.UNIT_Y);
  21004. * camera.frustum.fov = Cesium.Math.PI_OVER_THREE;
  21005. * camera.frustum.near = 1.0;
  21006. * camera.frustum.far = 2.0;
  21007. * @param scene - The scene.
  21008. */
  21009. export class Camera {
  21010. constructor(scene: Scene);
  21011. /**
  21012. * The position of the camera.
  21013. */
  21014. position: Cartesian3;
  21015. /**
  21016. * The view direction of the camera.
  21017. */
  21018. direction: Cartesian3;
  21019. /**
  21020. * The up direction of the camera.
  21021. */
  21022. up: Cartesian3;
  21023. /**
  21024. * The right direction of the camera.
  21025. */
  21026. right: Cartesian3;
  21027. /**
  21028. * The region of space in view.
  21029. */
  21030. frustum: PerspectiveFrustum | PerspectiveOffCenterFrustum | OrthographicFrustum;
  21031. /**
  21032. * The default amount to move the camera when an argument is not
  21033. * provided to the move methods.
  21034. */
  21035. defaultMoveAmount: number;
  21036. /**
  21037. * The default amount to rotate the camera when an argument is not
  21038. * provided to the look methods.
  21039. */
  21040. defaultLookAmount: number;
  21041. /**
  21042. * The default amount to rotate the camera when an argument is not
  21043. * provided to the rotate methods.
  21044. */
  21045. defaultRotateAmount: number;
  21046. /**
  21047. * The default amount to move the camera when an argument is not
  21048. * provided to the zoom methods.
  21049. */
  21050. defaultZoomAmount: number;
  21051. /**
  21052. * If set, the camera will not be able to rotate past this axis in either direction.
  21053. */
  21054. constrainedAxis: Cartesian3;
  21055. /**
  21056. * The factor multiplied by the the map size used to determine where to clamp the camera position
  21057. * when zooming out from the surface. The default is 1.5. Only valid for 2D and the map is rotatable.
  21058. */
  21059. maximumZoomFactor: number;
  21060. /**
  21061. * 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.
  21062. */
  21063. percentageChanged: number;
  21064. /**
  21065. * The default rectangle the camera will view on creation.
  21066. */
  21067. DEFAULT_VIEW_RECTANGLE: Rectangle;
  21068. /**
  21069. * A scalar to multiply to the camera position and add it back after setting the camera to view the rectangle.
  21070. * A value of zero means the camera will view the entire {@link Camera#DEFAULT_VIEW_RECTANGLE}, a value greater than zero
  21071. * will move it further away from the extent, and a value less than zero will move it close to the extent.
  21072. */
  21073. DEFAULT_VIEW_FACTOR: number;
  21074. /**
  21075. * The default heading/pitch/range that is used when the camera flies to a location that contains a bounding sphere.
  21076. */
  21077. DEFAULT_OFFSET: HeadingPitchRange;
  21078. /**
  21079. * Gets the camera's reference frame. The inverse of this transformation is appended to the view matrix.
  21080. */
  21081. readonly transform: Matrix4;
  21082. /**
  21083. * Gets the inverse camera transform.
  21084. */
  21085. readonly inverseTransform: Matrix4;
  21086. /**
  21087. * Gets the view matrix.
  21088. */
  21089. readonly viewMatrix: Matrix4;
  21090. /**
  21091. * Gets the inverse view matrix.
  21092. */
  21093. readonly inverseViewMatrix: Matrix4;
  21094. /**
  21095. * Gets the {@link Cartographic} position of the camera, with longitude and latitude
  21096. * expressed in radians and height in meters. In 2D and Columbus View, it is possible
  21097. * for the returned longitude and latitude to be outside the range of valid longitudes
  21098. * and latitudes when the camera is outside the map.
  21099. */
  21100. readonly positionCartographic: Cartographic;
  21101. /**
  21102. * Gets the position of the camera in world coordinates.
  21103. */
  21104. readonly positionWC: Cartesian3;
  21105. /**
  21106. * Gets the view direction of the camera in world coordinates.
  21107. */
  21108. readonly directionWC: Cartesian3;
  21109. /**
  21110. * Gets the up direction of the camera in world coordinates.
  21111. */
  21112. readonly upWC: Cartesian3;
  21113. /**
  21114. * Gets the right direction of the camera in world coordinates.
  21115. */
  21116. readonly rightWC: Cartesian3;
  21117. /**
  21118. * Gets the camera heading in radians.
  21119. */
  21120. readonly heading: number;
  21121. /**
  21122. * Gets the camera pitch in radians.
  21123. */
  21124. readonly pitch: number;
  21125. /**
  21126. * Gets the camera roll in radians.
  21127. */
  21128. readonly roll: number;
  21129. /**
  21130. * Gets the event that will be raised at when the camera starts to move.
  21131. */
  21132. readonly moveStart: Event;
  21133. /**
  21134. * Gets the event that will be raised when the camera has stopped moving.
  21135. */
  21136. readonly moveEnd: Event;
  21137. /**
  21138. * Gets the event that will be raised when the camera has changed by <code>percentageChanged</code>.
  21139. */
  21140. readonly changed: Event;
  21141. /**
  21142. * Sets the camera position, orientation and transform.
  21143. * @example
  21144. * // 1. Set position with a top-down view
  21145. * viewer.camera.setView({
  21146. * destination : Cesium.Cartesian3.fromDegrees(-117.16, 32.71, 15000.0)
  21147. * });
  21148. *
  21149. * // 2 Set view with heading, pitch and roll
  21150. * viewer.camera.setView({
  21151. * destination : cartesianPosition,
  21152. * orientation: {
  21153. * heading : Cesium.Math.toRadians(90.0), // east, default value is 0.0 (north)
  21154. * pitch : Cesium.Math.toRadians(-90), // default value (looking down)
  21155. * roll : 0.0 // default value
  21156. * }
  21157. * });
  21158. *
  21159. * // 3. Change heading, pitch and roll with the camera position remaining the same.
  21160. * viewer.camera.setView({
  21161. * orientation: {
  21162. * heading : Cesium.Math.toRadians(90.0), // east, default value is 0.0 (north)
  21163. * pitch : Cesium.Math.toRadians(-90), // default value (looking down)
  21164. * roll : 0.0 // default value
  21165. * }
  21166. * });
  21167. *
  21168. *
  21169. * // 4. View rectangle with a top-down view
  21170. * viewer.camera.setView({
  21171. * destination : Cesium.Rectangle.fromDegrees(west, south, east, north)
  21172. * });
  21173. *
  21174. * // 5. Set position with an orientation using unit vectors.
  21175. * viewer.camera.setView({
  21176. * destination : Cesium.Cartesian3.fromDegrees(-122.19, 46.25, 5000.0),
  21177. * orientation : {
  21178. * direction : new Cesium.Cartesian3(-0.04231243104240401, -0.20123236049443421, -0.97862924300734),
  21179. * up : new Cesium.Cartesian3(-0.47934589305293746, -0.8553216253114552, 0.1966022179118339)
  21180. * }
  21181. * });
  21182. * @param options - Object with the following properties:
  21183. * @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.
  21184. * @param [options.orientation] - An object that contains either direction and up properties or heading, pitch and roll properties. By default, the direction will point
  21185. * 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
  21186. * y direction in Columbus view. Orientation is not used in 2D when in infinite scrolling mode.
  21187. * @param [options.endTransform] - Transform matrix representing the reference frame of the camera.
  21188. * @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>.
  21189. */
  21190. setView(options: {
  21191. destination?: Cartesian3 | Rectangle;
  21192. orientation?: HeadingPitchRollValues | DirectionUp;
  21193. endTransform?: Matrix4;
  21194. convert?: boolean;
  21195. }): void;
  21196. /**
  21197. * Fly the camera to the home view. Use {@link Camera#.DEFAULT_VIEW_RECTANGLE} to set
  21198. * the default view for the 3D scene. The home view for 2D and columbus view shows the
  21199. * entire map.
  21200. * @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}
  21201. */
  21202. flyHome(duration?: number): void;
  21203. /**
  21204. * Transform a vector or point from world coordinates to the camera's reference frame.
  21205. * @param cartesian - The vector or point to transform.
  21206. * @param [result] - The object onto which to store the result.
  21207. * @returns The transformed vector or point.
  21208. */
  21209. worldToCameraCoordinates(cartesian: Cartesian4, result?: Cartesian4): Cartesian4;
  21210. /**
  21211. * Transform a point from world coordinates to the camera's reference frame.
  21212. * @param cartesian - The point to transform.
  21213. * @param [result] - The object onto which to store the result.
  21214. * @returns The transformed point.
  21215. */
  21216. worldToCameraCoordinatesPoint(cartesian: Cartesian3, result?: Cartesian3): Cartesian3;
  21217. /**
  21218. * Transform a vector from world coordinates to the camera's reference frame.
  21219. * @param cartesian - The vector to transform.
  21220. * @param [result] - The object onto which to store the result.
  21221. * @returns The transformed vector.
  21222. */
  21223. worldToCameraCoordinatesVector(cartesian: Cartesian3, result?: Cartesian3): Cartesian3;
  21224. /**
  21225. * Transform a vector or point from the camera's reference frame to world coordinates.
  21226. * @param cartesian - The vector or point to transform.
  21227. * @param [result] - The object onto which to store the result.
  21228. * @returns The transformed vector or point.
  21229. */
  21230. cameraToWorldCoordinates(cartesian: Cartesian4, result?: Cartesian4): Cartesian4;
  21231. /**
  21232. * Transform a point from the camera's reference frame to world coordinates.
  21233. * @param cartesian - The point to transform.
  21234. * @param [result] - The object onto which to store the result.
  21235. * @returns The transformed point.
  21236. */
  21237. cameraToWorldCoordinatesPoint(cartesian: Cartesian3, result?: Cartesian3): Cartesian3;
  21238. /**
  21239. * Transform a vector from the camera's reference frame to world coordinates.
  21240. * @param cartesian - The vector to transform.
  21241. * @param [result] - The object onto which to store the result.
  21242. * @returns The transformed vector.
  21243. */
  21244. cameraToWorldCoordinatesVector(cartesian: Cartesian3, result?: Cartesian3): Cartesian3;
  21245. /**
  21246. * Translates the camera's position by <code>amount</code> along <code>direction</code>.
  21247. * @param direction - The direction to move.
  21248. * @param [amount] - The amount, in meters, to move. Defaults to <code>defaultMoveAmount</code>.
  21249. */
  21250. move(direction: Cartesian3, amount?: number): void;
  21251. /**
  21252. * Translates the camera's position by <code>amount</code> along the camera's view vector.
  21253. * When in 2D mode, this will zoom in the camera instead of translating the camera's position.
  21254. * @param [amount] - The amount, in meters, to move. Defaults to <code>defaultMoveAmount</code>.
  21255. */
  21256. moveForward(amount?: number): void;
  21257. /**
  21258. * Translates the camera's position by <code>amount</code> along the opposite direction
  21259. * of the camera's view vector.
  21260. * When in 2D mode, this will zoom out the camera instead of translating the camera's position.
  21261. * @param [amount] - The amount, in meters, to move. Defaults to <code>defaultMoveAmount</code>.
  21262. */
  21263. moveBackward(amount?: number): void;
  21264. /**
  21265. * Translates the camera's position by <code>amount</code> along the camera's up vector.
  21266. * @param [amount] - The amount, in meters, to move. Defaults to <code>defaultMoveAmount</code>.
  21267. */
  21268. moveUp(amount?: number): void;
  21269. /**
  21270. * Translates the camera's position by <code>amount</code> along the opposite direction
  21271. * of the camera's up vector.
  21272. * @param [amount] - The amount, in meters, to move. Defaults to <code>defaultMoveAmount</code>.
  21273. */
  21274. moveDown(amount?: number): void;
  21275. /**
  21276. * Translates the camera's position by <code>amount</code> along the camera's right vector.
  21277. * @param [amount] - The amount, in meters, to move. Defaults to <code>defaultMoveAmount</code>.
  21278. */
  21279. moveRight(amount?: number): void;
  21280. /**
  21281. * Translates the camera's position by <code>amount</code> along the opposite direction
  21282. * of the camera's right vector.
  21283. * @param [amount] - The amount, in meters, to move. Defaults to <code>defaultMoveAmount</code>.
  21284. */
  21285. moveLeft(amount?: number): void;
  21286. /**
  21287. * Rotates the camera around its up vector by amount, in radians, in the opposite direction
  21288. * of its right vector if not in 2D mode.
  21289. * @param [amount] - The amount, in radians, to rotate by. Defaults to <code>defaultLookAmount</code>.
  21290. */
  21291. lookLeft(amount?: number): void;
  21292. /**
  21293. * Rotates the camera around its up vector by amount, in radians, in the direction
  21294. * of its right vector if not in 2D mode.
  21295. * @param [amount] - The amount, in radians, to rotate by. Defaults to <code>defaultLookAmount</code>.
  21296. */
  21297. lookRight(amount?: number): void;
  21298. /**
  21299. * Rotates the camera around its right vector by amount, in radians, in the direction
  21300. * of its up vector if not in 2D mode.
  21301. * @param [amount] - The amount, in radians, to rotate by. Defaults to <code>defaultLookAmount</code>.
  21302. */
  21303. lookUp(amount?: number): void;
  21304. /**
  21305. * Rotates the camera around its right vector by amount, in radians, in the opposite direction
  21306. * of its up vector if not in 2D mode.
  21307. * @param [amount] - The amount, in radians, to rotate by. Defaults to <code>defaultLookAmount</code>.
  21308. */
  21309. lookDown(amount?: number): void;
  21310. /**
  21311. * Rotate each of the camera's orientation vectors around <code>axis</code> by <code>angle</code>
  21312. * @param axis - The axis to rotate around.
  21313. * @param [angle] - The angle, in radians, to rotate by. Defaults to <code>defaultLookAmount</code>.
  21314. */
  21315. look(axis: Cartesian3, angle?: number): void;
  21316. /**
  21317. * Rotate the camera counter-clockwise around its direction vector by amount, in radians.
  21318. * @param [amount] - The amount, in radians, to rotate by. Defaults to <code>defaultLookAmount</code>.
  21319. */
  21320. twistLeft(amount?: number): void;
  21321. /**
  21322. * Rotate the camera clockwise around its direction vector by amount, in radians.
  21323. * @param [amount] - The amount, in radians, to rotate by. Defaults to <code>defaultLookAmount</code>.
  21324. */
  21325. twistRight(amount?: number): void;
  21326. /**
  21327. * Rotates the camera around <code>axis</code> by <code>angle</code>. The distance
  21328. * of the camera's position to the center of the camera's reference frame remains the same.
  21329. * @param axis - The axis to rotate around given in world coordinates.
  21330. * @param [angle] - The angle, in radians, to rotate by. Defaults to <code>defaultRotateAmount</code>.
  21331. */
  21332. rotate(axis: Cartesian3, angle?: number): void;
  21333. /**
  21334. * Rotates the camera around the center of the camera's reference frame by angle downwards.
  21335. * @param [angle] - The angle, in radians, to rotate by. Defaults to <code>defaultRotateAmount</code>.
  21336. */
  21337. rotateDown(angle?: number): void;
  21338. /**
  21339. * Rotates the camera around the center of the camera's reference frame by angle upwards.
  21340. * @param [angle] - The angle, in radians, to rotate by. Defaults to <code>defaultRotateAmount</code>.
  21341. */
  21342. rotateUp(angle?: number): void;
  21343. /**
  21344. * Rotates the camera around the center of the camera's reference frame by angle to the right.
  21345. * @param [angle] - The angle, in radians, to rotate by. Defaults to <code>defaultRotateAmount</code>.
  21346. */
  21347. rotateRight(angle?: number): void;
  21348. /**
  21349. * Rotates the camera around the center of the camera's reference frame by angle to the left.
  21350. * @param [angle] - The angle, in radians, to rotate by. Defaults to <code>defaultRotateAmount</code>.
  21351. */
  21352. rotateLeft(angle?: number): void;
  21353. /**
  21354. * Zooms <code>amount</code> along the camera's view vector.
  21355. * @param [amount] - The amount to move. Defaults to <code>defaultZoomAmount</code>.
  21356. */
  21357. zoomIn(amount?: number): void;
  21358. /**
  21359. * Zooms <code>amount</code> along the opposite direction of
  21360. * the camera's view vector.
  21361. * @param [amount] - The amount to move. Defaults to <code>defaultZoomAmount</code>.
  21362. */
  21363. zoomOut(amount?: number): void;
  21364. /**
  21365. * Gets the magnitude of the camera position. In 3D, this is the vector magnitude. In 2D and
  21366. * Columbus view, this is the distance to the map.
  21367. * @returns The magnitude of the position.
  21368. */
  21369. getMagnitude(): number;
  21370. /**
  21371. * Sets the camera position and orientation using a target and offset. The target must be given in
  21372. * 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.
  21373. * 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
  21374. * is heading/pitch/range, then the heading and the pitch angles are defined in the reference frame defined by the transformation matrix.
  21375. * The heading is the angle from y axis and increasing towards the x axis. Pitch is the rotation from the xy-plane. Positive pitch
  21376. * angles are below the plane. Negative pitch angles are above the plane. The range is the distance from the center.
  21377. *
  21378. * In 2D, there must be a top down view. The camera will be placed above the target looking down. The height above the
  21379. * target will be the magnitude of the offset. The heading will be determined from the offset. If the heading cannot be
  21380. * determined from the offset, the heading will be north.
  21381. * @example
  21382. * // 1. Using a cartesian offset
  21383. * const center = Cesium.Cartesian3.fromDegrees(-98.0, 40.0);
  21384. * viewer.camera.lookAt(center, new Cesium.Cartesian3(0.0, -4790000.0, 3930000.0));
  21385. *
  21386. * // 2. Using a HeadingPitchRange offset
  21387. * const center = Cesium.Cartesian3.fromDegrees(-72.0, 40.0);
  21388. * const heading = Cesium.Math.toRadians(50.0);
  21389. * const pitch = Cesium.Math.toRadians(-20.0);
  21390. * const range = 5000.0;
  21391. * viewer.camera.lookAt(center, new Cesium.HeadingPitchRange(heading, pitch, range));
  21392. * @param target - The target position in world coordinates.
  21393. * @param offset - The offset from the target in the local east-north-up reference frame centered at the target.
  21394. */
  21395. lookAt(target: Cartesian3, offset: Cartesian3 | HeadingPitchRange): void;
  21396. /**
  21397. * Sets the camera position and orientation using a target and transformation matrix. The offset can be either a cartesian or heading/pitch/range.
  21398. * 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
  21399. * is heading/pitch/range, then the heading and the pitch angles are defined in the reference frame defined by the transformation matrix.
  21400. * The heading is the angle from y axis and increasing towards the x axis. Pitch is the rotation from the xy-plane. Positive pitch
  21401. * angles are below the plane. Negative pitch angles are above the plane. The range is the distance from the center.
  21402. *
  21403. * 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
  21404. * target will be the magnitude of the offset. The heading will be determined from the offset. If the heading cannot be
  21405. * determined from the offset, the heading will be north.
  21406. * @example
  21407. * // 1. Using a cartesian offset
  21408. * const transform = Cesium.Transforms.eastNorthUpToFixedFrame(Cesium.Cartesian3.fromDegrees(-98.0, 40.0));
  21409. * viewer.camera.lookAtTransform(transform, new Cesium.Cartesian3(0.0, -4790000.0, 3930000.0));
  21410. *
  21411. * // 2. Using a HeadingPitchRange offset
  21412. * const transform = Cesium.Transforms.eastNorthUpToFixedFrame(Cesium.Cartesian3.fromDegrees(-72.0, 40.0));
  21413. * const heading = Cesium.Math.toRadians(50.0);
  21414. * const pitch = Cesium.Math.toRadians(-20.0);
  21415. * const range = 5000.0;
  21416. * viewer.camera.lookAtTransform(transform, new Cesium.HeadingPitchRange(heading, pitch, range));
  21417. * @param transform - The transformation matrix defining the reference frame.
  21418. * @param [offset] - The offset from the target in a reference frame centered at the target.
  21419. */
  21420. lookAtTransform(transform: Matrix4, offset?: Cartesian3 | HeadingPitchRange): void;
  21421. /**
  21422. * Get the camera position needed to view a rectangle on an ellipsoid or map
  21423. * @param rectangle - The rectangle to view.
  21424. * @param [result] - The camera position needed to view the rectangle
  21425. * @returns The camera position needed to view the rectangle
  21426. */
  21427. getRectangleCameraCoordinates(rectangle: Rectangle, result?: Cartesian3): Cartesian3;
  21428. /**
  21429. * Pick an ellipsoid or map.
  21430. * @example
  21431. * const canvas = viewer.scene.canvas;
  21432. * const center = new Cesium.Cartesian2(canvas.clientWidth / 2.0, canvas.clientHeight / 2.0);
  21433. * const ellipsoid = viewer.scene.globe.ellipsoid;
  21434. * const result = viewer.camera.pickEllipsoid(center, ellipsoid);
  21435. * @param windowPosition - The x and y coordinates of a pixel.
  21436. * @param [ellipsoid = Ellipsoid.WGS84] - The ellipsoid to pick.
  21437. * @param [result] - The object onto which to store the result.
  21438. * @returns If the ellipsoid or map was picked,
  21439. * returns the point on the surface of the ellipsoid or map in world
  21440. * coordinates. If the ellipsoid or map was not picked, returns undefined.
  21441. */
  21442. pickEllipsoid(windowPosition: Cartesian2, ellipsoid?: Ellipsoid, result?: Cartesian3): Cartesian3 | undefined;
  21443. /**
  21444. * Create a ray from the camera position through the pixel at <code>windowPosition</code>
  21445. * in world coordinates.
  21446. * @param windowPosition - The x and y coordinates of a pixel.
  21447. * @param [result] - The object onto which to store the result.
  21448. * @returns Returns the {@link Cartesian3} position and direction of the ray, or undefined if the pick ray cannot be determined.
  21449. */
  21450. getPickRay(windowPosition: Cartesian2, result?: Ray): Ray | undefined;
  21451. /**
  21452. * Return the distance from the camera to the front of the bounding sphere.
  21453. * @param boundingSphere - The bounding sphere in world coordinates.
  21454. * @returns The distance to the bounding sphere.
  21455. */
  21456. distanceToBoundingSphere(boundingSphere: BoundingSphere): number;
  21457. /**
  21458. * Return the pixel size in meters.
  21459. * @param boundingSphere - The bounding sphere in world coordinates.
  21460. * @param drawingBufferWidth - The drawing buffer width.
  21461. * @param drawingBufferHeight - The drawing buffer height.
  21462. * @returns The pixel size in meters.
  21463. */
  21464. getPixelSize(boundingSphere: BoundingSphere, drawingBufferWidth: number, drawingBufferHeight: number): number;
  21465. /**
  21466. * Cancels the current camera flight and leaves the camera at its current location.
  21467. * If no flight is in progress, this this function does nothing.
  21468. */
  21469. cancelFlight(): void;
  21470. /**
  21471. * Completes the current camera flight and moves the camera immediately to its final destination.
  21472. * If no flight is in progress, this this function does nothing.
  21473. */
  21474. completeFlight(): void;
  21475. /**
  21476. * Flies the camera from its current position to a new position.
  21477. * @example
  21478. * // 1. Fly to a position with a top-down view
  21479. * viewer.camera.flyTo({
  21480. * destination : Cesium.Cartesian3.fromDegrees(-117.16, 32.71, 15000.0)
  21481. * });
  21482. *
  21483. * // 2. Fly to a Rectangle with a top-down view
  21484. * viewer.camera.flyTo({
  21485. * destination : Cesium.Rectangle.fromDegrees(west, south, east, north)
  21486. * });
  21487. *
  21488. * // 3. Fly to a position with an orientation using unit vectors.
  21489. * viewer.camera.flyTo({
  21490. * destination : Cesium.Cartesian3.fromDegrees(-122.19, 46.25, 5000.0),
  21491. * orientation : {
  21492. * direction : new Cesium.Cartesian3(-0.04231243104240401, -0.20123236049443421, -0.97862924300734),
  21493. * up : new Cesium.Cartesian3(-0.47934589305293746, -0.8553216253114552, 0.1966022179118339)
  21494. * }
  21495. * });
  21496. *
  21497. * // 4. Fly to a position with an orientation using heading, pitch and roll.
  21498. * viewer.camera.flyTo({
  21499. * destination : Cesium.Cartesian3.fromDegrees(-122.19, 46.25, 5000.0),
  21500. * orientation : {
  21501. * heading : Cesium.Math.toRadians(175.0),
  21502. * pitch : Cesium.Math.toRadians(-35.0),
  21503. * roll : 0.0
  21504. * }
  21505. * });
  21506. * @param options - Object with the following properties:
  21507. * @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.
  21508. * @param [options.orientation] - An object that contains either direction and up properties or heading, pitch and roll properties. By default, the direction will point
  21509. * 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
  21510. * y direction in Columbus view. Orientation is not used in 2D when in infinite scrolling mode.
  21511. * @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.
  21512. * @param [options.complete] - The function to execute when the flight is complete.
  21513. * @param [options.cancel] - The function to execute if the flight is cancelled.
  21514. * @param [options.endTransform] - Transform matrix representing the reference frame the camera will be in when the flight is completed.
  21515. * @param [options.maximumHeight] - The maximum height at the peak of the flight.
  21516. * @param [options.pitchAdjustHeight] - If camera flyes higher than that value, adjust pitch duiring the flight to look down, and keep Earth in viewport.
  21517. * @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.
  21518. * @param [options.flyOverLongitudeWeight] - Fly over the lon specifyed via flyOverLongitude only if that way is not longer than short way times flyOverLongitudeWeight.
  21519. * @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>.
  21520. * @param [options.easingFunction] - Controls how the time is interpolated over the duration of the flight.
  21521. */
  21522. // flyTo(options: {
  21523. // destination: Cartesian3 | Rectangle;
  21524. // orientation?: any;
  21525. // duration?: number;
  21526. // complete?: Camera.FlightCompleteCallback;
  21527. // cancel?: Camera.FlightCancelledCallback;
  21528. // endTransform?: Matrix4;
  21529. // maximumHeight?: number;
  21530. // pitchAdjustHeight?: number;
  21531. // flyOverLongitude?: number;
  21532. // flyOverLongitudeWeight?: number;
  21533. // convert?: boolean;
  21534. // easingFunction?: EasingFunction.Callback;
  21535. // }): void;
  21536. /**
  21537. * Sets the camera so that the current view contains the provided bounding sphere.
  21538. *
  21539. * <p>The offset is heading/pitch/range in the local east-north-up reference frame centered at the center of the bounding sphere.
  21540. * The heading and the pitch angles are defined in the local east-north-up reference frame.
  21541. * The heading is the angle from y axis and increasing towards the x axis. Pitch is the rotation from the xy-plane. Positive pitch
  21542. * angles are below the plane. Negative pitch angles are above the plane. The range is the distance from the center. If the range is
  21543. * zero, a range will be computed such that the whole bounding sphere is visible.</p>
  21544. *
  21545. * <p>In 2D, there must be a top down view. The camera will be placed above the target looking down. The height above the
  21546. * target will be the range. The heading will be determined from the offset. If the heading cannot be
  21547. * determined from the offset, the heading will be north.</p>
  21548. * @param boundingSphere - The bounding sphere to view, in world coordinates.
  21549. * @param [offset] - The offset from the target in the local east-north-up reference frame centered at the target.
  21550. */
  21551. viewBoundingSphere(boundingSphere: BoundingSphere, offset?: HeadingPitchRange): void;
  21552. /**
  21553. * Flies the camera to a location where the current view contains the provided bounding sphere.
  21554. *
  21555. * <p> The offset is heading/pitch/range in the local east-north-up reference frame centered at the center of the bounding sphere.
  21556. * The heading and the pitch angles are defined in the local east-north-up reference frame.
  21557. * The heading is the angle from y axis and increasing towards the x axis. Pitch is the rotation from the xy-plane. Positive pitch
  21558. * angles are below the plane. Negative pitch angles are above the plane. The range is the distance from the center. If the range is
  21559. * zero, a range will be computed such that the whole bounding sphere is visible.</p>
  21560. *
  21561. * <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
  21562. * target will be the range. The heading will be aligned to local north.</p>
  21563. * @param boundingSphere - The bounding sphere to view, in world coordinates.
  21564. * @param [options] - Object with the following properties:
  21565. * @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.
  21566. * @param [options.offset] - The offset from the target in the local east-north-up reference frame centered at the target.
  21567. * @param [options.complete] - The function to execute when the flight is complete.
  21568. * @param [options.cancel] - The function to execute if the flight is cancelled.
  21569. * @param [options.endTransform] - Transform matrix representing the reference frame the camera will be in when the flight is completed.
  21570. * @param [options.maximumHeight] - The maximum height at the peak of the flight.
  21571. * @param [options.pitchAdjustHeight] - If camera flyes higher than that value, adjust pitch duiring the flight to look down, and keep Earth in viewport.
  21572. * @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.
  21573. * @param [options.flyOverLongitudeWeight] - Fly over the lon specifyed via flyOverLongitude only if that way is not longer than short way times flyOverLongitudeWeight.
  21574. * @param [options.easingFunction] - Controls how the time is interpolated over the duration of the flight.
  21575. */
  21576. // flyToBoundingSphere(boundingSphere: BoundingSphere, options?: {
  21577. // duration?: number;
  21578. // offset?: HeadingPitchRange;
  21579. // complete?: Camera.FlightCompleteCallback;
  21580. // cancel?: Camera.FlightCancelledCallback;
  21581. // endTransform?: Matrix4;
  21582. // maximumHeight?: number;
  21583. // pitchAdjustHeight?: number;
  21584. // flyOverLongitude?: number;
  21585. // flyOverLongitudeWeight?: number;
  21586. // easingFunction?: EasingFunction.Callback;
  21587. // }): void;
  21588. /**
  21589. * Computes the approximate visible rectangle on the ellipsoid.
  21590. * @param [ellipsoid = Ellipsoid.WGS84] - The ellipsoid that you want to know the visible region.
  21591. * @param [result] - The rectangle in which to store the result
  21592. * @returns The visible rectangle or undefined if the ellipsoid isn't visible at all.
  21593. */
  21594. computeViewRectangle(ellipsoid?: Ellipsoid, result?: Rectangle): Rectangle | undefined;
  21595. /**
  21596. * Switches the frustum/projection to perspective.
  21597. *
  21598. * This function is a no-op in 2D which must always be orthographic.
  21599. */
  21600. switchToPerspectiveFrustum(): void;
  21601. /**
  21602. * Switches the frustum/projection to orthographic.
  21603. *
  21604. * This function is a no-op in 2D which will always be orthographic.
  21605. */
  21606. switchToOrthographicFrustum(): void;
  21607. }
  21608. export namespace Camera {
  21609. /**
  21610. * A function that will execute when a flight completes.
  21611. */
  21612. type FlightCompleteCallback = () => void;
  21613. /**
  21614. * A function that will execute when a flight is cancelled.
  21615. */
  21616. type FlightCancelledCallback = () => void;
  21617. }
  21618. /**
  21619. * Aggregates input events. For example, suppose the following inputs are received between frames:
  21620. * left mouse button down, mouse move, mouse move, left mouse button up. These events will be aggregated into
  21621. * one event with a start and end position of the mouse.
  21622. * @param [canvas = document] - The element to handle events for.
  21623. */
  21624. export class CameraEventAggregator {
  21625. constructor(canvas?: HTMLCanvasElement);
  21626. /**
  21627. * Gets the current mouse position.
  21628. */
  21629. currentMousePosition: Cartesian2;
  21630. /**
  21631. * Gets whether any mouse button is down, a touch has started, or the wheel has been moved.
  21632. */
  21633. anyButtonDown: boolean;
  21634. /**
  21635. * Gets if a mouse button down or touch has started and has been moved.
  21636. * @param type - The camera event type.
  21637. * @param [modifier] - The keyboard modifier.
  21638. * @returns Returns <code>true</code> if a mouse button down or touch has started and has been moved; otherwise, <code>false</code>
  21639. */
  21640. isMoving(type: CameraEventType, modifier?: KeyboardEventModifier): boolean;
  21641. /**
  21642. * Gets the aggregated start and end position of the current event.
  21643. * @param type - The camera event type.
  21644. * @param [modifier] - The keyboard modifier.
  21645. * @returns An object with two {@link Cartesian2} properties: <code>startPosition</code> and <code>endPosition</code>.
  21646. */
  21647. getMovement(type: CameraEventType, modifier?: KeyboardEventModifier): any;
  21648. /**
  21649. * Gets the start and end position of the last move event (not the aggregated event).
  21650. * @param type - The camera event type.
  21651. * @param [modifier] - The keyboard modifier.
  21652. * @returns An object with two {@link Cartesian2} properties: <code>startPosition</code> and <code>endPosition</code> or <code>undefined</code>.
  21653. */
  21654. getLastMovement(type: CameraEventType, modifier?: KeyboardEventModifier): any | undefined;
  21655. /**
  21656. * Gets whether the mouse button is down or a touch has started.
  21657. * @param type - The camera event type.
  21658. * @param [modifier] - The keyboard modifier.
  21659. * @returns Whether the mouse button is down or a touch has started.
  21660. */
  21661. isButtonDown(type: CameraEventType, modifier?: KeyboardEventModifier): boolean;
  21662. /**
  21663. * Gets the mouse position that started the aggregation.
  21664. * @param type - The camera event type.
  21665. * @param [modifier] - The keyboard modifier.
  21666. * @returns The mouse position.
  21667. */
  21668. getStartMousePosition(type: CameraEventType, modifier?: KeyboardEventModifier): Cartesian2;
  21669. /**
  21670. * Gets the time the button was pressed or the touch was started.
  21671. * @param type - The camera event type.
  21672. * @param [modifier] - The keyboard modifier.
  21673. * @returns The time the button was pressed or the touch was started.
  21674. */
  21675. getButtonPressTime(type: CameraEventType, modifier?: KeyboardEventModifier): Date;
  21676. /**
  21677. * Gets the time the button was released or the touch was ended.
  21678. * @param type - The camera event type.
  21679. * @param [modifier] - The keyboard modifier.
  21680. * @returns The time the button was released or the touch was ended.
  21681. */
  21682. getButtonReleaseTime(type: CameraEventType, modifier?: KeyboardEventModifier): Date;
  21683. /**
  21684. * Signals that all of the events have been handled and the aggregator should be reset to handle new events.
  21685. */
  21686. reset(): void;
  21687. /**
  21688. * Returns true if this object was destroyed; otherwise, false.
  21689. * <br /><br />
  21690. * If this object was destroyed, it should not be used; calling any function other than
  21691. * <code>isDestroyed</code> will result in a {@link DeveloperError} exception.
  21692. * @returns <code>true</code> if this object was destroyed; otherwise, <code>false</code>.
  21693. */
  21694. isDestroyed(): boolean;
  21695. /**
  21696. * Removes mouse listeners held by this object.
  21697. * <br /><br />
  21698. * Once an object is destroyed, it should not be used; calling any function other than
  21699. * <code>isDestroyed</code> will result in a {@link DeveloperError} exception. Therefore,
  21700. * assign the return value (<code>undefined</code>) to the object as done in the example.
  21701. * @example
  21702. * handler = handler && handler.destroy();
  21703. */
  21704. destroy(): void;
  21705. }
  21706. /**
  21707. * Enumerates the available input for interacting with the camera.
  21708. */
  21709. export enum CameraEventType {
  21710. /**
  21711. * A left mouse button press followed by moving the mouse and releasing the button.
  21712. */
  21713. LEFT_DRAG = 0,
  21714. /**
  21715. * A right mouse button press followed by moving the mouse and releasing the button.
  21716. */
  21717. RIGHT_DRAG = 1,
  21718. /**
  21719. * A middle mouse button press followed by moving the mouse and releasing the button.
  21720. */
  21721. MIDDLE_DRAG = 2,
  21722. /**
  21723. * Scrolling the middle mouse button.
  21724. */
  21725. WHEEL = 3,
  21726. /**
  21727. * A two-finger touch on a touch surface.
  21728. */
  21729. PINCH = 4
  21730. }
  21731. /**
  21732. * A classification primitive represents a volume enclosing geometry in the {@link Scene} to be highlighted.
  21733. * <p>
  21734. * A primitive combines geometry instances with an {@link Appearance} that describes the full shading, including
  21735. * {@link Material} and {@link RenderState}. Roughly, the geometry instance defines the structure and placement,
  21736. * and the appearance defines the visual characteristics. Decoupling geometry and appearance allows us to mix
  21737. * and match most of them and add a new geometry or appearance independently of each other.
  21738. * Only {@link PerInstanceColorAppearance} with the same color across all instances is supported at this time when using
  21739. * ClassificationPrimitive directly.
  21740. * For full {@link Appearance} support when classifying terrain or 3D Tiles use {@link GroundPrimitive} instead.
  21741. * </p>
  21742. * <p>
  21743. * For correct rendering, this feature requires the EXT_frag_depth WebGL extension. For hardware that do not support this extension, there
  21744. * will be rendering artifacts for some viewing angles.
  21745. * </p>
  21746. * <p>
  21747. * Valid geometries are {@link BoxGeometry}, {@link CylinderGeometry}, {@link EllipsoidGeometry}, {@link PolylineVolumeGeometry}, and {@link SphereGeometry}.
  21748. * </p>
  21749. * <p>
  21750. * Geometries that follow the surface of the ellipsoid, such as {@link CircleGeometry}, {@link CorridorGeometry}, {@link EllipseGeometry}, {@link PolygonGeometry}, and {@link RectangleGeometry},
  21751. * are also valid if they are extruded volumes; otherwise, they will not be rendered.
  21752. * </p>
  21753. * @param [options] - Object with the following properties:
  21754. * @param [options.geometryInstances] - The geometry instances to render. This can either be a single instance or an array of length one.
  21755. * @param [options.appearance] - The appearance used to render the primitive. Defaults to PerInstanceColorAppearance when GeometryInstances have a color attribute.
  21756. * @param [options.show = true] - Determines if this primitive will be shown.
  21757. * @param [options.vertexCacheOptimize = false] - When <code>true</code>, geometry vertices are optimized for the pre and post-vertex-shader caches.
  21758. * @param [options.interleave = false] - When <code>true</code>, geometry vertex attributes are interleaved, which can slightly improve rendering performance but increases load time.
  21759. * @param [options.compressVertices = true] - When <code>true</code>, the geometry vertices are compressed, which will save memory.
  21760. * @param [options.releaseGeometryInstances = true] - When <code>true</code>, the primitive does not keep a reference to the input <code>geometryInstances</code> to save memory.
  21761. * @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.
  21762. * @param [options.asynchronous = true] - Determines if the primitive will be created asynchronously or block until ready. If false initializeTerrainHeights() must be called first.
  21763. * @param [options.classificationType = ClassificationType.BOTH] - Determines whether terrain, 3D Tiles or both will be classified.
  21764. * @param [options.debugShowBoundingVolume = false] - For debugging only. Determines if this primitive's commands' bounding spheres are shown.
  21765. * @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
  21766. * creation for the volumes to be created before the geometry is released or options.releaseGeometryInstance must be <code>false</code>.
  21767. */
  21768. export class ClassificationPrimitive {
  21769. constructor(options?: {
  21770. geometryInstances?: any[] | GeometryInstance;
  21771. appearance?: Appearance;
  21772. show?: boolean;
  21773. vertexCacheOptimize?: boolean;
  21774. interleave?: boolean;
  21775. compressVertices?: boolean;
  21776. releaseGeometryInstances?: boolean;
  21777. allowPicking?: boolean;
  21778. asynchronous?: boolean;
  21779. classificationType?: ClassificationType;
  21780. debugShowBoundingVolume?: boolean;
  21781. debugShowShadowVolume?: boolean;
  21782. });
  21783. /**
  21784. * The geometry instance rendered with this primitive. This may
  21785. * be <code>undefined</code> if <code>options.releaseGeometryInstances</code>
  21786. * is <code>true</code> when the primitive is constructed.
  21787. * <p>
  21788. * Changing this property after the primitive is rendered has no effect.
  21789. * </p>
  21790. * <p>
  21791. * Because of the rendering technique used, all geometry instances must be the same color.
  21792. * If there is an instance with a differing color, a <code>DeveloperError</code> will be thrown
  21793. * on the first attempt to render.
  21794. * </p>
  21795. */
  21796. readonly geometryInstances: any[] | GeometryInstance;
  21797. /**
  21798. * Determines if the primitive will be shown. This affects all geometry
  21799. * instances in the primitive.
  21800. */
  21801. show: boolean;
  21802. /**
  21803. * Determines whether terrain, 3D Tiles or both will be classified.
  21804. */
  21805. classificationType: ClassificationType;
  21806. /**
  21807. * This property is for debugging only; it is not for production use nor is it optimized.
  21808. * <p>
  21809. * Draws the bounding sphere for each draw command in the primitive.
  21810. * </p>
  21811. */
  21812. debugShowBoundingVolume: boolean;
  21813. /**
  21814. * This property is for debugging only; it is not for production use nor is it optimized.
  21815. * <p>
  21816. * Draws the shadow volume for each geometry in the primitive.
  21817. * </p>
  21818. */
  21819. debugShowShadowVolume: boolean;
  21820. /**
  21821. * When <code>true</code>, geometry vertices are optimized for the pre and post-vertex-shader caches.
  21822. */
  21823. readonly vertexCacheOptimize: boolean;
  21824. /**
  21825. * Determines if geometry vertex attributes are interleaved, which can slightly improve rendering performance.
  21826. */
  21827. readonly interleave: boolean;
  21828. /**
  21829. * When <code>true</code>, the primitive does not keep a reference to the input <code>geometryInstances</code> to save memory.
  21830. */
  21831. readonly releaseGeometryInstances: boolean;
  21832. /**
  21833. * When <code>true</code>, each geometry instance will only be pickable with {@link Scene#pick}. When <code>false</code>, GPU memory is saved.
  21834. */
  21835. readonly allowPicking: boolean;
  21836. /**
  21837. * Determines if the geometry instances will be created and batched on a web worker.
  21838. */
  21839. readonly asynchronous: boolean;
  21840. /**
  21841. * When <code>true</code>, geometry vertices are compressed, which will save memory.
  21842. */
  21843. readonly compressVertices: boolean;
  21844. /**
  21845. * Determines if the primitive is complete and ready to render. If this property is
  21846. * true, the primitive will be rendered the next time that {@link ClassificationPrimitive#update}
  21847. * is called.
  21848. */
  21849. readonly ready: boolean;
  21850. /**
  21851. * Gets a promise that resolves when the primitive is ready to render.
  21852. */
  21853. readonly readyPromise: Promise<ClassificationPrimitive>;
  21854. /**
  21855. * Determines if ClassificationPrimitive rendering is supported.
  21856. * @param scene - The scene.
  21857. * @returns <code>true</code> if ClassificationPrimitives are supported; otherwise, returns <code>false</code>
  21858. */
  21859. isSupported(scene: Scene): boolean;
  21860. /**
  21861. * Called when {@link Viewer} or {@link CesiumWidget} render the scene to
  21862. * get the draw commands needed to render this primitive.
  21863. * <p>
  21864. * Do not call this function directly. This is documented just to
  21865. * list the exceptions that may be propagated when the scene is rendered:
  21866. * </p>
  21867. */
  21868. update(): void;
  21869. /**
  21870. * Returns the modifiable per-instance attributes for a {@link GeometryInstance}.
  21871. * @example
  21872. * const attributes = primitive.getGeometryInstanceAttributes('an id');
  21873. * attributes.color = Cesium.ColorGeometryInstanceAttribute.toValue(Cesium.Color.AQUA);
  21874. * attributes.show = Cesium.ShowGeometryInstanceAttribute.toValue(true);
  21875. * @param id - The id of the {@link GeometryInstance}.
  21876. * @returns The typed array in the attribute's format or undefined if the is no instance with id.
  21877. */
  21878. getGeometryInstanceAttributes(id: any): any;
  21879. /**
  21880. * Returns true if this object was destroyed; otherwise, false.
  21881. * <p>
  21882. * If this object was destroyed, it should not be used; calling any function other than
  21883. * <code>isDestroyed</code> will result in a {@link DeveloperError} exception.
  21884. * </p>
  21885. * @returns <code>true</code> if this object was destroyed; otherwise, <code>false</code>.
  21886. */
  21887. isDestroyed(): boolean;
  21888. /**
  21889. * Destroys the WebGL resources held by this object. Destroying an object allows for deterministic
  21890. * release of WebGL resources, instead of relying on the garbage collector to destroy this object.
  21891. * <p>
  21892. * Once an object is destroyed, it should not be used; calling any function other than
  21893. * <code>isDestroyed</code> will result in a {@link DeveloperError} exception. Therefore,
  21894. * assign the return value (<code>undefined</code>) to the object as done in the example.
  21895. * </p>
  21896. * @example
  21897. * e = e && e.destroy();
  21898. */
  21899. destroy(): void;
  21900. }
  21901. /**
  21902. * Whether a classification affects terrain, 3D Tiles or both.
  21903. */
  21904. export enum ClassificationType {
  21905. /**
  21906. * Only terrain will be classified.
  21907. */
  21908. TERRAIN = 0,
  21909. /**
  21910. * Only 3D Tiles will be classified.
  21911. */
  21912. Cesium_3D_TILE = 1,
  21913. /**
  21914. * Both terrain and 3D Tiles will be classified.
  21915. */
  21916. BOTH = 2
  21917. }
  21918. /**
  21919. * A Plane in Hessian Normal form to be used with {@link ClippingPlaneCollection}.
  21920. * Compatible with mathematics functions in {@link Plane}
  21921. * @param normal - The plane's normal (normalized).
  21922. * @param distance - The shortest distance from the origin to the plane. The sign of
  21923. * <code>distance</code> determines which side of the plane the origin
  21924. * is on. If <code>distance</code> is positive, the origin is in the half-space
  21925. * in the direction of the normal; if negative, the origin is in the half-space
  21926. * opposite to the normal; if zero, the plane passes through the origin.
  21927. */
  21928. export class ClippingPlane {
  21929. constructor(normal: Cartesian3, distance: number);
  21930. /**
  21931. * The shortest distance from the origin to the plane. The sign of
  21932. * <code>distance</code> determines which side of the plane the origin
  21933. * is on. If <code>distance</code> is positive, the origin is in the half-space
  21934. * in the direction of the normal; if negative, the origin is in the half-space
  21935. * opposite to the normal; if zero, the plane passes through the origin.
  21936. */
  21937. distance: number;
  21938. /**
  21939. * The plane's normal.
  21940. */
  21941. normal: Cartesian3;
  21942. /**
  21943. * Create a ClippingPlane from a Plane object.
  21944. * @param plane - The plane containing parameters to copy
  21945. * @param [result] - The object on which to store the result
  21946. * @returns The ClippingPlane generated from the plane's parameters.
  21947. */
  21948. fromPlane(plane: Plane, result?: ClippingPlane): ClippingPlane;
  21949. /**
  21950. * Clones the ClippingPlane without setting its ownership.
  21951. * @param clippingPlane - The ClippingPlane to be cloned
  21952. * @param [result] - The object on which to store the cloned parameters.
  21953. * @returns a clone of the input ClippingPlane
  21954. */
  21955. clone(clippingPlane: ClippingPlane, result?: ClippingPlane): ClippingPlane;
  21956. }
  21957. /**
  21958. * Specifies a set of clipping planes. Clipping planes selectively disable rendering in a region on the
  21959. * outside of the specified list of {@link ClippingPlane} objects for a single gltf model, 3D Tileset, or the globe.
  21960. * <p>
  21961. * 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
  21962. * through the center of the object.
  21963. * </p>
  21964. * <p>
  21965. * 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.
  21966. * </p>
  21967. * @example
  21968. * // This clipping plane's distance is positive, which means its normal
  21969. * // is facing the origin. This will clip everything that is behind
  21970. * // the plane, which is anything with y coordinate < -5.
  21971. * const clippingPlanes = new Cesium.ClippingPlaneCollection({
  21972. * planes : [
  21973. * new Cesium.ClippingPlane(new Cesium.Cartesian3(0.0, 1.0, 0.0), 5.0)
  21974. * ],
  21975. * });
  21976. * // Create an entity and attach the ClippingPlaneCollection to the model.
  21977. * const entity = viewer.entities.add({
  21978. * position : Cesium.Cartesian3.fromDegrees(-123.0744619, 44.0503706, 10000),
  21979. * model : {
  21980. * uri : 'model.gltf',
  21981. * minimumPixelSize : 128,
  21982. * maximumScale : 20000,
  21983. * clippingPlanes : clippingPlanes
  21984. * }
  21985. * });
  21986. * viewer.zoomTo(entity);
  21987. * @param [options] - Object with the following properties:
  21988. * @param [options.planes = []] - An array of {@link ClippingPlane} objects used to selectively disable rendering on the outside of each plane.
  21989. * @param [options.enabled = true] - Determines whether the clipping planes are active.
  21990. * @param [options.modelMatrix = Matrix4.IDENTITY] - The 4x4 transformation matrix specifying an additional transform relative to the clipping planes original coordinate system.
  21991. * @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.
  21992. * @param [options.edgeColor = Color.WHITE] - The color applied to highlight the edge along which an object is clipped.
  21993. * @param [options.edgeWidth = 0.0] - The width, in pixels, of the highlight applied to the edge along which an object is clipped.
  21994. */
  21995. export class ClippingPlaneCollection {
  21996. constructor(options?: {
  21997. planes?: ClippingPlane[];
  21998. enabled?: boolean;
  21999. modelMatrix?: Matrix4;
  22000. unionClippingRegions?: boolean;
  22001. edgeColor?: Color;
  22002. edgeWidth?: number;
  22003. });
  22004. /**
  22005. * The 4x4 transformation matrix specifying an additional transform relative to the clipping planes
  22006. * original coordinate system.
  22007. */
  22008. modelMatrix: Matrix4;
  22009. /**
  22010. * The color applied to highlight the edge along which an object is clipped.
  22011. */
  22012. edgeColor: Color;
  22013. /**
  22014. * The width, in pixels, of the highlight applied to the edge along which an object is clipped.
  22015. */
  22016. edgeWidth: number;
  22017. /**
  22018. * An event triggered when a new clipping plane is added to the collection. Event handlers
  22019. * are passed the new plane and the index at which it was added.
  22020. */
  22021. planeAdded: Event;
  22022. /**
  22023. * An event triggered when a new clipping plane is removed from the collection. Event handlers
  22024. * are passed the new plane and the index from which it was removed.
  22025. */
  22026. planeRemoved: Event;
  22027. /**
  22028. * Returns the number of planes in this collection. This is commonly used with
  22029. * {@link ClippingPlaneCollection#get} to iterate over all the planes
  22030. * in the collection.
  22031. */
  22032. readonly length: number;
  22033. /**
  22034. * If true, a region will be clipped if it is on the outside of any plane in the
  22035. * collection. Otherwise, a region will only be clipped if it is on the
  22036. * outside of every plane.
  22037. */
  22038. unionClippingRegions: boolean;
  22039. /**
  22040. * If true, clipping will be enabled.
  22041. */
  22042. enabled: boolean;
  22043. /**
  22044. * Adds the specified {@link ClippingPlane} to the collection to be used to selectively disable rendering
  22045. * on the outside of each plane. Use {@link ClippingPlaneCollection#unionClippingRegions} to modify
  22046. * how modify the clipping behavior of multiple planes.
  22047. * @param plane - The ClippingPlane to add to the collection.
  22048. */
  22049. add(plane: ClippingPlane): void;
  22050. /**
  22051. * Returns the plane in the collection at the specified index. Indices are zero-based
  22052. * and increase as planes are added. Removing a plane shifts all planes after
  22053. * it to the left, changing their indices. This function is commonly used with
  22054. * {@link ClippingPlaneCollection#length} to iterate over all the planes
  22055. * in the collection.
  22056. * @param index - The zero-based index of the plane.
  22057. * @returns The ClippingPlane at the specified index.
  22058. */
  22059. get(index: number): ClippingPlane;
  22060. /**
  22061. * Checks whether this collection contains a ClippingPlane equal to the given ClippingPlane.
  22062. * @param [clippingPlane] - The ClippingPlane to check for.
  22063. * @returns true if this collection contains the ClippingPlane, false otherwise.
  22064. */
  22065. contains(clippingPlane?: ClippingPlane): boolean;
  22066. /**
  22067. * Removes the first occurrence of the given ClippingPlane from the collection.
  22068. * @returns <code>true</code> if the plane was removed; <code>false</code> if the plane was not found in the collection.
  22069. */
  22070. remove(clippingPlane: ClippingPlane): boolean;
  22071. /**
  22072. * Removes all planes from the collection.
  22073. */
  22074. removeAll(): void;
  22075. /**
  22076. * Called when {@link Viewer} or {@link CesiumWidget} render the scene to
  22077. * build the resources for clipping planes.
  22078. * <p>
  22079. * Do not call this function directly.
  22080. * </p>
  22081. */
  22082. update(): void;
  22083. /**
  22084. * Returns true if this object was destroyed; otherwise, false.
  22085. * <br /><br />
  22086. * If this object was destroyed, it should not be used; calling any function other than
  22087. * <code>isDestroyed</code> will result in a {@link DeveloperError} exception.
  22088. * @returns <code>true</code> if this object was destroyed; otherwise, <code>false</code>.
  22089. */
  22090. isDestroyed(): boolean;
  22091. /**
  22092. * Destroys the WebGL resources held by this object. Destroying an object allows for deterministic
  22093. * release of WebGL resources, instead of relying on the garbage collector to destroy this object.
  22094. * <br /><br />
  22095. * Once an object is destroyed, it should not be used; calling any function other than
  22096. * <code>isDestroyed</code> will result in a {@link DeveloperError} exception. Therefore,
  22097. * assign the return value (<code>undefined</code>) to the object as done in the example.
  22098. * @example
  22099. * clippingPlanes = clippingPlanes && clippingPlanes.destroy();
  22100. */
  22101. destroy(): void;
  22102. }
  22103. /**
  22104. * An expression for a style applied to a {@link Cesium3DTileset}.
  22105. * <p>
  22106. * Evaluates a conditions expression defined using the
  22107. * {@link https://github.com/CesiumGS/3d-tiles/tree/main/specification/Styling|3D Tiles Styling language}.
  22108. * </p>
  22109. * <p>
  22110. * Implements the {@link StyleExpression} interface.
  22111. * </p>
  22112. * @example
  22113. * const expression = new Cesium.ConditionsExpression({
  22114. * conditions : [
  22115. * ['${Area} > 10, 'color("#FF0000")'],
  22116. * ['${id} !== "1"', 'color("#00FF00")'],
  22117. * ['true', 'color("#FFFFFF")']
  22118. * ]
  22119. * });
  22120. * expression.evaluateColor(feature, result); // returns a Cesium.Color object
  22121. * @param [conditionsExpression] - The conditions expression defined using the 3D Tiles Styling language.
  22122. * @param [defines] - Defines in the style.
  22123. */
  22124. export class ConditionsExpression {
  22125. constructor(conditionsExpression?: any, defines?: any);
  22126. /**
  22127. * Gets the conditions expression defined in the 3D Tiles Styling language.
  22128. */
  22129. readonly conditionsExpression: any;
  22130. /**
  22131. * Evaluates the result of an expression, optionally using the provided feature's properties. If the result of
  22132. * the expression in the
  22133. * {@link https://github.com/CesiumGS/3d-tiles/tree/main/specification/Styling|3D Tiles Styling language}
  22134. * is of type <code>Boolean</code>, <code>Number</code>, or <code>String</code>, the corresponding JavaScript
  22135. * primitive type will be returned. If the result is a <code>RegExp</code>, a Javascript <code>RegExp</code>
  22136. * object will be returned. If the result is a <code>Cartesian2</code>, <code>Cartesian3</code>, or <code>Cartesian4</code>,
  22137. * a {@link Cartesian2}, {@link Cartesian3}, or {@link Cartesian4} object will be returned. If the <code>result</code> argument is
  22138. * a {@link Color}, the {@link Cartesian4} value is converted to a {@link Color} and then returned.
  22139. * @param feature - The feature whose properties may be used as variables in the expression.
  22140. * @param [result] - The object onto which to store the result.
  22141. * @returns The result of evaluating the expression.
  22142. */
  22143. evaluate(feature: Cesium3DTileFeature, result?: any): boolean | number | string | RegExp | Cartesian2 | Cartesian3 | Cartesian4 | Color;
  22144. /**
  22145. * Evaluates the result of a Color expression, using the values defined by a feature.
  22146. * <p>
  22147. * This is equivalent to {@link ConditionsExpression#evaluate} but always returns a {@link Color} object.
  22148. * </p>
  22149. * @param feature - The feature whose properties may be used as variables in the expression.
  22150. * @param [result] - The object in which to store the result
  22151. * @returns The modified result parameter or a new Color instance if one was not provided.
  22152. */
  22153. evaluateColor(feature: Cesium3DTileFeature, result?: Color): Color;
  22154. }
  22155. /**
  22156. * The credit display is responsible for displaying credits on screen.
  22157. * @example
  22158. * const creditDisplay = new Cesium.CreditDisplay(creditContainer);
  22159. * @param container - The HTML element where credits will be displayed
  22160. * @param [delimiter = ' • '] - The string to separate text credits
  22161. * @param [viewport = document.body] - The HTML element that will contain the credits popup
  22162. */
  22163. export class CreditDisplay {
  22164. constructor(container: HTMLElement, delimiter?: string, viewport?: HTMLElement);
  22165. /**
  22166. * The HTML element where credits will be displayed.
  22167. */
  22168. container: HTMLElement;
  22169. /**
  22170. * Adds a credit to the list of current credits to be displayed in the credit container
  22171. * @param credit - The credit to display
  22172. */
  22173. addCredit(credit: Credit): void;
  22174. /**
  22175. * Adds credits that will persist until they are removed
  22176. * @param credit - The credit to added to defaults
  22177. */
  22178. addDefaultCredit(credit: Credit): void;
  22179. /**
  22180. * Removes a default credit
  22181. * @param credit - The credit to be removed from defaults
  22182. */
  22183. removeDefaultCredit(credit: Credit): void;
  22184. /**
  22185. * Updates the credit display before a new frame is rendered.
  22186. */
  22187. update(): void;
  22188. /**
  22189. * Resets the credit display to a beginning of frame state, clearing out current credits.
  22190. */
  22191. beginFrame(): void;
  22192. /**
  22193. * Sets the credit display to the end of frame state, displaying credits from the last frame in the credit container.
  22194. */
  22195. endFrame(): void;
  22196. /**
  22197. * Destroys the resources held by this object. Destroying an object allows for deterministic
  22198. * release of resources, instead of relying on the garbage collector to destroy this object.
  22199. * <br /><br />
  22200. * Once an object is destroyed, it should not be used; calling any function other than
  22201. * <code>isDestroyed</code> will result in a {@link DeveloperError} exception. Therefore,
  22202. * assign the return value (<code>undefined</code>) to the object as done in the example.
  22203. */
  22204. destroy(): void;
  22205. /**
  22206. * Returns true if this object was destroyed; otherwise, false.
  22207. * <br /><br />
  22208. * @returns <code>true</code> if this object was destroyed; otherwise, <code>false</code>.
  22209. */
  22210. isDestroyed(): boolean;
  22211. /**
  22212. * Gets or sets the Cesium logo credit.
  22213. */
  22214. CesiumCredit: Credit;
  22215. }
  22216. /**
  22217. * Determines which triangles, if any, are culled.
  22218. */
  22219. export enum CullFace {
  22220. /**
  22221. * Front-facing triangles are culled.
  22222. */
  22223. FRONT = WebGLConstants.FRONT,
  22224. /**
  22225. * Back-facing triangles are culled.
  22226. */
  22227. BACK = WebGLConstants.BACK,
  22228. /**
  22229. * Both front-facing and back-facing triangles are culled.
  22230. */
  22231. FRONT_AND_BACK = WebGLConstants.FRONT_AND_BACK
  22232. }
  22233. /**
  22234. * Draws the outline of the camera's view frustum.
  22235. * @example
  22236. * primitives.add(new Cesium.DebugCameraPrimitive({
  22237. * camera : camera,
  22238. * color : Cesium.Color.YELLOW
  22239. * }));
  22240. * @param options - Object with the following properties:
  22241. * @param options.camera - The camera.
  22242. * @param [options.frustumSplits] - Distances to the near and far planes of the camera frustums. This overrides the camera's frustum near and far values.
  22243. * @param [options.color = Color.CYAN] - The color of the debug outline.
  22244. * @param [options.updateOnChange = true] - Whether the primitive updates when the underlying camera changes.
  22245. * @param [options.show = true] - Determines if this primitive will be shown.
  22246. * @param [options.id] - A user-defined object to return when the instance is picked with {@link Scene#pick}.
  22247. */
  22248. export class DebugCameraPrimitive {
  22249. constructor(options: {
  22250. camera: Camera;
  22251. frustumSplits?: number[];
  22252. color?: Color;
  22253. updateOnChange?: boolean;
  22254. show?: boolean;
  22255. id?: any;
  22256. });
  22257. /**
  22258. * Determines if this primitive will be shown.
  22259. */
  22260. show: boolean;
  22261. /**
  22262. * User-defined value returned when the primitive is picked.
  22263. */
  22264. id: any;
  22265. /**
  22266. * Returns true if this object was destroyed; otherwise, false.
  22267. * <p>
  22268. * If this object was destroyed, it should not be used; calling any function other than
  22269. * <code>isDestroyed</code> will result in a {@link DeveloperError} exception.
  22270. * </p>
  22271. * @returns <code>true</code> if this object was destroyed; otherwise, <code>false</code>.
  22272. */
  22273. isDestroyed(): boolean;
  22274. /**
  22275. * Destroys the WebGL resources held by this object. Destroying an object allows for deterministic
  22276. * release of WebGL resources, instead of relying on the garbage collector to destroy this object.
  22277. * <p>
  22278. * Once an object is destroyed, it should not be used; calling any function other than
  22279. * <code>isDestroyed</code> will result in a {@link DeveloperError} exception. Therefore,
  22280. * assign the return value (<code>undefined</code>) to the object as done in the example.
  22281. * </p>
  22282. * @example
  22283. * p = p && p.destroy();
  22284. */
  22285. destroy(): void;
  22286. }
  22287. /**
  22288. * Determines the function used to compare two depths for the depth test.
  22289. */
  22290. export enum DepthFunction {
  22291. /**
  22292. * The depth test never passes.
  22293. */
  22294. NEVER = WebGLConstants.NEVER,
  22295. /**
  22296. * The depth test passes if the incoming depth is less than the stored depth.
  22297. */
  22298. LESS = WebGLConstants.LESS,
  22299. /**
  22300. * The depth test passes if the incoming depth is equal to the stored depth.
  22301. */
  22302. EQUAL = WebGLConstants.EQUAL,
  22303. /**
  22304. * The depth test passes if the incoming depth is less than or equal to the stored depth.
  22305. */
  22306. LESS_OR_EQUAL = WebGLConstants.LEQUAL,
  22307. /**
  22308. * The depth test passes if the incoming depth is greater than the stored depth.
  22309. */
  22310. GREATER = WebGLConstants.GREATER,
  22311. /**
  22312. * The depth test passes if the incoming depth is not equal to the stored depth.
  22313. */
  22314. NOT_EQUAL = WebGLConstants.NOTEQUAL,
  22315. /**
  22316. * The depth test passes if the incoming depth is greater than or equal to the stored depth.
  22317. */
  22318. GREATER_OR_EQUAL = WebGLConstants.GEQUAL,
  22319. /**
  22320. * The depth test always passes.
  22321. */
  22322. ALWAYS = WebGLConstants.ALWAYS
  22323. }
  22324. /**
  22325. * A light that gets emitted in a single direction from infinitely far away.
  22326. * @param options - Object with the following properties:
  22327. * @param options.direction - The direction in which light gets emitted.
  22328. * @param [options.color = Color.WHITE] - The color of the light.
  22329. * @param [options.intensity = 1.0] - The intensity of the light.
  22330. */
  22331. export class DirectionalLight {
  22332. constructor(options: {
  22333. direction: Cartesian3;
  22334. color?: Color;
  22335. intensity?: number;
  22336. });
  22337. /**
  22338. * The direction in which light gets emitted.
  22339. */
  22340. direction: Cartesian3;
  22341. /**
  22342. * The color of the light.
  22343. */
  22344. color: Color;
  22345. /**
  22346. * The intensity of the light.
  22347. */
  22348. intensity: number;
  22349. }
  22350. /**
  22351. * A policy for discarding tile images that contain no data (and so aren't actually images).
  22352. * This policy discards {@link DiscardEmptyTileImagePolicy.EMPTY_IMAGE}, which is
  22353. * expected to be used in place of any empty tile images by the image loading code.
  22354. */
  22355. export class DiscardEmptyTileImagePolicy {
  22356. constructor();
  22357. /**
  22358. * Determines if the discard policy is ready to process images.
  22359. * @returns True if the discard policy is ready to process images; otherwise, false.
  22360. */
  22361. isReady(): boolean;
  22362. /**
  22363. * Given a tile image, decide whether to discard that image.
  22364. * @param image - An image to test.
  22365. * @returns True if the image should be discarded; otherwise, false.
  22366. */
  22367. shouldDiscardImage(image: HTMLImageElement): boolean;
  22368. /**
  22369. * Default value for representing an empty image.
  22370. */
  22371. readonly EMPTY_IMAGE: HTMLImageElement;
  22372. }
  22373. /**
  22374. * An expression for a style applied to a {@link Cesium3DTileset}.
  22375. * <p>
  22376. * Evaluates an expression defined using the
  22377. * {@link https://github.com/CesiumGS/3d-tiles/tree/main/specification/Styling|3D Tiles Styling language}.
  22378. * </p>
  22379. * <p>
  22380. * Implements the {@link StyleExpression} interface.
  22381. * </p>
  22382. * @example
  22383. * const expression = new Cesium.Expression('(regExp("^Chest").test(${County})) && (${YearBuilt} >= 1970)');
  22384. * expression.evaluate(feature); // returns true or false depending on the feature's properties
  22385. * @example
  22386. * const expression = new Cesium.Expression('(${Temperature} > 90) ? color("red") : color("white")');
  22387. * expression.evaluateColor(feature, result); // returns a Cesium.Color object
  22388. * @param [expression] - The expression defined using the 3D Tiles Styling language.
  22389. * @param [defines] - Defines in the style.
  22390. */
  22391. export class Expression {
  22392. constructor(expression?: string, defines?: any);
  22393. /**
  22394. * Gets the expression defined in the 3D Tiles Styling language.
  22395. */
  22396. readonly expression: string;
  22397. /**
  22398. * Evaluates the result of an expression, optionally using the provided feature's properties. If the result of
  22399. * the expression in the
  22400. * {@link https://github.com/CesiumGS/3d-tiles/tree/main/specification/Styling|3D Tiles Styling language}
  22401. * is of type <code>Boolean</code>, <code>Number</code>, or <code>String</code>, the corresponding JavaScript
  22402. * primitive type will be returned. If the result is a <code>RegExp</code>, a Javascript <code>RegExp</code>
  22403. * object will be returned. If the result is a <code>Cartesian2</code>, <code>Cartesian3</code>, or <code>Cartesian4</code>,
  22404. * a {@link Cartesian2}, {@link Cartesian3}, or {@link Cartesian4} object will be returned. If the <code>result</code> argument is
  22405. * a {@link Color}, the {@link Cartesian4} value is converted to a {@link Color} and then returned.
  22406. * @param feature - The feature whose properties may be used as variables in the expression.
  22407. * @param [result] - The object onto which to store the result.
  22408. * @returns The result of evaluating the expression.
  22409. */
  22410. evaluate(feature: Cesium3DTileFeature, result?: any): boolean | number | string | RegExp | Cartesian2 | Cartesian3 | Cartesian4 | Color;
  22411. /**
  22412. * Evaluates the result of a Color expression, optionally using the provided feature's properties.
  22413. * <p>
  22414. * This is equivalent to {@link Expression#evaluate} but always returns a {@link Color} object.
  22415. * </p>
  22416. * @param feature - The feature whose properties may be used as variables in the expression.
  22417. * @param [result] - The object in which to store the result
  22418. * @returns The modified result parameter or a new Color instance if one was not provided.
  22419. */
  22420. evaluateColor(feature: Cesium3DTileFeature, result?: Color): Color;
  22421. }
  22422. /**
  22423. * Blends the atmosphere to geometry far from the camera for horizon views. Allows for additional
  22424. * performance improvements by rendering less geometry and dispatching less terrain requests.
  22425. */
  22426. export class Fog {
  22427. constructor();
  22428. /**
  22429. * <code>true</code> if fog is enabled, <code>false</code> otherwise.
  22430. */
  22431. enabled: boolean;
  22432. /**
  22433. * <code>true</code> if fog is renderable in shaders, <code>false</code> otherwise.
  22434. * This allows to benefits from optimized tile loading strategy based on fog density without the actual visual rendering.
  22435. */
  22436. renderable: boolean;
  22437. /**
  22438. * A scalar that determines the density of the fog. Terrain that is in full fog are culled.
  22439. * The density of the fog increases as this number approaches 1.0 and becomes less dense as it approaches zero.
  22440. * The more dense the fog is, the more aggressively the terrain is culled. For example, if the camera is a height of
  22441. * 1000.0m above the ellipsoid, increasing the value to 3.0e-3 will cause many tiles close to the viewer be culled.
  22442. * Decreasing the value will push the fog further from the viewer, but decrease performance as more of the terrain is rendered.
  22443. */
  22444. density: number;
  22445. /**
  22446. * A factor used to increase the screen space error of terrain tiles when they are partially in fog. The effect is to reduce
  22447. * the number of terrain tiles requested for rendering. If set to zero, the feature will be disabled. If the value is increased
  22448. * for mountainous regions, less tiles will need to be requested, but the terrain meshes near the horizon may be a noticeably
  22449. * lower resolution. If the value is increased in a relatively flat area, there will be little noticeable change on the horizon.
  22450. */
  22451. screenSpaceErrorFactor: number;
  22452. /**
  22453. * 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
  22454. * the brightness at all.
  22455. */
  22456. minimumBrightness: number;
  22457. }
  22458. /**
  22459. * The globe rendered in the scene, including its terrain ({@link Globe#terrainProvider})
  22460. * and imagery layers ({@link Globe#imageryLayers}). Access the globe using {@link Scene#globe}.
  22461. * @param [ellipsoid = Ellipsoid.WGS84] - Determines the size and shape of the
  22462. * globe.
  22463. */
  22464. export class Globe {
  22465. constructor(ellipsoid?: Ellipsoid);
  22466. /**
  22467. * Determines if the globe will be shown.
  22468. */
  22469. show: boolean;
  22470. /**
  22471. * The maximum screen-space error used to drive level-of-detail refinement. Higher
  22472. * values will provide better performance but lower visual quality.
  22473. */
  22474. maximumScreenSpaceError: number;
  22475. /**
  22476. * The size of the terrain tile cache, expressed as a number of tiles. Any additional
  22477. * tiles beyond this number will be freed, as long as they aren't needed for rendering
  22478. * this frame. A larger number will consume more memory but will show detail faster
  22479. * when, for example, zooming out and then back in.
  22480. */
  22481. tileCacheSize: number;
  22482. /**
  22483. * Gets or sets the number of loading descendant tiles that is considered "too many".
  22484. * If a tile has too many loading descendants, that tile will be loaded and rendered before any of
  22485. * its descendants are loaded and rendered. This means more feedback for the user that something
  22486. * is happening at the cost of a longer overall load time. Setting this to 0 will cause each
  22487. * tile level to be loaded successively, significantly increasing load time. Setting it to a large
  22488. * number (e.g. 1000) will minimize the number of tiles that are loaded but tend to make
  22489. * detail appear all at once after a long wait.
  22490. */
  22491. loadingDescendantLimit: number;
  22492. /**
  22493. * Gets or sets a value indicating whether the ancestors of rendered tiles should be preloaded.
  22494. * Setting this to true optimizes the zoom-out experience and provides more detail in
  22495. * newly-exposed areas when panning. The down side is that it requires loading more tiles.
  22496. */
  22497. preloadAncestors: boolean;
  22498. /**
  22499. * Gets or sets a value indicating whether the siblings of rendered tiles should be preloaded.
  22500. * Setting this to true causes tiles with the same parent as a rendered tile to be loaded, even
  22501. * if they are culled. Setting this to true may provide a better panning experience at the
  22502. * cost of loading more tiles.
  22503. */
  22504. preloadSiblings: boolean;
  22505. /**
  22506. * The color to use to highlight terrain fill tiles. If undefined, fill tiles are not
  22507. * highlighted at all. The alpha value is used to alpha blend with the tile's
  22508. * actual color. Because terrain fill tiles do not represent the actual terrain surface,
  22509. * it may be useful in some applications to indicate visually that they are not to be trusted.
  22510. */
  22511. fillHighlightColor: Color;
  22512. /**
  22513. * Enable lighting the globe with the scene's light source.
  22514. */
  22515. enableLighting: boolean;
  22516. /**
  22517. * A multiplier to adjust terrain lambert lighting.
  22518. * This number is multiplied by the result of <code>czm_getLambertDiffuse</code> in GlobeFS.glsl.
  22519. * This only takes effect when <code>enableLighting</code> is <code>true</code>.
  22520. */
  22521. lambertDiffuseMultiplier: number;
  22522. /**
  22523. * Enable dynamic lighting effects on atmosphere and fog. This only takes effect
  22524. * when <code>enableLighting</code> is <code>true</code>.
  22525. */
  22526. dynamicAtmosphereLighting: boolean;
  22527. /**
  22528. * Whether dynamic atmosphere lighting uses the sun direction instead of the scene's
  22529. * light direction. This only takes effect when <code>enableLighting</code> and
  22530. * <code>dynamicAtmosphereLighting</code> are <code>true</code>.
  22531. */
  22532. dynamicAtmosphereLightingFromSun: boolean;
  22533. /**
  22534. * Enable the ground atmosphere, which is drawn over the globe when viewed from a distance between <code>lightingFadeInDistance</code> and <code>lightingFadeOutDistance</code>.
  22535. */
  22536. showGroundAtmosphere: boolean;
  22537. /**
  22538. * The intensity of the light that is used for computing the ground atmosphere color.
  22539. */
  22540. atmosphereLightIntensity: number;
  22541. /**
  22542. * The Rayleigh scattering coefficient used in the atmospheric scattering equations for the ground atmosphere.
  22543. */
  22544. atmosphereRayleighCoefficient: Cartesian3;
  22545. /**
  22546. * The Mie scattering coefficient used in the atmospheric scattering equations for the ground atmosphere.
  22547. */
  22548. atmosphereMieCoefficient: Cartesian3;
  22549. /**
  22550. * The Rayleigh scale height used in the atmospheric scattering equations for the ground atmosphere, in meters.
  22551. */
  22552. atmosphereRayleighScaleHeight: number;
  22553. /**
  22554. * The Mie scale height used in the atmospheric scattering equations for the ground atmosphere, in meters.
  22555. */
  22556. atmosphereMieScaleHeight: number;
  22557. /**
  22558. * The anisotropy of the medium to consider for Mie scattering.
  22559. * <p>
  22560. * Valid values are between -1.0 and 1.0.
  22561. * </p>
  22562. */
  22563. atmosphereMieAnisotropy: number;
  22564. /**
  22565. * The distance where everything becomes lit. This only takes effect
  22566. * when <code>enableLighting</code> or <code>showGroundAtmosphere</code> is <code>true</code>.
  22567. */
  22568. lightingFadeOutDistance: number;
  22569. /**
  22570. * The distance where lighting resumes. This only takes effect
  22571. * when <code>enableLighting</code> or <code>showGroundAtmosphere</code> is <code>true</code>.
  22572. */
  22573. lightingFadeInDistance: number;
  22574. /**
  22575. * The distance where the darkness of night from the ground atmosphere fades out to a lit ground atmosphere.
  22576. * This only takes effect when <code>showGroundAtmosphere</code>, <code>enableLighting</code>, and
  22577. * <code>dynamicAtmosphereLighting</code> are <code>true</code>.
  22578. */
  22579. nightFadeOutDistance: number;
  22580. /**
  22581. * The distance where the darkness of night from the ground atmosphere fades in to an unlit ground atmosphere.
  22582. * This only takes effect when <code>showGroundAtmosphere</code>, <code>enableLighting</code>, and
  22583. * <code>dynamicAtmosphereLighting</code> are <code>true</code>.
  22584. */
  22585. nightFadeInDistance: number;
  22586. /**
  22587. * True if an animated wave effect should be shown in areas of the globe
  22588. * covered by water; otherwise, false. This property is ignored if the
  22589. * <code>terrainProvider</code> does not provide a water mask.
  22590. */
  22591. showWaterEffect: boolean;
  22592. /**
  22593. * True if primitives such as billboards, polylines, labels, etc. should be depth-tested
  22594. * against the terrain surface, or false if such primitives should always be drawn on top
  22595. * of terrain unless they're on the opposite side of the globe. The disadvantage of depth
  22596. * testing primitives against terrain is that slight numerical noise or terrain level-of-detail
  22597. * switched can sometimes make a primitive that should be on the surface disappear underneath it.
  22598. */
  22599. depthTestAgainstTerrain: boolean;
  22600. /**
  22601. * Determines whether the globe casts or receives shadows from light sources. Setting the globe
  22602. * to cast shadows may impact performance since the terrain is rendered again from the light's perspective.
  22603. * Currently only terrain that is in view casts shadows. By default the globe does not cast shadows.
  22604. */
  22605. shadows: ShadowMode;
  22606. /**
  22607. * The hue shift to apply to the atmosphere. Defaults to 0.0 (no shift).
  22608. * A hue shift of 1.0 indicates a complete rotation of the hues available.
  22609. */
  22610. atmosphereHueShift: number;
  22611. /**
  22612. * The saturation shift to apply to the atmosphere. Defaults to 0.0 (no shift).
  22613. * A saturation shift of -1.0 is monochrome.
  22614. */
  22615. atmosphereSaturationShift: number;
  22616. /**
  22617. * The brightness shift to apply to the atmosphere. Defaults to 0.0 (no shift).
  22618. * A brightness shift of -1.0 is complete darkness, which will let space show through.
  22619. */
  22620. atmosphereBrightnessShift: number;
  22621. /**
  22622. * A scalar used to exaggerate the terrain. Defaults to <code>1.0</code> (no exaggeration).
  22623. * A value of <code>2.0</code> scales the terrain by 2x.
  22624. * A value of <code>0.0</code> makes the terrain completely flat.
  22625. * Note that terrain exaggeration will not modify any other primitive as they are positioned relative to the ellipsoid.
  22626. */
  22627. terrainExaggeration: number;
  22628. /**
  22629. * The height from which terrain is exaggerated. Defaults to <code>0.0</code> (scaled relative to ellipsoid surface).
  22630. * Terrain that is above this height will scale upwards and terrain that is below this height will scale downwards.
  22631. * Note that terrain exaggeration will not modify any other primitive as they are positioned relative to the ellipsoid.
  22632. * If {@link Globe#terrainExaggeration} is <code>1.0</code> this value will have no effect.
  22633. */
  22634. terrainExaggerationRelativeHeight: number;
  22635. /**
  22636. * Whether to show terrain skirts. Terrain skirts are geometry extending downwards from a tile's edges used to hide seams between neighboring tiles.
  22637. * Skirts are always hidden when the camera is underground or translucency is enabled.
  22638. */
  22639. showSkirts: boolean;
  22640. /**
  22641. * Whether to cull back-facing terrain. Back faces are not culled when the camera is underground or translucency is enabled.
  22642. */
  22643. backFaceCulling: boolean;
  22644. /**
  22645. * Gets an ellipsoid describing the shape of this globe.
  22646. */
  22647. ellipsoid: Ellipsoid;
  22648. /**
  22649. * Gets the collection of image layers that will be rendered on this globe.
  22650. */
  22651. imageryLayers: ImageryLayerCollection;
  22652. /**
  22653. * Gets an event that's raised when an imagery layer is added, shown, hidden, moved, or removed.
  22654. */
  22655. readonly imageryLayersUpdatedEvent: Event;
  22656. /**
  22657. * Returns <code>true</code> when the tile load queue is empty, <code>false</code> otherwise. When the load queue is empty,
  22658. * all terrain and imagery for the current view have been loaded.
  22659. */
  22660. readonly tilesLoaded: boolean;
  22661. /**
  22662. * Gets or sets the color of the globe when no imagery is available.
  22663. */
  22664. baseColor: Color;
  22665. /**
  22666. * A property specifying a {@link ClippingPlaneCollection} used to selectively disable rendering on the outside of each plane.
  22667. */
  22668. clippingPlanes: ClippingPlaneCollection;
  22669. /**
  22670. * A property specifying a {@link Rectangle} used to limit globe rendering to a cartographic area.
  22671. * Defaults to the maximum extent of cartographic coordinates.
  22672. */
  22673. cartographicLimitRectangle: Rectangle;
  22674. /**
  22675. * The normal map to use for rendering waves in the ocean. Setting this property will
  22676. * only have an effect if the configured terrain provider includes a water mask.
  22677. */
  22678. oceanNormalMapUrl: string;
  22679. /**
  22680. * The terrain provider providing surface geometry for this globe.
  22681. */
  22682. terrainProvider: TerrainProvider;
  22683. /**
  22684. * Gets an event that's raised when the terrain provider is changed
  22685. */
  22686. readonly terrainProviderChanged: Event;
  22687. /**
  22688. * 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,
  22689. * all terrain and imagery for the current view have been loaded. The event passes the new length of the tile load queue.
  22690. */
  22691. tileLoadProgressEvent: Event;
  22692. /**
  22693. * Gets or sets the material appearance of the Globe.
  22694. */
  22695. material: Material | undefined;
  22696. /**
  22697. * The color to render the back side of the globe when the camera is underground or the globe is translucent,
  22698. * blended with the globe color based on the camera's distance.
  22699. * <br /><br />
  22700. * To disable underground coloring, set <code>undergroundColor</code> to <code>undefined</code>.
  22701. */
  22702. undergroundColor: Color;
  22703. /**
  22704. * Gets or sets the near and far distance for blending {@link Globe#undergroundColor} with the globe color.
  22705. * The alpha will interpolate between the {@link NearFarScalar#nearValue} and
  22706. * {@link NearFarScalar#farValue} while the camera distance falls within the lower and upper bounds
  22707. * of the specified {@link NearFarScalar#near} and {@link NearFarScalar#far}.
  22708. * Outside of these ranges the alpha remains clamped to the nearest bound. If undefined,
  22709. * the underground color will not be blended with the globe color.
  22710. * <br /> <br />
  22711. * When the camera is above the ellipsoid the distance is computed from the nearest
  22712. * point on the ellipsoid instead of the camera's position.
  22713. */
  22714. undergroundColorAlphaByDistance: NearFarScalar;
  22715. /**
  22716. * Properties for controlling globe translucency.
  22717. */
  22718. translucency: GlobeTranslucency;
  22719. /**
  22720. * Find an intersection between a ray and the globe surface that was rendered. The ray must be given in world coordinates.
  22721. * @example
  22722. * // find intersection of ray through a pixel and the globe
  22723. * const ray = viewer.camera.getPickRay(windowCoordinates);
  22724. * const intersection = globe.pick(ray, scene);
  22725. * @param ray - The ray to test for intersection.
  22726. * @param scene - The scene.
  22727. * @param [result] - The object onto which to store the result.
  22728. * @returns The intersection or <code>undefined</code> if none was found.
  22729. */
  22730. pick(ray: Ray, scene: Scene, result?: Cartesian3): Cartesian3 | undefined;
  22731. /**
  22732. * Get the height of the surface at a given cartographic.
  22733. * @param cartographic - The cartographic for which to find the height.
  22734. * @returns The height of the cartographic or undefined if it could not be found.
  22735. */
  22736. getHeight(cartographic: Cartographic): number | undefined;
  22737. /**
  22738. * Returns true if this object was destroyed; otherwise, false.
  22739. * <br /><br />
  22740. * If this object was destroyed, it should not be used; calling any function other than
  22741. * <code>isDestroyed</code> will result in a {@link DeveloperError} exception.
  22742. * @returns True if this object was destroyed; otherwise, false.
  22743. */
  22744. isDestroyed(): boolean;
  22745. /**
  22746. * Destroys the WebGL resources held by this object. Destroying an object allows for deterministic
  22747. * release of WebGL resources, instead of relying on the garbage collector to destroy this object.
  22748. * <br /><br />
  22749. * Once an object is destroyed, it should not be used; calling any function other than
  22750. * <code>isDestroyed</code> will result in a {@link DeveloperError} exception. Therefore,
  22751. * assign the return value (<code>undefined</code>) to the object as done in the example.
  22752. * @example
  22753. * globe = globe && globe.destroy();
  22754. */
  22755. destroy(): void;
  22756. }
  22757. /**
  22758. * A GroundPolylinePrimitive represents a polyline draped over the terrain or 3D Tiles in the {@link Scene}.
  22759. * <p>
  22760. * Only to be used with GeometryInstances containing {@link GroundPolylineGeometry}.
  22761. * </p>
  22762. * @example
  22763. * // 1. Draw a polyline on terrain with a basic color material
  22764. *
  22765. * const instance = new Cesium.GeometryInstance({
  22766. * geometry : new Cesium.GroundPolylineGeometry({
  22767. * positions : Cesium.Cartesian3.fromDegreesArray([
  22768. * -112.1340164450331, 36.05494287836128,
  22769. * -112.08821010582645, 36.097804071380715
  22770. * ]),
  22771. * width : 4.0
  22772. * }),
  22773. * id : 'object returned when this instance is picked and to get/set per-instance attributes'
  22774. * });
  22775. *
  22776. * scene.groundPrimitives.add(new Cesium.GroundPolylinePrimitive({
  22777. * geometryInstances : instance,
  22778. * appearance : new Cesium.PolylineMaterialAppearance()
  22779. * }));
  22780. *
  22781. * // 2. Draw a looped polyline on terrain with per-instance color and a distance display condition.
  22782. * // Distance display conditions for polylines on terrain are based on an approximate terrain height
  22783. * // instead of true terrain height.
  22784. *
  22785. * const instance2 = new Cesium.GeometryInstance({
  22786. * geometry : new Cesium.GroundPolylineGeometry({
  22787. * positions : Cesium.Cartesian3.fromDegreesArray([
  22788. * -112.1340164450331, 36.05494287836128,
  22789. * -112.08821010582645, 36.097804071380715,
  22790. * -112.13296079730024, 36.168769146801104
  22791. * ]),
  22792. * loop : true,
  22793. * width : 4.0
  22794. * }),
  22795. * attributes : {
  22796. * color : Cesium.ColorGeometryInstanceAttribute.fromColor(Cesium.Color.fromCssColorString('green').withAlpha(0.7)),
  22797. * distanceDisplayCondition : new Cesium.DistanceDisplayConditionGeometryInstanceAttribute(1000, 30000)
  22798. * },
  22799. * id : 'object returned when this instance is picked and to get/set per-instance attributes'
  22800. * });
  22801. *
  22802. * scene.groundPrimitives.add(new Cesium.GroundPolylinePrimitive({
  22803. * geometryInstances : instance2,
  22804. * appearance : new Cesium.PolylineColorAppearance()
  22805. * }));
  22806. * @param [options] - Object with the following properties:
  22807. * @param [options.geometryInstances] - GeometryInstances containing GroundPolylineGeometry
  22808. * @param [options.appearance] - The Appearance used to render the polyline. Defaults to a white color {@link Material} on a {@link PolylineMaterialAppearance}.
  22809. * @param [options.show = true] - Determines if this primitive will be shown.
  22810. * @param [options.interleave = false] - When <code>true</code>, geometry vertex attributes are interleaved, which can slightly improve rendering performance but increases load time.
  22811. * @param [options.releaseGeometryInstances = true] - When <code>true</code>, the primitive does not keep a reference to the input <code>geometryInstances</code> to save memory.
  22812. * @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.
  22813. * @param [options.asynchronous = true] - Determines if the primitive will be created asynchronously or block until ready. If false initializeTerrainHeights() must be called first.
  22814. * @param [options.classificationType = ClassificationType.BOTH] - Determines whether terrain, 3D Tiles or both will be classified.
  22815. * @param [options.debugShowBoundingVolume = false] - For debugging only. Determines if this primitive's commands' bounding spheres are shown.
  22816. * @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.
  22817. */
  22818. export class GroundPolylinePrimitive {
  22819. constructor(options?: {
  22820. geometryInstances?: any[] | GeometryInstance;
  22821. appearance?: Appearance;
  22822. show?: boolean;
  22823. interleave?: boolean;
  22824. releaseGeometryInstances?: boolean;
  22825. allowPicking?: boolean;
  22826. asynchronous?: boolean;
  22827. classificationType?: ClassificationType;
  22828. debugShowBoundingVolume?: boolean;
  22829. debugShowShadowVolume?: boolean;
  22830. });
  22831. /**
  22832. * The geometry instances rendered with this primitive. This may
  22833. * be <code>undefined</code> if <code>options.releaseGeometryInstances</code>
  22834. * is <code>true</code> when the primitive is constructed.
  22835. * <p>
  22836. * Changing this property after the primitive is rendered has no effect.
  22837. * </p>
  22838. */
  22839. readonly geometryInstances: any[] | GeometryInstance;
  22840. /**
  22841. * The {@link Appearance} used to shade this primitive. Each geometry
  22842. * instance is shaded with the same appearance. Some appearances, like
  22843. * {@link PolylineColorAppearance} allow giving each instance unique
  22844. * properties.
  22845. */
  22846. appearance: Appearance;
  22847. /**
  22848. * Determines if the primitive will be shown. This affects all geometry
  22849. * instances in the primitive.
  22850. */
  22851. show: boolean;
  22852. /**
  22853. * Determines whether terrain, 3D Tiles or both will be classified.
  22854. */
  22855. classificationType: ClassificationType;
  22856. /**
  22857. * This property is for debugging only; it is not for production use nor is it optimized.
  22858. * <p>
  22859. * Draws the bounding sphere for each draw command in the primitive.
  22860. * </p>
  22861. */
  22862. debugShowBoundingVolume: boolean;
  22863. /**
  22864. * Determines if geometry vertex attributes are interleaved, which can slightly improve rendering performance.
  22865. */
  22866. readonly interleave: boolean;
  22867. /**
  22868. * When <code>true</code>, the primitive does not keep a reference to the input <code>geometryInstances</code> to save memory.
  22869. */
  22870. readonly releaseGeometryInstances: boolean;
  22871. /**
  22872. * When <code>true</code>, each geometry instance will only be pickable with {@link Scene#pick}. When <code>false</code>, GPU memory is saved.
  22873. */
  22874. readonly allowPicking: boolean;
  22875. /**
  22876. * Determines if the geometry instances will be created and batched on a web worker.
  22877. */
  22878. readonly asynchronous: boolean;
  22879. /**
  22880. * Determines if the primitive is complete and ready to render. If this property is
  22881. * true, the primitive will be rendered the next time that {@link GroundPolylinePrimitive#update}
  22882. * is called.
  22883. */
  22884. readonly ready: boolean;
  22885. /**
  22886. * Gets a promise that resolves when the primitive is ready to render.
  22887. */
  22888. readonly readyPromise: Promise<GroundPolylinePrimitive>;
  22889. /**
  22890. * This property is for debugging only; it is not for production use nor is it optimized.
  22891. * <p>
  22892. * If true, draws the shadow volume for each geometry in the primitive.
  22893. * </p>
  22894. */
  22895. readonly debugShowShadowVolume: boolean;
  22896. /**
  22897. * Initializes the minimum and maximum terrain heights. This only needs to be called if you are creating the
  22898. * GroundPolylinePrimitive synchronously.
  22899. * @returns A promise that will resolve once the terrain heights have been loaded.
  22900. */
  22901. initializeTerrainHeights(): Promise<void>;
  22902. /**
  22903. * Called when {@link Viewer} or {@link CesiumWidget} render the scene to
  22904. * get the draw commands needed to render this primitive.
  22905. * <p>
  22906. * Do not call this function directly. This is documented just to
  22907. * list the exceptions that may be propagated when the scene is rendered:
  22908. * </p>
  22909. */
  22910. update(): void;
  22911. /**
  22912. * Returns the modifiable per-instance attributes for a {@link GeometryInstance}.
  22913. * @example
  22914. * const attributes = primitive.getGeometryInstanceAttributes('an id');
  22915. * attributes.color = Cesium.ColorGeometryInstanceAttribute.toValue(Cesium.Color.AQUA);
  22916. * attributes.show = Cesium.ShowGeometryInstanceAttribute.toValue(true);
  22917. * @param id - The id of the {@link GeometryInstance}.
  22918. * @returns The typed array in the attribute's format or undefined if the is no instance with id.
  22919. */
  22920. getGeometryInstanceAttributes(id: any): any;
  22921. /**
  22922. * Checks if the given Scene supports GroundPolylinePrimitives.
  22923. * GroundPolylinePrimitives require support for the WEBGL_depth_texture extension.
  22924. * @param scene - The current scene.
  22925. * @returns Whether or not the current scene supports GroundPolylinePrimitives.
  22926. */
  22927. isSupported(scene: Scene): boolean;
  22928. /**
  22929. * Returns true if this object was destroyed; otherwise, false.
  22930. * <p>
  22931. * If this object was destroyed, it should not be used; calling any function other than
  22932. * <code>isDestroyed</code> will result in a {@link DeveloperError} exception.
  22933. * </p>
  22934. * @returns <code>true</code> if this object was destroyed; otherwise, <code>false</code>.
  22935. */
  22936. isDestroyed(): boolean;
  22937. /**
  22938. * Destroys the WebGL resources held by this object. Destroying an object allows for deterministic
  22939. * release of WebGL resources, instead of relying on the garbage collector to destroy this object.
  22940. * <p>
  22941. * Once an object is destroyed, it should not be used; calling any function other than
  22942. * <code>isDestroyed</code> will result in a {@link DeveloperError} exception. Therefore,
  22943. * assign the return value (<code>undefined</code>) to the object as done in the example.
  22944. * </p>
  22945. * @example
  22946. * e = e && e.destroy();
  22947. */
  22948. destroy(): void;
  22949. }
  22950. /**
  22951. * A ground primitive represents geometry draped over terrain or 3D Tiles in the {@link Scene}.
  22952. * <p>
  22953. * A primitive combines geometry instances with an {@link Appearance} that describes the full shading, including
  22954. * {@link Material} and {@link RenderState}. Roughly, the geometry instance defines the structure and placement,
  22955. * and the appearance defines the visual characteristics. Decoupling geometry and appearance allows us to mix
  22956. * and match most of them and add a new geometry or appearance independently of each other.
  22957. * </p>
  22958. * <p>
  22959. * Support for the WEBGL_depth_texture extension is required to use GeometryInstances with different PerInstanceColors
  22960. * or materials besides PerInstanceColorAppearance.
  22961. * </p>
  22962. * <p>
  22963. * Textured GroundPrimitives were designed for notional patterns and are not meant for precisely mapping
  22964. * textures to terrain - for that use case, use {@link SingleTileImageryProvider}.
  22965. * </p>
  22966. * <p>
  22967. * For correct rendering, this feature requires the EXT_frag_depth WebGL extension. For hardware that do not support this extension, there
  22968. * will be rendering artifacts for some viewing angles.
  22969. * </p>
  22970. * <p>
  22971. * Valid geometries are {@link CircleGeometry}, {@link CorridorGeometry}, {@link EllipseGeometry}, {@link PolygonGeometry}, and {@link RectangleGeometry}.
  22972. * </p>
  22973. * @example
  22974. * // Example 1: Create primitive with a single instance
  22975. * const rectangleInstance = new Cesium.GeometryInstance({
  22976. * geometry : new Cesium.RectangleGeometry({
  22977. * rectangle : Cesium.Rectangle.fromDegrees(-140.0, 30.0, -100.0, 40.0)
  22978. * }),
  22979. * id : 'rectangle',
  22980. * attributes : {
  22981. * color : new Cesium.ColorGeometryInstanceAttribute(0.0, 1.0, 1.0, 0.5)
  22982. * }
  22983. * });
  22984. * scene.primitives.add(new Cesium.GroundPrimitive({
  22985. * geometryInstances : rectangleInstance
  22986. * }));
  22987. *
  22988. * // Example 2: Batch instances
  22989. * const color = new Cesium.ColorGeometryInstanceAttribute(0.0, 1.0, 1.0, 0.5); // Both instances must have the same color.
  22990. * const rectangleInstance = new Cesium.GeometryInstance({
  22991. * geometry : new Cesium.RectangleGeometry({
  22992. * rectangle : Cesium.Rectangle.fromDegrees(-140.0, 30.0, -100.0, 40.0)
  22993. * }),
  22994. * id : 'rectangle',
  22995. * attributes : {
  22996. * color : color
  22997. * }
  22998. * });
  22999. * const ellipseInstance = new Cesium.GeometryInstance({
  23000. * geometry : new Cesium.EllipseGeometry({
  23001. * center : Cesium.Cartesian3.fromDegrees(-105.0, 40.0),
  23002. * semiMinorAxis : 300000.0,
  23003. * semiMajorAxis : 400000.0
  23004. * }),
  23005. * id : 'ellipse',
  23006. * attributes : {
  23007. * color : color
  23008. * }
  23009. * });
  23010. * scene.primitives.add(new Cesium.GroundPrimitive({
  23011. * geometryInstances : [rectangleInstance, ellipseInstance]
  23012. * }));
  23013. * @param [options] - Object with the following properties:
  23014. * @param [options.geometryInstances] - The geometry instances to render.
  23015. * @param [options.appearance] - The appearance used to render the primitive. Defaults to a flat PerInstanceColorAppearance when GeometryInstances have a color attribute.
  23016. * @param [options.show = true] - Determines if this primitive will be shown.
  23017. * @param [options.vertexCacheOptimize = false] - When <code>true</code>, geometry vertices are optimized for the pre and post-vertex-shader caches.
  23018. * @param [options.interleave = false] - When <code>true</code>, geometry vertex attributes are interleaved, which can slightly improve rendering performance but increases load time.
  23019. * @param [options.compressVertices = true] - When <code>true</code>, the geometry vertices are compressed, which will save memory.
  23020. * @param [options.releaseGeometryInstances = true] - When <code>true</code>, the primitive does not keep a reference to the input <code>geometryInstances</code> to save memory.
  23021. * @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.
  23022. * @param [options.asynchronous = true] - Determines if the primitive will be created asynchronously or block until ready. If false initializeTerrainHeights() must be called first.
  23023. * @param [options.classificationType = ClassificationType.BOTH] - Determines whether terrain, 3D Tiles or both will be classified.
  23024. * @param [options.debugShowBoundingVolume = false] - For debugging only. Determines if this primitive's commands' bounding spheres are shown.
  23025. * @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
  23026. * creation for the volumes to be created before the geometry is released or options.releaseGeometryInstance must be <code>false</code>.
  23027. */
  23028. export class GroundPrimitive {
  23029. constructor(options?: {
  23030. geometryInstances?: any[] | GeometryInstance;
  23031. appearance?: Appearance;
  23032. show?: boolean;
  23033. vertexCacheOptimize?: boolean;
  23034. interleave?: boolean;
  23035. compressVertices?: boolean;
  23036. releaseGeometryInstances?: boolean;
  23037. allowPicking?: boolean;
  23038. asynchronous?: boolean;
  23039. classificationType?: ClassificationType;
  23040. debugShowBoundingVolume?: boolean;
  23041. debugShowShadowVolume?: boolean;
  23042. });
  23043. /**
  23044. * The {@link Appearance} used to shade this primitive. Each geometry
  23045. * instance is shaded with the same appearance. Some appearances, like
  23046. * {@link PerInstanceColorAppearance} allow giving each instance unique
  23047. * properties.
  23048. */
  23049. appearance: Appearance;
  23050. /**
  23051. * The geometry instances rendered with this primitive. This may
  23052. * be <code>undefined</code> if <code>options.releaseGeometryInstances</code>
  23053. * is <code>true</code> when the primitive is constructed.
  23054. * <p>
  23055. * Changing this property after the primitive is rendered has no effect.
  23056. * </p>
  23057. */
  23058. readonly geometryInstances: any[] | GeometryInstance;
  23059. /**
  23060. * Determines if the primitive will be shown. This affects all geometry
  23061. * instances in the primitive.
  23062. */
  23063. show: boolean;
  23064. /**
  23065. * Determines whether terrain, 3D Tiles or both will be classified.
  23066. */
  23067. classificationType: ClassificationType;
  23068. /**
  23069. * This property is for debugging only; it is not for production use nor is it optimized.
  23070. * <p>
  23071. * Draws the bounding sphere for each draw command in the primitive.
  23072. * </p>
  23073. */
  23074. debugShowBoundingVolume: boolean;
  23075. /**
  23076. * This property is for debugging only; it is not for production use nor is it optimized.
  23077. * <p>
  23078. * Draws the shadow volume for each geometry in the primitive.
  23079. * </p>
  23080. */
  23081. debugShowShadowVolume: boolean;
  23082. /**
  23083. * When <code>true</code>, geometry vertices are optimized for the pre and post-vertex-shader caches.
  23084. */
  23085. readonly vertexCacheOptimize: boolean;
  23086. /**
  23087. * Determines if geometry vertex attributes are interleaved, which can slightly improve rendering performance.
  23088. */
  23089. readonly interleave: boolean;
  23090. /**
  23091. * When <code>true</code>, the primitive does not keep a reference to the input <code>geometryInstances</code> to save memory.
  23092. */
  23093. readonly releaseGeometryInstances: boolean;
  23094. /**
  23095. * When <code>true</code>, each geometry instance will only be pickable with {@link Scene#pick}. When <code>false</code>, GPU memory is saved.
  23096. */
  23097. readonly allowPicking: boolean;
  23098. /**
  23099. * Determines if the geometry instances will be created and batched on a web worker.
  23100. */
  23101. readonly asynchronous: boolean;
  23102. /**
  23103. * When <code>true</code>, geometry vertices are compressed, which will save memory.
  23104. */
  23105. readonly compressVertices: boolean;
  23106. /**
  23107. * Determines if the primitive is complete and ready to render. If this property is
  23108. * true, the primitive will be rendered the next time that {@link GroundPrimitive#update}
  23109. * is called.
  23110. */
  23111. readonly ready: boolean;
  23112. /**
  23113. * Gets a promise that resolves when the primitive is ready to render.
  23114. */
  23115. readonly readyPromise: Promise<GroundPrimitive>;
  23116. /**
  23117. * Determines if GroundPrimitive rendering is supported.
  23118. * @param scene - The scene.
  23119. * @returns <code>true</code> if GroundPrimitives are supported; otherwise, returns <code>false</code>
  23120. */
  23121. isSupported(scene: Scene): boolean;
  23122. /**
  23123. * Initializes the minimum and maximum terrain heights. This only needs to be called if you are creating the
  23124. * GroundPrimitive synchronously.
  23125. * @returns A promise that will resolve once the terrain heights have been loaded.
  23126. */
  23127. initializeTerrainHeights(): Promise<void>;
  23128. /**
  23129. * Called when {@link Viewer} or {@link CesiumWidget} render the scene to
  23130. * get the draw commands needed to render this primitive.
  23131. * <p>
  23132. * Do not call this function directly. This is documented just to
  23133. * list the exceptions that may be propagated when the scene is rendered:
  23134. * </p>
  23135. */
  23136. update(): void;
  23137. /**
  23138. * Returns the modifiable per-instance attributes for a {@link GeometryInstance}.
  23139. * @example
  23140. * const attributes = primitive.getGeometryInstanceAttributes('an id');
  23141. * attributes.color = Cesium.ColorGeometryInstanceAttribute.toValue(Cesium.Color.AQUA);
  23142. * attributes.show = Cesium.ShowGeometryInstanceAttribute.toValue(true);
  23143. * @param id - The id of the {@link GeometryInstance}.
  23144. * @returns The typed array in the attribute's format or undefined if the is no instance with id.
  23145. */
  23146. getGeometryInstanceAttributes(id: any): any;
  23147. /**
  23148. * Returns true if this object was destroyed; otherwise, false.
  23149. * <p>
  23150. * If this object was destroyed, it should not be used; calling any function other than
  23151. * <code>isDestroyed</code> will result in a {@link DeveloperError} exception.
  23152. * </p>
  23153. * @returns <code>true</code> if this object was destroyed; otherwise, <code>false</code>.
  23154. */
  23155. isDestroyed(): boolean;
  23156. /**
  23157. * Destroys the WebGL resources held by this object. Destroying an object allows for deterministic
  23158. * release of WebGL resources, instead of relying on the garbage collector to destroy this object.
  23159. * <p>
  23160. * Once an object is destroyed, it should not be used; calling any function other than
  23161. * <code>isDestroyed</code> will result in a {@link DeveloperError} exception. Therefore,
  23162. * assign the return value (<code>undefined</code>) to the object as done in the example.
  23163. * </p>
  23164. * @example
  23165. * e = e && e.destroy();
  23166. */
  23167. destroy(): void;
  23168. /**
  23169. * Checks if the given Scene supports materials on GroundPrimitives.
  23170. * Materials on GroundPrimitives require support for the WEBGL_depth_texture extension.
  23171. * @param scene - The current scene.
  23172. * @returns Whether or not the current scene supports materials on GroundPrimitives.
  23173. */
  23174. supportsMaterials(scene: Scene): boolean;
  23175. }
  23176. /**
  23177. * Represents the position relative to the terrain.
  23178. */
  23179. export enum HeightReference {
  23180. /**
  23181. * The position is absolute.
  23182. */
  23183. NONE = 0,
  23184. /**
  23185. * The position is clamped to the terrain.
  23186. */
  23187. CLAMP_TO_GROUND = 1,
  23188. /**
  23189. * The position height is the height above the terrain.
  23190. */
  23191. RELATIVE_TO_GROUND = 2
  23192. }
  23193. /**
  23194. * The horizontal location of an origin relative to an object, e.g., a {@link Billboard}
  23195. * or {@link Label}. For example, setting the horizontal origin to <code>LEFT</code>
  23196. * or <code>RIGHT</code> will display a billboard to the left or right (in screen space)
  23197. * of the anchor position.
  23198. * <br /><br />
  23199. * <div align='center'>
  23200. * <img src='Images/Billboard.setHorizontalOrigin.png' width='648' height='196' /><br />
  23201. * </div>
  23202. */
  23203. export enum HorizontalOrigin {
  23204. /**
  23205. * The origin is at the horizontal center of the object.
  23206. */
  23207. CENTER = 0,
  23208. /**
  23209. * The origin is on the left side of the object.
  23210. */
  23211. LEFT = 1,
  23212. /**
  23213. * The origin is on the right side of the object.
  23214. */
  23215. RIGHT = -1
  23216. }
  23217. /**
  23218. * An imagery layer that displays tiled image data from a single imagery provider
  23219. * on a {@link Globe}.
  23220. * @param imageryProvider - The imagery provider to use.
  23221. * @param [options] - Object with the following properties:
  23222. * @param [options.rectangle = imageryProvider.rectangle] - The rectangle of the layer. This rectangle
  23223. * can limit the visible portion of the imagery provider.
  23224. * @param [options.alpha = 1.0] - The alpha blending value of this layer, from 0.0 to 1.0.
  23225. * This can either be a simple number or a function with the signature
  23226. * <code>function(frameState, layer, x, y, level)</code>. The function is passed the
  23227. * current frame state, this layer, and the x, y, and level coordinates of the
  23228. * imagery tile for which the alpha is required, and it is expected to return
  23229. * the alpha value to use for the tile.
  23230. * @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.
  23231. * This can either be a simple number or a function with the signature
  23232. * <code>function(frameState, layer, x, y, level)</code>. The function is passed the
  23233. * current frame state, this layer, and the x, y, and level coordinates of the
  23234. * imagery tile for which the alpha is required, and it is expected to return
  23235. * the alpha value to use for the tile. This only takes effect when <code>enableLighting</code> is <code>true</code>.
  23236. * @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.
  23237. * This can either be a simple number or a function with the signature
  23238. * <code>function(frameState, layer, x, y, level)</code>. The function is passed the
  23239. * current frame state, this layer, and the x, y, and level coordinates of the
  23240. * imagery tile for which the alpha is required, and it is expected to return
  23241. * the alpha value to use for the tile. This only takes effect when <code>enableLighting</code> is <code>true</code>.
  23242. * @param [options.brightness = 1.0] - The brightness of this layer. 1.0 uses the unmodified imagery
  23243. * color. Less than 1.0 makes the imagery darker while greater than 1.0 makes it brighter.
  23244. * This can either be a simple number or a function with the signature
  23245. * <code>function(frameState, layer, x, y, level)</code>. The function is passed the
  23246. * current frame state, this layer, and the x, y, and level coordinates of the
  23247. * imagery tile for which the brightness is required, and it is expected to return
  23248. * the brightness value to use for the tile. The function is executed for every
  23249. * frame and for every tile, so it must be fast.
  23250. * @param [options.contrast = 1.0] - The contrast of this layer. 1.0 uses the unmodified imagery color.
  23251. * Less than 1.0 reduces the contrast while greater than 1.0 increases it.
  23252. * This can either be a simple number or a function with the signature
  23253. * <code>function(frameState, layer, x, y, level)</code>. The function is passed the
  23254. * current frame state, this layer, and the x, y, and level coordinates of the
  23255. * imagery tile for which the contrast is required, and it is expected to return
  23256. * the contrast value to use for the tile. The function is executed for every
  23257. * frame and for every tile, so it must be fast.
  23258. * @param [options.hue = 0.0] - The hue of this layer. 0.0 uses the unmodified imagery color.
  23259. * This can either be a simple number or a function with the signature
  23260. * <code>function(frameState, layer, x, y, level)</code>. The function is passed the
  23261. * current frame state, this layer, and the x, y, and level coordinates
  23262. * of the imagery tile for which the hue is required, and it is expected to return
  23263. * the contrast value to use for the tile. The function is executed for every
  23264. * frame and for every tile, so it must be fast.
  23265. * @param [options.saturation = 1.0] - The saturation of this layer. 1.0 uses the unmodified imagery color.
  23266. * Less than 1.0 reduces the saturation while greater than 1.0 increases it.
  23267. * This can either be a simple number or a function with the signature
  23268. * <code>function(frameState, layer, x, y, level)</code>. The function is passed the
  23269. * current frame state, this layer, and the x, y, and level coordinates
  23270. * of the imagery tile for which the saturation is required, and it is expected to return
  23271. * the contrast value to use for the tile. The function is executed for every
  23272. * frame and for every tile, so it must be fast.
  23273. * @param [options.gamma = 1.0] - The gamma correction to apply to this layer. 1.0 uses the unmodified imagery color.
  23274. * This can either be a simple number or a function with the signature
  23275. * <code>function(frameState, layer, x, y, level)</code>. The function is passed the
  23276. * current frame state, this layer, and the x, y, and level coordinates of the
  23277. * imagery tile for which the gamma is required, and it is expected to return
  23278. * the gamma value to use for the tile. The function is executed for every
  23279. * frame and for every tile, so it must be fast.
  23280. * @param [options.splitDirection = SplitDirection.NONE] - The {@link SplitDirection} split to apply to this layer.
  23281. * @param [options.minificationFilter = TextureMinificationFilter.LINEAR] - The
  23282. * texture minification filter to apply to this layer. Possible values
  23283. * are <code>TextureMinificationFilter.LINEAR</code> and
  23284. * <code>TextureMinificationFilter.NEAREST</code>.
  23285. * @param [options.magnificationFilter = TextureMagnificationFilter.LINEAR] - The
  23286. * texture minification filter to apply to this layer. Possible values
  23287. * are <code>TextureMagnificationFilter.LINEAR</code> and
  23288. * <code>TextureMagnificationFilter.NEAREST</code>.
  23289. * @param [options.show = true] - True if the layer is shown; otherwise, false.
  23290. * @param [options.maximumAnisotropy = maximum supported] - The maximum anisotropy level to use
  23291. * for texture filtering. If this parameter is not specified, the maximum anisotropy supported
  23292. * by the WebGL stack will be used. Larger values make the imagery look better in horizon
  23293. * views.
  23294. * @param [options.minimumTerrainLevel] - The minimum terrain level-of-detail at which to show this imagery layer,
  23295. * or undefined to show it at all levels. Level zero is the least-detailed level.
  23296. * @param [options.maximumTerrainLevel] - The maximum terrain level-of-detail at which to show this imagery layer,
  23297. * or undefined to show it at all levels. Level zero is the least-detailed level.
  23298. * @param [options.cutoutRectangle] - Cartographic rectangle for cutting out a portion of this ImageryLayer.
  23299. * @param [options.colorToAlpha] - Color to be used as alpha.
  23300. * @param [options.colorToAlphaThreshold = 0.004] - Threshold for color-to-alpha.
  23301. */
  23302. export class ImageryLayer {
  23303. constructor(imageryProvider: ImageryProvider, options?: {
  23304. rectangle?: Rectangle;
  23305. alpha?: number | ((...params: any[]) => any);
  23306. nightAlpha?: number | ((...params: any[]) => any);
  23307. dayAlpha?: number | ((...params: any[]) => any);
  23308. brightness?: number | ((...params: any[]) => any);
  23309. contrast?: number | ((...params: any[]) => any);
  23310. hue?: number | ((...params: any[]) => any);
  23311. saturation?: number | ((...params: any[]) => any);
  23312. gamma?: number | ((...params: any[]) => any);
  23313. splitDirection?: SplitDirection | ((...params: any[]) => any);
  23314. minificationFilter?: TextureMinificationFilter;
  23315. magnificationFilter?: TextureMagnificationFilter;
  23316. show?: boolean;
  23317. maximumAnisotropy?: number;
  23318. minimumTerrainLevel?: number;
  23319. maximumTerrainLevel?: number;
  23320. cutoutRectangle?: Rectangle;
  23321. colorToAlpha?: Color;
  23322. colorToAlphaThreshold?: number;
  23323. });
  23324. /**
  23325. * The alpha blending value of this layer, with 0.0 representing fully transparent and
  23326. * 1.0 representing fully opaque.
  23327. */
  23328. alpha: number;
  23329. /**
  23330. * The alpha blending value of this layer on the night side of the globe, with 0.0 representing fully transparent and
  23331. * 1.0 representing fully opaque. This only takes effect when {@link Globe#enableLighting} is <code>true</code>.
  23332. */
  23333. nightAlpha: number;
  23334. /**
  23335. * The alpha blending value of this layer on the day side of the globe, with 0.0 representing fully transparent and
  23336. * 1.0 representing fully opaque. This only takes effect when {@link Globe#enableLighting} is <code>true</code>.
  23337. */
  23338. dayAlpha: number;
  23339. /**
  23340. * The brightness of this layer. 1.0 uses the unmodified imagery color. Less than 1.0
  23341. * makes the imagery darker while greater than 1.0 makes it brighter.
  23342. */
  23343. brightness: number;
  23344. /**
  23345. * The contrast of this layer. 1.0 uses the unmodified imagery color. Less than 1.0 reduces
  23346. * the contrast while greater than 1.0 increases it.
  23347. */
  23348. contrast: number;
  23349. /**
  23350. * The hue of this layer in radians. 0.0 uses the unmodified imagery color.
  23351. */
  23352. hue: number;
  23353. /**
  23354. * The saturation of this layer. 1.0 uses the unmodified imagery color. Less than 1.0 reduces the
  23355. * saturation while greater than 1.0 increases it.
  23356. */
  23357. saturation: number;
  23358. /**
  23359. * The gamma correction to apply to this layer. 1.0 uses the unmodified imagery color.
  23360. */
  23361. gamma: number;
  23362. /**
  23363. * The {@link SplitDirection} to apply to this layer.
  23364. */
  23365. splitDirection: SplitDirection;
  23366. /**
  23367. * The {@link TextureMinificationFilter} to apply to this layer.
  23368. * Possible values are {@link TextureMinificationFilter.LINEAR} (the default)
  23369. * and {@link TextureMinificationFilter.NEAREST}.
  23370. *
  23371. * To take effect, this property must be set immediately after adding the imagery layer.
  23372. * Once a texture is loaded it won't be possible to change the texture filter used.
  23373. */
  23374. minificationFilter: TextureMinificationFilter;
  23375. /**
  23376. * The {@link TextureMagnificationFilter} to apply to this layer.
  23377. * Possible values are {@link TextureMagnificationFilter.LINEAR} (the default)
  23378. * and {@link TextureMagnificationFilter.NEAREST}.
  23379. *
  23380. * To take effect, this property must be set immediately after adding the imagery layer.
  23381. * Once a texture is loaded it won't be possible to change the texture filter used.
  23382. */
  23383. magnificationFilter: TextureMagnificationFilter;
  23384. /**
  23385. * Determines if this layer is shown.
  23386. */
  23387. show: boolean;
  23388. /**
  23389. * Rectangle cutout in this layer of imagery.
  23390. */
  23391. cutoutRectangle: Rectangle;
  23392. /**
  23393. * Color value that should be set to transparent.
  23394. */
  23395. colorToAlpha: Color;
  23396. /**
  23397. * Normalized (0-1) threshold for color-to-alpha.
  23398. */
  23399. colorToAlphaThreshold: number;
  23400. /**
  23401. * Gets the imagery provider for this layer.
  23402. */
  23403. readonly imageryProvider: ImageryProvider;
  23404. /**
  23405. * Gets the rectangle of this layer. If this rectangle is smaller than the rectangle of the
  23406. * {@link ImageryProvider}, only a portion of the imagery provider is shown.
  23407. */
  23408. readonly rectangle: Rectangle;
  23409. /**
  23410. * This value is used as the default brightness for the imagery layer if one is not provided during construction
  23411. * or by the imagery provider. This value does not modify the brightness of the imagery.
  23412. */
  23413. DEFAULT_BRIGHTNESS: number;
  23414. /**
  23415. * This value is used as the default contrast for the imagery layer if one is not provided during construction
  23416. * or by the imagery provider. This value does not modify the contrast of the imagery.
  23417. */
  23418. DEFAULT_CONTRAST: number;
  23419. /**
  23420. * This value is used as the default hue for the imagery layer if one is not provided during construction
  23421. * or by the imagery provider. This value does not modify the hue of the imagery.
  23422. */
  23423. DEFAULT_HUE: number;
  23424. /**
  23425. * This value is used as the default saturation for the imagery layer if one is not provided during construction
  23426. * or by the imagery provider. This value does not modify the saturation of the imagery.
  23427. */
  23428. DEFAULT_SATURATION: number;
  23429. /**
  23430. * This value is used as the default gamma for the imagery layer if one is not provided during construction
  23431. * or by the imagery provider. This value does not modify the gamma of the imagery.
  23432. */
  23433. DEFAULT_GAMMA: number;
  23434. /**
  23435. * This value is used as the default split for the imagery layer if one is not provided during construction
  23436. * or by the imagery provider.
  23437. */
  23438. DEFAULT_SPLIT: SplitDirection;
  23439. /**
  23440. * This value is used as the default texture minification filter for the imagery layer if one is not provided
  23441. * during construction or by the imagery provider.
  23442. */
  23443. DEFAULT_MINIFICATION_FILTER: TextureMinificationFilter;
  23444. /**
  23445. * This value is used as the default texture magnification filter for the imagery layer if one is not provided
  23446. * during construction or by the imagery provider.
  23447. */
  23448. DEFAULT_MAGNIFICATION_FILTER: TextureMagnificationFilter;
  23449. /**
  23450. * This value is used as the default threshold for color-to-alpha if one is not provided
  23451. * during construction or by the imagery provider.
  23452. */
  23453. DEFAULT_APPLY_COLOR_TO_ALPHA_THRESHOLD: number;
  23454. /**
  23455. * Gets a value indicating whether this layer is the base layer in the
  23456. * {@link ImageryLayerCollection}. The base layer is the one that underlies all
  23457. * others. It is special in that it is treated as if it has global rectangle, even if
  23458. * it actually does not, by stretching the texels at the edges over the entire
  23459. * globe.
  23460. * @returns true if this is the base layer; otherwise, false.
  23461. */
  23462. isBaseLayer(): boolean;
  23463. /**
  23464. * Returns true if this object was destroyed; otherwise, false.
  23465. * <br /><br />
  23466. * If this object was destroyed, it should not be used; calling any function other than
  23467. * <code>isDestroyed</code> will result in a {@link DeveloperError} exception.
  23468. * @returns True if this object was destroyed; otherwise, false.
  23469. */
  23470. isDestroyed(): boolean;
  23471. /**
  23472. * Destroys the WebGL resources held by this object. Destroying an object allows for deterministic
  23473. * release of WebGL resources, instead of relying on the garbage collector to destroy this object.
  23474. * <br /><br />
  23475. * Once an object is destroyed, it should not be used; calling any function other than
  23476. * <code>isDestroyed</code> will result in a {@link DeveloperError} exception. Therefore,
  23477. * assign the return value (<code>undefined</code>) to the object as done in the example.
  23478. * @example
  23479. * imageryLayer = imageryLayer && imageryLayer.destroy();
  23480. */
  23481. destroy(): void;
  23482. /**
  23483. * Computes the intersection of this layer's rectangle with the imagery provider's availability rectangle,
  23484. * producing the overall bounds of imagery that can be produced by this layer.
  23485. * @example
  23486. * // Zoom to an imagery layer.
  23487. * imageryLayer.getViewableRectangle().then(function (rectangle) {
  23488. * return camera.flyTo({
  23489. * destination: rectangle
  23490. * });
  23491. * });
  23492. * @returns A promise to a rectangle which defines the overall bounds of imagery that can be produced by this layer.
  23493. */
  23494. getViewableRectangle(): Promise<Rectangle>;
  23495. }
  23496. /**
  23497. * An ordered collection of imagery layers.
  23498. */
  23499. type ImageryLayerCollection = {
  23500. /**
  23501. * An event that is raised when a layer is added to the collection. Event handlers are passed the layer that
  23502. * was added and the index at which it was added.
  23503. */
  23504. layerAdded: Event;
  23505. /**
  23506. * An event that is raised when a layer is removed from the collection. Event handlers are passed the layer that
  23507. * was removed and the index from which it was removed.
  23508. */
  23509. layerRemoved: Event;
  23510. /**
  23511. * An event that is raised when a layer changes position in the collection. Event handlers are passed the layer that
  23512. * was moved, its new index after the move, and its old index prior to the move.
  23513. */
  23514. layerMoved: Event;
  23515. /**
  23516. * An event that is raised when a layer is shown or hidden by setting the
  23517. * {@link ImageryLayer#show} property. Event handlers are passed a reference to this layer,
  23518. * the index of the layer in the collection, and a flag that is true if the layer is now
  23519. * shown or false if it is now hidden.
  23520. */
  23521. layerShownOrHidden: Event;
  23522. /**
  23523. * Gets the number of layers in this collection.
  23524. */
  23525. length: number;
  23526. /**
  23527. * Adds a layer to the collection.
  23528. * @param layer - the layer to add.
  23529. * @param [index] - the index to add the layer at. If omitted, the layer will
  23530. * be added on top of all existing layers.
  23531. */
  23532. add(layer: ImageryLayer, index?: number): void;
  23533. /**
  23534. * 用给定的ImageryProvider创建一个新层,并将其添加到集合中.
  23535. * @param imageryProvider - 图像提供程序创建一个新层.
  23536. * @param [index] - 添加图层的索引。如果省略,该层将添加到所有现有层的顶部.
  23537. * @returns 新创建的图层.
  23538. */
  23539. addImageryProvider(imageryProvider: ImageryProvider, index?: number): ImageryLayer;
  23540. /**
  23541. * Removes a layer from this collection, if present.
  23542. * @param layer - The layer to remove.
  23543. * @param [destroy = true] - whether to destroy the layers in addition to removing them.
  23544. * @returns true if the layer was in the collection and was removed,
  23545. * false if the layer was not in the collection.
  23546. */
  23547. remove(layer: ImageryLayer, destroy?: boolean): boolean;
  23548. /**
  23549. * Removes all layers from this collection.
  23550. * @param [destroy = true] - whether to destroy the layers in addition to removing them.
  23551. */
  23552. removeAll(destroy?: boolean): void;
  23553. /**
  23554. * Checks to see if the collection contains a given layer.
  23555. * @param layer - the layer to check for.
  23556. * @returns true if the collection contains the layer, false otherwise.
  23557. */
  23558. contains(layer: ImageryLayer): boolean;
  23559. /**
  23560. * Determines the index of a given layer in the collection.
  23561. * @param layer - The layer to find the index of.
  23562. * @returns The index of the layer in the collection, or -1 if the layer does not exist in the collection.
  23563. */
  23564. indexOf(layer: ImageryLayer): number;
  23565. /**
  23566. * Gets a layer by index from the collection.
  23567. * @param index - the index to retrieve.
  23568. * @returns The imagery layer at the given index.
  23569. */
  23570. get(index: number): ImageryLayer;
  23571. /**
  23572. * Raises a layer up one position in the collection.
  23573. * @param layer - the layer to move.
  23574. */
  23575. raise(layer: ImageryLayer): void;
  23576. /**
  23577. * Lowers a layer down one position in the collection.
  23578. * @param layer - the layer to move.
  23579. */
  23580. lower(layer: ImageryLayer): void;
  23581. /**
  23582. * Raises a layer to the top of the collection.
  23583. * @param layer - the layer to move.
  23584. */
  23585. raiseToTop(layer: ImageryLayer): void;
  23586. /**
  23587. * Lowers a layer to the bottom of the collection.
  23588. * @param layer - the layer to move.
  23589. */
  23590. lowerToBottom(layer: ImageryLayer): void;
  23591. /**
  23592. * Determines the imagery layers that are intersected by a pick ray. To compute a pick ray from a
  23593. * location on the screen, use {@link Camera.getPickRay}.
  23594. * @param ray - The ray to test for intersection.
  23595. * @param scene - The scene.
  23596. * @returns An array that includes all of
  23597. * the layers that are intersected by a given pick ray. Undefined if
  23598. * no layers are selected.
  23599. */
  23600. pickImageryLayers(ray: Ray, scene: Scene): ImageryLayer[] | undefined;
  23601. /**
  23602. * Asynchronously determines the imagery layer features that are intersected by a pick ray. The intersected imagery
  23603. * layer features are found by invoking {@link ImageryProvider#pickFeatures} for each imagery layer tile intersected
  23604. * by the pick ray. To compute a pick ray from a location on the screen, use {@link Camera.getPickRay}.
  23605. * @example
  23606. * const pickRay = viewer.camera.getPickRay(windowPosition);
  23607. * const featuresPromise = viewer.imageryLayers.pickImageryLayerFeatures(pickRay, viewer.scene);
  23608. * if (!Cesium.defined(featuresPromise)) {
  23609. * console.log('No features picked.');
  23610. * } else {
  23611. * Promise.resolve(featuresPromise).then(function(features) {
  23612. * // This function is called asynchronously when the list if picked features is available.
  23613. * console.log('Number of features: ' + features.length);
  23614. * if (features.length > 0) {
  23615. * console.log('First feature name: ' + features[0].name);
  23616. * }
  23617. * });
  23618. * }
  23619. * @param ray - The ray to test for intersection.
  23620. * @param scene - The scene.
  23621. * @returns A promise that resolves to an array of features intersected by the pick ray.
  23622. * If it can be quickly determined that no features are intersected (for example,
  23623. * because no active imagery providers support {@link ImageryProvider#pickFeatures}
  23624. * or because the pick ray does not intersect the surface), this function will
  23625. * return undefined.
  23626. */
  23627. pickImageryLayerFeatures(ray: Ray, scene: Scene): Promise<ImageryLayerFeatureInfo[]> | undefined;
  23628. /**
  23629. * Returns true if this object was destroyed; otherwise, false.
  23630. * <br /><br />
  23631. * If this object was destroyed, it should not be used; calling any function other than
  23632. * <code>isDestroyed</code> will result in a {@link DeveloperError} exception.
  23633. * @returns true if this object was destroyed; otherwise, false.
  23634. */
  23635. isDestroyed(): boolean;
  23636. /**
  23637. * Destroys the WebGL resources held by all layers in this collection. Explicitly destroying this
  23638. * object allows for deterministic release of WebGL resources, instead of relying on the garbage
  23639. * collector.
  23640. * <br /><br />
  23641. * Once this object is destroyed, it should not be used; calling any function other than
  23642. * <code>isDestroyed</code> will result in a {@link DeveloperError} exception. Therefore,
  23643. * assign the return value (<code>undefined</code>) to the object as done in the example.
  23644. * @example
  23645. * layerCollection = layerCollection && layerCollection.destroy();
  23646. */
  23647. destroy(): void;
  23648. }
  23649. /**
  23650. * A Label draws viewport-aligned text positioned in the 3D scene. This constructor
  23651. * should not be used directly, instead create labels by calling {@link LabelCollection#add}.
  23652. */
  23653. export class Label {
  23654. constructor();
  23655. /**
  23656. * Determines if this label will be shown. Use this to hide or show a label, instead
  23657. * of removing it and re-adding it to the collection.
  23658. */
  23659. show: boolean;
  23660. /**
  23661. * Gets or sets the Cartesian position of this label.
  23662. */
  23663. position: Cartesian3;
  23664. /**
  23665. * Gets or sets the height reference of this billboard.
  23666. */
  23667. heightReference: HeightReference;
  23668. /**
  23669. * Gets or sets the text of this label.
  23670. */
  23671. text: string;
  23672. /**
  23673. * Gets or sets the font used to draw this label. Fonts are specified using the same syntax as the CSS 'font' property.
  23674. */
  23675. font: string;
  23676. /**
  23677. * Gets or sets the fill color of this label.
  23678. */
  23679. fillColor: Color;
  23680. /**
  23681. * Gets or sets the outline color of this label.
  23682. */
  23683. outlineColor: Color;
  23684. /**
  23685. * Gets or sets the outline width of this label.
  23686. */
  23687. outlineWidth: number;
  23688. /**
  23689. * Determines if a background behind this label will be shown.
  23690. */
  23691. showBackground: boolean;
  23692. /**
  23693. * Gets or sets the background color of this label.
  23694. */
  23695. backgroundColor: Color;
  23696. /**
  23697. * Gets or sets the background padding, in pixels, of this label. The <code>x</code> value
  23698. * controls horizontal padding, and the <code>y</code> value controls vertical padding.
  23699. */
  23700. backgroundPadding: Cartesian2;
  23701. /**
  23702. * Gets or sets the style of this label.
  23703. */
  23704. style: LabelStyle;
  23705. /**
  23706. * Gets or sets the pixel offset in screen space from the origin of this label. This is commonly used
  23707. * to align multiple labels and billboards at the same position, e.g., an image and text. The
  23708. * screen space origin is the top, left corner of the canvas; <code>x</code> increases from
  23709. * left to right, and <code>y</code> increases from top to bottom.
  23710. * <br /><br />
  23711. * <div align='center'>
  23712. * <table border='0' cellpadding='5'><tr>
  23713. * <td align='center'><code>default</code><br/><img src='Images/Label.setPixelOffset.default.png' width='250' height='188' /></td>
  23714. * <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>
  23715. * </tr></table>
  23716. * The label's origin is indicated by the yellow point.
  23717. * </div>
  23718. */
  23719. pixelOffset: Cartesian2;
  23720. /**
  23721. * Gets or sets near and far translucency properties of a Label based on the Label's distance from the camera.
  23722. * A label's translucency will interpolate between the {@link NearFarScalar#nearValue} and
  23723. * {@link NearFarScalar#farValue} while the camera distance falls within the lower and upper bounds
  23724. * of the specified {@link NearFarScalar#near} and {@link NearFarScalar#far}.
  23725. * Outside of these ranges the label's translucency remains clamped to the nearest bound. If undefined,
  23726. * translucencyByDistance will be disabled.
  23727. * @example
  23728. * // Example 1.
  23729. * // Set a label's translucencyByDistance to 1.0 when the
  23730. * // camera is 1500 meters from the label and disappear as
  23731. * // the camera distance approaches 8.0e6 meters.
  23732. * text.translucencyByDistance = new Cesium.NearFarScalar(1.5e2, 1.0, 8.0e6, 0.0);
  23733. * @example
  23734. * // Example 2.
  23735. * // disable translucency by distance
  23736. * text.translucencyByDistance = undefined;
  23737. */
  23738. translucencyByDistance: NearFarScalar;
  23739. /**
  23740. * Gets or sets near and far pixel offset scaling properties of a Label based on the Label's distance from the camera.
  23741. * A label's pixel offset will be scaled between the {@link NearFarScalar#nearValue} and
  23742. * {@link NearFarScalar#farValue} while the camera distance falls within the lower and upper bounds
  23743. * of the specified {@link NearFarScalar#near} and {@link NearFarScalar#far}.
  23744. * Outside of these ranges the label's pixel offset scaling remains clamped to the nearest bound. If undefined,
  23745. * pixelOffsetScaleByDistance will be disabled.
  23746. * @example
  23747. * // Example 1.
  23748. * // Set a label's pixel offset scale to 0.0 when the
  23749. * // camera is 1500 meters from the label and scale pixel offset to 10.0 pixels
  23750. * // in the y direction the camera distance approaches 8.0e6 meters.
  23751. * text.pixelOffset = new Cesium.Cartesian2(0.0, 1.0);
  23752. * text.pixelOffsetScaleByDistance = new Cesium.NearFarScalar(1.5e2, 0.0, 8.0e6, 10.0);
  23753. * @example
  23754. * // Example 2.
  23755. * // disable pixel offset by distance
  23756. * text.pixelOffsetScaleByDistance = undefined;
  23757. */
  23758. pixelOffsetScaleByDistance: NearFarScalar;
  23759. /**
  23760. * Gets or sets near and far scaling properties of a Label based on the label's distance from the camera.
  23761. * A label's scale will interpolate between the {@link NearFarScalar#nearValue} and
  23762. * {@link NearFarScalar#farValue} while the camera distance falls within the lower and upper bounds
  23763. * of the specified {@link NearFarScalar#near} and {@link NearFarScalar#far}.
  23764. * Outside of these ranges the label's scale remains clamped to the nearest bound. If undefined,
  23765. * scaleByDistance will be disabled.
  23766. * @example
  23767. * // Example 1.
  23768. * // Set a label's scaleByDistance to scale by 1.5 when the
  23769. * // camera is 1500 meters from the label and disappear as
  23770. * // the camera distance approaches 8.0e6 meters.
  23771. * label.scaleByDistance = new Cesium.NearFarScalar(1.5e2, 1.5, 8.0e6, 0.0);
  23772. * @example
  23773. * // Example 2.
  23774. * // disable scaling by distance
  23775. * label.scaleByDistance = undefined;
  23776. */
  23777. scaleByDistance: NearFarScalar;
  23778. /**
  23779. * Gets and sets the 3D Cartesian offset applied to this label in eye coordinates. Eye coordinates is a left-handed
  23780. * coordinate system, where <code>x</code> points towards the viewer's right, <code>y</code> points up, and
  23781. * <code>z</code> points into the screen. Eye coordinates use the same scale as world and model coordinates,
  23782. * which is typically meters.
  23783. * <br /><br />
  23784. * An eye offset is commonly used to arrange multiple label or objects at the same position, e.g., to
  23785. * arrange a label above its corresponding 3D model.
  23786. * <br /><br />
  23787. * Below, the label is positioned at the center of the Earth but an eye offset makes it always
  23788. * appear on top of the Earth regardless of the viewer's or Earth's orientation.
  23789. * <br /><br />
  23790. * <div align='center'>
  23791. * <table border='0' cellpadding='5'><tr>
  23792. * <td align='center'><img src='Images/Billboard.setEyeOffset.one.png' width='250' height='188' /></td>
  23793. * <td align='center'><img src='Images/Billboard.setEyeOffset.two.png' width='250' height='188' /></td>
  23794. * </tr></table>
  23795. * <code>l.eyeOffset = new Cartesian3(0.0, 8000000.0, 0.0);</code><br /><br />
  23796. * </div>
  23797. */
  23798. eyeOffset: Cartesian3;
  23799. /**
  23800. * Gets or sets the horizontal origin of this label, which determines if the label is drawn
  23801. * to the left, center, or right of its anchor position.
  23802. * <br /><br />
  23803. * <div align='center'>
  23804. * <img src='Images/Billboard.setHorizontalOrigin.png' width='648' height='196' /><br />
  23805. * </div>
  23806. * @example
  23807. * // Use a top, right origin
  23808. * l.horizontalOrigin = Cesium.HorizontalOrigin.RIGHT;
  23809. * l.verticalOrigin = Cesium.VerticalOrigin.TOP;
  23810. */
  23811. horizontalOrigin: HorizontalOrigin;
  23812. /**
  23813. * Gets or sets the vertical origin of this label, which determines if the label is
  23814. * to the above, below, or at the center of its anchor position.
  23815. * <br /><br />
  23816. * <div align='center'>
  23817. * <img src='Images/Billboard.setVerticalOrigin.png' width='695' height='175' /><br />
  23818. * </div>
  23819. * @example
  23820. * // Use a top, right origin
  23821. * l.horizontalOrigin = Cesium.HorizontalOrigin.RIGHT;
  23822. * l.verticalOrigin = Cesium.VerticalOrigin.TOP;
  23823. */
  23824. verticalOrigin: VerticalOrigin;
  23825. /**
  23826. * Gets or sets the uniform scale that is multiplied with the label's size in pixels.
  23827. * A scale of <code>1.0</code> does not change the size of the label; a scale greater than
  23828. * <code>1.0</code> enlarges the label; a positive scale less than <code>1.0</code> shrinks
  23829. * the label.
  23830. * <br /><br />
  23831. * Applying a large scale value may pixelate the label. To make text larger without pixelation,
  23832. * use a larger font size when calling {@link Label#font} instead.
  23833. * <br /><br />
  23834. * <div align='center'>
  23835. * <img src='Images/Label.setScale.png' width='400' height='300' /><br/>
  23836. * From left to right in the above image, the scales are <code>0.5</code>, <code>1.0</code>,
  23837. * and <code>2.0</code>.
  23838. * </div>
  23839. */
  23840. scale: number;
  23841. /**
  23842. * Gets the total scale of the label, which is the label's scale multiplied by the computed relative size
  23843. * of the desired font compared to the generated glyph size.
  23844. */
  23845. totalScale: number;
  23846. /**
  23847. * Gets or sets the condition specifying at what distance from the camera that this label will be displayed.
  23848. */
  23849. distanceDisplayCondition: DistanceDisplayCondition;
  23850. /**
  23851. * Gets or sets the distance from the camera at which to disable the depth test to, for example, prevent clipping against terrain.
  23852. * When set to zero, the depth test is always applied. When set to Number.POSITIVE_INFINITY, the depth test is never applied.
  23853. */
  23854. disableDepthTestDistance: number;
  23855. /**
  23856. * Gets or sets the user-defined value returned when the label is picked.
  23857. */
  23858. id: any;
  23859. /**
  23860. * Computes the screen-space position of the label's origin, taking into account eye and pixel offsets.
  23861. * The screen space origin is the top, left corner of the canvas; <code>x</code> increases from
  23862. * left to right, and <code>y</code> increases from top to bottom.
  23863. * @example
  23864. * console.log(l.computeScreenSpacePosition(scene).toString());
  23865. * @param scene - The scene the label is in.
  23866. * @param [result] - The object onto which to store the result.
  23867. * @returns The screen-space position of the label.
  23868. */
  23869. computeScreenSpacePosition(scene: Scene, result?: Cartesian2): Cartesian2;
  23870. /**
  23871. * Determines if this label equals another label. Labels are equal if all their properties
  23872. * are equal. Labels in different collections can be equal.
  23873. * @param other - The label to compare for equality.
  23874. * @returns <code>true</code> if the labels are equal; otherwise, <code>false</code>.
  23875. */
  23876. equals(other: Label): boolean;
  23877. /**
  23878. * Returns true if this object was destroyed; otherwise, false.
  23879. * <br /><br />
  23880. * If this object was destroyed, it should not be used; calling any function other than
  23881. * <code>isDestroyed</code> will result in a {@link DeveloperError} exception.
  23882. * @returns True if this object was destroyed; otherwise, false.
  23883. */
  23884. isDestroyed(): boolean;
  23885. /**
  23886. * Determines whether or not run the algorithm, that match the text of the label to right-to-left languages
  23887. * @example
  23888. * // Example 1.
  23889. * // Set a label's rightToLeft before init
  23890. * Cesium.Label.enableRightToLeftDetection = true;
  23891. * const myLabelEntity = viewer.entities.add({
  23892. * label: {
  23893. * id: 'my label',
  23894. * text: 'זה טקסט בעברית \n ועכשיו יורדים שורה',
  23895. * }
  23896. * });
  23897. * @example
  23898. * // Example 2.
  23899. * const myLabelEntity = viewer.entities.add({
  23900. * label: {
  23901. * id: 'my label',
  23902. * text: 'English text'
  23903. * }
  23904. * });
  23905. * // Set a label's rightToLeft after init
  23906. * Cesium.Label.enableRightToLeftDetection = true;
  23907. * myLabelEntity.text = 'טקסט חדש';
  23908. */
  23909. enableRightToLeftDetection: boolean;
  23910. }
  23911. /**
  23912. * A renderable collection of labels. Labels are viewport-aligned text positioned in the 3D scene.
  23913. * Each label can have a different font, color, scale, etc.
  23914. * <br /><br />
  23915. * <div align='center'>
  23916. * <img src='Images/Label.png' width='400' height='300' /><br />
  23917. * Example labels
  23918. * </div>
  23919. * <br /><br />
  23920. * Labels are added and removed from the collection using {@link LabelCollection#add}
  23921. * and {@link LabelCollection#remove}.
  23922. * @example
  23923. * // Create a label collection with two labels
  23924. * const labels = scene.primitives.add(new Cesium.LabelCollection());
  23925. * labels.add({
  23926. * position : new Cesium.Cartesian3(1.0, 2.0, 3.0),
  23927. * text : 'A label'
  23928. * });
  23929. * labels.add({
  23930. * position : new Cesium.Cartesian3(4.0, 5.0, 6.0),
  23931. * text : 'Another label'
  23932. * });
  23933. * @param [options] - Object with the following properties:
  23934. * @param [options.modelMatrix = Matrix4.IDENTITY] - The 4x4 transformation matrix that transforms each label from model to world coordinates.
  23935. * @param [options.debugShowBoundingVolume = false] - For debugging only. Determines if this primitive's commands' bounding spheres are shown.
  23936. * @param [options.scene] - Must be passed in for labels that use the height reference property or will be depth tested against the globe.
  23937. * @param [options.blendOption = BlendOption.OPAQUE_AND_TRANSLUCENT] - The label blending option. The default
  23938. * is used for rendering both opaque and translucent labels. However, if either all of the labels are completely opaque or all are completely translucent,
  23939. * setting the technique to BlendOption.OPAQUE or BlendOption.TRANSLUCENT can improve performance by up to 2x.
  23940. * @param [options.show = true] - Determines if the labels in the collection will be shown.
  23941. */
  23942. export class LabelCollection {
  23943. constructor(options?: {
  23944. modelMatrix?: Matrix4;
  23945. debugShowBoundingVolume?: boolean;
  23946. scene?: Scene;
  23947. blendOption?: BlendOption;
  23948. show?: boolean;
  23949. });
  23950. /**
  23951. * Determines if labels in this collection will be shown.
  23952. */
  23953. show: boolean;
  23954. /**
  23955. * The 4x4 transformation matrix that transforms each label in this collection from model to world coordinates.
  23956. * When this is the identity matrix, the labels are drawn in world coordinates, i.e., Earth's WGS84 coordinates.
  23957. * Local reference frames can be used by providing a different transformation matrix, like that returned
  23958. * by {@link Transforms.eastNorthUpToFixedFrame}.
  23959. * @example
  23960. * const center = Cesium.Cartesian3.fromDegrees(-75.59777, 40.03883);
  23961. * labels.modelMatrix = Cesium.Transforms.eastNorthUpToFixedFrame(center);
  23962. * labels.add({
  23963. * position : new Cesium.Cartesian3(0.0, 0.0, 0.0),
  23964. * text : 'Center'
  23965. * });
  23966. * labels.add({
  23967. * position : new Cesium.Cartesian3(1000000.0, 0.0, 0.0),
  23968. * text : 'East'
  23969. * });
  23970. * labels.add({
  23971. * position : new Cesium.Cartesian3(0.0, 1000000.0, 0.0),
  23972. * text : 'North'
  23973. * });
  23974. * labels.add({
  23975. * position : new Cesium.Cartesian3(0.0, 0.0, 1000000.0),
  23976. * text : 'Up'
  23977. * });
  23978. */
  23979. modelMatrix: Matrix4;
  23980. /**
  23981. * This property is for debugging only; it is not for production use nor is it optimized.
  23982. * <p>
  23983. * Draws the bounding sphere for each draw command in the primitive.
  23984. * </p>
  23985. */
  23986. debugShowBoundingVolume: boolean;
  23987. /**
  23988. * The label blending option. The default is used for rendering both opaque and translucent labels.
  23989. * However, if either all of the labels are completely opaque or all are completely translucent,
  23990. * setting the technique to BlendOption.OPAQUE or BlendOption.TRANSLUCENT can improve
  23991. * performance by up to 2x.
  23992. */
  23993. blendOption: BlendOption;
  23994. /**
  23995. * Returns the number of labels in this collection. This is commonly used with
  23996. * {@link LabelCollection#get} to iterate over all the labels
  23997. * in the collection.
  23998. */
  23999. length: number;
  24000. /**
  24001. * Creates and adds a label with the specified initial properties to the collection.
  24002. * The added label is returned so it can be modified or removed from the collection later.
  24003. * @example
  24004. * // Example 1: Add a label, specifying all the default values.
  24005. * const l = labels.add({
  24006. * show : true,
  24007. * position : Cesium.Cartesian3.ZERO,
  24008. * text : '',
  24009. * font : '30px sans-serif',
  24010. * fillColor : Cesium.Color.WHITE,
  24011. * outlineColor : Cesium.Color.BLACK,
  24012. * outlineWidth : 1.0,
  24013. * showBackground : false,
  24014. * backgroundColor : new Cesium.Color(0.165, 0.165, 0.165, 0.8),
  24015. * backgroundPadding : new Cesium.Cartesian2(7, 5),
  24016. * style : Cesium.LabelStyle.FILL,
  24017. * pixelOffset : Cesium.Cartesian2.ZERO,
  24018. * eyeOffset : Cesium.Cartesian3.ZERO,
  24019. * horizontalOrigin : Cesium.HorizontalOrigin.LEFT,
  24020. * verticalOrigin : Cesium.VerticalOrigin.BASELINE,
  24021. * scale : 1.0,
  24022. * translucencyByDistance : undefined,
  24023. * pixelOffsetScaleByDistance : undefined,
  24024. * heightReference : HeightReference.NONE,
  24025. * distanceDisplayCondition : undefined
  24026. * });
  24027. * @example
  24028. * // Example 2: Specify only the label's cartographic position,
  24029. * // text, and font.
  24030. * const l = labels.add({
  24031. * position : Cesium.Cartesian3.fromRadians(longitude, latitude, height),
  24032. * text : 'Hello World',
  24033. * font : '24px Helvetica',
  24034. * });
  24035. * @param [options] - A template describing the label's properties as shown in Example 1.
  24036. * @returns The label that was added to the collection.
  24037. */
  24038. add(options?: any): Label;
  24039. /**
  24040. * Removes a label from the collection. Once removed, a label is no longer usable.
  24041. * @example
  24042. * const l = labels.add(...);
  24043. * labels.remove(l); // Returns true
  24044. * @param label - The label to remove.
  24045. * @returns <code>true</code> if the label was removed; <code>false</code> if the label was not found in the collection.
  24046. */
  24047. remove(label: Label): boolean;
  24048. /**
  24049. * Removes all labels from the collection.
  24050. * @example
  24051. * labels.add(...);
  24052. * labels.add(...);
  24053. * labels.removeAll();
  24054. */
  24055. removeAll(): void;
  24056. /**
  24057. * Check whether this collection contains a given label.
  24058. * @param label - The label to check for.
  24059. * @returns true if this collection contains the label, false otherwise.
  24060. */
  24061. contains(label: Label): boolean;
  24062. /**
  24063. * Returns the label in the collection at the specified index. Indices are zero-based
  24064. * and increase as labels are added. Removing a label shifts all labels after
  24065. * it to the left, changing their indices. This function is commonly used with
  24066. * {@link LabelCollection#length} to iterate over all the labels
  24067. * in the collection.
  24068. * @example
  24069. * // Toggle the show property of every label in the collection
  24070. * const len = labels.length;
  24071. * for (let i = 0; i < len; ++i) {
  24072. * const l = billboards.get(i);
  24073. * l.show = !l.show;
  24074. * }
  24075. * @param index - The zero-based index of the billboard.
  24076. * @returns The label at the specified index.
  24077. */
  24078. get(index: number): Label;
  24079. /**
  24080. * Returns true if this object was destroyed; otherwise, false.
  24081. * <br /><br />
  24082. * If this object was destroyed, it should not be used; calling any function other than
  24083. * <code>isDestroyed</code> will result in a {@link DeveloperError} exception.
  24084. * @returns True if this object was destroyed; otherwise, false.
  24085. */
  24086. isDestroyed(): boolean;
  24087. /**
  24088. * Destroys the WebGL resources held by this object. Destroying an object allows for deterministic
  24089. * release of WebGL resources, instead of relying on the garbage collector to destroy this object.
  24090. * <br /><br />
  24091. * Once an object is destroyed, it should not be used; calling any function other than
  24092. * <code>isDestroyed</code> will result in a {@link DeveloperError} exception. Therefore,
  24093. * assign the return value (<code>undefined</code>) to the object as done in the example.
  24094. * @example
  24095. * labels = labels && labels.destroy();
  24096. */
  24097. destroy(): void;
  24098. }
  24099. /**
  24100. * Describes how to draw a label.
  24101. */
  24102. export enum LabelStyle {
  24103. /**
  24104. * Fill the text of the label, but do not outline.
  24105. */
  24106. FILL = 0,
  24107. /**
  24108. * Outline the text of the label, but do not fill.
  24109. */
  24110. OUTLINE = 1,
  24111. /**
  24112. * Fill and outline the text of the label.
  24113. */
  24114. FILL_AND_OUTLINE = 2
  24115. }
  24116. /**
  24117. * Describes how the map will operate in 2D.
  24118. */
  24119. export enum MapMode2D {
  24120. /**
  24121. * The 2D map can be rotated about the z axis.
  24122. */
  24123. ROTATE = 0,
  24124. /**
  24125. * The 2D map can be scrolled infinitely in the horizontal direction.
  24126. */
  24127. INFINITE_SCROLL = 1
  24128. }
  24129. /**
  24130. * A Material defines surface appearance through a combination of diffuse, specular,
  24131. * normal, emission, and alpha components. These values are specified using a
  24132. * JSON schema called Fabric which gets parsed and assembled into glsl shader code
  24133. * behind-the-scenes.
  24134. * <br /><br />
  24135. * <style type="text/css">
  24136. * #materialDescriptions code {
  24137. * font-weight: normal;
  24138. * font-family: Consolas, 'Lucida Console', Monaco, monospace;
  24139. * color: #A35A00;
  24140. * }
  24141. * #materialDescriptions ul, #materialDescriptions ul ul {
  24142. * list-style-type: none;
  24143. * }
  24144. * #materialDescriptions ul ul {
  24145. * margin-bottom: 10px;
  24146. * }
  24147. * #materialDescriptions ul ul li {
  24148. * font-weight: normal;
  24149. * color: #000000;
  24150. * text-indent: -2em;
  24151. * margin-left: 2em;
  24152. * }
  24153. * #materialDescriptions ul li {
  24154. * font-weight: bold;
  24155. * color: #0053CF;
  24156. * }
  24157. * </style>
  24158. *
  24159. * Base material types and their uniforms:
  24160. * <div id='materialDescriptions'>
  24161. * <ul>
  24162. * <li>Color</li>
  24163. * <ul>
  24164. * <li><code>color</code>: rgba color object.</li>
  24165. * </ul>
  24166. * <li>Image</li>
  24167. * <ul>
  24168. * <li><code>image</code>: path to image.</li>
  24169. * <li><code>repeat</code>: Object with x and y values specifying the number of times to repeat the image.</li>
  24170. * </ul>
  24171. * <li>DiffuseMap</li>
  24172. * <ul>
  24173. * <li><code>image</code>: path to image.</li>
  24174. * <li><code>channels</code>: Three character string containing any combination of r, g, b, and a for selecting the desired image channels.</li>
  24175. * <li><code>repeat</code>: Object with x and y values specifying the number of times to repeat the image.</li>
  24176. * </ul>
  24177. * <li>AlphaMap</li>
  24178. * <ul>
  24179. * <li><code>image</code>: path to image.</li>
  24180. * <li><code>channel</code>: One character string containing r, g, b, or a for selecting the desired image channel. </li>
  24181. * <li><code>repeat</code>: Object with x and y values specifying the number of times to repeat the image.</li>
  24182. * </ul>
  24183. * <li>SpecularMap</li>
  24184. * <ul>
  24185. * <li><code>image</code>: path to image.</li>
  24186. * <li><code>channel</code>: One character string containing r, g, b, or a for selecting the desired image channel. </li>
  24187. * <li><code>repeat</code>: Object with x and y values specifying the number of times to repeat the image.</li>
  24188. * </ul>
  24189. * <li>EmissionMap</li>
  24190. * <ul>
  24191. * <li><code>image</code>: path to image.</li>
  24192. * <li><code>channels</code>: Three character string containing any combination of r, g, b, and a for selecting the desired image channels. </li>
  24193. * <li><code>repeat</code>: Object with x and y values specifying the number of times to repeat the image.</li>
  24194. * </ul>
  24195. * <li>BumpMap</li>
  24196. * <ul>
  24197. * <li><code>image</code>: path to image.</li>
  24198. * <li><code>channel</code>: One character string containing r, g, b, or a for selecting the desired image channel. </li>
  24199. * <li><code>repeat</code>: Object with x and y values specifying the number of times to repeat the image.</li>
  24200. * <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>
  24201. * </ul>
  24202. * <li>NormalMap</li>
  24203. * <ul>
  24204. * <li><code>image</code>: path to image.</li>
  24205. * <li><code>channels</code>: Three character string containing any combination of r, g, b, and a for selecting the desired image channels. </li>
  24206. * <li><code>repeat</code>: Object with x and y values specifying the number of times to repeat the image.</li>
  24207. * <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>
  24208. * </ul>
  24209. * <li>Grid</li>
  24210. * <ul>
  24211. * <li><code>color</code>: rgba color object for the whole material.</li>
  24212. * <li><code>cellAlpha</code>: Alpha value for the cells between grid lines. This will be combined with color.alpha.</li>
  24213. * <li><code>lineCount</code>: Object with x and y values specifying the number of columns and rows respectively.</li>
  24214. * <li><code>lineThickness</code>: Object with x and y values specifying the thickness of grid lines (in pixels where available).</li>
  24215. * <li><code>lineOffset</code>: Object with x and y values specifying the offset of grid lines (range is 0 to 1).</li>
  24216. * </ul>
  24217. * <li>Stripe</li>
  24218. * <ul>
  24219. * <li><code>horizontal</code>: Boolean that determines if the stripes are horizontal or vertical.</li>
  24220. * <li><code>evenColor</code>: rgba color object for the stripe's first color.</li>
  24221. * <li><code>oddColor</code>: rgba color object for the stripe's second color.</li>
  24222. * <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>
  24223. * <li><code>repeat</code>: Number that controls the total number of stripes, half light and half dark.</li>
  24224. * </ul>
  24225. * <li>Checkerboard</li>
  24226. * <ul>
  24227. * <li><code>lightColor</code>: rgba color object for the checkerboard's light alternating color.</li>
  24228. * <li><code>darkColor</code>: rgba color object for the checkerboard's dark alternating color.</li>
  24229. * <li><code>repeat</code>: Object with x and y values specifying the number of columns and rows respectively.</li>
  24230. * </ul>
  24231. * <li>Dot</li>
  24232. * <ul>
  24233. * <li><code>lightColor</code>: rgba color object for the dot color.</li>
  24234. * <li><code>darkColor</code>: rgba color object for the background color.</li>
  24235. * <li><code>repeat</code>: Object with x and y values specifying the number of columns and rows of dots respectively.</li>
  24236. * </ul>
  24237. * <li>Water</li>
  24238. * <ul>
  24239. * <li><code>baseWaterColor</code>: rgba color object base color of the water.</li>
  24240. * <li><code>blendColor</code>: rgba color object used when blending from water to non-water areas.</li>
  24241. * <li><code>specularMap</code>: Single channel texture used to indicate areas of water.</li>
  24242. * <li><code>normalMap</code>: Normal map for water normal perturbation.</li>
  24243. * <li><code>frequency</code>: Number that controls the number of waves.</li>
  24244. * <li><code>animationSpeed</code>: Number that controls the animations speed of the water.</li>
  24245. * <li><code>amplitude</code>: Number that controls the amplitude of water waves.</li>
  24246. * <li><code>specularIntensity</code>: Number that controls the intensity of specular reflections.</li>
  24247. * </ul>
  24248. * <li>RimLighting</li>
  24249. * <ul>
  24250. * <li><code>color</code>: diffuse color and alpha.</li>
  24251. * <li><code>rimColor</code>: diffuse color and alpha of the rim.</li>
  24252. * <li><code>width</code>: Number that determines the rim's width.</li>
  24253. * </ul>
  24254. * <li>Fade</li>
  24255. * <ul>
  24256. * <li><code>fadeInColor</code>: diffuse color and alpha at <code>time</code></li>
  24257. * <li><code>fadeOutColor</code>: diffuse color and alpha at <code>maximumDistance</code> from <code>time</code></li>
  24258. * <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>
  24259. * <li><code>repeat</code>: true if the fade should wrap around the texture coodinates.</li>
  24260. * <li><code>fadeDirection</code>: Object with x and y values specifying if the fade should be in the x and y directions.</li>
  24261. * <li><code>time</code>: Object with x and y values between 0.0 and 1.0 of the <code>fadeInColor</code> position</li>
  24262. * </ul>
  24263. * <li>PolylineArrow</li>
  24264. * <ul>
  24265. * <li><code>color</code>: diffuse color and alpha.</li>
  24266. * </ul>
  24267. * <li>PolylineDash</li>
  24268. * <ul>
  24269. * <li><code>color</code>: color for the line.</li>
  24270. * <li><code>gapColor</code>: color for the gaps in the line.</li>
  24271. * <li><code>dashLength</code>: Dash length in pixels.</li>
  24272. * <li><code>dashPattern</code>: The 16 bit stipple pattern for the line..</li>
  24273. * </ul>
  24274. * <li>PolylineGlow</li>
  24275. * <ul>
  24276. * <li><code>color</code>: color and maximum alpha for the glow on the line.</li>
  24277. * <li><code>glowPower</code>: strength of the glow, as a percentage of the total line width (less than 1.0).</li>
  24278. * <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>
  24279. * </ul>
  24280. * <li>PolylineOutline</li>
  24281. * <ul>
  24282. * <li><code>color</code>: diffuse color and alpha for the interior of the line.</li>
  24283. * <li><code>outlineColor</code>: diffuse color and alpha for the outline.</li>
  24284. * <li><code>outlineWidth</code>: width of the outline in pixels.</li>
  24285. * </ul>
  24286. * <li>ElevationContour</li>
  24287. * <ul>
  24288. * <li><code>color</code>: color and alpha for the contour line.</li>
  24289. * <li><code>spacing</code>: spacing for contour lines in meters.</li>
  24290. * <li><code>width</code>: Number specifying the width of the grid lines in pixels.</li>
  24291. * </ul>
  24292. * <li>ElevationRamp</li>
  24293. * <ul>
  24294. * <li><code>image</code>: color ramp image to use for coloring the terrain.</li>
  24295. * <li><code>minimumHeight</code>: minimum height for the ramp.</li>
  24296. * <li><code>maximumHeight</code>: maximum height for the ramp.</li>
  24297. * </ul>
  24298. * <li>SlopeRamp</li>
  24299. * <ul>
  24300. * <li><code>image</code>: color ramp image to use for coloring the terrain by slope.</li>
  24301. * </ul>
  24302. * <li>AspectRamp</li>
  24303. * <ul>
  24304. * <li><code>image</code>: color ramp image to use for color the terrain by aspect.</li>
  24305. * </ul>
  24306. * <li>ElevationBand</li>
  24307. * <ul>
  24308. * <li><code>heights</code>: image of heights sorted from lowest to highest.</li>
  24309. * <li><code>colors</code>: image of colors at the corresponding heights.</li>
  24310. * </ul>
  24311. * </ul>
  24312. * </ul>
  24313. * </div>
  24314. * @example
  24315. * // Create a color material with fromType:
  24316. * polygon.material = Cesium.Material.fromType('Color');
  24317. * polygon.material.uniforms.color = new Cesium.Color(1.0, 1.0, 0.0, 1.0);
  24318. *
  24319. * // Create the default material:
  24320. * polygon.material = new Cesium.Material();
  24321. *
  24322. * // Create a color material with full Fabric notation:
  24323. * polygon.material = new Cesium.Material({
  24324. * fabric : {
  24325. * type : 'Color',
  24326. * uniforms : {
  24327. * color : new Cesium.Color(1.0, 1.0, 0.0, 1.0)
  24328. * }
  24329. * }
  24330. * });
  24331. * @param [options] - Object with the following properties:
  24332. * @param [options.strict = false] - Throws errors for issues that would normally be ignored, including unused uniforms or materials.
  24333. * @param [options.translucent = true] - When <code>true</code> or a function that returns <code>true</code>, the geometry
  24334. * with this material is expected to appear translucent.
  24335. * @param [options.minificationFilter = TextureMinificationFilter.LINEAR] - The {@link TextureMinificationFilter} to apply to this material's textures.
  24336. * @param [options.magnificationFilter = TextureMagnificationFilter.LINEAR] - The {@link TextureMagnificationFilter} to apply to this material's textures.
  24337. * @param options.fabric - The fabric JSON used to generate the material.
  24338. */
  24339. export class Material {
  24340. constructor(options?: {
  24341. strict?: boolean;
  24342. translucent?: boolean | ((...params: any[]) => any);
  24343. minificationFilter?: TextureMinificationFilter;
  24344. magnificationFilter?: TextureMagnificationFilter;
  24345. fabric: any;
  24346. });
  24347. /**
  24348. * The material type. Can be an existing type or a new type. If no type is specified in fabric, type is a GUID.
  24349. */
  24350. type: string;
  24351. /**
  24352. * The glsl shader source for this material.
  24353. */
  24354. shaderSource: string;
  24355. /**
  24356. * Maps sub-material names to Material objects.
  24357. */
  24358. materials: any;
  24359. /**
  24360. * Maps uniform names to their values.
  24361. */
  24362. uniforms: any;
  24363. /**
  24364. * When <code>true</code> or a function that returns <code>true</code>,
  24365. * the geometry is expected to appear translucent.
  24366. */
  24367. translucent: boolean | ((...params: any[]) => any);
  24368. /**
  24369. * Creates a new material using an existing material type.
  24370. * <br /><br />
  24371. * Shorthand for: new Material({fabric : {type : type}});
  24372. * @example
  24373. * const material = Cesium.Material.fromType('Color', {
  24374. * color : new Cesium.Color(1.0, 0.0, 0.0, 1.0)
  24375. * });
  24376. * @param type - The base material type.
  24377. * @param [uniforms] - Overrides for the default uniforms.
  24378. * @returns New material object.
  24379. */
  24380. fromType(type: string, uniforms?: any): Material;
  24381. /**
  24382. * Gets whether or not this material is translucent.
  24383. * @returns <code>true</code> if this material is translucent, <code>false</code> otherwise.
  24384. */
  24385. isTranslucent(): boolean;
  24386. /**
  24387. * Returns true if this object was destroyed; otherwise, false.
  24388. * <br /><br />
  24389. * If this object was destroyed, it should not be used; calling any function other than
  24390. * <code>isDestroyed</code> will result in a {@link DeveloperError} exception.
  24391. * @returns True if this object was destroyed; otherwise, false.
  24392. */
  24393. isDestroyed(): boolean;
  24394. /**
  24395. * Destroys the WebGL resources held by this object. Destroying an object allows for deterministic
  24396. * release of WebGL resources, instead of relying on the garbage collector to destroy this object.
  24397. * <br /><br />
  24398. * Once an object is destroyed, it should not be used; calling any function other than
  24399. * <code>isDestroyed</code> will result in a {@link DeveloperError} exception. Therefore,
  24400. * assign the return value (<code>undefined</code>) to the object as done in the example.
  24401. * @example
  24402. * material = material && material.destroy();
  24403. */
  24404. destroy(): void;
  24405. /**
  24406. * Gets or sets the default texture uniform value.
  24407. */
  24408. DefaultImageId: string;
  24409. /**
  24410. * Gets or sets the default cube map texture uniform value.
  24411. */
  24412. DefaultCubeMapId: string;
  24413. /**
  24414. * Gets the name of the color material.
  24415. */
  24416. readonly ColorType: string;
  24417. /**
  24418. * Gets the name of the image material.
  24419. */
  24420. readonly ImageType: string;
  24421. /**
  24422. * Gets the name of the diffuce map material.
  24423. */
  24424. readonly DiffuseMapType: string;
  24425. /**
  24426. * Gets the name of the alpha map material.
  24427. */
  24428. readonly AlphaMapType: string;
  24429. /**
  24430. * Gets the name of the specular map material.
  24431. */
  24432. readonly SpecularMapType: string;
  24433. /**
  24434. * Gets the name of the emmision map material.
  24435. */
  24436. readonly EmissionMapType: string;
  24437. /**
  24438. * Gets the name of the bump map material.
  24439. */
  24440. readonly BumpMapType: string;
  24441. /**
  24442. * Gets the name of the normal map material.
  24443. */
  24444. readonly NormalMapType: string;
  24445. /**
  24446. * Gets the name of the grid material.
  24447. */
  24448. readonly GridType: string;
  24449. /**
  24450. * Gets the name of the stripe material.
  24451. */
  24452. readonly StripeType: string;
  24453. /**
  24454. * Gets the name of the checkerboard material.
  24455. */
  24456. readonly CheckerboardType: string;
  24457. /**
  24458. * Gets the name of the dot material.
  24459. */
  24460. readonly DotType: string;
  24461. /**
  24462. * Gets the name of the water material.
  24463. */
  24464. readonly WaterType: string;
  24465. /**
  24466. * Gets the name of the rim lighting material.
  24467. */
  24468. readonly RimLightingType: string;
  24469. /**
  24470. * Gets the name of the fade material.
  24471. */
  24472. readonly FadeType: string;
  24473. /**
  24474. * Gets the name of the polyline arrow material.
  24475. */
  24476. readonly PolylineArrowType: string;
  24477. /**
  24478. * Gets the name of the polyline glow material.
  24479. */
  24480. readonly PolylineDashType: string;
  24481. /**
  24482. * Gets the name of the polyline glow material.
  24483. */
  24484. readonly PolylineGlowType: string;
  24485. /**
  24486. * Gets the name of the polyline outline material.
  24487. */
  24488. readonly PolylineOutlineType: string;
  24489. /**
  24490. * Gets the name of the elevation contour material.
  24491. */
  24492. readonly ElevationContourType: string;
  24493. /**
  24494. * Gets the name of the elevation contour material.
  24495. */
  24496. readonly ElevationRampType: string;
  24497. /**
  24498. * Gets the name of the slope ramp material.
  24499. */
  24500. readonly SlopeRampMaterialType: string;
  24501. /**
  24502. * Gets the name of the aspect ramp material.
  24503. */
  24504. readonly AspectRampMaterialType: string;
  24505. /**
  24506. * Gets the name of the elevation band material.
  24507. */
  24508. readonly ElevationBandType: string;
  24509. }
  24510. /**
  24511. * An appearance for arbitrary geometry (as opposed to {@link EllipsoidSurfaceAppearance}, for example)
  24512. * that supports shading with materials.
  24513. * @example
  24514. * const primitive = new Cesium.Primitive({
  24515. * geometryInstances : new Cesium.GeometryInstance({
  24516. * geometry : new Cesium.WallGeometry({
  24517. * materialSupport : Cesium.MaterialAppearance.MaterialSupport.BASIC.vertexFormat,
  24518. * // ...
  24519. * })
  24520. * }),
  24521. * appearance : new Cesium.MaterialAppearance({
  24522. * material : Cesium.Material.fromType('Color'),
  24523. * faceForward : true
  24524. * })
  24525. *
  24526. * });
  24527. * @param [options] - Object with the following properties:
  24528. * @param [options.flat = false] - When <code>true</code>, flat shading is used in the fragment shader, which means lighting is not taking into account.
  24529. * @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}.
  24530. * @param [options.translucent = true] - When <code>true</code>, the geometry is expected to appear translucent so {@link MaterialAppearance#renderState} has alpha blending enabled.
  24531. * @param [options.closed = false] - When <code>true</code>, the geometry is expected to be closed so {@link MaterialAppearance#renderState} has backface culling enabled.
  24532. * @param [options.materialSupport = MaterialAppearance.MaterialSupport.TEXTURED] - The type of materials that will be supported.
  24533. * @param [options.material = Material.ColorType] - The material used to determine the fragment color.
  24534. * @param [options.vertexShaderSource] - Optional GLSL vertex shader source to override the default vertex shader.
  24535. * @param [options.fragmentShaderSource] - Optional GLSL fragment shader source to override the default fragment shader.
  24536. * @param [options.renderState] - Optional render state to override the default render state.
  24537. */
  24538. export class MaterialAppearance {
  24539. constructor(options?: {
  24540. flat?: boolean;
  24541. faceForward?: boolean;
  24542. translucent?: boolean;
  24543. closed?: boolean;
  24544. materialSupport?: MaterialAppearance.MaterialSupportType;
  24545. material?: Material;
  24546. vertexShaderSource?: string;
  24547. fragmentShaderSource?: string;
  24548. renderState?: any;
  24549. });
  24550. /**
  24551. * The material used to determine the fragment color. Unlike other {@link MaterialAppearance}
  24552. * properties, this is not read-only, so an appearance's material can change on the fly.
  24553. */
  24554. material: Material;
  24555. /**
  24556. * When <code>true</code>, the geometry is expected to appear translucent.
  24557. */
  24558. translucent: boolean;
  24559. /**
  24560. * The GLSL source code for the vertex shader.
  24561. */
  24562. readonly vertexShaderSource: string;
  24563. /**
  24564. * The GLSL source code for the fragment shader. The full fragment shader
  24565. * source is built procedurally taking into account {@link MaterialAppearance#material},
  24566. * {@link MaterialAppearance#flat}, and {@link MaterialAppearance#faceForward}.
  24567. * Use {@link MaterialAppearance#getFragmentShaderSource} to get the full source.
  24568. */
  24569. readonly fragmentShaderSource: string;
  24570. /**
  24571. * The WebGL fixed-function state to use when rendering the geometry.
  24572. * <p>
  24573. * The render state can be explicitly defined when constructing a {@link MaterialAppearance}
  24574. * instance, or it is set implicitly via {@link MaterialAppearance#translucent}
  24575. * and {@link MaterialAppearance#closed}.
  24576. * </p>
  24577. */
  24578. readonly renderState: any;
  24579. /**
  24580. * When <code>true</code>, the geometry is expected to be closed so
  24581. * {@link MaterialAppearance#renderState} has backface culling enabled.
  24582. * If the viewer enters the geometry, it will not be visible.
  24583. */
  24584. readonly closed: boolean;
  24585. /**
  24586. * The type of materials supported by this instance. This impacts the required
  24587. * {@link VertexFormat} and the complexity of the vertex and fragment shaders.
  24588. */
  24589. readonly materialSupport: MaterialAppearance.MaterialSupportType;
  24590. /**
  24591. * The {@link VertexFormat} that this appearance instance is compatible with.
  24592. * A geometry can have more vertex attributes and still be compatible - at a
  24593. * potential performance cost - but it can't have less.
  24594. */
  24595. readonly vertexFormat: VertexFormat;
  24596. /**
  24597. * When <code>true</code>, flat shading is used in the fragment shader,
  24598. * which means lighting is not taking into account.
  24599. */
  24600. readonly flat: boolean;
  24601. /**
  24602. * When <code>true</code>, the fragment shader flips the surface normal
  24603. * as needed to ensure that the normal faces the viewer to avoid
  24604. * dark spots. This is useful when both sides of a geometry should be
  24605. * shaded like {@link WallGeometry}.
  24606. */
  24607. readonly faceForward: boolean;
  24608. /**
  24609. * Procedurally creates the full GLSL fragment shader source. For {@link MaterialAppearance},
  24610. * this is derived from {@link MaterialAppearance#fragmentShaderSource}, {@link MaterialAppearance#material},
  24611. * {@link MaterialAppearance#flat}, and {@link MaterialAppearance#faceForward}.
  24612. * @returns The full GLSL fragment shader source.
  24613. */
  24614. getFragmentShaderSource(): string;
  24615. /**
  24616. * Determines if the geometry is translucent based on {@link MaterialAppearance#translucent} and {@link Material#isTranslucent}.
  24617. * @returns <code>true</code> if the appearance is translucent.
  24618. */
  24619. isTranslucent(): boolean;
  24620. /**
  24621. * Creates a render state. This is not the final render state instance; instead,
  24622. * it can contain a subset of render state properties identical to the render state
  24623. * created in the context.
  24624. * @returns The render state.
  24625. */
  24626. getRenderState(): any;
  24627. }
  24628. export namespace MaterialAppearance {
  24629. type MaterialSupportType = {
  24630. vertexFormat: VertexFormat;
  24631. vertexShaderSource: string;
  24632. fragmentShaderSource: string;
  24633. };
  24634. /**
  24635. * Determines the type of {@link Material} that is supported by a
  24636. * {@link MaterialAppearance} instance. This is a trade-off between
  24637. * flexibility (a wide array of materials) and memory/performance
  24638. * (required vertex format and GLSL shader complexity.
  24639. */
  24640. namespace MaterialSupport {
  24641. /**
  24642. * Only basic materials, which require just <code>position</code> and
  24643. * <code>normal</code> vertex attributes, are supported.
  24644. */
  24645. const BASIC: MaterialAppearance.MaterialSupportType;
  24646. /**
  24647. * Materials with textures, which require <code>position</code>,
  24648. * <code>normal</code>, and <code>st</code> vertex attributes,
  24649. * are supported. The vast majority of materials fall into this category.
  24650. */
  24651. const TEXTURED: MaterialAppearance.MaterialSupportType;
  24652. /**
  24653. * All materials, including those that work in tangent space, are supported.
  24654. * This requires <code>position</code>, <code>normal</code>, <code>st</code>,
  24655. * <code>tangent</code>, and <code>bitangent</code> vertex attributes.
  24656. */
  24657. const ALL: MaterialAppearance.MaterialSupportType;
  24658. }
  24659. }
  24660. /**
  24661. * Draws the Moon in 3D.
  24662. * @example
  24663. * scene.moon = new Cesium.Moon();
  24664. * @param [options] - Object with the following properties:
  24665. * @param [options.show = true] - Determines whether the moon will be rendered.
  24666. * @param [options.textureUrl = buildModuleUrl('Assets/Textures/moonSmall.jpg')] - The moon texture.
  24667. * @param [options.ellipsoid = Ellipsoid.MOON] - The moon ellipsoid.
  24668. * @param [options.onlySunLighting = true] - Use the sun as the only light source.
  24669. */
  24670. export class Moon {
  24671. constructor(options?: {
  24672. show?: boolean;
  24673. textureUrl?: string;
  24674. ellipsoid?: Ellipsoid;
  24675. onlySunLighting?: boolean;
  24676. });
  24677. /**
  24678. * Determines if the moon will be shown.
  24679. */
  24680. show: boolean;
  24681. /**
  24682. * The moon texture.
  24683. */
  24684. textureUrl: string;
  24685. /**
  24686. * Use the sun as the only light source.
  24687. */
  24688. onlySunLighting: boolean;
  24689. /**
  24690. * Get the ellipsoid that defines the shape of the moon.
  24691. */
  24692. readonly ellipsoid: Ellipsoid;
  24693. /**
  24694. * Returns true if this object was destroyed; otherwise, false.
  24695. * <br /><br />
  24696. * If this object was destroyed, it should not be used; calling any function other than
  24697. * <code>isDestroyed</code> will result in a {@link DeveloperError} exception.
  24698. * @returns <code>true</code> if this object was destroyed; otherwise, <code>false</code>.
  24699. */
  24700. isDestroyed(): boolean;
  24701. /**
  24702. * Destroys the WebGL resources held by this object. Destroying an object allows for deterministic
  24703. * release of WebGL resources, instead of relying on the garbage collector to destroy this object.
  24704. * <br /><br />
  24705. * Once an object is destroyed, it should not be used; calling any function other than
  24706. * <code>isDestroyed</code> will result in a {@link DeveloperError} exception. Therefore,
  24707. * assign the return value (<code>undefined</code>) to the object as done in the example.
  24708. * @example
  24709. * moon = moon && moon.destroy();
  24710. */
  24711. destroy(): void;
  24712. }
  24713. /**
  24714. * A particle emitted by a {@link ParticleSystem}.
  24715. * @param options - An object with the following properties:
  24716. * @param [options.mass = 1.0] - The mass of the particle in kilograms.
  24717. * @param [options.position = Cartesian3.ZERO] - The initial position of the particle in world coordinates.
  24718. * @param [options.velocity = Cartesian3.ZERO] - The velocity vector of the particle in world coordinates.
  24719. * @param [options.life = Number.MAX_VALUE] - The life of the particle in seconds.
  24720. * @param [options.image] - The URI, HTMLImageElement, or HTMLCanvasElement to use for the billboard.
  24721. * @param [options.startColor = Color.WHITE] - The color of a particle when it is born.
  24722. * @param [options.endColor = Color.WHITE] - The color of a particle when it dies.
  24723. * @param [options.startScale = 1.0] - The scale of the particle when it is born.
  24724. * @param [options.endScale = 1.0] - The scale of the particle when it dies.
  24725. * @param [options.imageSize = new Cartesian2(1.0, 1.0)] - The dimensions, width by height, to scale the particle image in pixels.
  24726. */
  24727. export class Particle {
  24728. constructor(options: {
  24729. mass?: number;
  24730. position?: Cartesian3;
  24731. velocity?: Cartesian3;
  24732. life?: number;
  24733. image?: any;
  24734. startColor?: Color;
  24735. endColor?: Color;
  24736. startScale?: number;
  24737. endScale?: number;
  24738. imageSize?: Cartesian2;
  24739. });
  24740. /**
  24741. * The mass of the particle in kilograms.
  24742. */
  24743. mass: number;
  24744. /**
  24745. * The positon of the particle in world coordinates.
  24746. */
  24747. position: Cartesian3;
  24748. /**
  24749. * The velocity of the particle in world coordinates.
  24750. */
  24751. velocity: Cartesian3;
  24752. /**
  24753. * The life of the particle in seconds.
  24754. */
  24755. life: number;
  24756. /**
  24757. * The image to use for the particle.
  24758. */
  24759. image: any;
  24760. /**
  24761. * The color of the particle when it is born.
  24762. */
  24763. startColor: Color;
  24764. /**
  24765. * The color of the particle when it dies.
  24766. */
  24767. endColor: Color;
  24768. /**
  24769. * the scale of the particle when it is born.
  24770. */
  24771. startScale: number;
  24772. /**
  24773. * The scale of the particle when it dies.
  24774. */
  24775. endScale: number;
  24776. /**
  24777. * The dimensions, width by height, to scale the particle image in pixels.
  24778. */
  24779. imageSize: Cartesian2;
  24780. /**
  24781. * Gets the age of the particle in seconds.
  24782. */
  24783. age: number;
  24784. /**
  24785. * Gets the age normalized to a value in the range [0.0, 1.0].
  24786. */
  24787. normalizedAge: number;
  24788. }
  24789. /**
  24790. * A ParticleSystem manages the updating and display of a collection of particles.
  24791. * @param [options] - Object with the following properties:
  24792. * @param [options.show = true] - Whether to display the particle system.
  24793. * @param [options.updateCallback] - The callback function to be called each frame to update a particle.
  24794. * @param [options.emitter = new CircleEmitter(0.5)] - The particle emitter for this system.
  24795. * @param [options.modelMatrix = Matrix4.IDENTITY] - The 4x4 transformation matrix that transforms the particle system from model to world coordinates.
  24796. * @param [options.emitterModelMatrix = Matrix4.IDENTITY] - The 4x4 transformation matrix that transforms the particle system emitter within the particle systems local coordinate system.
  24797. * @param [options.emissionRate = 5] - The number of particles to emit per second.
  24798. * @param [options.bursts] - An array of {@link ParticleBurst}, emitting bursts of particles at periodic times.
  24799. * @param [options.loop = true] - Whether the particle system should loop its bursts when it is complete.
  24800. * @param [options.scale = 1.0] - Sets the scale to apply to the image of the particle for the duration of its particleLife.
  24801. * @param [options.startScale] - The initial scale to apply to the image of the particle at the beginning of its life.
  24802. * @param [options.endScale] - The final scale to apply to the image of the particle at the end of its life.
  24803. * @param [options.color = Color.WHITE] - Sets the color of a particle for the duration of its particleLife.
  24804. * @param [options.startColor] - The color of the particle at the beginning of its life.
  24805. * @param [options.endColor] - The color of the particle at the end of its life.
  24806. * @param [options.image] - The URI, HTMLImageElement, or HTMLCanvasElement to use for the billboard.
  24807. * @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.
  24808. * @param [options.minimumImageSize] - Sets the minimum bound, width by height, above which to randomly scale the particle image's dimensions in pixels.
  24809. * @param [options.maximumImageSize] - Sets the maximum bound, width by height, below which to randomly scale the particle image's dimensions in pixels.
  24810. * @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.
  24811. * @param [options.speed = 1.0] - If set, overrides the minimumSpeed and maximumSpeed inputs with this value.
  24812. * @param [options.minimumSpeed] - Sets the minimum bound in meters per second above which a particle's actual speed will be randomly chosen.
  24813. * @param [options.maximumSpeed] - Sets the maximum bound in meters per second below which a particle's actual speed will be randomly chosen.
  24814. * @param [options.lifetime = Number.MAX_VALUE] - How long the particle system will emit particles, in seconds.
  24815. * @param [options.particleLife = 5.0] - If set, overrides the minimumParticleLife and maximumParticleLife inputs with this value.
  24816. * @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.
  24817. * @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.
  24818. * @param [options.mass = 1.0] - Sets the minimum and maximum mass of particles in kilograms.
  24819. * @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.
  24820. * @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.
  24821. */
  24822. export class ParticleSystem {
  24823. constructor(options?: {
  24824. show?: boolean;
  24825. updateCallback?: ParticleSystem.updateCallback;
  24826. emitter?: ParticleEmitter;
  24827. modelMatrix?: Matrix4;
  24828. emitterModelMatrix?: Matrix4;
  24829. emissionRate?: number;
  24830. bursts?: ParticleBurst[];
  24831. loop?: boolean;
  24832. scale?: number;
  24833. startScale?: number;
  24834. endScale?: number;
  24835. color?: Color;
  24836. startColor?: Color;
  24837. endColor?: Color;
  24838. image?: any;
  24839. imageSize?: Cartesian2;
  24840. minimumImageSize?: Cartesian2;
  24841. maximumImageSize?: Cartesian2;
  24842. sizeInMeters?: boolean;
  24843. speed?: number;
  24844. minimumSpeed?: number;
  24845. maximumSpeed?: number;
  24846. lifetime?: number;
  24847. particleLife?: number;
  24848. minimumParticleLife?: number;
  24849. maximumParticleLife?: number;
  24850. mass?: number;
  24851. minimumMass?: number;
  24852. maximumMass?: number;
  24853. });
  24854. /**
  24855. * Whether to display the particle system.
  24856. */
  24857. show: boolean;
  24858. /**
  24859. * An array of force callbacks. The callback is passed a {@link Particle} and the difference from the last time
  24860. */
  24861. updateCallback: ParticleSystem.updateCallback;
  24862. /**
  24863. * Whether the particle system should loop it's bursts when it is complete.
  24864. */
  24865. loop: boolean;
  24866. /**
  24867. * The URI, HTMLImageElement, or HTMLCanvasElement to use for the billboard.
  24868. */
  24869. image: any;
  24870. /**
  24871. * The particle emitter for this
  24872. */
  24873. emitter: ParticleEmitter;
  24874. /**
  24875. * An array of {@link ParticleBurst}, emitting bursts of particles at periodic times.
  24876. */
  24877. bursts: ParticleBurst[];
  24878. /**
  24879. * The 4x4 transformation matrix that transforms the particle system from model to world coordinates.
  24880. */
  24881. modelMatrix: Matrix4;
  24882. /**
  24883. * The 4x4 transformation matrix that transforms the particle system emitter within the particle systems local coordinate system.
  24884. */
  24885. emitterModelMatrix: Matrix4;
  24886. /**
  24887. * The color of the particle at the beginning of its life.
  24888. */
  24889. startColor: Color;
  24890. /**
  24891. * The color of the particle at the end of its life.
  24892. */
  24893. endColor: Color;
  24894. /**
  24895. * The initial scale to apply to the image of the particle at the beginning of its life.
  24896. */
  24897. startScale: number;
  24898. /**
  24899. * The final scale to apply to the image of the particle at the end of its life.
  24900. */
  24901. endScale: number;
  24902. /**
  24903. * The number of particles to emit per second.
  24904. */
  24905. emissionRate: number;
  24906. /**
  24907. * Sets the minimum bound in meters per second above which a particle's actual speed will be randomly chosen.
  24908. */
  24909. minimumSpeed: number;
  24910. /**
  24911. * Sets the maximum bound in meters per second below which a particle's actual speed will be randomly chosen.
  24912. */
  24913. maximumSpeed: number;
  24914. /**
  24915. * 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.
  24916. */
  24917. minimumParticleLife: number;
  24918. /**
  24919. * 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.
  24920. */
  24921. maximumParticleLife: number;
  24922. /**
  24923. * Sets the minimum mass of particles in kilograms.
  24924. */
  24925. minimumMass: number;
  24926. /**
  24927. * Sets the maximum mass of particles in kilograms.
  24928. */
  24929. maximumMass: number;
  24930. /**
  24931. * Sets the minimum bound, width by height, above which to randomly scale the particle image's dimensions in pixels.
  24932. */
  24933. minimumImageSize: Cartesian2;
  24934. /**
  24935. * Sets the maximum bound, width by height, below which to randomly scale the particle image's dimensions in pixels.
  24936. */
  24937. maximumImageSize: Cartesian2;
  24938. /**
  24939. * 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.
  24940. */
  24941. sizeInMeters: boolean;
  24942. /**
  24943. * How long the particle system will emit particles, in seconds.
  24944. */
  24945. lifetime: number;
  24946. /**
  24947. * Fires an event when the particle system has reached the end of its lifetime.
  24948. */
  24949. complete: Event;
  24950. /**
  24951. * When <code>true</code>, the particle system has reached the end of its lifetime; <code>false</code> otherwise.
  24952. */
  24953. isComplete: boolean;
  24954. /**
  24955. * Returns true if this object was destroyed; otherwise, false.
  24956. * <br /><br />
  24957. * If this object was destroyed, it should not be used; calling any function other than
  24958. * <code>isDestroyed</code> will result in a {@link DeveloperError} exception.
  24959. * @returns <code>true</code> if this object was destroyed; otherwise, <code>false</code>.
  24960. */
  24961. isDestroyed(): boolean;
  24962. /**
  24963. * Destroys the WebGL resources held by this object. Destroying an object allows for deterministic
  24964. * release of WebGL resources, instead of relying on the garbage collector to destroy this object.
  24965. * <br /><br />
  24966. * Once an object is destroyed, it should not be used; calling any function other than
  24967. * <code>isDestroyed</code> will result in a {@link DeveloperError} exception. Therefore,
  24968. * assign the return value (<code>undefined</code>) to the object as done in the example.
  24969. */
  24970. destroy(): void;
  24971. }
  24972. export namespace ParticleSystem {
  24973. /**
  24974. * A function used to modify attributes of the particle at each time step. This can include force modifications,
  24975. * color, sizing, etc.
  24976. * @example
  24977. * function applyGravity(particle, dt) {
  24978. * const position = particle.position;
  24979. * const gravityVector = Cesium.Cartesian3.normalize(position, new Cesium.Cartesian3());
  24980. * Cesium.Cartesian3.multiplyByScalar(gravityVector, GRAVITATIONAL_CONSTANT * dt, gravityVector);
  24981. * particle.velocity = Cesium.Cartesian3.add(particle.velocity, gravityVector, particle.velocity);
  24982. * }
  24983. * @param particle - The particle being updated.
  24984. * @param dt - The time in seconds since the last update.
  24985. */
  24986. type updateCallback = (particle: Particle, dt: number) => void;
  24987. }
  24988. /**
  24989. * An appearance for {@link GeometryInstance} instances with color attributes.
  24990. * This allows several geometry instances, each with a different color, to
  24991. * be drawn with the same {@link Primitive} as shown in the second example below.
  24992. * @example
  24993. * // A solid white line segment
  24994. * const primitive = new Cesium.Primitive({
  24995. * geometryInstances : new Cesium.GeometryInstance({
  24996. * geometry : new Cesium.SimplePolylineGeometry({
  24997. * positions : Cesium.Cartesian3.fromDegreesArray([
  24998. * 0.0, 0.0,
  24999. * 5.0, 0.0
  25000. * ])
  25001. * }),
  25002. * attributes : {
  25003. * color : Cesium.ColorGeometryInstanceAttribute.fromColor(new Cesium.Color(1.0, 1.0, 1.0, 1.0))
  25004. * }
  25005. * }),
  25006. * appearance : new Cesium.PerInstanceColorAppearance({
  25007. * flat : true,
  25008. * translucent : false
  25009. * })
  25010. * });
  25011. *
  25012. * // Two rectangles in a primitive, each with a different color
  25013. * const instance = new Cesium.GeometryInstance({
  25014. * geometry : new Cesium.RectangleGeometry({
  25015. * rectangle : Cesium.Rectangle.fromDegrees(0.0, 20.0, 10.0, 30.0)
  25016. * }),
  25017. * attributes : {
  25018. * color : new Cesium.ColorGeometryInstanceAttribute(1.0, 0.0, 0.0, 0.5)
  25019. * }
  25020. * });
  25021. *
  25022. * const anotherInstance = new Cesium.GeometryInstance({
  25023. * geometry : new Cesium.RectangleGeometry({
  25024. * rectangle : Cesium.Rectangle.fromDegrees(0.0, 40.0, 10.0, 50.0)
  25025. * }),
  25026. * attributes : {
  25027. * color : new Cesium.ColorGeometryInstanceAttribute(0.0, 0.0, 1.0, 0.5)
  25028. * }
  25029. * });
  25030. *
  25031. * const rectanglePrimitive = new Cesium.Primitive({
  25032. * geometryInstances : [instance, anotherInstance],
  25033. * appearance : new Cesium.PerInstanceColorAppearance()
  25034. * });
  25035. * @param [options] - Object with the following properties:
  25036. * @param [options.flat = false] - When <code>true</code>, flat shading is used in the fragment shader, which means lighting is not taking into account.
  25037. * @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}.
  25038. * @param [options.translucent = true] - When <code>true</code>, the geometry is expected to appear translucent so {@link PerInstanceColorAppearance#renderState} has alpha blending enabled.
  25039. * @param [options.closed = false] - When <code>true</code>, the geometry is expected to be closed so {@link PerInstanceColorAppearance#renderState} has backface culling enabled.
  25040. * @param [options.vertexShaderSource] - Optional GLSL vertex shader source to override the default vertex shader.
  25041. * @param [options.fragmentShaderSource] - Optional GLSL fragment shader source to override the default fragment shader.
  25042. * @param [options.renderState] - Optional render state to override the default render state.
  25043. */
  25044. export class PerInstanceColorAppearance {
  25045. constructor(options?: {
  25046. flat?: boolean;
  25047. faceForward?: boolean;
  25048. translucent?: boolean;
  25049. closed?: boolean;
  25050. vertexShaderSource?: string;
  25051. fragmentShaderSource?: string;
  25052. renderState?: any;
  25053. });
  25054. /**
  25055. * This property is part of the {@link Appearance} interface, but is not
  25056. * used by {@link PerInstanceColorAppearance} since a fully custom fragment shader is used.
  25057. */
  25058. material: Material;
  25059. /**
  25060. * When <code>true</code>, the geometry is expected to appear translucent so
  25061. * {@link PerInstanceColorAppearance#renderState} has alpha blending enabled.
  25062. */
  25063. translucent: boolean;
  25064. /**
  25065. * The GLSL source code for the vertex shader.
  25066. */
  25067. readonly vertexShaderSource: string;
  25068. /**
  25069. * The GLSL source code for the fragment shader.
  25070. */
  25071. readonly fragmentShaderSource: string;
  25072. /**
  25073. * The WebGL fixed-function state to use when rendering the geometry.
  25074. * <p>
  25075. * The render state can be explicitly defined when constructing a {@link PerInstanceColorAppearance}
  25076. * instance, or it is set implicitly via {@link PerInstanceColorAppearance#translucent}
  25077. * and {@link PerInstanceColorAppearance#closed}.
  25078. * </p>
  25079. */
  25080. readonly renderState: any;
  25081. /**
  25082. * When <code>true</code>, the geometry is expected to be closed so
  25083. * {@link PerInstanceColorAppearance#renderState} has backface culling enabled.
  25084. * If the viewer enters the geometry, it will not be visible.
  25085. */
  25086. readonly closed: boolean;
  25087. /**
  25088. * The {@link VertexFormat} that this appearance instance is compatible with.
  25089. * A geometry can have more vertex attributes and still be compatible - at a
  25090. * potential performance cost - but it can't have less.
  25091. */
  25092. readonly vertexFormat: VertexFormat;
  25093. /**
  25094. * When <code>true</code>, flat shading is used in the fragment shader,
  25095. * which means lighting is not taking into account.
  25096. */
  25097. readonly flat: boolean;
  25098. /**
  25099. * When <code>true</code>, the fragment shader flips the surface normal
  25100. * as needed to ensure that the normal faces the viewer to avoid
  25101. * dark spots. This is useful when both sides of a geometry should be
  25102. * shaded like {@link WallGeometry}.
  25103. */
  25104. readonly faceForward: boolean;
  25105. /**
  25106. * The {@link VertexFormat} that all {@link PerInstanceColorAppearance} instances
  25107. * are compatible with. This requires only <code>position</code> and <code>normal</code>
  25108. * attributes.
  25109. */
  25110. readonly VERTEX_FORMAT: VertexFormat;
  25111. /**
  25112. * The {@link VertexFormat} that all {@link PerInstanceColorAppearance} instances
  25113. * are compatible with when {@link PerInstanceColorAppearance#flat} is <code>true</code>.
  25114. * This requires only a <code>position</code> attribute.
  25115. */
  25116. readonly FLAT_VERTEX_FORMAT: VertexFormat;
  25117. /**
  25118. * Procedurally creates the full GLSL fragment shader source. For {@link PerInstanceColorAppearance},
  25119. * this is derived from {@link PerInstanceColorAppearance#fragmentShaderSource}, {@link PerInstanceColorAppearance#flat},
  25120. * and {@link PerInstanceColorAppearance#faceForward}.
  25121. * @returns The full GLSL fragment shader source.
  25122. */
  25123. getFragmentShaderSource(): string;
  25124. /**
  25125. * Determines if the geometry is translucent based on {@link PerInstanceColorAppearance#translucent}.
  25126. * @returns <code>true</code> if the appearance is translucent.
  25127. */
  25128. isTranslucent(): boolean;
  25129. /**
  25130. * Creates a render state. This is not the final render state instance; instead,
  25131. * it can contain a subset of render state properties identical to the render state
  25132. * created in the context.
  25133. * @returns The render state.
  25134. */
  25135. getRenderState(): any;
  25136. }
  25137. /**
  25138. * Options for performing point attenuation based on geometric error when rendering
  25139. * point clouds using 3D Tiles.
  25140. * @param [options] - Object with the following properties:
  25141. * @param [options.attenuation = false] - Perform point attenuation based on geometric error.
  25142. * @param [options.geometricErrorScale = 1.0] - Scale to be applied to each tile's geometric error.
  25143. * @param [options.maximumAttenuation] - Maximum attenuation in pixels. Defaults to the Cesium3DTileset's maximumScreenSpaceError.
  25144. * @param [options.baseResolution] - Average base resolution for the dataset in meters. Substitute for Geometric Error when not available.
  25145. * @param [options.eyeDomeLighting = true] - When true, use eye dome lighting when drawing with point attenuation.
  25146. * @param [options.eyeDomeLightingStrength = 1.0] - Increasing this value increases contrast on slopes and edges.
  25147. * @param [options.eyeDomeLightingRadius = 1.0] - Increase the thickness of contours from eye dome lighting.
  25148. * @param [options.backFaceCulling = false] - Determines whether back-facing points are hidden. This option works only if data has normals included.
  25149. * @param [options.normalShading = true] - Determines whether a point cloud that contains normals is shaded by the scene's light source.
  25150. */
  25151. export class PointCloudShading {
  25152. constructor(options?: {
  25153. attenuation?: boolean;
  25154. geometricErrorScale?: number;
  25155. maximumAttenuation?: number;
  25156. baseResolution?: number;
  25157. eyeDomeLighting?: boolean;
  25158. eyeDomeLightingStrength?: number;
  25159. eyeDomeLightingRadius?: number;
  25160. backFaceCulling?: boolean;
  25161. normalShading?: boolean;
  25162. });
  25163. /**
  25164. * Perform point attenuation based on geometric error.
  25165. */
  25166. attenuation: boolean;
  25167. /**
  25168. * Scale to be applied to the geometric error before computing attenuation.
  25169. */
  25170. geometricErrorScale: number;
  25171. /**
  25172. * Maximum point attenuation in pixels. If undefined, the Cesium3DTileset's maximumScreenSpaceError will be used.
  25173. */
  25174. maximumAttenuation: number;
  25175. /**
  25176. * Average base resolution for the dataset in meters.
  25177. * Used in place of geometric error when geometric error is 0.
  25178. * If undefined, an approximation will be computed for each tile that has geometric error of 0.
  25179. */
  25180. baseResolution: number;
  25181. /**
  25182. * Use eye dome lighting when drawing with point attenuation
  25183. * Requires support for EXT_frag_depth, OES_texture_float, and WEBGL_draw_buffers extensions in WebGL 1.0,
  25184. * otherwise eye dome lighting is ignored.
  25185. */
  25186. eyeDomeLighting: boolean;
  25187. /**
  25188. * Eye dome lighting strength (apparent contrast)
  25189. */
  25190. eyeDomeLightingStrength: number;
  25191. /**
  25192. * Thickness of contours from eye dome lighting
  25193. */
  25194. eyeDomeLightingRadius: number;
  25195. /**
  25196. * Determines whether back-facing points are hidden.
  25197. * This option works only if data has normals included.
  25198. */
  25199. backFaceCulling: boolean;
  25200. /**
  25201. * Determines whether a point cloud that contains normals is shaded by the scene's light source.
  25202. */
  25203. normalShading: boolean;
  25204. /**
  25205. * Determines if point cloud shading is supported.
  25206. * @param scene - The scene.
  25207. * @returns <code>true</code> if point cloud shading is supported; otherwise, returns <code>false</code>
  25208. */
  25209. isSupported(scene: Scene): boolean;
  25210. }
  25211. /**
  25212. * A graphical point positioned in the 3D scene, that is created
  25213. * and rendered using a {@link PointPrimitiveCollection}. A point is created and its initial
  25214. * properties are set by calling {@link PointPrimitiveCollection#add}.
  25215. */
  25216. export class PointPrimitive {
  25217. constructor();
  25218. /**
  25219. * Determines if this point will be shown. Use this to hide or show a point, instead
  25220. * of removing it and re-adding it to the collection.
  25221. */
  25222. show: boolean;
  25223. /**
  25224. * Gets or sets the Cartesian position of this point.
  25225. */
  25226. position: Cartesian3;
  25227. /**
  25228. * Gets or sets near and far scaling properties of a point based on the point's distance from the camera.
  25229. * A point's scale will interpolate between the {@link NearFarScalar#nearValue} and
  25230. * {@link NearFarScalar#farValue} while the camera distance falls within the lower and upper bounds
  25231. * of the specified {@link NearFarScalar#near} and {@link NearFarScalar#far}.
  25232. * Outside of these ranges the point's scale remains clamped to the nearest bound. This scale
  25233. * multiplies the pixelSize and outlineWidth to affect the total size of the point. If undefined,
  25234. * scaleByDistance will be disabled.
  25235. * @example
  25236. * // Example 1.
  25237. * // Set a pointPrimitive's scaleByDistance to scale to 15 when the
  25238. * // camera is 1500 meters from the pointPrimitive and disappear as
  25239. * // the camera distance approaches 8.0e6 meters.
  25240. * p.scaleByDistance = new Cesium.NearFarScalar(1.5e2, 15, 8.0e6, 0.0);
  25241. * @example
  25242. * // Example 2.
  25243. * // disable scaling by distance
  25244. * p.scaleByDistance = undefined;
  25245. */
  25246. scaleByDistance: NearFarScalar;
  25247. /**
  25248. * Gets or sets near and far translucency properties of a point based on the point's distance from the camera.
  25249. * A point's translucency will interpolate between the {@link NearFarScalar#nearValue} and
  25250. * {@link NearFarScalar#farValue} while the camera distance falls within the lower and upper bounds
  25251. * of the specified {@link NearFarScalar#near} and {@link NearFarScalar#far}.
  25252. * Outside of these ranges the point's translucency remains clamped to the nearest bound. If undefined,
  25253. * translucencyByDistance will be disabled.
  25254. * @example
  25255. * // Example 1.
  25256. * // Set a point's translucency to 1.0 when the
  25257. * // camera is 1500 meters from the point and disappear as
  25258. * // the camera distance approaches 8.0e6 meters.
  25259. * p.translucencyByDistance = new Cesium.NearFarScalar(1.5e2, 1.0, 8.0e6, 0.0);
  25260. * @example
  25261. * // Example 2.
  25262. * // disable translucency by distance
  25263. * p.translucencyByDistance = undefined;
  25264. */
  25265. translucencyByDistance: NearFarScalar;
  25266. /**
  25267. * Gets or sets the inner size of the point in pixels.
  25268. */
  25269. pixelSize: number;
  25270. /**
  25271. * Gets or sets the inner color of the point.
  25272. * The red, green, blue, and alpha values are indicated by <code>value</code>'s <code>red</code>, <code>green</code>,
  25273. * <code>blue</code>, and <code>alpha</code> properties as shown in Example 1. These components range from <code>0.0</code>
  25274. * (no intensity) to <code>1.0</code> (full intensity).
  25275. * @example
  25276. * // Example 1. Assign yellow.
  25277. * p.color = Cesium.Color.YELLOW;
  25278. * @example
  25279. * // Example 2. Make a pointPrimitive 50% translucent.
  25280. * p.color = new Cesium.Color(1.0, 1.0, 1.0, 0.5);
  25281. */
  25282. color: Color;
  25283. /**
  25284. * Gets or sets the outline color of the point.
  25285. */
  25286. outlineColor: Color;
  25287. /**
  25288. * Gets or sets the outline width in pixels. This width adds to pixelSize,
  25289. * increasing the total size of the point.
  25290. */
  25291. outlineWidth: number;
  25292. /**
  25293. * Gets or sets the condition specifying at what distance from the camera that this point will be displayed.
  25294. */
  25295. distanceDisplayCondition: DistanceDisplayCondition;
  25296. /**
  25297. * Gets or sets the distance from the camera at which to disable the depth test to, for example, prevent clipping against terrain.
  25298. * When set to zero, the depth test is always applied. When set to Number.POSITIVE_INFINITY, the depth test is never applied.
  25299. */
  25300. disableDepthTestDistance: number;
  25301. /**
  25302. * Gets or sets the user-defined value returned when the point is picked.
  25303. */
  25304. id: any;
  25305. /**
  25306. * Computes the screen-space position of the point's origin.
  25307. * The screen space origin is the top, left corner of the canvas; <code>x</code> increases from
  25308. * left to right, and <code>y</code> increases from top to bottom.
  25309. * @example
  25310. * console.log(p.computeScreenSpacePosition(scene).toString());
  25311. * @param scene - The scene.
  25312. * @param [result] - The object onto which to store the result.
  25313. * @returns The screen-space position of the point.
  25314. */
  25315. computeScreenSpacePosition(scene: Scene, result?: Cartesian2): Cartesian2;
  25316. /**
  25317. * Determines if this point equals another point. Points are equal if all their properties
  25318. * are equal. Points in different collections can be equal.
  25319. * @param other - The point to compare for equality.
  25320. * @returns <code>true</code> if the points are equal; otherwise, <code>false</code>.
  25321. */
  25322. equals(other: PointPrimitive): boolean;
  25323. }
  25324. /**
  25325. * A renderable collection of points.
  25326. * <br /><br />
  25327. * Points are added and removed from the collection using {@link PointPrimitiveCollection#add}
  25328. * and {@link PointPrimitiveCollection#remove}.
  25329. * @example
  25330. * // Create a pointPrimitive collection with two points
  25331. * const points = scene.primitives.add(new Cesium.PointPrimitiveCollection());
  25332. * points.add({
  25333. * position : new Cesium.Cartesian3(1.0, 2.0, 3.0),
  25334. * color : Cesium.Color.YELLOW
  25335. * });
  25336. * points.add({
  25337. * position : new Cesium.Cartesian3(4.0, 5.0, 6.0),
  25338. * color : Cesium.Color.CYAN
  25339. * });
  25340. * @param [options] - Object with the following properties:
  25341. * @param [options.modelMatrix = Matrix4.IDENTITY] - The 4x4 transformation matrix that transforms each point from model to world coordinates.
  25342. * @param [options.debugShowBoundingVolume = false] - For debugging only. Determines if this primitive's commands' bounding spheres are shown.
  25343. * @param [options.blendOption = BlendOption.OPAQUE_AND_TRANSLUCENT] - The point blending option. The default
  25344. * is used for rendering both opaque and translucent points. However, if either all of the points are completely opaque or all are completely translucent,
  25345. * setting the technique to BlendOption.OPAQUE or BlendOption.TRANSLUCENT can improve performance by up to 2x.
  25346. * @param [options.show = true] - Determines if the primitives in the collection will be shown.
  25347. */
  25348. export class PointPrimitiveCollection {
  25349. constructor(options?: {
  25350. modelMatrix?: Matrix4;
  25351. debugShowBoundingVolume?: boolean;
  25352. blendOption?: BlendOption;
  25353. show?: boolean;
  25354. });
  25355. /**
  25356. * Determines if primitives in this collection will be shown.
  25357. */
  25358. show: boolean;
  25359. /**
  25360. * The 4x4 transformation matrix that transforms each point in this collection from model to world coordinates.
  25361. * When this is the identity matrix, the pointPrimitives are drawn in world coordinates, i.e., Earth's WGS84 coordinates.
  25362. * Local reference frames can be used by providing a different transformation matrix, like that returned
  25363. * by {@link Transforms.eastNorthUpToFixedFrame}.
  25364. * @example
  25365. * const center = Cesium.Cartesian3.fromDegrees(-75.59777, 40.03883);
  25366. * pointPrimitives.modelMatrix = Cesium.Transforms.eastNorthUpToFixedFrame(center);
  25367. * pointPrimitives.add({
  25368. * color : Cesium.Color.ORANGE,
  25369. * position : new Cesium.Cartesian3(0.0, 0.0, 0.0) // center
  25370. * });
  25371. * pointPrimitives.add({
  25372. * color : Cesium.Color.YELLOW,
  25373. * position : new Cesium.Cartesian3(1000000.0, 0.0, 0.0) // east
  25374. * });
  25375. * pointPrimitives.add({
  25376. * color : Cesium.Color.GREEN,
  25377. * position : new Cesium.Cartesian3(0.0, 1000000.0, 0.0) // north
  25378. * });
  25379. * pointPrimitives.add({
  25380. * color : Cesium.Color.CYAN,
  25381. * position : new Cesium.Cartesian3(0.0, 0.0, 1000000.0) // up
  25382. * });
  25383. */
  25384. modelMatrix: Matrix4;
  25385. /**
  25386. * This property is for debugging only; it is not for production use nor is it optimized.
  25387. * <p>
  25388. * Draws the bounding sphere for each draw command in the primitive.
  25389. * </p>
  25390. */
  25391. debugShowBoundingVolume: boolean;
  25392. /**
  25393. * The point blending option. The default is used for rendering both opaque and translucent points.
  25394. * However, if either all of the points are completely opaque or all are completely translucent,
  25395. * setting the technique to BlendOption.OPAQUE or BlendOption.TRANSLUCENT can improve
  25396. * performance by up to 2x.
  25397. */
  25398. blendOption: BlendOption;
  25399. /**
  25400. * Returns the number of points in this collection. This is commonly used with
  25401. * {@link PointPrimitiveCollection#get} to iterate over all the points
  25402. * in the collection.
  25403. */
  25404. length: number;
  25405. /**
  25406. * Creates and adds a point with the specified initial properties to the collection.
  25407. * The added point is returned so it can be modified or removed from the collection later.
  25408. * @example
  25409. * // Example 1: Add a point, specifying all the default values.
  25410. * const p = pointPrimitives.add({
  25411. * show : true,
  25412. * position : Cesium.Cartesian3.ZERO,
  25413. * pixelSize : 10.0,
  25414. * color : Cesium.Color.WHITE,
  25415. * outlineColor : Cesium.Color.TRANSPARENT,
  25416. * outlineWidth : 0.0,
  25417. * id : undefined
  25418. * });
  25419. * @example
  25420. * // Example 2: Specify only the point's cartographic position.
  25421. * const p = pointPrimitives.add({
  25422. * position : Cesium.Cartesian3.fromDegrees(longitude, latitude, height)
  25423. * });
  25424. * @param [options] - A template describing the point's properties as shown in Example 1.
  25425. * @returns The point that was added to the collection.
  25426. */
  25427. add(options?: any): PointPrimitive;
  25428. /**
  25429. * Removes a point from the collection.
  25430. * @example
  25431. * const p = pointPrimitives.add(...);
  25432. * pointPrimitives.remove(p); // Returns true
  25433. * @param pointPrimitive - The point to remove.
  25434. * @returns <code>true</code> if the point was removed; <code>false</code> if the point was not found in the collection.
  25435. */
  25436. remove(pointPrimitive: PointPrimitive): boolean;
  25437. /**
  25438. * Removes all points from the collection.
  25439. * @example
  25440. * pointPrimitives.add(...);
  25441. * pointPrimitives.add(...);
  25442. * pointPrimitives.removeAll();
  25443. */
  25444. removeAll(): void;
  25445. /**
  25446. * Check whether this collection contains a given point.
  25447. * @param [pointPrimitive] - The point to check for.
  25448. * @returns true if this collection contains the point, false otherwise.
  25449. */
  25450. contains(pointPrimitive?: PointPrimitive): boolean;
  25451. /**
  25452. * Returns the point in the collection at the specified index. Indices are zero-based
  25453. * and increase as points are added. Removing a point shifts all points after
  25454. * it to the left, changing their indices. This function is commonly used with
  25455. * {@link PointPrimitiveCollection#length} to iterate over all the points
  25456. * in the collection.
  25457. * @example
  25458. * // Toggle the show property of every point in the collection
  25459. * const len = pointPrimitives.length;
  25460. * for (let i = 0; i < len; ++i) {
  25461. * const p = pointPrimitives.get(i);
  25462. * p.show = !p.show;
  25463. * }
  25464. * @param index - The zero-based index of the point.
  25465. * @returns The point at the specified index.
  25466. */
  25467. get(index: number): PointPrimitive;
  25468. /**
  25469. * Returns true if this object was destroyed; otherwise, false.
  25470. * <br /><br />
  25471. * If this object was destroyed, it should not be used; calling any function other than
  25472. * <code>isDestroyed</code> will result in a {@link DeveloperError} exception.
  25473. * @returns <code>true</code> if this object was destroyed; otherwise, <code>false</code>.
  25474. */
  25475. isDestroyed(): boolean;
  25476. /**
  25477. * Destroys the WebGL resources held by this object. Destroying an object allows for deterministic
  25478. * release of WebGL resources, instead of relying on the garbage collector to destroy this object.
  25479. * <br /><br />
  25480. * Once an object is destroyed, it should not be used; calling any function other than
  25481. * <code>isDestroyed</code> will result in a {@link DeveloperError} exception. Therefore,
  25482. * assign the return value (<code>undefined</code>) to the object as done in the example.
  25483. * @example
  25484. * pointPrimitives = pointPrimitives && pointPrimitives.destroy();
  25485. */
  25486. destroy(): void;
  25487. }
  25488. /**
  25489. * A renderable polyline. Create this by calling {@link PolylineCollection#add}
  25490. * @param options - Object with the following properties:
  25491. * @param [options.show = true] - <code>true</code> if this polyline will be shown; otherwise, <code>false</code>.
  25492. * @param [options.width = 1.0] - The width of the polyline in pixels.
  25493. * @param [options.loop = false] - Whether a line segment will be added between the last and first line positions to make this line a loop.
  25494. * @param [options.material = Material.ColorType] - The material.
  25495. * @param [options.positions] - The positions.
  25496. * @param [options.id] - The user-defined object to be returned when this polyline is picked.
  25497. * @param [options.distanceDisplayCondition] - The condition specifying at what distance from the camera that this polyline will be displayed.
  25498. * @param polylineCollection - The renderable polyline collection.
  25499. */
  25500. export class Polyline {
  25501. constructor(options: {
  25502. show?: boolean;
  25503. width?: number;
  25504. loop?: boolean;
  25505. material?: Material;
  25506. positions?: Cartesian3[];
  25507. id?: any;
  25508. distanceDisplayCondition?: DistanceDisplayCondition;
  25509. }, polylineCollection: PolylineCollection);
  25510. /**
  25511. * Determines if this polyline will be shown. Use this to hide or show a polyline, instead
  25512. * of removing it and re-adding it to the collection.
  25513. */
  25514. show: boolean;
  25515. /**
  25516. * Gets or sets the positions of the polyline.
  25517. * @example
  25518. * polyline.positions = Cesium.Cartesian3.fromDegreesArray([
  25519. * 0.0, 0.0,
  25520. * 10.0, 0.0,
  25521. * 0.0, 20.0
  25522. * ]);
  25523. */
  25524. positions: Cartesian3[];
  25525. /**
  25526. * Gets or sets the surface appearance of the polyline.
  25527. */
  25528. material: Material;
  25529. /**
  25530. * Gets or sets the width of the polyline.
  25531. */
  25532. width: number;
  25533. /**
  25534. * Gets or sets whether a line segment will be added between the first and last polyline positions.
  25535. */
  25536. loop: boolean;
  25537. /**
  25538. * Gets or sets the user-defined value returned when the polyline is picked.
  25539. */
  25540. id: any;
  25541. /**
  25542. * Gets or sets the condition specifying at what distance from the camera that this polyline will be displayed.
  25543. */
  25544. distanceDisplayCondition: DistanceDisplayCondition;
  25545. }
  25546. /**
  25547. * A renderable collection of polylines.
  25548. * <br /><br />
  25549. * <div align="center">
  25550. * <img src="Images/Polyline.png" width="400" height="300" /><br />
  25551. * Example polylines
  25552. * </div>
  25553. * <br /><br />
  25554. * Polylines are added and removed from the collection using {@link PolylineCollection#add}
  25555. * and {@link PolylineCollection#remove}.
  25556. * @example
  25557. * // Create a polyline collection with two polylines
  25558. * const polylines = new Cesium.PolylineCollection();
  25559. * polylines.add({
  25560. * positions : Cesium.Cartesian3.fromDegreesArray([
  25561. * -75.10, 39.57,
  25562. * -77.02, 38.53,
  25563. * -80.50, 35.14,
  25564. * -80.12, 25.46]),
  25565. * width : 2
  25566. * });
  25567. *
  25568. * polylines.add({
  25569. * positions : Cesium.Cartesian3.fromDegreesArray([
  25570. * -73.10, 37.57,
  25571. * -75.02, 36.53,
  25572. * -78.50, 33.14,
  25573. * -78.12, 23.46]),
  25574. * width : 4
  25575. * });
  25576. * @param [options] - Object with the following properties:
  25577. * @param [options.modelMatrix = Matrix4.IDENTITY] - The 4x4 transformation matrix that transforms each polyline from model to world coordinates.
  25578. * @param [options.debugShowBoundingVolume = false] - For debugging only. Determines if this primitive's commands' bounding spheres are shown.
  25579. * @param [options.show = true] - Determines if the polylines in the collection will be shown.
  25580. */
  25581. export class PolylineCollection {
  25582. constructor(options?: {
  25583. modelMatrix?: Matrix4;
  25584. debugShowBoundingVolume?: boolean;
  25585. show?: boolean;
  25586. });
  25587. /**
  25588. * Determines if polylines in this collection will be shown.
  25589. */
  25590. show: boolean;
  25591. /**
  25592. * The 4x4 transformation matrix that transforms each polyline in this collection from model to world coordinates.
  25593. * When this is the identity matrix, the polylines are drawn in world coordinates, i.e., Earth's WGS84 coordinates.
  25594. * Local reference frames can be used by providing a different transformation matrix, like that returned
  25595. * by {@link Transforms.eastNorthUpToFixedFrame}.
  25596. */
  25597. modelMatrix: Matrix4;
  25598. /**
  25599. * This property is for debugging only; it is not for production use nor is it optimized.
  25600. * <p>
  25601. * Draws the bounding sphere for each draw command in the primitive.
  25602. * </p>
  25603. */
  25604. debugShowBoundingVolume: boolean;
  25605. /**
  25606. * Returns the number of polylines in this collection. This is commonly used with
  25607. * {@link PolylineCollection#get} to iterate over all the polylines
  25608. * in the collection.
  25609. */
  25610. length: number;
  25611. /**
  25612. * Creates and adds a polyline with the specified initial properties to the collection.
  25613. * The added polyline is returned so it can be modified or removed from the collection later.
  25614. * @example
  25615. * // Example 1: Add a polyline, specifying all the default values.
  25616. * const p = polylines.add({
  25617. * show : true,
  25618. * positions : ellipsoid.cartographicArrayToCartesianArray([
  25619. * Cesium.Cartographic.fromDegrees(-75.10, 39.57),
  25620. * Cesium.Cartographic.fromDegrees(-77.02, 38.53)]),
  25621. * width : 1
  25622. * });
  25623. * @param [options] - A template describing the polyline's properties as shown in Example 1.
  25624. * @returns The polyline that was added to the collection.
  25625. */
  25626. add(options?: any): Polyline;
  25627. /**
  25628. * Removes a polyline from the collection.
  25629. * @example
  25630. * const p = polylines.add(...);
  25631. * polylines.remove(p); // Returns true
  25632. * @param polyline - The polyline to remove.
  25633. * @returns <code>true</code> if the polyline was removed; <code>false</code> if the polyline was not found in the collection.
  25634. */
  25635. remove(polyline: Polyline): boolean;
  25636. /**
  25637. * Removes all polylines from the collection.
  25638. * @example
  25639. * polylines.add(...);
  25640. * polylines.add(...);
  25641. * polylines.removeAll();
  25642. */
  25643. removeAll(): void;
  25644. /**
  25645. * Determines if this collection contains the specified polyline.
  25646. * @param polyline - The polyline to check for.
  25647. * @returns true if this collection contains the polyline, false otherwise.
  25648. */
  25649. contains(polyline: Polyline): boolean;
  25650. /**
  25651. * Returns the polyline in the collection at the specified index. Indices are zero-based
  25652. * and increase as polylines are added. Removing a polyline shifts all polylines after
  25653. * it to the left, changing their indices. This function is commonly used with
  25654. * {@link PolylineCollection#length} to iterate over all the polylines
  25655. * in the collection.
  25656. * @example
  25657. * // Toggle the show property of every polyline in the collection
  25658. * const len = polylines.length;
  25659. * for (let i = 0; i < len; ++i) {
  25660. * const p = polylines.get(i);
  25661. * p.show = !p.show;
  25662. * }
  25663. * @param index - The zero-based index of the polyline.
  25664. * @returns The polyline at the specified index.
  25665. */
  25666. get(index: number): Polyline;
  25667. /**
  25668. * Called when {@link Viewer} or {@link CesiumWidget} render the scene to
  25669. * get the draw commands needed to render this primitive.
  25670. * <p>
  25671. * Do not call this function directly. This is documented just to
  25672. * list the exceptions that may be propagated when the scene is rendered:
  25673. * </p>
  25674. */
  25675. update(): void;
  25676. /**
  25677. * Returns true if this object was destroyed; otherwise, false.
  25678. * <br /><br />
  25679. * If this object was destroyed, it should not be used; calling any function other than
  25680. * <code>isDestroyed</code> will result in a {@link DeveloperError} exception.
  25681. * @returns <code>true</code> if this object was destroyed; otherwise, <code>false</code>.
  25682. */
  25683. isDestroyed(): boolean;
  25684. /**
  25685. * Destroys the WebGL resources held by this object. Destroying an object allows for deterministic
  25686. * release of WebGL resources, instead of relying on the garbage collector to destroy this object.
  25687. * <br /><br />
  25688. * Once an object is destroyed, it should not be used; calling any function other than
  25689. * <code>isDestroyed</code> will result in a {@link DeveloperError} exception. Therefore,
  25690. * assign the return value (<code>undefined</code>) to the object as done in the example.
  25691. * @example
  25692. * polylines = polylines && polylines.destroy();
  25693. */
  25694. destroy(): void;
  25695. }
  25696. /**
  25697. * An appearance for {@link GeometryInstance} instances with color attributes and
  25698. * {@link PolylineGeometry} or {@link GroundPolylineGeometry}.
  25699. * This allows several geometry instances, each with a different color, to
  25700. * be drawn with the same {@link Primitive}.
  25701. * @example
  25702. * // A solid white line segment
  25703. * const primitive = new Cesium.Primitive({
  25704. * geometryInstances : new Cesium.GeometryInstance({
  25705. * geometry : new Cesium.PolylineGeometry({
  25706. * positions : Cesium.Cartesian3.fromDegreesArray([
  25707. * 0.0, 0.0,
  25708. * 5.0, 0.0
  25709. * ]),
  25710. * width : 10.0,
  25711. * vertexFormat : Cesium.PolylineColorAppearance.VERTEX_FORMAT
  25712. * }),
  25713. * attributes : {
  25714. * color : Cesium.ColorGeometryInstanceAttribute.fromColor(new Cesium.Color(1.0, 1.0, 1.0, 1.0))
  25715. * }
  25716. * }),
  25717. * appearance : new Cesium.PolylineColorAppearance({
  25718. * translucent : false
  25719. * })
  25720. * });
  25721. * @param [options] - Object with the following properties:
  25722. * @param [options.translucent = true] - When <code>true</code>, the geometry is expected to appear translucent so {@link PolylineColorAppearance#renderState} has alpha blending enabled.
  25723. * @param [options.vertexShaderSource] - Optional GLSL vertex shader source to override the default vertex shader.
  25724. * @param [options.fragmentShaderSource] - Optional GLSL fragment shader source to override the default fragment shader.
  25725. * @param [options.renderState] - Optional render state to override the default render state.
  25726. */
  25727. export class PolylineColorAppearance {
  25728. constructor(options?: {
  25729. translucent?: boolean;
  25730. vertexShaderSource?: string;
  25731. fragmentShaderSource?: string;
  25732. renderState?: any;
  25733. });
  25734. /**
  25735. * This property is part of the {@link Appearance} interface, but is not
  25736. * used by {@link PolylineColorAppearance} since a fully custom fragment shader is used.
  25737. */
  25738. material: Material;
  25739. /**
  25740. * When <code>true</code>, the geometry is expected to appear translucent so
  25741. * {@link PolylineColorAppearance#renderState} has alpha blending enabled.
  25742. */
  25743. translucent: boolean;
  25744. /**
  25745. * The GLSL source code for the vertex shader.
  25746. */
  25747. readonly vertexShaderSource: string;
  25748. /**
  25749. * The GLSL source code for the fragment shader.
  25750. */
  25751. readonly fragmentShaderSource: string;
  25752. /**
  25753. * The WebGL fixed-function state to use when rendering the geometry.
  25754. * <p>
  25755. * The render state can be explicitly defined when constructing a {@link PolylineColorAppearance}
  25756. * instance, or it is set implicitly via {@link PolylineColorAppearance#translucent}.
  25757. * </p>
  25758. */
  25759. readonly renderState: any;
  25760. /**
  25761. * When <code>true</code>, the geometry is expected to be closed so
  25762. * {@link PolylineColorAppearance#renderState} has backface culling enabled.
  25763. * This is always <code>false</code> for <code>PolylineColorAppearance</code>.
  25764. */
  25765. readonly closed: boolean;
  25766. /**
  25767. * The {@link VertexFormat} that this appearance instance is compatible with.
  25768. * A geometry can have more vertex attributes and still be compatible - at a
  25769. * potential performance cost - but it can't have less.
  25770. */
  25771. readonly vertexFormat: VertexFormat;
  25772. /**
  25773. * The {@link VertexFormat} that all {@link PolylineColorAppearance} instances
  25774. * are compatible with. This requires only a <code>position</code> attribute.
  25775. */
  25776. readonly VERTEX_FORMAT: VertexFormat;
  25777. /**
  25778. * Procedurally creates the full GLSL fragment shader source.
  25779. * @returns The full GLSL fragment shader source.
  25780. */
  25781. getFragmentShaderSource(): string;
  25782. /**
  25783. * Determines if the geometry is translucent based on {@link PolylineColorAppearance#translucent}.
  25784. * @returns <code>true</code> if the appearance is translucent.
  25785. */
  25786. isTranslucent(): boolean;
  25787. /**
  25788. * Creates a render state. This is not the final render state instance; instead,
  25789. * it can contain a subset of render state properties identical to the render state
  25790. * created in the context.
  25791. * @returns The render state.
  25792. */
  25793. getRenderState(): any;
  25794. }
  25795. /**
  25796. * An appearance for {@link PolylineGeometry} that supports shading with materials.
  25797. * @example
  25798. * const primitive = new Cesium.Primitive({
  25799. * geometryInstances : new Cesium.GeometryInstance({
  25800. * geometry : new Cesium.PolylineGeometry({
  25801. * positions : Cesium.Cartesian3.fromDegreesArray([
  25802. * 0.0, 0.0,
  25803. * 5.0, 0.0
  25804. * ]),
  25805. * width : 10.0,
  25806. * vertexFormat : Cesium.PolylineMaterialAppearance.VERTEX_FORMAT
  25807. * })
  25808. * }),
  25809. * appearance : new Cesium.PolylineMaterialAppearance({
  25810. * material : Cesium.Material.fromType('Color')
  25811. * })
  25812. * });
  25813. * @param [options] - Object with the following properties:
  25814. * @param [options.translucent = true] - When <code>true</code>, the geometry is expected to appear translucent so {@link PolylineMaterialAppearance#renderState} has alpha blending enabled.
  25815. * @param [options.material = Material.ColorType] - The material used to determine the fragment color.
  25816. * @param [options.vertexShaderSource] - Optional GLSL vertex shader source to override the default vertex shader.
  25817. * @param [options.fragmentShaderSource] - Optional GLSL fragment shader source to override the default fragment shader.
  25818. * @param [options.renderState] - Optional render state to override the default render state.
  25819. */
  25820. export class PolylineMaterialAppearance {
  25821. constructor(options?: {
  25822. translucent?: boolean;
  25823. material?: Material;
  25824. vertexShaderSource?: string;
  25825. fragmentShaderSource?: string;
  25826. renderState?: any;
  25827. });
  25828. /**
  25829. * The material used to determine the fragment color. Unlike other {@link PolylineMaterialAppearance}
  25830. * properties, this is not read-only, so an appearance's material can change on the fly.
  25831. */
  25832. material: Material;
  25833. /**
  25834. * When <code>true</code>, the geometry is expected to appear translucent so
  25835. * {@link PolylineMaterialAppearance#renderState} has alpha blending enabled.
  25836. */
  25837. translucent: boolean;
  25838. /**
  25839. * The GLSL source code for the vertex shader.
  25840. */
  25841. readonly vertexShaderSource: string;
  25842. /**
  25843. * The GLSL source code for the fragment shader.
  25844. */
  25845. readonly fragmentShaderSource: string;
  25846. /**
  25847. * The WebGL fixed-function state to use when rendering the geometry.
  25848. * <p>
  25849. * The render state can be explicitly defined when constructing a {@link PolylineMaterialAppearance}
  25850. * instance, or it is set implicitly via {@link PolylineMaterialAppearance#translucent}
  25851. * and {@link PolylineMaterialAppearance#closed}.
  25852. * </p>
  25853. */
  25854. readonly renderState: any;
  25855. /**
  25856. * When <code>true</code>, the geometry is expected to be closed so
  25857. * {@link PolylineMaterialAppearance#renderState} has backface culling enabled.
  25858. * This is always <code>false</code> for <code>PolylineMaterialAppearance</code>.
  25859. */
  25860. readonly closed: boolean;
  25861. /**
  25862. * The {@link VertexFormat} that this appearance instance is compatible with.
  25863. * A geometry can have more vertex attributes and still be compatible - at a
  25864. * potential performance cost - but it can't have less.
  25865. */
  25866. readonly vertexFormat: VertexFormat;
  25867. /**
  25868. * The {@link VertexFormat} that all {@link PolylineMaterialAppearance} instances
  25869. * are compatible with. This requires <code>position</code> and <code>st</code> attributes.
  25870. */
  25871. readonly VERTEX_FORMAT: VertexFormat;
  25872. /**
  25873. * Procedurally creates the full GLSL fragment shader source. For {@link PolylineMaterialAppearance},
  25874. * this is derived from {@link PolylineMaterialAppearance#fragmentShaderSource} and {@link PolylineMaterialAppearance#material}.
  25875. * @returns The full GLSL fragment shader source.
  25876. */
  25877. getFragmentShaderSource(): string;
  25878. /**
  25879. * Determines if the geometry is translucent based on {@link PolylineMaterialAppearance#translucent} and {@link Material#isTranslucent}.
  25880. * @returns <code>true</code> if the appearance is translucent.
  25881. */
  25882. isTranslucent(): boolean;
  25883. /**
  25884. * Creates a render state. This is not the final render state instance; instead,
  25885. * it can contain a subset of render state properties identical to the render state
  25886. * created in the context.
  25887. * @returns The render state.
  25888. */
  25889. getRenderState(): any;
  25890. }
  25891. /**
  25892. * Runs a post-process stage on either the texture rendered by the scene or the output of a previous post-process stage.
  25893. * @example
  25894. * // Simple stage to change the color
  25895. * const fs =
  25896. * 'uniform sampler2D colorTexture;\n' +
  25897. * 'varying vec2 v_textureCoordinates;\n' +
  25898. * 'uniform float scale;\n' +
  25899. * 'uniform vec3 offset;\n' +
  25900. * 'void main() {\n' +
  25901. * ' vec4 color = texture2D(colorTexture, v_textureCoordinates);\n' +
  25902. * ' gl_FragColor = vec4(color.rgb * scale + offset, 1.0);\n' +
  25903. * '}\n';
  25904. * scene.postProcessStages.add(new Cesium.PostProcessStage({
  25905. * fragmentShader : fs,
  25906. * uniforms : {
  25907. * scale : 1.1,
  25908. * offset : function() {
  25909. * return new Cesium.Cartesian3(0.1, 0.2, 0.3);
  25910. * }
  25911. * }
  25912. * }));
  25913. * @example
  25914. * // Simple stage to change the color of what is selected.
  25915. * // If czm_selected returns true, the current fragment belongs to geometry in the selected array.
  25916. * const fs =
  25917. * 'uniform sampler2D colorTexture;\n' +
  25918. * 'varying vec2 v_textureCoordinates;\n' +
  25919. * 'uniform vec4 highlight;\n' +
  25920. * 'void main() {\n' +
  25921. * ' vec4 color = texture2D(colorTexture, v_textureCoordinates);\n' +
  25922. * ' if (czm_selected()) {\n' +
  25923. * ' vec3 highlighted = highlight.a * highlight.rgb + (1.0 - highlight.a) * color.rgb;\n' +
  25924. * ' gl_FragColor = vec4(highlighted, 1.0);\n' +
  25925. * ' } else { \n' +
  25926. * ' gl_FragColor = color;\n' +
  25927. * ' }\n' +
  25928. * '}\n';
  25929. * const stage = scene.postProcessStages.add(new Cesium.PostProcessStage({
  25930. * fragmentShader : fs,
  25931. * uniforms : {
  25932. * highlight : function() {
  25933. * return new Cesium.Color(1.0, 0.0, 0.0, 0.5);
  25934. * }
  25935. * }
  25936. * }));
  25937. * stage.selected = [Cesium3DTileFeature];
  25938. * @param options - An object with the following properties:
  25939. * @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.
  25940. * @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.
  25941. * @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.
  25942. * @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.
  25943. * @param [options.sampleMode = PostProcessStageSampleMode.NEAREST] - How to sample the input color texture.
  25944. * @param [options.pixelFormat = PixelFormat.RGBA] - The color pixel format of the output texture.
  25945. * @param [options.pixelDatatype = PixelDatatype.UNSIGNED_BYTE] - The pixel data type of the output texture.
  25946. * @param [options.clearColor = Color.BLACK] - The color to clear the output texture to.
  25947. * @param [options.scissorRectangle] - The rectangle to use for the scissor test.
  25948. * @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.
  25949. */
  25950. export class PostProcessStage {
  25951. constructor(options: {
  25952. fragmentShader: string;
  25953. uniforms?: any;
  25954. textureScale?: number;
  25955. forcePowerOfTwo?: boolean;
  25956. sampleMode?: PostProcessStageSampleMode;
  25957. pixelFormat?: PixelFormat;
  25958. pixelDatatype?: PixelDatatype;
  25959. clearColor?: Color;
  25960. scissorRectangle?: BoundingRectangle;
  25961. name?: string;
  25962. });
  25963. /**
  25964. * Whether or not to execute this post-process stage when ready.
  25965. */
  25966. enabled: boolean;
  25967. /**
  25968. * Determines if this post-process stage is ready to be executed. A stage is only executed when both <code>ready</code>
  25969. * and {@link PostProcessStage#enabled} are <code>true</code>. A stage will not be ready while it is waiting on textures
  25970. * to load.
  25971. */
  25972. readonly ready: boolean;
  25973. /**
  25974. * The unique name of this post-process stage for reference by other stages in a {@link PostProcessStageComposite}.
  25975. */
  25976. readonly name: string;
  25977. /**
  25978. * The fragment shader to use when execute this post-process stage.
  25979. * <p>
  25980. * The shader must contain a sampler uniform declaration for <code>colorTexture</code>, <code>depthTexture</code>,
  25981. * or both.
  25982. * </p>
  25983. * <p>
  25984. * The shader must contain a <code>vec2</code> varying declaration for <code>v_textureCoordinates</code> for sampling
  25985. * the texture uniforms.
  25986. * </p>
  25987. */
  25988. readonly fragmentShader: string;
  25989. /**
  25990. * An object whose properties are used to set the uniforms of the fragment shader.
  25991. * <p>
  25992. * The object property values can be either a constant or a function. The function will be called
  25993. * each frame before the post-process stage is executed.
  25994. * </p>
  25995. * <p>
  25996. * 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.
  25997. * </p>
  25998. * <p>
  25999. * If this post-process stage is part of a {@link PostProcessStageComposite} that does not execute in series, the constant value can also be
  26000. * the name of another stage in a composite. This will set the uniform to the output texture the stage with that name.
  26001. * </p>
  26002. */
  26003. readonly uniforms: any;
  26004. /**
  26005. * 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.
  26006. */
  26007. readonly textureScale: number;
  26008. /**
  26009. * 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.
  26010. */
  26011. readonly forcePowerOfTwo: number;
  26012. /**
  26013. * How to sample the input color texture.
  26014. */
  26015. readonly sampleMode: PostProcessStageSampleMode;
  26016. /**
  26017. * The color pixel format of the output texture.
  26018. */
  26019. readonly pixelFormat: PixelFormat;
  26020. /**
  26021. * The pixel data type of the output texture.
  26022. */
  26023. readonly pixelDatatype: PixelDatatype;
  26024. /**
  26025. * The color to clear the output texture to.
  26026. */
  26027. readonly clearColor: Color;
  26028. /**
  26029. * The {@link BoundingRectangle} to use for the scissor test. A default bounding rectangle will disable the scissor test.
  26030. */
  26031. readonly scissorRectangle: BoundingRectangle;
  26032. /**
  26033. * The features selected for applying the post-process.
  26034. * <p>
  26035. * In the fragment shader, use <code>czm_selected</code> to determine whether or not to apply the post-process
  26036. * stage to that fragment. For example:
  26037. * <code>
  26038. * if (czm_selected(v_textureCoordinates)) {
  26039. * // apply post-process stage
  26040. * } else {
  26041. * gl_FragColor = texture2D(colorTexture, v_textureCordinates);
  26042. * }
  26043. * </code>
  26044. * </p>
  26045. */
  26046. selected: any[];
  26047. /**
  26048. * Returns true if this object was destroyed; otherwise, false.
  26049. * <p>
  26050. * If this object was destroyed, it should not be used; calling any function other than
  26051. * <code>isDestroyed</code> will result in a {@link DeveloperError} exception.
  26052. * </p>
  26053. * @returns <code>true</code> if this object was destroyed; otherwise, <code>false</code>.
  26054. */
  26055. isDestroyed(): boolean;
  26056. /**
  26057. * Destroys the WebGL resources held by this object. Destroying an object allows for deterministic
  26058. * release of WebGL resources, instead of relying on the garbage collector to destroy this object.
  26059. * <p>
  26060. * Once an object is destroyed, it should not be used; calling any function other than
  26061. * <code>isDestroyed</code> will result in a {@link DeveloperError} exception. Therefore,
  26062. * assign the return value (<code>undefined</code>) to the object as done in the example.
  26063. * </p>
  26064. */
  26065. destroy(): void;
  26066. }
  26067. /**
  26068. * A collection of {@link PostProcessStage}s and/or {@link PostProcessStageComposite}s.
  26069. * <p>
  26070. * The input texture for each post-process stage is the texture rendered to by the scene or the texture rendered
  26071. * to by the previous stage in the collection.
  26072. * </p>
  26073. * <p>
  26074. * If the ambient occlusion or bloom stages are enabled, they will execute before all other stages.
  26075. * </p>
  26076. * <p>
  26077. * If the FXAA stage is enabled, it will execute after all other stages.
  26078. * </p>
  26079. */
  26080. export class PostProcessStageCollection {
  26081. constructor();
  26082. /**
  26083. * Determines if all of the post-process stages in the collection are ready to be executed.
  26084. */
  26085. readonly ready: boolean;
  26086. /**
  26087. * A post-process stage for Fast Approximate Anti-aliasing.
  26088. * <p>
  26089. * When enabled, this stage will execute after all others.
  26090. * </p>
  26091. */
  26092. readonly fxaa: PostProcessStage;
  26093. /**
  26094. * A post-process stage that applies Horizon-based Ambient Occlusion (HBAO) to the input texture.
  26095. * <p>
  26096. * Ambient occlusion simulates shadows from ambient light. These shadows would always be present when the
  26097. * surface receives light and regardless of the light's position.
  26098. * </p>
  26099. * <p>
  26100. * The uniforms have the following properties: <code>intensity</code>, <code>bias</code>, <code>lengthCap</code>,
  26101. * <code>stepSize</code>, <code>frustumLength</code>, <code>ambientOcclusionOnly</code>,
  26102. * <code>delta</code>, <code>sigma</code>, and <code>blurStepSize</code>.
  26103. * </p>
  26104. * <ul>
  26105. * <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>
  26106. *
  26107. * <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,
  26108. * 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>
  26109. *
  26110. * <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,
  26111. * sampling stops in the current direction. The default value is <code>0.26</code>.</li>
  26112. *
  26113. * <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>
  26114. *
  26115. * <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.
  26116. * The default value is <code>1000.0</code>.</li>
  26117. *
  26118. * <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
  26119. * 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>
  26120. * </ul>
  26121. * <p>
  26122. * <code>delta</code>, <code>sigma</code>, and <code>blurStepSize</code> are the same properties as {@link PostProcessStageLibrary#createBlurStage}.
  26123. * The blur is applied to the shadows generated from the image to make them smoother.
  26124. * </p>
  26125. * <p>
  26126. * When enabled, this stage will execute before all others.
  26127. * </p>
  26128. */
  26129. readonly ambientOcclusion: PostProcessStageComposite;
  26130. /**
  26131. * A post-process stage for a bloom effect.
  26132. * <p>
  26133. * A bloom effect adds glow effect, makes bright areas brighter, and dark areas darker.
  26134. * </p>
  26135. * <p>
  26136. * This stage has the following uniforms: <code>contrast</code>, <code>brightness</code>, <code>glowOnly</code>,
  26137. * <code>delta</code>, <code>sigma</code>, and <code>stepSize</code>.
  26138. * </p>
  26139. * <ul>
  26140. * <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>
  26141. *
  26142. * <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
  26143. * added to the brightness. The default value is <code>-0.3</code>.</li>
  26144. *
  26145. * <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.
  26146. * The default value is <code>false</code>. This is a debug option for viewing the effects when changing the other uniform values.</li>
  26147. * </ul>
  26148. * <p>
  26149. * <code>delta</code>, <code>sigma</code>, and <code>stepSize</code> are the same properties as {@link PostProcessStageLibrary#createBlurStage}.
  26150. * The blur is applied to the shadows generated from the image to make them smoother.
  26151. * </p>
  26152. * <p>
  26153. * When enabled, this stage will execute before all others.
  26154. * </p>
  26155. */
  26156. readonly bloom: PostProcessStageComposite;
  26157. /**
  26158. * The number of post-process stages in this collection.
  26159. */
  26160. readonly length: number;
  26161. /**
  26162. * Adds the post-process stage to the collection.
  26163. * @param stage - The post-process stage to add to the collection.
  26164. * @returns The post-process stage that was added to the collection.
  26165. */
  26166. add(stage: PostProcessStage | PostProcessStageComposite): PostProcessStage | PostProcessStageComposite;
  26167. /**
  26168. * Removes a post-process stage from the collection and destroys it.
  26169. * @param stage - The post-process stage to remove from the collection.
  26170. * @returns Whether the post-process stage was removed.
  26171. */
  26172. remove(stage: PostProcessStage | PostProcessStageComposite): boolean;
  26173. /**
  26174. * Returns whether the collection contains a post-process stage.
  26175. * @param stage - The post-process stage.
  26176. * @returns Whether the collection contains the post-process stage.
  26177. */
  26178. contains(stage: PostProcessStage | PostProcessStageComposite): boolean;
  26179. /**
  26180. * Gets the post-process stage at <code>index</code>.
  26181. * @param index - The index of the post-process stage.
  26182. * @returns The post-process stage at index.
  26183. */
  26184. get(index: number): PostProcessStage | PostProcessStageComposite;
  26185. /**
  26186. * Removes all post-process stages from the collection and destroys them.
  26187. */
  26188. removeAll(): void;
  26189. /**
  26190. * Returns true if this object was destroyed; otherwise, false.
  26191. * <p>
  26192. * If this object was destroyed, it should not be used; calling any function other than
  26193. * <code>isDestroyed</code> will result in a {@link DeveloperError} exception.
  26194. * </p>
  26195. * @returns <code>true</code> if this object was destroyed; otherwise, <code>false</code>.
  26196. */
  26197. isDestroyed(): boolean;
  26198. /**
  26199. * Destroys the WebGL resources held by this object. Destroying an object allows for deterministic
  26200. * release of WebGL resources, instead of relying on the garbage collector to destroy this object.
  26201. * <p>
  26202. * Once an object is destroyed, it should not be used; calling any function other than
  26203. * <code>isDestroyed</code> will result in a {@link DeveloperError} exception. Therefore,
  26204. * assign the return value (<code>undefined</code>) to the object as done in the example.
  26205. * </p>
  26206. */
  26207. destroy(): void;
  26208. }
  26209. /**
  26210. * A collection of {@link PostProcessStage}s or other post-process composite stages that execute together logically.
  26211. * <p>
  26212. * All stages are executed in the order of the array. The input texture changes based on the value of <code>inputPreviousStageTexture</code>.
  26213. * 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.
  26214. * 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
  26215. * or the output texture of the previous stage.
  26216. * </p>
  26217. * @example
  26218. * // Example 1: separable blur filter
  26219. * // The input to blurXDirection is the texture rendered to by the scene or the output of the previous stage.
  26220. * // The input to blurYDirection is the texture rendered to by blurXDirection.
  26221. * scene.postProcessStages.add(new Cesium.PostProcessStageComposite({
  26222. * stages : [blurXDirection, blurYDirection]
  26223. * }));
  26224. * @example
  26225. * // Example 2: referencing the output of another post-process stage
  26226. * scene.postProcessStages.add(new Cesium.PostProcessStageComposite({
  26227. * inputPreviousStageTexture : false,
  26228. * stages : [
  26229. * // The same as Example 1.
  26230. * new Cesium.PostProcessStageComposite({
  26231. * inputPreviousStageTexture : true
  26232. * stages : [blurXDirection, blurYDirection],
  26233. * name : 'blur'
  26234. * }),
  26235. * // The input texture for this stage is the same input texture to blurXDirection since inputPreviousStageTexture is false
  26236. * new Cesium.PostProcessStage({
  26237. * fragmentShader : compositeShader,
  26238. * uniforms : {
  26239. * blurTexture : 'blur' // The output of the composite with name 'blur' (the texture that blurYDirection rendered to).
  26240. * }
  26241. * })
  26242. * ]
  26243. * });
  26244. * @example
  26245. * // Example 3: create a uniform alias
  26246. * const uniforms = {};
  26247. * Cesium.defineProperties(uniforms, {
  26248. * filterSize : {
  26249. * get : function() {
  26250. * return blurXDirection.uniforms.filterSize;
  26251. * },
  26252. * set : function(value) {
  26253. * blurXDirection.uniforms.filterSize = blurYDirection.uniforms.filterSize = value;
  26254. * }
  26255. * }
  26256. * });
  26257. * scene.postProcessStages.add(new Cesium.PostProcessStageComposite({
  26258. * stages : [blurXDirection, blurYDirection],
  26259. * uniforms : uniforms
  26260. * }));
  26261. * @param options - An object with the following properties:
  26262. * @param options.stages - An array of {@link PostProcessStage}s or composites to be executed in order.
  26263. * @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.
  26264. * @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.
  26265. * @param [options.uniforms] - An alias to the uniforms of post-process stages.
  26266. */
  26267. export class PostProcessStageComposite {
  26268. constructor(options: {
  26269. stages: any[];
  26270. inputPreviousStageTexture?: boolean;
  26271. name?: string;
  26272. uniforms?: any;
  26273. });
  26274. /**
  26275. * Determines if this post-process stage is ready to be executed.
  26276. */
  26277. readonly ready: boolean;
  26278. /**
  26279. * The unique name of this post-process stage for reference by other stages in a PostProcessStageComposite.
  26280. */
  26281. readonly name: string;
  26282. /**
  26283. * Whether or not to execute this post-process stage when ready.
  26284. */
  26285. enabled: boolean;
  26286. /**
  26287. * 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.
  26288. */
  26289. uniforms: any;
  26290. /**
  26291. * All post-process stages are executed in the order of the array. The input texture changes based on the value of <code>inputPreviousStageTexture</code>.
  26292. * 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.
  26293. * 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
  26294. * or the output texture of the previous stage.
  26295. */
  26296. readonly inputPreviousStageTexture: boolean;
  26297. /**
  26298. * The number of post-process stages in this composite.
  26299. */
  26300. readonly length: number;
  26301. /**
  26302. * The features selected for applying the post-process.
  26303. */
  26304. selected: any[];
  26305. /**
  26306. * Gets the post-process stage at <code>index</code>
  26307. * @param index - The index of the post-process stage or composite.
  26308. * @returns The post-process stage or composite at index.
  26309. */
  26310. get(index: number): PostProcessStage | PostProcessStageComposite;
  26311. /**
  26312. * Returns true if this object was destroyed; otherwise, false.
  26313. * <p>
  26314. * If this object was destroyed, it should not be used; calling any function other than
  26315. * <code>isDestroyed</code> will result in a {@link DeveloperError} exception.
  26316. * </p>
  26317. * @returns <code>true</code> if this object was destroyed; otherwise, <code>false</code>.
  26318. */
  26319. isDestroyed(): boolean;
  26320. /**
  26321. * Destroys the WebGL resources held by this object. Destroying an object allows for deterministic
  26322. * release of WebGL resources, instead of relying on the garbage collector to destroy this object.
  26323. * <p>
  26324. * Once an object is destroyed, it should not be used; calling any function other than
  26325. * <code>isDestroyed</code> will result in a {@link DeveloperError} exception. Therefore,
  26326. * assign the return value (<code>undefined</code>) to the object as done in the example.
  26327. * </p>
  26328. */
  26329. destroy(): void;
  26330. }
  26331. /**
  26332. * Contains functions for creating common post-process stages.
  26333. */
  26334. export namespace PostProcessStageLibrary {
  26335. /**
  26336. * Creates a post-process stage that applies a Gaussian blur to the input texture. This stage is usually applied in conjunction with another stage.
  26337. * <p>
  26338. * This stage has the following uniforms: <code>delta</code>, <code>sigma</code>, and <code>stepSize</code>.
  26339. * </p>
  26340. * <p>
  26341. * <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>.
  26342. * The default value for <code>delta</code> is <code>1.0</code>. The default value for <code>sigma</code> is <code>2.0</code>.
  26343. * <code>stepSize</code> is the distance to the next texel. The default is <code>1.0</code>.
  26344. * </p>
  26345. * @returns A post-process stage that applies a Gaussian blur to the input texture.
  26346. */
  26347. function createBlurStage(): PostProcessStageComposite;
  26348. /**
  26349. * Creates a post-process stage that applies a depth of field effect.
  26350. * <p>
  26351. * Depth of field simulates camera focus. Objects in the scene that are in focus
  26352. * will be clear whereas objects not in focus will be blurred.
  26353. * </p>
  26354. * <p>
  26355. * This stage has the following uniforms: <code>focalDistance</code>, <code>delta</code>, <code>sigma</code>, and <code>stepSize</code>.
  26356. * </p>
  26357. * <p>
  26358. * <code>focalDistance</code> is the distance in meters from the camera to set the camera focus.
  26359. * </p>
  26360. * <p>
  26361. * <code>delta</code>, <code>sigma</code>, and <code>stepSize</code> are the same properties as {@link PostProcessStageLibrary#createBlurStage}.
  26362. * The blur is applied to the areas out of focus.
  26363. * </p>
  26364. * @returns A post-process stage that applies a depth of field effect.
  26365. */
  26366. function createDepthOfFieldStage(): PostProcessStageComposite;
  26367. /**
  26368. * Whether or not a depth of field stage is supported.
  26369. * <p>
  26370. * This stage requires the WEBGL_depth_texture extension.
  26371. * </p>
  26372. * @param scene - The scene.
  26373. * @returns Whether this post process stage is supported.
  26374. */
  26375. function isDepthOfFieldSupported(scene: Scene): boolean;
  26376. /**
  26377. * Creates a post-process stage that detects edges.
  26378. * <p>
  26379. * Writes the color to the output texture with alpha set to 1.0 when it is on an edge.
  26380. * </p>
  26381. * <p>
  26382. * This stage has the following uniforms: <code>color</code> and <code>length</code>
  26383. * </p>
  26384. * <ul>
  26385. * <li><code>color</code> is the color of the highlighted edge. The default is {@link Color#BLACK}.</li>
  26386. * <li><code>length</code> is the length of the edges in pixels. The default is <code>0.5</code>.</li>
  26387. * </ul>
  26388. * <p>
  26389. * This stage is not supported in 2D.
  26390. * </p>
  26391. * @example
  26392. * // multiple silhouette effects
  26393. * const yellowEdge = Cesium.PostProcessLibrary.createEdgeDetectionStage();
  26394. * yellowEdge.uniforms.color = Cesium.Color.YELLOW;
  26395. * yellowEdge.selected = [feature0];
  26396. *
  26397. * const greenEdge = Cesium.PostProcessLibrary.createEdgeDetectionStage();
  26398. * greenEdge.uniforms.color = Cesium.Color.LIME;
  26399. * greenEdge.selected = [feature1];
  26400. *
  26401. * // draw edges around feature0 and feature1
  26402. * postProcessStages.add(Cesium.PostProcessLibrary.createSilhouetteStage([yellowEdge, greenEdge]);
  26403. * @returns A post-process stage that applies an edge detection effect.
  26404. */
  26405. function createEdgeDetectionStage(): PostProcessStage;
  26406. /**
  26407. * Whether or not an edge detection stage is supported.
  26408. * <p>
  26409. * This stage requires the WEBGL_depth_texture extension.
  26410. * </p>
  26411. * @param scene - The scene.
  26412. * @returns Whether this post process stage is supported.
  26413. */
  26414. function isEdgeDetectionSupported(scene: Scene): boolean;
  26415. /**
  26416. * Creates a post-process stage that applies a silhouette effect.
  26417. * <p>
  26418. * A silhouette effect composites the color from the edge detection pass with input color texture.
  26419. * </p>
  26420. * <p>
  26421. * This stage has the following uniforms when <code>edgeDetectionStages</code> is <code>undefined</code>: <code>color</code> and <code>length</code>
  26422. * </p>
  26423. * <p>
  26424. * <code>color</code> is the color of the highlighted edge. The default is {@link Color#BLACK}.
  26425. * <code>length</code> is the length of the edges in pixels. The default is <code>0.5</code>.
  26426. * </p>
  26427. * @param [edgeDetectionStages] - An array of edge detection post process stages.
  26428. * @returns A post-process stage that applies a silhouette effect.
  26429. */
  26430. function createSilhouetteStage(edgeDetectionStages?: PostProcessStage[]): PostProcessStageComposite;
  26431. /**
  26432. * Whether or not a silhouette stage is supported.
  26433. * <p>
  26434. * This stage requires the WEBGL_depth_texture extension.
  26435. * </p>
  26436. * @param scene - The scene.
  26437. * @returns Whether this post process stage is supported.
  26438. */
  26439. function isSilhouetteSupported(scene: Scene): boolean;
  26440. /**
  26441. * Whether or not an ambient occlusion stage is supported.
  26442. * <p>
  26443. * This stage requires the WEBGL_depth_texture extension.
  26444. * </p>
  26445. * @param scene - The scene.
  26446. * @returns Whether this post process stage is supported.
  26447. */
  26448. function isAmbientOcclusionSupported(scene: Scene): boolean;
  26449. /**
  26450. * Creates a post-process stage that renders the input texture with black and white gradations.
  26451. * <p>
  26452. * This stage has one uniform value, <code>gradations</code>, which scales the luminance of each pixel.
  26453. * </p>
  26454. * @returns A post-process stage that renders the input texture with black and white gradations.
  26455. */
  26456. function createBlackAndWhiteStage(): PostProcessStage;
  26457. /**
  26458. * Creates a post-process stage that saturates the input texture.
  26459. * <p>
  26460. * This stage has one uniform value, <code>brightness</code>, which scales the saturation of each pixel.
  26461. * </p>
  26462. * @returns A post-process stage that saturates the input texture.
  26463. */
  26464. function createBrightnessStage(): PostProcessStage;
  26465. /**
  26466. * Creates a post-process stage that adds a night vision effect to the input texture.
  26467. * @returns A post-process stage that adds a night vision effect to the input texture.
  26468. */
  26469. function createNightVisionStage(): PostProcessStage;
  26470. /**
  26471. * Creates a post-process stage that applies an effect simulating light flaring a camera lens.
  26472. * <p>
  26473. * This stage has the following uniforms: <code>dirtTexture</code>, <code>starTexture</code>, <code>intensity</code>, <code>distortion</code>, <code>ghostDispersal</code>,
  26474. * <code>haloWidth</code>, <code>dirtAmount</code>, and <code>earthRadius</code>.
  26475. * <ul>
  26476. * <li><code>dirtTexture</code> is a texture sampled to simulate dirt on the lens.</li>
  26477. * <li><code>starTexture</code> is the texture sampled for the star pattern of the flare.</li>
  26478. * <li><code>intensity</code> is a scalar multiplied by the result of the lens flare. The default value is <code>2.0</code>.</li>
  26479. * <li><code>distortion</code> is a scalar value that affects the chromatic effect distortion. The default value is <code>10.0</code>.</li>
  26480. * <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>
  26481. * <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>
  26482. * <li><code>dirtAmount</code> is a scalar representing the amount of dirt on the lens. The default value is <code>0.4</code>.</li>
  26483. * <li><code>earthRadius</code> is the maximum radius of the earth. The default value is <code>Ellipsoid.WGS84.maximumRadius</code>.</li>
  26484. * </ul>
  26485. * </p>
  26486. * @returns A post-process stage for applying a lens flare effect.
  26487. */
  26488. function createLensFlareStage(): PostProcessStage;
  26489. }
  26490. /**
  26491. * Determines how input texture to a {@link PostProcessStage} is sampled.
  26492. */
  26493. export enum PostProcessStageSampleMode {
  26494. /**
  26495. * Samples the texture by returning the closest texel.
  26496. */
  26497. NEAREST = 0,
  26498. /**
  26499. * Samples the texture through bi-linear interpolation of the four nearest texels.
  26500. */
  26501. LINEAR = 1
  26502. }
  26503. /**
  26504. * A primitive represents geometry in the {@link Scene}. The geometry can be from a single {@link GeometryInstance}
  26505. * as shown in example 1 below, or from an array of instances, even if the geometry is from different
  26506. * geometry types, e.g., an {@link RectangleGeometry} and an {@link EllipsoidGeometry} as shown in Code Example 2.
  26507. * <p>
  26508. * A primitive combines geometry instances with an {@link Appearance} that describes the full shading, including
  26509. * {@link Material} and {@link RenderState}. Roughly, the geometry instance defines the structure and placement,
  26510. * and the appearance defines the visual characteristics. Decoupling geometry and appearance allows us to mix
  26511. * and match most of them and add a new geometry or appearance independently of each other.
  26512. * </p>
  26513. * <p>
  26514. * Combining multiple instances into one primitive is called batching, and significantly improves performance for data.
  26515. * Instances can be individually picked; {@link Scene#pick} returns their {@link GeometryInstance#id}. Using
  26516. * per-instance appearances like {@link PerInstanceColorAppearance}, each instance can also have a unique color.
  26517. * </p>
  26518. * <p>
  26519. * {@link Geometry} can either be created and batched on a web worker or the main thread. The first two examples
  26520. * show geometry that will be created on a web worker by using the descriptions of the geometry. The third example
  26521. * shows how to create the geometry on the main thread by explicitly calling the <code>createGeometry</code> method.
  26522. * </p>
  26523. * @example
  26524. * // 1. Draw a translucent ellipse on the surface with a checkerboard pattern
  26525. * const instance = new Cesium.GeometryInstance({
  26526. * geometry : new Cesium.EllipseGeometry({
  26527. * center : Cesium.Cartesian3.fromDegrees(-100.0, 20.0),
  26528. * semiMinorAxis : 500000.0,
  26529. * semiMajorAxis : 1000000.0,
  26530. * rotation : Cesium.Math.PI_OVER_FOUR,
  26531. * vertexFormat : Cesium.VertexFormat.POSITION_AND_ST
  26532. * }),
  26533. * id : 'object returned when this instance is picked and to get/set per-instance attributes'
  26534. * });
  26535. * scene.primitives.add(new Cesium.Primitive({
  26536. * geometryInstances : instance,
  26537. * appearance : new Cesium.EllipsoidSurfaceAppearance({
  26538. * material : Cesium.Material.fromType('Checkerboard')
  26539. * })
  26540. * }));
  26541. * @example
  26542. * // 2. Draw different instances each with a unique color
  26543. * const rectangleInstance = new Cesium.GeometryInstance({
  26544. * geometry : new Cesium.RectangleGeometry({
  26545. * rectangle : Cesium.Rectangle.fromDegrees(-140.0, 30.0, -100.0, 40.0),
  26546. * vertexFormat : Cesium.PerInstanceColorAppearance.VERTEX_FORMAT
  26547. * }),
  26548. * id : 'rectangle',
  26549. * attributes : {
  26550. * color : new Cesium.ColorGeometryInstanceAttribute(0.0, 1.0, 1.0, 0.5)
  26551. * }
  26552. * });
  26553. * const ellipsoidInstance = new Cesium.GeometryInstance({
  26554. * geometry : new Cesium.EllipsoidGeometry({
  26555. * radii : new Cesium.Cartesian3(500000.0, 500000.0, 1000000.0),
  26556. * vertexFormat : Cesium.VertexFormat.POSITION_AND_NORMAL
  26557. * }),
  26558. * modelMatrix : Cesium.Matrix4.multiplyByTranslation(Cesium.Transforms.eastNorthUpToFixedFrame(
  26559. * Cesium.Cartesian3.fromDegrees(-95.59777, 40.03883)), new Cesium.Cartesian3(0.0, 0.0, 500000.0), new Cesium.Matrix4()),
  26560. * id : 'ellipsoid',
  26561. * attributes : {
  26562. * color : Cesium.ColorGeometryInstanceAttribute.fromColor(Cesium.Color.AQUA)
  26563. * }
  26564. * });
  26565. * scene.primitives.add(new Cesium.Primitive({
  26566. * geometryInstances : [rectangleInstance, ellipsoidInstance],
  26567. * appearance : new Cesium.PerInstanceColorAppearance()
  26568. * }));
  26569. * @example
  26570. * // 3. Create the geometry on the main thread.
  26571. * scene.primitives.add(new Cesium.Primitive({
  26572. * geometryInstances : new Cesium.GeometryInstance({
  26573. * geometry : Cesium.EllipsoidGeometry.createGeometry(new Cesium.EllipsoidGeometry({
  26574. * radii : new Cesium.Cartesian3(500000.0, 500000.0, 1000000.0),
  26575. * vertexFormat : Cesium.VertexFormat.POSITION_AND_NORMAL
  26576. * })),
  26577. * modelMatrix : Cesium.Matrix4.multiplyByTranslation(Cesium.Transforms.eastNorthUpToFixedFrame(
  26578. * Cesium.Cartesian3.fromDegrees(-95.59777, 40.03883)), new Cesium.Cartesian3(0.0, 0.0, 500000.0), new Cesium.Matrix4()),
  26579. * id : 'ellipsoid',
  26580. * attributes : {
  26581. * color : Cesium.ColorGeometryInstanceAttribute.fromColor(Cesium.Color.AQUA)
  26582. * }
  26583. * }),
  26584. * appearance : new Cesium.PerInstanceColorAppearance(),
  26585. * asynchronous : false
  26586. * }));
  26587. * @param [options] - Object with the following properties:
  26588. * @param [options.geometryInstances] - The geometry instances - or a single geometry instance - to render.
  26589. * @param [options.appearance] - The appearance used to render the primitive.
  26590. * @param [options.depthFailAppearance] - The appearance used to shade this primitive when it fails the depth test.
  26591. * @param [options.show = true] - Determines if this primitive will be shown.
  26592. * @param [options.modelMatrix = Matrix4.IDENTITY] - The 4x4 transformation matrix that transforms the primitive (all geometry instances) from model to world coordinates.
  26593. * @param [options.vertexCacheOptimize = false] - When <code>true</code>, geometry vertices are optimized for the pre and post-vertex-shader caches.
  26594. * @param [options.interleave = false] - When <code>true</code>, geometry vertex attributes are interleaved, which can slightly improve rendering performance but increases load time.
  26595. * @param [options.compressVertices = true] - When <code>true</code>, the geometry vertices are compressed, which will save memory.
  26596. * @param [options.releaseGeometryInstances = true] - When <code>true</code>, the primitive does not keep a reference to the input <code>geometryInstances</code> to save memory.
  26597. * @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.
  26598. * @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.
  26599. * @param [options.asynchronous = true] - Determines if the primitive will be created asynchronously or block until ready.
  26600. * @param [options.debugShowBoundingVolume = false] - For debugging only. Determines if this primitive's commands' bounding spheres are shown.
  26601. * @param [options.shadows = ShadowMode.DISABLED] - Determines whether this primitive casts or receives shadows from light sources.
  26602. */
  26603. export class Primitive {
  26604. constructor(options?: {
  26605. geometryInstances?: GeometryInstance[] | GeometryInstance;
  26606. appearance?: Appearance;
  26607. depthFailAppearance?: Appearance;
  26608. show?: boolean;
  26609. modelMatrix?: Matrix4;
  26610. vertexCacheOptimize?: boolean;
  26611. interleave?: boolean;
  26612. compressVertices?: boolean;
  26613. releaseGeometryInstances?: boolean;
  26614. allowPicking?: boolean;
  26615. cull?: boolean;
  26616. asynchronous?: boolean;
  26617. debugShowBoundingVolume?: boolean;
  26618. shadows?: ShadowMode;
  26619. });
  26620. /**
  26621. * The geometry instances rendered with this primitive. This may
  26622. * be <code>undefined</code> if <code>options.releaseGeometryInstances</code>
  26623. * is <code>true</code> when the primitive is constructed.
  26624. * <p>
  26625. * Changing this property after the primitive is rendered has no effect.
  26626. * </p>
  26627. */
  26628. readonly geometryInstances: GeometryInstance[] | GeometryInstance;
  26629. /**
  26630. * The {@link Appearance} used to shade this primitive. Each geometry
  26631. * instance is shaded with the same appearance. Some appearances, like
  26632. * {@link PerInstanceColorAppearance} allow giving each instance unique
  26633. * properties.
  26634. */
  26635. appearance: Appearance;
  26636. /**
  26637. * The {@link Appearance} used to shade this primitive when it fails the depth test. Each geometry
  26638. * instance is shaded with the same appearance. Some appearances, like
  26639. * {@link PerInstanceColorAppearance} allow giving each instance unique
  26640. * properties.
  26641. *
  26642. * <p>
  26643. * When using an appearance that requires a color attribute, like PerInstanceColorAppearance,
  26644. * add a depthFailColor per-instance attribute instead.
  26645. * </p>
  26646. *
  26647. * <p>
  26648. * Requires the EXT_frag_depth WebGL extension to render properly. If the extension is not supported,
  26649. * there may be artifacts.
  26650. * </p>
  26651. */
  26652. depthFailAppearance: Appearance;
  26653. /**
  26654. * The 4x4 transformation matrix that transforms the primitive (all geometry instances) from model to world coordinates.
  26655. * When this is the identity matrix, the primitive is drawn in world coordinates, i.e., Earth's WGS84 coordinates.
  26656. * Local reference frames can be used by providing a different transformation matrix, like that returned
  26657. * by {@link Transforms.eastNorthUpToFixedFrame}.
  26658. *
  26659. * <p>
  26660. * This property is only supported in 3D mode.
  26661. * </p>
  26662. * @example
  26663. * const origin = Cesium.Cartesian3.fromDegrees(-95.0, 40.0, 200000.0);
  26664. * p.modelMatrix = Cesium.Transforms.eastNorthUpToFixedFrame(origin);
  26665. */
  26666. modelMatrix: Matrix4;
  26667. /**
  26668. * Determines if the primitive will be shown. This affects all geometry
  26669. * instances in the primitive.
  26670. */
  26671. show: boolean;
  26672. /**
  26673. * When <code>true</code>, the renderer frustum culls and horizon culls the primitive's commands
  26674. * based on their bounding volume. Set this to <code>false</code> for a small performance gain
  26675. * if you are manually culling the primitive.
  26676. */
  26677. cull: boolean;
  26678. /**
  26679. * This property is for debugging only; it is not for production use nor is it optimized.
  26680. * <p>
  26681. * Draws the bounding sphere for each draw command in the primitive.
  26682. * </p>
  26683. */
  26684. debugShowBoundingVolume: boolean;
  26685. /**
  26686. * Determines whether this primitive casts or receives shadows from light sources.
  26687. */
  26688. shadows: ShadowMode;
  26689. /**
  26690. * When <code>true</code>, geometry vertices are optimized for the pre and post-vertex-shader caches.
  26691. */
  26692. readonly vertexCacheOptimize: boolean;
  26693. /**
  26694. * Determines if geometry vertex attributes are interleaved, which can slightly improve rendering performance.
  26695. */
  26696. readonly interleave: boolean;
  26697. /**
  26698. * When <code>true</code>, the primitive does not keep a reference to the input <code>geometryInstances</code> to save memory.
  26699. */
  26700. readonly releaseGeometryInstances: boolean;
  26701. /**
  26702. * When <code>true</code>, each geometry instance will only be pickable with {@link Scene#pick}. When <code>false</code>, GPU memory is saved. *
  26703. */
  26704. readonly allowPicking: boolean;
  26705. /**
  26706. * Determines if the geometry instances will be created and batched on a web worker.
  26707. */
  26708. readonly asynchronous: boolean;
  26709. /**
  26710. * When <code>true</code>, geometry vertices are compressed, which will save memory.
  26711. */
  26712. readonly compressVertices: boolean;
  26713. /**
  26714. * Determines if the primitive is complete and ready to render. If this property is
  26715. * true, the primitive will be rendered the next time that {@link Primitive#update}
  26716. * is called.
  26717. */
  26718. readonly ready: boolean;
  26719. /**
  26720. * Gets a promise that resolves when the primitive is ready to render.
  26721. */
  26722. readonly readyPromise: Promise<Primitive>;
  26723. /**
  26724. * Called when {@link Viewer} or {@link CesiumWidget} render the scene to
  26725. * get the draw commands needed to render this primitive.
  26726. * <p>
  26727. * Do not call this function directly. This is documented just to
  26728. * list the exceptions that may be propagated when the scene is rendered:
  26729. * </p>
  26730. */
  26731. update(): void;
  26732. /**
  26733. * Returns the modifiable per-instance attributes for a {@link GeometryInstance}.
  26734. * @example
  26735. * const attributes = primitive.getGeometryInstanceAttributes('an id');
  26736. * attributes.color = Cesium.ColorGeometryInstanceAttribute.toValue(Cesium.Color.AQUA);
  26737. * attributes.show = Cesium.ShowGeometryInstanceAttribute.toValue(true);
  26738. * attributes.distanceDisplayCondition = Cesium.DistanceDisplayConditionGeometryInstanceAttribute.toValue(100.0, 10000.0);
  26739. * attributes.offset = Cesium.OffsetGeometryInstanceAttribute.toValue(Cartesian3.IDENTITY);
  26740. * @param id - The id of the {@link GeometryInstance}.
  26741. * @returns The typed array in the attribute's format or undefined if the is no instance with id.
  26742. */
  26743. getGeometryInstanceAttributes(id: any): any;
  26744. /**
  26745. * Returns true if this object was destroyed; otherwise, false.
  26746. * <p>
  26747. * If this object was destroyed, it should not be used; calling any function other than
  26748. * <code>isDestroyed</code> will result in a {@link DeveloperError} exception.
  26749. * </p>
  26750. * @returns <code>true</code> if this object was destroyed; otherwise, <code>false</code>.
  26751. */
  26752. isDestroyed(): boolean;
  26753. /**
  26754. * Destroys the WebGL resources held by this object. Destroying an object allows for deterministic
  26755. * release of WebGL resources, instead of relying on the garbage collector to destroy this object.
  26756. * <p>
  26757. * Once an object is destroyed, it should not be used; calling any function other than
  26758. * <code>isDestroyed</code> will result in a {@link DeveloperError} exception. Therefore,
  26759. * assign the return value (<code>undefined</code>) to the object as done in the example.
  26760. * </p>
  26761. * @example
  26762. * e = e && e.destroy();
  26763. */
  26764. destroy(): void;
  26765. }
  26766. /**
  26767. * A collection of primitives. This is most often used with {@link Scene#primitives},
  26768. * but <code>PrimitiveCollection</code> is also a primitive itself so collections can
  26769. * be added to collections forming a hierarchy.
  26770. * @example
  26771. * const billboards = new Cesium.BillboardCollection();
  26772. * const labels = new Cesium.LabelCollection();
  26773. *
  26774. * const collection = new Cesium.PrimitiveCollection();
  26775. * collection.add(billboards);
  26776. *
  26777. * scene.primitives.add(collection); // Add collection
  26778. * scene.primitives.add(labels); // Add regular primitive
  26779. * @param [options] - Object with the following properties:
  26780. * @param [options.show = true] - Determines if the primitives in the collection will be shown.
  26781. * @param [options.destroyPrimitives = true] - Determines if primitives in the collection are destroyed when they are removed.
  26782. */
  26783. export class PrimitiveCollection {
  26784. constructor(options?: {
  26785. show?: boolean;
  26786. destroyPrimitives?: boolean;
  26787. });
  26788. /**
  26789. * Determines if primitives in this collection will be shown.
  26790. */
  26791. show: boolean;
  26792. /**
  26793. * Determines if primitives in the collection are destroyed when they are removed by
  26794. * {@link PrimitiveCollection#destroy} or {@link PrimitiveCollection#remove} or implicitly
  26795. * by {@link PrimitiveCollection#removeAll}.
  26796. * @example
  26797. * // Example 1. Primitives are destroyed by default.
  26798. * const primitives = new Cesium.PrimitiveCollection();
  26799. * const labels = primitives.add(new Cesium.LabelCollection());
  26800. * primitives = primitives.destroy();
  26801. * const b = labels.isDestroyed(); // true
  26802. * @example
  26803. * // Example 2. Do not destroy primitives in a collection.
  26804. * const primitives = new Cesium.PrimitiveCollection();
  26805. * primitives.destroyPrimitives = false;
  26806. * const labels = primitives.add(new Cesium.LabelCollection());
  26807. * primitives = primitives.destroy();
  26808. * const b = labels.isDestroyed(); // false
  26809. * labels = labels.destroy(); // explicitly destroy
  26810. */
  26811. destroyPrimitives: boolean;
  26812. /**
  26813. * Gets the number of primitives in the collection.
  26814. */
  26815. readonly length: number;
  26816. /**
  26817. * Adds a primitive to the collection.
  26818. * @example
  26819. * const billboards = scene.primitives.add(new Cesium.BillboardCollection());
  26820. * @param primitive - The primitive to add.
  26821. * @param [index] - The index to add the layer at. If omitted, the primitive will be added at the bottom of all existing primitives.
  26822. * @returns The primitive added to the collection.
  26823. */
  26824. add(primitive: any, index?: number): any;
  26825. /**
  26826. * Removes a primitive from the collection.
  26827. * @example
  26828. * const billboards = scene.primitives.add(new Cesium.BillboardCollection());
  26829. * scene.primitives.remove(billboards); // Returns true
  26830. * @param [primitive] - The primitive to remove.
  26831. * @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.
  26832. */
  26833. remove(primitive?: any): boolean;
  26834. /**
  26835. * Removes all primitives in the collection.
  26836. */
  26837. removeAll(): void;
  26838. /**
  26839. * Determines if this collection contains a primitive.
  26840. * @param [primitive] - The primitive to check for.
  26841. * @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.
  26842. */
  26843. contains(primitive?: any): boolean;
  26844. /**
  26845. * Raises a primitive "up one" in the collection. If all primitives in the collection are drawn
  26846. * on the globe surface, this visually moves the primitive up one.
  26847. * @param [primitive] - The primitive to raise.
  26848. */
  26849. raise(primitive?: any): void;
  26850. /**
  26851. * Raises a primitive to the "top" of the collection. If all primitives in the collection are drawn
  26852. * on the globe surface, this visually moves the primitive to the top.
  26853. * @param [primitive] - The primitive to raise the top.
  26854. */
  26855. raiseToTop(primitive?: any): void;
  26856. /**
  26857. * Lowers a primitive "down one" in the collection. If all primitives in the collection are drawn
  26858. * on the globe surface, this visually moves the primitive down one.
  26859. * @param [primitive] - The primitive to lower.
  26860. */
  26861. lower(primitive?: any): void;
  26862. /**
  26863. * Lowers a primitive to the "bottom" of the collection. If all primitives in the collection are drawn
  26864. * on the globe surface, this visually moves the primitive to the bottom.
  26865. * @param [primitive] - The primitive to lower to the bottom.
  26866. */
  26867. lowerToBottom(primitive?: any): void;
  26868. /**
  26869. * Returns the primitive in the collection at the specified index.
  26870. * @example
  26871. * // Toggle the show property of every primitive in the collection.
  26872. * const primitives = scene.primitives;
  26873. * const length = primitives.length;
  26874. * for (let i = 0; i < length; ++i) {
  26875. * const p = primitives.get(i);
  26876. * p.show = !p.show;
  26877. * }
  26878. * @param index - The zero-based index of the primitive to return.
  26879. * @returns The primitive at the <code>index</code>.
  26880. */
  26881. get(index: number): any;
  26882. /**
  26883. * Returns true if this object was destroyed; otherwise, false.
  26884. * <br /><br />
  26885. * If this object was destroyed, it should not be used; calling any function other than
  26886. * <code>isDestroyed</code> will result in a {@link DeveloperError} exception.
  26887. * @returns True if this object was destroyed; otherwise, false.
  26888. */
  26889. isDestroyed(): boolean;
  26890. /**
  26891. * Destroys the WebGL resources held by each primitive in this collection. Explicitly destroying this
  26892. * collection allows for deterministic release of WebGL resources, instead of relying on the garbage
  26893. * collector to destroy this collection.
  26894. * <br /><br />
  26895. * Since destroying a collection destroys all the contained primitives, only destroy a collection
  26896. * when you are sure no other code is still using any of the contained primitives.
  26897. * <br /><br />
  26898. * Once this collection is destroyed, it should not be used; calling any function other than
  26899. * <code>isDestroyed</code> will result in a {@link DeveloperError} exception. Therefore,
  26900. * assign the return value (<code>undefined</code>) to the object as done in the example.
  26901. * @example
  26902. * primitives = primitives && primitives.destroy();
  26903. */
  26904. destroy(): void;
  26905. }
  26906. /**
  26907. * The container for all 3D graphical objects and state in a Cesium virtual scene. Generally,
  26908. * a scene is not created directly; instead, it is implicitly created by {@link CesiumWidget}.
  26909. * <p>
  26910. * <em><code>contextOptions</code> parameter details:</em>
  26911. * </p>
  26912. * <p>
  26913. * The default values are:
  26914. * <code>
  26915. * {
  26916. * webgl : {
  26917. * alpha : false,
  26918. * depth : true,
  26919. * stencil : false,
  26920. * antialias : true,
  26921. * powerPreference: 'high-performance',
  26922. * premultipliedAlpha : true,
  26923. * preserveDrawingBuffer : false,
  26924. * failIfMajorPerformanceCaveat : false
  26925. * },
  26926. * allowTextureFilterAnisotropic : true
  26927. * }
  26928. * </code>
  26929. * </p>
  26930. * <p>
  26931. * The <code>webgl</code> property corresponds to the {@link http://www.khronos.org/registry/webgl/specs/latest/#5.2|WebGLContextAttributes}
  26932. * object used to create the WebGL context.
  26933. * </p>
  26934. * <p>
  26935. * <code>webgl.alpha</code> defaults to false, which can improve performance compared to the standard WebGL default
  26936. * of true. If an application needs to composite Cesium above other HTML elements using alpha-blending, set
  26937. * <code>webgl.alpha</code> to true.
  26938. * </p>
  26939. * <p>
  26940. * The other <code>webgl</code> properties match the WebGL defaults for {@link http://www.khronos.org/registry/webgl/specs/latest/#5.2|WebGLContextAttributes}.
  26941. * </p>
  26942. * <p>
  26943. * <code>allowTextureFilterAnisotropic</code> defaults to true, which enables anisotropic texture filtering when the
  26944. * WebGL extension is supported. Setting this to false will improve performance, but hurt visual quality, especially for horizon views.
  26945. * </p>
  26946. * @example
  26947. * // Create scene without anisotropic texture filtering
  26948. * const scene = new Cesium.Scene({
  26949. * canvas : canvas,
  26950. * contextOptions : {
  26951. * allowTextureFilterAnisotropic : false
  26952. * }
  26953. * });
  26954. * @param options - Object with the following properties:
  26955. * @param options.canvas - The HTML canvas element to create the scene for.
  26956. * @param [options.contextOptions] - Context and WebGL creation properties. See details above.
  26957. * @param [options.creditContainer] - The HTML element in which the credits will be displayed.
  26958. * @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.
  26959. * @param [options.mapProjection = new GeographicProjection()] - The map projection to use in 2D and Columbus View modes.
  26960. * @param [options.orderIndependentTranslucency = true] - If true and the configuration supports it, use order independent translucency.
  26961. * @param [options.scene3DOnly = false] - If true, optimizes memory use and performance for 3D mode but disables the ability to use 2D or Columbus View.
  26962. * @param [options.shadows = false] - Determines if shadows are cast by light sources.
  26963. * @param [options.mapMode2D = MapMode2D.INFINITE_SCROLL] - Determines if the 2D map is rotatable or can be scrolled infinitely in the horizontal direction.
  26964. * @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.
  26965. * @param [options.maximumRenderTimeChange = 0.0] - If requestRenderMode is true, this value defines the maximum change in simulation time allowed before a render is requested.
  26966. * @param [depthPlaneEllipsoidOffset = 0.0] - Adjust the DepthPlane to address rendering artefacts below ellipsoid zero elevation.
  26967. * @param [options.msaaSamples = 1] - If provided, this value controls the rate of multisample antialiasing. Typical multisampling rates are 2, 4, and sometimes 8 samples per pixel. Higher sampling rates of MSAA may impact performance in exchange for improved visual quality. This value only applies to WebGL2 contexts that support multisample render targets.
  26968. */
  26969. export class Scene {
  26970. constructor(options: {
  26971. canvas: HTMLCanvasElement;
  26972. contextOptions?: any;
  26973. creditContainer?: Element;
  26974. creditViewport?: Element;
  26975. mapProjection?: MapProjection;
  26976. orderIndependentTranslucency?: boolean;
  26977. scene3DOnly?: boolean;
  26978. shadows?: boolean;
  26979. mapMode2D?: MapMode2D;
  26980. requestRenderMode?: boolean;
  26981. maximumRenderTimeChange?: number;
  26982. msaaSamples?: number;
  26983. }, depthPlaneEllipsoidOffset?: number);
  26984. /**
  26985. * Exceptions occurring in <code>render</code> are always caught in order to raise the
  26986. * <code>renderError</code> event. If this property is true, the error is rethrown
  26987. * after the event is raised. If this property is false, the <code>render</code> function
  26988. * returns normally after raising the event.
  26989. */
  26990. rethrowRenderErrors: boolean;
  26991. /**
  26992. * Determines whether or not to instantly complete the
  26993. * scene transition animation on user input.
  26994. */
  26995. completeMorphOnUserInput: boolean;
  26996. /**
  26997. * The event fired at the beginning of a scene transition.
  26998. */
  26999. morphStart: Event;
  27000. /**
  27001. * The event fired at the completion of a scene transition.
  27002. */
  27003. morphComplete: Event;
  27004. /**
  27005. * The {@link SkyBox} used to draw the stars.
  27006. */
  27007. skyBox: SkyBox;
  27008. /**
  27009. * The sky atmosphere drawn around the globe.
  27010. */
  27011. skyAtmosphere: SkyAtmosphere;
  27012. /**
  27013. * The {@link Sun}.
  27014. */
  27015. sun: Sun;
  27016. /**
  27017. * Uses a bloom filter on the sun when enabled.
  27018. */
  27019. sunBloom: boolean;
  27020. /**
  27021. * The {@link Moon}
  27022. */
  27023. moon: Moon;
  27024. /**
  27025. * The background color, which is only visible if there is no sky box, i.e., {@link Scene#skyBox} is undefined.
  27026. */
  27027. backgroundColor: Color;
  27028. /**
  27029. * The current morph transition time between 2D/Columbus View and 3D,
  27030. * with 0.0 being 2D or Columbus View and 1.0 being 3D.
  27031. */
  27032. morphTime: number;
  27033. /**
  27034. * The far-to-near ratio of the multi-frustum when using a normal depth buffer.
  27035. * <p>
  27036. * This value is used to create the near and far values for each frustum of the multi-frustum. It is only used
  27037. * when {@link Scene#logarithmicDepthBuffer} is <code>false</code>. When <code>logarithmicDepthBuffer</code> is
  27038. * <code>true</code>, use {@link Scene#logarithmicDepthFarToNearRatio}.
  27039. * </p>
  27040. */
  27041. farToNearRatio: number;
  27042. /**
  27043. * The far-to-near ratio of the multi-frustum when using a logarithmic depth buffer.
  27044. * <p>
  27045. * This value is used to create the near and far values for each frustum of the multi-frustum. It is only used
  27046. * when {@link Scene#logarithmicDepthBuffer} is <code>true</code>. When <code>logarithmicDepthBuffer</code> is
  27047. * <code>false</code>, use {@link Scene#farToNearRatio}.
  27048. * </p>
  27049. */
  27050. logarithmicDepthFarToNearRatio: number;
  27051. /**
  27052. * Determines the uniform depth size in meters of each frustum of the multifrustum in 2D. If a primitive or model close
  27053. * to the surface shows z-fighting, decreasing this will eliminate the artifact, but decrease performance. On the
  27054. * other hand, increasing this will increase performance but may cause z-fighting among primitives close to the surface.
  27055. */
  27056. nearToFarDistance2D: number;
  27057. /**
  27058. * This property is for debugging only; it is not for production use.
  27059. * <p>
  27060. * A function that determines what commands are executed. As shown in the examples below,
  27061. * the function receives the command's <code>owner</code> as an argument, and returns a boolean indicating if the
  27062. * command should be executed.
  27063. * </p>
  27064. * <p>
  27065. * The default is <code>undefined</code>, indicating that all commands are executed.
  27066. * </p>
  27067. * @example
  27068. * // Do not execute any commands.
  27069. * scene.debugCommandFilter = function(command) {
  27070. * return false;
  27071. * };
  27072. *
  27073. * // Execute only the billboard's commands. That is, only draw the billboard.
  27074. * const billboards = new Cesium.BillboardCollection();
  27075. * scene.debugCommandFilter = function(command) {
  27076. * return command.owner === billboards;
  27077. * };
  27078. */
  27079. debugCommandFilter: (...params: any[]) => any;
  27080. /**
  27081. * This property is for debugging only; it is not for production use.
  27082. * <p>
  27083. * When <code>true</code>, commands are randomly shaded. This is useful
  27084. * for performance analysis to see what parts of a scene or model are
  27085. * command-dense and could benefit from batching.
  27086. * </p>
  27087. */
  27088. debugShowCommands: boolean;
  27089. /**
  27090. * This property is for debugging only; it is not for production use.
  27091. * <p>
  27092. * When <code>true</code>, commands are shaded based on the frustums they
  27093. * overlap. Commands in the closest frustum are tinted red, commands in
  27094. * the next closest are green, and commands in the farthest frustum are
  27095. * blue. If a command overlaps more than one frustum, the color components
  27096. * are combined, e.g., a command overlapping the first two frustums is tinted
  27097. * yellow.
  27098. * </p>
  27099. */
  27100. debugShowFrustums: boolean;
  27101. /**
  27102. * This property is for debugging only; it is not for production use.
  27103. * <p>
  27104. * Displays frames per second and time between frames.
  27105. * </p>
  27106. */
  27107. debugShowFramesPerSecond: boolean;
  27108. /**
  27109. * This property is for debugging only; it is not for production use.
  27110. * <p>
  27111. * Indicates which frustum will have depth information displayed.
  27112. * </p>
  27113. */
  27114. debugShowDepthFrustum: number;
  27115. /**
  27116. * This property is for debugging only; it is not for production use.
  27117. * <p>
  27118. * When <code>true</code>, draws outlines to show the boundaries of the camera frustums
  27119. * </p>
  27120. */
  27121. debugShowFrustumPlanes: boolean;
  27122. /**
  27123. * When <code>true</code>, enables picking using the depth buffer.
  27124. */
  27125. useDepthPicking: boolean;
  27126. /**
  27127. * 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.
  27128. *
  27129. * <p>
  27130. * There is a decrease in performance when enabled. There are extra draw calls to write depth for
  27131. * translucent geometry.
  27132. * </p>
  27133. * @example
  27134. * // picking the position of a translucent primitive
  27135. * viewer.screenSpaceEventHandler.setInputAction(function onLeftClick(movement) {
  27136. * const pickedFeature = viewer.scene.pick(movement.position);
  27137. * if (!Cesium.defined(pickedFeature)) {
  27138. * // nothing picked
  27139. * return;
  27140. * }
  27141. * const worldPosition = viewer.scene.pickPosition(movement.position);
  27142. * }, Cesium.ScreenSpaceEventType.LEFT_CLICK);
  27143. */
  27144. pickTranslucentDepth: boolean;
  27145. /**
  27146. * Blends the atmosphere to geometry far from the camera for horizon views. Allows for additional
  27147. * performance improvements by rendering less geometry and dispatching less terrain requests.
  27148. */
  27149. fog: Fog;
  27150. /**
  27151. * The shadow map for the scene's light source. When enabled, models, primitives, and the globe may cast and receive shadows.
  27152. */
  27153. shadowMap: ShadowMap;
  27154. /**
  27155. * When <code>false</code>, 3D Tiles will render normally. When <code>true</code>, classified 3D Tile geometry will render normally and
  27156. * unclassified 3D Tile geometry will render with the color multiplied by {@link Scene#invertClassificationColor}.
  27157. */
  27158. invertClassification: boolean;
  27159. /**
  27160. * The highlight color of unclassified 3D Tile geometry when {@link Scene#invertClassification} is <code>true</code>.
  27161. * <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>
  27162. * <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>
  27163. */
  27164. invertClassificationColor: Color;
  27165. /**
  27166. * The focal length for use when with cardboard or WebVR.
  27167. */
  27168. focalLength: number;
  27169. /**
  27170. * The eye separation distance in meters for use with cardboard or WebVR.
  27171. */
  27172. eyeSeparation: number;
  27173. /**
  27174. * Post processing effects applied to the final render.
  27175. */
  27176. postProcessStages: PostProcessStageCollection;
  27177. /**
  27178. * When <code>true</code>, rendering a frame will only occur when needed as determined by changes within the scene.
  27179. * Enabling improves performance of the application, but requires using {@link Scene#requestRender}
  27180. * to render a new frame explicitly in this mode. This will be necessary in many cases after making changes
  27181. * to the scene in other parts of the API.
  27182. */
  27183. requestRenderMode: boolean;
  27184. /**
  27185. * If {@link Scene#requestRenderMode} is <code>true</code>, this value defines the maximum change in
  27186. * simulation time allowed before a render is requested. Lower values increase the number of frames rendered
  27187. * and higher values decrease the number of frames rendered. If <code>undefined</code>, changes to
  27188. * the simulation time will never request a render.
  27189. * This value impacts the rate of rendering for changes in the scene like lighting, entity property updates,
  27190. * and animations.
  27191. */
  27192. maximumRenderTimeChange: number;
  27193. /**
  27194. * The spherical harmonic coefficients for image-based lighting of PBR models.
  27195. */
  27196. sphericalHarmonicCoefficients: Cartesian3[];
  27197. /**
  27198. * The url to the KTX2 file containing the specular environment map and convoluted mipmaps for image-based lighting of PBR models.
  27199. */
  27200. specularEnvironmentMaps: string;
  27201. /**
  27202. * The light source for shading. Defaults to a directional light from the Sun.
  27203. */
  27204. light: Light;
  27205. /**
  27206. * Gets the canvas element to which this scene is bound.
  27207. */
  27208. readonly canvas: HTMLCanvasElement;
  27209. /**
  27210. * The drawingBufferHeight of the underlying GL context.
  27211. */
  27212. readonly drawingBufferHeight: number;
  27213. /**
  27214. * The drawingBufferHeight of the underlying GL context.
  27215. */
  27216. readonly drawingBufferWidth: number;
  27217. /**
  27218. * The maximum aliased line width, in pixels, supported by this WebGL implementation. It will be at least one.
  27219. */
  27220. readonly maximumAliasedLineWidth: number;
  27221. /**
  27222. * The maximum length in pixels of one edge of a cube map, supported by this WebGL implementation. It will be at least 16.
  27223. */
  27224. readonly maximumCubeMapSize: number;
  27225. /**
  27226. * Returns <code>true</code> if the {@link Scene#pickPosition} function is supported.
  27227. */
  27228. readonly pickPositionSupported: boolean;
  27229. /**
  27230. * Returns <code>true</code> if the {@link Scene#sampleHeight} and {@link Scene#sampleHeightMostDetailed} functions are supported.
  27231. */
  27232. readonly sampleHeightSupported: boolean;
  27233. /**
  27234. * Returns <code>true</code> if the {@link Scene#clampToHeight} and {@link Scene#clampToHeightMostDetailed} functions are supported.
  27235. */
  27236. readonly clampToHeightSupported: boolean;
  27237. /**
  27238. * Returns <code>true</code> if the {@link Scene#invertClassification} is supported.
  27239. */
  27240. readonly invertClassificationSupported: boolean;
  27241. /**
  27242. * Returns <code>true</code> if specular environment maps are supported.
  27243. */
  27244. readonly specularEnvironmentMapsSupported: boolean;
  27245. /**
  27246. * Gets or sets the depth-test ellipsoid.
  27247. */
  27248. globe: Globe;
  27249. /**
  27250. * Gets the collection of primitives.
  27251. */
  27252. readonly primitives: PrimitiveCollection;
  27253. /**
  27254. * Gets the collection of ground primitives.
  27255. */
  27256. readonly groundPrimitives: PrimitiveCollection;
  27257. /**
  27258. * Gets or sets the camera.
  27259. */
  27260. readonly camera: Camera;
  27261. /**
  27262. * Gets the controller for camera input handling.
  27263. */
  27264. readonly screenSpaceCameraController: ScreenSpaceCameraController;
  27265. /**
  27266. * Get the map projection to use in 2D and Columbus View modes.
  27267. */
  27268. readonly mapProjection: MapProjection;
  27269. /**
  27270. * Gets the collection of image layers that will be rendered on the globe.
  27271. */
  27272. readonly imageryLayers: ImageryLayerCollection;
  27273. /**
  27274. * The terrain provider providing surface geometry for the globe.
  27275. */
  27276. terrainProvider: TerrainProvider;
  27277. /**
  27278. * Gets an event that's raised when the terrain provider is changed
  27279. */
  27280. readonly terrainProviderChanged: Event;
  27281. /**
  27282. * Gets the event that will be raised before the scene is updated or rendered. Subscribers to the event
  27283. * receive the Scene instance as the first parameter and the current time as the second parameter.
  27284. */
  27285. readonly preUpdate: Event;
  27286. /**
  27287. * Gets the event that will be raised immediately after the scene is updated and before the scene is rendered.
  27288. * Subscribers to the event receive the Scene instance as the first parameter and the current time as the second
  27289. * parameter.
  27290. */
  27291. readonly postUpdate: Event;
  27292. /**
  27293. * Gets the event that will be raised when an error is thrown inside the <code>render</code> function.
  27294. * The Scene instance and the thrown error are the only two parameters passed to the event handler.
  27295. * By default, errors are not rethrown after this event is raised, but that can be changed by setting
  27296. * the <code>rethrowRenderErrors</code> property.
  27297. */
  27298. readonly renderError: Event;
  27299. /**
  27300. * Gets the event that will be raised after the scene is updated and immediately before the scene is rendered.
  27301. * Subscribers to the event receive the Scene instance as the first parameter and the current time as the second
  27302. * parameter.
  27303. */
  27304. readonly preRender: Event;
  27305. /**
  27306. * Gets the event that will be raised immediately after the scene is rendered. Subscribers to the event
  27307. * receive the Scene instance as the first parameter and the current time as the second parameter.
  27308. */
  27309. readonly postRender: Event;
  27310. /**
  27311. * Gets the simulation time when the scene was last rendered. Returns undefined if the scene has not yet been
  27312. * rendered.
  27313. */
  27314. readonly lastRenderTime: JulianDate;
  27315. /**
  27316. * This property is for debugging only; it is not for production use.
  27317. * <p>
  27318. * When {@link Scene.debugShowFrustums} is <code>true</code>, this contains
  27319. * properties with statistics about the number of command execute per frustum.
  27320. * <code>totalCommands</code> is the total number of commands executed, ignoring
  27321. * overlap. <code>commandsInFrustums</code> is an array with the number of times
  27322. * commands are executed redundantly, e.g., how many commands overlap two or
  27323. * three frustums.
  27324. * </p>
  27325. */
  27326. readonly debugFrustumStatistics: any;
  27327. /**
  27328. * Gets whether or not the scene is optimized for 3D only viewing.
  27329. */
  27330. readonly scene3DOnly: boolean;
  27331. /**
  27332. * Gets whether or not the scene has order independent translucency enabled.
  27333. * Note that this only reflects the original construction option, and there are
  27334. * other factors that could prevent OIT from functioning on a given system configuration.
  27335. */
  27336. readonly orderIndependentTranslucency: boolean;
  27337. /**
  27338. * Gets the unique identifier for this scene.
  27339. */
  27340. readonly id: string;
  27341. /**
  27342. * Gets or sets the current mode of the scene.
  27343. */
  27344. mode: SceneMode;
  27345. /**
  27346. * When <code>true</code>, splits the scene into two viewports with steroscopic views for the left and right eyes.
  27347. * Used for cardboard and WebVR.
  27348. */
  27349. useWebVR: boolean;
  27350. /**
  27351. * Determines if the 2D map is rotatable or can be scrolled infinitely in the horizontal direction.
  27352. */
  27353. readonly mapMode2D: MapMode2D;
  27354. /**
  27355. * Gets or sets the position of the splitter within the viewport. Valid values are between 0.0 and 1.0.
  27356. */
  27357. splitPosition: number;
  27358. /**
  27359. * The distance from the camera at which to disable the depth test of billboards, labels and points
  27360. * to, for example, prevent clipping against terrain. When set to zero, the depth test should always
  27361. * be applied. When less than zero, the depth test should never be applied. Setting the disableDepthTestDistance
  27362. * property of a billboard, label or point will override this value.
  27363. */
  27364. minimumDisableDepthTestDistance: number;
  27365. /**
  27366. * Whether or not to use a logarithmic depth buffer. Enabling this option will allow for less frustums in the multi-frustum,
  27367. * increasing performance. This property relies on fragmentDepth being supported.
  27368. */
  27369. logarithmicDepthBuffer: boolean;
  27370. /**
  27371. * The value used for gamma correction. This is only used when rendering with high dynamic range.
  27372. */
  27373. gamma: number;
  27374. /**
  27375. * Whether or not to use high dynamic range rendering.
  27376. */
  27377. highDynamicRange: boolean;
  27378. /**
  27379. * Whether or not high dynamic range rendering is supported.
  27380. */
  27381. readonly highDynamicRangeSupported: boolean;
  27382. /**
  27383. * Whether or not the camera is underneath the globe.
  27384. */
  27385. readonly cameraUnderground: boolean;
  27386. /**
  27387. * The sample rate of multisample antialiasing (values greater than 1 enable MSAA).
  27388. */
  27389. msaaSamples: number;
  27390. /**
  27391. * Returns <code>true</code> if the Scene's context supports MSAA.
  27392. */
  27393. readonly msaaSupported: boolean;
  27394. /**
  27395. * Determines if a compressed texture format is supported.
  27396. * @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.
  27397. * @returns Whether or not the format is supported.
  27398. */
  27399. getCompressedTextureFormatSupported(format: string): boolean;
  27400. /**
  27401. * Update and render the scene. It is usually not necessary to call this function
  27402. * directly because {@link CesiumWidget} or {@link Viewer} do it automatically.
  27403. * @param [time] - The simulation time at which to render.
  27404. */
  27405. render(time?: JulianDate): void;
  27406. /**
  27407. * Requests a new rendered frame when {@link Scene#requestRenderMode} is set to <code>true</code>.
  27408. * The render rate will not exceed the {@link CesiumWidget#targetFrameRate}.
  27409. */
  27410. requestRender(): void;
  27411. /**
  27412. * Returns an object with a `primitive` property that contains the first (top) primitive in the scene
  27413. * at a particular window coordinate or undefined if nothing is at the location. Other properties may
  27414. * potentially be set depending on the type of primitive and may be used to further identify the picked object.
  27415. * <p>
  27416. * When a feature of a 3D Tiles tileset is picked, <code>pick</code> returns a {@link Cesium3DTileFeature} object.
  27417. * </p>
  27418. * @example
  27419. * // On mouse over, color the feature yellow.
  27420. * handler.setInputAction(function(movement) {
  27421. * const feature = scene.pick(movement.endPosition);
  27422. * if (feature instanceof Cesium.Cesium3DTileFeature) {
  27423. * feature.color = Cesium.Color.YELLOW;
  27424. * }
  27425. * }, Cesium.ScreenSpaceEventType.MOUSE_MOVE);
  27426. * @param windowPosition - Window coordinates to perform picking on.
  27427. * @param [width = 3] - Width of the pick rectangle.
  27428. * @param [height = 3] - Height of the pick rectangle.
  27429. * @returns Object containing the picked primitive.
  27430. */
  27431. pick(windowPosition: Cartesian2, width?: number, height?: number): any;
  27432. /**
  27433. * Returns the cartesian position reconstructed from the depth buffer and window position.
  27434. * <p>
  27435. * The position reconstructed from the depth buffer in 2D may be slightly different from those
  27436. * reconstructed in 3D and Columbus view. This is caused by the difference in the distribution
  27437. * of depth values of perspective and orthographic projection.
  27438. * </p>
  27439. * <p>
  27440. * Set {@link Scene#pickTranslucentDepth} to <code>true</code> to include the depth of
  27441. * translucent primitives; otherwise, this essentially picks through translucent primitives.
  27442. * </p>
  27443. * @param windowPosition - Window coordinates to perform picking on.
  27444. * @param [result] - The object on which to restore the result.
  27445. * @returns The cartesian position.
  27446. */
  27447. pickPosition(windowPosition: Cartesian2, result?: Cartesian3): Cartesian3;
  27448. /**
  27449. * Returns a list of objects, each containing a `primitive` property, for all primitives at
  27450. * a particular window coordinate position. Other properties may also be set depending on the
  27451. * type of primitive and may be used to further identify the picked object. The primitives in
  27452. * the list are ordered by their visual order in the scene (front to back).
  27453. * @example
  27454. * const pickedObjects = scene.drillPick(new Cesium.Cartesian2(100.0, 200.0));
  27455. * @param windowPosition - Window coordinates to perform picking on.
  27456. * @param [limit] - If supplied, stop drilling after collecting this many picks.
  27457. * @param [width = 3] - Width of the pick rectangle.
  27458. * @param [height = 3] - Height of the pick rectangle.
  27459. * @returns Array of objects, each containing 1 picked primitives.
  27460. */
  27461. drillPick(windowPosition: Cartesian2, limit?: number, width?: number, height?: number): any[];
  27462. /**
  27463. * Returns the height of scene geometry at the given cartographic position or <code>undefined</code> if there was no
  27464. * scene geometry to sample height from. The height of the input position is ignored. May be used to clamp objects to
  27465. * the globe, 3D Tiles, or primitives in the scene.
  27466. * <p>
  27467. * This function only samples height from globe tiles and 3D Tiles that are rendered in the current view. Samples height
  27468. * from all other primitives regardless of their visibility.
  27469. * </p>
  27470. * @example
  27471. * const position = new Cesium.Cartographic(-1.31968, 0.698874);
  27472. * const height = viewer.scene.sampleHeight(position);
  27473. * console.log(height);
  27474. * @param position - The cartographic position to sample height from.
  27475. * @param [objectsToExclude] - A list of primitives, entities, or 3D Tiles features to not sample height from.
  27476. * @param [width = 0.1] - Width of the intersection volume in meters.
  27477. * @returns The height. This may be <code>undefined</code> if there was no scene geometry to sample height from.
  27478. */
  27479. sampleHeight(position: Cartographic, objectsToExclude?: object[], width?: number): number;
  27480. /**
  27481. * Clamps the given cartesian position to the scene geometry along the geodetic surface normal. Returns the
  27482. * clamped position or <code>undefined</code> if there was no scene geometry to clamp to. May be used to clamp
  27483. * objects to the globe, 3D Tiles, or primitives in the scene.
  27484. * <p>
  27485. * This function only clamps to globe tiles and 3D Tiles that are rendered in the current view. Clamps to
  27486. * all other primitives regardless of their visibility.
  27487. * </p>
  27488. * @example
  27489. * // Clamp an entity to the underlying scene geometry
  27490. * const position = entity.position.getValue(Cesium.JulianDate.now());
  27491. * entity.position = viewer.scene.clampToHeight(position);
  27492. * @param cartesian - The cartesian position.
  27493. * @param [objectsToExclude] - A list of primitives, entities, or 3D Tiles features to not clamp to.
  27494. * @param [width = 0.1] - Width of the intersection volume in meters.
  27495. * @param [result] - An optional object to return the clamped position.
  27496. * @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.
  27497. */
  27498. clampToHeight(cartesian: Cartesian3, objectsToExclude?: object[], width?: number, result?: Cartesian3): Cartesian3;
  27499. /**
  27500. * Initiates an asynchronous {@link Scene#sampleHeight} query for an array of {@link Cartographic} positions
  27501. * using the maximum level of detail for 3D Tilesets in the scene. The height of the input positions is ignored.
  27502. * Returns a promise that is resolved when the query completes. Each point height is modified in place.
  27503. * If a height cannot be determined because no geometry can be sampled at that location, or another error occurs,
  27504. * the height is set to undefined.
  27505. * @example
  27506. * const positions = [
  27507. * new Cesium.Cartographic(-1.31968, 0.69887),
  27508. * new Cesium.Cartographic(-1.10489, 0.83923)
  27509. * ];
  27510. * const promise = viewer.scene.sampleHeightMostDetailed(positions);
  27511. * promise.then(function(updatedPosition) {
  27512. * // positions[0].height and positions[1].height have been updated.
  27513. * // updatedPositions is just a reference to positions.
  27514. * }
  27515. * @param positions - The cartographic positions to update with sampled heights.
  27516. * @param [objectsToExclude] - A list of primitives, entities, or 3D Tiles features to not sample height from.
  27517. * @param [width = 0.1] - Width of the intersection volume in meters.
  27518. * @returns A promise that resolves to the provided list of positions when the query has completed.
  27519. */
  27520. sampleHeightMostDetailed(positions: Cartographic[], objectsToExclude?: object[], width?: number): Promise<Cartographic[]>;
  27521. /**
  27522. * Initiates an asynchronous {@link Scene#clampToHeight} query for an array of {@link Cartesian3} positions
  27523. * using the maximum level of detail for 3D Tilesets in the scene. Returns a promise that is resolved when
  27524. * the query completes. Each position is modified in place. If a position cannot be clamped because no geometry
  27525. * can be sampled at that location, or another error occurs, the element in the array is set to undefined.
  27526. * @example
  27527. * const cartesians = [
  27528. * entities[0].position.getValue(Cesium.JulianDate.now()),
  27529. * entities[1].position.getValue(Cesium.JulianDate.now())
  27530. * ];
  27531. * const promise = viewer.scene.clampToHeightMostDetailed(cartesians);
  27532. * promise.then(function(updatedCartesians) {
  27533. * entities[0].position = updatedCartesians[0];
  27534. * entities[1].position = updatedCartesians[1];
  27535. * }
  27536. * @param cartesians - The cartesian positions to update with clamped positions.
  27537. * @param [objectsToExclude] - A list of primitives, entities, or 3D Tiles features to not clamp to.
  27538. * @param [width = 0.1] - Width of the intersection volume in meters.
  27539. * @returns A promise that resolves to the provided list of positions when the query has completed.
  27540. */
  27541. clampToHeightMostDetailed(cartesians: Cartesian3[], objectsToExclude?: object[], width?: number): Promise<Cartesian3[]>;
  27542. /**
  27543. * Transforms a position in cartesian coordinates to canvas coordinates. This is commonly used to place an
  27544. * HTML element at the same screen position as an object in the scene.
  27545. * @example
  27546. * // Output the canvas position of longitude/latitude (0, 0) every time the mouse moves.
  27547. * const scene = widget.scene;
  27548. * const ellipsoid = scene.globe.ellipsoid;
  27549. * const position = Cesium.Cartesian3.fromDegrees(0.0, 0.0);
  27550. * const handler = new Cesium.ScreenSpaceEventHandler(scene.canvas);
  27551. * handler.setInputAction(function(movement) {
  27552. * console.log(scene.cartesianToCanvasCoordinates(position));
  27553. * }, Cesium.ScreenSpaceEventType.MOUSE_MOVE);
  27554. * @param position - The position in cartesian coordinates.
  27555. * @param [result] - An optional object to return the input position transformed to canvas coordinates.
  27556. * @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.
  27557. */
  27558. cartesianToCanvasCoordinates(position: Cartesian3, result?: Cartesian2): Cartesian2;
  27559. /**
  27560. * Instantly completes an active transition.
  27561. */
  27562. completeMorph(): void;
  27563. /**
  27564. * Asynchronously transitions the scene to 2D.
  27565. * @param [duration = 2.0] - The amount of time, in seconds, for transition animations to complete.
  27566. */
  27567. morphTo2D(duration?: number): void;
  27568. /**
  27569. * Asynchronously transitions the scene to Columbus View.
  27570. * @param [duration = 2.0] - The amount of time, in seconds, for transition animations to complete.
  27571. */
  27572. morphToColumbusView(duration?: number): void;
  27573. /**
  27574. * Asynchronously transitions the scene to 3D.
  27575. * @param [duration = 2.0] - The amount of time, in seconds, for transition animations to complete.
  27576. */
  27577. morphTo3D(duration?: number): void;
  27578. /**
  27579. * Returns true if this object was destroyed; otherwise, false.
  27580. * <br /><br />
  27581. * If this object was destroyed, it should not be used; calling any function other than
  27582. * <code>isDestroyed</code> will result in a {@link DeveloperError} exception.
  27583. * @returns <code>true</code> if this object was destroyed; otherwise, <code>false</code>.
  27584. */
  27585. isDestroyed(): boolean;
  27586. /**
  27587. * Destroys the WebGL resources held by this object. Destroying an object allows for deterministic
  27588. * release of WebGL resources, instead of relying on the garbage collector to destroy this object.
  27589. * <br /><br />
  27590. * Once an object is destroyed, it should not be used; calling any function other than
  27591. * <code>isDestroyed</code> will result in a {@link DeveloperError} exception. Therefore,
  27592. * assign the return value (<code>undefined</code>) to the object as done in the example.
  27593. * @example
  27594. * scene = scene && scene.destroy();
  27595. */
  27596. destroy(): void;
  27597. }
  27598. /**
  27599. * Indicates if the scene is viewed in 3D, 2D, or 2.5D Columbus view.
  27600. */
  27601. export enum SceneMode {
  27602. /**
  27603. * Morphing between mode, e.g., 3D to 2D.
  27604. */
  27605. MORPHING = 0,
  27606. /**
  27607. * Columbus View mode. A 2.5D perspective view where the map is laid out
  27608. * flat and objects with non-zero height are drawn above it.
  27609. */
  27610. COLUMBUS_VIEW = 1,
  27611. /**
  27612. * 2D mode. The map is viewed top-down with an orthographic projection.
  27613. */
  27614. SCENE2D = 2,
  27615. /**
  27616. * 3D mode. A traditional 3D perspective view of the globe.
  27617. */
  27618. SCENE3D = 3
  27619. }
  27620. /**
  27621. * Functions that do scene-dependent transforms between rendering-related coordinate systems.
  27622. */
  27623. export namespace SceneTransforms {
  27624. /**
  27625. * Transforms a position in WGS84 coordinates to window coordinates. This is commonly used to place an
  27626. * HTML element at the same screen position as an object in the scene.
  27627. * @example
  27628. * // Output the window position of longitude/latitude (0, 0) every time the mouse moves.
  27629. * const scene = widget.scene;
  27630. * const ellipsoid = scene.globe.ellipsoid;
  27631. * const position = Cesium.Cartesian3.fromDegrees(0.0, 0.0);
  27632. * const handler = new Cesium.ScreenSpaceEventHandler(scene.canvas);
  27633. * handler.setInputAction(function(movement) {
  27634. * console.log(Cesium.SceneTransforms.wgs84ToWindowCoordinates(scene, position));
  27635. * }, Cesium.ScreenSpaceEventType.MOUSE_MOVE);
  27636. * @param scene - The scene.
  27637. * @param position - The position in WGS84 (world) coordinates.
  27638. * @param [result] - An optional object to return the input position transformed to window coordinates.
  27639. * @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.
  27640. */
  27641. function wgs84ToWindowCoordinates(scene: Scene, position: Cartesian3, result?: Cartesian2): Cartesian2;
  27642. /**
  27643. * Transforms a position in WGS84 coordinates to drawing buffer coordinates. This may produce different
  27644. * results from SceneTransforms.wgs84ToWindowCoordinates when the browser zoom is not 100%, or on high-DPI displays.
  27645. * @example
  27646. * // Output the window position of longitude/latitude (0, 0) every time the mouse moves.
  27647. * const scene = widget.scene;
  27648. * const ellipsoid = scene.globe.ellipsoid;
  27649. * const position = Cesium.Cartesian3.fromDegrees(0.0, 0.0);
  27650. * const handler = new Cesium.ScreenSpaceEventHandler(scene.canvas);
  27651. * handler.setInputAction(function(movement) {
  27652. * console.log(Cesium.SceneTransforms.wgs84ToWindowCoordinates(scene, position));
  27653. * }, Cesium.ScreenSpaceEventType.MOUSE_MOVE);
  27654. * @param scene - The scene.
  27655. * @param position - The position in WGS84 (world) coordinates.
  27656. * @param [result] - An optional object to return the input position transformed to window coordinates.
  27657. * @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.
  27658. */
  27659. function wgs84ToDrawingBufferCoordinates(scene: Scene, position: Cartesian3, result?: Cartesian2): Cartesian2;
  27660. }
  27661. /**
  27662. * Modifies the camera position and orientation based on mouse input to a canvas.
  27663. * @param scene - The scene.
  27664. */
  27665. export class ScreenSpaceCameraController {
  27666. constructor(scene: Scene);
  27667. /**
  27668. * If true, inputs are allowed conditionally with the flags enableTranslate, enableZoom,
  27669. * enableRotate, enableTilt, and enableLook. If false, all inputs are disabled.
  27670. *
  27671. * NOTE: This setting is for temporary use cases, such as camera flights and
  27672. * drag-selection of regions (see Picking demo). It is typically set to false at the
  27673. * start of such events, and set true on completion. To keep inputs disabled
  27674. * past the end of camera flights, you must use the other booleans (enableTranslate,
  27675. * enableZoom, enableRotate, enableTilt, and enableLook).
  27676. */
  27677. enableInputs: boolean;
  27678. /**
  27679. * If true, allows the user to pan around the map. If false, the camera stays locked at the current position.
  27680. * This flag only applies in 2D and Columbus view modes.
  27681. */
  27682. enableTranslate: boolean;
  27683. /**
  27684. * If true, allows the user to zoom in and out. If false, the camera is locked to the current distance from the ellipsoid.
  27685. */
  27686. enableZoom: boolean;
  27687. /**
  27688. * If true, allows the user to rotate the world which translates the user's position.
  27689. * This flag only applies in 2D and 3D.
  27690. */
  27691. enableRotate: boolean;
  27692. /**
  27693. * If true, allows the user to tilt the camera. If false, the camera is locked to the current heading.
  27694. * This flag only applies in 3D and Columbus view.
  27695. */
  27696. enableTilt: boolean;
  27697. /**
  27698. * If true, allows the user to use free-look. If false, the camera view direction can only be changed through translating
  27699. * or rotating. This flag only applies in 3D and Columbus view modes.
  27700. */
  27701. enableLook: boolean;
  27702. /**
  27703. * A parameter in the range <code>[0, 1)</code> used to determine how long
  27704. * the camera will continue to spin because of inertia.
  27705. * With value of zero, the camera will have no inertia.
  27706. */
  27707. inertiaSpin: number;
  27708. /**
  27709. * A parameter in the range <code>[0, 1)</code> used to determine how long
  27710. * the camera will continue to translate because of inertia.
  27711. * With value of zero, the camera will have no inertia.
  27712. */
  27713. inertiaTranslate: number;
  27714. /**
  27715. * A parameter in the range <code>[0, 1)</code> used to determine how long
  27716. * the camera will continue to zoom because of inertia.
  27717. * With value of zero, the camera will have no inertia.
  27718. */
  27719. inertiaZoom: number;
  27720. /**
  27721. * A parameter in the range <code>[0, 1)</code> used to limit the range
  27722. * of various user inputs to a percentage of the window width/height per animation frame.
  27723. * This helps keep the camera under control in low-frame-rate situations.
  27724. */
  27725. maximumMovementRatio: number;
  27726. /**
  27727. * Sets the duration, in seconds, of the bounce back animations in 2D and Columbus view.
  27728. */
  27729. bounceAnimationTime: number;
  27730. /**
  27731. * The minimum magnitude, in meters, of the camera position when zooming. Defaults to 1.0.
  27732. */
  27733. minimumZoomDistance: number;
  27734. /**
  27735. * The maximum magnitude, in meters, of the camera position when zooming. Defaults to positive infinity.
  27736. */
  27737. maximumZoomDistance: number;
  27738. /**
  27739. * The input that allows the user to pan around the map. This only applies in 2D and Columbus view modes.
  27740. * <p>
  27741. * The type came be a {@link CameraEventType}, <code>undefined</code>, an object with <code>eventType</code>
  27742. * and <code>modifier</code> properties with types <code>CameraEventType</code> and {@link KeyboardEventModifier},
  27743. * or an array of any of the preceding.
  27744. * </p>
  27745. */
  27746. translateEventTypes: CameraEventType | any[] | undefined;
  27747. /**
  27748. * The input that allows the user to zoom in/out.
  27749. * <p>
  27750. * The type came be a {@link CameraEventType}, <code>undefined</code>, an object with <code>eventType</code>
  27751. * and <code>modifier</code> properties with types <code>CameraEventType</code> and {@link KeyboardEventModifier},
  27752. * or an array of any of the preceding.
  27753. * </p>
  27754. */
  27755. zoomEventTypes: CameraEventType | any[] | undefined;
  27756. /**
  27757. * The input that allows the user to rotate around the globe or another object. This only applies in 3D and Columbus view modes.
  27758. * <p>
  27759. * The type came be a {@link CameraEventType}, <code>undefined</code>, an object with <code>eventType</code>
  27760. * and <code>modifier</code> properties with types <code>CameraEventType</code> and {@link KeyboardEventModifier},
  27761. * or an array of any of the preceding.
  27762. * </p>
  27763. */
  27764. rotateEventTypes: CameraEventType | any[] | undefined;
  27765. /**
  27766. * The input that allows the user to tilt in 3D and Columbus view or twist in 2D.
  27767. * <p>
  27768. * The type came be a {@link CameraEventType}, <code>undefined</code>, an object with <code>eventType</code>
  27769. * and <code>modifier</code> properties with types <code>CameraEventType</code> and {@link KeyboardEventModifier},
  27770. * or an array of any of the preceding.
  27771. * </p>
  27772. */
  27773. tiltEventTypes: CameraEventType | any[] | undefined;
  27774. /**
  27775. * The input that allows the user to change the direction the camera is viewing. This only applies in 3D and Columbus view modes.
  27776. * <p>
  27777. * The type came be a {@link CameraEventType}, <code>undefined</code>, an object with <code>eventType</code>
  27778. * and <code>modifier</code> properties with types <code>CameraEventType</code> and {@link KeyboardEventModifier},
  27779. * or an array of any of the preceding.
  27780. * </p>
  27781. */
  27782. lookEventTypes: CameraEventType | any[] | undefined;
  27783. /**
  27784. * The minimum height the camera must be before picking the terrain instead of the ellipsoid.
  27785. */
  27786. minimumPickingTerrainHeight: number;
  27787. /**
  27788. * The minimum height the camera must be before testing for collision with terrain.
  27789. */
  27790. minimumCollisionTerrainHeight: number;
  27791. /**
  27792. * The minimum height the camera must be before switching from rotating a track ball to
  27793. * free look when clicks originate on the sky or in space.
  27794. */
  27795. minimumTrackBallHeight: number;
  27796. /**
  27797. * Enables or disables camera collision detection with terrain.
  27798. */
  27799. enableCollisionDetection: boolean;
  27800. /**
  27801. * Returns true if this object was destroyed; otherwise, false.
  27802. * <br /><br />
  27803. * If this object was destroyed, it should not be used; calling any function other than
  27804. * <code>isDestroyed</code> will result in a {@link DeveloperError} exception.
  27805. * @returns <code>true</code> if this object was destroyed; otherwise, <code>false</code>.
  27806. */
  27807. isDestroyed(): boolean;
  27808. /**
  27809. * Removes mouse listeners held by this object.
  27810. * <br /><br />
  27811. * Once an object is destroyed, it should not be used; calling any function other than
  27812. * <code>isDestroyed</code> will result in a {@link DeveloperError} exception. Therefore,
  27813. * assign the return value (<code>undefined</code>) to the object as done in the example.
  27814. * @example
  27815. * controller = controller && controller.destroy();
  27816. */
  27817. destroy(): void;
  27818. }
  27819. /**
  27820. * Use {@link Viewer#shadowMap} to get the scene's shadow map. Do not construct this directly.
  27821. *
  27822. * <p>
  27823. * The normalOffset bias pushes the shadows forward slightly, and may be disabled
  27824. * for applications that require ultra precise shadows.
  27825. * </p>
  27826. * @param options - An object containing the following properties:
  27827. * @param options.lightCamera - A camera representing the light source.
  27828. * @param [options.enabled = true] - Whether the shadow map is enabled.
  27829. * @param [options.isPointLight = false] - Whether the light source is a point light. Point light shadows do not use cascades.
  27830. * @param [options.pointLightRadius = 100.0] - Radius of the point light.
  27831. * @param [options.cascadesEnabled = true] - Use multiple shadow maps to cover different partitions of the view frustum.
  27832. * @param [options.numberOfCascades = 4] - The number of cascades to use for the shadow map. Supported values are one and four.
  27833. * @param [options.maximumDistance = 5000.0] - The maximum distance used for generating cascaded shadows. Lower values improve shadow quality.
  27834. * @param [options.size = 2048] - The width and height, in pixels, of each shadow map.
  27835. * @param [options.softShadows = false] - Whether percentage-closer-filtering is enabled for producing softer shadows.
  27836. * @param [options.darkness = 0.3] - The shadow darkness.
  27837. * @param [options.normalOffset = true] - Whether a normal bias is applied to shadows.
  27838. * @param [options.fadingEnabled = true] - Whether shadows start to fade out once the light gets closer to the horizon.
  27839. */
  27840. export class ShadowMap {
  27841. constructor(options: {
  27842. lightCamera: Camera;
  27843. enabled?: boolean;
  27844. isPointLight?: boolean;
  27845. pointLightRadius?: number;
  27846. cascadesEnabled?: boolean;
  27847. numberOfCascades?: number;
  27848. maximumDistance?: number;
  27849. size?: number;
  27850. softShadows?: boolean;
  27851. darkness?: number;
  27852. normalOffset?: boolean;
  27853. fadingEnabled?: boolean;
  27854. });
  27855. /**
  27856. * Determines the darkness of the shadows.
  27857. */
  27858. darkness: number;
  27859. /**
  27860. * Determines whether shadows start to fade out once the light gets closer to the horizon.
  27861. */
  27862. fadingEnabled: boolean;
  27863. /**
  27864. * Determines the maximum distance of the shadow map. Only applicable for cascaded shadows. Larger distances may result in lower quality shadows.
  27865. */
  27866. maximumDistance: number;
  27867. /**
  27868. * Determines if the shadow map will be shown.
  27869. */
  27870. enabled: boolean;
  27871. /**
  27872. * Determines if a normal bias will be applied to shadows.
  27873. */
  27874. normalOffset: boolean;
  27875. /**
  27876. * Determines if soft shadows are enabled. Uses pcf filtering which requires more texture reads and may hurt performance.
  27877. */
  27878. softShadows: boolean;
  27879. /**
  27880. * The width and height, in pixels, of each shadow map.
  27881. */
  27882. size: number;
  27883. }
  27884. /**
  27885. * Specifies whether the object casts or receives shadows from light sources when
  27886. * shadows are enabled.
  27887. */
  27888. export enum ShadowMode {
  27889. /**
  27890. * The object does not cast or receive shadows.
  27891. */
  27892. DISABLED = 0,
  27893. /**
  27894. * The object casts and receives shadows.
  27895. */
  27896. ENABLED = 1,
  27897. /**
  27898. * The object casts shadows only.
  27899. */
  27900. CAST_ONLY = 2,
  27901. /**
  27902. * The object receives shadows only.
  27903. */
  27904. RECEIVE_ONLY = 3
  27905. }
  27906. export namespace SingleTileImageryProvider {
  27907. /**
  27908. * Initialization options for the SingleTileImageryProvider constructor
  27909. * @property url - The url for the tile.
  27910. * @property [rectangle = Rectangle.MAX_VALUE] - The rectangle, in radians, covered by the image.
  27911. * @property [credit] - A credit for the data source, which is displayed on the canvas.
  27912. * @property [ellipsoid] - The ellipsoid. If not specified, the WGS84 ellipsoid is used.
  27913. */
  27914. type ConstructorOptions = {
  27915. url: Resource | string;
  27916. rectangle?: Rectangle;
  27917. credit?: Credit | string;
  27918. ellipsoid?: Ellipsoid;
  27919. };
  27920. }
  27921. /**
  27922. * Provides a single, top-level imagery tile. The single image is assumed to use a
  27923. * {@link GeographicTilingScheme}.
  27924. * @param options - Object describing initialization options
  27925. */
  27926. export class SingleTileImageryProvider {
  27927. constructor(options: SingleTileImageryProvider.ConstructorOptions);
  27928. /**
  27929. * The default alpha blending value of this provider, with 0.0 representing fully transparent and
  27930. * 1.0 representing fully opaque.
  27931. */
  27932. defaultAlpha: number | undefined;
  27933. /**
  27934. * The default alpha blending value on the night side of the globe of this provider, with 0.0 representing fully transparent and
  27935. * 1.0 representing fully opaque.
  27936. */
  27937. defaultNightAlpha: number | undefined;
  27938. /**
  27939. * The default alpha blending value on the day side of the globe of this provider, with 0.0 representing fully transparent and
  27940. * 1.0 representing fully opaque.
  27941. */
  27942. defaultDayAlpha: number | undefined;
  27943. /**
  27944. * The default brightness of this provider. 1.0 uses the unmodified imagery color. Less than 1.0
  27945. * makes the imagery darker while greater than 1.0 makes it brighter.
  27946. */
  27947. defaultBrightness: number | undefined;
  27948. /**
  27949. * The default contrast of this provider. 1.0 uses the unmodified imagery color. Less than 1.0 reduces
  27950. * the contrast while greater than 1.0 increases it.
  27951. */
  27952. defaultContrast: number | undefined;
  27953. /**
  27954. * The default hue of this provider in radians. 0.0 uses the unmodified imagery color.
  27955. */
  27956. defaultHue: number | undefined;
  27957. /**
  27958. * The default saturation of this provider. 1.0 uses the unmodified imagery color. Less than 1.0 reduces the
  27959. * saturation while greater than 1.0 increases it.
  27960. */
  27961. defaultSaturation: number | undefined;
  27962. /**
  27963. * The default gamma correction to apply to this provider. 1.0 uses the unmodified imagery color.
  27964. */
  27965. defaultGamma: number | undefined;
  27966. /**
  27967. * The default texture minification filter to apply to this provider.
  27968. */
  27969. defaultMinificationFilter: TextureMinificationFilter;
  27970. /**
  27971. * The default texture magnification filter to apply to this provider.
  27972. */
  27973. defaultMagnificationFilter: TextureMagnificationFilter;
  27974. /**
  27975. * Gets the URL of the single, top-level imagery tile.
  27976. */
  27977. readonly url: string;
  27978. /**
  27979. * Gets the proxy used by this provider.
  27980. */
  27981. readonly proxy: Proxy;
  27982. /**
  27983. * Gets the width of each tile, in pixels. This function should
  27984. * not be called before {@link SingleTileImageryProvider#ready} returns true.
  27985. */
  27986. readonly tileWidth: number;
  27987. /**
  27988. * Gets the height of each tile, in pixels. This function should
  27989. * not be called before {@link SingleTileImageryProvider#ready} returns true.
  27990. */
  27991. readonly tileHeight: number;
  27992. /**
  27993. * Gets the maximum level-of-detail that can be requested. This function should
  27994. * not be called before {@link SingleTileImageryProvider#ready} returns true.
  27995. */
  27996. readonly maximumLevel: number | undefined;
  27997. /**
  27998. * Gets the minimum level-of-detail that can be requested. This function should
  27999. * not be called before {@link SingleTileImageryProvider#ready} returns true.
  28000. */
  28001. readonly minimumLevel: number;
  28002. /**
  28003. * Gets the tiling scheme used by this provider. This function should
  28004. * not be called before {@link SingleTileImageryProvider#ready} returns true.
  28005. */
  28006. readonly tilingScheme: TilingScheme;
  28007. /**
  28008. * Gets the rectangle, in radians, of the imagery provided by this instance. This function should
  28009. * not be called before {@link SingleTileImageryProvider#ready} returns true.
  28010. */
  28011. readonly rectangle: Rectangle;
  28012. /**
  28013. * Gets the tile discard policy. If not undefined, the discard policy is responsible
  28014. * for filtering out "missing" tiles via its shouldDiscardImage function. If this function
  28015. * returns undefined, no tiles are filtered. This function should
  28016. * not be called before {@link SingleTileImageryProvider#ready} returns true.
  28017. */
  28018. readonly tileDiscardPolicy: TileDiscardPolicy;
  28019. /**
  28020. * Gets an event that is raised when the imagery provider encounters an asynchronous error. By subscribing
  28021. * to the event, you will be notified of the error and can potentially recover from it. Event listeners
  28022. * are passed an instance of {@link TileProviderError}.
  28023. */
  28024. readonly errorEvent: Event;
  28025. /**
  28026. * Gets a value indicating whether or not the provider is ready for use.
  28027. */
  28028. readonly ready: boolean;
  28029. /**
  28030. * Gets a promise that resolves to true when the provider is ready for use.
  28031. */
  28032. readonly readyPromise: Promise<boolean>;
  28033. /**
  28034. * Gets the credit to display when this imagery provider is active. Typically this is used to credit
  28035. * the source of the imagery. This function should not be called before {@link SingleTileImageryProvider#ready} returns true.
  28036. */
  28037. readonly credit: Credit;
  28038. /**
  28039. * Gets a value indicating whether or not the images provided by this imagery provider
  28040. * include an alpha channel. If this property is false, an alpha channel, if present, will
  28041. * be ignored. If this property is true, any images without an alpha channel will be treated
  28042. * as if their alpha is 1.0 everywhere. When this property is false, memory usage
  28043. * and texture upload time are reduced.
  28044. */
  28045. readonly hasAlphaChannel: boolean;
  28046. /**
  28047. * Gets the credits to be displayed when a given tile is displayed.
  28048. * @param x - The tile X coordinate.
  28049. * @param y - The tile Y coordinate.
  28050. * @param level - The tile level;
  28051. * @returns The credits to be displayed when the tile is displayed.
  28052. */
  28053. getTileCredits(x: number, y: number, level: number): Credit[];
  28054. /**
  28055. * Requests the image for a given tile. This function should
  28056. * not be called before {@link SingleTileImageryProvider#ready} returns true.
  28057. * @param x - The tile X coordinate.
  28058. * @param y - The tile Y coordinate.
  28059. * @param level - The tile level.
  28060. * @param [request] - The request object. Intended for internal use only.
  28061. * @returns The resolved image
  28062. */
  28063. requestImage(x: number, y: number, level: number, request?: Request): Promise<ImageryTypes> | undefined;
  28064. /**
  28065. * Picking features is not currently supported by this imagery provider, so this function simply returns
  28066. * undefined.
  28067. * @param x - The tile X coordinate.
  28068. * @param y - The tile Y coordinate.
  28069. * @param level - The tile level.
  28070. * @param longitude - The longitude at which to pick features.
  28071. * @param latitude - The latitude at which to pick features.
  28072. * @returns Undefined since picking is not supported.
  28073. */
  28074. pickFeatures(x: number, y: number, level: number, longitude: number, latitude: number): undefined;
  28075. }
  28076. /**
  28077. * An atmosphere drawn around the limb of the provided ellipsoid. Based on
  28078. * {@link http://nishitalab.org/user/nis/cdrom/sig93_nis.pdf|Display of The Earth Taking Into Account Atmospheric Scattering}.
  28079. * <p>
  28080. * This is only supported in 3D. Atmosphere is faded out when morphing to 2D or Columbus view.
  28081. * </p>
  28082. * @example
  28083. * scene.skyAtmosphere = new Cesium.SkyAtmosphere();
  28084. * @param [ellipsoid = Ellipsoid.WGS84] - The ellipsoid that the atmosphere is drawn around.
  28085. */
  28086. export class SkyAtmosphere {
  28087. constructor(ellipsoid?: Ellipsoid);
  28088. /**
  28089. * Determines if the atmosphere is shown.
  28090. */
  28091. show: boolean;
  28092. /**
  28093. * Compute atmosphere per-fragment instead of per-vertex.
  28094. * This produces better looking atmosphere with a slight performance penalty.
  28095. */
  28096. perFragmentAtmosphere: boolean;
  28097. /**
  28098. * The intensity of the light that is used for computing the sky atmosphere color.
  28099. */
  28100. atmosphereLightIntensity: number;
  28101. /**
  28102. * The Rayleigh scattering coefficient used in the atmospheric scattering equations for the sky atmosphere.
  28103. */
  28104. atmosphereRayleighCoefficient: Cartesian3;
  28105. /**
  28106. * The Mie scattering coefficient used in the atmospheric scattering equations for the sky atmosphere.
  28107. */
  28108. atmosphereMieCoefficient: Cartesian3;
  28109. /**
  28110. * The Rayleigh scale height used in the atmospheric scattering equations for the sky atmosphere, in meters.
  28111. */
  28112. atmosphereRayleighScaleHeight: number;
  28113. /**
  28114. * The Mie scale height used in the atmospheric scattering equations for the sky atmosphere, in meters.
  28115. */
  28116. atmosphereMieScaleHeight: number;
  28117. /**
  28118. * The anisotropy of the medium to consider for Mie scattering.
  28119. * <p>
  28120. * Valid values are between -1.0 and 1.0.
  28121. * </p>
  28122. */
  28123. atmosphereMieAnisotropy: number;
  28124. /**
  28125. * The hue shift to apply to the atmosphere. Defaults to 0.0 (no shift).
  28126. * A hue shift of 1.0 indicates a complete rotation of the hues available.
  28127. */
  28128. hueShift: number;
  28129. /**
  28130. * The saturation shift to apply to the atmosphere. Defaults to 0.0 (no shift).
  28131. * A saturation shift of -1.0 is monochrome.
  28132. */
  28133. saturationShift: number;
  28134. /**
  28135. * The brightness shift to apply to the atmosphere. Defaults to 0.0 (no shift).
  28136. * A brightness shift of -1.0 is complete darkness, which will let space show through.
  28137. */
  28138. brightnessShift: number;
  28139. /**
  28140. * Gets the ellipsoid the atmosphere is drawn around.
  28141. */
  28142. readonly ellipsoid: Ellipsoid;
  28143. /**
  28144. * Returns true if this object was destroyed; otherwise, false.
  28145. * <br /><br />
  28146. * If this object was destroyed, it should not be used; calling any function other than
  28147. * <code>isDestroyed</code> will result in a {@link DeveloperError} exception.
  28148. * @returns <code>true</code> if this object was destroyed; otherwise, <code>false</code>.
  28149. */
  28150. isDestroyed(): boolean;
  28151. /**
  28152. * Destroys the WebGL resources held by this object. Destroying an object allows for deterministic
  28153. * release of WebGL resources, instead of relying on the garbage collector to destroy this object.
  28154. * <br /><br />
  28155. * Once an object is destroyed, it should not be used; calling any function other than
  28156. * <code>isDestroyed</code> will result in a {@link DeveloperError} exception. Therefore,
  28157. * assign the return value (<code>undefined</code>) to the object as done in the example.
  28158. * @example
  28159. * skyAtmosphere = skyAtmosphere && skyAtmosphere.destroy();
  28160. */
  28161. destroy(): void;
  28162. }
  28163. /**
  28164. * A sky box around the scene to draw stars. The sky box is defined using the True Equator Mean Equinox (TEME) axes.
  28165. * <p>
  28166. * This is only supported in 3D. The sky box is faded out when morphing to 2D or Columbus view. The size of
  28167. * the sky box must not exceed {@link Scene#maximumCubeMapSize}.
  28168. * </p>
  28169. * @example
  28170. * scene.skyBox = new Cesium.SkyBox({
  28171. * sources : {
  28172. * positiveX : 'skybox_px.png',
  28173. * negativeX : 'skybox_nx.png',
  28174. * positiveY : 'skybox_py.png',
  28175. * negativeY : 'skybox_ny.png',
  28176. * positiveZ : 'skybox_pz.png',
  28177. * negativeZ : 'skybox_nz.png'
  28178. * }
  28179. * });
  28180. * @param options - Object with the following properties:
  28181. * @param [options.sources] - The source URL or <code>Image</code> object for each of the six cube map faces. See the example below.
  28182. * @param [options.show = true] - Determines if this primitive will be shown.
  28183. */
  28184. export class SkyBox {
  28185. constructor(options: {
  28186. sources?: any;
  28187. show?: boolean;
  28188. });
  28189. /**
  28190. * The sources used to create the cube map faces: an object
  28191. * with <code>positiveX</code>, <code>negativeX</code>, <code>positiveY</code>,
  28192. * <code>negativeY</code>, <code>positiveZ</code>, and <code>negativeZ</code> properties.
  28193. * These can be either URLs or <code>Image</code> objects.
  28194. */
  28195. sources: any;
  28196. /**
  28197. * Determines if the sky box will be shown.
  28198. */
  28199. show: boolean;
  28200. /**
  28201. * Called when {@link Viewer} or {@link CesiumWidget} render the scene to
  28202. * get the draw commands needed to render this primitive.
  28203. * <p>
  28204. * Do not call this function directly. This is documented just to
  28205. * list the exceptions that may be propagated when the scene is rendered:
  28206. * </p>
  28207. */
  28208. update(): void;
  28209. /**
  28210. * Returns true if this object was destroyed; otherwise, false.
  28211. * <br /><br />
  28212. * If this object was destroyed, it should not be used; calling any function other than
  28213. * <code>isDestroyed</code> will result in a {@link DeveloperError} exception.
  28214. * @returns <code>true</code> if this object was destroyed; otherwise, <code>false</code>.
  28215. */
  28216. isDestroyed(): boolean;
  28217. /**
  28218. * Destroys the WebGL resources held by this object. Destroying an object allows for deterministic
  28219. * release of WebGL resources, instead of relying on the garbage collector to destroy this object.
  28220. * <br /><br />
  28221. * Once an object is destroyed, it should not be used; calling any function other than
  28222. * <code>isDestroyed</code> will result in a {@link DeveloperError} exception. Therefore,
  28223. * assign the return value (<code>undefined</code>) to the object as done in the example.
  28224. * @example
  28225. * skyBox = skyBox && skyBox.destroy();
  28226. */
  28227. destroy(): void;
  28228. }
  28229. /**
  28230. * The direction to display a primitive or ImageryLayer relative to the {@link Scene#splitPosition}.
  28231. */
  28232. export enum SplitDirection {
  28233. /**
  28234. * Display the primitive or ImageryLayer to the left of the {@link Scene#splitPosition}.
  28235. */
  28236. LEFT = -1,
  28237. /**
  28238. * Always display the primitive or ImageryLayer.
  28239. */
  28240. NONE = 0,
  28241. /**
  28242. * Display the primitive or ImageryLayer to the right of the {@link Scene#splitPosition}.
  28243. */
  28244. RIGHT = 1
  28245. }
  28246. /**
  28247. * Determines the function used to compare stencil values for the stencil test.
  28248. */
  28249. export enum StencilFunction {
  28250. /**
  28251. * The stencil test never passes.
  28252. */
  28253. NEVER = WebGLConstants.NEVER,
  28254. /**
  28255. * The stencil test passes when the masked reference value is less than the masked stencil value.
  28256. */
  28257. LESS = WebGLConstants.LESS,
  28258. /**
  28259. * The stencil test passes when the masked reference value is equal to the masked stencil value.
  28260. */
  28261. EQUAL = WebGLConstants.EQUAL,
  28262. /**
  28263. * The stencil test passes when the masked reference value is less than or equal to the masked stencil value.
  28264. */
  28265. LESS_OR_EQUAL = WebGLConstants.LEQUAL,
  28266. /**
  28267. * The stencil test passes when the masked reference value is greater than the masked stencil value.
  28268. */
  28269. GREATER = WebGLConstants.GREATER,
  28270. /**
  28271. * The stencil test passes when the masked reference value is not equal to the masked stencil value.
  28272. */
  28273. NOT_EQUAL = WebGLConstants.NOTEQUAL,
  28274. /**
  28275. * The stencil test passes when the masked reference value is greater than or equal to the masked stencil value.
  28276. */
  28277. GREATER_OR_EQUAL = WebGLConstants.GEQUAL,
  28278. /**
  28279. * The stencil test always passes.
  28280. */
  28281. ALWAYS = WebGLConstants.ALWAYS
  28282. }
  28283. /**
  28284. * Determines the action taken based on the result of the stencil test.
  28285. */
  28286. export enum StencilOperation {
  28287. /**
  28288. * Sets the stencil buffer value to zero.
  28289. */
  28290. ZERO = WebGLConstants.ZERO,
  28291. /**
  28292. * Does not change the stencil buffer.
  28293. */
  28294. KEEP = WebGLConstants.KEEP,
  28295. /**
  28296. * Replaces the stencil buffer value with the reference value.
  28297. */
  28298. REPLACE = WebGLConstants.REPLACE,
  28299. /**
  28300. * Increments the stencil buffer value, clamping to unsigned byte.
  28301. */
  28302. INCREMENT = WebGLConstants.INCR,
  28303. /**
  28304. * Decrements the stencil buffer value, clamping to zero.
  28305. */
  28306. DECREMENT = WebGLConstants.DECR,
  28307. /**
  28308. * Bitwise inverts the existing stencil buffer value.
  28309. */
  28310. INVERT = WebGLConstants.INVERT,
  28311. /**
  28312. * Increments the stencil buffer value, wrapping to zero when exceeding the unsigned byte range.
  28313. */
  28314. INCREMENT_WRAP = WebGLConstants.INCR_WRAP,
  28315. /**
  28316. * Decrements the stencil buffer value, wrapping to the maximum unsigned byte instead of going below zero.
  28317. */
  28318. DECREMENT_WRAP = WebGLConstants.DECR_WRAP
  28319. }
  28320. /**
  28321. * Draws a sun billboard.
  28322. * <p>This is only supported in 3D and Columbus view.</p>
  28323. * @example
  28324. * scene.sun = new Cesium.Sun();
  28325. */
  28326. export class Sun {
  28327. constructor();
  28328. /**
  28329. * Determines if the sun will be shown.
  28330. */
  28331. show: boolean;
  28332. /**
  28333. * Gets or sets a number that controls how "bright" the Sun's lens flare appears
  28334. * to be. Zero shows just the Sun's disc without any flare.
  28335. * Use larger values for a more pronounced flare around the Sun.
  28336. */
  28337. glowFactor: number;
  28338. /**
  28339. * Returns true if this object was destroyed; otherwise, false.
  28340. * <br /><br />
  28341. * If this object was destroyed, it should not be used; calling any function other than
  28342. * <code>isDestroyed</code> will result in a {@link DeveloperError} exception.
  28343. * @returns <code>true</code> if this object was destroyed; otherwise, <code>false</code>.
  28344. */
  28345. isDestroyed(): boolean;
  28346. /**
  28347. * Destroys the WebGL resources held by this object. Destroying an object allows for deterministic
  28348. * release of WebGL resources, instead of relying on the garbage collector to destroy this object.
  28349. * <br /><br />
  28350. * Once an object is destroyed, it should not be used; calling any function other than
  28351. * <code>isDestroyed</code> will result in a {@link DeveloperError} exception. Therefore,
  28352. * assign the return value (<code>undefined</code>) to the object as done in the example.
  28353. * @example
  28354. * sun = sun && sun.destroy();
  28355. *
  28356. *
  28357. */
  28358. destroy(): void;
  28359. }
  28360. /**
  28361. * A directional light source that originates from the Sun.
  28362. * @param [options] - Object with the following properties:
  28363. * @param [options.color = Color.WHITE] - The light's color.
  28364. * @param [options.intensity = 2.0] - The light's intensity.
  28365. */
  28366. export class SunLight {
  28367. constructor(options?: {
  28368. color?: Color;
  28369. intensity?: number;
  28370. });
  28371. /**
  28372. * The color of the light.
  28373. */
  28374. color: Color;
  28375. /**
  28376. * The intensity of the light.
  28377. */
  28378. intensity: number;
  28379. }
  28380. export namespace TileCoordinatesImageryProvider {
  28381. /**
  28382. * Initialization options for the TileCoordinatesImageryProvider constructor
  28383. * @property [tilingScheme = new GeographicTilingScheme()] - The tiling scheme for which to draw tiles.
  28384. * @property [ellipsoid] - The ellipsoid. If the tilingScheme is specified,
  28385. * this parameter is ignored and the tiling scheme's ellipsoid is used instead. If neither
  28386. * parameter is specified, the WGS84 ellipsoid is used.
  28387. * @property [color = Color.YELLOW] - The color to draw the tile box and label.
  28388. * @property [tileWidth = 256] - The width of the tile for level-of-detail selection purposes.
  28389. * @property [tileHeight = 256] - The height of the tile for level-of-detail selection purposes.
  28390. */
  28391. type ConstructorOptions = {
  28392. tilingScheme?: TilingScheme;
  28393. ellipsoid?: Ellipsoid;
  28394. color?: Color;
  28395. tileWidth?: number;
  28396. tileHeight?: number;
  28397. };
  28398. }
  28399. /**
  28400. * An {@link ImageryProvider} that draws a box around every rendered tile in the tiling scheme, and draws
  28401. * a label inside it indicating the X, Y, Level coordinates of the tile. This is mostly useful for
  28402. * debugging terrain and imagery rendering problems.
  28403. * @param [options] - Object describing initialization options
  28404. */
  28405. export class TileCoordinatesImageryProvider {
  28406. constructor(options?: TileCoordinatesImageryProvider.ConstructorOptions);
  28407. /**
  28408. * The default alpha blending value of this provider, with 0.0 representing fully transparent and
  28409. * 1.0 representing fully opaque.
  28410. */
  28411. defaultAlpha: number | undefined;
  28412. /**
  28413. * The default alpha blending value on the night side of the globe of this provider, with 0.0 representing fully transparent and
  28414. * 1.0 representing fully opaque.
  28415. */
  28416. defaultNightAlpha: number | undefined;
  28417. /**
  28418. * The default alpha blending value on the day side of the globe of this provider, with 0.0 representing fully transparent and
  28419. * 1.0 representing fully opaque.
  28420. */
  28421. defaultDayAlpha: number | undefined;
  28422. /**
  28423. * The default brightness of this provider. 1.0 uses the unmodified imagery color. Less than 1.0
  28424. * makes the imagery darker while greater than 1.0 makes it brighter.
  28425. */
  28426. defaultBrightness: number | undefined;
  28427. /**
  28428. * The default contrast of this provider. 1.0 uses the unmodified imagery color. Less than 1.0 reduces
  28429. * the contrast while greater than 1.0 increases it.
  28430. */
  28431. defaultContrast: number | undefined;
  28432. /**
  28433. * The default hue of this provider in radians. 0.0 uses the unmodified imagery color.
  28434. */
  28435. defaultHue: number | undefined;
  28436. /**
  28437. * The default saturation of this provider. 1.0 uses the unmodified imagery color. Less than 1.0 reduces the
  28438. * saturation while greater than 1.0 increases it.
  28439. */
  28440. defaultSaturation: number | undefined;
  28441. /**
  28442. * The default gamma correction to apply to this provider. 1.0 uses the unmodified imagery color.
  28443. */
  28444. defaultGamma: number | undefined;
  28445. /**
  28446. * The default texture minification filter to apply to this provider.
  28447. */
  28448. defaultMinificationFilter: TextureMinificationFilter;
  28449. /**
  28450. * The default texture magnification filter to apply to this provider.
  28451. */
  28452. defaultMagnificationFilter: TextureMagnificationFilter;
  28453. /**
  28454. * Gets the proxy used by this provider.
  28455. */
  28456. readonly proxy: Proxy;
  28457. /**
  28458. * Gets the width of each tile, in pixels. This function should
  28459. * not be called before {@link TileCoordinatesImageryProvider#ready} returns true.
  28460. */
  28461. readonly tileWidth: number;
  28462. /**
  28463. * Gets the height of each tile, in pixels. This function should
  28464. * not be called before {@link TileCoordinatesImageryProvider#ready} returns true.
  28465. */
  28466. readonly tileHeight: number;
  28467. /**
  28468. * Gets the maximum level-of-detail that can be requested. This function should
  28469. * not be called before {@link TileCoordinatesImageryProvider#ready} returns true.
  28470. */
  28471. readonly maximumLevel: number | undefined;
  28472. /**
  28473. * Gets the minimum level-of-detail that can be requested. This function should
  28474. * not be called before {@link TileCoordinatesImageryProvider#ready} returns true.
  28475. */
  28476. readonly minimumLevel: number;
  28477. /**
  28478. * Gets the tiling scheme used by this provider. This function should
  28479. * not be called before {@link TileCoordinatesImageryProvider#ready} returns true.
  28480. */
  28481. readonly tilingScheme: TilingScheme;
  28482. /**
  28483. * Gets the rectangle, in radians, of the imagery provided by this instance. This function should
  28484. * not be called before {@link TileCoordinatesImageryProvider#ready} returns true.
  28485. */
  28486. readonly rectangle: Rectangle;
  28487. /**
  28488. * Gets the tile discard policy. If not undefined, the discard policy is responsible
  28489. * for filtering out "missing" tiles via its shouldDiscardImage function. If this function
  28490. * returns undefined, no tiles are filtered. This function should
  28491. * not be called before {@link TileCoordinatesImageryProvider#ready} returns true.
  28492. */
  28493. readonly tileDiscardPolicy: TileDiscardPolicy;
  28494. /**
  28495. * Gets an event that is raised when the imagery provider encounters an asynchronous error. By subscribing
  28496. * to the event, you will be notified of the error and can potentially recover from it. Event listeners
  28497. * are passed an instance of {@link TileProviderError}.
  28498. */
  28499. readonly errorEvent: Event;
  28500. /**
  28501. * Gets a value indicating whether or not the provider is ready for use.
  28502. */
  28503. readonly ready: boolean;
  28504. /**
  28505. * Gets a promise that resolves to true when the provider is ready for use.
  28506. */
  28507. readonly readyPromise: Promise<boolean>;
  28508. /**
  28509. * Gets the credit to display when this imagery provider is active. Typically this is used to credit
  28510. * the source of the imagery. This function should not be called before {@link TileCoordinatesImageryProvider#ready} returns true.
  28511. */
  28512. readonly credit: Credit;
  28513. /**
  28514. * Gets a value indicating whether or not the images provided by this imagery provider
  28515. * include an alpha channel. If this property is false, an alpha channel, if present, will
  28516. * be ignored. If this property is true, any images without an alpha channel will be treated
  28517. * as if their alpha is 1.0 everywhere. Setting this property to false reduces memory usage
  28518. * and texture upload time.
  28519. */
  28520. readonly hasAlphaChannel: boolean;
  28521. /**
  28522. * Gets the credits to be displayed when a given tile is displayed.
  28523. * @param x - The tile X coordinate.
  28524. * @param y - The tile Y coordinate.
  28525. * @param level - The tile level;
  28526. * @returns The credits to be displayed when the tile is displayed.
  28527. */
  28528. getTileCredits(x: number, y: number, level: number): Credit[];
  28529. /**
  28530. * Requests the image for a given tile. This function should
  28531. * not be called before {@link TileCoordinatesImageryProvider#ready} returns true.
  28532. * @param x - The tile X coordinate.
  28533. * @param y - The tile Y coordinate.
  28534. * @param level - The tile level.
  28535. * @param [request] - The request object. Intended for internal use only.
  28536. * @returns The resolved image as a Canvas DOM object.
  28537. */
  28538. requestImage(x: number, y: number, level: number, request?: Request): Promise<HTMLCanvasElement>;
  28539. /**
  28540. * Picking features is not currently supported by this imagery provider, so this function simply returns
  28541. * undefined.
  28542. * @param x - The tile X coordinate.
  28543. * @param y - The tile Y coordinate.
  28544. * @param level - The tile level.
  28545. * @param longitude - The longitude at which to pick features.
  28546. * @param latitude - The latitude at which to pick features.
  28547. * @returns Undefined since picking is not supported.
  28548. */
  28549. pickFeatures(x: number, y: number, level: number, longitude: number, latitude: number): undefined;
  28550. }
  28551. /**
  28552. * Provides functionality for ImageryProviders that have time dynamic imagery
  28553. * @param options - Object with the following properties:
  28554. * @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.
  28555. * @param options.times - TimeIntervalCollection with its <code>data</code> property being an object containing time dynamic dimension and their values.
  28556. * @param options.requestImageFunction - A function that will request imagery tiles.
  28557. * @param options.reloadFunction - A function that will be called when all imagery tiles need to be reloaded.
  28558. */
  28559. export class TimeDynamicImagery {
  28560. constructor(options: {
  28561. clock: Clock;
  28562. times: TimeIntervalCollection;
  28563. requestImageFunction: (...params: any[]) => any;
  28564. reloadFunction: (...params: any[]) => any;
  28565. });
  28566. /**
  28567. * Gets or sets a clock that is used to get keep the time used for time dynamic parameters.
  28568. */
  28569. clock: Clock;
  28570. /**
  28571. * Gets or sets a time interval collection.
  28572. */
  28573. times: TimeIntervalCollection;
  28574. /**
  28575. * Gets the current interval.
  28576. */
  28577. currentInterval: TimeInterval;
  28578. /**
  28579. * Gets the tile from the cache if its available.
  28580. * @param x - The tile X coordinate.
  28581. * @param y - The tile Y coordinate.
  28582. * @param level - The tile level.
  28583. * @param [request] - The request object. Intended for internal use only.
  28584. * @returns A promise for the image that will resolve when the image is available, or
  28585. * undefined if the tile is not in the cache.
  28586. */
  28587. getFromCache(x: number, y: number, level: number, request?: Request): Promise<HTMLImageElement> | undefined;
  28588. /**
  28589. * Checks if the next interval is approaching and will start preload the tile if necessary. Otherwise it will
  28590. * just add the tile to a list to preload when we approach the next interval.
  28591. * @param x - The tile X coordinate.
  28592. * @param y - The tile Y coordinate.
  28593. * @param level - The tile level.
  28594. * @param [request] - The request object. Intended for internal use only.
  28595. */
  28596. checkApproachingInterval(x: number, y: number, level: number, request?: Request): void;
  28597. }
  28598. /**
  28599. * The vertical location of an origin relative to an object, e.g., a {@link Billboard}
  28600. * or {@link Label}. For example, setting the vertical origin to <code>TOP</code>
  28601. * or <code>BOTTOM</code> will display a billboard above or below (in screen space)
  28602. * the anchor position.
  28603. * <br /><br />
  28604. * <div align='center'>
  28605. * <img src='Images/Billboard.setVerticalOrigin.png' width='695' height='175' /><br />
  28606. * </div>
  28607. */
  28608. export enum VerticalOrigin {
  28609. /**
  28610. * The origin is at the vertical center between <code>BASELINE</code> and <code>TOP</code>.
  28611. */
  28612. CENTER = 0,
  28613. /**
  28614. * The origin is at the bottom of the object.
  28615. */
  28616. BOTTOM = 1,
  28617. /**
  28618. * If the object contains text, the origin is at the baseline of the text, else the origin is at the bottom of the object.
  28619. */
  28620. BASELINE = 2,
  28621. /**
  28622. * The origin is at the top of the object.
  28623. */
  28624. TOP = -1
  28625. }
  28626. export namespace WebMapTileServiceImageryProvider {
  28627. /**
  28628. * Initialization options for the WebMapTileServiceImageryProvider constructor
  28629. * @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.
  28630. * @property [format = 'image/jpeg'] - The MIME type for images to retrieve from the server.
  28631. * @property layer - The layer name for WMTS requests.
  28632. * @property style - The style name for WMTS requests.
  28633. * @property tileMatrixSetID - The identifier of the TileMatrixSet to use for WMTS requests.
  28634. * @property [tileMatrixLabels] - A list of identifiers in the TileMatrix to use for WMTS requests, one per TileMatrix level.
  28635. * @property [clock] - A Clock instance that is used when determining the value for the time dimension. Required when `times` is specified.
  28636. * @property [times] - TimeIntervalCollection with its <code>data</code> property being an object containing time dynamic dimension and their values.
  28637. * @property [dimensions] - A object containing dimensions and their values.
  28638. * @property [tileWidth = 256] - The tile width in pixels.
  28639. * @property [tileHeight = 256] - The tile height in pixels.
  28640. * @property [tilingScheme] - The tiling scheme corresponding to the organization of the tiles in the TileMatrixSet.
  28641. * @property [rectangle = Rectangle.MAX_VALUE] - The rectangle covered by the layer.
  28642. * @property [minimumLevel = 0] - The minimum level-of-detail supported by the imagery provider.
  28643. * @property [maximumLevel] - The maximum level-of-detail supported by the imagery provider, or undefined if there is no limit.
  28644. * @property [ellipsoid] - The ellipsoid. If not specified, the WGS84 ellipsoid is used.
  28645. * @property [credit] - A credit for the data source, which is displayed on the canvas.
  28646. * @property [subdomains = 'abc'] - The subdomains to use for the <code>{s}</code> placeholder in the URL template.
  28647. * If this parameter is a single string, each character in the string is a subdomain. If it is
  28648. * an array, each element in the array is a subdomain.
  28649. */
  28650. type ConstructorOptions = {
  28651. url: Resource | string;
  28652. format?: string;
  28653. layer: string;
  28654. style: string;
  28655. tileMatrixSetID: string;
  28656. tileMatrixLabels?: any[];
  28657. clock?: Clock;
  28658. times?: TimeIntervalCollection;
  28659. dimensions?: any;
  28660. tileWidth?: number;
  28661. tileHeight?: number;
  28662. tilingScheme?: TilingScheme;
  28663. rectangle?: Rectangle;
  28664. minimumLevel?: number;
  28665. maximumLevel?: number;
  28666. ellipsoid?: Ellipsoid;
  28667. credit?: Credit | string;
  28668. subdomains?: string | string[];
  28669. };
  28670. }
  28671. /**
  28672. * Provides tiled imagery served by {@link http://www.opengeospatial.org/standards/wmts|WMTS 1.0.0} compliant servers.
  28673. * This provider supports HTTP KVP-encoded and RESTful GetTile requests, but does not yet support the SOAP encoding.
  28674. * @example
  28675. * // Example 1. USGS shaded relief tiles (KVP)
  28676. * const shadedRelief1 = new Cesium.WebMapTileServiceImageryProvider({
  28677. * url : 'http://basemap.nationalmap.gov/arcgis/rest/services/USGSShadedReliefOnly/MapServer/WMTS',
  28678. * layer : 'USGSShadedReliefOnly',
  28679. * style : 'default',
  28680. * format : 'image/jpeg',
  28681. * tileMatrixSetID : 'default028mm',
  28682. * // tileMatrixLabels : ['default028mm:0', 'default028mm:1', 'default028mm:2' ...],
  28683. * maximumLevel: 19,
  28684. * credit : new Cesium.Credit('U. S. Geological Survey')
  28685. * });
  28686. * viewer.imageryLayers.addImageryProvider(shadedRelief1);
  28687. * @example
  28688. * // Example 2. USGS shaded relief tiles (RESTful)
  28689. * const shadedRelief2 = new Cesium.WebMapTileServiceImageryProvider({
  28690. * url : 'http://basemap.nationalmap.gov/arcgis/rest/services/USGSShadedReliefOnly/MapServer/WMTS/tile/1.0.0/USGSShadedReliefOnly/{Style}/{TileMatrixSet}/{TileMatrix}/{TileRow}/{TileCol}.jpg',
  28691. * layer : 'USGSShadedReliefOnly',
  28692. * style : 'default',
  28693. * format : 'image/jpeg',
  28694. * tileMatrixSetID : 'default028mm',
  28695. * maximumLevel: 19,
  28696. * credit : new Cesium.Credit('U. S. Geological Survey')
  28697. * });
  28698. * viewer.imageryLayers.addImageryProvider(shadedRelief2);
  28699. * @example
  28700. * // Example 3. NASA time dynamic weather data (RESTful)
  28701. * const times = Cesium.TimeIntervalCollection.fromIso8601({
  28702. * iso8601: '2015-07-30/2017-06-16/P1D',
  28703. * dataCallback: function dataCallback(interval, index) {
  28704. * return {
  28705. * Time: Cesium.JulianDate.toIso8601(interval.start)
  28706. * };
  28707. * }
  28708. * });
  28709. * const weather = new Cesium.WebMapTileServiceImageryProvider({
  28710. * url : 'https://gibs.earthdata.nasa.gov/wmts/epsg4326/best/AMSR2_Snow_Water_Equivalent/default/{Time}/{TileMatrixSet}/{TileMatrix}/{TileRow}/{TileCol}.png',
  28711. * layer : 'AMSR2_Snow_Water_Equivalent',
  28712. * style : 'default',
  28713. * tileMatrixSetID : '2km',
  28714. * maximumLevel : 5,
  28715. * format : 'image/png',
  28716. * clock: clock,
  28717. * times: times,
  28718. * credit : new Cesium.Credit('NASA Global Imagery Browse Services for EOSDIS')
  28719. * });
  28720. * viewer.imageryLayers.addImageryProvider(weather);
  28721. * @param options - Object describing initialization options
  28722. */
  28723. export class WebMapTileServiceImageryProvider {
  28724. constructor(options: WebMapTileServiceImageryProvider.ConstructorOptions);
  28725. /**
  28726. * The default alpha blending value of this provider, with 0.0 representing fully transparent and
  28727. * 1.0 representing fully opaque.
  28728. */
  28729. defaultAlpha: number | undefined;
  28730. /**
  28731. * The default alpha blending value on the night side of the globe of this provider, with 0.0 representing fully transparent and
  28732. * 1.0 representing fully opaque.
  28733. */
  28734. defaultNightAlpha: number | undefined;
  28735. /**
  28736. * The default alpha blending value on the day side of the globe of this provider, with 0.0 representing fully transparent and
  28737. * 1.0 representing fully opaque.
  28738. */
  28739. defaultDayAlpha: number | undefined;
  28740. /**
  28741. * The default brightness of this provider. 1.0 uses the unmodified imagery color. Less than 1.0
  28742. * makes the imagery darker while greater than 1.0 makes it brighter.
  28743. */
  28744. defaultBrightness: number | undefined;
  28745. /**
  28746. * The default contrast of this provider. 1.0 uses the unmodified imagery color. Less than 1.0 reduces
  28747. * the contrast while greater than 1.0 increases it.
  28748. */
  28749. defaultContrast: number | undefined;
  28750. /**
  28751. * The default hue of this provider in radians. 0.0 uses the unmodified imagery color.
  28752. */
  28753. defaultHue: number | undefined;
  28754. /**
  28755. * The default saturation of this provider. 1.0 uses the unmodified imagery color. Less than 1.0 reduces the
  28756. * saturation while greater than 1.0 increases it.
  28757. */
  28758. defaultSaturation: number | undefined;
  28759. /**
  28760. * The default gamma correction to apply to this provider. 1.0 uses the unmodified imagery color.
  28761. */
  28762. defaultGamma: number | undefined;
  28763. /**
  28764. * The default texture minification filter to apply to this provider.
  28765. */
  28766. defaultMinificationFilter: TextureMinificationFilter;
  28767. /**
  28768. * The default texture magnification filter to apply to this provider.
  28769. */
  28770. defaultMagnificationFilter: TextureMagnificationFilter;
  28771. /**
  28772. * Gets the URL of the service hosting the imagery.
  28773. */
  28774. readonly url: string;
  28775. /**
  28776. * Gets the proxy used by this provider.
  28777. */
  28778. readonly proxy: Proxy;
  28779. /**
  28780. * Gets the width of each tile, in pixels. This function should
  28781. * not be called before {@link WebMapTileServiceImageryProvider#ready} returns true.
  28782. */
  28783. readonly tileWidth: number;
  28784. /**
  28785. * Gets the height of each tile, in pixels. This function should
  28786. * not be called before {@link WebMapTileServiceImageryProvider#ready} returns true.
  28787. */
  28788. readonly tileHeight: number;
  28789. /**
  28790. * Gets the maximum level-of-detail that can be requested. This function should
  28791. * not be called before {@link WebMapTileServiceImageryProvider#ready} returns true.
  28792. */
  28793. readonly maximumLevel: number | undefined;
  28794. /**
  28795. * Gets the minimum level-of-detail that can be requested. This function should
  28796. * not be called before {@link WebMapTileServiceImageryProvider#ready} returns true.
  28797. */
  28798. readonly minimumLevel: number;
  28799. /**
  28800. * Gets the tiling scheme used by this provider. This function should
  28801. * not be called before {@link WebMapTileServiceImageryProvider#ready} returns true.
  28802. */
  28803. readonly tilingScheme: TilingScheme;
  28804. /**
  28805. * Gets the rectangle, in radians, of the imagery provided by this instance. This function should
  28806. * not be called before {@link WebMapTileServiceImageryProvider#ready} returns true.
  28807. */
  28808. readonly rectangle: Rectangle;
  28809. /**
  28810. * Gets the tile discard policy. If not undefined, the discard policy is responsible
  28811. * for filtering out "missing" tiles via its shouldDiscardImage function. If this function
  28812. * returns undefined, no tiles are filtered. This function should
  28813. * not be called before {@link WebMapTileServiceImageryProvider#ready} returns true.
  28814. */
  28815. readonly tileDiscardPolicy: TileDiscardPolicy;
  28816. /**
  28817. * Gets an event that is raised when the imagery provider encounters an asynchronous error. By subscribing
  28818. * to the event, you will be notified of the error and can potentially recover from it. Event listeners
  28819. * are passed an instance of {@link TileProviderError}.
  28820. */
  28821. readonly errorEvent: Event;
  28822. /**
  28823. * Gets the mime type of images returned by this imagery provider.
  28824. */
  28825. readonly format: string;
  28826. /**
  28827. * Gets a value indicating whether or not the provider is ready for use.
  28828. */
  28829. readonly ready: boolean;
  28830. /**
  28831. * Gets a promise that resolves to true when the provider is ready for use.
  28832. */
  28833. readonly readyPromise: Promise<boolean>;
  28834. /**
  28835. * Gets the credit to display when this imagery provider is active. Typically this is used to credit
  28836. * the source of the imagery. This function should not be called before {@link WebMapTileServiceImageryProvider#ready} returns true.
  28837. */
  28838. readonly credit: Credit;
  28839. /**
  28840. * Gets a value indicating whether or not the images provided by this imagery provider
  28841. * include an alpha channel. If this property is false, an alpha channel, if present, will
  28842. * be ignored. If this property is true, any images without an alpha channel will be treated
  28843. * as if their alpha is 1.0 everywhere. When this property is false, memory usage
  28844. * and texture upload time are reduced.
  28845. */
  28846. readonly hasAlphaChannel: boolean;
  28847. /**
  28848. * Gets or sets a clock that is used to get keep the time used for time dynamic parameters.
  28849. */
  28850. clock: Clock;
  28851. /**
  28852. * Gets or sets a time interval collection that is used to get time dynamic parameters. The data of each
  28853. * TimeInterval is an object containing the keys and values of the properties that are used during
  28854. * tile requests.
  28855. */
  28856. times: TimeIntervalCollection;
  28857. /**
  28858. * Gets or sets an object that contains dimensions and their values.
  28859. */
  28860. dimensions: any;
  28861. /**
  28862. * Gets the credits to be displayed when a given tile is displayed.
  28863. * @param x - The tile X coordinate.
  28864. * @param y - The tile Y coordinate.
  28865. * @param level - The tile level;
  28866. * @returns The credits to be displayed when the tile is displayed.
  28867. */
  28868. getTileCredits(x: number, y: number, level: number): Credit[];
  28869. /**
  28870. * Requests the image for a given tile. This function should
  28871. * not be called before {@link WebMapTileServiceImageryProvider#ready} returns true.
  28872. * @param x - The tile X coordinate.
  28873. * @param y - The tile Y coordinate.
  28874. * @param level - The tile level.
  28875. * @param [request] - The request object. Intended for internal use only.
  28876. * @returns A promise for the image that will resolve when the image is available, or
  28877. * undefined if there are too many active requests to the server, and the request should be retried later.
  28878. */
  28879. requestImage(x: number, y: number, level: number, request?: Request): Promise<ImageryTypes> | undefined;
  28880. /**
  28881. * Picking features is not currently supported by this imagery provider, so this function simply returns
  28882. * undefined.
  28883. * @param x - The tile X coordinate.
  28884. * @param y - The tile Y coordinate.
  28885. * @param level - The tile level.
  28886. * @param longitude - The longitude at which to pick features.
  28887. * @param latitude - The latitude at which to pick features.
  28888. * @returns Undefined since picking is not supported.
  28889. */
  28890. pickFeatures(x: number, y: number, level: number, longitude: number, latitude: number): undefined;
  28891. }
  28892. /**
  28893. * <span style="display: block; text-align: center;">
  28894. * <img src="Images/AnimationWidget.png" width="211" height="142" alt="" />
  28895. * <br />Animation widget
  28896. * </span>
  28897. * <br /><br />
  28898. * The Animation widget provides buttons for play, pause, and reverse, along with the
  28899. * current time and date, surrounded by a "shuttle ring" for controlling the speed of animation.
  28900. * <br /><br />
  28901. * The "shuttle ring" concept is borrowed from video editing, where typically a
  28902. * "jog wheel" can be rotated to move past individual animation frames very slowly, and
  28903. * a surrounding shuttle ring can be twisted to control direction and speed of fast playback.
  28904. * Cesium typically treats time as continuous (not broken into pre-defined animation frames),
  28905. * so this widget offers no jog wheel. Instead, the shuttle ring is capable of both fast and
  28906. * very slow playback. Click and drag the shuttle ring pointer itself (shown above in green),
  28907. * or click in the rest of the ring area to nudge the pointer to the next preset speed in that direction.
  28908. * <br /><br />
  28909. * The Animation widget also provides a "realtime" button (in the upper-left) that keeps
  28910. * animation time in sync with the end user's system clock, typically displaying
  28911. * "today" or "right now." This mode is not available in {@link ClockRange.CLAMPED} or
  28912. * {@link ClockRange.LOOP_STOP} mode if the current time is outside of {@link Clock}'s startTime and endTime.
  28913. * @example
  28914. * // In HTML head, include a link to Animation.css stylesheet,
  28915. * // and in the body, include: <div id="animationContainer"></div>
  28916. *
  28917. * const clock = new Cesium.Clock();
  28918. * const clockViewModel = new Cesium.ClockViewModel(clock);
  28919. * const viewModel = new Cesium.AnimationViewModel(clockViewModel);
  28920. * const widget = new Cesium.Animation('animationContainer', viewModel);
  28921. *
  28922. * function tick() {
  28923. * clock.tick();
  28924. * Cesium.requestAnimationFrame(tick);
  28925. * }
  28926. * Cesium.requestAnimationFrame(tick);
  28927. * @param container - The DOM element or ID that will contain the widget.
  28928. * @param viewModel - The view model used by this widget.
  28929. */
  28930. export class Animation {
  28931. constructor(container: Element | string, viewModel: AnimationViewModel);
  28932. /**
  28933. * Gets the parent container.
  28934. */
  28935. readonly container: Element;
  28936. /**
  28937. * Gets the view model.
  28938. */
  28939. readonly viewModel: AnimationViewModel;
  28940. /**
  28941. * @returns true if the object has been destroyed, false otherwise.
  28942. */
  28943. isDestroyed(): boolean;
  28944. /**
  28945. * Destroys the animation widget. Should be called if permanently
  28946. * removing the widget from layout.
  28947. */
  28948. destroy(): void;
  28949. /**
  28950. * Resizes the widget to match the container size.
  28951. * This function should be called whenever the container size is changed.
  28952. */
  28953. resize(): void;
  28954. /**
  28955. * Updates the widget to reflect any modified CSS rules for theming.
  28956. * @example
  28957. * animation.applyThemeChanges();
  28958. */
  28959. applyThemeChanges(): void;
  28960. }
  28961. /**
  28962. * Hide display mode by eigenvalue
  28963. */
  28964. export enum CategoryVisibleMode {
  28965. /**
  28966. * hide
  28967. */
  28968. Hide = 0,
  28969. /**
  28970. * show
  28971. */
  28972. Visible = 1,
  28973. /**
  28974. * ResetAll
  28975. */
  28976. ResetAll = 2
  28977. }
  28978. /**
  28979. * Sectional pattern of clipping surface
  28980. */
  28981. export enum ClipPlaneMode {
  28982. /**
  28983. * no cross section
  28984. */
  28985. NONE = 0,
  28986. /**
  28987. * Cross sections in the specified color
  28988. */
  28989. COLOR = 1,
  28990. /**
  28991. * Cross sections use the color of the model
  28992. */
  28993. MODEL_COLOR = 2
  28994. }
  28995. export enum DATAFILETYPE {
  28996. OSGBFile = 0,
  28997. OSGBCacheFile = 1,
  28998. ClampGroundPolygon = 2,
  28999. ClampObjectPolygon = 3,
  29000. ClampGroundLine = 4,
  29001. ClampObjectLine = 5,
  29002. IconPoint = 6,
  29003. Text = 7,
  29004. PointCloudFile = 8,
  29005. // 动态拉伸面
  29006. ExtendRegion3D = 9,
  29007. ExtendClampPolygonCache = 10,
  29008. PolylineEffect = 11,
  29009. RegionEffect = 12,
  29010. ClampGroundAndObjectLineCache = 13,
  29011. ClampGroundRealtimeRasterCache = 14
  29012. }
  29013. export enum EmissionTextureUnit {
  29014. None = 0,
  29015. First = 1,
  29016. Second = 2
  29017. }
  29018. export enum INSTANCEMODE {
  29019. SIZE_PER_INSTANCE = 20,
  29020. SIZE_PER_DM_INSTANCE = 35,
  29021. S3MB_BIM_INSTANCE = 17,
  29022. S3MB_BIM_INSTANCE_2 = 16,
  29023. S3MB_PIPE_INSTANCE = 29,
  29024. }
  29025. export enum InterpolationType {
  29026. /**
  29027. * Linear interpolation
  29028. */
  29029. Linear = 0,
  29030. /**
  29031. * Accelerated motion interpolation
  29032. */
  29033. Acceleration = 1,
  29034. /**
  29035. * Deceleration motion interpolation
  29036. */
  29037. Deceleration = 2,
  29038. /**
  29039. * Cubic spline interpolation
  29040. */
  29041. CubicSpline = 3,
  29042. /**
  29043. * SmoothStep interpolation
  29044. */
  29045. SmoothStep = 4
  29046. }
  29047. export enum LoadingPriorityMode {
  29048. /**
  29049. * Layer first
  29050. */
  29051. Root_Priority = 0,
  29052. /**
  29053. * Depth first
  29054. */
  29055. Child_Priority = 1,
  29056. /**
  29057. * Load according to the spatial index
  29058. */
  29059. UsePagedLodInfo = 2,
  29060. /**
  29061. * Depth-first nonlinear switching
  29062. */
  29063. Child_Priority_NonLinear = 3
  29064. }
  29065. export enum LOADSTATE {
  29066. UNLOAD = 0,
  29067. LOADING = 1,
  29068. LOADED = 2,
  29069. VOLLOADED = 3,
  29070. PARSING = 4,
  29071. PARSED = 5,
  29072. TRANSFORMING = 6,
  29073. TRANSFORMED = 7,
  29074. LOST = 8,
  29075. LOADVOL = 9,
  29076. FAILED = 10,
  29077. VOLFAILED = 11
  29078. }
  29079. /**
  29080. * Layer color blending mode
  29081. */
  29082. export enum MixColorType {
  29083. /**
  29084. * Color blending mode
  29085. */
  29086. MIX = 0,
  29087. /**
  29088. * Color replacement mode
  29089. */
  29090. REPLACE = 1
  29091. }
  29092. /**
  29093. * The excavation mode
  29094. */
  29095. export enum ModifyRegionMode {
  29096. /**
  29097. * Excavation of the internal
  29098. */
  29099. CLIP_INSIDE = 0,
  29100. /**
  29101. * The excavation outside
  29102. */
  29103. CLIP_OUTSIDE = 1
  29104. }
  29105. export enum ObjsOperationType {
  29106. RESET = 0,
  29107. SetColor = 0x01,
  29108. SELECTED = 0x02,
  29109. HIDE = 0x04,
  29110. OFFSET = 0x08,
  29111. CLIP = 0x10,
  29112. BLOOM = 0x20,
  29113. ALL = 0xff
  29114. }
  29115. /**
  29116. * Particle Effects type
  29117. */
  29118. export enum ParticleSystemType {
  29119. /**
  29120. * fire
  29121. */
  29122. FIRE = 0,
  29123. /**
  29124. * fountain
  29125. */
  29126. FOUNTAIN = 1,
  29127. /**
  29128. * rain
  29129. */
  29130. RAIN = 2
  29131. }
  29132. export enum PBR_MATERIAL_TYPE {
  29133. NONE = 0,
  29134. TITANIUM_SCUFFED = 1,
  29135. METAL_PLATE = 2,
  29136. EMISSION = 4,
  29137. ROUGHNESS = 8
  29138. }
  29139. /**
  29140. * Point cloud rendering mode
  29141. */
  29142. export enum PointCloudRenderMode {
  29143. /**
  29144. * General point
  29145. */
  29146. POINT = 0,
  29147. /**
  29148. * The body of the yuan
  29149. */
  29150. VOXEL = 1
  29151. }
  29152. export enum ProgramDefines {
  29153. EXCAVATION = 'EXCAVATION',
  29154. FALTTEN = 'FALTTEN',
  29155. OVERLAY = 'OVERLAY',
  29156. HYPSOMETRIC = 'HYPSOMETRIC',
  29157. ADJUST_COLOR = 'ADJUST_COLOR',
  29158. TRANSPARENT_BACK_COLOR = 'TRANSPARENT_BACK_COLOR',
  29159. HORIZONTAL_LINE = 'HORIZONTAL_LINE',
  29160. COMPUTE_W_VALUE = 'COMPUTE_W_VALUE',
  29161. COMPUTE_TEXCOORD = 'COMPUTE_TEXCOORD',
  29162. HAS_LIGHT = 'HAS_LIGHT',
  29163. HAS_NORMAL = 'HAS_NORMAL',
  29164. REPLACE_SELECT_TYPE = 'REPLACE_SELECT_TYPE',
  29165. SILHOUETTE_SELECT_TYPE = 'SILHOUETTE_SELECT_TYPE',
  29166. MULTI_TEX = 'MULTI_TEX',
  29167. APPLY_SPLIT = 'APPLY_SPLIT',
  29168. APPLY_SWIPE = 'APPLY_SWIPE',
  29169. TEXCOORD = 'TexCoord',
  29170. TEXCOORD2 = 'TexCoord2',
  29171. COMPRESS_VERTEX = 'COMPRESS_VERTEX',
  29172. COMPRESS_NORMAL = 'COMPRESS_NORMAL',
  29173. COMPRESS_COLOR = 'COMPRESS_COLOR',
  29174. COMPRESS_TEXCOORD = 'COMPRESS_TEXCOORD',
  29175. SKETCH_MODE = 'SKETCH_MODE',
  29176. NORMAL_AND_DEPTH = 'NORMAL_AND_DEPTH',
  29177. POST_EFFECT = 'POST_EFFECT',
  29178. CLIP_FILT_BY_ID = 'CLIP_FILT_BY_ID',
  29179. CLIP = 'CLIP',
  29180. CLIPPLANE = 'CLIPPLANE',
  29181. PBR = 'PBR',
  29182. PT_CLOUD = 'PT_CLOUD',
  29183. DIR_LIGHTS = 'DIR_LIGHTS ',
  29184. POINT_LIGHTS = 'POINT_LIGHTS ',
  29185. SPOT_LIGHTS = 'SPOT_LIGHTS ',
  29186. W_VISIBLE = 'W_VISIBLE',
  29187. EMISSION_TEXTURE = 'EMISSION_TEXTURE',
  29188. EMISSION_TEXTURE_COUNT = 'EMISSION_TEXTURE_COUNT ',
  29189. TEXTURE_MOVE = 'TEXTURE_MOVE',
  29190. VOLUME = 'Volume',
  29191. VOLUME2 = 'Volume2',
  29192. TEXTURE_COORD_ONE_IS_W = 'TEXTURE_COORD_ONE_IS_W',
  29193. TRIANGLE_FILTRATE = 'TRIANGLE_FILTRATE',
  29194. UseInstanceSkeletonMatrix = 'UseInstanceSkeletonMatrix',
  29195. RGBTOBGR = 'RGBTOBGR',
  29196. HAS_SKELETONSELECTED = 'HAS_SKELETONSELECTED',
  29197. SKELETONSELECT_ENABLE = 'SKELETONSELECT_ENABLE',
  29198. REPLACE_COLOR_TYPE = 'REPLACE_COLOR_TYPE',
  29199. INVALID_OBLIQUE = 'INVALID_OBLIQUE',//无效倾斜数据,默认用灰色
  29200. IGNORE_NORMAL = 'IGNORE_NORMAL',
  29201. TextureBatch = 'TextureBatch',
  29202. Translation = 'Translation',
  29203. VOL_AND_HYP = 'VOL_AND_HYP', // 有VOLUME时只有分层设色颜色,不用专题图颜色
  29204. VERTEX_CAPTURE = 'VERTEX_CAPTURE',
  29205. SEC_TEX_EMISSION = 'SEC_TEX_EMISSION',
  29206. BRDF = 'BRDF',
  29207. PBR_THEME = 'PBR_THEME',
  29208. IBL = 'IBL',
  29209. POINT = 'POINT',
  29210. HAS_BASE_TEXTURE = 'HAS_BASE_TEXTURE',
  29211. HAS_NORMAL_TEXTURE = 'HAS_NORMAL_TEXTURE',
  29212. HAS_OCCLUSION_TEXTURE = 'HAS_OCCLUSION_TEXTURE',
  29213. HAS_EMISSIVE_TEXTURE = 'HAS_EMISSIVE_TEXTURE',
  29214. REFRACTION = 'REFRACTION',
  29215. HAS_ANISOTROPY = 'HAS_ANISOTROPY',
  29216. HAS_CLEARCOAT = 'HAS_CLEARCOAT',
  29217. HAS_VOLUME = 'HAS_VOLUME',
  29218. HAS_TRANSMISSION = 'HAS_TRANSMISSION',
  29219. USE_BatchPBR = 'USE_BatchPBR',
  29220. HAS_DIR_LIGHTS = 'HAS_DIR_LIGHTS',
  29221. HAS_POINT_LIGHTS = 'HAS_POINT_LIGHTS',
  29222. HAS_SPOT_LIGHTS = 'HAS_SPOT_LIGHTS',
  29223. NO_TEXCOORD = 'NO_TEXCOORD',
  29224. FLOOD_ANALYSIS = 'FLOOD_ANALYSIS',
  29225. HAS_RAIN = 'HAS_RAIN',
  29226. HAS_WETNESS = 'HAS_WETNESS',
  29227. HAS_SNOW = 'HAS_SNOW',
  29228. HAS_MetallicRoughness_TEXTURE = 'HAS_MetallicRoughness_TEXTURE',
  29229. FusionMode = 'FusionMode',
  29230. VISIBLEDISTANCEMAX = 'VISIBLEDISTANCEMAX',
  29231. // BBL= Babylon
  29232. BBL_OPACITY = 'BBL_OPACITY',
  29233. BBL_OPACITYRGB = 'BBL_OPACITYRGB',
  29234. METALLICWORKFLOW = 'METALLICWORKFLOW',
  29235. DEBUGMODE = 'DEBUGMODE',
  29236. REFLECTIVITY = 'REFLECTIVITY',
  29237. ROUGHNESSSTOREINMETALMAPGREEN = 'ROUGHNESSSTOREINMETALMAPGREEN',
  29238. METALLNESSSTOREINMETALMAPBLUE = 'METALLNESSSTOREINMETALMAPBLUE',
  29239. SHEEN = 'SHEEN',
  29240. SHEEN_TEXTURE = 'SHEEN_TEXTURE',
  29241. SHEENBRDF_TEXTURE = 'SHEENBRDF_TEXTURE',
  29242. SHEEN_ROUGHNESS = 'SHEEN_ROUGHNESS',
  29243. CLEARCOAT = 'CLEARCOAT',
  29244. CLEARCOAT_TEXTURE = 'CLEARCOAT_TEXTURE',
  29245. CLEARCOAT_TINT = 'CLEARCOAT_TINT',
  29246. CLEARCOAT_TINT_TEXTURE = 'CLEARCOAT_TINT_TEXTURE',
  29247. CLEARCOAT_BUMP = 'CLEARCOAT_BUMP',
  29248. SUBSURFACE = 'SUBSURFACE',
  29249. SS_THICKNESSANDMASK_TEXTURE = 'SS_THICKNESSANDMASK_TEXTURE',
  29250. SS_REFRACTION = 'SS_REFRACTION',
  29251. SS_TRANSLUCENCY = 'SS_TRANSLUCENCY'
  29252. }
  29253. export enum RANGEMODE {
  29254. DISTANCE_FROM_EYE_POINT = 0,
  29255. PIXEL_SIZE_ON_SCREEN = 1,
  29256. GEOMETRY_ERROR = 2
  29257. }
  29258. /**
  29259. * S3M texture compression type
  29260. */
  29261. export enum S3MCompressType {
  29262. /**
  29263. * compression
  29264. */
  29265. encNONE = 0,
  29266. /**
  29267. * DXT compression
  29268. */
  29269. enrS3TCDXTN = 14,
  29270. /**
  29271. * PVR compression -IOS devices
  29272. */
  29273. enrPVRTPF_PVRTC2 = 19,
  29274. /**
  29275. * PVR compression -IOS devices
  29276. */
  29277. enrPVRTPF_PVRTC = 20,
  29278. /**
  29279. * PVR compression -IOS devices
  29280. */
  29281. enrPVRTPF_PVRTC_4bpp = 21,
  29282. /**
  29283. * ETC compression - Android devices
  29284. */
  29285. enrPVRTPF_ETC1 = 22
  29286. }
  29287. export enum VERSION {
  29288. S3M = 49,
  29289. S3M4 = 1
  29290. }
  29291. /**
  29292. * Select Color mode for S3M layer
  29293. */
  29294. var SelectColorType = {
  29295. /**
  29296. * Color blending mode
  29297. */
  29298. MIX = 0,
  29299. /**
  29300. * Color replacement mode
  29301. */
  29302. REPLACE = 1,
  29303. /**
  29304. * Contour model
  29305. */
  29306. SILHOUETTE = 2,
  29307. /**
  29308. * Contour mode that will not be occluded
  29309. */
  29310. ALWAYS_SHOW_SILHOUETTE = 3,
  29311. /**
  29312. * Outer contour mode
  29313. */
  29314. SILHOUETTE_EDGE = 4
  29315. };
  29316. /**
  29317. * S3M Layer shadow type
  29318. */
  29319. export enum SHADOWTYPE {
  29320. /**
  29321. * Close the shadow
  29322. */
  29323. NONE = 0,
  29324. /**
  29325. * Select only the object to turn on shadow
  29326. */
  29327. SELECTION = 1,
  29328. /**
  29329. * Turn shadow on for all objects
  29330. */
  29331. ALL = 2
  29332. }
  29333. export enum SkeletonState {
  29334. UnLoad = 0,
  29335. Loading = 1,
  29336. Loaded = 2,
  29337. Parsing = 3,
  29338. Ready = 4,
  29339. LoadedFailed = 5,
  29340. ParseFailed = 6
  29341. }
  29342. /**
  29343. * SplitDirection
  29344. */
  29345. export enum SplitDirection {
  29346. /**
  29347. * Disable the split
  29348. */
  29349. NONE = 0,
  29350. /**
  29351. * Shield the left side of the curtain
  29352. */
  29353. LEFT = 1,
  29354. /**
  29355. * Shield the right side of the curtain
  29356. */
  29357. RIGHT = 2,
  29358. /**
  29359. * Shield the top of the curtain
  29360. */
  29361. TOP = -1,
  29362. /**
  29363. * Shield the lower side of the curtain
  29364. */
  29365. BOTTOM = -2
  29366. }
  29367. export enum VertexWeightMode {
  29368. DatasetField = 0,
  29369. EdgeLengthMin = 1
  29370. }
  29371. /**
  29372. * Facade立面出图类,通过该功能,对场景中的模型输出指定范围的立面图。
  29373. */
  29374. export class Facade {
  29375. /**
  29376. * 获取终止点
  29377. */
  29378. endPoint: Cartesian3;
  29379. /**
  29380. * 获取或设置立面出图范围的最远距离
  29381. */
  29382. farDistance: Number;
  29383. /**
  29384. * 获取或设置立面出图的最大高度。
  29385. * 异步对象,解析出立面图的base64字符串(和场景出图用法保持一致)。
  29386. * @example
  29387. * facade.readyPromise.then(function(base64) {
  29388. XXX // 将base64字符串转换为图片进行下载或者填充到别的元素中
  29389. });
  29390. */
  29391. readyPromise: Promise;
  29392. /**
  29393. * 获取起始点。
  29394. */
  29395. startPoint: Cartesian3
  29396. /**
  29397. * 将立面分析加入分析图层中进行更新
  29398. */
  29399. build(): void;
  29400. /**
  29401. * 设置指定线段出图的起止点
  29402. * @param 开始位置
  29403. * @param 结束位置
  29404. */
  29405. setBoundByPoints(startPoint: Cartesian3, endPoint: Cartesian3)
  29406. }
  29407. export class LimitBody {
  29408. constructor(positions: any, skyline: any)
  29409. destroy(): void;
  29410. initialize(): void;
  29411. update(): void;
  29412. }
  29413. /**
  29414. * 剖面线分析类,在场景中选取起始点、结束点进行分析,获得剖面线分析效果图。
  29415. */
  29416. export class Profile {
  29417. /**
  29418. * @param scene 指定用于分析的场景对象
  29419. * @example
  29420. * 创建剖面线分析
  29421. * var profile= new Cesium.Profile(scene);
  29422. */
  29423. constructor(scene: Object)
  29424. /**
  29425. * 获取或设置剖面线分析的结束点。该点由经度、纬度和高程组成的数组表示
  29426. */
  29427. endPoint: Array
  29428. /**
  29429. * 获取或设置剖面分析在三维空间中的跨越高度,单位是米
  29430. */
  29431. extendHeight: Number
  29432. /**
  29433. * 获取或设置剖面线分析的起始点。该点由经度、纬度和高程组成的数组表示
  29434. */
  29435. startPoint: Array
  29436. /**
  29437. * 执行剖面线分析
  29438. */
  29439. build(): void
  29440. /**
  29441. * 清除分析结果
  29442. */
  29443. destroy(): void
  29444. /**
  29445. * 获取剖面分析的结果
  29446. * @param func - 回调函数,其参数是剖面分析的结果(剖面图rgba字节流)
  29447. */
  29448. getBuffer(func: () => void);
  29449. /**
  29450. * 获取分析结果的点集的实际地理坐标
  29451. * @param func - 回调函数,其参数是剖面分析的结果
  29452. */
  29453. getPositions(func: () => void);
  29454. }
  29455. /**
  29456. * 视频投放类。将图片或视频投放到场景中,可模拟建筑物上的广告幕布或大屏电视效果
  29457. * @param scene - 指定用于分析的场景对象
  29458. * @example
  29459. * 创建视频投放
  29460. * var projectionImagee= new Cesium.ProjectionImage(scene);
  29461. */
  29462. export class ProjectionImage {
  29463. constructor(scene: Object)
  29464. /**
  29465. * 获取或设置视频投放时投影仪的方位角,即顺时针与正北方向的夹角,取值范围:0度~360度
  29466. */
  29467. direction: number
  29468. /**
  29469. * 获取或设置观察点到投影仪的距离
  29470. */
  29471. distance: number
  29472. /**
  29473. * 获取或设置视频投放时提示线的颜色
  29474. */
  29475. hintLineColor: Color
  29476. /**
  29477. * 获取或设置视频投放时提示线的可见性
  29478. */
  29479. hintLineVisible: Color
  29480. /**
  29481. * 获取或设置视频投放时投影仪的水平视角范围,单位:度
  29482. */
  29483. horizontalFov: number
  29484. /**
  29485. * 获取或设置视频投放时投影仪的俯仰角,该角指相机方向和水面方向的夹角,取向上为正,单位:度
  29486. */
  29487. pitch: number
  29488. /**
  29489. * 获取或设置视频投放时投影仪的垂直视角范围,单位:度
  29490. */
  29491. verticalFov: number
  29492. /**
  29493. * 获取或设置视频投放观察者的位置。位置由经度、纬度和高程组成的数组表示
  29494. */
  29495. viewPosition: array
  29496. /**
  29497. * 获取或者设置视频投放是否可见,默认为true
  29498. */
  29499. visible: boolean
  29500. /**
  29501. * 获取或者设置视频投放的最大可见距离,默认为500
  29502. */
  29503. visibleDistanceMax: number
  29504. /**
  29505. * 从文件中读取多路视频,即通过文件同时添加多个视频进行投放
  29506. * @param scene - 进行投放的场景
  29507. * @param infoUrl - 视频的属性信息文件的地址或者路径
  29508. * @param baseUrl - 基础路径。如果添加, 则会和文件中视频的名字拼接成一个路径,如果不添加,则使用infoUrl文件中的父级路径作为baseUrl
  29509. * @example
  29510. * Cesium.ProjectionImage.fromInfo(scene, './data/allprojectionInfo.xml', './media/')
  29511. */
  29512. fromInfo(scene: Scene, infoUrl: string, baseUrl: string): Promise
  29513. /**
  29514. * 添加裁剪多边形
  29515. * @param name - 多边形的名称
  29516. * @param position - 多边形的位置
  29517. */
  29518. addClipRegion(options: { name: string, position: Cartesian3 }): boolean;
  29519. /**
  29520. * 执行视频投放分析
  29521. */
  29522. build(): void
  29523. /**
  29524. * 获取视频投放分析在指定视口的可见性
  29525. * @param index - 指定的视口索引
  29526. */
  29527. getVisibleInViewport(index: number): boolean;
  29528. /**
  29529. * 图片像素坐标转世界坐标
  29530. * @param x - 图片像素的x坐标
  29531. * @param x - 图片像素的y坐标
  29532. */
  29533. pixelToWorldCoordinates(x: number, y: number): Cartesian3
  29534. /**
  29535. * 删除所有多边形
  29536. */
  29537. removeAllClipRegion(): boolean
  29538. /**
  29539. * 删除指定名称的多边形
  29540. * @param name - 多边形名称
  29541. */
  29542. removeClipRegion(name: string): boolean
  29543. /**
  29544. * 设置裁剪模式
  29545. * @param - 为ModifyRegionMode枚举
  29546. */
  29547. setClipMode(mode: any): boolean
  29548. /**
  29549. * 按点设置方向(经度、纬度和高度)
  29550. * @param position
  29551. */
  29552. setDistDirByPoint(position: array): void
  29553. /**
  29554. * 设置图片融合的S3M图层
  29555. * @param layers - S3M图层
  29556. */
  29557. setFusionLayers(layers: array): void
  29558. /**
  29559. * 设置用于投放的图片或视频对象
  29560. * @param options - url: 指定图片资源的地址 video:指定视频的地址,目前仅支持*.webm格式的视频,目前只支持.webm
  29561. */
  29562. setImage(options: { url: array, video: object })
  29563. /**
  29564. * 设置视频投放的位置信息,这些位置信息被保存在一个.xml的文件中,通过读取该文件的内容进行设置
  29565. * @param url - 存储位置信息的文件的地址
  29566. */
  29567. setInfo(url: string)
  29568. /**
  29569. * 设置视频投放分析在指定视口的可见性ShadowQueryPoints
  29570. * @param index - 指定的视口索引 索引值的范围为0-3
  29571. */
  29572. setVisibleInViewport(index: number)
  29573. }
  29574. /**
  29575. * 阴影率分析类,指定分析范围、设置阴影类型、设定分析时间段得出阴影率分析结果
  29576. * @param scene - 场景对象
  29577. * @example
  29578. * //创建阴影率分析
  29579. * var shadowQueryPoints= new Cesium.ShadowQueryPoints(scene)
  29580. */
  29581. export class ShadowQueryPoints {
  29582. constructor(scene: Scene);
  29583. /**
  29584. * 设置颜色表
  29585. */
  29586. colorTable: ColorTable;
  29587. /**
  29588. * 获取或设置分析的结束时间
  29589. */
  29590. endTime: JulianDate
  29591. /**
  29592. * 获取点集和每个点的阴影率事件
  29593. */
  29594. queryPointsEvent: Event
  29595. /**
  29596. * 获取或设置阴影率点的间距
  29597. */
  29598. spacing: number
  29599. /**
  29600. * 获取或设置分析的开始时间
  29601. */
  29602. startTime: JulianDate
  29603. /**
  29604. * 用于获取体元数据,设置给S3M图层,以体覆盖的形式来表达日照率
  29605. */
  29606. voxelData: object
  29607. /**
  29608. * 执行阴影分析
  29609. */
  29610. build(): void
  29611. /**
  29612. * 获得阴影率
  29613. * @param cartographic - 经纬度
  29614. */
  29615. getShadowRadio(cartographic: object): number
  29616. /**
  29617. * 获得阴影率分析在指定视口的可见性
  29618. * @param index - 指定的视口索引 索引值的范围为:0-3
  29619. */
  29620. getVisibleInViewport(index: number): boolean
  29621. /**
  29622. * 添加阴影率分析的区域
  29623. * @param options.position - 指定分析区域的位置信息,由包含经度、纬度的数组表示
  29624. * @param options.bottom - 指定分析区域的底部高程
  29625. * @param options.extend - 指定分析区域的拉伸高度
  29626. */
  29627. qureyRegion(options: { position: array, bottom: string, extend: string }): void
  29628. /**
  29629. * 设置阴影率分析在指定视口的可见性
  29630. * @param index - 指定的视口索引 索引值的范围为:0-3
  29631. */
  29632. setVisibleInViewport(index: number): void
  29633. }
  29634. /**
  29635. * 视线分析,即通视分析,根据观察者点位和目标点建立视线分析,并在场景中分析得到结果
  29636. * @param scene - 场景对象
  29637. * @example
  29638. * //创建通视分析
  29639. * var sightline = new Cesium.Sightline(scene)
  29640. */
  29641. export class Sightline {
  29642. constructor(scene: Scene)
  29643. /**
  29644. * 获取或设置通视分析的不可见部分颜色
  29645. * @example
  29646. * var sightline = new Cesium.Sightline(scene);
  29647. * var color = new Cesium.Color(1, 0, 0);
  29648. * //设置不可见部分的颜色
  29649. * sightline .hiddenColor = color;
  29650. * //获取不可见部分的颜色
  29651. * var value= sightline .hiddenColor
  29652. */
  29653. hiddenColor: Color
  29654. /**
  29655. * 获取或设置通视线的宽度
  29656. */
  29657. lineWidth: number
  29658. /**
  29659. * 获取或设置观察者的位置。位置由经度、纬度和高程组成的数组表示
  29660. * @example
  29661. * var sightline = new Cesium.Sightline(scene);
  29662. * //设置观察者的位置
  29663. * sightline .viewPosition = [120, 40, 100];F
  29664. * //获取观察者的位置
  29665. * var value= sightline .viewPosition;
  29666. */
  29667. viewPosition: array
  29668. /**
  29669. * 获取或设置通视分析的可见部分颜色
  29670. * @example
  29671. * var sightline = new Cesium.Sightline(scene);
  29672. * var color = new Cesium.Color(0, 1, 0);
  29673. * //设置可见部分颜色
  29674. * sightline .visibleColor = color;
  29675. * //获取可见部分颜色
  29676. * var value= sightline .visibleColor
  29677. */
  29678. visibleColor: Color
  29679. /**
  29680. * 添加目标点
  29681. * @param options.position - 位置信息,由经度、纬度和高程组成的数组表示
  29682. * @param options.name - 目标点的名称
  29683. * @example
  29684. * var sightline = new Cesium.Sightline(scene);
  29685. * sightline.addTargetPoint({
  29686. * postion : [120, 40, 50],
  29687. * name : “first”
  29688. * });
  29689. */
  29690. addTargetPoint(options: { position: Array, name: string }): boolean
  29691. /**
  29692. * 执行通视分析
  29693. * @example
  29694. * var sightline = new Cesium.Sightline(scene);
  29695. * sightline.build()
  29696. */
  29697. build(): void
  29698. /**
  29699. * 获得障碍点
  29700. * @param name - 目标点名称
  29701. * @param func - 回调函数
  29702. */
  29703. getBarrierPoint(name: string, func: () => void): object
  29704. /**
  29705. * 获取通视分析所有障碍物对象的IDS集合
  29706. * @returns 返回一个k-v对象,key为S3M图层ID,value为对象IDS数组
  29707. */
  29708. getObjectIds(): object
  29709. /**
  29710. * 获得图层对应视口可见性
  29711. * @param index - 索引
  29712. * @returns visible 可见性
  29713. */
  29714. getVisibleInViewport(index: number): boolean
  29715. /**
  29716. * 移除所有目标点
  29717. * @example
  29718. * var sightline = new Cesium.Sightline(scene);
  29719. * sightline.removeAllTargetPoint()
  29720. */
  29721. removeAllTargetPoint(): void
  29722. /**
  29723. * 移除指定名称的目标点
  29724. * @param name - 待移除的目标点名称
  29725. * @return 移除成功返回true,否则返回false
  29726. * @example
  29727. * var sightline = new Cesium.Sightline(scene);
  29728. * var flag = sightline.removeTargetPoint(“first”);
  29729. */
  29730. removeTargetPoint(name: string): boolean
  29731. /**
  29732. * 设置图层对应视口可见性
  29733. * @param index - 索引
  29734. */
  29735. setVisibleInViewport(index: number): void
  29736. }
  29737. /**
  29738. * 天际线分析。可设定观察者位置、观察方向,并在场景中得到分析结果
  29739. * @example
  29740. * //创建天际线分析
  29741. * var skyline= new Cesium.Skyline(scene);
  29742. */
  29743. export class Skyline {
  29744. constructor(scene: object)
  29745. /**
  29746. * Get or Set the color
  29747. * @example
  29748. * var skyline= new Cesium.Skyline(scene);
  29749. * var color = new Cesium.Color(0, 1, 0);
  29750. * //设置颜色
  29751. * skyline.color = color;
  29752. * //获取颜色
  29753. * var value= skyline.color ;
  29754. */
  29755. color: Color
  29756. /**
  29757. * 获取或设置相机与正北方向的夹角。单位:度,取值范围0-360
  29758. * @example
  29759. * var skyline= new Cesium.Skyline(scene);
  29760. * //设置方向
  29761. * skyline.direction = 1.0;
  29762. * //获取方向
  29763. * var value= skyline.direction ;
  29764. */
  29765. direction: number
  29766. /**
  29767. * 获取或设置线、面的显示模式。当值取0时,以线的形式展示;当值为1时,以面展示。默认值为线
  29768. */
  29769. displayMode: number
  29770. /**
  29771. * 获取或设置天际线的显示模式。 DisplayMode.LINE表示天际线的线模式,DisplayMode.FACE表示天际线的面模式
  29772. * @example
  29773. * var skyline= new Cesium.Skyline(scene);
  29774. * //设置显示模式
  29775. * skyline.displayStyle = Cesium.Skyline.displayMode.LINE;
  29776. * //获取显示模式
  29777. * var value= skyline.displayStyle ;
  29778. */
  29779. displayStyle: number
  29780. /**
  29781. * 地球表面是否参与天际线分析,默认值为false表示参与,当设置为true则表示不参与
  29782. */
  29783. ignoreGlobe: boolean
  29784. /**
  29785. * 设置天际线的宽度,默认1像素
  29786. */
  29787. lineWidth: number
  29788. /**
  29789. * 获取或设置相机的俯仰角,该俯仰角为相机方向和水面方向的夹角。单位:度,取值范围为0-90
  29790. * @example
  29791. * var skyline= new Cesium.Skyline(scene);
  29792. * //设置俯仰角
  29793. * skyline.pitch = 1.0;
  29794. * //获取俯仰角
  29795. * var value= skyline.pitch;
  29796. */
  29797. pitch: number
  29798. /**
  29799. * 获取或设置天际线分析半径,单位:米。默认值为-1.0,表示无穷远
  29800. */
  29801. radius: number
  29802. /**
  29803. * Get or Set the viewPosition
  29804. * @example
  29805. * var skyline= new Cesium.Skyline(scene);
  29806. * //设置观察者的位置
  29807. * skyline.viewPosition = [120, 40, 100];
  29808. * //获取观察者的位置
  29809. * var value= skyline.viewPosition;
  29810. */
  29811. viewPosition: array
  29812. /**
  29813. * 为天际线分析添加限高体对象,模拟新建建筑物在不影响天际线时的高度范围
  29814. * @param options.position - 指定限高体位置信息,由经度、纬度的数组表示
  29815. * @param options.name - 指定限高体名称
  29816. * @returns 添加成功返回true,失败返回fals
  29817. */
  29818. addLimitbody(options: { position: array, name: string }): boolean
  29819. /**
  29820. * 执行天际线分析
  29821. * @example
  29822. * var skyline= new Cesium.Skyline(scene);
  29823. * skyline.bulid();
  29824. */
  29825. build(): void
  29826. /**
  29827. * 清除限高体
  29828. */
  29829. clear(): void
  29830. /**
  29831. * 获取障碍物对象的IDS集合
  29832. * @returns 返回一个k-v对象,key为S3M图层ID,value为对象IDS数组
  29833. */
  29834. getObjectIds(): object
  29835. /**
  29836. * 输出二维的天际线分析结果
  29837. * @returns 二维线,由x/y数组表示
  29838. */
  29839. getSkyline2D(): Object
  29840. /**
  29841. * 输出三维的天际线分析结果
  29842. * @returns 三维线,由x/y/z数组表示
  29843. */
  29844. getSkyline3D(): Object
  29845. /**
  29846. * 获取天际线闭合体的构建参数,包括三维天际线、观察点位置
  29847. */
  29848. getSkylineSectorParameter(): object
  29849. /**
  29850. * 获取天际线分析结果在指定视口的可见性
  29851. * @param index 指定的视口索引索引值的范围为0-3
  29852. */
  29853. getVisibleInViewport(index: number): boolean
  29854. /**
  29855. * 移除所有限高体对象
  29856. */
  29857. removeAllLimitBody(): void
  29858. /**
  29859. * 移除指定名称的限高体对象
  29860. * @param name 待移除限高体的名称
  29861. * @returns 移除成功返回true,失败返回false
  29862. */
  29863. removeLimitbody(name: string): boolean
  29864. /**
  29865. * 设置天际线分析结果在指定视口的可见性
  29866. * @param index 指定的视口索引
  29867. */
  29868. setVisibleInViewport(index: number): void
  29869. }
  29870. /**
  29871. * 可视域分析,设置观察点、目标的位置,水平、垂直视角范围,建立可视区域分析并在指定的场景中显示分析结果
  29872. * @param scene 场景对象
  29873. * @example
  29874. * //创建可视域分析
  29875. * var viewShed3D= new Cesium.ViewShed3D(scene);
  29876. */
  29877. export class ViewShed3D {
  29878. constructor(scene: object)
  29879. /**
  29880. * 获取或设置当前相机的方向与正北方向的夹角,单位:度
  29881. */
  29882. direction: number
  29883. /**
  29884. * 获取或设置可视距离,单位:米
  29885. */
  29886. distance: number
  29887. /**
  29888. * 获取或设置不可见区域的颜色
  29889. */
  29890. hiddenAreaColor: Color
  29891. /**
  29892. * 获取或设置可视域分析的提示线颜色
  29893. */
  29894. hintLineColor: Color
  29895. /**
  29896. * 获取或设置可视域分析的水平视角范围。单位:度
  29897. */
  29898. horizontalFov: number
  29899. /**
  29900. * 获取或设置当前分析的相机俯仰角。注意:该俯仰角指当相机方向与地面平行的时候是0度,与相机本身参数俯仰不一样
  29901. */
  29902. pitch: number
  29903. /**
  29904. * 获取或设置可视域分析垂直视角范围。单位:度
  29905. */
  29906. verticalFov: number
  29907. /**
  29908. * 获取或设置观察点的位置。位置由经度、纬度和高程组成的数组表示
  29909. */
  29910. viewPosition: array
  29911. /**
  29912. * 获取或设置可见区域的颜色
  29913. */
  29914. visibleAreaColor: Color
  29915. /**
  29916. * 添加裁剪区域
  29917. * @param options.name 裁剪区域的名称
  29918. * @param options.position 裁剪区域
  29919. * @returns 裁剪区域是否添加成功
  29920. */
  29921. addClipRegion(options: { name: string, position: array }): boolean
  29922. /**
  29923. * 获取目标点对应的障碍点
  29924. * @param options
  29925. * @param targetPoint 目标点
  29926. * @returns 障碍点
  29927. */
  29928. getBarrierPoint(options: object, targetPoint: Point3D): Point3D
  29929. /**
  29930. * 获取可视域闭合体的构建参数。
  29931. * @Returns 返回可视/不可视闭合体的构建参数,包括视点、目标、障碍点行列阵列及半径
  29932. */
  29933. getViewshedParameter(): object
  29934. /**
  29935. * 获得可视域分析在对应视口的可见性
  29936. */
  29937. getVisibleInViewport(index: number): boolean
  29938. /**
  29939. * 移除所有裁剪区域
  29940. */
  29941. removeAllClipRegion(): boolean
  29942. /**
  29943. * 移除裁剪区域
  29944. * @param name 区域名称
  29945. */
  29946. removeClipRegion(name: string): boolean
  29947. /**
  29948. * set the direction by point(longitude, latitude and height)
  29949. * @param position
  29950. */
  29951. setDistDirByPoint(position: array)
  29952. /**
  29953. * 设置可视域分析在对应视口的可见性
  29954. * @param index 指定的视口索引
  29955. */
  29956. setVisibleInViewport(index: number): void
  29957. }
  29958. /**
  29959. * 飞行管理类,控制飞行的开始、暂停、停止以及站点事件等
  29960. * @param option.scene 场景对象
  29961. * @param option.routes 飞行路线集合对象(从飞行文件中读取的)
  29962. * @example
  29963. * //创建飞行路线集合对象。
  29964. * var routes = new Cesium.RouteCollection();
  29965. * //读取飞行文件。
  29966. * routes.fromFile('./test.fpf');
  29967. * //创建飞行管理对象。
  29968. * var fm = new Cesium.FlyManager({
  29969. * scene : scene,
  29970. * routes : routes
  29971. * });
  29972. */
  29973. export class FlyManager {
  29974. constructor(option: { scene: Scene, routes: RouteCollection })
  29975. /**
  29976. * 获取当前飞行路线
  29977. */
  29978. currentRoute: Route
  29979. /**
  29980. * 获取或者设置当前站点索引(指定从该站点开始飞行
  29981. */
  29982. currentStopIndex: Number
  29983. /**
  29984. * 获取或者设置飞行路线的飞行速率,大于1.0加速,小于1.0减速
  29985. */
  29986. playRate: Number
  29987. /**
  29988. * 获取飞行路线的就绪状态的promise
  29989. */
  29990. readyPromise: Promise
  29991. /**
  29992. * 获取或者设置当前路线集合对象
  29993. */
  29994. routes: RouteCollection
  29995. /**
  29996. * 获取站点到达事件
  29997. */
  29998. stopArrived: Event
  29999. /**
  30000. * 获取当前飞行路线的所有站点
  30001. * @returns 返回所有站点集合数组
  30002. */
  30003. getAllRouteStops(): array
  30004. /**
  30005. * 暂停飞行
  30006. */
  30007. pause()
  30008. /**
  30009. * 开始飞行
  30010. */
  30011. play()
  30012. /**
  30013. * 停止飞行
  30014. */
  30015. stop()
  30016. /**
  30017. * 站点定位
  30018. * @param stop 相机定位到该站点
  30019. */
  30020. viewToStop(stop: RouteStop): void
  30021. }
  30022. //相机飞行拐弯模式
  30023. export enum TurningMode {
  30024. /**
  30025. * 平滑拐弯
  30026. * @type {Number}
  30027. */
  30028. Smoothly = 0,
  30029. /**
  30030. * 直接拐弯
  30031. * @type {Number}
  30032. */
  30033. Directly = 1
  30034. };
  30035. /**
  30036. * 飞行路线对象类
  30037. * @param option.isStopVisible 是否循环飞行
  30038. * @param option.isFlyLoop 是否循环飞行
  30039. * @param option.isLineVisible 飞行路线是否可见
  30040. * @param option.routeName 飞行路线名称
  30041. * @param option.speed 飞行速度
  30042. * @param option.isAlongline 是否沿线飞行
  30043. * @param option.totalDuration 总共的飞行时间
  30044. */
  30045. export class Route {
  30046. constructor(option: {
  30047. isStopVisible: boolean,
  30048. isFlyLoop: boolean,
  30049. isLineVisible: boolean,
  30050. routeName: string,
  30051. speed: number,
  30052. isAlongline: boolean,
  30053. totalDuration: number,
  30054. })
  30055. /**
  30056. * 获取或者设置该飞行路线是否是沿线飞行
  30057. */
  30058. isAlongline: boolean
  30059. /**
  30060. * 获取或者设置相机高度是否锁定
  30061. */
  30062. isAltitudeFree: boolean
  30063. /**
  30064. * 获取或者设置该飞行路线是否循环飞行
  30065. */
  30066. isFlyLoop: boolean
  30067. /**
  30068. * 获取或者设置相机是否锁定方位角
  30069. */
  30070. isHeadingFree: boolean
  30071. /**
  30072. * 获取或者设置该飞行路线的路径是否可见
  30073. */
  30074. isLineVisible: boolean
  30075. /**
  30076. * 获取或者设置该飞行路线的站点是否可见
  30077. */
  30078. isStopVisible: boolean
  30079. /**
  30080. * 获取或者设置相机是否锁定俯仰角
  30081. */
  30082. isTiltFree: boolean
  30083. /**
  30084. * 获取或者设置该飞行路线的名称
  30085. */
  30086. routeName: string
  30087. /**
  30088. * 获取或者设置该飞行路线的飞行速度,优先以站点速度为准(单位:m/s)
  30089. */
  30090. speed: number
  30091. /**
  30092. * 获取该飞行路线的所有站点集合
  30093. */
  30094. stopCollection: array
  30095. /**
  30096. * 获取该飞行路线的站点个数
  30097. */
  30098. stopCount: number
  30099. /**
  30100. * 获取或者设置该飞行路线总共飞行时间(单位:秒)
  30101. */
  30102. totalDuration: number
  30103. /**
  30104. * 添加站点
  30105. * @param stop 站点对象
  30106. */
  30107. addStop(stop: RouteStop): boolean
  30108. /**
  30109. * 通过索引获取该飞行路线的站点
  30110. * @param index 站点索引
  30111. */
  30112. get(index: number): RouteStop
  30113. /**
  30114. * 移除飞行站点,参数为站点对象
  30115. * @param stop - 站点对象
  30116. */
  30117. removeStop(stop: object)
  30118. }
  30119. /**
  30120. * 飞行路线集合对象类
  30121. * @example
  30122. * //创建飞行路线集合对象。
  30123. * var routes = new Cesium.RouteCollection(entityCollection);
  30124. * //读取记录飞行路线的文本文件。
  30125. * routes.fromFile('./test.fpf');
  30126. */
  30127. export class RouteCollection {
  30128. constructor(entityCollection: EntityCollection)
  30129. /**
  30130. * 获取路线集合是否准备就绪
  30131. */
  30132. ready: boolean
  30133. /**
  30134. * 获取路线集合数组
  30135. */
  30136. routes: array
  30137. /**
  30138. * 添加路线对象
  30139. * @param route 路线对象
  30140. */
  30141. addRoute(route: Route)
  30142. /**
  30143. * 异步加载记录飞行路线的fpf文本文件
  30144. * @param url fpf文本文件路径url
  30145. */
  30146. fromFile(url: string)
  30147. /**
  30148. * 读取解析记录飞行路线的fpf文本文件
  30149. * @param xml 记录飞行路线的fpf文本文件
  30150. * @example
  30151. * var routes = new Cesium.RouteCollection();
  30152. * var XMLContent = "......";
  30153. * routes.fromXML(XMLContent);
  30154. */
  30155. fromXML(xml: string)
  30156. /**
  30157. * 通过索引获取飞行路线
  30158. * @param index 索引
  30159. */
  30160. get(index: number): Route
  30161. }
  30162. /**
  30163. * 飞行站点对象类。飞行路线由多个飞行站点构成
  30164. * @param options.duration 当前站点到下一站点所持续的时间
  30165. * @param options.isExcluded 当前站点是否被排除。(暂不支持)
  30166. * @param options.waitTime 在本站点停留的时间
  30167. * @param options.point 本站点的位置
  30168. * @param options.heading 当前站点到下一站点所持续的时间
  30169. * @param options.tilt 当前站点到下一站点所持续的时间
  30170. * @param options.stopName 当前站点到下一站点所持续的时间
  30171. * @param options.distanceToNext 当前站点到下一站点所持续的时间
  30172. * @param options.speed 当前站点到下一站点所持续的时间
  30173. */
  30174. export class RouteStop {
  30175. constructor(options: {
  30176. duration: number,
  30177. isExcluded: boolean,
  30178. waitTime: number,
  30179. point: Cartesian3,
  30180. heading: number,
  30181. tilt: number,
  30182. stopName: string,
  30183. distanceToNext: number,
  30184. speed: number
  30185. })
  30186. /**
  30187. * 获取或设置当前站点到下一站点的飞行持续时间(单位:秒)
  30188. */
  30189. duration: number
  30190. /**
  30191. * 获取或者设置当前站点的相机heading角度(单位:弧度)
  30192. */
  30193. heading: number
  30194. /**
  30195. * 获取当前站点的索引
  30196. */
  30197. index: Number
  30198. /**
  30199. * 获取或者设置当前站点的位置
  30200. */
  30201. point: Cartesian3
  30202. /**
  30203. * 获取或者设置当前站点的promise,用于异步操作站点事件
  30204. * @example
  30205. * flyManager.stopArrived.addEventListener(function(routeStop){
  30206. audioEle.play();
  30207. var defer = Cesium.when.defer();
  30208. //播放音频的异步处理
  30209. routeStop.promise = defer;
  30210. audioEle.onended = function(){
  30211. defer.resolve(true);
  30212. routeStop.promise = undefined;
  30213. };
  30214. });
  30215. */
  30216. promise: object
  30217. /**
  30218. * 获取或设置当前站点的飞行速度(单位:米/秒)
  30219. */
  30220. speed: number
  30221. /**
  30222. * 获取或设置当前的站点名称
  30223. */
  30224. stopName: string
  30225. /**
  30226. * 获取或者设置当前站点动作模式,包括暂停和旋转
  30227. */
  30228. stopPlayMode: string
  30229. /**
  30230. * 获取或者设置当前站点环绕飞行时间
  30231. */
  30232. surroundDuration: number
  30233. /**
  30234. * 获取或者设置当前站点的相机的tilt角度(单位:弧度)
  30235. */
  30236. tilt: number
  30237. /**
  30238. * 获取或者设置当前站点的等待时间(单位:秒)
  30239. */
  30240. waitTime: number
  30241. }
  30242. /**
  30243. * 站点模式,包括普通模式和环绕飞行模式
  30244. */
  30245. export enum StopPlayMode {
  30246. /**
  30247. * 普通模式
  30248. */
  30249. StopPause = 'StopPause',
  30250. /**
  30251. * 站点环绕模式
  30252. */
  30253. StopAround = 'StopAround'
  30254. }
  30255. /**
  30256. * 三维布告板对象类
  30257. */
  30258. export class GeoBillboard {
  30259. /**
  30260. * 获取或设置布告板的高度,单位:像素
  30261. */
  30262. geoHeight: number
  30263. /**
  30264. * 获取或设置布告板图片的存储路径
  30265. */
  30266. geoImagePath: String
  30267. /**
  30268. * 获取或设置布告板的宽度,单位:像素
  30269. */
  30270. geoWidth: number
  30271. }
  30272. /**
  30273. * 三维长方体几何对象类。该类用于在三维图层上绘制长方体几何对象
  30274. * @param length 长方体的长度,单位:米
  30275. * @param width 长方体的宽度,单位:米
  30276. * @param height 长方体的高度,单位:米
  30277. */
  30278. export class GeoBox {
  30279. constructor(length: number, width: number, height: number)
  30280. /**
  30281. * 获取或设置长方体的高度,单位:米
  30282. */
  30283. geoHeight: number
  30284. /**
  30285. * 获取或设置长方体的长度,单位:米
  30286. */
  30287. geoLength: number
  30288. /**n
  30289. * 获取或设置长方体的宽度,单位:米
  30290. */
  30291. geoWidth: number
  30292. /**
  30293. * 获取长方体几何对象的中心点
  30294. */
  30295. getCenter(): number
  30296. /**
  30297. * 获取长方体几何对象是否有效
  30298. */
  30299. isValid(): boolean
  30300. }
  30301. export class GeoCircle3D {
  30302. constructor(radius: number)
  30303. init(radius: number): void
  30304. isValid(): void
  30305. getCenter(): void
  30306. }
  30307. /**
  30308. * 三维椎体几何对象类
  30309. * @param bottomRadius 椎体底部圆的半径,单位:米
  30310. * @param height 椎体的高度,单位:米
  30311. */
  30312. export class GeoCone {
  30313. constructor(bottomRadius: number, height: number)
  30314. /**
  30315. * 获取或设置椎体底部圆的半径,单位:米
  30316. */
  30317. geoBottomRadius: number
  30318. /**
  30319. * 获取或设置椎体的高度,单位:米
  30320. */
  30321. geoHeight: number
  30322. /**
  30323. * 获取或者设置模型的旋转风格。目前主要支持绕顶点旋转和绕模型中心点旋转两种,默认值为绕中心点旋转
  30324. */
  30325. rotateOrigin: RotationOrigin
  30326. /**
  30327. * 克隆三维椎体几何对象
  30328. * @returns 返回新的三维椎体几何对象
  30329. */
  30330. clone(): object
  30331. }
  30332. /**
  30333. * 三维圆柱体几何对象类
  30334. * @param topRadius 圆柱体顶部圆的半径,单位:米
  30335. * @param bottomRadius 圆柱体底部圆的半径,单位:米
  30336. * @param height 圆柱体的高度,单位:米
  30337. */
  30338. export class GeoCylinder {
  30339. constructor(topRadius: number, bottomRadius: number, height: number)
  30340. /**
  30341. * 获取或设置圆柱体底部圆的半径,单位:米
  30342. */
  30343. geoBottomRadius: number
  30344. /**
  30345. * 获取或设置圆柱体的高度,单位:米
  30346. */
  30347. geoHeight: number
  30348. /**
  30349. * 获取或设置圆柱体顶部圆的半径,单位:米
  30350. */
  30351. geoTopRadius: number
  30352. /**
  30353. * 克隆三维圆柱体几何对象
  30354. * @returns 返回新的三维圆柱体几何对象
  30355. */
  30356. clone(): object
  30357. }
  30358. /**
  30359. * 三维椭球体几何对象类
  30360. * @param xAxis 椭球体x轴方向的长度,单位:米
  30361. * @param yAxis 椭球体y轴方向的长度,单位:米
  30362. * @param zAxis 椭球体z轴方向的长度,单位:米
  30363. */
  30364. export class GeoEllipsoid {
  30365. constructor(xAxis: number, yAxis: number, zAxis: number)
  30366. /**
  30367. * 获取或设置椭球体x轴方向的长度,单位:米
  30368. */
  30369. geoXAxis: number
  30370. /**
  30371. * 获取或设置椭球体y轴方向的长度,单位:米
  30372. */
  30373. geoYAxis: number
  30374. /**
  30375. * 获取或设置椭球体z轴方向的长度,单位:米
  30376. */
  30377. geoZAxis: number
  30378. /**
  30379. * 获取椭球体几何对象的中心点
  30380. * @returns 椭球体几何对象的中心点地理坐标值
  30381. */
  30382. getCenter(): number
  30383. /**
  30384. * 获取椭球体几何对象是否有效
  30385. * @returns 如果椭球体几何对象有效则返回 true,否则返回 false
  30386. */
  30387. isValid(): boolean
  30388. }
  30389. /**
  30390. * 三维线对象类。它是由三维点串构成的线对象,这些点可以不在同一平面上。线对象由一个或多个部分组成,每个部分称为线对象的一个子对象。每个子对象由一个 Point3D 数组来表示
  30391. * @param point3DsArray Point3Ds数组
  30392. */
  30393. export class GeoLine3D {
  30394. constructor(point3DsArray: array)
  30395. /**
  30396. * 获取三维线对象的子对象个数
  30397. */
  30398. partCount: number
  30399. /**
  30400. * 向三维线对象中追加一个子对象
  30401. * @param point3Ds 三维线子对象的点串
  30402. * @returns 如果成功,则返回添加的子对象的索引号;如果失败,则返回-1
  30403. */
  30404. addPart(point3Ds: object): number
  30405. /**
  30406. * 获取三维线对象中指定索引号的子对象的三维点对象数组
  30407. * @param index 三维线对象中子对象的索引号(大于等于零
  30408. * @returns 如果成功,则返回 Point3Ds 对象;如果失败,则返回空值
  30409. */
  30410. getPart(index: number): Object
  30411. }
  30412. /**
  30413. * 三维几何对象抽象类。它是三维几何类的基类,提供了基本三维几何类的属性和方法。通过本类可以对三维几何对象的姿态进行控制,包括对象的位置、旋转角度、缩放比例
  30414. * @param option.rotationX 三维几何对象绕 X 轴的旋转角度,采用的坐标系以球心为原点,北方向为 Y 轴的右手坐标系
  30415. * @param option.rotationY 三维几何对象沿 Y 轴方向的旋转角度。采用的坐标系以球心为原点,北方向为 Y 轴的右手坐标系
  30416. * @param option.rotationZ 三维几何对象沿 Z 轴方向的旋转角度。采用的坐标系以球心为原点,北方向为 Y 轴的右手坐标系
  30417. * @param option.scaleX 三维几何对象沿 X 轴方向的缩放比例。采用的坐标系以球心为原点,北方向为 Y 轴的右手坐标系
  30418. * @param option.scaleY 三维几何对象沿 Y 轴方向的缩放比例。采用的坐标系以球心为原点,北方向为 Y 轴的右手坐标系
  30419. * @param option.scaleZ 三维几何对象沿 Z 轴方向的缩放比例。采用的坐标系以球心为原点,北方向为 Y 轴的右手坐标系
  30420. * @param option.position 三维几何对象的位置。该位置的坐标值是三维几何对象外接长方体底面中心点的三维坐标值。这个底面中心点用来控制三维几何对象在地球上放置位置
  30421. * @param option.id 三维几何对象的Id
  30422. * @param option.type 三维几何对象的类型
  30423. */
  30424. export class Geometry3D {
  30425. constructor(option: {
  30426. rotationX: number,
  30427. rotationY: number,
  30428. rotationZ: number,
  30429. scaleX: number,
  30430. scaleY: number,
  30431. scaleZ: number,
  30432. position: object,
  30433. id: number,
  30434. type: number
  30435. })
  30436. /**
  30437. * 获取或设置三维几何对象的Id
  30438. */
  30439. geoId: number
  30440. /**
  30441. * 获取或设置三维几何对象的位置
  30442. */
  30443. geoPosition: Point3D
  30444. /**
  30445. * 获取或设置三维几何对象绕 X 轴的旋转角度,单位:度
  30446. */
  30447. geoRotationX: Number
  30448. /**
  30449. * 获取或设置三维几何对象绕 Y 轴的旋转角度,单位:度
  30450. */
  30451. geoRotationY: Number
  30452. /**
  30453. * 获取或设置三维几何对象绕 Z 轴的旋转角度,单位:度
  30454. */
  30455. geoRotationZ: Number
  30456. /**
  30457. * 获取或设置三维几何对象沿 X 轴方向的缩放比例
  30458. */
  30459. geoScaleX: Number
  30460. /**
  30461. * 获取或设置三维几何对象沿 Y 轴方向的缩放比例
  30462. */
  30463. geoScaleY: Number
  30464. /**
  30465. * 获取或设置三维几何对象沿 Z 轴方向的缩放比例
  30466. */
  30467. geoScaleZ: Number
  30468. /**
  30469. * 获取三维几何对象的类型
  30470. */
  30471. geoType: String
  30472. /**
  30473. * geometry是否需要更新
  30474. */
  30475. isGeometryDirty: Boolean
  30476. /**
  30477. * geometry插入点是否是经纬度
  30478. */
  30479. isLatLon: Boolean
  30480. /**
  30481. * 矩阵
  30482. */
  30483. modelMatrix: Matirx4
  30484. /**
  30485. * 获取三维几何对象的地理范围,即三维几何对象的最小外接矩形,点的最小外接矩形就是点本身
  30486. */
  30487. getBounds()
  30488. }
  30489. /**
  30490. * 三维模型对象类。空间查询时,可以设置GeoModel3D为查询对象
  30491. */
  30492. export class GeoModel3D {
  30493. /**
  30494. * 获取或设置三维模型文件的存储路径
  30495. */
  30496. geoFilePath: string
  30497. /**
  30498. * 获取或者设置S3M模型文件数据,用来对接服务端下载的S3M流
  30499. */
  30500. geoModel: object
  30501. }
  30502. /**
  30503. * 三维地理点几何对象类。该类用于表示点状地理要素 Feature3D 的空间信息,当赋予点状地理要素 Feature3D 一定风格时,即可将点状地理要素显示在三维场景中,它的空间位置就由 GeoPoint3D 决定。它与 Point3D 的区别是:Point3D 只能描述一个位置点
  30504. * @param x 三维地理点几何对象的 X 坐标值,即经度坐标,单位:度
  30505. * @param y 三维地理点几何对象的 Y 坐标值,即纬度坐标,单位:度
  30506. * @param z 三维地理点几何对象的 Z 坐标值,即高度,单位:米
  30507. */
  30508. export class GeoPoint3D {
  30509. constructor(option: {
  30510. x: number,
  30511. y: number,
  30512. z: number
  30513. })
  30514. /**
  30515. * 获取或设置三维地理点几何对象的 X 坐标值,即经度坐标,单位:度
  30516. */
  30517. X: number
  30518. /**
  30519. * 获取或设置三维地理点几何对象的 Y 坐标值,即纬度坐标,单位:度
  30520. */
  30521. Y: number
  30522. /**
  30523. * 获取或设置三维地理点几何对象的 Z 坐标值,即高度,单位:米
  30524. */
  30525. Z: number
  30526. }
  30527. /**
  30528. * 垂线类,根据两个经纬度的点绘制模型
  30529. */
  30530. export class GeoPolyline {
  30531. }
  30532. /**
  30533. * 三维面对象类。三维面几何对象由一个或多个部分组成,每个部分称为三维面几何对象的一个子对象,每个子对象用一个有序三维坐标点集合 Point3Ds 来表示,其起始点和终止点重合
  30534. * @param point3DsArray Point3Ds数组。
  30535. */
  30536. export class GeoRegion3D {
  30537. constructor(point3DsArray: array)
  30538. /**
  30539. * 底部高程
  30540. */
  30541. bottomAltitude: number
  30542. /**
  30543. * 拉伸后的封底
  30544. */
  30545. closeBottom: Boolean
  30546. /**
  30547. * 拉伸后的封顶
  30548. */
  30549. closeTop: Boolean
  30550. /**
  30551. * 拉伸高度
  30552. */
  30553. extrudedHeight: number
  30554. /**
  30555. * 获取三维面几何对象的子对象个数
  30556. */
  30557. partCount: number
  30558. /**
  30559. * 向三维面对象中追加一个子对象
  30560. * @param point3Ds 向三维面对象中追加一个子对象
  30561. */
  30562. addPart(point3Ds: object): number
  30563. /**
  30564. * 获取三维面对象中指定索引号的子对象的三维点对象数组
  30565. * @param index 三维面对象中子对象的索引号(大于等于零
  30566. */
  30567. getPart(index: number): object
  30568. }
  30569. /**
  30570. * 三维球体几何对象类
  30571. * @param radius 三维球体的半径,单位:米
  30572. */
  30573. export class GeoSphere {
  30574. constructor(radius: number)
  30575. /**
  30576. * 获取或设置三维球体的半径,单位:米
  30577. */
  30578. geoRadius: number
  30579. /**
  30580. * 获取球体几何对象的中心点
  30581. */
  30582. getCenter(): number
  30583. /**
  30584. * 获取球体几何对象是否有效
  30585. */
  30586. isValid(): Boolean
  30587. }
  30588. /**
  30589. * 三维点对象类。该对象用于表示地理坐标系下坐标值精度为 Double 的三维点对象,即其坐标值大致范围为 ±5.0×1E−324 到 ±1.7×1E308,有效位为15-16位,单位为经纬度。三维点对象是三维几何对象的基础
  30590. * @param x 三维点对象的经度坐标值,单位:度
  30591. * @param y 三维点对象的纬度坐标值,单位:度
  30592. * @param z 三维点对象的高度坐标值,单位:米
  30593. */
  30594. export class Point3D {
  30595. constructor(x: number, y: number, z: number)
  30596. }
  30597. /**
  30598. * 向三维点集合对象中追加三维点对象
  30599. *
  30600. */
  30601. export class Point3Ds {
  30602. /**
  30603. * 向三维点集合对象中追加三维点对象
  30604. * @param point3D 向三维点集合对象中追加三维点对象
  30605. */
  30606. add(point3D: object): Number
  30607. /**
  30608. * 清除三维点集合对象中的所有元素
  30609. */
  30610. removeAll(): void
  30611. }
  30612. /**
  30613. * Box编辑器类,用于对box进行编辑,可以对该编辑器进行激活、失效以及销毁等操作
  30614. * @param viewer 当前的viewer
  30615. * @param box 拟编辑的box对象,对该对象设置编辑器
  30616. */
  30617. export class BoxEditor {
  30618. constructor(viewer: Viewer, box: Entity)
  30619. /**
  30620. * 获取或者设置盒子的颜色
  30621. */
  30622. color: Color
  30623. /**
  30624. * 激活box编辑器
  30625. */
  30626. activate()
  30627. /**
  30628. * 使box编辑器失效
  30629. */
  30630. deactivate()
  30631. /**
  30632. * 销毁box编辑器
  30633. */
  30634. destroy()
  30635. /**
  30636. * 为编辑器设置编辑对象
  30637. * @param editObject 拟编辑的box对象
  30638. */
  30639. setEditObject(editObject): void
  30640. }
  30641. /**
  30642. * 绘制、量算的几何对象的风格
  30643. */
  30644. export enum ClampMode {
  30645. /**
  30646. * 贴地模式
  30647. */
  30648. Ground,
  30649. /**
  30650. * 栅格化模式
  30651. */
  30652. Raster,
  30653. /**
  30654. * 贴对象模式
  30655. */
  30656. S3mModel,
  30657. /**
  30658. * 空间模式
  30659. */
  30660. Space
  30661. }
  30662. /**
  30663. * 绘制处理器对象类。支持栅格化面对象的绘制
  30664. * @param viewer viewer对象
  30665. * @param mode 绘制模式,包含点、线、面、图标
  30666. * @param clampMode clampMode 绘制风格,包含空间、贴地、贴对象(S3M模型)
  30667. * @example
  30668. * var handler = new Cesium.DrawHandler(viewer,Cesium.DrawMode.Line,ClampMode.Ground);
  30669. * handler.activate();
  30670. */
  30671. export class DrawHandler {
  30672. constructor(viewer: Viewer, mode: DrawMode, clampMode: ClampMode)
  30673. /**
  30674. * 绘制handler的激活事件
  30675. * @example
  30676. * handler.activeEvt.addEventListener(function(result){});
  30677. */
  30678. activeEvt: Event
  30679. /**
  30680. * 获取或者设置绘制几何对象的风格,空间、贴地、贴对象
  30681. */
  30682. clampMode: number
  30683. /**
  30684. * 绘制完成事件,监听绘制完成的事件,获取当前绘制结果。
  30685. 当绘制模式为DrawMode.Point,事件回调的结果是{object : point}。
  30686. 当绘制模式为DrawMode.Polygon,事件回调的结果是{object : polygon}。
  30687. 当绘制模式为DrawMode.Line,事件回调的结果是{object : polyline}。
  30688. 当绘制模式为DrawMode.Marker,事件回调的结果是{object : marker}。
  30689. @example
  30690. handler.drawEvt.addEventListener(function(result){
  30691. console.log(result);
  30692. });
  30693. */
  30694. drawEvt: Event
  30695. /**
  30696. * 设置绘制的图元是否开启深度检测,默认开启
  30697. */
  30698. enableDepthTest: Boolean
  30699. /**
  30700. * 绘制handler的移动事件
  30701. * @example
  30702. * handler.movingEvt.addEventListener(function(result){});
  30703. */
  30704. movingEvt: Event
  30705. /**
  30706. * 激活handler
  30707. */
  30708. activate()
  30709. /**
  30710. * 清除所有图元
  30711. */
  30712. clear()
  30713. /**
  30714. * 使handler无效
  30715. */
  30716. deactivate()
  30717. }
  30718. /**
  30719. * 绘制模式类
  30720. */
  30721. export enum DrawMode {
  30722. /**
  30723. * 绘制盒子
  30724. */
  30725. Box,
  30726. /**
  30727. * 绘制线
  30728. */
  30729. Line,
  30730. /**
  30731. * 绘制图标
  30732. */
  30733. Marker,
  30734. /**
  30735. * 绘制点
  30736. */
  30737. Point,
  30738. /**
  30739. * 绘制面
  30740. */
  30741. Polygon
  30742. }
  30743. /**
  30744. * 编辑对象
  30745. * @param viewer viewer对象
  30746. * @param editObject 被编辑对象
  30747. * @example
  30748. * var handler = new Cesium.EditHandler(viewer,editObject);
  30749. * handler.activate();
  30750. */
  30751. export class EditHandler {
  30752. constructor(viewer: Viewer, editObject: Entity)
  30753. /**
  30754. * 用于监听编辑线面后的变化
  30755. */
  30756. changedEvt: Event
  30757. /**
  30758. * 获取或者设置线面支持编辑高度
  30759. */
  30760. isEditZ: Boolean
  30761. }
  30762. /**
  30763. * 量测处理器类
  30764. * @param viewer 指定用于量测的视图
  30765. * @param mode 指定量测模式
  30766. * @param clampMode 指定几何对象的风格(贴地,贴对象)
  30767. * @example
  30768. * var handler = new MeasureHandler(viewer,Cesium.MeasureMode.Distance);
  30769. * handler.activate();
  30770. * handler.measureEvt.addEventListener(function(obj){
  30771. * console.log(obj);
  30772. * });
  30773. */
  30774. export class MeasureHandler {
  30775. constructor(viewer: Viewer, mode: MeasureMode, clampMode: ClampMode)
  30776. /**
  30777. * 激活事件,监听当前事件以获取处理器的状态
  30778. */
  30779. activeEvt: Event
  30780. /**
  30781. * 当量测模式为Area,利用此标签实体对象 areaLabel 来显示面积量算结果
  30782. */
  30783. areaLabel: Entity
  30784. /**
  30785. * 获取或设置量算时点云捕捉点的颜色
  30786. */
  30787. capturePointColor: Color
  30788. /**
  30789. * 获取或设置量算时点云捕捉点的大小
  30790. */
  30791. capturePointSize: number
  30792. /**
  30793. * 贴对象模式
  30794. */
  30795. clampMode: ClampMode
  30796. /**
  30797. * 当量测模式为Distance,利用此标签实体对象disLabel来显示空间距离量算结果
  30798. */
  30799. disLabel: Entity
  30800. /**
  30801. * 设置绘制对象是否开启深度检测,默认开启
  30802. */
  30803. enableDepthTest: boolean
  30804. /**
  30805. * 获取或设置量算时指定几何对象的线颜色
  30806. */
  30807. fillColor: position
  30808. /**
  30809. * 获取或设置量算时线的类型
  30810. */
  30811. lineDisplayType: LineDisplayType
  30812. /**
  30813. * 获取或设置量算时指定几何对象的线宽
  30814. */
  30815. lineWidth: position
  30816. /**
  30817. * 量测事件,监听当前事件以获取测量结果。 当量测模式为MeasureMode.Distance时,回调结果为{distance : distance}。 当量测模式为MeasureMode.Area时,回调结果为{area : area,positions : positions}。 当量测模式为MeasureMode.DVH时,回调结果为{distance : distance,verticalHeight : vHeight,horizontalDistance : hHeight}
  30818. * @example
  30819. * var handler = new Cesium.MeasureHandler(viewer,Cesium.MeasureMode.Area);
  30820. * handler.measureEvt.addEventListener(function(result){
  30821. * var area = result.area > 1000000 ? result.area/1000000 + 'km²' : result.area + '㎡'
  30822. * handler.areaLabel.text = 'area:' + area;
  30823. * });
  30824. */
  30825. measureEvt: Event
  30826. /**
  30827. * 当量测模式为DVH或Height,利用此标签实体对象 vLabel 来显示垂直高度量算结果
  30828. */
  30829. vLabel: Entity
  30830. /**
  30831. * 根据一系列笛卡尔坐标点计算面积,单位m2(平方米)
  30832. * @param positions 面上各个点的坐标
  30833. */
  30834. computeArea(positions: any): void
  30835. /**
  30836. * 激活量测处理器
  30837. */
  30838. activate(): void
  30839. /**
  30840. * 清除所有关于量测的要素
  30841. */
  30842. clear(): void
  30843. /**
  30844. * 关闭量测处理器
  30845. */
  30846. deactivate()
  30847. }
  30848. /**
  30849. * 量算模式类
  30850. */
  30851. export enum MeasureMode {
  30852. /**
  30853. * 面积量算模式
  30854. */
  30855. Area,
  30856. /**
  30857. * 距离量算模式
  30858. */
  30859. Distance,
  30860. /**
  30861. * 空间距离、水平距离、垂直距离三分量量算模式(测高)
  30862. */
  30863. DVH
  30864. }
  30865. /**
  30866. * 光源类
  30867. */
  30868. export class LightSource {
  30869. /**
  30870. * 获取或设置环境光颜色
  30871. *
  30872. */
  30873. ambientLightColor: Color
  30874. /**
  30875. * 获取平行光源
  30876. */
  30877. directionalLight: DirectionalLight
  30878. /**
  30879. * 获取点光源
  30880. */
  30881. pointLight: PointLight
  30882. /**
  30883. * 获取聚光灯
  30884. */
  30885. spotLight: SpotLight
  30886. /**
  30887. * 获取或设置光照
  30888. */
  30889. sunLightON: Number
  30890. /**
  30891. * 设置灯光最大可见距离
  30892. */
  30893. visibleDistanceMax: Number
  30894. }
  30895. /**
  30896. * 光源类型
  30897. */
  30898. export enum LightSourceType {
  30899. /**
  30900. * 平行光
  30901. */
  30902. DIRECTIONAL,
  30903. /**
  30904. * 点光源
  30905. */
  30906. POINT,
  30907. /**
  30908. * 聚光灯
  30909. */
  30910. SPOT
  30911. }
  30912. /**
  30913. * 点光源
  30914. * @param position 点光源位置
  30915. * @param options.color 光源颜色,默认白色
  30916. * @param options.cutoffDistance 点光源的扩散距离,默认10米
  30917. * @param options.decay 点光源衰减因子,越小随着距离衰减越小,越亮
  30918. * @param options.intensity 点光源强度
  30919. */
  30920. export class PointLight {
  30921. constructor(position: Cartesian3, options: {
  30922. color: Color,
  30923. cutoffDistance: Number,
  30924. decay: Number,
  30925. intensity: Number
  30926. })
  30927. /**
  30928. * 获取或设置光源颜色,默认白色
  30929. */
  30930. color: Color
  30931. /**
  30932. * 获取或设置点光源的扩散距离,默认10米
  30933. */
  30934. cutoffDistance: Number
  30935. /**
  30936. * 获取或设置点点光源衰减因子,越小随着距离衰减越小,越亮
  30937. */
  30938. decay: Number
  30939. /**
  30940. * 获取点光源id
  30941. */
  30942. id: Number
  30943. /**
  30944. * 获取或设置点光源强度
  30945. */
  30946. intensity: Number
  30947. /**
  30948. * 获取点光源颜色
  30949. */
  30950. lightColor: Color
  30951. /**
  30952. * 获取或设置点光源位置,使用世界坐标系
  30953. */
  30954. position: Cartesian3
  30955. }
  30956. /**
  30957. * 聚光灯
  30958. * @param position 光源位置
  30959. * @param targetPosition 目标点位置,决定聚光方向
  30960. * @param options.color 光源颜色
  30961. * @param options.intesity 光强度
  30962. * @param options.distance 光能到达的距离,默认100米
  30963. * @param options.decay 光源衰减因子,越小,随着距离衰减越小,也就越亮
  30964. */
  30965. export class SpotLight {
  30966. constructor(position: Cartesian3, targetPosition: Cartesian3, options: {
  30967. color: Color,
  30968. intesity: Number,
  30969. distance: Number,
  30970. decay: Number,
  30971. })
  30972. /**
  30973. * 获取或设置聚光范围,默认Math.PI / 6,单位弧度
  30974. */
  30975. angle: Number
  30976. /**
  30977. * 获取或设置光源颜色,默认白色
  30978. */
  30979. color: Color
  30980. /**
  30981. * 获取或设置聚光灯光源衰减因子,越小,随着距离衰减越小,也就越亮
  30982. */
  30983. decay: Number
  30984. /**
  30985. * 获取聚光灯的方向
  30986. */
  30987. direction: Cartesian3
  30988. /**
  30989. * 获取或设置聚光灯光能到达的距离,默认100米
  30990. */
  30991. distance: Number
  30992. /**
  30993. * 获取聚光灯id
  30994. */
  30995. id: Number
  30996. /**
  30997. * 获取或设置聚光灯的光强度
  30998. */
  30999. intensity: Number
  31000. /**
  31001. * 获取聚光灯的颜色
  31002. */
  31003. lightColor: Color
  31004. /**
  31005. * 获取或设置点光源位置,使用世界坐标系
  31006. */
  31007. position: Cartesian3
  31008. /**
  31009. * 获取或设置聚光灯目标点位置,决定聚光方向
  31010. */
  31011. targetPosition: Cartesian3
  31012. }
  31013. /**
  31014. * @param options.url 影像服务地址
  31015. * @param options.name 影像图层名称
  31016. * @param options.minimumLevel 最小层级
  31017. * @param options.maximumLevel 最大层级
  31018. * @param options.transparent 设置请求的地图服务的参数是否为
  31019. * @param options.credit 影像服务描述信息
  31020. * @param options.tileFormat 影像图片格式,默认为png
  31021. * @param options.cacheKey 影像的三维缓存密钥
  31022. * @example
  31023. * //创建provider。
  31024. * var provider = new Cesium.SuperMapImageryProvider({url : URL_CONFIG.ZF_IMG});
  31025. * //创建影像图层。
  31026. * var layer = viewer.imageryLayers.addImageryProvider(provider);
  31027. */
  31028. export class SuperMapImageryProvider {
  31029. constructor(options: {
  31030. url: String,
  31031. name: String,
  31032. minimumLevel: number,
  31033. maximumLevel: number,
  31034. transparent: boolean,
  31035. credit: string,
  31036. tileFormat: string,
  31037. cacheKey: string
  31038. })
  31039. /**
  31040. * 获取该影像服务的描述信息对象
  31041. */
  31042. credit: Credit
  31043. /**
  31044. * 获取最大层级(LOD调度时可以请求的最大层级)
  31045. */
  31046. maximumLevel: Number
  31047. /**
  31048. * 获取最小层级(LOD调度时可以请求的最小层级)
  31049. */
  31050. minimumLevel: Number
  31051. /**
  31052. * 获取该影像服务是否就绪
  31053. */
  31054. ready: Boolean
  31055. /**
  31056. * 获取该服务的请求状态的promise
  31057. */
  31058. readyPromise: Promise
  31059. /**
  31060. * 获取该影像服务的矩形范围
  31061. */
  31062. rectangle: Rectangle
  31063. /**
  31064. * 获取或者设置子域名称。通过该接口可以向指定的子域请求数据
  31065. */
  31066. subdomains: String
  31067. /**
  31068. * 获取丢弃影像切片颜色比例
  31069. */
  31070. tileDiscardPolicy: DiscardColorTileImagePolicy
  31071. /**
  31072. * 获取请求切片格式
  31073. */
  31074. tileFormat: Format
  31075. /**
  31076. * 获取切片高度
  31077. */
  31078. tileHeight: Number
  31079. /**
  31080. * 获取切片宽度
  31081. */
  31082. tileWidth: Number
  31083. /**
  31084. * 获取投影方式(支持经纬度投影和墨卡托投影)
  31085. */
  31086. tilingScheme: TilingScheme
  31087. /**
  31088. * 获取影像服务的url
  31089. */
  31090. url: String
  31091. /**
  31092. * 设置地图子图层的过滤条件
  31093. * @param v 过滤条件的数组
  31094. */
  31095. setLayerStatusParameters(v: array): void
  31096. }
  31097. /**
  31098. * 天地图影像服务提供者类
  31099. * @param options.mapStyle 指定天地图服务类型
  31100. * @example
  31101. * var labelImagery = new Cesium.TiandituImageryProvider({
  31102. * mapStyle : Cesium.TiandituMapsStyle.CIA_C//天地图全球中文注记服务(经纬度投影)
  31103. * });
  31104. */
  31105. export class TiandituImageryProvider {
  31106. constructor(options: {
  31107. mapStyle: TiandituMapsStyle
  31108. })
  31109. /**
  31110. * 获取服务的描述信息
  31111. */
  31112. credit: String
  31113. /**
  31114. * 错误事件
  31115. */
  31116. errorEvent: String
  31117. /**
  31118. * 获取服务类型
  31119. */
  31120. mapStyle: String
  31121. /**
  31122. * 获取可以请求的最大细节层次(LOD)
  31123. */
  31124. maximumLevel: Number
  31125. /**
  31126. * 获取可以请求的最小细节层次(LOD)
  31127. */
  31128. minimumLevel: Number
  31129. /**
  31130. * 获取瓦片高度
  31131. */
  31132. tileHeight: Number
  31133. /**
  31134. * 获取服务的url
  31135. */
  31136. url: String
  31137. }
  31138. /**
  31139. * 天地图服务类型常量
  31140. */
  31141. export enum TiandituMapsStyle {
  31142. /**
  31143. * 天地图全球中文注记服务(经纬度投影)
  31144. */
  31145. CIA_C,
  31146. /**
  31147. * 天地图全球中文注记服务(墨卡托投影)
  31148. */
  31149. CIA_W
  31150. }
  31151. /**
  31152. * 天地图三维地形服务类。通过该类,可以添加由天地图服务器发布的三维地形服务
  31153. * @param options.token 天地图地形服务的密钥
  31154. * @param options.minimumLevel 最小数据层级
  31155. * @param options.maximumLevel 最大数据层级
  31156. */
  31157. export class TiandituTerrainProvider {
  31158. constructor(options: {
  31159. token: string,
  31160. minimumLevel: number,
  31161. maximumLevel: number
  31162. })
  31163. }
  31164. /**
  31165. * 缓存管理
  31166. */
  31167. export class BufferManager {
  31168. /**
  31169. * VBO(顶点缓存对象)占用的最大缓存,单位MB
  31170. */
  31171. maxVBOSize
  31172. }
  31173. /**
  31174. * DDS纹理对象
  31175. * @param gl
  31176. * @param width
  31177. * @param height
  31178. * @param imageBuffer
  31179. */
  31180. export class DDSTexture {
  31181. constructor(gl: WebGLRenderingContext, width: number, height: number, imageBuffer: Array)
  31182. /**
  31183. * 释放资源
  31184. */
  31185. destroy(): void
  31186. /**
  31187. * 激活纹理单元
  31188. */
  31189. enable(): void
  31190. /**
  31191. * 初始化DDS纹理
  31192. */
  31193. initTexture(): void
  31194. /**
  31195. * 更新纹理
  31196. */
  31197. updateTexture(): void
  31198. }
  31199. /**
  31200. * DDS纹理管理
  31201. */
  31202. export class DDSTextureManager {
  31203. /**
  31204. * 保留的纹理显存大小,单位MB
  31205. */
  31206. reservedMemorySize: number
  31207. /**
  31208. * 初始化DDS纹理
  31209. */
  31210. CreateTexture(): void
  31211. }
  31212. /**
  31213. * 动态图层,一个动态图层可以包含多种类型的模型,每种模型又能包含多个实例,每个实例以一定刷新间隔更新状态信息DynamicObjectState,从而达到动态效果
  31214. * @param context webgl context对象
  31215. * @param urls 模型url数组
  31216. * @example
  31217. * var uls = ['model1.s3m','model2.s3m'];
  31218. * var layer = new DynamicLayer3D(context,urls);
  31219. * scene.primitives.add(layer);
  31220. */
  31221. export class DynamicLayer3D {
  31222. constructor(context: Context, urls: array)
  31223. /**
  31224. * 设置是否支持模型局部偏移(模型自带偏移矩阵
  31225. */
  31226. enableLocalOffset: boolean
  31227. /**
  31228. * 获取或设置子对象过滤模式,默认为距离模式
  31229. */
  31230. filterMode: Mode
  31231. /**
  31232. * 获取或设置子对象过滤像素,默认为0
  31233. */
  31234. filterPixel: Number
  31235. /**
  31236. * 获取动态图层的所有模型分组集合{url:object}
  31237. */
  31238. group: Object
  31239. /**
  31240. * 获取或者设置动态图层的最大可见高度
  31241. */
  31242. maxVisibleAltitude: Number
  31243. /**
  31244. * 获取或设置对象过滤的最大可见距离
  31245. */
  31246. maxVisibleDistance: Number
  31247. /**
  31248. * 获取或者设置阴影模式。默认值为NONE
  31249. */
  31250. shadowType: ShadowType
  31251. /**
  31252. * 获取该图层类型标识
  31253. */
  31254. type: String
  31255. /**
  31256. * 获取或者设置动态图层的刷新间隔时间,单位ms
  31257. */
  31258. updateInterval: Number
  31259. /**
  31260. * 获取或者设置动态图层的可见性
  31261. */
  31262. visible: Boolean
  31263. /**
  31264. * 清除该动态图层所有动态实例对象的状态信息,在下次更新状态之前,所有动态实例都不被渲染
  31265. * @example
  31266. * layer.clearAllState();
  31267. */
  31268. clearAllState(): void
  31269. /**
  31270. * 根据模型url和动态实例ID,清除该类型模型指定ID的动态实例的状态信息,下次更新状态之前,该实例不被渲染
  31271. * @param url 模型url
  31272. * @param ids 动态实例ids
  31273. * @example
  31274. * layer.clearState('ship.s3m',[1]);
  31275. */
  31276. clearState(url: string, ids: array)
  31277. /**
  31278. * 删除该动态图层所有动态实例对象,在下次更新状态之前,所有动态实例都不被渲染
  31279. * @example
  31280. * layer.deleteAllObjects();
  31281. */
  31282. deleteAllObjects(): void
  31283. /**
  31284. * 根据模型url和动态实例ID,删除指定类型的对应ids的实例对象,下次再次更新相同id的状态,将不会在渲染对应id的对象
  31285. * @param url 模型url
  31286. * @param ids 动态实例ids
  31287. * @example
  31288. * layer.deleteObjects('ship.s3m',[1]);
  31289. */
  31290. deleteObjects(url: string, ids: Array): void
  31291. /**
  31292. * 释放webgl资源。一旦释放对象资源, 它将不能被使用;调用任何方法将会抛出DeveloperError异常
  31293. * @example
  31294. * layer = layer && layer.destroy();
  31295. */
  31296. destroy(): void
  31297. /**
  31298. * 获取是否开启单双面渲染
  31299. * @param url 模型url
  31300. */
  31301. getCullEnabled(url: string) : boolean
  31302. /**
  31303. * 设置是否开启单双面渲染
  31304. * @param url 模型url
  31305. * @param enabled 是否开启单双面渲染
  31306. */
  31307. setCullEnabled(url: string, enabled: boolean)
  31308. /**
  31309. * 根据动态图层的url设置url对应的模型实例是否可选
  31310. * @param url 动态图层的url
  31311. * @param enable 其值为true时可选,为false时不可选
  31312. */
  31313. setPickEnable(url: string, enable: boolean)
  31314. /**
  31315. * 取消所有实例的选中状态
  31316. */
  31317. setUnSelected()
  31318. /**
  31319. * 根据url设置该图层下指定模型类型的所有实例的可见性
  31320. * @param modelUrl 模型url(指定模型类型)
  31321. * @param isVisible 是否可见
  31322. * @example
  31323. * //设置model.s3m类型的所有实例不可见。
  31324. * layer.setVisibleByUrl('model.s3m',false);
  31325. */
  31326. setVisibleByUrl(modelUrl: string, isVisible: boolean)
  31327. /**
  31328. * 根据指定模型类型(url)更新对象状态信息
  31329. * @param url 模型类型url
  31330. * @param arrStates 状态信息(DynamicObjectState)数组
  31331. * @example
  31332. * //更新model.s3m类型实例的状态信息
  31333. * var states = [];
  31334. * states.push(new DynamicObjectState({id : 1,longitude : 100,latitude : 10}));
  31335. * states.push(new DynamicObjectState({id : 2,longitude : 101,latitude : 11}));
  31336. * layer.updateObjectWithModel('model.s3m',states);
  31337. */
  31338. updateObjectWithModel(url: string, arrStates: Array)
  31339. }
  31340. /**
  31341. * 动态实例对象状态信息,用于更新动态图层中的指定id模型实例的状态
  31342. * @param options.longitude 经度
  31343. * @param options.latitude 纬度
  31344. * @param options.altitude 高度
  31345. * @param options.scale 缩放系数
  31346. * @param options.color 颜色
  31347. * @param options.heading 绕Z轴旋转的角度(弧度)
  31348. * @param options.pitch 绕X轴旋转的角度(弧度)
  31349. * @param options.roll 绕Y轴旋转的角度(弧度)
  31350. * @param options.offset 模型中心点的偏移位置
  31351. * @param options.id 对象id
  31352. * @param options.description 描述信息
  31353. */
  31354. export class DynamicObjectState {
  31355. constructor(options: {
  31356. longitude: number,
  31357. latitude: number,
  31358. altitude: number,
  31359. scale: Cartesian3,
  31360. color: Color,
  31361. heading: number,
  31362. pitch: number,
  31363. roll: number,
  31364. offset: Cartesian3,
  31365. id: number | string,
  31366. description: object | string
  31367. })
  31368. /**
  31369. * 获取或者设置高度
  31370. */
  31371. altitude : Number
  31372. /**
  31373. * 获取或者设置颜色
  31374. */
  31375. color : Color
  31376. /**
  31377. * 获取或者设置描述信息
  31378. */
  31379. description : Object|String
  31380. /**
  31381. * 获取或者设置方位角(绕Z轴旋转)
  31382. */
  31383. heading : Number
  31384. /**
  31385. * 获取或者设置ID
  31386. */
  31387. id : Number | String
  31388. /**
  31389. * 获取或者设置纬度
  31390. */
  31391. latitude : Number
  31392. /**
  31393. * 获取或者设置经度
  31394. */
  31395. longitude : Number
  31396. /**
  31397. * 获取或者设置模型中心点偏移位置
  31398. */
  31399. offset : Cartesian3
  31400. /**
  31401. * 获取或者设置绕X轴旋转角度
  31402. */
  31403. pitch : Number
  31404. /**
  31405. * 获取或者设置绕Y轴旋转角度
  31406. */
  31407. roll : Number
  31408. /**
  31409. * 获取或者设置缩放系数
  31410. */
  31411. scale : Cartesian3
  31412. /**
  31413. * 获取或者设置模型的方位角(指北方向线起依顺时针方向至目标方向线的水平夹角),单位:弧度
  31414. */
  31415. startDirection : Number
  31416. /**
  31417. * 获取或者设置时间戳
  31418. */
  31419. timeStamp : Number
  31420. /**
  31421. * 克隆对象
  31422. * @param state 克隆的源对象
  31423. * @example
  31424. * var state = DynamicObjectState.clone(oldState);
  31425. */
  31426. clone(state) : DynamicObjectState
  31427. }
  31428. /**
  31429. * 图层集合类。该类用于对场景中的所有图层进行管理
  31430. */
  31431. export class Layers {
  31432. /**
  31433. * 获取图层列表
  31434. */
  31435. layerQueue : Array
  31436. /**
  31437. * 向图层集合添加一个图层
  31438. */
  31439. add(layer): void
  31440. /**
  31441. *
  31442. * @param name
  31443. */
  31444. find(name) : Layer
  31445. /**
  31446. * 根据指定索引查找图层对象
  31447. * @param index 指定的图层索引
  31448. */
  31449. findByIndex(index) : Layer
  31450. /**
  31451. * 获取当前点击选中的S3M图层
  31452. */
  31453. getSelectedLayer() : S3MTilesLayer
  31454. /**
  31455. * 向下调整图层顺序,和影像图层集合相对应
  31456. * @param layer
  31457. */
  31458. lower(layer): void
  31459. /**
  31460. *
  31461. * @param winpos 位置信息
  31462. * @param scene 场景对象
  31463. */
  31464. pickFeatures(winpos: number, scene: object)
  31465. /**
  31466. * 向上调整图层顺序,和影像图层集合相对应
  31467. * @param layer 待调整的图层
  31468. */
  31469. raise(layer): void
  31470. /**
  31471. * 释放被选择的图层对象
  31472. */
  31473. releaseSelection(): void
  31474. /**
  31475. * 从图层集合中删除指定名称的图层对象
  31476. * @param layer 待删除的图层名称
  31477. * @param destroy 指定删除时是否释放资源。
  31478. */
  31479. remove(layer, destroy) : Boolean
  31480. /**
  31481. * 删除图层集合中的所有图层对象
  31482. * @param destroy 指定删除时是否释放资源
  31483. */
  31484. removeAll(destroy): void
  31485. /**
  31486. * 设置当前点击选中的S3M图层
  31487. * @param layer 当前点击选中的S3M图层
  31488. */
  31489. setSelectedLayer(layer: S3MTilesLayer)
  31490. }
  31491. /**
  31492. * 点云分类信息
  31493. * @param id 点云索引
  31494. * @param type 点云类型
  31495. * @param pointCounts 点云点数
  31496. */
  31497. export class PointCloudClassificationInfo {
  31498. constructor(id: number, type: number, pointCounts: number)
  31499. /**
  31500. * 获取或者设置点云索引
  31501. */
  31502. id : Number
  31503. /**
  31504. * 获取或者设置点云点数
  31505. */
  31506. pointCounts : Number
  31507. /**
  31508. * 获取或者设置点云类型
  31509. */
  31510. type : Number
  31511. }
  31512. /**
  31513. * S3M实例化模型集合类
  31514. * @param context 对象
  31515. */
  31516. export class S3MInstanceCollection {
  31517. constructor(context: Context)
  31518. /**
  31519. * addModels函数添加的模型加载完成后触发的事件
  31520. */
  31521. addedEvent()
  31522. /**
  31523. * 获取或者设置该图层是否贴对象,默认值为false。
  31524. */
  31525. clampToObject : Boolean
  31526. /**
  31527. * 获取或者设置子对象过滤模式
  31528. */
  31529. filterMode : RangeMode
  31530. /**
  31531. * 获取或者设置过滤像素大小,子对象投影屏幕的像素大小过滤阀值
  31532. */
  31533. filterPixel : Number
  31534. /**
  31535. * 获取该图层所有的模型组
  31536. */
  31537. group : Object
  31538. /**
  31539. * 获取或者设置模型始终显示在屏幕最前面,支持选中。默认值为false
  31540. */
  31541. isOverLay : Boolean
  31542. /**
  31543. * 获取或者设置图层的最大可见高度
  31544. */
  31545. maxVisibleAltitude : number
  31546. /**
  31547. * 获取或者设置该图层的最小可见高度
  31548. */
  31549. minVisibleAltitude : Number
  31550. /**
  31551. * 获取或者设置该图层的最小可见距离
  31552. */
  31553. minVisibleDistance : Number
  31554. /**
  31555. * 设置纹理显示模式(混合、替换)
  31556. */
  31557. mixColorType : Number
  31558. /**
  31559. * 获取或者设置该图层的模型矩阵,设置平移、旋转、缩放参数
  31560. */
  31561. modelMatrix : any
  31562. /**
  31563. * 获取或者设置阴影模式。默认值为NONE
  31564. */
  31565. shadowType : ShadowType
  31566. /**
  31567. * 获取该图层类型标识
  31568. */
  31569. type : String
  31570. /**
  31571. * 获取或者设置该图层的可见性
  31572. */
  31573. visible : Boolean
  31574. /**
  31575. * 添加一个或者一组实例
  31576. * @param url 模型url
  31577. * @param attrs 实例属性或者实例属性集合
  31578. * @param data 流数据
  31579. * @param streamBytes 是否截取前四个字节
  31580. */
  31581. add(url, attrs, data, streamBytes) : void
  31582. /**
  31583. * 通过ID获取实例对象S3MInstance
  31584. * @param url 实例对象的url
  31585. * @param id 实例对象的id
  31586. */
  31587. getInstance(url: string, id: number)
  31588. /**
  31589. * 获取指定分屏窗口所在的对象
  31590. * @param index 视口索引值,其范围为0~3
  31591. */
  31592. getVisibleInViewport(index: number) : boolean
  31593. /**
  31594. * 移除url对应的所有实例对象
  31595. * @param url 模型的url
  31596. */
  31597. removeCollection(url) : boolean
  31598. /**
  31599. * 移除url模型指定id对应的实例对象
  31600. * @param url 模型的url
  31601. * @param ids 实例对象id列表
  31602. */
  31603. removeInstance(url, ids) : boolean
  31604. /**
  31605. * 用于移除指定实例化模型的PBR材质
  31606. * @param instancePath 为实例化模型的地址
  31607. */
  31608. removePBRMaterial(instancePath): void
  31609. /**
  31610. * 设置单面渲染
  31611. * @param url 模型的url
  31612. * @param cullFace 是否开启单面渲染
  31613. */
  31614. setCullEnabled(url: string, cullFace: boolean)
  31615. /**
  31616. * 实例化集合支持设置PBR材质
  31617. * @param instancePath 模型地址
  31618. * @param jsonPath JSON文件地址
  31619. */
  31620. setPBRMaterialFromJSON(instancePath, jsonPath): void
  31621. /**
  31622. * 取消所有实例的选中状态
  31623. */
  31624. setUnSelected(): void
  31625. /**
  31626. * 设置对象在哪个分屏窗口显示
  31627. * @param index 视口索引值,其范围为0~3
  31628. * @param visible 视口可见性
  31629. */
  31630. setVisibleInViewport(index: number, visible: boolean): void
  31631. /**
  31632. * Do not call this function directly.
  31633. */
  31634. update(frameState) : void
  31635. }
  31636. /**
  31637. * 布告板模式
  31638. */
  31639. export enum BillboardMode {
  31640. /**
  31641. * 贴地模式。即布告板贴在球面上
  31642. */
  31643. FixedXYZ,
  31644. /**
  31645. * 轴对齐模式。在这种模式下,布告板在水平方向上会跟着相机旋转,当相机位于布告板的正上方时,看到的就只是一条线, 即是说,这种模式下的布告板只能在水平分量上被选中
  31646. */
  31647. FixedZ,
  31648. /**
  31649. * 屏幕对齐模式。即是布告板会在任意方向上随着相机旋转,始终对着屏幕
  31650. */
  31651. None
  31652. }
  31653. /**
  31654. *
  31655. */
  31656. export class Style3D {
  31657. /**
  31658. * 获取或设置高度模式
  31659. */
  31660. altitudeMode : HeightReference
  31661. /**
  31662. * 获取或者设置billboard布告板的模式,目前支持贴地、屏幕对齐和轴对齐模式。如果在SuperMap桌面软件中生成S3M缓存时保留了该模式设置, 则WebGL端也支持
  31663. */
  31664. billboardMode : Number
  31665. /**
  31666. * 获取或设置底部高程
  31667. * @example
  31668. * var style3D = new Cesium.Style3D();
  31669. //设置底部高程。
  31670. style3D.bottomAltitude = 10;
  31671. //获取底部高程值。
  31672. var altitude = style3D.bottomAltitude;
  31673. */
  31674. bottomAltitude : Number
  31675. /**
  31676. * 设置或者获取牵引线的颜色
  31677. */
  31678. calloutColor : Color
  31679. /**
  31680. * 设置或者获取牵引线的宽度
  31681. */
  31682. calloutWidth : Number
  31683. /**
  31684. * 获取或者设置自发光体的颜色
  31685. */
  31686. emissionColor : Number
  31687. /**
  31688. * 获取或设置填充前景色
  31689. * @example
  31690. * var style3D = new Cesium.Style3D();
  31691. var color = new Cesium.Color(1.0, 0.0, 0.0);
  31692. //设置填充前景色。
  31693. style3D.fillForeColor = color;
  31694. //获取填充前景色。
  31695. var fillForeColor = style3D.fillForeColor;
  31696. */
  31697. fillForeColor : Color
  31698. /**
  31699. * 获取或者设置填充风格
  31700. */
  31701. fillStyle : Number
  31702. /**
  31703. * 设置或者获取图标的存储路径或数据的网络来源
  31704. */
  31705. image : String
  31706. /**
  31707. * 获取或者设置线颜色
  31708. */
  31709. lineColor : Number
  31710. /**
  31711. * 获取或者设置线宽
  31712. */
  31713. lineWidth : Number
  31714. /**
  31715. * 获取或者设置点的颜色
  31716. */
  31717. pointColor : Number
  31718. /**
  31719. * 获取或者设置点的尺寸
  31720. */
  31721. pointSize : Number
  31722. }